Package: mpfi
Version: 1.3.4~rc3-1
Severity: wishlist

Hello,

I'm working on packaging SAGE for Debian, which links against libmpfi. However, I'm getting linking problems on amd64 because libmpfi in debian is not compiled with -fPIC (as it should be).

The right solution to this is that I should link against the shared library version of libmpfi which would be built with -fPIC.

Making mpfi build a shared library requires some minor changes to the Makefile.am and configure.ac files and running autotools (patch attached). There's additional work that needs to be done in terms of setting up the right shared library versioning and making the new shared library package (and ideally convincing upstream to include the shared library), but I've attached the patch I constructed to build the shared library for my development use in case it saves you some time.

        -Tim Abbott
--- mpfi-1.3.4~rc3/configure.ac	2006-01-03 04:03:52.000000000 -0500
+++ mpfi-1.3.4~rc3tabbott/configure.ac	2008-04-02 23:50:22.000000000 -0400
@@ -12,6 +12,9 @@
 MPFI_SUBDIRS="src tests doc"
 AC_SUBST(MPFI_SUBDIRS)
 
+AC_PROG_LIBTOOL
+AC_SUBST(LIBTOOL_DEPS)
+
 # ajout des options sur la ligne de commande du configure
 # Initialisation des repertoires GMP
 AC_ARG_WITH(gmp-dir,
--- mpfi-1.3.4~rc3/src/Makefile.am	2006-01-03 04:04:02.000000000 -0500
+++ mpfi-1.3.4~rc3tabbott/src/Makefile.am	2008-04-02 23:46:51.000000000 -0400
@@ -1,6 +1,6 @@
-lib_LIBRARIES = libmpfi.a 
+lib_LTLIBRARIES = libmpfi.la 
 include_HEADERS = mpfi.h mpfi_io.h
-libmpfi_a_SOURCES = mpfi.h mpfi-impl.h mpfi_io.h mpfi.c mpfi_io.c mpfi_trigo.c
+libmpfi_la_SOURCES = mpfi.h mpfi-impl.h mpfi_io.h mpfi.c mpfi_io.c mpfi_trigo.c
 #test_mpfi_LADD = @LIBS@ ../src/libmpfi.a
 
 INCLUDES =-I$(top_srcdir) @INCLUDES@
--- mpfi-1.3.4~rc3/tests/Makefile.am	2006-01-03 04:04:06.000000000 -0500
+++ mpfi-1.3.4~rc3tabbott/tests/Makefile.am	2008-04-03 01:53:58.000000000 -0400
@@ -1,8 +1,8 @@
 noinst_PROGRAMS = test_mpfi test_trigo
 test_mpfi_SOURCES = test_mpfi.c
 test_trigo_SOURCES = test_trigo.c
-test_mpfi_LDADD = ${top_srcdir}/src/libmpfi.a @LDADD@
-test_trigo_LDADD = ${top_srcdir}/src/libmpfi.a @LDADD@
+test_mpfi_LDADD = ${top_srcdir}/src/.libs/libmpfi.a @LDADD@
+test_trigo_LDADD = ${top_srcdir}/src/.libs/libmpfi.a @LDADD@
 
 # ici on utilise la variable GMP_INC_PATH declaree par le configure
 

Reply via email to