Annotation of Amaya/configure.in, revision 1.77

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: 
                     13: AC_PREREQ(2.2)
                     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
                    179: 
                    180: dnl
                    181: dnl Checks for typedefs, structures, and compiler characteristics.
                    182: dnl
                    183: 
                    184: AC_C_CONST
                    185: AC_C_INLINE
                    186: AC_TYPE_MODE_T
                    187: AC_TYPE_OFF_T
                    188: AC_TYPE_SIZE_T
                    189: AC_HEADER_TIME
                    190: AC_STRUCT_TM
                    191: AC_STRUCT_TIMEZONE
                    192: AC_TYPE_UID_T
                    193: 
                    194: dnl
                    195: dnl Checks for library functions.
                    196: dnl
                    197: 
                    198: AC_FUNC_ALLOCA
                    199: AC_TYPE_GETGROUPS
                    200: AC_PROG_GCC_TRADITIONAL
                    201: AC_FUNC_MEMCMP
                    202: AC_FUNC_MMAP
                    203: AC_TYPE_SIGNAL
                    204: AC_FUNC_VPRINTF
1.58      cvs       205: 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       206: 
1.75      cheyroul  207: 
1.63      vatton    208: GTK_OPTIONS=
                    209: AC_ARG_WITH(gtk, [  --with-gtk              use GTK instead of Motif])
                    210: if test "$withval" = "yes" ; then
                    211:   for ac_dir in               \
1.65      cvs       212:     /usr/lib/glib/include     \
1.63      vatton    213:     /usr/X11R6/include        \
                    214:                               \
                    215:     /usr/include/X11R6        \
                    216:     /usr/local/X11R6/include  \
                    217:     /usr/local/include/X11R6  \
                    218:                               \
                    219:     /usr/X11/include          \
                    220:     /usr/include/X11          \
                    221:     /usr/local/X11/include    \
                    222:     /usr/local/include/X11    \
                    223:                               \
                    224:     /usr/X386/include         \
                    225:     /usr/x386/include         \
                    226:     /usr/XFree86/include/X11  \
                    227:     /usr/dt/include           \
                    228:     /usr/include              \
                    229:     /usr/local/include        \
                    230:     /usr/local/lib/glib/include  \
                    231:     ; \
                    232:   do
                    233:     if test -r "$ac_dir/gdk/gdk.h"; then
                    234:       no_gtk= ac_gtk_includes=$ac_dir
                    235:       break
                    236:     fi
                    237:   done
                    238: 
