Annotation of Amaya/configure.in, revision 1.83

1.1       cvs         1: dnl
                      2: dnl Process this file with autoconf to produce a configure script.
                      3: dnl Autoconf script for Amaya and Thot.
1.10      cvs         4: dnl Daniel Veillard and Irene Vatton, 1997
1.1       cvs         5: dnl
                      6: 
                      7: dnl  ***************************************************************
                      8: dnl
                      9: dnl    GENERIC AUTOCONF STUFF : GUESS INFORMATIONS ON SYSTEM SETUP
                     10: dnl
                     11: dnl  ***************************************************************
                     12: 
                     13: AC_PREREQ(2.2)
                     14: AC_INIT(thotlib/internals/h/constpiv.h)
                     15: AC_REVISION
                     16: 
                     17: dnl
1.69      kahan      18: dnl Verify that configure is not being called in the Amaya directory
                     19: dnl
                     20: if test -d batch -a -f configure.in ; then
1.70      kahan      21:    echo 
                     22:    echo "****************************************************************"
1.69      kahan      23:    echo ERROR: You must invoke the configure script in a subidrectory
                     24:    echo under the Amaya tree.
                     25:    echo For example:
                     26:    echo "  cd Amaya ; mkdir obj ; cd obj ; ../configure [your options] "
1.70      kahan      27:    echo "****************************************************************"
                     28:    echo 
1.69      kahan      29:    exit 1
                     30: fi
                     31: 
                     32: dnl
1.1       cvs        33: dnl Checks for platform information
                     34: dnl
                     35: 
                     36: AC_CANONICAL_SYSTEM
                     37: AC_CONFIG_HEADER(config.h)
                     38: 
                     39: dnl
                     40: dnl Initializing Automake
                     41: dnl
                     42: 
                     43: AC_PROG_MAKE_SET
                     44: AC_ARG_PROGRAM
                     45: 
                     46: dnl
                     47: dnl Checks for programs.
                     48: dnl
                     49: 
                     50: AC_PROG_YACC
                     51: AC_PROG_CC
                     52: AC_PROG_CPP
                     53: AC_PROG_LEX
                     54: AC_PROG_AWK
                     55: AC_PROG_INSTALL
                     56: AC_PROG_LN_S
                     57: AC_PROG_MAKE_SET
                     58: AC_PROG_RANLIB
                     59: AC_PATH_PROG(CP, cp, /bin/cp, $PATH:/bin:/usr/bin:/usr/ucb/bin)
                     60: AC_PATH_PROG(MV, mv, /bin/mv, $PATH:/bin:/usr/bin:/usr/ucb/bin)
                     61: AC_PATH_PROG(RM, rm, /bin/rm, $PATH:/bin:/usr/bin:/usr/ucb/bin)
                     62: AC_PATH_PROG(MKDIR, mkdir, /bin/mkdir, $PATH:/bin:/usr/bin:/usr/ucb/bin)
                     63: AC_PATH_PROG(ECHO, echo, /bin/echo, $PATH:/bin:/usr/bin:/usr/ucb/bin)
                     64: AC_PATH_PROG(CAT, cat, /bin/cat, $PATH:/bin:/usr/bin:/usr/ucb/bin)
                     65: AC_PATH_PROG(CHMOD, chmod, /bin/chmod, $PATH:/bin:/usr/bin:/usr/ucb/bin)
                     66: AC_PATH_PROG(SED, sed, /bin/sed, $PATH:/bin:/usr/bin:/usr/ucb/bin)
                     67: AC_PATH_PROG(AR, ar, /usr/bin/ar, $PATH:/bin:/usr/bin:/usr/ucb/bin)
1.6       cvs        68: AC_PATH_PROG(DIFF, diff, /usr/bin/diff, $PATH:/bin:/usr/bin:/usr/ucb/bin)
1.1       cvs        69: 
                     70: dnl
                     71: dnl Checks for libraries.
                     72: dnl
                     73: 
                     74: AC_CHECK_LIB(socket, socket, )
                     75: AC_CHECK_LIB(inet, connect)
                     76: AC_CHECK_LIB(nsl, t_accept)
                     77: AC_CHECK_LIB(dl, dlopen)
                     78: AC_PATH_X
                     79: AC_PATH_XTRA
                     80: 
1.41      cvs        81: dnl
                     82: dnl Check for libXp
                     83: dnl
1.38      cvs        84: 
1.41      cvs        85: for ac_dir in               \
                     86:   /usr/X11R6/lib        \
                     87:   /usr/X11R5/lib        \
                     88:                             \
                     89:   /usr/lib/X11R6        \
                     90:   /usr/lib/X11R5        \
                     91:                             \
                     92:   /usr/local/X11R6/lib  \
                     93:   /usr/local/X11R5/lib  \
                     94:                             \
                     95:   /usr/local/lib/X11R6  \
                     96:   /usr/local/lib/X11R5  \
                     97:                             \
                     98:   /usr/X11/lib          \
                     99:   /usr/lib/X11          \
                    100:   /usr/local/X11/lib    \
                    101:   /usr/local/lib/X11    \
                    102:                             \
                    103:   /usr/X386/lib         \
                    104:   /usr/x386/lib         \
                    105:   /usr/XFree86/lib/X11  \
                    106:                             \
                    107:   /usr/dt/lib           \
                    108:                             \
                    109:   /usr/lib              \
                    110:   /usr/local/lib        \
                    111:   /usr/unsupported/lib  \
                    112:   /usr/athena/lib       \
                    113:   /usr/local/x11r5/lib  \
                    114:   /usr/lpp/Xamples/lib  \
                    115:                             \
                    116:   /usr/lesstif/lib      \
                    117:   /usr/local/lesstif/lib\
                    118:   /usr/gnu/lesstif/lib  \
                    119:   $HOME/lesstif/lib     \
                    120:   ; \
                    121: do
                    122:   if test -r "$ac_dir/libXp.a" -o -r "$ac_dir/libXp.so"; then
                    123:      echo "\nfound libXp.a\n"
                    124:      X_PRE_LIBS="-lXp ${X_PRE_LIBS}"
                    125:      break
                    126:   fi
                    127: done
