Annotation of Amaya/configure.in, revision 1.243

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

Webmaster