Annotation of Amaya/configure.in, revision 1.71

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     \
1.71    ! vatton    301:     /sw/Lesstif/Motif2.0/include \
1.4       cvs       302:                               \
                    303:     /usr/motif/include        \
                    304:                               \
                    305:     /usr/X11R6/include        \
                    306:     /usr/X11R5/include        \
                    307:                               \
                    308:     /usr/include/X11R6        \
                    309:     /usr/include/X11R5        \
                    310:                               \
                    311:     /usr/local/X11R6/include  \
                    312:     /usr/local/X11R5/include  \
                    313:                               \
                    314:     /usr/local/include/X11R6  \
                    315:     /usr/local/include/X11R5  \
                    316:                               \
                    317:     /usr/X11/include          \
                    318:     /usr/include/X11          \
                    319:     /usr/local/X11/include    \
                    320:     /usr/local/include/X11    \
                    321:                               \
                    322:     /usr/X386/include         \
                    323:     /usr/x386/include         \
                    324:     /usr/XFree86/include/X11  \
                    325:                               \
                    326:     /usr/dt/include           \
                    327:                               \
                    328:     /usr/include              \
                    329:     /usr/local/include        \
                    330:     /usr/unsupported/include  \
                    331:     /usr/athena/include       \
                    332:     /usr/local/x11r5/include  \
                    333:     /usr/lpp/Xamples/include  \
1.14      cvs       334:                               \
                    335:     /usr/lesstif/include      \
                    336:     /usr/local/lesstif/include\
                    337:     /usr/gnu/lesstif/include  \
                    338:     $HOME/lesstif/include     \
1.4       cvs       339:     ; \
                    340:   do
                    341:     if test -r "$ac_dir/$motif_direct_test_include"; then
                    342:       no_motif= ac_motif_includes=$ac_dir
                    343:       break
                    344:     fi
                    345:   done
                    346: 
                    347: # Check for the libraries.
                    348: # See if we find them without any special options.
                    349: # Don't add to $LIBS permanently.
                    350: ac_save_LIBS="$LIBS"
                    351: LIBS="-l$motif_direct_test_library $LIBS"
                    352: # First see if replacing the include by lib works.
                    353: for ac_dir in `echo "$ac_motif_includes" | sed s/include/lib/` \
                    354:     /usr/lib/Motif1.2     \
                    355:     /usr/Motif1.2/lib     \
1.71    ! vatton    356:     /sw/Lesstif/Motif2.0/lib \
1.4       cvs       357:                           \
                    358:     /usr/motif/lib        \
                    359:                           \
                    360:     /usr/X11R6/lib        \
                    361:     /usr/X11R5/lib        \
                    362:                           \
                    363:     /usr/lib/X11R6        \
                    364:     /usr/lib/X11R5        \
                    365:                           \
                    366:     /usr/local/X11R6/lib  \
                    367:     /usr/local/X11R5/lib  \
                    368:                           \
                    369:     /usr/local/lib/X11R6  \
                    370:     /usr/local/lib/X11R5  \
                    371:                           \
                    372:     /usr/X11/lib          \
                    373:     /usr/lib/X11          \
                    374:     /usr/local/X11/lib    \
                    375:                           \
                    376:     /usr/X386/lib         \
                    377:     /usr/x386/lib         \
                    378:     /usr/XFree86/lib/X11  \
                    379:                           \
                    380:     /usr/lib              \
                    381:     /usr/local/lib        \
                    382:     /usr/unsupported/lib  \
                    383:     /usr/athena/lib       \
                    384:     /usr/local/x11r5/lib  \
                    385:     /usr/lpp/Xamples/lib  \
1.14      cvs       386:                           \
                    387:     /usr/lesstif/lib      \
                    388:     /usr/local/lesstif/lib\
                    389:     /usr/gnu/lesstif/lib  \
                    390:     $HOME/lesstif/lib     \
1.4       cvs       391:     ; \
                    392: do
1.71    ! vatton    393:   for ac_extension in a so sl la; do
1.4       cvs       394:     if test -r $ac_dir/lib${motif_direct_test_library}.$ac_extension; then
                    395:       no_motif= ac_motif_libraries=$ac_dir
                    396:       break 2
                    397:     fi
                    398:   done
1.5       cvs       399: done
                    400: LIBS="$ac_save_LIBS"
                    401: ])
