Annotation of Amaya/configure.in, revision 1.152

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

Webmaster