Commit 56d96e2260ada51e31cceded0dc9b46937c0cb64

Authored by Jay Berkenbilt
1 parent bed165c9

Add --disable-rpath to configure (fixes #422)

ChangeLog
  1 +2020-10-20 Jay Berkenbilt <ejb@ql.org>
  2 +
  3 + * Build option: add --disable-rpath option to ./configure, which
  4 + disables passing -rpath to the linker when building shared
  5 + libraries with libtool. Fixes #422.
  6 +
1 2020-10-18 Jay Berkenbilt <ejb@ql.org> 7 2020-10-18 Jay Berkenbilt <ejb@ql.org>
2 8
3 * Note that InputSource::unreadCh is deprecated and will be 9 * Note that InputSource::unreadCh is deprecated and will be
@@ -6,7 +6,6 @@ Candidates for upcoming release @@ -6,7 +6,6 @@ Candidates for upcoming release
6 * Add --warning-exit-0 option. Search for --no-warn in the docs. 6 * Add --warning-exit-0 option. Search for --no-warn in the docs.
7 7
8 * Easy build/test 8 * Easy build/test
9 - * #422: disable rpath when building RPM  
10 * #352: building standalone executables (lambda layer) 9 * #352: building standalone executables (lambda layer)
11 * #460: potential malware in fuzzer seed corpus 10 * #460: potential malware in fuzzer seed corpus
12 * Consider building workflow on a schedule to detect build rot. This 11 * Consider building workflow on a schedule to detect build rot. This
autoconf.mk.in
@@ -23,6 +23,7 @@ LIBS=@LIBS@ @@ -23,6 +23,7 @@ LIBS=@LIBS@
23 CPPFLAGS=@CPPFLAGS@ 23 CPPFLAGS=@CPPFLAGS@
24 CXX=@CXX@ 24 CXX=@CXX@
25 CXXFLAGS=@CXXFLAGS@ $(CXXWFLAGS) $(WFLAGS) 25 CXXFLAGS=@CXXFLAGS@ $(CXXWFLAGS) $(WFLAGS)
  26 +RPATH=@RPATH@
26 AR=@AR@ 27 AR=@AR@
27 RANLIB=@RANLIB@ 28 RANLIB=@RANLIB@
28 DLLTOOL=@DLLTOOL@ 29 DLLTOOL=@DLLTOOL@
autofiles.sums
1 -d2cb3f80935a7e6e265a04da6ba9c0df4eabae3de33c6a48384a9fa50a15143b configure.ac 1 +cc3c7947646412e7c3152c3ef238226ede1c2199328a38df93debee26184b087 configure.ac
2 d3f9ee6f6f0846888d9a10fd3dad2e4b1258be84205426cf04d7cef02d61dad7 aclocal.m4 2 d3f9ee6f6f0846888d9a10fd3dad2e4b1258be84205426cf04d7cef02d61dad7 aclocal.m4
3 cf2c764639c4c94abc183a0976eca6ae500b80790ea25e3d0af97b23587363b7 libqpdf/qpdf/qpdf-config.h.in 3 cf2c764639c4c94abc183a0976eca6ae500b80790ea25e3d0af97b23587363b7 libqpdf/qpdf/qpdf-config.h.in
4 5297971a0ef90bcd5563eb3f7127a032bb76d3ae2af7258bf13479caf8983a60 m4/ax_cxx_compile_stdcxx.m4 4 5297971a0ef90bcd5563eb3f7127a032bb76d3ae2af7258bf13479caf8983a60 m4/ax_cxx_compile_stdcxx.m4
configure
@@ -670,6 +670,7 @@ PKG_CONFIG @@ -670,6 +670,7 @@ PKG_CONFIG
670 WINDOWS_WORDSIZE 670 WINDOWS_WORDSIZE
671 IS_32BIT 671 IS_32BIT
672 RANDOM_DEVICE 672 RANDOM_DEVICE
  673 +RPATH
673 LT_SONAME 674 LT_SONAME
674 LT_AGE 675 LT_AGE
675 LT_REVISION 676 LT_REVISION
@@ -775,6 +776,7 @@ with_aix_soname @@ -775,6 +776,7 @@ with_aix_soname
775 with_gnu_ld 776 with_gnu_ld
776 with_sysroot 777 with_sysroot
777 enable_libtool_lock 778 enable_libtool_lock
  779 +enable_rpath
778 enable_insecure_random 780 enable_insecure_random
779 enable_os_secure_random 781 enable_os_secure_random
780 with_random 782 with_random
@@ -1458,6 +1460,8 @@ Optional Features: @@ -1458,6 +1460,8 @@ Optional Features:
1458 --enable-fast-install[=PKGS] 1460 --enable-fast-install[=PKGS]
1459 optimize for fast installation [default=yes] 1461 optimize for fast installation [default=yes]
1460 --disable-libtool-lock avoid locking (might break parallel builds) 1462 --disable-libtool-lock avoid locking (might break parallel builds)
  1463 + --enable-rpath whether to pass -rpath to the linker when building
  1464 + libraries
1461 --enable-insecure-random 1465 --enable-insecure-random
1462 whether to use stdlib's random number generator 1466 whether to use stdlib's random number generator
1463 (default is no) 1467 (default is no)
@@ -16213,6 +16217,29 @@ LT_REVISION=1 @@ -16213,6 +16217,29 @@ LT_REVISION=1
16213 LT_SONAME=$(expr $LT_CURRENT - $LT_AGE) 16217 LT_SONAME=$(expr $LT_CURRENT - $LT_AGE)
16214 16218
16215 16219
  16220 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for whether to use -rpath" >&5
  16221 +$as_echo_n "checking for whether to use -rpath... " >&6; }
  16222 +# Check whether --enable-rpath was given.
  16223 +if test "${enable_rpath+set}" = set; then :
  16224 + enableval=$enable_rpath; if test "$enableval" = "yes"; then
  16225 + qpdf_USE_RPATH=1;
  16226 + else
  16227 + qpdf_USE_RPATH=0;
  16228 + fi
  16229 +else
  16230 + qpdf_USE_RPATH=1
  16231 +fi
  16232 +
  16233 +if test "$qpdf_USE_RPATH" = "1"; then
  16234 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
  16235 +$as_echo "yes" >&6; }
  16236 + RPATH='-rpath $(libdir)'
  16237 +else
  16238 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
  16239 +$as_echo "no" >&6; }
  16240 +fi
  16241 +
  16242 +
