Annotation of Amaya/configure.in, revision 1.197

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

Webmaster