public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: [PATCH] Add -lpwl to ppllibs.
@ 2011-03-02 12:32 Dominique Dhumieres
  0 siblings, 0 replies; 23+ messages in thread
From: Dominique Dhumieres @ 2011-03-02 12:32 UTC (permalink / raw)
  To: gcc-patches; +Cc: richard.guenther, sebpop

Different bootstrap failure on x86_64-apple-darwin10:

...
gcc   -g -fkeep-inline-functions -DIN_GCC   -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Wold-style-definition -Wc++-compat -fno-common  -DHAVE_CONFIG_H  -o cc1 c-lang.o c-family/stub-objc.o attribs.o c-errors.o c-decl.o c-typeck.o c-convert.o c-aux-info.o c-objc-common.o c-parser.o tree-mudflap.o c-family/c-common.o c-family/c-cppbuiltin.o c-family/c-dump.o c-family/c-format.o c-family/c-gimplify.o c-family/c-lex.o c-family/c-omp.o c-family/c-opts.o c-family/c-pch.o c-family/c-ppoutput.o c-family/c-pragma.o c-family/c-pretty-print.o c-family/c-semantics.o c-family/c-ada-spec.o i386-c.o darwin-c.o \
          cc1-checksum.o main.o tree-browser.o libbackend.a ../libcpp/libcpp.a ../libdecnumber/libdecnumber.a ../libcpp/libcpp.a -lintl -L/opt/sw64/lib -liconv  ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a  -L/opt/sw64/lib -lcloog-isl -lisl  -L/opt/sw64/lib -lmpc -lmpfr -lgmp   -lz
Undefined symbols:
  "_ppl_Polyhedron_affine_image", referenced from:
      _lst_offset in libbackend.a(graphite-flattening.o)
      _lst_scale in libbackend.a(graphite-flattening.o)
      _lst_project_loop in libbackend.a(graphite-flattening.o)
      _lst_project_loop in libbackend.a(graphite-flattening.o)
...

Apparently 'ppllibs="$ppllibs -lppl_c -lppl $pwllib -lgmpxx"' is not
taken into account.

TIA

Dominique

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] Add -lpwl to ppllibs.
  2011-03-02 12:57                       ` Jakub Jelinek
@ 2011-03-02 18:43                         ` Sebastian Pop
  0 siblings, 0 replies; 23+ messages in thread
From: Sebastian Pop @ 2011-03-02 18:43 UTC (permalink / raw)
  To: Jakub Jelinek
  Cc: Paolo Carlini, Richard Guenther, Ralf Wildenhues, GCC Patches,
	binutils, gdb-patches

On Wed, Mar 2, 2011 at 06:57, Jakub Jelinek <jakub@redhat.com> wrote:
> It also broke bootstrap with ppl-0.10.2 and cloog-ppl 0.15.7 (which before

Unless you specify --disable-ppl-version-check, PPL version 0.11 or later
is required.

> didn't try to compile in graphite, now it does, except it doesn't link in
> -lppl and uses unconditionally ppl 0.11+ functions).

Jakub, I am not sure I addressed the concerns that you raised: could
you please let me know if the patch I committed is not enough to fix
the issue?

Thanks,
Sebastian

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] Add -lpwl to ppllibs.
  2011-03-02 15:15                         ` Paolo Carlini
@ 2011-03-02 15:21                           ` Sebastian Pop
  0 siblings, 0 replies; 23+ messages in thread
From: Sebastian Pop @ 2011-03-02 15:21 UTC (permalink / raw)
  To: Paolo Carlini
  Cc: Richard Guenther, Ralf Wildenhues, GCC Patches, binutils, gdb-patches

[-- Attachment #1: Type: text/plain, Size: 335 bytes --]

On Wed, Mar 2, 2011 at 09:15, Paolo Carlini <paolo.carlini@oracle.com> wrote:
> On 03/02/2011 04:01 PM, Richard Guenther wrote:
>> It seems to work for me
>>
> Likewise, with my usual simple configure line including only
> --enable-cloog-backend=isl beyond trivial things.

I have committed the attached patch to gcc trunk.

Sebastian

[-- Attachment #2: 0001-Fix-configure-problem.patch --]
[-- Type: text/x-patch, Size: 1674 bytes --]

From 7aa8604d6bcfc9a8523fd769ec8a25e7d8cfba68 Mon Sep 17 00:00:00 2001
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Wed, 2 Mar 2011 15:18:47 +0000
Subject: [PATCH] Fix configure problem.

2011-03-02  Sebastian Pop  <sebastian.pop@amd.com>

	* configure.ac: Adjust test of with_ppl.
	* configure: Regenerated.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@170618 138bc75d-0d04-0410-961f-82ee72b054a4
---
 ChangeLog    |    5 +++++
 configure    |    2 +-
 configure.ac |    2 +-
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 92f4f15..b066896 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-03-02  Sebastian Pop  <sebastian.pop@amd.com>
+
+	* configure.ac: Adjust test of with_ppl.
+	* configure: Regenerated.
+
 2011-03-02  Kai Tietz  <ktietz@redhat.com>
 
 	* MAINTAINERS: Adjust my e-mail address.
diff --git a/configure b/configure
index 997282f..5e97d0f 100755
--- a/configure
+++ b/configure
@@ -5723,7 +5723,7 @@ if test x"$with_ppl$with_ppl_include$with_ppl_lib" = x && test -d ${srcdir}/ppl;
   with_ppl=yes
 fi
 
-if test "x$with_ppl" = xyes; then
+if test "x$with_ppl" != xno; then
   if test "x$pwllib" = x; then
     saved_LDFLAGS="$LDFLAGS"
     LDFLAGS="$LDFLAGS $ppllibs"
diff --git a/configure.ac b/configure.ac
index 4fb29c0..233ce0a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1675,7 +1675,7 @@ if test x"$with_ppl$with_ppl_include$with_ppl_lib" = x && test -d ${srcdir}/ppl;
   with_ppl=yes
 fi
 
-if test "x$with_ppl" = xyes; then
+if test "x$with_ppl" != xno; then
   if test "x$pwllib" = x; then
     saved_LDFLAGS="$LDFLAGS"
     LDFLAGS="$LDFLAGS $ppllibs"
-- 
1.7.1


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] Add -lpwl to ppllibs.
  2011-03-02 15:02                       ` Richard Guenther
  2011-03-02 15:07                         ` Sebastian Pop
@ 2011-03-02 15:15                         ` Paolo Carlini
  2011-03-02 15:21                           ` Sebastian Pop
  1 sibling, 1 reply; 23+ messages in thread
From: Paolo Carlini @ 2011-03-02 15:15 UTC (permalink / raw)
  To: Richard Guenther
  Cc: Sebastian Pop, Ralf Wildenhues, GCC Patches, binutils, gdb-patches

On 03/02/2011 04:01 PM, Richard Guenther wrote:
> It seems to work for me
>   
Likewise, with my usual simple configure line including only
--enable-cloog-backend=isl beyond trivial things.

Paolo.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] Add -lpwl to ppllibs.
  2011-03-02 15:07                         ` Sebastian Pop
@ 2011-03-02 15:09                           ` Richard Guenther
  0 siblings, 0 replies; 23+ messages in thread
From: Richard Guenther @ 2011-03-02 15:09 UTC (permalink / raw)
  To: Sebastian Pop; +Cc: Ralf Wildenhues, GCC Patches, binutils, gdb-patches

On Wed, Mar 2, 2011 at 4:07 PM, Sebastian Pop <sebpop@gmail.com> wrote:
> On Wed, Mar 2, 2011 at 09:01, Richard Guenther
> <richard.guenther@gmail.com> wrote:
>> On Wed, Mar 2, 2011 at 3:48 PM, Sebastian Pop <sebpop@gmail.com> wrote:
>>> On Wed, Mar 2, 2011 at 06:20, Richard Guenther
>>> <richard.guenther@gmail.com> wrote:
>>>> As you can see from the link line it doesn't link ppl at all.  ppllibs is empty
>>>> for me.
>>>>
>>>> Please revert or fix ASAP.
>>>
>>> Does the attached patch fix the problem you are seeing?
>>
>> It seems to work for me (bootstrap is in stage2, HAVE_cloog is 1).
>
> Ok, thanks for checking.
>
> So my theory is that you configured with "--with-ppl" with no arguments,
> that sets the variable $with_ppl to the empty string, and so "x$with_ppl"
> is not equal to "xyes" in that case.

No, I configured with just ./configure --enable-languages=c

Richard.

> Sebastian
>

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] Add -lpwl to ppllibs.
  2011-03-02 15:02                       ` Richard Guenther
@ 2011-03-02 15:07                         ` Sebastian Pop
  2011-03-02 15:09                           ` Richard Guenther
  2011-03-02 15:15                         ` Paolo Carlini
  1 sibling, 1 reply; 23+ messages in thread
From: Sebastian Pop @ 2011-03-02 15:07 UTC (permalink / raw)
  To: Richard Guenther; +Cc: Ralf Wildenhues, GCC Patches, binutils, gdb-patches

On Wed, Mar 2, 2011 at 09:01, Richard Guenther
<richard.guenther@gmail.com> wrote:
> On Wed, Mar 2, 2011 at 3:48 PM, Sebastian Pop <sebpop@gmail.com> wrote:
>> On Wed, Mar 2, 2011 at 06:20, Richard Guenther
>> <richard.guenther@gmail.com> wrote:
>>> As you can see from the link line it doesn't link ppl at all.  ppllibs is empty
>>> for me.
>>>
>>> Please revert or fix ASAP.
>>
>> Does the attached patch fix the problem you are seeing?
>
> It seems to work for me (bootstrap is in stage2, HAVE_cloog is 1).

Ok, thanks for checking.

So my theory is that you configured with "--with-ppl" with no arguments,
that sets the variable $with_ppl to the empty string, and so "x$with_ppl"
is not equal to "xyes" in that case.

