public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix GRAPHITE configure
@ 2009-10-20 13:00 Richard Guenther
  2009-10-20 13:16 ` Richard Guenther
  0 siblings, 1 reply; 7+ messages in thread
From: Richard Guenther @ 2009-10-20 13:00 UTC (permalink / raw)
  To: gcc-patches; +Cc: spop


It seems that even though the documentation states that --with-cloog
and --with-ppl need only be specified if cloog/ppl do not reside in
the default search paths graphite is disabled if I do not specify
them (with a correct path even).

Looking at the configure

# Check for CLOOG
clooglibs=" -lcloog "
clooginc=" -DCLOOG_PPL_BACKEND "

AC_ARG_WITH(cloog, [  --with-cloog=PATH       Specify prefix directory for 
the installed CLooG-PPL package
                          Equivalent to --with-cloog-include=PATH/include
                          plus --with-cloog-lib=PATH/lib],, with_cloog=no)
AC_ARG_WITH(cloog_include, [  --with-cloog-include=PATH Specify directory 
for installed CLooG include files])
AC_ARG_WITH(cloog_lib, [  --with-cloog-lib=PATH   Specify the directory 
for the installed CLooG library])

case $with_cloog in
  no)
    clooglibs=
    clooginc=
    ;;
  *)
    clooglibs="-L$with_cloog/lib -lcloog"
    clooginc="-I$with_cloog/include -DCLOOG_PPL_BACKEND "
    LIBS="$clooglibs $LIBS"
    ;;
esac

it seems clear that without specifying --with-cloog with_cloog will
be "no" and thus while the header checks will report success (and
thus also config.log is silent about not using graphite) CLOOGLIBS
will be empty and thus gcc/configure will set HAVE_cloog to 0.

So, what is wrong here, the documentation or the configure?  Even
just specifying --with-cloog --with-ppl will not work as then I get

HOST_CLOOGLIBS = -Lyes/lib -lcloog
HOST_CLOOGINC = -Iyes/include -DCLOOG_PPL_BACKEND

but still

checking for version 0.10 of PPL... yes
checking for correct version of CLooG... yes

so I believe all these checks are somehow broken.  At least the above
should also have

  yes)
   ;;

and IMHO AC_ARG_WITH shouldn't have with_cloog=no in its default
so only --without-cloog will set with_cloog=no.  Then the header
checks shouldn't run if --without-cloog is specified, that only
confuses the user.  Also with --without-ppl cloog should be disabled
as well, otherwise we'll still enable graphite but fail to link
later.

Thus, like the following.  Tested with all sorts of
--with[out]-{ppl,cloog} combinations.

Ok for trunk?

Thanks,
Richard.

2009-10-20  Richard Guenther  <rguenther@suse.de>

	* configure.ac: Adjust the ppl and cloog configure to work as
	documented.  Disable cloog if ppl was disabled.  Omit the version
	checks if they were disabled.
	* configure: Re-generate.

Index: configure.ac
===================================================================
*** configure.ac	(revision 153009)
--- configure.ac	(working copy)
*************** pplinc=
*** 1514,1520 ****
  
  AC_ARG_WITH(ppl, [  --with-ppl=PATH         Specify prefix directory for the installed PPL package
                            Equivalent to --with-ppl-include=PATH/include
!                           plus --with-ppl-lib=PATH/lib],, with_ppl=no)
  AC_ARG_WITH(ppl_include, [  --with-ppl-include=PATH Specify directory for installed PPL include files])
  AC_ARG_WITH(ppl_lib, [  --with-ppl-lib=PATH     Specify the directory for the installed PPL library])
  
--- 1514,1520 ----
  
  AC_ARG_WITH(ppl, [  --with-ppl=PATH         Specify prefix directory for the installed PPL package
                            Equivalent to --with-ppl-include=PATH/include
!                           plus --with-ppl-lib=PATH/lib],,)
  AC_ARG_WITH(ppl_include, [  --with-ppl-include=PATH Specify directory for installed PPL include files])
  AC_ARG_WITH(ppl_lib, [  --with-ppl-lib=PATH     Specify the directory for the installed PPL library])
  
*************** case $with_ppl in
*** 1522,1527 ****
--- 1522,1529 ----
    no)
      ppllibs=
      ;;
+   yes)
+     ;;
    *)
      ppllibs="-L$with_ppl/lib -lppl_c -lppl -lgmpxx"
      pplinc="-I$with_ppl/include $pplinc"
*************** AC_ARG_ENABLE(ppl-version-check,
*** 1546,1552 ****
  ENABLE_PPL_CHECK=$enableval,
  ENABLE_PPL_CHECK=yes)
  
! if test "${ENABLE_PPL_CHECK}" = "yes"; then
    saved_CFLAGS="$CFLAGS"
    CFLAGS="$CFLAGS $pplinc $gmpinc"
    AC_MSG_CHECKING([for version $ppl_major_version.$ppl_minor_version of PPL])
--- 1548,1554 ----
  ENABLE_PPL_CHECK=$enableval,
  ENABLE_PPL_CHECK=yes)
  
! if test "x$with_ppl" != "xno" -a "${ENABLE_PPL_CHECK}" = "yes"; then
    saved_CFLAGS="$CFLAGS"
    CFLAGS="$CFLAGS $pplinc $gmpinc"
    AC_MSG_CHECKING([for version $ppl_major_version.$ppl_minor_version of PPL])
*************** clooginc=" -DCLOOG_PPL_BACKEND "
*** 1569,1583 ****
  
  AC_ARG_WITH(cloog, [  --with-cloog=PATH       Specify prefix directory for the installed CLooG-PPL package
                            Equivalent to --with-cloog-include=PATH/include
!                           plus --with-cloog-lib=PATH/lib],, with_cloog=no)
  AC_ARG_WITH(cloog_include, [  --with-cloog-include=PATH Specify directory for installed CLooG include files])
  AC_ARG_WITH(cloog_lib, [  --with-cloog-lib=PATH   Specify the directory for the installed CLooG library])
  
  case $with_cloog in 
    no)
      clooglibs=
      clooginc=
      ;;
    *)
      clooglibs="-L$with_cloog/lib -lcloog"
      clooginc="-I$with_cloog/include -DCLOOG_PPL_BACKEND "
--- 1571,1591 ----
  
  AC_ARG_WITH(cloog, [  --with-cloog=PATH       Specify prefix directory for the installed CLooG-PPL package
                            Equivalent to --with-cloog-include=PATH/include
!                           plus --with-cloog-lib=PATH/lib],,)
  AC_ARG_WITH(cloog_include, [  --with-cloog-include=PATH Specify directory for installed CLooG include files])
  AC_ARG_WITH(cloog_lib, [  --with-cloog-lib=PATH   Specify the directory for the installed CLooG library])
  
+ if test "x$with_ppl" == "xno"; then
+   with_cloog=no
+ fi
+ 
  case $with_cloog in 
    no)
      clooglibs=
      clooginc=
      ;;
+   yes)
+     ;;
    *)
      clooglibs="-L$with_cloog/lib -lcloog"
      clooginc="-I$with_cloog/include -DCLOOG_PPL_BACKEND "
*************** AC_ARG_ENABLE(cloog-version-check,
*** 1602,1608 ****
  ENABLE_CLOOG_CHECK=$enableval,
  ENABLE_CLOOG_CHECK=yes)
  
! if test "${ENABLE_CLOOG_CHECK}" = "yes"; then
    saved_CFLAGS="$CFLAGS"
    CFLAGS="$CFLAGS $clooginc $gmpinc $pplinc"
    AC_MSG_CHECKING([for correct version of CLooG])
--- 1610,1616 ----
  ENABLE_CLOOG_CHECK=$enableval,
  ENABLE_CLOOG_CHECK=yes)
  
! if test "x$with_cloog" != "xno" -a "${ENABLE_CLOOG_CHECK}" = "yes"; then
    saved_CFLAGS="$CFLAGS"
    CFLAGS="$CFLAGS $clooginc $gmpinc $pplinc"
    AC_MSG_CHECKING([for correct version of CLooG])

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

end of thread, other threads:[~2009-10-24  6:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-20 13:00 [PATCH] Fix GRAPHITE configure Richard Guenther
2009-10-20 13:16 ` Richard Guenther
2009-10-20 17:11   ` Dave Korn
2009-10-20 18:52     ` Loren James Rittle
2009-10-20 17:14   ` Sebastian Pop
2009-10-20 17:36     ` Paolo Bonzini
2009-10-24  8:04   ` Ryan Hill

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).