1.1       cvs       128: dnl
1.5       cvs       129: dnl Checks for header files.
                    130: dnl
                    131: 
                    132: AC_HEADER_DIRENT
                    133: AC_HEADER_STDC
                    134: AC_HEADER_SYS_WAIT
                    135: 
                    136: AC_CHECK_HEADERS(stdio.h)
                    137: AC_CHECK_HEADERS(sys/types.h types.h)
                    138: AC_CHECK_HEADERS(sys/unistd.h unistd.h)
                    139: AC_CHECK_HEADERS(sys/fcntl.h fcntl.h)
                    140: AC_CHECK_HEADERS(sys/limits.h limits.h)
                    141: AC_CHECK_HEADERS(sys/stat.h stat.h)
                    142: AC_CHECK_HEADERS(sys/file.h)
                    143: AC_CHECK_HEADERS(sys/ioctl.h)
                    144: AC_CHECK_HEADERS(sys/time.h time.h)
                    145: AC_CHECK_HEADERS(sys/systeminfo.h)
1.46      cvs       146: AC_CHECK_HEADERS(sys/string.h strings.h)
1.34      cvs       147: AC_CHECK_HEADERS(sys/syslog.h syslog.h)
1.5       cvs       148: AC_CHECK_HEADERS(sys/socket.h socket.h)
                    149: AC_CHECK_HEADERS(appkit/appkit.h appkit.h)
1.72      vatton    150: AC_CHECK_HEADERS(apppkit/apppkit.h apppkit.h)
1.5       cvs       151: AC_CHECK_HEADERS(netinet/in.h in.h)
                    152: AC_CHECK_HEADERS(dn.h)
                    153: AC_CHECK_HEADERS(sys/ipc.h)
                    154: AC_CHECK_HEADERS(net/errno.h sys/errno.h errno.h)
                    155: AC_CHECK_HEADERS(pwd.h)
                    156: AC_CHECK_HEADERS(grp.h)
                    157: AC_CHECK_HEADERS(arpa/inet.h inet.h)
                    158: AC_CHECK_HEADERS(netdb.h)
                    159: AC_CHECK_HEADERS(manifest.h)
                    160: AC_CHECK_HEADERS(bsdtypes.h)
                    161: AC_CHECK_HEADERS(stdefs.h)
                    162: AC_CHECK_HEADERS(bsdtime.h)
                    163: AC_CHECK_HEADERS(sys/select.h select.h)
                    164: AC_CHECK_HEADERS(dnetdb.h)
                    165: AC_CHECK_HEADERS(libc.h)
                    166: AC_CHECK_HEADERS(stdlib.h)
                    167: AC_CHECK_HEADERS(malloc.h)
                    168: AC_CHECK_HEADERS(memory.h)
                    169: AC_CHECK_HEADERS(unixlib.h)
                    170: AC_CHECK_HEADERS(ctype.h)
                    171: AC_CHECK_HEADERS(cursesX.h curses.h)
                    172: AC_CHECK_HEADERS(sys/resource.h resource.h)
                    173: AC_HEADER_DIRENT
                    174: AC_CHECK_HEADERS(dir.h direct.h) dnl AC_HEADER_DIRENT only checks for some..
                    175: AC_HEADER_STDC
                    176: AC_HEADER_SYS_WAIT
                    177: AC_HEADER_TIME
                    178: AC_HEADER_STAT
                    179: 
                    180: dnl
                    181: dnl Checks for typedefs, structures, and compiler characteristics.
                    182: dnl
                    183: 
                    184: AC_C_CONST
                    185: AC_C_INLINE
                    186: AC_TYPE_MODE_T
                    187: AC_TYPE_OFF_T
                    188: AC_TYPE_SIZE_T
                    189: AC_HEADER_TIME
                    190: AC_STRUCT_TM
                    191: AC_STRUCT_TIMEZONE
                    192: AC_TYPE_UID_T
                    193: 
                    194: dnl
                    195: dnl Checks for library functions.
                    196: dnl
                    197: 
                    198: AC_FUNC_ALLOCA
                    199: AC_TYPE_GETGROUPS
                    200: AC_PROG_GCC_TRADITIONAL
                    201: AC_FUNC_MEMCMP
                    202: AC_FUNC_MMAP
                    203: AC_TYPE_SIGNAL
                    204: AC_FUNC_VPRINTF
1.58      cvs       205: AC_CHECK_FUNCS(getcwd gethostname gettimeofday getwd mkdir mktime putenv select socket strdup strerror strftime strstr strtod strtol uname lstat strcasecmp strncasecmp strchr memcpy)
1.5       cvs       206: 
1.75      cheyroul  207: 
1.63      vatton    208: GTK_OPTIONS=
                    209: AC_ARG_WITH(gtk, [  --with-gtk              use GTK instead of Motif])
                    210: if test "$withval" = "yes" ; then
                    211:   for ac_dir in               \
1.65      cvs       212:     /usr/lib/glib/include     \
1.63      vatton    213:     /usr/X11R6/include        \
                    214:                               \
                    215:     /usr/include/X11R6        \
                    216:     /usr/local/X11R6/include  \
                    217:     /usr/local/include/X11R6  \
                    218:                               \
                    219:     /usr/X11/include          \
                    220:     /usr/include/X11          \
                    221:     /usr/local/X11/include    \
                    222:     /usr/local/include/X11    \
                    223:                               \
                    224:     /usr/X386/include         \
                    225:     /usr/x386/include         \
                    226:     /usr/XFree86/include/X11  \
                    227:     /usr/dt/include           \
                    228:     /usr/include              \
                    229:     /usr/local/include        \
                    230:     /usr/local/lib/glib/include  \
                    231:     ; \
                    232:   do
                    233:     if test -r "$ac_dir/gdk/gdk.h"; then
                    234:       no_gtk= ac_gtk_includes=$ac_dir
                    235:       break
                    236:     fi
                    237:   done
                    238: 
