3 # -- I N I T --------------------------------------------------
5 AC_INIT([Synfig Core],[0.62.01RC4],[http://synfig.org/Bugs],[synfig])
8 AC_CONFIG_AUX_DIR(config)
9 AC_CONFIG_HEADERS([config.h])
11 dnl AC_CANONICAL_TARGET
13 AM_INIT_AUTOMAKE([nostdinc])
16 AC_LIBLTDL_CONVENIENCE
23 AC_DEFINE(LT_SCOPE,[extern],[LibLTDL is linked staticly])
28 # -- V A R I A B L E S ----------------------------------------
30 SVN_REPOSITORY=https://synfig.svn.sourceforge.net/svnroot/synfig/synfig-core
31 AC_SUBST(SVN_REPOSITORY)
34 # -- P R O G R A M S ------------------------------------------
48 # -- A R G U M E N T S ----------------------------------------
56 AC_ARG_BRANCH_PROBABILITIES
59 --enable-g5opt enable optimizations specific to G5 proc],[
60 # CXXFLAGS="$CXXFLAGS -fastf -fPIC"
61 # CFLAGS="$CFLAGS -fastf -fPIC"
62 CXXFLAGS="$CXXFLAGS -mtune=G5 -falign-loops=32"
63 CFLAGS="$CFLAGS -mtune=G5"
69 #MINGW_FLAGS="-mno-cygwin"
73 # If we are in debug mode, use the debugging version of the
74 # Microsoft Visual C Runtime Library
75 #if [[ $debug = "yes" ]] ; then {
76 # WIN32_DEBUG_LIBRARY="msvcr70d"
77 # WIN32_DEBUG_LIBRARY="msvcrtd"
78 # LIBTOOL_PATCH_SED="$LIBTOOL_PATCH_SED
79 # s/-lmsvcrt/-l$WIN32_DEBUG_LIBRARY/g;
88 AC_SUBST(LIBTOOL_DEPS)
91 #if [[ "$LIBTOOL_PATCH_SED""x" != "x" ]] ; then {
92 # printf "Patching libtool... "
93 # cat libtool | sed "$LIBTOOL_PATCH_SED" > libtool2
97 # AC_MSG_RESULT([patched])
104 AC_CHECK_LIB(c, dlopen,
109 DYNAMIC_LD_LIBS="-ldl",
114 AC_SUBST(DYNAMIC_LD_LIBS)
117 --enable-half Use OpenEXR's "half" type for color],[
118 use_openexr_half=$enableval
121 use_openexr_half="no"
126 AC_ARG_ENABLE(layer-profiling,[
127 --enable-layer-profiling Enable layer profiling],[
128 use_layerprofiling=$enableval
131 use_layerprofiling="no"
133 if test $use_layerprofiling = "yes" ; then {
134 AC_DEFINE(SYNFIG_PROFILE_LAYERS,[1],[enable layer profiling])
140 AC_ARG_WITH(imagemagick,[
141 --without-imagemagick Disable support for ImageMagick],[
143 AC_CHECK_PROG([imagemagick_convert],[convert],[yes],[no])
144 with_imagemagick=$imagemagick_convert
146 if test $with_imagemagick = "no" ; then {
147 AM_CONDITIONAL(WITH_IMAGEMAGICK,false)
149 AM_CONDITIONAL(WITH_IMAGEMAGICK,true)
156 AC_ARG_WITH(magickpp,[
157 --without-magickpp Disable support for Magick++],[
161 if test $with_magickpp = "yes" ; then {
162 AC_CHECK_HEADER([Magick++.h],[
163 MAGICKPP_LIBS="-lMagick++"
164 AC_DEFINE(HAVE_MAGICKPP,[], [ Define if Magick++ library is available ] )
165 AC_SUBST(MAGICKPP_LIBS)
166 AM_CONDITIONAL(HAVE_LIBMAGICKPP,true)
167 AC_CHECK_LIB(Magick,OptimizeImageTransparency,[
168 AC_DEFINE(HAVE_MAGICK_OPTIMIZE,[], [ Define if Magick++ defines OptimizeImageTransparency() ] )
169 AM_CONDITIONAL(HAVE_MAGICK_OPTIMIZE,true)
171 AC_MSG_RESULT([ *** OptimizeImageTransparency() not available - need ImageMagick 6.3 or newer ])
172 AM_CONDITIONAL(HAVE_MAGICK_OPTIMIZE,false)
176 AC_MSG_RESULT([ *** Magick++ Output target disabled])
178 AM_CONDITIONAL(HAVE_LIBMAGICKPP,false)
179 AM_CONDITIONAL(HAVE_MAGICK_OPTIMIZE,false)
182 AM_CONDITIONAL(HAVE_LIBMAGICKPP,false)
183 AM_CONDITIONAL(HAVE_MAGICK_OPTIMIZE,false)
190 --without-ffmpeg Disable support for FFMPEG],[
194 if test $with_ffmpeg = "no" ; then {
195 AM_CONDITIONAL(WITH_FFMPEG,false)
197 AM_CONDITIONAL(WITH_FFMPEG,true)
204 --with-vimage Enable support for apple vImage],[
208 if test $with_vimage = "no" ; then {
209 AM_CONDITIONAL(WITH_VIMAGE,false)
211 AM_CONDITIONAL(WITH_VIMAGE,true)
212 AC_DEFINE(HAS_VIMAGE,[1],[enable apple vImage])
213 VIMAGE_LIBS="-Wc,-framework -Wc,Accelerate"
220 --without-libdv Disable support for libdv],[
224 if test $with_libdv = "no" ; then {
225 AM_CONDITIONAL(WITH_LIBDV,false)
227 AM_CONDITIONAL(WITH_LIBDV,true)
233 # LIBAVCODEC CHECK--------------------
235 AC_ARG_WITH(libavcodec,[
236 --with-libavcodec Enable support for libavcodec (Default=no)],[
241 if test $with_libavcodec != "no" ; then {
242 PKG_CHECK_MODULES(LIBAVCODEC, [libavcodec libavformat],[],[echo no; with_libavcodec="no"])
244 if test $with_libavcodec = "yes" ; then {
245 AC_DEFINE(WITH_LIBAVCODEC,[],[enable libavcodec support])
246 AM_CONDITIONAL(WITH_LIBAVCODEC,true)
248 AM_CONDITIONAL(WITH_LIBAVCODEC,false)
252 if test $with_libavcodec = "yes" ; then {
254 # Need to check both the new and old locations for the avformat header
255 # Need to save flags, add avformat flags, check headers and restore flags
256 ac_save_CPPFLAGS="$CPPFLAGS"
257 ac_save_CFLAGS="$CFLAGS"
258 CPPFLAGS="${CPPFLAGS} ${LIBAVCODEC_CFLAGS}"
259 CFLAGS="${CFLAGS} ${LIBAVCODEC_CFLAGS}"
260 AC_CHECK_HEADERS(libavformat/avformat.h avformat.h ffmpeg/avformat.h)
261 CPPFLAGS="${ac_save_CPPFLAGS}"
262 CFLAGS="${ac_save_CFLAGS}"
264 AC_ARG_WITH(libswscale,
265 [AS_HELP_STRING([--without-libswscale],
266 [disable support for libswscale (Default=auto)])],
268 [with_libswscale="yes"]
271 if test $with_libswscale != "no" ; then {
272 PKG_CHECK_MODULES(LIBSWSCALE, [libswscale], [], [echo no; with_libswscale="no"])
275 if test $with_libswscale = "yes" ; then {
276 AC_DEFINE(WITH_LIBSWSCALE, [], [enable libswscale support])
278 # Need to check both the new and old locations for the swscale header
279 # Need to save flags, add swscale flags, check headers and restore flags
280 ac_save_CPPFLAGS="$CPPFLAGS"
281 ac_save_CFLAGS="$CFLAGS"
282 CPPFLAGS="${CPPFLAGS} ${LIBSWSCALE_CFLAGS}"
283 CFLAGS="${CFLAGS} ${LIBSWSCALE_CFLAGS}"
284 AC_CHECK_HEADERS(libswscale/swscale.h swscale.h ffmpeg/swscale.h)
285 CPPFLAGS="${ac_save_CPPFLAGS}"
286 CFLAGS="${ac_save_CFLAGS}"
288 AC_CHECK_LIB(avcodec, img_convert,
289 [AC_MSG_RESULT([ *** Using deprecated function img_convert.])],
290 [AC_MSG_FAILURE([Neither libswscale nor function img_convert was found.])],
295 AM_CONDITIONAL(WITH_LIBSWSCALE, test "x$with_libswscale" = "xyes")
298 # FREETYPE2 CHECK--------------------
300 AC_ARG_WITH(freetype,[
301 --without-freetype disable support for freetype (Default=auto)],[
306 if test $with_freetype != "no" ; then {
307 PKG_CHECK_MODULES(FREETYPE, freetype2,[
310 PKG_CHECK_MODULES(FREETYPE, xft,[
318 if test $with_freetype = "no" ; then {
319 AM_CONDITIONAL(WITH_FREETYPE,false)
321 AM_CONDITIONAL(WITH_FREETYPE,true)
325 # FONTCONFIG CHECK--------------------
327 AC_ARG_WITH(fontconfig,[
328 --without-fontconfig disable support for fontconfig (Default=auto)],[
330 with_fontconfig="yes"
333 if test $with_fontconfig != "no" ; then {
334 PKG_CHECK_MODULES(FONTCONFIG, fontconfig,[
335 with_fontconfig="yes"
341 if test $with_fontconfig = "yes" ; then {
342 AC_DEFINE(WITH_FONTCONFIG,[],[enable fontconfig support])
343 AM_CONDITIONAL(WITH_FONTCONFIG,true)
345 AM_CONDITIONAL(WITH_FONTCONFIG,false)
349 # OPENEXR CHECK------------------------
350 AC_ARG_WITH(openexr,[
351 --without-openexr Disable support for ILM's OpenEXR],[
355 if test $with_openexr = "yes" ; then {
356 PKG_CHECK_MODULES(OPENEXR, OpenEXR,[
357 AC_DEFINE(HAVE_OPENEXR,[], [ Define if OpenEXR is available ] )
358 AM_CONDITIONAL(WITH_OPENEXR,true)
364 if test $with_openexr = "no" ; then {
365 AM_CONDITIONAL(WITH_OPENEXR,false)
366 use_openexr_half="no"
368 if test $use_openexr_half = yes ; then {
369 AC_MSG_RESULT([ ** Using OpenEXR Half.])
370 CONFIG_DEPS="$CONFIG_DEPS OpenEXR"
371 CONFIG_CFLAGS="$CONFIG_CFLAGS -DUSE_HALF_TYPE"
372 OPENEXR_HALF_LIBS="-lHalf"
378 # JPEG CHECK (commandline switch) ------------------------
380 --without-jpeg Disable support for JPEG],[
384 if test $with_jpeg = "no" ; then {
385 AM_CONDITIONAL(WITH_JPEG,false)
387 AM_CONDITIONAL(WITH_JPEG,true)
394 # -- L I B R A R I E S ----------------------------------------
398 ALL_LINGUAS="es fr it ru"
399 AM_GNU_GETTEXT([external])
400 # This is here so autoreconf will run autopoint
401 AM_GNU_GETTEXT_VERSION([0.15])
402 localedir="$datadir/locale"
404 PKG_CHECK_MODULES(ETL, [ETL >= 0.04.13],,[
405 AC_MSG_ERROR([ ** You need to install the ETL (version 0.04.13 or greater).])
407 CONFIG_DEPS="$CONFIG_DEPS ETL"
410 PKG_CHECK_MODULES(LIBXMLPP, libxml++-2.6,[
411 CONFIG_DEPS="$CONFIG_DEPS libxml++-2.6"
413 PKG_CHECK_MODULES(LIBXMLPP, libxml++-1.0,[
414 CONFIG_DEPS="$CONFIG_DEPS libxml++-1.0"
416 AC_MSG_ERROR([ ** You need to install libxml++, either verison 2.6 or 1.0.])
420 PKG_CHECK_MODULES(LIBSIGC, [sigc++-2.0],,[
421 AC_MSG_ERROR([ ** libsigc++-2.0 not found. It is required. You should really install it.])
422 dnl PKG_CHECK_MODULES(LIBSIGC, [sigc++-1.2],,[
423 dnl AC_MSG_ERROR([ ** At least libsigc++-1.2 is required.])
426 CONFIG_DEPS="$CONFIG_DEPS sigc++-2.0"
428 dnl PKG_CHECK_MODULES(GLIB, glib-2.0,[GLIB="yes"],[GLIB="no"])
437 AC_CHECK_LIB(png, png_write_row,[
439 AC_DEFINE(HAVE_LIBPNG,[], [ Define if PNG library is available ] )
441 AM_CONDITIONAL(HAVE_LIBPNG,true)
443 AC_CHECK_LIB(png12, png_write_row,[
445 AC_DEFINE(HAVE_LIBPNG,[])
447 AM_CONDITIONAL(HAVE_LIBPNG,true)
449 AC_MSG_RESULT([ *** PNG Output target disabled])
451 AM_CONDITIONAL(HAVE_LIBPNG,false)
452 ],[-lz -L${exec_prefix}/lib])
453 ],[-lz -L${exec_prefix}/lib])
455 AC_CHECK_LIB(mng, mng_initialize,[
457 AC_DEFINE(HAVE_LIBMNG,[], [ Define if MNG library is available ] )
459 AM_CONDITIONAL(HAVE_LIBMNG,true)
461 AC_MSG_RESULT([ *** MNG Output target disabled])
463 AM_CONDITIONAL(HAVE_LIBMNG,false)
464 ],[-lz -L${exec_prefix}/lib])
466 # check for JPEG availability
467 if test $with_jpeg = "yes" ; then {
468 AC_CHECK_LIB(jpeg, jpeg_CreateCompress,[
470 AC_DEFINE(HAVE_LIBJPEG,[], [ Define if JPEG library is available ] )
473 AM_CONDITIONAL(HAVE_LIBJPEG,true)
475 AC_MSG_RESULT([ *** JPEG Output target disabled])
477 AM_CONDITIONAL(HAVE_LIBJPEG,false)
482 AC_MSG_RESULT([ *** JPEG Output target disabled])
484 AM_CONDITIONAL(HAVE_LIBJPEG,false)
489 MODULE_DIR='${libdir}/synfig/modules'
490 moduledir=$libdir/synfig/modules
492 SYNFIGLIB_DIR=$libdir/synfig
493 AC_SUBST(SYNFIGLIB_DIR)
495 # Check for unordered_map or hash_map headers
496 AC_MSG_CHECKING([for unordered_map<int,int>::const_iterator])
499 [#include <tr1/unordered_map>]
501 [std::tr1::unordered_map<int,int>::const_iterator iter;]
504 AC_DEFINE([HASH_MAP_CLASS],[HASH_MAP_NAMESPACE::unordered_map],[The template name for unordered maps.])
505 AC_DEFINE([HASH_MAP_H],[<tr1/unordered_map>],[The header file to include for unordered maps.])
506 AC_DEFINE([HASH_MAP_NAMESPACE],[std::tr1],[The namespace for unordered maps.])
507 AC_DEFINE([FUNCTIONAL_H],[<tr1/functional>],[The header file for hash<T>.])
508 AC_DEFINE([FUNCTIONAL_HASH_ON_STRING],[1],[Define to 1 if hash<T> needs to use T=String rather than T=char* to hash strings.])
511 AC_CHECK_HEADERS([ext/hash_map],[
512 AC_DEFINE([HASH_MAP_CLASS],[HASH_MAP_NAMESPACE::hash_map],[The template name for unordered maps.])
513 AC_DEFINE([HASH_MAP_H],[<ext/hash_map>],[The header file to include for unordered maps.])
514 AC_DEFINE([HASH_MAP_NAMESPACE],[__gnu_cxx],[The namespace for unordered maps.])
515 AC_DEFINE([FUNCTIONAL_H],[<ext/functional>],[The header file for hash<T>.])
517 AC_MSG_ERROR([C++ compiler does not seem to support unordered containers])
521 # Check for unordered_set or hash_set headers
522 AC_MSG_CHECKING([for unordered_set<int,int>::const_iterator])
525 [#include <tr1/unordered_set>]
527 [std::tr1::unordered_set<int,int>::const_iterator iter;]
530 AC_DEFINE([HASH_SET_CLASS],[HASH_SET_NAMESPACE::unordered_set],[The template name for unordered sets.])
531 AC_DEFINE([HASH_SET_H],[<tr1/unordered_set>],[The header file to include for unordered sets.])
532 AC_DEFINE([HASH_SET_NAMESPACE],[std::tr1],[The namespace for unordered sets.])
535 AC_CHECK_HEADERS([ext/hash_set],[
536 AC_DEFINE([HASH_SET_CLASS],[HASH_SET_NAMESPACE::hash_set],[The template name for unordered sets.])
537 AC_DEFINE([HASH_SET_H],[<ext/hash_set>],[The header file to include for unordered sets.])
538 AC_DEFINE([HASH_SET_NAMESPACE],[__gnu_cxx],[The namespace for unordered sets.])
540 AC_MSG_ERROR([C++ compiler does not seem to support unordered containers])
548 AC_CHECK_HEADERS(signal.h termios.h sys/errno.h)
553 AM_CONDITIONAL(WIN32_PKG, true)
554 AM_CONDITIONAL(MACOSX_PKG, false)
557 AM_CONDITIONAL(WIN32_PKG, false)
558 AM_CONDITIONAL(MACOSX_PKG, true)
561 AM_CONDITIONAL(WIN32_PKG, false)
562 AM_CONDITIONAL(MACOSX_PKG, false)
568 # -- H E A D E R S --------------------------------------------
571 AC_CHECK_HEADERS([process.h io.h fcntl.h])
573 # -- T Y P E S & S T R U C T S --------------------------------
575 # -- F U N C T I O N S ----------------------------------------
577 dnl AC_CHECK_FUNCS([floor pow sqrt],[],[
578 dnl AC_MSG_ERROR([ ** Could not find proper math functions.])
581 AC_CHECK_FUNCS([fork])
582 AC_CHECK_FUNCS([kill])
583 AC_CHECK_FUNCS([pipe])
584 AC_CHECK_FUNCS([waitpid])
616 AC_CHECK_LIB([pthread],[pthread_create])
618 # -- O U T P U T ----------------------------------------------
625 # AC_CONFIG_SUBDIRS(libltdl) is required for libtool 1.5.26 but must not be present for
626 # libtool 2.2.4. Problem seems to be that AC_LIB_LTDL (above) now calls AC_CONFIG_SUBDIRS
627 # itself, through LTDL_INIT, _LTDL_SETUP, _LTDL_MODE_DISPATCH. We need to check the
628 # condition that libltdl has already been registered with AC_CONFIG_SUBDIRS:
629 m4_ifdef([_AC_SEEN_TAG(libltdl)], [], [AC_CONFIG_SUBDIRS(libltdl)])
631 CONFIG_LIBS="-lsynfig"
632 CONFIG_CFLAGS="$CONFIG_CFLAGS"
633 AC_SUBST(CONFIG_LIBS)
634 AC_SUBST(CONFIG_CFLAGS)
635 AC_SUBST(CONFIG_DEPS)
638 SYNFIG_LIBS="$VIMAGE_LIBS $LIBXMLPP_LIBS $ETL_LIBS $LIBSIGC_LIBS $LTLIBINTL"
639 SYNFIG_CFLAGS="$LIBXMLPP_CFLAGS $ETL_CFLAGS $LIBSIGC_CFLAGS $CONFIG_CFLAGS -DSYNFIG_NO_DEPRECATED -DLOCALEDIR=\\\"$localedir\\\""
641 CONFIG_CFLAGS="`echo $CONFIG_CFLAGS | sed s/-mno-cygwin//g | sed s/-mwindows//g`"
642 SYNFIG_CFLAGS="`echo $SYNFIG_CFLAGS | sed s/-mno-cygwin//g | sed s/-mwindows//g`"
643 SYNFIG_LIBS="`echo $SYNFIG_LIBS | sed s/-mno-cygwin//g | sed s/-mwindows//g`"
647 AC_SUBST(SYNFIG_LIBS)
648 AC_SUBST(SYNFIG_CFLAGS)
649 AC_SUBST(OPENEXR_HALF_LIBS)
651 AC_SUBST(API_VERSION)
653 synfigincludedir=$includedir/synfig-$API_VERSION
654 AC_SUBST(synfigincludedir)
656 AC_CONFIG_FILES([synfig-config
665 src/modules/lyr_freetype/Makefile
666 src/modules/lyr_std/Makefile
667 src/modules/mod_bmp/Makefile
668 src/modules/mod_dv/Makefile
669 src/modules/mod_ffmpeg/Makefile
670 src/modules/mod_filter/Makefile
671 src/modules/mod_geometry/Makefile
672 src/modules/mod_gif/Makefile
673 src/modules/mod_gradient/Makefile
674 src/modules/mod_imagemagick/Makefile
675 src/modules/mod_jpeg/Makefile
676 src/modules/mod_libavcodec/Makefile
677 src/modules/mod_magickpp/Makefile
678 src/modules/mod_mng/Makefile
679 src/modules/mod_noise/Makefile
680 src/modules/mod_openexr/Makefile
681 src/modules/mod_particle/Makefile
682 src/modules/mod_png/Makefile
683 src/modules/mod_ppm/Makefile
684 src/modules/mod_yuv420p/Makefile
685 src/modules/mod_svg/Makefile
686 src/modules/example/Makefile
688 src/modules/synfig_modules.cfg
689 examples/walk/Makefile
692 pkg-info/macosx/synfig-core.info
694 ## src/modules/trgt_mpg/Makefile
695 ## src/modules/mptr_mplayer/Makefile
698 # -- S U M M A R Y --------------------------------------------
701 $PACKAGE_NAME v.$VERSION
702 Configuration Summary
705 Install Prefix -------------------> $prefix
706 Module directory -----------------> $moduledir
707 Build Platform -------------------> $build
708 Host Platform --------------------> $host
709 Arc Profiling --------------------> $profile_arcs
710 GProf Profiling ------------------> $profiling
711 Debug Mode -----------------------> $debug ($debug_flags)
712 Optimization ---------------------> $optimization
713 PNG output target support --------> $TARGET_PNG
714 MNG output target support --------> $TARGET_MNG
715 JPEG output target support -------> $TARGET_JPEG
716 ETL_CFLAGS -----------------------> $ETL_CFLAGS
717 FreeType2 ------------------------> $with_freetype
718 fontconfig -----------------------> $with_fontconfig
719 libavcodec -----------------------> $with_libavcodec
720 libswscale -----------------------> $with_libswscale
721 vImage ---------------------------> $with_vimage
722 ImageMagick ----------------------> $with_imagemagick
723 Magick++ -------------------------> $with_magickpp
724 FFMPEG ---------------------------> $with_ffmpeg
725 libdv ----------------------------> $with_libdv
726 OpenEXR --------------------------> $with_openexr
727 Using OpenEXR's \"half\" type ------> $use_openexr_half
729 "'$'"CXX -----------------------------> '$CXX'
730 "'$'"CXXFLAGS ------------------------> '$CXXFLAGS'
731 "'$'"SYNFIG_LIBS ---------------------> '$SYNFIG_LIBS'
732 "'$'"LIBXMLPP_LIBS -------------------> '$LIBXMLPP_LIBS'
733 "'$'"ETL_LIBS ------------------------> '$ETL_LIBS'
734 "'$'"LIBSIGC_LIBS --------------------> '$LIBSIGC_LIBS'
735 "'$'"SYNFIG_CFLAGS -------------------> '$SYNFIG_CFLAGS'
736 "'$'"LIBADD_DL -----------------------> '$LIBADD_DL'