16216 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -fvisibility=hidden" >&5 16243 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -fvisibility=hidden" >&5
16217 $as_echo_n "checking for -fvisibility=hidden... " >&6; } 16244 $as_echo_n "checking for -fvisibility=hidden... " >&6; }
16218 try_flags=-fvisibility=hidden 16245 try_flags=-fvisibility=hidden
configure.ac
@@ -61,6 +61,23 @@ AC_SUBST(LT_AGE) @@ -61,6 +61,23 @@ AC_SUBST(LT_AGE)
61 LT_SONAME=$(expr $LT_CURRENT - $LT_AGE) 61 LT_SONAME=$(expr $LT_CURRENT - $LT_AGE)
62 AC_SUBST(LT_SONAME) 62 AC_SUBST(LT_SONAME)
63 63
  64 +AC_MSG_CHECKING(for whether to use -rpath)
  65 +AC_ARG_ENABLE(rpath,
  66 + AS_HELP_STRING([--enable-rpath],
  67 + [whether to pass -rpath to the linker when building libraries]),
  68 + [if test "$enableval" = "yes"; then
  69 + qpdf_USE_RPATH=1;
  70 + else
  71 + qpdf_USE_RPATH=0;
  72 + fi], [qpdf_USE_RPATH=1])
  73 +if test "$qpdf_USE_RPATH" = "1"; then
  74 + AC_MSG_RESULT(yes)
  75 + RPATH='-rpath $(libdir)'
  76 +else
  77 + AC_MSG_RESULT(no)
  78 +fi
  79 +AC_SUBST(RPATH)
  80 +
64 AC_MSG_CHECKING(for -fvisibility=hidden) 81 AC_MSG_CHECKING(for -fvisibility=hidden)
65 try_flags=-fvisibility=hidden 82 try_flags=-fvisibility=hidden
66 oCXXFLAGS=$CXXFLAGS 83 oCXXFLAGS=$CXXFLAGS
make/libtool.mk
@@ -95,7 +95,7 @@ define makelib @@ -95,7 +95,7 @@ define makelib
95 $(LIBTOOL) --mode=link \ 95 $(LIBTOOL) --mode=link \
96 $(CXX) $(CXXFLAGS) $(LD_VERSION_FLAGS) \ 96 $(CXX) $(CXXFLAGS) $(LD_VERSION_FLAGS) \
97 -o $(2) $(1) $(3) $(4) \ 97 -o $(2) $(1) $(3) $(4) \
98 - -rpath $(libdir) -version-info $(5):$(6):$(7) -no-undefined 98 + $(RPATH) -version-info $(5):$(6):$(7) -no-undefined
99 endef 99 endef
100 100
101 # 1 2 3 4 5 101 # 1 2 3 4 5