Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: dje@google.com (Doug Evans)
To: gdb-patches@sourceware.org
Cc: tromey@redhat.com, msnyder@vmware.com
Subject: [RFC] configure additions for linking with static libpython
Date: Mon, 08 Feb 2010 19:26:00 -0000	[thread overview]
Message-ID: <20100208192538.E075A84415@ruffy.mtv.corp.google.com> (raw)

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  <dje@google.com>

	* 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)


             reply	other threads:[~2010-02-08 19:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-08 19:26 Doug Evans [this message]
2010-02-08 20:03 ` Daniel Jacobowitz
2010-02-09  4:36 ` Joel Brobecker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100208192538.E075A84415@ruffy.mtv.corp.google.com \
    --to=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    --cc=msnyder@vmware.com \
    --cc=tromey@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox