Annotation of Amaya/configure.in, revision 1.140
1.1 cvs 1: dnl
2: dnl Process this file with autoconf to produce a configure script.
3: dnl Autoconf script for Amaya and Thot.
1.10 cvs 4: dnl Daniel Veillard and Irene Vatton, 1997
1.1 cvs 5: dnl
6:
7: dnl ***************************************************************
8: dnl
9: dnl GENERIC AUTOCONF STUFF : GUESS INFORMATIONS ON SYSTEM SETUP
10: dnl
11: dnl ***************************************************************
12:
1.114 kahan 13: AC_PREREQ(2.53)
1.1 cvs 14: AC_INIT(thotlib/internals/h/constpiv.h)
15: AC_REVISION
16:
17: dnl
1.69 kahan 18: dnl Verify that configure is not being called in the Amaya directory
19: dnl
20: if test -d batch -a -f configure.in ; then
1.70 kahan 21: echo
22: echo "****************************************************************"
1.69 kahan 23: echo ERROR: You must invoke the configure script in a subidrectory
24: echo under the Amaya tree.
25: echo For example:
26: echo " cd Amaya ; mkdir obj ; cd obj ; ../configure [your options] "
1.70 kahan 27: echo "****************************************************************"
28: echo
1.69 kahan 29: exit 1
30: fi
31:
32: dnl
1.1 cvs 33: dnl Checks for platform information
34: dnl
35:
36: AC_CANONICAL_SYSTEM
37: AC_CONFIG_HEADER(config.h)
38:
39: dnl
40: dnl Initializing Automake
41: dnl
42:
43: AC_PROG_MAKE_SET
44: AC_ARG_PROGRAM
45:
46: dnl
47: dnl Checks for programs.
48: dnl
49:
50: AC_PROG_YACC
51: AC_PROG_CC
52: AC_PROG_CPP
1.122 gully 53: AC_PROG_CXX
1.1 cvs 54: AC_PROG_LEX
55: AC_PROG_AWK
56: AC_PROG_INSTALL
57: AC_PROG_LN_S
58: AC_PROG_MAKE_SET
59: AC_PROG_RANLIB
60: AC_PATH_PROG(CP, cp, /bin/cp, $PATH:/bin:/usr/bin:/usr/ucb/bin)
61: AC_PATH_PROG(MV, mv, /bin/mv, $PATH:/bin:/usr/bin:/usr/ucb/bin)
62: AC_PATH_PROG(RM, rm, /bin/rm, $PATH:/bin:/usr/bin:/usr/ucb/bin)
63: AC_PATH_PROG(MKDIR, mkdir, /bin/mkdir, $PATH:/bin:/usr/bin:/usr/ucb/bin)
64: AC_PATH_PROG(ECHO, echo, /bin/echo, $PATH:/bin:/usr/bin:/usr/ucb/bin)
65: AC_PATH_PROG(CAT, cat, /bin/cat, $PATH:/bin:/usr/bin:/usr/ucb/bin)
66: AC_PATH_PROG(CHMOD, chmod, /bin/chmod, $PATH:/bin:/usr/bin:/usr/ucb/bin)
67: AC_PATH_PROG(SED, sed, /bin/sed, $PATH:/bin:/usr/bin:/usr/ucb/bin)
68: AC_PATH_PROG(AR, ar, /usr/bin/ar, $PATH:/bin:/usr/bin:/usr/ucb/bin)
1.6 cvs 69: AC_PATH_PROG(DIFF, diff, /usr/bin/diff, $PATH:/bin:/usr/bin:/usr/ucb/bin)
1.1 cvs 70:
71: dnl
72: dnl Checks for libraries.
73: dnl
74:
75: AC_CHECK_LIB(socket, socket, )
76: AC_CHECK_LIB(inet, connect)
77: AC_CHECK_LIB(nsl, t_accept)
78: AC_CHECK_LIB(dl, dlopen)
79: AC_PATH_X
80: AC_PATH_XTRA
81:
1.41 cvs 82: dnl
83: dnl Check for libXp
84: dnl
1.38 cvs 85:
1.41 cvs 86: for ac_dir in \
87: /usr/X11R6/lib \
88: /usr/X11R5/lib \
89: \
90: /usr/lib/X11R6 \
91: /usr/lib/X11R5 \
92: \
93: /usr/local/X11R6/lib \
94: /usr/local/X11R5/lib \
95: \
96: /usr/local/lib/X11R6 \
97: /usr/local/lib/X11R5 \
98: \
99: /usr/X11/lib \
100: /usr/lib/X11 \
101: /usr/local/X11/lib \
102: /usr/local/lib/X11 \
103: \
104: /usr/X386/lib \
105: /usr/x386/lib \
106: /usr/XFree86/lib/X11 \
107: \
108: /usr/dt/lib \
109: \
110: /usr/lib \
111: /usr/local/lib \
112: /usr/unsupported/lib \
113: /usr/athena/lib \
114: /usr/local/x11r5/lib \
115: /usr/lpp/Xamples/lib \
116: \
117: /usr/lesstif/lib \
118: /usr/local/lesstif/lib\
119: /usr/gnu/lesstif/lib \
120: $HOME/lesstif/lib \
121: ; \
122: do
123: if test -r "$ac_dir/libXp.a" -o -r "$ac_dir/libXp.so"; then
1.131 gully 124: echo "found libXp.a"
1.41 cvs 125: X_PRE_LIBS="-lXp ${X_PRE_LIBS}"
126: break
127: fi
128: done
1.1 cvs 129: dnl
1.5 cvs 130: dnl Checks for header files.
131: dnl
132:
133: AC_HEADER_DIRENT
134: AC_HEADER_STDC
135: AC_HEADER_SYS_WAIT
136:
137: AC_CHECK_HEADERS(stdio.h)
138: AC_CHECK_HEADERS(sys/types.h types.h)
139: AC_CHECK_HEADERS(sys/unistd.h unistd.h)
140: AC_CHECK_HEADERS(sys/fcntl.h fcntl.h)
141: AC_CHECK_HEADERS(sys/limits.h limits.h)
142: AC_CHECK_HEADERS(sys/stat.h stat.h)
143: AC_CHECK_HEADERS(sys/file.h)
144: AC_CHECK_HEADERS(sys/ioctl.h)
145: AC_CHECK_HEADERS(sys/time.h time.h)
146: AC_CHECK_HEADERS(sys/systeminfo.h)
1.46 cvs 147: AC_CHECK_HEADERS(sys/string.h strings.h)
1.34 cvs 148: AC_CHECK_HEADERS(sys/syslog.h syslog.h)
1.5 cvs 149: AC_CHECK_HEADERS(sys/socket.h socket.h)
1.131 gully 150:
151: # SG: not used ? => do not compile on macosx
152: # AC_CHECK_HEADERS(appkit/appkit.h appkit.h)
153: # AC_CHECK_HEADERS(apppkit/apppkit.h apppkit.h)
154:
1.5 cvs 155: AC_CHECK_HEADERS(netinet/in.h in.h)
156: AC_CHECK_HEADERS(dn.h)
157: AC_CHECK_HEADERS(sys/ipc.h)
158: AC_CHECK_HEADERS(net/errno.h sys/errno.h errno.h)
159: AC_CHECK_HEADERS(pwd.h)
160: AC_CHECK_HEADERS(grp.h)
161: AC_CHECK_HEADERS(arpa/inet.h inet.h)
162: AC_CHECK_HEADERS(netdb.h)
163: AC_CHECK_HEADERS(manifest.h)
164: AC_CHECK_HEADERS(bsdtypes.h)
165: AC_CHECK_HEADERS(stdefs.h)
166: AC_CHECK_HEADERS(bsdtime.h)
167: AC_CHECK_HEADERS(sys/select.h select.h)
168: AC_CHECK_HEADERS(dnetdb.h)
169: AC_CHECK_HEADERS(libc.h)
170: AC_CHECK_HEADERS(stdlib.h)
171: AC_CHECK_HEADERS(malloc.h)
172: AC_CHECK_HEADERS(memory.h)
173: AC_CHECK_HEADERS(unixlib.h)
174: AC_CHECK_HEADERS(ctype.h)
175: AC_CHECK_HEADERS(cursesX.h curses.h)
176: AC_CHECK_HEADERS(sys/resource.h resource.h)
177: AC_HEADER_DIRENT
178: AC_CHECK_HEADERS(dir.h direct.h) dnl AC_HEADER_DIRENT only checks for some..
179: AC_HEADER_STDC
180: AC_HEADER_SYS_WAIT
181: AC_HEADER_TIME
182: AC_HEADER_STAT
1.103 kahan 183: AC_CHECK_HEADERS(stdint.h)
1.5 cvs 184:
185: dnl
186: dnl Checks for typedefs, structures, and compiler characteristics.
187: dnl
188:
189: AC_C_CONST
190: AC_C_INLINE
191: AC_TYPE_MODE_T
192: AC_TYPE_OFF_T
193: AC_TYPE_SIZE_T
194: AC_HEADER_TIME
195: AC_STRUCT_TM
196: AC_STRUCT_TIMEZONE
197: AC_TYPE_UID_T
198:
199: dnl
200: dnl Checks for library functions.
201: dnl
202:
203: AC_FUNC_ALLOCA
204: AC_TYPE_GETGROUPS
205: AC_PROG_GCC_TRADITIONAL
206: AC_FUNC_MEMCMP
207: AC_FUNC_MMAP
208: AC_TYPE_SIGNAL
209: AC_FUNC_VPRINTF
1.58 cvs 210: AC_CHECK_FUNCS(getcwd gethostname gettimeofday getwd mkdir mktime putenv select socket strdup strerror strftime strstr strtod strtol uname lstat strcasecmp strncasecmp strchr memcpy)
1.5 cvs 211:
1.132 gully 212: #
213: # Check for operating system (UNIX / WINDOWS / MACOSX )
214: # ---------->
215: # canonicalize the target OS : default UNIX
216: OS_OPTIONS="-D_UNIX"
217: case $target_os in
218: aix*) OS_OPTIONS="-D_UNIX" ;;
219: cygwin*) OS_OPTIONS="-D_UNIX" ;;
220: darwin*) OS_OPTIONS="-D_UNIX -D_MACOS" ;;
221: freebsd2*) OS_OPTIONS="-D_UNIX" ;;
222: freebsd*) OS_OPTIONS="-D_UNIX" ;;
223: hpux*) OS_OPTIONS="-D_UNIX" ;;
224: irix*) OS_OPTIONS="-D_UNIX" ;;
225: linuxaout*) OS_OPTIONS="-D_UNIX" ;;
226: linux*) OS_OPTIONS="-D_UNIX" ;;
227: mingw32*) OS_OPTIONS="-D_UNIX" ;;
228: netbsd*) OS_OPTIONS="-D_UNIX" ;;
229: openbsd*) OS_OPTIONS="-D_UNIX" ;;
230: osf[12]*) OS_OPTIONS="-D_UNIX" ;;
231: osf*) OS_OPTIONS="-D_UNIX" ;;
232: solaris2*) OS_OPTIONS="-D_UNIX" ;;
233: sunos4*) OS_OPTIONS="-D_UNIX" ;;
234: ultrix*) OS_OPTIONS="-D_UNIX" ;;
235: esac
236:
1.85 vatton 237: AC_ARG_WITH(GL, [ --with-gl enable Opengl canvas (experimental) ])
238: dnl
239: dnl GL canvas is disabled by default
240: dnl
241: dnl needs Opengl, glu, Xft (xfree 4 font server)
242: dnl needs GTK
243: dnl text WILL need freetype2, ftgl
244: dnl GL is for opengl
245: dnl Glu is for text drawing (until we switch)
246: dnl GLU is for tesselation algortihms (until we extract it from this lib)
247: dnl (tesselation is used for polygons with holes in it...)
248: dnl gtkgl is for integration of opengl in GTK
249: if test "$with_gl" = "" ; then
250: if test "$enable_gl" = "yes" ; then
251: with_gl="yes"
252: else
253: with_gl="no"
254: fi
255: fi
256:
1.120 gully 257: # check if gtk gui should be used
258: AC_ARG_WITH(gtk, [ --with-gtk use GTK GUI toolkit ])
259: if test "$with_gtk" = "yes" -o "$enable_gtk" = "yes" ; then
260: if test "$withval" = "no" ; then
261: with_gtk="no"
262: else
263: with_gtk="yes"
264: fi
265: fi
266:
1.124 gully 267: # check if wxWindows gui should be used
268: AC_ARG_WITH(wx, [ --with-wx use wxWindows GUI toolkit (experimental)])
269: if test "$with_wx" = "yes" -o "$enable_wx" = "yes" ; then
270: if test "$withval" = "no" ; then
271: with_wx="no"
272: else
273: with_wx="yes"
1.134 gully 274: # force opengl with wxWidgets
275: with_gl="yes"
1.124 gully 276: fi
277: fi
278:
1.134 gully 279: # Check if iat least one GUI toolkit is enabled
280: if test "$with_wx" = "no" -o "$with_wx" = "" ; then
281: if test "$with_gtk" = "no" -o "$with_gtk" = "" ; then
282: # Nothing is enable so force the default GUI toolkit (GTK)
283: with_wx="no"
284: with_gtk="yes"
1.85 vatton 285: fi
286: fi
287:
1.121 gully 288: # check if no gui is enable
289: AC_ARG_WITH(nogui, [ --with-nogui do not use GUI toolkit ])
290: if test "$with_nogui" = "yes" -o "$enable_nogui" = "yes" ; then
291: with_nogui="yes"
292: with_gtk="no"
1.134 gully 293: with_wx="no"
1.121 gully 294: NOGUI_OPTIONS="-D_NOGUI"
295: fi
296:
1.136 gully 297: # check if wxWidgets debug is enable
298: AC_ARG_WITH(wxdebug, [ --with-wxdebug compiles wxWidgets with debuging options ])
299: if test "$with_wxdebug" = "yes" ; then
300: with_wxdebug="yes"
301: else
302: with_wxdebug="no"
303: fi
304:
1.134 gully 305: if test "$with_wx" = "yes" ; then
1.120 gully 306: if test "$with_gtk" = "yes" ; then
307: echo
308: echo "****************************************************************"
309: echo " ERROR: "
310: echo " More than one GUI toolkit is enable"
311: echo " Only one GUI toolkit should be enable (turn off one)"
312: echo " exemple ok : ../configure --with-gtk "
1.134 gully 313: echo " exemple !ok : ../configure --with-gtk --with-wx"
1.120 gully 314: echo "****************************************************************"
315: echo
316: exit 1
317: fi
318: fi
1.134 gully 319:
1.85 vatton 320: if test "$with_gtk" = "yes" ; then
1.131 gully 321: # SG : lookingfor gtkimlib includes
322: # because not found with gtk-config on macosx
1.134 gully 323: gdkimlib_h_found="no"
1.63 vatton 324: for ac_dir in \
1.131 gully 325: /sw/include/ \
326: /sw/local/include \
327: /usr/include \
1.63 vatton 328: /usr/local/include \
329: ; \
330: do
1.131 gully 331: if test -r "$ac_dir/gdk_imlib.h"; then
332: echo "found gdk_imlib.h"
1.134 gully 333: gdkimlib_h_found="yes"
1.131 gully 334: GTK_INCLUDES="${GTK_INCLUDES} -I$ac_dir"
1.63 vatton 335: break
336: fi
337: done
338:
1.134 gully 339: # check that gtk-config exists
340: AC_CHECK_PROG(GTKCONFIG_FOUND,gtk-config,yes,no)
341: if test "$GTKCONFIG_FOUND" = no ; then
342: AC_MSG_ERROR(Cannot find gtk-config. Please install gtk development library.)
343: fi
344:
1.131 gully 345: GTK_INCLUDES="${GTK_INCLUDES} `gtk-config --cflags`"
1.124 gully 346: AC_SUBST(GTK_INCLUDES)
347: GTK_LIBRARIES="`gtk-config --libs`"
1.134 gully 348: # GL doesn't need the imlib
1.124 gully 349: if test "${with_gl}" != "yes" ; then
1.134 gully 350: GTK_LIBRARIES="${GTK_LIBRARIES} -lgdk_imlib"
351: else
352: gdkimlib_h_found="yes"
1.124 gully 353: fi
1.106 kahan 354:
1.124 gully 355: AC_SUBST(GTK_LIBRARIES)
356: GTK_OPTIONS="-D_GTK"
1.76 vatton 357: no_graphic=yes
1.134 gully 358:
359: if test "$gdkimlib_h_found" = "no" ; then
360: echo
361: echo "****************************************************************"
362: echo " ERROR: gdk_imlib.h not found -"
363: echo " [please install imlib developpement package (libimlib1-devel on mandrake)]"
364: echo "****************************************************************"
365: exit 1
366: fi
1.120 gully 367: fi
368:
1.124 gully 369: if test "$with_wx" = "yes" ; then
1.135 gully 370:
371: # check that sources of wxWidgets exists
372: if test ! -f ../../wxWidgets/Makefile.in ; then
373: AC_MSG_ERROR(wxWidgets library sources not found. Please download wxWidgets sources (http://www.wxwidgets.org/) or remove --with-wx option !)
374: fi
375:
376: # --------- compile wxWidgets library --------------- #
377: echo "---> Configuring wxWidgets library."
378: OLDDIR=`pwd`
379: cd ../../wxWidgets/
1.136 gully 380: mkdir -p AMAYABUILD
1.135 gully 381: cd AMAYABUILD
1.136 gully 382:
1.135 gully 383: # remove old configure options
384: rm -f configarg.cache
1.136 gully 385:
386: # setup configure options
1.135 gully 387: if test "$OS_OPTIONS" = "-D_UNIX" ; then
388: # LINUX
1.136 gully 389: WXCONFIGURE_OPTION="--with-opengl --with-gtk --enable-gtk2 --enable-unicode"
1.135 gully 390: fi
391: if test "$OS_OPTIONS" = "-D_UNIX -D_MACOS" ; then
392: # MACOSX
393: AC_MSG_ERROR(TODO: configurer wxWidgets pour MACOSX)
1.136 gully 394: # WXCONFIGURE_OPTION="--with-opengl --with-gtk --enable-gtk2 --enable-unicode"
395: fi
396: if test $with_wxdebug = yes ; then
397: WXCONFIGURE_OPTION="$WXCONFIGURE_OPTION --enable-debug --enable-debug_cntxt --enable-debug_gdb --enable-debug_info --enable-debug_flag --enable-mem_tracing"
1.135 gully 398: fi
1.136 gully 399:
400: # launch the configure
401: ../configure $WXCONFIGURE_OPTION
402:
1.135 gully 403: echo "---> Configuring wxWidgets library. - DONE"
404: echo "---> Compiling wxWidgets library."
405: # compile the lib
406: make
407: echo "---> Compiling wxWidgets contrib xrc library."
408: cd contrib/src/xrc
409: # compile xrc lib (xml resource lib)
410: make
411: cd $OLDDIR
412: echo "---> Compiling wxWidgets library. - DONE"
413: # --------- compile wxWidgets library - DONE --------------- #
414:
415: # --------- configuring wxWidgets paths --------------- #
416: WXCONFIG=../../wxWidgets/AMAYABUILD/wx-config
417: # loop for absolute wxWidgets path : necessary to compile thotlib and amaya because they are in subdirectory
418: cd ../../wxWidgets/ && WXROOTDIR=`pwd` && WXCONFIG_ARGS="--prefix=$WXROOTDIR --exec-prefix=$WXROOTDIR/AMAYABUILD" && cd -
1.134 gully 419: # check that wx-config exists
1.135 gully 420: if test ! -f $WXCONFIG ; then
421: AC_MSG_ERROR(Cannot find wx-config. Please install wxWidgets (http://www.wxwidgets.org/))
1.134 gully 422: fi
423:
1.135 gully 424: WX_INCLUDES="`$WXCONFIG $WXCONFIG_ARGS --cxxflags`"
1.136 gully 425: WX_INCLUDES="-I$WXROOTDIR/contrib/include/ ${WX_INCLUDES}"
1.124 gully 426: AC_SUBST(WX_INCLUDES)
427:
1.136 gully 428: WX_LIBRARIES="-Wl,-rpath,$WXROOTDIR/AMAYABUILD/lib `$WXCONFIG $WXCONFIG_ARGS --libs`"
1.126 gully 429:
1.132 gully 430: # GL is used ?
1.126 gully 431: if test "${with_gl}" = "yes" ; then
1.135 gully 432: WX_LIBRARIES="${WX_LIBRARIES} `$WXCONFIG $WXCONFIG_ARGS --gl-libs`"
1.132 gully 433:
434: # SG: this is a mistery why wx-config doesn't add these needed option on macosx
435: if test "$OS_OPTIONS" = "-D_UNIX -D_MACOS" ; then
436: WX_LIBRARIES="${WX_LIBRARIES} -framework OpenGL -framework AGL"
437: fi
1.124 gully 438: fi
439:
1.132 gully 440: # xrc ressources are used
1.137 gully 441: WX_LIBRARIES="${WX_LIBRARIES} -l`$WXCONFIG $WXCONFIG_ARGS --basename`_xrc-`$WXCONFIG $WXCONFIG_ARGS --release`"
1.136 gully 442:
1.124 gully 443: AC_SUBST(WX_LIBRARIES)
444: WX_OPTIONS="-D_WX"
1.135 gully 445: # --------- configuring wxWidgets paths - DONE --------------- #
1.132 gully 446:
447: no_graphic=yes
1.124 gully 448: fi
449:
1.63 vatton 450: if test "${GCC}" = "yes"; then
451: CPP="${CPP} -x c"
452: fi
453:
1.1 cvs 454: dnl ***************************************************************
455: dnl
1.61 cvs 456: dnl SPECIFIC STUFF : CONFIGURATION OPTIONS FOR AMAYA
1.1 cvs 457: dnl
458: dnl ***************************************************************
459:
1.101 kahan 460: # We don't use our graphic libraries for the pure GTK version (without GL)
461:
1.132 gully 462: # if configure has option --with-graphiclibs then dont check for system graphic libs
463: # force amaya static graphic libs to be used
464: AC_ARG_WITH(graphiclibs, [ --with-graphiclibs use static libjpeg, libpng.])
465: if test "$with_graphiclibs" = "yes" -o "enable_graphiclibs" = "yes" ; then
466: no_graphic="no"
467: else
468: no_graphic="yes"
1.76 vatton 469: fi
1.132 gully 470:
1.76 vatton 471: if test "$no_graphic" = yes; then
472: dnl
473: AC_MSG_CHECKING([for libjpeg version = 6b])
474: AC_EGREP_CPP([x 62 *x],
475: [#include <jpeglib.h>
476: x JPEG_LIB_VERSION x],
477: dnl
478: AC_MSG_RESULT([yes])
1.105 vatton 479: JPEGINCL=''
1.76 vatton 480: LIBJPEG='-ljpeg'
481: MAKEJPEG=['#'],
482: dnl
483: AC_MSG_RESULT([no])
1.105 vatton 484: JPEGINCL='-I$(THOTDIR)/libjpeg'
1.76 vatton 485: LIBJPEG='../libjpeg.a' dnl LIBJPEG goes into amaya/Makefile.in
486: )
487: dnl
488: dnl
1.95 vatton 489: AC_MSG_CHECKING([for libpng version = 1.0.x or 1.2.x])
490: AC_EGREP_CPP([x \"1.[02]\..*\" *x],
1.76 vatton 491: [#include <png.h>
492: x PNG_LIBPNG_VER_STRING x],
493: dnl
494: AC_MSG_RESULT([yes])
1.105 vatton 495: PNGINCL=''
1.76 vatton 496: LIBPNG='-lpng'
497: LIBZ=''
498: MAKEPNG=['#'],
499: dnl
500: AC_MSG_RESULT([no])
1.105 vatton 501: PNGINCL='-I$(THOTDIR)/libpng -I$(THOTDIR)/libpng/zlib'
1.76 vatton 502: LIBPNG='../libpng.a'
503: LIBZ='../libz.a'
504: )
505: else
1.105 vatton 506: JPEGINCL='-I$(THOTDIR)/libjpeg'
1.76 vatton 507: LIBJPEG='../libjpeg.a'
1.105 vatton 508: PNGINCL='-I$(THOTDIR)/libpng -I$(THOTDIR)/libpng/zlib'
1.76 vatton 509: LIBPNG='../libpng.a'
510: LIBZ='../libz.a'
511: fi
512: dnl
513: AC_SUBST(LIBJPEG)
514: AC_SUBST(LIBPNG)
515: AC_SUBST(LIBZ)
516: AC_SUBST(MAKEJPEG)
517: AC_SUBST(MAKEPNG)
518:
1.119 vatton 519: AMAYA_VER="8.2"
1.1 cvs 520:
521: dnl
1.6 cvs 522: dnl We use a special versoin of cextract patched for alignment
523: dnl to build the signatures of the modules functions located in f subdirs
524: dnl
525: CEXTRACT_VER="1.7"
526: CEXTRACT_FLAGS="+O"
527:
1.3 cvs 528:
529: dnl
1.9 cvs 530: dnl Adjust the some variables depending on the host and compiler
1.61 cvs 531: dnl Thotlib NEED signed chars !!!
1.7 cvs 532: dnl
533:
534: if test "${CC}" = "gcc" ; then
1.44 cvs 535: CFLAGS="${CFLAGS} -W "
1.7 cvs 536: case "${host}" in
537: *-*-irix5* | *-*irix6* )
538: CFLAGS="${CFLAGS} -fsigned-char"
539: ;;
540: esac
1.14 cvs 541: fi
542:
543: if test "$ac_cv_c_const" = "no" ; then
544: CFLAGS="${CFLAGS} -DCONST= "
1.7 cvs 545: fi
546:
1.122 gully 547:
548: # force C mode (-x c)
1.123 gully 549: CFLAGS="${CFLAGS} -x c"
1.122 gully 550:
551: # C++ options (-x c++)
552: CXX_OPTIONS="-D__cplusplus"
1.123 gully 553: CXXFLAGS="${CXXFLAGS} -W -x c++ ${CXX_OPTIONS}"
1.122 gully 554:
1.132 gully 555: # setup LDFLAGS
556: # on macosx, specific flags must be set to avoid conflicts with allready installed libwww
557: # for exemple it's possible to install libwww with fink (fink install libwww)
558: # to avoid conflicts, we just force the linker to search for specified amaya path first
1.133 gully 559: if test "$OS_OPTIONS" = "-D_UNIX -D_MACOS" ; then
1.132 gully 560: LDFLAGS="-Wl,-search_paths_first"
561: else
562: LDFLAGS=""
563: fi
1.128 gully 564:
565: dnl
1.61 cvs 566: dnl Check for availability of amaya sources
1.1 cvs 567: dnl
568:
569: build_amaya="yes"
570:
571: if test "$with_amaya" = "no" ; then
572: build_amaya="no"
1.45 cvs 573: else
574: if test ! -f $srcdir/amaya/Makefile.in ; then
1.1 cvs 575: AC_MSG_WARN(Amaya browser/editor sources not found, disabling Amaya build !)
576: build_amaya="no"
1.45 cvs 577: fi
1.1 cvs 578: fi
579:
580: dnl
1.50 cvs 581: dnl Check for additionnal packages
1.1 cvs 582: dnl use AC_CONFIG_SUBDIRS to launch configure in the subdir
583: dnl
1.93 kahan 584:
1.75 cheyroul 585: if test "$with_gl" = "yes" ; then
1.139 carcone 586: # setup a list of standard paths int LDFLAGS
587: # for AC_CHECK_LIB library existance checks
1.140 ! carcone 588: LIBS_OLD=$LIBS
1.139 carcone 589: LDFLAGS_OLD=$LDFLAGS
590: LDFLAGS="-L/usr/X11R6/lib -L/usr/lib -L/usr/local/lib"
1.75 cheyroul 591: AC_MSG_CHECKING([OpenGL])
592: for ac_dir in \
593: /usr/include \
594: /usr/X11R6/include \
595: /usr/local/include \
596: ; \
1.80 cheyroul 597: do if test -r "$ac_dir/GL/gl.h" ; then
1.75 cheyroul 598: gl_inc="yes"
1.80 cheyroul 599: GL_INC_I="$ac_dir"
600: if test "$ac_dir" != "/usr/include" ; then
601: GL_INCLUDES="-I$ac_dir"
602: fi
1.139 carcone 603: AC_CHECK_LIB(GL,glBegin,,AC_MSG_ERROR(Cannot find OpenGL library. Please install OpenGL.))
1.96 cheyroul 604: AC_MSG_RESULT([yes])
1.139 carcone 605: break
606: fi
1.80 cheyroul 607: done
608: AC_MSG_CHECKING([GLU])
1.75 cheyroul 609: for ac_dir in \
610: /usr/include \
611: /usr/X11R6/include \
612: /usr/local/include \
613: ; \
1.138 gully 614: do if test -r "$ac_dir/GL/glu.h" ; then
1.75 cheyroul 615: glu_inc="yes"
1.80 cheyroul 616: GL_INC_II="$ac_dir"
617: if test "$ac_dir" != "/usr/include" ; then
618: if test "$ac_dir" != "$GL_INC_I" ; then
619: GL_INCLUDES="$GL_INCLUDES -I$ac_dir"
620: fi
621: fi
1.138 gully 622: # now test that glu version is >= 1.2
1.139 carcone 623: AC_CHECK_LIB(GLU,gluNewTess,,AC_CHECK_LIB(glu32,gluNewTess,,AC_MSG_ERROR(Cannot find OpenGL GLU lib or existing version is < 1.2. Pease upgrade your GLU library.)))
1.96 cheyroul 624: AC_MSG_RESULT([yes])
1.139 carcone 625: break
626: fi
1.132 gully 627: done
1.139 carcone 628: LDFLAGS=$LDFLAGS_OLD
1.140 ! carcone 629: LIBS=$LIBS_OLD
1.139 carcone 630:
1.132 gully 631: # check for gtkglarea.h only if gtk gui is selected
632: if test "$with_gtk" = "yes" ; then
633: AC_MSG_CHECKING([GTKGLAREA])
634: for ac_dir in \
635: /usr/include/GL \
1.75 cheyroul 636: /usr/include \
637: /usr/X11R6/include/GL \
638: /usr/X11R6/include \
639: /usr/local/include \
640: /usr/local/include/GL \
641: ; \
1.132 gully 642: do if test -r "$ac_dir/gtkgl/gtkglarea.h" ; then
643: gtkgl_inc="yes"
644: if test "$ac_dir" != "/usr/include" ; then
645: if test "$ac_dir" != "$GL_INC_II" ; then
646: if test "$ac_dir" != "$GL_INC_I" ; then
647: GL_INCLUDES="$GL_INCLUDES -I$ac_dir"
648: fi
649: fi
650: fi
651: AC_MSG_RESULT([yes])
652: break
653: fi
654: done
655: GTKGL_LIBS="-lgtkgl"
656: else
657: gtkgl_inc="ignore"
658: GTKGL_LIBS=""
659: fi
660:
1.80 cheyroul 661: AC_MSG_CHECKING([freetype])
662: for ac_dir in \
663: /usr/include \
664: /usr/X11R6/include \
665: /usr/local/include \
1.132 gully 666: /opt/local/include \
667: /usr/X11R6/include/freetype2 \
1.80 cheyroul 668: ; \
669: do if test -r "$ac_dir/ft2build.h" ; then
670: freetype_inc="yes"
671: GL_INCLUDES="$GL_INCLUDES `freetype-config --cflags`"
1.96 cheyroul 672: AC_MSG_RESULT([yes])
673: break
674: fi
675: done
1.104 cheyroul 676: AC_MSG_CHECKING([Xft])
677: for ac_dir in \
678: /usr/include \
679: /usr/X11R6/include \
680: /usr/local/include \
681: /usr/include/X11/Xft \
682: /usr/X11R6/include/X11/Xft \
683: /usr/local/include/X11/Xft \
684: /usr/include/X11/Xft1 \
685: /usr/X11R6/include/X11/Xft1 \
1.113 vatton 686: /usr/include/Xft2/X11/Xft/ \
1.104 cheyroul 687: /usr/local/include/X11/Xft1 \
688: /usr/include/X11/Xft2 \
689: /usr/X11R6/include/X11/Xft2 \
690: /usr/local/include/X11/Xft2 \
691: ; \
692: do if test -r "$ac_dir/Xft.h" ; then
693: xft_inc="yes"
694: GL_INCLUDES="$GL_INCLUDES -I$ac_dir"
695: AC_MSG_RESULT([yes])
696: break
697: fi
698: done
1.96 cheyroul 699: AC_MSG_CHECKING([gcc3])
700: for ac_dir in \
701: /usr/lib \
702: /usr/X11R6/lib \
703: /usr/local/lib \
704: ; \
705: do if test -r "$ac_dir/libstdc++.so.5" ; then
706: stdglu_inc="yes"
707: AC_MSG_RESULT([yes])
708: break
1.80 cheyroul 709: fi
1.96 cheyroul 710: done
711: if test "$gl_inc" = "" ; then
1.75 cheyroul 712: AC_MSG_WARN(Opengl headers (gl.h) not found !!)
713: AC_MSG_WARN(Disabling opengl build !)
714: with_gl="no"
715: GL_OPTIONS=
716: GL_INCLUDES=
717: GL_LIBRARIES=
1.81 cheyroul 718: exit 1;
1.75 cheyroul 719: fi
720: if test "$glu_inc" = "" ; then
721: AC_MSG_WARN(Glu headers (glu.h) not found !!)
722: AC_MSG_WARN(Disabling opengl build !)
1.81 cheyroul 723:
1.75 cheyroul 724: with_gl="no"
725: GL_OPTIONS=
726: GL_INCLUDES=
727: GL_LIBRARIES=
1.81 cheyroul 728: exit 1;
1.75 cheyroul 729: fi
1.132 gully 730:
1.75 cheyroul 731: if test "$gtkgl_inc" = "" ; then
732: AC_MSG_WARN(Gtkglarea headers (gktglarea.h) not found !!)
733: AC_MSG_WARN(Disabling opengl build !)
734: with_gl="no"
735: GL_OPTIONS=
736: GL_INCLUDES=
737: GL_LIBRARIES=
1.81 cheyroul 738: exit 1;
1.75 cheyroul 739: fi
1.132 gully 740:
1.80 cheyroul 741: if test "$freetype_inc" = "" ; then
742: AC_MSG_WARN(Freetype 2 headers (ft2build.h) not found !!)
743: AC_MSG_WARN(Disabling opengl build !)
744: with_gl="no"
745: GL_OPTIONS=
746: GL_INCLUDES=
747: GL_LIBRARIES=
1.81 cheyroul 748: exit 1;
1.80 cheyroul 749: fi
1.104 cheyroul 750: if test "$xft_inc" = "" ; then
751: AC_MSG_WARN(Xft 2 headers (Xft.h) not found !!)
752: AC_MSG_WARN(Disabling opengl build !)
753: with_gl="no"
754: GL_OPTIONS=
755: GL_INCLUDES=
756: GL_LIBRARIES=
757: exit 1;
758: fi
1.75 cheyroul 759: if test "$gl_inc" = "yes" ; then
1.79 cheyroul 760: if test "$glu_inc" = "yes" ; then
1.132 gully 761: if test "$gtkgl_inc" = "yes" -o "$gtkgl_inc" = "ignore" ; then
1.96 cheyroul 762: if test "$freetype_inc" = "yes" ; then
1.104 cheyroul 763: if test "$xft_inc" = "yes" ; then
764: if test "$stdglu_inc" = "yes" ; then
1.132 gully 765: GL_LIBRARIES="-L/usr/lib -L/usr/X11R6/lib -lXmu -lXft -lfreetype -lGL -lGLU ${GTKGL_LIBS} -lstdc++"
1.104 cheyroul 766: else
1.132 gully 767: GL_LIBRARIES="-L/usr/lib -L/usr/X11R6/lib -lXmu -lXft -lfreetype -lGL -lGLU ${GTKGL_LIBS}"
1.104 cheyroul 768: fi
769: GL_OPTIONS="-D_GL"
770: fi
1.80 cheyroul 771: fi
1.75 cheyroul 772: fi
773: fi
774: fi
775: AC_SUBST(GL_INCLUDES)
776: AC_SUBST(GL_LIBRARIES)
1.115 cheyroul 777: dnl PRINTIFNOTGL=" "
778: dnl #NOPRINT="#"
779: NOPRINT=""
780: PRINTIFNOTGL=" print_prog"
1.97 cheyroul 781: else
1.112 cheyroul 782: NOPRINT=""
1.97 cheyroul 783: PRINTIFNOTGL=" print_prog"
1.75 cheyroul 784: fi
1.97 cheyroul 785: AC_SUBST(PRINTIFNOTGL)
1.112 cheyroul 786: AC_SUBST(NOPRINT)
787:
1.76 vatton 788:
789: AC_ARG_ENABLE(svg, [ --disable-svg remove SVG support ])
790: AC_ARG_ENABLE(annot, [ --disable-annot remove Annotations support ])
1.93 kahan 791: AC_ARG_ENABLE(raptor, [ --disable-raptor disable the raptor RDF parser ])
1.116 kahan 792: AC_ARG_ENABLE(redland, [ --enable-redland enable the redland RDF library ])
793: AC_ARG_ENABLE(system-redland, [ --enable-system-redland try the redland RDF system library ])
1.108 kahan 794: AC_ARG_ENABLE(bookmarks, [ --enable-bookmarks enables experimental bookmark support ])
1.76 vatton 795: AC_ARG_ENABLE(generic-xml, [ --disable-generic-xml remove Generic XML support ])
796:
1.75 cheyroul 797: dnl
1.21 cvs 798: dnl plugins support is disabled by default
1.8 cvs 799: dnl
1.13 cvs 800:
801: if test "$with_plugin" = "" ; then
1.21 cvs 802: if test "$enable_plugin" = "yes" ; then
1.55 kahan 803: with_plugin="yes"
1.21 cvs 804: else
1.17 cvs 805: with_plugin="no"
806: fi
1.10 cvs 807: fi
1.1 cvs 808:
1.8 cvs 809: dnl
1.68 vatton 810: dnl svg is enabled by default
1.26 cvs 811: dnl
1.68 vatton 812: if test "$with_svg" = "" ; then
813: if test "$enable_svg" = "no" ; then
814: with_svg="no"
1.49 cvs 815: else
1.68 vatton 816: with_svg="yes"
1.26 cvs 817: fi
818: fi
819:
820: dnl
1.56 kahan 821: dnl annotations is enabled by default
1.47 cvs 822: dnl
823: if test "$with_annot" = "" ; then
1.56 kahan 824: if test "$enable_annot" = "no" ; then
825: with_annot="no"
826: else
1.54 cvs 827: with_annot="yes"
1.47 cvs 828: fi
1.99 kahan 829: else
830: with_annot="yes"
1.47 cvs 831: fi
832:
1.93 kahan 833:
834: dnl
835: dnl The raptor RDF parser is enabled by default
836: dnl
837: if test "$with_raptor" = "" ; then
838: if test "$enable_raptor" = "no" ; then
839: with_raptor="no"
840: else
1.99 kahan 841: with_raptor="yes"
1.93 kahan 842: fi
1.99 kahan 843: else
844: with_raptor="yes"
1.93 kahan 845: fi
846:
1.70 kahan 847: dnl
1.116 kahan 848: dnl The redland library is disabled by default
1.109 kahan 849: dnl
850: if test "$with_redland" = "" ; then
851: if test "$enable_redland" = "yes" ; then
852: with_redland="yes"
853: else
854: with_redland="no"
855: fi
856: else
857: with_redland="no"
858: fi
859:
860: dnl
1.116 kahan 861: dnl The redland library is disabled by default
862: dnl
863: if test "$with_system_redland" = "" ; then
864: if test "$enable_system_redland" = "yes" ; then
865: with_redland="yes"
866: with_system_redland="yes"
867: else
868: with_system_redland="no"
869: fi
870: else
871: with_system_redland="no"
872: fi
873:
874: dnl
875: dnl The bookmarks support is disabled by default
1.108 kahan 876: dnl
877: if test "$with_bookmarks" = "" ; then
878: if test "$enable_bookmarks" = "yes" ; then
879: with_bookmarks="yes"
1.125 vatton 880: with_redland="yes"
1.108 kahan 881: else
882: with_bookmarks="no"
883: fi
884: else
885: with_bookmarks="no"
886: fi
887:
888: dnl
1.70 kahan 889: dnl Generic XML support enabled by default
890: dnl
891: if test "$with_generic_xml" = "" ; then
892: if test "$enable_generic_xml" = "no" ; then
893: with_generic_xml="no"
894: GENERIC_XML_OPTIONS=
895: else
896: with_generic_xml="yes"
897: GENERIC_XML_OPTIONS=-DXML_GENERIC
898: fi
899: fi
900:
1.120 gully 901: AC_ARG_WITH(dav, [ --with-dav enable WebDAV support (experimental) ])
1.88 kirschpi 902: dnl
903: dnl DAV support disabled by default
904: dnl
905: if test "$with_dav" = "" ; then
906: if test "$enable_dav" = "yes" ; then
907: with_dav="yes"
908: else
909: with_dav="no"
910: fi
911: fi
912:
913: if test "$with_dav" = "yes" ; then
914: DAV_OPTIONS=-DDAV
1.90 kirschpi 915: DAVDIR="davlib"
916: LIBDAV="libwwwdav"
917: WITHDAV="--with-dav"
918: WWWDAV="-lwwwdav"
1.88 kirschpi 919: else
920: with_dav="no"
921: DAV_OPTIONS=""
1.90 kirschpi 922: DAVDIR=""
923: LIBDAV=""
924: WITHDAV=""
925: WWWDAV=""
1.88 kirschpi 926: fi
927:
1.70 kahan 928:
1.19 cvs 929: if test "$build_amaya" = "yes" ; then
1.43 cvs 930: if test ! -f $srcdir/../libwww/Makefile.in ; then
1.50 cvs 931: AC_MSG_WARN(libwww sources not found !!)
932: AC_MSG_WARN(Disabling Amaya build !)
933: build_amaya="no"
1.1 cvs 934: fi
1.8 cvs 935:
936: if test ! -f $srcdir/amaya/MathML.S ; then
1.10 cvs 937: if test "$with_math" = "yes" ; then
1.8 cvs 938: AC_MSG_WARN(MathML sources not found !!)
1.26 cvs 939: AC_MSG_WARN(Disabling Math build !)
1.10 cvs 940: with_math="no"
941: MATH_OPTIONS=
1.8 cvs 942: fi
943: fi
1.26 cvs 944:
1.68 vatton 945: if test ! -f $srcdir/amaya/SVG.S ; then
946: if test "$with_svg" = "yes" ; then
947: AC_MSG_WARN(SVG sources not found !!)
948: AC_MSG_WARN(Disabling SVG build !)
949: with_svg="no"
950: SVG_OPTIONS=
1.26 cvs 951: fi
952: fi
953:
1.48 cvs 954: if test ! -f $srcdir/annotlib/Makefile.in ; then
1.47 cvs 955: if test "$with_annot" = "yes" ; then
956: AC_MSG_WARN(Annotation makefile not found !!)
957: AC_MSG_WARN(Disabling Annotations build !)
958: with_annot="no"
959: fi
960: fi
1.55 kahan 961:
1.109 kahan 962: if test "$with_raptor" = "yes" -a "$with_redland" = "yes" ; then
963: AC_MSG_WARN(Disabling raptor build as redland is enabled !)
964: MAKERAPTOR=['#']
965: with_raptor="no"
966: fi
967:
1.108 kahan 968: if test "$with_raptor" = "yes" -a "$with_annot" = "no" ; then
1.93 kahan 969: AC_MSG_WARN(Disabling raptor build as annotations are disabled !)
970: MAKERAPTOR=['#']
971: with_raptor="no"
972: fi
973:
1.108 kahan 974: if test "$with_raptor" = "yes" -a ! -d "$srcdir/libraptor" ; then
975: AC_MSG_WARN(Raptor source dir not found !!)
976: AC_MSG_WARN(Disabling raptor build !)
977: MAKERAPTOR=['#']
978: with_raptor="no"
1.109 kahan 979: fi
980:
981: if test "$with_raptor" = "yes" ; then
1.108 kahan 982: AMAYA_ANNOT_OPTIONS="$AMAYA_ANNOT_OPTIONS -DRAPTOR_RDF_PARSER -I\$(THOTDIR)/libraptor"
983: AMAYA_RAPTOR_LIBS="../libraptor/.libs/libraptor.a"
984: AMAYA_RAPTOR_SRC="amaya_comp_libraptor"
985: AMAYA_RAPTOR_INCLUDES="-I\$(THOTDIR)/libraptor"
986: fi
987:
1.109 kahan 988: if test "$with_redland" = "yes" -a "$with_annot" = "no" ; then
989: AC_MSG_WARN(Disabling redland build as annotations are disabled !)
990: MAKEREDLAND=['#']
991: with_redland="no"
992: fi
993:
1.116 kahan 994: redland_compile_source=yes
995: if test "$with_redland" = "yes" -a "$with_system_redland" = "yes" ; then
996: # check to see if we have a redland library
997: AC_MSG_CHECKING(system redland library)
1.118 kahan 998: redland_min_version=0.9.14
1.116 kahan 999: REDLAND_CONFIG="redland-config"
1000: REDLAND_VERSION=`$REDLAND_CONFIG --version`
1001: redland_version_dec=`echo $REDLAND_VERSION | awk -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'`
1002: redland_min_version_dec=`echo $redland_min_version | awk -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'`
1003: if test $redland_version_dec -lt $redland_min_version_dec; then
1004: AC_MSG_RESULT(no - found version $REDLAND_VERSION and minimal version is $redland_min_version)
1005: else
1006: AC_MSG_RESULT(yes - found version $REDLAND_VERSION)
1007: AC_MSG_CHECKING(checking for redland headers)
1.117 kahan 1008: dnl We should use awk here and remove the -I from the following line
1009: dnl REDLAND_HEADERS=`$REDLAND_CONFIG --cflags`
1010: REDLAND_HEADERS=""
1011: if test -e "/usr/include/redland.h" ; then
1012: REDLAND_HEADERS="/usr/include";
1013: else
1014: if test -e "/usr/local/include/redland.h" ; then
1015: REDLAND_HEADERS="/usr/local/include";
1016: fi
1017: fi
1018: if test $REDLAND_HEADERS != ""; then
1.116 kahan 1019: AC_MSG_RESULT(yes - have development version)
1020: redland_compile_source=no
1021: else
1022: AC_MSG_RESULT(no - no development version)
1023: fi
1024: fi
1025: fi
1026:
1027: if test "$with_redland" = "yes" -a "$redland_compile_source" = "yes" \
1028: -a ! -d "$srcdir/../redland" ; then
1.109 kahan 1029: AC_MSG_WARN(Redland source dir not found !!)
1030: AC_MSG_WARN(Disabling redland build !)
1031: MAKEREDLAND=['#']
1032: with_redland="no"
1033: fi
1034:
1035: if test "$with_redland" = "yes" ; then
1.116 kahan 1036: AMAYA_ANNOT_OPTIONS="$AMAYA_ANNOT_OPTIONS -DLIBRDF_INTERNAL=1 -DAM_REDLAND -DRAPTOR_RDF_PARSER"
1037: if test "$redland_compile_source" = "yes" ; then
1038: AMAYA_RAPTOR_SRC="amaya_comp_redland"
1039: AMAYA_ANNOT_OPTIONS="$AMAYA_ANNOT_OPTIONS -I\$(THOTDIR)/../redland/librdf -I\$(THOTDIR)/../redland/raptor"
1040: AMAYA_RAPTOR_LIBS="../redland/librdf/.libs/librdf.a ../redland/raptor/.libs/libraptor.a"
1041: AMAYA_RAPTOR_INCLUDES="-I\$(THOTDIR)/../redland/librdf -I\$(THOTDIR)/../redland/raptor"
1042: else
1043: MAKEREDLAND=['#']
1044: AMAYA_RAPTOR_SRC=
1045: redland_includes=`$REDLAND_CONFIG --cflags`
1046: redland_libs=`$REDLAND_CONFIG --libs`
1047: AMAYA_ANNOT_OPTIONS="$AMAYA_ANNOT_OPTIONS"
1048: AMAYA_ANNOT_INCLUDES="$redland_includes -I\$(THOTDIR)/thotlib/include"
1049: AMAYA_ANNOT_EXTRA_LIBS="$redland_libs"
1050: AMAYA_RAPTOR_INCLUDES="$redland_includes"
1051: fi
1.109 kahan 1052: fi
1053:
1.116 kahan 1054:
1.108 kahan 1055: dnl control whether we should build the bookmarks support
1056: if test "$with_bookmarks" = "yes" -a "$with_annot" = "no" ; then
1057: AC_MSG_WARN(Disabling bookmarks build as annotations are disabled !)
1058: with_bookmarks="no"
1059: fi
1.109 kahan 1060: if test "$with_bookmarks" = "yes" -a "$with_redland" = "no" ; then
1061: AC_MSG_WARN(Disabling bookmarks build as redland is disabled !)
1.108 kahan 1062: with_bookmarks="no"
1063: fi
1064: if test "$with_bookmarks" = "yes" ; then
1065: ANNOTLIB_COMPILE_BM=
1066: AMAYA_ANNOT_OPTIONS="$AMAYA_ANNOT_OPTIONS -DBOOKMARKS"
1067: else
1068: ANNOTLIB_COMPILE_BM=['#']
1069: fi
1070:
1.93 kahan 1071: dnl control whether we should use libwww's rdf parser
1.109 kahan 1072: if test "$with_raptor" = "yes" -o "$with_redland" = "yes"; then
1.93 kahan 1073: dnl not all the function calls have been cleared as of today,
1074: dnl we still need libwww's rdf parser
1.98 kahan 1075: MAKE_LIBWWW_RDF_PARSER=
1076: LIBWWW_RDF_PARSER=
1.93 kahan 1077: else
1078: MAKE_LIBWWW_RDF_PARSER="libwwwxml"
1079: LIBWWW_RDF_PARSER="-lwwwxml"
1080: fi
1.70 kahan 1081:
1.55 kahan 1082: if test "$with_plugin" = "yes" ; then
1083: AC_MSG_WARN(The plugin library isn't supported anymore in Amaya !!)
1084: AC_MSG_WARN(Disabling plugin build !)
1085: with_plugin="no"
1086: fi
1087:
1.88 kirschpi 1088:
1089: if test ! -f $srcdir/davlib/Makefile.in ; then
1090: if test "$with_dav" = "yes" ; then
1091: AC_MSG_WARN(WebDAV makefile not found !!)
1092: AC_MSG_WARN(Disabling WebDAV build !)
1093: with_dav="no"
1.90 kirschpi 1094: DAVDIR=""
1095: LIBDAV=""
1096: WITHDAV=""
1097: WWWDAV=""
1.88 kirschpi 1098: fi
1099: fi
1100:
1101:
1.1 cvs 1102: fi
1103:
1104: dnl
1105: dnl The options for each library or binary
1106: dnl
1107:
1.134 gully 1108: THOT_OPTIONS="$OS_OPTIONS $GTK_OPTIONS $GL_OPTIONS $WX_OPTIONS $NOGUI_OPTIONS"
1109: AMAYA_OPTIONS="$OS_OPTIONS $MATH_OPTIONS $SVG_OPTIONS $GENERIC_XML_OPTIONS $GTK_OPTIONS $GL_OPTIONS $WX_OPTIONS $NOGUI_OPTIONS"
1.58 cvs 1110: #PLUGIN_OPTIONS="-DPLUGIN_TRACE -DXP_UNIX"
1.129 vatton 1111: AMAYA_ANNOT_OPTIONS="$OS_OPTIONS $AMAYA_ANNOT_OPTIONS"
1.101 kahan 1112:
1.102 kahan 1113: IMGLIBS="-ljpeg -lpng -lz"
1.132 gully 1114:
1.3 cvs 1115: EXTRA_LIBS=
1.131 gully 1116: EXTRA_INCLUDES=
1117:
1118: # check for malloc.h
1119: # on macosx, this file is not at the right place
1120: for ac_dir in \
1121: /usr/include/malloc/ \
1122: /sw/include/malloc/ \
1123: ; \
1124: do
1125: if test -r "$ac_dir/malloc.h"; then
1126: echo "found malloc.h"
1127: EXTRA_INCLUDES="${EXTRA_INCLUDES} -I$ac_dir"
1128: break
1129: fi
1130: done
1.1 cvs 1131:
1132: dnl
1133: dnl Set up the PATHs needed
1134: dnl
1135:
1136: API="\$(THOTDIR)/thotlib/include"
1137: VAR="\$(THOTDIR)/thotlib/internals/var"
1138: INCL="\$(THOTDIR)/thotlib/internals/h"
1139: FUNC="\$(THOTDIR)/thotlib/internals/f"
1140:
1141: dnl
1142: dnl Set up the include variables.
1143: dnl
1144:
1.61 cvs 1145: THOTINCLUDES="-I${API} -I${VAR} -I${INCL} -I${FUNC} ${JPEGINCL} ${PNGINCL}"
1.58 cvs 1146: APIINCLUDES=-I${API}
1147:
1148: if test "${VPATHOPT}" = "" ; then
1.1 cvs 1149: VPATHOPT="VPATH"
1150: fi
1151:
1152: dnl
1153: dnl Exports the current values of the variables.
1154: dnl
1155:
1156: AC_SUBST(AMAYA_VER)
1.6 cvs 1157: AC_SUBST(CEXTRACT_VER)
1158: AC_SUBST(CEXTRACT_FLAGS)
1.1 cvs 1159:
1160: AC_SUBST(THOTINCLUDES)
1161: AC_SUBST(APIINCLUDES)
1162: AC_SUBST(VPATHOPT)
1163:
1.63 vatton 1164: AC_SUBST(GTK_OPTIONS)
1.1 cvs 1165: AC_SUBST(THOT_OPTIONS)
1166: AC_SUBST(AMAYA_OPTIONS)
1167: AC_SUBST(PLUGIN_OPTIONS)
1.48 cvs 1168: AC_SUBST(AMAYA_ANNOT_OPTIONS)
1.110 kahan 1169: AC_SUBST(AMAYA_ANNOT_INCLUDES)
1.116 kahan 1170: AC_SUBST(AMAYA_ANNOT_EXTRA_LIBS)
1.1 cvs 1171: AC_SUBST(IMGLIBS)
1.3 cvs 1172: AC_SUBST(EXTRA_LIBS)
1.131 gully 1173: AC_SUBST(EXTRA_INCLUDES)
1.90 kirschpi 1174:
1175: AC_SUBST(DAVDIR)
1176: AC_SUBST(LIBDAV)
1177: AC_SUBST(WITHDAV)
1178: AC_SUBST(WWWDAV)
1.1 cvs 1179:
1.93 kahan 1180: AC_SUBST(MAKERAPTOR)
1.109 kahan 1181: AC_SUBST(MAKEREDLAND)
1.108 kahan 1182: AC_SUBST(ANNOTLIB_COMPILE_BM)
1.109 kahan 1183: AC_SUBST(AMAYA_RAPTOR_SRC)
1.93 kahan 1184: AC_SUBST(AMAYA_RAPTOR_LIBS)
1185: AC_SUBST(AMAYA_RAPTOR_INCLUDES)
1186: AC_SUBST(MAKE_LIBWWW_RDF_PARSER)
1187: AC_SUBST(LIBWWW_RDF_PARSER)
1188:
1189: AC_SUBST(SUBDIRS)
1190:
1.1 cvs 1191: dnl
1.48 cvs 1192: dnl Include the option Makefile.xxx fragment according to the configure options
1.1 cvs 1193: dnl
1194:
1195: if test "$with_plugin" = "yes" ; then
1.50 cvs 1196: AC_SUBST_FILE(plugin_frag)
1.1 cvs 1197: plugin_frag=$srcdir/pluginlib/Makefile.plugin
1198: else
1199: AC_SUBST_FILE(plugin_frag)
1200: plugin_frag=/dev/null
1201: fi
1202:
1203: AC_SUBST_FILE(www_frag)
1.49 cvs 1204: www_frag=$srcdir/amaya/Makefile.libwww
1.1 cvs 1205:
1.50 cvs 1206: if test "$with_math" = "no" ; then
1.10 cvs 1207: AC_SUBST_FILE(math_frag)
1.50 cvs 1208: math_frag=/dev/null
1.8 cvs 1209: else
1.10 cvs 1210: AC_SUBST_FILE(math_frag)
1.50 cvs 1211: math_frag=$srcdir/amaya/Makefile.math
1.8 cvs 1212: fi
1213:
1.68 vatton 1214: if test "$with_svg" = "no" ; then
1215: AC_SUBST_FILE(svg_frag)
1216: svg_frag=/dev/null
1.26 cvs 1217: else
1.68 vatton 1218: AC_SUBST_FILE(svg_frag)
1219: svg_frag=$srcdir/amaya/Makefile.svg
1.26 cvs 1220: fi
1221:
1.47 cvs 1222: if test "$with_annot" = "yes" ; then
1223: AC_SUBST_FILE(annot_frag)
1.48 cvs 1224: annot_frag=$srcdir/annotlib/Makefile.annot
1.47 cvs 1225: else
1226: AC_SUBST_FILE(annot_frag)
1227: annot_frag=/dev/null
1228: fi
1229:
1.88 kirschpi 1230: if test "$with_dav" = "yes" ; then
1231: AC_SUBST_FILE(dav_frag)
1232: dav_frag=$srcdir/davlib/Makefile.dav
1233: fi
1.16 cvs 1234:
1.1 cvs 1235: dnl ***************************************************************
1236: dnl
1237: dnl FINAL STEP : PRODUCE ALL THE MAKEFILES AND CONFIG FILES
1238: dnl
1239: dnl ***************************************************************
1240:
1241: EXTRA_MAKEFILE_IN=
1.2 cvs 1242: make_output="Makefile Options.orig:Options.in tools/Makefile \
1.1 cvs 1243: libjpeg/Makefile libpng/Makefile libpng/zlib/Makefile \
1.2 cvs 1244: tools/mkdep/Makefile \
1.1 cvs 1245: tools/cextract-1.7/Makefile thotlib/Makefile \
1.127 vatton 1246: thotlib/include/Makefile batch/Makefile"
1.1 cvs 1247:
1248: if test "$build_amaya" = "yes" ; then
1.2 cvs 1249:
1.19 cvs 1250: make_output="$make_output amaya/Makefile pluginlib/Makefile"
1.2 cvs 1251: EXTRA_MAKEFILE_IN="$srcdir/amaya/Makefile.in \
1.93 kahan 1252: $srcdir/amaya/Makefile.libwww"
1.27 cvs 1253:
1254: if test "$$with_plugin" = "yes" ; then
1255: make_output="$make_output pluginlib/Makefile"
1256: EXTRA_MAKEFILE_IN="$srcdir/pluginlib/Makefile.in \
1.93 kahan 1257: $srcdir/pluginlib/Makefile.plugin"
1.27 cvs 1258: fi
1.2 cvs 1259:
1.48 cvs 1260: if test "$with_annot" = "yes" ; then
1261: make_output="$make_output annotlib/Makefile"
1262: EXTRA_MAKEFILE_IN="$srcdir/annotlib/Makefile.in"
1263: fi
1.88 kirschpi 1264:
1265: if test "$with_dav" = "yes" ; then
1266: make_output="$make_output davlib/Makefile"
1267: EXTRA_MAKEFILE_IN="$srcdir/davlib/Makefile.in"
1268: fi
1269:
1.1 cvs 1270: fi
1271:
1272: AC_SUBST(EXTRA_MAKEFILE_IN)
1.6 cvs 1273: AC_OUTPUT($make_output , [
1274: dnl
1275: dnl This fragment of shell code is executed after the
1276: dnl Makefile(s) dump ...
1277: dnl
1278:
1279: echo timestamp > stamp-h
1280:
1281: dnl
1282: dnl Check for an upgrade in the Options numbers
1283: dnl
1284:
1285: if test -f Options ; then
1286: oldversion=`grep Version Options`
1287: newversion=`grep Version Options.orig`
1288: if test "$oldversion" != "$newversion" ; then
1289: echo WARNING : Options files have changed, old options saved to Options.old
1290: cp Options Options.old
1291: cp Options.orig Options
1292: exit 1
1293: fi
1294: fi
1295: ])
1.1 cvs 1296:
1297: if test "$build_amaya" = "yes" ; then
1.50 cvs 1298: echo Amaya configured with libWWW
1299: if test "$with_plugin" = "yes" ; then
1300: echo Amaya configured with Plugins support
1.8 cvs 1301: fi
1.10 cvs 1302: if test "$with_math" = "yes" ; then
1303: echo Amaya configured with Math support
1.26 cvs 1304: fi
1.68 vatton 1305: if test "$with_svg" = "yes" ; then
1306: echo Amaya configured with SVG support
1.47 cvs 1307: fi
1308: if test "$with_annot" = "yes" ; then
1309: echo Amaya configured with Annotations support
1.70 kahan 1310: fi
1.93 kahan 1311: if test "$with_raptor" = "yes" ; then
1.106 kahan 1312: echo Amaya configured with the Raptor RDF parser
1.109 kahan 1313: fi
1314: if test "$with_redland" = "yes" ; then
1.116 kahan 1315: if test "$with_system_redland" = "no" ; then
1316: echo Amaya configured with the Redland RDF library \(local source\)
1317: else
1318: echo Amaya configured with the Redland RDF library \(system\)
1319: fi
1.108 kahan 1320: fi
1321: if test "$with_bookmarks" = "yes" ; then
1322: echo Amaya configured with bookmarks support \(experimental\)
1.93 kahan 1323: fi
1.70 kahan 1324: if test "$with_generic_xml" = "yes" ; then
1325: echo Amaya configured with generic XML suppport
1326: fi
1.129 vatton 1327: echo Amaya configured with internationalization suppport
1.75 cheyroul 1328: if test "$with_gl" = "yes" ; then
1.128 gully 1329: echo Amaya configured with OpenGL Canvas Rendering \(experimental\)
1.88 kirschpi 1330: fi
1331: if test "$with_dav" = "yes" ; then
1332: echo Amaya configured with WebDAV support \(experimental\)
1.1 cvs 1333: fi
1.5 cvs 1334: fi
1335:
1.107 kahan 1336: if test "$no_graphic" = "yes" ; then
1337: echo "Amaya configured with system graphic libraries (libjpeg, libpng, zlib)"
1338: else
1339: echo "Amaya configured with static graphic libraries (libjpeg, libpng, zlib)"
1340: if test "$with_gtk" = "yes" -o "$with_gl" = "yes" ; then
1341: echo " N.B. This option may not work in your platform. If Amaya crashes"
1342: echo " when opening a PNG file. Recompile it using the system libraries."
1343: fi
1344: fi
1345:
1346: if test "$with_gtk" = "yes" ; then
1.67 vatton 1347: echo "Amaya configured with GTK"
1.120 gully 1348: fi
1349:
1.124 gully 1350: if test "$with_wx" = "yes" ; then
1.136 gully 1351: if test "$with_wxdebug" = "yes" ; then
1352: echo "Amaya configured with wxWidgets (experimental) [with debug]"
1353: else
1354: echo "Amaya configured with wxWidgets (experimental)"
1355: fi
1.1 cvs 1356: fi
1357:
1.121 gully 1358: if test "$with_nogui" = "yes" ; then
1.128 gully 1359: echo "Amaya configured without GUI toolkit"
1.121 gully 1360: fi
1.136 gully 1361:
1362:
1.107 kahan 1363: echo ""
1.78 vatton 1364: echo "Now type \"make\" (GNU make preferably) to build the binaries"
1.107 kahan 1365: echo ""
1.120 gully 1366:
Webmaster