Browse Source

Build system: regenarate configure script

After two changes in configure.ac, we regen ./configure using
autoconf 2.69
Emmanuel Deloget 12 years ago
parent
commit
659db5c5ed
1 changed files with 324 additions and 31 deletions
  1. 324 31
      configure

+ 324 - 31
configure

@@ -12661,76 +12661,369 @@ else
 fi
 
 
-if test "x$use_roxml" = "xyes"; then
-	if test "x$use_libxml2" = "xyes"; then
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: both roxml and libxml2 are selected. I choose roxml" >&5
+if test "x$use_roxml" != "xno"; then
+    if test "x$use_libxml2" != "xno"; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: both roxml and libxml2 are selected. I choose roxml" >&5
 $as_echo "$as_me: WARNING: both roxml and libxml2 are selected. I choose roxml" >&2;}
-		use_libxml2=no
-	fi
+        use_libxml2=no
+    fi
+else
+    if test "x$use_libxml2" = "xno"; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: neither roxml nor libxml2 are selected. I choose libxml2" >&5
+$as_echo "$as_me: WARNING: neither roxml nor libxml2 are selected. I choose libxml2" >&2;}
+        use_libxml2=yes
+    fi
 fi
 
 XML_LDFLAGS=""
 XML_CFLAGS=""
 XML_LIBS=""
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libroxml support" >&5
-$as_echo_n "checking for libroxml support... " >&6; }
 case x$use_roxml in
   xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libroxml support" >&5
+$as_echo_n "checking for libroxml support... " >&6; }
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
     ;;
   xyes)
+    # we choose to NOT rely on pkg-config on this one. We may do it as
+    # libroxml provides a .pc file but some environment (both cross-compile
+    # or native environment) may lack this support. The good thing is that
+    # it doesn't add much complexity to the configure.ac file (and we
+    # may move these tests to another m4 file later).
+
+    # the header is installed in the standard path
+    ac_fn_c_check_header_compile "$LINENO" "roxml.h" "ac_cv_header_roxml_h" "/* force include check */
+"
+if test "x$ac_cv_header_roxml_h" = xyes; then :
+  roxml_h_found=yes
+else
+  roxml_h_found=no
+fi
+
+
+    if test "x$roxml_h_found" != "xyes"; then
+        as_fn_error $? "cannot find <roxml.h> header file" "$LINENO" 5
+    fi
+    XML_CFLAGS=""
+
     # the library is installed in the standard path
-    XML_LDFLAGS="`pkg-config libroxml --libs-only-L`"
-    XML_CFLAGS="`pkg-config libroxml --cflags`"
-    XML_LIBS="`pkg-config libroxml --libs-only-l`"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for roxml_load_doc in -lroxml" >&5
+$as_echo_n "checking for roxml_load_doc in -lroxml... " >&6; }
+if ${ac_cv_lib_roxml_roxml_load_doc+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lroxml  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char roxml_load_doc ();
+int
+main ()
+{
+return roxml_load_doc ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_roxml_roxml_load_doc=yes
+else
+  ac_cv_lib_roxml_roxml_load_doc=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_roxml_roxml_load_doc" >&5
+$as_echo "$ac_cv_lib_roxml_roxml_load_doc" >&6; }
+if test "x$ac_cv_lib_roxml_roxml_load_doc" = xyes; then :
+  roxml_lib_found=yes
+else
+  roxml_lib_found=no
+fi
+
+    if test "x$roxml_lib_found" != "xyes"; then
+        as_fn_error $? "cannot find roxml library" "$LINENO" 5
+    fi
+    XML_LDFLAGS=""
+    XML_LIBS="-lroxml"
+
 
 $as_echo "#define HAVE_LIB_ROXML /**/" >>confdefs.h
 
+
     ;;
+
   *)
