From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5911 invoked by alias); 28 May 2009 10:03:38 -0000 Received: (qmail 5586 invoked by uid 22791); 28 May 2009 10:03:35 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,HK_OBFDOM,J_CHICKENPOX_92 X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.154) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 28 May 2009 10:03:31 +0000 Received: from baal.u-strasbg.fr (baal.u-strasbg.fr [IPv6:2001:660:2402::41]) by mailhost.u-strasbg.fr (8.14.2/jtpda-5.5pre1) with ESMTP id n4SA3R0V017420 for ; Thu, 28 May 2009 12:03:28 +0200 (CEST) Received: from mailserver.u-strasbg.fr (ms2.u-strasbg.fr [IPv6:2001:660:2402:d::11]) by baal.u-strasbg.fr (8.14.0/jtpda-5.5pre1) with ESMTP id n4SA3R7l008436 for ; Thu, 28 May 2009 12:03:27 +0200 (CEST) (envelope-from muller@ics.u-strasbg.fr) Received: from d620muller (www-ics.u-strasbg.fr [130.79.210.225]) (user=mullerp mech=LOGIN) by mailserver.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id n4SA3Rjs085282 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Thu, 28 May 2009 12:03:27 +0200 (CEST) (envelope-from muller@ics.u-strasbg.fr) From: "Pierre Muller" To: Subject: [RFA] Build failure fix: Python troubles on non-python targets... Date: Thu, 28 May 2009 10:03:00 -0000 Message-ID: <001001c9df7b$8f2a3810$ad7ea830$@u-strasbg.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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: 2009-05/txt/msg00603.txt.bz2 On DJGPP, I now get this failure: gcc -gstabs+ -O0 -I../../purecvs/gdb/config/djgpp \ -o gdb.exe gdb.o libgdb.a \ ../readline/libreadline.a ../opcodes/libopcodes.a ../bfd/libbfd.a .. /libiberty/libiberty.a ../libdecnumber/libdecnumber.a -ldbg -lm ../libiberty/ libiberty.a gnulib/libgnu.a libgdb.a(valprint.o): In function `val_print': e:/cygwin/usr/local/src/gdbcvs/djcvsbuild2/gdb/../../purecvs/gdb/valprint.c: 292: undefined reference to `_apply_val_pretty_printer' libgdb.a(valprint.o): In function `value_print': e:/cygwin/usr/local/src/gdbcvs/djcvsbuild2/gdb/../../purecvs/gdb/valprint.c: 383: undefined reference to `_apply_val_pretty_printer' libgdb.a(cp-valprint.o): In function `cp_print_value': e:/cygwin/usr/local/src/gdbcvs/djcvsbuild2/gdb/../../purecvs/gdb/cp-valprint .c:4 28: undefined reference to `_apply_val_pretty_printer' collect2: ld returned 1 exit status python-prettyprint.o does not seem to be added to libgdb.a... But if I try to compile it by hand I get this: In file included from ../../purecvs/gdb/python/python-prettyprint.c:27: ../../purecvs/gdb/python/python-internal.h:49:2: #error "Unable to find usable Python.h" In file included from ../../purecvs/gdb/python/python-prettyprint.c:27: ../../purecvs/gdb/python/python-internal.h:66: error: parse error before '*' token The HAVE_PYTHON conditional is not at the right position. It seems like python-prettyprint.o should be added to CONFIG_OBS if no python is found or The following two changes fixes compilation for me: Is this patch OK? Pierre 2009-05-28 Pierre Muller * configure.ac (!have_libpython): Add python-prettyprint source and object files. * configure: Regenerate. * python/python-prettyprint.c: Move "#ifdef HAVE_PYTHON" before python headers. Index: configure.ac =================================================================== RCS file: /cvs/src/src/gdb/configure.ac,v retrieving revision 1.101 diff -u -p -r1.101 configure.ac --- configure.ac 23 Apr 2009 21:28:19 -0000 1.101 +++ configure.ac 28 May 2009 09:57:53 -0000 @@ -685,8 +685,8 @@ if test "${have_libpython}" = yes; then else # Even if Python support is not compiled in, we need to have these files # included in order to recognize the GDB command "python". - CONFIG_OBS="$CONFIG_OBS python.o python-value.o" - CONFIG_SRCS="$CONFIG_SRCS python/python.c python/python-value.c" + CONFIG_OBS="$CONFIG_OBS python.o python-value.o python-prettyprint.o" + CONFIG_SRCS="$CONFIG_SRCS python/python.c python/python-value.c python/python-prettyprint.c" fi AC_SUBST(PYTHON_CFLAGS) Index: python/python-prettyprint.c =================================================================== RCS file: /cvs/src/src/gdb/python/python-prettyprint.c,v retrieving revision 1.2 diff -u -p -r1.2 python-prettyprint.c --- python/python-prettyprint.c 28 May 2009 01:09:20 -0000 1.2 +++ python/python-prettyprint.c 28 May 2009 09:57:53 -0000 @@ -23,10 +23,12 @@ #include "symtab.h" #include "language.h" #include "valprint.h" + +#ifdef HAVE_PYTHON + #include "python.h" #include "python-internal.h" -#ifdef HAVE_PYTHON /* Helper function for find_pretty_printer which iterates over a list, calls each function and inspects output. This will return a