Sebastian

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] Add -lpwl to ppllibs.
  2011-03-02 14:49                     ` Sebastian Pop
@ 2011-03-02 15:02                       ` Richard Guenther
  2011-03-02 15:07                         ` Sebastian Pop
  2011-03-02 15:15                         ` Paolo Carlini
  0 siblings, 2 replies; 23+ messages in thread
From: Richard Guenther @ 2011-03-02 15:02 UTC (permalink / raw)
  To: Sebastian Pop; +Cc: Ralf Wildenhues, GCC Patches, binutils, gdb-patches

On Wed, Mar 2, 2011 at 3:48 PM, Sebastian Pop <sebpop@gmail.com> wrote:
> On Wed, Mar 2, 2011 at 06:20, Richard Guenther
> <richard.guenther@gmail.com> wrote:
>> As you can see from the link line it doesn't link ppl at all.  ppllibs is empty
>> for me.
>>
>> Please revert or fix ASAP.
>
> Does the attached patch fix the problem you are seeing?

It seems to work for me (bootstrap is in stage2, HAVE_cloog is 1).

Richard.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] Add -lpwl to ppllibs.
  2011-03-02 12:20                   ` Richard Guenther
  2011-03-02 12:45                     ` Paolo Carlini
@ 2011-03-02 14:49                     ` Sebastian Pop
  2011-03-02 15:02                       ` Richard Guenther
  1 sibling, 1 reply; 23+ messages in thread
From: Sebastian Pop @ 2011-03-02 14:49 UTC (permalink / raw)
  To: Richard Guenther; +Cc: Ralf Wildenhues, GCC Patches, binutils, gdb-patches

[-- Attachment #1: Type: text/plain, Size: 293 bytes --]

On Wed, Mar 2, 2011 at 06:20, Richard Guenther
<richard.guenther@gmail.com> wrote:
> As you can see from the link line it doesn't link ppl at all.  ppllibs is empty
> for me.
>
> Please revert or fix ASAP.

Does the attached patch fix the problem you are seeing?

Thanks,
Sebastian

[-- Attachment #2: 0001-Fix-configure-problem.patch --]
[-- Type: text/x-patch, Size: 1088 bytes --]

From 05223494274bc509fddf4f2546f50e4294c9537f Mon Sep 17 00:00:00 2001
From: Sebastian Pop <sebpop@gmail.com>
Date: Wed, 2 Mar 2011 08:47:36 -0600
Subject: [PATCH] Fix configure problem.

---
 configure    |    2 +-
 configure.ac |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 997282f..5e97d0f 100755
--- a/configure
+++ b/configure
@@ -5723,7 +5723,7 @@ if test x"$with_ppl$with_ppl_include$with_ppl_lib" = x && test -d ${srcdir}/ppl;
   with_ppl=yes
 fi
 
-if test "x$with_ppl" = xyes; then
+if test "x$with_ppl" != xno; then
   if test "x$pwllib" = x; then
     saved_LDFLAGS="$LDFLAGS"
     LDFLAGS="$LDFLAGS $ppllibs"
diff --git a/configure.ac b/configure.ac
index 4fb29c0..233ce0a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1675,7 +1675,7 @@ if test x"$with_ppl$with_ppl_include$with_ppl_lib" = x && test -d ${srcdir}/ppl;
   with_ppl=yes
 fi
 
-if test "x$with_ppl" = xyes; then
+if test "x$with_ppl" != xno; then
   if test "x$pwllib" = x; then
     saved_LDFLAGS="$LDFLAGS"
     LDFLAGS="$LDFLAGS $ppllibs"
-- 
1.7.1


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] Add -lpwl to ppllibs.
  2011-03-02 12:45                     ` Paolo Carlini
@ 2011-03-02 12:57                       ` Jakub Jelinek
  2011-03-02 18:43                         ` Sebastian Pop
  0 siblings, 1 reply; 23+ messages in thread
From: Jakub Jelinek @ 2011-03-02 12:57 UTC (permalink / raw)
  To: Paolo Carlini
  Cc: Richard Guenther, Sebastian Pop, Ralf Wildenhues, GCC Patches,
	binutils, gdb-patches

On Wed, Mar 02, 2011 at 01:45:01PM +0100, Paolo Carlini wrote:
> On 03/02/2011 01:20 PM, Richard Guenther wrote:
> > so it seems it broke some configure tests.  I have ppl-0.11 and cloog 0.15.10.
> >   
> I was about to send a message...
> 
> For the record, it broke the boostrap for me too. Until yesterday I used
> to build successfully with ppl-0.11 and cloog-0.16.1 with
> --enable-cloog-backend=isl. Today I see a lot of undefined references.
> For the record, upgrading to ppl-0.11.2 doesn't help.

It also broke bootstrap with ppl-0.10.2 and cloog-ppl 0.15.7 (which before
didn't try to compile in graphite, now it does, except it doesn't link in
-lppl and uses unconditionally ppl 0.11+ functions).

	Jakub

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] Add -lpwl to ppllibs.
  2011-03-02 12:20                   ` Richard Guenther
@ 2011-03-02 12:45                     ` Paolo Carlini
  2011-03-02 12:57                       ` Jakub Jelinek
  2011-03-02 14:49                     ` Sebastian Pop
  1 sibling, 1 reply; 23+ messages in thread
From: Paolo Carlini @ 2011-03-02 12:45 UTC (permalink / raw)
  To: Richard Guenther
  Cc: Sebastian Pop, Ralf Wildenhues, GCC Patches, binutils, gdb-patches

On 03/02/2011 01:20 PM, Richard Guenther wrote:
> so it seems it broke some configure tests.  I have ppl-0.11 and cloog 0.15.10.
>   
I was about to send a message...

For the record, it broke the boostrap for me too. Until yesterday I used
to build successfully with ppl-0.11 and cloog-0.16.1 with
--enable-cloog-backend=isl. Today I see a lot of undefined references.
For the record, upgrading to ppl-0.11.2 doesn't help.

Paolo.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] Add -lpwl to ppllibs.
  2011-03-02  3:53                 ` Sebastian Pop
@ 2011-03-02 12:20                   ` Richard Guenther
  2011-03-02 12:45                     ` Paolo Carlini
  2011-03-02 14:49                     ` Sebastian Pop
  0 siblings, 2 replies; 23+ messages in thread
From: Richard Guenther @ 2011-03-02 12:20 UTC (permalink / raw)
  To: Sebastian Pop; +Cc: Ralf Wildenhues, GCC Patches, binutils, gdb-patches

On Wed, Mar 2, 2011 at 4:49 AM, Sebastian Pop <sebpop@gmail.com> wrote:
> Hi,
>
> On Sun, Feb 27, 2011 at 03:38, Ralf Wildenhues <ralf.wildenhues@gmx.de> wrote:
>> * Sebastian Pop wrote on Sun, Feb 27, 2011 at 08:23:15AM CET:
>>> On Sun, Feb 27, 2011 at 00:35, Ralf Wildenhues wrote:
>>> > * Sebastian Pop wrote on Wed, Feb 23, 2011 at 09:47:07PM CET:
>>> >> here is the updated patch with your remarks and the remarks from
>>> >> Rainer.  We still have the libs in the same order: -lppl_c -lppl
>>> >> $pwllib, and I will change the order following what Roberto says.
>>> >
>>> > Well, has Roberto replied yet?  The contents of the patch depend
>>> > on the answer, and I'd rather review that version of the patch
>>> > that is supposed to go in.
>>> >
>>> > The patch looks OK for the case that pwl doesn't depend on any
>>> > of the other PPL libs.
>>>
>>> I have not yet received an answer for the question of whether PWL is
>>> independent of PPL.
>>
>> He answered now.  So the patch is OK.
>>
>>> > Please remember that toplevel patches need to be synced to src.
>>>
>>> Am I supposed to commit the configure changes to a different place
>>> than gcc trunk?
>>
>> Yes, to the src CVS repository, and Cc:ing binutils and gdb-patches
>> at sourceware.org.  See
>> http://gcc.gnu.org/codingconventions.html#upstream for details.
>
> Here are the two patches that I committed to
> svn+ssh://spop@gcc.gnu.org/svn/gcc
> and synced to :ext:spop@sourceware.org:/cvs/src

This broke bootstrap for me.

gcc   -g -fkeep-inline-functions -DIN_GCC   -W -Wall -Wwrite-strings
-Wcast-qual -Wstrict-prototypes -Wmissing-prototypes
-Wmissing-format-attribute -pedantic -Wno-long-long
-Wno-variadic-macros -Wno-overlength-strings -Wold-style-definition
-Wc++-compat -fno-common  -DHAVE_CONFIG_H  -o cc1 c-lang.o
c-family/stub-objc.o attribs.o c-errors.o c-decl.o c-typeck.o
c-convert.o c-aux-info.o c-objc-common.o c-parser.o tree-mudflap.o
c-family/c-common.o c-family/c-cppbuiltin.o c-family/c-dump.o
c-family/c-format.o c-family/c-gimplify.o c-family/c-lex.o
c-family/c-omp.o c-family/c-opts.o c-family/c-pch.o
c-family/c-ppoutput.o c-family/c-pragma.o c-family/c-pretty-print.o
c-family/c-semantics.o c-family/c-ada-spec.o i386-c.o \
          cc1-checksum.o main.o tree-browser.o libbackend.a
../libcpp/libcpp.a ../libdecnumber/libdecnumber.a ../libcpp/libcpp.a
../libiberty/libiberty.a ../libdecnumber/libdecnumber.a  -lcloog
-lmpc -lmpfr -lgmp -rdynamic -ldl  -L../zlib -lz
libbackend.a(graphite-ppl.o): In function `ppl_powerset_is_empty':
/space/rguenther/src/svn/trunk/gcc/graphite-ppl.c:552: undefined
reference to `ppl_new_PIP_Problem_from_constraints'
/space/rguenther/src/svn/trunk/gcc/graphite-ppl.c:553: undefined
reference to `ppl_PIP_Problem_is_satisfiable'
/space/rguenther/src/svn/trunk/gcc/graphite-ppl.c:555: undefined
reference to `ppl_delete_PIP_Problem'
collect2: ld returned 1 exit status
make[3]: *** [cc1] Error 1
make[3]: *** Waiting for unfinished jobs....
libbackend.a(graphite-ppl.o): In function `ppl_powerset_is_empty':
/space/rguenther/src/svn/trunk/gcc/graphite-ppl.c:552: undefined
reference to `ppl_new_PIP_Problem_from_constraints'
/space/rguenther/src/svn/trunk/gcc/graphite-ppl.c:553: undefined
reference to `ppl_PIP_Problem_is_satisfiable'
/space/rguenther/src/svn/trunk/gcc/graphite-ppl.c:555: undefined
reference to `ppl_delete_PIP_Problem'
collect2: ld returned 1 exit status
make[3]: *** [lto1] Error 1
rm gcov.pod cpp.pod gfdl.pod fsf-funding.pod gcc.pod
make[3]: Leaving directory `/home/abuild/rguenther/obj/gcc'
make[2]: *** [all-stage1-gcc] Error 2
make[2]: Leaving directory `/home/abuild/rguenther/obj'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/home/abuild/rguenther/obj'
make: *** [all] Error 2

so it seems it broke some configure tests.  I have ppl-0.11 and cloog 0.15.10.

As you can see from the link line it doesn't link ppl at all.  ppllibs is empty
for me.

Please revert or fix ASAP.

Richard.

> Sebastian
>

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] Add -lpwl to ppllibs.
  2011-02-27 11:35               ` Ralf Wildenhues
@ 2011-03-02  3:53                 ` Sebastian Pop
  2011-03-02 12:20                   ` Richard Guenther
  0 siblings, 1 reply; 23+ messages in thread
From: Sebastian Pop @ 2011-03-02  3:53 UTC (permalink / raw)
  To: Ralf Wildenhues, GCC Patches, binutils, gdb-patches

[-- Attachment #1: Type: text/plain, Size: 1405 bytes --]

Hi,

On Sun, Feb 27, 2011 at 03:38, Ralf Wildenhues <ralf.wildenhues@gmx.de> wrote:
> * Sebastian Pop wrote on Sun, Feb 27, 2011 at 08:23:15AM CET:
>> On Sun, Feb 27, 2011 at 00:35, Ralf Wildenhues wrote:
>> > * Sebastian Pop wrote on Wed, Feb 23, 2011 at 09:47:07PM CET:
>> >> here is the updated patch with your remarks and the remarks from
>> >> Rainer.  We still have the libs in the same order: -lppl_c -lppl
>> >> $pwllib, and I will change the order following what Roberto says.
>> >
>> > Well, has Roberto replied yet?  The contents of the patch depend
>> > on the answer, and I'd rather review that version of the patch
>> > that is supposed to go in.
>> >
>> > The patch looks OK for the case that pwl doesn't depend on any
>> > of the other PPL libs.
>>
>> I have not yet received an answer for the question of whether PWL is
>> independent of PPL.
>
> He answered now.  So the patch is OK.
>
>> > Please remember that toplevel patches need to be synced to src.
>>
>> Am I supposed to commit the configure changes to a different place
>> than gcc trunk?
>
> Yes, to the src CVS repository, and Cc:ing binutils and gdb-patches
> at sourceware.org.  See
> http://gcc.gnu.org/codingconventions.html#upstream for details.

Here are the two patches that I committed to
svn+ssh://spop@gcc.gnu.org/svn/gcc
and synced to :ext:spop@sourceware.org:/cvs/src

Sebastian

[-- Attachment #2: 0001-Add-lisl-to-clooglibs.patch --]
[-- Type: text/x-patch, Size: 1563 bytes --]

From 5c317faa934ddf93f9f2b68b8ddb857db4be9a0c Mon Sep 17 00:00:00 2001
From: Sebastian Pop <sebpop@gmail.com>
Date: Fri, 18 Feb 2011 11:25:52 -0600
Subject: [PATCH 1/2] Add -lisl to clooglibs.

2011-03-02  Sebastian Pop  <sebastian.pop@amd.com>

	* config/cloog.m4: Add -lisl to clooglibs.
	* configure: Regenerated.
---
 ChangeLog       |    5 +++++
 config/cloog.m4 |    2 +-
 configure       |    2 +-
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 8005328..7f1df97 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-03-02  Sebastian Pop  <sebastian.pop@amd.com>
+
+	* config/cloog.m4: Add -lisl to clooglibs.
+	* configure: Regenerated.
+
 2011-02-24  Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>
 
 	* MAINTAINERS (CPU Port maintainers): Add self.
diff --git a/config/cloog.m4 b/config/cloog.m4
index ec8b46d..e95b98d 100644
--- a/config/cloog.m4
+++ b/config/cloog.m4
@@ -179,7 +179,7 @@ AC_DEFUN([CLOOG_FIND_FLAGS],
       ;;
     "ISL")
       clooginc="${clooginc} ${_cloogorginc}"
-      clooglibs="${clooglibs} -lcloog-isl"
+      clooglibs="${clooglibs} -lcloog-isl -lisl"
       cloog_org=yes
       ;;
     "PPL")
diff --git a/configure b/configure
index 501c6ff..ac7db39 100755
--- a/configure
+++ b/configure
@@ -5963,7 +5963,7 @@ $as_echo "$gcc_cv_cloog_type" >&6; }
       ;;
     "ISL")
       clooginc="${clooginc} ${_cloogorginc}"
