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