From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25095 invoked by alias); 8 Feb 2010 19:26:03 -0000 Received: (qmail 25051 invoked by uid 22791); 8 Feb 2010 19:26:01 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,HK_OBFDOM,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.33.17) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 08 Feb 2010 19:25:57 +0000 Received: from kpbe16.cbf.corp.google.com (kpbe16.cbf.corp.google.com [172.25.105.80]) by smtp-out.google.com with ESMTP id o18JPeDN003471; Mon, 8 Feb 2010 19:25:41 GMT Received: from ruffy.mtv.corp.google.com (ruffy.mtv.corp.google.com [172.18.118.116]) by kpbe16.cbf.corp.google.com with ESMTP id o18JPdxq018555; Mon, 8 Feb 2010 11:25:39 -0800 Received: by ruffy.mtv.corp.google.com (Postfix, from userid 67641) id E075A84415; Mon, 8 Feb 2010 11:25:38 -0800 (PST) To: gdb-patches@sourceware.org cc: tromey@redhat.com, msnyder@vmware.com Subject: [RFC] configure additions for linking with static libpython Message-Id: <20100208192538.E075A84415@ruffy.mtv.corp.google.com> Date: Mon, 08 Feb 2010 19:26: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-02/txt/msg00219.txt.bz2 Hi. I was going through my mail and found this thread: http://sourceware.org/ml/gdb/2010-01/msg00223.html Tested on i686-linux and amd64-linux with a static-library-only python installation. I wasn't sure how common static-only installations are so I didn't submitted this earlier. The -lutil is necessary to find forkpty, openpty, referenced by at least libpython2.4.a(posixmodule.o). I don't know how common libutil is w.r.t. libpython. Maybe the script should first test for libutil? 2010-02-08 Doug Evans * configure.ac (--with-python): Add necessary libraries -dl, -lpthread, -lutil in case linking with libpython.a. Add attempt to find libpython.a. * configure: Regenerated. Index: configure.ac =================================================================== RCS file: /cvs/src/src/gdb/configure.ac,v retrieving revision 1.114 diff -u -p -r1.114 configure.ac --- configure.ac 25 Jan 2010 13:22:02 -0000 1.114 +++ configure.ac 8 Feb 2010 19:08:11 -0000 @@ -595,7 +595,7 @@ AC_DEFUN([AC_TRY_LIBPYTHON], [HAVE_LIB]VERSION=no AC_MSG_CHECKING([for ${version}]) save_LIBS=$LIBS - LIBS="$LIBS -l${version}" + LIBS="$LIBS -l${version} -ldl -lpthread -lutil" AC_LINK_IFELSE(AC_LANG_PROGRAM([[#include "${version}/Python.h"]], [[Py_Initialize ();]]), [[HAVE_LIB]VERSION=yes @@ -623,6 +623,11 @@ else /*) python_includes="-I${with_python}/include" python_libs="-L${with_python}/lib" + # This one is to find libpythonx.y.a + python_config_dir=`echo ${with_python}/lib/python*.*/config` + if test -d "${python_config_dir}"; then + python_libs="${python_libs} -L${python_config_dir}" + fi ;; *) AC_ERROR(invalid value for --with-python)