From patchwork Wed Jan 22 05:26:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5YKF57un5pmX?= X-Patchwork-Id: 37463 Received: (qmail 117957 invoked by alias); 22 Jan 2020 05:26:48 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 117944 invoked by uid 89); 22 Jan 2020 05:26:47 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-14.6 required=5.0 tests=AWL, BAYES_00, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mail-ed1-f65.google.com Received: from mail-ed1-f65.google.com (HELO mail-ed1-f65.google.com) (209.85.208.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 22 Jan 2020 05:26:40 +0000 Received: by mail-ed1-f65.google.com with SMTP id f8so5498318edv.2 for ; Tue, 21 Jan 2020 21:26:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Ntq0mgXZJF7IvrLgw0RE76IVwLOGlvjVvlhWlfnL2HI=; b=VoVHimFCwDnERsu0sj7yNYhuTOV6u9TRN/A2RNFv3qfSs32Yfg+w0IZTrg4pwzvl8E Qidolvl3pKzFbUFNoO6OE3q5CEzyxYHBa74aTBB/MPzi1jaU6stnTOzcOkvXpMDx0U8A YPCgd4JMVHD2jGoEWBMMcrcbqH6KcZVVfOBLkCzxz57YP16vRKs5HKhW1olt17APT2iC umnlx0VdoC/ku7LNzKcOo27se5CBS2GIt1ViE7iMvj8gEhewRI+MeSqbkSAs2iVWYaFa lpwHF5nLD/zHa+H06MOUkD4DtDKV7J390ZUQHII7Tz2Pmyqg3aMWkKyaPW4g8uXxYe9P RehA== MIME-Version: 1.0 References: In-Reply-To: From: =?UTF-8?B?5YKF57un5pmX?= Date: Wed, 22 Jan 2020 13:26:26 +0800 Message-ID: Subject: Re: [PATCH] Modify python-config.py or replace it with official one to support python3 To: gdb-patches Cc: Christian Biesinger add warning to explain that if no python-config found,fall back to internal copy "gdb/python/python-config.py" else --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -834,29 +834,36 @@ else esac esac + python_config= if test "${python_prog}" != missing; then + AC_CHECK_FILE([${python_prog}-config],[python_config="${python_prog}-config"],[python_config="${python_prog} ${srcdir}/python/python-config.py" +AC_MSG_WARN(python-config not found! Fall back to internal copy.)]) # We have a python program to use, but it may be too old. # Don't flag an error for --with-python=auto (the default). have_python_config=yes - python_includes=`${python_prog} ${srcdir}/python/python-config.py --includes` + python_includes=`${python_config} --includes` if test $? != 0; then have_python_config=failed if test "${with_python}" != auto; then - AC_ERROR(failure running python-config --includes) + AC_ERROR(failure running ${python_config} --includes) fi fi - python_libs=`${python_prog} ${srcdir}/python/python-config.py --ldflags` +# For python 3.8+ there must be a "--embed" flag to show lib version. + python_libs=`${python_config} --ldflags --embed` if test $? != 0; then - have_python_config=failed - if test "${with_python}" != auto; then - AC_ERROR(failure running python-config --ldflags) + python_libs=`${python_config} --ldflags` + if test $? != 0; then + have_python_config=failed + if test "${with_python}" != auto; then + AC_ERROR(failure running ${python_config} --ldflags) + fi fi fi - python_prefix=`${python_prog} ${srcdir}/python/python-config.py --exec-prefix` + python_prefix=`${python_config} --exec-prefix` if test $? != 0; then have_python_config=failed if test "${with_python}" != auto; then - AC_ERROR(failure running python-config --exec-prefix) + AC_ERROR(failure running ${python_config} --exec-prefix) fi fi