Annotation of Amaya/configure.in, revision 1.123

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: 
1.114     kahan      13: AC_PREREQ(2.53)
1.1       cvs        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
1.122     gully      53: AC_PROG_CXX
1.1       cvs        54: AC_PROG_LEX
                     55: AC_PROG_AWK
                     56: AC_PROG_INSTALL
                     57: AC_PROG_LN_S
                     58: AC_PROG_MAKE_SET
                     59: AC_PROG_RANLIB
                     60: AC_PATH_PROG(CP, cp, /bin/cp, $PATH:/bin:/usr/bin:/usr/ucb/bin)
                     61: AC_PATH_PROG(MV, mv, /bin/mv, $PATH:/bin:/usr/bin:/usr/ucb/bin)
                     62: AC_PATH_PROG(RM, rm, /bin/rm, $PATH:/bin:/usr/bin:/usr/ucb/bin)
                     63: AC_PATH_PROG(MKDIR, mkdir, /bin/mkdir, $PATH:/bin:/usr/bin:/usr/ucb/bin)
                     64: AC_PATH_PROG(ECHO, echo, /bin/echo, $PATH:/bin:/usr/bin:/usr/ucb/bin)
                     65: AC_PATH_PROG(CAT, cat, /bin/cat, $PATH:/bin:/usr/bin:/usr/ucb/bin)
                     66: AC_PATH_PROG(CHMOD, chmod, /bin/chmod, $PATH:/bin:/usr/bin:/usr/ucb/bin)
                     67: AC_PATH_PROG(SED, sed, /bin/sed, $PATH:/bin:/usr/bin:/usr/ucb/bin)
                     68: AC_PATH_PROG(AR, ar, /usr/bin/ar, $PATH:/bin:/usr/bin:/usr/ucb/bin)
1.6       cvs        69: AC_PATH_PROG(DIFF, diff, /usr/bin/diff, $PATH:/bin:/usr/bin:/usr/ucb/bin)
1.1       cvs        70: 
                     71: dnl
                     72: dnl Checks for libraries.
                     73: dnl
                     74: 
                     75: AC_CHECK_LIB(socket, socket, )
                     76: AC_CHECK_LIB(inet, connect)
                     77: AC_CHECK_LIB(nsl, t_accept)
                     78: AC_CHECK_LIB(dl, dlopen)
                     79: AC_PATH_X
                     80: AC_PATH_XTRA
                     81: 
1.41      cvs        82: dnl
                     83: dnl Check for libXp
                     84: dnl
1.38      cvs        85: 
1.41      cvs        86: for ac_dir in               \
                     87:   /usr/X11R6/lib        \
                     88:   /usr/X11R5/lib        \
                     89:                             \
                     90:   /usr/lib/X11R6        \
                     91:   /usr/lib/X11R5        \
                     92:                             \
                     93:   /usr/local/X11R6/lib  \
                     94:   /usr/local/X11R5/lib  \
                     95:                             \
                     96:   /usr/local/lib/X11R6  \
                     97:   /usr/local/lib/X11R5  \
                     98:                             \
                     99:   /usr/X11/lib          \
                    100:   /usr/lib/X11          \
                    101:   /usr/local/X11/lib    \
                    102:   /usr/local/lib/X11    \
                    103:                             \
                    104:   /usr/X386/lib         \
                    105:   /usr/x386/lib         \
                    106:   /usr/XFree86/lib/X11  \
                    107:                             \
                    108:   /usr/dt/lib           \
                    109:                             \
                    110:   /usr/lib              \
                    111:   /usr/local/lib        \
                    112:   /usr/unsupported/lib  \
                    113:   /usr/athena/lib       \
                    114:   /usr/local/x11r5/lib  \
                    115:   /usr/lpp/Xamples/lib  \
                    116:                             \
                    117:   /usr/lesstif/lib      \
                    118:   /usr/local/lesstif/lib\
                    119:   /usr/gnu/lesstif/lib  \
                    120:   $HOME/lesstif/lib     \
                    121:   ; \
                    122: do
                    123:   if test -r "$ac_dir/libXp.a" -o -r "$ac_dir/libXp.so"; then
                    124:      echo "\nfound libXp.a\n"
                    125:      X_PRE_LIBS="-lXp ${X_PRE_LIBS}"
                    126:      break
                    127:   fi
                    128: done
1.1       cvs       129: dnl
1.5       cvs       130: dnl Checks for header files.
                    131: dnl
                    132: 
                    133: AC_HEADER_DIRENT
                    134: AC_HEADER_STDC
                    135: AC_HEADER_SYS_WAIT
                    136: 
                    137: AC_CHECK_HEADERS(stdio.h)
                    138: AC_CHECK_HEADERS(sys/types.h types.h)
                    139: AC_CHECK_HEADERS(sys/unistd.h unistd.h)
                    140: AC_CHECK_HEADERS(sys/fcntl.h fcntl.h)
                    141: AC_CHECK_HEADERS(sys/limits.h limits.h)
                    142: AC_CHECK_HEADERS(sys/stat.h stat.h)
                    143: AC_CHECK_HEADERS(sys/file.h)
                    144: AC_CHECK_HEADERS(sys/ioctl.h)
                    145: AC_CHECK_HEADERS(sys/time.h time.h)
                    146: AC_CHECK_HEADERS(sys/systeminfo.h)
1.46      cvs       147: AC_CHECK_HEADERS(sys/string.h strings.h)
1.34      cvs       148: AC_CHECK_HEADERS(sys/syslog.h syslog.h)
1.5       cvs       149: AC_CHECK_HEADERS(sys/socket.h socket.h)
                    150: AC_CHECK_HEADERS(appkit/appkit.h appkit.h)
1.72      vatton    151: AC_CHECK_HEADERS(apppkit/apppkit.h apppkit.h)
1.5       cvs       152: AC_CHECK_HEADERS(netinet/in.h in.h)
                    153: AC_CHECK_HEADERS(dn.h)
                    154: AC_CHECK_HEADERS(sys/ipc.h)
                    155: AC_CHECK_HEADERS(net/errno.h sys/errno.h errno.h)
                    156: AC_CHECK_HEADERS(pwd.h)
                    157: AC_CHECK_HEADERS(grp.h)
                    158: AC_CHECK_HEADERS(arpa/inet.h inet.h)
                    159: AC_CHECK_HEADERS(netdb.h)
                    160: AC_CHECK_HEADERS(manifest.h)
                    161: AC_CHECK_HEADERS(bsdtypes.h)
                    162: AC_CHECK_HEADERS(stdefs.h)
                    163: AC_CHECK_HEADERS(bsdtime.h)
                    164: AC_CHECK_HEADERS(sys/select.h select.h)
                    165: AC_CHECK_HEADERS(dnetdb.h)
                    166: AC_CHECK_HEADERS(libc.h)
                    167: AC_CHECK_HEADERS(stdlib.h)
                    168: AC_CHECK_HEADERS(malloc.h)
                    169: AC_CHECK_HEADERS(memory.h)
                    170: AC_CHECK_HEADERS(unixlib.h)
                    171: AC_CHECK_HEADERS(ctype.h)
                    172: AC_CHECK_HEADERS(cursesX.h curses.h)
                    173: AC_CHECK_HEADERS(sys/resource.h resource.h)
                    174: AC_HEADER_DIRENT
                    175: AC_CHECK_HEADERS(dir.h direct.h) dnl AC_HEADER_DIRENT only checks for some..
                    176: AC_HEADER_STDC
                    177: AC_HEADER_SYS_WAIT
                    178: AC_HEADER_TIME
                    179: AC_HEADER_STAT
1.103     kahan     180: AC_CHECK_HEADERS(stdint.h)
1.5       cvs       181: 
                    182: dnl
                    183: dnl Checks for typedefs, structures, and compiler characteristics.
                    184: dnl
                    185: 
                    186: AC_C_CONST
                    187: AC_C_INLINE
                    188: AC_TYPE_MODE_T
                    189: AC_TYPE_OFF_T
                    190: AC_TYPE_SIZE_T
                    191: AC_HEADER_TIME
                    192: AC_STRUCT_TM
                    193: AC_STRUCT_TIMEZONE
                    194: AC_TYPE_UID_T
                    195: 
                    196: dnl
                    197: dnl Checks for library functions.
                    198: dnl
                    199: 
                    200: AC_FUNC_ALLOCA
                    201: AC_TYPE_GETGROUPS
                    202: AC_PROG_GCC_TRADITIONAL
                    203: AC_FUNC_MEMCMP
                    204: AC_FUNC_MMAP
                    205: AC_TYPE_SIGNAL
                    206: AC_FUNC_VPRINTF
