summaryrefslogtreecommitdiff
path: root/init.cfg
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2020-03-01 03:03:59 +0100
committerPádraig Brady <P@draigBrady.com>2020-03-01 10:56:12 +0000
commite840c7868554e01afeac5a8c5ad249524d1f08b2 (patch)
treedd636c1ece8b33454212cc25cee3ab572b5d1377 /init.cfg
parentea1c1b75153740355fd54c4455237be1f8cbd427 (diff)
downloadcoreutils-e840c7868554e01afeac5a8c5ad249524d1f08b2.tar.gz
tests: enable 4 more tests to be executed on FreeBSD
* init.cfg (gcc_shared_libs_): New variable. (gcc_shared_): Use it, instead of hardcoding -ldl. (require_gcc_shared_): Determine the suitable value for gcc_shared_libs_.
Diffstat (limited to 'init.cfg')
-rw-r--r--init.cfg19
1 files changed, 16 insertions, 3 deletions
diff --git a/init.cfg b/init.cfg
index f7a3fab3a..2009e294e 100644
--- a/init.cfg
+++ b/init.cfg
@@ -576,6 +576,9 @@ require_sparse_support_()
fi
}
+# Libraries needed when we compile a shared library.
+gcc_shared_libs_=
+
# Compile a shared lib using the GCC options for doing so.
# Pass input and output file as parameters respectively.
# Any other optional parmeters are passed to $CC.
@@ -585,7 +588,7 @@ gcc_shared_()
local out=$2
shift 2 || return 1
- $CC -Wall -shared --std=gnu99 -fPIC -O2 $* "$in" -o "$out" -ldl
+ $CC -Wall -shared --std=gnu99 -fPIC -O2 $* "$in" -o "$out" $gcc_shared_libs_
}
# There are a myriad of ways to build shared libs,
@@ -593,8 +596,18 @@ gcc_shared_()
# on platforms that support building them as follows.
require_gcc_shared_()
{
- gcc_shared_ '-' 'd.so' -xc < /dev/null 2>&1 \
- || skip_ '$CC -shared ... failed to build a shared lib'
+ # Try two different values for gcc_shared_libs_.
+ gcc_shared_libs_='-ldl'
+ if gcc_shared_ '-' 'd.so' -xc < /dev/null 2>&1; then
+ :
+ else
+ gcc_shared_libs_=
+ if gcc_shared_ '-' 'd.so' -xc < /dev/null 2>&1; then
+ :
+ else
+ skip_ '$CC -shared ... failed to build a shared lib'
+ fi
+ fi
rm -f d.so
}