-      clooglibs="${clooglibs} -lcloog-isl"
+      clooglibs="${clooglibs} -lcloog-isl -lisl"
       cloog_org=yes
       ;;
     "PPL")
-- 
1.7.1


[-- Attachment #3: 0002-Add-lpwl-to-ppllibs.patch --]
[-- Type: text/x-patch, Size: 8872 bytes --]

From 9c87128c7e9fd9b67bd99d37b82a7fd55df5c91b Mon Sep 17 00:00:00 2001
From: Sebastian Pop <sebpop@gmail.com>
Date: Fri, 18 Feb 2011 11:24:33 -0600
Subject: [PATCH 2/2] Add -lpwl to ppllibs.

2011-03-02  Sebastian Pop  <sebastian.pop@amd.com>

	* configure.ac: Add -lpwl to ppllibs.
	* configure: Regenerated.
---
 ChangeLog    |    5 +++
 configure    |  108 +++++++++++++++++++++++++++++++++++++++++++++-------------
 configure.ac |   73 +++++++++++++++++++++++++--------------
 3 files changed, 136 insertions(+), 50 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 7f1df97..2921567 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2011-03-02  Sebastian Pop  <sebastian.pop@amd.com>
 
+	* configure.ac: Add -lpwl to ppllibs.
+	* configure: Regenerated.
+
+2011-03-02  Sebastian Pop  <sebastian.pop@amd.com>
+
 	* config/cloog.m4: Add -lisl to clooglibs.
 	* configure: Regenerated.
 
diff --git a/configure b/configure
index ac7db39..997282f 100755
--- a/configure
+++ b/configure
@@ -5660,8 +5660,9 @@ fi
 
 
 # Check for PPL
-ppllibs=" -lppl_c -lppl -lgmpxx"
+ppllibs=
 pplinc=
+pwllib=
 
 
 # Check whether --with-ppl was given.
@@ -5682,52 +5683,110 @@ if test "${with_ppl_lib+set}" = set; then :
 fi
 
 
+# Check whether --enable-ppl-version-check was given.
+if test "${enable_ppl_version_check+set}" = set; then :
+  enableval=$enable_ppl_version_check;
+fi
+
+
 case $with_ppl in
-  no)
-    ppllibs=
-    ;;
-  "" | yes)
+  yes | no | "")
     ;;
   *)
-    ppllibs="-L$with_ppl/lib -lppl_c -lppl -lgmpxx"
+    ppllibs="-L$with_ppl/lib"
     pplinc="-I$with_ppl/include $pplinc"
+    if test -d "$with_ppl/lib" && test -d "$with_ppl/include"; then
+      with_ppl=yes
+    else
+      as_fn_error "cannot find directories \"$with_ppl/lib\" or \"$with_ppl/include\"" "$LINENO" 5
+    fi
     ;;
 esac
-if test "x$with_ppl_include" != x; then
+
+if test x"$with_ppl_include" != x; then
   pplinc="-I$with_ppl_include $pplinc"
+  with_ppl=yes
 fi
+
 if test "x$with_ppl_lib" != x; then
-  ppllibs="-L$with_ppl_lib -lppl_c -lppl -lgmpxx"
+  ppllibs="-L$with_ppl_lib"
+  with_ppl=yes
 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 '
+
+if test x"$with_ppl$with_ppl_include$with_ppl_lib" = x && test -d ${srcdir}/ppl; then
+  if test x"$enable_watchdog" = xyes; then
+    pwllib="-lpwl"
+  fi
+  ppllibs='-L$$r/$(HOST_SUBDIR)/ppl/interfaces/C/'"$lt_cv_objdir"' -L$$r/$(HOST_SUBDIR)/ppl/src/'"$lt_cv_objdir"
   pplinc='-I$$r/$(HOST_SUBDIR)/ppl/src -I$$r/$(HOST_SUBDIR)/ppl/interfaces/C '
   enable_ppl_version_check=no
+  with_ppl=yes
 fi
 
