Annotation of Amaya/configure.in, revision 1.125

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: 
                    362:   dnl GL is used ?
                    363:   if test "${with_gl}" == "yes" ; then
                    364:     WX_LIBRARIES="`wx-config --gl-libs`"
                    365:   else
                    366:     WX_LIBRARIES="`wx-config --libs`"
                    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.61      cvs       654: dnl Check for availability of amaya sources
1.1       cvs       655: dnl
                    656: 
                    657: build_amaya="yes"
                    658: 
                    659: if test "$with_amaya" = "no" ; then
                    660:     build_amaya="no"
1.45      cvs       661: else
                    662:   if test ! -f $srcdir/amaya/Makefile.in ; then
1.1       cvs       663:     AC_MSG_WARN(Amaya browser/editor sources not found, disabling Amaya build !)
                    664:     build_amaya="no"
1.45      cvs       665:   fi
1.1       cvs       666: fi
                    667: 
                    668: dnl
1.50      cvs       669: dnl Check for additionnal packages
1.1       cvs       670: dnl use AC_CONFIG_SUBDIRS to launch configure in the subdir
                    671: dnl
1.93      kahan     672: 
1.82      vatton    673: AC_ARG_WITH(i18n,            [  --without-i18n          disable internationalization support ])
1.76      vatton    674: dnl
                    675: dnl I18N support disabled by default
                    676: dnl
1.77      kahan     677: 
                    678: if test "$with_i18n" = "" ; then
1.82      vatton    679:   if test "$enable_i18n" = "no" ; then
                    680:     with_i18n="no"
                    681:   else
1.77      kahan     682:     with_i18n="yes"
                    683:   fi
                    684: 
                    685: fi  
1.76      vatton    686: if test "$with_i18n" = "yes" ; then
                    687:    I18N_OPTIONS=-D_I18N_
                    688: else
                    689:    with_i18n="no"
                    690:    I18N_OPTIONS=""
                    691: fi
1.1       cvs       692: 
1.75      cheyroul  693: if test "$with_gl" = "yes" ; then
                    694:        AC_MSG_CHECKING([OpenGL])
                    695:        for ac_dir in                           \
                    696:                /usr/include                    \
                    697:                /usr/X11R6/include              \
                    698:                /usr/local/include              \
                    699:                ; \
1.80      cheyroul  700:        do  if test -r "$ac_dir/GL/gl.h" ; then
1.75      cheyroul  701:                 gl_inc="yes"
1.80      cheyroul  702:                GL_INC_I="$ac_dir"
                    703:                if test "$ac_dir" != "/usr/include" ; then
                    704:                   GL_INCLUDES="-I$ac_dir"
                    705:                fi
1.96      cheyroul  706:                AC_MSG_RESULT([yes])
1.75      cheyroul  707:                        break   
                    708:            fi
1.80      cheyroul  709:        done    
                    710:        AC_MSG_CHECKING([GLU])  
1.75      cheyroul  711:        for ac_dir in                           \
                    712:                /usr/include/GL                 \
                    713:                /usr/include                    \
                    714:                /usr/X11R6/include/GL           \
                    715:                /usr/X11R6/include              \
                    716:                /usr/local/include              \
                    717:                /usr/local/include/GL           \
                    718:                ; \
                    719:        do  if test -r "$ac_dir/glu.h" ; then
                    720:                 glu_inc="yes"
1.80      cheyroul  721:                GL_INC_II="$ac_dir"
                    722:                if test "$ac_dir" != "/usr/include" ; then
                    723:                        if test "$ac_dir" != "$GL_INC_I" ; then
                    724:                            GL_INCLUDES="$GL_INCLUDES -I$ac_dir"
                    725:                        fi
                    726:                fi
1.96      cheyroul  727:                AC_MSG_RESULT([yes])
1.75      cheyroul  728:                        break   
                    729:            fi
                    730:        done    
1.80      cheyroul  731:        AC_MSG_CHECKING([GTKGLAREA])    
1.75      cheyroul  732:        for ac_dir in                           \
                    733:                /usr/include/GL                 \
                    734:                /usr/include                    \
                    735:                /usr/X11R6/include/GL           \
                    736:                /usr/X11R6/include              \
                    737:                /usr/local/include              \
                    738:                /usr/local/include/GL           \
                    739:                ; \
                    740:        do  if test -r "$ac_dir/gtkgl/gtkglarea.h" ; then
                    741:                 gtkgl_inc="yes"
1.80      cheyroul  742:                if test "$ac_dir" != "/usr/include" ; then
                    743:                        if test "$ac_dir" != "$GL_INC_II" ; then
                    744:                                if test "$ac_dir" != "$GL_INC_I" ; then
                    745:                                        GL_INCLUDES="$GL_INCLUDES -I$ac_dir"
                    746:                                fi
                    747:                        fi
                    748:                fi
1.96      cheyroul  749:                AC_MSG_RESULT([yes])
1.75      cheyroul  750:                        break   
                    751:            fi
                    752:        done    
1.80      cheyroul  753:        AC_MSG_CHECKING([freetype])     
                    754:        for ac_dir in                           \
                    755:                /usr/include                    \
                    756:                /usr/X11R6/include              \
                    757:                /usr/local/include              \
                    758:                ; \
                    759:        do  if test -r "$ac_dir/ft2build.h" ; then
                    760:                 freetype_inc="yes"
                    761:                GL_INCLUDES="$GL_INCLUDES `freetype-config --cflags`"
