From patchwork Wed Feb 23 06:32:53 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Pop X-Patchwork-Id: 84106 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 88D63B70CD for ; Wed, 23 Feb 2011 17:33:44 +1100 (EST) Received: (qmail 4549 invoked by alias); 23 Feb 2011 06:33:42 -0000 Received: (qmail 4541 invoked by uid 22791); 23 Feb 2011 06:33:41 -0000 X-SWARE-Spam-Status: No, hits=-2.5 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-yi0-f47.google.com (HELO mail-yi0-f47.google.com) (209.85.218.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 23 Feb 2011 06:33:37 +0000 Received: by yie16 with SMTP id 16so3615267yie.20 for ; Tue, 22 Feb 2011 22:33:35 -0800 (PST) Received: by 10.150.53.18 with SMTP id b18mr4601204yba.117.1298442815720; Tue, 22 Feb 2011 22:33:35 -0800 (PST) Received: from napoca (adsl-76-233-37-90.dsl.austtx.sbcglobal.net [76.233.37.90]) by mx.google.com with ESMTPS id v39sm4637992yba.6.2011.02.22.22.33.31 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 22 Feb 2011 22:33:33 -0800 (PST) Received: by napoca (sSMTP sendmail emulation); Wed, 23 Feb 2011 00:33:30 -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 00:32:53 -0600 Message-Id: <1298442773-21455-1-git-send-email-sebpop@gmail.com> In-Reply-To: <20110222054809.GB9035@gmx.de> References: <20110222054809.GB9035@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. 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)