Annotation of Amaya/configure.in, revision 1.258

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

Webmaster