1.96      cheyroul  762:                        AC_MSG_RESULT([yes])    
                    763:                break   
                    764:            fi
                    765:        done    
1.104     cheyroul  766:         AC_MSG_CHECKING([Xft]) 
                    767:        for ac_dir in                           \
                    768:                /usr/include                    \
                    769:                /usr/X11R6/include              \
                    770:                /usr/local/include              \
                    771:                /usr/include/X11/Xft            \
                    772:                /usr/X11R6/include/X11/Xft      \
                    773:                /usr/local/include/X11/Xft      \
                    774:                /usr/include/X11/Xft1           \
                    775:                /usr/X11R6/include/X11/Xft1     \
1.113     vatton    776:                /usr/include/Xft2/X11/Xft/      \
1.104     cheyroul  777:                /usr/local/include/X11/Xft1     \
                    778:                /usr/include/X11/Xft2           \
                    779:                /usr/X11R6/include/X11/Xft2     \
                    780:                /usr/local/include/X11/Xft2     \
                    781:                ; \
                    782:        do  if test -r "$ac_dir/Xft.h" ; then
                    783:                 xft_inc="yes"
                    784:                GL_INCLUDES="$GL_INCLUDES -I$ac_dir"
                    785:                        AC_MSG_RESULT([yes])    
                    786:                break   
                    787:            fi
                    788:        done    
1.96      cheyroul  789:        AC_MSG_CHECKING([gcc3]) 
                    790:        for ac_dir in                           \
                    791:                /usr/lib                        \
                    792:                /usr/X11R6/lib          \
                    793:                /usr/local/lib          \
                    794:                ; \
                    795:        do  if test -r "$ac_dir/libstdc++.so.5" ; then
                    796:                 stdglu_inc="yes"
                    797:                        AC_MSG_RESULT([yes])    
                    798:                break
1.80      cheyroul  799:            fi
1.96      cheyroul  800:        done
                    801:        if test "$gl_inc" = "" ; then           
