Annotation of Amaya/configure.in, revision 1.139

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

Webmaster