Annotation of Amaya/configure.in, revision 1.264

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.216     vatton     13: AC_PREREQ(2.54)
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: 
1.228     kia        71: 
1.1       cvs        72: dnl
                     73: dnl Checks for libraries.
                     74: dnl
                     75: 
                     76: AC_CHECK_LIB(socket, socket, )
                     77: AC_CHECK_LIB(inet, connect)
                     78: AC_CHECK_LIB(nsl, t_accept)
                     79: AC_CHECK_LIB(dl, dlopen)
1.141     gully      80: #AC_PATH_X
                     81: #AC_PATH_XTRA
1.1       cvs        82: 
1.41      cvs        83: dnl
1.5       cvs        84: dnl Checks for header files.
                     85: dnl
                     86: 
                     87: AC_HEADER_DIRENT
                     88: AC_HEADER_STDC
                     89: AC_HEADER_SYS_WAIT
                     90: 
                     91: AC_CHECK_HEADERS(stdio.h)
                     92: AC_CHECK_HEADERS(sys/types.h types.h)
                     93: AC_CHECK_HEADERS(sys/unistd.h unistd.h)
                     94: AC_CHECK_HEADERS(sys/fcntl.h fcntl.h)
                     95: AC_CHECK_HEADERS(sys/limits.h limits.h)
                     96: AC_CHECK_HEADERS(sys/stat.h stat.h)
                     97: AC_CHECK_HEADERS(sys/file.h)
                     98: AC_CHECK_HEADERS(sys/ioctl.h)
                     99: AC_CHECK_HEADERS(sys/time.h time.h)
                    100: AC_CHECK_HEADERS(sys/systeminfo.h)
1.46      cvs       101: AC_CHECK_HEADERS(sys/string.h strings.h)
1.34      cvs       102: AC_CHECK_HEADERS(sys/syslog.h syslog.h)
1.5       cvs       103: AC_CHECK_HEADERS(sys/socket.h socket.h)
1.131     gully     104: 
                    105: # SG: not used ? => do not compile on macosx
                    106: # AC_CHECK_HEADERS(appkit/appkit.h appkit.h)
                    107: # AC_CHECK_HEADERS(apppkit/apppkit.h apppkit.h)
                    108: 
1.5       cvs       109: AC_CHECK_HEADERS(netinet/in.h in.h)
                    110: AC_CHECK_HEADERS(dn.h)
                    111: AC_CHECK_HEADERS(sys/ipc.h)
                    112: AC_CHECK_HEADERS(net/errno.h sys/errno.h errno.h)
                    113: AC_CHECK_HEADERS(pwd.h)
                    114: AC_CHECK_HEADERS(grp.h)
                    115: AC_CHECK_HEADERS(arpa/inet.h inet.h)
                    116: AC_CHECK_HEADERS(netdb.h)
                    117: AC_CHECK_HEADERS(manifest.h)
                    118: AC_CHECK_HEADERS(bsdtypes.h)
                    119: AC_CHECK_HEADERS(stdefs.h)
                    120: AC_CHECK_HEADERS(bsdtime.h)
                    121: AC_CHECK_HEADERS(sys/select.h select.h)
                    122: AC_CHECK_HEADERS(dnetdb.h)
                    123: AC_CHECK_HEADERS(libc.h)
                    124: AC_CHECK_HEADERS(stdlib.h)
                    125: AC_CHECK_HEADERS(malloc.h)
                    126: AC_CHECK_HEADERS(memory.h)
                    127: AC_CHECK_HEADERS(unixlib.h)
                    128: AC_CHECK_HEADERS(ctype.h)
                    129: AC_CHECK_HEADERS(cursesX.h curses.h)
                    130: AC_CHECK_HEADERS(sys/resource.h resource.h)
                    131: AC_HEADER_DIRENT
                    132: AC_CHECK_HEADERS(dir.h direct.h) dnl AC_HEADER_DIRENT only checks for some..
                    133: AC_HEADER_STDC
                    134: AC_HEADER_SYS_WAIT
                    135: AC_HEADER_TIME
                    136: AC_HEADER_STAT
1.103     kahan     137: AC_CHECK_HEADERS(stdint.h)
1.5       cvs       138: 
                    139: dnl
                    140: dnl Checks for typedefs, structures, and compiler characteristics.
                    141: dnl
                    142: 
                    143: AC_C_CONST
                    144: AC_C_INLINE
                    145: AC_TYPE_MODE_T
                    146: AC_TYPE_OFF_T
                    147: AC_TYPE_SIZE_T
                    148: AC_HEADER_TIME
                    149: AC_STRUCT_TM
                    150: AC_STRUCT_TIMEZONE
                    151: AC_TYPE_UID_T
                    152: 
                    153: dnl
                    154: dnl Checks for library functions.
                    155: dnl
                    156: 
                    157: AC_FUNC_ALLOCA
                    158: AC_TYPE_GETGROUPS
                    159: AC_PROG_GCC_TRADITIONAL
                    160: AC_FUNC_MEMCMP
                    161: AC_FUNC_MMAP
                    162: AC_TYPE_SIGNAL
                    163: AC_FUNC_VPRINTF
1.58      cvs       164: 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       165: 
1.132     gully     166: #
                    167: # Check for operating system (UNIX / WINDOWS / MACOSX )
                    168: # ---------->
1.262     vatton    169: 
1.178     gully     170: # canonicalize the target OS
                    171: AMAYAOS="LINUX"
1.132     gully     172: case $target_os in
1.178     gully     173:   aix*)       AMAYAOS="LINUX" ;;
                    174:   cygwin*)    AMAYAOS="WINDOWS" ;;
                    175:   darwin*)    AMAYAOS="MACOSX" ;;
1.259     vatton    176:   freebsd2*)  AMAYAOS="FREEBSD" ;;
                    177:   freebsd*)   AMAYAOS="FREEBSD" ;;
1.178     gully     178:   hpux*)      AMAYAOS="LINUX" ;;
                    179:   irix*)      AMAYAOS="LINUX" ;;
                    180:   linuxaout*) AMAYAOS="LINUX" ;;
                    181:   linux*)     AMAYAOS="LINUX" ;;
                    182:   mingw32*)   AMAYAOS="WINDOWS" ;;
                    183:   netbsd*)    AMAYAOS="LINUX" ;;
                    184:   openbsd*)   AMAYAOS="LINUX" ;;
                    185:   osf[12]*)   AMAYAOS="LINUX" ;;
                    186:   osf*)       AMAYAOS="LINUX" ;;
1.259     vatton    187:   solaris2*)  AMAYAOS="FREEBSD" ;;
                    188:   sunos4*)    AMAYAOS="FREEBSD" ;;
1.178     gully     189:   ultrix*)    AMAYAOS="LINUX" ;;
                    190: esac
                    191: AC_SUBST(AMAYAOS)
                    192: 
                    193: if test "$AMAYAOS" = "WINDOWS" ; then
                    194:   AC_MSG_ERROR(Windows port do not use configure - not yet tested.)
                    195: fi
                    196: 
1.264   ! vatton    197: #default library path
        !           198: UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
        !           199: SYSLIB_PATH="/usr/lib"
        !           200: 
1.178     gully     201: OS_OPTIONS="-D_UNIX" # default is UNIX
                    202: case $AMAYAOS in
1.264   ! vatton    203:   LINUX)
        !           204:             if test "$UNAME_MACHINE"="x86_64" ; then
        !           205:               SYSLIB_PATH="/usr/lib64"
        !           206:             fi
        !           207:             OS_OPTIONS="-D_UNIX" ;;
        !           208:   WINDOWS)  OS_OPTIONS="-D_WINDOWS" ;; # not tested (cygwin or mingw)
        !           209:   MACOSX)   OS_OPTIONS="-D_UNIX -D_MACOS" ;;
        !           210:   FREEBSD)  OS_OPTIONS="-D_UNIX -D_FREEBSD" ;;
1.132     gully     211: esac
                    212: 
1.85      vatton    213: dnl
1.175     gully     214: dnl GL canvas is disabled by default in 8.7.x
                    215: dnl GL canvas is enabled by default in 9.x
                    216: dnl - 9.x needs : GL, GLX, GLU, freetype2, wxGLCanvas
1.85      vatton    217: dnl GL is for opengl
1.175     gully     218: dnl GlX is for XWindow integration
1.85      vatton    219: dnl GLU is for tesselation algortihms (until we extract it from this lib)
                    220: dnl (tesselation is used for polygons with holes in it...)
1.175     gully     221: dnl freetype2 is for text drawing (fonts ...)
                    222: dnl wxGLCanvas is for integration of opengl in wxWidgets (WX)
1.231     vatton    223: 
                    224: with_wx="yes"
