From: Alexandre Oliva Date: Fri, 19 Mar 1999 18:43:22 +0000 (+0000) Subject: * demo/Makefile.am (hc-direct, hc-libpath, hc-minusL): link with X-Git-Tag: release-1-3~111 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=48ef966f1e292874c21dc8c0172c406ba745fc96;p=thirdparty%2Flibtool.git * demo/Makefile.am (hc-direct, hc-libpath, hc-minusL): link with $$hardcode_libdir_flag_spec, if available, with libdir=$(libdir), to make sure the hardcode_* variables will produce the expected results even in the presence of a hardcoding flag; depend on libhello.la having been installed already (hc-libflag): link with the installed library, but try to hard-code the uninstalled one * doc/libtool.texi: document the changes --- diff --git a/ChangeLog b/ChangeLog index dfe7536ec..eec333710 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 1999-03-19 Alexandre Oliva + * demo/Makefile.am (hc-direct, hc-libpath, hc-minusL): link with + $$hardcode_libdir_flag_spec, if available, with libdir=$(libdir), + to make sure the hardcode_* variables will produce the expected + results even in the presence of a hardcoding flag; depend on + libhello.la having been installed already + (hc-libflag): link with the installed library, but try to + hard-code the uninstalled one + * doc/libtool.texi: document the changes + * tests/*.test: when a test fails, skip tests that depend on it. If a certain configuration is not supported, skip all its tests. diff --git a/demo/Makefile.am b/demo/Makefile.am index 8b5413b39..1df6fec29 100644 --- a/demo/Makefile.am +++ b/demo/Makefile.am @@ -65,7 +65,7 @@ $(srcdir)/acinclude.m4: # Test programs to see what gets hardcoded. .PHONY: hardcode hardcode: $(hardcode_tests) -hc-direct: $(hell_OBJECTS) $(hell_DEPENDENCIES) +hc-direct: $(hell_OBJECTS) $(hell_DEPENDENCIES) $(libdir)/libhello.la @rm -f hc-direct @echo "You may ignore any linking errors from the following command:" @shlib=./$(objdir)/libhello.a; \ @@ -73,41 +73,41 @@ hc-direct: $(hell_OBJECTS) $(hell_DEPENDENCIES) for lib in $$library_names; do \ shlib="./$(objdir)/$$lib"; \ done; \ - echo "$(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) $$shlib -lm || echo unsupported > $@"; \ - eval "$(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) $$shlib -lm || echo unsupported > $@" - -# We need to create an alias for $(objdir) so that this test works regardless -# of $hardcode_minus_L -hc-libflag: $(hell_OBJECTS) $(hell_DEPENDENCIES) - rm -rf hc-libflag _hclibs - mkdir _hclibs - objdir=$(objdir); cd _hclibs && for lib in ../$$objdir/libhello*; do \ - $(LN_S) $$lib `echo "$$lib" | sed 's%^.*/%%'` || exit 1; \ - done - @eval `egrep -e '^(hardcode_.*|wl)=' ../libtool`; \ + eval `egrep -e '^(hardcode_.*|wl)=' libtool`; \ + libdir=$(libdir); \ + flag=`eval echo \"$$hardcode_libdir_flag_spec\"`; \ + echo "$(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) $$shlib -lm $$flag || echo unsupported > $@"; \ + eval "$(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) $$shlib -lm $$flag || echo unsupported > $@" + +hc-libflag: $(hell_OBJECTS) $(hell_DEPENDENCIES) $(libdir)/libhello.la + @eval `egrep -e '^(hardcode_.*|wl)=' libtool`; \ libdir=`pwd`/$(objdir); \ flag=`eval echo \"$$hardcode_libdir_flag_spec\"`; \ if test -z "$$flag"; then \ echo "echo unsupported > $@"; \ echo unsupported > $@ || status="$$?"; \ else \ - echo "$(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) $$flag -L./_hclibs -lhello -lm"; \ - $(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) $$flag -L./_hclibs -lhello -lm || status="$$?"; \ + echo "$(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) $$flag -L$(libdir) -lhello -lm"; \ + $(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) $$flag -L$(libdir) -lhello -lm || status="$$?"; \ fi; \ - echo "rm -rf _hclibs"; \ - rm -rf _hclibs; \ exit $$status -hc-libpath: $(hell_OBJECTS) $(hell_DEPENDENCIES) +hc-libpath: $(hell_OBJECTS) $(hell_DEPENDENCIES) $(libdir)/libhello.la @rm -f hc-libpath @echo "You may ignore any linking errors from the following command:" - @eval `egrep -e '^shlibpath_var=' ../libtool`; \ - echo "$$shlibpath_var=./$(objdir) $(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) -lhello -lm || echo unsupported > $@"; \ - eval "$$shlibpath_var=./$(objdir) $(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) -lhello -lm || echo unsupported > $@" + @eval `egrep -e '^(shlibpath_var|hardcode_.*|wl)=' libtool`; \ + libdir=$(libdir); \ + flag=`eval echo \"$$hardcode_libdir_flag_spec\"`; \ + echo "$$shlibpath_var=./$(objdir) $(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) -lhello -lm $$flag || echo unsupported > $@"; \ + eval "$$shlibpath_var=./$(objdir) $(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) -lhello -lm $$flag || echo unsupported > $@" hc-minusL: $(hell_OBJECTS) $(hell_DEPENDENCIES) @rm -f hc-minusL - $(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) -L./$(objdir) -lhello -lm + @eval `egrep -e '^(hardcode_.*|wl)=' libtool`; \ + libdir=$(libdir); \ + flag=`eval echo \"$$hardcode_libdir_flag_spec\"`; \ + echo "$(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) -L./$(objdir) -lhello -lm $$flag || echo unsupported > $@"; \ + eval "$(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) -L./$(objdir) -lhello -lm $$flag || echo unsupported > $@" $(OBJECTS): libtool libtool: $(LIBTOOL_DEPS) diff --git a/doc/libtool.texi b/doc/libtool.texi index be24a308c..d787c87b1 100644 --- a/doc/libtool.texi +++ b/doc/libtool.texi @@ -3731,12 +3731,16 @@ or if they need to be relinked. @defvar hardcode_direct Set to @samp{yes} or @samp{no}, depending on whether the linker hardcodes directories if a library is directly specified on the command -line (such as @samp{@var{dir}/lib@var{name}.a}). +line (such as @samp{@var{dir}/lib@var{name}.a}) when +@var{hardcode_libdir_flag_spec} is specified. @end defvar @defvar hardcode_libdir_flag_spec Flag to hardcode a @var{libdir} variable into a binary, so that the dynamic linker searches @var{libdir} for shared libraries at runtime. +If it is empty, libtool will try to use some other hardcoding mechanism. +If everything else fails, it will fallback to +@samp{hardcode_action=relink}. @end defvar @defvar hardcode_libdir_separator @@ -3748,15 +3752,15 @@ arguments to that flag. @defvar hardcode_minus_L Set to @samp{yes} or @samp{no}, depending on whether the linker hardcodes directories specified by @samp{-L} flags into the resulting -executable. +executable when @var{hardcode_libdir_flag_spec} is specified. @end defvar @defvar hardcode_shlibpath_var Set to @samp{yes} or @samp{no}, depending on whether the linker hardcodes directories by writing the contents of @samp{$shlibpath_var} -into the resulting executable. Set to @samp{unsupported} if directories -specified by @samp{$shlibpath_var} are searched at run time, but not at -link time. +into the resulting executable when @var{hardcode_libdir_flag_spec} is +specified. Set to @samp{unsupported} if directories specified by +@samp{$shlibpath_var} are searched at run time, but not at link time. @end defvar @defvar host