Annotation of Amaya/configure.in, revision 1.69

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
        !            21:    echo ERROR: You must invoke the configure script in a subidrectory
        !            22:    echo under the Amaya tree.
        !            23:    echo For example:
        !            24:    echo "  cd Amaya ; mkdir obj ; cd obj ; ../configure [your options] "
        !            25:    exit 1
        !            26: fi
        !            27: 
        !            28: dnl
1.1       cvs        29: dnl Checks for platform information
                     30: dnl
                     31: 
                     32: AC_CANONICAL_SYSTEM
                     33: AC_CONFIG_HEADER(config.h)
                     34: 
                     35: dnl
                     36: dnl Initializing Automake
                     37: dnl
                     38: 
                     39: AC_PROG_MAKE_SET
                     40: AC_ARG_PROGRAM
                     41: 
                     42: dnl
                     43: dnl Checks for programs.
                     44: dnl
                     45: 
                     46: AC_PROG_YACC
                     47: AC_PROG_CC
                     48: AC_PROG_CPP
                     49: AC_PROG_LEX
                     50: AC_PROG_AWK
                     51: AC_PROG_INSTALL
                     52: AC_PROG_LN_S
                     53: AC_PROG_MAKE_SET
                     54: AC_PROG_RANLIB
                     55: AC_PATH_PROG(CP, cp, /bin/cp, $PATH:/bin:/usr/bin:/usr/ucb/bin)
                     56: AC_PATH_PROG(MV, mv, /bin/mv, $PATH:/bin:/usr/bin:/usr/ucb/bin)
                     57: AC_PATH_PROG(RM, rm, /bin/rm, $PATH:/bin:/usr/bin:/usr/ucb/bin)
                     58: AC_PATH_PROG(MKDIR, mkdir, /bin/mkdir, $PATH:/bin:/usr/bin:/usr/ucb/bin)
                     59: AC_PATH_PROG(ECHO, echo, /bin/echo, $PATH:/bin:/usr/bin:/usr/ucb/bin)
                     60: AC_PATH_PROG(CAT, cat, /bin/cat, $PATH:/bin:/usr/bin:/usr/ucb/bin)
                     61: AC_PATH_PROG(CHMOD, chmod, /bin/chmod, $PATH:/bin:/usr/bin:/usr/ucb/bin)
                     62: AC_PATH_PROG(SED, sed, /bin/sed, $PATH:/bin:/usr/bin:/usr/ucb/bin)
                     63: AC_PATH_PROG(AR, ar, /usr/bin/ar, $PATH:/bin:/usr/bin:/usr/ucb/bin)
