Source: net-snmp
Severity: normal
Dear Maintainer,
The --base-lib-cflags option to net-snmp-config added by Debian
developers is broken as it outputs @LIBCFLAGS@ among others.
The problem comes from the fact that when it was introduced (version
5.4.2.1~dsfg-4), the original patch modified the configure.in file as
well. In the meantime, the structure of configure.ac has changed and
when the patch was adapted, the modification to configure.ac was
dropped, resulting in a substitution left aside.
The attached patch is an attempt to restore the original behavior. It
is meant as a replacement of debian/patches/62_add_lib_cflags.patch .
Nevertheless, the way information output by net-snmp-config
--base-lib-cflags is gathered is wrong. There shouldn't IMHO be any
GCC optimization flags like -O2 in the substitution, among others. The
variable to substitute @LIBCFLAGS@ should be carefully constructed
during the configure process instead.
-- System Information:
Debian Release: stretch/sid
APT prefers zesty-updates
APT policy: (500, 'zesty-updates'), (500, 'zesty-security'), (500,
'zesty-proposed'), (500, 'zesty'), (100, 'zesty-backports')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 4.10.0-22-lowlatency (SMP w/4 CPU cores; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
diff --git a/configure.ac b/configure.ac
index ecf761f..e72b955 100644
--- a/configure.ac
+++ b/configure.ac
@@ -55,6 +55,11 @@ m4_include([configure.d/config_modules_agent])
m4_include([configure.d/config_os_misc1])
m4_include([configure.d/config_os_libs2])
AC_CACHE_SAVE
+
+# Save CFLAGS for net-snmp-config
+LIBCFLAGS=$CFLAGS
+AC_SUBST(LIBCFLAGS)
+
m4_include([configure.d/config_project_perl_python])
m4_include([configure.d/config_os_misc2])
m4_include([configure.d/config_project_types])
diff --git a/net-snmp-config.in b/net-snmp-config.in
index d55872c..0831fa0 100644
--- a/net-snmp-config.in
+++ b/net-snmp-config.in
@@ -140,6 +140,9 @@ else
--base-cflags)
echo @CFLAGS@ @CPPFLAGS@ -I${NSC_INCLUDEDIR}
;;
+ --base-lib-cflags)
+ echo @LIBCFLAGS@ @CPPFLAGS@ -I${NSC_INCLUDEDIR}
+ ;;
--cflags|--cf*)
echo @CFLAGS@ @DEVFLAGS@ @CPPFLAGS@ -I. -I${NSC_INCLUDEDIR}
;;
@@ -643,6 +646,8 @@ if test "x$usage" = "xyes"; then
echo " These options produce the various compilation flags needed when"
echo " building external SNMP applications:"
echo ""
+ echo " --base-lib-cflags lists additional compilation flags needed for linking"
+ echo " against libsnmp"
echo " --base-cflags lists additional compilation flags needed"
echo " --cflags lists additional compilation flags needed"
echo " (includes -I. and extra developer warning flags)"