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