Annotation of Amaya/configure.in, revision 1.121

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

Webmaster