build-sys: use $LIBS rather than LDFLAGS
Fixes: https://github.com/karelzak/util-linux/pull/1349 Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
parent
ab26415a03
commit
a000aad7a6
|
@ -843,7 +843,7 @@ char *c = crypt("abc","pw");
|
||||||
have_libcrypt=no
|
have_libcrypt=no
|
||||||
have_crypt=yes
|
have_crypt=yes
|
||||||
],[
|
],[
|
||||||
UL_SET_FLAGS([], [], [-lcrypt])
|
UL_SET_LIBS([-lcrypt])
|
||||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
||||||
#ifdef HAVE_CRYPT_H
|
#ifdef HAVE_CRYPT_H
|
||||||
#include <crypt.h>
|
#include <crypt.h>
|
||||||
|
@ -859,7 +859,7 @@ char *c = crypt("abc","pw");
|
||||||
],[
|
],[
|
||||||
AC_MSG_WARN([crypt() is not available])
|
AC_MSG_WARN([crypt() is not available])
|
||||||
])
|
])
|
||||||
UL_RESTORE_FLAGS
|
UL_RESTORE_LIBS
|
||||||
])
|
])
|
||||||
AM_CONDITIONAL([HAVE_LIBCRYPT], [test "x$have_libcrypt" = xyes])
|
AM_CONDITIONAL([HAVE_LIBCRYPT], [test "x$have_libcrypt" = xyes])
|
||||||
|
|
||||||
|
@ -881,10 +881,10 @@ AS_IF([test "x$with_selinux" = xno], [
|
||||||
UL_PKG_STATIC([SELINUX_LIBS_STATIC], [libselinux])
|
UL_PKG_STATIC([SELINUX_LIBS_STATIC], [libselinux])
|
||||||
AM_CONDITIONAL([HAVE_SELINUX], [true])
|
AM_CONDITIONAL([HAVE_SELINUX], [true])
|
||||||
|
|
||||||
UL_SET_FLAGS([], [], [$SELINUX_LIBS])
|
UL_SET_LIBS([$SELINUX_LIBS])
|
||||||
# This function is missing in old libselinux 1.xx versions
|
# This function is missing in old libselinux 1.xx versions
|
||||||
AC_CHECK_FUNCS([security_get_initial_context])
|
AC_CHECK_FUNCS([security_get_initial_context])
|
||||||
UL_RESTORE_FLAGS
|
UL_RESTORE_LIBS
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
AC_SUBST([SELINUX_LIBS])
|
AC_SUBST([SELINUX_LIBS])
|
||||||
|
|
25
m4/ul.m4
25
m4/ul.m4
|
@ -67,28 +67,21 @@ AC_DEFUN([UL_SET_ARCH], [
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
dnl UL_SET_FLAGS(CFLAGS, CPPFLAGS, LDFLAGS)
|
dnl UL_SET_LIBS(LIBS)
|
||||||
dnl
|
dnl
|
||||||
dnl Sets new global CFLAGS, CPPFLAGS and LDFLAG, the original
|
dnl Sets new global LIBS, the original setting could be restored by UL_RESTORE_LIBS()
|
||||||
dnl setting could be restored by UL_RESTORE_FLAGS()
|
|
||||||
dnl
|
dnl
|
||||||
AC_DEFUN([UL_SET_FLAGS], [
|
AC_DEFUN([UL_SET_LIBS], [
|
||||||
old_CFLAGS="$CFLAGS"
|
old_LIBS="$LIBS"
|
||||||
old_CPPFLAGS="$CPPFLAGS"
|
LIBS="$LIBS $1"
|
||||||
old_LDFLAGS="$LDFLAGS"
|
|
||||||
CFLAGS="$CFLAGS $1"
|
|
||||||
CPPFLAGS="$CPPFLAGS $2"
|
|
||||||
LDFLAGS="$LDFLAGS $3"
|
|
||||||
])
|
])
|
||||||
|
|
||||||
dnl UL_RESTORE_FLAGS()
|
dnl UL_RESTORE_LIBS()
|
||||||
dnl
|
dnl
|
||||||
dnl Restores CFLAGS, CPPFLAGS and LDFLAG previously saved by UL_SET_FLAGS()
|
dnl Restores LIBS previously saved by UL_SET_LIBS()
|
||||||
dnl
|
dnl
|
||||||
AC_DEFUN([UL_RESTORE_FLAGS], [
|
AC_DEFUN([UL_RESTORE_LIBS], [
|
||||||
CFLAGS="$old_CFLAGS"
|
LIBS="$old_LIBS"
|
||||||
CPPFLAGS="$old_CPPFLAGS"
|
|
||||||
LDFLAGS="$old_LDFLAGS"
|
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue