Annotation of Amaya/configure.in, revision 1.135

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: 
                     71: dnl
                     72: dnl Checks for libraries.
                     73: dnl
                     74: 
                     75: AC_CHECK_LIB(socket, socket, )
                     76: AC_CHECK_LIB(inet, connect)
                     77: AC_CHECK_LIB(nsl, t_accept)
                     78: AC_CHECK_LIB(dl, dlopen)
                     79: AC_PATH_X
                     80: AC_PATH_XTRA
                     81: 
1.41      cvs        82: dnl
                     83: dnl Check for libXp
                     84: dnl
1.38      cvs        85: 
1.41      cvs        86: for ac_dir in               \
                     87:   /usr/X11R6/lib        \
                     88:   /usr/X11R5/lib        \
                     89:                             \
                     90:   /usr/lib/X11R6        \
                     91:   /usr/lib/X11R5        \
                     92:                             \
                     93:   /usr/local/X11R6/lib  \
                     94:   /usr/local/X11R5/lib  \
                     95:                             \
                     96:   /usr/local/lib/X11R6  \
                     97:   /usr/local/lib/X11R5  \
                     98:                             \
                     99:   /usr/X11/lib          \
                    100:   /usr/lib/X11          \
                    101:   /usr/local/X11/lib    \
                    102:   /usr/local/lib/X11    \
                    103:                             \
                    104:   /usr/X386/lib         \
                    105:   /usr/x386/lib         \
                    106:   /usr/XFree86/lib/X11  \
                    107:                             \
                    108:   /usr/dt/lib           \
                    109:                             \
                    110:   /usr/lib              \
                    111:   /usr/local/lib        \
                    112:   /usr/unsupported/lib  \
                    113:   /usr/athena/lib       \
                    114:   /usr/local/x11r5/lib  \
                    115:   /usr/lpp/Xamples/lib  \
                    116:                             \
                    117:   /usr/lesstif/lib      \
                    118:   /usr/local/lesstif/lib\
                    119:   /usr/gnu/lesstif/lib  \
                    120:   $HOME/lesstif/lib     \
                    121:   ; \
                    122: do
                    123:   if test -r "$ac_dir/libXp.a" -o -r "$ac_dir/libXp.so"; then
1.131     gully     124:      echo "found libXp.a"
1.41      cvs       125:      X_PRE_LIBS="-lXp ${X_PRE_LIBS}"
                    126:      break
                    127:   fi
                    128: done
1.1       cvs       129: dnl
1.5       cvs       130: dnl Checks for header files.
                    131: dnl
                    132: 
                    133: AC_HEADER_DIRENT
                    134: AC_HEADER_STDC
                    135: AC_HEADER_SYS_WAIT
                    136: 
                    137: AC_CHECK_HEADERS(stdio.h)
                    138: AC_CHECK_HEADERS(sys/types.h types.h)
                    139: AC_CHECK_HEADERS(sys/unistd.h unistd.h)
                    140: AC_CHECK_HEADERS(sys/fcntl.h fcntl.h)
                    141: AC_CHECK_HEADERS(sys/limits.h limits.h)
                    142: AC_CHECK_HEADERS(sys/stat.h stat.h)
                    143: AC_CHECK_HEADERS(sys/file.h)
                    144: AC_CHECK_HEADERS(sys/ioctl.h)
                    145: AC_CHECK_HEADERS(sys/time.h time.h)
                    146: AC_CHECK_HEADERS(sys/systeminfo.h)
1.46      cvs       147: AC_CHECK_HEADERS(sys/string.h strings.h)
1.34      cvs       148: AC_CHECK_HEADERS(sys/syslog.h syslog.h)
1.5       cvs       149: AC_CHECK_HEADERS(sys/socket.h socket.h)
1.131     gully     150: 
                    151: # SG: not used ? => do not compile on macosx
                    152: # AC_CHECK_HEADERS(appkit/appkit.h appkit.h)
                    153: # AC_CHECK_HEADERS(apppkit/apppkit.h apppkit.h)
                    154: 
1.5       cvs       155: AC_CHECK_HEADERS(netinet/in.h in.h)
                    156: AC_CHECK_HEADERS(dn.h)
                    157: AC_CHECK_HEADERS(sys/ipc.h)
                    158: AC_CHECK_HEADERS(net/errno.h sys/errno.h errno.h)
                    159: AC_CHECK_HEADERS(pwd.h)
                    160: AC_CHECK_HEADERS(grp.h)
                    161: AC_CHECK_HEADERS(arpa/inet.h inet.h)
                    162: AC_CHECK_HEADERS(netdb.h)
                    163: AC_CHECK_HEADERS(manifest.h)
                    164: AC_CHECK_HEADERS(bsdtypes.h)
                    165: AC_CHECK_HEADERS(stdefs.h)
                    166: AC_CHECK_HEADERS(bsdtime.h)
                    167: AC_CHECK_HEADERS(sys/select.h select.h)
                    168: AC_CHECK_HEADERS(dnetdb.h)
                    169: AC_CHECK_HEADERS(libc.h)
                    170: AC_CHECK_HEADERS(stdlib.h)
                    171: AC_CHECK_HEADERS(malloc.h)
                    172: AC_CHECK_HEADERS(memory.h)
                    173: AC_CHECK_HEADERS(unixlib.h)
                    174: AC_CHECK_HEADERS(ctype.h)
                    175: AC_CHECK_HEADERS(cursesX.h curses.h)
                    176: AC_CHECK_HEADERS(sys/resource.h resource.h)
                    177: AC_HEADER_DIRENT
                    178: AC_CHECK_HEADERS(dir.h direct.h) dnl AC_HEADER_DIRENT only checks for some..
                    179: AC_HEADER_STDC
                    180: AC_HEADER_SYS_WAIT
                    181: AC_HEADER_TIME
                    182: AC_HEADER_STAT
1.103     kahan     183: AC_CHECK_HEADERS(stdint.h)
1.5       cvs       184: 
                    185: dnl
                    186: dnl Checks for typedefs, structures, and compiler characteristics.
                    187: dnl
                    188: 
                    189: AC_C_CONST
                    190: AC_C_INLINE
                    191: AC_TYPE_MODE_T
                    192: AC_TYPE_OFF_T
                    193: AC_TYPE_SIZE_T
                    194: AC_HEADER_TIME
                    195: AC_STRUCT_TM
                    196: AC_STRUCT_TIMEZONE
                    197: AC_TYPE_UID_T
                    198: 
                    199: dnl
                    200: dnl Checks for library functions.
                    201: dnl
                    202: 
                    203: AC_FUNC_ALLOCA
                    204: AC_TYPE_GETGROUPS
                    205: AC_PROG_GCC_TRADITIONAL
                    206: AC_FUNC_MEMCMP
                    207: AC_FUNC_MMAP
                    208: AC_TYPE_SIGNAL
                    209: AC_FUNC_VPRINTF
1.58      cvs       210: 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       211: 
1.132     gully     212: #
                    213: # Check for operating system (UNIX / WINDOWS / MACOSX )
                    214: # ---------->
                    215: # canonicalize the target OS : default UNIX
                    216: OS_OPTIONS="-D_UNIX"
                    217: case $target_os in
                    218:   aix*)       OS_OPTIONS="-D_UNIX" ;;
                    219:   cygwin*)    OS_OPTIONS="-D_UNIX" ;;
                    220:   darwin*)    OS_OPTIONS="-D_UNIX -D_MACOS" ;;
                    221:   freebsd2*)  OS_OPTIONS="-D_UNIX" ;;
                    222:   freebsd*)   OS_OPTIONS="-D_UNIX" ;;
                    223:   hpux*)      OS_OPTIONS="-D_UNIX" ;;
                    224:   irix*)      OS_OPTIONS="-D_UNIX" ;;
                    225:   linuxaout*) OS_OPTIONS="-D_UNIX" ;;
                    226:   linux*)     OS_OPTIONS="-D_UNIX" ;;
                    227:   mingw32*)   OS_OPTIONS="-D_UNIX" ;;
                    228:   netbsd*)    OS_OPTIONS="-D_UNIX" ;;
                    229:   openbsd*)   OS_OPTIONS="-D_UNIX" ;;
                    230:   osf[12]*)   OS_OPTIONS="-D_UNIX" ;;
                    231:   osf*)       OS_OPTIONS="-D_UNIX" ;;
                    232:   solaris2*)  OS_OPTIONS="-D_UNIX" ;;
                    233:   sunos4*)    OS_OPTIONS="-D_UNIX" ;;
                    234:   ultrix*)    OS_OPTIONS="-D_UNIX" ;;
                    235: esac
                    236: 
