Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFC] configure additions for linking with static libpython
@ 2010-02-08 19:26 Doug Evans
  2010-02-08 20:03 ` Daniel Jacobowitz
  2010-02-09  4:36 ` Joel Brobecker
  0 siblings, 2 replies; 3+ messages in thread
From: Doug Evans @ 2010-02-08 19:26 UTC (permalink / raw)
  To: gdb-patches; +Cc: tromey, msnyder

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)


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-02-09  4:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-08 19:26 [RFC] configure additions for linking with static libpython Doug Evans
2010-02-08 20:03 ` Daniel Jacobowitz
2010-02-09  4:36 ` Joel Brobecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox