Annotation of Amaya/configure.in, revision 1.128

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

Webmaster