-    # this is very likely to be a source directory, so
-    # let's consider that it's a valid one
-    XML_LDFLAGS="-L${use_roxml}"
-    XML_CFLAGS="-I${use_roxml}/inc"
-    XML_LIBS="-lroxml"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (lib in ${use_roxml}, includes in ${use_roxml}/inc)" >&5
-$as_echo "yes (lib in ${use_roxml}, includes in ${use_roxml}/inc)" >&6; }
+    # first, we check if we're not looking for an alternate include
+    # directory -for example, if the user feeds the script with the
+    # option --with-roxml=/usr/local
+    # NOTE: we search for include/roxml.h and inc/roxml.h to defeat
+    # the caching algorithm of the configure script. If someone knows
+    # a better way, please do not hesitate
+    roxml_CFLAGS="$CFLAGS"
+    CFLAGS="$CFLAGS -I${use_roxml}"
+    ac_fn_c_check_header_compile "$LINENO" "include/roxml.h" "ac_cv_header_include_roxml_h" "/* force include check */
+"
+if test "x$ac_cv_header_include_roxml_h" = xyes; then :
+  roxml_h_found=yes
+else
+  roxml_h_found=no
+fi
+
+
+    if test "x$roxml_h_found" = "xno"; then
+        # the directory might be a source directory, so check
+        # if the include file is to be found here
+        ac_fn_c_check_header_compile "$LINENO" "inc/roxml.h" "ac_cv_header_inc_roxml_h" "/* force include check */
+"
+if test "x$ac_cv_header_inc_roxml_h" = xyes; then :
+  roxml_h_found=yes
+else
+  roxml_h_found=no
+fi
+
+
+        if test "x$roxml_h_found" = "xno"; then
+            as_fn_error $? "cannot find <roxml.h> header file" "$LINENO" 5
+        fi
+        XML_CFLAGS="-I${use_roxml}/inc"
+        { $as_echo "$as_me:${as_lineno-$LINENO}: header file <roxml.h> found in ${use_roxml}/inc" >&5
+$as_echo "$as_me: header file <roxml.h> found in ${use_roxml}/inc" >&6;}
+    else
+        XML_CFLAGS="-I${use_roxml}/include"
+        { $as_echo "$as_me:${as_lineno-$LINENO}: header file <roxml.h> found in ${use_roxml}/include" >&5
+$as_echo "$as_me: header file <roxml.h> found in ${use_roxml}/include" >&6;}
+    fi
+    CFLAGS="$roxml_CFLAGS"
+
+    # we're doing both previous checks, but we are trying to find a library
+    # now, so the check themselves are a bit different
+    # NOTE: we search for roxml_load_doc and roxml_close to defeat
+    # the caching algorithm of the configure script. If someone knows
+    # a better way, please do not hesitate.
+    roxml_LDFLAGS="$LDFLAGS"
+    LDFLAGS="$LDFLAGS -L${use_roxml}/lib"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for roxml_load_doc in -lroxml" >&5
+$as_echo_n "checking for roxml_load_doc in -lroxml... " >&6; }
+if ${ac_cv_lib_roxml_roxml_load_doc+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lroxml  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char roxml_load_doc ();
+int
+main ()
+{
+return roxml_load_doc ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_roxml_roxml_load_doc=yes
+else
+  ac_cv_lib_roxml_roxml_load_doc=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_roxml_roxml_load_doc" >&5
+$as_echo "$ac_cv_lib_roxml_roxml_load_doc" >&6; }
+if test "x$ac_cv_lib_roxml_roxml_load_doc" = xyes; then :
+  roxml_lib_found=yes
+else
+  roxml_lib_found=no
+fi
+
+    LDFLAGS=$roxml_LDFLAGS
+    if test "x$roxml_lib_found" = "xno"; then
+        LDFLAGS="$LDFLAGS -L${use_roxml}"
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for roxml_close in -lroxml" >&5
+$as_echo_n "checking for roxml_close in -lroxml... " >&6; }
+if ${ac_cv_lib_roxml_roxml_close+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lroxml  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char roxml_close ();
+int
+main ()
+{
+return roxml_close ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_roxml_roxml_close=yes
+else
+  ac_cv_lib_roxml_roxml_close=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_roxml_roxml_close" >&5
+$as_echo "$ac_cv_lib_roxml_roxml_close" >&6; }
+if test "x$ac_cv_lib_roxml_roxml_close" = xyes; then :
+  roxml_lib_found=yes
+else
+  roxml_lib_found=no
+fi
+
+        LDFLAGS=$roxml_LDFLAGS
+        if test "x$roxml_lib_found" = "xno"; then
+            as_fn_error $? "cannot find roxml library" "$LINENO" 5
+        fi
+        XML_LDFLAGS="-L${use_roxml}"
+        XML_LIBS="-lroxml"
+        { $as_echo "$as_me:${as_lineno-$LINENO}: library libroxml found in ${use_roxml}" >&5
+$as_echo "$as_me: library libroxml found in ${use_roxml}" >&6;}
+    else
+        XML_LDFLAGS="-L${use_roxml}/lib"
+        XML_LIBS="-lroxml"
+        { $as_echo "$as_me:${as_lineno-$LINENO}: library libroxml found in ${use_roxml}/lib" >&5
+$as_echo "$as_me: library libroxml found in ${use_roxml}/lib" >&6;}
+    fi
+
 
 $as_echo "#define HAVE_LIB_ROXML /**/" >>confdefs.h
 
     ;;
 esac
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libxml2 support" >&5
-$as_echo_n "checking for libxml2 support... " >&6; }
 case x$use_libxml2 in
   xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libxml2 support" >&5
