Annotation of Amaya/configure.in, revision 1.148

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

Webmaster