[yap] Correct RPATH
Petr Pisar
ppisar at fedoraproject.org
Tue Jan 4 10:46:41 UTC 2011
commit ee2d16d5686c8bfbedb9d355aa525746a0c286ab
Author: Petr Písař <ppisar at redhat.com>
Date: Mon Jan 3 16:17:58 2011 +0100
Correct RPATH
The unversioned library file is needed while linking plug-ins at compilation.
The versioned library file is needed while compiling some plug-ins as
just-compiled yap interpreted is used for it.
yap.spec | 23 ++++++++++++++---------
1 files changed, 14 insertions(+), 9 deletions(-)
---
diff --git a/yap.spec b/yap.spec
index 0aecbfc..b0ae1de 100644
--- a/yap.spec
+++ b/yap.spec
@@ -70,18 +70,24 @@ Documentation for Yap.
%patch5 -p1 -b .do_not_install_readme
%patch6 -p1 -b .non_executable_info
%patch7 -p1 -b .do_not_install_info_index
+
+# remove redundant RPATH
+sed -i 's/-Wl,-R\(,\)\{0,1\}\\$(LIBDIR)//' configure.in
+# transform RPATH into RUN_PATH. Private libraries dlopen()ed depend each on
+# other
+sed -i 's/-Wl,-R/-Wl,--enable-new-dtags,-R/g' configure.in
+
# Regerenate configure because of patching
autoconf
# chr and clpqr are optional and they are a copy from SWI Prolog
# TODO: Bundle chr and clpqr libraries: cp %%{SOURCE1} LGPL/chr
-# remove redundant rpath
-sed -i '/-Wl,-R/d' configure
-# add soname to library
-sed -i 's/\(@YAPLIB@\)/\1.%{version}/g' Makefile.in
-sed -i 's/\(@DYNYAPLIB@\)/\1.%{version}/g' Makefile.in
-sed -i 's/\(@YAPLIB_LD@\)/\1 -Wl,-soname=@YAPLIB at .%{version} /g' Makefile.in
+# Add soname to library and symlink from unversioned to versioned one
+sed -i \
+ -e '/@YAPLIB_LD@/ s/\(-o @YAPLIB@\)\(.*\)/-Wl,-soname=@YAPLIB at .%{version} \1.%{version}\2\n\tln -s @YAPLIB at .%{version} @YAPLIB@/' \
+ -e '/@INSTALL_DLLS at .* @YAPLIB@/ s/\(@YAPLIB@\)\(.*\)/\1.%{version}\2\n\t at LN_S@ @YAPLIB at .%{version} $(DESTDIR)$(LIBDIR)\/@YAPLIB@/' \
+ Makefile.in
# TODO: Bumdle SWI chr and clpqr libraries
## Hack LGPL/chr build environment to run just build interpreter
@@ -141,8 +147,6 @@ make DESTDIR=$RPM_BUILD_ROOT install_info
chmod 0644 $RPM_BUILD_ROOT%{_datadir}/Yap/pl/*
chmod 0644 $RPM_BUILD_ROOT%{_includedir}/Yap/*
-(cd $RPM_BUILD_ROOT%{_libdir}; ln -sf libYap.so.%{version} libYap.so)
-
# move examples to docs dir
%global documentation docs-documentation
for P in clpbn; do
@@ -201,7 +205,7 @@ rm -rf $RPM_BUILD_ROOT
%changelog
-* Thu Dec 23 2010 Petr Pisar <ppisar at redhat.com> - 6.2.0-1
+* Mon Jan 03 2011 Petr Pisar <ppisar at redhat.com> - 6.2.0-1
- Reorder metadata in spec file
- 6.2.0 bump
- Remove uneeded Yap-creat.patch
@@ -218,6 +222,7 @@ rm -rf $RPM_BUILD_ROOT
- Package clpbn examples
- Fix Source URL
- Clean exported Requires
+- Correct RPATH
* Wed Dec 08 2010 Petr Pisar <ppisar at redhat.com> - 5.1.3-3
- Hack SWI-compatible libraries build system to be compilable (bug #660965)
More information about the scm-commits
mailing list