1.240     kia       225: 
                    226: AC_ARG_ENABLE([system-wx],
                    227:     AC_HELP_STRING([--enable-system-wx],[try the wxWidgets system library]),
                    228:     [case "${enableval}" in
                    229:       yes) with_system_wx="yes";;
                    230:       no)  with_system_wx="no" ;;
                    231:       *) AC_MSG_ERROR(bad value ${enableval} for --enable-system-wx) ;;
                    232:     esac],
                    233:     [with_system_wx="no"])
                    234: 
                    235: 
1.231     vatton    236: 
1.211     vatton    237: AC_ARG_WITH([gl],
1.218     vatton    238:    AC_HELP_STRING([--with-gl],[enable canvas with hardware OpenGL implementation]),
1.210     vatton    239:    [case "${withval}" in
                    240:          yes) with_gl="yes" ;;
                    241:          no)  with_gl="no" ;;
                    242:          *) AC_MSG_ERROR(bad value ${withval} for --with-gl) ;;
                    243:        esac],
                    244:        [with_gl="no"])
1.85      vatton    245: 
1.143     gully     246: # check for mesa library (OpenGL)
1.218     vatton    247: AC_ARG_WITH(MESA,              [  --with-mesa             enable canvas with software OpenGL implementation (default) ])
1.143     gully     248: if test "$with_mesa" = "" ; then
1.208     vatton    249:   with_mesa="no"
1.143     gully     250: fi
                    251: 
1.124     gully     252: 
1.176     gully     253: # mesa (software) gl implementation is default with wx (hardware gl implem can be choosen with --with-gl option)
1.231     vatton    254: if test "$AMAYAOS" = "MACOSX" ; then
                    255:   with_mesa="no"
                    256:   with_gl="yes"
                    257: else
1.176     gully     258:   if test "$with_gl" = "no" ; then
                    259:     with_mesa="yes"
1.175     gully     260:   fi
                    261: fi
                    262: 
1.257     vatton    263: # check if wxWidgets debug is enabled
1.155     carcone   264: AC_ARG_WITH(wxdebug,              [  --with-wxdebug          compiles wxWidgets with debuging options ])
1.136     gully     265: if test "$with_wxdebug" = "yes" ; then
                    266:   with_wxdebug="yes"
                    267: else
                    268:   with_wxdebug="no"
                    269: fi
                    270: 
1.153     gully     271: # it is possible to specify wxWidgets library path,
                    272: # usefull for developpers who want to compile amaya with different wxWidgets version
1.155     carcone   273: AC_ARG_WITH(wxsrcdir, [  --with-wxsrcdir=...     compiles Amaya with a specific wxWidgets sources path ])
1.153     gully     274: if test "$with_wxsrcdir" = "" ; then
                    275:   with_wxsrcdir="../../wxWidgets"
                    276: fi
                    277: 
                    278: 
1.152     gully     279: # setup the AMAYAGUI variable used to identify used GUI when 'make install' is called
1.231     vatton    280: AMAYAGUI="wx"
1.152     gully     281: AC_SUBST(AMAYAGUI)
                    282: 
                    283: 
1.143     gully     284: if test "$with_mesa" = "yes" ; then
                    285:   # --------- compile Mesa library (opengl) --------------- #
1.262     vatton    286:   # check that the right configure is used
1.264   ! vatton    287:   if test "$SYSLIB_PATH"="/usr/lib64" ; then
1.262     vatton    288:     cp ../../Mesa/configs/linux-x86-64-static ../../Mesa/configs/current
                    289:   fi
1.143     gully     290:   # check that sources of Mesa exists
                    291:   if test ! -f ../../Mesa/Makefile ; then
1.231     vatton    292:     GL_BUILDDIR=""
                    293:     GL_INCLUDES="-I/usr/include"