1.58      cvs       207: 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       208: 
1.85      vatton    209: AC_ARG_WITH(GL,              [  --with-gl               enable Opengl canvas (experimental) ])
                    210: dnl
                    211: dnl GL canvas is disabled by default
                    212: dnl
                    213: dnl needs Opengl, glu, Xft (xfree 4 font server)
                    214: dnl needs GTK
                    215: dnl text WILL need freetype2, ftgl
                    216: dnl GL is for opengl
                    217: dnl Glu is for text drawing (until we switch) 
                    218: dnl GLU is for tesselation algortihms (until we extract it from this lib)
                    219: dnl (tesselation is used for polygons with holes in it...)
                    220: dnl gtkgl is for integration of opengl in GTK
                    221: if test "$with_gl" = "" ; then
                    222:  if test "$enable_gl" = "yes" ; then
                    223:     with_gl="yes"
                    224:   else
                    225:     with_gl="no"
                    226:   fi
                    227: fi  
                    228: 
1.120     gully     229: #GTK_OPTIONS=
                    230: #AC_ARG_WITH(gtk, [  --without-gtk              use Motif instead of GTK])
                    231: #if test "$withval" = "no" ; then
                    232: #  if test "$with_gl" = "yes" ; then
                    233: #    with_gtk="yes"
                    234: #  else
                    235: #    with_gtk="no"
                    236: #  fi
                    237: #else
                    238: #  with_gtk="yes"
                    239: #fi
                    240: 
                    241: # check if gtk gui should be used
                    242: AC_ARG_WITH(gtk, [  --with-gtk              use GTK GUI toolkit ])
                    243: if test "$with_gtk" = "yes" -o "$enable_gtk" = "yes" ; then
                    244:   if test "$withval" = "no" ; then
                    245:     with_gtk="no"
                    246:   else
                    247:     with_gtk="yes"
                    248:   fi
                    249: fi
                    250: 
                    251: # check if motif gui should be used
                    252: AC_ARG_WITH(motif, [  --with-motif            use MOTIF GUI toolkit ])
                    253: if test "$with_motif" = "yes" -o "$enable_motif" = "yes" ; then
                    254:   with_motif="yes"
                    255:   no_motif=no
                    256: fi
                    257: 
                    258: # Check if a GUI toolkit is enabled
                    259: if test "$with_motif" = "no" -o "$with_motif" = "" ; then
                    260:   if test "$with_gtk" = "no" -o "$with_gtk" = "" ; then
                    261:     # Default GUI toolkits
                    262:     with_motif="no"
                    263:     no_motif=yes
1.85      vatton    264:     with_gtk="yes"
                    265:   fi
                    266: fi
                    267: 
1.121     gully     268: # check if no gui is enable
                    269: AC_ARG_WITH(nogui, [  --with-nogui            do not use GUI toolkit ])
                    270: if test "$with_nogui" = "yes" -o "$enable_nogui" = "yes" ; then
                    271:   with_nogui="yes"
                    272:   with_motif="no"
                    273:   no_motif=yes
                    274:   with_gtk="no"
                    275:   NOGUI_OPTIONS="-D_NOGUI"
                    276: fi
                    277: 
1.120     gully     278: if test "$with_motif" = "yes" ; then
                    279:   if test "$with_gtk" = "yes" ; then
                    280:     echo 
                    281:     echo "****************************************************************"
                    282:     echo " ERROR: "
                    283:     echo " More than one GUI toolkit is enable"
                    284:     echo " Only one GUI toolkit should be enable (turn off one)"
                    285:     echo " exemple ok :  ../configure --with-gtk "
                    286:     echo " exemple !ok : ../configure --with-gtk --with-motif"
                    287:     echo "****************************************************************"
                    288:     echo 
                    289:     exit 1
                    290:   fi
                    291:   if test "$with_gl" = "yes" ; then
                    292:     echo 
                    293:     echo "****************************************************************"
                    294:     echo " ERROR: "
                    295:     echo " MOTIF GUI doesn't support OpenGL canvas (turn off --with-gl)"
                    296:     echo "****************************************************************"
                    297:     echo 
                    298:     exit 1
                    299:   fi
                    300: fi
                    301:   
1.85      vatton    302: if test "$with_gtk" = "yes" ; then
1.63      vatton    303:   for ac_dir in               \
1.65      cvs       304:     /usr/lib/glib/include     \
1.63      vatton    305:     /usr/X11R6/include        \
                    306:                               \
                    307:     /usr/include/X11R6        \
                    308:     /usr/local/X11R6/include  \
                    309:     /usr/local/include/X11R6  \
                    310:                               \
                    311:     /usr/X11/include          \
                    312:     /usr/include/X11          \
                    313:     /usr/local/X11/include    \
                    314:     /usr/local/include/X11    \
                    315:                               \
                    316:     /usr/X386/include         \
                    317:     /usr/x386/include         \
                    318:     /usr/XFree86/include/X11  \
                    319:     /usr/dt/include           \
                    320:     /usr/include              \
                    321:     /usr/local/include        \
                    322:     /usr/local/lib/glib/include  \
                    323:     ; \
                    324:   do
                    325:     if test -r "$ac_dir/gdk/gdk.h"; then
                    326:       no_gtk= ac_gtk_includes=$ac_dir
                    327:       break
                    328:     fi
                    329:   done
                    330: 
1.65      cvs       331: GTK_INCLUDES="`gtk-config --cflags`"
1.63      vatton    332: AC_SUBST(GTK_INCLUDES)
1.106     kahan     333: GTK_LIBRARIES="`gtk-config --libs`"
                    334: dnl GL doesn't need the imlib
                    335: if test "${with_gl}" != "yes" ; then
                    336:  GTK_LIBRARIES="${GTK_LIBRARIES} -lgdk_imlib"
                    337: fi
                    338: 
1.63      vatton    339: AC_SUBST(GTK_LIBRARIES)
1.119     vatton    340: GTK_OPTIONS="-D_GTK"
1.63      vatton    341:   no_motif=yes
1.76      vatton    342:   no_graphic=yes
1.120     gully     343: fi
                    344: 
                    345: if test "$with_motif" = "yes" ; then
1.5       cvs       346: dnl
1.4       cvs       347: dnl Checking for Motif libraries and includes
                    348: dnl
                    349: dnl Borrowed from Lesstif configure.in
                    350: dnl Lesstif is a Great Project (TM)
                    351: dnl
                    352: 
                    353: AC_DEFUN(AC_PATH_MOTIF_DIRECT,
                    354: [test -z "$motif_direct_test_library" && motif_direct_test_library=Xm
                    355: test -z "$motif_direct_test_function" && motif_direct_test_function=XmCreatePushButton
                    356: test -z "$motif_direct_test_include" && motif_direct_test_include=Xm/Xm.h
                    357:   for ac_dir in               \
                    358:     /usr/include/Motif1.2     \
                    359:     /usr/Motif1.2/include     \
1.71      vatton    360:     /sw/Lesstif/Motif2.0/include \
1.4       cvs       361:                               \
                    362:     /usr/motif/include        \
                    363:                               \
                    364:     /usr/X11R6/include        \
                    365:     /usr/X11R5/include        \
                    366:                               \
                    367:     /usr/include/X11R6        \
                    368:     /usr/include/X11R5        \
                    369:                               \
                    370:     /usr/local/X11R6/include  \
                    371:     /usr/local/X11R5/include  \
                    372:                               \
                    373:     /usr/local/include/X11R6  \
                    374:     /usr/local/include/X11R5  \
                    375:                               \
                    376:     /usr/X11/include          \
                    377:     /usr/include/X11          \
                    378:     /usr/local/X11/include    \
                    379:     /usr/local/include/X11    \
                    380:                               \
                    381:     /usr/X386/include         \
                    382:     /usr/x386/include         \
                    383:     /usr/XFree86/include/X11  \
                    384:                               \
                    385:     /usr/dt/include           \
                    386:                               \
                    387:     /usr/include              \
                    388:     /usr/local/include        \
                    389:     /usr/unsupported/include  \
                    390:     /usr/athena/include       \
                    391:     /usr/local/x11r5/include  \
                    392:     /usr/lpp/Xamples/include  \
1.14      cvs       393:                               \
                    394:     /usr/lesstif/include      \
                    395:     /usr/local/lesstif/include\
                    396:     /usr/gnu/lesstif/include  \
                    397:     $HOME/lesstif/include     \
1.4       cvs       398:     ; \
                    399:   do
                    400:     if test -r "$ac_dir/$motif_direct_test_include"; then
                    401:       no_motif= ac_motif_includes=$ac_dir
                    402:       break
                    403:     fi
                    404:   done
                    405: 
                    406: # Check for the libraries.
                    407: # See if we find them without any special options.
                    408: # Don't add to $LIBS permanently.
                    409: ac_save_LIBS="$LIBS"
                    410: LIBS="-l$motif_direct_test_library $LIBS"
                    411: # First see if replacing the include by lib works.
                    412: for ac_dir in `echo "$ac_motif_includes" | sed s/include/lib/` \
                    413:     /usr/lib/Motif1.2     \
                    414:     /usr/Motif1.2/lib     \
1.71      vatton    415:     /sw/Lesstif/Motif2.0/lib \
1.4       cvs       416:                           \
                    417:     /usr/motif/lib        \
                    418:                           \
                    419:     /usr/X11R6/lib        \
                    420:     /usr/X11R5/lib        \
                    421:                           \
                    422:     /usr/lib/X11R6        \
                    423:     /usr/lib/X11R5        \
                    424:                           \
                    425:     /usr/local/X11R6/lib  \
                    426:     /usr/local/X11R5/lib  \
                    427:                           \
                    428:     /usr/local/lib/X11R6  \
                    429:     /usr/local/lib/X11R5  \
                    430:                           \
                    431:     /usr/X11/lib          \
                    432:     /usr/lib/X11          \
                    433:     /usr/local/X11/lib    \
                    434:                           \
                    435:     /usr/X386/lib         \
                    436:     /usr/x386/lib         \
                    437:     /usr/XFree86/lib/X11  \
                    438:                           \
                    439:     /usr/lib              \
                    440:     /usr/local/lib        \
                    441:     /usr/unsupported/lib  \
                    442:     /usr/athena/lib       \
                    443:     /usr/local/x11r5/lib  \
                    444:     /usr/lpp/Xamples/lib  \
1.14      cvs       445:                           \
                    446:     /usr/lesstif/lib      \
                    447:     /usr/local/lesstif/lib\
                    448:     /usr/gnu/lesstif/lib  \
                    449:     $HOME/lesstif/lib     \
1.4       cvs       450:     ; \
                    451: do
1.71      vatton    452:   for ac_extension in a so sl la; do
1.4       cvs       453:     if test -r $ac_dir/lib${motif_direct_test_library}.$ac_extension; then
                    454:       no_motif= ac_motif_libraries=$ac_dir
                    455:       break 2
                    456:     fi
                    457:   done
1.5       cvs       458: done
                    459: LIBS="$ac_save_LIBS"
                    460: ])
