Annotation of Amaya/configure.in, revision 1.134

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.134   ! gully     362:   # check that wx-config exists
        !           363:   AC_CHECK_PROG(WXCONFIG_FOUND,wx-config,yes,no)
        !           364:   if test "$WXCONFIG_FOUND" = no ; then
        !           365:     AC_MSG_ERROR(Cannot find wx-config. Please install wxWidgets (http://www.wxwidgets.org/) )
        !           366:   fi
        !           367:   
1.124     gully     368:   WX_INCLUDES="`wx-config --cxxflags`"
                    369:   AC_SUBST(WX_INCLUDES)
                    370: 
1.126     gully     371:   WX_LIBRARIES="`wx-config --libs`"
                    372: 
1.132     gully     373:   # GL is used ?
1.126     gully     374:   if test "${with_gl}" = "yes" ; then
                    375:     WX_LIBRARIES="${WX_LIBRARIES} `wx-config --gl-libs`"
1.132     gully     376: 
                    377:     # SG: this is a mistery why wx-config doesn't add these needed option on macosx
                    378:     if test "$OS_OPTIONS" = "-D_UNIX -D_MACOS" ; then
                    379:       WX_LIBRARIES="${WX_LIBRARIES} -framework OpenGL -framework AGL"
                    380:     fi
1.124     gully     381:   fi
                    382: 
1.132     gully     383:   # xrc ressources are used
1.130     gully     384:   WX_LIBRARIES="${WX_LIBRARIES} -l`wx-config --basename`_xrc-`wx-config --release`"
                    385:   
1.124     gully     386:   AC_SUBST(WX_LIBRARIES)
                    387:   WX_OPTIONS="-D_WX"
1.132     gully     388: 
                    389:   no_graphic=yes
1.124     gully     390: fi
                    391: 
1.63      vatton    392: if test "${GCC}" = "yes"; then
                    393:    CPP="${CPP} -x c"
                    394: fi
                    395: 
1.1       cvs       396: dnl  ***************************************************************
                    397: dnl
1.61      cvs       398: dnl    SPECIFIC STUFF : CONFIGURATION OPTIONS FOR AMAYA
1.1       cvs       399: dnl
                    400: dnl  ***************************************************************
                    401: 
1.101     kahan     402: # We don't use our graphic libraries for the pure GTK version (without GL)
                    403: 
1.132     gully     404: # if configure has option --with-graphiclibs then dont check for system graphic libs
                    405: # force amaya static graphic libs to be used
                    406: AC_ARG_WITH(graphiclibs, [  --with-graphiclibs     use static libjpeg, libpng.])
                    407: if test "$with_graphiclibs" = "yes" -o "enable_graphiclibs" = "yes" ; then
                    408:   no_graphic="no"
                    409: else
                    410:   no_graphic="yes"
1.76      vatton    411: fi
1.132     gully     412:                  
1.76      vatton    413: if test "$no_graphic" = yes; then
                    414: dnl
                    415:     AC_MSG_CHECKING([for libjpeg version = 6b])
                    416:     AC_EGREP_CPP([x 62 *x],
                    417:         [#include <jpeglib.h>
                    418:          x JPEG_LIB_VERSION x],
                    419: dnl
                    420:         AC_MSG_RESULT([yes])
1.105     vatton    421:        JPEGINCL=''
1.76      vatton    422:         LIBJPEG='-ljpeg'
                    423:         MAKEJPEG=['#'],
                    424: dnl
                    425:         AC_MSG_RESULT([no])
1.105     vatton    426:        JPEGINCL='-I$(THOTDIR)/libjpeg'
1.76      vatton    427:         LIBJPEG='../libjpeg.a'      dnl LIBJPEG goes into amaya/Makefile.in
                    428:         )
                    429: dnl    
                    430: dnl
1.95      vatton    431:     AC_MSG_CHECKING([for libpng version = 1.0.x or 1.2.x])
                    432:     AC_EGREP_CPP([x \"1.[02]\..*\" *x],
1.76      vatton    433:         [#include <png.h>
                    434:        x PNG_LIBPNG_VER_STRING x],
                    435: dnl
                    436:         AC_MSG_RESULT([yes])
1.105     vatton    437:        PNGINCL=''
1.76      vatton    438:         LIBPNG='-lpng'
                    439:         LIBZ=''
                    440:        MAKEPNG=['#'],
                    441: dnl
                    442:         AC_MSG_RESULT([no])
1.105     vatton    443:        PNGINCL='-I$(THOTDIR)/libpng -I$(THOTDIR)/libpng/zlib'
1.76      vatton    444:         LIBPNG='../libpng.a'
                    445:         LIBZ='../libz.a'
                    446:         )
                    447: else
1.105     vatton    448:     JPEGINCL='-I$(THOTDIR)/libjpeg'
1.76      vatton    449:     LIBJPEG='../libjpeg.a'
1.105     vatton    450:     PNGINCL='-I$(THOTDIR)/libpng -I$(THOTDIR)/libpng/zlib'
1.76      vatton    451:     LIBPNG='../libpng.a'
                    452:     LIBZ='../libz.a'
                    453: fi
                    454: dnl
                    455: AC_SUBST(LIBJPEG)
                    456: AC_SUBST(LIBPNG)
                    457: AC_SUBST(LIBZ)
                    458: AC_SUBST(MAKEJPEG)
                    459: AC_SUBST(MAKEPNG)
                    460: 
1.119     vatton    461: AMAYA_VER="8.2"
1.1       cvs       462: 
                    463: dnl
1.6       cvs       464: dnl We use a special versoin of cextract patched for alignment
                    465: dnl to build the signatures of the modules functions located in f subdirs
                    466: dnl
                    467: CEXTRACT_VER="1.7"
                    468: CEXTRACT_FLAGS="+O"
                    469: 
1.3       cvs       470: 
                    471: dnl
1.9       cvs       472: dnl Adjust the some variables depending on the host and compiler
1.61      cvs       473: dnl Thotlib NEED signed chars !!!
1.7       cvs       474: dnl
                    475: 
                    476: if test "${CC}" = "gcc" ; then
1.44      cvs       477:   CFLAGS="${CFLAGS} -W "
1.7       cvs       478:   case "${host}" in
                    479:       *-*-irix5* | *-*irix6* )
                    480:          CFLAGS="${CFLAGS} -fsigned-char"
                    481:       ;;
                    482:   esac
1.14      cvs       483: fi
                    484: 
                    485: if test "$ac_cv_c_const" = "no" ; then
                    486:   CFLAGS="${CFLAGS} -DCONST= "
1.7       cvs       487: fi
                    488: 
1.122     gully     489: 
                    490: # force C mode (-x c)
1.123     gully     491: CFLAGS="${CFLAGS} -x c"
1.122     gully     492: 
                    493: # C++ options (-x c++)
                    494: CXX_OPTIONS="-D__cplusplus"
1.123     gully     495: CXXFLAGS="${CXXFLAGS} -W -x c++ ${CXX_OPTIONS}"
1.122     gully     496: 
1.132     gully     497: # setup LDFLAGS
                    498: # on macosx, specific flags must be set to avoid conflicts with allready installed libwww
                    499: # for exemple it's possible to install libwww with fink (fink install libwww)
                    500: # to avoid conflicts, we just force the linker to search for specified amaya path first
1.133     gully     501: if test "$OS_OPTIONS" = "-D_UNIX -D_MACOS" ; then
1.132     gully     502:   LDFLAGS="-Wl,-search_paths_first"
                    503: else
                    504:   LDFLAGS=""
                    505: fi
1.128     gully     506: 
                    507: dnl
1.61      cvs       508: dnl Check for availability of amaya sources
1.1       cvs       509: dnl
                    510: 
                    511: build_amaya="yes"
                    512: 
                    513: if test "$with_amaya" = "no" ; then
                    514:     build_amaya="no"
1.45      cvs       515: else
                    516:   if test ! -f $srcdir/amaya/Makefile.in ; then
1.1       cvs       517:     AC_MSG_WARN(Amaya browser/editor sources not found, disabling Amaya build !)
                    518:     build_amaya="no"
1.45      cvs       519:   fi
1.1       cvs       520: fi
                    521: 
                    522: dnl
1.50      cvs       523: dnl Check for additionnal packages
1.1       cvs       524: dnl use AC_CONFIG_SUBDIRS to launch configure in the subdir
                    525: dnl
1.93      kahan     526: 
1.75      cheyroul  527: if test "$with_gl" = "yes" ; then
                    528:        AC_MSG_CHECKING([OpenGL])
                    529:        for ac_dir in                           \
                    530:                /usr/include                    \
                    531:                /usr/X11R6/include              \
                    532:                /usr/local/include              \
                    533:                ; \
1.80      cheyroul  534:        do  if test -r "$ac_dir/GL/gl.h" ; then
1.75      cheyroul  535:                 gl_inc="yes"
1.80      cheyroul  536:                GL_INC_I="$ac_dir"
                    537:                if test "$ac_dir" != "/usr/include" ; then
                    538:                   GL_INCLUDES="-I$ac_dir"
                    539:                fi
1.96      cheyroul  540:                AC_MSG_RESULT([yes])
1.75      cheyroul  541:                        break   
                    542:            fi
1.80      cheyroul  543:        done    
                    544:        AC_MSG_CHECKING([GLU])  
1.75      cheyroul  545:        for ac_dir in                           \
                    546:                /usr/include/GL                 \
                    547:                /usr/include                    \
                    548:                /usr/X11R6/include/GL           \
                    549:                /usr/X11R6/include              \
                    550:                /usr/local/include              \
                    551:                /usr/local/include/GL           \
                    552:                ; \
                    553:        do  if test -r "$ac_dir/glu.h" ; then
                    554:                 glu_inc="yes"
1.80      cheyroul  555:                GL_INC_II="$ac_dir"
                    556:                if test "$ac_dir" != "/usr/include" ; then
                    557:                        if test "$ac_dir" != "$GL_INC_I" ; then
                    558:                            GL_INCLUDES="$GL_INCLUDES -I$ac_dir"
                    559:                        fi
                    560:                fi
1.96      cheyroul  561:                AC_MSG_RESULT([yes])
1.75      cheyroul  562:                        break   
                    563:            fi
1.132     gully     564:        done
                    565: 
                    566:        # check for gtkglarea.h only if gtk gui is selected
                    567:        if test "$with_gtk" = "yes" ; then
                    568:          AC_MSG_CHECKING([GTKGLAREA])  
                    569:          for ac_dir in                         \
                    570:                /usr/include/GL                 \
1.75      cheyroul  571:                /usr/include                    \
                    572:                /usr/X11R6/include/GL           \
                    573:                /usr/X11R6/include              \
                    574:                /usr/local/include              \
                    575:                /usr/local/include/GL           \
                    576:                ; \
1.132     gully     577:          do  if test -r "$ac_dir/gtkgl/gtkglarea.h" ; then
                    578:                   gtkgl_inc="yes"
                    579:                  if test "$ac_dir" != "/usr/include" ; then
                    580:                          if test "$ac_dir" != "$GL_INC_II" ; then
                    581:                                  if test "$ac_dir" != "$GL_INC_I" ; then
                    582:                                          GL_INCLUDES="$GL_INCLUDES -I$ac_dir"
                    583:                                  fi
                    584:                          fi
                    585:                  fi
                    586:                  AC_MSG_RESULT([yes])
                    587:                          break 
                    588:              fi
                    589:          done
                    590:          GTKGL_LIBS="-lgtkgl"
                    591:        else
                    592:          gtkgl_inc="ignore"
                    593:          GTKGL_LIBS=""
                    594:        fi
                    595: 
1.80      cheyroul  596:        AC_MSG_CHECKING([freetype])     
                    597:        for ac_dir in                           \
                    598:                /usr/include                    \
                    599:                /usr/X11R6/include              \
                    600:                /usr/local/include              \
1.132     gully     601:                /opt/local/include              \
                    602:                /usr/X11R6/include/freetype2    \
1.80      cheyroul  603:                ; \
                    604:        do  if test -r "$ac_dir/ft2build.h" ; then
                    605:                 freetype_inc="yes"
                    606:                GL_INCLUDES="$GL_INCLUDES `freetype-config --cflags`"
1.96      cheyroul  607:                        AC_MSG_RESULT([yes])    
                    608:                break   
                    609:            fi
                    610:        done    
1.104     cheyroul  611:         AC_MSG_CHECKING([Xft]) 
                    612:        for ac_dir in                           \
                    613:                /usr/include                    \
                    614:                /usr/X11R6/include              \
                    615:                /usr/local/include              \
                    616:                /usr/include/X11/Xft            \
                    617:                /usr/X11R6/include/X11/Xft      \
                    618:                /usr/local/include/X11/Xft      \
                    619:                /usr/include/X11/Xft1           \
                    620:                /usr/X11R6/include/X11/Xft1     \
1.113     vatton    621:                /usr/include/Xft2/X11/Xft/      \
1.104     cheyroul  622:                /usr/local/include/X11/Xft1     \
                    623:                /usr/include/X11/Xft2           \
                    624:                /usr/X11R6/include/X11/Xft2     \
                    625:                /usr/local/include/X11/Xft2     \
                    626:                ; \
                    627:        do  if test -r "$ac_dir/Xft.h" ; then
                    628:                 xft_inc="yes"
                    629:                GL_INCLUDES="$GL_INCLUDES -I$ac_dir"
                    630:                        AC_MSG_RESULT([yes])    
                    631:                break   
                    632:            fi
                    633:        done    
1.96      cheyroul  634:        AC_MSG_CHECKING([gcc3]) 
                    635:        for ac_dir in                           \
                    636:                /usr/lib                        \
                    637:                /usr/X11R6/lib          \
                    638:                /usr/local/lib          \
                    639:                ; \
                    640:        do  if test -r "$ac_dir/libstdc++.so.5" ; then
                    641:                 stdglu_inc="yes"
                    642:                        AC_MSG_RESULT([yes])    
                    643:                break
1.80      cheyroul  644:            fi
1.96      cheyroul  645:        done
                    646:        if test "$gl_inc" = "" ; then           
1.75      cheyroul  647:                AC_MSG_WARN(Opengl headers (gl.h) not found !!)
                    648:                AC_MSG_WARN(Disabling opengl build !)
                    649:                with_gl="no"
                    650:                GL_OPTIONS=     
                    651:                GL_INCLUDES=    
                    652:                GL_LIBRARIES=
1.81      cheyroul  653:                exit 1;
1.75      cheyroul  654:        fi
                    655:        if test "$glu_inc" = "" ; then
                    656:                AC_MSG_WARN(Glu headers (glu.h) not found !!)
                    657:                AC_MSG_WARN(Disabling opengl build !)
1.81      cheyroul  658:        
1.75      cheyroul  659:                with_gl="no"
                    660:                GL_OPTIONS=     
                    661:                GL_INCLUDES=    
                    662:                GL_LIBRARIES=
1.81      cheyroul  663:                exit 1;
1.75      cheyroul  664:        fi
1.132     gully     665: 
1.75      cheyroul  666:        if test "$gtkgl_inc" = "" ; then
                    667:                AC_MSG_WARN(Gtkglarea headers (gktglarea.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
1.132     gully     675: 
1.80      cheyroul  676:        if test "$freetype_inc" = "" ; then
                    677:                AC_MSG_WARN(Freetype 2 headers (ft2build.h) not found !!)
                    678:                AC_MSG_WARN(Disabling opengl build !)
                    679:                with_gl="no"
                    680:                GL_OPTIONS=     
                    681:                GL_INCLUDES=
                    682:                GL_LIBRARIES=
1.81      cheyroul  683:                exit 1;
1.80      cheyroul  684:        fi
1.104     cheyroul  685:        if test "$xft_inc" = "" ; then
                    686:                AC_MSG_WARN(Xft 2 headers (Xft.h) not found !!)
                    687:                AC_MSG_WARN(Disabling opengl build !)
                    688:                with_gl="no"
                    689:                GL_OPTIONS=     
                    690:                GL_INCLUDES=
                    691:                GL_LIBRARIES=
                    692:                exit 1;
                    693:        fi
1.75      cheyroul  694:        if test "$gl_inc" = "yes" ; then
1.79      cheyroul  695:                if test "$glu_inc" = "yes" ; then
1.132     gully     696:                        if test "$gtkgl_inc" = "yes" -o "$gtkgl_inc" = "ignore" ; then
1.96      cheyroul  697:                            if test "$freetype_inc" = "yes" ; then
1.104     cheyroul  698:                                if test "$xft_inc" = "yes" ; then
                    699:                                        if test "$stdglu_inc" = "yes" ; then
1.132     gully     700:                                           GL_LIBRARIES="-L/usr/lib -L/usr/X11R6/lib  -lXmu -lXft -lfreetype -lGL -lGLU ${GTKGL_LIBS} -lstdc++"
1.104     cheyroul  701:                                        else
1.132     gully     702:                                           GL_LIBRARIES="-L/usr/lib -L/usr/X11R6/lib  -lXmu -lXft -lfreetype -lGL -lGLU ${GTKGL_LIBS}"
1.104     cheyroul  703:                                        fi                              
                    704:                                        GL_OPTIONS="-D_GL"
                    705:                                fi
1.80      cheyroul  706:                            fi
1.75      cheyroul  707:                        fi
                    708:                fi
                    709:        fi
                    710: AC_SUBST(GL_INCLUDES)
                    711: AC_SUBST(GL_LIBRARIES)
1.115     cheyroul  712: dnl PRINTIFNOTGL=" "
                    713: dnl #NOPRINT="#"
                    714: NOPRINT=""
                    715: PRINTIFNOTGL=" print_prog"
1.97      cheyroul  716: else
1.112     cheyroul  717: NOPRINT=""
1.97      cheyroul  718: PRINTIFNOTGL=" print_prog"
1.75      cheyroul  719: fi
1.97      cheyroul  720: AC_SUBST(PRINTIFNOTGL)
1.112     cheyroul  721: AC_SUBST(NOPRINT)
                    722: 
1.76      vatton    723: 
                    724: AC_ARG_ENABLE(svg,           [  --disable-svg           remove SVG support ])
                    725: AC_ARG_ENABLE(annot,         [  --disable-annot         remove Annotations support ])
1.93      kahan     726: AC_ARG_ENABLE(raptor,        [  --disable-raptor        disable the raptor RDF parser ])
1.116     kahan     727: AC_ARG_ENABLE(redland,       [  --enable-redland        enable the redland RDF library ])
                    728: AC_ARG_ENABLE(system-redland,       [  --enable-system-redland try the redland RDF system library ])
1.108     kahan     729: AC_ARG_ENABLE(bookmarks,     [  --enable-bookmarks      enables experimental bookmark support ])
1.76      vatton    730: AC_ARG_ENABLE(generic-xml,   [  --disable-generic-xml   remove Generic XML support ])
                    731: 
1.75      cheyroul  732: dnl
1.21      cvs       733: dnl plugins support is disabled by default
1.8       cvs       734: dnl
1.13      cvs       735: 
                    736: if test "$with_plugin" = "" ; then
1.21      cvs       737:   if test "$enable_plugin" = "yes" ; then
1.55      kahan     738:     with_plugin="yes"
1.21      cvs       739:   else
1.17      cvs       740:     with_plugin="no"
                    741:   fi
1.10      cvs       742: fi  
1.1       cvs       743: 
1.8       cvs       744: dnl
1.68      vatton    745: dnl svg is enabled by default
1.26      cvs       746: dnl
1.68      vatton    747: if test "$with_svg" = "" ; then
                    748:     if test "$enable_svg" = "no" ; then
                    749:        with_svg="no"
1.49      cvs       750:     else
1.68      vatton    751:        with_svg="yes"
1.26      cvs       752:     fi
                    753: fi
                    754: 
                    755: dnl
1.56      kahan     756: dnl annotations is enabled by default
1.47      cvs       757: dnl
                    758: if test "$with_annot" = "" ; then
1.56      kahan     759:     if test "$enable_annot" = "no" ; then
                    760:        with_annot="no"
                    761:     else
1.54      cvs       762:        with_annot="yes"
1.47      cvs       763:     fi
1.99      kahan     764: else
                    765:     with_annot="yes"
1.47      cvs       766: fi
                    767: 
1.93      kahan     768: 
                    769: dnl
                    770: dnl The raptor RDF parser is enabled by default
                    771: dnl
                    772: if test "$with_raptor" = "" ; then
                    773:     if test "$enable_raptor" = "no" ; then
                    774:        with_raptor="no"
                    775:     else
1.99      kahan     776:        with_raptor="yes"
1.93      kahan     777:     fi
1.99      kahan     778: else
                    779:     with_raptor="yes"
1.93      kahan     780: fi
                    781: 
1.70      kahan     782: dnl
1.116     kahan     783: dnl The redland library is disabled by default
1.109     kahan     784: dnl
                    785: if test "$with_redland" = "" ; then
                    786:     if test "$enable_redland" = "yes" ; then
                    787:        with_redland="yes"
                    788:     else
                    789:        with_redland="no"
                    790:     fi
                    791: else
                    792:     with_redland="no"
                    793: fi
                    794: 
                    795: dnl
1.116     kahan     796: dnl The redland library is disabled by default
                    797: dnl
                    798: if test "$with_system_redland" = "" ; then
                    799:     if test "$enable_system_redland" = "yes" ; then
                    800:        with_redland="yes"
                    801:        with_system_redland="yes"
                    802:     else
                    803:        with_system_redland="no"
                    804:     fi
                    805: else
                    806:     with_system_redland="no"
                    807: fi
                    808: 
                    809: dnl
                    810: dnl The bookmarks support is disabled by default
1.108     kahan     811: dnl
                    812: if test "$with_bookmarks" = "" ; then
                    813:     if test "$enable_bookmarks" = "yes" ; then
                    814:        with_bookmarks="yes"
1.125     vatton    815:        with_redland="yes"
1.108     kahan     816:     else
                    817:        with_bookmarks="no"
                    818:     fi
                    819: else
                    820:     with_bookmarks="no"
                    821: fi
                    822: 
                    823: dnl
1.70      kahan     824: dnl Generic XML support enabled by default
                    825: dnl
                    826: if test "$with_generic_xml" = "" ; then
                    827:     if test "$enable_generic_xml" = "no" ; then
                    828:        with_generic_xml="no"
                    829:        GENERIC_XML_OPTIONS=
                    830:     else
                    831:        with_generic_xml="yes"
                    832:        GENERIC_XML_OPTIONS=-DXML_GENERIC
                    833:     fi
                    834: fi
                    835: 
1.120     gully     836: AC_ARG_WITH(dav,            [  --with-dav              enable WebDAV support (experimental) ])
1.88      kirschpi  837: dnl
                    838: dnl DAV support disabled by default
                    839: dnl
                    840: if test "$with_dav" = "" ; then
                    841:   if test "$enable_dav" = "yes" ; then
                    842:     with_dav="yes"
                    843:   else
                    844:     with_dav="no"
                    845:   fi
                    846: fi  
                    847: 
                    848: if test "$with_dav" = "yes" ; then
                    849:    DAV_OPTIONS=-DDAV
1.90      kirschpi  850:    DAVDIR="davlib"
                    851:    LIBDAV="libwwwdav"
                    852:    WITHDAV="--with-dav" 
                    853:    WWWDAV="-lwwwdav" 
1.88      kirschpi  854: else
                    855:    with_dav="no"
                    856:    DAV_OPTIONS=""
1.90      kirschpi  857:    DAVDIR=""
                    858:    LIBDAV=""
                    859:    WITHDAV="" 
                    860:    WWWDAV="" 
1.88      kirschpi  861: fi
                    862: 
1.70      kahan     863: 
1.19      cvs       864: if test "$build_amaya" = "yes" ; then
1.43      cvs       865:     if test ! -f $srcdir/../libwww/Makefile.in ; then
1.50      cvs       866:        AC_MSG_WARN(libwww sources not found !!)
                    867:        AC_MSG_WARN(Disabling Amaya build !)
                    868:        build_amaya="no"
1.1       cvs       869:     fi
1.8       cvs       870: 
                    871:     if test ! -f $srcdir/amaya/MathML.S ; then
1.10      cvs       872:        if test "$with_math" = "yes" ; then
1.8       cvs       873:            AC_MSG_WARN(MathML sources not found !!)
1.26      cvs       874:            AC_MSG_WARN(Disabling Math build !)
1.10      cvs       875:            with_math="no"
                    876:            MATH_OPTIONS=
1.8       cvs       877:        fi
                    878:     fi
1.26      cvs       879: 
1.68      vatton    880:     if test ! -f $srcdir/amaya/SVG.S ; then
                    881:        if test "$with_svg" = "yes" ; then
                    882:            AC_MSG_WARN(SVG sources not found !!)
                    883:            AC_MSG_WARN(Disabling SVG build !)
                    884:            with_svg="no"
                    885:            SVG_OPTIONS=
1.26      cvs       886:        fi
                    887:     fi
                    888: 
1.48      cvs       889:     if test ! -f $srcdir/annotlib/Makefile.in ; then
1.47      cvs       890:        if test "$with_annot" = "yes" ; then
                    891:            AC_MSG_WARN(Annotation makefile not found !!)
                    892:            AC_MSG_WARN(Disabling Annotations build !)
                    893:            with_annot="no"
                    894:        fi
                    895:     fi
1.55      kahan     896: 
1.109     kahan     897:     if test "$with_raptor" = "yes" -a "$with_redland" = "yes" ; then
                    898:        AC_MSG_WARN(Disabling raptor build as redland is enabled !)
                    899:        MAKERAPTOR=['#']
                    900:        with_raptor="no"
                    901:     fi
                    902: 
1.108     kahan     903:     if test "$with_raptor" = "yes" -a "$with_annot" = "no" ; then
1.93      kahan     904:        AC_MSG_WARN(Disabling raptor build as annotations are disabled !)
                    905:        MAKERAPTOR=['#']
                    906:        with_raptor="no"
                    907:     fi
                    908: 
1.108     kahan     909:     if test "$with_raptor" = "yes" -a ! -d "$srcdir/libraptor" ; then
                    910:        AC_MSG_WARN(Raptor source dir not found !!)
                    911:        AC_MSG_WARN(Disabling raptor build !)
                    912:        MAKERAPTOR=['#']
                    913:        with_raptor="no"
1.109     kahan     914:     fi
                    915: 
                    916:     if test "$with_raptor" = "yes" ; then
1.108     kahan     917:        AMAYA_ANNOT_OPTIONS="$AMAYA_ANNOT_OPTIONS -DRAPTOR_RDF_PARSER -I\$(THOTDIR)/libraptor"
                    918:        AMAYA_RAPTOR_LIBS="../libraptor/.libs/libraptor.a"
                    919:        AMAYA_RAPTOR_SRC="amaya_comp_libraptor"
                    920:        AMAYA_RAPTOR_INCLUDES="-I\$(THOTDIR)/libraptor"
                    921:     fi
                    922: 
1.109     kahan     923:     if test "$with_redland" = "yes" -a "$with_annot" = "no" ; then
                    924:        AC_MSG_WARN(Disabling redland build as annotations are disabled !)
                    925:        MAKEREDLAND=['#']
                    926:        with_redland="no"
                    927:     fi
                    928: 
1.116     kahan     929:     redland_compile_source=yes
                    930:     if test "$with_redland" = "yes" -a "$with_system_redland" = "yes" ; then
                    931:        # check to see if we have a redland library
                    932:        AC_MSG_CHECKING(system redland library)
1.118     kahan     933:        redland_min_version=0.9.14
1.116     kahan     934:        REDLAND_CONFIG="redland-config"
                    935:        REDLAND_VERSION=`$REDLAND_CONFIG --version`
                    936:        redland_version_dec=`echo $REDLAND_VERSION | awk -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'`
                    937:        redland_min_version_dec=`echo $redland_min_version | awk -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'`
                    938:        if test $redland_version_dec -lt $redland_min_version_dec; then
                    939:          AC_MSG_RESULT(no - found version $REDLAND_VERSION and minimal version is $redland_min_version)
                    940:        else
                    941:          AC_MSG_RESULT(yes - found version $REDLAND_VERSION)
                    942:         AC_MSG_CHECKING(checking for redland headers)
1.117     kahan     943:         dnl  We should use awk here and remove the -I from the following line
                    944:          dnl REDLAND_HEADERS=`$REDLAND_CONFIG --cflags`
                    945:         REDLAND_HEADERS=""
                    946:         if test -e "/usr/include/redland.h" ; then
                    947:           REDLAND_HEADERS="/usr/include";
                    948:         else 
                    949:            if test -e "/usr/local/include/redland.h" ; then
                    950:             REDLAND_HEADERS="/usr/local/include";
                    951:            fi
                    952:          fi        
                    953:         if test $REDLAND_HEADERS != ""; then
1.116     kahan     954:            AC_MSG_RESULT(yes - have development version)
                    955:            redland_compile_source=no
                    956:         else
                    957:            AC_MSG_RESULT(no - no development version)
                    958:          fi
                    959:        fi
                    960:     fi
                    961: 
                    962:     if test "$with_redland" = "yes" -a "$redland_compile_source" = "yes" \
                    963:        -a ! -d "$srcdir/../redland" ; then
1.109     kahan     964:        AC_MSG_WARN(Redland source dir not found !!)
                    965:        AC_MSG_WARN(Disabling redland build !)
                    966:        MAKEREDLAND=['#']
                    967:        with_redland="no"
                    968:     fi
                    969: 
                    970:     if test "$with_redland" = "yes" ; then
1.116     kahan     971:        AMAYA_ANNOT_OPTIONS="$AMAYA_ANNOT_OPTIONS -DLIBRDF_INTERNAL=1 -DAM_REDLAND -DRAPTOR_RDF_PARSER"
                    972:        if test "$redland_compile_source" = "yes" ; then
                    973:          AMAYA_RAPTOR_SRC="amaya_comp_redland"
                    974:          AMAYA_ANNOT_OPTIONS="$AMAYA_ANNOT_OPTIONS -I\$(THOTDIR)/../redland/librdf -I\$(THOTDIR)/../redland/raptor"
                    975:          AMAYA_RAPTOR_LIBS="../redland/librdf/.libs/librdf.a ../redland/raptor/.libs/libraptor.a"
                    976:          AMAYA_RAPTOR_INCLUDES="-I\$(THOTDIR)/../redland/librdf -I\$(THOTDIR)/../redland/raptor"
                    977:        else
                    978:          MAKEREDLAND=['#']
                    979:         AMAYA_RAPTOR_SRC=
                    980:         redland_includes=`$REDLAND_CONFIG --cflags`
                    981:         redland_libs=`$REDLAND_CONFIG --libs`
                    982:          AMAYA_ANNOT_OPTIONS="$AMAYA_ANNOT_OPTIONS"
                    983:          AMAYA_ANNOT_INCLUDES="$redland_includes -I\$(THOTDIR)/thotlib/include"
                    984:          AMAYA_ANNOT_EXTRA_LIBS="$redland_libs"
                    985:          AMAYA_RAPTOR_INCLUDES="$redland_includes"
                    986:        fi
1.109     kahan     987:     fi
                    988: 
1.116     kahan     989: 
1.108     kahan     990:     dnl control whether we should build the bookmarks support
                    991:     if test "$with_bookmarks" = "yes" -a "$with_annot" = "no" ; then
                    992:        AC_MSG_WARN(Disabling bookmarks build as annotations are disabled !)
                    993:        with_bookmarks="no"
                    994:     fi
1.109     kahan     995:     if test "$with_bookmarks" = "yes" -a "$with_redland" = "no" ; then
                    996:        AC_MSG_WARN(Disabling bookmarks build as redland is disabled !)
1.108     kahan     997:        with_bookmarks="no"
                    998:     fi
                    999:     if test "$with_bookmarks" = "yes" ; then
                   1000:        ANNOTLIB_COMPILE_BM=
                   1001:        AMAYA_ANNOT_OPTIONS="$AMAYA_ANNOT_OPTIONS -DBOOKMARKS"
                   1002:     else
                   1003:        ANNOTLIB_COMPILE_BM=['#']
                   1004:     fi
                   1005: 
1.93      kahan    1006:     dnl control whether we should use libwww's rdf parser
1.109     kahan    1007:     if test "$with_raptor" = "yes" -o "$with_redland" = "yes"; then
1.93      kahan    1008:        dnl not all the function calls have been cleared as of today, 
                   1009:        dnl we still need libwww's rdf parser 
1.98      kahan    1010:        MAKE_LIBWWW_RDF_PARSER=
                   1011:        LIBWWW_RDF_PARSER=
1.93      kahan    1012:     else
                   1013:        MAKE_LIBWWW_RDF_PARSER="libwwwxml"
                   1014:        LIBWWW_RDF_PARSER="-lwwwxml"
                   1015:     fi
1.70      kahan    1016: 
1.55      kahan    1017:     if test "$with_plugin" = "yes" ; then
                   1018:         AC_MSG_WARN(The plugin library isn't supported anymore in Amaya !!)
                   1019:        AC_MSG_WARN(Disabling plugin build !)
                   1020:        with_plugin="no"
                   1021:     fi
                   1022: 
1.88      kirschpi 1023: 
                   1024:     if test ! -f $srcdir/davlib/Makefile.in ; then
                   1025:        if test "$with_dav" = "yes" ; then
                   1026:            AC_MSG_WARN(WebDAV makefile not found !!)
                   1027:            AC_MSG_WARN(Disabling WebDAV build !)
                   1028:            with_dav="no"
1.90      kirschpi 1029:             DAVDIR=""
                   1030:             LIBDAV=""
                   1031:             WITHDAV="" 
                   1032:             WWWDAV="" 
1.88      kirschpi 1033:        fi
                   1034:     fi
                   1035:    
                   1036: 
1.1       cvs      1037: fi
                   1038: 
                   1039: dnl
                   1040: dnl The options for each library or binary
                   1041: dnl
                   1042: 
1.134   ! gully    1043: THOT_OPTIONS="$OS_OPTIONS $GTK_OPTIONS $GL_OPTIONS $WX_OPTIONS $NOGUI_OPTIONS"
        !          1044: AMAYA_OPTIONS="$OS_OPTIONS $MATH_OPTIONS $SVG_OPTIONS $GENERIC_XML_OPTIONS $GTK_OPTIONS $GL_OPTIONS $WX_OPTIONS $NOGUI_OPTIONS"
1.58      cvs      1045: #PLUGIN_OPTIONS="-DPLUGIN_TRACE -DXP_UNIX"
1.129     vatton   1046: AMAYA_ANNOT_OPTIONS="$OS_OPTIONS $AMAYA_ANNOT_OPTIONS"
1.101     kahan    1047: 
1.102     kahan    1048: IMGLIBS="-ljpeg -lpng -lz"
1.132     gully    1049: 
1.3       cvs      1050: EXTRA_LIBS=
1.131     gully    1051: EXTRA_INCLUDES=
                   1052: 
                   1053: # check for malloc.h
                   1054: # on macosx, this file is not at the right place
                   1055: for ac_dir in               \
                   1056:   /usr/include/malloc/      \
                   1057:   /sw/include/malloc/       \
                   1058:   ; \
                   1059: do
                   1060:   if test -r "$ac_dir/malloc.h"; then
                   1061:     echo "found malloc.h"
                   1062:     EXTRA_INCLUDES="${EXTRA_INCLUDES} -I$ac_dir"
                   1063:     break
                   1064:   fi
                   1065: done
1.1       cvs      1066: 
                   1067: dnl
                   1068: dnl Set up the PATHs needed
                   1069: dnl
                   1070: 
                   1071: API="\$(THOTDIR)/thotlib/include"
                   1072: VAR="\$(THOTDIR)/thotlib/internals/var"
                   1073: INCL="\$(THOTDIR)/thotlib/internals/h"
                   1074: FUNC="\$(THOTDIR)/thotlib/internals/f"
                   1075: 
                   1076: dnl
                   1077: dnl Set up the include variables.
                   1078: dnl
                   1079: 
1.61      cvs      1080: THOTINCLUDES="-I${API} -I${VAR} -I${INCL} -I${FUNC} ${JPEGINCL} ${PNGINCL}"
1.58      cvs      1081: APIINCLUDES=-I${API}
                   1082:  
                   1083: if test "${VPATHOPT}" = "" ; then
1.1       cvs      1084:        VPATHOPT="VPATH"
                   1085: fi
                   1086: 
                   1087: dnl
                   1088: dnl Exports the current values of the variables.
                   1089: dnl
                   1090: 
                   1091: AC_SUBST(AMAYA_VER)
1.6       cvs      1092: AC_SUBST(CEXTRACT_VER)
                   1093: AC_SUBST(CEXTRACT_FLAGS)
1.1       cvs      1094: 
                   1095: AC_SUBST(THOTINCLUDES)
                   1096: AC_SUBST(APIINCLUDES)
                   1097: AC_SUBST(VPATHOPT)
                   1098: 
1.63      vatton   1099: AC_SUBST(GTK_OPTIONS)
1.1       cvs      1100: AC_SUBST(THOT_OPTIONS)
                   1101: AC_SUBST(AMAYA_OPTIONS)
                   1102: AC_SUBST(PLUGIN_OPTIONS)
1.48      cvs      1103: AC_SUBST(AMAYA_ANNOT_OPTIONS)
1.110     kahan    1104: AC_SUBST(AMAYA_ANNOT_INCLUDES)
1.116     kahan    1105: AC_SUBST(AMAYA_ANNOT_EXTRA_LIBS)
1.1       cvs      1106: AC_SUBST(IMGLIBS)
1.3       cvs      1107: AC_SUBST(EXTRA_LIBS)
1.131     gully    1108: AC_SUBST(EXTRA_INCLUDES)
1.90      kirschpi 1109: 
                   1110: AC_SUBST(DAVDIR)
                   1111: AC_SUBST(LIBDAV)
                   1112: AC_SUBST(WITHDAV)
                   1113: AC_SUBST(WWWDAV)
1.1       cvs      1114: 
1.93      kahan    1115: AC_SUBST(MAKERAPTOR)
1.109     kahan    1116: AC_SUBST(MAKEREDLAND)
1.108     kahan    1117: AC_SUBST(ANNOTLIB_COMPILE_BM)
1.109     kahan    1118: AC_SUBST(AMAYA_RAPTOR_SRC)
1.93      kahan    1119: AC_SUBST(AMAYA_RAPTOR_LIBS)
                   1120: AC_SUBST(AMAYA_RAPTOR_INCLUDES)
                   1121: AC_SUBST(MAKE_LIBWWW_RDF_PARSER)
                   1122: AC_SUBST(LIBWWW_RDF_PARSER)
                   1123: 
                   1124: AC_SUBST(SUBDIRS)
                   1125: 
1.1       cvs      1126: dnl
1.48      cvs      1127: dnl Include the option Makefile.xxx fragment according to the configure options
1.1       cvs      1128: dnl
                   1129: 
                   1130: if test "$with_plugin" = "yes" ; then
1.50      cvs      1131:     AC_SUBST_FILE(plugin_frag)
1.1       cvs      1132:     plugin_frag=$srcdir/pluginlib/Makefile.plugin
                   1133: else
                   1134:     AC_SUBST_FILE(plugin_frag)
                   1135:     plugin_frag=/dev/null
                   1136: fi
                   1137: 
                   1138:     AC_SUBST_FILE(www_frag)
1.49      cvs      1139:     www_frag=$srcdir/amaya/Makefile.libwww
1.1       cvs      1140: 
1.50      cvs      1141: if test "$with_math" = "no" ; then
1.10      cvs      1142:     AC_SUBST_FILE(math_frag)
1.50      cvs      1143:     math_frag=/dev/null
1.8       cvs      1144: else
1.10      cvs      1145:     AC_SUBST_FILE(math_frag)
1.50      cvs      1146:     math_frag=$srcdir/amaya/Makefile.math
1.8       cvs      1147: fi
                   1148: 
1.68      vatton   1149: if test "$with_svg" = "no" ; then
                   1150:     AC_SUBST_FILE(svg_frag)
                   1151:     svg_frag=/dev/null
1.26      cvs      1152: else
1.68      vatton   1153:     AC_SUBST_FILE(svg_frag)
                   1154:     svg_frag=$srcdir/amaya/Makefile.svg
1.26      cvs      1155: fi
                   1156: 
1.47      cvs      1157: if test "$with_annot" = "yes" ; then
                   1158:     AC_SUBST_FILE(annot_frag)
1.48      cvs      1159:     annot_frag=$srcdir/annotlib/Makefile.annot
1.47      cvs      1160: else
                   1161:     AC_SUBST_FILE(annot_frag)
                   1162:     annot_frag=/dev/null
                   1163: fi
                   1164: 
1.88      kirschpi 1165: if test "$with_dav" = "yes" ; then
                   1166:     AC_SUBST_FILE(dav_frag)
                   1167:     dav_frag=$srcdir/davlib/Makefile.dav
                   1168: fi
1.16      cvs      1169: 
1.1       cvs      1170: dnl  ***************************************************************
                   1171: dnl
                   1172: dnl      FINAL STEP : PRODUCE ALL THE MAKEFILES AND CONFIG FILES
                   1173: dnl
                   1174: dnl  ***************************************************************
                   1175: 
                   1176: EXTRA_MAKEFILE_IN=
1.2       cvs      1177: make_output="Makefile Options.orig:Options.in tools/Makefile \
1.1       cvs      1178:        libjpeg/Makefile libpng/Makefile libpng/zlib/Makefile \
1.2       cvs      1179:        tools/mkdep/Makefile \
1.1       cvs      1180:        tools/cextract-1.7/Makefile thotlib/Makefile \
1.127     vatton   1181:        thotlib/include/Makefile batch/Makefile"
1.1       cvs      1182: 
                   1183: if test "$build_amaya" = "yes" ; then
1.2       cvs      1184: 
1.19      cvs      1185:     make_output="$make_output amaya/Makefile pluginlib/Makefile"
1.2       cvs      1186:     EXTRA_MAKEFILE_IN="$srcdir/amaya/Makefile.in \
1.93      kahan    1187:     $srcdir/amaya/Makefile.libwww"
1.27      cvs      1188: 
                   1189:     if test "$$with_plugin" = "yes" ; then
                   1190:        make_output="$make_output pluginlib/Makefile"
                   1191:        EXTRA_MAKEFILE_IN="$srcdir/pluginlib/Makefile.in \
1.93      kahan    1192:        $srcdir/pluginlib/Makefile.plugin"
1.27      cvs      1193:     fi
1.2       cvs      1194: 
1.48      cvs      1195:     if test "$with_annot" = "yes" ; then
                   1196:        make_output="$make_output annotlib/Makefile"
                   1197:        EXTRA_MAKEFILE_IN="$srcdir/annotlib/Makefile.in"
                   1198:     fi
1.88      kirschpi 1199: 
                   1200:     if test "$with_dav" = "yes" ; then
                   1201:        make_output="$make_output davlib/Makefile"
                   1202:        EXTRA_MAKEFILE_IN="$srcdir/davlib/Makefile.in"
                   1203:     fi
                   1204: 
1.1       cvs      1205: fi
                   1206: 
                   1207: AC_SUBST(EXTRA_MAKEFILE_IN)
1.6       cvs      1208: AC_OUTPUT($make_output , [
                   1209: dnl
                   1210: dnl This fragment of shell code is executed after the
                   1211: dnl Makefile(s) dump ...
                   1212: dnl
                   1213: 
                   1214: echo timestamp > stamp-h
                   1215: 
                   1216: dnl
                   1217: dnl Check for an upgrade in the Options numbers
                   1218: dnl
                   1219: 
                   1220: if test -f Options ; then
                   1221:    oldversion=`grep Version Options`
                   1222:    newversion=`grep Version Options.orig`
                   1223:    if test "$oldversion" != "$newversion" ; then
                   1224:        echo WARNING : Options files have changed, old options saved to Options.old
                   1225:        cp Options Options.old
                   1226:        cp Options.orig Options
                   1227:        exit 1
                   1228:    fi
                   1229: fi
                   1230: ])
1.1       cvs      1231: 
                   1232: if test "$build_amaya" = "yes" ; then
1.50      cvs      1233:     echo Amaya configured with libWWW
                   1234:     if test "$with_plugin" = "yes" ; then
                   1235:         echo Amaya configured with Plugins support
1.8       cvs      1236:     fi
1.10      cvs      1237:     if test "$with_math" = "yes" ; then
                   1238:        echo Amaya configured with Math support
1.26      cvs      1239:     fi
1.68      vatton   1240:     if test "$with_svg" = "yes" ; then
                   1241:        echo Amaya configured with SVG support
1.47      cvs      1242:     fi
                   1243:     if test "$with_annot" = "yes" ; then
                   1244:        echo Amaya configured with Annotations support
1.70      kahan    1245:     fi
1.93      kahan    1246:     if test "$with_raptor" = "yes" ; then
1.106     kahan    1247:        echo Amaya configured with the Raptor RDF parser
1.109     kahan    1248:     fi
                   1249:     if test "$with_redland" = "yes" ; then
1.116     kahan    1250:        if test "$with_system_redland" = "no" ; then
                   1251:          echo Amaya configured with the Redland RDF library \(local source\)
                   1252:        else
                   1253:          echo Amaya configured with the Redland RDF library \(system\)
                   1254:        fi
1.108     kahan    1255:     fi
                   1256:     if test "$with_bookmarks" = "yes" ; then
                   1257:        echo Amaya configured with bookmarks support \(experimental\)
1.93      kahan    1258:     fi
1.70      kahan    1259:     if test "$with_generic_xml" = "yes" ; then
                   1260:        echo Amaya configured with generic XML suppport
                   1261:     fi
1.129     vatton   1262:     echo Amaya configured with internationalization suppport
1.75      cheyroul 1263:     if test "$with_gl" = "yes" ; then
1.128     gully    1264:        echo Amaya configured with OpenGL Canvas Rendering \(experimental\)
1.88      kirschpi 1265:     fi
                   1266:     if test "$with_dav" = "yes" ; then
                   1267:        echo Amaya configured with WebDAV support \(experimental\)
1.1       cvs      1268:     fi
1.5       cvs      1269: fi
                   1270: 
1.107     kahan    1271: if test "$no_graphic" = "yes" ; then
                   1272:     echo "Amaya configured with system graphic libraries (libjpeg, libpng, zlib)"
                   1273: else
                   1274:     echo "Amaya configured with static graphic libraries (libjpeg, libpng, zlib)"
                   1275:     if test "$with_gtk" = "yes" -o "$with_gl" = "yes" ; then
                   1276:       echo "  N.B. This option may not work in your platform. If Amaya crashes"
                   1277:       echo "  when opening a PNG file. Recompile it using the system libraries."
                   1278:     fi
                   1279: fi
                   1280: 
                   1281: if test "$with_gtk" = "yes" ; then
1.67      vatton   1282:     echo "Amaya configured with GTK"
1.120     gully    1283: fi
                   1284: 
1.124     gully    1285: if test "$with_wx" = "yes" ; then
                   1286:     echo "Amaya configured with wxWindows (experimental)"
1.1       cvs      1287: fi
                   1288: 
1.121     gully    1289: if test "$with_nogui" = "yes" ; then
1.128     gully    1290:   echo "Amaya configured without GUI toolkit"
1.121     gully    1291: fi
                   1292:   
1.107     kahan    1293: echo ""
1.78      vatton   1294: echo "Now type \"make\" (GNU make preferably) to build the binaries"
1.107     kahan    1295: echo ""
1.120     gully    1296: 

Webmaster