1.262     vatton    294:     GL_LIBRARIES="-Wl,-rpath,$SYSLIB_PATH -L$SYSLIB_PATH -lGL -lGLU"
1.231     vatton    295:     echo "---> Use system Mesa library"
                    296:   else
                    297:     OLDDIR=`pwd`
                    298:     GL_BUILDDIR="${OLDDIR}/Mesa"
                    299:     if test ! -d "$GL_BUILDDIR" ; then
                    300:       echo "---> Install Mesa library into ${GL_BUILDDIR}"
                    301:       mkdir -p ${GL_BUILDDIR}
                    302:       cp -r ../../Mesa/* ${GL_BUILDDIR}
                    303:       echo "---> Install Mesa library into ${GL_BUILDDIR} - DONE"
                    304:     fi
                    305:     # this is the flags used to build amaya with OpenGL
                    306:     GL_INCLUDES="-I${GL_BUILDDIR}/include"
                    307:     GL_LIBRARIES="-Wl,-rpath,${GL_BUILDDIR}/lib -L${GL_BUILDDIR}/lib -lGL -lGLU"
1.214     vatton    308:   fi
1.143     gully     309:   GL_OPTIONS="-D_GL"
1.152     gully     310:   AC_SUBST(GL_BUILDDIR)
1.143     gully     311:   AC_SUBST(GL_INCLUDES)
                    312:   AC_SUBST(GL_LIBRARIES)
                    313: fi
                    314: 
1.240     kia       315: if test "$with_system_wx" = "yes"; then
1.231     vatton    316:   AC_PATH_PROG(WXCONFIG, wx-config)
                    317:   if test -z "$WXCONFIG"; then
1.240     kia       318:     with_system_wx="no"
1.249     vatton    319:     AC_MSG_WARN(wxWidgets system library not found, falling back to the builtin version.)
1.135     gully     320:   fi
1.231     vatton    321: fi
1.205     vatton    322:   
1.240     kia       323: if test "$with_system_wx" != "yes"; then
1.231     vatton    324:   # WX_SRCDIR is better to understand the code than with_wxsrcdir variable
                    325:   if test ! -f $with_wxsrcdir/Makefile.in ; then
                    326:     $with_wxsrcdir = ../../wxWidgets
                    327:   fi
                    328:   cd $with_wxsrcdir
                    329:   WX_SRCDIR=`pwd`
                    330:   cd -
                    331:   AC_SUBST(WX_SRCDIR)
                    332: 
                    333:   # check that sources of wxWidgets exists
                    334:   if test ! -f $WX_SRCDIR/Makefile.in ; then
1.249     vatton    335:     AC_MSG_ERROR(wxWidgets library sources not found, check --with-wxsrcdir is correct !)
1.231     vatton    336:   fi
1.135     gully     337: 
1.152     gully     338:   # --------- configure wxWidgets library --------------- #
1.135     gully     339:   echo "---> Configuring wxWidgets library."
                    340:   OLDDIR=`pwd`
1.149     gully     341:   # create the build directory (debug or release)
                    342:   if test $with_wxdebug = yes ; then
1.152     gully     343:     WX_BUILDDIR="wxWidgets_DEBUG"
1.149     gully     344:   else
1.152     gully     345:     WX_BUILDDIR="wxWidgets_RELEASE"
1.149     gully     346:   fi
1.205     vatton    347: 
1.152     gully     348:   mkdir -p $WX_BUILDDIR
                    349:   cd $WX_BUILDDIR
                    350:   AC_SUBST(WX_BUILDDIR)
1.136     gully     351: 
1.149     gully     352:   # remove old configure cached options
1.135     gully     353:   rm -f configarg.cache
1.136     gully     354: 
                    355:   # setup configure options
1.158     gully     356:   
                    357:   # disable unused wx features
                    358:   #   --disable-htmlhelp
                    359:   #   --disable-html
                    360:   #   --disable-docview
                    361:   #   --disable-mdi
                    362:   #   --disable-mdidoc
                    363:   #   --disable-sound
1.225     vatton    364:   #   --disable-richtext
1.185     gully     365:   #   --disable-backtrace # to avoid the buggy popup when an assert occurs
1.229     kia       366:   WXCONFIGURE_TUNNING_OPTION="--disable-printarch --disable-htmlhelp --disable-html --disable-richtext --disable-docview --disable-mdidoc --disable-sound --disable-backtrace"
1.158     gully     367:   
1.178     gully     368:   if test "$AMAYAOS" = "LINUX" ; then
1.135     gully     369:     # LINUX
1.145     gully     370:     #   --enable-gtk2           use GTK+ 2.0 if available (EXPERIMENTAL)
1.158     gully     371:     #   --disable-shared        create only static library (.a)
1.145     gully     372:     #   --enable-unicode        compile wxString with Unicode support
                    373:     #   --with-gtk              use GTK+
                    374:     #   --with-opengl           use OpenGL (or Mesa)
1.232     vatton    375:     WXCONFIGURE_OPTION="--build=$build_alias --host=$host_alias --target=$target_alias --with-opengl --with-gtk --enable-gtk2 --enable-unicode --enable-ipc --disable-shared  --with-libpng=builtin --with-libjpeg=builtin --with-libtiff=builtin  --with-libxpm=builtin $WXCONFIGURE_TUNNING_OPTION"
1.135     gully     376:   fi
1.178     gully     377:   if test "$AMAYAOS" = "MACOSX" ; then
1.135     gully     378:     # MACOSX
1.233     vatton    379:     WXCONFIGURE_OPTION="--with-opengl --disable-shared --disable-tga --enable-unicode --with-libpng=builtin --with-libjpeg=builtin"
1.136     gully     380:   fi
                    381:   if test $with_wxdebug = yes ; then
1.141     gully     382:     WXCONFIGURE_OPTION="$WXCONFIGURE_OPTION --enable-debug"
1.143     gully     383:     # SG: I've disabled other debug options because the lib has bugs when using these flags \
                    384:     # (maybe because these flags are not often used by wxWidgets developpers)
1.141     gully     385:     # WXCONFIGURE_OPTION="$WXCONFIGURE_OPTION --enable-debug --enable-debug_cntxt --enable-debug_gdb --enable-debug_info --enable-debug_flag --enable-mem_tracing"
1.145     gully     386:   else
                    387:     WXCONFIGURE_OPTION="$WXCONFIGURE_OPTION --enable-optimise"
1.135     gully     388:   fi
1.143     gully     389: 
1.136     gully     390:   # launch the configure
1.143     gully     391:   if test "$with_mesa" = "yes" ; then
                    392:     # use internal OpenGL (mesa) libraries
1.165     gully     393:     $WX_SRCDIR/configure CFLAGS="-I${GL_BUILDDIR}/include" CXXFLAGS="-I${GL_BUILDDIR}/include" CPPFLAGS="-I${GL_BUILDDIR}/include" $WXCONFIGURE_OPTION
1.158     gully     394:     #../$WX_SRCDIR/configure CFLAGS="-I${GL_BUILDDIR}/include" CXXFLAGS="-I${GL_BUILDDIR}/include" CPPFLAGS="-I${GL_BUILDDIR}/include" OPENGL_LIBS="-lGL -lGLU" $WXCONFIGURE_OPTION
1.145     gully     395:     if test $? != 0 ; then
                    396:       AC_MSG_ERROR(A problem occurs durring wxWidgets library configuration. Please fix the problem and try again.)
                    397:     fi
1.143     gully     398:   else
                    399:     # use OpenGL system libraries
1.165     gully     400:     $WX_SRCDIR/configure $WXCONFIGURE_OPTION    
1.143     gully     401:   fi
1.152     gully     402:   cd $OLDDIR
1.135     gully     403:   echo "---> Configuring wxWidgets library. - DONE"
1.143     gully     404: 
1.135     gully     405:   # --------- configuring wxWidgets paths --------------- #
1.152     gully     406:   WXCONFIG=$WX_BUILDDIR/wx-config
1.134     gully     407:   # check that wx-config exists
1.135     gully     408:   if test ! -f $WXCONFIG ; then
1.143     gully     409:     AC_MSG_ERROR(Cannot find wx-config. Please download wxWidgets (http://www.wxwidgets.org/))
1.134     gully     410:   fi
1.144     gully     411: 
                    412:   # setup include paths  
1.165     gully     413:   # "-I$WX_SRCDIR/src/png -I$WX_SRCDIR/src/jpeg -I$WX_SRCDIR/src/tiff" is a temporary patch to fix incorrect generated paths by wx-config --cxxflags (remove it when wxWidgets will be fixed)
1.205     vatton    414:   WX_INCLUDES="-I$WX_SRCDIR/src/png -I$WX_SRCDIR/src/jpeg -I$WX_SRCDIR/src/tiff"
                    415:   BUILDWXWIDGETS="wxwidgets"
                    416:   AC_SUBST(BUILDWXWIDGETS)
                    417: 
1.240     kia       418: fi #!$with_system_wx
1.205     vatton    419: 
1.231     vatton    420: WX_INCLUDES="$WX_INCLUDES `$WXCONFIG --cxxflags`"
                    421: AC_SUBST(WX_INCLUDES)
1.205     vatton    422: 
1.231     vatton    423: # setup libraries paths
                    424: WX_LIBRARIES=""
                    425: WX_LIBRARIES_EXTRA_PARAM=""
                    426: WXCONFIG_LIBS_PARAM="aui,xrc,adv,core,xml,net"
                    427: # GL is used ?
                    428: if test "$with_gl" = "yes" -o "$with_mesa" = "yes" ; then
                    429:   WXCONFIG_LIBS_PARAM="${WXCONFIG_LIBS_PARAM},gl"
                    430:   # SG: this is a mistery why wx-config doesn't add these needed option on macosx
                    431:   if test "$AMAYAOS" = "MACOSX" ; then
                    432:     WX_LIBRARIES_EXTRA_PARAM="-framework OpenGL -framework AGL"
1.124     gully     433:   fi
1.231     vatton    434: fi
                    435: if test "$AMAYAOS" = "MACOSX" ; then
1.170     carcone   436:    WXCONFIG_LIBS_PARAM="${WXCONFIG_LIBS_PARAM},html"
1.231     vatton    437: fi
1.170     carcone   438: 
1.231     vatton    439: WX_LIBRARIES="`$WXCONFIG --libs $WXCONFIG_LIBS_PARAM` ${WX_LIBRARIES_EXTRA_PARAM}"
                    440: AC_SUBST(WX_LIBRARIES)
                    441: WX_LINKDEPS="`$WXCONFIG --linkdeps`"
                    442: AC_SUBST(WX_LINKDEPS)
                    443: WX_OPTIONS="-D_WX"
                    444: # --------- configuring wxWidgets paths - DONE --------------- #
1.124     gully     445: 
1.63      vatton    446: if test "${GCC}" = "yes"; then
1.231     vatton    447:   CPP="${CPP} -x c"
1.63      vatton    448: fi
                    449: 
1.1       cvs       450: dnl  ***************************************************************
                    451: dnl
1.61      cvs       452: dnl    SPECIFIC STUFF : CONFIGURATION OPTIONS FOR AMAYA
1.1       cvs       453: dnl
                    454: dnl  ***************************************************************
                    455: 
1.158     gully     456: # Do not care with libpng or libjpeg with wx version because we use the wxwidgets one.
1.76      vatton    457: 
1.166     gully     458: # the wx version
1.242     vatton    459: AMAYAWX_MAJVER=11
1.254     vatton    460: AMAYAWX_MINVER=3
1.263     vatton    461: AMAYAWX_SUBVER=1
1.231     vatton    462: APP_MAJVER=$AMAYAWX_MAJVER
                    463: APP_MINVER=$AMAYAWX_MINVER
                    464: APP_SUBVER=$AMAYAWX_SUBVER
1.168     gully     465: 
1.247     vatton    466: if test "$APP_SUBVER" = "0" ; then
1.168     gully     467:   APP_VER=$APP_MAJVER.$APP_MINVER
                    468: else
                    469:   APP_VER=$APP_MAJVER.$APP_MINVER.$APP_SUBVER
                    470: fi
1.166     gully     471: 
                    472: # generate a header file with the right version number, so it can be used on windows AND on unix
                    473: APPVERSION_H=../thotlib/internals/h/appversion.h
                    474: echo "#ifndef __APPVERSION_H__" > $APPVERSION_H
                    475: echo "#define __APPVERSION_H__" >> $APPVERSION_H
                    476: echo "#define APP_MAJVER $AMAYAWX_MAJVER" >> $APPVERSION_H
                    477: echo "#define APP_MINVER $AMAYAWX_MINVER" >> $APPVERSION_H
                    478: echo "#define APP_SUBVER $AMAYAWX_SUBVER" >> $APPVERSION_H
                    479: echo "#endif /* __APPVERSION_H__ */" >> $APPVERSION_H
1.1       cvs       480: 
                    481: dnl
1.6       cvs       482: dnl We use a special versoin of cextract patched for alignment
                    483: dnl to build the signatures of the modules functions located in f subdirs
                    484: dnl
                    485: CEXTRACT_VER="1.7"
                    486: CEXTRACT_FLAGS="+O"
                    487: 
1.178     gully     488: # Check if debug is enable
1.218     vatton    489: AC_ARG_WITH(debug,              [  --with-debug            compiles Amaya with debuging options (-g) ])
1.244     vatton    490: if test "$with_debug" = "yes" ; then
                    491:   with_debug="yes"
                    492:   CFLAGS="-g"
                    493:   CXXFLAGS="-g"
                    494: else
                    495:   with_debug="no"
                    496:   CFLAGS="-O2"
                    497:   CXXFLAGS="-O2"
                    498: fi