1.4       cvs       461: 
                    462: AC_DEFUN(AC_PATH_MOTIF,
1.66      vatton    463: [AC_REQUIRE_CPP()
1.4       cvs       464: 
                    465: motif_includes=NONE
                    466: motif_libraries=NONE
                    467: 
                    468: AC_MSG_CHECKING(for Motif)
1.63      vatton    469: if test "x$motif_includes" != xNONE && test "x$motif_libraries" != xNONE; then
                    470:     no_motif=
1.4       cvs       471: else
                    472: AC_CACHE_VAL(ac_cv_path_motif,
                    473: [# One or both of these vars are not set, and there is no cached value.
1.63      vatton    474:   no_motif=yes
1.4       cvs       475: AC_PATH_MOTIF_DIRECT
                    476: 
                    477: if test "$no_motif" = yes; then
1.63      vatton    478:     ac_cv_path_motif="no_motif=yes"
1.4       cvs       479: else
1.63      vatton    480:     ac_cv_path_motif="no_motif= ac_motif_includes=$ac_motif_includes ac_motif_libraries=$ac_motif_libraries"
1.66      vatton    481: fi])
                    482: eval "$ac_cv_path_motif"
1.63      vatton    483: fi
1.4       cvs       484: 
                    485: if test "$no_motif" = yes; then
                    486:   AC_MSG_RESULT(no)
1.5       cvs       487:   MOTIF_INCLUDES=
                    488:   MOTIF_LIBRARIES=
1.4       cvs       489: else
                    490:   test "x$motif_includes" = xNONE && motif_includes=$ac_motif_includes
                    491:   test "x$motif_libraries" = xNONE && motif_libraries=$ac_motif_libraries
                    492:   ac_cv_path_motif="no_motif= ac_motif_includes=$motif_includes ac_motif_libraries=$motif_libraries"
                    493:   AC_MSG_RESULT([libraries $motif_libraries, headers $motif_includes])
1.5       cvs       494:   if test "$motif_includes" != "/usr/include" ; then
                    495:     MOTIF_INCLUDES="-I$motif_includes"
                    496:   fi
                    497:   if test "$motif_libraries" != "/usr/lib" ; then
1.64      cvs       498:     MOTIF_LIBRARIES="-L$motif_libraries -lXm"
1.19      cvs       499:     case "${host}" in
                    500:         *-*sun-solaris* )
                    501:          MOTIF_LIBRARIES="${MOTIF_LIBRARIES} -R$motif_libraries"
                    502:         ;;
1.65      cvs       503:     esac
                    504:   else
                    505:   MOTIF_LIBRARIES="-lXm"
1.5       cvs       506:   fi
1.4       cvs       507: fi
1.5       cvs       508: AC_SUBST(MOTIF_INCLUDES)
                    509: AC_SUBST(MOTIF_LIBRARIES)
1.4       cvs       510: ])
                    511: 
1.120     gully     512: MOTIF_OPTIONS="-D_MOTIF"
                    513: 
1.4       cvs       514: AC_PATH_MOTIF
1.66      vatton    515: fi
1.4       cvs       516: 
1.63      vatton    517: if test "${GCC}" = "yes"; then
                    518:    CPP="${CPP} -x c"
                    519: fi
                    520: 
1.1       cvs       521: dnl  ***************************************************************
                    522: dnl
1.61      cvs       523: dnl    SPECIFIC STUFF : CONFIGURATION OPTIONS FOR AMAYA
1.1       cvs       524: dnl
                    525: dnl  ***************************************************************
                    526: 
1.101     kahan     527: # We don't use our graphic libraries for the pure GTK version (without GL)
                    528: 
1.108     kahan     529: dnl echo "with gtk is ${with_gtk}, with gl is ${with_gl}\n"
1.101     kahan     530: 
                    531: if test "${with_gtk}" != "yes" -o "${with_gl}" = "yes" ; then
1.120     gully     532:   AC_ARG_WITH(graphic-libs, [  --with-graphic-libs     use static libjpeg, libpng.])
1.101     kahan     533:   if test "$withval" = "no" ; then
                    534:     no_graphic=yes
                    535:   fi
                    536:   if test "$withval" = "yes" ; then
                    537:     no_graphic=no
                    538:   fi
1.76      vatton    539: fi
                    540: 
                    541: if test "$no_graphic" = yes; then
                    542: dnl
                    543:     AC_MSG_CHECKING([for libjpeg version = 6b])
                    544:     AC_EGREP_CPP([x 62 *x],
                    545:         [#include <jpeglib.h>
                    546:          x JPEG_LIB_VERSION x],
                    547: dnl
                    548:         AC_MSG_RESULT([yes])
1.105     vatton    549:        JPEGINCL=''
1.76      vatton    550:         LIBJPEG='-ljpeg'
                    551:         MAKEJPEG=['#'],
                    552: dnl
                    553:         AC_MSG_RESULT([no])
1.105     vatton    554:        JPEGINCL='-I$(THOTDIR)/libjpeg'
1.76      vatton    555:         LIBJPEG='../libjpeg.a'      dnl LIBJPEG goes into amaya/Makefile.in
                    556:         )
                    557: dnl    
                    558: dnl
1.95      vatton    559:     AC_MSG_CHECKING([for libpng version = 1.0.x or 1.2.x])
                    560:     AC_EGREP_CPP([x \"1.[02]\..*\" *x],
1.76      vatton    561:         [#include <png.h>
                    562:        x PNG_LIBPNG_VER_STRING x],
                    563: dnl
                    564:         AC_MSG_RESULT([yes])
1.105     vatton    565:        PNGINCL=''
1.76      vatton    566:         LIBPNG='-lpng'
                    567:         LIBZ=''
                    568:        MAKEPNG=['#'],
                    569: dnl
                    570:         AC_MSG_RESULT([no])
1.105     vatton    571:        PNGINCL='-I$(THOTDIR)/libpng -I$(THOTDIR)/libpng/zlib'
1.76      vatton    572:         LIBPNG='../libpng.a'
                    573:         LIBZ='../libz.a'
                    574:         )
                    575: else
1.105     vatton    576:     JPEGINCL='-I$(THOTDIR)/libjpeg'
1.76      vatton    577:     LIBJPEG='../libjpeg.a'
1.105     vatton    578:     PNGINCL='-I$(THOTDIR)/libpng -I$(THOTDIR)/libpng/zlib'
1.76      vatton    579:     LIBPNG='../libpng.a'
                    580:     LIBZ='../libz.a'
                    581: fi
                    582: dnl
                    583: AC_SUBST(LIBJPEG)
                    584: AC_SUBST(LIBPNG)
                    585: AC_SUBST(LIBZ)
                    586: AC_SUBST(MAKEJPEG)
                    587: AC_SUBST(MAKEPNG)
                    588: 
1.119     vatton    589: AMAYA_VER="8.2"
1.1       cvs       590: 
                    591: dnl
1.6       cvs       592: dnl We use a special versoin of cextract patched for alignment
                    593: dnl to build the signatures of the modules functions located in f subdirs
                    594: dnl
                    595: CEXTRACT_VER="1.7"
                    596: CEXTRACT_FLAGS="+O"
                    597: 
1.3       cvs       598: 
                    599: dnl
1.9       cvs       600: dnl Adjust the some variables depending on the host and compiler
1.61      cvs       601: dnl Thotlib NEED signed chars !!!
1.7       cvs       602: dnl
                    603: 
                    604: if test "${CC}" = "gcc" ; then
1.44      cvs       605:   CFLAGS="${CFLAGS} -W "
1.7       cvs       606:   case "${host}" in
                    607:       *-*-irix5* | *-*irix6* )
                    608:          CFLAGS="${CFLAGS} -fsigned-char"
                    609:       ;;
                    610:   esac
