diff mbox

[PPL] : Fix static PPL 0.11 case

Message ID ed2b369d51.Jo@hobbes.bass-software.com
State New
Headers show

Commit Message

John Tytgat Jan. 29, 2011, 2:14 p.m. UTC
In message <yddzkqlfkx6.fsf@manam.CeBiTec.Uni-Bielefeld.DE>
          Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> wrote:

> John Tytgat <John.Tytgat@aaug.net> writes:
> 
> > The reason is that PPL (and other libs like CLooG, GMP) are configured
> > with --disable-shared and that we need libpwl.a in our link line.
> >
> > Attached patch addresses this problem.  Please commit after review.
> >
> > John Tytgat  <John.Tytgat@aaug.net>
> >
> > 	* configure.ac (ppllibs): Add -lpwl.
> >
> > Index: configure.ac
> > ===================================================================
> > --- configure.ac	(revision 169306)
> > +++ configure.ac	(working copy)
> > @@ -1621,7 +1621,7 @@
> >  AC_SUBST(poststage1_ldflags)
> >  
> >  # Check for PPL
> > -ppllibs=" -lppl_c -lppl -lgmpxx"
> > +ppllibs=" -lppl_c -lppl -lpwl -lgmpxx"
> >  pplinc=
> >  
> >  AC_ARG_WITH(ppl,
> > @@ -1643,7 +1643,7 @@
> >    "" | yes)
> >      ;;
> >    *)
> > -    ppllibs="-L$with_ppl/lib -lppl_c -lppl -lgmpxx"
> > +    ppllibs="-L$with_ppl/lib -lppl_c -lppl -lpwl -lgmpxx"
> >      pplinc="-I$with_ppl/include $pplinc"
> >      ;;
> >  esac
> > @@ -1651,10 +1651,10 @@
> >    pplinc="-I$with_ppl_include $pplinc"
> >  fi
> >  if test "x$with_ppl_lib" != x; then
> > -  ppllibs="-L$with_ppl_lib -lppl_c -lppl -lgmpxx"
> > +  ppllibs="-L$with_ppl_lib -lppl_c -lppl -lpwl -lgmpxx"
> >  fi
> >  if test "x$with_ppl$with_ppl_include$with_ppl_lib" = x && test -d ${srcdir}/ppl; then
> > -  ppllibs='-L$$r/$(HOST_SUBDIR)/ppl/interfaces/C/'"$lt_cv_objdir"' -L$$r/$(HOST_SUBDIR)/ppl/src/'"$lt_cv_objdir"' -lppl_c -lppl -lgmpxx '
> > +  ppllibs='-L$$r/$(HOST_SUBDIR)/ppl/interfaces/C/'"$lt_cv_objdir"' -L$$r/$(HOST_SUBDIR)/ppl/src/'"$lt_cv_objdir"' -lppl_c -lppl -lpwl -lgmpxx '
> >    pplinc='-I$$r/$(HOST_SUBDIR)/ppl/src -I$$r/$(HOST_SUBDIR)/ppl/interfaces/C '
> >    enable_ppl_version_check=no
> >  fi
> 
> I had the same issue on Solaris recently (apart from others; this stuff
> is a nightmare).  Unfortunately, your patch is incomplete: libppl.a uses
> sqrt, which only lives in libm on some (most?) platforms.  While I've
> simply been adding -lm above, a correct version needs to check if libm
> is needed for sqrt and only add it if necessary.
> 
> Apart from that (and not your fault): please avoid duplicating the list
> of libraries 4 times!  This is guaranteed to get inconsistent.

Yes, but nevertheless as Ryan Hill pointed out, my patch breaks the case
of using a static PPL library which was configured with --disable-watchdog.

Trying to address this problem via a different angle : with PPL we
also have the bin/ppl-config binary so using this for the --with-ppl
case only (not --with-ppl-include nor --with--ppl-lib):


Unfortunately running "ppl-config -IC -A -D" gives me as library list
"-lppl -lppl_c -lgmpxx -lgmp".  The order of libppl and libppl_c needs
to be reversed.

Or would such an approach be acceptable when we throw in an additional
--start-group and --end-group ?

Quesion: does this ppl-config give for the Solaris case a -lm ?

John.

Comments

Rainer Orth Jan. 31, 2011, 3:49 p.m. UTC | #1
John Tytgat <John.Tytgat@aaug.net> writes:

> Or would such an approach be acceptable when we throw in an additional
> --start-group and --end-group ?

Please no: this is GNU ld only!

> Quesion: does this ppl-config give for the Solaris case a -lm ?

Nothing: it's missing.

	Rainer
diff mbox

Patch

Index: configure.ac
===================================================================
--- configure.ac	(revision 169339)
+++ configure.ac	(working copy)
@@ -1643,8 +1652,8 @@ 
   "" | yes)
     ;;
   *)
-    ppllibs="-L$with_ppl/lib -lppl_c -lppl -lgmpxx"
-    pplinc="-I$with_ppl/include $pplinc"
+    ppllibs="`$with_ppl/bin/ppl-config -IC -A -D`"
+    pplinc="-I`$with_ppl/bin/ppl-config -IC -A -i`"
     ;;
 esac
 if test "x$with_ppl_include" != x; then