1.7       cvs       499: 
                    500: if test "${CC}" = "gcc" ; then
1.243     vatton    501:   CFLAGS="${CFLAGS} -Wall"
1.7       cvs       502:   case "${host}" in
                    503:       *-*-irix5* | *-*irix6* )
                    504:          CFLAGS="${CFLAGS} -fsigned-char"
                    505:       ;;
                    506:   esac
1.14      cvs       507: fi
                    508: 
                    509: if test "$ac_cv_c_const" = "no" ; then
                    510:   CFLAGS="${CFLAGS} -DCONST= "
1.7       cvs       511: fi
                    512: 
1.243     vatton    513: # force C mode (-x c)
                    514: #CFLAGS="${CFLAGS} -Wall"
                    515: CFLAGS="${CFLAGS} -x c"
                    516: 
                    517: # C++ options (-x c++)
                    518: #CXXFLAGS="${CXXFLAGS} -Wall"
                    519: CXX_OPTIONS="-D__cplusplus"
                    520: CXXFLAGS="${CXXFLAGS} -Wall -x c++ ${CXX_OPTIONS}"
1.122     gully     521: 
1.132     gully     522: # setup LDFLAGS
                    523: # on macosx, specific flags must be set to avoid conflicts with allready installed libwww
                    524: # for exemple it's possible to install libwww with fink (fink install libwww)
                    525: # to avoid conflicts, we just force the linker to search for specified amaya path first
1.178     gully     526: if test "$AMAYAOS" = "MACOSX" ; then
1.132     gully     527:   LDFLAGS="-Wl,-search_paths_first"
                    528: else
                    529:   LDFLAGS=""
                    530: fi
1.128     gully     531: 
                    532: dnl
1.61      cvs       533: dnl Check for availability of amaya sources
1.1       cvs       534: dnl
                    535: 
                    536: build_amaya="yes"
                    537: 
                    538: if test "$with_amaya" = "no" ; then
                    539:     build_amaya="no"
1.45      cvs       540: else
                    541:   if test ! -f $srcdir/amaya/Makefile.in ; then
1.1       cvs       542:     AC_MSG_WARN(Amaya browser/editor sources not found, disabling Amaya build !)
                    543:     build_amaya="no"
1.45      cvs       544:   fi
1.1       cvs       545: fi
                    546: 
                    547: dnl
1.50      cvs       548: dnl Check for additionnal packages
1.1       cvs       549: dnl use AC_CONFIG_SUBDIRS to launch configure in the subdir
                    550: dnl
1.93      kahan     551: 
1.143     gully     552: if test "$with_gl" = "yes" -o "$with_mesa" = "yes" ; then
                    553: 
                    554:   # if with_gl is on then test system opengl library (GL & GLU)
                    555:   if test "$with_gl" = "yes" ; then
1.184     carcone   556:     if test "$AMAYAOS" = "LINUX" ; then
1.139     carcone   557:        # setup a list of standard paths int LDFLAGS
                    558:        # for AC_CHECK_LIB library existance checks
1.140     carcone   559:        LIBS_OLD=$LIBS
1.139     carcone   560:        LDFLAGS_OLD=$LDFLAGS
1.262     vatton    561:        LDFLAGS="-L/usr/X11R6/lib -L$SYSLIB_PATH -L/usr/local/lib"
1.75      cheyroul  562:        AC_MSG_CHECKING([OpenGL])
                    563:        for ac_dir in                           \
1.183     carcone   564:                /usr/include                    \
1.75      cheyroul  565:                /usr/X11R6/include              \
                    566:                /usr/local/include              \
                    567:                ; \
1.80      cheyroul  568:        do  if test -r "$ac_dir/GL/gl.h" ; then
1.143     gully     569:           gl_inc="yes"
                    570:           GL_INC_I="$ac_dir"
                    571:           if test "$ac_dir" != "/usr/include" ; then
                    572:             GL_INCLUDES="-I$ac_dir"
                    573:          fi
                    574:           AC_CHECK_LIB(GL,glBegin,,AC_MSG_ERROR(Cannot find OpenGL library. Please install OpenGL.))
                    575:           AC_MSG_RESULT([yes])
                    576:                  break 
                    577:         fi
                    578:        done
                    579:        
1.80      cheyroul  580:        AC_MSG_CHECKING([GLU])  
1.75      cheyroul  581:        for ac_dir in                           \
1.183     carcone   582:                /usr/include            \
                    583:                /usr/X11R6/include              \
1.75      cheyroul  584:                /usr/local/include              \
                    585:                ; \
1.138     gully     586:        do  if test -r "$ac_dir/GL/glu.h" ; then
1.143     gully     587:           glu_inc="yes"
                    588:           GL_INC_II="$ac_dir"
                    589:           if test "$ac_dir" != "/usr/include" ; then
                    590:             if test "$ac_dir" != "$GL_INC_I" ; then
                    591:               GL_INCLUDES="$GL_INCLUDES -I$ac_dir"
                    592:             fi
                    593:           fi
                    594:           # now test that glu version is >= 1.2
                    595:           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.)))
                    596:           AC_MSG_RESULT([yes])
                    597:                  break 
                    598:         fi
                    599:         done
1.139     carcone   600:        LDFLAGS=$LDFLAGS_OLD
1.140     carcone   601:        LIBS=$LIBS_OLD
1.174     carcone   602: 
1.143     gully     603:     if test "$gl_inc" = "" ; then              
                    604:       AC_MSG_WARN(Opengl headers (gl.h) not found !!)
                    605:       AC_MSG_WARN(Disabling opengl build !)
                    606:       with_gl="no"
                    607:       GL_OPTIONS=      
                    608:       GL_INCLUDES=     
                    609:       GL_LIBRARIES=
                    610:       exit 1;
                    611:     fi
                    612: 
                    613:     if test "$glu_inc" = "" ; then
                    614:       AC_MSG_WARN(Glu headers (glu.h) not found !!)
                    615:       AC_MSG_WARN(Disabling opengl build !)
                    616:   
                    617:       with_gl="no"
                    618:       GL_OPTIONS=      
                    619:       GL_INCLUDES=     
                    620:       GL_LIBRARIES=
                    621:       exit 1;
                    622:     fi
1.184     carcone   623:     fi # AMAYAOS = LINUX
1.174     carcone   624: 
1.187     gully     625:     if test "$AMAYAOS" = "MACOSX" ; then
1.174     carcone   626:       GL_OPTIONS="-D_GL"       
1.183     carcone   627:       GL_INCLUDES="-I/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers/"    
1.174     carcone   628:       GL_LIBRARIES=""
1.183     carcone   629:       GL_BUILDDIR=""
1.174     carcone   630:     else
1.262     vatton    631:       GL_LIBRARIES="-L$SYSLIB_PATH -L/usr/X11R6/lib -lGL -lGLU"
1.174     carcone   632:       GL_OPTIONS="-D_GL"
1.173     carcone   633:     fi
1.143     gully     634: 
                    635:     AC_SUBST(GL_INCLUDES)
                    636:     AC_SUBST(GL_LIBRARIES)
                    637:   fi # if with_gl
1.139     carcone   638:        
1.187     gully     639:   # ---------- Checking for freetype lib (fonts library)
                    640:   if test "$AMAYAOS" = "MACOSX" ; then
1.173     carcone   641:      # we use a static version of freetype lib for mac osx
1.187     gully     642:      # ** search for includes (freetype.h)
                    643:      for ac_dir in               \
1.257     vatton    644:          /Developer/SDKs/MacOSX10.6.sdk/usr/X11R6/include/  \
                    645:          /Developer/SDKs/MacOSX10.6.sdk/usr/X11R6/include/freetype2/  \
                    646:          /Developer/SDKs/MacOSX10.5.sdk/usr/X11R6/include/  \
                    647:          /Developer/SDKs/MacOSX10.5.sdk/usr/X11R6/include/freetype2/  \
1.187     gully     648:          /Developer/SDKs/MacOSX10.2.8.sdk/usr/X11R6/include/  \
                    649:          /Developer/SDKs/MacOSX10.2.8.sdk/usr/X11R6/include/freetype2/  \
                    650:          /Developer/SDKs/MacOSX10.3.0.sdk/usr/X11R6/include/  \
                    651:          /Developer/SDKs/MacOSX10.3.0.sdk/usr/X11R6/include/freetype2/  \
1.207     vatton    652:          /Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/include/  \
                    653:          /Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/include/freetype2/  \
1.187     gully     654:          /Developer/SDKs/MacOSX10.3.9.sdk/usr/X11R6/include/  \
                    655:          /Developer/SDKs/MacOSX10.3.9.sdk/usr/X11R6/include/freetype2/  \
                    656:          /Developer/SDKs/MacOSX10.4.0.sdk/usr/X11R6/include/  \
