Annotation of Amaya/configure.in, revision 1.131

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

Webmaster