Annotation of Amaya/configure.in, revision 1.81

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
1.79      cheyroul  546: dnl needs Opengl, glu, Xft (xfree 4 font server)
1.75      cheyroul  547: dnl needs GTK
                    548: dnl text WILL need freetype2, ftgl
                    549: dnl GL is for opengl
                    550: dnl Glu is for text drawing (until we switch) 
                    551: dnl GLU is for tesselation algortihms (until we extract it from this lib)
                    552: dnl (tesselation is used for polygons with holes in it...)
                    553: dnl gtkgl is for integration of opengl in GTK
                    554: if test "$with_gl" = "" ; then
                    555:  if test "$enable_gl" = "yes" ; then
                    556:     with_gl="yes"
                    557:   else
                    558:     with_gl="no"
                    559:   fi
                    560: fi  
                    561: if test "$with_gl" = "yes" ; then
                    562:        AC_MSG_CHECKING([OpenGL])
                    563:        for ac_dir in                           \
                    564:                /usr/include                    \
                    565:                /usr/X11R6/include              \
                    566:                /usr/local/include              \
                    567:                ; \
1.80      cheyroul  568:        do  if test -r "$ac_dir/GL/gl.h" ; then
1.75      cheyroul  569:                 gl_inc="yes"
1.80      cheyroul  570:                GL_INC_I="$ac_dir"
                    571:                if test "$ac_dir" != "/usr/include" ; then
                    572:                   GL_INCLUDES="-I$ac_dir"
                    573:                fi
1.75      cheyroul  574:                        break   
                    575:            fi
1.80      cheyroul  576:        done    
                    577:        AC_MSG_CHECKING([GLU])  
1.75      cheyroul  578:        for ac_dir in                           \
                    579:                /usr/include/GL                 \
                    580:                /usr/include                    \
                    581:                /usr/X11R6/include/GL           \
                    582:                /usr/X11R6/include              \
                    583:                /usr/local/include              \
                    584:                /usr/local/include/GL           \
                    585:                ; \
                    586:        do  if test -r "$ac_dir/glu.h" ; then
                    587:                 glu_inc="yes"
1.80      cheyroul  588:                GL_INC_II="$ac_dir"
                    589:                if test "$ac_dir" != "/usr/include" ; then
                    590:                        if test "$ac_dir" != "$GL_INC_I" ; then
                    591:                            GL_INCLUDES="$GL_INCLUDES -I$ac_dir"
                    592:                        fi
                    593:                fi
1.75      cheyroul  594:                        break   
                    595:            fi
                    596:        done    
1.80      cheyroul  597:        AC_MSG_CHECKING([GTKGLAREA])    
1.75      cheyroul  598:        for ac_dir in                           \
                    599:                /usr/include/GL                 \
                    600:                /usr/include                    \
                    601:                /usr/X11R6/include/GL           \
                    602:                /usr/X11R6/include              \
                    603:                /usr/local/include              \
                    604:                /usr/local/include/GL           \
                    605:                ; \
                    606:        do  if test -r "$ac_dir/gtkgl/gtkglarea.h" ; then
                    607:                 gtkgl_inc="yes"
1.80      cheyroul  608:                if test "$ac_dir" != "/usr/include" ; then
                    609:                        if test "$ac_dir" != "$GL_INC_II" ; then
                    610:                                if test "$ac_dir" != "$GL_INC_I" ; then
                    611:                                        GL_INCLUDES="$GL_INCLUDES -I$ac_dir"
                    612:                                fi
                    613:                        fi
                    614:                fi
1.75      cheyroul  615:                        break   
                    616:            fi
                    617:        done    
1.80      cheyroul  618:        AC_MSG_CHECKING([freetype])     
                    619:        for ac_dir in                           \
                    620:                /usr/include                    \
                    621:                /usr/X11R6/include              \
                    622:                /usr/local/include              \
                    623:                ; \
                    624:        do  if test -r "$ac_dir/ft2build.h" ; then
                    625:                 freetype_inc="yes"
                    626:                GL_INCLUDES="$GL_INCLUDES `freetype-config --cflags`"
                    627:                        break   
                    628:            fi
                    629:        done            
