Annotation of Amaya/configure.in, revision 1.153

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)
1.141     gully      79: #AC_PATH_X
                     80: #AC_PATH_XTRA
1.1       cvs        81: 
1.41      cvs        82: dnl
1.5       cvs        83: dnl Checks for header files.
                     84: dnl
                     85: 
                     86: AC_HEADER_DIRENT
                     87: AC_HEADER_STDC
                     88: AC_HEADER_SYS_WAIT
                     89: 
                     90: AC_CHECK_HEADERS(stdio.h)
                     91: AC_CHECK_HEADERS(sys/types.h types.h)
                     92: AC_CHECK_HEADERS(sys/unistd.h unistd.h)
                     93: AC_CHECK_HEADERS(sys/fcntl.h fcntl.h)
                     94: AC_CHECK_HEADERS(sys/limits.h limits.h)
                     95: AC_CHECK_HEADERS(sys/stat.h stat.h)
                     96: AC_CHECK_HEADERS(sys/file.h)
                     97: AC_CHECK_HEADERS(sys/ioctl.h)
                     98: AC_CHECK_HEADERS(sys/time.h time.h)
                     99: AC_CHECK_HEADERS(sys/systeminfo.h)
1.46      cvs       100: AC_CHECK_HEADERS(sys/string.h strings.h)
1.34      cvs       101: AC_CHECK_HEADERS(sys/syslog.h syslog.h)
1.5       cvs       102: AC_CHECK_HEADERS(sys/socket.h socket.h)
1.131     gully     103: 
                    104: # SG: not used ? => do not compile on macosx
                    105: # AC_CHECK_HEADERS(appkit/appkit.h appkit.h)
                    106: # AC_CHECK_HEADERS(apppkit/apppkit.h apppkit.h)
                    107: 
1.5       cvs       108: AC_CHECK_HEADERS(netinet/in.h in.h)
                    109: AC_CHECK_HEADERS(dn.h)
                    110: AC_CHECK_HEADERS(sys/ipc.h)
                    111: AC_CHECK_HEADERS(net/errno.h sys/errno.h errno.h)
                    112: AC_CHECK_HEADERS(pwd.h)
                    113: AC_CHECK_HEADERS(grp.h)
                    114: AC_CHECK_HEADERS(arpa/inet.h inet.h)
                    115: AC_CHECK_HEADERS(netdb.h)
                    116: AC_CHECK_HEADERS(manifest.h)
                    117: AC_CHECK_HEADERS(bsdtypes.h)
                    118: AC_CHECK_HEADERS(stdefs.h)
                    119: AC_CHECK_HEADERS(bsdtime.h)
                    120: AC_CHECK_HEADERS(sys/select.h select.h)
                    121: AC_CHECK_HEADERS(dnetdb.h)
                    122: AC_CHECK_HEADERS(libc.h)
                    123: AC_CHECK_HEADERS(stdlib.h)
                    124: AC_CHECK_HEADERS(malloc.h)
                    125: AC_CHECK_HEADERS(memory.h)
                    126: AC_CHECK_HEADERS(unixlib.h)
                    127: AC_CHECK_HEADERS(ctype.h)
                    128: AC_CHECK_HEADERS(cursesX.h curses.h)
                    129: AC_CHECK_HEADERS(sys/resource.h resource.h)
                    130: AC_HEADER_DIRENT
                    131: AC_CHECK_HEADERS(dir.h direct.h) dnl AC_HEADER_DIRENT only checks for some..
                    132: AC_HEADER_STDC
                    133: AC_HEADER_SYS_WAIT
                    134: AC_HEADER_TIME
                    135: AC_HEADER_STAT
1.103     kahan     136: AC_CHECK_HEADERS(stdint.h)
1.5       cvs       137: 
                    138: dnl
                    139: dnl Checks for typedefs, structures, and compiler characteristics.
                    140: dnl
                    141: 
                    142: AC_C_CONST
                    143: AC_C_INLINE
                    144: AC_TYPE_MODE_T
                    145: AC_TYPE_OFF_T
                    146: AC_TYPE_SIZE_T
                    147: AC_HEADER_TIME
                    148: AC_STRUCT_TM
                    149: AC_STRUCT_TIMEZONE
                    150: AC_TYPE_UID_T
                    151: 
                    152: dnl
                    153: dnl Checks for library functions.
                    154: dnl
                    155: 
                    156: AC_FUNC_ALLOCA
                    157: AC_TYPE_GETGROUPS
                    158: AC_PROG_GCC_TRADITIONAL
                    159: AC_FUNC_MEMCMP
                    160: AC_FUNC_MMAP
                    161: AC_TYPE_SIGNAL
                    162: AC_FUNC_VPRINTF
1.58      cvs       163: 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       164: 
1.132     gully     165: #
                    166: # Check for operating system (UNIX / WINDOWS / MACOSX )
                    167: # ---------->
                    168: # canonicalize the target OS : default UNIX
                    169: OS_OPTIONS="-D_UNIX"
                    170: case $target_os in
                    171:   aix*)       OS_OPTIONS="-D_UNIX" ;;
                    172:   cygwin*)    OS_OPTIONS="-D_UNIX" ;;
                    173:   darwin*)    OS_OPTIONS="-D_UNIX -D_MACOS" ;;
                    174:   freebsd2*)  OS_OPTIONS="-D_UNIX" ;;
                    175:   freebsd*)   OS_OPTIONS="-D_UNIX" ;;
                    176:   hpux*)      OS_OPTIONS="-D_UNIX" ;;
                    177:   irix*)      OS_OPTIONS="-D_UNIX" ;;
                    178:   linuxaout*) OS_OPTIONS="-D_UNIX" ;;
                    179:   linux*)     OS_OPTIONS="-D_UNIX" ;;
                    180:   mingw32*)   OS_OPTIONS="-D_UNIX" ;;
                    181:   netbsd*)    OS_OPTIONS="-D_UNIX" ;;
                    182:   openbsd*)   OS_OPTIONS="-D_UNIX" ;;
                    183:   osf[12]*)   OS_OPTIONS="-D_UNIX" ;;
                    184:   osf*)       OS_OPTIONS="-D_UNIX" ;;
                    185:   solaris2*)  OS_OPTIONS="-D_UNIX" ;;
                    186:   sunos4*)    OS_OPTIONS="-D_UNIX" ;;
                    187:   ultrix*)    OS_OPTIONS="-D_UNIX" ;;
                    188: esac
                    189: 
1.85      vatton    190: AC_ARG_WITH(GL,              [  --with-gl               enable Opengl canvas (experimental) ])
                    191: dnl
                    192: dnl GL canvas is disabled by default
                    193: dnl
                    194: dnl needs Opengl, glu, Xft (xfree 4 font server)
                    195: dnl needs GTK
                    196: dnl text WILL need freetype2, ftgl
                    197: dnl GL is for opengl
                    198: dnl Glu is for text drawing (until we switch) 
                    199: dnl GLU is for tesselation algortihms (until we extract it from this lib)
                    200: dnl (tesselation is used for polygons with holes in it...)
                    201: dnl gtkgl is for integration of opengl in GTK
                    202: if test "$with_gl" = "" ; then
                    203:  if test "$enable_gl" = "yes" ; then
                    204:     with_gl="yes"
                    205:   else
                    206:     with_gl="no"
                    207:   fi
                    208: fi  
                    209: 
1.120     gully     210: # check if gtk gui should be used
                    211: AC_ARG_WITH(gtk, [  --with-gtk              use GTK GUI toolkit ])
                    212: if test "$with_gtk" = "yes" -o "$enable_gtk" = "yes" ; then
                    213:   if test "$withval" = "no" ; then
                    214:     with_gtk="no"
                    215:   else
                    216:     with_gtk="yes"
                    217:   fi
                    218: fi
                    219: 
1.143     gully     220: # check for mesa library (OpenGL)
                    221: AC_ARG_WITH(MESA,              [  --with-mesa               enable OpenGL canvas with internal MesaLib (only used with wxWidgets GUI) ])
                    222: if test "$with_mesa" = "" ; then
                    223:  if test "$enable_mesa" = "yes" ; then
                    224:     with_mesa="yes"
                    225:     with_gl="no"
                    226:   else
                    227:     with_mesa="no"
                    228:   fi
                    229: fi
                    230: 
                    231: # check if wxWidgets gui should be used
                    232: AC_ARG_WITH(wx, [  --with-wx               use wxWidgets GUI toolkit (experimental)])
1.124     gully     233: if test "$with_wx" = "yes" -o "$enable_wx" = "yes" ; then
                    234:   if test "$withval" = "no" ; then
                    235:     with_wx="no"
                    236:   else
                    237:     with_wx="yes"