-# Check whether --enable-ppl-version-check was given.
-if test "${enable_ppl_version_check+set}" = set; then :
-  enableval=$enable_ppl_version_check; ENABLE_PPL_CHECK=$enableval
+if test "x$with_ppl" = xyes; then
+  if test "x$pwllib" = x; then
+    saved_LDFLAGS="$LDFLAGS"
+    LDFLAGS="$LDFLAGS $ppllibs"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PWL_handle_timeout in -lpwl" >&5
+$as_echo_n "checking for PWL_handle_timeout in -lpwl... " >&6; }
+if test "${ac_cv_lib_pwl_PWL_handle_timeout+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpwl  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char PWL_handle_timeout ();
+int
+main ()
+{
+return PWL_handle_timeout ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_pwl_PWL_handle_timeout=yes
 else
-  ENABLE_PPL_CHECK=yes
+  ac_cv_lib_pwl_PWL_handle_timeout=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pwl_PWL_handle_timeout" >&5
+$as_echo "$ac_cv_lib_pwl_PWL_handle_timeout" >&6; }
+if test "x$ac_cv_lib_pwl_PWL_handle_timeout" = x""yes; then :
+  pwllib="-lpwl"
 fi
 
+    LDFLAGS="$saved_LDFLAGS"
+  fi
 
-if test "x$with_ppl" != "xno" -a "${ENABLE_PPL_CHECK}" = "yes"; then
-  saved_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS $pplinc $gmpinc"
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for version 0.11 (or later revision) of PPL" >&5
-$as_echo_n "checking for version 0.11 (or later revision) of PPL... " >&6; }
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  ppllibs="$ppllibs -lppl_c -lppl $pwllib -lgmpxx"
+
+  if test "$enable_ppl_version_check" != no; then
+    saved_CFLAGS="$CFLAGS"
+    CFLAGS="$CFLAGS $pplinc $gmpinc"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for version 0.11 (revision 0 or later) of PPL" >&5
+$as_echo_n "checking for version 0.11 (revision 0 or later) of PPL... " >&6; }
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include "ppl_c.h"
 int
 main ()
 {
 
-  #if PPL_VERSION_MAJOR != 0 || PPL_VERSION_MINOR < 11
-  choke me
-  #endif
+    #if PPL_VERSION_MAJOR != 0 || PPL_VERSION_MINOR < 11
+    choke me
+    #endif
 
   ;
   return 0;
@@ -5741,7 +5800,8 @@ else
 $as_echo "no" >&6; }; ppllibs= ; pplinc= ; with_ppl=no
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  CFLAGS="$saved_CFLAGS"
+    CFLAGS="$saved_CFLAGS"
+  fi
 fi
 
 # Flags needed for PPL
diff --git a/configure.ac b/configure.ac
index 9121d65..4fb29c0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1621,8 +1621,9 @@ AC_ARG_WITH(boot-ldflags,
 AC_SUBST(poststage1_ldflags)
 
 # Check for PPL
-ppllibs=" -lppl_c -lppl -lgmpxx"
+ppllibs=
 pplinc=
+pwllib=
 
 AC_ARG_WITH(ppl,
 [AS_HELP_STRING([--with-ppl=PATH],
@@ -1636,45 +1637,65 @@ AC_ARG_WITH(ppl-lib,
 [AS_HELP_STRING([--with-ppl-lib=PATH],
 		[specify directory for the installed PPL library])])
 
-case $with_ppl in 
-  no)
-    ppllibs=
-    ;;
-  "" | yes)
+AC_ARG_ENABLE(ppl-version-check,
+[AS_HELP_STRING([--disable-ppl-version-check],
+		[disable check for PPL version])])
+
+case $with_ppl in
+  yes | no | "")
     ;;
   *)
-    ppllibs="-L$with_ppl/lib -lppl_c -lppl -lgmpxx"
+    ppllibs="-L$with_ppl/lib"
     pplinc="-I$with_ppl/include $pplinc"
+    if test -d "$with_ppl/lib" && test -d "$with_ppl/include"; then
+      with_ppl=yes
+    else
+      AC_MSG_ERROR([cannot find directories "$with_ppl/lib" or "$with_ppl/include"])
+    fi
     ;;
 esac
-if test "x$with_ppl_include" != x; then
+
+if test x"$with_ppl_include" != x; then
   pplinc="-I$with_ppl_include $pplinc"
+  with_ppl=yes
 fi
+
 if test "x$with_ppl_lib" != x; then
-  ppllibs="-L$with_ppl_lib -lppl_c -lppl -lgmpxx"
+  ppllibs="-L$with_ppl_lib"
+  with_ppl=yes
 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 '
+
+if test x"$with_ppl$with_ppl_include$with_ppl_lib" = x && test -d ${srcdir}/ppl; then
+  if test x"$enable_watchdog" = xyes; then
+    pwllib="-lpwl"
+  fi
+  ppllibs='-L$$r/$(HOST_SUBDIR)/ppl/interfaces/C/'"$lt_cv_objdir"' -L$$r/$(HOST_SUBDIR)/ppl/src/'"$lt_cv_objdir"
   pplinc='-I$$r/$(HOST_SUBDIR)/ppl/src -I$$r/$(HOST_SUBDIR)/ppl/interfaces/C '
   enable_ppl_version_check=no
+  with_ppl=yes
 fi
 
-AC_ARG_ENABLE(ppl-version-check,
-[AS_HELP_STRING([--disable-ppl-version-check],
-		[disable check for PPL version])],
-ENABLE_PPL_CHECK=$enableval,
-ENABLE_PPL_CHECK=yes)
+if test "x$with_ppl" = xyes; then
+  if test "x$pwllib" = x; then
+    saved_LDFLAGS="$LDFLAGS"
+    LDFLAGS="$LDFLAGS $ppllibs"
+    AC_CHECK_LIB(pwl,PWL_handle_timeout,[pwllib="-lpwl"])
+    LDFLAGS="$saved_LDFLAGS"
+  fi
 
-if test "x$with_ppl" != "xno" -a "${ENABLE_PPL_CHECK}" = "yes"; then
-  saved_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS $pplinc $gmpinc"
-  AC_MSG_CHECKING([for version 0.11 (or later revision) of PPL])
-  AC_TRY_COMPILE([#include "ppl_c.h"],[
-  #if PPL_VERSION_MAJOR != 0 || PPL_VERSION_MINOR < 11
-  choke me
-  #endif
-  ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); ppllibs= ; pplinc= ; with_ppl=no ])
-  CFLAGS="$saved_CFLAGS"
+  ppllibs="$ppllibs -lppl_c -lppl $pwllib -lgmpxx"
+
+  if test "$enable_ppl_version_check" != no; then
+    saved_CFLAGS="$CFLAGS"
+    CFLAGS="$CFLAGS $pplinc $gmpinc"
+    AC_MSG_CHECKING([for version 0.11 (revision 0 or later) of PPL])
+    AC_TRY_COMPILE([#include "ppl_c.h"],[
+    #if PPL_VERSION_MAJOR != 0 || PPL_VERSION_MINOR < 11
+    choke me
+    #endif
+    ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); ppllibs= ; pplinc= ; with_ppl=no ])
+    CFLAGS="$saved_CFLAGS"
+  fi
 fi
 
 # Flags needed for PPL
-- 
1.7.1


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] Add -lpwl to ppllibs.
  2011-02-27  8:10             ` Sebastian Pop
@ 2011-02-27 11:35               ` Ralf Wildenhues
  2011-03-02  3:53                 ` Sebastian Pop
  0 siblings, 1 reply; 23+ messages in thread
From: Ralf Wildenhues @ 2011-02-27 11:35 UTC (permalink / raw)
  To: Sebastian Pop; +Cc: gcc-patches, Roberto Bagnara

* Sebastian Pop wrote on Sun, Feb 27, 2011 at 08:23:15AM CET:
> On Sun, Feb 27, 2011 at 00:35, Ralf Wildenhues wrote:
> > * Sebastian Pop wrote on Wed, Feb 23, 2011 at 09:47:07PM CET:
> >> here is the updated patch with your remarks and the remarks from
> >> Rainer.  We still have the libs in the same order: -lppl_c -lppl
> >> $pwllib, and I will change the order following what Roberto says.
> >
> > Well, has Roberto replied yet?  The contents of the patch depend
> > on the answer, and I'd rather review that version of the patch
> > that is supposed to go in.
> >
> > The patch looks OK for the case that pwl doesn't depend on any
> > of the other PPL libs.
> 
> I have not yet received an answer for the question of whether PWL is
> independent of PPL.

He answered now.  So the patch is OK.

> > Please remember that toplevel patches need to be synced to src.
> 
> Am I supposed to commit the configure changes to a different place
> than gcc trunk?

Yes, to the src CVS repository, and Cc:ing binutils and gdb-patches
at sourceware.org.  See
http://gcc.gnu.org/codingconventions.html#upstream for details.

Thanks,
Ralf

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] Add -lpwl to ppllibs.
  2011-02-23 22:18         ` Sebastian Pop
@ 2011-02-27  8:38           ` Ralf Wildenhues
  2011-02-27  8:10             ` Sebastian Pop
  0 siblings, 1 reply; 23+ messages in thread
From: Ralf Wildenhues @ 2011-02-27  8:38 UTC (permalink / raw)
  To: Sebastian Pop; +Cc: gcc-patches

* Sebastian Pop wrote on Wed, Feb 23, 2011 at 09:47:07PM CET:
> here is the updated patch with your remarks and the remarks from
> Rainer.  We still have the libs in the same order: -lppl_c -lppl
> $pwllib, and I will change the order following what Roberto says.

Well, has Roberto replied yet?  The contents of the patch depend
on the answer, and I'd rather review that version of the patch
that is supposed to go in.

The patch looks OK for the case that pwl doesn't depend on any
of the other PPL libs.

Please remember that toplevel patches need to be synced to src.