1.75      cheyroul  630:        if test "$gl_inc" = "" ; then
                    631:                AC_MSG_WARN(Opengl headers (gl.h) not found !!)
                    632:                AC_MSG_WARN(Disabling opengl build !)
                    633:                with_gl="no"
                    634:                GL_OPTIONS=     
                    635:                GL_INCLUDES=    
                    636:                GL_LIBRARIES=
1.81    ! cheyroul  637:                exit 1;
1.75      cheyroul  638:        fi
                    639:        if test "$glu_inc" = "" ; then
                    640:                AC_MSG_WARN(Glu headers (glu.h) not found !!)
                    641:                AC_MSG_WARN(Disabling opengl build !)
1.81    ! cheyroul  642:        
1.75      cheyroul  643:                with_gl="no"
                    644:                GL_OPTIONS=     
                    645:                GL_INCLUDES=    
                    646:                GL_LIBRARIES=
1.81    ! cheyroul  647:                exit 1;
1.75      cheyroul  648:        fi
                    649:        if test "$gtkgl_inc" = "" ; then
                    650:                AC_MSG_WARN(Gtkglarea headers (gktglarea.h) not found !!)
                    651:                AC_MSG_WARN(Disabling opengl build !)
                    652:                with_gl="no"
                    653:                GL_OPTIONS=     
                    654:                GL_INCLUDES=    
                    655:                GL_LIBRARIES=
1.81    ! cheyroul  656:                exit 1;
1.75      cheyroul  657:        fi
1.80      cheyroul  658:        if test "$freetype_inc" = "" ; then
                    659:                AC_MSG_WARN(Freetype 2 headers (ft2build.h) not found !!)
                    660:                AC_MSG_WARN(Disabling opengl build !)
                    661:                with_gl="no"
                    662:                GL_OPTIONS=     
                    663:                GL_INCLUDES=
                    664:                GL_LIBRARIES=
1.81    ! cheyroul  665:                exit 1;
1.80      cheyroul  666:        fi
1.75      cheyroul  667:        if test "$gl_inc" = "yes" ; then
1.79      cheyroul  668:                if test "$glu_inc" = "yes" ; then
                    669:                        if test "$gtkgl_inc" = "yes" ; then
1.80      cheyroul  670:                            if test "$freetype_inc" = "yes" ; then      
                    671:                                GL_LIBRARIES=" -lXmu -lXft -lfreetype -lGL -lGLU -lgtkgl "
1.79      cheyroul  672:                                GL_OPTIONS=-D_GL 
                    673:                                no_motif=yes
1.80      cheyroul  674:                            fi
1.75      cheyroul  675:                        fi
                    676:                fi
                    677:        fi
                    678: AC_SUBST(GL_INCLUDES)
                    679: AC_SUBST(GL_LIBRARIES)
                    680: fi
1.76      vatton    681: 
                    682: AC_ARG_ENABLE(svg,           [  --disable-svg           remove SVG support ])
                    683: AC_ARG_ENABLE(annot,         [  --disable-annot         remove Annotations support ])
                    684: AC_ARG_ENABLE(generic-xml,   [  --disable-generic-xml   remove Generic XML support ])
                    685: AC_ARG_ENABLE(annot-threads, [  --disable-annot-threads remove annotation threads ])
                    686: 
1.75      cheyroul  687: dnl
1.21      cvs       688: dnl plugins support is disabled by default
1.8       cvs       689: dnl
1.13      cvs       690: 
                    691: if test "$with_plugin" = "" ; then
1.21      cvs       692:   if test "$enable_plugin" = "yes" ; then
1.55      kahan     693:     with_plugin="yes"
1.21      cvs       694:   else
1.17      cvs       695:     with_plugin="no"
                    696:   fi
