From patchwork Fri Feb 18 17:40:20 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Pop X-Patchwork-Id: 83630 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 06F4EB7116 for ; Sat, 19 Feb 2011 04:41:02 +1100 (EST) Received: (qmail 16113 invoked by alias); 18 Feb 2011 17:40:52 -0000 Received: (qmail 16015 invoked by uid 22791); 18 Feb 2011 17:40:49 -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-gw0-f47.google.com (HELO mail-gw0-f47.google.com) (74.125.83.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 18 Feb 2011 17:40:43 +0000 Received: by gwj18 with SMTP id 18so102614gwj.20 for ; Fri, 18 Feb 2011 09:40:42 -0800 (PST) Received: by 10.91.3.9 with SMTP id f9mr1455336agi.165.1298050841976; Fri, 18 Feb 2011 09:40:41 -0800 (PST) Received: from napoca ([163.181.251.115]) by mx.google.com with ESMTPS id c34sm2829083anc.10.2011.02.18.09.40.39 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 18 Feb 2011 09:40:41 -0800 (PST) Received: by napoca (sSMTP sendmail emulation); Fri, 18 Feb 2011 11:40:39 -0600 From: Sebastian Pop To: ralf.wildenhues@gmx.de Cc: gcc-patches@gcc.gnu.org, Sebastian Pop Subject: [PATCH] Add -lpwl to ppllibs. Date: Fri, 18 Feb 2011 11:40:20 -0600 Message-Id: <1298050820-10451-1-git-send-email-sebpop@gmail.com> In-Reply-To: <20110216055739.GD26163@gmx.de> References: <20110216055739.GD26163@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 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