Browse Source

xml: Build libxml2, roxml, expat modules conditionally

Serj Kalichev 3 years ago
parent
commit
08a0e62c85
4 changed files with 12 additions and 14 deletions
  1. 6 0
      configure.ac
  2. 6 0
      klish/kdb/Makefile.am
  3. 0 7
      klish/kdb/expat/expat_api.c
  4. 0 7
      klish/kdb/roxml/roxml_api.c

+ 6 - 0
configure.ac

@@ -240,6 +240,8 @@ AC_ARG_WITH(libxml2,
 	[use_libxml2=$withval],
 	[use_libxml2=no])
 
+AM_CONDITIONAL(WITH_LIBXML2,test x$use_libxml2 != xno)
+
 case x$use_libxml2 in
 xno)
 	/bin/true
@@ -305,6 +307,8 @@ AC_ARG_WITH(roxml,
 	[use_roxml=$withval],
 	[use_roxml=no])
 
+AM_CONDITIONAL(WITH_ROXML,test x$use_roxml != xno)
+
 case x$use_roxml in
 xno)
 	/bin/true
@@ -412,6 +416,8 @@ AC_ARG_WITH(expat,
             [use_expat=$withval],
             [use_expat=no])
 
+AM_CONDITIONAL(WITH_EXPAT,test x$use_expat != xno)
+
 case x$use_expat in
 xno)
 	/bin/true

+ 6 - 0
klish/kdb/Makefile.am

@@ -3,6 +3,12 @@ EXTRA_DIST += \
 	klish/kdb/roxml/Makefile.am \
 	klish/kdb/expat/Makefile.am
 
+if WITH_LIBXML2
 include $(top_srcdir)/klish/kdb/libxml2/Makefile.am
+endif
+if WITH_ROXML
 include $(top_srcdir)/klish/kdb/roxml/Makefile.am
+endif
+if WITH_EXPAT
 include $(top_srcdir)/klish/kdb/expat/Makefile.am
+endif

+ 0 - 7
klish/kdb/expat/expat_api.c

@@ -21,11 +21,6 @@
  * ------------------------------------------------------
  */
 
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#if defined(HAVE_LIB_EXPAT)
 #include <string.h>
 #include <stdlib.h>
 #include <fcntl.h>
@@ -535,5 +530,3 @@ void clish_xml_release(void *p)
 	/* nothing to release */
 }
 
-#endif /* HAVE_LIB_EXPAT */
-

+ 0 - 7
klish/kdb/roxml/roxml_api.c

@@ -8,11 +8,6 @@
  * ------------------------------------------------------
  */
 
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#if defined(HAVE_LIB_ROXML)
 #include <errno.h>
 #include <roxml.h>
 #include "xmlapi.h"
@@ -354,5 +349,3 @@ void clish_xml_release(void *p)
 	}
 }
 
-#endif /* HAVE_LIB_ROXML */
-