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