1.65      cvs       239: GTK_INCLUDES="`gtk-config --cflags`"
1.63      vatton    240: AC_SUBST(GTK_INCLUDES)
1.65      cvs       241: GTK_LIBRARIES="`gtk-config --libs` -lgdk_imlib -ltiff -lgif"
1.63      vatton    242: AC_SUBST(GTK_LIBRARIES)
1.65      cvs       243: GTK_OPTIONS=-D_GTK
1.63      vatton    244:   no_motif=yes
1.76      vatton    245:   no_graphic=yes
1.63      vatton    246: else
1.5       cvs       247: dnl
1.4       cvs       248: dnl Checking for Motif libraries and includes
                    249: dnl
                    250: dnl Borrowed from Lesstif configure.in
                    251: dnl Lesstif is a Great Project (TM)
                    252: dnl
                    253: 
                    254: AC_DEFUN(AC_PATH_MOTIF_DIRECT,
                    255: [test -z "$motif_direct_test_library" && motif_direct_test_library=Xm
                    256: test -z "$motif_direct_test_function" && motif_direct_test_function=XmCreatePushButton
                    257: test -z "$motif_direct_test_include" && motif_direct_test_include=Xm/Xm.h
                    258:   for ac_dir in               \
                    259:     /usr/include/Motif1.2     \
                    260:     /usr/Motif1.2/include     \
1.71      vatton    261:     /sw/Lesstif/Motif2.0/include \
1.4       cvs       262:                               \
                    263:     /usr/motif/include        \
                    264:                               \
                    265:     /usr/X11R6/include        \
                    266:     /usr/X11R5/include        \
                    267:                               \
                    268:     /usr/include/X11R6        \
                    269:     /usr/include/X11R5        \
                    270:                               \
                    271:     /usr/local/X11R6/include  \
                    272:     /usr/local/X11R5/include  \
                    273:                               \
                    274:     /usr/local/include/X11R6  \
                    275:     /usr/local/include/X11R5  \
                    276:                               \
                    277:     /usr/X11/include          \
                    278:     /usr/include/X11          \
                    279:     /usr/local/X11/include    \
                    280:     /usr/local/include/X11    \
                    281:                               \
                    282:     /usr/X386/include         \
                    283:     /usr/x386/include         \
                    284:     /usr/XFree86/include/X11  \
                    285:                               \
                    286:     /usr/dt/include           \
                    287:                               \
                    288:     /usr/include              \
                    289:     /usr/local/include        \
                    290:     /usr/unsupported/include  \
                    291:     /usr/athena/include       \
                    292:     /usr/local/x11r5/include  \
                    293:     /usr/lpp/Xamples/include  \
1.14      cvs       294:                               \
                    295:     /usr/lesstif/include      \
                    296:     /usr/local/lesstif/include\
                    297:     /usr/gnu/lesstif/include  \
                    298:     $HOME/lesstif/include     \
1.4       cvs       299:     ; \
                    300:   do
                    301:     if test -r "$ac_dir/$motif_direct_test_include"; then
                    302:       no_motif= ac_motif_includes=$ac_dir
                    303:       break
                    304:     fi
                    305:   done
                    306: 
                    307: # Check for the libraries.
                    308: # See if we find them without any special options.
                    309: # Don't add to $LIBS permanently.
                    310: ac_save_LIBS="$LIBS"
                    311: LIBS="-l$motif_direct_test_library $LIBS"
                    312: # First see if replacing the include by lib works.
                    313: for ac_dir in `echo "$ac_motif_includes" | sed s/include/lib/` \
                    314:     /usr/lib/Motif1.2     \
                    315:     /usr/Motif1.2/lib     \
1.71      vatton    316:     /sw/Lesstif/Motif2.0/lib \
1.4       cvs       317:                           \
                    318:     /usr/motif/lib        \
                    319:                           \
                    320:     /usr/X11R6/lib        \
                    321:     /usr/X11R5/lib        \
                    322:                           \
                    323:     /usr/lib/X11R6        \
                    324:     /usr/lib/X11R5        \
                    325:                           \
                    326:     /usr/local/X11R6/lib  \
                    327:     /usr/local/X11R5/lib  \
                    328:                           \
                    329:     /usr/local/lib/X11R6  \
                    330:     /usr/local/lib/X11R5  \
                    331:                           \
                    332:     /usr/X11/lib          \
                    333:     /usr/lib/X11          \
                    334:     /usr/local/X11/lib    \
                    335:                           \
                    336:     /usr/X386/lib         \
                    337:     /usr/x386/lib         \
                    338:     /usr/XFree86/lib/X11  \
                    339:                           \
                    340:     /usr/lib              \
                    341:     /usr/local/lib        \
                    342:     /usr/unsupported/lib  \
                    343:     /usr/athena/lib       \
                    344:     /usr/local/x11r5/lib  \
                    345:     /usr/lpp/Xamples/lib  \
1.14      cvs       346:                           \
                    347:     /usr/lesstif/lib      \
                    348:     /usr/local/lesstif/lib\
                    349:     /usr/gnu/lesstif/lib  \
                    350:     $HOME/lesstif/lib     \
1.4       cvs       351:     ; \
                    352: do
1.71      vatton    353:   for ac_extension in a so sl la; do
1.4       cvs       354:     if test -r $ac_dir/lib${motif_direct_test_library}.$ac_extension; then
                    355:       no_motif= ac_motif_libraries=$ac_dir
                    356:       break 2
                    357:     fi
                    358:   done
1.5       cvs       359: done
                    360: LIBS="$ac_save_LIBS"
                    361: ])
1.4       cvs       362: 
                    363: AC_DEFUN(AC_PATH_MOTIF,
1.66      vatton    364: [AC_REQUIRE_CPP()
1.4       cvs       365: 
                    366: motif_includes=NONE
                    367: motif_libraries=NONE
                    368: 
                    369: AC_MSG_CHECKING(for Motif)
1.63      vatton    370: if test "x$motif_includes" != xNONE && test "x$motif_libraries" != xNONE; then
                    371:     no_motif=
1.4       cvs       372: else
                    373: AC_CACHE_VAL(ac_cv_path_motif,
                    374: [# One or both of these vars are not set, and there is no cached value.
1.63      vatton    375:   no_motif=yes
1.4       cvs       376: AC_PATH_MOTIF_DIRECT
                    377: 
                    378: if test "$no_motif" = yes; then
1.63      vatton    379:     ac_cv_path_motif="no_motif=yes"
1.4       cvs       380: else
1.63      vatton    381:     ac_cv_path_motif="no_motif= ac_motif_includes=$ac_motif_includes ac_motif_libraries=$ac_motif_libraries"
1.66      vatton    382: fi])
                    383: eval "$ac_cv_path_motif"
1.63      vatton    384: fi
1.4       cvs       385: 
                    386: if test "$no_motif" = yes; then
                    387:   AC_MSG_RESULT(no)
1.5       cvs       388:   MOTIF_INCLUDES=
                    389:   MOTIF_LIBRARIES=
1.4       cvs       390: else
                    391:   test "x$motif_includes" = xNONE && motif_includes=$ac_motif_includes
                    392:   test "x$motif_libraries" = xNONE && motif_libraries=$ac_motif_libraries
                    393:   ac_cv_path_motif="no_motif= ac_motif_includes=$motif_includes ac_motif_libraries=$motif_libraries"
                    394:   AC_MSG_RESULT([libraries $motif_libraries, headers $motif_includes])
1.5       cvs       395:   if test "$motif_includes" != "/usr/include" ; then
                    396:     MOTIF_INCLUDES="-I$motif_includes"
                    397:   fi
                    398:   if test "$motif_libraries" != "/usr/lib" ; then
1.64      cvs       399:     MOTIF_LIBRARIES="-L$motif_libraries -lXm"
1.19      cvs       400:     case "${host}" in
                    401:         *-*sun-solaris* )
                    402:          MOTIF_LIBRARIES="${MOTIF_LIBRARIES} -R$motif_libraries"
                    403:         ;;
1.65      cvs       404:     esac
                    405:   else
                    406:   MOTIF_LIBRARIES="-lXm"
1.5       cvs       407:   fi
1.4       cvs       408: fi
1.5       cvs       409: AC_SUBST(MOTIF_INCLUDES)
                    410: AC_SUBST(MOTIF_LIBRARIES)
1.4       cvs       411: ])
                    412: 
                    413: AC_PATH_MOTIF
