From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17591 invoked by alias); 20 May 2010 23:04:18 -0000 Received: (qmail 17465 invoked by uid 22791); 20 May 2010 23:04:17 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (74.125.121.35) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 20 May 2010 23:04:10 +0000 Received: from wpaz5.hot.corp.google.com (wpaz5.hot.corp.google.com [172.24.198.69]) by smtp-out.google.com with ESMTP id o4KN47u3005530 for ; Thu, 20 May 2010 16:04:07 -0700 Received: from ruffy.mtv.corp.google.com (ruffy.mtv.corp.google.com [172.18.118.116]) by wpaz5.hot.corp.google.com with ESMTP id o4KN46Yw029883 for ; Thu, 20 May 2010 16:04:06 -0700 Received: by ruffy.mtv.corp.google.com (Postfix, from userid 67641) id 0D0C084398; Thu, 20 May 2010 16:04:06 -0700 (PDT) To: gdb-patches@sourceware.org Subject: [patch] Try to use python-config to get python include and lib parameters. Message-Id: <20100520230406.0D0C084398@ruffy.mtv.corp.google.com> Date: Thu, 20 May 2010 23:08:00 -0000 From: dje@google.com (Doug Evans) X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-05/txt/msg00463.txt.bz2 Hi. Building with a private copy of python, or even the system copy, sometimes requires linking with extra libraries. These libraries are listed with `python-config --ldflags'. [or --libs, but --ldflags also includes any needed -L's] I will check this in in a few days if there are no objections. 2010-05-20 Doug Evans * configure.ac: Try to use python-config to get python include and lib parameters. * configure: Regenerate. Index: configure.ac =================================================================== RCS file: /cvs/src/src/gdb/configure.ac,v retrieving revision 1.117 diff -u -p -r1.117 configure.ac --- configure.ac 23 Apr 2010 18:07:26 -0000 1.117 +++ configure.ac 20 May 2010 23:03:09 -0000 @@ -619,13 +619,28 @@ if test "${with_python}" = no; then else case "${with_python}" in yes | auto) - # Leave as empty, use defaults. - python_includes= - python_libs= + AC_PATH_PROG(python_config_path, python-config, missing) + if test "${python_config_path}" = missing; then + # Perhaps this should be an error, but 7.0 and 7.1 shipped without + # checking for python-config so in the interests of not breaking + # anything, we follow their behaviour here. + python_includes= + python_libs= + else + python_includes=`${python_config_path} --includes` + python_libs=`${python_config_path} --ldflags` + fi ;; /*) - python_includes="-I${with_python}/include" - python_libs="-L${with_python}/lib" + AC_PATH_PROG(python_config_path, python-config, missing, + [PATH = ${with_python}/bin]) + if test "${python_config_path}" = missing; then + # If an explicit path was provided, and we can't find python-config + # at that location, flag an error. + AC_ERROR(python-config missing from ${with_python}/bin) + fi + python_includes=`${python_config_path} --includes` + python_libs=`${python_config_path} --ldflags` ;; *) AC_ERROR(invalid value for --with-python)