1.14      cvs       611: fi
                    612: 
                    613: if test "$ac_cv_c_const" = "no" ; then
                    614:   CFLAGS="${CFLAGS} -DCONST= "
1.7       cvs       615: fi
                    616: 
1.122     gully     617: 
                    618: # force C mode (-x c)
1.123   ! gully     619: CFLAGS="${CFLAGS} -x c"
1.122     gully     620: 
                    621: # C++ options (-x c++)
                    622: CXX_OPTIONS="-D__cplusplus"
1.123   ! gully     623: CXXFLAGS="${CXXFLAGS} -W -x c++ ${CXX_OPTIONS}"
1.122     gully     624: 
1.7       cvs       625: dnl
1.61      cvs       626: dnl Check for availability of amaya sources
1.1       cvs       627: dnl
                    628: 
                    629: build_amaya="yes"
                    630: 
                    631: if test "$with_amaya" = "no" ; then
                    632:     build_amaya="no"
1.45      cvs       633: else
                    634:   if test ! -f $srcdir/amaya/Makefile.in ; then
1.1       cvs       635:     AC_MSG_WARN(Amaya browser/editor sources not found, disabling Amaya build !)
                    636:     build_amaya="no"
1.45      cvs       637:   fi
1.1       cvs       638: fi
                    639: 
                    640: dnl
1.50      cvs       641: dnl Check for additionnal packages
1.1       cvs       642: dnl use AC_CONFIG_SUBDIRS to launch configure in the subdir
                    643: dnl
1.93      kahan     644: 
1.82      vatton    645: AC_ARG_WITH(i18n,            [  --without-i18n          disable internationalization support ])
1.76      vatton    646: dnl
                    647: dnl I18N support disabled by default
                    648: dnl
1.77      kahan     649: 
                    650: if test "$with_i18n" = "" ; then
1.82      vatton    651:   if test "$enable_i18n" = "no" ; then
                    652:     with_i18n="no"
                    653:   else
1.77      kahan     654:     with_i18n="yes"
                    655:   fi
                    656: 
                    657: fi  
1.76      vatton    658: if test "$with_i18n" = "yes" ; then
                    659:    I18N_OPTIONS=-D_I18N_
                    660: else
                    661:    with_i18n="no"
                    662:    I18N_OPTIONS=""
                    663: fi
1.1       cvs       664: 
1.75      cheyroul  665: if test "$with_gl" = "yes" ; then
                    666:        AC_MSG_CHECKING([OpenGL])
                    667:        for ac_dir in                           \
                    668:                /usr/include                    \
                    669:                /usr/X11R6/include              \
                    670:                /usr/local/include              \
                    671:                ; \
1.80      cheyroul  672:        do  if test -r "$ac_dir/GL/gl.h" ; then
1.75      cheyroul  673:                 gl_inc="yes"
1.80      cheyroul  674:                GL_INC_I="$ac_dir"
                    675:                if test "$ac_dir" != "/usr/include" ; then
                    676:                   GL_INCLUDES="-I$ac_dir"
                    677:                fi
1.96      cheyroul  678:                AC_MSG_RESULT([yes])
1.75      cheyroul  679:                        break   
                    680:            fi
1.80      cheyroul  681:        done    
                    682:        AC_MSG_CHECKING([GLU])  
1.75      cheyroul  683:        for ac_dir in                           \
                    684:                /usr/include/GL                 \
                    685:                /usr/include                    \
                    686:                /usr/X11R6/include/GL           \
                    687:                /usr/X11R6/include              \
                    688:                /usr/local/include              \
                    689:                /usr/local/include/GL           \
                    690:                ; \
                    691:        do  if test -r "$ac_dir/glu.h" ; then
                    692:                 glu_inc="yes"
1.80      cheyroul  693:                GL_INC_II="$ac_dir"
                    694:                if test "$ac_dir" != "/usr/include" ; then
                    695:                        if test "$ac_dir" != "$GL_INC_I" ; then
                    696:                            GL_INCLUDES="$GL_INCLUDES -I$ac_dir"
                    697:                        fi
                    698:                fi
1.96      cheyroul  699:                AC_MSG_RESULT([yes])
1.75      cheyroul  700:                        break   
                    701:            fi
                    702:        done    
1.80      cheyroul  703:        AC_MSG_CHECKING([GTKGLAREA])    
1.75      cheyroul  704:        for ac_dir in                           \
                    705:                /usr/include/GL                 \
                    706:                /usr/include                    \
                    707:                /usr/X11R6/include/GL           \
                    708:                /usr/X11R6/include              \
                    709:                /usr/local/include              \
                    710:                /usr/local/include/GL           \
                    711:                ; \
                    712:        do  if test -r "$ac_dir/gtkgl/gtkglarea.h" ; then
                    713:                 gtkgl_inc="yes"
1.80      cheyroul  714:                if test "$ac_dir" != "/usr/include" ; then
                    715:                        if test "$ac_dir" != "$GL_INC_II" ; then
                    716:                                if test "$ac_dir" != "$GL_INC_I" ; then
                    717:                                        GL_INCLUDES="$GL_INCLUDES -I$ac_dir"
                    718:                                fi
                    719:                        fi
                    720:                fi
1.96      cheyroul  721:                AC_MSG_RESULT([yes])
1.75      cheyroul  722:                        break   
                    723:            fi
                    724:        done    
1.80      cheyroul  725:        AC_MSG_CHECKING([freetype])     
                    726:        for ac_dir in                           \
                    727:                /usr/include                    \
                    728:                /usr/X11R6/include              \
                    729:                /usr/local/include              \
                    730:                ; \
                    731:        do  if test -r "$ac_dir/ft2build.h" ; then
                    732:                 freetype_inc="yes"
                    733:                GL_INCLUDES="$GL_INCLUDES `freetype-config --cflags`"
1.96      cheyroul  734:                        AC_MSG_RESULT([yes])    
                    735:                break   
                    736:            fi
                    737:        done    
1.104     cheyroul  738:         AC_MSG_CHECKING([Xft]) 
                    739:        for ac_dir in                           \
                    740:                /usr/include                    \
                    741:                /usr/X11R6/include              \
                    742:                /usr/local/include              \
                    743:                /usr/include/X11/Xft            \
                    744:                /usr/X11R6/include/X11/Xft      \
                    745:                /usr/local/include/X11/Xft      \
                    746:                /usr/include/X11/Xft1           \
                    747:                /usr/X11R6/include/X11/Xft1     \
1.113     vatton    748:                /usr/include/Xft2/X11/Xft/      \
1.104     cheyroul  749:                /usr/local/include/X11/Xft1     \
                    750:                /usr/include/X11/Xft2           \
                    751:                /usr/X11R6/include/X11/Xft2     \
                    752:                /usr/local/include/X11/Xft2     \
                    753:                ; \
                    754:        do  if test -r "$ac_dir/Xft.h" ; then
                    755:                 xft_inc="yes"
                    756:                GL_INCLUDES="$GL_INCLUDES -I$ac_dir"
                    757:                        AC_MSG_RESULT([yes])    
                    758:                break   
                    759:            fi
                    760:        done    
1.96      cheyroul  761:        AC_MSG_CHECKING([gcc3]) 
                    762:        for ac_dir in                           \
                    763:                /usr/lib                        \
                    764:                /usr/X11R6/lib          \
                    765:                /usr/local/lib          \
                    766:                ; \
                    767:        do  if test -r "$ac_dir/libstdc++.so.5" ; then
                    768:                 stdglu_inc="yes"
                    769:                        AC_MSG_RESULT([yes])    
                    770:                break
