Bumped version, added libxml2 tests to configure

Sat, 31 May 2014 11:39:13 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Sat, 31 May 2014 11:39:13 +0200
changeset 57
a76dc0db592c
parent 56
f7711c6ac93c
child 58
e8e7b46b705b

Bumped version, added libxml2 tests to configure

config.h.in file | annotate | diff | comparison | revisions
configure file | annotate | diff | comparison | revisions
configure.ac file | annotate | diff | comparison | revisions
--- a/config.h.in	Tue May 27 23:20:37 2014 +0200
+++ b/config.h.in	Sat May 31 11:39:13 2014 +0200
@@ -14,3 +14,7 @@
 
 /* Define if you have the <mosquitto.h> header file. */
 #undef HAVE_MOSQUITTO_H
+
+/* Define if you have the <libxml2/parser.h> header file. */
+#undef HAVE_LIBXML_PARSER_H
+
--- a/configure	Tue May 27 23:20:37 2014 +0200
+++ b/configure	Sat May 31 11:39:13 2014 +0200
@@ -3506,7 +3506,6 @@
   as_fn_error $? "libmosquitto not found" "$LINENO" 5
 fi
 
-
 WIRINGPI=No
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wiringPiSetup in -lwiringPi" >&5
 $as_echo_n "checking for wiringPiSetup in -lwiringPi... " >&6; }
@@ -3597,6 +3596,71 @@
   CFLAGS="-g -O2 -fomit-frame-pointer -fno-strict-aliasing -Wall -Wshadow -Wwrite-strings -Wstrict-prototypes -Winline"
 fi
 
+
+LIBXML2=No
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for xmlParseFile in -lxml2" >&5
+$as_echo_n "checking for xmlParseFile in -lxml2... " >&6; }
+if ${ac_cv_lib_xml2_xmlParseFile+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lxml2  $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 xmlParseFile ();
+int
+main ()
+{
+return xmlParseFile ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_xml2_xmlParseFile=yes
+else
+  ac_cv_lib_xml2_xmlParseFile=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_xmlParseFile" >&5
+$as_echo "$ac_cv_lib_xml2_xmlParseFile" >&6; }
+if test "x$ac_cv_lib_xml2_xmlParseFile" = xyes; then :
+  result=yes
+else
+  result=no
+fi
+
+if test "$result" = "yes"; then
+  LIBS="$LIBS -lxml2"
+  CFLAGS="$CFLAGS $(xml2-config --cflags)"
+  for ac_header in libxml/xmlmemory.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "libxml/xmlmemory.h" "ac_cv_header_libxml_xmlmemory_h" "$ac_includes_default"
+if test "x$ac_cv_header_libxml_xmlmemory_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBXML_XMLMEMORY_H 1
+_ACEOF
+ LIBXML2=Yes
+else
+  LIBXML2=No
+fi
+
+done
+
+fi
+
+
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
 $as_echo_n "checking for ANSI C header files... " >&6; }
 if ${ac_cv_header_stdc+:} false; then :
@@ -4996,6 +5060,7 @@
     Version : ............ ${VERSION}
     Main directory : ..... ${prefix}
     WiringPi : ........... ${WIRINGPI}
+    XML2: ................ ${LIBXML2}
 
   Now type 'make' and 'sudo make install'
 " >&5
@@ -5007,6 +5072,7 @@
     Version : ............ ${VERSION}
     Main directory : ..... ${prefix}
     WiringPi : ........... ${WIRINGPI}
+    XML2: ................ ${LIBXML2}
 
   Now type 'make' and 'sudo make install'
 " >&6; }
--- a/configure.ac	Tue May 27 23:20:37 2014 +0200
+++ b/configure.ac	Sat May 31 11:39:13 2014 +0200
@@ -39,7 +39,6 @@
   AC_MSG_ERROR(libmosquitto not found)
 fi
 
-
 WIRINGPI=No
 AC_CHECK_LIB(wiringPi,wiringPiSetup,result=yes,result=no)
 if test "$result" = "yes"; then
@@ -63,6 +62,17 @@
   CFLAGS="-g -O2 -fomit-frame-pointer -fno-strict-aliasing -Wall -Wshadow -Wwrite-strings -Wstrict-prototypes -Winline"
 fi
 
+
+LIBXML2=No
+AC_CHECK_LIB(xml2,xmlParseFile,result=yes,result=no)
+if test "$result" = "yes"; then
+  LIBS="$LIBS -lxml2"
+  CFLAGS="$CFLAGS $(xml2-config --cflags)"
+  AC_CHECK_HEADERS(libxml/xmlmemory.h,LIBXML2=Yes,LIBXML2=No)
+fi
+
+
+
 dnl Checks for header files.
 AC_HEADER_STDC
 
@@ -81,6 +91,7 @@
     Version : ............ ${VERSION}
     Main directory : ..... ${prefix}
     WiringPi : ........... ${WIRINGPI}
+    XML2: ................ ${LIBXML2}
 
   Now type 'make' and 'sudo make install'
 ])

mercurial