1.10      cvs       697: fi  
1.1       cvs       698: 
1.8       cvs       699: dnl
1.68      vatton    700: dnl svg is enabled by default
1.26      cvs       701: dnl
1.68      vatton    702: if test "$with_svg" = "" ; then
                    703:     if test "$enable_svg" = "no" ; then
                    704:        with_svg="no"
1.49      cvs       705:     else
1.68      vatton    706:        with_svg="yes"
1.26      cvs       707:     fi
                    708: fi
                    709: 
                    710: dnl
1.56      kahan     711: dnl annotations is enabled by default
1.47      cvs       712: dnl
                    713: if test "$with_annot" = "" ; then
1.56      kahan     714:     if test "$enable_annot" = "no" ; then
                    715:        with_annot="no"
                    716:     else
1.54      cvs       717:        with_annot="yes"
1.47      cvs       718:     fi
                    719: fi
                    720: 
1.70      kahan     721: dnl
                    722: dnl Generic XML support enabled by default
                    723: dnl
                    724: if test "$with_generic_xml" = "" ; then
                    725:     if test "$enable_generic_xml" = "no" ; then
                    726:        with_generic_xml="no"
                    727:        GENERIC_XML_OPTIONS=
                    728:     else
                    729:        with_generic_xml="yes"
                    730:        GENERIC_XML_OPTIONS=-DXML_GENERIC
                    731:     fi
                    732: fi
                    733: 
                    734: dnl
1.73      kahan     735: dnl Annotation thread support enabled by default
1.70      kahan     736: dnl
                    737: if test "$with_annot_threads" = "" ; then
1.73      kahan     738:     if test "$enable_annot_threads" = "no" ; then
                    739:        with_annot_threads="no"
1.74      kahan     740:        ANNOT_THREAD_OPTIONS=
1.70      kahan     741:     else
1.73      kahan     742:        with_annot_threads="yes"
1.74      kahan     743:        ANNOT_THREAD_OPTIONS=-DANNOT_ON_ANNOT 
1.70      kahan     744:     fi
                    745: fi
                    746: 
1.19      cvs       747: if test "$build_amaya" = "yes" ; then
1.43      cvs       748:     if test ! -f $srcdir/../libwww/Makefile.in ; then
1.50      cvs       749:        AC_MSG_WARN(libwww sources not found !!)
                    750:        AC_MSG_WARN(Disabling Amaya build !)
                    751:        build_amaya="no"
1.1       cvs       752:     fi
1.8       cvs       753: 
                    754:     if test ! -f $srcdir/amaya/MathML.S ; then
1.10      cvs       755:        if test "$with_math" = "yes" ; then
1.8       cvs       756:            AC_MSG_WARN(MathML sources not found !!)
1.26      cvs       757:            AC_MSG_WARN(Disabling Math build !)
1.10      cvs       758:            with_math="no"
                    759:            MATH_OPTIONS=
1.8       cvs       760:        fi
                    761:     fi
1.26      cvs       762: 
1.68      vatton    763:     if test ! -f $srcdir/amaya/SVG.S ; then
                    764:        if test "$with_svg" = "yes" ; then
                    765:            AC_MSG_WARN(SVG sources not found !!)
                    766:            AC_MSG_WARN(Disabling SVG build !)
                    767:            with_svg="no"
                    768:            SVG_OPTIONS=
1.26      cvs       769:        fi
                    770:     fi
                    771: 
1.48      cvs       772:     if test ! -f $srcdir/annotlib/Makefile.in ; then
1.47      cvs       773:        if test "$with_annot" = "yes" ; then
                    774:            AC_MSG_WARN(Annotation makefile not found !!)
                    775:            AC_MSG_WARN(Disabling Annotations build !)
                    776:            with_annot="no"
                    777:        fi
                    778:     fi