1.4       cvs       402: 
                    403: AC_DEFUN(AC_PATH_MOTIF,
1.66      vatton    404: [AC_REQUIRE_CPP()
1.4       cvs       405: 
                    406: motif_includes=NONE
                    407: motif_libraries=NONE
                    408: 
                    409: AC_MSG_CHECKING(for Motif)
1.63      vatton    410: if test "x$motif_includes" != xNONE && test "x$motif_libraries" != xNONE; then
                    411:     no_motif=
1.4       cvs       412: else
                    413: AC_CACHE_VAL(ac_cv_path_motif,
                    414: [# One or both of these vars are not set, and there is no cached value.
1.63      vatton    415:   no_motif=yes
1.4       cvs       416: AC_PATH_MOTIF_DIRECT
                    417: 
                    418: if test "$no_motif" = yes; then
1.63      vatton    419:     ac_cv_path_motif="no_motif=yes"
1.4       cvs       420: else
1.63      vatton    421:     ac_cv_path_motif="no_motif= ac_motif_includes=$ac_motif_includes ac_motif_libraries=$ac_motif_libraries"
1.66      vatton    422: fi])
                    423: eval "$ac_cv_path_motif"
1.63      vatton    424: fi
1.4       cvs       425: 
                    426: if test "$no_motif" = yes; then
                    427:   AC_MSG_RESULT(no)
1.5       cvs       428:   MOTIF_INCLUDES=
                    429:   MOTIF_LIBRARIES=
1.4       cvs       430: else
                    431:   test "x$motif_includes" = xNONE && motif_includes=$ac_motif_includes
                    432:   test "x$motif_libraries" = xNONE && motif_libraries=$ac_motif_libraries
                    433:   ac_cv_path_motif="no_motif= ac_motif_includes=$motif_includes ac_motif_libraries=$motif_libraries"
                    434:   AC_MSG_RESULT([libraries $motif_libraries, headers $motif_includes])
1.5       cvs       435:   if test "$motif_includes" != "/usr/include" ; then
                    436:     MOTIF_INCLUDES="-I$motif_includes"
                    437:   fi
                    438:   if test "$motif_libraries" != "/usr/lib" ; then
1.64      cvs       439:     MOTIF_LIBRARIES="-L$motif_libraries -lXm"
1.19      cvs       440:     case "${host}" in
                    441:         *-*sun-solaris* )
                    442:          MOTIF_LIBRARIES="${MOTIF_LIBRARIES} -R$motif_libraries"
                    443:         ;;
1.65      cvs       444:     esac
                    445:   else
                    446:   MOTIF_LIBRARIES="-lXm"
1.5       cvs       447:   fi
1.4       cvs       448: fi
1.5       cvs       449: AC_SUBST(MOTIF_INCLUDES)
                    450: AC_SUBST(MOTIF_LIBRARIES)
1.4       cvs       451: ])
                    452: 
                    453: AC_PATH_MOTIF
1.66      vatton    454: fi
1.4       cvs       455: 
1.63      vatton    456: if test "${GCC}" = "yes"; then
                    457:    CPP="${CPP} -x c"
                    458: fi
                    459: 
1.1       cvs       460: dnl  ***************************************************************
                    461: dnl
1.61      cvs       462: dnl    SPECIFIC STUFF : CONFIGURATION OPTIONS FOR AMAYA
1.1       cvs       463: dnl
                    464: dnl  ***************************************************************
                    465: 
1.68      vatton    466: AMAYA_VER="6.0"
1.1       cvs       467: 
                    468: dnl
1.6       cvs       469: dnl We use a special versoin of cextract patched for alignment
                    470: dnl to build the signatures of the modules functions located in f subdirs
                    471: dnl
                    472: CEXTRACT_VER="1.7"
                    473: CEXTRACT_FLAGS="+O"
                    474: 
1.3       cvs       475: 
                    476: dnl
1.9       cvs       477: dnl Adjust the some variables depending on the host and compiler
1.61      cvs       478: dnl Thotlib NEED signed chars !!!
1.7       cvs       479: dnl
                    480: 
                    481: if test "${CC}" = "gcc" ; then
1.44      cvs       482:   CFLAGS="${CFLAGS} -W "
1.7       cvs       483:   case "${host}" in
                    484:       *-*-irix5* | *-*irix6* )
                    485:          CFLAGS="${CFLAGS} -fsigned-char"
                    486:       ;;
                    487:   esac
1.14      cvs       488: fi
                    489: 
                    490: if test "$ac_cv_c_const" = "no" ; then
                    491:   CFLAGS="${CFLAGS} -DCONST= "
1.7       cvs       492: fi
                    493: 
                    494: dnl
1.61      cvs       495: dnl Check for availability of amaya sources
1.1       cvs       496: dnl
                    497: 
                    498: build_amaya="yes"
                    499: 
                    500: if test "$with_amaya" = "no" ; then
                    501:     build_amaya="no"
1.45      cvs       502: else
                    503:   if test ! -f $srcdir/amaya/Makefile.in ; then
1.1       cvs       504:     AC_MSG_WARN(Amaya browser/editor sources not found, disabling Amaya build !)
                    505:     build_amaya="no"
1.45      cvs       506:   fi
1.1       cvs       507: fi
                    508: 
1.45      cvs       509:  
1.1       cvs       510: dnl
1.50      cvs       511: dnl Check for additionnal packages
1.1       cvs       512: dnl use AC_CONFIG_SUBDIRS to launch configure in the subdir
                    513: dnl
1.70      kahan     514: AC_ARG_ENABLE(svg,           [  --disable-svg           remove SVG support ])
                    515: AC_ARG_ENABLE(annot,         [  --disable-annot         remove Annotations support ])
                    516: AC_ARG_ENABLE(generic-xml,   [  --disable-generic-xml   remove Generic XML support ])
                    517: AC_ARG_ENABLE(annot-threads, [  --disable-annot-threads remove annotation threads ])
                    518: AC_ARG_ENABLE(i18n,          [  --with-18n              enable I18N support (experimental) ])
1.1       cvs       519: 
1.8       cvs       520: dnl
1.21      cvs       521: dnl plugins support is disabled by default
1.8       cvs       522: dnl
1.13      cvs       523: 
                    524: if test "$with_plugin" = "" ; then
1.21      cvs       525:   if test "$enable_plugin" = "yes" ; then
1.55      kahan     526:     with_plugin="yes"
1.21      cvs       527:   else
1.17      cvs       528:     with_plugin="no"
                    529:   fi
1.10      cvs       530: fi  
1.1       cvs       531: 
1.8       cvs       532: dnl
1.68      vatton    533: dnl svg is enabled by default
1.26      cvs       534: dnl
1.68      vatton    535: if test "$with_svg" = "" ; then
                    536:     if test "$enable_svg" = "no" ; then
                    537:        with_svg="no"
1.49      cvs       538:     else
1.68      vatton    539:        with_svg="yes"
1.26      cvs       540:     fi
                    541: fi
                    542: 
                    543: dnl
1.56      kahan     544: dnl annotations is enabled by default
1.47      cvs       545: dnl
                    546: if test "$with_annot" = "" ; then
1.56      kahan     547:     if test "$enable_annot" = "no" ; then
                    548:        with_annot="no"
                    549:     else
1.54      cvs       550:        with_annot="yes"
1.47      cvs       551:     fi
                    552: fi
                    553: 
1.70      kahan     554: dnl
                    555: dnl Generic XML support enabled by default
                    556: dnl
                    557: if test "$with_generic_xml" = "" ; then
                    558:     if test "$enable_generic_xml" = "no" ; then
                    559:        with_generic_xml="no"
                    560:        GENERIC_XML_OPTIONS=
                    561:     else
                    562:        with_generic_xml="yes"
                    563:        GENERIC_XML_OPTIONS=-DXML_GENERIC
                    564:     fi
                    565: fi
                    566: 
                    567: dnl
                    568: dnl Annotation thread support disabled by default
                    569: dnl
                    570: if test "$with_annot_threads" = "" ; then
                    571:     if test "$enable_annot_threads" = "yes" ; then
                    572:        with_annot_threads="yes"
                    573:        ANNOT_THREAD_OPTIONS=-DANNOT_ON_ANNOT
                    574:     else
                    575:        with_annot_threads="no"
                    576:        ANNOT_THREAD_OPTIONS=
                    577:     fi
                    578: fi
                    579: 
                    580: dnl
                    581: dnl I18N support disabled by default
                    582: dnl
                    583: if test "$with_i18n" = "" ; then
                    584:     if test "$enable_i18n" = "yes" ; then
                    585:        with_i18n="yes"
                    586:        I18N_OPTIONS=-D_I18N_
                    587:     else
                    588:        with_i18n="no"
                    589:        I18N_OPTIONS=""
                    590:     fi
                    591: fi