> 2011-02-23  Sebastian Pop  <sebastian.pop@amd.com>
> 
> 	* configure.ac: Add -lpwl to ppllibs.
> 	* configure: Regenerated.

Thanks,
Ralf

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] Add -lpwl to ppllibs.
  2011-02-27  8:38           ` Ralf Wildenhues
@ 2011-02-27  8:10             ` Sebastian Pop
  2011-02-27 11:35               ` Ralf Wildenhues
  0 siblings, 1 reply; 23+ messages in thread
From: Sebastian Pop @ 2011-02-27  8:10 UTC (permalink / raw)
  To: Ralf Wildenhues, Sebastian Pop, gcc-patches, Roberto Bagnara

Hi Ralf,

On Sun, Feb 27, 2011 at 00:35, Ralf Wildenhues <ralf.wildenhues@gmx.de> wrote:
> * Sebastian Pop wrote on Wed, Feb 23, 2011 at 09:47:07PM CET:
>> here is the updated patch with your remarks and the remarks from
>> Rainer.  We still have the libs in the same order: -lppl_c -lppl
>> $pwllib, and I will change the order following what Roberto says.
>
> Well, has Roberto replied yet?  The contents of the patch depend
> on the answer, and I'd rather review that version of the patch
> that is supposed to go in.
>
> The patch looks OK for the case that pwl doesn't depend on any
> of the other PPL libs.

I have not yet received an answer for the question of whether PWL is
independent of PPL.

If I'm looking with nm at the symbols of libpwl, I do not see any of
the symbols defined by the PPL.  Furthermore, the documentation
of PWL does not mention anything about PPL.

>
> Please remember that toplevel patches need to be synced to src.
>

Am I supposed to commit the configure changes to a different place
than gcc trunk?

Thanks,
Sebastian

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH] Add -lpwl to ppllibs.
  2011-02-23 20:48       ` Ralf Wildenhues
  2011-02-23 22:08         ` Sebastian Pop
@ 2011-02-23 22:18         ` Sebastian Pop
  2011-02-27  8:38           ` Ralf Wildenhues
  1 sibling, 1 reply; 23+ messages in thread
From: Sebastian Pop @ 2011-02-23 22:18 UTC (permalink / raw)
  To: ralf.wildenhues; +Cc: gcc-patches, Sebastian Pop

Hi Ralf,

here is the updated patch with your remarks and the remarks from
Rainer.  We still have the libs in the same order: -lppl_c -lppl
$pwllib, and I will change the order following what Roberto says.

Tested as previously with all the combinations below:
without ppl
--with-ppl with pwl
--with-ppl without pwl
--with-ppl=/path/to/ppl_with_pwl
--with-ppl=/path/to/ppl_without_pwl
--with-ppl-libs=/path/to/ppl_with_pwl
--with-ppl-libs=/path/to/ppl_without_pwl
in-tree ppl
in-tree ppl --enable-watchdog
in-tree ppl --disable-watchdog

Ok for trunk?

2011-02-23  Sebastian Pop  <sebastian.pop@amd.com>

	* configure.ac: Add -lpwl to ppllibs.
	* configure: Regenerated.
---
 ChangeLog    |    5 +++
 configure    |  108 +++++++++++++++++++++++++++++++++++++++++++++-------------
 configure.ac |   73 +++++++++++++++++++++++++--------------
 3 files changed, 136 insertions(+), 50 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 73ad168..6d0fb9d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-02-23  Sebastian Pop  <sebastian.pop@amd.com>
+
+	* configure.ac: Add -lpwl to ppllibs.
+	* configure: Regenerated.
+
 2011-02-16  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
 	* MAINTAINERS: Add myself as testsuite maintainer.
diff --git a/configure b/configure
index ac7db39..997282f 100755
--- a/configure
+++ b/configure
@@ -5660,8 +5660,9 @@ fi
 
 
 # Check for PPL
-ppllibs=" -lppl_c -lppl -lgmpxx"
+ppllibs=
 pplinc=
+pwllib=
 
 
 # Check whether --with-ppl was given.
@@ -5682,52 +5683,110 @@ if test "${with_ppl_lib+set}" = set; then :
 fi
 
 
+# Check whether --enable-ppl-version-check was given.
+if test "${enable_ppl_version_check+set}" = set; then :
+  enableval=$enable_ppl_version_check;
+fi
+
+
 case $with_ppl in
-  no)
-    ppllibs=
-    ;;
-  "" | yes)
+  yes | no | "")
     ;;
   *)
-    ppllibs="-L$with_ppl/lib -lppl_c -lppl -lgmpxx"
+    ppllibs="-L$with_ppl/lib"
     pplinc="-I$with_ppl/include $pplinc"
+    if test -d "$with_ppl/lib" && test -d "$with_ppl/include"; then
+      with_ppl=yes
+    else
+      as_fn_error "cannot find directories \"$with_ppl/lib\" or \"$with_ppl/include\"" "$LINENO" 5
+    fi
     ;;
 esac
-if test "x$with_ppl_include" != x; then
+
+if test x"$with_ppl_include" != x; then
   pplinc="-I$with_ppl_include $pplinc"
+  with_ppl=yes
 fi
+
 if test "x$with_ppl_lib" != x; then
-  ppllibs="-L$with_ppl_lib -lppl_c -lppl -lgmpxx"
+  ppllibs="-L$with_ppl_lib"
+  with_ppl=yes
 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 '
+
+if test x"$with_ppl$with_ppl_include$with_ppl_lib" = x && test -d ${srcdir}/ppl; then
+  if test x"$enable_watchdog" = xyes; then
+    pwllib="-lpwl"
+  fi
+  ppllibs='-L$$r/$(HOST_SUBDIR)/ppl/interfaces/C/'"$lt_cv_objdir"' -L$$r/$(HOST_SUBDIR)/ppl/src/'"$lt_cv_objdir"
   pplinc='-I$$r/$(HOST_SUBDIR)/ppl/src -I$$r/$(HOST_SUBDIR)/ppl/interfaces/C '
   enable_ppl_version_check=no
+  with_ppl=yes
 fi
 
-# Check whether --enable-ppl-version-check was given.
-if test "${enable_ppl_version_check+set}" = set; then :
-  enableval=$enable_ppl_version_check; ENABLE_PPL_CHECK=$enableval
+if test "x$with_ppl" = xyes; then
+  if test "x$pwllib" = x; then
+    saved_LDFLAGS="$LDFLAGS"
+    LDFLAGS="$LDFLAGS $ppllibs"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PWL_handle_timeout in -lpwl" >&5
+$as_echo_n "checking for PWL_handle_timeout in -lpwl... " >&6; }
+if test "${ac_cv_lib_pwl_PWL_handle_timeout+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpwl  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char PWL_handle_timeout ();
+int
+main ()
+{
+return PWL_handle_timeout ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_pwl_PWL_handle_timeout=yes
 else
-  ENABLE_PPL_CHECK=yes
+  ac_cv_lib_pwl_PWL_handle_timeout=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pwl_PWL_handle_timeout" >&5
+$as_echo "$ac_cv_lib_pwl_PWL_handle_timeout" >&6; }
+if test "x$ac_cv_lib_pwl_PWL_handle_timeout" = x""yes; then :
+  pwllib="-lpwl"
 fi
 
+    LDFLAGS="$saved_LDFLAGS"
+  fi
 
-if test "x$with_ppl" != "xno" -a "${ENABLE_PPL_CHECK}" = "yes"; then
-  saved_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS $pplinc $gmpinc"
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for version 0.11 (or later revision) of PPL" >&5
-$as_echo_n "checking for version 0.11 (or later revision) of PPL... " >&6; }
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  ppllibs="$ppllibs -lppl_c -lppl $pwllib -lgmpxx"
+
+  if test "$enable_ppl_version_check" != no; then
+    saved_CFLAGS="$CFLAGS"
+    CFLAGS="$CFLAGS $pplinc $gmpinc"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for version 0.11 (revision 0 or later) of PPL" >&5
+$as_echo_n "checking for version 0.11 (revision 0 or later) of PPL... " >&6; }
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include "ppl_c.h"
 int
 main ()
 {
 
-  #if PPL_VERSION_MAJOR != 0 || PPL_VERSION_MINOR < 11
-  choke me
-  #endif
+    #if PPL_VERSION_MAJOR != 0 || PPL_VERSION_MINOR < 11
+    choke me
+    #endif
 
   ;
   return 0;
@@ -5741,7 +5800,8 @@ else
 $as_echo "no" >&6; }; ppllibs= ; pplinc= ; with_ppl=no
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  CFLAGS="$saved_CFLAGS"
+    CFLAGS="$saved_CFLAGS"
+  fi
 fi
 
 # Flags needed for PPL
diff --git a/configure.ac b/configure.ac
index 9121d65..4fb29c0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1621,8 +1621,9 @@ AC_ARG_WITH(boot-ldflags,
 AC_SUBST(poststage1_ldflags)
 
 # Check for PPL
-ppllibs=" -lppl_c -lppl -lgmpxx"
+ppllibs=
 pplinc=
+pwllib=
 
 AC_ARG_WITH(ppl,
 [AS_HELP_STRING([--with-ppl=PATH],
@@ -1636,45 +1637,65 @@ AC_ARG_WITH(ppl-lib,
 [AS_HELP_STRING([--with-ppl-lib=PATH],
 		[specify directory for the installed PPL library])])
 
-case $with_ppl in 
-  no)
-    ppllibs=
-    ;;
-  "" | yes)
+AC_ARG_ENABLE(ppl-version-check,
+[AS_HELP_STRING([--disable-ppl-version-check],
+		[disable check for PPL version])])
+
+case $with_ppl in
+  yes | no | "")
     ;;
   *)
-    ppllibs="-L$with_ppl/lib -lppl_c -lppl -lgmpxx"
+    ppllibs="-L$with_ppl/lib"
     pplinc="-I$with_ppl/include $pplinc"
+    if test -d "$with_ppl/lib" && test -d "$with_ppl/include"; then
+      with_ppl=yes
+    else
+      AC_MSG_ERROR([cannot find directories "$with_ppl/lib" or "$with_ppl/include"])
+    fi
     ;;
 esac
-if test "x$with_ppl_include" != x; then
+
+if test x"$with_ppl_include" != x; then
   pplinc="-I$with_ppl_include $pplinc"
+  with_ppl=yes
 fi
+
 if test "x$with_ppl_lib" != x; then
-  ppllibs="-L$with_ppl_lib -lppl_c -lppl -lgmpxx"
+  ppllibs="-L$with_ppl_lib"
+  with_ppl=yes
 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 '
+
+if test x"$with_ppl$with_ppl_include$with_ppl_lib" = x && test -d ${srcdir}/ppl; then
+  if test x"$enable_watchdog" = xyes; then
+    pwllib="-lpwl"
+  fi
+  ppllibs='-L$$r/$(HOST_SUBDIR)/ppl/interfaces/C/'"$lt_cv_objdir"' -L$$r/$(HOST_SUBDIR)/ppl/src/'"$lt_cv_objdir"
   pplinc='-I$$r/$(HOST_SUBDIR)/ppl/src -I$$r/$(HOST_SUBDIR)/ppl/interfaces/C '
   enable_ppl_version_check=no
+  with_ppl=yes
 fi
 
-AC_ARG_ENABLE(ppl-version-check,
-[AS_HELP_STRING([--disable-ppl-version-check],
-		[disable check for PPL version])],
-ENABLE_PPL_CHECK=$enableval,
-ENABLE_PPL_CHECK=yes)
+if test "x$with_ppl" = xyes; then
+  if test "x$pwllib" = x; then
+    saved_LDFLAGS="$LDFLAGS"
+    LDFLAGS="$LDFLAGS $ppllibs"
+    AC_CHECK_LIB(pwl,PWL_handle_timeout,[pwllib="-lpwl"])
+    LDFLAGS="$saved_LDFLAGS"
+  fi
 
-if test "x$with_ppl" != "xno" -a "${ENABLE_PPL_CHECK}" = "yes"; then
-  saved_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS $pplinc $gmpinc"
-  AC_MSG_CHECKING([for version 0.11 (or later revision) of PPL])
-  AC_TRY_COMPILE([#include "ppl_c.h"],[
-  #if PPL_VERSION_MAJOR != 0 || PPL_VERSION_MINOR < 11
-  choke me
-  #endif
-  ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); ppllibs= ; pplinc= ; with_ppl=no ])
-  CFLAGS="$saved_CFLAGS"
+  ppllibs="$ppllibs -lppl_c -lppl $pwllib -lgmpxx"
+
+  if test "$enable_ppl_version_check" != no; then
+    saved_CFLAGS="$CFLAGS"
+    CFLAGS="$CFLAGS $pplinc $gmpinc"
+    AC_MSG_CHECKING([for version 0.11 (revision 0 or later) of PPL])
+    AC_TRY_COMPILE([#include "ppl_c.h"],[
+    #if PPL_VERSION_MAJOR != 0 || PPL_VERSION_MINOR < 11
+    choke me
+    #endif
+    ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); ppllibs= ; pplinc= ; with_ppl=no ])
+    CFLAGS="$saved_CFLAGS"
+  fi
 fi
 
 # Flags needed for PPL
-- 
1.7.1

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] Add -lpwl to ppllibs.
  2011-02-23 20:48       ` Ralf Wildenhues