1.80      cheyroul  771:            fi
1.96      cheyroul  772:        done
                    773:        if test "$gl_inc" = "" ; then           
1.75      cheyroul  774:                AC_MSG_WARN(Opengl headers (gl.h) not found !!)
                    775:                AC_MSG_WARN(Disabling opengl build !)
                    776:                with_gl="no"
                    777:                GL_OPTIONS=     
                    778:                GL_INCLUDES=    
                    779:                GL_LIBRARIES=
1.81      cheyroul  780:                exit 1;
1.75      cheyroul  781:        fi
                    782:        if test "$glu_inc" = "" ; then
                    783:                AC_MSG_WARN(Glu headers (glu.h) not found !!)
                    784:                AC_MSG_WARN(Disabling opengl build !)
1.81      cheyroul  785:        
1.75      cheyroul  786:                with_gl="no"
                    787:                GL_OPTIONS=     
                    788:                GL_INCLUDES=    
                    789:                GL_LIBRARIES=
1.81      cheyroul  790:                exit 1;
1.75      cheyroul  791:        fi
                    792:        if test "$gtkgl_inc" = "" ; then
                    793:                AC_MSG_WARN(Gtkglarea headers (gktglarea.h) not found !!)
                    794:                AC_MSG_WARN(Disabling opengl build !)
                    795:                with_gl="no"
                    796:                GL_OPTIONS=     
                    797:                GL_INCLUDES=    
                    798:                GL_LIBRARIES=
1.81      cheyroul  799:                exit 1;
1.75      cheyroul  800:        fi
1.80      cheyroul  801:        if test "$freetype_inc" = "" ; then
                    802:                AC_MSG_WARN(Freetype 2 headers (ft2build.h) not found !!)
                    803:                AC_MSG_WARN(Disabling opengl build !)
                    804:                with_gl="no"
                    805:                GL_OPTIONS=     
                    806:                GL_INCLUDES=
                    807:                GL_LIBRARIES=
1.81      cheyroul  808:                exit 1;
1.80      cheyroul  809:        fi
1.104     cheyroul  810:        if test "$xft_inc" = "" ; then
                    811:                AC_MSG_WARN(Xft 2 headers (Xft.h) not found !!)
                    812:                AC_MSG_WARN(Disabling opengl build !)
                    813:                with_gl="no"
                    814:                GL_OPTIONS=     
                    815:                GL_INCLUDES=
                    816:                GL_LIBRARIES=
                    817:                exit 1;
                    818:        fi
1.75      cheyroul  819:        if test "$gl_inc" = "yes" ; then
1.79      cheyroul  820:                if test "$glu_inc" = "yes" ; then
                    821:                        if test "$gtkgl_inc" = "yes" ; then
1.96      cheyroul  822:                            if test "$freetype_inc" = "yes" ; then
1.104     cheyroul  823:                                if test "$xft_inc" = "yes" ; then
                    824:                                        if test "$stdglu_inc" = "yes" ; then
1.113     vatton    825:                                           GL_LIBRARIES="-L/usr/lib -L/usr/X11R6/lib  -lXmu -lXft -lfreetype -lGL -lGLU -lgtkgl -lstdc++"
1.104     cheyroul  826:                                        else
1.113     vatton    827:                                           GL_LIBRARIES="-L/usr/lib -L/usr/X11R6/lib  -lXmu -lXft -lfreetype -lGL -lGLU -lgtkgl"
1.104     cheyroul  828:                                        fi                              
                    829:                                        GL_OPTIONS="-D_GL"
                    830:                                        no_motif=yes
                    831:                                fi
1.80      cheyroul  832:                            fi
1.75      cheyroul  833:                        fi
                    834:                fi
                    835:        fi
                    836: AC_SUBST(GL_INCLUDES)
                    837: AC_SUBST(GL_LIBRARIES)
1.115     cheyroul  838: dnl PRINTIFNOTGL=" "
                    839: dnl #NOPRINT="#"
                    840: NOPRINT=""
                    841: PRINTIFNOTGL=" print_prog"
1.97      cheyroul  842: else
1.112     cheyroul  843: NOPRINT=""
1.97      cheyroul  844: PRINTIFNOTGL=" print_prog"
1.75      cheyroul  845: fi
1.97      cheyroul  846: AC_SUBST(PRINTIFNOTGL)
1.112     cheyroul  847: AC_SUBST(NOPRINT)
                    848: 
1.76      vatton    849: 
                    850: AC_ARG_ENABLE(svg,           [  --disable-svg           remove SVG support ])
                    851: AC_ARG_ENABLE(annot,         [  --disable-annot         remove Annotations support ])
1.93      kahan     852: AC_ARG_ENABLE(raptor,        [  --disable-raptor        disable the raptor RDF parser ])
1.116     kahan     853: AC_ARG_ENABLE(redland,       [  --enable-redland        enable the redland RDF library ])
                    854: AC_ARG_ENABLE(system-redland,       [  --enable-system-redland try the redland RDF system library ])
1.108     kahan     855: AC_ARG_ENABLE(bookmarks,     [  --enable-bookmarks      enables experimental bookmark support ])
1.76      vatton    856: AC_ARG_ENABLE(generic-xml,   [  --disable-generic-xml   remove Generic XML support ])
                    857: 
1.75      cheyroul  858: dnl
1.21      cvs       859: dnl plugins support is disabled by default
1.8       cvs       860: dnl
1.13      cvs       861: 
                    862: if test "$with_plugin" = "" ; then
1.21      cvs       863:   if test "$enable_plugin" = "yes" ; then
1.55      kahan     864:     with_plugin="yes"
1.21      cvs       865:   else
1.17      cvs       866:     with_plugin="no"
                    867:   fi
1.10      cvs       868: fi  
1.1       cvs       869: 
1.8       cvs       870: dnl
1.68      vatton    871: dnl svg is enabled by default
1.26      cvs       872: dnl
1.68      vatton    873: if test "$with_svg" = "" ; then
                    874:     if test "$enable_svg" = "no" ; then
                    875:        with_svg="no"
1.49      cvs       876:     else
1.68      vatton    877:        with_svg="yes"
1.26      cvs       878:     fi
                    879: fi
                    880: 
                    881: dnl
1.56      kahan     882: dnl annotations is enabled by default
1.47      cvs       883: dnl
                    884: if test "$with_annot" = "" ; then
1.56      kahan     885:     if test "$enable_annot" = "no" ; then
                    886:        with_annot="no"
                    887:     else
1.54      cvs       888:        with_annot="yes"
1.47      cvs       889:     fi
1.99      kahan     890: else
                    891:     with_annot="yes"
1.47      cvs       892: fi
                    893: 
1.93      kahan     894: 
                    895: dnl
                    896: dnl The raptor RDF parser is enabled by default
                    897: dnl
                    898: if test "$with_raptor" = "" ; then
                    899:     if test "$enable_raptor" = "no" ; then
                    900:        with_raptor="no"
                    901:     else
1.99      kahan     902:        with_raptor="yes"
1.93      kahan     903:     fi
1.99      kahan     904: else
                    905:     with_raptor="yes"
1.93      kahan     906: fi
                    907: 
1.70      kahan     908: dnl
1.116     kahan     909: dnl The redland library is disabled by default
1.109     kahan     910: dnl
                    911: if test "$with_redland" = "" ; then
                    912:     if test "$enable_redland" = "yes" ; then
                    913:        with_redland="yes"
                    914:     else
                    915:        with_redland="no"
                    916:     fi
                    917: else
                    918:     with_redland="no"
                    919: fi
                    920: 
                    921: dnl
1.116     kahan     922: dnl The redland library is disabled by default
                    923: dnl
                    924: if test "$with_system_redland" = "" ; then
                    925:     if test "$enable_system_redland" = "yes" ; then
                    926:        with_redland="yes"
                    927:        with_system_redland="yes"
                    928:     else
                    929:        with_system_redland="no"
                    930:     fi
                    931: else
                    932:     with_system_redland="no"
                    933: fi
                    934: 
                    935: dnl
                    936: dnl The bookmarks support is disabled by default
1.108     kahan     937: dnl
                    938: if test "$with_bookmarks" = "" ; then
                    939:     if test "$enable_bookmarks" = "yes" ; then
                    940:        with_bookmarks="yes"
                    941:     else
                    942:        with_bookmarks="no"
                    943:     fi
                    944: else
                    945:     with_bookmarks="no"
                    946: fi
                    947: 
                    948: dnl
1.70      kahan     949: dnl Generic XML support enabled by default
                    950: dnl
                    951: if test "$with_generic_xml" = "" ; then
                    952:     if test "$enable_generic_xml" = "no" ; then
                    953:        with_generic_xml="no"
                    954:        GENERIC_XML_OPTIONS=
                    955:     else
                    956:        with_generic_xml="yes"
                    957:        GENERIC_XML_OPTIONS=-DXML_GENERIC
                    958:     fi
                    959: fi
                    960: 