1.85      vatton    237: AC_ARG_WITH(GL,              [  --with-gl               enable Opengl canvas (experimental) ])
                    238: dnl
                    239: dnl GL canvas is disabled by default
                    240: dnl
                    241: dnl needs Opengl, glu, Xft (xfree 4 font server)
                    242: dnl needs GTK
                    243: dnl text WILL need freetype2, ftgl
                    244: dnl GL is for opengl
                    245: dnl Glu is for text drawing (until we switch) 
                    246: dnl GLU is for tesselation algortihms (until we extract it from this lib)
                    247: dnl (tesselation is used for polygons with holes in it...)
                    248: dnl gtkgl is for integration of opengl in GTK
                    249: if test "$with_gl" = "" ; then
                    250:  if test "$enable_gl" = "yes" ; then
                    251:     with_gl="yes"
                    252:   else
                    253:     with_gl="no"
                    254:   fi
                    255: fi  
                    256: 
1.120     gully     257: # check if gtk gui should be used
                    258: AC_ARG_WITH(gtk, [  --with-gtk              use GTK GUI toolkit ])
                    259: if test "$with_gtk" = "yes" -o "$enable_gtk" = "yes" ; then
                    260:   if test "$withval" = "no" ; then
                    261:     with_gtk="no"
                    262:   else
                    263:     with_gtk="yes"
                    264:   fi
                    265: fi
                    266: 
1.124     gully     267: # check if wxWindows gui should be used
                    268: AC_ARG_WITH(wx, [  --with-wx               use wxWindows GUI toolkit (experimental)])
                    269: if test "$with_wx" = "yes" -o "$enable_wx" = "yes" ; then
                    270:   if test "$withval" = "no" ; then
                    271:     with_wx="no"
                    272:   else
                    273:     with_wx="yes"
1.134     gully     274:     # force opengl with wxWidgets
                    275:     with_gl="yes"
1.124     gully     276:   fi
                    277: fi
                    278: 
1.134     gully     279: # Check if iat least one GUI toolkit is enabled
                    280: if test "$with_wx" = "no" -o "$with_wx" = "" ; then
                    281:   if test "$with_gtk" = "no" -o "$with_gtk" = "" ; then
                    282:     # Nothing is enable so force the default GUI toolkit (GTK)
                    283:     with_wx="no"
                    284:     with_gtk="yes"
1.85      vatton    285:   fi
                    286: fi
                    287: 
1.121     gully     288: # check if no gui is enable
                    289: AC_ARG_WITH(nogui, [  --with-nogui            do not use GUI toolkit ])
                    290: if test "$with_nogui" = "yes" -o "$enable_nogui" = "yes" ; then
                    291:   with_nogui="yes"
                    292:   with_gtk="no"
1.134     gully     293:   with_wx="no"
1.121     gully     294:   NOGUI_OPTIONS="-D_NOGUI"
                    295: fi
                    296: 
1.134     gully     297: if test "$with_wx" = "yes" ; then
1.120     gully     298:   if test "$with_gtk" = "yes" ; then
                    299:     echo 
                    300:     echo "****************************************************************"
                    301:     echo " ERROR: "
                    302:     echo " More than one GUI toolkit is enable"
                    303:     echo " Only one GUI toolkit should be enable (turn off one)"
                    304:     echo " exemple ok :  ../configure --with-gtk "
1.134     gully     305:     echo " exemple !ok : ../configure --with-gtk --with-wx"
1.120     gully     306:     echo "****************************************************************"
                    307:     echo 
                    308:     exit 1
                    309:   fi
                    310: fi
1.134     gully     311: 
1.85      vatton    312: if test "$with_gtk" = "yes" ; then
1.131     gully     313:   # SG : lookingfor gtkimlib includes
                    314:   #      because not found with gtk-config on macosx 
1.134     gully     315:   gdkimlib_h_found="no"
1.63      vatton    316:   for ac_dir in               \
1.131     gully     317:     /sw/include/              \
                    318:     /sw/local/include         \
                    319:     /usr/include              \
1.63      vatton    320:     /usr/local/include        \
                    321:     ; \
                    322:   do
1.131     gully     323:     if test -r "$ac_dir/gdk_imlib.h"; then
                    324:       echo "found gdk_imlib.h"
1.134     gully     325:       gdkimlib_h_found="yes"
1.131     gully     326:       GTK_INCLUDES="${GTK_INCLUDES} -I$ac_dir"
1.63      vatton    327:       break
                    328:     fi
                    329:   done
                    330: 
1.134     gully     331:   # check that gtk-config exists
                    332:   AC_CHECK_PROG(GTKCONFIG_FOUND,gtk-config,yes,no)
                    333:   if test "$GTKCONFIG_FOUND" = no ; then
                    334:     AC_MSG_ERROR(Cannot find gtk-config. Please install gtk development library.)
                    335:   fi
                    336:                    
1.131     gully     337:   GTK_INCLUDES="${GTK_INCLUDES} `gtk-config --cflags`"
1.124     gully     338:   AC_SUBST(GTK_INCLUDES)
                    339:   GTK_LIBRARIES="`gtk-config --libs`"
1.134     gully     340:   # GL doesn't need the imlib
1.124     gully     341:   if test "${with_gl}" != "yes" ; then
1.134     gully     342:     GTK_LIBRARIES="${GTK_LIBRARIES} -lgdk_imlib"
                    343:   else
                    344:     gdkimlib_h_found="yes"
1.124     gully     345:   fi
1.106     kahan     346: 
1.124     gully     347:   AC_SUBST(GTK_LIBRARIES)
                    348:   GTK_OPTIONS="-D_GTK"
1.76      vatton    349:   no_graphic=yes
1.134     gully     350: 
                    351:   if test "$gdkimlib_h_found" = "no" ; then
                    352:     echo
                    353:     echo "****************************************************************"
                    354:     echo " ERROR: gdk_imlib.h not found -"
                    355:     echo " [please install imlib developpement package (libimlib1-devel on mandrake)]"
                    356:     echo "****************************************************************"
                    357:     exit 1
                    358:   fi                                                                                         
1.120     gully     359: fi
                    360: 