@ 2011-02-23 22:08         ` Sebastian Pop
  2011-02-23 22:18         ` Sebastian Pop
  1 sibling, 0 replies; 23+ messages in thread
From: Sebastian Pop @ 2011-02-23 22:08 UTC (permalink / raw)
  To: Ralf Wildenhues, Sebastian Pop, gcc-patches, Roberto Bagnara,
	The Parma Polyhedra Library developers' list

On Wed, Feb 23, 2011 at 13:39, Ralf Wildenhues <ralf.wildenhues@gmx.de> wrote:
> Does libpwl depend on libppl_c or libppl?  If it does, then your

Roberto, could you please confirm that PWL is not dependent on PPL?

> AC_CHECK_LIB test will fail on a system with only static libraries, as
> the -lppl_c -lppl will be listed before -lpwl thus the link will fail
> due to misordering.  '-l' flags generally belong in LIBS not LDFLAGS,
> but in the AC_CHECK_LIB test you would need to ensure that eventual -L
> flags needed to find pwl would be listed in LDFLAGS.
>
> If libpwl does not depend on libppl_c or libppl, then there is one more
> questionable case: the AC_CHECK_LIB is also tried out if ppl is in-tree.
> In that case it may be the case that an out-of-tree pwl is found.  Would
> that be problematic for libpwl?  If not, then the patch is OK.  If yes,
> then the patch is still ok if you do the change I noted below inline.

Roberto, would it be possible to use a version of PWL different than
the version of PPL?  Again, I guess that PWL and PPL are independent.

> Rainer's comment applies, but as the library list was duplicated before
> your patch, I won't require fixing that issue within this patch.  It can
> be done separately, and as it is not release-critical, it can be done in
> Stage 1.

I already reworked the patch to address Rainer's comments.
I will send out an updated patch.  Thanks for your careful review.

Sebastian

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] Add -lpwl to ppllibs.
  2011-02-23  8:59     ` Sebastian Pop
  2011-02-23 13:14       ` Rainer Orth
@ 2011-02-23 20:48       ` Ralf Wildenhues
  2011-02-23 22:08         ` Sebastian Pop
  2011-02-23 22:18         ` Sebastian Pop
  1 sibling, 2 replies; 23+ messages in thread
From: Ralf Wildenhues @ 2011-02-23 20:48 UTC (permalink / raw)
  To: Sebastian Pop; +Cc: gcc-patches

* Sebastian Pop wrote on Wed, Feb 23, 2011 at 07:32:53AM CET:
> here is the updated patch.  I tested this patch with the following
> configure options:
> 
> without ppl
> --with-ppl with pwl
> --with-ppl without pwl
> --with-ppl=/path/to/ppl_with_pwl
> --with-ppl=/path/to/ppl_without_pwl
> --with-ppl-libs=/path/to/ppl_with_pwl
> --with-ppl-libs=/path/to/ppl_without_pwl
> in-tree ppl
> in-tree ppl --enable-watchdog
> in-tree ppl --disable-watchdog
> 
> Usual bootstrap and regression test in progress using --with-ppl with pwl.
> Ok for trunk?

The patch is lacking a ChangeLog entry.

Does libpwl depend on libppl_c or libppl?  If it does, then your
AC_CHECK_LIB test will fail on a system with only static libraries, as
the -lppl_c -lppl will be listed before -lpwl thus the link will fail
due to misordering.  '-l' flags generally belong in LIBS not LDFLAGS,
but in the AC_CHECK_LIB test you would need to ensure that eventual -L
flags needed to find pwl would be listed in LDFLAGS.

If libpwl does not depend on libppl_c or libppl, then there is one more
questionable case: the AC_CHECK_LIB is also tried out if ppl is in-tree.
In that case it may be the case that an out-of-tree pwl is found.  Would
that be problematic for libpwl?  If not, then the patch is OK.  If yes,
then the patch is still ok if you do the change I noted below inline.

Rainer's comment applies, but as the library list was duplicated before
your patch, I won't require fixing that issue within this patch.  It can
be done separately, and as it is not release-critical, it can be done in
Stage 1.

Thanks,
Ralf

> --- a/configure.ac
> +++ b/configure.ac
> @@ -1621,8 +1621,9 @@ AC_ARG_WITH(boot-ldflags,
>  AC_SUBST(poststage1_ldflags)
>  
>  # Check for PPL
> -ppllibs=" -lppl_c -lppl -lgmpxx"
> +ppllibs=
>  pplinc=
> +pwllib=
>  
>  AC_ARG_WITH(ppl,
>  [AS_HELP_STRING([--with-ppl=PATH],
> @@ -1636,14 +1637,14 @@ AC_ARG_WITH(ppl-lib,
>  [AS_HELP_STRING([--with-ppl-lib=PATH],
>  		[specify directory for the installed PPL library])])
>  
> -case $with_ppl in 
> +case $with_ppl in
>    no)
> -    ppllibs=
>      ;;
>    "" | yes)
> +    ppllibs="-lppl_c -lppl"
>      ;;
>    *)
> -    ppllibs="-L$with_ppl/lib -lppl_c -lppl -lgmpxx"
> +    ppllibs="-L$with_ppl/lib -lppl_c -lppl"
>      pplinc="-I$with_ppl/include $pplinc"
>      ;;
>  esac
> @@ -1651,10 +1652,13 @@ if test "x$with_ppl_include" != x; then
>    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"
>  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 '
> +  if test "x$enable_watchdog" = xyes; then
> +    pwllib="-lpwl"
> +  fi
> +  ppllibs='-L$$r/$(HOST_SUBDIR)/ppl/interfaces/C/'"$lt_cv_objdir"' -L$$r/$(HOST_SUBDIR)/ppl/src/'"$lt_cv_objdir"' -lppl_c -lppl '
>    pplinc='-I$$r/$(HOST_SUBDIR)/ppl/src -I$$r/$(HOST_SUBDIR)/ppl/interfaces/C '
>    enable_ppl_version_check=no
>  fi
> @@ -1677,6 +1681,16 @@ if test "x$with_ppl" != "xno" -a "${ENABLE_PPL_CHECK}" = "yes"; then
>    CFLAGS="$saved_CFLAGS"
>  fi
>  
> +if test "x$ppllibs" != x; then
> +  if test "x$pwllib" = x; then

Instead of this line, use
    if test "x$pwllib" = x && test ! -d ${srcdir}/ppl; then

> +    saved_LDFLAGS="$LDFLAGS"
> +    LDFLAGS="$LDFLAGS $ppllibs"
> +    AC_CHECK_LIB(pwl,PWL_handle_timeout,[pwllib="-lpwl"])
> +    LDFLAGS="$saved_LDFLAGS"
> +  fi
> +  ppllibs="$ppllibs $pwllib -lgmpxx"
> +fi
> +
>  # Flags needed for PPL
>  AC_SUBST(ppllibs)
>  AC_SUBST(pplinc)

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] Add -lpwl to ppllibs.
  2011-02-23  8:59     ` Sebastian Pop
