--- Amaya/configure.in 2003/06/24 14:07:25 1.115 +++ Amaya/configure.in 2003/07/02 14:21:32 1.116 @@ -778,7 +778,8 @@ AC_SUBST(NOPRINT) AC_ARG_ENABLE(svg, [ --disable-svg remove SVG support ]) AC_ARG_ENABLE(annot, [ --disable-annot remove Annotations support ]) AC_ARG_ENABLE(raptor, [ --disable-raptor disable the raptor RDF parser ]) -AC_ARG_ENABLE(redland, [ --disable-redland disable the redland RDF library ]) +AC_ARG_ENABLE(redland, [ --enable-redland enable the redland RDF library ]) +AC_ARG_ENABLE(system-redland, [ --enable-system-redland try the redland RDF system library ]) AC_ARG_ENABLE(bookmarks, [ --enable-bookmarks enables experimental bookmark support ]) AC_ARG_ENABLE(generic-xml, [ --disable-generic-xml remove Generic XML support ]) @@ -833,7 +834,7 @@ else fi dnl -dnl The redlandr library is disabled by default +dnl The redland library is disabled by default dnl if test "$with_redland" = "" ; then if test "$enable_redland" = "yes" ; then @@ -846,7 +847,21 @@ else fi dnl -dnl The bookmarks supportr is disabled by default +dnl The redland library is disabled by default +dnl +if test "$with_system_redland" = "" ; then + if test "$enable_system_redland" = "yes" ; then + with_redland="yes" + with_system_redland="yes" + else + with_system_redland="no" + fi +else + with_system_redland="no" +fi + +dnl +dnl The bookmarks support is disabled by default dnl if test "$with_bookmarks" = "" ; then if test "$enable_bookmarks" = "yes" ; then @@ -964,7 +979,34 @@ if test "$build_amaya" = "yes" ; then with_redland="no" fi - if test "$with_redland" = "yes" -a ! -d "$srcdir/../redland" ; then + redland_compile_source=yes + if test "$with_redland" = "yes" -a "$with_system_redland" = "yes" ; then + # check to see if we have a redland library + AC_MSG_CHECKING(system redland library) + redland_min_version=0.9.12 + REDLAND_CONFIG="redland-config" + REDLAND_VERSION=`$REDLAND_CONFIG --version` + redland_version_dec=`echo $REDLAND_VERSION | awk -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'` + redland_min_version_dec=`echo $redland_min_version | awk -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'` + if test $redland_version_dec -lt $redland_min_version_dec; then + AC_MSG_RESULT(no - found version $REDLAND_VERSION and minimal version is $redland_min_version) + else + AC_MSG_RESULT(yes - found version $REDLAND_VERSION) + AC_MSG_CHECKING(checking for redland headers) + REDLAND_HEADERS=`$REDLAND_CONFIG --cflags` + REDLAND_HEADERS="$REDLAND_HEADERS/redland.h" + REDLAND_HEADERS="/usr/local/include/redland.h" + if test -e $REDLAND_HEADERS ; then + AC_MSG_RESULT(yes - have development version) + redland_compile_source=no + else + AC_MSG_RESULT(no - no development version) + fi + fi + fi + + if test "$with_redland" = "yes" -a "$redland_compile_source" = "yes" \ + -a ! -d "$srcdir/../redland" ; then AC_MSG_WARN(Redland source dir not found !!) AC_MSG_WARN(Disabling redland build !) MAKEREDLAND=['#'] @@ -972,12 +1014,25 @@ if test "$build_amaya" = "yes" ; then fi if test "$with_redland" = "yes" ; then - AMAYA_RAPTOR_SRC="amaya_comp_redland" - AMAYA_ANNOT_OPTIONS="$AMAYA_ANNOT_OPTIONS -DLIBRDF_INTERNAL=1 -DAM_REDLAND -DRAPTOR_RDF_PARSER -I\$(THOTDIR)/../redland/librdf -I\$(THOTDIR)/../redland/raptor" - AMAYA_RAPTOR_LIBS="../redland/librdf/.libs/librdf.a ../redland/raptor/.libs/libraptor.a -lexpat" - AMAYA_RAPTOR_INCLUDES="-I\$(THOTDIR)/../redland/librdf -I\$(THOTDIR)/../redland/raptor" + AMAYA_ANNOT_OPTIONS="$AMAYA_ANNOT_OPTIONS -DLIBRDF_INTERNAL=1 -DAM_REDLAND -DRAPTOR_RDF_PARSER" + if test "$redland_compile_source" = "yes" ; then + AMAYA_RAPTOR_SRC="amaya_comp_redland" + AMAYA_ANNOT_OPTIONS="$AMAYA_ANNOT_OPTIONS -I\$(THOTDIR)/../redland/librdf -I\$(THOTDIR)/../redland/raptor" + AMAYA_RAPTOR_LIBS="../redland/librdf/.libs/librdf.a ../redland/raptor/.libs/libraptor.a" + AMAYA_RAPTOR_INCLUDES="-I\$(THOTDIR)/../redland/librdf -I\$(THOTDIR)/../redland/raptor" + else + MAKEREDLAND=['#'] + AMAYA_RAPTOR_SRC= + redland_includes=`$REDLAND_CONFIG --cflags` + redland_libs=`$REDLAND_CONFIG --libs` + AMAYA_ANNOT_OPTIONS="$AMAYA_ANNOT_OPTIONS" + AMAYA_ANNOT_INCLUDES="$redland_includes -I\$(THOTDIR)/thotlib/include" + AMAYA_ANNOT_EXTRA_LIBS="$redland_libs" + AMAYA_RAPTOR_INCLUDES="$redland_includes" + fi fi + dnl control whether we should build the bookmarks support if test "$with_bookmarks" = "yes" -a "$with_annot" = "no" ; then AC_MSG_WARN(Disabling bookmarks build as annotations are disabled !) @@ -1077,6 +1132,7 @@ AC_SUBST(AMAYA_OPTIONS) AC_SUBST(PLUGIN_OPTIONS) AC_SUBST(AMAYA_ANNOT_OPTIONS) AC_SUBST(AMAYA_ANNOT_INCLUDES) +AC_SUBST(AMAYA_ANNOT_EXTRA_LIBS) AC_SUBST(IMGLIBS) AC_SUBST(EXTRA_LIBS) @@ -1220,7 +1276,11 @@ if test "$build_amaya" = "yes" ; then echo Amaya configured with the Raptor RDF parser fi if test "$with_redland" = "yes" ; then - echo Amaya configured with the Redland RDF library + if test "$with_system_redland" = "no" ; then + echo Amaya configured with the Redland RDF library \(local source\) + else + echo Amaya configured with the Redland RDF library \(system\) + fi fi if test "$with_bookmarks" = "yes" ; then echo Amaya configured with bookmarks support \(experimental\)