Skip to content

Commit

Permalink
Tidy up CFLAGS, CPPFLAGS, LDFLAGS and LDLIBS output from configure
Browse files Browse the repository at this point in the history
Signed-off-by: Quentin Armitage <quentin@armitage.org.uk>
  • Loading branch information
pqarmitage committed May 13, 2019
1 parent a9e0616 commit 63fe1f4
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2025,8 +2025,19 @@ if test "$enable_snmp" = yes -o \
]])
SNMP_SUPPORT=Yes
# NETSNMP_CFLAGS can have CPPFLAGS options, so separate them
NETSNMP_CPPFLAGS=`echo " $NETSNMP_CFLAGS " | sed -e "s/ / /g" -e "s/ -[[^I]] *-/ -/g" -e "s/ -[[^I]] *[[^-]][[^ ]]* / /g" -e "s/ */ /g"`
NETSNMP_CFLAGS=`echo " $NETSNMP_CFLAGS " | sed -e "s/ / /g" -e "s/ -I *[[^ ]]* / /g" -e "s/ */ /g"`
add_to_var([KA_CFLAGS], [$NETSNMP_CFLAGS])
add_to_var([KA_CPPFLAGS], [$NETSNMP_CPPFLAGS])
# NETSNMP_LIBS may have some LDFLAGS options, so separate them
NETSNMP_LDFLAGS=`echo " $NETSNMP_LIBS " | sed -e "s/ / /g" -e "s/ -l *[[^ ]]* / /g" -e "s/ */ /g" -e "s/ -/ @-/g" | tr "@" "\n" | sed -e "s/^ *//" -e "s/ *$//" | sort -u | tr "\n" " "`
NETSNMP_LIBS=`echo " $NETSNMP_LIBS " | sed -e "s/ / /g" -e "s/ \(-l *[[^ ]]*\) /@\1@/g" | tr "@" "\n" | grep "^-l" | tr "\n" " " | sed -e "s/ */ /g"`
add_to_var([KA_LDFLAGS], [$NETSNMP_LDFLAGS])
add_to_var([KA_LIBS], [$NETSNMP_LIBS])
if test "$enable_snmp_rfc" = yes; then
SNMP_RFCV2_SUPPORT=Yes
SNMP_RFCV3_SUPPORT=Yes
Expand Down Expand Up @@ -2554,6 +2565,12 @@ fi
dnl ----[ Process output target ]----
echo
# Tidy up some strings
KA_CPPFLAGS=`echo $KA_CPPFLAGS | sed -e "s/ */ /g" -e "s/^ //" -e "s/ $//"`
KA_CFLAGS=`echo $KA_CFLAGS | sed -e "s/ */ /g" -e "s/^ //" -e "s/ $//"`
KA_LDFLAGS=`echo $KA_LDFLAGS | sed -e "s/ */ /g" -e "s/^ //" -e "s/ $//"`
KA_LIBS=`echo $KA_LIBS | sed -e "s/ */ /g" -e "s/^ //" -e "s/ $//"`
AC_OUTPUT
# Restore lib/config_warnings.h.in
Expand Down

0 comments on commit 63fe1f4

Please sign in to comment.