Annotation of Amaya/configure.in, revision 1.178
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:
1.171 vatton 71:
1.1 cvs 72: dnl
73: dnl Checks for libraries.
74: dnl
75:
76: AC_CHECK_LIB(socket, socket, )
77: AC_CHECK_LIB(inet, connect)
78: AC_CHECK_LIB(nsl, t_accept)
79: AC_CHECK_LIB(dl, dlopen)
1.141 gully 80: #AC_PATH_X
81: #AC_PATH_XTRA
1.1 cvs 82:
1.41 cvs 83: dnl
1.5 cvs 84: dnl Checks for header files.
85: dnl
86:
87: AC_HEADER_DIRENT
88: AC_HEADER_STDC
89: AC_HEADER_SYS_WAIT
90:
91: AC_CHECK_HEADERS(stdio.h)
92: AC_CHECK_HEADERS(sys/types.h types.h)
93: AC_CHECK_HEADERS(sys/unistd.h unistd.h)
94: AC_CHECK_HEADERS(sys/fcntl.h fcntl.h)
95: AC_CHECK_HEADERS(sys/limits.h limits.h)
96: AC_CHECK_HEADERS(sys/stat.h stat.h)
97: AC_CHECK_HEADERS(sys/file.h)
98: AC_CHECK_HEADERS(sys/ioctl.h)
99: AC_CHECK_HEADERS(sys/time.h time.h)
100: AC_CHECK_HEADERS(sys/systeminfo.h)
1.46 cvs 101: AC_CHECK_HEADERS(sys/string.h strings.h)
1.34 cvs 102: AC_CHECK_HEADERS(sys/syslog.h syslog.h)
1.5 cvs 103: AC_CHECK_HEADERS(sys/socket.h socket.h)
1.131 gully 104:
105: # SG: not used ? => do not compile on macosx
106: # AC_CHECK_HEADERS(appkit/appkit.h appkit.h)
107: # AC_CHECK_HEADERS(apppkit/apppkit.h apppkit.h)
108:
1.5 cvs 109: AC_CHECK_HEADERS(netinet/in.h in.h)
110: AC_CHECK_HEADERS(dn.h)
111: AC_CHECK_HEADERS(sys/ipc.h)
112: AC_CHECK_HEADERS(net/errno.h sys/errno.h errno.h)
113: AC_CHECK_HEADERS(pwd.h)
114: AC_CHECK_HEADERS(grp.h)
115: AC_CHECK_HEADERS(arpa/inet.h inet.h)
116: AC_CHECK_HEADERS(netdb.h)
117: AC_CHECK_HEADERS(manifest.h)
118: AC_CHECK_HEADERS(bsdtypes.h)
119: AC_CHECK_HEADERS(stdefs.h)
120: AC_CHECK_HEADERS(bsdtime.h)
121: AC_CHECK_HEADERS(sys/select.h select.h)
122: AC_CHECK_HEADERS(dnetdb.h)
123: AC_CHECK_HEADERS(libc.h)
124: AC_CHECK_HEADERS(stdlib.h)
125: AC_CHECK_HEADERS(malloc.h)
126: AC_CHECK_HEADERS(memory.h)
127: AC_CHECK_HEADERS(unixlib.h)
128: AC_CHECK_HEADERS(ctype.h)
129: AC_CHECK_HEADERS(cursesX.h curses.h)
130: AC_CHECK_HEADERS(sys/resource.h resource.h)
131: AC_HEADER_DIRENT
132: AC_CHECK_HEADERS(dir.h direct.h) dnl AC_HEADER_DIRENT only checks for some..
133: AC_HEADER_STDC
134: AC_HEADER_SYS_WAIT
135: AC_HEADER_TIME
136: AC_HEADER_STAT
1.103 kahan 137: AC_CHECK_HEADERS(stdint.h)
1.5 cvs 138:
139: dnl
140: dnl Checks for typedefs, structures, and compiler characteristics.
141: dnl
142:
143: AC_C_CONST
144: AC_C_INLINE
145: AC_TYPE_MODE_T
146: AC_TYPE_OFF_T
147: AC_TYPE_SIZE_T
148: AC_HEADER_TIME
149: AC_STRUCT_TM
150: AC_STRUCT_TIMEZONE
151: AC_TYPE_UID_T
152:
153: dnl
154: dnl Checks for library functions.
155: dnl
156:
157: AC_FUNC_ALLOCA
158: AC_TYPE_GETGROUPS
159: AC_PROG_GCC_TRADITIONAL
160: AC_FUNC_MEMCMP
161: AC_FUNC_MMAP
162: AC_TYPE_SIGNAL
163: AC_FUNC_VPRINTF
1.58 cvs 164: 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 165:
1.132 gully 166: #
167: # Check for operating system (UNIX / WINDOWS / MACOSX )
168: # ---------->
1.178 ! gully 169: # canonicalize the target OS
! 170: AMAYAOS="LINUX"
1.132 gully 171: case $target_os in
1.178 ! gully 172: aix*) AMAYAOS="LINUX" ;;
! 173: cygwin*) AMAYAOS="WINDOWS" ;;
! 174: darwin*) AMAYAOS="MACOSX" ;;
! 175: freebsd2*) AMAYAOS="LINUX" ;;
! 176: freebsd*) AMAYAOS="LINUX" ;;
! 177: hpux*) AMAYAOS="LINUX" ;;
! 178: irix*) AMAYAOS="LINUX" ;;
! 179: linuxaout*) AMAYAOS="LINUX" ;;
! 180: linux*) AMAYAOS="LINUX" ;;
! 181: mingw32*) AMAYAOS="WINDOWS" ;;
! 182: netbsd*) AMAYAOS="LINUX" ;;
! 183: openbsd*) AMAYAOS="LINUX" ;;
! 184: osf[12]*) AMAYAOS="LINUX" ;;
! 185: osf*) AMAYAOS="LINUX" ;;
! 186: solaris2*) AMAYAOS="LINUX" ;;
! 187: sunos4*) AMAYAOS="LINUX" ;;
! 188: ultrix*) AMAYAOS="LINUX" ;;
! 189: esac
! 190: AC_SUBST(AMAYAOS)
! 191:
! 192: if test "$AMAYAOS" = "WINDOWS" ; then
! 193: AC_MSG_ERROR(Windows port do not use configure - not yet tested.)
! 194: fi
! 195:
! 196: OS_OPTIONS="-D_UNIX" # default is UNIX
! 197: case $AMAYAOS in
! 198: LINUX) OS_OPTIONS="-D_UNIX" ;;
! 199: WINDOWS) OS_OPTIONS="-D_WINDOWS" ;; # not tested (cygwin or mingw)
! 200: MACOSX) OS_OPTIONS="-D_UNIX -D_MACOS" ;;
1.132 gully 201: esac
202:
1.85 vatton 203: AC_ARG_WITH(GL, [ --with-gl enable Opengl canvas (experimental) ])
204: dnl
1.175 gully 205: dnl GL canvas is disabled by default in 8.7.x
206: dnl GL canvas is enabled by default in 9.x
207: dnl - 8.7.x needs : GL, GLX, GLU, freetype2, gtkgl
208: dnl - 9.x needs : GL, GLX, GLU, freetype2, wxGLCanvas
1.85 vatton 209: dnl GL is for opengl
1.175 gully 210: dnl GlX is for XWindow integration
1.85 vatton 211: dnl GLU is for tesselation algortihms (until we extract it from this lib)
212: dnl (tesselation is used for polygons with holes in it...)
213: dnl gtkgl is for integration of opengl in GTK
1.175 gully 214: dnl freetype2 is for text drawing (fonts ...)
215: dnl wxGLCanvas is for integration of opengl in wxWidgets (WX)
1.85 vatton 216: if test "$with_gl" = "" ; then
217: if test "$enable_gl" = "yes" ; then
218: with_gl="yes"
219: else
220: with_gl="no"
221: fi
222: fi
223:
1.120 gully 224: # check if gtk gui should be used
225: AC_ARG_WITH(gtk, [ --with-gtk use GTK GUI toolkit ])
226: if test "$with_gtk" = "yes" -o "$enable_gtk" = "yes" ; then
227: if test "$withval" = "no" ; then
228: with_gtk="no"
229: else
230: with_gtk="yes"
231: fi
232: fi
233:
1.155 carcone 234: # check if mac version is used
235: AC_ARG_WITH(mac, [ --with-mac generate mac version ])
236: if test "$with_mac" = "" ; then
237: if test "$enable_mac" = "yes" ; then
238: with_mac="yes"
239: else
240: with_mac="no"
241: fi
242: fi
243:
1.143 gully 244: # check for mesa library (OpenGL)
1.175 gully 245: AC_ARG_WITH(MESA, [ --with-mesa enable canvas with software OpenGL implementation (Mesa) ])
1.143 gully 246: if test "$with_mesa" = "" ; then
247: if test "$enable_mesa" = "yes" ; then
248: with_mesa="yes"
249: with_gl="no"
250: else
251: with_mesa="no"
252: fi
253: fi
254:
255: # check if wxWidgets gui should be used
256: AC_ARG_WITH(wx, [ --with-wx use wxWidgets GUI toolkit (experimental)])
1.124 gully 257: if test "$with_wx" = "yes" -o "$enable_wx" = "yes" ; then
258: if test "$withval" = "no" ; then
259: with_wx="no"
260: else
261: with_wx="yes"
262: fi
263: fi
264:
1.175 gully 265: # Check if at least one GUI toolkit is enabled
1.134 gully 266: if test "$with_wx" = "no" -o "$with_wx" = "" ; then
267: if test "$with_gtk" = "no" -o "$with_gtk" = "" ; then
268: # Nothing is enable so force the default GUI toolkit (GTK)
269: with_wx="no"
270: with_gtk="yes"
1.85 vatton 271: fi
272: fi
273:
1.176 gully 274: # mesa (software) gl implementation is default with wx (hardware gl implem can be choosen with --with-gl option)
1.175 gully 275: if test "$with_wx" = "yes" ; then
1.176 gully 276: if test "$with_gl" = "no" ; then
277: with_mesa="yes"
1.175 gully 278: fi
279: fi
280:
1.121 gully 281: # check if no gui is enable
1.175 gully 282: AC_ARG_WITH(nogui, [ --with-nogui do not use GUI toolkit (not maintained) ])
1.121 gully 283: if test "$with_nogui" = "yes" -o "$enable_nogui" = "yes" ; then
284: with_nogui="yes"
285: with_gtk="no"
1.134 gully 286: with_wx="no"
1.121 gully 287: NOGUI_OPTIONS="-D_NOGUI"
288: fi
289:
1.136 gully 290: # check if wxWidgets debug is enable
1.155 carcone 291: AC_ARG_WITH(wxdebug, [ --with-wxdebug compiles wxWidgets with debuging options ])
1.136 gully 292: if test "$with_wxdebug" = "yes" ; then
293: with_wxdebug="yes"
294: else
295: with_wxdebug="no"
296: fi
297:
1.153 gully 298: # it is possible to specify wxWidgets library path,
299: # usefull for developpers who want to compile amaya with different wxWidgets version
1.155 carcone 300: AC_ARG_WITH(wxsrcdir, [ --with-wxsrcdir=... compiles Amaya with a specific wxWidgets sources path ])
1.153 gully 301: if test "$with_wxsrcdir" = "" ; then
302: with_wxsrcdir="../../wxWidgets"
303: fi
304:
305:
1.134 gully 306: if test "$with_wx" = "yes" ; then
1.120 gully 307: if test "$with_gtk" = "yes" ; then
308: echo
309: echo "****************************************************************"
310: echo " ERROR: "
311: echo " More than one GUI toolkit is enable"
312: echo " Only one GUI toolkit should be enable (turn off one)"
313: echo " exemple ok : ../configure --with-gtk "
1.134 gully 314: echo " exemple !ok : ../configure --with-gtk --with-wx"
1.120 gully 315: echo "****************************************************************"
316: echo
317: exit 1
318: fi
319: fi
1.134 gully 320:
1.152 gully 321:
322: # setup the AMAYAGUI variable used to identify used GUI when 'make install' is called
323: # now several amaya gui can coexist.
324: if test "$with_gtk" = "yes" ; then
325: AMAYAGUI="gtk"
326: fi
327: if test "$with_gl" = "yes" ; then
328: AMAYAGUI="gl"
329: fi
330: if test "$with_wx" = "yes" ; then
331: AMAYAGUI="wx"
332: fi
333: AC_SUBST(AMAYAGUI)
334:
335:
1.85 vatton 336: if test "$with_gtk" = "yes" ; then
1.134 gully 337: gdkimlib_h_found="no"
1.63 vatton 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:
1.150 gully 359: # SG : lookingfor gtkimlib includes
360: # because not found with gtk-config on macosx
361: gtk_path_for_gdkimlib_h="`gtk-config --prefix`"
362: for ac_dir in \
363: /sw/include/ \
364: /sw/local/include \
365: /usr/include \
366: /usr/local/include \
367: "$gtk_path_for_gdkimlib_h/include" \
368: "$gtk_path_for_gdkimlib_h/local/include" \
369: ; \
370: do
371: if test -r "$ac_dir/gdk_imlib.h"; then
372: echo "found gdk_imlib.h"
373: gdkimlib_h_found="yes"
374: GTK_INCLUDES="${GTK_INCLUDES} -I$ac_dir"
375: break
376: fi
377: done
378:
1.134 gully 379: if test "$gdkimlib_h_found" = "no" ; then
380: echo
381: echo "****************************************************************"
382: echo " ERROR: gdk_imlib.h not found -"
383: echo " [please install imlib developpement package (libimlib1-devel on mandrake)]"
384: echo "****************************************************************"
385: exit 1
386: fi
1.120 gully 387: fi
388:
1.143 gully 389:
390: if test "$with_mesa" = "yes" ; then
391: # --------- compile Mesa library (opengl) --------------- #
392:
393: # check that sources of Mesa exists
394: if test ! -f ../../Mesa/Makefile ; then
395: AC_MSG_ERROR(Mesa library sources not found (opengl). Please download Mesa sources (http://www.mesa3d.org/) or remove --with-gl option !)
396: fi
397:
398: OLDDIR=`pwd`
1.152 gully 399: GL_BUILDDIR="${OLDDIR}/Mesa"
1.143 gully 400:
1.163 gully 401: echo "---> Install Mesa library into ${GL_BUILDDIR}"
1.143 gully 402:
1.163 gully 403: mkdir -p ${GL_BUILDDIR}
404: cp -r ../../Mesa/* ${GL_BUILDDIR}
1.143 gully 405:
1.152 gully 406: echo "---> Install Mesa library into ${GL_BUILDDIR} - DONE"
1.143 gully 407:
408: # this is the flags used to build amaya with OpenGL
409: GL_OPTIONS="-D_GL"
1.152 gully 410: GL_INCLUDES="-I${GL_BUILDDIR}/include"
411: GL_LIBRARIES="-Wl,-rpath,${GL_BUILDDIR}/lib -L${GL_BUILDDIR}/lib -lGL -lGLU"
412: AC_SUBST(GL_BUILDDIR)
1.143 gully 413: AC_SUBST(GL_INCLUDES)
414: AC_SUBST(GL_LIBRARIES)
415: fi
416:
1.124 gully 417: if test "$with_wx" = "yes" ; then
1.153 gully 418: # WX_SRCDIR is better to understand the code than with_wxsrcdir variable
1.165 gully 419: if test ! -f $with_wxsrcdir/Makefile.in ; then
420: $with_wxsrcdir = ../../wxWidgets
421: fi
422: cd $with_wxsrcdir
423: WX_SRCDIR=`pwd`
424: cd -
1.153 gully 425: AC_SUBST(WX_SRCDIR)
426:
1.135 gully 427: # check that sources of wxWidgets exists
1.153 gully 428: if test ! -f $WX_SRCDIR/Makefile.in ; then
429: AC_MSG_ERROR(wxWidgets library sources not found. Please download wxWidgets sources (http://www.wxwidgets.org/), or remove --with-wx option, or check --with-wxsrcdir is correct !)
1.135 gully 430: fi
431:
1.152 gully 432: # --------- configure wxWidgets library --------------- #
1.135 gully 433: echo "---> Configuring wxWidgets library."
434: OLDDIR=`pwd`
1.149 gully 435: # create the build directory (debug or release)
436: if test $with_wxdebug = yes ; then
1.152 gully 437: WX_BUILDDIR="wxWidgets_DEBUG"
1.149 gully 438: else
1.152 gully 439: WX_BUILDDIR="wxWidgets_RELEASE"
1.149 gully 440: fi
1.152 gully 441: mkdir -p $WX_BUILDDIR
442: cd $WX_BUILDDIR
443: AC_SUBST(WX_BUILDDIR)
1.136 gully 444:
1.149 gully 445: # remove old configure cached options
1.135 gully 446: rm -f configarg.cache
1.136 gully 447:
448: # setup configure options
1.158 gully 449:
450: # disable unused wx features
451: # --disable-htmlhelp
452: # --disable-html
453: # --disable-docview
454: # --disable-mdi
455: # --disable-mdidoc
456: # --disable-protocols
457: # --disable-ftp
458: # --disable-http
459: # --disable-sound
1.169 quint 460: WXCONFIGURE_TUNNING_OPTION="--disable-printarch --disable-htmlhelp --disable-html --disable-docview --disable-mdi --disable-mdidoc --disable-sound"
1.158 gully 461:
1.178 ! gully 462: if test "$AMAYAOS" = "LINUX" ; then
1.135 gully 463: # LINUX
1.145 gully 464: # --enable-gtk2 use GTK+ 2.0 if available (EXPERIMENTAL)
1.158 gully 465: # --disable-shared create only static library (.a)
1.145 gully 466: # --enable-unicode compile wxString with Unicode support
467: # --with-gtk use GTK+
468: # --with-opengl use OpenGL (or Mesa)
1.158 gully 469: WXCONFIGURE_OPTION="--with-opengl --with-gtk --enable-gtk2 --enable-unicode --enable-ipc --disable-shared --with-libpng=builtin --with-libjpeg=builtin --with-libtiff=builtin $WXCONFIGURE_TUNNING_OPTION"
1.135 gully 470: fi
1.178 ! gully 471: if test "$AMAYAOS" = "MACOSX" ; then
1.135 gully 472: # MACOSX
1.155 carcone 473: # AC_MSG_ERROR(TODO: configurer wxWidgets pour MACOSX)
1.145 gully 474: # --with-mac use Mac OS X
1.156 carcone 475: with_mac="yes"
1.170 carcone 476: WXCONFIGURE_OPTION="--with-opengl --disable-shared --enable-unicode --with-libpng=builtin --with-libjpeg=builtin"
1.136 gully 477: fi
478: if test $with_wxdebug = yes ; then
1.141 gully 479: WXCONFIGURE_OPTION="$WXCONFIGURE_OPTION --enable-debug"
1.143 gully 480: # SG: I've disabled other debug options because the lib has bugs when using these flags \
481: # (maybe because these flags are not often used by wxWidgets developpers)
1.141 gully 482: # WXCONFIGURE_OPTION="$WXCONFIGURE_OPTION --enable-debug --enable-debug_cntxt --enable-debug_gdb --enable-debug_info --enable-debug_flag --enable-mem_tracing"
1.145 gully 483: else
484: WXCONFIGURE_OPTION="$WXCONFIGURE_OPTION --enable-optimise"
1.135 gully 485: fi
1.143 gully 486:
1.136 gully 487: # launch the configure
1.143 gully 488: if test "$with_mesa" = "yes" ; then
489: # use internal OpenGL (mesa) libraries
1.165 gully 490: $WX_SRCDIR/configure CFLAGS="-I${GL_BUILDDIR}/include" CXXFLAGS="-I${GL_BUILDDIR}/include" CPPFLAGS="-I${GL_BUILDDIR}/include" $WXCONFIGURE_OPTION
1.158 gully 491: #../$WX_SRCDIR/configure CFLAGS="-I${GL_BUILDDIR}/include" CXXFLAGS="-I${GL_BUILDDIR}/include" CPPFLAGS="-I${GL_BUILDDIR}/include" OPENGL_LIBS="-lGL -lGLU" $WXCONFIGURE_OPTION
1.145 gully 492: if test $? != 0 ; then
493: AC_MSG_ERROR(A problem occurs durring wxWidgets library configuration. Please fix the problem and try again.)
494: fi
1.143 gully 495: else
496: # use OpenGL system libraries
1.165 gully 497: $WX_SRCDIR/configure $WXCONFIGURE_OPTION
1.143 gully 498: fi
1.152 gully 499: cd $OLDDIR
1.135 gully 500: echo "---> Configuring wxWidgets library. - DONE"
1.143 gully 501:
1.135 gully 502: # --------- configuring wxWidgets paths --------------- #
1.152 gully 503: WXCONFIG=$WX_BUILDDIR/wx-config
1.134 gully 504: # check that wx-config exists
1.135 gully 505: if test ! -f $WXCONFIG ; then
1.143 gully 506: AC_MSG_ERROR(Cannot find wx-config. Please download wxWidgets (http://www.wxwidgets.org/))
1.134 gully 507: fi
1.144 gully 508:
509: # setup include paths
1.165 gully 510: # "-I$WX_SRCDIR/src/png -I$WX_SRCDIR/src/jpeg -I$WX_SRCDIR/src/tiff" is a temporary patch to fix incorrect generated paths by wx-config --cxxflags (remove it when wxWidgets will be fixed)
511: WX_INCLUDES="-I$WX_SRCDIR/src/png -I$WX_SRCDIR/src/jpeg -I$WX_SRCDIR/src/tiff `$WXCONFIG --cxxflags`"
1.124 gully 512: AC_SUBST(WX_INCLUDES)
513:
1.144 gully 514: # setup libraries paths
515: WX_LIBRARIES=""
516: WX_LIBRARIES_EXTRA_PARAM=""
1.157 gully 517: WXCONFIG_LIBS_PARAM="xrc,adv,core,xml,net"
1.132 gully 518: # GL is used ?
1.143 gully 519: if test "$with_gl" = "yes" -o "$with_mesa" = "yes" ; then
1.144 gully 520: WXCONFIG_LIBS_PARAM="${WXCONFIG_LIBS_PARAM},gl"
1.132 gully 521: # SG: this is a mistery why wx-config doesn't add these needed option on macosx
1.178 ! gully 522: if test "$AMAYAOS" = "MACOSX" ; then
1.144 gully 523: WX_LIBRARIES_EXTRA_PARAM="-framework OpenGL -framework AGL"
1.132 gully 524: fi
1.124 gully 525: fi
1.170 carcone 526: if test "$with_mac" = "yes" ; then
527: WXCONFIG_LIBS_PARAM="${WXCONFIG_LIBS_PARAM},html"
528: fi
529:
1.152 gully 530: WX_LIBRARIES="`$WXCONFIG --libs $WXCONFIG_LIBS_PARAM` ${WX_LIBRARIES_EXTRA_PARAM}"
1.144 gully 531: AC_SUBST(WX_LIBRARIES)
1.161 gully 532:
533: WX_LINKDEPS="`$WXCONFIG --linkdeps`"
534: AC_SUBST(WX_LINKDEPS)
1.124 gully 535:
536: WX_OPTIONS="-D_WX"
1.135 gully 537: # --------- configuring wxWidgets paths - DONE --------------- #
1.132 gully 538:
539: no_graphic=yes
1.124 gully 540: fi
541:
1.63 vatton 542: if test "${GCC}" = "yes"; then
543: CPP="${CPP} -x c"
544: fi
545:
1.1 cvs 546: dnl ***************************************************************
547: dnl
1.61 cvs 548: dnl SPECIFIC STUFF : CONFIGURATION OPTIONS FOR AMAYA
1.1 cvs 549: dnl
550: dnl ***************************************************************
551:
1.158 gully 552: # Do not care with libpng or libjpeg with wx version because we use the wxwidgets one.
553: if test "$with_wx" = "no" ; then
554: # We don't use our graphic libraries for the pure GTK version (without GL)
555:
556: # if configure has option --with-graphiclibs then dont check for system graphic libs
557: # force amaya static graphic libs to be used
558: AC_ARG_WITH(graphiclibs, [ --with-graphiclibs use static libjpeg, libpng.])
559: if test "$with_graphiclibs" = "yes" -o "$enable_graphiclibs" = "yes" ; then
560: no_graphic="no"
561: else
562: no_graphic="yes"
563: fi
1.132 gully 564:
1.158 gully 565: if test "$no_graphic" = yes; then
566: dnl
567: AC_MSG_CHECKING([for libjpeg version = 6b])
568: AC_EGREP_CPP([x 62 *x],
569: [#include <jpeglib.h>
570: x JPEG_LIB_VERSION x],
571: dnl
572: AC_MSG_RESULT([yes])
573: JPEGINCL=''
1.76 vatton 574: LIBJPEG='-ljpeg'
575: MAKEJPEG=['#'],
1.158 gully 576: dnl
1.76 vatton 577: AC_MSG_RESULT([no])
1.158 gully 578: JPEGINCL='-I$(THOTDIR)/libjpeg'
1.76 vatton 579: LIBJPEG='../libjpeg.a' dnl LIBJPEG goes into amaya/Makefile.in
580: )
1.158 gully 581: dnl
582: dnl
1.95 vatton 583: AC_MSG_CHECKING([for libpng version = 1.0.x or 1.2.x])
584: AC_EGREP_CPP([x \"1.[02]\..*\" *x],
1.76 vatton 585: [#include <png.h>
586: x PNG_LIBPNG_VER_STRING x],
1.158 gully 587: dnl
588: AC_MSG_RESULT([yes])
589: PNGINCL=''
1.76 vatton 590: LIBPNG='-lpng'
591: LIBZ=''
592: MAKEPNG=['#'],
593: dnl
1.158 gully 594: AC_MSG_RESULT([no])
595: PNGINCL='-I$(THOTDIR)/libpng -I$(THOTDIR)/libpng/zlib'
1.76 vatton 596: LIBPNG='../libpng.a'
597: LIBZ='../libz.a'
598: )
1.158 gully 599: else
1.105 vatton 600: JPEGINCL='-I$(THOTDIR)/libjpeg'
1.76 vatton 601: LIBJPEG='../libjpeg.a'
1.105 vatton 602: PNGINCL='-I$(THOTDIR)/libpng -I$(THOTDIR)/libpng/zlib'
1.76 vatton 603: LIBPNG='../libpng.a'
604: LIBZ='../libz.a'
1.158 gully 605: fi
606: dnl
607: AC_SUBST(LIBJPEG)
608: AC_SUBST(LIBPNG)
609: AC_SUBST(LIBZ)
610: AC_SUBST(MAKEJPEG)
611: AC_SUBST(MAKEPNG)
612: fi # with_wx = no
1.76 vatton 613:
1.166 gully 614: # the wx version
615: AMAYAWX_MAJVER=9
1.167 gully 616: AMAYAWX_MINVER=1
1.177 gully 617: AMAYAWX_SUBVER=4
1.166 gully 618:
619: #the old version (to remove when switching on wx)
620: AMAYA_MAJVER=8
621: AMAYA_MINVER=7
1.177 gully 622: AMAYA_SUBVER=4
1.166 gully 623:
1.164 gully 624: if test "$with_wx" = "yes" ; then
1.166 gully 625: APP_MAJVER=$AMAYAWX_MAJVER
626: APP_MINVER=$AMAYAWX_MINVER
627: APP_SUBVER=$AMAYAWX_SUBVER
628: else
629: APP_MAJVER=$AMAYA_MAJVER
630: APP_MINVER=$AMAYA_MINVER
631: APP_SUBVER=$AMAYA_SUBVER
632: fi
1.168 gully 633:
634: if test $APP_SUBVER = 0 ; then
635: APP_VER=$APP_MAJVER.$APP_MINVER
636: else
637: APP_VER=$APP_MAJVER.$APP_MINVER.$APP_SUBVER
638: fi
1.166 gully 639:
640: # generate a header file with the right version number, so it can be used on windows AND on unix
641: APPVERSION_H=../thotlib/internals/h/appversion.h
642: echo "#ifndef __APPVERSION_H__" > $APPVERSION_H
643: echo "#define __APPVERSION_H__" >> $APPVERSION_H
644: echo "#ifdef _WX" >> $APPVERSION_H
645: echo "#define APP_MAJVER $AMAYAWX_MAJVER" >> $APPVERSION_H
646: echo "#define APP_MINVER $AMAYAWX_MINVER" >> $APPVERSION_H
647: echo "#define APP_SUBVER $AMAYAWX_SUBVER" >> $APPVERSION_H
648: echo "#else /* _WX */" >> $APPVERSION_H
649: echo "#define APP_MAJVER $AMAYA_MAJVER" >> $APPVERSION_H
650: echo "#define APP_MINVER $AMAYA_MINVER" >> $APPVERSION_H
651: echo "#define APP_SUBVER $AMAYA_SUBVER" >> $APPVERSION_H
652: echo "#endif /* _WX */" >> $APPVERSION_H
653: echo "#endif /* __APPVERSION_H__ */" >> $APPVERSION_H
1.1 cvs 654:
655: dnl
1.6 cvs 656: dnl We use a special versoin of cextract patched for alignment
657: dnl to build the signatures of the modules functions located in f subdirs
658: dnl
659: CEXTRACT_VER="1.7"
660: CEXTRACT_FLAGS="+O"
661:
1.178 ! gully 662: # Check if debug is enable
! 663: AC_ARG_WITH(debug, [ --with-debug compiles Amaya with debuging options (-g) ])
! 664: if test "$with_debug" = "yes" ; then
! 665: with_debug="yes"
! 666: CFLAGS="-g"
! 667: CXXFLAGS="-g"
! 668: else
! 669: with_debug="no"
! 670: CFLAGS="-O2"
! 671: CXXFLAGS="-O2"
! 672: fi
1.7 cvs 673:
674: if test "${CC}" = "gcc" ; then
1.172 gully 675: CFLAGS="${CFLAGS} -W"
1.7 cvs 676: case "${host}" in
677: *-*-irix5* | *-*irix6* )
678: CFLAGS="${CFLAGS} -fsigned-char"
679: ;;
680: esac
1.14 cvs 681: fi
682:
683: if test "$ac_cv_c_const" = "no" ; then
684: CFLAGS="${CFLAGS} -DCONST= "
1.7 cvs 685: fi
686:
1.122 gully 687:
688: # force C mode (-x c)
1.123 gully 689: CFLAGS="${CFLAGS} -x c"
1.122 gully 690:
691: # C++ options (-x c++)
692: CXX_OPTIONS="-D__cplusplus"
1.123 gully 693: CXXFLAGS="${CXXFLAGS} -W -x c++ ${CXX_OPTIONS}"
1.122 gully 694:
1.132 gully 695: # setup LDFLAGS
696: # on macosx, specific flags must be set to avoid conflicts with allready installed libwww
697: # for exemple it's possible to install libwww with fink (fink install libwww)
698: # to avoid conflicts, we just force the linker to search for specified amaya path first
1.178 ! gully 699: if test "$AMAYAOS" = "MACOSX" ; then
1.132 gully 700: LDFLAGS="-Wl,-search_paths_first"
701: else
702: LDFLAGS=""
703: fi
1.128 gully 704:
705: dnl
1.61 cvs 706: dnl Check for availability of amaya sources
1.1 cvs 707: dnl
708:
709: build_amaya="yes"
710:
711: if test "$with_amaya" = "no" ; then
712: build_amaya="no"
1.45 cvs 713: else
714: if test ! -f $srcdir/amaya/Makefile.in ; then
1.1 cvs 715: AC_MSG_WARN(Amaya browser/editor sources not found, disabling Amaya build !)
716: build_amaya="no"
1.45 cvs 717: fi
1.1 cvs 718: fi
719:
720: dnl
1.50 cvs 721: dnl Check for additionnal packages
1.1 cvs 722: dnl use AC_CONFIG_SUBDIRS to launch configure in the subdir
723: dnl
1.93 kahan 724:
1.143 gully 725: if test "$with_gl" = "yes" -o "$with_mesa" = "yes" ; then
726:
727: # if with_gl is on then test system opengl library (GL & GLU)
728: if test "$with_gl" = "yes" ; then
1.139 carcone 729: # setup a list of standard paths int LDFLAGS
730: # for AC_CHECK_LIB library existance checks
1.140 carcone 731: LIBS_OLD=$LIBS
1.139 carcone 732: LDFLAGS_OLD=$LDFLAGS
733: LDFLAGS="-L/usr/X11R6/lib -L/usr/lib -L/usr/local/lib"
1.75 cheyroul 734: AC_MSG_CHECKING([OpenGL])
735: for ac_dir in \
736: /usr/include \
737: /usr/X11R6/include \
738: /usr/local/include \
739: ; \
1.80 cheyroul 740: do if test -r "$ac_dir/GL/gl.h" ; then
1.143 gully 741: gl_inc="yes"
742: GL_INC_I="$ac_dir"
743: if test "$ac_dir" != "/usr/include" ; then
744: GL_INCLUDES="-I$ac_dir"
745: fi
746: AC_CHECK_LIB(GL,glBegin,,AC_MSG_ERROR(Cannot find OpenGL library. Please install OpenGL.))
747: AC_MSG_RESULT([yes])
748: break
749: fi
750: done
751:
1.80 cheyroul 752: AC_MSG_CHECKING([GLU])
1.75 cheyroul 753: for ac_dir in \
754: /usr/include \
755: /usr/X11R6/include \
756: /usr/local/include \
757: ; \
1.138 gully 758: do if test -r "$ac_dir/GL/glu.h" ; then
1.143 gully 759: glu_inc="yes"
760: GL_INC_II="$ac_dir"
761: if test "$ac_dir" != "/usr/include" ; then
762: if test "$ac_dir" != "$GL_INC_I" ; then
763: GL_INCLUDES="$GL_INCLUDES -I$ac_dir"
764: fi
765: fi
766: # now test that glu version is >= 1.2
767: 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.)))
768: AC_MSG_RESULT([yes])
769: break
770: fi
771: done
1.139 carcone 772: LDFLAGS=$LDFLAGS_OLD
1.140 carcone 773: LIBS=$LIBS_OLD
1.174 carcone 774:
1.143 gully 775: if test "$gl_inc" = "" ; then
776: AC_MSG_WARN(Opengl headers (gl.h) not found !!)
777: AC_MSG_WARN(Disabling opengl build !)
778: with_gl="no"
779: GL_OPTIONS=
780: GL_INCLUDES=
781: GL_LIBRARIES=
782: exit 1;
783: fi
784:
785: if test "$glu_inc" = "" ; then
786: AC_MSG_WARN(Glu headers (glu.h) not found !!)
787: AC_MSG_WARN(Disabling opengl build !)
788:
789: with_gl="no"
790: GL_OPTIONS=
791: GL_INCLUDES=
792: GL_LIBRARIES=
793: exit 1;
794: fi
1.174 carcone 795:
796: if test "$with_mac" = "yes" ; then
797: GL_OPTIONS="-D_GL"
798: GL_INCLUDES="-I/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers/"
799: GL_LIBRARIES=""
800: else
801: GL_LIBRARIES="-L/usr/lib -L/usr/X11R6/lib -lGL -lGLU"
802: GL_OPTIONS="-D_GL"
1.173 carcone 803: fi
1.143 gully 804:
805: AC_SUBST(GL_INCLUDES)
806: AC_SUBST(GL_LIBRARIES)
807: fi # if with_gl
1.139 carcone 808:
1.143 gully 809: # check for gtkglarea.h only if gtk gui is selected
810: if test "$with_gtk" = "yes" ; then
811: AC_MSG_CHECKING([GTKGLAREA])
812: for ac_dir in \
1.132 gully 813: /usr/include/GL \
1.75 cheyroul 814: /usr/include \
815: /usr/X11R6/include/GL \
816: /usr/X11R6/include \
817: /usr/local/include \
818: /usr/local/include/GL \
819: ; \
1.143 gully 820: do if test -r "$ac_dir/gtkgl/gtkglarea.h" ; then
821: gtkgl_inc="yes"
822: if test "$ac_dir" != "/usr/include" ; then
823: if test "$ac_dir" != "$GL_INC_II" ; then
824: if test "$ac_dir" != "$GL_INC_I" ; then
825: GTK_GL_INCLUDES="-I$ac_dir"
826: fi
827: fi
828: fi
829: AC_MSG_RESULT([yes])
830: break
831: fi
832: done
833: GTK_GL_LIBRARIES="-lgtkgl"
834:
835: if test "$gtkgl_inc" = "" ; then
836: AC_MSG_WARN(Gtkglarea headers (gktglarea.h) not found !!)
837: AC_MSG_WARN(Disabling opengl build !)
838: with_gl="no"
839: exit 1;
840: fi
841: AC_SUBST(GTK_GL_INCLUDES)
842: AC_SUBST(GTK_GL_LIBRARIES)
843: fi
1.132 gully 844:
1.143 gully 845: # checking for freetype lib (fonts library)
1.173 carcone 846: if test "$with_mac" = "yes" ; then
847: # we use a static version of freetype lib for mac osx
1.174 carcone 848: FREETYPE_INCLUDES="-I/opt/local/include -I/opt/local/include/freetype2 -I/usr/X11R6/include/freetype2/freetype"
849: FREETYPE_LIBRARIES="-lfreetype"
1.173 carcone 850: else
851: if test ! -f $(which freetype-config) ; then
852: AC_MSG_ERROR(Cannot find freetype library (font load/display routines). Please install it.)
853: fi
854: FREETYPE_INCLUDES=`freetype-config --cflags`
855: FREETYPE_LIBRARIES=`freetype-config --libs`
856: fi
857: AC_SUBST(FREETYPE_INCLUDES)
858: AC_SUBST(FREETYPE_LIBRARIES)
1.143 gully 859:
860:
861: # checking for xft lib
862: # (not used because xft-config doesn't exist on debian stable)
863: #if test ! -f $(which xft-config) ; then
864: # AC_MSG_ERROR(Cannot find Xft library. Please install it.)
865: #fi
866: #XFT_INCLUDES=`xft-config --cflags`
867: #XFT_LIBRARIES=`xft-config --libs`
868: #AC_SUBST(XFT_INCLUDES)
869: #AC_SUBST(XFT_LIBRARIES)
870:
871: # START CHECKING XFT #
872: # checking for Xft (old way)
1.173 carcone 873: if test "$with_mac" = "no" ; then
1.143 gully 874: AC_MSG_CHECKING([Xft])
875: for ac_dir in \
1.104 cheyroul 876: /usr/include \
877: /usr/X11R6/include \
878: /usr/local/include \
879: /usr/include/X11/Xft \
880: /usr/X11R6/include/X11/Xft \
881: /usr/local/include/X11/Xft \
882: /usr/include/X11/Xft1 \
883: /usr/X11R6/include/X11/Xft1 \
1.113 vatton 884: /usr/include/Xft2/X11/Xft/ \
1.104 cheyroul 885: /usr/local/include/X11/Xft1 \
886: /usr/include/X11/Xft2 \
887: /usr/X11R6/include/X11/Xft2 \
888: /usr/local/include/X11/Xft2 \
889: ; \
1.143 gully 890: do if test -r "$ac_dir/Xft.h" ; then
891: xft_inc="yes"
892: XFT_INCLUDES="-I$ac_dir"
893: AC_MSG_RESULT([yes])
894: break
895: fi
896: done
897: if test "$xft_inc" = "" ; then
898: AC_MSG_WARN(Xft 2 headers (Xft.h) not found !!)
899: AC_MSG_WARN(Disabling opengl build !)
900: with_gl="no"
901: exit 1;
902: fi
903:
904: AC_MSG_CHECKING([Xft-library])
1.155 carcone 905:
1.143 gully 906: for ac_dir in \
907: /usr/lib \
908: /usr/X11R6/lib \
909: /usr/local/lib \
910: ; \
911: do if test -r "$ac_dir/libXft.so" ; then
912: xft_lib="yes"
913: XFT_LIBRARIES="-L$ac_dir -lXft"
914: AC_MSG_RESULT([yes])
915: break
916: fi
917: done
918: if test "$xft_lib" = "" ; then
919: AC_MSG_WARN(Xft 2 librarie (libXft.so) not found !!)
920: AC_MSG_WARN(Disabling opengl build !)
921: with_gl="no"
922: exit 1;
923: fi
1.155 carcone 924:
1.143 gully 925: AC_SUBST(XFT_INCLUDES)
926: AC_SUBST(XFT_LIBRARIES)
927: # END CHECKING XFT #
1.173 carcone 928: fi
1.143 gully 929:
930:
931: AC_MSG_CHECKING([gcc3])
932: for ac_dir in \
1.96 cheyroul 933: /usr/lib \
934: /usr/X11R6/lib \
935: /usr/local/lib \
936: ; \
1.143 gully 937: do if test -r "$ac_dir/libstdc++.so.5" ; then
938: stdglu_inc="yes"
939: STDCPP_LIBRARIES="-lstdc++"
940: STDCPP_INCLUDES=""
941: AC_MSG_RESULT([yes])
942: break
943: fi
944: done
1.159 gully 945:
946: # not used in makefiles
947: # AC_SUBST(STDCPP_INCLUDES)
948: # AC_SUBST(STDCPP_LIBRARIES)
1.143 gully 949:
950: NOPRINT=""
951: PRINTIFNOTGL=" print_prog"
952:
953: else # if with_gl or with_mesa
954:
955: NOPRINT=""
956: PRINTIFNOTGL=" print_prog"
1.132 gully 957:
1.143 gully 958: fi # if with_gl or with_mesa
1.132 gully 959:
1.97 cheyroul 960: AC_SUBST(PRINTIFNOTGL)
1.112 cheyroul 961: AC_SUBST(NOPRINT)
962:
1.76 vatton 963:
964: AC_ARG_ENABLE(svg, [ --disable-svg remove SVG support ])
965: AC_ARG_ENABLE(annot, [ --disable-annot remove Annotations support ])
1.146 kahan 966: AC_ARG_ENABLE(redland, [ --disable-redland disable the redland RDF library ])
1.116 kahan 967: AC_ARG_ENABLE(system-redland, [ --enable-system-redland try the redland RDF system library ])
1.108 kahan 968: AC_ARG_ENABLE(bookmarks, [ --enable-bookmarks enables experimental bookmark support ])
1.76 vatton 969: AC_ARG_ENABLE(generic-xml, [ --disable-generic-xml remove Generic XML support ])
970:
1.75 cheyroul 971: dnl
1.21 cvs 972: dnl plugins support is disabled by default
1.8 cvs 973: dnl
1.13 cvs 974:
975: if test "$with_plugin" = "" ; then
1.21 cvs 976: if test "$enable_plugin" = "yes" ; then
1.55 kahan 977: with_plugin="yes"
1.21 cvs 978: else
1.17 cvs 979: with_plugin="no"
980: fi
1.10 cvs 981: fi
1.1 cvs 982:
1.8 cvs 983: dnl
1.68 vatton 984: dnl svg is enabled by default
1.26 cvs 985: dnl
1.68 vatton 986: if test "$with_svg" = "" ; then
987: if test "$enable_svg" = "no" ; then
988: with_svg="no"
1.49 cvs 989: else
1.68 vatton 990: with_svg="yes"
1.26 cvs 991: fi
992: fi
993:
994: dnl
1.56 kahan 995: dnl annotations is enabled by default
1.47 cvs 996: dnl
997: if test "$with_annot" = "" ; then
1.56 kahan 998: if test "$enable_annot" = "no" ; then
999: with_annot="no"
1000: else
1.54 cvs 1001: with_annot="yes"
1.47 cvs 1002: fi
1.99 kahan 1003: else
1004: with_annot="yes"
1.47 cvs 1005: fi
1006:
1.93 kahan 1007:
1008: dnl
1.146 kahan 1009: dnl The redland library is enabled by default
1.93 kahan 1010: dnl
1.146 kahan 1011: if test "$with_redland" = "" ; then
1012: if test "$enable_redland" = "no" ; then
1013: with_redland="no"
1.93 kahan 1014: else
1.109 kahan 1015: with_redland="yes"
1016: fi
1017: else
1.146 kahan 1018: with_redland="yes"
1.109 kahan 1019: fi
1020:
1021: dnl
1.116 kahan 1022: dnl The redland library is disabled by default
1023: dnl
1024: if test "$with_system_redland" = "" ; then
1025: if test "$enable_system_redland" = "yes" ; then
1026: with_redland="yes"
1027: with_system_redland="yes"
1028: else
1029: with_system_redland="no"
1030: fi
1031: else
1032: with_system_redland="no"
1033: fi
1034:
1035: dnl
1036: dnl The bookmarks support is disabled by default
1.108 kahan 1037: dnl
1038: if test "$with_bookmarks" = "" ; then
1039: if test "$enable_bookmarks" = "yes" ; then
1040: with_bookmarks="yes"
1.125 vatton 1041: with_redland="yes"
1.108 kahan 1042: else
1043: with_bookmarks="no"
1044: fi
1045: else
1046: with_bookmarks="no"
1047: fi
1048:
1049: dnl
1.70 kahan 1050: dnl Generic XML support enabled by default
1051: dnl
1052: if test "$with_generic_xml" = "" ; then
1053: if test "$enable_generic_xml" = "no" ; then
1054: with_generic_xml="no"
1055: GENERIC_XML_OPTIONS=
1056: else
1057: with_generic_xml="yes"
1058: GENERIC_XML_OPTIONS=-DXML_GENERIC
1059: fi
1060: fi
1061:
1.120 gully 1062: AC_ARG_WITH(dav, [ --with-dav enable WebDAV support (experimental) ])
1.88 kirschpi 1063: dnl
1064: dnl DAV support disabled by default
1065: dnl
1066: if test "$with_dav" = "" ; then
1067: if test "$enable_dav" = "yes" ; then
1068: with_dav="yes"
1069: else
1070: with_dav="no"
1071: fi
1072: fi
1073:
1074: if test "$with_dav" = "yes" ; then
1075: DAV_OPTIONS=-DDAV
1.90 kirschpi 1076: DAVDIR="davlib"
1077: LIBDAV="libwwwdav"
1078: WITHDAV="--with-dav"
1079: WWWDAV="-lwwwdav"
1.88 kirschpi 1080: else
1081: with_dav="no"
1082: DAV_OPTIONS=""
1.90 kirschpi 1083: DAVDIR=""
1084: LIBDAV=""
1085: WITHDAV=""
1086: WWWDAV=""
1.88 kirschpi 1087: fi
1088:
1.70 kahan 1089:
1.19 cvs 1090: if test "$build_amaya" = "yes" ; then
1.43 cvs 1091: if test ! -f $srcdir/../libwww/Makefile.in ; then
1.50 cvs 1092: AC_MSG_WARN(libwww sources not found !!)
1093: AC_MSG_WARN(Disabling Amaya build !)
1094: build_amaya="no"
1.1 cvs 1095: fi
1.8 cvs 1096:
1097: if test ! -f $srcdir/amaya/MathML.S ; then
1.10 cvs 1098: if test "$with_math" = "yes" ; then
1.8 cvs 1099: AC_MSG_WARN(MathML sources not found !!)
1.26 cvs 1100: AC_MSG_WARN(Disabling Math build !)
1.10 cvs 1101: with_math="no"
1102: MATH_OPTIONS=
1.8 cvs 1103: fi
1104: fi
1.26 cvs 1105:
1.68 vatton 1106: if test ! -f $srcdir/amaya/SVG.S ; then
1107: if test "$with_svg" = "yes" ; then
1108: AC_MSG_WARN(SVG sources not found !!)
1109: AC_MSG_WARN(Disabling SVG build !)
1110: with_svg="no"
1111: SVG_OPTIONS=
1.26 cvs 1112: fi
1113: fi
1114:
1.48 cvs 1115: if test ! -f $srcdir/annotlib/Makefile.in ; then
1.47 cvs 1116: if test "$with_annot" = "yes" ; then
1117: AC_MSG_WARN(Annotation makefile not found !!)
1118: AC_MSG_WARN(Disabling Annotations build !)
1119: with_annot="no"
1120: fi
1121: fi
1.55 kahan 1122:
1.146 kahan 1123: if test "$with_redland" = "yes" -a "$with_annot" = "no" -a "$with_bookmarks" = "no"; then
1124: AC_MSG_WARN(Disabling redland as neither annotations nor bookmarks are enabled !)
1.93 kahan 1125: MAKERAPTOR=['#']
1126: with_raptor="no"
1127: fi
1128:
1.116 kahan 1129: redland_compile_source=yes
1130: if test "$with_redland" = "yes" -a "$with_system_redland" = "yes" ; then
1131: # check to see if we have a redland library
1132: AC_MSG_CHECKING(system redland library)
1.142 kahan 1133: redland_min_version=0.9.16
1.116 kahan 1134: REDLAND_CONFIG="redland-config"
1135: REDLAND_VERSION=`$REDLAND_CONFIG --version`
1136: redland_version_dec=`echo $REDLAND_VERSION | awk -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'`
1137: redland_min_version_dec=`echo $redland_min_version | awk -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'`
1138: if test $redland_version_dec -lt $redland_min_version_dec; then
1139: AC_MSG_RESULT(no - found version $REDLAND_VERSION and minimal version is $redland_min_version)
1140: else
1141: AC_MSG_RESULT(yes - found version $REDLAND_VERSION)
1142: AC_MSG_CHECKING(checking for redland headers)
1.117 kahan 1143: dnl We should use awk here and remove the -I from the following line
1144: dnl REDLAND_HEADERS=`$REDLAND_CONFIG --cflags`
1145: REDLAND_HEADERS=""
1146: if test -e "/usr/include/redland.h" ; then
1147: REDLAND_HEADERS="/usr/include";
1148: else
1149: if test -e "/usr/local/include/redland.h" ; then
1150: REDLAND_HEADERS="/usr/local/include";
1151: fi
1152: fi
1153: if test $REDLAND_HEADERS != ""; then
1.116 kahan 1154: AC_MSG_RESULT(yes - have development version)
1155: redland_compile_source=no
1156: else
1157: AC_MSG_RESULT(no - no development version)
1158: fi
1159: fi
1160: fi
1161:
1162: if test "$with_redland" = "yes" -a "$redland_compile_source" = "yes" \
1163: -a ! -d "$srcdir/../redland" ; then
1.109 kahan 1164: AC_MSG_WARN(Redland source dir not found !!)
1165: AC_MSG_WARN(Disabling redland build !)
1166: MAKEREDLAND=['#']
1167: with_redland="no"
1168: fi
1169:
1170: if test "$with_redland" = "yes" ; then
1.116 kahan 1171: AMAYA_ANNOT_OPTIONS="$AMAYA_ANNOT_OPTIONS -DLIBRDF_INTERNAL=1 -DAM_REDLAND -DRAPTOR_RDF_PARSER"
1172: if test "$redland_compile_source" = "yes" ; then
1173: AMAYA_RAPTOR_SRC="amaya_comp_redland"
1174: AMAYA_ANNOT_OPTIONS="$AMAYA_ANNOT_OPTIONS -I\$(THOTDIR)/../redland/librdf -I\$(THOTDIR)/../redland/raptor"
1175: AMAYA_RAPTOR_LIBS="../redland/librdf/.libs/librdf.a ../redland/raptor/.libs/libraptor.a"
1176: AMAYA_RAPTOR_INCLUDES="-I\$(THOTDIR)/../redland/librdf -I\$(THOTDIR)/../redland/raptor"
1177: else
1178: MAKEREDLAND=['#']
1179: AMAYA_RAPTOR_SRC=
1180: redland_includes=`$REDLAND_CONFIG --cflags`
1181: redland_libs=`$REDLAND_CONFIG --libs`
1182: AMAYA_ANNOT_OPTIONS="$AMAYA_ANNOT_OPTIONS"
1183: AMAYA_ANNOT_INCLUDES="$redland_includes -I\$(THOTDIR)/thotlib/include"
1184: AMAYA_ANNOT_EXTRA_LIBS="$redland_libs"
1185: AMAYA_RAPTOR_INCLUDES="$redland_includes"
1186: fi
1.109 kahan 1187: fi
1188:
1.116 kahan 1189:
1.108 kahan 1190: dnl control whether we should build the bookmarks support
1.146 kahan 1191: if test "$with_annot" = "yes" -a "$with_redland" = "no" ; then
1192: AC_MSG_WARN(Disabling annotations build as redland is disabled !)
1.148 kahan 1193: with_annot="no"
1.146 kahan 1194: fi
1.108 kahan 1195: if test "$with_bookmarks" = "yes" -a "$with_annot" = "no" ; then
1196: AC_MSG_WARN(Disabling bookmarks build as annotations are disabled !)
1197: with_bookmarks="no"
1198: fi
1.109 kahan 1199: if test "$with_bookmarks" = "yes" -a "$with_redland" = "no" ; then
1200: AC_MSG_WARN(Disabling bookmarks build as redland is disabled !)
1.108 kahan 1201: with_bookmarks="no"
1202: fi
1203: if test "$with_bookmarks" = "yes" ; then
1204: ANNOTLIB_COMPILE_BM=
1205: AMAYA_ANNOT_OPTIONS="$AMAYA_ANNOT_OPTIONS -DBOOKMARKS"
1206: else
1207: ANNOTLIB_COMPILE_BM=['#']
1208: fi
1209:
1.55 kahan 1210: if test "$with_plugin" = "yes" ; then
1211: AC_MSG_WARN(The plugin library isn't supported anymore in Amaya !!)
1212: AC_MSG_WARN(Disabling plugin build !)
1213: with_plugin="no"
1214: fi
1215:
1.88 kirschpi 1216:
1217: if test ! -f $srcdir/davlib/Makefile.in ; then
1218: if test "$with_dav" = "yes" ; then
1219: AC_MSG_WARN(WebDAV makefile not found !!)
1220: AC_MSG_WARN(Disabling WebDAV build !)
1221: with_dav="no"
1.90 kirschpi 1222: DAVDIR=""
1223: LIBDAV=""
1224: WITHDAV=""
1225: WWWDAV=""
1.88 kirschpi 1226: fi
1227: fi
1228:
1229:
1.1 cvs 1230: fi
1231:
1232: dnl
1233: dnl The options for each library or binary
1234: dnl
1235:
1.134 gully 1236: THOT_OPTIONS="$OS_OPTIONS $GTK_OPTIONS $GL_OPTIONS $WX_OPTIONS $NOGUI_OPTIONS"
1237: AMAYA_OPTIONS="$OS_OPTIONS $MATH_OPTIONS $SVG_OPTIONS $GENERIC_XML_OPTIONS $GTK_OPTIONS $GL_OPTIONS $WX_OPTIONS $NOGUI_OPTIONS"
1.58 cvs 1238: #PLUGIN_OPTIONS="-DPLUGIN_TRACE -DXP_UNIX"
1.129 vatton 1239: AMAYA_ANNOT_OPTIONS="$OS_OPTIONS $AMAYA_ANNOT_OPTIONS"
1.101 kahan 1240:
1.158 gully 1241: if test "$with_wx" = "yes" ; then
1242: IMGLIBS=""
1243: else
1244: IMGLIBS="-ljpeg -lpng -lz"
1245: fi
1.132 gully 1246:
1.3 cvs 1247: EXTRA_LIBS=
1.131 gully 1248: EXTRA_INCLUDES=
1249:
1250: # check for malloc.h
1251: # on macosx, this file is not at the right place
1.173 carcone 1252: if test "$with_mac" = "yes" ; then
1253: for ac_dir in \
1254: /Developer/SDKs/MacOSX10.1.5.sdk/usr/include/objc/ \
1255: /Developer/SDKs/MacOSX10.1.5.sdk/usr/include/sys/ \
1256: /Developer/SDKs/MacOSX10.2.8.sdk/usr/include/objc/ \
1257: /Developer/SDKs/MacOSX10.2.8.sdk/usr/include/sys/ \
1258: /Developer/SDKs/MacOSX10.3.0.sdk/usr/include/objc/ \
1259: /Developer/SDKs/MacOSX10.3.0.sdk/usr/include/sys/ \
1260: ; \
1261: do
1262: if test -r "$ac_dir/malloc.h"; then
1263: echo "found malloc.h"
1264: EXTRA_INCLUDES="${EXTRA_INCLUDES} -I$ac_dir"
1265: break
1266: fi
1267: done
1268: else
1.131 gully 1269: for ac_dir in \
1270: /usr/include/malloc/ \
1271: /sw/include/malloc/ \
1272: ; \
1273: do
1274: if test -r "$ac_dir/malloc.h"; then
1275: echo "found malloc.h"
1276: EXTRA_INCLUDES="${EXTRA_INCLUDES} -I$ac_dir"
1277: break
1278: fi
1279: done
1.173 carcone 1280: fi
1.1 cvs 1281:
1282: dnl
1283: dnl Set up the PATHs needed
1284: dnl
1285:
1286: API="\$(THOTDIR)/thotlib/include"
1287: VAR="\$(THOTDIR)/thotlib/internals/var"
1288: INCL="\$(THOTDIR)/thotlib/internals/h"
1289: FUNC="\$(THOTDIR)/thotlib/internals/f"
1290:
1291: dnl
1292: dnl Set up the include variables.
1293: dnl
1294:
1.61 cvs 1295: THOTINCLUDES="-I${API} -I${VAR} -I${INCL} -I${FUNC} ${JPEGINCL} ${PNGINCL}"
1.58 cvs 1296: APIINCLUDES=-I${API}
1297:
1298: if test "${VPATHOPT}" = "" ; then
1.1 cvs 1299: VPATHOPT="VPATH"
1300: fi
1301:
1302: dnl
1303: dnl Exports the current values of the variables.
1304: dnl
1305:
1.166 gully 1306: AC_SUBST(APP_MAJVER)
1307: AC_SUBST(APP_MINVER)
1308: AC_SUBST(APP_SUBVER)
1309: AC_SUBST(APP_VER)
1.6 cvs 1310: AC_SUBST(CEXTRACT_VER)
1311: AC_SUBST(CEXTRACT_FLAGS)
1.1 cvs 1312:
1313: AC_SUBST(THOTINCLUDES)
1314: AC_SUBST(APIINCLUDES)
1315: AC_SUBST(VPATHOPT)
1316:
1.63 vatton 1317: AC_SUBST(GTK_OPTIONS)
1.1 cvs 1318: AC_SUBST(THOT_OPTIONS)
1319: AC_SUBST(AMAYA_OPTIONS)
1320: AC_SUBST(PLUGIN_OPTIONS)
1.48 cvs 1321: AC_SUBST(AMAYA_ANNOT_OPTIONS)
1.110 kahan 1322: AC_SUBST(AMAYA_ANNOT_INCLUDES)
1.116 kahan 1323: AC_SUBST(AMAYA_ANNOT_EXTRA_LIBS)
1.1 cvs 1324: AC_SUBST(IMGLIBS)
1.3 cvs 1325: AC_SUBST(EXTRA_LIBS)
1.131 gully 1326: AC_SUBST(EXTRA_INCLUDES)
1.90 kirschpi 1327:
1328: AC_SUBST(DAVDIR)
1329: AC_SUBST(LIBDAV)
1330: AC_SUBST(WITHDAV)
1331: AC_SUBST(WWWDAV)
1.1 cvs 1332:
1.93 kahan 1333: AC_SUBST(MAKERAPTOR)
1.109 kahan 1334: AC_SUBST(MAKEREDLAND)
1.108 kahan 1335: AC_SUBST(ANNOTLIB_COMPILE_BM)
1.109 kahan 1336: AC_SUBST(AMAYA_RAPTOR_SRC)
1.93 kahan 1337: AC_SUBST(AMAYA_RAPTOR_LIBS)
1338: AC_SUBST(AMAYA_RAPTOR_INCLUDES)
1339: AC_SUBST(MAKE_LIBWWW_RDF_PARSER)
1340: AC_SUBST(LIBWWW_RDF_PARSER)
1341:
1342: AC_SUBST(SUBDIRS)
1343:
1.1 cvs 1344: dnl
1.48 cvs 1345: dnl Include the option Makefile.xxx fragment according to the configure options
1.1 cvs 1346: dnl
1347:
1348: if test "$with_plugin" = "yes" ; then
1.50 cvs 1349: AC_SUBST_FILE(plugin_frag)
1.1 cvs 1350: plugin_frag=$srcdir/pluginlib/Makefile.plugin
1351: else
1352: AC_SUBST_FILE(plugin_frag)
1353: plugin_frag=/dev/null
1354: fi
1355:
1356: AC_SUBST_FILE(www_frag)
1.49 cvs 1357: www_frag=$srcdir/amaya/Makefile.libwww
1.1 cvs 1358:
1.50 cvs 1359: if test "$with_math" = "no" ; then
1.10 cvs 1360: AC_SUBST_FILE(math_frag)
1.50 cvs 1361: math_frag=/dev/null
1.8 cvs 1362: else
1.10 cvs 1363: AC_SUBST_FILE(math_frag)
1.50 cvs 1364: math_frag=$srcdir/amaya/Makefile.math
1.8 cvs 1365: fi
1366:
1.68 vatton 1367: if test "$with_svg" = "no" ; then
1368: AC_SUBST_FILE(svg_frag)
1369: svg_frag=/dev/null
1.26 cvs 1370: else
1.68 vatton 1371: AC_SUBST_FILE(svg_frag)
1372: svg_frag=$srcdir/amaya/Makefile.svg
1.26 cvs 1373: fi
1374:
1.47 cvs 1375: if test "$with_annot" = "yes" ; then
1376: AC_SUBST_FILE(annot_frag)
1.48 cvs 1377: annot_frag=$srcdir/annotlib/Makefile.annot
1.47 cvs 1378: else
1379: AC_SUBST_FILE(annot_frag)
1380: annot_frag=/dev/null
1381: fi
1382:
1.88 kirschpi 1383: if test "$with_dav" = "yes" ; then
1384: AC_SUBST_FILE(dav_frag)
1385: dav_frag=$srcdir/davlib/Makefile.dav
1386: fi
1.16 cvs 1387:
1.1 cvs 1388: dnl ***************************************************************
1389: dnl
1390: dnl FINAL STEP : PRODUCE ALL THE MAKEFILES AND CONFIG FILES
1391: dnl
1392: dnl ***************************************************************
1393:
1394: EXTRA_MAKEFILE_IN=
1.2 cvs 1395: make_output="Makefile Options.orig:Options.in tools/Makefile \
1.1 cvs 1396: libjpeg/Makefile libpng/Makefile libpng/zlib/Makefile \
1.2 cvs 1397: tools/mkdep/Makefile \
1.1 cvs 1398: tools/cextract-1.7/Makefile thotlib/Makefile \
1.127 vatton 1399: thotlib/include/Makefile batch/Makefile"
1.1 cvs 1400:
1401: if test "$build_amaya" = "yes" ; then
1.2 cvs 1402:
1.19 cvs 1403: make_output="$make_output amaya/Makefile pluginlib/Makefile"
1.2 cvs 1404: EXTRA_MAKEFILE_IN="$srcdir/amaya/Makefile.in \
1.93 kahan 1405: $srcdir/amaya/Makefile.libwww"
1.27 cvs 1406:
1.162 gully 1407: if test "$with_plugin" = "yes" ; then
1.27 cvs 1408: make_output="$make_output pluginlib/Makefile"
1409: EXTRA_MAKEFILE_IN="$srcdir/pluginlib/Makefile.in \
1.93 kahan 1410: $srcdir/pluginlib/Makefile.plugin"
1.27 cvs 1411: fi
1.2 cvs 1412:
1.48 cvs 1413: if test "$with_annot" = "yes" ; then
1414: make_output="$make_output annotlib/Makefile"
1415: EXTRA_MAKEFILE_IN="$srcdir/annotlib/Makefile.in"
1416: fi
1.88 kirschpi 1417:
1418: if test "$with_dav" = "yes" ; then
1419: make_output="$make_output davlib/Makefile"
1420: EXTRA_MAKEFILE_IN="$srcdir/davlib/Makefile.in"
1421: fi
1422:
1.162 gully 1423: if test "$with_wx" = "yes" ; then
1424: EXTRA_MAKEFILE_IN="$EXTRA_MAKEFILE_IN $WX_SRCDIR/Makefile.in $WX_SRCDIR/configure.in"
1425: fi
1426:
1.1 cvs 1427: fi
1428:
1429: AC_SUBST(EXTRA_MAKEFILE_IN)
1.6 cvs 1430: AC_OUTPUT($make_output , [
1431: dnl
1432: dnl This fragment of shell code is executed after the
1433: dnl Makefile(s) dump ...
1434: dnl
1435:
1436: echo timestamp > stamp-h
1437:
1438: dnl
1439: dnl Check for an upgrade in the Options numbers
1440: dnl
1441:
1442: if test -f Options ; then
1443: oldversion=`grep Version Options`
1444: newversion=`grep Version Options.orig`
1445: if test "$oldversion" != "$newversion" ; then
1446: echo WARNING : Options files have changed, old options saved to Options.old
1447: cp Options Options.old
1448: cp Options.orig Options
1449: exit 1
1450: fi
1451: fi
1452: ])
1.1 cvs 1453:
1454: if test "$build_amaya" = "yes" ; then
1.164 gully 1455: echo Amaya $AMAYA_VER configured
1.50 cvs 1456: echo Amaya configured with libWWW
1457: if test "$with_plugin" = "yes" ; then
1458: echo Amaya configured with Plugins support
1.8 cvs 1459: fi
1.10 cvs 1460: if test "$with_math" = "yes" ; then
1461: echo Amaya configured with Math support
1.26 cvs 1462: fi
1.68 vatton 1463: if test "$with_svg" = "yes" ; then
1464: echo Amaya configured with SVG support
1.47 cvs 1465: fi
1466: if test "$with_annot" = "yes" ; then
1467: echo Amaya configured with Annotations support
1.70 kahan 1468: fi
1.93 kahan 1469: if test "$with_raptor" = "yes" ; then
1.106 kahan 1470: echo Amaya configured with the Raptor RDF parser
1.109 kahan 1471: fi
1472: if test "$with_redland" = "yes" ; then
1.116 kahan 1473: if test "$with_system_redland" = "no" ; then
1474: echo Amaya configured with the Redland RDF library \(local source\)
1475: else
1476: echo Amaya configured with the Redland RDF library \(system\)
1477: fi
1.108 kahan 1478: fi
1479: if test "$with_bookmarks" = "yes" ; then
1480: echo Amaya configured with bookmarks support \(experimental\)
1.93 kahan 1481: fi
1.70 kahan 1482: if test "$with_generic_xml" = "yes" ; then
1483: echo Amaya configured with generic XML suppport
1484: fi
1.129 vatton 1485: echo Amaya configured with internationalization suppport
1.75 cheyroul 1486: if test "$with_gl" = "yes" ; then
1.143 gully 1487: echo Amaya configured with OpenGL Canvas Rendering \(System library\) \(experimental\)
1488: fi
1489: if test "$with_mesa" = "yes" ; then
1490: echo Amaya configured with OpenGL Canvas Rendering \(MesaLib\) \(experimental\)
1.88 kirschpi 1491: fi
1492: if test "$with_dav" = "yes" ; then
1493: echo Amaya configured with WebDAV support \(experimental\)
1.1 cvs 1494: fi
1.5 cvs 1495: fi
1496:
1.158 gully 1497: if test "$with_wx" = "no" ; then
1498: if test "$no_graphic" = "yes" ; then
1499: echo "Amaya configured with system graphic libraries (libjpeg, libpng, zlib)"
1500: else
1501: echo "Amaya configured with static graphic libraries (libjpeg, libpng, zlib)"
1502: if test "$with_gtk" = "yes" -o "$with_gl" = "yes" ; then
1503: echo " N.B. This option may not work in your platform. If Amaya crashes"
1504: echo " when opening a PNG file. Recompile it using the system libraries."
1505: fi
1506: fi
1.107 kahan 1507: fi
1508:
1509: if test "$with_gtk" = "yes" ; then
1.67 vatton 1510: echo "Amaya configured with GTK"
1.120 gully 1511: fi
1512:
1.124 gully 1513: if test "$with_wx" = "yes" ; then
1.136 gully 1514: if test "$with_wxdebug" = "yes" ; then
1.153 gully 1515: echo "Amaya configured with wxWidgets {srcdir=$WX_SRCDIR} (debug) (experimental)"
1.136 gully 1516: else
1.153 gully 1517: echo "Amaya configured with wxWidgets {srcdir=$WX_SRCDIR} (experimental)"
1.136 gully 1518: fi
1.1 cvs 1519: fi
1520:
1.121 gully 1521: if test "$with_nogui" = "yes" ; then
1.128 gully 1522: echo "Amaya configured without GUI toolkit"
1.121 gully 1523: fi
1.136 gully 1524:
1525:
1.107 kahan 1526: echo ""
1.78 vatton 1527: echo "Now type \"make\" (GNU make preferably) to build the binaries"
1.107 kahan 1528: echo ""
1.120 gully 1529:
Webmaster