summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancesco Giudici <fgiudici@redhat.com>2016-01-26 12:31:20 +0100
committerFrancesco Giudici <fgiudici@redhat.com>2016-04-04 19:20:23 +0200
commitd5df67ef3f98054b712d2100327f9da301944ec3 (patch)
tree4ae202257801c3f88df329686d8c8c19b0ebb289
parent412cf8d9aeb09878d061b26726af699ee6526d0e (diff)
downloadNetworkManager-fg/libcurl-vs-libsoup-bgo752642_II.tar.gz
build: enable selection of libcurlfg/libcurl-vs-libsoup-bgo752642_II
Connectivity check was performed through libsoup. Excluding libsoup at compile time dropped connectivity checking functionality. Now the user is allowed to select libcurl in order to provide the same functionality. Thanks to Beniamino Galvani for the libcurl compilation flags added in src/Makefile.am.
-rw-r--r--configure.ac27
-rw-r--r--src/Makefile.am5
2 files changed, 27 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index 131c5d185b..6a5371f62f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -836,13 +836,14 @@ fi
AC_DEFINE_UNQUOTED(KERNEL_FIRMWARE_DIR, "$KERNEL_FIRMWARE_DIR", [Define to path of the kernel firmware directory])
AC_SUBST(KERNEL_FIRMWARE_DIR)
-PKG_CHECK_MODULES(LIBSOUP, [libsoup-2.4 >= 2.40], [have_libsoup=yes],[have_libsoup=no])
+PKG_CHECK_MODULES(LIBSOUP, [libsoup-2.4 >= 2.40], [have_libsoup=yes], [have_libsoup=no])
AC_ARG_WITH(libsoup, AS_HELP_STRING([--with-libsoup=yes|no], [Link against libsoup]), [], [with_libsoup=${have_libsoup}])
if test "$with_libsoup" != "no"; then
if test "$have_libsoup" != "yes"; then
AC_MSG_ERROR(libsoup library not found)
fi
with_libsoup='yes'
+ concheck_lib='(libsoup)'
AC_DEFINE(WITH_LIBSOUP, 1, [Define if you have libsoup])
else
AC_DEFINE(WITH_LIBSOUP, 0, [Define if you have libsoup])
@@ -850,11 +851,27 @@ fi
AM_CONDITIONAL(WITH_LIBSOUP, test "$with_libsoup" != "no")
LIBSOUP_CFLAGS="$LIBSOUP_CFLAGS -DSOUP_VERSION_MIN_REQUIRED=SOUP_VERSION_2_40 -DSOUP_VERSION_MAX_ALLOWED=SOUP_VERSION_2_40"
+PKG_CHECK_MODULES(LIBCURL, [libcurl], [have_libcurl=yes], [have_libcurl=no])
+AC_ARG_WITH(libcurl, AS_HELP_STRING([--with-libcurl=yes|no], [Link against libcurl]), [],
+ [if test "$with_libsoup" != "yes"; then with_libcurl=${have_libcurl}; else with_libcurl="no"; fi] )
+
+if test "$with_libcurl" != "no"; then
+ if test "$have_libcurl" != "yes"; then
+ AC_MSG_ERROR(libcurl library not found)
+ fi
+ with_libcurl='yes'
+ concheck_lib='(libcurl)'
+ AC_DEFINE(WITH_LIBCURL, 1, [Define if you have libcurl])
+else
+ AC_DEFINE(WITH_LIBCURL, 0, [Define if you have libcurl])
+fi
+AM_CONDITIONAL(WITH_LIBCURL, test "$with_libcurl" != "no")
+
AC_ARG_ENABLE(concheck, AS_HELP_STRING([--enable-concheck], [enable connectivity checking support]),
- [enable_concheck=${enableval}], [enable_concheck=${with_libsoup}])
+ [enable_concheck=${enableval}], [if test "$with_libsoup" = "yes" || test "$with_libcurl" = "yes"; then enable_concheck="yes"; else enable_concheck="no"; fi])
if (test "${enable_concheck}" = "yes"); then
- if test x"$with_libsoup" = x"no"; then
- AC_MSG_ERROR(Connectivity checking requires libsoup)
+ if test x"$with_libsoup" = x"no" && test x"$with_libcurl" = x"no"; then
+ AC_MSG_ERROR(Connectivity checking requires libsoup or libcurl)
fi
AC_DEFINE(WITH_CONCHECK, 1, [Define if you want connectivity checking support])
else
@@ -1148,7 +1165,7 @@ echo " wext: $ac_with_wext"
echo " wifi: $enable_wifi"
echo " ppp: $enable_ppp"
echo " modemmanager-1: $with_modem_manager_1"
-echo " concheck: $enable_concheck"
+echo " concheck: $enable_concheck $concheck_lib"
echo " libteamdctl: $enable_teamdctl"
echo " libnm-glib: $with_libnm_glib"
echo " nmcli: $build_nmcli"
diff --git a/src/Makefile.am b/src/Makefile.am
index 7909128eb1..182fd937fc 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -479,6 +479,7 @@ AM_CPPFLAGS += \
$(LIBNL_CFLAGS) \
$(LIBNDP_CFLAGS) \
$(LIBSOUP_CFLAGS) \
+ $(LIBCURL_CFLAGS) \
$(SELINUX_CFLAGS) \
$(LIBAUDIT_CFLAGS) \
$(SYSTEMD_LOGIN_CFLAGS) \
@@ -526,6 +527,10 @@ if WITH_LIBSOUP
libNetworkManager_la_LIBADD += $(LIBSOUP_LIBS)
endif
+if WITH_LIBCURL
+libNetworkManager_la_LIBADD += $(LIBCURL_LIBS)
+endif
+
NetworkManager_LDFLAGS = \
-rdynamic \
-Wl,--version-script="$(srcdir)/NetworkManager.ver"