1.207     vatton    657:          /Developer/SDKs/MacOSX10.4.0.sdk/usr/X11R6/include/freetype2/  \
1.190     carcone   658:          /opt/local/include/  \
                    659:          /opt/local/include/freetype2/  \
                    660:          /usr/X11R6/include/freetype2/freetype/  \
                    661:         ; \
1.187     gully     662:          do
                    663:          if test -r "$ac_dir/ft2build.h"; then
                    664:             FREETYPE_INCLUDES="${FREETYPE_INCLUDES} -I$ac_dir"
1.191     carcone   665:          fi
                    666:          if test -r "$ac_dir/freetype/config/ftheader.h"; then
                    667:             FREETYPE_INCLUDES="${FREETYPE_INCLUDES} -I$ac_dir"
1.187     gully     668:          fi
                    669:      done
                    670:      # ** search for binary (libfreetype.a)
                    671:      for ac_dir in               \
                    672:          /Developer/SDKs/MacOSX10.2.8.sdk/usr/X11R6/lib/  \
                    673:          /Developer/SDKs/MacOSX10.3.0.sdk/usr/X11R6/lib/  \
1.207     vatton    674:          /Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/lib/  \
1.187     gully     675:          /Developer/SDKs/MacOSX10.3.9.sdk/usr/X11R6/lib/  \
                    676:          /Developer/SDKs/MacOSX10.4.0.sdk/usr/X11R6/lib/  \
1.190     carcone   677:          /opt/local/lib/  \
                    678:          /usr/X11R6/lib/  \
1.187     gully     679:          ; \
                    680:          do
                    681:          if test -r "$ac_dir/libfreetype.a"; then
1.192     carcone   682:             FREETYPE_LIBRARIES="$ac_dir/libfreetype.a"
1.187     gully     683:             break
                    684:          fi
                    685:      done
                    686:   else # "$AMAYAOS" = "MACOSX"
1.173     carcone   687:      if test ! -f $(which freetype-config) ; then
                    688:        AC_MSG_ERROR(Cannot find freetype library (font load/display routines). Please install it.)
                    689:      fi
                    690:      FREETYPE_INCLUDES=`freetype-config --cflags`
                    691:      FREETYPE_LIBRARIES=`freetype-config --libs`
1.187     gully     692:   fi # "$AMAYAOS" = "MACOSX"
                    693:   AC_SUBST(FREETYPE_INCLUDES)
                    694:   AC_SUBST(FREETYPE_LIBRARIES)
                    695: 
                    696: 
1.143     gully     697:   AC_MSG_CHECKING([gcc3])      
                    698:   for ac_dir in                        \
1.262     vatton    699:                $SYSLIB_PATH                    \
1.96      cheyroul  700:                /usr/X11R6/lib          \
                    701:                /usr/local/lib          \
                    702:                ; \
1.143     gully     703:   do  if test -r "$ac_dir/libstdc++.so.5" ; then
                    704:     stdglu_inc="yes"
                    705:     STDCPP_LIBRARIES="-lstdc++"
                    706:     STDCPP_INCLUDES=""
                    707:     AC_MSG_RESULT([yes])       
                    708:     break
                    709:   fi
                    710:   done
1.159     gully     711: 
1.143     gully     712: fi # if with_gl or with_mesa
1.132     gully     713: 
1.208     vatton    714: AC_ARG_ENABLE([svg],
                    715:        AC_HELP_STRING([--disable-svg],[disable SVG support]),
                    716:        [case "${enableval}" in
                    717:          yes) with_svg="yes" ;;
                    718:          no)  with_svg="no" ;;
                    719:          *) AC_MSG_ERROR(bad value ${enableval} for --disable-svg) ;;
                    720:        esac],
                    721:        [with_svg="yes"])
                    722: 
1.241     vatton    723: #################### LibWWW and WebDAV Support ################################
                    724: 
                    725: AC_ARG_ENABLE([system-libwww],
                    726:        AC_HELP_STRING([--enable-system-libwww],[try the libWWW system library]),
                    727:        [case "${enableval}" in
                    728:          yes) with_system_libwww="yes" ;;
                    729:          no)  with_system_libwww="no" ;;
                    730:          *) AC_MSG_ERROR([bad value ${enableval} for --enable-system-libwww]) ;;
                    731:        esac],
                    732:        [with_system_libwww="no"])
                    733: 
                    734: if test "$with_system_libwww" = "yes" ; then
                    735:     # check to see if we have a libWWW library
                    736:     AC_PATH_PROG([LIBWWW_CONFIG],[libwww-config])
                    737: 
                    738:     if test "$LIBWWW_CONFIG" = "" ; then
1.250     vatton    739:                AC_MSG_WARN(libwww system library not found, falling back to the builtin version.)
1.241     vatton    740:                with_system_libwww="no"
                    741:     fi
                    742: fi
                    743: 
                    744: dnl
                    745: dnl WebDAV support enabled by default
                    746: dnl
                    747: AC_ARG_WITH(dav,
                    748:   AC_HELP_STRING([--with-dav],[enable WebDAV support (default)]),
                    749:   [case "${withval}" in
                    750:          yes) with_dav="yes" ;;
                    751:          no)  with_dav="no" ;;
                    752:          *) AC_MSG_ERROR(bad value ${withval} for --with-dav) ;;
                    753:        esac],
                    754:        [with_dav="yes"])
                    755: 
                    756: # If DAV is enabled, check if the source code is present
                    757: if test ! -f $srcdir/davlib/Makefile.in ; then
                    758:        if test "$with_dav" = "yes" ; then
                    759:            AC_MSG_WARN(WebDAV makefile not found, disabling WebDAV build)
                    760:            with_dav="no"
                    761:        fi
                    762: fi
                    763: 
                    764: if test "$with_dav" = "yes" ; then
                    765:    WITHDAV="--with-dav"
                    766: else
                    767:    WITHDAV="--without-dav"
                    768: fi
                    769: 
1.250     vatton    770: if test "$with_system_libwww" != "yes" ; then
1.241     vatton    771:   # configure libwww
                    772:   CURRENT_PATH="`pwd`"
                    773:   mkdir libwww
                    774:   cd libwww && \
                    775:     $CURRENT_PATH/../../libwww/configure \
                    776:     --build=$build_alias --host=$host_alias --target=$target_alias \
                    777:     --disable-shared \
                    778:     $WITHDAV \
1.253     vatton    779:     --with-zlib --with-ssl && \
1.241     vatton    780:     echo "libwww is configured" ; \
                    781:     echo "patching wwwconf.h because appkit.h do not compile on macos, and it seems that appkit.h is not used in amaya" ; \
                    782:     cp wwwconf.h wwwconf.h.orig ; \
                    783:     sed -e "s/\(\#define HAVE_APPKIT_APPKIT_H 1\)/\/* \1 *\//" \
                    784:                        wwwconf.h.orig > wwwconf.h ; \
                    785:     echo "wwwconf.h patched !" ; \
                    786:   cd ..
                    787:   chmod +x libwww/libwww-config
                    788:   BUILDLIBWWW="libwww"
                    789:   LIBWWW_CONFIG="libwww/libwww-config"
1.251     vatton    790:   LIBWWW_LDFLAGS="-L$CURRENT_PATH/libwww/Library/src/.libs -lwwwxml -lwwwzip -lwwwinit -lwwwapp -lwwwhtml -lwwwtelnet -lwwwnews -lwwwhttp -lwwwmime -lwwwgopher -lwwwftp -lwwwfile -lwwwdir -lwwwcache -lwwwstream -lwwwmux -lwwwtrans -lwwwcore -lwwwutils -lwwwdav \
1.253     vatton    791:   -L$CURRENT_PATH/libwww/Library/src/SSL/.libs -lwwwssl\
1.251     vatton    792:   -L$CURRENT_PATH/libwww/modules/md5/.libs -lmd5 \
1.253     vatton    793:   -L$CURRENT_PATH/libwww/modules/expat/.libs -lexpat \
1.263     vatton    794:   -Wl,-rpath,$SYSLIB_PATH -L$SYSLIB_PATH -lssl -lcrypto"
1.260     vatton    795:   LIBWWW_CFLAGS="-I$CURRENT_PATH/../../libwww/Library/src -I$CURRENT_PATH/libwww -I$CURRENT_PATH/../../libwww/modules/expat/lib -I$CURRENT_PATH/../../libwww/Library/src/SSL"
1.241     vatton    796: else
                    797:   LIBWWW_CFLAGS="`$LIBWWW_CONFIG --cflags`"
                    798:   LIBWWW_LDFLAGS="`$LIBWWW_CONFIG --libs`"
                    799: 
                    800:   if test "$with_dav" = "yes" ; then
                    801:     AC_CHECK_LIB([wwwdav],
                    802:                                 [toto],
                    803:                                 [LIBWWW_LDFLAGS="$LIBWWW_LDFLAGS -lwwwdav"],
                    804:                                 [AC_MSG_WARN([libwwwdav is not available, disabling WebDAV]); with_dav="no"])
                    805:   fi
                    806: fi
                    807: 
                    808: if test "$with_dav" = "yes" ; then
                    809:    DAV_OPTIONS=-DDAV
                    810:    DAVDIR="davlib"
                    811: else
                    812:    with_dav="no"
                    813:    DAV_OPTIONS=""
                    814:    DAVDIR=""
                    815: fi
                    816: 
                    817: AC_SUBST(BUILDLIBWWW)
                    818: 
                    819: AC_SUBST(LIBWWW_CFLAGS)
                    820: AC_SUBST(LIBWWW_LDFLAGS)
                    821: 
                    822: AC_SUBST(DAVDIR)
                    823: AC_SUBST(LIBDAV)
                    824: AC_SUBST(WWWDAV)
                    825: 
                    826: ############# end of LibWWW and WebDAV Support ################################
                    827: 
