From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Karoly.Lorentey@cern.ch (=?utf-8?q?L=C5=91rentey_K=C3=A1roly?=) Newsgroups: gmane.emacs.devel Subject: Double slashes in config.h Date: Sun, 20 Mar 2005 06:43:04 +0100 Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1108830650==" X-Trace: sea.gmane.org 1111297429 13201 80.91.229.2 (20 Mar 2005 05:43:49 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 20 Mar 2005 05:43:49 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Mar 20 06:43:49 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DCtDt-0005gt-1E for ged-emacs-devel@m.gmane.org; Sun, 20 Mar 2005 06:43:37 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DCtUi-0005du-NM for ged-emacs-devel@m.gmane.org; Sun, 20 Mar 2005 01:01:00 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DCtUR-0005aw-30 for emacs-devel@gnu.org; Sun, 20 Mar 2005 01:00:43 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DCtUO-0005Z4-UY for emacs-devel@gnu.org; Sun, 20 Mar 2005 01:00:41 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DCtUO-0005YQ-T3 for emacs-devel@gnu.org; Sun, 20 Mar 2005 01:00:40 -0500 Original-Received: from [212.92.23.158] (helo=chatsubo.ninsei.hu) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DCtDZ-0008ER-Ay for emacs-devel@gnu.org; Sun, 20 Mar 2005 00:43:17 -0500 Original-Received: from walrus (AAnnecy-251-1-33-30.w81-251.abo.wanadoo.fr [81.251.195.30]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by chatsubo.ninsei.hu (Postfix) with ESMTP id 1ECA91AD6D for ; Sun, 20 Mar 2005 06:43:14 +0100 (CET) Original-Received: by walrus (Postfix, from userid 1000) id 8B5FA2B8F0; Sun, 20 Mar 2005 06:43:11 +0100 (CET) Original-To: emacs-devel@gnu.org User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/22.0.50 (gnu/linux) X-Face: 'En&2832W(@ewy5g1U"#y@9QIA5Ko, -nD`s[9D+/5g^PSGLTyV&be8/lc-aTc&JPpgbJ-8f 2f*2:@kvpQ:"H^R*;0f1.$ X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org X-MailScanner-To: ged-emacs-devel@m.gmane.org Xref: news.gmane.org gmane.emacs.devel:34811 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:34811 --===============1108830650== Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Transfer-Encoding: quoted-printable Hi, trying to investigate some problems with GTK + multi-tty, I wanted to compile Emacs with a debuggable GTK version. I was weary but not entirely shocked to find out that Emacs failed to pick up the location of my locally compiled GTK instance. Here is my pkg-config output for GTK: $ pkg-config gtk+-2.0 --cflags =2DDXTHREADS -I/home/lorentey/work/emacs/install//include/gtk-2.0 \ =2DI/home/lorentey/work/emacs/install//lib/gtk-2.0/include \ =2DI/usr/X11R6/include \ =2DI/home/lorentey/work/emacs/install//include/atk-1.0 \ =2DI/home/lorentey/work/emacs/install//include/pango-1.0 \ =2DI/usr/include/freetype2 \ =2DI/home/lorentey/work/emacs/install//include/cairo \ =2DI/home/lorentey/work/emacs/install//include -I/usr/include/libpng12 \ =2DI/home/lorentey/work/emacs/install/include/glib-2.0 \ =2DI/home/lorentey/work/emacs/install/lib/glib-2.0/include=20=20 Note the double slashes; these are caused by ending a --prefix with a slash, and are normally harmless. In this case, however, the paths are run through cpp, which thinks that the double slashes start one-line comments. The result is that pkg-config's carefully configured include options are harshly truncated in src/Makefile: ALL_CFLAGS=3D-Demacs -DHAVE_CONFIG_H $(TOOLKIT_DEFINES) $(MYCPPFLAGS) -I. -= I${srcdir} -D_BSD_SOURCE -I/usr/X11R6/include -DXTHREADS -I/home/lorentey/w= ork/emacs/install ${CFLAGS} For reference, here are the corresponding lines in src/Makefile.in: /* C_SWITCH_X_SITE must come before C_SWITCH_X_MACHINE and C_SWITCH_X_SYSTEM since it may have -I options that should override those two. */ ALL_CFLAGS=3D-Demacs -DHAVE_CONFIG_H $(TOOLKIT_DEFINES) $(MYCPPFLAGS) -I. -= I${srcdir} C_SWITCH_MACHINE C_SWITCH_SYSTEM C_SWITCH_SITE C_SWITCH_X_SITE C= _SWITCH_X_MACHINE C_SWITCH_X_SYSTEM C_SWITCH_SYSTEM_TEMACS ${CFLAGS} Passing the -ansi option to (GNU) cpp disables `//' recognition. To prevent other people running into this same problem, I think it would be useful to apply the following patch: --=-=-= Content-Type: text/x-patch Content-Disposition: attachment --- orig/configure.in +++ mod/configure.in @@ -3126,6 +3126,14 @@ CPP_NEED_TRADITIONAL=no, CPP_NEED_TRADITIONAL=yes) +## New-fangled C preprocessors consider `//' to start a one-line comment. +## The -ansi option forces GCC's cpp to ignore this syntax. + +AC_EGREP_CPP(yes//yes, + [yes//yes], + CPP_NEED_ANSI=no, + CPP_NEED_ANSI=yes) + AC_OUTPUT(Makefile lib-src/Makefile.c:lib-src/Makefile.in oldXMenu/Makefile \ man/Makefile lwlib/Makefile src/Makefile.c:src/Makefile.in \ lisp/Makefile lispref/Makefile lispintro/Makefile leim/Makefile, [ @@ -3160,6 +3168,13 @@ CPPFLAGS="$CPPFLAGS -traditional" fi +# Recent GNU cpp versions understand C++-style one-line comments +# unless invoked with -ansi. (Works with GCC 3.3, 3.4, 4.0) + +if test "x$GCC" = xyes && test "x$CPP_NEED_ANSI" = xyes; then + CPPFLAGS="$CPPFLAGS -ansi" +fi + echo creating lib-src/Makefile ( cd lib-src rm -f junk.c junk1.c junk2.c @@ -3200,7 +3215,7 @@ # This is how we know whether to re-run configure in certain cases. touch src/config.stamp -], [GCC="$GCC" NON_GNU_CPP="$NON_GNU_CPP" CPP="$CPP" CPP_NEED_TRADITIONAL="$CPP_NEED_TRADITIONAL" CPPFLAGS="$CPPFLAGS"]) +], [GCC="$GCC" NON_GNU_CPP="$NON_GNU_CPP" CPP="$CPP" CPP_NEED_TRADITIONAL="$CPP_NEED_TRADITIONAL" CPP_NEED_ANSI="$CPP_NEED_ANSI" CPPFLAGS="$CPPFLAGS"]) m4_if(dnl Do not change this comment arch-tag: 156a4dd5-bddc-4d18-96ac-f37742cf6a5e --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Running Makefiles through the C preprocessor is evil. =2D-=20 K=C3=A1roly --=-=-=-- --==-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQBCPQ1u6eoyqA+yej8RAg9rAJ9bZ778g/S7veXRUeQFCX8Iit3oJQCbBxQC b4M42U9H/1XjHzidGAdOdmA= =Wtl0 -----END PGP SIGNATURE----- --==-=-=-- --===============1108830650== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --===============1108830650==--