1.143     gully     238:     # force mesa or opengl with wxWidgets (mesa is used in priority)
                    239:     if test "$with_gl" = "no" ; then
                    240:       with_mesa="yes"
                    241:     fi
1.124     gully     242:   fi
                    243: fi
                    244: 
1.134     gully     245: # Check if iat least one GUI toolkit is enabled
                    246: if test "$with_wx" = "no" -o "$with_wx" = "" ; then
                    247:   if test "$with_gtk" = "no" -o "$with_gtk" = "" ; then
                    248:     # Nothing is enable so force the default GUI toolkit (GTK)
                    249:     with_wx="no"
                    250:     with_gtk="yes"
1.85      vatton    251:   fi
                    252: fi
                    253: 
1.121     gully     254: # check if no gui is enable
                    255: AC_ARG_WITH(nogui, [  --with-nogui            do not use GUI toolkit ])
                    256: if test "$with_nogui" = "yes" -o "$enable_nogui" = "yes" ; then
                    257:   with_nogui="yes"
                    258:   with_gtk="no"
1.134     gully     259:   with_wx="no"
1.121     gully     260:   NOGUI_OPTIONS="-D_NOGUI"
                    261: fi
                    262: 
1.136     gully     263: # check if wxWidgets debug is enable
                    264: AC_ARG_WITH(wxdebug,              [  --with-wxdebug               compiles wxWidgets with debuging options ])
                    265: if test "$with_wxdebug" = "yes" ; then
                    266:   with_wxdebug="yes"
                    267: else
                    268:   with_wxdebug="no"
                    269: fi
                    270: 
1.153   ! gully     271: # it is possible to specify wxWidgets library path,
        !           272: # usefull for developpers who want to compile amaya with different wxWidgets version
        !           273: AC_ARG_WITH(wxsrcdir, [  --with-wxsrcdir=...               compiles Amaya with a specific wxWidgets sources path ])
        !           274: if test "$with_wxsrcdir" = "" ; then
        !           275:   with_wxsrcdir="../../wxWidgets"
        !           276: fi
        !           277: 
        !           278: 
1.134     gully     279: if test "$with_wx" = "yes" ; then
1.120     gully     280:   if test "$with_gtk" = "yes" ; then
                    281:     echo 
                    282:     echo "****************************************************************"
                    283:     echo " ERROR: "
                    284:     echo " More than one GUI toolkit is enable"
                    285:     echo " Only one GUI toolkit should be enable (turn off one)"
                    286:     echo " exemple ok :  ../configure --with-gtk "
1.134     gully     287:     echo " exemple !ok : ../configure --with-gtk --with-wx"
1.120     gully     288:     echo "****************************************************************"
                    289:     echo 
                    290:     exit 1
                    291:   fi
                    292: fi
1.134     gully     293: 
1.152     gully     294: 
                    295: # setup the AMAYAGUI variable used to identify used GUI when 'make install' is called
                    296: # now several amaya gui can coexist.
                    297: if test "$with_gtk" = "yes" ; then
                    298:   AMAYAGUI="gtk"
                    299: fi
                    300: if test "$with_gl" = "yes" ; then
                    301:   AMAYAGUI="gl"
                    302: fi
                    303: if test "$with_wx" = "yes" ; then
                    304:   AMAYAGUI="wx"
                    305: fi
                    306: AC_SUBST(AMAYAGUI)
                    307: 
                    308: 
1.85      vatton    309: if test "$with_gtk" = "yes" ; then
1.134     gully     310:   gdkimlib_h_found="no"
1.63      vatton    311: 
1.134     gully     312:   # check that gtk-config exists
                    313:   AC_CHECK_PROG(GTKCONFIG_FOUND,gtk-config,yes,no)
                    314:   if test "$GTKCONFIG_FOUND" = no ; then
                    315:     AC_MSG_ERROR(Cannot find gtk-config. Please install gtk development library.)
                    316:   fi
                    317:                    
1.131     gully     318:   GTK_INCLUDES="${GTK_INCLUDES} `gtk-config --cflags`"
1.124     gully     319:   AC_SUBST(GTK_INCLUDES)
                    320:   GTK_LIBRARIES="`gtk-config --libs`"
1.134     gully     321:   # GL doesn't need the imlib
1.124     gully     322:   if test "${with_gl}" != "yes" ; then
1.134     gully     323:     GTK_LIBRARIES="${GTK_LIBRARIES} -lgdk_imlib"
                    324:   else
                    325:     gdkimlib_h_found="yes"
1.124     gully     326:   fi
1.106     kahan     327: 
1.124     gully     328:   AC_SUBST(GTK_LIBRARIES)
                    329:   GTK_OPTIONS="-D_GTK"
1.76      vatton    330:   no_graphic=yes
1.134     gully     331: 
1.150     gully     332:   # SG : lookingfor gtkimlib includes
                    333:   #      because not found with gtk-config on macosx
                    334:   gtk_path_for_gdkimlib_h="`gtk-config --prefix`"
                    335:   for ac_dir in               \
                    336:     /sw/include/              \
                    337:     /sw/local/include         \
                    338:     /usr/include              \
                    339:     /usr/local/include        \
                    340:     "$gtk_path_for_gdkimlib_h/include" \
                    341:     "$gtk_path_for_gdkimlib_h/local/include" \
                    342:     ; \
                    343:   do
                    344:     if test -r "$ac_dir/gdk_imlib.h"; then
                    345:       echo "found gdk_imlib.h"
                    346:       gdkimlib_h_found="yes"
                    347:       GTK_INCLUDES="${GTK_INCLUDES} -I$ac_dir"
                    348:       break
                    349:     fi
                    350:   done 
                    351: 
1.134     gully     352:   if test "$gdkimlib_h_found" = "no" ; then
                    353:     echo
                    354:     echo "****************************************************************"
                    355:     echo " ERROR: gdk_imlib.h not found -"
                    356:     echo " [please install imlib developpement package (libimlib1-devel on mandrake)]"
                    357:     echo "****************************************************************"
                    358:     exit 1
                    359:   fi                                                                                         
1.120     gully     360: fi
                    361: 