1.218     vatton    828: ##########################Annotations Support####################
1.208     vatton    829: dnl
                    830: dnl annotations are enabled by default
                    831: dnl
                    832: AC_ARG_ENABLE([annot],
                    833:        AC_HELP_STRING([--disable-annot],[disable Annotations support]),
                    834:        [case "${enableval}" in
                    835:          yes) with_annot="yes" ;;
                    836:          no)  with_annot="no" ;;
                    837:          *) AC_MSG_ERROR(bad value ${enableval} for --disable-annot) ;;
                    838:        esac],
                    839:        [with_annot="yes"])
1.93      kahan     840: 
1.108     kahan     841: 
1.237     vatton    842: #annot need Raptor
1.218     vatton    843: if test "$with_annot" = "yes" ; then
1.237     vatton    844:        with_raptor="yes"
1.210     vatton    845: else
1.237     vatton    846:        with_raptor="no"
1.210     vatton    847: fi
                    848: 
1.237     vatton    849: AC_ARG_ENABLE([system-raptor],
                    850:        AC_HELP_STRING([--enable-system-raptor],[try the raptor RDF system library]),
1.210     vatton    851:        [case "${enableval}" in
1.237     vatton    852:          yes) with_system_raptor="yes";;
                    853:          no)  with_system_raptor="no" ;;
                    854:          *) AC_MSG_ERROR(bad value ${enableval} for --enable-system-raptor) ;;
1.210     vatton    855:        esac],
1.237     vatton    856:        [with_system_raptor="no"])
1.210     vatton    857: 
1.237     vatton    858: #If Raptor is needed and we are asked
1.210     vatton    859: #to use the system library, check if is present
1.237     vatton    860: if test "$with_raptor" = "yes" -a "$with_system_raptor" = "yes" ; then
                    861:     # check to see if we have a raptor library
                    862:     AC_PATH_PROG([RAPTOR_CONFIG],[raptor-config])
                    863: 
                    864:     if test "$RAPTOR_CONFIG" = "" ; then
1.239     vatton    865:       AC_MSG_WARN(Not using system-provided Raptor library)
                    866:       with_system_raptor="no"
1.210     vatton    867:     fi
                    868: fi
                    869: 
                    870: #if we use the builtin library,
                    871: #check it is present
1.237     vatton    872: if test "$with_raptor" = "yes" -a "$with_system_raptor" != "yes" \
                    873:        -a ! -d "$srcdir/../redland/raptor" ; then
                    874:        AC_MSG_WARN(Raptor source dir not found !!)
                    875:        AC_MSG_WARN(Disabling raptor build !)
                    876:        with_raptor="no"
1.210     vatton    877: fi
                    878: 
1.237     vatton    879: #At this point, we know everything about Raptor,
1.210     vatton    880: #so either set the variables we will need later,
1.218     vatton    881: #or disable Annotations
1.237     vatton    882: if test "$with_raptor" = "yes" ; then
                    883:        if test "$with_system_raptor" != "yes" ; then
                    884:                AMAYA_ANNOT_OPTIONS="$AMAYA_ANNOT_OPTIONS -I\$(THOTDIR)/../redland/raptor "
1.238     vatton    885:                AMAYA_RAPTOR_LIBS="../raptor/.libs/libraptor.a"
1.237     vatton    886:                AMAYA_RAPTOR_INCLUDES="-I\$(THOTDIR)/../redland/raptor"
                    887:                BUILDRAPTOR="raptor"
                    888:                CURRENTPATH="`pwd`"
                    889:                mkdir $BUILDRAPTOR
                    890:                cd $BUILDRAPTOR &&
                    891:                        CC="$CC" CXX="$CXX" \
                    892:                        CPPFLAGS="-I$CURRENTPATH/../../libwww/modules/expat/lib" \
                    893:                        LDFLAGS="-L$CURRENTPATH/libwww/modules/expat -L$CURRENTPATH/libwww/modules/expat/.libs" \
                    894:                        ../../../redland/raptor/configure \
                    895:                        --build=$build_alias --host=$host_alias --target=$target_alias \
                    896:                        --disable-shared \
                    897:                        --with-xml-parser=expat \
                    898:                        --with-www=none
                    899:                        $ECHO "Raptor is configured"
                    900:                        $ECHO "Patching the raptor_config.h file to avoid including glib2-0"
                    901:                        $CP raptor_config.h raptor_config.h.orig
                    902:                        $SED "s/\(\#define HAVE_G_UTF8_NORMALIZE 1\)/\/* \1 *\//" \
                    903:                                raptor_config.h.orig > raptor_config.h
                    904:                        $RM raptor_config.h.orig
                    905:                        $ECHO "Raptor is patched"
                    906:                cd ..
1.210     vatton    907:        else
1.237     vatton    908:                raptor_includes=`$RAPTOR_CONFIG --cflags`
1.239     vatton    909:                raptor_libs="-lraptor"
                    910:                BUILDRAPTOR=""
1.210     vatton    911:                AMAYA_ANNOT_OPTIONS="$AMAYA_ANNOT_OPTIONS"
1.237     vatton    912:                AMAYA_ANNOT_INCLUDES="$raptor_includes -I\$(THOTDIR)/thotlib/include"
                    913:                AMAYA_ANNOT_EXTRA_LIBS="$raptor_libs"
                    914:                AMAYA_RAPTOR_INCLUDES="$raptor_includes"
1.210     vatton    915:        fi
                    916: else
                    917:        with_annot="no"
                    918: fi
                    919: 
1.218     vatton    920: ANNOTLIB_COMPILE_BM=['#']
1.210     vatton    921: 
1.237     vatton    922: AC_SUBST(BUILDRAPTOR)
                    923: 
                    924: AC_SUBST(AMAYA_ANNOT_OPTIONS)
                    925: AC_SUBST(AMAYA_ANNOT_INCLUDES)
                    926: AC_SUBST(AMAYA_ANNOT_EXTRA_LIBS)
                    927: 
                    928: AC_SUBST(ANNOTLIB_COMPILE_BM)
                    929: AC_SUBST(AMAYA_RAPTOR_LIBS)
                    930: AC_SUBST(AMAYA_RAPTOR_INCLUDES)
                    931: 
1.218     vatton    932: ###################End of Annotations Support####################
1.210     vatton    933: 
                    934: 
1.108     kahan     935: dnl
1.194     vatton    936: dnl The templates support is enabled by default
1.186     tollenae  937: dnl
1.208     vatton    938: AC_ARG_ENABLE([templates],
                    939:        AC_HELP_STRING([--disable-templates],[disable experimental templates support]),
                    940:        [case "${enableval}" in
                    941:          yes) with_templates="yes" ;;
                    942:          no)  with_templates="no" ;;
                    943:          *) AC_MSG_ERROR(bad value ${enableval} for --disable-templates) ;;
                    944:        esac],
                    945:        [with_templates="yes"])
                    946: 
                    947: if test "$with_templates" = yes -a "$with_wx" != "yes"; then
                    948:     AC_MSG_WARN(Templates are only available in WX version !!)
                    949:     AC_MSG_WARN(Disabling templates)
                    950:     with_templates="no"
                    951: fi
1.197     vatton    952: 
1.208     vatton    953: if test "$with_templates" = "yes" ; then
1.194     vatton    954:     TEMPLATES_OPTIONS="-DTEMPLATES"
1.186     tollenae  955: else
1.194     vatton    956:     TEMPLATES_OPTIONS=""
1.186     tollenae  957: fi
                    958: 