@ 2011-02-23 13:14       ` Rainer Orth
  2011-02-23 20:48       ` Ralf Wildenhues
  1 sibling, 0 replies; 23+ messages in thread
From: Rainer Orth @ 2011-02-23 13:14 UTC (permalink / raw)
  To: Sebastian Pop; +Cc: ralf.wildenhues, gcc-patches

Sebastian Pop <sebpop@gmail.com> writes:

> diff --git a/configure.ac b/configure.ac
> index 9121d65..05c295e 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -1621,8 +1621,9 @@ AC_ARG_WITH(boot-ldflags,
>  AC_SUBST(poststage1_ldflags)
>  
>  # Check for PPL
> -ppllibs=" -lppl_c -lppl -lgmpxx"
> +ppllibs=
>  pplinc=
> +pwllib=
>  
>  AC_ARG_WITH(ppl,
>  [AS_HELP_STRING([--with-ppl=PATH],
> @@ -1636,14 +1637,14 @@ AC_ARG_WITH(ppl-lib,
>  [AS_HELP_STRING([--with-ppl-lib=PATH],
>  		[specify directory for the installed PPL library])])
>  
> -case $with_ppl in 
> +case $with_ppl in
>    no)
> -    ppllibs=
>      ;;
>    "" | yes)
> +    ppllibs="-lppl_c -lppl"
>      ;;
>    *)
> -    ppllibs="-L$with_ppl/lib -lppl_c -lppl -lgmpxx"
> +    ppllibs="-L$with_ppl/lib -lppl_c -lppl"
>      pplinc="-I$with_ppl/include $pplinc"
>      ;;
>  esac
> @@ -1651,10 +1652,13 @@ if test "x$with_ppl_include" != x; then
>    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"
>  fi

Could you please avoid duplicating -lppl_c -lppl over and over again?
This is a complete maintenance nightmare.

Thanks.
	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH] Add -lpwl to ppllibs.
  2011-02-22  8:20   ` Ralf Wildenhues
  2011-02-22  9:54     ` Paolo Bonzini
@ 2011-02-23  8:59     ` Sebastian Pop
  2011-02-23 13:14       ` Rainer Orth
  2011-02-23 20:48       ` Ralf Wildenhues
  1 sibling, 2 replies; 23+ messages in thread
From: Sebastian Pop @ 2011-02-23  8:59 UTC (permalink / raw)
  To: ralf.wildenhues; +Cc: gcc-patches, Sebastian Pop

Hi Ralf,

here is the updated patch.  I tested this patch with the following
configure options:

without ppl
--with-ppl with pwl
--with-ppl without pwl
--with-ppl=/path/to/ppl_with_pwl
--with-ppl=/path/to/ppl_without_pwl
--with-ppl-libs=/path/to/ppl_with_pwl
--with-ppl-libs=/path/to/ppl_without_pwl
in-tree ppl
in-tree ppl --enable-watchdog
in-tree ppl --disable-watchdog

Usual bootstrap and regression test in progress using --with-ppl with pwl.
Ok for trunk?

Thanks,
Sebastian

---
 configure    |   63 +++++++++++++++++++++++++++++++++++++++++++++++++++++----
 configure.ac |   26 ++++++++++++++++++-----
 2 files changed, 78 insertions(+), 11 deletions(-)

diff --git a/configure b/configure
index ac7db39..5b0c615 100755
--- a/configure
+++ b/configure
@@ -5660,8 +5660,9 @@ fi
 
 
 # Check for PPL
-ppllibs=" -lppl_c -lppl -lgmpxx"
+ppllibs=
 pplinc=
+pwllib=
 
 
 # Check whether --with-ppl was given.
@@ -5684,12 +5685,12 @@ fi
 
 case $with_ppl in
   no)
-    ppllibs=
     ;;
   "" | yes)
+    ppllibs="-lppl_c -lppl"
     ;;
   *)
-    ppllibs="-L$with_ppl/lib -lppl_c -lppl -lgmpxx"
+    ppllibs="-L$with_ppl/lib -lppl_c -lppl"
     pplinc="-I$with_ppl/include $pplinc"
     ;;
 esac
@@ -5697,10 +5698,13 @@ if test "x$with_ppl_include" != x; then
   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"
 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 '
+  if test "x$enable_watchdog" = xyes; then
+    pwllib="-lpwl"
+  fi
+  ppllibs='-L$$r/$(HOST_SUBDIR)/ppl/interfaces/C/'"$lt_cv_objdir"' -L$$r/$(HOST_SUBDIR)/ppl/src/'"$lt_cv_objdir"' -lppl_c -lppl '
   pplinc='-I$$r/$(HOST_SUBDIR)/ppl/src -I$$r/$(HOST_SUBDIR)/ppl/interfaces/C '
   enable_ppl_version_check=no
 fi
@@ -5744,6 +5748,55 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   CFLAGS="$saved_CFLAGS"
 fi
 
+if test "x$ppllibs" != x; then
+  if test "x$pwllib" = x; then
+    saved_LDFLAGS="$LDFLAGS"
+    LDFLAGS="$LDFLAGS $ppllibs"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PWL_handle_timeout in -lpwl" >&5
+$as_echo_n "checking for PWL_handle_timeout in -lpwl... " >&6; }
+if test "${ac_cv_lib_pwl_PWL_handle_timeout+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpwl  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char PWL_handle_timeout ();
+int
+main ()
+{
+return PWL_handle_timeout ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_pwl_PWL_handle_timeout=yes
+else
+  ac_cv_lib_pwl_PWL_handle_timeout=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pwl_PWL_handle_timeout" >&5
+$as_echo "$ac_cv_lib_pwl_PWL_handle_timeout" >&6; }
+if test "x$ac_cv_lib_pwl_PWL_handle_timeout" = x""yes; then :
+  pwllib="-lpwl"
+fi
+
+    LDFLAGS="$saved_LDFLAGS"
+  fi
+  ppllibs="$ppllibs $pwllib -lgmpxx"
+fi
+
 # Flags needed for PPL
 
 
diff --git a/configure.ac b/configure.ac
index 9121d65..05c295e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1621,8 +1621,9 @@ AC_ARG_WITH(boot-ldflags,
 AC_SUBST(poststage1_ldflags)
 
 # Check for PPL
-ppllibs=" -lppl_c -lppl -lgmpxx"
+ppllibs=
 pplinc=
+pwllib=
 
 AC_ARG_WITH(ppl,
 [AS_HELP_STRING([--with-ppl=PATH],
@@ -1636,14 +1637,14 @@ AC_ARG_WITH(ppl-lib,
 [AS_HELP_STRING([--with-ppl-lib=PATH],
 		[specify directory for the installed PPL library])])
 
-case $with_ppl in 
+case $with_ppl in
   no)
-    ppllibs=
     ;;
   "" | yes)
+    ppllibs="-lppl_c -lppl"
     ;;
   *)
-    ppllibs="-L$with_ppl/lib -lppl_c -lppl -lgmpxx"
+    ppllibs="-L$with_ppl/lib -lppl_c -lppl"
     pplinc="-I$with_ppl/include $pplinc"
     ;;
 esac
@@ -1651,10 +1652,13 @@ if test "x$with_ppl_include" != x; then
   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"
 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 '
+  if test "x$enable_watchdog" = xyes; then
+    pwllib="-lpwl"
+  fi
+  ppllibs='-L$$r/$(HOST_SUBDIR)/ppl/interfaces/C/'"$lt_cv_objdir"' -L$$r/$(HOST_SUBDIR)/ppl/src/'"$lt_cv_objdir"' -lppl_c -lppl '
   pplinc='-I$$r/$(HOST_SUBDIR)/ppl/src -I$$r/$(HOST_SUBDIR)/ppl/interfaces/C '
   enable_ppl_version_check=no
 fi
@@ -1677,6 +1681,16 @@ if test "x$with_ppl" != "xno" -a "${ENABLE_PPL_CHECK}" = "yes"; then
   CFLAGS="$saved_CFLAGS"
 fi
 
+if test "x$ppllibs" != x; then
+  if test "x$pwllib" = x; then
+    saved_LDFLAGS="$LDFLAGS"
+    LDFLAGS="$LDFLAGS $ppllibs"
+    AC_CHECK_LIB(pwl,PWL_handle_timeout,[pwllib="-lpwl"])
+    LDFLAGS="$saved_LDFLAGS"
+  fi
+  ppllibs="$ppllibs $pwllib -lgmpxx"
+fi
+
 # Flags needed for PPL
 AC_SUBST(ppllibs)
 AC_SUBST(pplinc)
-- 
1.7.1

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] Add -lpwl to ppllibs.
  2011-02-22  8:20   ` Ralf Wildenhues
@ 2011-02-22  9:54     ` Paolo Bonzini
  2011-02-23  8:59     ` Sebastian Pop
  1 sibling, 0 replies; 23+ messages in thread
From: Paolo Bonzini @ 2011-02-22  9:54 UTC (permalink / raw)
  To: Ralf Wildenhues, Sebastian Pop, gcc-patches

On 02/22/2011 06:48 AM, Ralf Wildenhues wrote:
> Although, looking again, this is the first AC_CHECK_LIB test added to
> toplevel.  I'm wondering whether there is something I'm completely
> overlooking again.  Hmm, one can do link tests for the host compiler,
> no?  Paolo?