+$as_echo_n "checking for libxml2 support... " >&6; }
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
     ;;
   xyes)
-    # the library is installed in the standard path
-    XML_LDFLAGS="`pkg-config libxml-2.0 --libs-only-L`"
+    # I would love to avoid using pkg-config (which may not be available on
+    # some compilation environment) but doing so really add a lot of complexity
+    # to the system, as the headers don't lie in a standard directory (they
+    # lie in a subdirectory of a standard include directory; not the same thing
+    # for configure scripts).
     XML_CFLAGS="`pkg-config libxml-2.0 --cflags`"
+    XML_LDFLAGS="`pkg-config libxml-2.0 --libs-only-L`"
     XML_LIBS="`pkg-config libxml-2.0 --libs-only-l`"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xmlNewDoc in -lxml2" >&5
+$as_echo_n "checking for xmlNewDoc in -lxml2... " >&6; }
+if ${ac_cv_lib_xml2_xmlNewDoc+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lxml2 -lz $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char xmlNewDoc ();
+int
+main ()
+{
+return xmlNewDoc ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_xml2_xmlNewDoc=yes
+else
+  ac_cv_lib_xml2_xmlNewDoc=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xml2_xmlNewDoc" >&5
+$as_echo "$ac_cv_lib_xml2_xmlNewDoc" >&6; }
+if test "x$ac_cv_lib_xml2_xmlNewDoc" = xyes; then :
+  libxml2_lib_found=yes
+else
+  libxml2_lib_found=no
+fi
+
+    if test "x$libxml2_lib_found" != "xyes"; then
+        as_fn_error $? "cannot find libxml2 library" "$LINENO" 5
+    fi
+
+    # the header file is installed in a subdirectory of one of the standard
+    # include directory. This might prove to be a problem if the cross-compile
+    # environment is not complete enough (i.e. if it misses pkg-config, or
+    # if pkg-config returns wrong values). In most cases, the environment is
+    # likely to be OK so we will never hit any issue.
+    xml2_CFLAGS="$CFLAGS"
+    CFLAGS="$CFLAGS $XML_CFLAGS"
+    ac_fn_c_check_header_compile "$LINENO" "libxml/tree.h" "ac_cv_header_libxml_tree_h" "/* force include check */
+"
+if test "x$ac_cv_header_libxml_tree_h" = xyes; then :
+  libxml2_h_found=yes
+else
+  libxml2_h_found=no
+fi
+
+
+    CFLAGS="$xml2_CFLAGS"
+    if test "x$libxml2_h_found" != "xyes"; then
+        as_fn_error $? "cannot find libxml2 headers" "$LINENO" 5
+    fi
+
 
 $as_echo "#define HAVE_LIB_LIBXML2 /**/" >>confdefs.h
 
     ;;
   *)
-    # this is very likely to be a source directory, so
-    # let's consider that it's a valid one
-    XML_LDFLAGS="-L${use_libxml2}"
-    XML_CFLAGS="-I${use_libxml2}"
+    # this is probably broken. We consider that the user supplied path is
+    # a non-standard path. But we're not going to check anything.
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-libxml2=DIR is probably broken, but let's try" >&5
+$as_echo "$as_me: WARNING: --with-libxml2=DIR is probably broken, but let's try" >&2;}
+    XML_LDFLAGS="-L${use_libxml2}/include/libxml2"
+    XML_CFLAGS="-I${use_libxml2}/lib"
     XML_LIBS="-lxml2"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (lib and includes in ${use_libxml2}" >&5
-$as_echo "yes (lib and includes in ${use_libxml2}" >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libxml2 support" >&5
+$as_echo_n "checking for libxml2 support... " >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: headers for libxml2 hopefully in ${use_libxml2}/include/libxml2" >&5
+$as_echo "$as_me: headers for libxml2 hopefully in ${use_libxml2}/include/libxml2" >&6;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: library libxml2 hopefully in ${use_libxml2}/lib" >&5
+$as_echo "$as_me: library libxml2 hopefully in ${use_libxml2}/lib" >&6;}
 
 $as_echo "#define HAVE_LIB_LIBXML2 /**/" >>confdefs.h