From patchwork Wed Feb 23 20:47:07 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Pop X-Patchwork-Id: 84240 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 91958B7481 for ; Thu, 24 Feb 2011 07:48:31 +1100 (EST) Received: (qmail 2133 invoked by alias); 23 Feb 2011 20:48:28 -0000 Received: (qmail 2120 invoked by uid 22791); 23 Feb 2011 20:48:26 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, TW_PX, T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-vw0-f47.google.com (HELO mail-vw0-f47.google.com) (209.85.212.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 23 Feb 2011 20:48:20 +0000 Received: by vws4 with SMTP id 4so2654241vws.20 for ; Wed, 23 Feb 2011 12:48:18 -0800 (PST) Received: by 10.52.160.37 with SMTP id xh5mr7034025vdb.249.1298494098775; Wed, 23 Feb 2011 12:48:18 -0800 (PST) Received: from napoca ([163.181.251.115]) by mx.google.com with ESMTPS id r7sm5742910vbx.19.2011.02.23.12.48.16 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 23 Feb 2011 12:48:18 -0800 (PST) Received: by napoca (sSMTP sendmail emulation); Wed, 23 Feb 2011 14:48:15 -0600 From: Sebastian Pop To: ralf.wildenhues@gmx.de Cc: gcc-patches@gcc.gnu.org, Sebastian Pop Subject: [PATCH] Add -lpwl to ppllibs. Date: Wed, 23 Feb 2011 14:47:07 -0600 Message-Id: <1298494027-24185-1-git-send-email-sebpop@gmail.com> In-Reply-To: <20110223193905.GD24784@gmx.de> References: <20110223193905.GD24784@gmx.de> X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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 * 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 + + * configure.ac: Add -lpwl to ppllibs. + * configure: Regenerated. + 2011-02-16 Rainer Orth * 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