diff --git a/ChangeLog b/ChangeLog index 739419a0..fd6dd28f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,7 @@ - deprecated.h is now defined in terms of current functionality, rather than repeating stuff - im_flood() and friends rewritten, typically 4x faster +- removed --with-cimg option, added --disable-cxx 26/11/09 started 7.20.3 - updated en_GB.po translation diff --git a/Makefile.am b/Makefile.am index 7fe50f71..40658b4a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,8 +1,20 @@ -# only build in the python dir if we can + +# turn off libvipsCC if C++ is disabled +if ENABLE_CXX +C_COMPILE_DIR = libvipsCC +C_DIST_DIR = +C_PKGCONFIG = vipsCC-7.${IM_MINOR_VERSION}.pc + +# turn on Python if we can (requires C++) if HAVE_PYTHON P_COMPILE_DIR = swig P_DIST_DIR = +endif + else +C_COMPILE_DIR = +C_DIST_DIR = libvipsCC +C_PKGCONFIG = P_COMPILE_DIR = P_DIST_DIR = swig endif @@ -10,24 +22,25 @@ endif SUBDIRS = \ libvips \ tools \ - libvipsCC \ man \ po \ doc \ + $(C_COMPILE_DIR) \ $(P_COMPILE_DIR) EXTRA_DIST = \ m4 \ benchmark \ bootstrap.sh \ - vipsCC-7.${IM_MINOR_VERSION}.pc.in \ vips-7.${IM_MINOR_VERSION}.pc.in \ + vipsCC-7.${IM_MINOR_VERSION}.pc.in \ acinclude.m4 \ depcomp \ + $(C_DIST_DIR) \ $(P_DIST_DIR) pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = vips-7.${IM_MINOR_VERSION}.pc vipsCC-7.${IM_MINOR_VERSION}.pc +pkgconfig_DATA = vips-7.${IM_MINOR_VERSION}.pc $(C_PKGCONFIG) install-exec-hook: -rm -rf ${DESTDIR}$(datadir)/doc/vips diff --git a/TODO b/TODO index 27863c22..6334fbaa 100644 --- a/TODO +++ b/TODO @@ -1,6 +1,10 @@ - we sill have the old flood-fill code there, move to deprecated -- add a --without-cpp option? + should we have new API? we could have a single "im_floodfill" that allows + two inputs and has an "equals" param and junk im_flood(), im_flood_blob() + and im_flood_other() + +- what does G_UNLIKELY() do? can we use it? - rename vipsCC in SWIG as pyvips? diff --git a/configure.in b/configure.in index f1ca07af..2128a611 100644 --- a/configure.in +++ b/configure.in @@ -95,9 +95,25 @@ AC_C_RESTRICT AC_PROG_RANLIB AC_PROG_INSTALL AC_PROG_LN_S -AC_PROG_CXX AM_WITH_DMALLOC +# option to build without C++ +# handy for some embedded applications +# also, including C++ source causes link problems on some +# platforms, so have an option to disable it +AC_ARG_ENABLE(cxx, + AS_HELP_STRING([--enable-cxx], [build C++ components (default: enabled)])) + +if test x"$enable_cxx" != "xno"; then + AC_PROG_CXX + AC_DEFINE(ENABLE_CXX,1,[build C++ components]) + AM_CONDITIONAL(ENABLE_CXX, true) + enable_cxx=yes +else + AM_CONDITIONAL(ENABLE_CXX, false) + enable_cxx=no +fi + # we need a fully expanded version of $libdir # without this we get something like # define IM_LIBDIR ${exec_prefix}/lib @@ -437,9 +453,15 @@ AC_ARG_WITH([python], [build without Python bindings (default: test)])) if test x"$with_python" != "xno"; then - AM_PATH_PYTHON(2.2,, - [with_python=no - AC_MSG_WARN([Python not found; disabling Python binding])]) + if test x"$enable_cxx" = "xno"; then + # if C++ if off, we can't do Python + with_python=no + AC_MSG_WARN([C++ is off, disabling Python binding]) + else + AM_PATH_PYTHON(2.2,, + [with_python=no + AC_MSG_WARN([Python not found; disabling Python binding])]) + fi fi if test x"$with_python" != "xno"; then @@ -458,21 +480,6 @@ else AM_CONDITIONAL(HAVE_PYTHON, false) fi -# make CImg wrapper? including C++ source causes link problems on some -# platforms, so have an option to disable it -AC_ARG_WITH([cimg], - AS_HELP_STRING([--without-cimg], [build without CImg (default: with-cimg)])) - -if test x"$with_cimg" != "xno"; then - AM_CONDITIONAL(WITH_CIMG, true) - AC_DEFINE(WITH_CIMG,1,[include cimg package]) - with_cimg=yes -else - AM_CONDITIONAL(WITH_CIMG, false) - AC_MSG_WARN([disabling CImg binding]) - with_cimg=no -fi - # Gather all up for VIPS_CFLAGS, VIPS_INCLUDES and VIPS_LIBS # sort includes to get longer, more specific dirs first # helps, for example, selecting graphicsmagick over imagemagick @@ -547,6 +554,7 @@ AC_MSG_RESULT([ * general build options native win32: $vips_os_win32 open files in binary mode: $vips_binary_open +build C++ components: $enable_cxx evaluate with threads: $enable_threads make symlinks for commands in bin: $enable_links build docs with gtkdoc $enable_gtk_doc @@ -566,5 +574,4 @@ file import/export with libjpeg: $with_jpeg use libexif to load/save JPEG metadata: $with_libexif video capture with v4l: $with_v4l build Python binding: $with_python -build CImg wrapper: $with_cimg ]) diff --git a/libvips/Makefile.am b/libvips/Makefile.am index 478230e3..f611d2be 100644 --- a/libvips/Makefile.am +++ b/libvips/Makefile.am @@ -1,5 +1,5 @@ -# only build in the cimg dir if it's enabled -if WITH_CIMG +# only build in the cimg dir if C++ is enabled +if ENABLE_CXX C_COMPILE_DIR = cimg C_DIST_DIR = C_LIB = cimg/libcimg.la diff --git a/libvips/iofuncs/package.c b/libvips/iofuncs/package.c index 77147af9..7d73ab85 100644 --- a/libvips/iofuncs/package.c +++ b/libvips/iofuncs/package.c @@ -546,9 +546,9 @@ static im_package im__iofuncs = { static im_package *built_in[] = { &im__arithmetic, &im__boolean, -#ifdef WITH_CIMG +#ifdef ENABLE_CXX &im__cimg, -#endif /*WITH_CIMG*/ +#endif /*ENABLE_CXX*/ &im__colour, &im__conversion, &im__convolution, diff --git a/libvips/resample/Makefile.am b/libvips/resample/Makefile.am index 2c6f6dfc..4985f70f 100644 --- a/libvips/resample/Makefile.am +++ b/libvips/resample/Makefile.am @@ -1,18 +1,37 @@ +# only build the C++ stuff if it's enabled +if ENABLE_CXX +C_SOURCES = \ + bicubic.cpp \ + yafrsmooth.cpp \ + nohalo1.cpp \ + snohalo1.cpp \ + nohalo2.cpp \ + templates.h +C_DIST = +else +C_SOURCES = +C_DIST = \ + bicubic.cpp \ + yafrsmooth.cpp \ + nohalo1.cpp \ + snohalo1.cpp \ + nohalo2.cpp \ + templates.h +endif + noinst_LTLIBRARIES = libresample.la libresample_la_SOURCES = \ im_affine.c \ - bicubic.cpp \ interpolate.c \ - yafrsmooth.cpp \ im_shrink.c \ im_stretch3.c \ im_rightshift_size.c \ - nohalo1.cpp \ - snohalo1.cpp \ - nohalo2.cpp \ - templates.h \ transform.c \ - resample_dispatch.c + resample_dispatch.c \ + $(C_SOURCES) + +EXTRA_DIST = \ + $(C_DIST) INCLUDES = -I${top_srcdir}/libvips/include @VIPS_CFLAGS@ @VIPS_INCLUDES@ diff --git a/libvips/resample/interpolate.c b/libvips/resample/interpolate.c index 07e97f99..42b8677c 100644 --- a/libvips/resample/interpolate.c +++ b/libvips/resample/interpolate.c @@ -504,11 +504,14 @@ vips__interpolate_init( void ) vips_interpolate_nearest_get_type(); vips_interpolate_bilinear_get_type(); + +#ifdef ENABLE_CXX vips_interpolate_bicubic_get_type(); vips_interpolate_yafrsmooth_get_type(); vips_interpolate_nohalo1_get_type(); vips_interpolate_snohalo1_get_type(); vips_interpolate_nohalo2_get_type(); +#endif /*ENABLE_CXX*/ } /* Make an interpolator from a nickname. diff --git a/tools/iofuncs/Makefile.am b/tools/iofuncs/Makefile.am index 577daac1..f2cb6e45 100644 --- a/tools/iofuncs/Makefile.am +++ b/tools/iofuncs/Makefile.am @@ -14,8 +14,7 @@ LDADD = @VIPS_CFLAGS@ ${top_builddir}/libvips/libvips.la @VIPS_LIBS@ if ENABLE_LINKS install-exec-hook: ${top_srcdir}/src/scripts/post_install ${DESTDIR}${bindir} -endif - uninstall-hook: ${RM} ${bindir}/im_* +endif