1.22      cvs       592: 
1.19      cvs       593: if test "$build_amaya" = "yes" ; then
1.43      cvs       594:     if test ! -f $srcdir/../libwww/Makefile.in ; then
1.50      cvs       595:        AC_MSG_WARN(libwww sources not found !!)
                    596:        AC_MSG_WARN(Disabling Amaya build !)
                    597:        build_amaya="no"
1.1       cvs       598:     fi
1.8       cvs       599: 
                    600:     if test ! -f $srcdir/amaya/MathML.S ; then
1.10      cvs       601:        if test "$with_math" = "yes" ; then
1.8       cvs       602:            AC_MSG_WARN(MathML sources not found !!)
1.26      cvs       603:            AC_MSG_WARN(Disabling Math build !)
1.10      cvs       604:            with_math="no"
                    605:            MATH_OPTIONS=
1.8       cvs       606:        fi
                    607:     fi
1.26      cvs       608: 
1.68      vatton    609:     if test ! -f $srcdir/amaya/SVG.S ; then
                    610:        if test "$with_svg" = "yes" ; then
                    611:            AC_MSG_WARN(SVG sources not found !!)
                    612:            AC_MSG_WARN(Disabling SVG build !)
                    613:            with_svg="no"
                    614:            SVG_OPTIONS=
1.26      cvs       615:        fi
                    616:     fi
                    617: 
1.48      cvs       618:     if test ! -f $srcdir/annotlib/Makefile.in ; then
1.47      cvs       619:        if test "$with_annot" = "yes" ; then
                    620:            AC_MSG_WARN(Annotation makefile not found !!)
                    621:            AC_MSG_WARN(Disabling Annotations build !)
                    622:            with_annot="no"
                    623:        fi
                    624:     fi
1.55      kahan     625: 
1.70      kahan     626:     if test "$with_annot" = "no" -a "$with_annot_threads" = "yes" ; then
                    627:        AC_MSG_WARN(You must select the annotation support to have threads)
                    628:        AC_MSG_WARN(Disabling annotation thread support)
                    629:        with_annot_threads="no"
                    630:        ANNOT_THREAD_OPTIONS=
                    631:     fi
                    632: 