1.194     vatton    959: 
1.186     tollenae  960: dnl
1.70      kahan     961: dnl Generic XML support enabled by default
                    962: dnl
1.208     vatton    963: AC_ARG_ENABLE([generic-xml],
                    964:        AC_HELP_STRING([--disable-generic-xml],[disable Generic XML support]),
                    965:        [case "${enableval}" in
                    966:          yes) with_generic_xml="yes" ;;
                    967:          no)  with_generic_xml="no" ;;
                    968:          *) AC_MSG_ERROR(bad value ${enableval} for --disable-generic-xml) ;;
                    969:        esac],
                    970:        [with_generic_xml="yes"])
                    971: 
1.209     vatton    972: if test "$with_generic_xml" = "yes" ; then
                    973:  GENERIC_XML_OPTIONS="-DXML_GENERIC"
                    974: else
                    975:  GENERIC_XML_OPTIONS=""
                    976: fi
                    977: 
1.70      kahan     978: 
1.19      cvs       979: if test "$build_amaya" = "yes" ; then
1.8       cvs       980:     if test ! -f $srcdir/amaya/MathML.S ; then
1.10      cvs       981:        if test "$with_math" = "yes" ; then
1.8       cvs       982:            AC_MSG_WARN(MathML sources not found !!)
1.26      cvs       983:            AC_MSG_WARN(Disabling Math build !)
1.10      cvs       984:            with_math="no"
                    985:            MATH_OPTIONS=
1.8       cvs       986:        fi
                    987:     fi
1.26      cvs       988: 
1.68      vatton    989:     if test ! -f $srcdir/amaya/SVG.S ; then
                    990:        if test "$with_svg" = "yes" ; then
                    991:            AC_MSG_WARN(SVG sources not found !!)
                    992:            AC_MSG_WARN(Disabling SVG build !)
                    993:            with_svg="no"
                    994:            SVG_OPTIONS=
1.26      cvs       995:        fi
                    996:     fi
                    997: 
1.1       cvs       998: fi
                    999: 
                   1000: dnl
                   1001: dnl The options for each library or binary
                   1002: dnl
1.231     vatton   1003: THOT_OPTIONS="$OS_OPTIONS $GL_OPTIONS $WX_OPTIONS"
1.1       cvs      1004: 
1.231     vatton   1005: AMAYA_OPTIONS="$OS_OPTIONS $MATH_OPTIONS $SVG_OPTIONS $GENERIC_XML_OPTIONS $GL_OPTIONS $WX_OPTIONS $TEMPLATES_OPTIONS"
1.211     vatton   1006: 
1.179     gully    1007: if test "$with_debug" = "yes" ; then
1.211     vatton   1008:   AMAYA_OPTIONS="$AMAYA_OPTIONS -DAMAYA_DEBUG"
1.179     gully    1009: fi
1.101     kahan    1010: 
1.158     gully    1011: if test "$with_wx" = "yes" ; then
                   1012:   IMGLIBS=""
                   1013: else
                   1014:   IMGLIBS="-ljpeg -lpng -lz"
                   1015: fi
1.132     gully    1016: 
1.131     gully    1017: EXTRA_INCLUDES=
                   1018: 
                   1019: # check for malloc.h
                   1020: # on macosx, this file is not at the right place
1.187     gully    1021: if test "$AMAYAOS" = "MACOSX" ; then
1.173     carcone  1022: for ac_dir in               \
1.258     vatton   1023:   /Developer/SDKs/MacOSX10.6.sdk/usr/include/objc/   \
                   1024:   /Developer/SDKs/MacOSX10.6.sdk/usr/include/sys/    \
                   1025:   /Developer/SDKs/MacOSX10.5.sdk/usr/include/objc/   \
                   1026:   /Developer/SDKs/MacOSX10.5.sdk/usr/include/sys/    \
1.173     carcone  1027:   /Developer/SDKs/MacOSX10.2.8.sdk/usr/include/objc/   \
                   1028:   /Developer/SDKs/MacOSX10.2.8.sdk/usr/include/sys/    \
                   1029:   /Developer/SDKs/MacOSX10.3.0.sdk/usr/include/objc/   \
                   1030:   /Developer/SDKs/MacOSX10.3.0.sdk/usr/include/sys/    \
1.233     vatton   1031:   /Developer/SDKs/MacOSX10.4u.sdk/usr/include/objc/   \
                   1032:   /Developer/SDKs/MacOSX10.4u.sdk/usr/include/sys/    \
                   1033:   /Developer/SDKs/MacOSX10.3.9.sdk/usr/include/objc/   \
                   1034:   /Developer/SDKs/MacOSX10.3.9.sdk/usr/include/sys/    \
1.173     carcone  1035:   ; \
                   1036: do
                   1037:   if test -r "$ac_dir/malloc.h"; then
                   1038:     echo "found malloc.h"
                   1039:     EXTRA_INCLUDES="${EXTRA_INCLUDES} -I$ac_dir"
                   1040:     break
                   1041:   fi
                   1042: done
1.187     gully    1043: else # "$AMAYAOS" = "MACOSX"
1.131     gully    1044: for ac_dir in               \
                   1045:   /usr/include/malloc/      \
                   1046:   /sw/include/malloc/       \
                   1047:   ; \
                   1048: do
                   1049:   if test -r "$ac_dir/malloc.h"; then
                   1050:     echo "found malloc.h"
                   1051:     EXTRA_INCLUDES="${EXTRA_INCLUDES} -I$ac_dir"
                   1052:     break
                   1053:   fi
                   1054: done
1.187     gully    1055: fi # "$AMAYAOS" = "MACOSX"
1.1       cvs      1056: 
                   1057: dnl
                   1058: dnl Set up the PATHs needed
                   1059: dnl
                   1060: 
                   1061: API="\$(THOTDIR)/thotlib/include"
                   1062: VAR="\$(THOTDIR)/thotlib/internals/var"
                   1063: INCL="\$(THOTDIR)/thotlib/internals/h"
                   1064: FUNC="\$(THOTDIR)/thotlib/internals/f"
                   1065: 
                   1066: dnl
                   1067: dnl Set up the include variables.
                   1068: dnl
                   1069: 
1.61      cvs      1070: THOTINCLUDES="-I${API} -I${VAR} -I${INCL} -I${FUNC} ${JPEGINCL} ${PNGINCL}"
1.58      cvs      1071: APIINCLUDES=-I${API}
                   1072:  
                   1073: if test "${VPATHOPT}" = "" ; then
1.1       cvs      1074:        VPATHOPT="VPATH"
                   1075: fi
                   1076: 
1.217     vatton   1077: AMAYA_INSTALLDIR="Amaya"
1.206     vatton   1078: 
1.1       cvs      1079: dnl
                   1080: dnl Exports the current values of the variables.
                   1081: dnl
                   1082: 
1.206     vatton   1083: AC_SUBST(AMAYA_INSTALLDIR)
                   1084: 
1.166     gully    1085: AC_SUBST(APP_MAJVER)
                   1086: AC_SUBST(APP_MINVER)
                   1087: AC_SUBST(APP_SUBVER)
                   1088: AC_SUBST(APP_VER)
1.6       cvs      1089: AC_SUBST(CEXTRACT_VER)
                   1090: AC_SUBST(CEXTRACT_FLAGS)
1.1       cvs      1091: 
                   1092: AC_SUBST(THOTINCLUDES)
                   1093: AC_SUBST(APIINCLUDES)
                   1094: AC_SUBST(VPATHOPT)
                   1095: 
                   1096: AC_SUBST(THOT_OPTIONS)
                   1097: AC_SUBST(AMAYA_OPTIONS)
                   1098: AC_SUBST(IMGLIBS)
1.131     gully    1099: AC_SUBST(EXTRA_INCLUDES)
1.90      kirschpi 1100: 
1.224     vatton   1101: AC_SUBST(MAKE_LIBWWW_RDF_PARSER)
                   1102: AC_SUBST(LIBWWW_RDF_PARSER)
                   1103: #AC_SUBST(ANNOTLIB_COMPILE_BM)
1.93      kahan    1104: AC_SUBST(AMAYA_RAPTOR_LIBS)
                   1105: AC_SUBST(AMAYA_RAPTOR_INCLUDES)
                   1106: 
                   1107: AC_SUBST(SUBDIRS)
                   1108: 
1.1       cvs      1109: dnl
1.48      cvs      1110: dnl Include the option Makefile.xxx fragment according to the configure options
1.1       cvs      1111: dnl
                   1112: 
1.211     vatton   1113: www_frag=$srcdir/amaya/Makefile.libwww
                   1114: AC_SUBST_FILE(www_frag)
