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, LIBDIRSTEM, with_gnu_ld, host.
7 if test -f $top_srcdir/build-aux/config.rpath; then
8 build_aux_dir=$top_srcdir/build-aux
10 build_aux_dir=$top_srcdir/../build-aux
13 echo "=============== rpathcfg for $host ==============="
15 echo "--------------- config.rpath output ---------------"
16 ${CONFIG_SHELL-/bin/sh} $build_aux_dir/config.rpath "$host" | sed -e 's/^acl_cv_//'
17 echo "--------------- experimentally determined ---------------"
19 global_top_auxdir=`cd "$top_srcdir"/build-aux && pwd`
20 export global_top_auxdir
23 test -d $tstdir || { mkdir tst && mkdir $tstdir; }
25 rm -rf tstprefix $tstdir/build tstlib
27 eval `${CONFIG_SHELL-/bin/sh} $build_aux_dir/config.rpath "$host" | grep '^acl_cv_wl='`
30 # Static library suffix (normally "a").
33 (cd $srcdir/rpathx && tar cf - *) | (cd $tstdir/build && tar xf -)
35 ${CONFIG_SHELL-/bin/sh} ./configure --disable-shared --prefix=$builddir/tstprefix --libdir=$builddir/tstprefix/${LIBDIRSTEM-lib} > configure.log 2>&1
37 make install > install.log 2>&1
46 *) libext=`echo $f | sed -e 's/^.*\.//'`;;
48 if test -n "$libext"; then
55 # Shared library suffix (normally "so").
58 (cd $srcdir/rpathx && tar cf - *) | (cd $tstdir/build && tar xf -)
60 ${CONFIG_SHELL-/bin/sh} ./configure --disable-static --prefix=$builddir/tstprefix --libdir=$builddir/tstprefix/${LIBDIRSTEM-lib} > configure.log 2>&1
62 make install > install.log 2>&1
66 cd tstprefix/lib || exit 1
71 *) shlibext=`echo $f | sed -e 's/^.*\.//'`;;
73 if test -n "$shlibext"; then
80 # Prepare hardcoding tests.
83 (cd $srcdir/rpathx && tar cf - *) | (cd $tstdir/build && tar xf -)
85 ${CONFIG_SHELL-/bin/sh} ./configure --disable-static --prefix=$builddir/tstprefix --libdir=$builddir/tstprefix/${LIBDIRSTEM-lib} > configure.log 2>&1
87 make install > install.log 2>&1
91 # Flag to hardcode \$libdir into a binary during linking.
92 # This must work even if \$libdir does not exist.
93 hardcode_libdir_flag_spec=
97 '-rpath $libdir' '${wl}-rpath ${wl}$libdir' \
98 '${wl}+b ${wl}$libdir' \
99 '${wl}-R $libdir:/usr/lib:/lib' \
100 '${wl}-blibpath:$libdir:/usr/lib:/lib' \
101 '${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib' \
103 mv tstprefix/lib tstlib
104 libdir=`pwd`/tstprefix/lib
107 echo "$CC $LDFLAGS $srcdir/rpathlx/usex.c tstlib/librpathx.$shlibext $flag -o a.out" 1>&2
108 $CC $LDFLAGS $srcdir/rpathlx/usex.c tstlib/librpathx.$shlibext $flag -o a.out
110 mv tstlib tstprefix/lib
111 echo "ok, running created a.out." 1>&2
113 hardcode_libdir_flag_spec="$hardcode_libdir_flag_spec$spec
117 mv tstlib tstprefix/lib
122 # Whether we need a single -rpath flag with a separated argument.
123 hardcode_libdir_separator=
124 if test -n "$hardcode_libdir_flag_spec"; then
125 spec=`echo "$hardcode_libdir_flag_spec" | sed -e '2,$d'`
126 # Try with multiple -rpath flags.
127 mv tstprefix/lib tstlib
128 libdir=`pwd`/tstprefix/lib
133 echo "$CC $LDFLAGS $srcdir/rpathlx/usex.c tstlib/librpathx.$shlibext $flag1 $flag2 -o a.out" 1>&2
134 $CC $LDFLAGS $srcdir/rpathlx/usex.c tstlib/librpathx.$shlibext $flag1 $flag2 -o a.out
136 mv tstlib tstprefix/lib
137 echo "ok, running created a.out." 1>&2
139 hardcode_libdir_separator=NONE
142 mv tstlib tstprefix/lib
145 if test -z "$hardcode_libdir_separator"; then
146 # Try with a single -rpath flag.
147 mv tstprefix/lib tstlib
148 libdir=`pwd`/tstprefix/lib:/tmp
151 echo "$CC $LDFLAGS $srcdir/rpathlx/usex.c tstlib/librpathx.$shlibext $flag -o a.out" 1>&2
152 $CC $LDFLAGS $srcdir/rpathlx/usex.c tstlib/librpathx.$shlibext $flag -o a.out
154 mv tstlib tstprefix/lib
155 echo "ok, running created a.out." 1>&2
157 hardcode_libdir_separator=:
160 mv tstlib tstprefix/lib
164 if test -z "$hardcode_libdir_separator"; then
165 echo "hardcode_libdir_separator test failed!" 1>&2
167 if test "$hardcode_libdir_separator" = NONE; then
168 hardcode_libdir_separator=
173 # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
177 echo "$CC $LDFLAGS $srcdir/rpathlx/usex.c tstprefix/lib/librpathx.$shlibext -o a.out" 1>&2
178 $CC $LDFLAGS $srcdir/rpathlx/usex.c tstprefix/lib/librpathx.$shlibext -o a.out
180 echo "ok, running created a.out." 1>&2
187 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
191 echo "$CC $LDFLAGS $srcdir/rpathlx/usex.c -Ltstprefix/lib -lrpathx -o a.out" 1>&2
192 $CC $LDFLAGS $srcdir/rpathlx/usex.c -Ltstprefix/lib -lrpathx -o a.out
194 echo "ok, running created a.out." 1>&2
202 rm -rf tstprefix $tstdir
204 sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
205 escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
206 escaped_sys_lib_search_path_spec=`echo "X$sys_lib_search_path_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
207 escaped_sys_lib_dlsearch_path_spec=`echo "X$sys_lib_dlsearch_path_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
211 # Static library suffix (normally "a").
214 # Shared library suffix (normally "so").
217 # Flag to hardcode \$libdir into a binary during linking.
218 # This must work even if \$libdir does not exist.
219 hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
221 # Whether we need a single -rpath flag with a separated argument.
222 hardcode_libdir_separator="$hardcode_libdir_separator"
224 # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
226 hardcode_direct="$hardcode_direct"
228 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
230 hardcode_minus_L="$hardcode_minus_L"