Annotation of Amaya/configure.in, revision 1.70

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

Webmaster