Annotation of Amaya/configure.in, revision 1.142

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

Webmaster