emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Double slashes in config.h


From: Lőrentey Károly
Subject: Double slashes in config.h
Date: Sun, 20 Mar 2005 06:43:04 +0100
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/22.0.50 (gnu/linux)

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
-DXTHREADS -I/home/lorentey/work/emacs/install//include/gtk-2.0 \
-I/home/lorentey/work/emacs/install//lib/gtk-2.0/include \
-I/usr/X11R6/include \
-I/home/lorentey/work/emacs/install//include/atk-1.0 \
-I/home/lorentey/work/emacs/install//include/pango-1.0 \
-I/usr/include/freetype2 \
-I/home/lorentey/work/emacs/install//include/cairo \
-I/home/lorentey/work/emacs/install//include -I/usr/include/libpng12 \
-I/home/lorentey/work/emacs/install/include/glib-2.0 \
-I/home/lorentey/work/emacs/install/lib/glib-2.0/include  

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=-Demacs -DHAVE_CONFIG_H $(TOOLKIT_DEFINES) $(MYCPPFLAGS) -I. 
-I${srcdir} -D_BSD_SOURCE -I/usr/X11R6/include -DXTHREADS 
-I/home/lorentey/work/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=-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:

Attachment: txtv2duz9nFdd.txt
Description: Text Data

Running Makefiles through the C preprocessor is evil.

-- 
Károly

Attachment: pgpK1VZqA8HSR.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]