1.120     gully     961: AC_ARG_WITH(dav,            [  --with-dav              enable WebDAV support (experimental) ])
1.88      kirschpi  962: dnl
                    963: dnl DAV support disabled by default
                    964: dnl
                    965: if test "$with_dav" = "" ; then
                    966:   if test "$enable_dav" = "yes" ; then
                    967:     with_dav="yes"
                    968:   else
                    969:     with_dav="no"
                    970:   fi
                    971: fi  
                    972: 
                    973: if test "$with_dav" = "yes" ; then
                    974:    DAV_OPTIONS=-DDAV
1.90      kirschpi  975:    DAVDIR="davlib"
                    976:    LIBDAV="libwwwdav"
                    977:    WITHDAV="--with-dav" 
                    978:    WWWDAV="-lwwwdav" 
1.88      kirschpi  979: else
                    980:    with_dav="no"
                    981:    DAV_OPTIONS=""
1.90      kirschpi  982:    DAVDIR=""
                    983:    LIBDAV=""
                    984:    WITHDAV="" 
                    985:    WWWDAV="" 
1.88      kirschpi  986: fi
                    987: 
1.70      kahan     988: 
1.19      cvs       989: if test "$build_amaya" = "yes" ; then
1.43      cvs       990:     if test ! -f $srcdir/../libwww/Makefile.in ; then
1.50      cvs       991:        AC_MSG_WARN(libwww sources not found !!)
                    992:        AC_MSG_WARN(Disabling Amaya build !)
                    993:        build_amaya="no"
1.1       cvs       994:     fi
1.8       cvs       995: 
                    996:     if test ! -f $srcdir/amaya/MathML.S ; then
1.10      cvs       997:        if test "$with_math" = "yes" ; then
1.8       cvs       998:            AC_MSG_WARN(MathML sources not found !!)
1.26      cvs       999:            AC_MSG_WARN(Disabling Math build !)
1.10      cvs      1000:            with_math="no"
                   1001:            MATH_OPTIONS=
1.8       cvs      1002:        fi
                   1003:     fi
1.26      cvs      1004: 
1.68      vatton   1005:     if test ! -f $srcdir/amaya/SVG.S ; then
                   1006:        if test "$with_svg" = "yes" ; then
                   1007:            AC_MSG_WARN(SVG sources not found !!)
                   1008:            AC_MSG_WARN(Disabling SVG build !)
                   1009:            with_svg="no"
                   1010:            SVG_OPTIONS=
1.26      cvs      1011:        fi
                   1012:     fi
                   1013: 
1.48      cvs      1014:     if test ! -f $srcdir/annotlib/Makefile.in ; then
1.47      cvs      1015:        if test "$with_annot" = "yes" ; then
                   1016:            AC_MSG_WARN(Annotation makefile not found !!)
                   1017:            AC_MSG_WARN(Disabling Annotations build !)
                   1018:            with_annot="no"
                   1019:        fi
                   1020:     fi
1.55      kahan    1021: 
1.109     kahan    1022:     if test "$with_raptor" = "yes" -a "$with_redland" = "yes" ; then
                   1023:        AC_MSG_WARN(Disabling raptor build as redland is enabled !)
                   1024:        MAKERAPTOR=['#']
                   1025:        with_raptor="no"
                   1026:     fi
                   1027: 
1.108     kahan    1028:     if test "$with_raptor" = "yes" -a "$with_annot" = "no" ; then
1.93      kahan    1029:        AC_MSG_WARN(Disabling raptor build as annotations are disabled !)
                   1030:        MAKERAPTOR=['#']
                   1031:        with_raptor="no"
                   1032:     fi
                   1033: 
1.108     kahan    1034:     if test "$with_raptor" = "yes" -a ! -d "$srcdir/libraptor" ; then
                   1035:        AC_MSG_WARN(Raptor source dir not found !!)
                   1036:        AC_MSG_WARN(Disabling raptor build !)
                   1037:        MAKERAPTOR=['#']
                   1038:        with_raptor="no"
1.109     kahan    1039:     fi
                   1040: 
                   1041:     if test "$with_raptor" = "yes" ; then
1.108     kahan    1042:        AMAYA_ANNOT_OPTIONS="$AMAYA_ANNOT_OPTIONS -DRAPTOR_RDF_PARSER -I\$(THOTDIR)/libraptor"
                   1043:        AMAYA_RAPTOR_LIBS="../libraptor/.libs/libraptor.a"
                   1044:        AMAYA_RAPTOR_SRC="amaya_comp_libraptor"
                   1045:        AMAYA_RAPTOR_INCLUDES="-I\$(THOTDIR)/libraptor"
                   1046:     fi
                   1047: 
1.109     kahan    1048:     if test "$with_redland" = "yes" -a "$with_annot" = "no" ; then
                   1049:        AC_MSG_WARN(Disabling redland build as annotations are disabled !)
                   1050:        MAKEREDLAND=['#']
                   1051:        with_redland="no"
                   1052:     fi
                   1053: 
1.116     kahan    1054:     redland_compile_source=yes
                   1055:     if test "$with_redland" = "yes" -a "$with_system_redland" = "yes" ; then
                   1056:        # check to see if we have a redland library
                   1057:        AC_MSG_CHECKING(system redland library)
1.118     kahan    1058:        redland_min_version=0.9.14
1.116     kahan    1059:        REDLAND_CONFIG="redland-config"
                   1060:        REDLAND_VERSION=`$REDLAND_CONFIG --version`
                   1061:        redland_version_dec=`echo $REDLAND_VERSION | awk -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'`
                   1062:        redland_min_version_dec=`echo $redland_min_version | awk -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'`
                   1063:        if test $redland_version_dec -lt $redland_min_version_dec; then
                   1064:          AC_MSG_RESULT(no - found version $REDLAND_VERSION and minimal version is $redland_min_version)
                   1065:        else
                   1066:          AC_MSG_RESULT(yes - found version $REDLAND_VERSION)
                   1067:         AC_MSG_CHECKING(checking for redland headers)
1.117     kahan    1068:         dnl  We should use awk here and remove the -I from the following line
                   1069:          dnl REDLAND_HEADERS=`$REDLAND_CONFIG --cflags`
                   1070:         REDLAND_HEADERS=""
                   1071:         if test -e "/usr/include/redland.h" ; then
                   1072:           REDLAND_HEADERS="/usr/include";
                   1073:         else 
                   1074:            if test -e "/usr/local/include/redland.h" ; then
                   1075:             REDLAND_HEADERS="/usr/local/include";
                   1076:            fi
                   1077:          fi        
                   1078:         if test $REDLAND_HEADERS != ""; then
1.116     kahan    1079:            AC_MSG_RESULT(yes - have development version)
                   1080:            redland_compile_source=no
                   1081:         else
                   1082:            AC_MSG_RESULT(no - no development version)
                   1083:          fi
                   1084:        fi
                   1085:     fi
                   1086: 
                   1087:     if test "$with_redland" = "yes" -a "$redland_compile_source" = "yes" \
                   1088:        -a ! -d "$srcdir/../redland" ; then
1.109     kahan    1089:        AC_MSG_WARN(Redland source dir not found !!)
                   1090:        AC_MSG_WARN(Disabling redland build !)
                   1091:        MAKEREDLAND=['#']
                   1092:        with_redland="no"
                   1093:     fi
                   1094: 
                   1095:     if test "$with_redland" = "yes" ; then
1.116     kahan    1096:        AMAYA_ANNOT_OPTIONS="$AMAYA_ANNOT_OPTIONS -DLIBRDF_INTERNAL=1 -DAM_REDLAND -DRAPTOR_RDF_PARSER"
                   1097:        if test "$redland_compile_source" = "yes" ; then
                   1098:          AMAYA_RAPTOR_SRC="amaya_comp_redland"
                   1099:          AMAYA_ANNOT_OPTIONS="$AMAYA_ANNOT_OPTIONS -I\$(THOTDIR)/../redland/librdf -I\$(THOTDIR)/../redland/raptor"
                   1100:          AMAYA_RAPTOR_LIBS="../redland/librdf/.libs/librdf.a ../redland/raptor/.libs/libraptor.a"
                   1101:          AMAYA_RAPTOR_INCLUDES="-I\$(THOTDIR)/../redland/librdf -I\$(THOTDIR)/../redland/raptor"
                   1102:        else
                   1103:          MAKEREDLAND=['#']
                   1104:         AMAYA_RAPTOR_SRC=
                   1105:         redland_includes=`$REDLAND_CONFIG --cflags`
                   1106:         redland_libs=`$REDLAND_CONFIG --libs`
                   1107:          AMAYA_ANNOT_OPTIONS="$AMAYA_ANNOT_OPTIONS"
                   1108:          AMAYA_ANNOT_INCLUDES="$redland_includes -I\$(THOTDIR)/thotlib/include"
                   1109:          AMAYA_ANNOT_EXTRA_LIBS="$redland_libs"
                   1110:          AMAYA_RAPTOR_INCLUDES="$redland_includes"
                   1111:        fi