1.55      kahan     633:     if test "$with_plugin" = "yes" ; then
                    634:         AC_MSG_WARN(The plugin library isn't supported anymore in Amaya !!)
                    635:        AC_MSG_WARN(Disabling plugin build !)
                    636:        with_plugin="no"
                    637:     fi
                    638: 
1.1       cvs       639: fi
                    640: 
                    641: dnl
                    642: dnl The options for each library or binary
                    643: dnl
                    644: 
1.70      kahan     645: THOT_OPTIONS="$GTK_OPTIONS $I18N_OPTIONS"
                    646: AMAYA_OPTIONS="$MATH_OPTIONS $SVG_OPTIONS $GTK_OPTIONS $GENERIC_XML_OPTIONS $I18N_OPTIONS $ANNOT_THREAD_OPTIONS"
1.58      cvs       647: #PLUGIN_OPTIONS="-DPLUGIN_TRACE -DXP_UNIX"
1.70      kahan     648: AMAYA_ANNOT_OPTIONS="$ANNOT_THREAD_OPTIONS"
1.1       cvs       649: IMGLIBS="-ljpeg -lpng -lz"
1.3       cvs       650: EXTRA_LIBS=
1.1       cvs       651: 
                    652: dnl
                    653: dnl Set up the PATHs needed
                    654: dnl
                    655: 
                    656: API="\$(THOTDIR)/thotlib/include"
                    657: VAR="\$(THOTDIR)/thotlib/internals/var"
                    658: INCL="\$(THOTDIR)/thotlib/internals/h"
                    659: FUNC="\$(THOTDIR)/thotlib/internals/f"
1.58      cvs       660: if test "${LIBPNG}" = "../libpng.a" ; then
1.52      cvs       661: #there is a modified header file we need
1.1       cvs       662: PNGINCL="-I\$(THOTDIR)/libpng -I\$(THOTDIR)/libpng/zlib"
1.58      cvs       663: fi
                    664: if test "${LIBJPEG}" = "../libjpeg.a" ; then
                    665: #there is a modified header file we need
                    666: JPEGINCL="-I\$(THOTDIR)/libjpeg"
                    667: fi
1.1       cvs       668: 
                    669: dnl
                    670: dnl Set up the include variables.
                    671: dnl
                    672: 
1.61      cvs       673: THOTINCLUDES="-I${API} -I${VAR} -I${INCL} -I${FUNC} ${JPEGINCL} ${PNGINCL}"
1.58      cvs       674: APIINCLUDES=-I${API}
                    675:  
                    676: if test "${VPATHOPT}" = "" ; then
1.1       cvs       677:        VPATHOPT="VPATH"
                    678: fi
                    679: 
                    680: dnl
                    681: dnl Exports the current values of the variables.
                    682: dnl
                    683: 
                    684: AC_SUBST(AMAYA_VER)
1.6       cvs       685: AC_SUBST(CEXTRACT_VER)
                    686: AC_SUBST(CEXTRACT_FLAGS)
1.1       cvs       687: 
                    688: AC_SUBST(THOTINCLUDES)
                    689: AC_SUBST(APIINCLUDES)
                    690: AC_SUBST(VPATHOPT)
                    691: 
1.63      vatton    692: AC_SUBST(GTK_OPTIONS)
1.1       cvs       693: AC_SUBST(THOT_OPTIONS)
                    694: AC_SUBST(AMAYA_OPTIONS)
                    695: AC_SUBST(PLUGIN_OPTIONS)
1.48      cvs       696: AC_SUBST(AMAYA_ANNOT_OPTIONS)
1.1       cvs       697: AC_SUBST(IMGLIBS)
1.3       cvs       698: AC_SUBST(EXTRA_LIBS)
1.1       cvs       699: 
                    700: dnl
1.48      cvs       701: dnl Include the option Makefile.xxx fragment according to the configure options
1.1       cvs       702: dnl
                    703: 
                    704: if test "$with_plugin" = "yes" ; then
1.50      cvs       705:     AC_SUBST_FILE(plugin_frag)
1.1       cvs       706:     plugin_frag=$srcdir/pluginlib/Makefile.plugin
                    707: else
                    708:     AC_SUBST_FILE(plugin_frag)
                    709:     plugin_frag=/dev/null
                    710: fi
                    711: 
                    712:     AC_SUBST_FILE(www_frag)
1.49      cvs       713:     www_frag=$srcdir/amaya/Makefile.libwww
1.1       cvs       714: 
1.50      cvs       715: if test "$with_math" = "no" ; then
1.10      cvs       716:     AC_SUBST_FILE(math_frag)
1.50      cvs       717:     math_frag=/dev/null
1.8       cvs       718: else
1.10      cvs       719:     AC_SUBST_FILE(math_frag)
1.50      cvs       720:     math_frag=$srcdir/amaya/Makefile.math
1.8       cvs       721: fi
                    722: 
1.68      vatton    723: if test "$with_svg" = "no" ; then
                    724:     AC_SUBST_FILE(svg_frag)
                    725:     svg_frag=/dev/null
1.26      cvs       726: else
1.68      vatton    727:     AC_SUBST_FILE(svg_frag)
                    728:     svg_frag=$srcdir/amaya/Makefile.svg
1.26      cvs       729: fi
                    730: 
1.47      cvs       731: if test "$with_annot" = "yes" ; then
                    732:     AC_SUBST_FILE(annot_frag)
1.48      cvs       733:     annot_frag=$srcdir/annotlib/Makefile.annot
1.47      cvs       734: else
                    735:     AC_SUBST_FILE(annot_frag)
                    736:     annot_frag=/dev/null
                    737: fi
                    738: 
1.16      cvs       739: 
1.1       cvs       740: dnl  ***************************************************************
                    741: dnl
                    742: dnl      FINAL STEP : PRODUCE ALL THE MAKEFILES AND CONFIG FILES
                    743: dnl
                    744: dnl  ***************************************************************
                    745: 
                    746: EXTRA_MAKEFILE_IN=
1.2       cvs       747: make_output="Makefile Options.orig:Options.in tools/Makefile \
1.1       cvs       748:        libjpeg/Makefile libpng/Makefile libpng/zlib/Makefile \
1.2       cvs       749:        tools/mkdep/Makefile \
1.1       cvs       750:        tools/cextract-1.7/Makefile thotlib/Makefile \
1.5       cvs       751:        thotlib/include/Makefile batch/Makefile tablelib/Makefile"
1.1       cvs       752: 
                    753: if test "$build_amaya" = "yes" ; then
1.2       cvs       754: 
1.19      cvs       755:     make_output="$make_output amaya/Makefile pluginlib/Makefile"
1.2       cvs       756:     EXTRA_MAKEFILE_IN="$srcdir/amaya/Makefile.in \
1.27      cvs       757: $srcdir/amaya/Makefile.libwww"
                    758: 
                    759:     if test "$$with_plugin" = "yes" ; then
                    760:        make_output="$make_output pluginlib/Makefile"
                    761:        EXTRA_MAKEFILE_IN="$srcdir/pluginlib/Makefile.in \
1.2       cvs       762: $srcdir/pluginlib/Makefile.plugin"
1.27      cvs       763:     fi
1.2       cvs       764: 
1.48      cvs       765:     if test "$with_annot" = "yes" ; then
                    766:        make_output="$make_output annotlib/Makefile"
                    767:        EXTRA_MAKEFILE_IN="$srcdir/annotlib/Makefile.in"
                    768:     fi
1.1       cvs       769: fi
                    770: 
                    771: AC_SUBST(EXTRA_MAKEFILE_IN)
1.6       cvs       772: AC_OUTPUT($make_output , [
                    773: dnl
                    774: dnl This fragment of shell code is executed after the
                    775: dnl Makefile(s) dump ...
                    776: dnl
                    777: 
                    778: echo timestamp > stamp-h
                    779: 
                    780: dnl
                    781: dnl Check for an upgrade in the Options numbers
                    782: dnl
                    783: 
                    784: if test -f Options ; then
                    785:    oldversion=`grep Version Options`
                    786:    newversion=`grep Version Options.orig`
                    787:    if test "$oldversion" != "$newversion" ; then
                    788:        echo WARNING : Options files have changed, old options saved to Options.old
                    789:        cp Options Options.old
                    790:        cp Options.orig Options
                    791:        exit 1
                    792:    fi
                    793: fi
                    794: ])
1.1       cvs       795: 
                    796: if test "$build_amaya" = "yes" ; then
1.50      cvs       797:     echo Amaya configured with libWWW
                    798:     if test "$with_plugin" = "yes" ; then
                    799:         echo Amaya configured with Plugins support
1.8       cvs       800:     fi
1.10      cvs       801:     if test "$with_math" = "yes" ; then
                    802:        echo Amaya configured with Math support
1.26      cvs       803:     fi
1.68      vatton    804:     if test "$with_svg" = "yes" ; then
                    805:        echo Amaya configured with SVG support
1.47      cvs       806:     fi
                    807:     if test "$with_annot" = "yes" ; then
                    808:        echo Amaya configured with Annotations support
1.70      kahan     809:     fi
                    810:     if test "$with_annot_threads" = "yes" ; then
                    811:        echo Amaya configured with Annotation threads support
                    812:     fi
                    813:     if test "$with_generic_xml" = "yes" ; then
                    814:        echo Amaya configured with generic XML suppport
                    815:     fi
                    816:     if test "$with_i18n" = "yes" ; then
                    817:        echo Amaya configured with I18N suppport \(experimental\)
1.1       cvs       818:     fi
1.5       cvs       819: fi
                    820: 
                    821: if test "$no_motif" = yes ; then
1.67      vatton    822:     echo "Amaya configured with GTK"
                    823: else
                    824: if test "$no_motif" = yes ; then
1.5       cvs       825:     echo "Motif seems not installed on this machine"
1.61      cvs       826:     echo "Amaya need Motif 1.2 or 2.0"
1.5       cvs       827: else
                    828: if test "$motif_includes" = "" ; then
                    829:     echo "Motif includes were not found"
1.61      cvs       830:     echo "Amaya might not compile"
1.5       cvs       831:     echo "Edit your Option file"
                    832: else
                    833: if test "$motif_libraries" = "" ; then
                    834:     echo "Motif libraries were not found"
1.61      cvs       835:     echo "Amaya might not compile"
1.5       cvs       836:     echo "Edit your Option file"
1.67      vatton    837: fi
1.5       cvs       838: fi
                    839: fi
1.1       cvs       840: fi
                    841: 
1.69      kahan     842: echo "Now type \"make all\" (GNU make preferably) to build the binaries"
1.48      cvs       843: 
                    844: 
                    845: 
1.5       cvs       846: 

Webmaster