1.66      vatton    414: fi
1.4       cvs       415: 
1.63      vatton    416: if test "${GCC}" = "yes"; then
                    417:    CPP="${CPP} -x c"
                    418: fi
                    419: 
1.1       cvs       420: dnl  ***************************************************************
                    421: dnl
1.61      cvs       422: dnl    SPECIFIC STUFF : CONFIGURATION OPTIONS FOR AMAYA
1.1       cvs       423: dnl
                    424: dnl  ***************************************************************
                    425: 
1.76      vatton    426: AC_ARG_WITH(graphic-libs, [  --without-graphic-libs    doesn't use provided libjpeg, libpng.])
                    427: if test "$withval" = "no" ; then
                    428:   no_graphic = yes
                    429: else
                    430:   no_graphic =
                    431: fi
                    432: 
                    433: if test "$no_graphic" = yes; then
                    434: dnl
                    435:     AC_MSG_CHECKING([for libjpeg version = 6b])
                    436:     AC_EGREP_CPP([x 62 *x],
                    437:         [#include <jpeglib.h>
                    438:          x JPEG_LIB_VERSION x],
                    439: dnl
                    440:         AC_MSG_RESULT([yes])
                    441:         LIBJPEG='-ljpeg'
                    442:         MAKEJPEG=['#'],
                    443: dnl
                    444:         AC_MSG_RESULT([no])
                    445:         LIBJPEG='../libjpeg.a'      dnl LIBJPEG goes into amaya/Makefile.in
                    446:         )
                    447: dnl    
                    448: dnl
                    449:     AC_MSG_CHECKING([for libpng version = 1.0.x])
                    450:     AC_EGREP_CPP([x \"1.0\..*\" *x],
                    451:         [#include <png.h>
                    452:        x PNG_LIBPNG_VER_STRING x],
                    453: dnl
                    454:         AC_MSG_RESULT([yes])
                    455:         LIBPNG='-lpng'
                    456:         LIBZ=''
                    457:        MAKEPNG=['#'],
                    458: dnl
                    459:         AC_MSG_RESULT([no])
                    460:         LIBPNG='../libpng.a'
                    461:         LIBZ='../libz.a'
                    462:         )
                    463: else
                    464:     LIBJPEG='../libjpeg.a'
                    465:     LIBPNG='../libpng.a'
                    466:     LIBZ='../libz.a'
                    467: fi
                    468: dnl
                    469: AC_SUBST(LIBJPEG)
                    470: AC_SUBST(LIBPNG)
                    471: AC_SUBST(LIBZ)
                    472: AC_SUBST(MAKEJPEG)
                    473: AC_SUBST(MAKEPNG)
                    474: 
1.68      vatton    475: AMAYA_VER="6.0"
1.1       cvs       476: 
                    477: dnl
1.6       cvs       478: dnl We use a special versoin of cextract patched for alignment
                    479: dnl to build the signatures of the modules functions located in f subdirs
                    480: dnl
                    481: CEXTRACT_VER="1.7"
                    482: CEXTRACT_FLAGS="+O"
                    483: 
1.3       cvs       484: 
                    485: dnl
1.9       cvs       486: dnl Adjust the some variables depending on the host and compiler
1.61      cvs       487: dnl Thotlib NEED signed chars !!!
1.7       cvs       488: dnl
                    489: 
                    490: if test "${CC}" = "gcc" ; then
1.44      cvs       491:   CFLAGS="${CFLAGS} -W "
1.7       cvs       492:   case "${host}" in
                    493:       *-*-irix5* | *-*irix6* )
                    494:          CFLAGS="${CFLAGS} -fsigned-char"
                    495:       ;;
                    496:   esac
1.14      cvs       497: fi
                    498: 
                    499: if test "$ac_cv_c_const" = "no" ; then
                    500:   CFLAGS="${CFLAGS} -DCONST= "
1.7       cvs       501: fi
                    502: 
                    503: dnl
1.61      cvs       504: dnl Check for availability of amaya sources
1.1       cvs       505: dnl
                    506: 
                    507: build_amaya="yes"
                    508: 
                    509: if test "$with_amaya" = "no" ; then
                    510:     build_amaya="no"
1.45      cvs       511: else
                    512:   if test ! -f $srcdir/amaya/Makefile.in ; then
1.1       cvs       513:     AC_MSG_WARN(Amaya browser/editor sources not found, disabling Amaya build !)
                    514:     build_amaya="no"
1.45      cvs       515:   fi
1.1       cvs       516: fi
                    517: 
                    518: dnl
1.50      cvs       519: dnl Check for additionnal packages
1.1       cvs       520: dnl use AC_CONFIG_SUBDIRS to launch configure in the subdir
                    521: dnl
1.77    ! kahan     522: AC_ARG_WITH(i18n,            [  --with-i18n             enable I18N support (experimental) ])
1.76      vatton    523: dnl
                    524: dnl I18N support disabled by default
                    525: dnl
1.77    ! kahan     526: 
        !           527: if test "$with_i18n" = "" ; then
        !           528:   if test "$enable_i18n" = "yes" ; then
        !           529:     with_i18n="yes"
        !           530:   else
        !           531:     with_i18n="no"
        !           532:   fi
        !           533: 
        !           534: fi  
1.76      vatton    535: if test "$with_i18n" = "yes" ; then
                    536:    I18N_OPTIONS=-D_I18N_
                    537: else
                    538:    with_i18n="no"
                    539:    I18N_OPTIONS=""
                    540: fi
1.1       cvs       541: 
1.76      vatton    542: AC_ARG_WITH(GL,              [  --with-gl               enable Opengl canvas (experimental) ])
1.8       cvs       543: dnl
1.75      cheyroul  544: dnl GL canvas is disabled by default
                    545: dnl
                    546: dnl needs Opengl, glut, glu, 
                    547: dnl needs GTK
                    548: dnl text WILL need freetype2, ftgl
                    549: dnl GL is for opengl
                    550: dnl Xmu is for a linking in Glut
                    551: dnl Glu is for text drawing (until we switch) 
                    552: dnl GLU is for tesselation algortihms (until we extract it from this lib)
                    553: dnl (tesselation is used for polygons with holes in it...)
                    554: dnl gtkgl is for integration of opengl in GTK
                    555: if test "$with_gl" = "" ; then
                    556:  if test "$enable_gl" = "yes" ; then
                    557:     with_gl="yes"
                    558:   else
                    559:     with_gl="no"
                    560:   fi
                    561: fi  
                    562: if test "$with_gl" = "yes" ; then
                    563:        AC_MSG_CHECKING([OpenGL])
                    564:        for ac_dir in                           \
                    565:                /usr/include/GL                 \
                    566:                /usr/include                    \
                    567:                /usr/X11R6/include/GL           \
                    568:                /usr/X11R6/include              \
                    569:                /usr/local/include              \
                    570:                /usr/local/include/GL           \
                    571:                ; \
                    572:        do  if test -r "$ac_dir/gl.h" ; then
                    573:                 gl_inc="yes"
                    574:                        break   
                    575:            fi
                    576:        done    
                    577:        for ac_dir in                           \
                    578:                /usr/include/GL                 \
                    579:                /usr/include                    \
                    580:                /usr/X11R6/include/GL           \
                    581:                /usr/X11R6/include              \
                    582:                /usr/local/include              \
                    583:                /usr/local/include/GL           \
                    584:                ; \
                    585:        do  if test -r "$ac_dir/glut.h" ; then
                    586:                 glut_inc="yes"
                    587:                        break   
                    588:            fi
                    589:        done    
                    590:        for ac_dir in                           \
                    591:                /usr/include/GL                 \
                    592:                /usr/include                    \
                    593:                /usr/X11R6/include/GL           \
                    594:                /usr/X11R6/include              \
                    595:                /usr/local/include              \
                    596:                /usr/local/include/GL           \
                    597:                ; \
                    598:        do  if test -r "$ac_dir/glu.h" ; then
                    599:                 glu_inc="yes"
                    600:                        break   
                    601:            fi
                    602:        done    
                    603:        for ac_dir in                           \
                    604:                /usr/include/GL                 \
                    605:                /usr/include                    \
                    606:                /usr/X11R6/include/GL           \
                    607:                /usr/X11R6/include              \
                    608:                /usr/local/include              \
                    609:                /usr/local/include/GL           \
                    610:                ; \
                    611:        do  if test -r "$ac_dir/gtkgl/gtkglarea.h" ; then
                    612:                 gtkgl_inc="yes"
                    613:                        break   
                    614:            fi
                    615:        done    
                    616:        if test "$gl_inc" = "" ; then
                    617:                AC_MSG_WARN(Opengl headers (gl.h) not found !!)
                    618:                AC_MSG_WARN(Disabling opengl build !)
                    619:                with_gl="no"
                    620:                GL_OPTIONS=     
                    621:                GL_INCLUDES=    
                    622:                GL_LIBRARIES=
                    623:        fi
                    624:        if test "$glut_inc" = "" ; then
                    625:                AC_MSG_WARN(Glut headers (glut.h) not found !!)
                    626:                AC_MSG_WARN(Disabling opengl build !)
                    627:                with_gl="no"
                    628:                GL_OPTIONS=     
                    629:                GL_INCLUDES=    
                    630:                GL_LIBRARIES=
                    631:        fi
                    632:        if test "$glu_inc" = "" ; then
                    633:                AC_MSG_WARN(Glu headers (glu.h) not found !!)
                    634:                AC_MSG_WARN(Disabling opengl build !)
                    635:                with_gl="no"
                    636:                GL_OPTIONS=     
                    637:                GL_INCLUDES=    
                    638:                GL_LIBRARIES=
                    639:        fi
                    640:        if test "$gtkgl_inc" = "" ; then
                    641:                AC_MSG_WARN(Gtkglarea headers (gktglarea.h) not found !!)
                    642:                AC_MSG_WARN(Disabling opengl build !)
                    643:                with_gl="no"
                    644:                GL_OPTIONS=     
                    645:                GL_INCLUDES=    
                    646:                GL_LIBRARIES=
                    647:        fi
                    648:        if test "$gl_inc" = "yes" ; then
                    649:                if test "$glut_inc" = "yes" ; then
                    650:                        if test "$glu_inc" = "yes" ; then
                    651:                                if test "$gtkgl_inc" = "yes" ; then
                    652:                                        GL_INCLUDES="-I$ac_dir "
                    653:                                        GL_LIBRARIES=" -lXmu  -lGL -lglut -lGLU -lgtkgl "
                    654:                                        GL_OPTIONS=-D_GL 
                    655:                                        no_motif=yes
                    656:                                fi
                    657:                        fi
                    658:                fi
                    659:        fi
                    660: AC_SUBST(GL_INCLUDES)
                    661: AC_SUBST(GL_LIBRARIES)
                    662: fi
1.76      vatton    663: 
                    664: AC_ARG_ENABLE(svg,           [  --disable-svg           remove SVG support ])
                    665: AC_ARG_ENABLE(annot,         [  --disable-annot         remove Annotations support ])
                    666: AC_ARG_ENABLE(generic-xml,   [  --disable-generic-xml   remove Generic XML support ])
                    667: AC_ARG_ENABLE(annot-threads, [  --disable-annot-threads remove annotation threads ])
                    668: 
1.75      cheyroul  669: dnl
1.21      cvs       670: dnl plugins support is disabled by default
1.8       cvs       671: dnl
1.13      cvs       672: 
                    673: if test "$with_plugin" = "" ; then
1.21      cvs       674:   if test "$enable_plugin" = "yes" ; then
1.55      kahan     675:     with_plugin="yes"
1.21      cvs       676:   else
1.17      cvs       677:     with_plugin="no"
                    678:   fi
1.10      cvs       679: fi  
1.1       cvs       680: 
1.8       cvs       681: dnl
1.68      vatton    682: dnl svg is enabled by default
1.26      cvs       683: dnl
1.68      vatton    684: if test "$with_svg" = "" ; then
                    685:     if test "$enable_svg" = "no" ; then
                    686:        with_svg="no"
1.49      cvs       687:     else
1.68      vatton    688:        with_svg="yes"
1.26      cvs       689:     fi
                    690: fi
                    691: 
                    692: dnl
1.56      kahan     693: dnl annotations is enabled by default
1.47      cvs       694: dnl
                    695: if test "$with_annot" = "" ; then
1.56      kahan     696:     if test "$enable_annot" = "no" ; then
                    697:        with_annot="no"
                    698:     else
1.54      cvs       699:        with_annot="yes"
1.47      cvs       700:     fi
                    701: fi
                    702: 
1.70      kahan     703: dnl
                    704: dnl Generic XML support enabled by default
                    705: dnl
                    706: if test "$with_generic_xml" = "" ; then
                    707:     if test "$enable_generic_xml" = "no" ; then
                    708:        with_generic_xml="no"
                    709:        GENERIC_XML_OPTIONS=
                    710:     else
                    711:        with_generic_xml="yes"
                    712:        GENERIC_XML_OPTIONS=-DXML_GENERIC
                    713:     fi
                    714: fi
                    715: 
                    716: dnl
1.73      kahan     717: dnl Annotation thread support enabled by default
1.70      kahan     718: dnl
                    719: if test "$with_annot_threads" = "" ; then
1.73      kahan     720:     if test "$enable_annot_threads" = "no" ; then
                    721:        with_annot_threads="no"
1.74      kahan     722:        ANNOT_THREAD_OPTIONS=
1.70      kahan     723:     else
1.73      kahan     724:        with_annot_threads="yes"
1.74      kahan     725:        ANNOT_THREAD_OPTIONS=-DANNOT_ON_ANNOT 
1.70      kahan     726:     fi
                    727: fi
                    728: 
1.19      cvs       729: if test "$build_amaya" = "yes" ; then
1.43      cvs       730:     if test ! -f $srcdir/../libwww/Makefile.in ; then
1.50      cvs       731:        AC_MSG_WARN(libwww sources not found !!)
                    732:        AC_MSG_WARN(Disabling Amaya build !)
                    733:        build_amaya="no"
1.1       cvs       734:     fi
1.8       cvs       735: 
                    736:     if test ! -f $srcdir/amaya/MathML.S ; then
1.10      cvs       737:        if test "$with_math" = "yes" ; then
1.8       cvs       738:            AC_MSG_WARN(MathML sources not found !!)
1.26      cvs       739:            AC_MSG_WARN(Disabling Math build !)
1.10      cvs       740:            with_math="no"
                    741:            MATH_OPTIONS=
1.8       cvs       742:        fi
                    743:     fi
1.26      cvs       744: 
1.68      vatton    745:     if test ! -f $srcdir/amaya/SVG.S ; then
                    746:        if test "$with_svg" = "yes" ; then
                    747:            AC_MSG_WARN(SVG sources not found !!)
                    748:            AC_MSG_WARN(Disabling SVG build !)
                    749:            with_svg="no"
                    750:            SVG_OPTIONS=
1.26      cvs       751:        fi
                    752:     fi
                    753: 
1.48      cvs       754:     if test ! -f $srcdir/annotlib/Makefile.in ; then
1.47      cvs       755:        if test "$with_annot" = "yes" ; then
                    756:            AC_MSG_WARN(Annotation makefile not found !!)
                    757:            AC_MSG_WARN(Disabling Annotations build !)
                    758:            with_annot="no"
                    759:        fi
                    760:     fi
1.55      kahan     761: 
1.70      kahan     762:     if test "$with_annot" = "no" -a "$with_annot_threads" = "yes" ; then
                    763:        AC_MSG_WARN(You must select the annotation support to have threads)
                    764:        AC_MSG_WARN(Disabling annotation thread support)
                    765:        with_annot_threads="no"
                    766:        ANNOT_THREAD_OPTIONS=
                    767:     fi
                    768: 
1.55      kahan     769:     if test "$with_plugin" = "yes" ; then
                    770:         AC_MSG_WARN(The plugin library isn't supported anymore in Amaya !!)
                    771:        AC_MSG_WARN(Disabling plugin build !)
                    772:        with_plugin="no"
                    773:     fi
                    774: 
1.1       cvs       775: fi
                    776: 
                    777: dnl
                    778: dnl The options for each library or binary
                    779: dnl
                    780: 
1.75      cheyroul  781: THOT_OPTIONS="$GTK_OPTIONS $I18N_OPTIONS $GL_OPTIONS"
                    782: AMAYA_OPTIONS="$MATH_OPTIONS $SVG_OPTIONS $GTK_OPTIONS $GENERIC_XML_OPTIONS $I18N_OPTIONS $ANNOT_THREAD_OPTIONS $GL_OPTIONS"
1.58      cvs       783: #PLUGIN_OPTIONS="-DPLUGIN_TRACE -DXP_UNIX"
1.70      kahan     784: AMAYA_ANNOT_OPTIONS="$ANNOT_THREAD_OPTIONS"
1.1       cvs       785: IMGLIBS="-ljpeg -lpng -lz"
1.3       cvs       786: EXTRA_LIBS=
1.1       cvs       787: 
                    788: dnl
                    789: dnl Set up the PATHs needed
                    790: dnl
                    791: 
                    792: API="\$(THOTDIR)/thotlib/include"
                    793: VAR="\$(THOTDIR)/thotlib/internals/var"
                    794: INCL="\$(THOTDIR)/thotlib/internals/h"
                    795: FUNC="\$(THOTDIR)/thotlib/internals/f"
1.58      cvs       796: if test "${LIBPNG}" = "../libpng.a" ; then
1.52      cvs       797: #there is a modified header file we need
1.1       cvs       798: PNGINCL="-I\$(THOTDIR)/libpng -I\$(THOTDIR)/libpng/zlib"
1.58      cvs       799: fi
                    800: if test "${LIBJPEG}" = "../libjpeg.a" ; then
                    801: #there is a modified header file we need
                    802: JPEGINCL="-I\$(THOTDIR)/libjpeg"
                    803: fi
1.1       cvs       804: 
                    805: dnl
                    806: dnl Set up the include variables.
                    807: dnl
                    808: 
1.61      cvs       809: THOTINCLUDES="-I${API} -I${VAR} -I${INCL} -I${FUNC} ${JPEGINCL} ${PNGINCL}"
1.58      cvs       810: APIINCLUDES=-I${API}
                    811:  
                    812: if test "${VPATHOPT}" = "" ; then
1.1       cvs       813:        VPATHOPT="VPATH"
                    814: fi
                    815: 
                    816: dnl
                    817: dnl Exports the current values of the variables.
                    818: dnl
                    819: 
                    820: AC_SUBST(AMAYA_VER)
1.6       cvs       821: AC_SUBST(CEXTRACT_VER)
                    822: AC_SUBST(CEXTRACT_FLAGS)
1.1       cvs       823: 
                    824: AC_SUBST(THOTINCLUDES)
                    825: AC_SUBST(APIINCLUDES)
                    826: AC_SUBST(VPATHOPT)
                    827: 
1.63      vatton    828: AC_SUBST(GTK_OPTIONS)
1.1       cvs       829: AC_SUBST(THOT_OPTIONS)
                    830: AC_SUBST(AMAYA_OPTIONS)
                    831: AC_SUBST(PLUGIN_OPTIONS)
1.48      cvs       832: AC_SUBST(AMAYA_ANNOT_OPTIONS)
1.1       cvs       833: AC_SUBST(IMGLIBS)
1.3       cvs       834: AC_SUBST(EXTRA_LIBS)
1.1       cvs       835: 
                    836: dnl
1.48      cvs       837: dnl Include the option Makefile.xxx fragment according to the configure options
1.1       cvs       838: dnl
                    839: 
                    840: if test "$with_plugin" = "yes" ; then
1.50      cvs       841:     AC_SUBST_FILE(plugin_frag)
1.1       cvs       842:     plugin_frag=$srcdir/pluginlib/Makefile.plugin
                    843: else
                    844:     AC_SUBST_FILE(plugin_frag)
                    845:     plugin_frag=/dev/null
                    846: fi
                    847: 
                    848:     AC_SUBST_FILE(www_frag)
1.49      cvs       849:     www_frag=$srcdir/amaya/Makefile.libwww
1.1       cvs       850: 
1.50      cvs       851: if test "$with_math" = "no" ; then
1.10      cvs       852:     AC_SUBST_FILE(math_frag)
1.50      cvs       853:     math_frag=/dev/null
1.8       cvs       854: else
1.10      cvs       855:     AC_SUBST_FILE(math_frag)
1.50      cvs       856:     math_frag=$srcdir/amaya/Makefile.math
1.8       cvs       857: fi
                    858: 
1.68      vatton    859: if test "$with_svg" = "no" ; then
                    860:     AC_SUBST_FILE(svg_frag)
                    861:     svg_frag=/dev/null
1.26      cvs       862: else
1.68      vatton    863:     AC_SUBST_FILE(svg_frag)
                    864:     svg_frag=$srcdir/amaya/Makefile.svg
1.26      cvs       865: fi
                    866: 
1.47      cvs       867: if test "$with_annot" = "yes" ; then
                    868:     AC_SUBST_FILE(annot_frag)
1.48      cvs       869:     annot_frag=$srcdir/annotlib/Makefile.annot
1.47      cvs       870: else
                    871:     AC_SUBST_FILE(annot_frag)
                    872:     annot_frag=/dev/null
                    873: fi
                    874: 
1.16      cvs       875: 
1.1       cvs       876: dnl  ***************************************************************
                    877: dnl
                    878: dnl      FINAL STEP : PRODUCE ALL THE MAKEFILES AND CONFIG FILES
                    879: dnl
                    880: dnl  ***************************************************************
                    881: 
                    882: EXTRA_MAKEFILE_IN=
1.2       cvs       883: make_output="Makefile Options.orig:Options.in tools/Makefile \
1.1       cvs       884:        libjpeg/Makefile libpng/Makefile libpng/zlib/Makefile \
1.2       cvs       885:        tools/mkdep/Makefile \
1.1       cvs       886:        tools/cextract-1.7/Makefile thotlib/Makefile \
1.5       cvs       887:        thotlib/include/Makefile batch/Makefile tablelib/Makefile"
1.1       cvs       888: 
                    889: if test "$build_amaya" = "yes" ; then
1.2       cvs       890: 
1.19      cvs       891:     make_output="$make_output amaya/Makefile pluginlib/Makefile"
1.2       cvs       892:     EXTRA_MAKEFILE_IN="$srcdir/amaya/Makefile.in \
1.27      cvs       893: $srcdir/amaya/Makefile.libwww"
                    894: 
                    895:     if test "$$with_plugin" = "yes" ; then
                    896:        make_output="$make_output pluginlib/Makefile"
                    897:        EXTRA_MAKEFILE_IN="$srcdir/pluginlib/Makefile.in \
1.2       cvs       898: $srcdir/pluginlib/Makefile.plugin"
1.27      cvs       899:     fi
1.2       cvs       900: 
1.48      cvs       901:     if test "$with_annot" = "yes" ; then
                    902:        make_output="$make_output annotlib/Makefile"
                    903:        EXTRA_MAKEFILE_IN="$srcdir/annotlib/Makefile.in"
                    904:     fi
1.1       cvs       905: fi
                    906: 
                    907: AC_SUBST(EXTRA_MAKEFILE_IN)
1.6       cvs       908: AC_OUTPUT($make_output , [
                    909: dnl
                    910: dnl This fragment of shell code is executed after the
                    911: dnl Makefile(s) dump ...
                    912: dnl
                    913: 
                    914: echo timestamp > stamp-h
                    915: 
                    916: dnl
                    917: dnl Check for an upgrade in the Options numbers
                    918: dnl
                    919: 
                    920: if test -f Options ; then
                    921:    oldversion=`grep Version Options`
                    922:    newversion=`grep Version Options.orig`
                    923:    if test "$oldversion" != "$newversion" ; then
                    924:        echo WARNING : Options files have changed, old options saved to Options.old
                    925:        cp Options Options.old
                    926:        cp Options.orig Options
                    927:        exit 1
                    928:    fi
                    929: fi
                    930: ])
1.1       cvs       931: 
                    932: if test "$build_amaya" = "yes" ; then
1.50      cvs       933:     echo Amaya configured with libWWW
                    934:     if test "$with_plugin" = "yes" ; then
                    935:         echo Amaya configured with Plugins support
1.8       cvs       936:     fi
1.10      cvs       937:     if test "$with_math" = "yes" ; then
                    938:        echo Amaya configured with Math support
1.26      cvs       939:     fi
1.68      vatton    940:     if test "$with_svg" = "yes" ; then
                    941:        echo Amaya configured with SVG support
1.47      cvs       942:     fi
                    943:     if test "$with_annot" = "yes" ; then
                    944:        echo Amaya configured with Annotations support
1.70      kahan     945:     fi
                    946:     if test "$with_annot_threads" = "yes" ; then
                    947:        echo Amaya configured with Annotation threads support
                    948:     fi
                    949:     if test "$with_generic_xml" = "yes" ; then
                    950:        echo Amaya configured with generic XML suppport
                    951:     fi
                    952:     if test "$with_i18n" = "yes" ; then
                    953:        echo Amaya configured with I18N suppport \(experimental\)
1.75      cheyroul  954:     fi 
                    955:     if test "$with_gl" = "yes" ; then
                    956:        echo Amaya configured with Opengl Canvas Rendering \(experimental\)
1.1       cvs       957:     fi
1.5       cvs       958: fi
                    959: 
                    960: if test "$no_motif" = yes ; then
1.67      vatton    961:     echo "Amaya configured with GTK"
1.76      vatton    962:     echo "Amaya configured without static graphic libraries (libjpeg, libpng)"
1.67      vatton    963: else
1.76      vatton    964: if test "$no_motif" = yes ; then
                    965:     echo "Amaya configured without static graphic libraries (libjpeg, libpng)"
                    966: fi
1.67      vatton    967: if test "$no_motif" = yes ; then
1.5       cvs       968:     echo "Motif seems not installed on this machine"
1.61      cvs       969:     echo "Amaya need Motif 1.2 or 2.0"
1.5       cvs       970: else
                    971: if test "$motif_includes" = "" ; then
                    972:     echo "Motif includes were not found"
1.61      cvs       973:     echo "Amaya might not compile"
1.5       cvs       974:     echo "Edit your Option file"
                    975: else
                    976: if test "$motif_libraries" = "" ; then
                    977:     echo "Motif libraries were not found"
1.61      cvs       978:     echo "Amaya might not compile"
1.5       cvs       979:     echo "Edit your Option file"
1.67      vatton    980: fi
1.5       cvs       981: fi
                    982: fi
1.1       cvs       983: fi
                    984: 
1.69      kahan     985: echo "Now type \"make all\" (GNU make preferably) to build the binaries"
1.48      cvs       986: 
                    987: 
                    988: 
1.5       cvs       989: 

Webmaster