Annotation of Amaya/configure.in, revision 1.238

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

Webmaster