Typo.
[synfig.git] / synfig-core / trunk / configure.ac
1 # $Id$
2
3 # -- I N I T --------------------------------------------------
4
5 AC_INIT([Synfig Core],[0.61.07],[http://sourceforge.net/tracker/?group_id=144022&atid=757416],[synfig])
6 AC_REVISION
7
8 AC_CONFIG_AUX_DIR(config)
9 AM_CONFIG_HEADER(config.h)
10 AC_CANONICAL_HOST
11 dnl AC_CANONICAL_TARGET
12
13 AM_INIT_AUTOMAKE([nostdinc])
14 AM_MAINTAINER_MODE
15
16 AC_LIBLTDL_CONVENIENCE
17 AC_SUBST(INCLTDL)
18 AC_SUBST(LIBLTDL)
19
20 API_VERSION=0.0
21
22
23 AC_DEFINE(LT_SCOPE,[extern],[LibLTDL is linked staticly])       
24
25
26
27
28 # -- V A R I A B L E S ----------------------------------------
29
30 SVN_REPOSITORY=http://svn.voria.com/code/synfig-core
31 AC_SUBST(SVN_REPOSITORY)
32
33 # -- P R O G R A M S ------------------------------------------
34
35 AC_PROG_CC
36 AC_GNU_SOURCE
37 AC_PROG_CXX
38 AC_PROG_CPP
39 AC_PROG_CXXCPP
40 AC_PROG_INSTALL
41
42 AC_LANG_CPLUSPLUS
43
44
45 # -- A R G U M E N T S ----------------------------------------
46
47
48 AC_ARG_TIMELIMIT
49 AC_ARG_DEBUG
50 AC_ARG_OPTIMIZATION
51 AC_ARG_WARNINGS
52 AC_ARG_PROFILING
53 AC_ARG_PROFILE_ARCS
54 AC_ARG_BRANCH_PROBABILITIES
55 dnl AC_ARG_LICENSE_KEY
56
57 AC_ARG_ENABLE(g5opt,[
58   --enable-g5opt           enable optimizations specific to G5 proc],[
59 #       CXXFLAGS="$CXXFLAGS -fastf -fPIC"
60 #       CFLAGS="$CFLAGS -fastf -fPIC"
61         CXXFLAGS="$CXXFLAGS -mtune=G5 -falign-loops=32"
62         CFLAGS="$CFLAGS -mtune=G5"
63 ],
64 [
65         true
66 ])
67
68 #MINGW_FLAGS="-mno-cygwin"
69
70 AC_WIN32_QUIRKS
71
72 # If we are in debug mode, use the debugging version of the
73 # Microsoft Visual C Runtime Library
74 #if [[ $debug = "yes" ]] ; then {
75 #       WIN32_DEBUG_LIBRARY="msvcr70d"
76 #       WIN32_DEBUG_LIBRARY="msvcrtd"
77 #       LIBTOOL_PATCH_SED="$LIBTOOL_PATCH_SED
78 #               s/-lmsvcrt/-l$WIN32_DEBUG_LIBRARY/g;
79 #       ";
80 #} ; fi
81
82 AC_LIBTOOL_WIN32_DLL
83 AC_LIBTOOL_DLOPEN
84 AC_DISABLE_STATIC
85 AC_ENABLE_SHARED
86 AC_PROG_LIBTOOL
87 AC_SUBST(LIBTOOL_DEPS)
88 AC_LIBTOOL_PATCH
89
90 #if [[ "$LIBTOOL_PATCH_SED""x" != "x" ]] ; then {
91 #       printf "Patching libtool... "
92 #       cat libtool | sed "$LIBTOOL_PATCH_SED" > libtool2
93 #       rm libtool
94 #       mv libtool2 libtool
95 #       chmod +x libtool
96 #       AC_MSG_RESULT([patched])
97 #} fi ;
98
99
100 dnl
101 dnl dynamic linker
102 dnl
103 AC_CHECK_LIB(c, dlopen,
104         DYNAMIC_LD_LIBS="",
105         AC_CHECK_LIB(
106                 dl,
107                 dlopen,
108         DYNAMIC_LD_LIBS="-ldl",
109             DYNAMIC_LD_LIBS=""
110         )
111 )
112
113 AC_SUBST(DYNAMIC_LD_LIBS)
114
115 AC_ARG_ENABLE(half,[
116   --enable-half           Use OpenEXR's "half" type for color],[
117         use_openexr_half=$enableval
118 ],
119 [
120         use_openexr_half="no"
121 ])
122
123
124
125 AC_ARG_ENABLE(layer-profiling,[
126   --enable-layer-profiling       Enable layer profiling],[
127         use_layerprofiling=$enableval
128 ],
129 [
130         use_layerprofiling="no"
131 ])
132 if test $use_layerprofiling = "yes" ; then {
133         AC_DEFINE(SYNFIG_PROFILE_LAYERS,[1],[enable layer profiling])   
134 } ; fi
135
136
137
138
139 AC_ARG_WITH(imagemagick,[
140   --without-imagemagick   Disable support for ImageMagick],[
141 ],[
142     AC_CHECK_PROG([imagemagick_convert],[convert],[yes],[no])
143     with_imagemagick=$imagemagick_convert
144 ])
145 if test $with_imagemagick = "no" ; then {
146         AM_CONDITIONAL(WITH_IMAGEMAGICK,false)
147 } else {
148         AM_CONDITIONAL(WITH_IMAGEMAGICK,true)
149 } ; fi
150
151
152
153
154
155 AC_ARG_WITH(magickpp,[
156   --without-magickpp        Disable support for Magick++],[
157 ],[
158         with_magickpp="yes"
159 ])
160 if test $with_magickpp = "yes" ; then {
161   AC_CHECK_HEADER([Magick++.h],[
162         MAGICKPP_LIBS="-lMagick++"
163         AC_DEFINE(HAVE_MAGICKPP,[], [ Define if Magick++ library is available ] )
164         AC_SUBST(MAGICKPP_LIBS)
165         AM_CONDITIONAL(HAVE_LIBMAGICKPP,true)
166         AC_CHECK_LIB(Magick,OptimizeImageTransparency,[
167                 AC_DEFINE(HAVE_MAGICK_OPTIMIZE,[], [ Define if Magick++ defines OptimizeImageTransparency() ] )
168                 AM_CONDITIONAL(HAVE_MAGICK_OPTIMIZE,true)
169         ],[
170                 AC_MSG_RESULT([ *** OptimizeImageTransparency() not available - need ImageMagick 6.3 or newer ])
171                 AM_CONDITIONAL(HAVE_MAGICK_OPTIMIZE,false)
172         ])
173   ],[
174         with_magickpp="no"
175         AC_MSG_RESULT([ *** Magick++ Output target disabled])
176         TARGET_MAGICKPP="no"
177         AM_CONDITIONAL(HAVE_LIBMAGICKPP,false)
178         AM_CONDITIONAL(HAVE_MAGICK_OPTIMIZE,false)
179   ])
180 } else {
181         AM_CONDITIONAL(HAVE_LIBMAGICKPP,false)
182         AM_CONDITIONAL(HAVE_MAGICK_OPTIMIZE,false)
183 } ; fi
184
185
186
187
188 AC_ARG_WITH(ffmpeg,[
189   --without-ffmpeg        Disable support for FFMPEG],[
190 ],[
191         with_ffmpeg="yes"
192 ])
193 if test $with_ffmpeg = "no" ; then {
194         AM_CONDITIONAL(WITH_FFMPEG,false)
195 } else {
196         AM_CONDITIONAL(WITH_FFMPEG,true)
197 } ; fi
198
199
200
201
202 AC_ARG_WITH(vimage,[
203   --with-vimage        Enable support for apple vImage],[
204 ],[
205         with_vimage="no"
206 ])
207 if test $with_vimage = "no" ; then {
208         AM_CONDITIONAL(WITH_VIMAGE,false)
209 } else {
210         AM_CONDITIONAL(WITH_VIMAGE,true)
211         AC_DEFINE(HAS_VIMAGE,[1],[enable apple vImage])
212         VIMAGE_LIBS="-Wc,-framework -Wc,Accelerate"
213
214 } ; fi
215
216
217
218 AC_ARG_WITH(libdv,[
219   --without-libdv         Disable support for libdv],[
220 ],[
221         with_libdv="yes"
222 ])
223 if test $with_libdv = "no" ; then {
224         AM_CONDITIONAL(WITH_LIBDV,false)
225 } else {
226         AM_CONDITIONAL(WITH_LIBDV,true)
227 } ; fi
228
229
230
231
232 # LIBAVCODEC CHECK--------------------
233
234 AC_ARG_WITH(libavcodec,[
235   --without-libavcodec         disable support for libavcodec (Default=auto)],[
236 ],[
237         with_libavcodec="yes"
238 ])
239
240 if test $with_libavcodec != "no" ; then {
241         PKG_CHECK_MODULES(LIBAVCODEC, [libavcodec libavformat],[],[echo no; with_libavcodec="no"])
242 } ; fi
243 if test $with_libavcodec = "yes" ; then {
244         AC_DEFINE(WITH_LIBAVCODEC,[],[enable libavcodec support])
245         AM_CONDITIONAL(WITH_LIBAVCODEC,true)
246 } else {
247         AM_CONDITIONAL(WITH_LIBAVCODEC,false)
248 } ; fi
249
250
251
252 # FREETYPE2 CHECK--------------------
253
254 AC_ARG_WITH(freetype,[
255   --without-freetype         disable support for freetype (Default=auto)],[
256 ],[
257         with_freetype="yes"
258 ])
259
260 if test $with_freetype != "no" ; then {
261         PKG_CHECK_MODULES(FREETYPE, freetype2,[
262                 with_freetype="yes"
263         ],[
264                 PKG_CHECK_MODULES(FREETYPE, xft,[
265                         with_freetype="yes"
266                 ],[
267                         with_freetype="no"
268                 ])
269         ])
270 } ; fi
271
272 if test $with_freetype = "no" ; then {
273         AM_CONDITIONAL(WITH_FREETYPE,false)
274 } else {
275         AM_CONDITIONAL(WITH_FREETYPE,true)
276 } ; fi
277
278
279 # FONTCONFIG CHECK--------------------
280
281 AC_ARG_WITH(fontconfig,[
282   --without-fontconfig         disable support for fontconfig (Default=auto)],[
283 ],[
284         with_fontconfig="yes"
285 ])
286
287 if test $with_fontconfig != "no" ; then {
288         PKG_CHECK_MODULES(FONTCONFIG, fontconfig,[
289                 with_fontconfig="yes"
290         ],[
291                 with_fontconfig="no"
292         ])
293 } ; fi
294
295 if test $with_fontconfig = "yes" ; then {
296         AC_DEFINE(WITH_FONTCONFIG,[],[enable fontconfig support])
297         AM_CONDITIONAL(WITH_FONTCONFIG,true)
298 } else {
299         AM_CONDITIONAL(WITH_FONTCONFIG,false)
300 } ; fi
301
302
303 # OPENEXR CHECK------------------------
304 AC_ARG_WITH(openexr,[
305   --without-openexr        Disable support for ILM's OpenEXR],[
306 ],[
307         with_openexr="yes"
308 ])
309 if test $with_openexr = "yes" ; then {
310         PKG_CHECK_MODULES(OPENEXR, OpenEXR,[
311                 CONFIG_DEPS="$CONFIG_DEPS OpenEXR"
312         
313                 AC_DEFINE(HAVE_OPENEXR,[], [ Define if OpenEXR is available ] )
314                 AM_CONDITIONAL(WITH_OPENEXR,true)
315         ],
316         [
317                 with_openexr="no"
318         ])
319 } ; fi
320 if test $with_openexr = "no" ; then {
321         AM_CONDITIONAL(WITH_OPENEXR,false)
322         use_openexr_half="no"
323 } ; fi
324 if test $use_openexr_half = yes ; then {
325         AC_MSG_RESULT([ ** Using OpenEXR Half.])
326         CONFIG_CFLAGS="$CONFIG_CFLAGS -DUSE_HALF_TYPE"
327         OPENEXR_HALF_LIBS="-lHalf"
328 } else {
329         OPENEXR_HALF_LIBS=""
330 } ; fi
331
332
333
334
335
336 # -- L I B R A R I E S ----------------------------------------
337
338 AC_LIB_LTDL
339
340 ALL_LINGUAS=""
341 AM_GNU_GETTEXT([external])
342 # This is here so autoreconf will run autopoint
343 AM_GNU_GETTEXT_VERSION([0.13])
344 localedir="$datadir/locale"
345
346 PKG_CHECK_MODULES(ETL, [ETL >= 0.04.10],,[
347         AC_MSG_ERROR([ ** You need to install the ETL (version 0.04.10 or greater).])
348 ])
349 CONFIG_DEPS="$CONFIG_DEPS ETL"
350
351
352 PKG_CHECK_MODULES(LIBXMLPP, libxml++-2.6,[
353         CONFIG_DEPS="$CONFIG_DEPS libxml++-2.6"
354 ],[
355         PKG_CHECK_MODULES(LIBXMLPP, libxml++-1.0,[
356                 CONFIG_DEPS="$CONFIG_DEPS libxml++-1.0"
357         ],[
358                 AC_MSG_ERROR([ ** You need to install libxml++, either verison 2.6 or 1.0.])
359         ])
360 ])
361
362 PKG_CHECK_MODULES(LIBSIGC, [sigc++-2.0],,[
363         AC_MSG_ERROR([ ** libsigc++-2.0 not found. It is required. You should really install it.])
364 dnl     PKG_CHECK_MODULES(LIBSIGC, [sigc++-1.2],,[
365 dnl             AC_MSG_ERROR([ ** At least libsigc++-1.2 is required.])
366 dnl     ])
367 ])
368 CONFIG_DEPS="$CONFIG_DEPS sigc++-2.0"
369
370 dnl PKG_CHECK_MODULES(GLIB, glib-2.0,[GLIB="yes"],[GLIB="no"])
371
372
373
374
375
376 TARGET_TIF="yes"
377 TARGET_PNG="yes"
378 TARGET_MNG="yes"
379 TARGET_JPEG="yes"
380
381 if test "$TARGET_TIF" != "disabled" ; then
382 AC_CHECK_LIB(tiff, TIFFClose,[
383         TIF_LIBS="-ltiff"
384         AC_DEFINE(HAVE_LIBTIFF,[], [ Define if TIFF library is available ] )
385         AC_SUBST(TIF_LIBS)
386         AM_CONDITIONAL(HAVE_LIBTIFF,true)
387 ],[
388         AC_MSG_RESULT([ *** TIFF Output target disabled])
389         TARGET_TIF="no"
390         AM_CONDITIONAL(HAVE_LIBTIFF,false)
391 ])
392 fi
393
394 AC_CHECK_LIB(png, png_write_row,[
395         PNG_LIBS="-lpng"
396         AC_DEFINE(HAVE_LIBPNG,[], [ Define if PNG library is available ] )
397         AC_SUBST(PNG_LIBS)
398         AM_CONDITIONAL(HAVE_LIBPNG,true)
399 ],[
400         AC_CHECK_LIB(png12, png_write_row,[
401         PNG_LIBS="-lpng12"
402         AC_DEFINE(HAVE_LIBPNG,[])
403         AC_SUBST(PNG_LIBS)
404         AM_CONDITIONAL(HAVE_LIBPNG,true)
405         ],[
406                 AC_MSG_RESULT([ *** PNG Output target disabled])
407                 TARGET_PNG="no"
408                 AM_CONDITIONAL(HAVE_LIBPNG,false)
409         ],[-lz -L${exec_prefix}/lib])
410 ],[-lz -L${exec_prefix}/lib])
411
412 AC_CHECK_LIB(mng, mng_initialize,[
413         MNG_LIBS="-lmng -lz"
414         AC_DEFINE(HAVE_LIBMNG,[], [ Define if MNG library is available ] )
415         AC_SUBST(MNG_LIBS)
416         AM_CONDITIONAL(HAVE_LIBMNG,true)
417 ],[
418         AC_MSG_RESULT([ *** MNG Output target disabled])
419         TARGET_MNG="no"
420         AM_CONDITIONAL(HAVE_LIBMNG,false)
421 ],[-lz -L${exec_prefix}/lib])
422
423 AC_CHECK_LIB(jpeg, main,[
424         JPEG_LIBS="-ljpeg"
425         AC_DEFINE(HAVE_LIBJPEG,[], [ Define if JPEG library is available ] )
426         AC_SUBST(JPEG_LIBS)
427         AM_CONDITIONAL(HAVE_LIBJPEG,true)
428 ],[
429         AC_MSG_RESULT([ *** JPEG Output target disabled])
430         TARGET_JPEG="no"
431         AM_CONDITIONAL(HAVE_LIBJPEG,false)
432 ],[-L${exec_prefix}/lib])
433
434
435 dnl AC_CHECK_HEADERS(jpeglib.h,[],[
436 dnl     AC_MSG_RESULT([ *** JPEG Output target disabled])
437 dnl     TARGET_JPEG="no"
438 dnl     AM_CONDITIONAL(HAVE_LIBJPEG,false)
439 dnl ])
440
441
442
443 MODULE_DIR='${libdir}/synfig/modules'
444 moduledir=$libdir/synfig/modules
445 AC_SUBST(MODULE_DIR)
446 SYNFIGLIB_DIR=$libdir/synfig
447 AC_SUBST(SYNFIGLIB_DIR)
448
449
450
451
452
453 CXXFLAGS="$CXXFLAGS -fpermissive"
454
455 AC_CHECK_HEADERS(signal.h termios.h sys/errno.h)
456
457
458 case "$host" in
459         *mingw* | *cygwin*)
460                 AM_CONDITIONAL(WIN32_PKG, true)
461                 AM_CONDITIONAL(MACOSX_PKG, false)
462         ;;
463         *darwin*)
464                 AM_CONDITIONAL(WIN32_PKG, false)
465                 AM_CONDITIONAL(MACOSX_PKG, true)
466         ;;
467         *)
468                 AM_CONDITIONAL(WIN32_PKG, false)
469                 AM_CONDITIONAL(MACOSX_PKG, false)
470         ;;
471 esac
472                 
473                 
474
475 # -- H E A D E R S --------------------------------------------
476
477 # -- T Y P E S & S T R U C T S --------------------------------
478
479 # -- F U N C T I O N S ----------------------------------------
480
481 dnl AC_CHECK_FUNCS([floor pow sqrt],[],[
482 dnl     AC_MSG_ERROR([ ** Could not find proper math functions.])
483 dnl ])
484
485 AC_CHECK_FUNCS([fork])
486 AC_CHECK_FUNCS([kill])
487 AC_CHECK_FUNCS([pipe])
488
489 AC_CHECK_FUNCS(
490         [isnan],
491         [],
492         [
493                 AC_CHECK_FUNCS(
494                         [_isnan]
495                 )
496         ]
497 )
498
499 AC_CHECK_FUNCS(
500         [isnanf],
501         [],
502         [
503                 AC_CHECK_FUNCS(
504                         [_isnanf]
505                 )
506         ]
507 )
508
509 AC_CHECK_FUNCS(
510         [floorl],
511         [],
512         [
513                 AC_CHECK_FUNCS(
514                         [_floorl]
515                 )
516         ]
517 )
518
519 AC_CHECK_LIB([pthread],[pthread_create])
520
521 # -- O U T P U T ----------------------------------------------
522
523 AC_SUBST(CFLAGS)
524 AC_SUBST(CXXFLAGS)
525 AC_SUBST(CPPFLAGS)
526 AC_SUBST(LDFLAGS)
527
528 AC_CONFIG_SUBDIRS(libltdl)
529
530 CONFIG_LIBS="-lsynfig"
531 CONFIG_CFLAGS="$CONFIG_CFLAGS"
532 AC_SUBST(CONFIG_LIBS)
533 AC_SUBST(CONFIG_CFLAGS)
534 AC_SUBST(CONFIG_DEPS)
535 AC_SUBST(ETL_CFLAGS)
536
537 SYNFIG_LIBS="$VIMAGE_LIBS $LIBXMLPP_LIBS $ETL_LIBS $LIBSIGC_LIBS $LTLIBINTL"
538 SYNFIG_CFLAGS="$LIBXMLPP_CFLAGS $ETL_CFLAGS $LIBSIGC_CFLAGS $CONFIG_CFLAGS -DSYNFIG_NO_DEPRECATED -DLOCALEDIR=\\\"$localedir\\\""
539
540 CONFIG_CFLAGS="`echo $CONFIG_CFLAGS | sed s/-mno-cygwin//g | sed s/-mwindows//g`"
541 SYNFIG_CFLAGS="`echo $SYNFIG_CFLAGS | sed s/-mno-cygwin//g | sed s/-mwindows//g`"
542 SYNFIG_LIBS="`echo $SYNFIG_LIBS | sed s/-mno-cygwin//g | sed s/-mwindows//g`"
543
544 AC_SUBST(LIBADD_DL)
545
546 AC_SUBST(SYNFIG_LIBS)
547 AC_SUBST(SYNFIG_CFLAGS)
548 AC_SUBST(OPENEXR_HALF_LIBS)
549
550 AC_SUBST(API_VERSION)
551
552 synfigincludedir=$includedir/synfig-$API_VERSION
553 AC_SUBST(synfigincludedir)
554
555 AC_OUTPUT(
556 synfig-config
557 synfig.pc
558 synfig.spec
559 doxygen.cfg
560 Makefile
561 po/Makefile.in
562 src/Makefile
563 src/synfig/Makefile
564 src/modules/Makefile
565 src/modules/lyr_freetype/Makefile
566 src/modules/lyr_std/Makefile
567 src/modules/mod_bmp/Makefile
568 src/modules/mod_dv/Makefile
569 src/modules/mod_ffmpeg/Makefile
570 src/modules/mod_filter/Makefile
571 src/modules/mod_geometry/Makefile
572 src/modules/mod_gif/Makefile
573 src/modules/mod_gradient/Makefile
574 src/modules/mod_imagemagick/Makefile
575 src/modules/mod_jpeg/Makefile
576 src/modules/mod_libavcodec/Makefile
577 src/modules/mod_magickpp/Makefile
578 src/modules/mod_mng/Makefile
579 src/modules/mod_noise/Makefile
580 src/modules/mod_openexr/Makefile
581 src/modules/mod_particle/Makefile
582 src/modules/mod_png/Makefile
583 src/modules/mod_ppm/Makefile
584 src/modules/mod_yuv420p/Makefile
585 src/tool/Makefile
586 src/modules/synfig_modules.cfg
587 examples/walk/Makefile
588 examples/Makefile
589 win32inst.nsi
590 pkg-info/macosx/synfig-core.info
591 dnl src/modules/trgt_mpg/Makefile
592 dnl src/modules/mptr_mplayer/Makefile
593 )
594
595 # -- S U M M A R Y --------------------------------------------
596
597 echo "
598 $PACKAGE_NAME v.$VERSION
599 Configuration Summary
600 - - - - - -
601
602 Install Prefix -------------------> $prefix
603 Module directory -----------------> $moduledir
604 Build Platform -------------------> $build
605 Host Platform --------------------> $host
606 Time Limit -----------------------> $death_time
607 Arc Profiling --------------------> $profile_arcs
608 GProf Profiling ------------------> $profiling
609 Debug Mode -----------------------> $debug ($debug_flags)
610 Optimization ---------------------> $optimization
611 PNG output target support --------> $TARGET_PNG
612 MNG output target support --------> $TARGET_MNG
613 TIFF output target support -------> $TARGET_TIF
614 JPEG output target support -------> $TARGET_JPEG
615 ETL_CFLAGS -----------------------> $ETL_CFLAGS
616 FreeType2 ------------------------> $with_freetype
617 fontconfig -----------------------> $with_fontconfig
618 libavcodec -----------------------> $with_libavcodec
619 vImage ---------------------------> $with_vimage
620 ImageMagick ----------------------> $with_imagemagick
621 Magick++ -------------------------> $with_magickpp
622 FFMPEG ---------------------------> $with_ffmpeg
623 libdv ----------------------------> $with_libdv
624 OpenEXR --------------------------> $with_openexr
625 Using OpenEXR's \"half\" type ------> $use_openexr_half
626
627 "'$'"CXX -----------------------------> '$CXX'
628 "'$'"CXXFLAGS ------------------------> '$CXXFLAGS'
629 "'$'"SYNFIG_LIBS ---------------------> '$SYNFIG_LIBS'
630 "'$'"LIBXMLPP_LIBS -------------------> '$LIBXMLPP_LIBS'
631 "'$'"ETL_LIBS ------------------------> '$ETL_LIBS'
632 "'$'"LIBSIGC_LIBS --------------------> '$LIBSIGC_LIBS'
633 "'$'"SYNFIG_CFLAGS -------------------> '$SYNFIG_CFLAGS'
634 "'$'"LIBADD_DL -----------------------> '$LIBADD_DL'
635 "