1.65      cvs       239: GTK_INCLUDES="`gtk-config --cflags`"
1.63      vatton    240: AC_SUBST(GTK_INCLUDES)
1.65      cvs       241: GTK_LIBRARIES="`gtk-config --libs` -lgdk_imlib -ltiff -lgif"
1.63      vatton    242: AC_SUBST(GTK_LIBRARIES)
1.65      cvs       243: GTK_OPTIONS=-D_GTK
1.63      vatton    244:   no_motif=yes
1.76      vatton    245:   no_graphic=yes
1.63      vatton    246: else
1.5       cvs       247: dnl
1.4       cvs       248: dnl Checking for Motif libraries and includes
                    249: dnl
                    250: dnl Borrowed from Lesstif configure.in
                    251: dnl Lesstif is a Great Project (TM)
                    252: dnl
                    253: 
                    254: AC_DEFUN(AC_PATH_MOTIF_DIRECT,
                    255: [test -z "$motif_direct_test_library" && motif_direct_test_library=Xm
                    256: test -z "$motif_direct_test_function" && motif_direct_test_function=XmCreatePushButton
                    257: test -z "$motif_direct_test_include" && motif_direct_test_include=Xm/Xm.h
                    258:   for ac_dir in               \
                    259:     /usr/include/Motif1.2     \
                    260:     /usr/Motif1.2/include     \
1.71      vatton    261:     /sw/Lesstif/Motif2.0/include \
1.4       cvs       262:                               \
                    263:     /usr/motif/include        \
                    264:                               \
                    265:     /usr/X11R6/include        \
                    266:     /usr/X11R5/include        \
                    267:                               \
                    268:     /usr/include/X11R6        \
                    269:     /usr/include/X11R5        \
                    270:                               \
                    271:     /usr/local/X11R6/include  \
                    272:     /usr/local/X11R5/include  \
                    273:                               \
                    274:     /usr/local/include/X11R6  \
                    275:     /usr/local/include/X11R5  \
                    276:                               \
                    277:     /usr/X11/include          \
                    278:     /usr/include/X11          \
                    279:     /usr/local/X11/include    \
                    280:     /usr/local/include/X11    \
                    281:                               \
                    282:     /usr/X386/include         \
                    283:     /usr/x386/include         \
                    284:     /usr/XFree86/include/X11  \
                    285:                               \
                    286:     /usr/dt/include           \
                    287:                               \
                    288:     /usr/include              \
                    289:     /usr/local/include        \
                    290:     /usr/unsupported/include  \
                    291:     /usr/athena/include       \
                    292:     /usr/local/x11r5/include  \
                    293:     /usr/lpp/Xamples/include  \
1.14      cvs       294:                               \
                    295:     /usr/lesstif/include      \
                    296:     /usr/local/lesstif/include\
                    297:     /usr/gnu/lesstif/include  \
                    298:     $HOME/lesstif/include     \
1.4       cvs       299:     ; \
                    300:   do
                    301:     if test -r "$ac_dir/$motif_direct_test_include"; then
                    302:       no_motif= ac_motif_includes=$ac_dir
                    303:       break
                    304:     fi
                    305:   done
                    306: 
                    307: # Check for the libraries.
                    308: # See if we find them without any special options.
                    309: # Don't add to $LIBS permanently.
                    310: ac_save_LIBS="$LIBS"
                    311: LIBS="-l$motif_direct_test_library $LIBS"
                    312: # First see if replacing the include by lib works.
                    313: for ac_dir in `echo "$ac_motif_includes" | sed s/include/lib/` \
                    314:     /usr/lib/Motif1.2     \
                    315:     /usr/Motif1.2/lib     \
1.71      vatton    316:     /sw/Lesstif/Motif2.0/lib \
1.4       cvs       317:                           \
                    318:     /usr/motif/lib        \
                    319:                           \
                    320:     /usr/X11R6/lib        \
                    321:     /usr/X11R5/lib        \
                    322:                           \
                    323:     /usr/lib/X11R6        \
                    324:     /usr/lib/X11R5        \
                    325:                           \
                    326:     /usr/local/X11R6/lib  \
                    327:     /usr/local/X11R5/lib  \
                    328:                           \
                    329:     /usr/local/lib/X11R6  \
                    330:     /usr/local/lib/X11R5  \
                    331:                           \
                    332:     /usr/X11/lib          \
                    333:     /usr/lib/X11          \
                    334:     /usr/local/X11/lib    \
                    335:                           \
                    336:     /usr/X386/lib         \
                    337:     /usr/x386/lib         \
                    338:     /usr/XFree86/lib/X11  \
                    339:                           \
                    340:     /usr/lib              \
                    341:     /usr/local/lib        \
                    342:     /usr/unsupported/lib  \
                    343:     /usr/athena/lib       \
                    344:     /usr/local/x11r5/lib  \
                    345:     /usr/lpp/Xamples/lib  \
1.14      cvs       346:                           \
                    347:     /usr/lesstif/lib      \
                    348:     /usr/local/lesstif/lib\
                    349:     /usr/gnu/lesstif/lib  \
                    350:     $HOME/lesstif/lib     \
1.4       cvs       351:     ; \
                    352: do
1.71      vatton    353:   for ac_extension in a so sl la; do
1.4       cvs       354:     if test -r $ac_dir/lib${motif_direct_test_library}.$ac_extension; then
                    355:       no_motif= ac_motif_libraries=$ac_dir
                    356:       break 2
                    357:     fi
                    358:   done
1.5       cvs       359: done
                    360: LIBS="$ac_save_LIBS"
                    361: ])
