diff options
author | Kelvin M. Klann <kmk3.code@protonmail.com> | 2022-11-30 03:34:14 -0300 |
---|---|---|
committer | Kelvin M. Klann <kmk3.code@protonmail.com> | 2022-12-03 07:53:07 -0300 |
commit | 35332bd99808335b79c01845b3dabf0d3e21fee1 (patch) | |
tree | 332a1c9719cb77e0044a2e9b1e31c635752d163e | |
parent | build: actually set LDFLAGS and LIBS in makefiles (diff) | |
download | firejail-35332bd99808335b79c01845b3dabf0d3e21fee1.tar.gz firejail-35332bd99808335b79c01845b3dabf0d3e21fee1.tar.zst firejail-35332bd99808335b79c01845b3dabf0d3e21fee1.zip |
build: move library flags from EXTRA_LDFLAGS to LIBS
LIBS is the variable that Autoconf uses to put library flags. From the
manual of GNU Autoconf (version 2.69):
> -- Variable: LDFLAGS
>
> [...]
>
> This variable's contents should contain options like '-s' and '-L'
> that affect only the behavior of the linker. Please see the
> explanation of 'CFLAGS' for what you can do if an option also
> affects other phases of the compiler.
>
> Don't use this variable to pass library names ('-l') to the linker;
> use 'LIBS' instead.
>
> -- Variable: LIBS
>
> '-l' options to pass to the linker. The default value is empty,
> but some Autoconf macros may prepend extra libraries to this
> variable if those libraries are found and provide necessary
> functions, see *note Libraries::. 'configure' uses this variable
> when linking programs to test for C, C++, Objective C, Objective
> C++, Fortran, and Go features.
-rwxr-xr-x | configure | 7 | ||||
-rw-r--r-- | configure.ac | 7 |
2 files changed, 8 insertions, 6 deletions
@@ -3334,7 +3334,7 @@ else | |||
3334 | $as_echo "yes" >&6; } | 3334 | $as_echo "yes" >&6; } |
3335 | 3335 | ||
3336 | EXTRA_CFLAGS="$EXTRA_CFLAGS $AA_CFLAGS" | 3336 | EXTRA_CFLAGS="$EXTRA_CFLAGS $AA_CFLAGS" |
3337 | EXTRA_LDFLAGS="$EXTRA_LDFLAGS $AA_LIBS" | 3337 | LIBS="$LIBS $AA_LIBS" |
3338 | 3338 | ||
3339 | fi | 3339 | fi |
3340 | 3340 | ||
@@ -3350,7 +3350,7 @@ fi | |||
3350 | if test "x$enable_selinux" = "xyes"; then : | 3350 | if test "x$enable_selinux" = "xyes"; then : |
3351 | 3351 | ||
3352 | HAVE_SELINUX="-DHAVE_SELINUX" | 3352 | HAVE_SELINUX="-DHAVE_SELINUX" |
3353 | EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lselinux" | 3353 | LIBS="$LIBS -lselinux" |
3354 | 3354 | ||
3355 | fi | 3355 | fi |
3356 | 3356 | ||
@@ -3612,7 +3612,8 @@ fi | |||
3612 | if test "x$enable_gcov" = "xyes"; then : | 3612 | if test "x$enable_gcov" = "xyes"; then : |
3613 | 3613 | ||
3614 | HAVE_GCOV="--coverage -DHAVE_GCOV" | 3614 | HAVE_GCOV="--coverage -DHAVE_GCOV" |
3615 | EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lgcov --coverage" | 3615 | EXTRA_LDFLAGS="$EXTRA_LDFLAGS --coverage" |
3616 | LIBS="$LIBS -lgcov" | ||
3616 | 3617 | ||
3617 | fi | 3618 | fi |
3618 | 3619 | ||
diff --git a/configure.ac b/configure.ac index 416d79682..556019232 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -72,7 +72,7 @@ AS_IF([test "x$enable_apparmor" = "xyes"], [ | |||
72 | HAVE_APPARMOR="-DHAVE_APPARMOR" | 72 | HAVE_APPARMOR="-DHAVE_APPARMOR" |
73 | PKG_CHECK_MODULES([AA], [libapparmor], [ | 73 | PKG_CHECK_MODULES([AA], [libapparmor], [ |
74 | EXTRA_CFLAGS="$EXTRA_CFLAGS $AA_CFLAGS" | 74 | EXTRA_CFLAGS="$EXTRA_CFLAGS $AA_CFLAGS" |
75 | EXTRA_LDFLAGS="$EXTRA_LDFLAGS $AA_LIBS" | 75 | LIBS="$LIBS $AA_LIBS" |
76 | ]) | 76 | ]) |
77 | ]) | 77 | ]) |
78 | 78 | ||
@@ -82,7 +82,7 @@ AC_ARG_ENABLE([selinux], | |||
82 | [AS_HELP_STRING([--enable-selinux], [SELinux labeling support])]) | 82 | [AS_HELP_STRING([--enable-selinux], [SELinux labeling support])]) |
83 | AS_IF([test "x$enable_selinux" = "xyes"], [ | 83 | AS_IF([test "x$enable_selinux" = "xyes"], [ |
84 | HAVE_SELINUX="-DHAVE_SELINUX" | 84 | HAVE_SELINUX="-DHAVE_SELINUX" |
85 | EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lselinux" | 85 | LIBS="$LIBS -lselinux" |
86 | ]) | 86 | ]) |
87 | 87 | ||
88 | AC_SUBST([EXTRA_CFLAGS]) | 88 | AC_SUBST([EXTRA_CFLAGS]) |
@@ -226,7 +226,8 @@ AC_ARG_ENABLE([gcov], | |||
226 | [AS_HELP_STRING([--enable-gcov], [Gcov instrumentation])]) | 226 | [AS_HELP_STRING([--enable-gcov], [Gcov instrumentation])]) |
227 | AS_IF([test "x$enable_gcov" = "xyes"], [ | 227 | AS_IF([test "x$enable_gcov" = "xyes"], [ |
228 | HAVE_GCOV="--coverage -DHAVE_GCOV" | 228 | HAVE_GCOV="--coverage -DHAVE_GCOV" |
229 | EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lgcov --coverage" | 229 | EXTRA_LDFLAGS="$EXTRA_LDFLAGS --coverage" |
230 | LIBS="$LIBS -lgcov" | ||
230 | ]) | 231 | ]) |
231 | 232 | ||
232 | HAVE_CONTRIB_INSTALL="yes" | 233 | HAVE_CONTRIB_INSTALL="yes" |