[apron] -devel also needs ocaml-camlidl-devel. Pass --as-needed to the linker to fix unused shared library d

Jerry James jjames at fedoraproject.org
Tue Nov 8 22:40:54 UTC 2011


commit 30772dc9970ef35e0a4fce8d6c3e63bf46b57979
Author: Jerry James <loganjerry at gmail.com>
Date:   Tue Nov 8 15:40:27 2011 -0700

    -devel also needs ocaml-camlidl-devel.
    Pass --as-needed to the linker to fix unused shared library dependencies.

 apron.spec |   48 +++++++++++++++++-------------------------------
 1 files changed, 17 insertions(+), 31 deletions(-)
---
diff --git a/apron.spec b/apron.spec
index 8aa7a27..f8df475 100644
--- a/apron.spec
+++ b/apron.spec
@@ -4,7 +4,7 @@
 
 Name:           apron
 Version:        0.9.10
-Release:        3%{?dist}
+Release:        4%{?dist}
 Summary:        Numerical abstract domain library
 
 # The entire package is LGPLv2+ except newpolka/mf_qsort.c and ppl/*, all of
@@ -65,6 +65,7 @@ Ocaml interface to the APRON library.
 %package -n     ocaml-%{name}-devel
 Summary:        Development files for the Ocaml interface to APRON
 Requires:       ocaml-%{name}%{?_isa} = %{version}-%{release}
+Requires:       ocaml-camlidl-devel%{?_isa}
 Requires:       ocaml-mlgmpidl-devel%{?_isa}
 Requires:       %{name}-devel%{?_isa} = %{version}-%{release}
 
@@ -83,8 +84,8 @@ sed -e "s|^# HAS_CPP.*|HAS_CPP = 1|" \
     -e "s|^APRON_PREFIX =.*|APRON_PREFIX=%{_prefix}|" \
     -e "s|^MLGMPIDL_PREFIX =.*|MLGMPIDL_PREFIX=%{_libdir}/ocaml/mlgmpidl|" \
     -e "s|^PPL_PREFIX =.*|PPL_PREFIX=%{_prefix}|" \
-    -e "s|^-fPIC -O3 -DNDEBUG|$RPM_OPT_FLAGS -fPIC -DNDEBUG|" \
-    -e "s|^-fPIC -g -O0|$RPM_OPT_FLAGS -fPIC -O0|" \
+    -e "s|^-fPIC -O3 -DNDEBUG|$RPM_OPT_FLAGS -fPIC -DNDEBUG -Wl,--as-needed|" \
+    -e "s|^-fPIC -g -O0|$RPM_OPT_FLAGS -fPIC -O0 -Wl,--as-needed|" \
 %ifarch %{ocaml_arches}
 %if !%opt
     -e "s|^HAS_OCAMLOPT.*|# HAS_OCAMLOPT = 1|" \
@@ -104,6 +105,15 @@ sed -e "s|\$(CAMLIDL_PREFIX)/lib/ocaml|%{_libdir}/ocaml|g" \
        newpolka/Makefile octagons/Makefile ppl/Makefile products/Makefile \
        test/Makefile
 
+# Remove rpaths
+for f in `find . -name Makefile`; do
+  sed -r -e 's| ?-L\$\(APRON_PREFIX\)/lib||' \
+         -e 's| ?-L\$\(GMP_PREFIX\)/lib||' \
+         -e 's| ?-L\$\(MPFR_PREFIX\)/lib||' \
+         -e 's| ?-L\$\(PPL_PREFIX\)/lib||' \
+         -i $f
+done
+
 # Fix the install location for libraries
 if [ %{__isa_bits} = "64" ]; then
   sed -e "s|\$(APRON_PREFIX)/lib|\$(APRON_PREFIX)/lib64|g" \
@@ -113,34 +123,6 @@ if [ %{__isa_bits} = "64" ]; then
          ppl/Makefile products/Makefile test/Makefile
 fi
 
-# Remove unused direct shared library dependencies and rpaths
-sed -e 's|^LIBS =.*|LIBS = -L../apron -lapron -lmpfr|' \
-    -e 's|^LIBS_DEBUG =.*|LIBS_DEBUG = -L../apron -lapron_debug -lmpfr|' \
-    -e 's|^LIBS := .*|LIBS := \$(LIBS) -lgmpxx|' \
-    -e 's|^LIBS_DEBUG := .*|LIBS_DEBUG := \$(LIBS_DEBUG) -lgmpxx|' \
-    -e 's|-lapronxx_debug|-lapronxx_debug -L../products -lap_pkgrid_debug -L../ppl -lap_ppl_debug -lgmp|' \
-    -i apronxx/Makefile
-sed -e 's|^LIBS =.*|LIBS = -L../apron -lapron -lmpfr -lgmp|' \
-    -e 's|^LIBS_DEBUG =.*|LIBS_DEBUG = -L../apron -lapron_debug -lmpfr -lgmp|'\
-    -e 's| -L$(APRON_PREFIX)/lib||' \
-    -i box/Makefile
-sed -e 's|^LIBS =.*|LIBS = -L../apron -lapron -lmpfr -lgmp|' \
-    -e 's|^LIBS_DEBUG =.*|LIBS_DEBUG = -L../apron -lapron_debug -lmpfr -lgmp|' \
-    -i mlapronidl/Makefile
-sed -e 's|^LIBS =.*|LIBS = -L../apron -lapron -lgmp|' \
-    -e 's|^LIBS_DEBUG =.*|LIBS_DEBUG = -L../apron -lapron_debug -lgmp|' \
-    -i newpolka/Makefile
-sed -e 's|^LIBS =.*|LIBS = -L../apron -lapron -lmpfr -lm|' \
-    -e 's|^LIBS_DEBUG =.*|LIBS_DEBUG = -L../apron -lapron_debug -lmpfr -lm|' \
-    -i octagons/Makefile
-sed -e 's|^LIBS =.*|LIBS = -nodefaultlibs -L../apron -lapron -lppl -lgmp -lstdc++ -lc|' \
-    -e 's|^LIBS_DEBUG =.*|LIBS_DEBUG = -nodefaultlibs -L../apron -lapron_debug -lppl -lgmp -lstdc++ -lc|' \
-    -i ppl/Makefile
-sed -e 's|^LIBS =.*|LIBS = -nodefaultlibs -L../apron -lapron -L../ppl -lap_ppl -lgmp -lc|' \
-    -e 's|^LIBS_DEBUG =.*|LIBS_DEBUG = -nodefaultlibs -L../apron -lapron_debug -L../ppl -lap_ppl_debug -lgmp -lc|' \
-    -e 's| -L$(APRON_PREFIX)/lib||' \
-    -i products/Makefile
-
 # Add sonames
 sed -i -e "s|-shared|-shared -Wl,-soname=\$@.%{sover}|" apron/Makefile
 sed -r -e "s|(-shared -o \\\$@ \\\$\^ \\\$\(LIBS.*\))|\1 -Wl,-soname=\$@.%{sover}|" \
@@ -256,6 +238,10 @@ done
 %endif
 
 %changelog
+* Tue Nov  8 2011 Jerry James <loganjerry at gmail.com> - 0.9.10-4
+- -devel also needs ocaml-camlidl-devel
+- Pass --as-needed to the linker to fix unused shared library dependencies
+
 * Fri Nov  4 2011 Jerry James <loganjerry at gmail.com> - 0.9.10-3
 - Comment on license situation
 - Drop debug libraries altogether


More information about the scm-commits mailing list