Annotation of Amaya/configure.in, revision 1.52

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

Webmaster