1.55      kahan     779: 
1.70      kahan     780:     if test "$with_annot" = "no" -a "$with_annot_threads" = "yes" ; then
                    781:        AC_MSG_WARN(You must select the annotation support to have threads)
                    782:        AC_MSG_WARN(Disabling annotation thread support)
                    783:        with_annot_threads="no"
                    784:        ANNOT_THREAD_OPTIONS=
                    785:     fi
                    786: 
1.55      kahan     787:     if test "$with_plugin" = "yes" ; then
                    788:         AC_MSG_WARN(The plugin library isn't supported anymore in Amaya !!)
                    789:        AC_MSG_WARN(Disabling plugin build !)
                    790:        with_plugin="no"
                    791:     fi
                    792: 
1.1       cvs       793: fi
                    794: 
                    795: dnl
                    796: dnl The options for each library or binary
                    797: dnl
                    798: 
1.75      cheyroul  799: THOT_OPTIONS="$GTK_OPTIONS $I18N_OPTIONS $GL_OPTIONS"
                    800: AMAYA_OPTIONS="$MATH_OPTIONS $SVG_OPTIONS $GTK_OPTIONS $GENERIC_XML_OPTIONS $I18N_OPTIONS $ANNOT_THREAD_OPTIONS $GL_OPTIONS"
1.58      cvs       801: #PLUGIN_OPTIONS="-DPLUGIN_TRACE -DXP_UNIX"
1.70      kahan     802: AMAYA_ANNOT_OPTIONS="$ANNOT_THREAD_OPTIONS"
1.1       cvs       803: IMGLIBS="-ljpeg -lpng -lz"
1.3       cvs       804: EXTRA_LIBS=
1.1       cvs       805: 
                    806: dnl
                    807: dnl Set up the PATHs needed
                    808: dnl
                    809: 
                    810: API="\$(THOTDIR)/thotlib/include"
                    811: VAR="\$(THOTDIR)/thotlib/internals/var"
                    812: INCL="\$(THOTDIR)/thotlib/internals/h"
                    813: FUNC="\$(THOTDIR)/thotlib/internals/f"
1.58      cvs       814: if test "${LIBPNG}" = "../libpng.a" ; then
1.52      cvs       815: #there is a modified header file we need
1.1       cvs       816: PNGINCL="-I\$(THOTDIR)/libpng -I\$(THOTDIR)/libpng/zlib"
1.58      cvs       817: fi
                    818: if test "${LIBJPEG}" = "../libjpeg.a" ; then
                    819: #there is a modified header file we need
                    820: JPEGINCL="-I\$(THOTDIR)/libjpeg"
                    821: fi
1.1       cvs       822: 
                    823: dnl
                    824: dnl Set up the include variables.
                    825: dnl
                    826: 
1.61      cvs       827: THOTINCLUDES="-I${API} -I${VAR} -I${INCL} -I${FUNC} ${JPEGINCL} ${PNGINCL}"
1.58      cvs       828: APIINCLUDES=-I${API}
                    829:  
                    830: if test "${VPATHOPT}" = "" ; then
1.1       cvs       831:        VPATHOPT="VPATH"
                    832: fi
                    833: 
                    834: dnl
                    835: dnl Exports the current values of the variables.
                    836: dnl
                    837: 
                    838: AC_SUBST(AMAYA_VER)
1.6       cvs       839: AC_SUBST(CEXTRACT_VER)
                    840: AC_SUBST(CEXTRACT_FLAGS)
1.1       cvs       841: 
                    842: AC_SUBST(THOTINCLUDES)
                    843: AC_SUBST(APIINCLUDES)
                    844: AC_SUBST(VPATHOPT)
                    845: 
1.63      vatton    846: AC_SUBST(GTK_OPTIONS)
1.1       cvs       847: AC_SUBST(THOT_OPTIONS)
                    848: AC_SUBST(AMAYA_OPTIONS)
                    849: AC_SUBST(PLUGIN_OPTIONS)
1.48      cvs       850: AC_SUBST(AMAYA_ANNOT_OPTIONS)
1.1       cvs       851: AC_SUBST(IMGLIBS)
1.3       cvs       852: AC_SUBST(EXTRA_LIBS)
1.1       cvs       853: 
                    854: dnl
1.48      cvs       855: dnl Include the option Makefile.xxx fragment according to the configure options
1.1       cvs       856: dnl
                    857: 
                    858: if test "$with_plugin" = "yes" ; then
1.50      cvs       859:     AC_SUBST_FILE(plugin_frag)
1.1       cvs       860:     plugin_frag=$srcdir/pluginlib/Makefile.plugin
                    861: else
                    862:     AC_SUBST_FILE(plugin_frag)
                    863:     plugin_frag=/dev/null
                    864: fi
                    865: 
                    866:     AC_SUBST_FILE(www_frag)
1.49      cvs       867:     www_frag=$srcdir/amaya/Makefile.libwww
1.1       cvs       868: 
1.50      cvs       869: if test "$with_math" = "no" ; then
1.10      cvs       870:     AC_SUBST_FILE(math_frag)
1.50      cvs       871:     math_frag=/dev/null
1.8       cvs       872: else
1.10      cvs       873:     AC_SUBST_FILE(math_frag)
1.50      cvs       874:     math_frag=$srcdir/amaya/Makefile.math
1.8       cvs       875: fi
                    876: 
1.68      vatton    877: if test "$with_svg" = "no" ; then
                    878:     AC_SUBST_FILE(svg_frag)
                    879:     svg_frag=/dev/null
1.26      cvs       880: else
1.68      vatton    881:     AC_SUBST_FILE(svg_frag)
                    882:     svg_frag=$srcdir/amaya/Makefile.svg
1.26      cvs       883: fi
                    884: 
1.47      cvs       885: if test "$with_annot" = "yes" ; then
                    886:     AC_SUBST_FILE(annot_frag)
1.48      cvs       887:     annot_frag=$srcdir/annotlib/Makefile.annot
1.47      cvs       888: else
                    889:     AC_SUBST_FILE(annot_frag)
                    890:     annot_frag=/dev/null
                    891: fi
                    892: 
1.16      cvs       893: 
1.1       cvs       894: dnl  ***************************************************************
                    895: dnl
                    896: dnl      FINAL STEP : PRODUCE ALL THE MAKEFILES AND CONFIG FILES
                    897: dnl
                    898: dnl  ***************************************************************
                    899: 
                    900: EXTRA_MAKEFILE_IN=
1.2       cvs       901: make_output="Makefile Options.orig:Options.in tools/Makefile \
1.1       cvs       902:        libjpeg/Makefile libpng/Makefile libpng/zlib/Makefile \
1.2       cvs       903:        tools/mkdep/Makefile \
1.1       cvs       904:        tools/cextract-1.7/Makefile thotlib/Makefile \
1.5       cvs       905:        thotlib/include/Makefile batch/Makefile tablelib/Makefile"
1.1       cvs       906: 
                    907: if test "$build_amaya" = "yes" ; then
1.2       cvs       908: 
1.19      cvs       909:     make_output="$make_output amaya/Makefile pluginlib/Makefile"
1.2       cvs       910:     EXTRA_MAKEFILE_IN="$srcdir/amaya/Makefile.in \
1.27      cvs       911: $srcdir/amaya/Makefile.libwww"
                    912: 
                    913:     if test "$$with_plugin" = "yes" ; then
                    914:        make_output="$make_output pluginlib/Makefile"
                    915:        EXTRA_MAKEFILE_IN="$srcdir/pluginlib/Makefile.in \
1.2       cvs       916: $srcdir/pluginlib/Makefile.plugin"
1.27      cvs       917:     fi
1.2       cvs       918: 
1.48      cvs       919:     if test "$with_annot" = "yes" ; then
                    920:        make_output="$make_output annotlib/Makefile"
                    921:        EXTRA_MAKEFILE_IN="$srcdir/annotlib/Makefile.in"
                    922:     fi
1.1       cvs       923: fi
                    924: 
                    925: AC_SUBST(EXTRA_MAKEFILE_IN)
1.6       cvs       926: AC_OUTPUT($make_output , [
                    927: dnl
                    928: dnl This fragment of shell code is executed after the
                    929: dnl Makefile(s) dump ...
                    930: dnl
                    931: 
                    932: echo timestamp > stamp-h
                    933: 
                    934: dnl
                    935: dnl Check for an upgrade in the Options numbers
                    936: dnl
                    937: 
                    938: if test -f Options ; then
                    939:    oldversion=`grep Version Options`
                    940:    newversion=`grep Version Options.orig`
                    941:    if test "$oldversion" != "$newversion" ; then
                    942:        echo WARNING : Options files have changed, old options saved to Options.old
                    943:        cp Options Options.old
                    944:        cp Options.orig Options
                    945:        exit 1
                    946:    fi
                    947: fi
                    948: ])
1.1       cvs       949: 
                    950: if test "$build_amaya" = "yes" ; then
1.50      cvs       951:     echo Amaya configured with libWWW
                    952:     if test "$with_plugin" = "yes" ; then
                    953:         echo Amaya configured with Plugins support
1.8       cvs       954:     fi
1.10      cvs       955:     if test "$with_math" = "yes" ; then
                    956:        echo Amaya configured with Math support
1.26      cvs       957:     fi
1.68      vatton    958:     if test "$with_svg" = "yes" ; then
                    959:        echo Amaya configured with SVG support
1.47      cvs       960:     fi
                    961:     if test "$with_annot" = "yes" ; then
                    962:        echo Amaya configured with Annotations support
1.70      kahan     963:     fi
                    964:     if test "$with_annot_threads" = "yes" ; then
                    965:        echo Amaya configured with Annotation threads support
                    966:     fi
                    967:     if test "$with_generic_xml" = "yes" ; then
                    968:        echo Amaya configured with generic XML suppport
                    969:     fi
                    970:     if test "$with_i18n" = "yes" ; then
                    971:        echo Amaya configured with I18N suppport \(experimental\)
1.75      cheyroul  972:     fi 
                    973:     if test "$with_gl" = "yes" ; then
                    974:        echo Amaya configured with Opengl Canvas Rendering \(experimental\)
1.1       cvs       975:     fi
1.5       cvs       976: fi
                    977: 
                    978: if test "$no_motif" = yes ; then
1.67      vatton    979:     echo "Amaya configured with GTK"
1.76      vatton    980:     echo "Amaya configured without static graphic libraries (libjpeg, libpng)"
1.67      vatton    981: else
1.76      vatton    982: if test "$no_motif" = yes ; then
                    983:     echo "Amaya configured without static graphic libraries (libjpeg, libpng)"
                    984: fi
1.67      vatton    985: if test "$no_motif" = yes ; then
1.5       cvs       986:     echo "Motif seems not installed on this machine"
1.61      cvs       987:     echo "Amaya need Motif 1.2 or 2.0"
1.5       cvs       988: else
                    989: if test "$motif_includes" = "" ; then
                    990:     echo "Motif includes were not found"
1.61      cvs       991:     echo "Amaya might not compile"
1.5       cvs       992:     echo "Edit your Option file"
                    993: else
                    994: if test "$motif_libraries" = "" ; then
                    995:     echo "Motif libraries were not found"
1.61      cvs       996:     echo "Amaya might not compile"
1.5       cvs       997:     echo "Edit your Option file"
1.67      vatton    998: fi
1.5       cvs       999: fi
                   1000: fi
1.1       cvs      1001: fi
                   1002: 
1.78      vatton   1003: echo "Now type \"make\" (GNU make preferably) to build the binaries"
1.48      cvs      1004: 
                   1005: 
                   1006: 
1.5       cvs      1007: 

Webmaster