1.4       cvs       362: 
                    363: AC_DEFUN(AC_PATH_MOTIF,
1.66      vatton    364: [AC_REQUIRE_CPP()
1.4       cvs       365: 
                    366: motif_includes=NONE
                    367: motif_libraries=NONE
                    368: 
                    369: AC_MSG_CHECKING(for Motif)
1.63      vatton    370: if test "x$motif_includes" != xNONE && test "x$motif_libraries" != xNONE; then
                    371:     no_motif=
1.4       cvs       372: else
                    373: AC_CACHE_VAL(ac_cv_path_motif,
                    374: [# One or both of these vars are not set, and there is no cached value.
1.63      vatton    375:   no_motif=yes
1.4       cvs       376: AC_PATH_MOTIF_DIRECT
                    377: 
                    378: if test "$no_motif" = yes; then
1.63      vatton    379:     ac_cv_path_motif="no_motif=yes"
1.4       cvs       380: else
1.63      vatton    381:     ac_cv_path_motif="no_motif= ac_motif_includes=$ac_motif_includes ac_motif_libraries=$ac_motif_libraries"
1.66      vatton    382: fi])
                    383: eval "$ac_cv_path_motif"
1.63      vatton    384: fi
1.4       cvs       385: 
                    386: if test "$no_motif" = yes; then
                    387:   AC_MSG_RESULT(no)
1.5       cvs       388:   MOTIF_INCLUDES=
                    389:   MOTIF_LIBRARIES=
1.4       cvs       390: else
                    391:   test "x$motif_includes" = xNONE && motif_includes=$ac_motif_includes
                    392:   test "x$motif_libraries" = xNONE && motif_libraries=$ac_motif_libraries
                    393:   ac_cv_path_motif="no_motif= ac_motif_includes=$motif_includes ac_motif_libraries=$motif_libraries"
                    394:   AC_MSG_RESULT([libraries $motif_libraries, headers $motif_includes])
1.5       cvs       395:   if test "$motif_includes" != "/usr/include" ; then
                    396:     MOTIF_INCLUDES="-I$motif_includes"
                    397:   fi
                    398:   if test "$motif_libraries" != "/usr/lib" ; then
1.64      cvs       399:     MOTIF_LIBRARIES="-L$motif_libraries -lXm"
1.19      cvs       400:     case "${host}" in
                    401:         *-*sun-solaris* )
                    402:          MOTIF_LIBRARIES="${MOTIF_LIBRARIES} -R$motif_libraries"
                    403:         ;;
1.65      cvs       404:     esac
                    405:   else
                    406:   MOTIF_LIBRARIES="-lXm"
1.5       cvs       407:   fi
1.4       cvs       408: fi
1.5       cvs       409: AC_SUBST(MOTIF_INCLUDES)
                    410: AC_SUBST(MOTIF_LIBRARIES)
1.4       cvs       411: ])
                    412: 
                    413: AC_PATH_MOTIF
1.66      vatton    414: fi
1.4       cvs       415: 
1.63      vatton    416: if test "${GCC}" = "yes"; then
                    417:    CPP="${CPP} -x c"
                    418: fi
                    419: 
1.1       cvs       420: dnl  ***************************************************************
                    421: dnl
1.61      cvs       422: dnl    SPECIFIC STUFF : CONFIGURATION OPTIONS FOR AMAYA
1.1       cvs       423: dnl
                    424: dnl  ***************************************************************
                    425: 
