Skip to content

Commit ad3c452

Browse files
diabonasWilliam Roberts
authored and
William Roberts
committed
build: remove Gnulib dependency
Gnulib is not packaged in some distros (i.e. Arch Linux and openSUSE) and furthermore Gnulib explicitly states it's intended to be copied into source trees: "Gnulib takes a different approach. Its components are intended to be shared at the source level, rather than being a library that gets built, installed, and linked against. Thus, there is no distribution tarball; the idea is to copy files from Gnulib into your own source tree." https://www.gnu.org/software/gnulib/ Therefore add back the ld-version-script.m4 and update the installation instructions to no longer recommend it. Signed-off-by: Joshua Lock <[email protected]> Signed-off-by: Jonas Witschel <[email protected]>
1 parent fc20cb6 commit ad3c452

File tree

6 files changed

+53
-18
lines changed

6 files changed

+53
-18
lines changed

Diff for: .ci/coverity.run

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ fi
2121

2222
echo "Performing build with Coverity Scan"
2323
rm -fr $TRAVIS_BUILD_DIR/cov-int
24-
./bootstrap -I /usr/share/gnulib/m4 && ./configure && make clean
24+
./bootstrap && ./configure && make clean
2525
cov-build --dir $TRAVIS_BUILD_DIR/cov-int make -j $(nproc)
2626

2727
echo "Collecting Coverity data for submission"

Diff for: .ci/docker.run

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ else #GCC
7171
fi
7272

7373
# Bootstrap the project
74-
./bootstrap -I /usr/share/gnulib/m4
74+
./bootstrap
7575

7676
# clang has asan enabled with options exported that fail
7777
# make distcheck, so only do this with gcc.

Diff for: .ci/download-deps.sh

-9
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,6 @@
55
# All rights reserved.
66
#
77

8-
function install_m4_deps() {
9-
# all of our projects need auto-conf archive up-to-date and
10-
# distros tend to be outdated.
11-
mkdir -p m4
12-
cp /usr/share/gnulib/m4/ld-version-script.m4 m4/
13-
}
14-
158
function get_deps() {
169

1710
# The list order is important and thus we can't use the keys of the dictionary as order is not preserved.
@@ -33,8 +26,6 @@ function get_deps() {
3326

3427
pushd "$p"
3528

36-
install_m4_deps
37-
3829
./bootstrap
3930
./configure $configure_flags
4031
make -j$(nproc) install

Diff for: .gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,5 @@ test-suite.log
7272

7373
nbproject/
7474
build/
75-
m4/
75+
m4/*
76+
!m4/ld-version-script.m4

Diff for: docs/BUILDING.md

+1-6
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@ The project depends on:
2020
Others may not work, some distros package versions too old. Either install or just copy the contents of the
2121
autoconf-archive's m4 directory to the m4 subdirectory of the tpm2-pkcs11 project. If the m4 folder is not
2222
present, simply create it with mkdir.
23-
10. [gnulib](https://www.gnu.org/software/gnulib/): For ld-version-script.m4.
24-
On Ubuntu, the ld-version-script.m4 file does not resolve in it's default location under /usr/share/gnulib/m4.
25-
During bootstrap one can pass arguments to autoreconf and specify additional search paths via `-I`.
26-
For example:
27-
```./bootstrap -I /usr/share/gnulib/m4```
2823

2924
### Notes:
3025
The tpm2-tss and tpm2-tools projects must be obtained via source. Packaged versions existing
@@ -41,7 +36,7 @@ in known package managers are likely too old.
4136
Run the `bootstrap` command.
4237

4338
```sh
44-
$ ./bootstrap -I /usr/share/gnulib/m4
39+
$ ./bootstrap
4540
```
4641

4742
## Step 3 - Configuring

Diff for: m4/ld-version-script.m4

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# ld-version-script.m4 serial 4
2+
dnl Copyright (C) 2008-2019 Free Software Foundation, Inc.
3+
dnl This file is free software; the Free Software Foundation
4+
dnl gives unlimited permission to copy and/or distribute it,
5+
dnl with or without modifications, as long as this notice is preserved.
6+
7+
dnl From Simon Josefsson
8+
9+
# FIXME: The test below returns a false positive for mingw
10+
# cross-compiles, 'local:' statements does not reduce number of
11+
# exported symbols in a DLL. Use --disable-ld-version-script to work
12+
# around the problem.
13+
14+
# gl_LD_VERSION_SCRIPT
15+
# --------------------
16+
# Check if LD supports linker scripts, and define automake conditional
17+
# HAVE_LD_VERSION_SCRIPT if so.
18+
AC_DEFUN([gl_LD_VERSION_SCRIPT],
19+
[
20+
AC_ARG_ENABLE([ld-version-script],
21+
[AS_HELP_STRING([--enable-ld-version-script],
22+
[enable linker version script (default is enabled when possible)])],
23+
[have_ld_version_script=$enableval],
24+
[AC_CACHE_CHECK([if LD -Wl,--version-script works],
25+
[gl_cv_sys_ld_version_script],
26+
[gl_cv_sys_ld_version_script=no
27+
save_LDFLAGS=$LDFLAGS
28+
LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map"
29+
echo foo >conftest.map
30+
AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
31+
[],
32+
[cat > conftest.map <<EOF
33+
VERS_1 {
34+
global: sym;
35+
};
36+
37+
VERS_2 {
38+
global: sym;
39+
} VERS_1;
40+
EOF
41+
AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
42+
[gl_cv_sys_ld_version_script=yes])])
43+
rm -f conftest.map
44+
LDFLAGS=$save_LDFLAGS])
45+
have_ld_version_script=$gl_cv_sys_ld_version_script])
46+
AM_CONDITIONAL([HAVE_LD_VERSION_SCRIPT],
47+
[test "$have_ld_version_script" = yes])
48+
])

0 commit comments

Comments
 (0)