1.75      cheyroul  802:                AC_MSG_WARN(Opengl headers (gl.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
                    810:        if test "$glu_inc" = "" ; then
                    811:                AC_MSG_WARN(Glu headers (glu.h) not found !!)
                    812:                AC_MSG_WARN(Disabling opengl build !)
1.81      cheyroul  813:        
1.75      cheyroul  814:                with_gl="no"
                    815:                GL_OPTIONS=     
                    816:                GL_INCLUDES=    
                    817:                GL_LIBRARIES=
1.81      cheyroul  818:                exit 1;
1.75      cheyroul  819:        fi
                    820:        if test "$gtkgl_inc" = "" ; then
                    821:                AC_MSG_WARN(Gtkglarea headers (gktglarea.h) not found !!)
                    822:                AC_MSG_WARN(Disabling opengl build !)
                    823:                with_gl="no"
                    824:                GL_OPTIONS=     
                    825:                GL_INCLUDES=    
                    826:                GL_LIBRARIES=
1.81      cheyroul  827:                exit 1;
1.75      cheyroul  828:        fi
1.80      cheyroul  829:        if test "$freetype_inc" = "" ; then
                    830:                AC_MSG_WARN(Freetype 2 headers (ft2build.h) not found !!)
                    831:                AC_MSG_WARN(Disabling opengl build !)
                    832:                with_gl="no"
                    833:                GL_OPTIONS=     
                    834:                GL_INCLUDES=
                    835:                GL_LIBRARIES=
1.81      cheyroul  836:                exit 1;
1.80      cheyroul  837:        fi
1.104     cheyroul  838:        if test "$xft_inc" = "" ; then
                    839:                AC_MSG_WARN(Xft 2 headers (Xft.h) not found !!)
                    840:                AC_MSG_WARN(Disabling opengl build !)
                    841:                with_gl="no"
                    842:                GL_OPTIONS=     
                    843:                GL_INCLUDES=
                    844:                GL_LIBRARIES=
                    845:                exit 1;
                    846:        fi
1.75      cheyroul  847:        if test "$gl_inc" = "yes" ; then
1.79      cheyroul  848:                if test "$glu_inc" = "yes" ; then
                    849:                        if test "$gtkgl_inc" = "yes" ; then
1.96      cheyroul  850:                            if test "$freetype_inc" = "yes" ; then
1.104     cheyroul  851:                                if test "$xft_inc" = "yes" ; then
                    852:                                        if test "$stdglu_inc" = "yes" ; then
1.113     vatton    853:                                           GL_LIBRARIES="-L/usr/lib -L/usr/X11R6/lib  -lXmu -lXft -lfreetype -lGL -lGLU -lgtkgl -lstdc++"
1.104     cheyroul  854:                                        else
1.113     vatton    855:                                           GL_LIBRARIES="-L/usr/lib -L/usr/X11R6/lib  -lXmu -lXft -lfreetype -lGL -lGLU -lgtkgl"
1.104     cheyroul  856:                                        fi                              
                    857:                                        GL_OPTIONS="-D_GL"
                    858:                                        no_motif=yes
                    859:                                fi
1.80      cheyroul  860:                            fi
1.75      cheyroul  861:                        fi
                    862:                fi
                    863:        fi
                    864: AC_SUBST(GL_INCLUDES)
                    865: AC_SUBST(GL_LIBRARIES)
1.115     cheyroul  866: dnl PRINTIFNOTGL=" "
                    867: dnl #NOPRINT="#"
                    868: NOPRINT=""
                    869: PRINTIFNOTGL=" print_prog"
1.97      cheyroul  870: else
1.112     cheyroul  871: NOPRINT=""
1.97      cheyroul  872: PRINTIFNOTGL=" print_prog"
1.75      cheyroul  873: fi
1.97      cheyroul  874: AC_SUBST(PRINTIFNOTGL)
1.112     cheyroul  875: AC_SUBST(NOPRINT)
                    876: 
1.76      vatton    877: 
                    878: AC_ARG_ENABLE(svg,           [  --disable-svg           remove SVG support ])
                    879: AC_ARG_ENABLE(annot,         [  --disable-annot         remove Annotations support ])
1.93      kahan     880: AC_ARG_ENABLE(raptor,        [  --disable-raptor        disable the raptor RDF parser ])
1.116     kahan     881: AC_ARG_ENABLE(redland,       [  --enable-redland        enable the redland RDF library ])
                    882: AC_ARG_ENABLE(system-redland,       [  --enable-system-redland try the redland RDF system library ])
1.108     kahan     883: AC_ARG_ENABLE(bookmarks,     [  --enable-bookmarks      enables experimental bookmark support ])
1.76      vatton    884: AC_ARG_ENABLE(generic-xml,   [  --disable-generic-xml   remove Generic XML support ])
                    885: 
1.75      cheyroul  886: dnl
1.21      cvs       887: dnl plugins support is disabled by default
1.8       cvs       888: dnl
1.13      cvs       889: 
                    890: if test "$with_plugin" = "" ; then
1.21      cvs       891:   if test "$enable_plugin" = "yes" ; then
1.55      kahan     892:     with_plugin="yes"
1.21      cvs       893:   else
1.17      cvs       894:     with_plugin="no"
                    895:   fi
1.10      cvs       896: fi  
1.1       cvs       897: 
1.8       cvs       898: dnl
1.68      vatton    899: dnl svg is enabled by default
1.26      cvs       900: dnl
1.68      vatton    901: if test "$with_svg" = "" ; then
                    902:     if test "$enable_svg" = "no" ; then
                    903:        with_svg="no"
1.49      cvs       904:     else
1.68      vatton    905:        with_svg="yes"
1.26      cvs       906:     fi
                    907: fi
                    908: 
                    909: dnl
1.56      kahan     910: dnl annotations is enabled by default
1.47      cvs       911: dnl
                    912: if test "$with_annot" = "" ; then
1.56      kahan     913:     if test "$enable_annot" = "no" ; then
                    914:        with_annot="no"
                    915:     else
1.54      cvs       916:        with_annot="yes"
1.47      cvs       917:     fi
1.99      kahan     918: else
                    919:     with_annot="yes"
1.47      cvs       920: fi
                    921: 
1.93      kahan     922: 
                    923: dnl
                    924: dnl The raptor RDF parser is enabled by default
                    925: dnl
                    926: if test "$with_raptor" = "" ; then
                    927:     if test "$enable_raptor" = "no" ; then
                    928:        with_raptor="no"
                    929:     else
1.99      kahan     930:        with_raptor="yes"
1.93      kahan     931:     fi
1.99      kahan     932: else
                    933:     with_raptor="yes"
1.93      kahan     934: fi
                    935: 
1.70      kahan     936: dnl
1.116     kahan     937: dnl The redland library is disabled by default
1.109     kahan     938: dnl
                    939: if test "$with_redland" = "" ; then
                    940:     if test "$enable_redland" = "yes" ; then
                    941:        with_redland="yes"
                    942:     else
                    943:        with_redland="no"
                    944:     fi
                    945: else
                    946:     with_redland="no"
                    947: fi
                    948: 
                    949: dnl
1.116     kahan     950: dnl The redland library is disabled by default
                    951: dnl
                    952: if test "$with_system_redland" = "" ; then
                    953:     if test "$enable_system_redland" = "yes" ; then
                    954:        with_redland="yes"
                    955:        with_system_redland="yes"
                    956:     else
                    957:        with_system_redland="no"
                    958:     fi
                    959: else
                    960:     with_system_redland="no"
                    961: fi
                    962: 
                    963: dnl
                    964: dnl The bookmarks support is disabled by default
1.108     kahan     965: dnl
                    966: if test "$with_bookmarks" = "" ; then
                    967:     if test "$enable_bookmarks" = "yes" ; then
                    968:        with_bookmarks="yes"
1.125   ! vatton    969:        with_redland="yes"
1.108     kahan     970:     else
                    971:        with_bookmarks="no"
                    972:     fi
                    973: else
                    974:     with_bookmarks="no"
                    975: fi
                    976: 
                    977: dnl
1.70      kahan     978: dnl Generic XML support enabled by default
                    979: dnl
                    980: if test "$with_generic_xml" = "" ; then
                    981:     if test "$enable_generic_xml" = "no" ; then
                    982:        with_generic_xml="no"
                    983:        GENERIC_XML_OPTIONS=
                    984:     else
                    985:        with_generic_xml="yes"
                    986:        GENERIC_XML_OPTIONS=-DXML_GENERIC
                    987:     fi
                    988: fi
                    989: 
1.120     gully     990: AC_ARG_WITH(dav,            [  --with-dav              enable WebDAV support (experimental) ])
1.88      kirschpi  991: dnl
                    992: dnl DAV support disabled by default
                    993: dnl
                    994: if test "$with_dav" = "" ; then
                    995:   if test "$enable_dav" = "yes" ; then
                    996:     with_dav="yes"
                    997:   else
                    998:     with_dav="no"
                    999:   fi
                   1000: fi  
                   1001: 
                   1002: if test "$with_dav" = "yes" ; then
                   1003:    DAV_OPTIONS=-DDAV
1.90      kirschpi 1004:    DAVDIR="davlib"
                   1005:    LIBDAV="libwwwdav"
                   1006:    WITHDAV="--with-dav" 
                   1007:    WWWDAV="-lwwwdav" 
1.88      kirschpi 1008: else
                   1009:    with_dav="no"
                   1010:    DAV_OPTIONS=""
1.90      kirschpi 1011:    DAVDIR=""
                   1012:    LIBDAV=""
                   1013:    WITHDAV="" 
                   1014:    WWWDAV="" 
1.88      kirschpi 1015: fi
                   1016: 
1.70      kahan    1017: 
1.19      cvs      1018: if test "$build_amaya" = "yes" ; then
1.43      cvs      1019:     if test ! -f $srcdir/../libwww/Makefile.in ; then
1.50      cvs      1020:        AC_MSG_WARN(libwww sources not found !!)
                   1021:        AC_MSG_WARN(Disabling Amaya build !)
                   1022:        build_amaya="no"
1.1       cvs      1023:     fi
1.8       cvs      1024: 
                   1025:     if test ! -f $srcdir/amaya/MathML.S ; then
1.10      cvs      1026:        if test "$with_math" = "yes" ; then
1.8       cvs      1027:            AC_MSG_WARN(MathML sources not found !!)
1.26      cvs      1028:            AC_MSG_WARN(Disabling Math build !)
1.10      cvs      1029:            with_math="no"
                   1030:            MATH_OPTIONS=
1.8       cvs      1031:        fi
                   1032:     fi
1.26      cvs      1033: 
1.68      vatton   1034:     if test ! -f $srcdir/amaya/SVG.S ; then
                   1035:        if test "$with_svg" = "yes" ; then
                   1036:            AC_MSG_WARN(SVG sources not found !!)
                   1037:            AC_MSG_WARN(Disabling SVG build !)
                   1038:            with_svg="no"
                   1039:            SVG_OPTIONS=
1.26      cvs      1040:        fi
                   1041:     fi
                   1042: 
1.48      cvs      1043:     if test ! -f $srcdir/annotlib/Makefile.in ; then
1.47      cvs      1044:        if test "$with_annot" = "yes" ; then
                   1045:            AC_MSG_WARN(Annotation makefile not found !!)
                   1046:            AC_MSG_WARN(Disabling Annotations build !)
                   1047:            with_annot="no"
                   1048:        fi
                   1049:     fi
1.55      kahan    1050: 
1.109     kahan    1051:     if test "$with_raptor" = "yes" -a "$with_redland" = "yes" ; then
                   1052:        AC_MSG_WARN(Disabling raptor build as redland is enabled !)
                   1053:        MAKERAPTOR=['#']
                   1054:        with_raptor="no"
                   1055:     fi
                   1056: 
1.108     kahan    1057:     if test "$with_raptor" = "yes" -a "$with_annot" = "no" ; then
1.93      kahan    1058:        AC_MSG_WARN(Disabling raptor build as annotations are disabled !)
                   1059:        MAKERAPTOR=['#']
                   1060:        with_raptor="no"
                   1061:     fi
                   1062: 
1.108     kahan    1063:     if test "$with_raptor" = "yes" -a ! -d "$srcdir/libraptor" ; then
                   1064:        AC_MSG_WARN(Raptor source dir not found !!)
                   1065:        AC_MSG_WARN(Disabling raptor build !)
                   1066:        MAKERAPTOR=['#']
                   1067:        with_raptor="no"
1.109     kahan    1068:     fi
                   1069: 
                   1070:     if test "$with_raptor" = "yes" ; then
1.108     kahan    1071:        AMAYA_ANNOT_OPTIONS="$AMAYA_ANNOT_OPTIONS -DRAPTOR_RDF_PARSER -I\$(THOTDIR)/libraptor"
                   1072:        AMAYA_RAPTOR_LIBS="../libraptor/.libs/libraptor.a"
                   1073:        AMAYA_RAPTOR_SRC="amaya_comp_libraptor"
                   1074:        AMAYA_RAPTOR_INCLUDES="-I\$(THOTDIR)/libraptor"
                   1075:     fi
                   1076: 
1.109     kahan    1077:     if test "$with_redland" = "yes" -a "$with_annot" = "no" ; then
                   1078:        AC_MSG_WARN(Disabling redland build as annotations are disabled !)
                   1079:        MAKEREDLAND=['#']
                   1080:        with_redland="no"
                   1081:     fi
                   1082: 
1.116     kahan    1083:     redland_compile_source=yes
                   1084:     if test "$with_redland" = "yes" -a "$with_system_redland" = "yes" ; then
                   1085:        # check to see if we have a redland library
                   1086:        AC_MSG_CHECKING(system redland library)
1.118     kahan    1087:        redland_min_version=0.9.14
1.116     kahan    1088:        REDLAND_CONFIG="redland-config"
                   1089:        REDLAND_VERSION=`$REDLAND_CONFIG --version`
                   1090:        redland_version_dec=`echo $REDLAND_VERSION | awk -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'`
                   1091:        redland_min_version_dec=`echo $redland_min_version | awk -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'`
                   1092:        if test $redland_version_dec -lt $redland_min_version_dec; then
                   1093:          AC_MSG_RESULT(no - found version $REDLAND_VERSION and minimal version is $redland_min_version)
                   1094:        else
                   1095:          AC_MSG_RESULT(yes - found version $REDLAND_VERSION)
                   1096:         AC_MSG_CHECKING(checking for redland headers)
1.117     kahan    1097:         dnl  We should use awk here and remove the -I from the following line
                   1098:          dnl REDLAND_HEADERS=`$REDLAND_CONFIG --cflags`
                   1099:         REDLAND_HEADERS=""
                   1100:         if test -e "/usr/include/redland.h" ; then
                   1101:           REDLAND_HEADERS="/usr/include";
                   1102:         else 
                   1103:            if test -e "/usr/local/include/redland.h" ; then
                   1104:             REDLAND_HEADERS="/usr/local/include";
                   1105:            fi
                   1106:          fi        
                   1107:         if test $REDLAND_HEADERS != ""; then
1.116     kahan    1108:            AC_MSG_RESULT(yes - have development version)
                   1109:            redland_compile_source=no
                   1110:         else
                   1111:            AC_MSG_RESULT(no - no development version)
                   1112:          fi
                   1113:        fi
                   1114:     fi
                   1115: 
                   1116:     if test "$with_redland" = "yes" -a "$redland_compile_source" = "yes" \
                   1117:        -a ! -d "$srcdir/../redland" ; then
1.109     kahan    1118:        AC_MSG_WARN(Redland source dir not found !!)
                   1119:        AC_MSG_WARN(Disabling redland build !)
                   1120:        MAKEREDLAND=['#']
                   1121:        with_redland="no"
                   1122:     fi
                   1123: 
                   1124:     if test "$with_redland" = "yes" ; then
1.116     kahan    1125:        AMAYA_ANNOT_OPTIONS="$AMAYA_ANNOT_OPTIONS -DLIBRDF_INTERNAL=1 -DAM_REDLAND -DRAPTOR_RDF_PARSER"
                   1126:        if test "$redland_compile_source" = "yes" ; then
                   1127:          AMAYA_RAPTOR_SRC="amaya_comp_redland"
                   1128:          AMAYA_ANNOT_OPTIONS="$AMAYA_ANNOT_OPTIONS -I\$(THOTDIR)/../redland/librdf -I\$(THOTDIR)/../redland/raptor"
                   1129:          AMAYA_RAPTOR_LIBS="../redland/librdf/.libs/librdf.a ../redland/raptor/.libs/libraptor.a"
                   1130:          AMAYA_RAPTOR_INCLUDES="-I\$(THOTDIR)/../redland/librdf -I\$(THOTDIR)/../redland/raptor"
                   1131:        else
                   1132:          MAKEREDLAND=['#']
                   1133:         AMAYA_RAPTOR_SRC=
                   1134:         redland_includes=`$REDLAND_CONFIG --cflags`
                   1135:         redland_libs=`$REDLAND_CONFIG --libs`
                   1136:          AMAYA_ANNOT_OPTIONS="$AMAYA_ANNOT_OPTIONS"
                   1137:          AMAYA_ANNOT_INCLUDES="$redland_includes -I\$(THOTDIR)/thotlib/include"
                   1138:          AMAYA_ANNOT_EXTRA_LIBS="$redland_libs"
                   1139:          AMAYA_RAPTOR_INCLUDES="$redland_includes"
                   1140:        fi
1.109     kahan    1141:     fi
                   1142: 
1.116     kahan    1143: 
1.108     kahan    1144:     dnl control whether we should build the bookmarks support
                   1145:     if test "$with_bookmarks" = "yes" -a "$with_annot" = "no" ; then
                   1146:        AC_MSG_WARN(Disabling bookmarks build as annotations are disabled !)
                   1147:        with_bookmarks="no"
                   1148:     fi
1.109     kahan    1149:     if test "$with_bookmarks" = "yes" -a "$with_redland" = "no" ; then
                   1150:        AC_MSG_WARN(Disabling bookmarks build as redland is disabled !)
1.108     kahan    1151:        with_bookmarks="no"
                   1152:     fi
                   1153:     if test "$with_bookmarks" = "yes" ; then
                   1154:        ANNOTLIB_COMPILE_BM=
                   1155:        AMAYA_ANNOT_OPTIONS="$AMAYA_ANNOT_OPTIONS -DBOOKMARKS"
                   1156:     else
                   1157:        ANNOTLIB_COMPILE_BM=['#']
                   1158:     fi
                   1159: 
1.93      kahan    1160:     dnl control whether we should use libwww's rdf parser
1.109     kahan    1161:     if test "$with_raptor" = "yes" -o "$with_redland" = "yes"; then
1.93      kahan    1162:        dnl not all the function calls have been cleared as of today, 
                   1163:        dnl we still need libwww's rdf parser 
1.98      kahan    1164:        MAKE_LIBWWW_RDF_PARSER=
                   1165:        LIBWWW_RDF_PARSER=
1.93      kahan    1166:     else
                   1167:        MAKE_LIBWWW_RDF_PARSER="libwwwxml"
                   1168:        LIBWWW_RDF_PARSER="-lwwwxml"
                   1169:     fi
1.70      kahan    1170: 
1.55      kahan    1171:     if test "$with_plugin" = "yes" ; then
                   1172:         AC_MSG_WARN(The plugin library isn't supported anymore in Amaya !!)
                   1173:        AC_MSG_WARN(Disabling plugin build !)
                   1174:        with_plugin="no"
                   1175:     fi
                   1176: 
1.88      kirschpi 1177: 
                   1178:     if test ! -f $srcdir/davlib/Makefile.in ; then
                   1179:        if test "$with_dav" = "yes" ; then
                   1180:            AC_MSG_WARN(WebDAV makefile not found !!)
                   1181:            AC_MSG_WARN(Disabling WebDAV build !)
                   1182:            with_dav="no"
1.90      kirschpi 1183:             DAVDIR=""
                   1184:             LIBDAV=""
                   1185:             WITHDAV="" 
                   1186:             WWWDAV="" 
1.88      kirschpi 1187:        fi
                   1188:     fi
                   1189:    
                   1190: 
1.1       cvs      1191: fi
                   1192: 
                   1193: dnl
                   1194: dnl The options for each library or binary
                   1195: dnl
                   1196: 
1.124     gully    1197: THOT_OPTIONS="$I18N_OPTIONS $MOTIF_OPTIONS $GTK_OPTIONS $GL_OPTIONS $WX_OPTIONS $NOGUI_OPTIONS"
                   1198: AMAYA_OPTIONS="$MATH_OPTIONS $SVG_OPTIONS $GENERIC_XML_OPTIONS $I18N_OPTIONS $MOTIF_OPTIONS $GTK_OPTIONS $GL_OPTIONS $WX_OPTIONS $NOGUI_OPTIONS"
1.58      cvs      1199: #PLUGIN_OPTIONS="-DPLUGIN_TRACE -DXP_UNIX"
1.123     gully    1200: AMAYA_ANNOT_OPTIONS="$AMAYA_ANNOT_OPTIONS $I18N_OPTIONS"
1.101     kahan    1201: 
1.102     kahan    1202: IMGLIBS="-ljpeg -lpng -lz"
1.3       cvs      1203: EXTRA_LIBS=
1.1       cvs      1204: 
                   1205: dnl
                   1206: dnl Set up the PATHs needed
                   1207: dnl
                   1208: 
                   1209: API="\$(THOTDIR)/thotlib/include"
                   1210: VAR="\$(THOTDIR)/thotlib/internals/var"
                   1211: INCL="\$(THOTDIR)/thotlib/internals/h"
                   1212: FUNC="\$(THOTDIR)/thotlib/internals/f"
                   1213: 
                   1214: dnl
                   1215: dnl Set up the include variables.
                   1216: dnl
                   1217: 
1.61      cvs      1218: THOTINCLUDES="-I${API} -I${VAR} -I${INCL} -I${FUNC} ${JPEGINCL} ${PNGINCL}"
1.58      cvs      1219: APIINCLUDES=-I${API}
                   1220:  
                   1221: if test "${VPATHOPT}" = "" ; then
1.1       cvs      1222:        VPATHOPT="VPATH"
                   1223: fi
                   1224: 
                   1225: dnl
                   1226: dnl Exports the current values of the variables.
                   1227: dnl
                   1228: 
                   1229: AC_SUBST(AMAYA_VER)
1.6       cvs      1230: AC_SUBST(CEXTRACT_VER)
                   1231: AC_SUBST(CEXTRACT_FLAGS)
1.1       cvs      1232: 
                   1233: AC_SUBST(THOTINCLUDES)
                   1234: AC_SUBST(APIINCLUDES)
                   1235: AC_SUBST(VPATHOPT)
                   1236: 
1.63      vatton   1237: AC_SUBST(GTK_OPTIONS)
1.1       cvs      1238: AC_SUBST(THOT_OPTIONS)
                   1239: AC_SUBST(AMAYA_OPTIONS)
                   1240: AC_SUBST(PLUGIN_OPTIONS)
1.48      cvs      1241: AC_SUBST(AMAYA_ANNOT_OPTIONS)
1.110     kahan    1242: AC_SUBST(AMAYA_ANNOT_INCLUDES)
1.116     kahan    1243: AC_SUBST(AMAYA_ANNOT_EXTRA_LIBS)
1.1       cvs      1244: AC_SUBST(IMGLIBS)
1.3       cvs      1245: AC_SUBST(EXTRA_LIBS)
1.90      kirschpi 1246: 
                   1247: AC_SUBST(DAVDIR)
                   1248: AC_SUBST(LIBDAV)
                   1249: AC_SUBST(WITHDAV)
                   1250: AC_SUBST(WWWDAV)
1.1       cvs      1251: 
1.93      kahan    1252: AC_SUBST(MAKERAPTOR)
1.109     kahan    1253: AC_SUBST(MAKEREDLAND)
1.108     kahan    1254: AC_SUBST(ANNOTLIB_COMPILE_BM)
1.109     kahan    1255: AC_SUBST(AMAYA_RAPTOR_SRC)
1.93      kahan    1256: AC_SUBST(AMAYA_RAPTOR_LIBS)
                   1257: AC_SUBST(AMAYA_RAPTOR_INCLUDES)
                   1258: AC_SUBST(MAKE_LIBWWW_RDF_PARSER)
                   1259: AC_SUBST(LIBWWW_RDF_PARSER)
                   1260: 
                   1261: AC_SUBST(SUBDIRS)
                   1262: 
1.1       cvs      1263: dnl
1.48      cvs      1264: dnl Include the option Makefile.xxx fragment according to the configure options
1.1       cvs      1265: dnl
                   1266: 
                   1267: if test "$with_plugin" = "yes" ; then
1.50      cvs      1268:     AC_SUBST_FILE(plugin_frag)
1.1       cvs      1269:     plugin_frag=$srcdir/pluginlib/Makefile.plugin
                   1270: else
                   1271:     AC_SUBST_FILE(plugin_frag)
                   1272:     plugin_frag=/dev/null
                   1273: fi
                   1274: 
                   1275:     AC_SUBST_FILE(www_frag)
1.49      cvs      1276:     www_frag=$srcdir/amaya/Makefile.libwww
1.1       cvs      1277: 
1.50      cvs      1278: if test "$with_math" = "no" ; then
1.10      cvs      1279:     AC_SUBST_FILE(math_frag)
1.50      cvs      1280:     math_frag=/dev/null
1.8       cvs      1281: else
1.10      cvs      1282:     AC_SUBST_FILE(math_frag)
1.50      cvs      1283:     math_frag=$srcdir/amaya/Makefile.math
1.8       cvs      1284: fi
                   1285: 
1.68      vatton   1286: if test "$with_svg" = "no" ; then
                   1287:     AC_SUBST_FILE(svg_frag)
                   1288:     svg_frag=/dev/null
1.26      cvs      1289: else
1.68      vatton   1290:     AC_SUBST_FILE(svg_frag)
                   1291:     svg_frag=$srcdir/amaya/Makefile.svg
1.26      cvs      1292: fi
                   1293: 
1.47      cvs      1294: if test "$with_annot" = "yes" ; then
                   1295:     AC_SUBST_FILE(annot_frag)
1.48      cvs      1296:     annot_frag=$srcdir/annotlib/Makefile.annot
1.47      cvs      1297: else
                   1298:     AC_SUBST_FILE(annot_frag)
                   1299:     annot_frag=/dev/null
                   1300: fi
                   1301: 
1.88      kirschpi 1302: if test "$with_dav" = "yes" ; then
                   1303:     AC_SUBST_FILE(dav_frag)
                   1304:     dav_frag=$srcdir/davlib/Makefile.dav
                   1305: fi
1.16      cvs      1306: 
1.1       cvs      1307: dnl  ***************************************************************
                   1308: dnl
                   1309: dnl      FINAL STEP : PRODUCE ALL THE MAKEFILES AND CONFIG FILES
                   1310: dnl
                   1311: dnl  ***************************************************************
                   1312: 
                   1313: EXTRA_MAKEFILE_IN=
1.2       cvs      1314: make_output="Makefile Options.orig:Options.in tools/Makefile \
1.1       cvs      1315:        libjpeg/Makefile libpng/Makefile libpng/zlib/Makefile \
1.2       cvs      1316:        tools/mkdep/Makefile \
1.1       cvs      1317:        tools/cextract-1.7/Makefile thotlib/Makefile \
1.5       cvs      1318:        thotlib/include/Makefile batch/Makefile tablelib/Makefile"
1.1       cvs      1319: 
                   1320: if test "$build_amaya" = "yes" ; then
1.2       cvs      1321: 
1.19      cvs      1322:     make_output="$make_output amaya/Makefile pluginlib/Makefile"
1.2       cvs      1323:     EXTRA_MAKEFILE_IN="$srcdir/amaya/Makefile.in \
1.93      kahan    1324:     $srcdir/amaya/Makefile.libwww"
1.27      cvs      1325: 
                   1326:     if test "$$with_plugin" = "yes" ; then
                   1327:        make_output="$make_output pluginlib/Makefile"
                   1328:        EXTRA_MAKEFILE_IN="$srcdir/pluginlib/Makefile.in \
1.93      kahan    1329:        $srcdir/pluginlib/Makefile.plugin"
1.27      cvs      1330:     fi
1.2       cvs      1331: 
1.48      cvs      1332:     if test "$with_annot" = "yes" ; then
                   1333:        make_output="$make_output annotlib/Makefile"
                   1334:        EXTRA_MAKEFILE_IN="$srcdir/annotlib/Makefile.in"
                   1335:     fi
1.88      kirschpi 1336: 
                   1337:     if test "$with_dav" = "yes" ; then
                   1338:        make_output="$make_output davlib/Makefile"
                   1339:        EXTRA_MAKEFILE_IN="$srcdir/davlib/Makefile.in"
                   1340:     fi
                   1341: 
1.1       cvs      1342: fi
                   1343: 
                   1344: AC_SUBST(EXTRA_MAKEFILE_IN)
1.6       cvs      1345: AC_OUTPUT($make_output , [
                   1346: dnl
                   1347: dnl This fragment of shell code is executed after the
                   1348: dnl Makefile(s) dump ...
                   1349: dnl
                   1350: 
                   1351: echo timestamp > stamp-h
                   1352: 
                   1353: dnl
                   1354: dnl Check for an upgrade in the Options numbers
                   1355: dnl
                   1356: 
                   1357: if test -f Options ; then
                   1358:    oldversion=`grep Version Options`
                   1359:    newversion=`grep Version Options.orig`
                   1360:    if test "$oldversion" != "$newversion" ; then
                   1361:        echo WARNING : Options files have changed, old options saved to Options.old
                   1362:        cp Options Options.old
                   1363:        cp Options.orig Options
                   1364:        exit 1
                   1365:    fi
                   1366: fi
                   1367: ])
1.1       cvs      1368: 
                   1369: if test "$build_amaya" = "yes" ; then
1.50      cvs      1370:     echo Amaya configured with libWWW
                   1371:     if test "$with_plugin" = "yes" ; then
                   1372:         echo Amaya configured with Plugins support
1.8       cvs      1373:     fi
1.10      cvs      1374:     if test "$with_math" = "yes" ; then
                   1375:        echo Amaya configured with Math support
1.26      cvs      1376:     fi
1.68      vatton   1377:     if test "$with_svg" = "yes" ; then
                   1378:        echo Amaya configured with SVG support
1.47      cvs      1379:     fi
                   1380:     if test "$with_annot" = "yes" ; then
                   1381:        echo Amaya configured with Annotations support
1.70      kahan    1382:     fi
1.93      kahan    1383:     if test "$with_raptor" = "yes" ; then
1.106     kahan    1384:        echo Amaya configured with the Raptor RDF parser
1.109     kahan    1385:     fi
                   1386:     if test "$with_redland" = "yes" ; then
1.116     kahan    1387:        if test "$with_system_redland" = "no" ; then
                   1388:          echo Amaya configured with the Redland RDF library \(local source\)
                   1389:        else
                   1390:          echo Amaya configured with the Redland RDF library \(system\)
                   1391:        fi
1.108     kahan    1392:     fi
                   1393:     if test "$with_bookmarks" = "yes" ; then
                   1394:        echo Amaya configured with bookmarks support \(experimental\)
1.93      kahan    1395:     fi
1.70      kahan    1396:     if test "$with_generic_xml" = "yes" ; then
                   1397:        echo Amaya configured with generic XML suppport
                   1398:     fi
                   1399:     if test "$with_i18n" = "yes" ; then
1.82      vatton   1400:        echo Amaya configured with internationalization suppport
1.75      cheyroul 1401:     fi 
                   1402:     if test "$with_gl" = "yes" ; then
                   1403:        echo Amaya configured with Opengl Canvas Rendering \(experimental\)
1.88      kirschpi 1404:     fi
                   1405:     if test "$with_dav" = "yes" ; then
                   1406:        echo Amaya configured with WebDAV support \(experimental\)
1.1       cvs      1407:     fi
1.5       cvs      1408: fi
                   1409: 
1.107     kahan    1410: if test "$no_graphic" = "yes" ; then
                   1411:     echo "Amaya configured with system graphic libraries (libjpeg, libpng, zlib)"
                   1412: else
                   1413:     echo "Amaya configured with static graphic libraries (libjpeg, libpng, zlib)"
                   1414:     if test "$with_gtk" = "yes" -o "$with_gl" = "yes" ; then
                   1415:       echo "  N.B. This option may not work in your platform. If Amaya crashes"
                   1416:       echo "  when opening a PNG file. Recompile it using the system libraries."
                   1417:     fi
                   1418: fi
                   1419: 
                   1420: if test "$with_gtk" = "yes" ; then
1.67      vatton   1421:     echo "Amaya configured with GTK"
1.120     gully    1422: fi
                   1423: 
                   1424: if test "$with_motif" = "yes" ; then
1.107     kahan    1425:   if test "$no_motif" = "yes" ; then
1.120     gully    1426:       echo "Motif seems not installed on this machine"
                   1427:       echo "Amaya need Motif 1.2 or 2.0"
1.105     vatton   1428:   else
                   1429:     if test "$motif_includes" = "" ; then
                   1430:       echo "Motif includes were not found"
                   1431:       echo "Amaya might not compile"
                   1432:       echo "Edit your Option file"
                   1433:     else
                   1434:       if test "$motif_libraries" = "" ; then
                   1435:         echo "Motif libraries were not found"
                   1436:         echo "Amaya might not compile"
                   1437:         echo "Edit your Option file"
1.120     gully    1438:       else
                   1439:         echo "Amaya configured with MOTIF"
1.105     vatton   1440:       fi
                   1441:     fi
                   1442:   fi
1.124     gully    1443: fi
                   1444: 
                   1445: if test "$with_wx" = "yes" ; then
                   1446:     echo "Amaya configured with wxWindows (experimental)"
1.1       cvs      1447: fi
                   1448: 
1.121     gully    1449: if test "$with_nogui" = "yes" ; then
                   1450:   echo "Amaya configured with no GUI toolkit"
                   1451: fi
                   1452:   
1.107     kahan    1453: echo ""
1.78      vatton   1454: echo "Now type \"make\" (GNU make preferably) to build the binaries"
1.107     kahan    1455: echo ""
1.120     gully    1456: 

Webmaster