configure.ac: rigmem XML support user optional

I found that building on Cygwin that when libxml2 is installed, MSYS
fails the compile as libxml2 is installed outside the MSYS idea of
'root'.  As this feature depends on an external library, give user the
option of compiling with this support.  Default is to not build rigmem
with XML support.
Hamlib-3.0
Nate Bargmann 2012-10-08 22:23:14 -05:00
rodzic 26da1df586
commit 30e58dfa67
1 zmienionych plików z 32 dodań i 20 usunięć

Wyświetl plik

@ -214,6 +214,7 @@ AS_IF([test "$hl_checkBoth" = 1], [
AC_CHECK_FUNC([accept], [hl_checkNsl=0], [LIBS=$hl2_oldLibs])
])
# separate Name Service Library
AC_CHECK_FUNC([gethostbyname],
[],
[AC_CHECK_LIB([nsl],
@ -223,7 +224,7 @@ AC_CHECK_FUNC([gethostbyname],
[])
])
# Winsock2
# Winsock2 32 bit
AC_CHECK_FUNC([gethostbyname],
[],
[AC_CHECK_LIB([ws2_32],
@ -363,14 +364,24 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],
])
dnl libxml2 required rigmem xml support
PKG_CHECK_MODULES([LIBXML2],
# libxml2 required rigmem xml support, make it user optional
AC_MSG_CHECKING([whether to build rigmem XML support])
AC_ARG_WITH([xml-support],
[AS_HELP_STRING([--with-xml-support],
[build rigmem with XML support @<:@default=no@:>@])],
[cf_with_xml_support=$withval],
[cf_with_xml_support=no])
AC_MSG_RESULT([$cf_with_xml_support])
AS_IF([test x"${cf_with_xml_support}" = "xyes"], [
PKG_CHECK_MODULES([LIBXML2],
[libxml-2.0],
[AC_DEFINE([HAVE_XML2],
[1],
[Define if libxml2 is available])],
[AC_MSG_WARN([libxml-2.0 pkg-config not found, XML support will be disabled])
])
])
AC_SUBST([LIBXML2_LIBS])
AC_SUBST([LIBXML2_CFLAGS])
@ -717,6 +728,7 @@ echo \
With Perl binding ${cf_with_perl_binding}
With Python binding ${cf_with_python_binding}
With TCL binding ${build_tcl}
With rigmem XML support ${cf_with_xml_support}
With included ltdl ${with_included_ltdl}
Enable Rig Matrix ${enable_rigmatrix}