[PATCH] fix overquoting of $(XKBCONFIGROOT)

Matt Turner mattst88 at gmail.com
Thu Mar 24 08:55:55 PDT 2011


On Thu, Mar 24, 2011 at 1:13 PM, Dan Nicholson <dbn.lists at gmail.com> wrote:
> On Wed, Mar 23, 2011 at 8:29 PM, Matt Turner <mattst88 at gmail.com> wrote:
>> Fixes: http://bugs.gentoo.org/show_bug.cgi?id=360227
>>
>> Problem is easily seen during compile:
>>        -DDFLT_XKB_CONFIG_ROOT='""/usr/share/X11/xkb""'
>> ---
>>  src/xkbcomp/Makefile.am |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/src/xkbcomp/Makefile.am b/src/xkbcomp/Makefile.am
>> index db54c55..84e5381 100644
>> --- a/src/xkbcomp/Makefile.am
>> +++ b/src/xkbcomp/Makefile.am
>> @@ -1,6 +1,6 @@
>>  AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src
>>  AM_CFLAGS = $(X11_CFLAGS) $(CWARNFLAGS) \
>> -       -DDFLT_XKB_CONFIG_ROOT='"$(XKBCONFIGROOT)"'
>> +       -DDFLT_XKB_CONFIG_ROOT='$(XKBCONFIGROOT)'
>>
>>  noinst_LTLIBRARIES = libxkbcomp.la
>>  libxkbcomp_la_SOURCES = \
>
> This seems to break the normal configuration where pkg-config gives us
> the string unquoted.
>
> $ grep ^XKBCONFIGROOT src/xkbcomp/Makefile
> XKBCONFIGROOT = /opt/gfx/share/X11/xkb

A clean checkout and ./autogen.sh here gives me:

src/xkbcomp/Makefile:XKBCONFIGROOT = "/usr/share/X11/xkb"

> No quotes around the string. Building with this patch and V=1 results in:
>
> libtool: compile:  gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../../src
> -I../../include -I../../src -I/opt/gfx/include -Wall -Wpointer-arith
> -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations
> -Wnested-externs -fno-strict-aliasing -Wbad-function-cast -Wformat=2
> -Wold-style-definition -Wdeclaration-after-statement
> -DDFLT_XKB_CONFIG_ROOT=/opt/gfx/share/X11/xkb -g -O2
> -fvisibility=hidden -MT listing.lo -MD -MP -MF .deps/listing.Tpo -c
> listing.c  -fPIC -DPIC -o .libs/listing.o
> listing.c: In function ‘xkb_list_components’:
> listing.c:494: error: expected expression before ‘/’ token
> listing.c:494: error: too few arguments to function ‘GenerateComponent’
> listing.c:498: error: expected expression before ‘/’ token
> listing.c:498: error: too few arguments to function ‘GenerateComponent’
> listing.c:502: error: expected expression before ‘/’ token
> listing.c:502: error: too few arguments to function ‘GenerateComponent’
> listing.c:506: error: expected expression before ‘/’ token
> listing.c:506: error: too few arguments to function ‘GenerateComponent’
> listing.c:510: error: expected expression before ‘/’ token
> listing.c:510: error: too few arguments to function ‘GenerateComponent’
> listing.c:514: error: expected expression before ‘/’ token
> listing.c:514: error: too few arguments to function ‘GenerateComponent’
> make: *** [listing.lo] Error 1
>
> I think you need to change it to
>
> diff --git a/src/xkbcomp/Makefile.am b/src/xkbcomp/Makefile.am
> index db54c55..9c27248 100644
> --- a/src/xkbcomp/Makefile.am
> +++ b/src/xkbcomp/Makefile.am
> @@ -1,6 +1,6 @@
>  AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src
>  AM_CFLAGS = $(X11_CFLAGS) $(CWARNFLAGS) \
> -       -DDFLT_XKB_CONFIG_ROOT='"$(XKBCONFIGROOT)"'
> +       -DDFLT_XKB_CONFIG_ROOT=\"$(XKBCONFIGROOT)\"
>
>  noinst_LTLIBRARIES = libxkbcomp.la
>  libxkbcomp_la_SOURCES = \

With this patch, I get


/bin/sh ../../libtool  --tag=CC   --mode=compile gcc -std=gnu99
-DHAVE_CONFIG_H -I. -I../../src  -I../../include -I../../src   -Wall
-Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes
-Wmissing-declarations -Wnested-externs -fno-strict-aliasing
-Wbad-function-cast -Wformat=2 -Wold-style-definition
-Wdeclaration-after-statement
-DDFLT_XKB_CONFIG_ROOT='\""/usr/share/X11/xkb"\"' -g -O2
-fvisibility=hidden -MT listing.lo -MD -MP -MF .deps/listing.Tpo -c -o
listing.lo listing.c
libtool: compile:  gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../../src
-I../../include -I../../src -Wall -Wpointer-arith -Wstrict-prototypes
-Wmissing-prototypes -Wmissing-declarations -Wnested-externs
-fno-strict-aliasing -Wbad-function-cast -Wformat=2
-Wold-style-definition -Wdeclaration-after-statement
-DDFLT_XKB_CONFIG_ROOT=\\\"\"/usr/share/X11/xkb\"\\\" -g -O2
-fvisibility=hidden -MT listing.lo -MD -MP -MF .deps/listing.Tpo -c
listing.c  -fPIC -DPIC -o .libs/listing.o
<command-line>:0:43: warning: missing terminating " character
listing.c: In function 'xkb_list_components':
listing.c:494:36: error: stray '\' in program
listing.c:494:36: error: 'usr' undeclared (first use in this function)
listing.c:494:36: note: each undeclared identifier is reported only
once for each function it appears in
listing.c:494:36: error: 'share' undeclared (first use in this function)
listing.c:494:36: error: 'X11' undeclared (first use in this function)
listing.c:494:36: error: missing terminating " character
listing.c:494:36: error: 'xkb' undeclared (first use in this function)
listing.c:498:36: error: stray '\' in program
listing.c:498:36: error: missing terminating " character
listing.c:502:36: error: stray '\' in program
listing.c:502:36: error: missing terminating " character
listing.c:506:36: error: stray '\' in program
listing.c:506:36: error: missing terminating " character
listing.c:510:36: error: stray '\' in program
listing.c:510:36: error: missing terminating " character
listing.c:514:36: error: stray '\' in program
listing.c:514:36: error: missing terminating " character
make[3]: *** [listing.lo] Error 1

Notice both
  -DDFLT_XKB_CONFIG_ROOT='\""/usr/share/X11/xkb"\"'
  -DDFLT_XKB_CONFIG_ROOT=\\\"\"/usr/share/X11/xkb\"\\\"
appear in the command. No idea what's going on there.

This has to be some kind of system-specific problem. The configure
script gets the value of XKBCONFIGROOT from pkg-config. What's your
output of this command?

$ pkg-config --variable=xkb_base xkeyboard-config
"/usr/share/X11/xkb"

No quotes? (I've got xkeyboard-config-2.1)

/usr/share/pkgconfig/xkeyboard-config.pc has
xkb_base="/usr/share/X11/xkb". Should this not have quotes?

Thanks,
Matt


More information about the xorg-devel mailing list