Annotation of Amaya/configure.in, revision 1.76

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

Webmaster