Annotation of Amaya/configure.in, revision 1.261
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.216 vatton 13: AC_PREREQ(2.54)
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.228 kia 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" ;;
1.259 vatton 175: freebsd2*) AMAYAOS="FREEBSD" ;;
176: freebsd*) AMAYAOS="FREEBSD" ;;
1.178 gully 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" ;;
1.259 vatton 186: solaris2*) AMAYAOS="FREEBSD" ;;
187: sunos4*) AMAYAOS="FREEBSD" ;;
1.178 gully 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.259 vatton 201: FREEBSD) OS_OPTIONS="-D_UNIX -D_FREEBSD" ;;
1.132 gully 202: esac
203:
1.85 vatton 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 - 9.x needs : GL, GLX, GLU, freetype2, wxGLCanvas
1.85 vatton 208: dnl GL is for opengl
1.175 gully 209: dnl GlX is for XWindow integration
1.85 vatton 210: dnl GLU is for tesselation algortihms (until we extract it from this lib)
211: dnl (tesselation is used for polygons with holes in it...)
1.175 gully 212: dnl freetype2 is for text drawing (fonts ...)
213: dnl wxGLCanvas is for integration of opengl in wxWidgets (WX)
1.231 vatton 214:
215: with_wx="yes"
1.240 kia 216:
217: AC_ARG_ENABLE([system-wx],
218: AC_HELP_STRING([--enable-system-wx],[try the wxWidgets system library]),
219: [case "${enableval}" in
220: yes) with_system_wx="yes";;
221: no) with_system_wx="no" ;;
222: *) AC_MSG_ERROR(bad value ${enableval} for --enable-system-wx) ;;
223: esac],
224: [with_system_wx="no"])
225:
226:
1.231 vatton 227:
1.211 vatton 228: AC_ARG_WITH([gl],
1.218 vatton 229: AC_HELP_STRING([--with-gl],[enable canvas with hardware OpenGL implementation]),
1.210 vatton 230: [case "${withval}" in
231: yes) with_gl="yes" ;;
232: no) with_gl="no" ;;
233: *) AC_MSG_ERROR(bad value ${withval} for --with-gl) ;;
234: esac],
235: [with_gl="no"])
1.85 vatton 236:
1.143 gully 237: # check for mesa library (OpenGL)
1.218 vatton 238: AC_ARG_WITH(MESA, [ --with-mesa enable canvas with software OpenGL implementation (default) ])
1.143 gully 239: if test "$with_mesa" = "" ; then
1.208 vatton 240: with_mesa="no"
1.143 gully 241: fi
242:
1.124 gully 243:
1.176 gully 244: # mesa (software) gl implementation is default with wx (hardware gl implem can be choosen with --with-gl option)
1.231 vatton 245: if test "$AMAYAOS" = "MACOSX" ; then
246: with_mesa="no"
247: with_gl="yes"
248: else
1.176 gully 249: if test "$with_gl" = "no" ; then
250: with_mesa="yes"
1.175 gully 251: fi
252: fi
253:
1.257 vatton 254: # check if wxWidgets debug is enabled
1.155 carcone 255: AC_ARG_WITH(wxdebug, [ --with-wxdebug compiles wxWidgets with debuging options ])
1.136 gully 256: if test "$with_wxdebug" = "yes" ; then
257: with_wxdebug="yes"
258: else
259: with_wxdebug="no"
260: fi
261:
1.153 gully 262: # it is possible to specify wxWidgets library path,
263: # usefull for developpers who want to compile amaya with different wxWidgets version
1.155 carcone 264: AC_ARG_WITH(wxsrcdir, [ --with-wxsrcdir=... compiles Amaya with a specific wxWidgets sources path ])
1.153 gully 265: if test "$with_wxsrcdir" = "" ; then
266: with_wxsrcdir="../../wxWidgets"
267: fi
268:
269:
1.152 gully 270: # setup the AMAYAGUI variable used to identify used GUI when 'make install' is called
1.231 vatton 271: AMAYAGUI="wx"
1.152 gully 272: AC_SUBST(AMAYAGUI)
273:
274:
1.143 gully 275: if test "$with_mesa" = "yes" ; then
276: # --------- compile Mesa library (opengl) --------------- #
277: # check that sources of Mesa exists
278: if test ! -f ../../Mesa/Makefile ; then
1.231 vatton 279: GL_BUILDDIR=""
280: GL_INCLUDES="-I/usr/include"
281: GL_LIBRARIES="-Wl,-rpath,usr/lib -L/usr/lib -lGL -lGLU"
282: echo "---> Use system Mesa library"
283: else
284: OLDDIR=`pwd`
285: GL_BUILDDIR="${OLDDIR}/Mesa"
286: if test ! -d "$GL_BUILDDIR" ; then
287: echo "---> Install Mesa library into ${GL_BUILDDIR}"
288: mkdir -p ${GL_BUILDDIR}
289: cp -r ../../Mesa/* ${GL_BUILDDIR}
290: echo "---> Install Mesa library into ${GL_BUILDDIR} - DONE"
291: fi
292: # this is the flags used to build amaya with OpenGL
293: GL_INCLUDES="-I${GL_BUILDDIR}/include"
294: GL_LIBRARIES="-Wl,-rpath,${GL_BUILDDIR}/lib -L${GL_BUILDDIR}/lib -lGL -lGLU"
1.214 vatton 295: fi
1.143 gully 296: GL_OPTIONS="-D_GL"
1.152 gully 297: AC_SUBST(GL_BUILDDIR)
1.143 gully 298: AC_SUBST(GL_INCLUDES)
299: AC_SUBST(GL_LIBRARIES)
300: fi
301:
1.240 kia 302: if test "$with_system_wx" = "yes"; then
1.231 vatton 303: AC_PATH_PROG(WXCONFIG, wx-config)
304: if test -z "$WXCONFIG"; then
1.240 kia 305: with_system_wx="no"
1.249 vatton 306: AC_MSG_WARN(wxWidgets system library not found, falling back to the builtin version.)
1.135 gully 307: fi
1.231 vatton 308: fi
1.205 vatton 309:
1.240 kia 310: if test "$with_system_wx" != "yes"; then
1.231 vatton 311: # WX_SRCDIR is better to understand the code than with_wxsrcdir variable
312: if test ! -f $with_wxsrcdir/Makefile.in ; then
313: $with_wxsrcdir = ../../wxWidgets
314: fi
315: cd $with_wxsrcdir
316: WX_SRCDIR=`pwd`
317: cd -
318: AC_SUBST(WX_SRCDIR)
319:
320: # check that sources of wxWidgets exists
321: if test ! -f $WX_SRCDIR/Makefile.in ; then
1.249 vatton 322: AC_MSG_ERROR(wxWidgets library sources not found, check --with-wxsrcdir is correct !)
1.231 vatton 323: fi
1.135 gully 324:
1.152 gully 325: # --------- configure wxWidgets library --------------- #
1.135 gully 326: echo "---> Configuring wxWidgets library."
327: OLDDIR=`pwd`
1.149 gully 328: # create the build directory (debug or release)
329: if test $with_wxdebug = yes ; then
1.152 gully 330: WX_BUILDDIR="wxWidgets_DEBUG"
1.149 gully 331: else
1.152 gully 332: WX_BUILDDIR="wxWidgets_RELEASE"
1.149 gully 333: fi
1.205 vatton 334:
1.152 gully 335: mkdir -p $WX_BUILDDIR
336: cd $WX_BUILDDIR
337: AC_SUBST(WX_BUILDDIR)
1.136 gully 338:
1.149 gully 339: # remove old configure cached options
1.135 gully 340: rm -f configarg.cache
1.136 gully 341:
342: # setup configure options
1.158 gully 343:
344: # disable unused wx features
345: # --disable-htmlhelp
346: # --disable-html
347: # --disable-docview
348: # --disable-mdi
349: # --disable-mdidoc
350: # --disable-sound
1.225 vatton 351: # --disable-richtext
1.185 gully 352: # --disable-backtrace # to avoid the buggy popup when an assert occurs
1.229 kia 353: WXCONFIGURE_TUNNING_OPTION="--disable-printarch --disable-htmlhelp --disable-html --disable-richtext --disable-docview --disable-mdidoc --disable-sound --disable-backtrace"
1.158 gully 354:
1.178 gully 355: if test "$AMAYAOS" = "LINUX" ; then
1.135 gully 356: # LINUX
1.145 gully 357: # --enable-gtk2 use GTK+ 2.0 if available (EXPERIMENTAL)
1.158 gully 358: # --disable-shared create only static library (.a)
1.145 gully 359: # --enable-unicode compile wxString with Unicode support
360: # --with-gtk use GTK+
361: # --with-opengl use OpenGL (or Mesa)
1.232 vatton 362: WXCONFIGURE_OPTION="--build=$build_alias --host=$host_alias --target=$target_alias --with-opengl --with-gtk --enable-gtk2 --enable-unicode --enable-ipc --disable-shared --with-libpng=builtin --with-libjpeg=builtin --with-libtiff=builtin --with-libxpm=builtin $WXCONFIGURE_TUNNING_OPTION"
1.135 gully 363: fi
1.178 gully 364: if test "$AMAYAOS" = "MACOSX" ; then
1.135 gully 365: # MACOSX
1.233 vatton 366: WXCONFIGURE_OPTION="--with-opengl --disable-shared --disable-tga --enable-unicode --with-libpng=builtin --with-libjpeg=builtin"
1.136 gully 367: fi
368: if test $with_wxdebug = yes ; then
1.141 gully 369: WXCONFIGURE_OPTION="$WXCONFIGURE_OPTION --enable-debug"
1.143 gully 370: # SG: I've disabled other debug options because the lib has bugs when using these flags \
371: # (maybe because these flags are not often used by wxWidgets developpers)
1.141 gully 372: # WXCONFIGURE_OPTION="$WXCONFIGURE_OPTION --enable-debug --enable-debug_cntxt --enable-debug_gdb --enable-debug_info --enable-debug_flag --enable-mem_tracing"
1.145 gully 373: else
374: WXCONFIGURE_OPTION="$WXCONFIGURE_OPTION --enable-optimise"
1.135 gully 375: fi
1.143 gully 376:
1.136 gully 377: # launch the configure
1.143 gully 378: if test "$with_mesa" = "yes" ; then
379: # use internal OpenGL (mesa) libraries
1.165 gully 380: $WX_SRCDIR/configure CFLAGS="-I${GL_BUILDDIR}/include" CXXFLAGS="-I${GL_BUILDDIR}/include" CPPFLAGS="-I${GL_BUILDDIR}/include" $WXCONFIGURE_OPTION
1.158 gully 381: #../$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 382: if test $? != 0 ; then
383: AC_MSG_ERROR(A problem occurs durring wxWidgets library configuration. Please fix the problem and try again.)
384: fi
1.143 gully 385: else
386: # use OpenGL system libraries
1.165 gully 387: $WX_SRCDIR/configure $WXCONFIGURE_OPTION
1.143 gully 388: fi
1.152 gully 389: cd $OLDDIR
1.135 gully 390: echo "---> Configuring wxWidgets library. - DONE"
1.143 gully 391:
1.135 gully 392: # --------- configuring wxWidgets paths --------------- #
1.152 gully 393: WXCONFIG=$WX_BUILDDIR/wx-config
1.134 gully 394: # check that wx-config exists
1.135 gully 395: if test ! -f $WXCONFIG ; then
1.143 gully 396: AC_MSG_ERROR(Cannot find wx-config. Please download wxWidgets (http://www.wxwidgets.org/))
1.134 gully 397: fi
1.144 gully 398:
399: # setup include paths
1.165 gully 400: # "-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)
1.205 vatton 401: WX_INCLUDES="-I$WX_SRCDIR/src/png -I$WX_SRCDIR/src/jpeg -I$WX_SRCDIR/src/tiff"
402: BUILDWXWIDGETS="wxwidgets"
403: AC_SUBST(BUILDWXWIDGETS)
404:
1.240 kia 405: fi #!$with_system_wx
1.205 vatton 406:
1.231 vatton 407: WX_INCLUDES="$WX_INCLUDES `$WXCONFIG --cxxflags`"
408: AC_SUBST(WX_INCLUDES)
1.205 vatton 409:
1.231 vatton 410: # setup libraries paths
411: WX_LIBRARIES=""
412: WX_LIBRARIES_EXTRA_PARAM=""
413: WXCONFIG_LIBS_PARAM="aui,xrc,adv,core,xml,net"
414: # GL is used ?
415: if test "$with_gl" = "yes" -o "$with_mesa" = "yes" ; then
416: WXCONFIG_LIBS_PARAM="${WXCONFIG_LIBS_PARAM},gl"
417: # SG: this is a mistery why wx-config doesn't add these needed option on macosx
418: if test "$AMAYAOS" = "MACOSX" ; then
419: WX_LIBRARIES_EXTRA_PARAM="-framework OpenGL -framework AGL"
1.124 gully 420: fi
1.231 vatton 421: fi
422: if test "$AMAYAOS" = "MACOSX" ; then
1.170 carcone 423: WXCONFIG_LIBS_PARAM="${WXCONFIG_LIBS_PARAM},html"
1.231 vatton 424: fi
1.170 carcone 425:
1.231 vatton 426: WX_LIBRARIES="`$WXCONFIG --libs $WXCONFIG_LIBS_PARAM` ${WX_LIBRARIES_EXTRA_PARAM}"
427: AC_SUBST(WX_LIBRARIES)
428: WX_LINKDEPS="`$WXCONFIG --linkdeps`"
429: AC_SUBST(WX_LINKDEPS)
430: WX_OPTIONS="-D_WX"
431: # --------- configuring wxWidgets paths - DONE --------------- #
1.124 gully 432:
1.63 vatton 433: if test "${GCC}" = "yes"; then
1.231 vatton 434: CPP="${CPP} -x c"
1.63 vatton 435: fi
436:
1.1 cvs 437: dnl ***************************************************************
438: dnl
1.61 cvs 439: dnl SPECIFIC STUFF : CONFIGURATION OPTIONS FOR AMAYA
1.1 cvs 440: dnl
441: dnl ***************************************************************
442:
1.158 gully 443: # Do not care with libpng or libjpeg with wx version because we use the wxwidgets one.
1.76 vatton 444:
1.166 gully 445: # the wx version
1.242 vatton 446: AMAYAWX_MAJVER=11
1.254 vatton 447: AMAYAWX_MINVER=3
1.201 vatton 448: AMAYAWX_SUBVER=0
1.231 vatton 449: APP_MAJVER=$AMAYAWX_MAJVER
450: APP_MINVER=$AMAYAWX_MINVER
451: APP_SUBVER=$AMAYAWX_SUBVER
1.168 gully 452:
1.247 vatton 453: if test "$APP_SUBVER" = "0" ; then
1.168 gully 454: APP_VER=$APP_MAJVER.$APP_MINVER
455: else
456: APP_VER=$APP_MAJVER.$APP_MINVER.$APP_SUBVER
457: fi
1.166 gully 458:
459: # generate a header file with the right version number, so it can be used on windows AND on unix
460: APPVERSION_H=../thotlib/internals/h/appversion.h
461: echo "#ifndef __APPVERSION_H__" > $APPVERSION_H
462: echo "#define __APPVERSION_H__" >> $APPVERSION_H
463: echo "#define APP_MAJVER $AMAYAWX_MAJVER" >> $APPVERSION_H
464: echo "#define APP_MINVER $AMAYAWX_MINVER" >> $APPVERSION_H
465: echo "#define APP_SUBVER $AMAYAWX_SUBVER" >> $APPVERSION_H
466: echo "#endif /* __APPVERSION_H__ */" >> $APPVERSION_H
1.1 cvs 467:
468: dnl
1.6 cvs 469: dnl We use a special versoin of cextract patched for alignment
470: dnl to build the signatures of the modules functions located in f subdirs
471: dnl
472: CEXTRACT_VER="1.7"
473: CEXTRACT_FLAGS="+O"
474:
1.178 gully 475: # Check if debug is enable
1.218 vatton 476: AC_ARG_WITH(debug, [ --with-debug compiles Amaya with debuging options (-g) ])
1.244 vatton 477: if test "$with_debug" = "yes" ; then
478: with_debug="yes"
479: CFLAGS="-g"
480: CXXFLAGS="-g"
481: else
482: with_debug="no"
483: CFLAGS="-O2"
484: CXXFLAGS="-O2"
485: fi
1.7 cvs 486:
487: if test "${CC}" = "gcc" ; then
1.243 vatton 488: CFLAGS="${CFLAGS} -Wall"
1.7 cvs 489: case "${host}" in
490: *-*-irix5* | *-*irix6* )
491: CFLAGS="${CFLAGS} -fsigned-char"
492: ;;
493: esac
1.14 cvs 494: fi
495:
496: if test "$ac_cv_c_const" = "no" ; then
497: CFLAGS="${CFLAGS} -DCONST= "
1.7 cvs 498: fi
499:
1.243 vatton 500: # force C mode (-x c)
501: #CFLAGS="${CFLAGS} -Wall"
502: CFLAGS="${CFLAGS} -x c"
503:
504: # C++ options (-x c++)
505: #CXXFLAGS="${CXXFLAGS} -Wall"
506: CXX_OPTIONS="-D__cplusplus"
507: CXXFLAGS="${CXXFLAGS} -Wall -x c++ ${CXX_OPTIONS}"
1.122 gully 508:
1.132 gully 509: # setup LDFLAGS
510: # on macosx, specific flags must be set to avoid conflicts with allready installed libwww
511: # for exemple it's possible to install libwww with fink (fink install libwww)
512: # to avoid conflicts, we just force the linker to search for specified amaya path first
1.178 gully 513: if test "$AMAYAOS" = "MACOSX" ; then
1.132 gully 514: LDFLAGS="-Wl,-search_paths_first"
515: else
516: LDFLAGS=""
517: fi
1.128 gully 518:
519: dnl
1.61 cvs 520: dnl Check for availability of amaya sources
1.1 cvs 521: dnl
522:
523: build_amaya="yes"
524:
525: if test "$with_amaya" = "no" ; then
526: build_amaya="no"
1.45 cvs 527: else
528: if test ! -f $srcdir/amaya/Makefile.in ; then
1.1 cvs 529: AC_MSG_WARN(Amaya browser/editor sources not found, disabling Amaya build !)
530: build_amaya="no"
1.45 cvs 531: fi
1.1 cvs 532: fi
533:
534: dnl
1.50 cvs 535: dnl Check for additionnal packages
1.1 cvs 536: dnl use AC_CONFIG_SUBDIRS to launch configure in the subdir
537: dnl
1.93 kahan 538:
1.143 gully 539: if test "$with_gl" = "yes" -o "$with_mesa" = "yes" ; then
540:
541: # if with_gl is on then test system opengl library (GL & GLU)
542: if test "$with_gl" = "yes" ; then
1.184 carcone 543: if test "$AMAYAOS" = "LINUX" ; then
1.139 carcone 544: # setup a list of standard paths int LDFLAGS
545: # for AC_CHECK_LIB library existance checks
1.140 carcone 546: LIBS_OLD=$LIBS
1.139 carcone 547: LDFLAGS_OLD=$LDFLAGS
548: LDFLAGS="-L/usr/X11R6/lib -L/usr/lib -L/usr/local/lib"
1.75 cheyroul 549: AC_MSG_CHECKING([OpenGL])
550: for ac_dir in \
1.183 carcone 551: /usr/include \
1.75 cheyroul 552: /usr/X11R6/include \
553: /usr/local/include \
554: ; \
1.80 cheyroul 555: do if test -r "$ac_dir/GL/gl.h" ; then
1.143 gully 556: gl_inc="yes"
557: GL_INC_I="$ac_dir"
558: if test "$ac_dir" != "/usr/include" ; then
559: GL_INCLUDES="-I$ac_dir"
560: fi
561: AC_CHECK_LIB(GL,glBegin,,AC_MSG_ERROR(Cannot find OpenGL library. Please install OpenGL.))
562: AC_MSG_RESULT([yes])
563: break
564: fi
565: done
566:
1.80 cheyroul 567: AC_MSG_CHECKING([GLU])
1.75 cheyroul 568: for ac_dir in \
1.183 carcone 569: /usr/include \
570: /usr/X11R6/include \
1.75 cheyroul 571: /usr/local/include \
572: ; \
1.138 gully 573: do if test -r "$ac_dir/GL/glu.h" ; then
1.143 gully 574: glu_inc="yes"
575: GL_INC_II="$ac_dir"
576: if test "$ac_dir" != "/usr/include" ; then
577: if test "$ac_dir" != "$GL_INC_I" ; then
578: GL_INCLUDES="$GL_INCLUDES -I$ac_dir"
579: fi
580: fi
581: # now test that glu version is >= 1.2
582: 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.)))
583: AC_MSG_RESULT([yes])
584: break
585: fi
586: done
1.139 carcone 587: LDFLAGS=$LDFLAGS_OLD
1.140 carcone 588: LIBS=$LIBS_OLD
1.174 carcone 589:
1.143 gully 590: if test "$gl_inc" = "" ; then
591: AC_MSG_WARN(Opengl headers (gl.h) not found !!)
592: AC_MSG_WARN(Disabling opengl build !)
593: with_gl="no"
594: GL_OPTIONS=
595: GL_INCLUDES=
596: GL_LIBRARIES=
597: exit 1;
598: fi
599:
600: if test "$glu_inc" = "" ; then
601: AC_MSG_WARN(Glu headers (glu.h) not found !!)
602: AC_MSG_WARN(Disabling opengl build !)
603:
604: with_gl="no"
605: GL_OPTIONS=
606: GL_INCLUDES=
607: GL_LIBRARIES=
608: exit 1;
609: fi
1.184 carcone 610: fi # AMAYAOS = LINUX
1.174 carcone 611:
1.187 gully 612: if test "$AMAYAOS" = "MACOSX" ; then
1.174 carcone 613: GL_OPTIONS="-D_GL"
1.183 carcone 614: GL_INCLUDES="-I/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers/"
1.174 carcone 615: GL_LIBRARIES=""
1.183 carcone 616: GL_BUILDDIR=""
1.174 carcone 617: else
618: GL_LIBRARIES="-L/usr/lib -L/usr/X11R6/lib -lGL -lGLU"
619: GL_OPTIONS="-D_GL"
1.173 carcone 620: fi
1.143 gully 621:
622: AC_SUBST(GL_INCLUDES)
623: AC_SUBST(GL_LIBRARIES)
624: fi # if with_gl
1.139 carcone 625:
1.187 gully 626: # ---------- Checking for freetype lib (fonts library)
627: if test "$AMAYAOS" = "MACOSX" ; then
1.173 carcone 628: # we use a static version of freetype lib for mac osx
1.187 gully 629: # ** search for includes (freetype.h)
630: for ac_dir in \
1.257 vatton 631: /Developer/SDKs/MacOSX10.6.sdk/usr/X11R6/include/ \
632: /Developer/SDKs/MacOSX10.6.sdk/usr/X11R6/include/freetype2/ \
633: /Developer/SDKs/MacOSX10.5.sdk/usr/X11R6/include/ \
634: /Developer/SDKs/MacOSX10.5.sdk/usr/X11R6/include/freetype2/ \
1.187 gully 635: /Developer/SDKs/MacOSX10.2.8.sdk/usr/X11R6/include/ \
636: /Developer/SDKs/MacOSX10.2.8.sdk/usr/X11R6/include/freetype2/ \
637: /Developer/SDKs/MacOSX10.3.0.sdk/usr/X11R6/include/ \
638: /Developer/SDKs/MacOSX10.3.0.sdk/usr/X11R6/include/freetype2/ \
1.207 vatton 639: /Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/include/ \
640: /Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/include/freetype2/ \
1.187 gully 641: /Developer/SDKs/MacOSX10.3.9.sdk/usr/X11R6/include/ \
642: /Developer/SDKs/MacOSX10.3.9.sdk/usr/X11R6/include/freetype2/ \
643: /Developer/SDKs/MacOSX10.4.0.sdk/usr/X11R6/include/ \
1.207 vatton 644: /Developer/SDKs/MacOSX10.4.0.sdk/usr/X11R6/include/freetype2/ \
1.190 carcone 645: /opt/local/include/ \
646: /opt/local/include/freetype2/ \
647: /usr/X11R6/include/freetype2/freetype/ \
648: ; \
1.187 gully 649: do
650: if test -r "$ac_dir/ft2build.h"; then
651: FREETYPE_INCLUDES="${FREETYPE_INCLUDES} -I$ac_dir"
1.191 carcone 652: fi
653: if test -r "$ac_dir/freetype/config/ftheader.h"; then
654: FREETYPE_INCLUDES="${FREETYPE_INCLUDES} -I$ac_dir"
1.187 gully 655: fi
656: done
657: # ** search for binary (libfreetype.a)
658: for ac_dir in \
659: /Developer/SDKs/MacOSX10.2.8.sdk/usr/X11R6/lib/ \
660: /Developer/SDKs/MacOSX10.3.0.sdk/usr/X11R6/lib/ \
1.207 vatton 661: /Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/lib/ \
1.187 gully 662: /Developer/SDKs/MacOSX10.3.9.sdk/usr/X11R6/lib/ \
663: /Developer/SDKs/MacOSX10.4.0.sdk/usr/X11R6/lib/ \
1.190 carcone 664: /opt/local/lib/ \
665: /usr/X11R6/lib/ \
1.187 gully 666: ; \
667: do
668: if test -r "$ac_dir/libfreetype.a"; then
1.192 carcone 669: FREETYPE_LIBRARIES="$ac_dir/libfreetype.a"
1.187 gully 670: break
671: fi
672: done
673: else # "$AMAYAOS" = "MACOSX"
1.173 carcone 674: if test ! -f $(which freetype-config) ; then
675: AC_MSG_ERROR(Cannot find freetype library (font load/display routines). Please install it.)
676: fi
677: FREETYPE_INCLUDES=`freetype-config --cflags`
678: FREETYPE_LIBRARIES=`freetype-config --libs`
1.187 gully 679: fi # "$AMAYAOS" = "MACOSX"
680: AC_SUBST(FREETYPE_INCLUDES)
681: AC_SUBST(FREETYPE_LIBRARIES)
682:
683:
1.143 gully 684: AC_MSG_CHECKING([gcc3])
685: for ac_dir in \
1.96 cheyroul 686: /usr/lib \
687: /usr/X11R6/lib \
688: /usr/local/lib \
689: ; \
1.143 gully 690: do if test -r "$ac_dir/libstdc++.so.5" ; then
691: stdglu_inc="yes"
692: STDCPP_LIBRARIES="-lstdc++"
693: STDCPP_INCLUDES=""
694: AC_MSG_RESULT([yes])
695: break
696: fi
697: done
1.159 gully 698:
1.143 gully 699: fi # if with_gl or with_mesa
1.132 gully 700:
1.208 vatton 701: AC_ARG_ENABLE([svg],
702: AC_HELP_STRING([--disable-svg],[disable SVG support]),
703: [case "${enableval}" in
704: yes) with_svg="yes" ;;
705: no) with_svg="no" ;;
706: *) AC_MSG_ERROR(bad value ${enableval} for --disable-svg) ;;
707: esac],
708: [with_svg="yes"])
709:
1.241 vatton 710: #################### LibWWW and WebDAV Support ################################
711:
712: AC_ARG_ENABLE([system-libwww],
713: AC_HELP_STRING([--enable-system-libwww],[try the libWWW system library]),
714: [case "${enableval}" in
715: yes) with_system_libwww="yes" ;;
716: no) with_system_libwww="no" ;;
717: *) AC_MSG_ERROR([bad value ${enableval} for --enable-system-libwww]) ;;
718: esac],
719: [with_system_libwww="no"])
720:
721: if test "$with_system_libwww" = "yes" ; then
722: # check to see if we have a libWWW library
723: AC_PATH_PROG([LIBWWW_CONFIG],[libwww-config])
724:
725: if test "$LIBWWW_CONFIG" = "" ; then
1.250 vatton 726: AC_MSG_WARN(libwww system library not found, falling back to the builtin version.)
1.241 vatton 727: with_system_libwww="no"
728: fi
729: fi
730:
731: dnl
732: dnl WebDAV support enabled by default
733: dnl
734: AC_ARG_WITH(dav,
735: AC_HELP_STRING([--with-dav],[enable WebDAV support (default)]),
736: [case "${withval}" in
737: yes) with_dav="yes" ;;
738: no) with_dav="no" ;;
739: *) AC_MSG_ERROR(bad value ${withval} for --with-dav) ;;
740: esac],
741: [with_dav="yes"])
742:
743: # If DAV is enabled, check if the source code is present
744: if test ! -f $srcdir/davlib/Makefile.in ; then
745: if test "$with_dav" = "yes" ; then
746: AC_MSG_WARN(WebDAV makefile not found, disabling WebDAV build)
747: with_dav="no"
748: fi
749: fi
750:
751: if test "$with_dav" = "yes" ; then
752: WITHDAV="--with-dav"
753: else
754: WITHDAV="--without-dav"
755: fi
756:
1.250 vatton 757: if test "$with_system_libwww" != "yes" ; then
1.241 vatton 758: # configure libwww
759: CURRENT_PATH="`pwd`"
760: mkdir libwww
761: cd libwww && \
762: $CURRENT_PATH/../../libwww/configure \
763: --build=$build_alias --host=$host_alias --target=$target_alias \
764: --disable-shared \
765: $WITHDAV \
1.253 vatton 766: --with-zlib --with-ssl && \
1.241 vatton 767: echo "libwww is configured" ; \
768: echo "patching wwwconf.h because appkit.h do not compile on macos, and it seems that appkit.h is not used in amaya" ; \
769: cp wwwconf.h wwwconf.h.orig ; \
770: sed -e "s/\(\#define HAVE_APPKIT_APPKIT_H 1\)/\/* \1 *\//" \
771: wwwconf.h.orig > wwwconf.h ; \
772: echo "wwwconf.h patched !" ; \
773: cd ..
774: chmod +x libwww/libwww-config
775: BUILDLIBWWW="libwww"
776: LIBWWW_CONFIG="libwww/libwww-config"
1.251 vatton 777: LIBWWW_LDFLAGS="-L$CURRENT_PATH/libwww/Library/src/.libs -lwwwxml -lwwwzip -lwwwinit -lwwwapp -lwwwhtml -lwwwtelnet -lwwwnews -lwwwhttp -lwwwmime -lwwwgopher -lwwwftp -lwwwfile -lwwwdir -lwwwcache -lwwwstream -lwwwmux -lwwwtrans -lwwwcore -lwwwutils -lwwwdav \
1.253 vatton 778: -L$CURRENT_PATH/libwww/Library/src/SSL/.libs -lwwwssl\
1.251 vatton 779: -L$CURRENT_PATH/libwww/modules/md5/.libs -lmd5 \
1.253 vatton 780: -L$CURRENT_PATH/libwww/modules/expat/.libs -lexpat \
1.261 ! vatton 781: -L/usr/lib -lssl -lcrypto -L/usr/lib64 -lssl -lcrypto"
1.260 vatton 782: LIBWWW_CFLAGS="-I$CURRENT_PATH/../../libwww/Library/src -I$CURRENT_PATH/libwww -I$CURRENT_PATH/../../libwww/modules/expat/lib -I$CURRENT_PATH/../../libwww/Library/src/SSL"
1.241 vatton 783: else
784: LIBWWW_CFLAGS="`$LIBWWW_CONFIG --cflags`"
785: LIBWWW_LDFLAGS="`$LIBWWW_CONFIG --libs`"
786:
787: if test "$with_dav" = "yes" ; then
788: AC_CHECK_LIB([wwwdav],
789: [toto],
790: [LIBWWW_LDFLAGS="$LIBWWW_LDFLAGS -lwwwdav"],
791: [AC_MSG_WARN([libwwwdav is not available, disabling WebDAV]); with_dav="no"])
792: fi
793: fi
794:
795: if test "$with_dav" = "yes" ; then
796: DAV_OPTIONS=-DDAV
797: DAVDIR="davlib"
798: else
799: with_dav="no"
800: DAV_OPTIONS=""
801: DAVDIR=""
802: fi
803:
804: AC_SUBST(BUILDLIBWWW)
805:
806: AC_SUBST(LIBWWW_CFLAGS)
807: AC_SUBST(LIBWWW_LDFLAGS)
808:
809: AC_SUBST(DAVDIR)
810: AC_SUBST(LIBDAV)
811: AC_SUBST(WWWDAV)
812:
813: ############# end of LibWWW and WebDAV Support ################################
814:
1.218 vatton 815: ##########################Annotations Support####################
1.208 vatton 816: dnl
817: dnl annotations are enabled by default
818: dnl
819: AC_ARG_ENABLE([annot],
820: AC_HELP_STRING([--disable-annot],[disable Annotations support]),
821: [case "${enableval}" in
822: yes) with_annot="yes" ;;
823: no) with_annot="no" ;;
824: *) AC_MSG_ERROR(bad value ${enableval} for --disable-annot) ;;
825: esac],
826: [with_annot="yes"])
1.93 kahan 827:
1.108 kahan 828:
1.237 vatton 829: #annot need Raptor
1.218 vatton 830: if test "$with_annot" = "yes" ; then
1.237 vatton 831: with_raptor="yes"
1.210 vatton 832: else
1.237 vatton 833: with_raptor="no"
1.210 vatton 834: fi
835:
1.237 vatton 836: AC_ARG_ENABLE([system-raptor],
837: AC_HELP_STRING([--enable-system-raptor],[try the raptor RDF system library]),
1.210 vatton 838: [case "${enableval}" in
1.237 vatton 839: yes) with_system_raptor="yes";;
840: no) with_system_raptor="no" ;;
841: *) AC_MSG_ERROR(bad value ${enableval} for --enable-system-raptor) ;;
1.210 vatton 842: esac],
1.237 vatton 843: [with_system_raptor="no"])
1.210 vatton 844:
1.237 vatton 845: #If Raptor is needed and we are asked
1.210 vatton 846: #to use the system library, check if is present
1.237 vatton 847: if test "$with_raptor" = "yes" -a "$with_system_raptor" = "yes" ; then
848: # check to see if we have a raptor library
849: AC_PATH_PROG([RAPTOR_CONFIG],[raptor-config])
850:
851: if test "$RAPTOR_CONFIG" = "" ; then
1.239 vatton 852: AC_MSG_WARN(Not using system-provided Raptor library)
853: with_system_raptor="no"
1.210 vatton 854: fi
855: fi
856:
857: #if we use the builtin library,
858: #check it is present
1.237 vatton 859: if test "$with_raptor" = "yes" -a "$with_system_raptor" != "yes" \
860: -a ! -d "$srcdir/../redland/raptor" ; then
861: AC_MSG_WARN(Raptor source dir not found !!)
862: AC_MSG_WARN(Disabling raptor build !)
863: with_raptor="no"
1.210 vatton 864: fi
865:
1.237 vatton 866: #At this point, we know everything about Raptor,
1.210 vatton 867: #so either set the variables we will need later,
1.218 vatton 868: #or disable Annotations
1.237 vatton 869: if test "$with_raptor" = "yes" ; then
870: if test "$with_system_raptor" != "yes" ; then
871: AMAYA_ANNOT_OPTIONS="$AMAYA_ANNOT_OPTIONS -I\$(THOTDIR)/../redland/raptor "
1.238 vatton 872: AMAYA_RAPTOR_LIBS="../raptor/.libs/libraptor.a"
1.237 vatton 873: AMAYA_RAPTOR_INCLUDES="-I\$(THOTDIR)/../redland/raptor"
874: BUILDRAPTOR="raptor"
875: CURRENTPATH="`pwd`"
876: mkdir $BUILDRAPTOR
877: cd $BUILDRAPTOR &&
878: CC="$CC" CXX="$CXX" \
879: CPPFLAGS="-I$CURRENTPATH/../../libwww/modules/expat/lib" \
880: LDFLAGS="-L$CURRENTPATH/libwww/modules/expat -L$CURRENTPATH/libwww/modules/expat/.libs" \
881: ../../../redland/raptor/configure \
882: --build=$build_alias --host=$host_alias --target=$target_alias \
883: --disable-shared \
884: --with-xml-parser=expat \
885: --with-www=none
886: $ECHO "Raptor is configured"
887: $ECHO "Patching the raptor_config.h file to avoid including glib2-0"
888: $CP raptor_config.h raptor_config.h.orig
889: $SED "s/\(\#define HAVE_G_UTF8_NORMALIZE 1\)/\/* \1 *\//" \
890: raptor_config.h.orig > raptor_config.h
891: $RM raptor_config.h.orig
892: $ECHO "Raptor is patched"
893: cd ..
1.210 vatton 894: else
1.237 vatton 895: raptor_includes=`$RAPTOR_CONFIG --cflags`
1.239 vatton 896: raptor_libs="-lraptor"
897: BUILDRAPTOR=""
1.210 vatton 898: AMAYA_ANNOT_OPTIONS="$AMAYA_ANNOT_OPTIONS"
1.237 vatton 899: AMAYA_ANNOT_INCLUDES="$raptor_includes -I\$(THOTDIR)/thotlib/include"
900: AMAYA_ANNOT_EXTRA_LIBS="$raptor_libs"
901: AMAYA_RAPTOR_INCLUDES="$raptor_includes"
1.210 vatton 902: fi
903: else
904: with_annot="no"
905: fi
906:
1.218 vatton 907: ANNOTLIB_COMPILE_BM=['#']
1.210 vatton 908:
1.237 vatton 909: AC_SUBST(BUILDRAPTOR)
910:
911: AC_SUBST(AMAYA_ANNOT_OPTIONS)
912: AC_SUBST(AMAYA_ANNOT_INCLUDES)
913: AC_SUBST(AMAYA_ANNOT_EXTRA_LIBS)
914:
915: AC_SUBST(ANNOTLIB_COMPILE_BM)
916: AC_SUBST(AMAYA_RAPTOR_LIBS)
917: AC_SUBST(AMAYA_RAPTOR_INCLUDES)
918:
1.218 vatton 919: ###################End of Annotations Support####################
1.210 vatton 920:
921:
1.108 kahan 922: dnl
1.194 vatton 923: dnl The templates support is enabled by default
1.186 tollenae 924: dnl
1.208 vatton 925: AC_ARG_ENABLE([templates],
926: AC_HELP_STRING([--disable-templates],[disable experimental templates support]),
927: [case "${enableval}" in
928: yes) with_templates="yes" ;;
929: no) with_templates="no" ;;
930: *) AC_MSG_ERROR(bad value ${enableval} for --disable-templates) ;;
931: esac],
932: [with_templates="yes"])
933:
934: if test "$with_templates" = yes -a "$with_wx" != "yes"; then
935: AC_MSG_WARN(Templates are only available in WX version !!)
936: AC_MSG_WARN(Disabling templates)
937: with_templates="no"
938: fi
1.197 vatton 939:
1.208 vatton 940: if test "$with_templates" = "yes" ; then
1.194 vatton 941: TEMPLATES_OPTIONS="-DTEMPLATES"
1.186 tollenae 942: else
1.194 vatton 943: TEMPLATES_OPTIONS=""
1.186 tollenae 944: fi
945:
1.194 vatton 946:
1.186 tollenae 947: dnl
1.70 kahan 948: dnl Generic XML support enabled by default
949: dnl
1.208 vatton 950: AC_ARG_ENABLE([generic-xml],
951: AC_HELP_STRING([--disable-generic-xml],[disable Generic XML support]),
952: [case "${enableval}" in
953: yes) with_generic_xml="yes" ;;
954: no) with_generic_xml="no" ;;
955: *) AC_MSG_ERROR(bad value ${enableval} for --disable-generic-xml) ;;
956: esac],
957: [with_generic_xml="yes"])
958:
1.209 vatton 959: if test "$with_generic_xml" = "yes" ; then
960: GENERIC_XML_OPTIONS="-DXML_GENERIC"
961: else
962: GENERIC_XML_OPTIONS=""
963: fi
964:
1.70 kahan 965:
1.19 cvs 966: if test "$build_amaya" = "yes" ; then
1.8 cvs 967: if test ! -f $srcdir/amaya/MathML.S ; then
1.10 cvs 968: if test "$with_math" = "yes" ; then
1.8 cvs 969: AC_MSG_WARN(MathML sources not found !!)
1.26 cvs 970: AC_MSG_WARN(Disabling Math build !)
1.10 cvs 971: with_math="no"
972: MATH_OPTIONS=
1.8 cvs 973: fi
974: fi
1.26 cvs 975:
1.68 vatton 976: if test ! -f $srcdir/amaya/SVG.S ; then
977: if test "$with_svg" = "yes" ; then
978: AC_MSG_WARN(SVG sources not found !!)
979: AC_MSG_WARN(Disabling SVG build !)
980: with_svg="no"
981: SVG_OPTIONS=
1.26 cvs 982: fi
983: fi
984:
1.1 cvs 985: fi
986:
987: dnl
988: dnl The options for each library or binary
989: dnl
1.231 vatton 990: THOT_OPTIONS="$OS_OPTIONS $GL_OPTIONS $WX_OPTIONS"
1.1 cvs 991:
1.231 vatton 992: AMAYA_OPTIONS="$OS_OPTIONS $MATH_OPTIONS $SVG_OPTIONS $GENERIC_XML_OPTIONS $GL_OPTIONS $WX_OPTIONS $TEMPLATES_OPTIONS"
1.211 vatton 993:
1.179 gully 994: if test "$with_debug" = "yes" ; then
1.211 vatton 995: AMAYA_OPTIONS="$AMAYA_OPTIONS -DAMAYA_DEBUG"
1.179 gully 996: fi
1.101 kahan 997:
1.158 gully 998: if test "$with_wx" = "yes" ; then
999: IMGLIBS=""
1000: else
1001: IMGLIBS="-ljpeg -lpng -lz"
1002: fi
1.132 gully 1003:
1.131 gully 1004: EXTRA_INCLUDES=
1005:
1006: # check for malloc.h
1007: # on macosx, this file is not at the right place
1.187 gully 1008: if test "$AMAYAOS" = "MACOSX" ; then
1.173 carcone 1009: for ac_dir in \
1.258 vatton 1010: /Developer/SDKs/MacOSX10.6.sdk/usr/include/objc/ \
1011: /Developer/SDKs/MacOSX10.6.sdk/usr/include/sys/ \
1012: /Developer/SDKs/MacOSX10.5.sdk/usr/include/objc/ \
1013: /Developer/SDKs/MacOSX10.5.sdk/usr/include/sys/ \
1.173 carcone 1014: /Developer/SDKs/MacOSX10.2.8.sdk/usr/include/objc/ \
1015: /Developer/SDKs/MacOSX10.2.8.sdk/usr/include/sys/ \
1016: /Developer/SDKs/MacOSX10.3.0.sdk/usr/include/objc/ \
1017: /Developer/SDKs/MacOSX10.3.0.sdk/usr/include/sys/ \
1.233 vatton 1018: /Developer/SDKs/MacOSX10.4u.sdk/usr/include/objc/ \
1019: /Developer/SDKs/MacOSX10.4u.sdk/usr/include/sys/ \
1020: /Developer/SDKs/MacOSX10.3.9.sdk/usr/include/objc/ \
1021: /Developer/SDKs/MacOSX10.3.9.sdk/usr/include/sys/ \
1.173 carcone 1022: ; \
1023: do
1024: if test -r "$ac_dir/malloc.h"; then
1025: echo "found malloc.h"
1026: EXTRA_INCLUDES="${EXTRA_INCLUDES} -I$ac_dir"
1027: break
1028: fi
1029: done
1.187 gully 1030: else # "$AMAYAOS" = "MACOSX"
1.131 gully 1031: for ac_dir in \
1032: /usr/include/malloc/ \
1033: /sw/include/malloc/ \
1034: ; \
1035: do
1036: if test -r "$ac_dir/malloc.h"; then
1037: echo "found malloc.h"
1038: EXTRA_INCLUDES="${EXTRA_INCLUDES} -I$ac_dir"
1039: break
1040: fi
1041: done
1.187 gully 1042: fi # "$AMAYAOS" = "MACOSX"
1.1 cvs 1043:
1044: dnl
1045: dnl Set up the PATHs needed
1046: dnl
1047:
1048: API="\$(THOTDIR)/thotlib/include"
1049: VAR="\$(THOTDIR)/thotlib/internals/var"
1050: INCL="\$(THOTDIR)/thotlib/internals/h"
1051: FUNC="\$(THOTDIR)/thotlib/internals/f"
1052:
1053: dnl
1054: dnl Set up the include variables.
1055: dnl
1056:
1.61 cvs 1057: THOTINCLUDES="-I${API} -I${VAR} -I${INCL} -I${FUNC} ${JPEGINCL} ${PNGINCL}"
1.58 cvs 1058: APIINCLUDES=-I${API}
1059:
1060: if test "${VPATHOPT}" = "" ; then
1.1 cvs 1061: VPATHOPT="VPATH"
1062: fi
1063:
1.217 vatton 1064: AMAYA_INSTALLDIR="Amaya"
1.206 vatton 1065:
1.1 cvs 1066: dnl
1067: dnl Exports the current values of the variables.
1068: dnl
1069:
1.206 vatton 1070: AC_SUBST(AMAYA_INSTALLDIR)
1071:
1.166 gully 1072: AC_SUBST(APP_MAJVER)
1073: AC_SUBST(APP_MINVER)
1074: AC_SUBST(APP_SUBVER)
1075: AC_SUBST(APP_VER)
1.6 cvs 1076: AC_SUBST(CEXTRACT_VER)
1077: AC_SUBST(CEXTRACT_FLAGS)
1.1 cvs 1078:
1079: AC_SUBST(THOTINCLUDES)
1080: AC_SUBST(APIINCLUDES)
1081: AC_SUBST(VPATHOPT)
1082:
1083: AC_SUBST(THOT_OPTIONS)
1084: AC_SUBST(AMAYA_OPTIONS)
1085: AC_SUBST(IMGLIBS)
1.131 gully 1086: AC_SUBST(EXTRA_INCLUDES)
1.90 kirschpi 1087:
1.224 vatton 1088: AC_SUBST(MAKE_LIBWWW_RDF_PARSER)
1089: AC_SUBST(LIBWWW_RDF_PARSER)
1090: #AC_SUBST(ANNOTLIB_COMPILE_BM)
1.93 kahan 1091: AC_SUBST(AMAYA_RAPTOR_LIBS)
1092: AC_SUBST(AMAYA_RAPTOR_INCLUDES)
1093:
1094: AC_SUBST(SUBDIRS)
1095:
1.1 cvs 1096: dnl
1.48 cvs 1097: dnl Include the option Makefile.xxx fragment according to the configure options
1.1 cvs 1098: dnl
1099:
1.211 vatton 1100: www_frag=$srcdir/amaya/Makefile.libwww
1101: AC_SUBST_FILE(www_frag)
1.1 cvs 1102:
1.50 cvs 1103: if test "$with_math" = "no" ; then
1104: math_frag=/dev/null
1.8 cvs 1105: else
1.50 cvs 1106: math_frag=$srcdir/amaya/Makefile.math
1.8 cvs 1107: fi
1.211 vatton 1108: AC_SUBST_FILE(math_frag)
1.8 cvs 1109:
1.68 vatton 1110: if test "$with_svg" = "no" ; then
1111: svg_frag=/dev/null
1.26 cvs 1112: else
1.68 vatton 1113: svg_frag=$srcdir/amaya/Makefile.svg
1.26 cvs 1114: fi
1.211 vatton 1115: AC_SUBST_FILE(svg_frag)
1.26 cvs 1116:
1.47 cvs 1117: if test "$with_annot" = "yes" ; then
1.48 cvs 1118: annot_frag=$srcdir/annotlib/Makefile.annot
1.47 cvs 1119: else
1120: annot_frag=/dev/null
1121: fi
1.211 vatton 1122: AC_SUBST_FILE(annot_frag)
1.47 cvs 1123:
1.88 kirschpi 1124: if test "$with_dav" = "yes" ; then
1125: dav_frag=$srcdir/davlib/Makefile.dav
1.188 vatton 1126: else
1127: dav_frag=/dev/null
1.88 kirschpi 1128: fi
1.211 vatton 1129: AC_SUBST_FILE(dav_frag)
1.16 cvs 1130:
1.186 tollenae 1131: if test "$with_templates" = "yes" ; then
1132: templates_frag=$srcdir/amaya/Makefile.templates
1.188 vatton 1133: else
1134: templates_frag=/dev/null
1.186 tollenae 1135: fi
1.211 vatton 1136: AC_SUBST_FILE(templates_frag)
1.186 tollenae 1137:
1.1 cvs 1138: dnl ***************************************************************
1139: dnl
1140: dnl FINAL STEP : PRODUCE ALL THE MAKEFILES AND CONFIG FILES
1141: dnl
1142: dnl ***************************************************************
1143:
1144: EXTRA_MAKEFILE_IN=
1.2 cvs 1145: make_output="Makefile Options.orig:Options.in tools/Makefile \
1146: tools/mkdep/Makefile \
1.1 cvs 1147: tools/cextract-1.7/Makefile thotlib/Makefile \
1.193 gully 1148: thotlib/include/Makefile batch/Makefile \
1149: script_install:../batch/script_install.in \
1150: script_install_gnomekde:../batch/script_install_gnomekde.in \
1151: script_install_macosxbundle:../batch/script_install_macosxbundle.in \
1152: script_uninstall:../batch/script_uninstall.in"
1.1 cvs 1153:
1154: if test "$build_amaya" = "yes" ; then
1.208 vatton 1155: make_output="$make_output amaya/Makefile"
1.2 cvs 1156: EXTRA_MAKEFILE_IN="$srcdir/amaya/Makefile.in \
1.93 kahan 1157: $srcdir/amaya/Makefile.libwww"
1.27 cvs 1158:
1.48 cvs 1159: if test "$with_annot" = "yes" ; then
1160: make_output="$make_output annotlib/Makefile"
1161: EXTRA_MAKEFILE_IN="$srcdir/annotlib/Makefile.in"
1162: fi
1.88 kirschpi 1163:
1164: if test "$with_dav" = "yes" ; then
1165: make_output="$make_output davlib/Makefile"
1166: EXTRA_MAKEFILE_IN="$srcdir/davlib/Makefile.in"
1167: fi
1168:
1.1 cvs 1169: fi
1170:
1.221 vatton 1171: dnl
1172: dnl Generate the script
1173: dnl
1174: if test "$AMAYAOS" != "MACOSX" ; then
1175: if test ! -d bin ; then
1176: mkdir -p bin
1177: fi
1178: make_output="$make_output bin/amaya:../batch/amaya.in"
1179: fi
1180:
1.1 cvs 1181: AC_SUBST(EXTRA_MAKEFILE_IN)
1.6 cvs 1182: AC_OUTPUT($make_output , [
1183: dnl
1184: dnl This fragment of shell code is executed after the
1185: dnl Makefile(s) dump ...
1186: dnl
1187:
1188: echo timestamp > stamp-h
1189:
1190: dnl
1191: dnl Check for an upgrade in the Options numbers
1192: dnl
1193: if test -f Options ; then
1194: oldversion=`grep Version Options`
1195: newversion=`grep Version Options.orig`
1196: if test "$oldversion" != "$newversion" ; then
1197: echo WARNING : Options files have changed, old options saved to Options.old
1198: cp Options Options.old
1199: cp Options.orig Options
1200: exit 1
1201: fi
1202: fi
1.193 gully 1203: if test -f script_install ; then
1204: chmod a+x script_install
1205: fi
1206: if test -f script_install_gnomekde ; then
1207: chmod a+x script_install_gnomekde
1208: fi
1209: if test -f script_install_macosxbundle ; then
1210: chmod a+x script_install_macosxbundle
1211: fi
1212: if test -f script_uninstall ; then
1213: chmod a+x script_uninstall
1214: fi
1.227 vatton 1215: if test -f bin/amaya ; then
1216: chmod 755 bin/amaya
1217: echo WARNING : `ls -l bin/amaya`
1218: fi
1.6 cvs 1219: ])
1.1 cvs 1220:
1.222 cvs 1221: dnl
1.1 cvs 1222: if test "$build_amaya" = "yes" ; then
1.164 gully 1223: echo Amaya $AMAYA_VER configured
1.230 vatton 1224: echo Amaya configured with libWWW \(local source\)
1.10 cvs 1225: if test "$with_math" = "yes" ; then
1226: echo Amaya configured with Math support
1.26 cvs 1227: fi
1.68 vatton 1228: if test "$with_svg" = "yes" ; then
1229: echo Amaya configured with SVG support
1.47 cvs 1230: fi
1231: if test "$with_annot" = "yes" ; then
1232: echo Amaya configured with Annotations support
1.239 vatton 1233: if test "$with_system_raptor" = "yes" ; then
1234: echo Amaya configured with the RaptorF library \(system\)
1235: else
1.253 vatton 1236: echo Amaya configured with the Raptor library \(local source\)
1.239 vatton 1237: fi
1.108 kahan 1238: fi
1.186 tollenae 1239: if test "$with_templates" = "yes" ; then
1.230 vatton 1240: echo Amaya configured with templates support
1.186 tollenae 1241: fi
1.70 kahan 1242: if test "$with_generic_xml" = "yes" ; then
1.195 vatton 1243: echo Amaya configured with generic XML support
1.70 kahan 1244: fi
1.195 vatton 1245: echo Amaya configured with internationalization support
1.75 cheyroul 1246: if test "$with_gl" = "yes" ; then
1.143 gully 1247: echo Amaya configured with OpenGL Canvas Rendering \(System library\) \(experimental\)
1248: fi
1249: if test "$with_mesa" = "yes" ; then
1.181 gully 1250: echo Amaya configured with OpenGL Canvas Rendering \(MesaLib\)
1.88 kirschpi 1251: fi
1252: if test "$with_dav" = "yes" ; then
1.181 gully 1253: echo Amaya configured with WebDAV support
1.1 cvs 1254: fi
1.5 cvs 1255: fi
1256:
1.124 gully 1257: if test "$with_wx" = "yes" ; then
1.136 gully 1258: if test "$with_wxdebug" = "yes" ; then
1.181 gully 1259: echo "Amaya configured with wxWidgets {srcdir=$WX_SRCDIR} (debug)"
1.136 gully 1260: else
1.181 gully 1261: echo "Amaya configured with wxWidgets {srcdir=$WX_SRCDIR}"
1.136 gully 1262: fi
1.1 cvs 1263: fi
1264:
1.136 gully 1265:
1.107 kahan 1266: echo ""
1.78 vatton 1267: echo "Now type \"make\" (GNU make preferably) to build the binaries"
1.107 kahan 1268: echo ""
1.120 gully 1269:
Webmaster