1.143     gully     362: 
                    363: if test "$with_mesa" = "yes" ; then
                    364:   # --------- compile Mesa library (opengl) --------------- #
                    365: 
                    366:   # check that sources of Mesa exists
                    367:   if test ! -f ../../Mesa/Makefile ; then
                    368:     AC_MSG_ERROR(Mesa library sources not found (opengl). Please download Mesa sources (http://www.mesa3d.org/) or remove --with-gl option !)
                    369:   fi
                    370: 
                    371:   OLDDIR=`pwd`
                    372:   cd ../../Mesa
1.152     gully     373:   GL_BUILDDIR="${OLDDIR}/Mesa"
1.143     gully     374: 
                    375:   echo "---> Compiling Mesa library."
                    376:   if test "$OS_OPTIONS" = "-D_UNIX" ; then
                    377:     # LINUX
1.145     gully     378:     # compile only .a libraries because Amaya is linked staticaly with mesa
                    379:     make linux-static    
                    380:     if test $? != 0 ; then
                    381:       AC_MSG_ERROR(A problem occurs durring Mesa library compilation. Please fix the problem and try again.)
                    382:     fi
1.143     gully     383:   fi
                    384:   echo "---> Compiling Mesa library. - DONE"
                    385: 
                    386: 
1.152     gully     387:   echo "---> Install Mesa library into ${GL_BUILDDIR}"
1.151     gully     388:   # remove old lib
1.152     gully     389:   rm -rf ${GL_BUILDDIR}/lib/*
1.151     gully     390:   # create directories
1.152     gully     391:   mkdir -p ${GL_BUILDDIR}
                    392:   mkdir -p ${GL_BUILDDIR}/include
                    393:   mkdir -p ${GL_BUILDDIR}/lib
1.145     gully     394:   # copy includes
1.152     gully     395:   cp -r include/GL ${GL_BUILDDIR}/include/
1.145     gully     396:   # copy libraries (only .a because we dont want to share)
1.152     gully     397:   cp lib/*.a ${GL_BUILDDIR}/lib/
                    398:   echo "---> Install Mesa library into ${GL_BUILDDIR} - DONE"
1.143     gully     399: 
                    400:   cd $OLDDIR
                    401: 
                    402:   # this is the flags used to build amaya with OpenGL
                    403:   GL_OPTIONS="-D_GL"
1.152     gully     404:   GL_INCLUDES="-I${GL_BUILDDIR}/include"
                    405:   GL_LIBRARIES="-Wl,-rpath,${GL_BUILDDIR}/lib -L${GL_BUILDDIR}/lib -lGL -lGLU"
                    406:   AC_SUBST(GL_BUILDDIR)
1.143     gully     407:   AC_SUBST(GL_INCLUDES)
                    408:   AC_SUBST(GL_LIBRARIES)
                    409: fi
                    410: 
1.124     gully     411: if test "$with_wx" = "yes" ; then
1.153   ! gully     412:   # WX_SRCDIR is better to understand the code than with_wxsrcdir variable
        !           413:   WX_SRCDIR=$with_wxsrcdir
        !           414:   AC_SUBST(WX_SRCDIR)
        !           415: 
1.135     gully     416:   # check that sources of wxWidgets exists
1.153   ! gully     417:   if test ! -f $WX_SRCDIR/Makefile.in ; then
        !           418:     AC_MSG_ERROR(wxWidgets library sources not found. Please download wxWidgets sources (http://www.wxwidgets.org/), or remove --with-wx option, or check --with-wxsrcdir is correct !)
1.135     gully     419:   fi
                    420: 
1.152     gully     421:   # --------- configure wxWidgets library --------------- #
1.135     gully     422:   echo "---> Configuring wxWidgets library."
                    423:   OLDDIR=`pwd`
1.149     gully     424:   # create the build directory (debug or release)
                    425:   if test $with_wxdebug = yes ; then
1.152     gully     426:     WX_BUILDDIR="wxWidgets_DEBUG"
1.149     gully     427:   else
1.152     gully     428:     WX_BUILDDIR="wxWidgets_RELEASE"
1.149     gully     429:   fi
1.152     gully     430:   mkdir -p $WX_BUILDDIR
                    431:   cd $WX_BUILDDIR
                    432:   AC_SUBST(WX_BUILDDIR)
1.136     gully     433: 
1.149     gully     434:   # remove old configure cached options
1.135     gully     435:   rm -f configarg.cache
1.136     gully     436: 
                    437:   # setup configure options
1.135     gully     438:   if test "$OS_OPTIONS" = "-D_UNIX" ; then
                    439:     # LINUX
1.145     gully     440:     #   --enable-gtk2           use GTK+ 2.0 if available (EXPERIMENTAL)
                    441:     #   --enable-shared         create shared library code
                    442:     #   --enable-unicode        compile wxString with Unicode support
                    443:     #   --with-gtk              use GTK+
                    444:     #   --with-opengl           use OpenGL (or Mesa)
1.152     gully     445:     #   --with-xrc              use XRC resources system
                    446:     WXCONFIGURE_OPTION="--with-opengl --with-gtk --enable-gtk2 --enable-unicode --with-xrc --enable-shared=no"
1.135     gully     447:   fi
                    448:   if test "$OS_OPTIONS" = "-D_UNIX -D_MACOS" ; then
                    449:     # MACOSX
                    450:     AC_MSG_ERROR(TODO: configurer wxWidgets pour MACOSX)
1.145     gully     451:     # --with-mac              use Mac OS X
                    452:     # --with-cocoa            use Cocoa
1.136     gully     453:     # WXCONFIGURE_OPTION="--with-opengl --with-gtk --enable-gtk2 --enable-unicode"
                    454:   fi
                    455:   if test $with_wxdebug = yes ; then
1.141     gully     456:     WXCONFIGURE_OPTION="$WXCONFIGURE_OPTION --enable-debug"
1.143     gully     457:     # SG: I've disabled other debug options because the lib has bugs when using these flags \
                    458:     # (maybe because these flags are not often used by wxWidgets developpers)
1.141     gully     459:     # WXCONFIGURE_OPTION="$WXCONFIGURE_OPTION --enable-debug --enable-debug_cntxt --enable-debug_gdb --enable-debug_info --enable-debug_flag --enable-mem_tracing"
1.145     gully     460:   else
                    461:     WXCONFIGURE_OPTION="$WXCONFIGURE_OPTION --enable-optimise"
1.135     gully     462:   fi
1.143     gully     463: 
1.136     gully     464:   # launch the configure
1.143     gully     465:   if test "$with_mesa" = "yes" ; then
                    466:     # use internal OpenGL (mesa) libraries
1.153   ! gully     467:     ../$WX_SRCDIR/configure CFLAGS="-I${GL_BUILDDIR}/include" CXXFLAGS="-I${GL_BUILDDIR}/include" CPPFLAGS="-I${GL_BUILDDIR}/include" OPENGL_LIBS="-lGL -lGLU" $WXCONFIGURE_OPTION
1.145     gully     468:     if test $? != 0 ; then
                    469:       AC_MSG_ERROR(A problem occurs durring wxWidgets library configuration. Please fix the problem and try again.)
                    470:     fi
1.143     gully     471:   else
                    472:     # use OpenGL system libraries
1.153   ! gully     473:     ../$WX_SRCDIR/configure $WXCONFIGURE_OPTION    
1.143     gully     474:   fi
1.152     gully     475:   cd $OLDDIR
1.135     gully     476:   echo "---> Configuring wxWidgets library. - DONE"
1.143     gully     477: 
1.135     gully     478:   # --------- configuring wxWidgets paths --------------- #
1.152     gully     479:   WXCONFIG=$WX_BUILDDIR/wx-config
1.134     gully     480:   # check that wx-config exists
1.135     gully     481:   if test ! -f $WXCONFIG ; then
1.143     gully     482:     AC_MSG_ERROR(Cannot find wx-config. Please download wxWidgets (http://www.wxwidgets.org/))
1.134     gully     483:   fi
1.144     gully     484: 
                    485:   # setup include paths  
1.152     gully     486:   WX_INCLUDES="`$WXCONFIG --cxxflags`"
1.124     gully     487:   AC_SUBST(WX_INCLUDES)
                    488: 
1.144     gully     489:   # setup libraries paths
                    490:   WX_LIBRARIES=""
                    491:   WX_LIBRARIES_EXTRA_PARAM=""
                    492:   WXCONFIG_LIBS_PARAM="xrc,html,adv,core,xml"
1.132     gully     493:   # GL is used ?
1.143     gully     494:   if test "$with_gl" = "yes" -o "$with_mesa" = "yes" ; then
1.144     gully     495:     WXCONFIG_LIBS_PARAM="${WXCONFIG_LIBS_PARAM},gl"
1.132     gully     496:     # SG: this is a mistery why wx-config doesn't add these needed option on macosx
                    497:     if test "$OS_OPTIONS" = "-D_UNIX -D_MACOS" ; then
1.144     gully     498:       WX_LIBRARIES_EXTRA_PARAM="-framework OpenGL -framework AGL"
1.132     gully     499:     fi
1.124     gully     500:   fi
1.152     gully     501:   WX_LIBRARIES="`$WXCONFIG --libs $WXCONFIG_LIBS_PARAM` ${WX_LIBRARIES_EXTRA_PARAM}"
1.144     gully     502:   AC_SUBST(WX_LIBRARIES)
1.124     gully     503: 
                    504:   WX_OPTIONS="-D_WX"
1.135     gully     505:   # --------- configuring wxWidgets paths - DONE --------------- #
1.132     gully     506: 
                    507:   no_graphic=yes
1.124     gully     508: fi
                    509: 
1.63      vatton    510: if test "${GCC}" = "yes"; then
                    511:    CPP="${CPP} -x c"
                    512: fi
                    513: 
1.1       cvs       514: dnl  ***************************************************************
                    515: dnl
1.61      cvs       516: dnl    SPECIFIC STUFF : CONFIGURATION OPTIONS FOR AMAYA
1.1       cvs       517: dnl
                    518: dnl  ***************************************************************
                    519: 
1.101     kahan     520: # We don't use our graphic libraries for the pure GTK version (without GL)
                    521: 
1.132     gully     522: # if configure has option --with-graphiclibs then dont check for system graphic libs
                    523: # force amaya static graphic libs to be used
                    524: AC_ARG_WITH(graphiclibs, [  --with-graphiclibs     use static libjpeg, libpng.])
1.143     gully     525: if test "$with_graphiclibs" = "yes" -o "$enable_graphiclibs" = "yes" ; then
1.132     gully     526:   no_graphic="no"
                    527: else
                    528:   no_graphic="yes"
1.76      vatton    529: fi
1.132     gully     530:                  
1.76      vatton    531: if test "$no_graphic" = yes; then
                    532: dnl
                    533:     AC_MSG_CHECKING([for libjpeg version = 6b])
                    534:     AC_EGREP_CPP([x 62 *x],
                    535:         [#include <jpeglib.h>
                    536:          x JPEG_LIB_VERSION x],
                    537: dnl
                    538:         AC_MSG_RESULT([yes])
1.105     vatton    539:        JPEGINCL=''
1.76      vatton    540:         LIBJPEG='-ljpeg'
                    541:         MAKEJPEG=['#'],
                    542: dnl
                    543:         AC_MSG_RESULT([no])
1.105     vatton    544:        JPEGINCL='-I$(THOTDIR)/libjpeg'
1.76      vatton    545:         LIBJPEG='../libjpeg.a'      dnl LIBJPEG goes into amaya/Makefile.in
                    546:         )
                    547: dnl    
                    548: dnl
1.95      vatton    549:     AC_MSG_CHECKING([for libpng version = 1.0.x or 1.2.x])
                    550:     AC_EGREP_CPP([x \"1.[02]\..*\" *x],
1.76      vatton    551:         [#include <png.h>
                    552:        x PNG_LIBPNG_VER_STRING x],
                    553: dnl
                    554:         AC_MSG_RESULT([yes])
1.105     vatton    555:        PNGINCL=''
1.76      vatton    556:         LIBPNG='-lpng'
                    557:         LIBZ=''
                    558:        MAKEPNG=['#'],
                    559: dnl
                    560:         AC_MSG_RESULT([no])
1.105     vatton    561:        PNGINCL='-I$(THOTDIR)/libpng -I$(THOTDIR)/libpng/zlib'
1.76      vatton    562:         LIBPNG='../libpng.a'
                    563:         LIBZ='../libz.a'
                    564:         )
                    565: else
1.105     vatton    566:     JPEGINCL='-I$(THOTDIR)/libjpeg'
1.76      vatton    567:     LIBJPEG='../libjpeg.a'
1.105     vatton    568:     PNGINCL='-I$(THOTDIR)/libpng -I$(THOTDIR)/libpng/zlib'
1.76      vatton    569:     LIBPNG='../libpng.a'
                    570:     LIBZ='../libz.a'
                    571: fi
                    572: dnl
                    573: AC_SUBST(LIBJPEG)
                    574: AC_SUBST(LIBPNG)
                    575: AC_SUBST(LIBZ)
                    576: AC_SUBST(MAKEJPEG)
                    577: AC_SUBST(MAKEPNG)
                    578: 
1.119     vatton    579: AMAYA_VER="8.2"
1.1       cvs       580: 
                    581: dnl
1.6       cvs       582: dnl We use a special versoin of cextract patched for alignment
                    583: dnl to build the signatures of the modules functions located in f subdirs
                    584: dnl
                    585: CEXTRACT_VER="1.7"
                    586: CEXTRACT_FLAGS="+O"
                    587: 
1.3       cvs       588: 
                    589: dnl
1.9       cvs       590: dnl Adjust the some variables depending on the host and compiler
1.61      cvs       591: dnl Thotlib NEED signed chars !!!
1.7       cvs       592: dnl
                    593: 
                    594: if test "${CC}" = "gcc" ; then
1.44      cvs       595:   CFLAGS="${CFLAGS} -W "
1.7       cvs       596:   case "${host}" in
                    597:       *-*-irix5* | *-*irix6* )
                    598:          CFLAGS="${CFLAGS} -fsigned-char"
                    599:       ;;
                    600:   esac
1.14      cvs       601: fi
                    602: 
                    603: if test "$ac_cv_c_const" = "no" ; then
                    604:   CFLAGS="${CFLAGS} -DCONST= "
1.7       cvs       605: fi
                    606: 
1.122     gully     607: 
                    608: # force C mode (-x c)
1.123     gully     609: CFLAGS="${CFLAGS} -x c"
1.122     gully     610: 
                    611: # C++ options (-x c++)
                    612: CXX_OPTIONS="-D__cplusplus"
1.123     gully     613: CXXFLAGS="${CXXFLAGS} -W -x c++ ${CXX_OPTIONS}"
1.122     gully     614: 
1.132     gully     615: # setup LDFLAGS
                    616: # on macosx, specific flags must be set to avoid conflicts with allready installed libwww
                    617: # for exemple it's possible to install libwww with fink (fink install libwww)
                    618: # to avoid conflicts, we just force the linker to search for specified amaya path first
1.133     gully     619: if test "$OS_OPTIONS" = "-D_UNIX -D_MACOS" ; then
1.132     gully     620:   LDFLAGS="-Wl,-search_paths_first"
                    621: else
                    622:   LDFLAGS=""
                    623: fi
1.128     gully     624: 
                    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.143     gully     645: if test "$with_gl" = "yes" -o "$with_mesa" = "yes" ; then
                    646: 
                    647:   # if with_gl is on then test system opengl library (GL & GLU)
                    648:   if test "$with_gl" = "yes" ; then
1.139     carcone   649:        # setup a list of standard paths int LDFLAGS
                    650:        # for AC_CHECK_LIB library existance checks
1.140     carcone   651:        LIBS_OLD=$LIBS
1.139     carcone   652:        LDFLAGS_OLD=$LDFLAGS
                    653:        LDFLAGS="-L/usr/X11R6/lib -L/usr/lib -L/usr/local/lib"
1.75      cheyroul  654:        AC_MSG_CHECKING([OpenGL])
                    655:        for ac_dir in                           \
                    656:                /usr/include                    \
                    657:                /usr/X11R6/include              \
                    658:                /usr/local/include              \
                    659:                ; \
1.80      cheyroul  660:        do  if test -r "$ac_dir/GL/gl.h" ; then
1.143     gully     661:           gl_inc="yes"
                    662:           GL_INC_I="$ac_dir"
                    663:           if test "$ac_dir" != "/usr/include" ; then
                    664:             GL_INCLUDES="-I$ac_dir"
                    665:          fi
                    666:           AC_CHECK_LIB(GL,glBegin,,AC_MSG_ERROR(Cannot find OpenGL library. Please install OpenGL.))
                    667:           AC_MSG_RESULT([yes])
                    668:                  break 
                    669:         fi
                    670:        done
                    671:        
1.80      cheyroul  672:        AC_MSG_CHECKING([GLU])  
1.75      cheyroul  673:        for ac_dir in                           \
                    674:                /usr/include                    \
                    675:                /usr/X11R6/include              \
                    676:                /usr/local/include              \
                    677:                ; \
1.138     gully     678:        do  if test -r "$ac_dir/GL/glu.h" ; then
1.143     gully     679:           glu_inc="yes"
                    680:           GL_INC_II="$ac_dir"
                    681:           if test "$ac_dir" != "/usr/include" ; then
                    682:             if test "$ac_dir" != "$GL_INC_I" ; then
                    683:               GL_INCLUDES="$GL_INCLUDES -I$ac_dir"
                    684:             fi
                    685:           fi
                    686:           # now test that glu version is >= 1.2
                    687:           AC_CHECK_LIB(GLU,gluNewTess,,AC_CHECK_LIB(glu32,gluNewTess,,AC_MSG_ERROR(Cannot find OpenGL GLU lib or existing version is < 1.2. Pease upgrade your GLU library.)))
                    688:           AC_MSG_RESULT([yes])
                    689:                  break 
                    690:         fi
                    691:         done
1.139     carcone   692:        LDFLAGS=$LDFLAGS_OLD
1.140     carcone   693:        LIBS=$LIBS_OLD
1.143     gully     694:     if test "$gl_inc" = "" ; then              
                    695:       AC_MSG_WARN(Opengl headers (gl.h) not found !!)
                    696:       AC_MSG_WARN(Disabling opengl build !)
                    697:       with_gl="no"
                    698:       GL_OPTIONS=      
                    699:       GL_INCLUDES=     
                    700:       GL_LIBRARIES=
                    701:       exit 1;
                    702:     fi
                    703: 
                    704:     if test "$glu_inc" = "" ; then
                    705:       AC_MSG_WARN(Glu headers (glu.h) not found !!)
                    706:       AC_MSG_WARN(Disabling opengl build !)
                    707:   
                    708:       with_gl="no"
                    709:       GL_OPTIONS=      
                    710:       GL_INCLUDES=     
                    711:       GL_LIBRARIES=
                    712:       exit 1;
                    713:     fi
                    714:     
                    715:     GL_LIBRARIES="-L/usr/lib -L/usr/X11R6/lib -lGL -lGLU"
                    716:     GL_OPTIONS="-D_GL"
                    717: 
                    718:     AC_SUBST(GL_INCLUDES)
                    719:     AC_SUBST(GL_LIBRARIES)
                    720:   fi # if with_gl
1.139     carcone   721:        
1.143     gully     722:   # check for gtkglarea.h only if gtk gui is selected
                    723:   if test "$with_gtk" = "yes" ; then
                    724:     AC_MSG_CHECKING([GTKGLAREA])
                    725:     for ac_dir in                              \
1.132     gully     726:                /usr/include/GL                 \
1.75      cheyroul  727:                /usr/include                    \
                    728:                /usr/X11R6/include/GL           \
                    729:                /usr/X11R6/include              \
                    730:                /usr/local/include              \
                    731:                /usr/local/include/GL           \
                    732:                ; \
1.143     gully     733:     do  if test -r "$ac_dir/gtkgl/gtkglarea.h" ; then
                    734:       gtkgl_inc="yes"
                    735:         if test "$ac_dir" != "/usr/include" ; then
                    736:           if test "$ac_dir" != "$GL_INC_II" ; then
                    737:             if test "$ac_dir" != "$GL_INC_I" ; then
                    738:               GTK_GL_INCLUDES="-I$ac_dir"
                    739:             fi
                    740:           fi
                    741:         fi
                    742:         AC_MSG_RESULT([yes])
                    743:         break  
                    744:     fi
                    745:     done
                    746:     GTK_GL_LIBRARIES="-lgtkgl"
                    747: 
                    748:     if test "$gtkgl_inc" = "" ; then
                    749:       AC_MSG_WARN(Gtkglarea headers (gktglarea.h) not found !!)
                    750:       AC_MSG_WARN(Disabling opengl build !)
                    751:       with_gl="no"
                    752:       exit 1;
                    753:     fi
                    754:     AC_SUBST(GTK_GL_INCLUDES)
                    755:     AC_SUBST(GTK_GL_LIBRARIES)
                    756:   fi
1.132     gully     757: 
1.143     gully     758:   # checking for freetype lib (fonts library)
                    759:   if test ! -f $(which freetype-config) ; then
                    760:     AC_MSG_ERROR(Cannot find freetype library (font load/display routines). Please install it.)
                    761:   fi
                    762:   FREETYPE_INCLUDES=`freetype-config --cflags`
                    763:   FREETYPE_LIBRARIES=`freetype-config --libs`
                    764:   AC_SUBST(FREETYPE_INCLUDES)
                    765:   AC_SUBST(FREETYPE_LIBRARIES)
                    766: 
                    767: 
                    768:   # checking for xft lib
                    769:   # (not used because xft-config doesn't exist on debian stable)
                    770:   #if test ! -f $(which xft-config) ; then
                    771:   #  AC_MSG_ERROR(Cannot find Xft library. Please install it.)
                    772:   #fi
                    773:   #XFT_INCLUDES=`xft-config --cflags`
                    774:   #XFT_LIBRARIES=`xft-config --libs`
                    775:   #AC_SUBST(XFT_INCLUDES)
                    776:   #AC_SUBST(XFT_LIBRARIES)
                    777: 
                    778:   # START CHECKING XFT #
                    779:   # checking for Xft (old way)
                    780:   AC_MSG_CHECKING([Xft])
                    781:   for ac_dir in                        \
1.104     cheyroul  782:                /usr/include                    \
                    783:                /usr/X11R6/include              \
                    784:                /usr/local/include              \
                    785:                /usr/include/X11/Xft            \
                    786:                /usr/X11R6/include/X11/Xft      \
                    787:                /usr/local/include/X11/Xft      \
                    788:                /usr/include/X11/Xft1           \
                    789:                /usr/X11R6/include/X11/Xft1     \
1.113     vatton    790:                /usr/include/Xft2/X11/Xft/      \
1.104     cheyroul  791:                /usr/local/include/X11/Xft1     \
                    792:                /usr/include/X11/Xft2           \
                    793:                /usr/X11R6/include/X11/Xft2     \
                    794:                /usr/local/include/X11/Xft2     \
                    795:                ; \
1.143     gully     796:   do  if test -r "$ac_dir/Xft.h" ; then
                    797:     xft_inc="yes"
                    798:     XFT_INCLUDES="-I$ac_dir"
                    799:     AC_MSG_RESULT([yes])       
                    800:     break      
                    801:   fi
                    802:   done 
                    803:   if test "$xft_inc" = "" ; then
                    804:     AC_MSG_WARN(Xft 2 headers (Xft.h) not found !!)
                    805:     AC_MSG_WARN(Disabling opengl build !)
                    806:       with_gl="no"
                    807:       exit 1;
                    808:   fi
                    809: 
                    810:   AC_MSG_CHECKING([Xft-library])
                    811:   for ac_dir in                        \
                    812:                /usr/lib                        \
                    813:                /usr/X11R6/lib                  \
                    814:                /usr/local/lib                  \
                    815:                ; \
                    816:   do  if test -r "$ac_dir/libXft.so" ; then
                    817:     xft_lib="yes"
                    818:     XFT_LIBRARIES="-L$ac_dir -lXft"
                    819:     AC_MSG_RESULT([yes])
                    820:     break      
                    821:   fi
                    822:   done 
                    823:   if test "$xft_lib" = "" ; then
                    824:     AC_MSG_WARN(Xft 2 librarie (libXft.so) not found !!)
                    825:     AC_MSG_WARN(Disabling opengl build !)
                    826:       with_gl="no"
                    827:       exit 1;
                    828:   fi
                    829:   AC_SUBST(XFT_INCLUDES)
                    830:   AC_SUBST(XFT_LIBRARIES)
                    831:   # END CHECKING XFT #
                    832: 
                    833: 
                    834:   AC_MSG_CHECKING([gcc3])      
                    835:   for ac_dir in                        \
1.96      cheyroul  836:                /usr/lib                        \
                    837:                /usr/X11R6/lib          \
                    838:                /usr/local/lib          \
                    839:                ; \
1.143     gully     840:   do  if test -r "$ac_dir/libstdc++.so.5" ; then
                    841:     stdglu_inc="yes"
                    842:     STDCPP_LIBRARIES="-lstdc++"
                    843:     STDCPP_INCLUDES=""
                    844:     AC_MSG_RESULT([yes])       
                    845:     break
                    846:   fi
                    847:   done
                    848:   AC_SUBST(STDCPP_INCLUDES)
                    849:   AC_SUBST(STDCPP_LIBRARIES)
                    850: 
                    851:   NOPRINT=""
                    852:   PRINTIFNOTGL=" print_prog"
                    853: 
                    854: else # if with_gl or with_mesa
                    855: 
                    856:   NOPRINT=""
                    857:   PRINTIFNOTGL=" print_prog"
1.132     gully     858: 
1.143     gully     859: fi # if with_gl or with_mesa
1.132     gully     860: 
1.97      cheyroul  861: AC_SUBST(PRINTIFNOTGL)
1.112     cheyroul  862: AC_SUBST(NOPRINT)
                    863: 
1.76      vatton    864: 
                    865: AC_ARG_ENABLE(svg,           [  --disable-svg           remove SVG support ])
                    866: AC_ARG_ENABLE(annot,         [  --disable-annot         remove Annotations support ])
1.146     kahan     867: AC_ARG_ENABLE(redland,       [  --disable-redland       disable the redland RDF library ])
1.116     kahan     868: AC_ARG_ENABLE(system-redland,       [  --enable-system-redland try the redland RDF system library ])
1.108     kahan     869: AC_ARG_ENABLE(bookmarks,     [  --enable-bookmarks      enables experimental bookmark support ])
1.76      vatton    870: AC_ARG_ENABLE(generic-xml,   [  --disable-generic-xml   remove Generic XML support ])
                    871: 
1.75      cheyroul  872: dnl
1.21      cvs       873: dnl plugins support is disabled by default
1.8       cvs       874: dnl
1.13      cvs       875: 
                    876: if test "$with_plugin" = "" ; then
1.21      cvs       877:   if test "$enable_plugin" = "yes" ; then
1.55      kahan     878:     with_plugin="yes"
1.21      cvs       879:   else
1.17      cvs       880:     with_plugin="no"
                    881:   fi
1.10      cvs       882: fi  
1.1       cvs       883: 
1.8       cvs       884: dnl
1.68      vatton    885: dnl svg is enabled by default
1.26      cvs       886: dnl
1.68      vatton    887: if test "$with_svg" = "" ; then
                    888:     if test "$enable_svg" = "no" ; then
                    889:        with_svg="no"
1.49      cvs       890:     else
1.68      vatton    891:        with_svg="yes"
1.26      cvs       892:     fi
                    893: fi
                    894: 
                    895: dnl
1.56      kahan     896: dnl annotations is enabled by default
1.47      cvs       897: dnl
                    898: if test "$with_annot" = "" ; then
1.56      kahan     899:     if test "$enable_annot" = "no" ; then
                    900:        with_annot="no"
                    901:     else
1.54      cvs       902:        with_annot="yes"
1.47      cvs       903:     fi
1.99      kahan     904: else
                    905:     with_annot="yes"
1.47      cvs       906: fi
                    907: 
1.93      kahan     908: 
                    909: dnl
1.146     kahan     910: dnl The redland library is enabled by default
1.93      kahan     911: dnl
1.146     kahan     912: if test "$with_redland" = "" ; then
                    913:     if test "$enable_redland" = "no" ; then
                    914:        with_redland="no"
1.93      kahan     915:     else
1.109     kahan     916:        with_redland="yes"
                    917:     fi
                    918: else
1.146     kahan     919:     with_redland="yes"
1.109     kahan     920: fi
                    921: 
                    922: dnl
1.116     kahan     923: dnl The redland library is disabled by default
                    924: dnl
                    925: if test "$with_system_redland" = "" ; then
                    926:     if test "$enable_system_redland" = "yes" ; then
                    927:        with_redland="yes"
                    928:        with_system_redland="yes"
                    929:     else
                    930:        with_system_redland="no"
                    931:     fi
                    932: else
                    933:     with_system_redland="no"
                    934: fi
                    935: 
                    936: dnl
                    937: dnl The bookmarks support is disabled by default
1.108     kahan     938: dnl
                    939: if test "$with_bookmarks" = "" ; then
                    940:     if test "$enable_bookmarks" = "yes" ; then
                    941:        with_bookmarks="yes"
1.125     vatton    942:        with_redland="yes"
1.108     kahan     943:     else
                    944:        with_bookmarks="no"
                    945:     fi
                    946: else
                    947:     with_bookmarks="no"
                    948: fi
                    949: 
                    950: dnl
1.70      kahan     951: dnl Generic XML support enabled by default
                    952: dnl
                    953: if test "$with_generic_xml" = "" ; then
                    954:     if test "$enable_generic_xml" = "no" ; then
                    955:        with_generic_xml="no"
                    956:        GENERIC_XML_OPTIONS=
                    957:     else
                    958:        with_generic_xml="yes"
                    959:        GENERIC_XML_OPTIONS=-DXML_GENERIC
                    960:     fi
                    961: fi
                    962: 
1.120     gully     963: AC_ARG_WITH(dav,            [  --with-dav              enable WebDAV support (experimental) ])
1.88      kirschpi  964: dnl
                    965: dnl DAV support disabled by default
                    966: dnl
                    967: if test "$with_dav" = "" ; then
                    968:   if test "$enable_dav" = "yes" ; then
                    969:     with_dav="yes"
                    970:   else
                    971:     with_dav="no"
                    972:   fi
                    973: fi  
                    974: 
                    975: if test "$with_dav" = "yes" ; then
                    976:    DAV_OPTIONS=-DDAV
1.90      kirschpi  977:    DAVDIR="davlib"
                    978:    LIBDAV="libwwwdav"
                    979:    WITHDAV="--with-dav" 
                    980:    WWWDAV="-lwwwdav" 
1.88      kirschpi  981: else
                    982:    with_dav="no"
                    983:    DAV_OPTIONS=""
1.90      kirschpi  984:    DAVDIR=""
                    985:    LIBDAV=""
                    986:    WITHDAV="" 
                    987:    WWWDAV="" 
1.88      kirschpi  988: fi
                    989: 
1.70      kahan     990: 
1.19      cvs       991: if test "$build_amaya" = "yes" ; then
1.43      cvs       992:     if test ! -f $srcdir/../libwww/Makefile.in ; then
1.50      cvs       993:        AC_MSG_WARN(libwww sources not found !!)
                    994:        AC_MSG_WARN(Disabling Amaya build !)
                    995:        build_amaya="no"
1.1       cvs       996:     fi
1.8       cvs       997: 
                    998:     if test ! -f $srcdir/amaya/MathML.S ; then
1.10      cvs       999:        if test "$with_math" = "yes" ; then
1.8       cvs      1000:            AC_MSG_WARN(MathML sources not found !!)
1.26      cvs      1001:            AC_MSG_WARN(Disabling Math build !)
1.10      cvs      1002:            with_math="no"
                   1003:            MATH_OPTIONS=
1.8       cvs      1004:        fi
                   1005:     fi
1.26      cvs      1006: 
1.68      vatton   1007:     if test ! -f $srcdir/amaya/SVG.S ; then
                   1008:        if test "$with_svg" = "yes" ; then
                   1009:            AC_MSG_WARN(SVG sources not found !!)
                   1010:            AC_MSG_WARN(Disabling SVG build !)
                   1011:            with_svg="no"
                   1012:            SVG_OPTIONS=
1.26      cvs      1013:        fi
                   1014:     fi
                   1015: 
1.48      cvs      1016:     if test ! -f $srcdir/annotlib/Makefile.in ; then
1.47      cvs      1017:        if test "$with_annot" = "yes" ; then
                   1018:            AC_MSG_WARN(Annotation makefile not found !!)
                   1019:            AC_MSG_WARN(Disabling Annotations build !)
                   1020:            with_annot="no"
                   1021:        fi
                   1022:     fi
1.55      kahan    1023: 
1.146     kahan    1024:     if test "$with_redland" = "yes" -a "$with_annot" = "no" -a "$with_bookmarks" = "no"; then
                   1025:        AC_MSG_WARN(Disabling redland as neither annotations nor bookmarks are enabled !)
1.93      kahan    1026:        MAKERAPTOR=['#']
                   1027:        with_raptor="no"
                   1028:     fi
                   1029: 
1.116     kahan    1030:     redland_compile_source=yes
                   1031:     if test "$with_redland" = "yes" -a "$with_system_redland" = "yes" ; then
                   1032:        # check to see if we have a redland library
                   1033:        AC_MSG_CHECKING(system redland library)
1.142     kahan    1034:        redland_min_version=0.9.16
1.116     kahan    1035:        REDLAND_CONFIG="redland-config"
                   1036:        REDLAND_VERSION=`$REDLAND_CONFIG --version`
                   1037:        redland_version_dec=`echo $REDLAND_VERSION | awk -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'`
                   1038:        redland_min_version_dec=`echo $redland_min_version | awk -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'`
                   1039:        if test $redland_version_dec -lt $redland_min_version_dec; then
                   1040:          AC_MSG_RESULT(no - found version $REDLAND_VERSION and minimal version is $redland_min_version)
                   1041:        else
                   1042:          AC_MSG_RESULT(yes - found version $REDLAND_VERSION)
                   1043:         AC_MSG_CHECKING(checking for redland headers)
1.117     kahan    1044:         dnl  We should use awk here and remove the -I from the following line
                   1045:          dnl REDLAND_HEADERS=`$REDLAND_CONFIG --cflags`
                   1046:         REDLAND_HEADERS=""
                   1047:         if test -e "/usr/include/redland.h" ; then
                   1048:           REDLAND_HEADERS="/usr/include";
                   1049:         else 
                   1050:            if test -e "/usr/local/include/redland.h" ; then
                   1051:             REDLAND_HEADERS="/usr/local/include";
                   1052:            fi
                   1053:          fi        
                   1054:         if test $REDLAND_HEADERS != ""; then
1.116     kahan    1055:            AC_MSG_RESULT(yes - have development version)
                   1056:            redland_compile_source=no
                   1057:         else
                   1058:            AC_MSG_RESULT(no - no development version)
                   1059:          fi
                   1060:        fi
                   1061:     fi
                   1062: 
                   1063:     if test "$with_redland" = "yes" -a "$redland_compile_source" = "yes" \
                   1064:        -a ! -d "$srcdir/../redland" ; then
1.109     kahan    1065:        AC_MSG_WARN(Redland source dir not found !!)
                   1066:        AC_MSG_WARN(Disabling redland build !)
                   1067:        MAKEREDLAND=['#']
                   1068:        with_redland="no"
                   1069:     fi
                   1070: 
                   1071:     if test "$with_redland" = "yes" ; then
1.116     kahan    1072:        AMAYA_ANNOT_OPTIONS="$AMAYA_ANNOT_OPTIONS -DLIBRDF_INTERNAL=1 -DAM_REDLAND -DRAPTOR_RDF_PARSER"
                   1073:        if test "$redland_compile_source" = "yes" ; then
                   1074:          AMAYA_RAPTOR_SRC="amaya_comp_redland"
                   1075:          AMAYA_ANNOT_OPTIONS="$AMAYA_ANNOT_OPTIONS -I\$(THOTDIR)/../redland/librdf -I\$(THOTDIR)/../redland/raptor"
                   1076:          AMAYA_RAPTOR_LIBS="../redland/librdf/.libs/librdf.a ../redland/raptor/.libs/libraptor.a"
                   1077:          AMAYA_RAPTOR_INCLUDES="-I\$(THOTDIR)/../redland/librdf -I\$(THOTDIR)/../redland/raptor"
                   1078:        else
                   1079:          MAKEREDLAND=['#']
                   1080:         AMAYA_RAPTOR_SRC=
                   1081:         redland_includes=`$REDLAND_CONFIG --cflags`
                   1082:         redland_libs=`$REDLAND_CONFIG --libs`
                   1083:          AMAYA_ANNOT_OPTIONS="$AMAYA_ANNOT_OPTIONS"
                   1084:          AMAYA_ANNOT_INCLUDES="$redland_includes -I\$(THOTDIR)/thotlib/include"
                   1085:          AMAYA_ANNOT_EXTRA_LIBS="$redland_libs"
                   1086:          AMAYA_RAPTOR_INCLUDES="$redland_includes"
                   1087:        fi
1.109     kahan    1088:     fi
                   1089: 
1.116     kahan    1090: 
1.108     kahan    1091:     dnl control whether we should build the bookmarks support
1.146     kahan    1092:     if test "$with_annot" = "yes" -a "$with_redland" = "no" ; then
                   1093:        AC_MSG_WARN(Disabling annotations build as redland is disabled !)
1.148     kahan    1094:        with_annot="no"
1.146     kahan    1095:     fi
1.108     kahan    1096:     if test "$with_bookmarks" = "yes" -a "$with_annot" = "no" ; then
                   1097:        AC_MSG_WARN(Disabling bookmarks build as annotations are disabled !)
                   1098:        with_bookmarks="no"
                   1099:     fi
1.109     kahan    1100:     if test "$with_bookmarks" = "yes" -a "$with_redland" = "no" ; then
                   1101:        AC_MSG_WARN(Disabling bookmarks build as redland is disabled !)
1.108     kahan    1102:        with_bookmarks="no"
                   1103:     fi
                   1104:     if test "$with_bookmarks" = "yes" ; then
                   1105:        ANNOTLIB_COMPILE_BM=
                   1106:        AMAYA_ANNOT_OPTIONS="$AMAYA_ANNOT_OPTIONS -DBOOKMARKS"
                   1107:     else
                   1108:        ANNOTLIB_COMPILE_BM=['#']
                   1109:     fi
                   1110: 
1.55      kahan    1111:     if test "$with_plugin" = "yes" ; then
                   1112:         AC_MSG_WARN(The plugin library isn't supported anymore in Amaya !!)
                   1113:        AC_MSG_WARN(Disabling plugin build !)
                   1114:        with_plugin="no"
                   1115:     fi
                   1116: 
1.88      kirschpi 1117: 
                   1118:     if test ! -f $srcdir/davlib/Makefile.in ; then
                   1119:        if test "$with_dav" = "yes" ; then
                   1120:            AC_MSG_WARN(WebDAV makefile not found !!)
                   1121:            AC_MSG_WARN(Disabling WebDAV build !)
                   1122:            with_dav="no"
1.90      kirschpi 1123:             DAVDIR=""
                   1124:             LIBDAV=""
                   1125:             WITHDAV="" 
                   1126:             WWWDAV="" 
1.88      kirschpi 1127:        fi
                   1128:     fi
                   1129:    
                   1130: 
1.1       cvs      1131: fi
                   1132: 
                   1133: dnl
                   1134: dnl The options for each library or binary
                   1135: dnl
                   1136: 
1.134     gully    1137: THOT_OPTIONS="$OS_OPTIONS $GTK_OPTIONS $GL_OPTIONS $WX_OPTIONS $NOGUI_OPTIONS"
                   1138: AMAYA_OPTIONS="$OS_OPTIONS $MATH_OPTIONS $SVG_OPTIONS $GENERIC_XML_OPTIONS $GTK_OPTIONS $GL_OPTIONS $WX_OPTIONS $NOGUI_OPTIONS"
1.58      cvs      1139: #PLUGIN_OPTIONS="-DPLUGIN_TRACE -DXP_UNIX"
1.129     vatton   1140: AMAYA_ANNOT_OPTIONS="$OS_OPTIONS $AMAYA_ANNOT_OPTIONS"
1.101     kahan    1141: 
1.102     kahan    1142: IMGLIBS="-ljpeg -lpng -lz"
1.132     gully    1143: 
1.3       cvs      1144: EXTRA_LIBS=
1.131     gully    1145: EXTRA_INCLUDES=
                   1146: 
                   1147: # check for malloc.h
                   1148: # on macosx, this file is not at the right place
                   1149: for ac_dir in               \
                   1150:   /usr/include/malloc/      \
                   1151:   /sw/include/malloc/       \
                   1152:   ; \
                   1153: do
                   1154:   if test -r "$ac_dir/malloc.h"; then
                   1155:     echo "found malloc.h"
                   1156:     EXTRA_INCLUDES="${EXTRA_INCLUDES} -I$ac_dir"
                   1157:     break
                   1158:   fi
                   1159: done
1.1       cvs      1160: 
                   1161: dnl
                   1162: dnl Set up the PATHs needed
                   1163: dnl
                   1164: 
                   1165: API="\$(THOTDIR)/thotlib/include"
                   1166: VAR="\$(THOTDIR)/thotlib/internals/var"
                   1167: INCL="\$(THOTDIR)/thotlib/internals/h"
                   1168: FUNC="\$(THOTDIR)/thotlib/internals/f"
                   1169: 
                   1170: dnl
                   1171: dnl Set up the include variables.
                   1172: dnl
                   1173: 
1.61      cvs      1174: THOTINCLUDES="-I${API} -I${VAR} -I${INCL} -I${FUNC} ${JPEGINCL} ${PNGINCL}"
1.58      cvs      1175: APIINCLUDES=-I${API}
                   1176:  
                   1177: if test "${VPATHOPT}" = "" ; then
1.1       cvs      1178:        VPATHOPT="VPATH"
                   1179: fi
                   1180: 
                   1181: dnl
                   1182: dnl Exports the current values of the variables.
                   1183: dnl
                   1184: 
                   1185: AC_SUBST(AMAYA_VER)
1.6       cvs      1186: AC_SUBST(CEXTRACT_VER)
                   1187: AC_SUBST(CEXTRACT_FLAGS)
1.1       cvs      1188: 
                   1189: AC_SUBST(THOTINCLUDES)
                   1190: AC_SUBST(APIINCLUDES)
                   1191: AC_SUBST(VPATHOPT)
                   1192: 
1.63      vatton   1193: AC_SUBST(GTK_OPTIONS)
1.1       cvs      1194: AC_SUBST(THOT_OPTIONS)
                   1195: AC_SUBST(AMAYA_OPTIONS)
                   1196: AC_SUBST(PLUGIN_OPTIONS)
1.48      cvs      1197: AC_SUBST(AMAYA_ANNOT_OPTIONS)
1.110     kahan    1198: AC_SUBST(AMAYA_ANNOT_INCLUDES)
1.116     kahan    1199: AC_SUBST(AMAYA_ANNOT_EXTRA_LIBS)
1.1       cvs      1200: AC_SUBST(IMGLIBS)
1.3       cvs      1201: AC_SUBST(EXTRA_LIBS)
1.131     gully    1202: AC_SUBST(EXTRA_INCLUDES)
1.90      kirschpi 1203: 
                   1204: AC_SUBST(DAVDIR)
                   1205: AC_SUBST(LIBDAV)
                   1206: AC_SUBST(WITHDAV)
                   1207: AC_SUBST(WWWDAV)
1.1       cvs      1208: 
1.93      kahan    1209: AC_SUBST(MAKERAPTOR)
1.109     kahan    1210: AC_SUBST(MAKEREDLAND)
1.108     kahan    1211: AC_SUBST(ANNOTLIB_COMPILE_BM)
1.109     kahan    1212: AC_SUBST(AMAYA_RAPTOR_SRC)
1.93      kahan    1213: AC_SUBST(AMAYA_RAPTOR_LIBS)
                   1214: AC_SUBST(AMAYA_RAPTOR_INCLUDES)
                   1215: AC_SUBST(MAKE_LIBWWW_RDF_PARSER)
                   1216: AC_SUBST(LIBWWW_RDF_PARSER)
                   1217: 
                   1218: AC_SUBST(SUBDIRS)
                   1219: 
1.1       cvs      1220: dnl
1.48      cvs      1221: dnl Include the option Makefile.xxx fragment according to the configure options
1.1       cvs      1222: dnl
                   1223: 
                   1224: if test "$with_plugin" = "yes" ; then
1.50      cvs      1225:     AC_SUBST_FILE(plugin_frag)
1.1       cvs      1226:     plugin_frag=$srcdir/pluginlib/Makefile.plugin
                   1227: else
                   1228:     AC_SUBST_FILE(plugin_frag)
                   1229:     plugin_frag=/dev/null
                   1230: fi
                   1231: 
                   1232:     AC_SUBST_FILE(www_frag)
1.49      cvs      1233:     www_frag=$srcdir/amaya/Makefile.libwww
1.1       cvs      1234: 
1.50      cvs      1235: if test "$with_math" = "no" ; then
1.10      cvs      1236:     AC_SUBST_FILE(math_frag)
1.50      cvs      1237:     math_frag=/dev/null
1.8       cvs      1238: else
1.10      cvs      1239:     AC_SUBST_FILE(math_frag)
1.50      cvs      1240:     math_frag=$srcdir/amaya/Makefile.math
1.8       cvs      1241: fi
                   1242: 
1.68      vatton   1243: if test "$with_svg" = "no" ; then
                   1244:     AC_SUBST_FILE(svg_frag)
                   1245:     svg_frag=/dev/null
1.26      cvs      1246: else
1.68      vatton   1247:     AC_SUBST_FILE(svg_frag)
                   1248:     svg_frag=$srcdir/amaya/Makefile.svg
1.26      cvs      1249: fi
                   1250: 
1.47      cvs      1251: if test "$with_annot" = "yes" ; then
                   1252:     AC_SUBST_FILE(annot_frag)
1.48      cvs      1253:     annot_frag=$srcdir/annotlib/Makefile.annot
1.47      cvs      1254: else
                   1255:     AC_SUBST_FILE(annot_frag)
                   1256:     annot_frag=/dev/null
                   1257: fi
                   1258: 
1.88      kirschpi 1259: if test "$with_dav" = "yes" ; then
                   1260:     AC_SUBST_FILE(dav_frag)
                   1261:     dav_frag=$srcdir/davlib/Makefile.dav
                   1262: fi
1.16      cvs      1263: 
1.1       cvs      1264: dnl  ***************************************************************
                   1265: dnl
                   1266: dnl      FINAL STEP : PRODUCE ALL THE MAKEFILES AND CONFIG FILES
                   1267: dnl
                   1268: dnl  ***************************************************************
                   1269: 
                   1270: EXTRA_MAKEFILE_IN=
1.2       cvs      1271: make_output="Makefile Options.orig:Options.in tools/Makefile \
1.1       cvs      1272:        libjpeg/Makefile libpng/Makefile libpng/zlib/Makefile \
1.2       cvs      1273:        tools/mkdep/Makefile \
1.1       cvs      1274:        tools/cextract-1.7/Makefile thotlib/Makefile \
1.127     vatton   1275:        thotlib/include/Makefile batch/Makefile"
1.1       cvs      1276: 
                   1277: if test "$build_amaya" = "yes" ; then
1.2       cvs      1278: 
1.19      cvs      1279:     make_output="$make_output amaya/Makefile pluginlib/Makefile"
1.2       cvs      1280:     EXTRA_MAKEFILE_IN="$srcdir/amaya/Makefile.in \
1.93      kahan    1281:     $srcdir/amaya/Makefile.libwww"
1.27      cvs      1282: 
                   1283:     if test "$$with_plugin" = "yes" ; then
                   1284:        make_output="$make_output pluginlib/Makefile"
                   1285:        EXTRA_MAKEFILE_IN="$srcdir/pluginlib/Makefile.in \
1.93      kahan    1286:        $srcdir/pluginlib/Makefile.plugin"
1.27      cvs      1287:     fi
1.2       cvs      1288: 
1.48      cvs      1289:     if test "$with_annot" = "yes" ; then
                   1290:        make_output="$make_output annotlib/Makefile"
                   1291:        EXTRA_MAKEFILE_IN="$srcdir/annotlib/Makefile.in"
                   1292:     fi
1.88      kirschpi 1293: 
                   1294:     if test "$with_dav" = "yes" ; then
                   1295:        make_output="$make_output davlib/Makefile"
                   1296:        EXTRA_MAKEFILE_IN="$srcdir/davlib/Makefile.in"
                   1297:     fi
                   1298: 
1.1       cvs      1299: fi
                   1300: 
                   1301: AC_SUBST(EXTRA_MAKEFILE_IN)
1.6       cvs      1302: AC_OUTPUT($make_output , [
                   1303: dnl
                   1304: dnl This fragment of shell code is executed after the
                   1305: dnl Makefile(s) dump ...
                   1306: dnl
                   1307: 
                   1308: echo timestamp > stamp-h
                   1309: 
                   1310: dnl
                   1311: dnl Check for an upgrade in the Options numbers
                   1312: dnl
                   1313: 
                   1314: if test -f Options ; then
                   1315:    oldversion=`grep Version Options`
                   1316:    newversion=`grep Version Options.orig`
                   1317:    if test "$oldversion" != "$newversion" ; then
                   1318:        echo WARNING : Options files have changed, old options saved to Options.old
                   1319:        cp Options Options.old
                   1320:        cp Options.orig Options
                   1321:        exit 1
                   1322:    fi
                   1323: fi
                   1324: ])
1.1       cvs      1325: 
                   1326: if test "$build_amaya" = "yes" ; then
1.50      cvs      1327:     echo Amaya configured with libWWW
                   1328:     if test "$with_plugin" = "yes" ; then
                   1329:         echo Amaya configured with Plugins support
1.8       cvs      1330:     fi
1.10      cvs      1331:     if test "$with_math" = "yes" ; then
                   1332:        echo Amaya configured with Math support
1.26      cvs      1333:     fi
1.68      vatton   1334:     if test "$with_svg" = "yes" ; then
                   1335:        echo Amaya configured with SVG support
1.47      cvs      1336:     fi
                   1337:     if test "$with_annot" = "yes" ; then
                   1338:        echo Amaya configured with Annotations support
1.70      kahan    1339:     fi
1.93      kahan    1340:     if test "$with_raptor" = "yes" ; then
1.106     kahan    1341:        echo Amaya configured with the Raptor RDF parser
1.109     kahan    1342:     fi
                   1343:     if test "$with_redland" = "yes" ; then
1.116     kahan    1344:        if test "$with_system_redland" = "no" ; then
                   1345:          echo Amaya configured with the Redland RDF library \(local source\)
                   1346:        else
                   1347:          echo Amaya configured with the Redland RDF library \(system\)
                   1348:        fi
1.108     kahan    1349:     fi
                   1350:     if test "$with_bookmarks" = "yes" ; then
                   1351:        echo Amaya configured with bookmarks support \(experimental\)
1.93      kahan    1352:     fi
1.70      kahan    1353:     if test "$with_generic_xml" = "yes" ; then
                   1354:        echo Amaya configured with generic XML suppport
                   1355:     fi
1.129     vatton   1356:     echo Amaya configured with internationalization suppport
1.75      cheyroul 1357:     if test "$with_gl" = "yes" ; then
1.143     gully    1358:        echo Amaya configured with OpenGL Canvas Rendering \(System library\) \(experimental\)
                   1359:     fi
                   1360:     if test "$with_mesa" = "yes" ; then
                   1361:        echo Amaya configured with OpenGL Canvas Rendering \(MesaLib\) \(experimental\)
1.88      kirschpi 1362:     fi
                   1363:     if test "$with_dav" = "yes" ; then
                   1364:        echo Amaya configured with WebDAV support \(experimental\)
1.1       cvs      1365:     fi
1.5       cvs      1366: fi
                   1367: 
1.107     kahan    1368: if test "$no_graphic" = "yes" ; then
                   1369:     echo "Amaya configured with system graphic libraries (libjpeg, libpng, zlib)"
                   1370: else
                   1371:     echo "Amaya configured with static graphic libraries (libjpeg, libpng, zlib)"
                   1372:     if test "$with_gtk" = "yes" -o "$with_gl" = "yes" ; then
                   1373:       echo "  N.B. This option may not work in your platform. If Amaya crashes"
                   1374:       echo "  when opening a PNG file. Recompile it using the system libraries."
                   1375:     fi
                   1376: fi
                   1377: 
                   1378: if test "$with_gtk" = "yes" ; then
1.67      vatton   1379:     echo "Amaya configured with GTK"
1.120     gully    1380: fi
                   1381: 
1.124     gully    1382: if test "$with_wx" = "yes" ; then
1.136     gully    1383:   if test "$with_wxdebug" = "yes" ; then
1.153   ! gully    1384:     echo "Amaya configured with wxWidgets {srcdir=$WX_SRCDIR} (debug) (experimental)"
1.136     gully    1385:   else
1.153   ! gully    1386:     echo "Amaya configured with wxWidgets {srcdir=$WX_SRCDIR} (experimental)"
1.136     gully    1387:   fi
1.1       cvs      1388: fi
                   1389: 
1.121     gully    1390: if test "$with_nogui" = "yes" ; then
1.128     gully    1391:   echo "Amaya configured without GUI toolkit"
1.121     gully    1392: fi
1.136     gully    1393: 
                   1394: 
1.107     kahan    1395: echo ""
1.78      vatton   1396: echo "Now type \"make\" (GNU make preferably) to build the binaries"
1.107     kahan    1397: echo ""
1.120     gully    1398: 

Webmaster