2 # Prints information for maintaining config.rpath.
4 # The caller should set the environment variables
5 # top_srcdir, srcdir, CONFIG_SHELL, CC, GCC, LDFLAGS, LD, with_gnu_ld, host.
7 echo "=============== rpathcfg for $host ==============="
9 echo "--------------- config.rpath output ---------------"
10 ${CONFIG_SHELL-/bin/sh} $srcdir/..
/config.rpath
"$host" |
sed -e 's/^acl_cv_//'
11 echo "--------------- experimentally determined ---------------"
13 global_top_auxdir
=`cd "$top_srcdir"/build-aux && pwd`
14 export global_top_auxdir
16 test -d tstdir || mkdir tstdir
18 rm -rf tstprefix tstdir
/build tstlib
20 eval `${CONFIG_SHELL-/bin/sh} $srcdir/../config.rpath "$host" | grep '^acl_cv_wl='`
23 # Static library suffix (normally "a").
26 (cd $srcdir/rpathx
&& tar cf
- *) |
(cd tstdir
/build
&& tar xf
-)
28 ${CONFIG_SHELL-/bin/sh} .
/configure
--disable-shared --prefix=$builddir/tstprefix
> configure.log
2>&1
30 make install > install.log
2>&1
39 *) libext
=`echo $f | sed -e 's/^.*\.//'`;;
41 if test -n "$libext"; then
48 # Shared library suffix (normally "so").
51 (cd $srcdir/rpathx
&& tar cf
- *) |
(cd tstdir
/build
&& tar xf
-)
53 ${CONFIG_SHELL-/bin/sh} .
/configure
--disable-static --prefix=$builddir/tstprefix
> configure.log
2>&1
55 make install > install.log
2>&1
59 cd tstprefix
/lib ||
exit 1
64 *) shlibext
=`echo $f | sed -e 's/^.*\.//'`;;
66 if test -n "$shlibext"; then
73 # Prepare hardcoding tests.
76 (cd $srcdir/rpathx
&& tar cf
- *) |
(cd tstdir
/build
&& tar xf
-)
78 ${CONFIG_SHELL-/bin/sh} .
/configure
--disable-static --prefix=$builddir/tstprefix
> configure.log
2>&1
80 make install > install.log
2>&1
84 # Flag to hardcode \$libdir into a binary during linking.
85 # This must work even if \$libdir does not exist.
86 hardcode_libdir_flag_spec
=
90 '-rpath $libdir' '${wl}-rpath ${wl}$libdir' \
91 '${wl}+b ${wl}$libdir' \
92 '${wl}-R $libdir:/usr/lib:/lib' \
93 '${wl}-blibpath:$libdir:/usr/lib:/lib' \
94 '${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib' \
96 mv tstprefix
/lib tstlib
97 libdir
=`pwd`/tstprefix
/lib
100 echo "$CC $LDFLAGS $srcdir/rpathlx/usex.c tstlib/librpathx.$shlibext $flag -o a.out" 1>&2
101 $CC $LDFLAGS $srcdir/rpathlx
/usex.c tstlib
/librpathx.
$shlibext $flag -o a.out
103 mv tstlib tstprefix
/lib
104 echo "ok, running created a.out." 1>&2
106 hardcode_libdir_flag_spec
="$hardcode_libdir_flag_spec$spec
110 mv tstlib tstprefix
/lib
115 # Whether we need a single -rpath flag with a separated argument.
116 hardcode_libdir_separator
=
117 if test -n "$hardcode_libdir_flag_spec"; then
118 spec
=`echo "$hardcode_libdir_flag_spec" | sed -e '2,$d'`
119 # Try with multiple -rpath flags.
120 mv tstprefix
/lib tstlib
121 libdir
=`pwd`/tstprefix
/lib
126 echo "$CC $LDFLAGS $srcdir/rpathlx/usex.c tstlib/librpathx.$shlibext $flag1 $flag2 -o a.out" 1>&2
127 $CC $LDFLAGS $srcdir/rpathlx
/usex.c tstlib
/librpathx.
$shlibext $flag1 $flag2 -o a.out
129 mv tstlib tstprefix
/lib
130 echo "ok, running created a.out." 1>&2
132 hardcode_libdir_separator
=NONE
135 mv tstlib tstprefix
/lib
138 if test -z "$hardcode_libdir_separator"; then
139 # Try with a single -rpath flag.
140 mv tstprefix
/lib tstlib
141 libdir
=`pwd`/tstprefix
/lib
:/tmp
144 echo "$CC $LDFLAGS $srcdir/rpathlx/usex.c tstlib/librpathx.$shlibext $flag -o a.out" 1>&2
145 $CC $LDFLAGS $srcdir/rpathlx
/usex.c tstlib
/librpathx.
$shlibext $flag -o a.out
147 mv tstlib tstprefix
/lib
148 echo "ok, running created a.out." 1>&2
150 hardcode_libdir_separator
=:
153 mv tstlib tstprefix
/lib
157 if test -z "$hardcode_libdir_separator"; then
158 echo "hardcode_libdir_separator test failed!" 1>&2
160 if test "$hardcode_libdir_separator" = NONE
; then
161 hardcode_libdir_separator
=
166 # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
170 echo "$CC $LDFLAGS $srcdir/rpathlx/usex.c tstprefix/lib/librpathx.$shlibext -o a.out" 1>&2
171 $CC $LDFLAGS $srcdir/rpathlx
/usex.c tstprefix
/lib
/librpathx.
$shlibext -o a.out
173 echo "ok, running created a.out." 1>&2
180 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
184 echo "$CC $LDFLAGS $srcdir/rpathlx/usex.c -Ltstprefix/lib -lrpathx -o a.out" 1>&2
185 $CC $LDFLAGS $srcdir/rpathlx
/usex.c
-Ltstprefix/lib
-lrpathx -o a.out
187 echo "ok, running created a.out." 1>&2
195 rm -rf tstprefix tstdir
197 sed_quote_subst
='s/\(["`$\\]\)/\\\1/g'
198 escaped_hardcode_libdir_flag_spec
=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
199 escaped_sys_lib_search_path_spec
=`echo "X$sys_lib_search_path_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
200 escaped_sys_lib_dlsearch_path_spec
=`echo "X$sys_lib_dlsearch_path_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
204 # Static library suffix (normally "a").
207 # Shared library suffix (normally "so").
210 # Flag to hardcode \$libdir into a binary during linking.
211 # This must work even if \$libdir does not exist.
212 hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
214 # Whether we need a single -rpath flag with a separated argument.
215 hardcode_libdir_separator="$hardcode_libdir_separator"
217 # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
219 hardcode_direct="$hardcode_direct"
221 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
223 hardcode_minus_L="$hardcode_minus_L"