Missing a few files
[synfig.git] / synfig-core / trunk / config / configure.ac
1 i# $Header: /opt/voria/cvs/synfig/config/configure.ac,v 1.10 2005/03/24 21:07:24 darco Exp $
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_CONVENIENCE
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         with_imagemagick="yes"
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(ffmpeg,[
156   --without-ffmpeg        Disable support for FFMPEG],[
157 ],[
158         with_ffmpeg="yes"
159 ])
160 if test $with_ffmpeg = "no" ; then {
161         AM_CONDITIONAL(WITH_FFMPEG,false)
162 } else {
163         AM_CONDITIONAL(WITH_FFMPEG,true)
164 } ; fi
165
166
167
168
169 AC_ARG_WITH(vimage,[
170   --with-vimage        Enable support for apple vImage],[
171 ],[
172         with_vimage="no"
173 ])
174 if test $with_vimage = "no" ; then {
175         AM_CONDITIONAL(WITH_VIMAGE,false)
176 } else {
177         AM_CONDITIONAL(WITH_VIMAGE,true)
178         AC_DEFINE(HAS_VIMAGE,[1],[enable apple vImage])
179         VIMAGE_LIBS="-Wc,-framework -Wc,Accelerate"
180
181 } ; fi
182
183
184
185 AC_ARG_WITH(libdv,[
186   --without-libdv         Disable support for libdv],[
187 ],[
188         with_libdv="yes"
189 ])
190 if test $with_libdv = "no" ; then {
191         AM_CONDITIONAL(WITH_LIBDV,false)
192 } else {
193         AM_CONDITIONAL(WITH_LIBDV,true)
194 } ; fi
195
196
197
198
199
200 AC_ARG_WITH(libavcodec,[
201   --with-libavcodec         Enable support for libavcodec (Default=auto)],[
202 ],[
203         AC_CHECK_LIB(avcodec, avcodec_find_encoder,[
204                 with_libavcodec="yes"
205         ],[
206                 with_libavcodec="no"
207         ])
208 ])
209 if test $with_libavcodec = "no" ; then {
210         AM_CONDITIONAL(WITH_LIBAVCODEC,false)
211 } else {
212         AM_CONDITIONAL(WITH_LIBAVCODEC,true)
213 } ; fi
214
215
216
217
218
219 # FREETYPE2 CHECK--------------------
220
221 AC_ARG_WITH(freetype,[
222   --without-freetype         disable support for freetype (Default=auto)],[
223 ],[
224         with_freetype="yes"
225 ])
226
227
228 if test $with_freetype != "no" ; then {
229         PKG_CHECK_MODULES(FREETYPE, xft fontconfig,[
230                 with_freetype="yes"
231         ],[
232                 PKG_CHECK_MODULES(FREETYPE, freetype2 fontconfig,[
233                         with_freetype="yes"
234                 ],[
235                         with_freetype="no"
236                 ])
237         ])
238 #       AC_CHECK_FT2(,[
239 #               with_freetype="yes"
240 #       ],[
241 #               with_freetype="no"
242 #       ])      
243 } ; fi
244
245 if test $with_freetype = "no" ; then {
246         AM_CONDITIONAL(WITH_FREETYPE,false)
247 } else {
248         AM_CONDITIONAL(WITH_FREETYPE,true)
249 } ; fi
250
251
252
253
254
255
256 # OPENEXR CHECK------------------------
257 AC_ARG_WITH(openexr,[
258   --without-openexr        Disable support for ILM's OpenEXR],[
259 ],[
260         with_openexr="yes"
261 ])
262 if test $with_openexr = "yes" ; then {
263         PKG_CHECK_MODULES(OPENEXR, OpenEXR,[
264                 CONFIG_DEPS="$CONFIG_DEPS OpenEXR"
265         
266                 AC_DEFINE(HAVE_OPENEXR,[], [ Define if OpenEXR is available ] )
267                 AM_CONDITIONAL(WITH_OPENEXR,true)
268         ],
269         [
270                 with_openexr="no"
271         ])
272 } ; fi
273 if test $with_openexr = "no" ; then {
274         AM_CONDITIONAL(WITH_OPENEXR,false)
275         use_openexr_half="no"
276 } ; fi
277 if test $use_openexr_half = yes ; then {
278         AC_MSG_RESULT([ ** Using OpenEXR Half.])
279         CONFIG_CFLAGS="$CONFIG_CFLAGS -DUSE_HALF_TYPE"
280 } ; fi
281
282
283
284
285
286 # -- L I B R A R I E S ----------------------------------------
287
288 AC_LIB_LTDL
289
290 PKG_CHECK_MODULES(ETL, ETL,,[
291         AC_MSG_ERROR([ ** You need to install the ETL.])
292 ])
293 CONFIG_DEPS="$CONFIG_DEPS ETL"
294
295
296 PKG_CHECK_MODULES(LIBXMLPP, libxml++-2.6,[
297         CONFIG_DEPS="$CONFIG_DEPS libxml++-2.6"
298 ],[
299         PKG_CHECK_MODULES(LIBXMLPP, libxml++-1.0,[
300                 CONFIG_DEPS="$CONFIG_DEPS libxml++-1.0"
301         ],[
302                 AC_MSG_ERROR([ ** You need to install libxml++, either verison 2.6 or 1.0.])
303         ])
304 ])
305
306 PKG_CHECK_MODULES(LIBSIGC, [sigc++-2.0],,[
307         AC_MSG_ERROR([ ** libsigc++-2.0 not found. It is required. You should really install it.])
308 dnl     PKG_CHECK_MODULES(LIBSIGC, [sigc++-1.2],,[
309 dnl             AC_MSG_ERROR([ ** At least libsigc++-1.2 is required.])
310 dnl     ])
311 ])
312 CONFIG_DEPS="$CONFIG_DEPS sigc++-2.0"
313
314 dnl PKG_CHECK_MODULES(GLIB, glib-2.0,[GLIB="yes"],[GLIB="no"])
315
316
317
318
319
320 TARGET_TIF="yes"
321 TARGET_PNG="yes"
322 TARGET_JPEG="yes"
323
324 if test "$TARGET_TIF" != "disabled" ; then
325 AC_CHECK_LIB(tiff, TIFFClose,[
326         TIF_LIBS="-ltiff"
327         AC_DEFINE(HAVE_LIBTIFF,[], [ Define if TIFF library is available ] )
328         AC_SUBST(TIF_LIBS)
329         AM_CONDITIONAL(HAVE_LIBTIFF,true)
330 ],[
331         AC_MSG_RESULT([ *** TIFF Output target disabled])
332         TARGET_TIF="no"
333         AM_CONDITIONAL(HAVE_LIBTIFF,false)
334 ])
335 fi
336
337 AC_CHECK_LIB(png, png_write_row,[
338         PNG_LIBS="-lpng"
339         AC_DEFINE(HAVE_LIBPNG,[], [ Define if PNG library is available ] )
340         AC_SUBST(PNG_LIBS)
341         AM_CONDITIONAL(HAVE_LIBPNG,true)
342 ],[
343         AC_MSG_RESULT([ *** PNG Output target disabled])
344         TARGET_PNG="no"
345         AM_CONDITIONAL(HAVE_LIBPNG,false)
346 ],[-lz -L${exec_prefix}/lib])
347
348 AC_CHECK_LIB(jpeg, main,[
349         JPEG_LIBS="-ljpeg"
350         AC_DEFINE(HAVE_LIBJPEG,[], [ Define if JPEG library is available ] )
351         AC_SUBST(JPEG_LIBS)
352         AM_CONDITIONAL(HAVE_LIBJPEG,true)
353 ],[
354         AC_MSG_RESULT([ *** JPEG Output target disabled])
355         TARGET_JPEG="no"
356         AM_CONDITIONAL(HAVE_LIBJPEG,false)
357 ],[-L${exec_prefix}/lib])
358
359
360 dnl AC_CHECK_HEADERS(jpeglib.h,[],[
361 dnl     AC_MSG_RESULT([ *** JPEG Output target disabled])
362 dnl     TARGET_JPEG="no"
363 dnl     AM_CONDITIONAL(HAVE_LIBJPEG,false)
364 dnl ])
365
366
367
368 MODULE_DIR='${libdir}/synfig/modules'
369 moduledir=$libdir/synfig/modules
370 AC_SUBST(MODULE_DIR)
371 SYNFIGLIB_DIR=$libdir/synfig
372 AC_SUBST(SYNFIGLIB_DIR)
373
374
375
376
377
378 CXXFLAGS="$CXXFLAGS -fpermissive"
379
380 AC_CHECK_HEADERS(signal.h termios.h sys/errno.h)
381
382
383 case "$host" in
384         *mingw* | *cygwin*)
385                 AM_CONDITIONAL(WIN32_PKG, true)
386                 AM_CONDITIONAL(MACOSX_PKG, false)
387         ;;
388         *darwin*)
389                 AM_CONDITIONAL(WIN32_PKG, false)
390                 AM_CONDITIONAL(MACOSX_PKG, true)
391         ;;
392         *)
393                 AM_CONDITIONAL(WIN32_PKG, false)
394                 AM_CONDITIONAL(MACOSX_PKG, false)
395         ;;
396 esac
397                 
398                 
399
400 # -- H E A D E R S --------------------------------------------
401
402 # -- T Y P E S & S T R U C T S --------------------------------
403
404 # -- F U N C T I O N S ----------------------------------------
405
406 dnl AC_CHECK_FUNCS([floor pow sqrt],[],[
407 dnl     AC_MSG_ERROR([ ** Could not find proper math functions.])
408 dnl ])
409
410 AC_CHECK_FUNCS([fork])
411 AC_CHECK_FUNCS([kill])
412 AC_CHECK_FUNCS([pipe])
413
414 AC_CHECK_FUNCS(
415         [isnan],
416         [],
417         [
418                 AC_CHECK_FUNCS(
419                         [_isnan]
420                 )
421         ]
422 )
423
424 AC_CHECK_FUNCS(
425         [isnanf],
426         [],
427         [
428                 AC_CHECK_FUNCS(
429                         [_isnanf]
430                 )
431         ]
432 )
433
434 AC_CHECK_FUNCS(
435         [floorl],
436         [],
437         [
438                 AC_CHECK_FUNCS(
439                         [_floorl]
440                 )
441         ]
442 )
443
444 AC_CHECK_LIB([pthread],[pthread_create])
445
446 # -- O U T P U T ----------------------------------------------
447
448 AC_SUBST(CFLAGS)
449 AC_SUBST(CXXFLAGS)
450 AC_SUBST(CPPFLAGS)
451 AC_SUBST(LDFLAGS)
452
453 VERSION_MAJ=@VERSION_MAJ@
454 VERSION_MIN=@VERSION_MIN@
455 VERSION_REV=@VERSION_REV@
456 AC_SUBST(VERSION_MAJ)
457 AC_SUBST(VERSION_MIN)
458 AC_SUBST(VERSION_REV)
459
460 dnl AC_CONFIG_SUBDIRS(libltdl)
461
462 CONFIG_LIBS="-lsynfig"
463 CONFIG_CFLAGS="$CONFIG_CFLAGS"
464 AC_SUBST(CONFIG_LIBS)
465 AC_SUBST(CONFIG_CFLAGS)
466 AC_SUBST(CONFIG_DEPS)
467 AC_SUBST(ETL_CFLAGS)
468
469 SYNFIG_LIBS="$VIMAGE_LIBS $LIBXMLPP_LIBS $ETL_LIBS $LIBSIGC_LIBS"
470 SYNFIG_CFLAGS="$LIBXMLPP_CFLAGS $ETL_CFLAGS $LIBSIGC_CFLAGS $CONFIG_CFLAGS -DSYNFIG_NO_DEPRECATED"
471
472 CONFIG_CFLAGS="`echo $CONFIG_CFLAGS | sed s/-mno-cygwin//g | sed s/-mwindows//g`"
473 SYNFIG_CFLAGS="`echo $SYNFIG_CFLAGS | sed s/-mno-cygwin//g | sed s/-mwindows//g`"
474 SYNFIG_LIBS="`echo $SYNFIG_LIBS | sed s/-mno-cygwin//g | sed s/-mwindows//g`"
475
476 AC_SUBST(LIBADD_DL)
477
478 AC_SUBST(SYNFIG_LIBS)
479 AC_SUBST(SYNFIG_CFLAGS)
480 AC_SUBST(API_VERSION)
481
482 synfigincludedir=$includedir/synfig-@API_VERSION@
483 AC_SUBST(synfigincludedir)
484
485 [(
486         [ -d libltdl ] || mkdir libltdl;
487         cd libltdl;
488         
489         echo
490         echo pwd: `pwd`
491         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
492         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
493         
494 )]
495
496 AC_OUTPUT(
497 synfig-config
498 @PACKAGE_TARNAME@.pc
499 Makefile
500 src/Makefile
501 src/synfig/Makefile
502 src/modules/Makefile
503 src/modules/mod_filter/Makefile
504 src/modules/mod_bmp/Makefile
505 src/modules/mod_gif/Makefile
506 src/modules/mod_ppm/Makefile
507 src/modules/mod_png/Makefile
508 src/modules/mod_jpeg/Makefile
509 src/modules/lyr_std/Makefile
510 src/modules/mod_geometry/Makefile
511 src/modules/mod_gradient/Makefile
512 src/modules/mod_noise/Makefile
513 src/modules/lyr_freetype/Makefile
514 src/modules/mod_ffmpeg/Makefile
515 src/modules/mod_dv/Makefile
516 src/modules/mod_imagemagick/Makefile
517 src/modules/mod_openexr/Makefile
518 src/modules/mod_libavcodec/Makefile
519 src/modules/mod_yuv420p/Makefile
520 src/modules/mod_particle/Makefile
521 src/tool/Makefile
522 src/modules/synfig_modules.cfg
523 examples/Makefile
524 win32inst.nsi
525 pkg-info/macosx/synfig-core.info
526 dnl src/modules/trgt_mpg/Makefile
527 dnl src/modules/mptr_mplayer/Makefile
528 )
529
530 # -- S U M M A R Y --------------------------------------------
531
532 echo "
533 $PACKAGE_NAME v.$VERSION
534 Configuration Summary
535 - - - - - -
536
537 Install Prefix -------------------> $prefix
538 Module directory -----------------> $moduledir
539 Build Platform -------------------> $build
540 Host Platform --------------------> $host
541 Time Limit -----------------------> $death_time
542 Arc Profiling --------------------> $profile_arcs
543 GProf Profiling ------------------> $profiling
544 Debug Mode -----------------------> $debug ($debug_flags)
545 Optimization ---------------------> $optimization
546 PNG output target support --------> $TARGET_PNG
547 TIFF output target support -------> $TARGET_TIF
548 JPEG output target support -------> $TARGET_JPEG
549 ETL_CFLAGS -----------------------> $ETL_CFLAGS
550 FreeType2 ------------------------> $with_freetype
551 libavcodec -----------------------> $with_libavcodec
552 vImage ---------------------------> $with_vimage
553 GLib -----------------------------> $GLIB
554 ImageMagick ----------------------> $with_imagemagick
555 FFMPEG ---------------------------> $with_ffmpeg
556 libdv ----------------------------> $with_libdv
557 OpenEXR --------------------------> $with_openexr
558 Using OpenEXR's \"half\" type ------> $use_openexr_half
559
560 "'$'"CXX ------------------------------> '$CXX'
561 "'$'"CXXFLAGS -------------------------> '$CXXFLAGS'
562 "'$'"SYNFIG_LIBS -----------------------> '$SYNFIG_LIBS'
563 "'$'"LIBXMLPP_LIBS --------------------> '$LIBXMLPP_LIBS'
564 "'$'"ETL_LIBS -------------------------> '$ETL_LIBS'
565 "'$'"LIBSIGC_LIBS ---------------------> '$LIBSIGC_LIBS'
566 "'$'"SYNFIG_CFLAGS ---------------------> '$SYNFIG_CFLAGS'
567 "'$'"LIBADD_DL ------------------------> '$LIBADD_DL'
568 "