1.6       cvs        64: AC_PATH_PROG(DIFF, diff, /usr/bin/diff, $PATH:/bin:/usr/bin:/usr/ucb/bin)
1.1       cvs        65: 
1.62      cvs        66: AC_ARG_WITH(graphic-libs, [  --without-graphic-libs    doesn't use provided libjpeg, libpng.])
                     67: if test "$withval" = "no" ; then
1.52      cvs        68: dnl
                     69:     AC_MSG_CHECKING([for libjpeg version = 6b])
1.58      cvs        70:     AC_EGREP_CPP([x 62 *x],
1.52      cvs        71:         [#include <jpeglib.h>
                     72:          x JPEG_LIB_VERSION x],
                     73: dnl
                     74:         AC_MSG_RESULT([yes])
                     75:         LIBJPEG='-ljpeg'
                     76:         MAKEJPEG=['#'],
                     77: dnl
                     78:         AC_MSG_RESULT([no])
                     79:         LIBJPEG='../libjpeg.a'      dnl LIBJPEG goes into amaya/Makefile.in
                     80:         )
                     81: dnl    
                     82: dnl
1.57      cvs        83:     AC_MSG_CHECKING([for libpng version = 1.0.x])
1.58      cvs        84:     AC_EGREP_CPP([x \"1.0\..*\" *x],
1.52      cvs        85:         [#include <png.h>
                     86:        x PNG_LIBPNG_VER_STRING x],
                     87: dnl
                     88:         AC_MSG_RESULT([yes])
                     89:         LIBPNG='-lpng'
                     90:         LIBZ=''
                     91:        MAKEPNG=['#'],
                     92: dnl
                     93:         AC_MSG_RESULT([no])
                     94:         LIBPNG='../libpng.a'
                     95:         LIBZ='../libz.a'
                     96:         )
                     97: else
                     98:     LIBJPEG='../libjpeg.a'
                     99:     LIBPNG='../libpng.a'
                    100:     LIBZ='../libz.a'
                    101: fi
                    102: dnl
                    103: AC_SUBST(LIBJPEG)
                    104: AC_SUBST(LIBPNG)
                    105: AC_SUBST(LIBZ)
                    106: AC_SUBST(MAKEJPEG)
                    107: AC_SUBST(MAKEPNG)
                    108: 
1.1       cvs       109: dnl
                    110: dnl Checks for libraries.
                    111: dnl
                    112: 
                    113: AC_CHECK_LIB(socket, socket, )
                    114: AC_CHECK_LIB(inet, connect)
                    115: AC_CHECK_LIB(nsl, t_accept)
                    116: AC_CHECK_LIB(dl, dlopen)
                    117: AC_PATH_X
                    118: AC_PATH_XTRA
                    119: 
1.41      cvs       120: dnl
                    121: dnl Check for libXp
                    122: dnl
1.38      cvs       123: 
1.41      cvs       124: for ac_dir in               \
                    125:   /usr/X11R6/lib        \
                    126:   /usr/X11R5/lib        \
                    127:                             \
                    128:   /usr/lib/X11R6        \
                    129:   /usr/lib/X11R5        \
                    130:                             \
                    131:   /usr/local/X11R6/lib  \
                    132:   /usr/local/X11R5/lib  \
                    133:                             \
                    134:   /usr/local/lib/X11R6  \
                    135:   /usr/local/lib/X11R5  \
                    136:                             \
                    137:   /usr/X11/lib          \
                    138:   /usr/lib/X11          \
                    139:   /usr/local/X11/lib    \
                    140:   /usr/local/lib/X11    \
                    141:                             \
                    142:   /usr/X386/lib         \
                    143:   /usr/x386/lib         \
                    144:   /usr/XFree86/lib/X11  \
                    145:                             \
                    146:   /usr/dt/lib           \
                    147:                             \
                    148:   /usr/lib              \
                    149:   /usr/local/lib        \
                    150:   /usr/unsupported/lib  \
                    151:   /usr/athena/lib       \
                    152:   /usr/local/x11r5/lib  \
                    153:   /usr/lpp/Xamples/lib  \
                    154:                             \
                    155:   /usr/lesstif/lib      \
                    156:   /usr/local/lesstif/lib\
                    157:   /usr/gnu/lesstif/lib  \
                    158:   $HOME/lesstif/lib     \
                    159:   ; \
                    160: do
                    161:   if test -r "$ac_dir/libXp.a" -o -r "$ac_dir/libXp.so"; then
                    162:      echo "\nfound libXp.a\n"
                    163:      X_PRE_LIBS="-lXp ${X_PRE_LIBS}"
                    164:      break
                    165:   fi
                    166: done
1.1       cvs       167: dnl
1.5       cvs       168: dnl Checks for header files.
                    169: dnl
                    170: 
                    171: AC_HEADER_DIRENT
                    172: AC_HEADER_STDC
                    173: AC_HEADER_SYS_WAIT
                    174: 
                    175: AC_CHECK_HEADERS(stdio.h)
                    176: AC_CHECK_HEADERS(sys/types.h types.h)
                    177: AC_CHECK_HEADERS(sys/unistd.h unistd.h)
                    178: AC_CHECK_HEADERS(sys/fcntl.h fcntl.h)
                    179: AC_CHECK_HEADERS(sys/limits.h limits.h)
                    180: AC_CHECK_HEADERS(sys/stat.h stat.h)
                    181: AC_CHECK_HEADERS(sys/file.h)
                    182: AC_CHECK_HEADERS(sys/ioctl.h)
                    183: AC_CHECK_HEADERS(sys/time.h time.h)
                    184: AC_CHECK_HEADERS(sys/systeminfo.h)
1.46      cvs       185: AC_CHECK_HEADERS(sys/string.h strings.h)
1.34      cvs       186: AC_CHECK_HEADERS(sys/syslog.h syslog.h)
1.5       cvs       187: AC_CHECK_HEADERS(sys/socket.h socket.h)
                    188: AC_CHECK_HEADERS(appkit/appkit.h appkit.h)
                    189: AC_CHECK_HEADERS(netinet/in.h in.h)
                    190: AC_CHECK_HEADERS(dn.h)
                    191: AC_CHECK_HEADERS(sys/ipc.h)
                    192: AC_CHECK_HEADERS(net/errno.h sys/errno.h errno.h)
                    193: AC_CHECK_HEADERS(pwd.h)
                    194: AC_CHECK_HEADERS(grp.h)
                    195: AC_CHECK_HEADERS(arpa/inet.h inet.h)
                    196: AC_CHECK_HEADERS(netdb.h)
                    197: AC_CHECK_HEADERS(manifest.h)
                    198: AC_CHECK_HEADERS(bsdtypes.h)
                    199: AC_CHECK_HEADERS(stdefs.h)
                    200: AC_CHECK_HEADERS(bsdtime.h)
                    201: AC_CHECK_HEADERS(sys/select.h select.h)
                    202: AC_CHECK_HEADERS(dnetdb.h)
                    203: AC_CHECK_HEADERS(libc.h)
                    204: AC_CHECK_HEADERS(stdlib.h)
                    205: AC_CHECK_HEADERS(malloc.h)
                    206: AC_CHECK_HEADERS(memory.h)
                    207: AC_CHECK_HEADERS(unixlib.h)
                    208: AC_CHECK_HEADERS(ctype.h)
                    209: AC_CHECK_HEADERS(cursesX.h curses.h)
                    210: AC_CHECK_HEADERS(sys/resource.h resource.h)
                    211: AC_HEADER_DIRENT
                    212: AC_CHECK_HEADERS(dir.h direct.h) dnl AC_HEADER_DIRENT only checks for some..
                    213: AC_HEADER_STDC
                    214: AC_HEADER_SYS_WAIT
                    215: AC_HEADER_TIME
                    216: AC_HEADER_STAT
                    217: 
                    218: dnl
                    219: dnl Checks for typedefs, structures, and compiler characteristics.
                    220: dnl
                    221: 
                    222: AC_C_CONST
                    223: AC_C_INLINE
                    224: AC_TYPE_MODE_T
                    225: AC_TYPE_OFF_T
                    226: AC_TYPE_SIZE_T
                    227: AC_HEADER_TIME
                    228: AC_STRUCT_TM
                    229: AC_STRUCT_TIMEZONE
                    230: AC_TYPE_UID_T
                    231: 
                    232: dnl
                    233: dnl Checks for library functions.
                    234: dnl
                    235: 
                    236: AC_FUNC_ALLOCA
                    237: AC_TYPE_GETGROUPS
                    238: AC_PROG_GCC_TRADITIONAL
                    239: AC_FUNC_MEMCMP
                    240: AC_FUNC_MMAP
                    241: AC_TYPE_SIGNAL
                    242: AC_FUNC_VPRINTF
1.58      cvs       243: 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       244: 
1.63      vatton    245: GTK_OPTIONS=
                    246: AC_ARG_WITH(gtk, [  --with-gtk              use GTK instead of Motif])
                    247: if test "$withval" = "yes" ; then
                    248:   for ac_dir in               \
1.65      cvs       249:     /usr/lib/glib/include     \
1.63      vatton    250:     /usr/X11R6/include        \
                    251:                               \
                    252:     /usr/include/X11R6        \
                    253:     /usr/local/X11R6/include  \
                    254:     /usr/local/include/X11R6  \
                    255:                               \
                    256:     /usr/X11/include          \
                    257:     /usr/include/X11          \
                    258:     /usr/local/X11/include    \
                    259:     /usr/local/include/X11    \
                    260:                               \
                    261:     /usr/X386/include         \
                    262:     /usr/x386/include         \
                    263:     /usr/XFree86/include/X11  \
                    264:     /usr/dt/include           \
                    265:     /usr/include              \
                    266:     /usr/local/include        \
                    267:     /usr/local/lib/glib/include  \
                    268:     ; \
                    269:   do
                    270:     if test -r "$ac_dir/gdk/gdk.h"; then
                    271:       no_gtk= ac_gtk_includes=$ac_dir
                    272:       break
                    273:     fi
                    274:   done
                    275: 
1.65      cvs       276: GTK_INCLUDES="`gtk-config --cflags`"
1.63      vatton    277: AC_SUBST(GTK_INCLUDES)
1.65      cvs       278: GTK_LIBRARIES="`gtk-config --libs` -lgdk_imlib -ltiff -lgif"
1.63      vatton    279: AC_SUBST(GTK_LIBRARIES)
1.65      cvs       280: GTK_OPTIONS=-D_GTK
1.63      vatton    281:   no_motif=yes
                    282: else
1.5       cvs       283: dnl
1.4       cvs       284: dnl Checking for Motif libraries and includes
                    285: dnl
                    286: dnl Borrowed from Lesstif configure.in
                    287: dnl Lesstif is a Great Project (TM)
                    288: dnl
                    289: 
                    290: AC_DEFUN(AC_PATH_MOTIF_DIRECT,
                    291: [test -z "$motif_direct_test_library" && motif_direct_test_library=Xm
                    292: test -z "$motif_direct_test_function" && motif_direct_test_function=XmCreatePushButton
                    293: test -z "$motif_direct_test_include" && motif_direct_test_include=Xm/Xm.h
                    294:   for ac_dir in               \
                    295:     /usr/include/Motif1.2     \
                    296:     /usr/Motif1.2/include     \
                    297:                               \
                    298:     /usr/motif/include        \
                    299:                               \
                    300:     /usr/X11R6/include        \
                    301:     /usr/X11R5/include        \
                    302:                               \
                    303:     /usr/include/X11R6        \
                    304:     /usr/include/X11R5        \
                    305:                               \
                    306:     /usr/local/X11R6/include  \
                    307:     /usr/local/X11R5/include  \
                    308:                               \
                    309:     /usr/local/include/X11R6  \
                    310:     /usr/local/include/X11R5  \
                    311:                               \
                    312:     /usr/X11/include          \
                    313:     /usr/include/X11          \
                    314:     /usr/local/X11/include    \
                    315:     /usr/local/include/X11    \
                    316:                               \
                    317:     /usr/X386/include         \
                    318:     /usr/x386/include         \
                    319:     /usr/XFree86/include/X11  \
                    320:                               \
                    321:     /usr/dt/include           \
                    322:                               \
                    323:     /usr/include              \
                    324:     /usr/local/include        \
                    325:     /usr/unsupported/include  \
                    326:     /usr/athena/include       \
                    327:     /usr/local/x11r5/include  \
                    328:     /usr/lpp/Xamples/include  \
1.14      cvs       329:                               \
                    330:     /usr/lesstif/include      \
                    331:     /usr/local/lesstif/include\
                    332:     /usr/gnu/lesstif/include  \
                    333:     $HOME/lesstif/include     \
1.4       cvs       334:     ; \
                    335:   do
                    336:     if test -r "$ac_dir/$motif_direct_test_include"; then
                    337:       no_motif= ac_motif_includes=$ac_dir
                    338:       break
                    339:     fi
                    340:   done
                    341: 
                    342: # Check for the libraries.
                    343: # See if we find them without any special options.
                    344: # Don't add to $LIBS permanently.
                    345: ac_save_LIBS="$LIBS"
                    346: LIBS="-l$motif_direct_test_library $LIBS"
                    347: # First see if replacing the include by lib works.
                    348: for ac_dir in `echo "$ac_motif_includes" | sed s/include/lib/` \
                    349:     /usr/lib/Motif1.2     \
                    350:     /usr/Motif1.2/lib     \
                    351:                           \
                    352:     /usr/motif/lib        \
                    353:                           \
                    354:     /usr/X11R6/lib        \
                    355:     /usr/X11R5/lib        \
                    356:                           \
                    357:     /usr/lib/X11R6        \
                    358:     /usr/lib/X11R5        \
                    359:                           \
                    360:     /usr/local/X11R6/lib  \
                    361:     /usr/local/X11R5/lib  \
                    362:                           \
                    363:     /usr/local/lib/X11R6  \
                    364:     /usr/local/lib/X11R5  \
                    365:                           \
                    366:     /usr/X11/lib          \
                    367:     /usr/lib/X11          \
                    368:     /usr/local/X11/lib    \
                    369:                           \
                    370:     /usr/X386/lib         \
                    371:     /usr/x386/lib         \
                    372:     /usr/XFree86/lib/X11  \
                    373:                           \
                    374:     /usr/lib              \
                    375:     /usr/local/lib        \
                    376:     /usr/unsupported/lib  \
                    377:     /usr/athena/lib       \
                    378:     /usr/local/x11r5/lib  \
                    379:     /usr/lpp/Xamples/lib  \
1.14      cvs       380:                           \
                    381:     /usr/lesstif/lib      \
                    382:     /usr/local/lesstif/lib\
                    383:     /usr/gnu/lesstif/lib  \
                    384:     $HOME/lesstif/lib     \
1.4       cvs       385:     ; \
                    386: do
                    387:   for ac_extension in a so sl; do
                    388:     if test -r $ac_dir/lib${motif_direct_test_library}.$ac_extension; then
                    389:       no_motif= ac_motif_libraries=$ac_dir
                    390:       break 2
                    391:     fi
                    392:   done
1.5       cvs       393: done
                    394: LIBS="$ac_save_LIBS"
                    395: ])
1.4       cvs       396: 
                    397: AC_DEFUN(AC_PATH_MOTIF,
1.66      vatton    398: [AC_REQUIRE_CPP()
1.4       cvs       399: 
                    400: motif_includes=NONE
                    401: motif_libraries=NONE
                    402: 
                    403: AC_MSG_CHECKING(for Motif)
1.63      vatton    404: if test "x$motif_includes" != xNONE && test "x$motif_libraries" != xNONE; then
                    405:     no_motif=
1.4       cvs       406: else
                    407: AC_CACHE_VAL(ac_cv_path_motif,
                    408: [# One or both of these vars are not set, and there is no cached value.
1.63      vatton    409:   no_motif=yes
1.4       cvs       410: AC_PATH_MOTIF_DIRECT
                    411: 
                    412: if test "$no_motif" = yes; then
1.63      vatton    413:     ac_cv_path_motif="no_motif=yes"
1.4       cvs       414: else
1.63      vatton    415:     ac_cv_path_motif="no_motif= ac_motif_includes=$ac_motif_includes ac_motif_libraries=$ac_motif_libraries"
1.66      vatton    416: fi])
                    417: eval "$ac_cv_path_motif"
1.63      vatton    418: fi
1.4       cvs       419: 
                    420: if test "$no_motif" = yes; then
                    421:   AC_MSG_RESULT(no)
1.5       cvs       422:   MOTIF_INCLUDES=
                    423:   MOTIF_LIBRARIES=
1.4       cvs       424: else
                    425:   test "x$motif_includes" = xNONE && motif_includes=$ac_motif_includes
                    426:   test "x$motif_libraries" = xNONE && motif_libraries=$ac_motif_libraries
                    427:   ac_cv_path_motif="no_motif= ac_motif_includes=$motif_includes ac_motif_libraries=$motif_libraries"
                    428:   AC_MSG_RESULT([libraries $motif_libraries, headers $motif_includes])
1.5       cvs       429:   if test "$motif_includes" != "/usr/include" ; then
                    430:     MOTIF_INCLUDES="-I$motif_includes"
                    431:   fi
                    432:   if test "$motif_libraries" != "/usr/lib" ; then
1.64      cvs       433:     MOTIF_LIBRARIES="-L$motif_libraries -lXm"
1.19      cvs       434:     case "${host}" in
                    435:         *-*sun-solaris* )
                    436:          MOTIF_LIBRARIES="${MOTIF_LIBRARIES} -R$motif_libraries"
                    437:         ;;
1.65      cvs       438:     esac
                    439:   else
                    440:   MOTIF_LIBRARIES="-lXm"
1.5       cvs       441:   fi
1.4       cvs       442: fi
1.5       cvs       443: AC_SUBST(MOTIF_INCLUDES)
                    444: AC_SUBST(MOTIF_LIBRARIES)
1.4       cvs       445: ])
                    446: 
                    447: AC_PATH_MOTIF
1.66      vatton    448: fi
1.4       cvs       449: 
1.63      vatton    450: if test "${GCC}" = "yes"; then
                    451:    CPP="${CPP} -x c"
                    452: fi
                    453: 
1.1       cvs       454: dnl  ***************************************************************
                    455: dnl
1.61      cvs       456: dnl    SPECIFIC STUFF : CONFIGURATION OPTIONS FOR AMAYA
1.1       cvs       457: dnl
                    458: dnl  ***************************************************************
                    459: 
1.68      vatton    460: AMAYA_VER="6.0"
1.1       cvs       461: 
                    462: dnl
1.6       cvs       463: dnl We use a special versoin of cextract patched for alignment
                    464: dnl to build the signatures of the modules functions located in f subdirs
                    465: dnl
                    466: CEXTRACT_VER="1.7"
                    467: CEXTRACT_FLAGS="+O"
                    468: 
1.3       cvs       469: 
                    470: dnl
1.9       cvs       471: dnl Adjust the some variables depending on the host and compiler
1.61      cvs       472: dnl Thotlib NEED signed chars !!!
1.7       cvs       473: dnl
                    474: 
                    475: if test "${CC}" = "gcc" ; then
1.44      cvs       476:   CFLAGS="${CFLAGS} -W "
1.7       cvs       477:   case "${host}" in
                    478:       *-*-irix5* | *-*irix6* )
                    479:          CFLAGS="${CFLAGS} -fsigned-char"
                    480:       ;;
                    481:   esac
1.14      cvs       482: fi
                    483: 
                    484: if test "$ac_cv_c_const" = "no" ; then
                    485:   CFLAGS="${CFLAGS} -DCONST= "
1.7       cvs       486: fi
                    487: 
                    488: dnl
1.61      cvs       489: dnl Check for availability of amaya sources
1.1       cvs       490: dnl
                    491: 
                    492: build_amaya="yes"
                    493: 
                    494: if test "$with_amaya" = "no" ; then
                    495:     build_amaya="no"
1.45      cvs       496: else
                    497:   if test ! -f $srcdir/amaya/Makefile.in ; then
1.1       cvs       498:     AC_MSG_WARN(Amaya browser/editor sources not found, disabling Amaya build !)
                    499:     build_amaya="no"
1.45      cvs       500:   fi
1.1       cvs       501: fi
                    502: 
1.45      cvs       503:  
1.1       cvs       504: dnl
1.50      cvs       505: dnl Check for additionnal packages
1.1       cvs       506: dnl use AC_CONFIG_SUBDIRS to launch configure in the subdir
                    507: dnl
1.68      vatton    508: AC_ARG_ENABLE(svg,   [  --disable-svg           remove SVG support ])
1.53      cvs       509: AC_ARG_ENABLE(annot,   [  --disable-annot         remove Annotations support ])
1.1       cvs       510: 
1.8       cvs       511: dnl
1.21      cvs       512: dnl plugins support is disabled by default
1.8       cvs       513: dnl
1.13      cvs       514: 
                    515: if test "$with_plugin" = "" ; then
1.21      cvs       516:   if test "$enable_plugin" = "yes" ; then
1.55      kahan     517:     with_plugin="yes"
1.21      cvs       518:   else
1.17      cvs       519:     with_plugin="no"
                    520:   fi
1.10      cvs       521: fi  
1.1       cvs       522: 
1.8       cvs       523: dnl
1.68      vatton    524: dnl svg is enabled by default
1.26      cvs       525: dnl
1.68      vatton    526: if test "$with_svg" = "" ; then
                    527:     if test "$enable_svg" = "no" ; then
                    528:        with_svg="no"
1.49      cvs       529:     else
1.68      vatton    530:        with_svg="yes"
1.26      cvs       531:     fi
                    532: fi
                    533: 
                    534: dnl
1.56      kahan     535: dnl annotations is enabled by default
1.47      cvs       536: dnl
                    537: if test "$with_annot" = "" ; then
1.56      kahan     538:     if test "$enable_annot" = "no" ; then
                    539:        with_annot="no"
                    540:     else
1.54      cvs       541:        with_annot="yes"
1.47      cvs       542:     fi
                    543: fi
                    544: 
1.22      cvs       545: 
1.19      cvs       546: if test "$build_amaya" = "yes" ; then
1.43      cvs       547:     if test ! -f $srcdir/../libwww/Makefile.in ; then
1.50      cvs       548:        AC_MSG_WARN(libwww sources not found !!)
                    549:        AC_MSG_WARN(Disabling Amaya build !)
                    550:        build_amaya="no"
1.1       cvs       551:     fi
1.8       cvs       552: 
                    553:     if test ! -f $srcdir/amaya/MathML.S ; then
1.10      cvs       554:        if test "$with_math" = "yes" ; then
1.8       cvs       555:            AC_MSG_WARN(MathML sources not found !!)
1.26      cvs       556:            AC_MSG_WARN(Disabling Math build !)
1.10      cvs       557:            with_math="no"
                    558:            MATH_OPTIONS=
1.8       cvs       559:        fi
                    560:     fi
1.26      cvs       561: 
1.68      vatton    562:     if test ! -f $srcdir/amaya/SVG.S ; then
                    563:        if test "$with_svg" = "yes" ; then
                    564:            AC_MSG_WARN(SVG sources not found !!)
                    565:            AC_MSG_WARN(Disabling SVG build !)
                    566:            with_svg="no"
                    567:            SVG_OPTIONS=
1.26      cvs       568:        fi
                    569:     fi
                    570: 
1.48      cvs       571:     if test ! -f $srcdir/annotlib/Makefile.in ; then
1.47      cvs       572:        if test "$with_annot" = "yes" ; then
                    573:            AC_MSG_WARN(Annotation makefile not found !!)
                    574:            AC_MSG_WARN(Disabling Annotations build !)
                    575:            with_annot="no"
                    576:        fi
                    577:     fi
1.55      kahan     578: 
                    579:     if test "$with_plugin" = "yes" ; then
                    580:         AC_MSG_WARN(The plugin library isn't supported anymore in Amaya !!)
                    581:        AC_MSG_WARN(Disabling plugin build !)
                    582:        with_plugin="no"
                    583:     fi
                    584: 
1.1       cvs       585: fi
                    586: 
                    587: dnl
                    588: dnl The options for each library or binary
                    589: dnl
                    590: 
1.63      vatton    591: THOT_OPTIONS="$GTK_OPTIONS"
1.68      vatton    592: AMAYA_OPTIONS="$MATH_OPTIONS $SVG_OPTIONS $GTK_OPTIONS"
1.58      cvs       593: #PLUGIN_OPTIONS="-DPLUGIN_TRACE -DXP_UNIX"
1.48      cvs       594: AMAYA_ANNOT_OPTIONS=
1.1       cvs       595: IMGLIBS="-ljpeg -lpng -lz"
1.3       cvs       596: EXTRA_LIBS=
1.1       cvs       597: 
                    598: dnl
                    599: dnl Set up the PATHs needed
                    600: dnl
                    601: 
                    602: API="\$(THOTDIR)/thotlib/include"
                    603: VAR="\$(THOTDIR)/thotlib/internals/var"
                    604: INCL="\$(THOTDIR)/thotlib/internals/h"
                    605: FUNC="\$(THOTDIR)/thotlib/internals/f"
1.58      cvs       606: if test "${LIBPNG}" = "../libpng.a" ; then
1.52      cvs       607: #there is a modified header file we need
1.1       cvs       608: PNGINCL="-I\$(THOTDIR)/libpng -I\$(THOTDIR)/libpng/zlib"
1.58      cvs       609: fi
                    610: if test "${LIBJPEG}" = "../libjpeg.a" ; then
                    611: #there is a modified header file we need
                    612: JPEGINCL="-I\$(THOTDIR)/libjpeg"
                    613: fi
1.1       cvs       614: 
                    615: dnl
                    616: dnl Set up the include variables.
                    617: dnl
                    618: 
1.61      cvs       619: THOTINCLUDES="-I${API} -I${VAR} -I${INCL} -I${FUNC} ${JPEGINCL} ${PNGINCL}"
1.58      cvs       620: APIINCLUDES=-I${API}
                    621:  
                    622: if test "${VPATHOPT}" = "" ; then
1.1       cvs       623:        VPATHOPT="VPATH"
                    624: fi
                    625: 
                    626: dnl
                    627: dnl Exports the current values of the variables.
                    628: dnl
                    629: 
                    630: AC_SUBST(AMAYA_VER)
1.6       cvs       631: AC_SUBST(CEXTRACT_VER)
                    632: AC_SUBST(CEXTRACT_FLAGS)
1.1       cvs       633: 
                    634: AC_SUBST(THOTINCLUDES)
                    635: AC_SUBST(APIINCLUDES)
                    636: AC_SUBST(VPATHOPT)
                    637: 
1.63      vatton    638: AC_SUBST(GTK_OPTIONS)
1.1       cvs       639: AC_SUBST(THOT_OPTIONS)
                    640: AC_SUBST(AMAYA_OPTIONS)
                    641: AC_SUBST(PLUGIN_OPTIONS)
1.48      cvs       642: AC_SUBST(AMAYA_ANNOT_OPTIONS)
1.1       cvs       643: AC_SUBST(IMGLIBS)
1.3       cvs       644: AC_SUBST(EXTRA_LIBS)
1.1       cvs       645: 
                    646: dnl
1.48      cvs       647: dnl Include the option Makefile.xxx fragment according to the configure options
1.1       cvs       648: dnl
                    649: 
                    650: if test "$with_plugin" = "yes" ; then
1.50      cvs       651:     AC_SUBST_FILE(plugin_frag)
1.1       cvs       652:     plugin_frag=$srcdir/pluginlib/Makefile.plugin
                    653: else
                    654:     AC_SUBST_FILE(plugin_frag)
                    655:     plugin_frag=/dev/null
                    656: fi
                    657: 
                    658:     AC_SUBST_FILE(www_frag)
1.49      cvs       659:     www_frag=$srcdir/amaya/Makefile.libwww
1.1       cvs       660: 
1.50      cvs       661: if test "$with_math" = "no" ; then
1.10      cvs       662:     AC_SUBST_FILE(math_frag)
1.50      cvs       663:     math_frag=/dev/null
1.8       cvs       664: else
1.10      cvs       665:     AC_SUBST_FILE(math_frag)
1.50      cvs       666:     math_frag=$srcdir/amaya/Makefile.math
1.8       cvs       667: fi
                    668: 
1.68      vatton    669: if test "$with_svg" = "no" ; then
                    670:     AC_SUBST_FILE(svg_frag)
                    671:     svg_frag=/dev/null
1.26      cvs       672: else
1.68      vatton    673:     AC_SUBST_FILE(svg_frag)
                    674:     svg_frag=$srcdir/amaya/Makefile.svg
1.26      cvs       675: fi
                    676: 
1.47      cvs       677: if test "$with_annot" = "yes" ; then
                    678:     AC_SUBST_FILE(annot_frag)
1.48      cvs       679:     annot_frag=$srcdir/annotlib/Makefile.annot
1.47      cvs       680: else
                    681:     AC_SUBST_FILE(annot_frag)
                    682:     annot_frag=/dev/null
                    683: fi
                    684: 
1.16      cvs       685: 
1.1       cvs       686: dnl  ***************************************************************
                    687: dnl
                    688: dnl      FINAL STEP : PRODUCE ALL THE MAKEFILES AND CONFIG FILES
                    689: dnl
                    690: dnl  ***************************************************************
                    691: 
                    692: EXTRA_MAKEFILE_IN=
1.2       cvs       693: make_output="Makefile Options.orig:Options.in tools/Makefile \
1.1       cvs       694:        libjpeg/Makefile libpng/Makefile libpng/zlib/Makefile \
1.2       cvs       695:        tools/mkdep/Makefile \
1.1       cvs       696:        tools/cextract-1.7/Makefile thotlib/Makefile \
1.5       cvs       697:        thotlib/include/Makefile batch/Makefile tablelib/Makefile"
1.1       cvs       698: 
                    699: if test "$build_amaya" = "yes" ; then
1.2       cvs       700: 
1.19      cvs       701:     make_output="$make_output amaya/Makefile pluginlib/Makefile"
1.2       cvs       702:     EXTRA_MAKEFILE_IN="$srcdir/amaya/Makefile.in \
1.27      cvs       703: $srcdir/amaya/Makefile.libwww"
                    704: 
                    705:     if test "$$with_plugin" = "yes" ; then
                    706:        make_output="$make_output pluginlib/Makefile"
                    707:        EXTRA_MAKEFILE_IN="$srcdir/pluginlib/Makefile.in \
1.2       cvs       708: $srcdir/pluginlib/Makefile.plugin"
1.27      cvs       709:     fi
1.2       cvs       710: 
1.48      cvs       711:     if test "$with_annot" = "yes" ; then
                    712:        make_output="$make_output annotlib/Makefile"
                    713:        EXTRA_MAKEFILE_IN="$srcdir/annotlib/Makefile.in"
                    714:     fi
1.1       cvs       715: fi
                    716: 
                    717: AC_SUBST(EXTRA_MAKEFILE_IN)
1.6       cvs       718: AC_OUTPUT($make_output , [
                    719: dnl
                    720: dnl This fragment of shell code is executed after the
                    721: dnl Makefile(s) dump ...
                    722: dnl
                    723: 
                    724: echo timestamp > stamp-h
                    725: 
                    726: dnl
                    727: dnl Check for an upgrade in the Options numbers
                    728: dnl
                    729: 
                    730: if test -f Options ; then
                    731:    oldversion=`grep Version Options`
                    732:    newversion=`grep Version Options.orig`
                    733:    if test "$oldversion" != "$newversion" ; then
                    734:        echo WARNING : Options files have changed, old options saved to Options.old
                    735:        cp Options Options.old
                    736:        cp Options.orig Options
                    737:        exit 1
                    738:    fi
                    739: fi
                    740: ])
1.1       cvs       741: 
                    742: if test "$build_amaya" = "yes" ; then
1.50      cvs       743:     echo Amaya configured with libWWW
                    744:     if test "$with_plugin" = "yes" ; then
                    745:         echo Amaya configured with Plugins support
1.8       cvs       746:     fi
1.10      cvs       747:     if test "$with_math" = "yes" ; then
                    748:        echo Amaya configured with Math support
1.26      cvs       749:     fi
1.68      vatton    750:     if test "$with_svg" = "yes" ; then
                    751:        echo Amaya configured with SVG support
1.47      cvs       752:     fi
                    753:     if test "$with_annot" = "yes" ; then
                    754:        echo Amaya configured with Annotations support
1.1       cvs       755:     fi
1.5       cvs       756: fi
                    757: 
                    758: if test "$no_motif" = yes ; then
1.67      vatton    759:     echo "Amaya configured with GTK"
                    760: else
                    761: if test "$no_motif" = yes ; then
1.5       cvs       762:     echo "Motif seems not installed on this machine"
1.61      cvs       763:     echo "Amaya need Motif 1.2 or 2.0"
1.5       cvs       764: else
                    765: if test "$motif_includes" = "" ; then
                    766:     echo "Motif includes were not found"
1.61      cvs       767:     echo "Amaya might not compile"
1.5       cvs       768:     echo "Edit your Option file"
                    769: else
                    770: if test "$motif_libraries" = "" ; then
                    771:     echo "Motif libraries were not found"
1.61      cvs       772:     echo "Amaya might not compile"
1.5       cvs       773:     echo "Edit your Option file"
1.67      vatton    774: fi
1.5       cvs       775: fi
                    776: fi
1.1       cvs       777: fi
                    778: 
1.69    ! kahan     779: echo "Now type \"make all\" (GNU make preferably) to build the binaries"
1.48      cvs       780: 
                    781: 
                    782: 
1.5       cvs       783: 

Webmaster