Annotation of Amaya/configure.in, revision 1.189

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

Webmaster