1.124     gully     361: if test "$with_wx" = "yes" ; then
1.135   ! gully     362:   
        !           363:   # check that sources of wxWidgets exists
        !           364:   if test ! -f ../../wxWidgets/Makefile.in ; then
        !           365:     AC_MSG_ERROR(wxWidgets library sources not found. Please download wxWidgets sources (http://www.wxwidgets.org/) or remove --with-wx option !)
        !           366:   fi
        !           367: 
        !           368:   # --------- compile wxWidgets library --------------- #
        !           369:   echo "---> Configuring wxWidgets library."
        !           370:   OLDDIR=`pwd`
        !           371:   cd ../../wxWidgets/
        !           372:   mkdir AMAYABUILD
        !           373:   cd AMAYABUILD
        !           374:   # remove old configure options
        !           375:   rm -f configarg.cache
        !           376:   # launch the configure
        !           377:   if test "$OS_OPTIONS" = "-D_UNIX" ; then
        !           378:     # LINUX
        !           379:     ../configure --with-opengl --with-gtk --enable-gtk2 --enable-unicode --enable-debug  
        !           380:   fi
        !           381:   if test "$OS_OPTIONS" = "-D_UNIX -D_MACOS" ; then
        !           382:     # MACOSX
        !           383:     AC_MSG_ERROR(TODO: configurer wxWidgets pour MACOSX)
        !           384:     # ../configure --with-opengl --with-gtk --enable-gtk2 --enable-unicode --enable-debug
        !           385:   fi
        !           386:   echo "---> Configuring wxWidgets library. - DONE"
        !           387:   echo "---> Compiling wxWidgets library."
        !           388:   # compile the lib
        !           389:   make
        !           390:   echo "---> Compiling wxWidgets contrib xrc library."
        !           391:   cd contrib/src/xrc
        !           392:   # compile xrc lib (xml resource lib)
        !           393:   make
        !           394:   cd $OLDDIR
        !           395:   echo "---> Compiling wxWidgets library. - DONE"
        !           396:   # --------- compile wxWidgets library - DONE --------------- #
        !           397: 
        !           398:   # --------- configuring wxWidgets paths --------------- #
        !           399:   WXCONFIG=../../wxWidgets/AMAYABUILD/wx-config
        !           400:   # loop for absolute wxWidgets path : necessary to compile thotlib and amaya because they are in subdirectory
        !           401:   cd ../../wxWidgets/ && WXROOTDIR=`pwd` && WXCONFIG_ARGS="--prefix=$WXROOTDIR --exec-prefix=$WXROOTDIR/AMAYABUILD" && cd -
1.134     gully     402:   # check that wx-config exists
1.135   ! gully     403:   if test ! -f $WXCONFIG ; then
        !           404:     AC_MSG_ERROR(Cannot find wx-config. Please install wxWidgets (http://www.wxwidgets.org/))
1.134     gully     405:   fi
                    406:   
1.135   ! gully     407:   WX_INCLUDES="`$WXCONFIG $WXCONFIG_ARGS --cxxflags`"
1.124     gully     408:   AC_SUBST(WX_INCLUDES)
                    409: 
1.135   ! gully     410:   WX_LIBRARIES="-Wl,-rpath,$WXROOTDIR `$WXCONFIG $WXCONFIG_ARGS --libs`"
1.126     gully     411: 
1.132     gully     412:   # GL is used ?
1.126     gully     413:   if test "${with_gl}" = "yes" ; then
1.135   ! gully     414:     WX_LIBRARIES="${WX_LIBRARIES} `$WXCONFIG $WXCONFIG_ARGS --gl-libs`"
1.132     gully     415: 
                    416:     # SG: this is a mistery why wx-config doesn't add these needed option on macosx
                    417:     if test "$OS_OPTIONS" = "-D_UNIX -D_MACOS" ; then
                    418:       WX_LIBRARIES="${WX_LIBRARIES} -framework OpenGL -framework AGL"
                    419:     fi
1.124     gully     420:   fi
                    421: 
1.132     gully     422:   # xrc ressources are used
1.135   ! gully     423:   WX_LIBRARIES="${WX_LIBRARIES} -l`$WXCONFIG $WXCONFIG_ARGS --basename`_xrc-`wx-config --release`"
1.130     gully     424:   
1.124     gully     425:   AC_SUBST(WX_LIBRARIES)
                    426:   WX_OPTIONS="-D_WX"
1.135   ! gully     427:   # --------- configuring wxWidgets paths - DONE --------------- #
1.132     gully     428: 
                    429:   no_graphic=yes
1.124     gully     430: fi
                    431: 
1.63      vatton    432: if test "${GCC}" = "yes"; then
                    433:    CPP="${CPP} -x c"
                    434: fi
                    435: 
1.1       cvs       436: dnl  ***************************************************************
                    437: dnl
1.61      cvs       438: dnl    SPECIFIC STUFF : CONFIGURATION OPTIONS FOR AMAYA
1.1       cvs       439: dnl
                    440: dnl  ***************************************************************
                    441: 
1.101     kahan     442: # We don't use our graphic libraries for the pure GTK version (without GL)
                    443: 
1.132     gully     444: # if configure has option --with-graphiclibs then dont check for system graphic libs
                    445: # force amaya static graphic libs to be used
                    446: AC_ARG_WITH(graphiclibs, [  --with-graphiclibs     use static libjpeg, libpng.])
                    447: if test "$with_graphiclibs" = "yes" -o "enable_graphiclibs" = "yes" ; then
                    448:   no_graphic="no"
                    449: else
                    450:   no_graphic="yes"
1.76      vatton    451: fi
1.132     gully     452:                  
1.76      vatton    453: if test "$no_graphic" = yes; then
                    454: dnl
                    455:     AC_MSG_CHECKING([for libjpeg version = 6b])
                    456:     AC_EGREP_CPP([x 62 *x],
                    457:         [#include <jpeglib.h>
                    458:          x JPEG_LIB_VERSION x],
                    459: dnl
                    460:         AC_MSG_RESULT([yes])
1.105     vatton    461:        JPEGINCL=''
1.76      vatton    462:         LIBJPEG='-ljpeg'
                    463:         MAKEJPEG=['#'],
                    464: dnl
                    465:         AC_MSG_RESULT([no])
1.105     vatton    466:        JPEGINCL='-I$(THOTDIR)/libjpeg'
1.76      vatton    467:         LIBJPEG='../libjpeg.a'      dnl LIBJPEG goes into amaya/Makefile.in
                    468:         )
                    469: dnl    
                    470: dnl
1.95      vatton    471:     AC_MSG_CHECKING([for libpng version = 1.0.x or 1.2.x])
                    472:     AC_EGREP_CPP([x \"1.[02]\..*\" *x],
1.76      vatton    473:         [#include <png.h>
                    474:        x PNG_LIBPNG_VER_STRING x],
                    475: dnl
                    476:         AC_MSG_RESULT([yes])
1.105     vatton    477:        PNGINCL=''
1.76      vatton    478:         LIBPNG='-lpng'
                    479:         LIBZ=''
                    480:        MAKEPNG=['#'],
                    481: dnl
                    482:         AC_MSG_RESULT([no])
1.105     vatton    483:        PNGINCL='-I$(THOTDIR)/libpng -I$(THOTDIR)/libpng/zlib'
1.76      vatton    484:         LIBPNG='../libpng.a'
                    485:         LIBZ='../libz.a'
                    486:         )
                    487: else
1.105     vatton    488:     JPEGINCL='-I$(THOTDIR)/libjpeg'
1.76      vatton    489:     LIBJPEG='../libjpeg.a'
1.105     vatton    490:     PNGINCL='-I$(THOTDIR)/libpng -I$(THOTDIR)/libpng/zlib'
1.76      vatton    491:     LIBPNG='../libpng.a'
                    492:     LIBZ='../libz.a'
                    493: fi
                    494: dnl
                    495: AC_SUBST(LIBJPEG)
                    496: AC_SUBST(LIBPNG)
                    497: AC_SUBST(LIBZ)
                    498: AC_SUBST(MAKEJPEG)
                    499: AC_SUBST(MAKEPNG)
                    500: 
1.119     vatton    501: AMAYA_VER="8.2"
1.1       cvs       502: 
                    503: dnl
1.6       cvs       504: dnl We use a special versoin of cextract patched for alignment
                    505: dnl to build the signatures of the modules functions located in f subdirs
                    506: dnl
                    507: CEXTRACT_VER="1.7"
                    508: CEXTRACT_FLAGS="+O"
                    509: 
1.3       cvs       510: 
                    511: dnl
1.9       cvs       512: dnl Adjust the some variables depending on the host and compiler
1.61      cvs       513: dnl Thotlib NEED signed chars !!!
1.7       cvs       514: dnl
                    515: 
                    516: if test "${CC}" = "gcc" ; then
1.44      cvs       517:   CFLAGS="${CFLAGS} -W "
1.7       cvs       518:   case "${host}" in
                    519:       *-*-irix5* | *-*irix6* )
                    520:          CFLAGS="${CFLAGS} -fsigned-char"
                    521:       ;;
                    522:   esac
1.14      cvs       523: fi
                    524: 
                    525: if test "$ac_cv_c_const" = "no" ; then
                    526:   CFLAGS="${CFLAGS} -DCONST= "
1.7       cvs       527: fi
                    528: 
1.122     gully     529: 
                    530: # force C mode (-x c)
1.123     gully     531: CFLAGS="${CFLAGS} -x c"
1.122     gully     532: 
                    533: # C++ options (-x c++)
                    534: CXX_OPTIONS="-D__cplusplus"
1.123     gully     535: CXXFLAGS="${CXXFLAGS} -W -x c++ ${CXX_OPTIONS}"
1.122     gully     536: 
1.132     gully     537: # setup LDFLAGS
                    538: # on macosx, specific flags must be set to avoid conflicts with allready installed libwww
                    539: # for exemple it's possible to install libwww with fink (fink install libwww)
                    540: # to avoid conflicts, we just force the linker to search for specified amaya path first
1.133     gully     541: if test "$OS_OPTIONS" = "-D_UNIX -D_MACOS" ; then
1.132     gully     542:   LDFLAGS="-Wl,-search_paths_first"
                    543: else
                    544:   LDFLAGS=""
                    545: fi
1.128     gully     546: 
                    547: dnl
1.61      cvs       548: dnl Check for availability of amaya sources
1.1       cvs       549: dnl
                    550: 
                    551: build_amaya="yes"
                    552: 
                    553: if test "$with_amaya" = "no" ; then
                    554:     build_amaya="no"
1.45      cvs       555: else
                    556:   if test ! -f $srcdir/amaya/Makefile.in ; then
1.1       cvs       557:     AC_MSG_WARN(Amaya browser/editor sources not found, disabling Amaya build !)
                    558:     build_amaya="no"
1.45      cvs       559:   fi
1.1       cvs       560: fi
                    561: 
                    562: dnl
1.50      cvs       563: dnl Check for additionnal packages
1.1       cvs       564: dnl use AC_CONFIG_SUBDIRS to launch configure in the subdir
                    565: dnl
1.93      kahan     566: 
1.75      cheyroul  567: if test "$with_gl" = "yes" ; then
                    568:        AC_MSG_CHECKING([OpenGL])
                    569:        for ac_dir in                           \
                    570:                /usr/include                    \
                    571:                /usr/X11R6/include              \
                    572:                /usr/local/include              \
                    573:                ; \
1.80      cheyroul  574:        do  if test -r "$ac_dir/GL/gl.h" ; then
1.75      cheyroul  575:                 gl_inc="yes"
1.80      cheyroul  576:                GL_INC_I="$ac_dir"
                    577:                if test "$ac_dir" != "/usr/include" ; then
                    578:                   GL_INCLUDES="-I$ac_dir"
                    579:                fi
1.96      cheyroul  580:                AC_MSG_RESULT([yes])
1.75      cheyroul  581:                        break   
                    582:            fi
1.80      cheyroul  583:        done    
                    584:        AC_MSG_CHECKING([GLU])  
1.75      cheyroul  585:        for ac_dir in                           \
                    586:                /usr/include/GL                 \
                    587:                /usr/include                    \
                    588:                /usr/X11R6/include/GL           \
                    589:                /usr/X11R6/include              \
                    590:                /usr/local/include              \
                    591:                /usr/local/include/GL           \
                    592:                ; \
                    593:        do  if test -r "$ac_dir/glu.h" ; then
                    594:                 glu_inc="yes"
1.80      cheyroul  595:                GL_INC_II="$ac_dir"
                    596:                if test "$ac_dir" != "/usr/include" ; then
                    597:                        if test "$ac_dir" != "$GL_INC_I" ; then
                    598:                            GL_INCLUDES="$GL_INCLUDES -I$ac_dir"
                    599:                        fi
                    600:                fi
1.96      cheyroul  601:                AC_MSG_RESULT([yes])
1.75      cheyroul  602:                        break   
                    603:            fi
1.132     gully     604:        done
                    605: 
                    606:        # check for gtkglarea.h only if gtk gui is selected
                    607:        if test "$with_gtk" = "yes" ; then
                    608:          AC_MSG_CHECKING([GTKGLAREA])  
                    609:          for ac_dir in                         \
                    610:                /usr/include/GL                 \
1.75      cheyroul  611:                /usr/include                    \
                    612:                /usr/X11R6/include/GL           \
                    613:                /usr/X11R6/include              \
                    614:                /usr/local/include              \
                    615:                /usr/local/include/GL           \
                    616:                ; \
1.132     gully     617:          do  if test -r "$ac_dir/gtkgl/gtkglarea.h" ; then
                    618:                   gtkgl_inc="yes"
                    619:                  if test "$ac_dir" != "/usr/include" ; then
                    620:                          if test "$ac_dir" != "$GL_INC_II" ; then
                    621:                                  if test "$ac_dir" != "$GL_INC_I" ; then
                    622:                                          GL_INCLUDES="$GL_INCLUDES -I$ac_dir"
                    623:                                  fi
                    624:                          fi
                    625:                  fi
                    626:                  AC_MSG_RESULT([yes])
                    627:                          break 
                    628:              fi
                    629:          done
                    630:          GTKGL_LIBS="-lgtkgl"
                    631:        else
                    632:          gtkgl_inc="ignore"
                    633:          GTKGL_LIBS=""
                    634:        fi
                    635: 
1.80      cheyroul  636:        AC_MSG_CHECKING([freetype])     
                    637:        for ac_dir in                           \
                    638:                /usr/include                    \
                    639:                /usr/X11R6/include              \
                    640:                /usr/local/include              \
1.132     gully     641:                /opt/local/include              \
                    642:                /usr/X11R6/include/freetype2    \
1.80      cheyroul  643:                ; \
                    644:        do  if test -r "$ac_dir/ft2build.h" ; then
                    645:                 freetype_inc="yes"
                    646:                GL_INCLUDES="$GL_INCLUDES `freetype-config --cflags`"
1.96      cheyroul  647:                        AC_MSG_RESULT([yes])    
                    648:                break   
                    649:            fi
                    650:        done    
1.104     cheyroul  651:         AC_MSG_CHECKING([Xft]) 
                    652:        for ac_dir in                           \
                    653:                /usr/include                    \
                    654:                /usr/X11R6/include              \
                    655:                /usr/local/include              \
                    656:                /usr/include/X11/Xft            \
                    657:                /usr/X11R6/include/X11/Xft      \
                    658:                /usr/local/include/X11/Xft      \
                    659:                /usr/include/X11/Xft1           \
                    660:                /usr/X11R6/include/X11/Xft1     \
1.113     vatton    661:                /usr/include/Xft2/X11/Xft/      \
1.104     cheyroul  662:                /usr/local/include/X11/Xft1     \
                    663:                /usr/include/X11/Xft2           \
                    664:                /usr/X11R6/include/X11/Xft2     \
                    665:                /usr/local/include/X11/Xft2     \
                    666:                ; \
                    667:        do  if test -r "$ac_dir/Xft.h" ; then
                    668:                 xft_inc="yes"
                    669:                GL_INCLUDES="$GL_INCLUDES -I$ac_dir"
                    670:                        AC_MSG_RESULT([yes])    
                    671:                break   
                    672:            fi
                    673:        done    
1.96      cheyroul  674:        AC_MSG_CHECKING([gcc3]) 
                    675:        for ac_dir in                           \
                    676:                /usr/lib                        \
                    677:                /usr/X11R6/lib          \
                    678:                /usr/local/lib          \
                    679:                ; \
                    680:        do  if test -r "$ac_dir/libstdc++.so.5" ; then
                    681:                 stdglu_inc="yes"
                    682:                        AC_MSG_RESULT([yes])    
                    683:                break
1.80      cheyroul  684:            fi
1.96      cheyroul  685:        done
                    686:        if test "$gl_inc" = "" ; then           
1.75      cheyroul  687:                AC_MSG_WARN(Opengl headers (gl.h) not found !!)
                    688:                AC_MSG_WARN(Disabling opengl build !)
                    689:                with_gl="no"
                    690:                GL_OPTIONS=     
                    691:                GL_INCLUDES=    
                    692:                GL_LIBRARIES=
1.81      cheyroul  693:                exit 1;
1.75      cheyroul  694:        fi
                    695:        if test "$glu_inc" = "" ; then
                    696:                AC_MSG_WARN(Glu headers (glu.h) not found !!)
                    697:                AC_MSG_WARN(Disabling opengl build !)
1.81      cheyroul  698:        
1.75      cheyroul  699:                with_gl="no"
                    700:                GL_OPTIONS=     
                    701:                GL_INCLUDES=    
                    702:                GL_LIBRARIES=
1.81      cheyroul  703:                exit 1;
1.75      cheyroul  704:        fi
1.132     gully     705: 
1.75      cheyroul  706:        if test "$gtkgl_inc" = "" ; then
                    707:                AC_MSG_WARN(Gtkglarea headers (gktglarea.h) not found !!)
                    708:                AC_MSG_WARN(Disabling opengl build !)
                    709:                with_gl="no"
                    710:                GL_OPTIONS=     
                    711:                GL_INCLUDES=    
                    712:                GL_LIBRARIES=
1.81      cheyroul  713:                exit 1;
1.75      cheyroul  714:        fi
1.132     gully     715: 
1.80      cheyroul  716:        if test "$freetype_inc" = "" ; then
                    717:                AC_MSG_WARN(Freetype 2 headers (ft2build.h) not found !!)
                    718:                AC_MSG_WARN(Disabling opengl build !)
                    719:                with_gl="no"
                    720:                GL_OPTIONS=     
                    721:                GL_INCLUDES=
                    722:                GL_LIBRARIES=
1.81      cheyroul  723:                exit 1;
1.80      cheyroul  724:        fi
1.104     cheyroul  725:        if test "$xft_inc" = "" ; then
                    726:                AC_MSG_WARN(Xft 2 headers (Xft.h) not found !!)
                    727:                AC_MSG_WARN(Disabling opengl build !)
                    728:                with_gl="no"
                    729:                GL_OPTIONS=     
                    730:                GL_INCLUDES=
                    731:                GL_LIBRARIES=
                    732:                exit 1;
                    733:        fi
1.75      cheyroul  734:        if test "$gl_inc" = "yes" ; then
1.79      cheyroul  735:                if test "$glu_inc" = "yes" ; then
1.132     gully     736:                        if test "$gtkgl_inc" = "yes" -o "$gtkgl_inc" = "ignore" ; then
1.96      cheyroul  737:                            if test "$freetype_inc" = "yes" ; then
1.104     cheyroul  738:                                if test "$xft_inc" = "yes" ; then
                    739:                                        if test "$stdglu_inc" = "yes" ; then
1.132     gully     740:                                           GL_LIBRARIES="-L/usr/lib -L/usr/X11R6/lib  -lXmu -lXft -lfreetype -lGL -lGLU ${GTKGL_LIBS} -lstdc++"
1.104     cheyroul  741:                                        else
1.132     gully     742:                                           GL_LIBRARIES="-L/usr/lib -L/usr/X11R6/lib  -lXmu -lXft -lfreetype -lGL -lGLU ${GTKGL_LIBS}"
1.104     cheyroul  743:                                        fi                              
                    744:                                        GL_OPTIONS="-D_GL"
                    745:                                fi
1.80      cheyroul  746:                            fi
1.75      cheyroul  747:                        fi
                    748:                fi
                    749:        fi
                    750: AC_SUBST(GL_INCLUDES)
                    751: AC_SUBST(GL_LIBRARIES)
1.115     cheyroul  752: dnl PRINTIFNOTGL=" "
                    753: dnl #NOPRINT="#"
                    754: NOPRINT=""
                    755: PRINTIFNOTGL=" print_prog"
1.97      cheyroul  756: else
1.112     cheyroul  757: NOPRINT=""
1.97      cheyroul  758: PRINTIFNOTGL=" print_prog"
1.75      cheyroul  759: fi
1.97      cheyroul  760: AC_SUBST(PRINTIFNOTGL)
1.112     cheyroul  761: AC_SUBST(NOPRINT)
                    762: 
1.76      vatton    763: 
                    764: AC_ARG_ENABLE(svg,           [  --disable-svg           remove SVG support ])
                    765: AC_ARG_ENABLE(annot,         [  --disable-annot         remove Annotations support ])
1.93      kahan     766: AC_ARG_ENABLE(raptor,        [  --disable-raptor        disable the raptor RDF parser ])
1.116     kahan     767: AC_ARG_ENABLE(redland,       [  --enable-redland        enable the redland RDF library ])
                    768: AC_ARG_ENABLE(system-redland,       [  --enable-system-redland try the redland RDF system library ])
1.108     kahan     769: AC_ARG_ENABLE(bookmarks,     [  --enable-bookmarks      enables experimental bookmark support ])
1.76      vatton    770: AC_ARG_ENABLE(generic-xml,   [  --disable-generic-xml   remove Generic XML support ])
                    771: 
1.75      cheyroul  772: dnl
1.21      cvs       773: dnl plugins support is disabled by default
1.8       cvs       774: dnl
1.13      cvs       775: 
                    776: if test "$with_plugin" = "" ; then
1.21      cvs       777:   if test "$enable_plugin" = "yes" ; then
1.55      kahan     778:     with_plugin="yes"
1.21      cvs       779:   else
1.17      cvs       780:     with_plugin="no"
                    781:   fi
1.10      cvs       782: fi  
1.1       cvs       783: 
1.8       cvs       784: dnl
1.68      vatton    785: dnl svg is enabled by default
1.26      cvs       786: dnl
1.68      vatton    787: if test "$with_svg" = "" ; then
                    788:     if test "$enable_svg" = "no" ; then
                    789:        with_svg="no"
1.49      cvs       790:     else
1.68      vatton    791:        with_svg="yes"
1.26      cvs       792:     fi
                    793: fi
                    794: 
                    795: dnl
1.56      kahan     796: dnl annotations is enabled by default
1.47      cvs       797: dnl
                    798: if test "$with_annot" = "" ; then
1.56      kahan     799:     if test "$enable_annot" = "no" ; then
                    800:        with_annot="no"
                    801:     else
1.54      cvs       802:        with_annot="yes"
1.47      cvs       803:     fi
1.99      kahan     804: else
                    805:     with_annot="yes"
1.47      cvs       806: fi
                    807: 
1.93      kahan     808: 
                    809: dnl
                    810: dnl The raptor RDF parser is enabled by default
                    811: dnl
                    812: if test "$with_raptor" = "" ; then
                    813:     if test "$enable_raptor" = "no" ; then
                    814:        with_raptor="no"
                    815:     else
1.99      kahan     816:        with_raptor="yes"
1.93      kahan     817:     fi
1.99      kahan     818: else
                    819:     with_raptor="yes"
1.93      kahan     820: fi
                    821: 
1.70      kahan     822: dnl
1.116     kahan     823: dnl The redland library is disabled by default
1.109     kahan     824: dnl
                    825: if test "$with_redland" = "" ; then
                    826:     if test "$enable_redland" = "yes" ; then
                    827:        with_redland="yes"
                    828:     else
                    829:        with_redland="no"
                    830:     fi
                    831: else
                    832:     with_redland="no"
                    833: fi
                    834: 
                    835: dnl
1.116     kahan     836: dnl The redland library is disabled by default
                    837: dnl
                    838: if test "$with_system_redland" = "" ; then
                    839:     if test "$enable_system_redland" = "yes" ; then
                    840:        with_redland="yes"
                    841:        with_system_redland="yes"
                    842:     else
                    843:        with_system_redland="no"
                    844:     fi
                    845: else
                    846:     with_system_redland="no"
                    847: fi
                    848: 
                    849: dnl
                    850: dnl The bookmarks support is disabled by default
1.108     kahan     851: dnl
                    852: if test "$with_bookmarks" = "" ; then
                    853:     if test "$enable_bookmarks" = "yes" ; then
                    854:        with_bookmarks="yes"
1.125     vatton    855:        with_redland="yes"
1.108     kahan     856:     else
                    857:        with_bookmarks="no"
                    858:     fi
                    859: else
                    860:     with_bookmarks="no"
                    861: fi
                    862: 
                    863: dnl
1.70      kahan     864: dnl Generic XML support enabled by default
                    865: dnl
                    866: if test "$with_generic_xml" = "" ; then
                    867:     if test "$enable_generic_xml" = "no" ; then
                    868:        with_generic_xml="no"
                    869:        GENERIC_XML_OPTIONS=
                    870:     else
                    871:        with_generic_xml="yes"
                    872:        GENERIC_XML_OPTIONS=-DXML_GENERIC
                    873:     fi
                    874: fi
                    875: 
1.120     gully     876: AC_ARG_WITH(dav,            [  --with-dav              enable WebDAV support (experimental) ])
1.88      kirschpi  877: dnl
                    878: dnl DAV support disabled by default
                    879: dnl
                    880: if test "$with_dav" = "" ; then
                    881:   if test "$enable_dav" = "yes" ; then
                    882:     with_dav="yes"
                    883:   else
                    884:     with_dav="no"
                    885:   fi
                    886: fi  
                    887: 
                    888: if test "$with_dav" = "yes" ; then
                    889:    DAV_OPTIONS=-DDAV
1.90      kirschpi  890:    DAVDIR="davlib"
                    891:    LIBDAV="libwwwdav"
                    892:    WITHDAV="--with-dav" 
                    893:    WWWDAV="-lwwwdav" 
1.88      kirschpi  894: else
                    895:    with_dav="no"
                    896:    DAV_OPTIONS=""
1.90      kirschpi  897:    DAVDIR=""
                    898:    LIBDAV=""
                    899:    WITHDAV="" 
                    900:    WWWDAV="" 
1.88      kirschpi  901: fi
                    902: 
1.70      kahan     903: 
1.19      cvs       904: if test "$build_amaya" = "yes" ; then
1.43      cvs       905:     if test ! -f $srcdir/../libwww/Makefile.in ; then
1.50      cvs       906:        AC_MSG_WARN(libwww sources not found !!)
                    907:        AC_MSG_WARN(Disabling Amaya build !)
                    908:        build_amaya="no"
1.1       cvs       909:     fi
1.8       cvs       910: 
                    911:     if test ! -f $srcdir/amaya/MathML.S ; then
1.10      cvs       912:        if test "$with_math" = "yes" ; then
1.8       cvs       913:            AC_MSG_WARN(MathML sources not found !!)
1.26      cvs       914:            AC_MSG_WARN(Disabling Math build !)
1.10      cvs       915:            with_math="no"
                    916:            MATH_OPTIONS=
1.8       cvs       917:        fi
                    918:     fi
1.26      cvs       919: 
1.68      vatton    920:     if test ! -f $srcdir/amaya/SVG.S ; then
                    921:        if test "$with_svg" = "yes" ; then
                    922:            AC_MSG_WARN(SVG sources not found !!)
                    923:            AC_MSG_WARN(Disabling SVG build !)
                    924:            with_svg="no"
                    925:            SVG_OPTIONS=
1.26      cvs       926:        fi
                    927:     fi
                    928: 
1.48      cvs       929:     if test ! -f $srcdir/annotlib/Makefile.in ; then
1.47      cvs       930:        if test "$with_annot" = "yes" ; then
                    931:            AC_MSG_WARN(Annotation makefile not found !!)
                    932:            AC_MSG_WARN(Disabling Annotations build !)
                    933:            with_annot="no"
                    934:        fi
                    935:     fi
1.55      kahan     936: 
1.109     kahan     937:     if test "$with_raptor" = "yes" -a "$with_redland" = "yes" ; then
                    938:        AC_MSG_WARN(Disabling raptor build as redland is enabled !)
                    939:        MAKERAPTOR=['#']
                    940:        with_raptor="no"
                    941:     fi
                    942: 
1.108     kahan     943:     if test "$with_raptor" = "yes" -a "$with_annot" = "no" ; then
1.93      kahan     944:        AC_MSG_WARN(Disabling raptor build as annotations are disabled !)
                    945:        MAKERAPTOR=['#']
                    946:        with_raptor="no"
                    947:     fi
                    948: 
1.108     kahan     949:     if test "$with_raptor" = "yes" -a ! -d "$srcdir/libraptor" ; then
                    950:        AC_MSG_WARN(Raptor source dir not found !!)
                    951:        AC_MSG_WARN(Disabling raptor build !)
                    952:        MAKERAPTOR=['#']
                    953:        with_raptor="no"
1.109     kahan     954:     fi
                    955: 
                    956:     if test "$with_raptor" = "yes" ; then
1.108     kahan     957:        AMAYA_ANNOT_OPTIONS="$AMAYA_ANNOT_OPTIONS -DRAPTOR_RDF_PARSER -I\$(THOTDIR)/libraptor"
                    958:        AMAYA_RAPTOR_LIBS="../libraptor/.libs/libraptor.a"
                    959:        AMAYA_RAPTOR_SRC="amaya_comp_libraptor"
                    960:        AMAYA_RAPTOR_INCLUDES="-I\$(THOTDIR)/libraptor"
                    961:     fi
                    962: 
1.109     kahan     963:     if test "$with_redland" = "yes" -a "$with_annot" = "no" ; then
                    964:        AC_MSG_WARN(Disabling redland build as annotations are disabled !)
                    965:        MAKEREDLAND=['#']
                    966:        with_redland="no"
                    967:     fi
                    968: 
1.116     kahan     969:     redland_compile_source=yes
                    970:     if test "$with_redland" = "yes" -a "$with_system_redland" = "yes" ; then
                    971:        # check to see if we have a redland library
                    972:        AC_MSG_CHECKING(system redland library)
1.118     kahan     973:        redland_min_version=0.9.14
1.116     kahan     974:        REDLAND_CONFIG="redland-config"
                    975:        REDLAND_VERSION=`$REDLAND_CONFIG --version`
                    976:        redland_version_dec=`echo $REDLAND_VERSION | awk -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'`
                    977:        redland_min_version_dec=`echo $redland_min_version | awk -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'`
                    978:        if test $redland_version_dec -lt $redland_min_version_dec; then
                    979:          AC_MSG_RESULT(no - found version $REDLAND_VERSION and minimal version is $redland_min_version)
                    980:        else
                    981:          AC_MSG_RESULT(yes - found version $REDLAND_VERSION)
                    982:         AC_MSG_CHECKING(checking for redland headers)
1.117     kahan     983:         dnl  We should use awk here and remove the -I from the following line
                    984:          dnl REDLAND_HEADERS=`$REDLAND_CONFIG --cflags`
                    985:         REDLAND_HEADERS=""
                    986:         if test -e "/usr/include/redland.h" ; then
                    987:           REDLAND_HEADERS="/usr/include";
                    988:         else 
                    989:            if test -e "/usr/local/include/redland.h" ; then
                    990:             REDLAND_HEADERS="/usr/local/include";
                    991:            fi
                    992:          fi        
                    993:         if test $REDLAND_HEADERS != ""; then
1.116     kahan     994:            AC_MSG_RESULT(yes - have development version)
                    995:            redland_compile_source=no
                    996:         else
                    997:            AC_MSG_RESULT(no - no development version)
                    998:          fi
                    999:        fi
                   1000:     fi
                   1001: 
                   1002:     if test "$with_redland" = "yes" -a "$redland_compile_source" = "yes" \
                   1003:        -a ! -d "$srcdir/../redland" ; then
1.109     kahan    1004:        AC_MSG_WARN(Redland source dir not found !!)
                   1005:        AC_MSG_WARN(Disabling redland build !)
                   1006:        MAKEREDLAND=['#']
                   1007:        with_redland="no"
                   1008:     fi
                   1009: 
                   1010:     if test "$with_redland" = "yes" ; then
1.116     kahan    1011:        AMAYA_ANNOT_OPTIONS="$AMAYA_ANNOT_OPTIONS -DLIBRDF_INTERNAL=1 -DAM_REDLAND -DRAPTOR_RDF_PARSER"
                   1012:        if test "$redland_compile_source" = "yes" ; then
                   1013:          AMAYA_RAPTOR_SRC="amaya_comp_redland"
                   1014:          AMAYA_ANNOT_OPTIONS="$AMAYA_ANNOT_OPTIONS -I\$(THOTDIR)/../redland/librdf -I\$(THOTDIR)/../redland/raptor"
                   1015:          AMAYA_RAPTOR_LIBS="../redland/librdf/.libs/librdf.a ../redland/raptor/.libs/libraptor.a"
                   1016:          AMAYA_RAPTOR_INCLUDES="-I\$(THOTDIR)/../redland/librdf -I\$(THOTDIR)/../redland/raptor"
                   1017:        else
                   1018:          MAKEREDLAND=['#']
                   1019:         AMAYA_RAPTOR_SRC=
                   1020:         redland_includes=`$REDLAND_CONFIG --cflags`
                   1021:         redland_libs=`$REDLAND_CONFIG --libs`
                   1022:          AMAYA_ANNOT_OPTIONS="$AMAYA_ANNOT_OPTIONS"
                   1023:          AMAYA_ANNOT_INCLUDES="$redland_includes -I\$(THOTDIR)/thotlib/include"
                   1024:          AMAYA_ANNOT_EXTRA_LIBS="$redland_libs"
                   1025:          AMAYA_RAPTOR_INCLUDES="$redland_includes"
                   1026:        fi
1.109     kahan    1027:     fi
                   1028: 
1.116     kahan    1029: 
1.108     kahan    1030:     dnl control whether we should build the bookmarks support
                   1031:     if test "$with_bookmarks" = "yes" -a "$with_annot" = "no" ; then
                   1032:        AC_MSG_WARN(Disabling bookmarks build as annotations are disabled !)
                   1033:        with_bookmarks="no"
                   1034:     fi
1.109     kahan    1035:     if test "$with_bookmarks" = "yes" -a "$with_redland" = "no" ; then
                   1036:        AC_MSG_WARN(Disabling bookmarks build as redland is disabled !)
1.108     kahan    1037:        with_bookmarks="no"
                   1038:     fi
                   1039:     if test "$with_bookmarks" = "yes" ; then
                   1040:        ANNOTLIB_COMPILE_BM=
                   1041:        AMAYA_ANNOT_OPTIONS="$AMAYA_ANNOT_OPTIONS -DBOOKMARKS"
                   1042:     else
                   1043:        ANNOTLIB_COMPILE_BM=['#']
                   1044:     fi
                   1045: 
1.93      kahan    1046:     dnl control whether we should use libwww's rdf parser
1.109     kahan    1047:     if test "$with_raptor" = "yes" -o "$with_redland" = "yes"; then
1.93      kahan    1048:        dnl not all the function calls have been cleared as of today, 
                   1049:        dnl we still need libwww's rdf parser 
1.98      kahan    1050:        MAKE_LIBWWW_RDF_PARSER=
                   1051:        LIBWWW_RDF_PARSER=
1.93      kahan    1052:     else
                   1053:        MAKE_LIBWWW_RDF_PARSER="libwwwxml"
                   1054:        LIBWWW_RDF_PARSER="-lwwwxml"
                   1055:     fi
1.70      kahan    1056: 
1.55      kahan    1057:     if test "$with_plugin" = "yes" ; then
                   1058:         AC_MSG_WARN(The plugin library isn't supported anymore in Amaya !!)
                   1059:        AC_MSG_WARN(Disabling plugin build !)
                   1060:        with_plugin="no"
                   1061:     fi
                   1062: 
1.88      kirschpi 1063: 
                   1064:     if test ! -f $srcdir/davlib/Makefile.in ; then
                   1065:        if test "$with_dav" = "yes" ; then
                   1066:            AC_MSG_WARN(WebDAV makefile not found !!)
                   1067:            AC_MSG_WARN(Disabling WebDAV build !)
                   1068:            with_dav="no"
1.90      kirschpi 1069:             DAVDIR=""
                   1070:             LIBDAV=""
                   1071:             WITHDAV="" 
                   1072:             WWWDAV="" 
1.88      kirschpi 1073:        fi
                   1074:     fi
                   1075:    
                   1076: 
1.1       cvs      1077: fi
                   1078: 
                   1079: dnl
                   1080: dnl The options for each library or binary
                   1081: dnl
                   1082: 
1.134     gully    1083: THOT_OPTIONS="$OS_OPTIONS $GTK_OPTIONS $GL_OPTIONS $WX_OPTIONS $NOGUI_OPTIONS"
                   1084: AMAYA_OPTIONS="$OS_OPTIONS $MATH_OPTIONS $SVG_OPTIONS $GENERIC_XML_OPTIONS $GTK_OPTIONS $GL_OPTIONS $WX_OPTIONS $NOGUI_OPTIONS"
1.58      cvs      1085: #PLUGIN_OPTIONS="-DPLUGIN_TRACE -DXP_UNIX"
1.129     vatton   1086: AMAYA_ANNOT_OPTIONS="$OS_OPTIONS $AMAYA_ANNOT_OPTIONS"
1.101     kahan    1087: 
1.102     kahan    1088: IMGLIBS="-ljpeg -lpng -lz"
1.132     gully    1089: 
1.3       cvs      1090: EXTRA_LIBS=
1.131     gully    1091: EXTRA_INCLUDES=
                   1092: 
                   1093: # check for malloc.h
                   1094: # on macosx, this file is not at the right place
                   1095: for ac_dir in               \
                   1096:   /usr/include/malloc/      \
                   1097:   /sw/include/malloc/       \
                   1098:   ; \
                   1099: do
                   1100:   if test -r "$ac_dir/malloc.h"; then
                   1101:     echo "found malloc.h"
                   1102:     EXTRA_INCLUDES="${EXTRA_INCLUDES} -I$ac_dir"
                   1103:     break
                   1104:   fi
                   1105: done
1.1       cvs      1106: 
                   1107: dnl
                   1108: dnl Set up the PATHs needed
                   1109: dnl
                   1110: 
                   1111: API="\$(THOTDIR)/thotlib/include"
                   1112: VAR="\$(THOTDIR)/thotlib/internals/var"
                   1113: INCL="\$(THOTDIR)/thotlib/internals/h"
                   1114: FUNC="\$(THOTDIR)/thotlib/internals/f"
                   1115: 
                   1116: dnl
                   1117: dnl Set up the include variables.
                   1118: dnl
                   1119: 
1.61      cvs      1120: THOTINCLUDES="-I${API} -I${VAR} -I${INCL} -I${FUNC} ${JPEGINCL} ${PNGINCL}"
1.58      cvs      1121: APIINCLUDES=-I${API}
                   1122:  
                   1123: if test "${VPATHOPT}" = "" ; then
1.1       cvs      1124:        VPATHOPT="VPATH"
                   1125: fi
                   1126: 
                   1127: dnl
                   1128: dnl Exports the current values of the variables.
                   1129: dnl
                   1130: 
                   1131: AC_SUBST(AMAYA_VER)
1.6       cvs      1132: AC_SUBST(CEXTRACT_VER)
                   1133: AC_SUBST(CEXTRACT_FLAGS)
1.1       cvs      1134: 
                   1135: AC_SUBST(THOTINCLUDES)
                   1136: AC_SUBST(APIINCLUDES)
                   1137: AC_SUBST(VPATHOPT)
                   1138: 
1.63      vatton   1139: AC_SUBST(GTK_OPTIONS)
1.1       cvs      1140: AC_SUBST(THOT_OPTIONS)
                   1141: AC_SUBST(AMAYA_OPTIONS)
                   1142: AC_SUBST(PLUGIN_OPTIONS)
1.48      cvs      1143: AC_SUBST(AMAYA_ANNOT_OPTIONS)
1.110     kahan    1144: AC_SUBST(AMAYA_ANNOT_INCLUDES)
1.116     kahan    1145: AC_SUBST(AMAYA_ANNOT_EXTRA_LIBS)
1.1       cvs      1146: AC_SUBST(IMGLIBS)
1.3       cvs      1147: AC_SUBST(EXTRA_LIBS)
1.131     gully    1148: AC_SUBST(EXTRA_INCLUDES)
1.90      kirschpi 1149: 
                   1150: AC_SUBST(DAVDIR)
                   1151: AC_SUBST(LIBDAV)
                   1152: AC_SUBST(WITHDAV)
                   1153: AC_SUBST(WWWDAV)
1.1       cvs      1154: 
1.93      kahan    1155: AC_SUBST(MAKERAPTOR)
1.109     kahan    1156: AC_SUBST(MAKEREDLAND)
1.108     kahan    1157: AC_SUBST(ANNOTLIB_COMPILE_BM)
1.109     kahan    1158: AC_SUBST(AMAYA_RAPTOR_SRC)
1.93      kahan    1159: AC_SUBST(AMAYA_RAPTOR_LIBS)
                   1160: AC_SUBST(AMAYA_RAPTOR_INCLUDES)
                   1161: AC_SUBST(MAKE_LIBWWW_RDF_PARSER)
                   1162: AC_SUBST(LIBWWW_RDF_PARSER)
                   1163: 
                   1164: AC_SUBST(SUBDIRS)
                   1165: 
1.1       cvs      1166: dnl
1.48      cvs      1167: dnl Include the option Makefile.xxx fragment according to the configure options
1.1       cvs      1168: dnl
                   1169: 
                   1170: if test "$with_plugin" = "yes" ; then
1.50      cvs      1171:     AC_SUBST_FILE(plugin_frag)
1.1       cvs      1172:     plugin_frag=$srcdir/pluginlib/Makefile.plugin
                   1173: else
                   1174:     AC_SUBST_FILE(plugin_frag)
                   1175:     plugin_frag=/dev/null
                   1176: fi
                   1177: 
                   1178:     AC_SUBST_FILE(www_frag)
1.49      cvs      1179:     www_frag=$srcdir/amaya/Makefile.libwww
1.1       cvs      1180: 
1.50      cvs      1181: if test "$with_math" = "no" ; then
1.10      cvs      1182:     AC_SUBST_FILE(math_frag)
1.50      cvs      1183:     math_frag=/dev/null
1.8       cvs      1184: else
1.10      cvs      1185:     AC_SUBST_FILE(math_frag)
1.50      cvs      1186:     math_frag=$srcdir/amaya/Makefile.math
1.8       cvs      1187: fi
                   1188: 
1.68      vatton   1189: if test "$with_svg" = "no" ; then
                   1190:     AC_SUBST_FILE(svg_frag)
                   1191:     svg_frag=/dev/null
1.26      cvs      1192: else
1.68      vatton   1193:     AC_SUBST_FILE(svg_frag)
                   1194:     svg_frag=$srcdir/amaya/Makefile.svg
1.26      cvs      1195: fi
                   1196: 
1.47      cvs      1197: if test "$with_annot" = "yes" ; then
                   1198:     AC_SUBST_FILE(annot_frag)
1.48      cvs      1199:     annot_frag=$srcdir/annotlib/Makefile.annot
1.47      cvs      1200: else
                   1201:     AC_SUBST_FILE(annot_frag)
                   1202:     annot_frag=/dev/null
                   1203: fi
                   1204: 
1.88      kirschpi 1205: if test "$with_dav" = "yes" ; then
                   1206:     AC_SUBST_FILE(dav_frag)
                   1207:     dav_frag=$srcdir/davlib/Makefile.dav
                   1208: fi
1.16      cvs      1209: 
1.1       cvs      1210: dnl  ***************************************************************
                   1211: dnl
                   1212: dnl      FINAL STEP : PRODUCE ALL THE MAKEFILES AND CONFIG FILES
                   1213: dnl
                   1214: dnl  ***************************************************************
                   1215: 
                   1216: EXTRA_MAKEFILE_IN=
1.2       cvs      1217: make_output="Makefile Options.orig:Options.in tools/Makefile \
1.1       cvs      1218:        libjpeg/Makefile libpng/Makefile libpng/zlib/Makefile \
1.2       cvs      1219:        tools/mkdep/Makefile \
1.1       cvs      1220:        tools/cextract-1.7/Makefile thotlib/Makefile \
1.127     vatton   1221:        thotlib/include/Makefile batch/Makefile"
1.1       cvs      1222: 
                   1223: if test "$build_amaya" = "yes" ; then
1.2       cvs      1224: 
1.19      cvs      1225:     make_output="$make_output amaya/Makefile pluginlib/Makefile"
1.2       cvs      1226:     EXTRA_MAKEFILE_IN="$srcdir/amaya/Makefile.in \
1.93      kahan    1227:     $srcdir/amaya/Makefile.libwww"
1.27      cvs      1228: 
                   1229:     if test "$$with_plugin" = "yes" ; then
                   1230:        make_output="$make_output pluginlib/Makefile"
                   1231:        EXTRA_MAKEFILE_IN="$srcdir/pluginlib/Makefile.in \
1.93      kahan    1232:        $srcdir/pluginlib/Makefile.plugin"
1.27      cvs      1233:     fi
1.2       cvs      1234: 
1.48      cvs      1235:     if test "$with_annot" = "yes" ; then
                   1236:        make_output="$make_output annotlib/Makefile"
                   1237:        EXTRA_MAKEFILE_IN="$srcdir/annotlib/Makefile.in"
                   1238:     fi
1.88      kirschpi 1239: 
                   1240:     if test "$with_dav" = "yes" ; then
                   1241:        make_output="$make_output davlib/Makefile"
                   1242:        EXTRA_MAKEFILE_IN="$srcdir/davlib/Makefile.in"
                   1243:     fi
                   1244: 
1.1       cvs      1245: fi
                   1246: 
                   1247: AC_SUBST(EXTRA_MAKEFILE_IN)
1.6       cvs      1248: AC_OUTPUT($make_output , [
                   1249: dnl
                   1250: dnl This fragment of shell code is executed after the
                   1251: dnl Makefile(s) dump ...
                   1252: dnl
                   1253: 
                   1254: echo timestamp > stamp-h
                   1255: 
                   1256: dnl
                   1257: dnl Check for an upgrade in the Options numbers
                   1258: dnl
                   1259: 
                   1260: if test -f Options ; then
                   1261:    oldversion=`grep Version Options`
                   1262:    newversion=`grep Version Options.orig`
                   1263:    if test "$oldversion" != "$newversion" ; then
                   1264:        echo WARNING : Options files have changed, old options saved to Options.old
                   1265:        cp Options Options.old
                   1266:        cp Options.orig Options
                   1267:        exit 1
                   1268:    fi
                   1269: fi
                   1270: ])
1.1       cvs      1271: 
                   1272: if test "$build_amaya" = "yes" ; then
1.50      cvs      1273:     echo Amaya configured with libWWW
                   1274:     if test "$with_plugin" = "yes" ; then
                   1275:         echo Amaya configured with Plugins support
1.8       cvs      1276:     fi
1.10      cvs      1277:     if test "$with_math" = "yes" ; then
                   1278:        echo Amaya configured with Math support
1.26      cvs      1279:     fi
1.68      vatton   1280:     if test "$with_svg" = "yes" ; then
                   1281:        echo Amaya configured with SVG support
1.47      cvs      1282:     fi
                   1283:     if test "$with_annot" = "yes" ; then
                   1284:        echo Amaya configured with Annotations support
1.70      kahan    1285:     fi
1.93      kahan    1286:     if test "$with_raptor" = "yes" ; then
1.106     kahan    1287:        echo Amaya configured with the Raptor RDF parser
1.109     kahan    1288:     fi
                   1289:     if test "$with_redland" = "yes" ; then
1.116     kahan    1290:        if test "$with_system_redland" = "no" ; then
                   1291:          echo Amaya configured with the Redland RDF library \(local source\)
                   1292:        else
                   1293:          echo Amaya configured with the Redland RDF library \(system\)
                   1294:        fi
1.108     kahan    1295:     fi
                   1296:     if test "$with_bookmarks" = "yes" ; then
                   1297:        echo Amaya configured with bookmarks support \(experimental\)
1.93      kahan    1298:     fi
1.70      kahan    1299:     if test "$with_generic_xml" = "yes" ; then
                   1300:        echo Amaya configured with generic XML suppport
                   1301:     fi
1.129     vatton   1302:     echo Amaya configured with internationalization suppport
1.75      cheyroul 1303:     if test "$with_gl" = "yes" ; then
1.128     gully    1304:        echo Amaya configured with OpenGL Canvas Rendering \(experimental\)
1.88      kirschpi 1305:     fi
                   1306:     if test "$with_dav" = "yes" ; then
                   1307:        echo Amaya configured with WebDAV support \(experimental\)
1.1       cvs      1308:     fi
1.5       cvs      1309: fi
                   1310: 
1.107     kahan    1311: if test "$no_graphic" = "yes" ; then
                   1312:     echo "Amaya configured with system graphic libraries (libjpeg, libpng, zlib)"
                   1313: else
                   1314:     echo "Amaya configured with static graphic libraries (libjpeg, libpng, zlib)"
                   1315:     if test "$with_gtk" = "yes" -o "$with_gl" = "yes" ; then
                   1316:       echo "  N.B. This option may not work in your platform. If Amaya crashes"
                   1317:       echo "  when opening a PNG file. Recompile it using the system libraries."
                   1318:     fi
                   1319: fi
                   1320: 
                   1321: if test "$with_gtk" = "yes" ; then
1.67      vatton   1322:     echo "Amaya configured with GTK"
1.120     gully    1323: fi
                   1324: 
1.124     gully    1325: if test "$with_wx" = "yes" ; then
                   1326:     echo "Amaya configured with wxWindows (experimental)"
1.1       cvs      1327: fi
                   1328: 
1.121     gully    1329: if test "$with_nogui" = "yes" ; then
1.128     gully    1330:   echo "Amaya configured without GUI toolkit"
1.121     gully    1331: fi
                   1332:   
1.107     kahan    1333: echo ""
1.78      vatton   1334: echo "Now type \"make\" (GNU make preferably) to build the binaries"
1.107     kahan    1335: echo ""
1.120     gully    1336: 

Webmaster