1.109     kahan    1112:     fi
                   1113: 
1.116     kahan    1114: 
1.108     kahan    1115:     dnl control whether we should build the bookmarks support
                   1116:     if test "$with_bookmarks" = "yes" -a "$with_annot" = "no" ; then
                   1117:        AC_MSG_WARN(Disabling bookmarks build as annotations are disabled !)
                   1118:        with_bookmarks="no"
                   1119:     fi
1.109     kahan    1120:     if test "$with_bookmarks" = "yes" -a "$with_redland" = "no" ; then
                   1121:        AC_MSG_WARN(Disabling bookmarks build as redland is disabled !)
1.108     kahan    1122:        with_bookmarks="no"
                   1123:     fi
                   1124:     if test "$with_bookmarks" = "yes" ; then
                   1125:        ANNOTLIB_COMPILE_BM=
                   1126:        AMAYA_ANNOT_OPTIONS="$AMAYA_ANNOT_OPTIONS -DBOOKMARKS"
                   1127:     else
                   1128:        ANNOTLIB_COMPILE_BM=['#']
                   1129:     fi
                   1130: 
1.93      kahan    1131:     dnl control whether we should use libwww's rdf parser
1.109     kahan    1132:     if test "$with_raptor" = "yes" -o "$with_redland" = "yes"; then
1.93      kahan    1133:        dnl not all the function calls have been cleared as of today, 
                   1134:        dnl we still need libwww's rdf parser 
1.98      kahan    1135:        MAKE_LIBWWW_RDF_PARSER=
                   1136:        LIBWWW_RDF_PARSER=
1.93      kahan    1137:     else
                   1138:        MAKE_LIBWWW_RDF_PARSER="libwwwxml"
                   1139:        LIBWWW_RDF_PARSER="-lwwwxml"
                   1140:     fi