1.76      vatton    426: AC_ARG_WITH(graphic-libs, [  --without-graphic-libs    doesn't use provided libjpeg, libpng.])
                    427: if test "$withval" = "no" ; then
1.83    ! vatton    428:   no_graphic=yes
        !           429: fi
        !           430: if test "$withval" = "yes" ; then
        !           431:   no_graphic=no
1.76      vatton    432: fi
                    433: 
                    434: if test "$no_graphic" = yes; then
                    435: dnl
                    436:     AC_MSG_CHECKING([for libjpeg version = 6b])
                    437:     AC_EGREP_CPP([x 62 *x],
                    438:         [#include <jpeglib.h>
                    439:          x JPEG_LIB_VERSION x],
                    440: dnl
                    441:         AC_MSG_RESULT([yes])
                    442:         LIBJPEG='-ljpeg'
                    443:         MAKEJPEG=['#'],
                    444: dnl
                    445:         AC_MSG_RESULT([no])
                    446:         LIBJPEG='../libjpeg.a'      dnl LIBJPEG goes into amaya/Makefile.in
                    447:         )
                    448: dnl    
                    449: dnl
                    450:     AC_MSG_CHECKING([for libpng version = 1.0.x])
                    451:     AC_EGREP_CPP([x \"1.0\..*\" *x],
                    452:         [#include <png.h>
                    453:        x PNG_LIBPNG_VER_STRING x],
                    454: dnl
                    455:         AC_MSG_RESULT([yes])
                    456:         LIBPNG='-lpng'
                    457:         LIBZ=''
                    458:        MAKEPNG=['#'],
                    459: dnl
                    460:         AC_MSG_RESULT([no])
                    461:         LIBPNG='../libpng.a'
                    462:         LIBZ='../libz.a'
                    463:         )
                    464: else
                    465:     LIBJPEG='../libjpeg.a'
                    466:     LIBPNG='../libpng.a'
                    467:     LIBZ='../libz.a'
                    468: fi
                    469: dnl
                    470: AC_SUBST(LIBJPEG)
                    471: AC_SUBST(LIBPNG)
                    472: AC_SUBST(LIBZ)
                    473: AC_SUBST(MAKEJPEG)
                    474: AC_SUBST(MAKEPNG)
                    475: 
1.68      vatton    476: AMAYA_VER="6.0"
1.1       cvs       477: 
                    478: dnl
1.6       cvs       479: dnl We use a special versoin of cextract patched for alignment
                    480: dnl to build the signatures of the modules functions located in f subdirs
                    481: dnl
                    482: CEXTRACT_VER="1.7"
                    483: CEXTRACT_FLAGS="+O"
                    484: 
1.3       cvs       485: 
                    486: dnl
1.9       cvs       487: dnl Adjust the some variables depending on the host and compiler
1.61      cvs       488: dnl Thotlib NEED signed chars !!!
1.7       cvs       489: dnl
                    490: 
                    491: if test "${CC}" = "gcc" ; then
1.44      cvs       492:   CFLAGS="${CFLAGS} -W "
1.7       cvs       493:   case "${host}" in
                    494:       *-*-irix5* | *-*irix6* )
                    495:          CFLAGS="${CFLAGS} -fsigned-char"
                    496:       ;;
                    497:   esac
1.14      cvs       498: fi
                    499: 
                    500: if test "$ac_cv_c_const" = "no" ; then
                    501:   CFLAGS="${CFLAGS} -DCONST= "
1.7       cvs       502: fi
                    503: 
                    504: dnl
1.61      cvs       505: dnl Check for availability of amaya sources
1.1       cvs       506: dnl
                    507: 
                    508: build_amaya="yes"
                    509: 
                    510: if test "$with_amaya" = "no" ; then
                    511:     build_amaya="no"
1.45      cvs       512: else
                    513:   if test ! -f $srcdir/amaya/Makefile.in ; then
1.1       cvs       514:     AC_MSG_WARN(Amaya browser/editor sources not found, disabling Amaya build !)
                    515:     build_amaya="no"
1.45      cvs       516:   fi
1.1       cvs       517: fi
                    518: 
                    519: dnl
1.50      cvs       520: dnl Check for additionnal packages
1.1       cvs       521: dnl use AC_CONFIG_SUBDIRS to launch configure in the subdir
                    522: dnl
1.82      vatton    523: AC_ARG_WITH(i18n,            [  --without-i18n          disable internationalization support ])
1.76      vatton    524: dnl
                    525: dnl I18N support disabled by default
                    526: dnl
1.77      kahan     527: 
                    528: if test "$with_i18n" = "" ; then
1.82      vatton    529:   if test "$enable_i18n" = "no" ; then
                    530:     with_i18n="no"
                    531:   else
1.77      kahan     532:     with_i18n="yes"
                    533:   fi
                    534: 
                    535: fi  
1.76      vatton    536: if test "$with_i18n" = "yes" ; then
                    537:    I18N_OPTIONS=-D_I18N_
                    538: else
                    539:    with_i18n="no"
                    540:    I18N_OPTIONS=""
                    541: fi
1.1       cvs       542: 
1.76      vatton    543: AC_ARG_WITH(GL,              [  --with-gl               enable Opengl canvas (experimental) ])
1.8       cvs       544: dnl
1.75      cheyroul  545: dnl GL canvas is disabled by default
                    546: dnl
1.79      cheyroul  547: dnl needs Opengl, glu, Xft (xfree 4 font server)
1.75      cheyroul  548: dnl needs GTK
                    549: dnl text WILL need freetype2, ftgl
                    550: dnl GL is for opengl
                    551: dnl Glu is for text drawing (until we switch) 
                    552: dnl GLU is for tesselation algortihms (until we extract it from this lib)
                    553: dnl (tesselation is used for polygons with holes in it...)
                    554: dnl gtkgl is for integration of opengl in GTK
                    555: if test "$with_gl" = "" ; then
                    556:  if test "$enable_gl" = "yes" ; then
                    557:     with_gl="yes"
                    558:   else
                    559:     with_gl="no"
                    560:   fi
                    561: fi  
                    562: if test "$with_gl" = "yes" ; then
                    563:        AC_MSG_CHECKING([OpenGL])
                    564:        for ac_dir in                           \
                    565:                /usr/include                    \
                    566:                /usr/X11R6/include              \
                    567:                /usr/local/include              \
                    568:                ; \
1.80      cheyroul  569:        do  if test -r "$ac_dir/GL/gl.h" ; then
1.75      cheyroul  570:                 gl_inc="yes"
1.80      cheyroul  571:                GL_INC_I="$ac_dir"
                    572:                if test "$ac_dir" != "/usr/include" ; then
                    573:                   GL_INCLUDES="-I$ac_dir"
                    574:                fi
1.75      cheyroul  575:                        break   
                    576:            fi
1.80      cheyroul  577:        done    
                    578:        AC_MSG_CHECKING([GLU])  
1.75      cheyroul  579:        for ac_dir in                           \
                    580:                /usr/include/GL                 \
                    581:                /usr/include                    \
                    582:                /usr/X11R6/include/GL           \
                    583:                /usr/X11R6/include              \
                    584:                /usr/local/include              \
                    585:                /usr/local/include/GL           \
                    586:                ; \
                    587:        do  if test -r "$ac_dir/glu.h" ; then
                    588:                 glu_inc="yes"
1.80      cheyroul  589:                GL_INC_II="$ac_dir"
                    590:                if test "$ac_dir" != "/usr/include" ; then
                    591:                        if test "$ac_dir" != "$GL_INC_I" ; then
                    592:                            GL_INCLUDES="$GL_INCLUDES -I$ac_dir"
                    593:                        fi
                    594:                fi
1.75      cheyroul  595:                        break   
                    596:            fi
                    597:        done    
1.80      cheyroul  598:        AC_MSG_CHECKING([GTKGLAREA])    
1.75      cheyroul  599:        for ac_dir in                           \
                    600:                /usr/include/GL                 \
                    601:                /usr/include                    \
                    602:                /usr/X11R6/include/GL           \
                    603:                /usr/X11R6/include              \
                    604:                /usr/local/include              \
                    605:                /usr/local/include/GL           \
                    606:                ; \
                    607:        do  if test -r "$ac_dir/gtkgl/gtkglarea.h" ; then
                    608:                 gtkgl_inc="yes"
1.80      cheyroul  609:                if test "$ac_dir" != "/usr/include" ; then
                    610:                        if test "$ac_dir" != "$GL_INC_II" ; then
                    611:                                if test "$ac_dir" != "$GL_INC_I" ; then
                    612:                                        GL_INCLUDES="$GL_INCLUDES -I$ac_dir"
                    613:                                fi
                    614:                        fi
                    615:                fi
1.75      cheyroul  616:                        break   
                    617:            fi
                    618:        done    
1.80      cheyroul  619:        AC_MSG_CHECKING([freetype])     
                    620:        for ac_dir in                           \
                    621:                /usr/include                    \
                    622:                /usr/X11R6/include              \
                    623:                /usr/local/include              \
                    624:                ; \
                    625:        do  if test -r "$ac_dir/ft2build.h" ; then
                    626:                 freetype_inc="yes"
                    627:                GL_INCLUDES="$GL_INCLUDES `freetype-config --cflags`"
                    628:                        break   
                    629:            fi
                    630:        done            
1.75      cheyroul  631:        if test "$gl_inc" = "" ; then
                    632:                AC_MSG_WARN(Opengl headers (gl.h) not found !!)
                    633:                AC_MSG_WARN(Disabling opengl build !)
                    634:                with_gl="no"
                    635:                GL_OPTIONS=     
                    636:                GL_INCLUDES=    
                    637:                GL_LIBRARIES=
1.81      cheyroul  638:                exit 1;
1.75      cheyroul  639:        fi
                    640:        if test "$glu_inc" = "" ; then
                    641:                AC_MSG_WARN(Glu headers (glu.h) not found !!)
                    642:                AC_MSG_WARN(Disabling opengl build !)
1.81      cheyroul  643:        
1.75      cheyroul  644:                with_gl="no"
                    645:                GL_OPTIONS=     
                    646:                GL_INCLUDES=    
                    647:                GL_LIBRARIES=
1.81      cheyroul  648:                exit 1;
1.75      cheyroul  649:        fi
                    650:        if test "$gtkgl_inc" = "" ; then
                    651:                AC_MSG_WARN(Gtkglarea headers (gktglarea.h) not found !!)
                    652:                AC_MSG_WARN(Disabling opengl build !)
                    653:                with_gl="no"
                    654:                GL_OPTIONS=     
                    655:                GL_INCLUDES=    
                    656:                GL_LIBRARIES=
1.81      cheyroul  657:                exit 1;
1.75      cheyroul  658:        fi
1.80      cheyroul  659:        if test "$freetype_inc" = "" ; then
                    660:                AC_MSG_WARN(Freetype 2 headers (ft2build.h) not found !!)
                    661:                AC_MSG_WARN(Disabling opengl build !)
                    662:                with_gl="no"
                    663:                GL_OPTIONS=     
                    664:                GL_INCLUDES=
                    665:                GL_LIBRARIES=
1.81      cheyroul  666:                exit 1;
1.80      cheyroul  667:        fi
1.75      cheyroul  668:        if test "$gl_inc" = "yes" ; then
1.79      cheyroul  669:                if test "$glu_inc" = "yes" ; then
                    670:                        if test "$gtkgl_inc" = "yes" ; then
1.80      cheyroul  671:                            if test "$freetype_inc" = "yes" ; then      
                    672:                                GL_LIBRARIES=" -lXmu -lXft -lfreetype -lGL -lGLU -lgtkgl "
1.79      cheyroul  673:                                GL_OPTIONS=-D_GL 
                    674:                                no_motif=yes
1.80      cheyroul  675:                            fi
1.75      cheyroul  676:                        fi
                    677:                fi
                    678:        fi
                    679: AC_SUBST(GL_INCLUDES)
                    680: AC_SUBST(GL_LIBRARIES)
                    681: fi
1.76      vatton    682: 
                    683: AC_ARG_ENABLE(svg,           [  --disable-svg           remove SVG support ])
                    684: AC_ARG_ENABLE(annot,         [  --disable-annot         remove Annotations support ])
                    685: AC_ARG_ENABLE(generic-xml,   [  --disable-generic-xml   remove Generic XML support ])
                    686: AC_ARG_ENABLE(annot-threads, [  --disable-annot-threads remove annotation threads ])
                    687: 
1.75      cheyroul  688: dnl
1.21      cvs       689: dnl plugins support is disabled by default
1.8       cvs       690: dnl
1.13      cvs       691: 
                    692: if test "$with_plugin" = "" ; then
1.21      cvs       693:   if test "$enable_plugin" = "yes" ; then
1.55      kahan     694:     with_plugin="yes"
1.21      cvs       695:   else
1.17      cvs       696:     with_plugin="no"
                    697:   fi
1.10      cvs       698: fi  
1.1       cvs       699: 
1.8       cvs       700: dnl
1.68      vatton    701: dnl svg is enabled by default
1.26      cvs       702: dnl
1.68      vatton    703: if test "$with_svg" = "" ; then
                    704:     if test "$enable_svg" = "no" ; then
                    705:        with_svg="no"
1.49      cvs       706:     else
1.68      vatton    707:        with_svg="yes"
1.26      cvs       708:     fi
                    709: fi
                    710: 
                    711: dnl
1.56      kahan     712: dnl annotations is enabled by default
1.47      cvs       713: dnl
                    714: if test "$with_annot" = "" ; then
1.56      kahan     715:     if test "$enable_annot" = "no" ; then
                    716:        with_annot="no"
                    717:     else
1.54      cvs       718:        with_annot="yes"
1.47      cvs       719:     fi
                    720: fi
                    721: 
1.70      kahan     722: dnl
                    723: dnl Generic XML support enabled by default
                    724: dnl
                    725: if test "$with_generic_xml" = "" ; then
                    726:     if test "$enable_generic_xml" = "no" ; then
                    727:        with_generic_xml="no"
                    728:        GENERIC_XML_OPTIONS=
                    729:     else
                    730:        with_generic_xml="yes"
                    731:        GENERIC_XML_OPTIONS=-DXML_GENERIC
                    732:     fi
                    733: fi
                    734: 
                    735: dnl
1.73      kahan     736: dnl Annotation thread support enabled by default
1.70      kahan     737: dnl
                    738: if test "$with_annot_threads" = "" ; then
1.73      kahan     739:     if test "$enable_annot_threads" = "no" ; then
                    740:        with_annot_threads="no"
1.74      kahan     741:        ANNOT_THREAD_OPTIONS=
1.70      kahan     742:     else
1.73      kahan     743:        with_annot_threads="yes"
1.74      kahan     744:        ANNOT_THREAD_OPTIONS=-DANNOT_ON_ANNOT 
1.70      kahan     745:     fi
                    746: fi
                    747: 
1.19      cvs       748: if test "$build_amaya" = "yes" ; then
1.43      cvs       749:     if test ! -f $srcdir/../libwww/Makefile.in ; then
1.50      cvs       750:        AC_MSG_WARN(libwww sources not found !!)
                    751:        AC_MSG_WARN(Disabling Amaya build !)
                    752:        build_amaya="no"
1.1       cvs       753:     fi
1.8       cvs       754: 
                    755:     if test ! -f $srcdir/amaya/MathML.S ; then
1.10      cvs       756:        if test "$with_math" = "yes" ; then
1.8       cvs       757:            AC_MSG_WARN(MathML sources not found !!)
1.26      cvs       758:            AC_MSG_WARN(Disabling Math build !)
1.10      cvs       759:            with_math="no"
                    760:            MATH_OPTIONS=
1.8       cvs       761:        fi
                    762:     fi
1.26      cvs       763: 
1.68      vatton    764:     if test ! -f $srcdir/amaya/SVG.S ; then
                    765:        if test "$with_svg" = "yes" ; then
                    766:            AC_MSG_WARN(SVG sources not found !!)
                    767:            AC_MSG_WARN(Disabling SVG build !)
                    768:            with_svg="no"
                    769:            SVG_OPTIONS=
1.26      cvs       770:        fi
                    771:     fi
                    772: 
1.48      cvs       773:     if test ! -f $srcdir/annotlib/Makefile.in ; then
1.47      cvs       774:        if test "$with_annot" = "yes" ; then
                    775:            AC_MSG_WARN(Annotation makefile not found !!)
                    776:            AC_MSG_WARN(Disabling Annotations build !)
                    777:            with_annot="no"
                    778:        fi
                    779:     fi
1.55      kahan     780: 
1.70      kahan     781:     if test "$with_annot" = "no" -a "$with_annot_threads" = "yes" ; then
                    782:        AC_MSG_WARN(You must select the annotation support to have threads)
                    783:        AC_MSG_WARN(Disabling annotation thread support)
                    784:        with_annot_threads="no"
                    785:        ANNOT_THREAD_OPTIONS=
                    786:     fi
                    787: 
1.55      kahan     788:     if test "$with_plugin" = "yes" ; then
                    789:         AC_MSG_WARN(The plugin library isn't supported anymore in Amaya !!)
                    790:        AC_MSG_WARN(Disabling plugin build !)
                    791:        with_plugin="no"
                    792:     fi
                    793: 
1.1       cvs       794: fi
                    795: 
                    796: dnl
                    797: dnl The options for each library or binary
                    798: dnl
                    799: 
1.75      cheyroul  800: THOT_OPTIONS="$GTK_OPTIONS $I18N_OPTIONS $GL_OPTIONS"
                    801: AMAYA_OPTIONS="$MATH_OPTIONS $SVG_OPTIONS $GTK_OPTIONS $GENERIC_XML_OPTIONS $I18N_OPTIONS $ANNOT_THREAD_OPTIONS $GL_OPTIONS"
1.58      cvs       802: #PLUGIN_OPTIONS="-DPLUGIN_TRACE -DXP_UNIX"
1.70      kahan     803: AMAYA_ANNOT_OPTIONS="$ANNOT_THREAD_OPTIONS"
1.1       cvs       804: IMGLIBS="-ljpeg -lpng -lz"
1.3       cvs       805: EXTRA_LIBS=
1.1       cvs       806: 
                    807: dnl
                    808: dnl Set up the PATHs needed
                    809: dnl
                    810: 
                    811: API="\$(THOTDIR)/thotlib/include"
                    812: VAR="\$(THOTDIR)/thotlib/internals/var"
                    813: INCL="\$(THOTDIR)/thotlib/internals/h"
                    814: FUNC="\$(THOTDIR)/thotlib/internals/f"
1.58      cvs       815: if test "${LIBPNG}" = "../libpng.a" ; then
1.52      cvs       816: #there is a modified header file we need
1.1       cvs       817: PNGINCL="-I\$(THOTDIR)/libpng -I\$(THOTDIR)/libpng/zlib"
1.58      cvs       818: fi
                    819: if test "${LIBJPEG}" = "../libjpeg.a" ; then
                    820: #there is a modified header file we need
                    821: JPEGINCL="-I\$(THOTDIR)/libjpeg"
                    822: fi
1.1       cvs       823: 
                    824: dnl
                    825: dnl Set up the include variables.
                    826: dnl
                    827: 
1.61      cvs       828: THOTINCLUDES="-I${API} -I${VAR} -I${INCL} -I${FUNC} ${JPEGINCL} ${PNGINCL}"
1.58      cvs       829: APIINCLUDES=-I${API}
                    830:  
                    831: if test "${VPATHOPT}" = "" ; then
1.1       cvs       832:        VPATHOPT="VPATH"
                    833: fi
                    834: 
                    835: dnl
                    836: dnl Exports the current values of the variables.
                    837: dnl
                    838: 
                    839: AC_SUBST(AMAYA_VER)
1.6       cvs       840: AC_SUBST(CEXTRACT_VER)
                    841: AC_SUBST(CEXTRACT_FLAGS)
1.1       cvs       842: 
                    843: AC_SUBST(THOTINCLUDES)
                    844: AC_SUBST(APIINCLUDES)
                    845: AC_SUBST(VPATHOPT)
                    846: 
1.63      vatton    847: AC_SUBST(GTK_OPTIONS)
1.1       cvs       848: AC_SUBST(THOT_OPTIONS)
                    849: AC_SUBST(AMAYA_OPTIONS)
                    850: AC_SUBST(PLUGIN_OPTIONS)
1.48      cvs       851: AC_SUBST(AMAYA_ANNOT_OPTIONS)
1.1       cvs       852: AC_SUBST(IMGLIBS)
1.3       cvs       853: AC_SUBST(EXTRA_LIBS)
1.1       cvs       854: 
                    855: dnl
1.48      cvs       856: dnl Include the option Makefile.xxx fragment according to the configure options
1.1       cvs       857: dnl
                    858: 
                    859: if test "$with_plugin" = "yes" ; then
1.50      cvs       860:     AC_SUBST_FILE(plugin_frag)
1.1       cvs       861:     plugin_frag=$srcdir/pluginlib/Makefile.plugin
                    862: else
                    863:     AC_SUBST_FILE(plugin_frag)
                    864:     plugin_frag=/dev/null
                    865: fi
                    866: 
                    867:     AC_SUBST_FILE(www_frag)
1.49      cvs       868:     www_frag=$srcdir/amaya/Makefile.libwww
1.1       cvs       869: 
1.50      cvs       870: if test "$with_math" = "no" ; then
1.10      cvs       871:     AC_SUBST_FILE(math_frag)
1.50      cvs       872:     math_frag=/dev/null
1.8       cvs       873: else
1.10      cvs       874:     AC_SUBST_FILE(math_frag)
1.50      cvs       875:     math_frag=$srcdir/amaya/Makefile.math
1.8       cvs       876: fi
                    877: 
1.68      vatton    878: if test "$with_svg" = "no" ; then
                    879:     AC_SUBST_FILE(svg_frag)
                    880:     svg_frag=/dev/null
1.26      cvs       881: else
1.68      vatton    882:     AC_SUBST_FILE(svg_frag)
                    883:     svg_frag=$srcdir/amaya/Makefile.svg
1.26      cvs       884: fi
                    885: 
1.47      cvs       886: if test "$with_annot" = "yes" ; then
                    887:     AC_SUBST_FILE(annot_frag)
1.48      cvs       888:     annot_frag=$srcdir/annotlib/Makefile.annot
1.47      cvs       889: else
                    890:     AC_SUBST_FILE(annot_frag)
                    891:     annot_frag=/dev/null
                    892: fi
                    893: 
1.16      cvs       894: 
1.1       cvs       895: dnl  ***************************************************************
                    896: dnl
                    897: dnl      FINAL STEP : PRODUCE ALL THE MAKEFILES AND CONFIG FILES
                    898: dnl
                    899: dnl  ***************************************************************
                    900: 
                    901: EXTRA_MAKEFILE_IN=
1.2       cvs       902: make_output="Makefile Options.orig:Options.in tools/Makefile \
1.1       cvs       903:        libjpeg/Makefile libpng/Makefile libpng/zlib/Makefile \
1.2       cvs       904:        tools/mkdep/Makefile \
1.1       cvs       905:        tools/cextract-1.7/Makefile thotlib/Makefile \
1.5       cvs       906:        thotlib/include/Makefile batch/Makefile tablelib/Makefile"
1.1       cvs       907: 
                    908: if test "$build_amaya" = "yes" ; then
1.2       cvs       909: 
1.19      cvs       910:     make_output="$make_output amaya/Makefile pluginlib/Makefile"
1.2       cvs       911:     EXTRA_MAKEFILE_IN="$srcdir/amaya/Makefile.in \
1.27      cvs       912: $srcdir/amaya/Makefile.libwww"
                    913: 
                    914:     if test "$$with_plugin" = "yes" ; then
                    915:        make_output="$make_output pluginlib/Makefile"
                    916:        EXTRA_MAKEFILE_IN="$srcdir/pluginlib/Makefile.in \
1.2       cvs       917: $srcdir/pluginlib/Makefile.plugin"
1.27      cvs       918:     fi
1.2       cvs       919: 
1.48      cvs       920:     if test "$with_annot" = "yes" ; then
                    921:        make_output="$make_output annotlib/Makefile"
                    922:        EXTRA_MAKEFILE_IN="$srcdir/annotlib/Makefile.in"
                    923:     fi
1.1       cvs       924: fi
                    925: 
                    926: AC_SUBST(EXTRA_MAKEFILE_IN)
1.6       cvs       927: AC_OUTPUT($make_output , [
                    928: dnl
                    929: dnl This fragment of shell code is executed after the
                    930: dnl Makefile(s) dump ...
                    931: dnl
                    932: 
                    933: echo timestamp > stamp-h
                    934: 
                    935: dnl
                    936: dnl Check for an upgrade in the Options numbers
                    937: dnl
                    938: 
                    939: if test -f Options ; then
                    940:    oldversion=`grep Version Options`
                    941:    newversion=`grep Version Options.orig`
                    942:    if test "$oldversion" != "$newversion" ; then
                    943:        echo WARNING : Options files have changed, old options saved to Options.old
                    944:        cp Options Options.old
                    945:        cp Options.orig Options
                    946:        exit 1
                    947:    fi
                    948: fi
                    949: ])
1.1       cvs       950: 
                    951: if test "$build_amaya" = "yes" ; then
1.50      cvs       952:     echo Amaya configured with libWWW
                    953:     if test "$with_plugin" = "yes" ; then
                    954:         echo Amaya configured with Plugins support
1.8       cvs       955:     fi
1.10      cvs       956:     if test "$with_math" = "yes" ; then
                    957:        echo Amaya configured with Math support
1.26      cvs       958:     fi
1.68      vatton    959:     if test "$with_svg" = "yes" ; then
                    960:        echo Amaya configured with SVG support
1.47      cvs       961:     fi
                    962:     if test "$with_annot" = "yes" ; then
                    963:        echo Amaya configured with Annotations support
1.70      kahan     964:     fi
                    965:     if test "$with_annot_threads" = "yes" ; then
                    966:        echo Amaya configured with Annotation threads support
                    967:     fi
                    968:     if test "$with_generic_xml" = "yes" ; then
                    969:        echo Amaya configured with generic XML suppport
                    970:     fi
                    971:     if test "$with_i18n" = "yes" ; then
1.82      vatton    972:        echo Amaya configured with internationalization suppport
1.75      cheyroul  973:     fi 
                    974:     if test "$with_gl" = "yes" ; then
                    975:        echo Amaya configured with Opengl Canvas Rendering \(experimental\)
1.1       cvs       976:     fi
1.5       cvs       977: fi
                    978: 
                    979: if test "$no_motif" = yes ; then
1.67      vatton    980:     echo "Amaya configured with GTK"
1.76      vatton    981:     echo "Amaya configured without static graphic libraries (libjpeg, libpng)"
1.67      vatton    982: else
1.76      vatton    983: if test "$no_motif" = yes ; then
                    984:     echo "Amaya configured without static graphic libraries (libjpeg, libpng)"
                    985: fi
1.67      vatton    986: if test "$no_motif" = yes ; then
1.5       cvs       987:     echo "Motif seems not installed on this machine"
1.61      cvs       988:     echo "Amaya need Motif 1.2 or 2.0"
1.5       cvs       989: else
                    990: if test "$motif_includes" = "" ; then
                    991:     echo "Motif includes were not found"
1.61      cvs       992:     echo "Amaya might not compile"
1.5       cvs       993:     echo "Edit your Option file"
                    994: else
                    995: if test "$motif_libraries" = "" ; then
                    996:     echo "Motif libraries were not found"
1.61      cvs       997:     echo "Amaya might not compile"
1.5       cvs       998:     echo "Edit your Option file"
1.67      vatton    999: fi
1.5       cvs      1000: fi
                   1001: fi
1.1       cvs      1002: fi
                   1003: 
1.78      vatton   1004: echo "Now type \"make\" (GNU make preferably) to build the binaries"
1.48      cvs      1005: 
                   1006: 
                   1007: 
1.5       cvs      1008: 

Webmaster