[PATCH]: Workaround cpp bug with orbit-2-idl in non C locale
- From: fherrera onirica com
- To: michael ximian com
- Cc: gnome-components-list gnome org
- Subject: [PATCH]: Workaround cpp bug with orbit-2-idl in non C locale
- Date: Thu, 12 Jun 2003 01:59:10 +0200
Hi. Here is a fix for building ORBit-2 and libbonobo in non-C locales.
When orbit-idl-2 is invoked to generate deps files in a non-C locale,
it generates invalid deps files. For example, under LC_ALL=es_ES:
../../src/idl-compiler/orbit-idl-2 --showcpperrors --deps ./.deps/poatest.idl.P poatest.idl
will generate this .deps/poatest.idl.P:
poatest-stubs.c poatest-skels.c poatest-common.c poatest.h poatest-skelimpl.c
poatest-imodule.c : \ poatest.idl \
<interno> \
<línea de orden> \
poatest.idl
Where <interno> and <linea de orden> are just trash.
I think the real problem is with cpp0 (that really generates the
file), when invoked with es_ES locale as orbit-idl-2 does:
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/cpp0 -lang-c -I- -D__GNUC__=3
-D__GNUC_MINOR__=2 -D__GNUC_PATCHLEVEL__=2 -D__GXX_ABI_VERSION=102 -D__ELF__
-Dunix -D__gnu_linux__ -Dlinux -D__ELF__ -D__unix__ -D__gnu_linux__
-D__linux__ -D__unix -D__linux -Asystem=posix -D__NO_INLINE__
-D__STDC_HOSTED__=1 -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__
-D__tune_i386__ -D__ORBIT_IDL__ poatest.idl
It generates the offensive deps.
I don't know much about cpp internals, but this seems really wrong in
cppinit.c:
_cpp_do_file_change (pfile, LC_RENAME, _("<built-in>"), 1, 0);
init_builtins (pfile);
_cpp_do_file_change (pfile, LC_RENAME, _("<command line>"), 1, 0);
both strings are marked for translation (and LC_* here doesn't mean locale!).
I will ask the gcc people about this, but anyway, to make ORBit-2
and libbonoboui buildable under a non-C locale, here are two patches for
Makefile.am and Makefile.shared that only do LC_ALL="" before invoking
orbit-idl-2.
I think this will make GNOME more buildable for Spanish users (gcc is
translated to few languages :) that now was removing .deps by hand, or running
jhbuild with C locale. Ok to commit?
Salu2
--
Fernando Herrera de las Heras
Onírica: aálisis, disño e implantacón de soluciones inforáticas
http://www.onirica.com
Index: Makefile.shared
===================================================================
RCS file: /cvs/gnome/ORBit2/Makefile.shared,v
retrieving revision 1.7
diff -u -u -r1.7 Makefile.shared
--- Makefile.shared 14 Apr 2003 18:05:10 -0000 1.7
+++ Makefile.shared 11 Jun 2003 23:52:12 -0000
@@ -2,7 +2,7 @@
%.h %-stubs.c %-skels.c %-common.c %-imodule.c %-skelimpl.c: $(IDL_DIR)%.idl $(IDL_COMPILER)
-(rm -f $(*).h $(*)-stubs.c $(*)-skels.c $(*)-common.c $(*)-imodule.c $(*)-skelimpl.c || true) > /dev/null
- $(IDL_COMPILER) $(IDL_FLAGS) --deps $(*D)/.deps/$(*F).idl.P $<
+ LC_ALL="C" $(IDL_COMPILER) $(IDL_FLAGS) --deps $(*D)/.deps/$(*F).idl.P $<
for I in $(*).h $(*)-stubs.c $(*)-skels.c $(*)-common.c $(*)-imodule.c $(*)-skelimpl.c; do \
if test -f $$I; then \
sed -e 's,OObject,Object,g' -e 's,TTypeCode,TypeCode,g' $$I > $$I.out; \
? autom4te.cache
? stamp-h1
? activation-server/test-performance
? tests/test-thread
Index: bonobo/Makefile.am
===================================================================
RCS file: /cvs/gnome/libbonobo/bonobo/Makefile.am,v
retrieving revision 1.73
diff -u -u -r1.73 Makefile.am
--- bonobo/Makefile.am 9 Jun 2003 16:20:15 -0000 1.73
+++ bonobo/Makefile.am 12 Jun 2003 00:35:36 -0000
@@ -44,7 +44,7 @@
idl_flags = -I$(top_srcdir)/idl -D__Bonobo_COMPILATION
$(CORBA_SOURCE): $(idls) $(ORBIT_IDL)
- $(ORBIT_IDL) $(idl_flags) $(top_srcdir)/idl/Bonobo.idl
+ LC_ALL="" $(ORBIT_IDL) $(idl_flags) $(top_srcdir)/idl/Bonobo.idl
lib_LTLIBRARIES = libbonobo-2.la
Index: bonobo-activation/Makefile.am
===================================================================
RCS file: /cvs/gnome/libbonobo/bonobo-activation/Makefile.am,v
retrieving revision 1.48
diff -u -u -r1.48 Makefile.am
--- bonobo-activation/Makefile.am 9 Jun 2003 13:17:55 -0000 1.48
+++ bonobo-activation/Makefile.am 12 Jun 2003 00:35:39 -0000
@@ -81,7 +81,7 @@
echo "IDL_DIR: $(IDL_DIR)"
echo "IDL file: $<"
-(rm -f $(*).h $(*)-stubs.c $(*)-skels.c $(*)-common.c $(*)-imodule.c $(*)-skelimpl.c || true) > /dev/null
- $(ORBIT_IDL) $(IDL_FLAGS) "-D__$(*)_COMPILATION" --deps $(*D)/.deps/$(*F).idl.P $<
+ LC_ALL="" $(ORBIT_IDL) $(IDL_FLAGS) "-D__$(*)_COMPILATION" --deps $(*D)/.deps/$(*F).idl.P $<
if MAINTAINER_MODE
DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
Index: idl/Makefile.am
===================================================================
RCS file: /cvs/gnome/libbonobo/idl/Makefile.am,v
retrieving revision 1.52
diff -u -u -r1.52 Makefile.am
--- idl/Makefile.am 16 Apr 2003 19:10:52 -0000 1.52
+++ idl/Makefile.am 12 Jun 2003 00:35:41 -0000
@@ -61,7 +61,7 @@
-export-dynamic -module -avoid-version -no-undefined
$(IMODULE_SOURCE): $(idl_DATA) $(ORBIT_IDL)
- $(ORBIT_IDL) $(idl_flags) --imodule $(top_srcdir)/idl/Bonobo.idl
+ LC_ALL="" $(ORBIT_IDL) $(idl_flags) --imodule $(top_srcdir)/idl/Bonobo.idl
DONT_DIST_SOURCE = $(IMODULE_SOURCE)
Index: samples/echo/Makefile.am
===================================================================
RCS file: /cvs/gnome/libbonobo/samples/echo/Makefile.am,v
retrieving revision 1.27
diff -u -u -r1.27 Makefile.am
--- samples/echo/Makefile.am 16 Apr 2003 19:10:54 -0000 1.27
+++ samples/echo/Makefile.am 12 Jun 2003 00:35:42 -0000
@@ -40,7 +40,7 @@
libEcho_a_SOURCES = $(ECHO_CORBA_GENERATED)
$(ECHO_CORBA_GENERATED): Bonobo_Sample_Echo.idl $(ORBIT_IDL)
- $(ORBIT_IDL) -I$(top_srcdir)/idl $(srcdir)/Bonobo_Sample_Echo.idl
+ LC_ALL="" $(ORBIT_IDL) -I$(top_srcdir)/idl $(srcdir)/Bonobo_Sample_Echo.idl
serverdir = $(libdir)/bonobo/servers
server_in_files = $(server_dot_in)
Index: tests/test-activation/Makefile.am
===================================================================
RCS file: /cvs/gnome/libbonobo/tests/test-activation/Makefile.am,v
retrieving revision 1.38
diff -u -u -r1.38 Makefile.am
--- tests/test-activation/Makefile.am 13 May 2003 14:41:35 -0000 1.38
+++ tests/test-activation/Makefile.am 12 Jun 2003 00:35:42 -0000
@@ -55,7 +55,7 @@
plugin.h plugin-common.c plugin-stubs.c plugin-skels.c: plugin_built
empty_built: empty.idl $(ORBIT_IDL)
- $(ORBIT_IDL) $(srcdir)/empty.idl
+ LC_ALL="" $(ORBIT_IDL) $(srcdir)/empty.idl
touch empty_built
plugin_built: plugin.idl $(ORBIT_IDL)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]