1.1       cvs      1115: 
1.50      cvs      1116: if test "$with_math" = "no" ; then
                   1117:     math_frag=/dev/null
1.8       cvs      1118: else
1.50      cvs      1119:     math_frag=$srcdir/amaya/Makefile.math
1.8       cvs      1120: fi
1.211     vatton   1121: AC_SUBST_FILE(math_frag)
1.8       cvs      1122: 
1.68      vatton   1123: if test "$with_svg" = "no" ; then
                   1124:     svg_frag=/dev/null
1.26      cvs      1125: else
1.68      vatton   1126:     svg_frag=$srcdir/amaya/Makefile.svg
1.26      cvs      1127: fi
1.211     vatton   1128: AC_SUBST_FILE(svg_frag)
1.26      cvs      1129: 
1.47      cvs      1130: if test "$with_annot" = "yes" ; then
1.48      cvs      1131:     annot_frag=$srcdir/annotlib/Makefile.annot
1.47      cvs      1132: else
                   1133:     annot_frag=/dev/null
                   1134: fi
1.211     vatton   1135: AC_SUBST_FILE(annot_frag)
1.47      cvs      1136: 
1.88      kirschpi 1137: if test "$with_dav" = "yes" ; then
                   1138:     dav_frag=$srcdir/davlib/Makefile.dav
1.188     vatton   1139: else
                   1140:     dav_frag=/dev/null
1.88      kirschpi 1141: fi
1.211     vatton   1142: AC_SUBST_FILE(dav_frag)
1.16      cvs      1143: 
1.186     tollenae 1144: if test "$with_templates" = "yes" ; then
                   1145:     templates_frag=$srcdir/amaya/Makefile.templates
1.188     vatton   1146: else
                   1147:     templates_frag=/dev/null
1.186     tollenae 1148: fi
1.211     vatton   1149: AC_SUBST_FILE(templates_frag)
1.186     tollenae 1150: 
1.1       cvs      1151: dnl  ***************************************************************
                   1152: dnl
                   1153: dnl      FINAL STEP : PRODUCE ALL THE MAKEFILES AND CONFIG FILES
                   1154: dnl
                   1155: dnl  ***************************************************************
                   1156: 
                   1157: EXTRA_MAKEFILE_IN=
1.2       cvs      1158: make_output="Makefile Options.orig:Options.in tools/Makefile \
                   1159:        tools/mkdep/Makefile \
1.1       cvs      1160:        tools/cextract-1.7/Makefile thotlib/Makefile \
1.193     gully    1161:        thotlib/include/Makefile batch/Makefile \
                   1162:        script_install:../batch/script_install.in \
                   1163:        script_install_gnomekde:../batch/script_install_gnomekde.in \
                   1164:        script_install_macosxbundle:../batch/script_install_macosxbundle.in \
                   1165:        script_uninstall:../batch/script_uninstall.in"
1.1       cvs      1166: 
                   1167: if test "$build_amaya" = "yes" ; then
1.208     vatton   1168:     make_output="$make_output amaya/Makefile"
1.2       cvs      1169:     EXTRA_MAKEFILE_IN="$srcdir/amaya/Makefile.in \
1.93      kahan    1170:     $srcdir/amaya/Makefile.libwww"
1.27      cvs      1171: 
1.48      cvs      1172:     if test "$with_annot" = "yes" ; then
                   1173:        make_output="$make_output annotlib/Makefile"
                   1174:        EXTRA_MAKEFILE_IN="$srcdir/annotlib/Makefile.in"
                   1175:     fi
1.88      kirschpi 1176: 
                   1177:     if test "$with_dav" = "yes" ; then
                   1178:        make_output="$make_output davlib/Makefile"
                   1179:        EXTRA_MAKEFILE_IN="$srcdir/davlib/Makefile.in"
                   1180:     fi
                   1181: 
1.1       cvs      1182: fi
                   1183: 
1.221     vatton   1184: dnl
                   1185: dnl Generate the script
                   1186: dnl
                   1187: if test "$AMAYAOS" != "MACOSX" ; then
                   1188:     if test ! -d bin ; then
                   1189:       mkdir -p bin
                   1190:     fi
                   1191:     make_output="$make_output bin/amaya:../batch/amaya.in"
                   1192: fi
                   1193: 
1.1       cvs      1194: AC_SUBST(EXTRA_MAKEFILE_IN)
1.6       cvs      1195: AC_OUTPUT($make_output , [
                   1196: dnl
                   1197: dnl This fragment of shell code is executed after the
                   1198: dnl Makefile(s) dump ...
                   1199: dnl
                   1200: 
                   1201: echo timestamp > stamp-h
                   1202: 
                   1203: dnl
                   1204: dnl Check for an upgrade in the Options numbers
                   1205: dnl
                   1206: if test -f Options ; then
                   1207:    oldversion=`grep Version Options`
                   1208:    newversion=`grep Version Options.orig`
                   1209:    if test "$oldversion" != "$newversion" ; then
                   1210:        echo WARNING : Options files have changed, old options saved to Options.old
                   1211:        cp Options Options.old
                   1212:        cp Options.orig Options
                   1213:        exit 1
                   1214:    fi
                   1215: fi
1.193     gully    1216: if test -f script_install ; then
                   1217:    chmod a+x script_install
                   1218: fi
                   1219: if test -f script_install_gnomekde ; then
                   1220:    chmod a+x script_install_gnomekde
                   1221: fi
                   1222: if test -f script_install_macosxbundle ; then
                   1223:    chmod a+x script_install_macosxbundle
                   1224: fi
                   1225: if test -f script_uninstall ; then
                   1226:    chmod a+x script_uninstall
                   1227: fi
1.227     vatton   1228: if test -f bin/amaya ; then
                   1229:    chmod 755 bin/amaya
                   1230:     echo WARNING : `ls -l bin/amaya`
                   1231: fi
1.6       cvs      1232: ])
1.1       cvs      1233: 
1.222     cvs      1234: dnl
1.1       cvs      1235: if test "$build_amaya" = "yes" ; then
1.164     gully    1236:     echo Amaya $AMAYA_VER configured
1.262     vatton   1237:     echo Amaya configured with libWWW \(local source\) and $SYSLIB_PATH
1.10      cvs      1238:     if test "$with_math" = "yes" ; then
                   1239:        echo Amaya configured with Math support
1.26      cvs      1240:     fi
1.68      vatton   1241:     if test "$with_svg" = "yes" ; then
                   1242:        echo Amaya configured with SVG support
1.47      cvs      1243:     fi
                   1244:     if test "$with_annot" = "yes" ; then
                   1245:        echo Amaya configured with Annotations support
1.239     vatton   1246:       if test "$with_system_raptor" = "yes" ; then
                   1247:        echo Amaya configured with the RaptorF library \(system\)
                   1248:       else
1.253     vatton   1249:        echo Amaya configured with the Raptor library \(local source\)
1.239     vatton   1250:       fi
1.108     kahan    1251:     fi
1.186     tollenae 1252:     if test "$with_templates" = "yes" ; then
1.230     vatton   1253:        echo Amaya configured with templates support
1.186     tollenae 1254:     fi
1.70      kahan    1255:     if test "$with_generic_xml" = "yes" ; then
1.195     vatton   1256:        echo Amaya configured with generic XML support
1.70      kahan    1257:     fi
1.195     vatton   1258:     echo Amaya configured with internationalization support
1.75      cheyroul 1259:     if test "$with_gl" = "yes" ; then
1.143     gully    1260:        echo Amaya configured with OpenGL Canvas Rendering \(System library\) \(experimental\)
                   1261:     fi
                   1262:     if test "$with_mesa" = "yes" ; then
1.181     gully    1263:        echo Amaya configured with OpenGL Canvas Rendering \(MesaLib\)
1.88      kirschpi 1264:     fi
                   1265:     if test "$with_dav" = "yes" ; then
1.181     gully    1266:        echo Amaya configured with WebDAV support
1.1       cvs      1267:     fi
1.5       cvs      1268: fi
                   1269: 
1.124     gully    1270: if test "$with_wx" = "yes" ; then
1.136     gully    1271:   if test "$with_wxdebug" = "yes" ; then
1.181     gully    1272:     echo "Amaya configured with wxWidgets {srcdir=$WX_SRCDIR} (debug)"
1.136     gully    1273:   else
1.181     gully    1274:     echo "Amaya configured with wxWidgets {srcdir=$WX_SRCDIR}"
1.136     gully    1275:   fi
1.1       cvs      1276: fi
                   1277: 
1.136     gully    1278: 
1.107     kahan    1279: echo ""
1.78      vatton   1280: echo "Now type \"make\" (GNU make preferably) to build the binaries"
1.107     kahan    1281: echo ""
1.120     gully    1282: 

Webmaster