Yes.  It's just that all these tests should actually be moved to gcc/, 
IMO.  Graphite (and before it, GMP/MPFR) have been abusing a bit the 
toplevel.

Paolo

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] Add -lpwl to ppllibs.
  2011-02-18 17:54 ` [PATCH] Add -lpwl to ppllibs Sebastian Pop
@ 2011-02-22  8:20   ` Ralf Wildenhues
  2011-02-22  9:54     ` Paolo Bonzini
  2011-02-23  8:59     ` Sebastian Pop
  0 siblings, 2 replies; 23+ messages in thread
From: Ralf Wildenhues @ 2011-02-22  8:20 UTC (permalink / raw)
  To: Sebastian Pop, Paolo Bonzini; +Cc: gcc-patches

Hello Sebastian,

* Sebastian Pop wrote on Fri, Feb 18, 2011 at 06:40:20PM CET:
> here is the patch with the changes that you requested:
> 
> 	* configure.ac: Use AC_CHECK_LIB to check for -lpwl.
> 	* configure: Regenerated.
> 
> This passed regstrap on amd64-linux.  I tested on two different
> machines one having and the other one without libpwl.  Ok for trunk?

> --- a/configure.ac
> +++ b/configure.ac
> @@ -1621,7 +1621,9 @@ AC_ARG_WITH(boot-ldflags,
>  AC_SUBST(poststage1_ldflags)
>  
>  # Check for PPL
> -ppllibs=" -lppl_c -lppl -lgmpxx"
> +pwllib=
> +AC_CHECK_LIB(pwl,PWL_handle_timeout,[pwllib="-lpwl"])
> +ppllibs=" -lppl_c -lppl $pwllib -lgmpxx"

This seems is OK.

Although, looking again, this is the first AC_CHECK_LIB test added to
toplevel.  I'm wondering whether there is something I'm completely
overlooking again.  Hmm, one can do link tests for the host compiler,
no?  Paolo?

>  pplinc=
>  
>  AC_ARG_WITH(ppl,
> @@ -1643,7 +1645,7 @@ case $with_ppl in
>    "" | yes)
>      ;;
>    *)
> -    ppllibs="-L$with_ppl/lib -lppl_c -lppl -lgmpxx"
> +    ppllibs="-L$with_ppl/lib -lppl_c -lppl $pwllib -lgmpxx"

This doesn't make sense to me.  If you need -L$with_ppl/lib to link with
PPL, then most likely the test for libpwl would have needed that flag as
well in order to be correct.  So it seems it would need here a link test
for libpwl with -L$with_ppl/lib but none of the other libraries added.

>      pplinc="-I$with_ppl/include $pplinc"
>      ;;
>  esac
> @@ -1651,10 +1653,10 @@ if test "x$with_ppl_include" != x; then
>    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 $pwllib -lgmpxx"

Likewise, the test would have needed -L$with_ppl_lib here.

>  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 '"$pwllib"' -lgmpxx '

The check above doesn't check the in-tree ppl, so it cannot tell you an
answer about the in-tree library (and it may not even have been built
yet).  OTOH, toplevel configure knows how ppl will be built: it will
create its configure command line.  I think your only chance to get
things right here is to look for --enable* or --with* flags passed by
the user (you can check the right $enable_* or $with_* variable instead,
i.e., in this case $enable_watchdog), or be sure to pass them correctly
to ppl.

>    pplinc='-I$$r/$(HOST_SUBDIR)/ppl/src -I$$r/$(HOST_SUBDIR)/ppl/interfaces/C '
>    enable_ppl_version_check=no
>  fi

When testing a patch for this change, it should be completely sufficient
to run toplevel configure and then 'grep ppllibs config.status' to see
that things worked.  But configure should be run with each of the above
option combinations (--with-ppl, --with-ppl-lib, none of these, and
in-tree PPL with or without --enable-watchdog) and once each with the
library present and once absent.  And, I suppose, one cross setup
bootstrap.

Thanks,
Ralf

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH] Add -lpwl to ppllibs.
  2011-02-16  7:24 Cloog ISL - and linking of libisl Ralf Wildenhues
@ 2011-02-18 17:54 ` Sebastian Pop
  2011-02-22  8:20   ` Ralf Wildenhues
  0 siblings, 1 reply; 23+ messages in thread
From: Sebastian Pop @ 2011-02-18 17:54 UTC (permalink / raw)
  To: ralf.wildenhues; +Cc: gcc-patches, Sebastian Pop

Hi Ralf,
here is the patch with the changes that you requested:

	* configure.ac: Use AC_CHECK_LIB to check for -lpwl.
	* configure: Regenerated.

This passed regstrap on amd64-linux.  I tested on two different
machines one having and the other one without libpwl.  Ok for trunk?

Thanks,
Sebastian

---
 configure    |   49 +++++++++++++++++++++++++++++++++++++++++++++----
 configure.ac |   10 ++++++----
 2 files changed, 51 insertions(+), 8 deletions(-)

diff --git a/configure b/configure
index ac7db39..38e44fc 100755
--- a/configure
+++ b/configure
@@ -5660,7 +5660,48 @@ fi
 
 
 # Check for PPL
-ppllibs=" -lppl_c -lppl -lgmpxx"
+pwllib=
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PWL_handle_timeout in -lpwl" >&5
+$as_echo_n "checking for PWL_handle_timeout in -lpwl... " >&6; }
+if test "${ac_cv_lib_pwl_PWL_handle_timeout+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpwl  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char PWL_handle_timeout ();
+int
+main ()
+{
+return PWL_handle_timeout ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_pwl_PWL_handle_timeout=yes
+else
+  ac_cv_lib_pwl_PWL_handle_timeout=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pwl_PWL_handle_timeout" >&5
+$as_echo "$ac_cv_lib_pwl_PWL_handle_timeout" >&6; }
+if test "x$ac_cv_lib_pwl_PWL_handle_timeout" = x""yes; then :
+  pwllib="-lpwl"
+fi
+
+ppllibs=" -lppl_c -lppl $pwllib -lgmpxx"
 pplinc=
 
 
@@ -5689,7 +5730,7 @@ case $with_ppl in
   "" | yes)
     ;;
   *)
-    ppllibs="-L$with_ppl/lib -lppl_c -lppl -lgmpxx"
+    ppllibs="-L$with_ppl/lib -lppl_c -lppl $pwllib -lgmpxx"
     pplinc="-I$with_ppl/include $pplinc"
     ;;
 esac
@@ -5697,10 +5738,10 @@ if test "x$with_ppl_include" != x; then
   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 $pwllib -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 '"$pwllib"' -lgmpxx '
   pplinc='-I$$r/$(HOST_SUBDIR)/ppl/src -I$$r/$(HOST_SUBDIR)/ppl/interfaces/C '
   enable_ppl_version_check=no
 fi
diff --git a/configure.ac b/configure.ac
index 9121d65..4adb989 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1621,7 +1621,9 @@ AC_ARG_WITH(boot-ldflags,
 AC_SUBST(poststage1_ldflags)
 
 # Check for PPL
-ppllibs=" -lppl_c -lppl -lgmpxx"
+pwllib=
+AC_CHECK_LIB(pwl,PWL_handle_timeout,[pwllib="-lpwl"])
+ppllibs=" -lppl_c -lppl $pwllib -lgmpxx"
 pplinc=
 
 AC_ARG_WITH(ppl,
@@ -1643,7 +1645,7 @@ case $with_ppl in
   "" | yes)
     ;;
   *)
-    ppllibs="-L$with_ppl/lib -lppl_c -lppl -lgmpxx"
+    ppllibs="-L$with_ppl/lib -lppl_c -lppl $pwllib -lgmpxx"
     pplinc="-I$with_ppl/include $pplinc"
     ;;
 esac
@@ -1651,10 +1653,10 @@ if test "x$with_ppl_include" != x; then
   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 $pwllib -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 '"$pwllib"' -lgmpxx '
   pplinc='-I$$r/$(HOST_SUBDIR)/ppl/src -I$$r/$(HOST_SUBDIR)/ppl/interfaces/C '
   enable_ppl_version_check=no
 fi
-- 
1.7.1

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2011-03-02 18:43 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-02 12:32 [PATCH] Add -lpwl to ppllibs Dominique Dhumieres
  -- strict thread matches above, loose matches on Subject: below --
2011-02-16  7:24 Cloog ISL - and linking of libisl Ralf Wildenhues
2011-02-18 17:54 ` [PATCH] Add -lpwl to ppllibs Sebastian Pop
2011-02-22  8:20   ` Ralf Wildenhues
2011-02-22  9:54     ` Paolo Bonzini
2011-02-23  8:59     ` Sebastian Pop
2011-02-23 13:14       ` Rainer Orth
2011-02-23 20:48       ` Ralf Wildenhues
2011-02-23 22:08         ` Sebastian Pop
2011-02-23 22:18         ` Sebastian Pop
2011-02-27  8:38           ` Ralf Wildenhues
2011-02-27  8:10             ` Sebastian Pop
2011-02-27 11:35               ` Ralf Wildenhues
2011-03-02  3:53                 ` Sebastian Pop
2011-03-02 12:20                   ` Richard Guenther
2011-03-02 12:45                     ` Paolo Carlini
2011-03-02 12:57                       ` Jakub Jelinek
2011-03-02 18:43                         ` Sebastian Pop
2011-03-02 14:49                     ` Sebastian Pop
2011-03-02 15:02                       ` Richard Guenther
2011-03-02 15:07                         ` Sebastian Pop
2011-03-02 15:09                           ` Richard Guenther
2011-03-02 15:15                         ` Paolo Carlini
2011-03-02 15:21                           ` Sebastian Pop

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).