1.70      kahan    1141: 
1.55      kahan    1142:     if test "$with_plugin" = "yes" ; then
                   1143:         AC_MSG_WARN(The plugin library isn't supported anymore in Amaya !!)
                   1144:        AC_MSG_WARN(Disabling plugin build !)
                   1145:        with_plugin="no"
                   1146:     fi
                   1147: 
1.88      kirschpi 1148: 
                   1149:     if test ! -f $srcdir/davlib/Makefile.in ; then
                   1150:        if test "$with_dav" = "yes" ; then
                   1151:            AC_MSG_WARN(WebDAV makefile not found !!)
                   1152:            AC_MSG_WARN(Disabling WebDAV build !)
                   1153:            with_dav="no"
1.90      kirschpi 1154:             DAVDIR=""
                   1155:             LIBDAV=""
                   1156:             WITHDAV="" 
                   1157:             WWWDAV="" 
1.88      kirschpi 1158:        fi
                   1159:     fi
                   1160:    
                   1161: 
1.1       cvs      1162: fi
                   1163: 
                   1164: dnl
                   1165: dnl The options for each library or binary
                   1166: dnl
                   1167: 
1.123   ! gully    1168: THOT_OPTIONS="$I18N_OPTIONS $MOTIF_OPTIONS $GTK_OPTIONS $GL_OPTIONS $NOGUI_OPTIONS"
        !          1169: AMAYA_OPTIONS="$MATH_OPTIONS $SVG_OPTIONS $GENERIC_XML_OPTIONS $I18N_OPTIONS $MOTIF_OPTIONS $GTK_OPTIONS $GL_OPTIONS $NOGUI_OPTIONS"
1.58      cvs      1170: #PLUGIN_OPTIONS="-DPLUGIN_TRACE -DXP_UNIX"
1.123   ! gully    1171: AMAYA_ANNOT_OPTIONS="$AMAYA_ANNOT_OPTIONS $I18N_OPTIONS"
1.101     kahan    1172: 
1.102     kahan    1173: IMGLIBS="-ljpeg -lpng -lz"
1.3       cvs      1174: EXTRA_LIBS=
1.1       cvs      1175: 
                   1176: dnl
                   1177: dnl Set up the PATHs needed
                   1178: dnl
                   1179: 
                   1180: API="\$(THOTDIR)/thotlib/include"
                   1181: VAR="\$(THOTDIR)/thotlib/internals/var"
                   1182: INCL="\$(THOTDIR)/thotlib/internals/h"
                   1183: FUNC="\$(THOTDIR)/thotlib/internals/f"
                   1184: 
                   1185: dnl
                   1186: dnl Set up the include variables.
                   1187: dnl
                   1188: 
1.61      cvs      1189: THOTINCLUDES="-I${API} -I${VAR} -I${INCL} -I${FUNC} ${JPEGINCL} ${PNGINCL}"
1.58      cvs      1190: APIINCLUDES=-I${API}
                   1191:  
                   1192: if test "${VPATHOPT}" = "" ; then
1.1       cvs      1193:        VPATHOPT="VPATH"
                   1194: fi
                   1195: 
                   1196: dnl
                   1197: dnl Exports the current values of the variables.
                   1198: dnl
                   1199: 
                   1200: AC_SUBST(AMAYA_VER)
1.6       cvs      1201: AC_SUBST(CEXTRACT_VER)
                   1202: AC_SUBST(CEXTRACT_FLAGS)
1.1       cvs      1203: 
                   1204: AC_SUBST(THOTINCLUDES)
                   1205: AC_SUBST(APIINCLUDES)
                   1206: AC_SUBST(VPATHOPT)
                   1207: 
1.63      vatton   1208: AC_SUBST(GTK_OPTIONS)
1.1       cvs      1209: AC_SUBST(THOT_OPTIONS)
                   1210: AC_SUBST(AMAYA_OPTIONS)
                   1211: AC_SUBST(PLUGIN_OPTIONS)
1.48      cvs      1212: AC_SUBST(AMAYA_ANNOT_OPTIONS)
1.110     kahan    1213: AC_SUBST(AMAYA_ANNOT_INCLUDES)
1.116     kahan    1214: AC_SUBST(AMAYA_ANNOT_EXTRA_LIBS)
1.1       cvs      1215: AC_SUBST(IMGLIBS)
1.3       cvs      1216: AC_SUBST(EXTRA_LIBS)
1.90      kirschpi 1217: 
                   1218: AC_SUBST(DAVDIR)
                   1219: AC_SUBST(LIBDAV)
                   1220: AC_SUBST(WITHDAV)
                   1221: AC_SUBST(WWWDAV)
1.1       cvs      1222: 
1.93      kahan    1223: AC_SUBST(MAKERAPTOR)
1.109     kahan    1224: AC_SUBST(MAKEREDLAND)
1.108     kahan    1225: AC_SUBST(ANNOTLIB_COMPILE_BM)
1.109     kahan    1226: AC_SUBST(AMAYA_RAPTOR_SRC)
1.93      kahan    1227: AC_SUBST(AMAYA_RAPTOR_LIBS)
                   1228: AC_SUBST(AMAYA_RAPTOR_INCLUDES)
                   1229: AC_SUBST(MAKE_LIBWWW_RDF_PARSER)
                   1230: AC_SUBST(LIBWWW_RDF_PARSER)
                   1231: 
                   1232: AC_SUBST(SUBDIRS)
                   1233: 
1.1       cvs      1234: dnl
1.48      cvs      1235: dnl Include the option Makefile.xxx fragment according to the configure options
1.1       cvs      1236: dnl
                   1237: 
                   1238: if test "$with_plugin" = "yes" ; then
1.50      cvs      1239:     AC_SUBST_FILE(plugin_frag)
1.1       cvs      1240:     plugin_frag=$srcdir/pluginlib/Makefile.plugin
                   1241: else
                   1242:     AC_SUBST_FILE(plugin_frag)
                   1243:     plugin_frag=/dev/null
                   1244: fi
                   1245: 
                   1246:     AC_SUBST_FILE(www_frag)
1.49      cvs      1247:     www_frag=$srcdir/amaya/Makefile.libwww
1.1       cvs      1248: 
1.50      cvs      1249: if test "$with_math" = "no" ; then
1.10      cvs      1250:     AC_SUBST_FILE(math_frag)
1.50      cvs      1251:     math_frag=/dev/null
1.8       cvs      1252: else
1.10      cvs      1253:     AC_SUBST_FILE(math_frag)
1.50      cvs      1254:     math_frag=$srcdir/amaya/Makefile.math
1.8       cvs      1255: fi
                   1256: 
1.68      vatton   1257: if test "$with_svg" = "no" ; then
                   1258:     AC_SUBST_FILE(svg_frag)
                   1259:     svg_frag=/dev/null
1.26      cvs      1260: else
1.68      vatton   1261:     AC_SUBST_FILE(svg_frag)
                   1262:     svg_frag=$srcdir/amaya/Makefile.svg
1.26      cvs      1263: fi
                   1264: 
1.47      cvs      1265: if test "$with_annot" = "yes" ; then
                   1266:     AC_SUBST_FILE(annot_frag)
1.48      cvs      1267:     annot_frag=$srcdir/annotlib/Makefile.annot
1.47      cvs      1268: else
                   1269:     AC_SUBST_FILE(annot_frag)
                   1270:     annot_frag=/dev/null
                   1271: fi
                   1272: 
1.88      kirschpi 1273: if test "$with_dav" = "yes" ; then
                   1274:     AC_SUBST_FILE(dav_frag)
                   1275:     dav_frag=$srcdir/davlib/Makefile.dav
                   1276: fi
1.16      cvs      1277: 
1.1       cvs      1278: dnl  ***************************************************************
                   1279: dnl
                   1280: dnl      FINAL STEP : PRODUCE ALL THE MAKEFILES AND CONFIG FILES
                   1281: dnl
                   1282: dnl  ***************************************************************
                   1283: 
                   1284: EXTRA_MAKEFILE_IN=
1.2       cvs      1285: make_output="Makefile Options.orig:Options.in tools/Makefile \
1.1       cvs      1286:        libjpeg/Makefile libpng/Makefile libpng/zlib/Makefile \
1.2       cvs      1287:        tools/mkdep/Makefile \
1.1       cvs      1288:        tools/cextract-1.7/Makefile thotlib/Makefile \
1.5       cvs      1289:        thotlib/include/Makefile batch/Makefile tablelib/Makefile"
1.1       cvs      1290: 
                   1291: if test "$build_amaya" = "yes" ; then
1.2       cvs      1292: 
1.19      cvs      1293:     make_output="$make_output amaya/Makefile pluginlib/Makefile"
1.2       cvs      1294:     EXTRA_MAKEFILE_IN="$srcdir/amaya/Makefile.in \
1.93      kahan    1295:     $srcdir/amaya/Makefile.libwww"
1.27      cvs      1296: 
                   1297:     if test "$$with_plugin" = "yes" ; then
                   1298:        make_output="$make_output pluginlib/Makefile"
                   1299:        EXTRA_MAKEFILE_IN="$srcdir/pluginlib/Makefile.in \
1.93      kahan    1300:        $srcdir/pluginlib/Makefile.plugin"
1.27      cvs      1301:     fi
1.2       cvs      1302: 
1.48      cvs      1303:     if test "$with_annot" = "yes" ; then
                   1304:        make_output="$make_output annotlib/Makefile"
                   1305:        EXTRA_MAKEFILE_IN="$srcdir/annotlib/Makefile.in"
                   1306:     fi
1.88      kirschpi 1307: 
                   1308:     if test "$with_dav" = "yes" ; then
                   1309:        make_output="$make_output davlib/Makefile"
                   1310:        EXTRA_MAKEFILE_IN="$srcdir/davlib/Makefile.in"
                   1311:     fi
                   1312: 
1.1       cvs      1313: fi
                   1314: 
                   1315: AC_SUBST(EXTRA_MAKEFILE_IN)
1.6       cvs      1316: AC_OUTPUT($make_output , [
                   1317: dnl
                   1318: dnl This fragment of shell code is executed after the
                   1319: dnl Makefile(s) dump ...
                   1320: dnl
                   1321: 
                   1322: echo timestamp > stamp-h
                   1323: 
                   1324: dnl
                   1325: dnl Check for an upgrade in the Options numbers
                   1326: dnl
                   1327: 
                   1328: if test -f Options ; then
                   1329:    oldversion=`grep Version Options`
                   1330:    newversion=`grep Version Options.orig`
                   1331:    if test "$oldversion" != "$newversion" ; then
                   1332:        echo WARNING : Options files have changed, old options saved to Options.old
                   1333:        cp Options Options.old
                   1334:        cp Options.orig Options
                   1335:        exit 1
                   1336:    fi
                   1337: fi
                   1338: ])
1.1       cvs      1339: 
                   1340: if test "$build_amaya" = "yes" ; then
1.50      cvs      1341:     echo Amaya configured with libWWW
                   1342:     if test "$with_plugin" = "yes" ; then
                   1343:         echo Amaya configured with Plugins support
1.8       cvs      1344:     fi
1.10      cvs      1345:     if test "$with_math" = "yes" ; then
                   1346:        echo Amaya configured with Math support
1.26      cvs      1347:     fi
1.68      vatton   1348:     if test "$with_svg" = "yes" ; then
                   1349:        echo Amaya configured with SVG support
1.47      cvs      1350:     fi
                   1351:     if test "$with_annot" = "yes" ; then
                   1352:        echo Amaya configured with Annotations support
1.70      kahan    1353:     fi
1.93      kahan    1354:     if test "$with_raptor" = "yes" ; then
1.106     kahan    1355:        echo Amaya configured with the Raptor RDF parser
1.109     kahan    1356:     fi
                   1357:     if test "$with_redland" = "yes" ; then
1.116     kahan    1358:        if test "$with_system_redland" = "no" ; then
                   1359:          echo Amaya configured with the Redland RDF library \(local source\)
                   1360:        else
                   1361:          echo Amaya configured with the Redland RDF library \(system\)
                   1362:        fi
1.108     kahan    1363:     fi
                   1364:     if test "$with_bookmarks" = "yes" ; then
                   1365:        echo Amaya configured with bookmarks support \(experimental\)
1.93      kahan    1366:     fi
1.70      kahan    1367:     if test "$with_generic_xml" = "yes" ; then
                   1368:        echo Amaya configured with generic XML suppport
                   1369:     fi
                   1370:     if test "$with_i18n" = "yes" ; then
1.82      vatton   1371:        echo Amaya configured with internationalization suppport
1.75      cheyroul 1372:     fi 
                   1373:     if test "$with_gl" = "yes" ; then
                   1374:        echo Amaya configured with Opengl Canvas Rendering \(experimental\)
1.88      kirschpi 1375:     fi
                   1376:     if test "$with_dav" = "yes" ; then
                   1377:        echo Amaya configured with WebDAV support \(experimental\)
1.1       cvs      1378:     fi
1.5       cvs      1379: fi
                   1380: 
1.107     kahan    1381: if test "$no_graphic" = "yes" ; then
                   1382:     echo "Amaya configured with system graphic libraries (libjpeg, libpng, zlib)"
                   1383: else
                   1384:     echo "Amaya configured with static graphic libraries (libjpeg, libpng, zlib)"
                   1385:     if test "$with_gtk" = "yes" -o "$with_gl" = "yes" ; then
                   1386:       echo "  N.B. This option may not work in your platform. If Amaya crashes"
                   1387:       echo "  when opening a PNG file. Recompile it using the system libraries."
                   1388:     fi
                   1389: fi
                   1390: 
                   1391: if test "$with_gtk" = "yes" ; then
1.67      vatton   1392:     echo "Amaya configured with GTK"
1.120     gully    1393: fi
                   1394: 
                   1395: if test "$with_motif" = "yes" ; then
1.107     kahan    1396:   if test "$no_motif" = "yes" ; then
1.120     gully    1397:       echo "Motif seems not installed on this machine"
                   1398:       echo "Amaya need Motif 1.2 or 2.0"
1.105     vatton   1399:   else
                   1400:     if test "$motif_includes" = "" ; then
                   1401:       echo "Motif includes were not found"
                   1402:       echo "Amaya might not compile"
                   1403:       echo "Edit your Option file"
                   1404:     else
                   1405:       if test "$motif_libraries" = "" ; then
                   1406:         echo "Motif libraries were not found"
                   1407:         echo "Amaya might not compile"
                   1408:         echo "Edit your Option file"
1.120     gully    1409:       else
                   1410:         echo "Amaya configured with MOTIF"
1.105     vatton   1411:       fi
                   1412:     fi
                   1413:   fi
1.1       cvs      1414: fi
                   1415: 
1.121     gully    1416: if test "$with_nogui" = "yes" ; then
                   1417:   echo "Amaya configured with no GUI toolkit"
                   1418: fi
                   1419:   
1.107     kahan    1420: echo ""
1.78      vatton   1421: echo "Now type \"make\" (GNU make preferably) to build the binaries"
1.107     kahan    1422: echo ""
1.120     gully    1423: 

Webmaster