Skip to content

Commit 47c16d7

Browse files
committed
rust: avoid clobbering LIBS
Save LIBS around calls to AC_SEARCH_LIBS to avoid clobbering $LIBS. ChangeLog: * configure: Regenerate. * configure.ac: Save LIBS around calls to AC_SEARCH_LIBS. Signed-off-by: Marc Poulhiès <[email protected]> Reviewed-by: Thomas Schwinge <[email protected]> Tested-by: Thomas Schwinge <[email protected]>
1 parent 177660e commit 47c16d7

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

configure

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8829,9 +8829,12 @@ fi
88298829

88308830
# Rust requires -ldl and -lpthread if you are using an old glibc that does not include them by
88318831
# default, so we check for them here
8832-
8832+
# We are doing the test here and not in the gcc/configure to be able to nicely disable the
8833+
# build of the Rust frontend in case a dep is missing.
88338834
missing_rust_dynlibs=none
88348835

8836+
save_LIBS="$LIBS"
8837+
LIBS=
88358838
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5
88368839
$as_echo_n "checking for library containing dlopen... " >&6; }
88378840
if ${ac_cv_search_dlopen+:} false; then :
@@ -8944,16 +8947,14 @@ if test "$ac_res" != no; then :
89448947

89458948
fi
89468949

8950+
CRAB1_LIBS="$LIBS"
8951+
LIBS="$save_LIBS"
89478952

8948-
if test $ac_cv_search_dlopen = -ldl; then
8949-
CRAB1_LIBS="$CRAB1_LIBS -ldl"
8950-
elif test $ac_cv_search_dlopen = no; then
8953+
if test "$ac_cv_search_dlopen" = no; then
89518954
missing_rust_dynlibs="libdl"
89528955
fi
89538956

8954-
if test $ac_cv_search_pthread_create = -lpthread; then
8955-
CRAB1_LIBS="$CRAB1_LIBS -lpthread"
8956-
elif test $ac_cv_search_pthread_crate = no; then
8957+
if test "$ac_cv_search_pthread_create" = no; then
89578958
missing_rust_dynlibs="$missing_rust_dynlibs, libpthread"
89588959
fi
89598960

configure.ac

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2038,21 +2038,22 @@ AC_SUBST(PICFLAG)
20382038

20392039
# Rust requires -ldl and -lpthread if you are using an old glibc that does not include them by
20402040
# default, so we check for them here
2041-
2041+
# We are doing the test here and not in the gcc/configure to be able to nicely disable the
2042+
# build of the Rust frontend in case a dep is missing.
20422043
missing_rust_dynlibs=none
20432044

2045+
save_LIBS="$LIBS"
2046+
LIBS=
20442047
AC_SEARCH_LIBS([dlopen], [dl])
20452048
AC_SEARCH_LIBS([pthread_create], [pthread])
2049+
CRAB1_LIBS="$LIBS"
2050+
LIBS="$save_LIBS"
20462051

2047-
if test $ac_cv_search_dlopen = -ldl; then
2048-
CRAB1_LIBS="$CRAB1_LIBS -ldl"
2049-
elif test $ac_cv_search_dlopen = no; then
2052+
if test "$ac_cv_search_dlopen" = no; then
20502053
missing_rust_dynlibs="libdl"
20512054
fi
20522055

2053-
if test $ac_cv_search_pthread_create = -lpthread; then
2054-
CRAB1_LIBS="$CRAB1_LIBS -lpthread"
2055-
elif test $ac_cv_search_pthread_crate = no; then
2056+
if test "$ac_cv_search_pthread_create" = no; then
20562057
missing_rust_dynlibs="$missing_rust_dynlibs, libpthread"
20572058
fi
20582059

0 commit comments

Comments
 (0)