Skip to content

Commit

Permalink
autoconf: better libnl3 detection
Browse files Browse the repository at this point in the history
use pkg-config facilities to append CFLAGS related instead of hardcoding
libnl3 path in configure script.
  • Loading branch information
acassen committed Jan 7, 2014
1 parent 8b6e812 commit cba49f2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
6 changes: 1 addition & 5 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,6 @@ ac_includes_default="\
ac_subst_vars='LTLIBOBJS
LIBOBJS
VRRP_SUPPORT
INCLUDE_NL
USE_NL
IPVS_SUPPORT
VERSION_DATE
Expand Down Expand Up @@ -3975,9 +3974,8 @@ $as_echo "$ac_cv_lib_nl_genl_3_genl_connect" >&6; }
if test "x$ac_cv_lib_nl_genl_3_genl_connect" = xyes; then :
USE_NL="LIBIPVS_USE_NL"
CFLAGS="$CFLAGS $(pkg-config libnl-genl-3.0)"
CFLAGS="$CFLAGS $(pkg-config --cflags libnl-genl-3.0)"
LIBS="$LIBS $(pkg-config --libs libnl-genl-3.0)"
INCLUDE_NL="-I/usr/include/libnl3"
else
Expand Down Expand Up @@ -4029,7 +4027,6 @@ if test "x$ac_cv_lib_nl_nl_socket_modify_cb" = xyes; then :
USE_NL="LIBIPVS_USE_NL"
CFLAGS="$CFLAGS -DFALLBACK_LIBNL1"
LIBS="$LIBS $(pkg-config --libs libnl-1)"
INCLUDE_NL=""
else
Expand Down Expand Up @@ -4465,7 +4462,6 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
if ${ac_cv_c_const+:} false; then :
Expand Down
5 changes: 1 addition & 4 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,8 @@ AC_CHECK_LIB(nl-3, nl_socket_alloc,
AC_CHECK_LIB(nl-genl-3, genl_connect,
[
USE_NL="LIBIPVS_USE_NL"
CFLAGS="$CFLAGS $(pkg-config libnl-genl-3.0)"
CFLAGS="$CFLAGS $(pkg-config --cflags libnl-genl-3.0)"
LIBS="$LIBS $(pkg-config --libs libnl-genl-3.0)"
INCLUDE_NL="-I/usr/include/libnl3"
],
[
AC_MSG_ERROR([libnl-3 is installed but not libnl-gen-3. Please, install libnl-gen-3.])
Expand All @@ -75,7 +74,6 @@ AC_CHECK_LIB(nl-3, nl_socket_alloc,
USE_NL="LIBIPVS_USE_NL"
CFLAGS="$CFLAGS -DFALLBACK_LIBNL1"
LIBS="$LIBS $(pkg-config --libs libnl-1)"
INCLUDE_NL=""
],
[
USE_NL="LIBIPVS_DONTUSE_NL"
Expand Down Expand Up @@ -279,7 +277,6 @@ AC_SUBST(VERSION)
AC_SUBST(VERSION_DATE)
AC_SUBST(IPVS_SUPPORT)
AC_SUBST(USE_NL)
AC_SUBST(INCLUDE_NL)
AC_SUBST(VRRP_SUPPORT)

dnl ----[ Checks for typedefs, structures, and compiler characteristics ]----
Expand Down
2 changes: 1 addition & 1 deletion keepalived/libipvs-2.6/Makefile.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Makefile for libipvs

CC = @CC@
CFLAGS = @CFLAGS@ @CPPFLAGS@ @INCLUDE_NL@ -D@USE_NL@ -Wall -Wunused
CFLAGS = @CFLAGS@ @CPPFLAGS@ -D@USE_NL@ -Wall -Wunused

export OBJS += libipvs.a

Expand Down

0 comments on commit cba49f2

Please sign in to comment.