You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by bo...@apache.org on 2009/11/10 13:50:49 UTC

svn commit: r834455 - in /xerces/c/trunk/src: Makefile.am xercesc/util/MsgLoaders/ICU/resources/Makefile.in xercesc/util/MsgLoaders/ICU/resources/resources.mak xercesc/util/MsgLoaders/ICU/resources/root_res_dummy.cpp

Author: borisk
Date: Tue Nov 10 12:50:48 2009
New Revision: 834455

URL: http://svn.apache.org/viewvc?rev=834455&view=rev
Log:
Rework compilation of ICU message loader resources (XERCESC-1882).

Removed:
    xerces/c/trunk/src/xercesc/util/MsgLoaders/ICU/resources/resources.mak
    xerces/c/trunk/src/xercesc/util/MsgLoaders/ICU/resources/root_res_dummy.cpp
Modified:
    xerces/c/trunk/src/Makefile.am
    xerces/c/trunk/src/xercesc/util/MsgLoaders/ICU/resources/Makefile.in

Modified: xerces/c/trunk/src/Makefile.am
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/Makefile.am?rev=834455&r1=834454&r2=834455&view=diff
==============================================================================
--- xerces/c/trunk/src/Makefile.am (original)
+++ xerces/c/trunk/src/Makefile.am Tue Nov 10 12:50:48 2009
@@ -127,8 +127,6 @@
 AM_CPPFLAGS += -I${ICU_PREFIX}/include
 
 SUBDIRS += xercesc/util/MsgLoaders/ICU/resources
-libxerces_c_la_LIBADD += xercesc/util/MsgLoaders/ICU/resources/xercesc_messages.lo \
-xercesc/util/MsgLoaders/ICU/resources/root_res.lo
 endif
 
 if XERCES_USE_MSGLOADER_ICONV
@@ -1057,7 +1055,9 @@
 	xercesc/util/MsgLoaders/ICU/ICUMsgLoader.hpp
 
 msgicu_sources = \
-	xercesc/util/MsgLoaders/ICU/ICUMsgLoader.cpp
+	xercesc/util/MsgLoaders/ICU/ICUMsgLoader.cpp \
+        xercesc/util/MsgLoaders/ICU/resources/xercesc_messages.c \
+        xercesc/util/MsgLoaders/ICU/resources/root_res.c
 
 msgiconv_headers = \
 	xercesc/util/MsgLoaders/MsgCatalog/MsgCatalogLoader.hpp \

Modified: xerces/c/trunk/src/xercesc/util/MsgLoaders/ICU/resources/Makefile.in
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/MsgLoaders/ICU/resources/Makefile.in?rev=834455&r1=834454&r2=834455&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/util/MsgLoaders/ICU/resources/Makefile.in (original)
+++ xerces/c/trunk/src/xercesc/util/MsgLoaders/ICU/resources/Makefile.in Tue Nov 10 12:50:48 2009
@@ -14,148 +14,54 @@
 # limitations under the License.
 #
 
-# TODO:
-# @@ get rid of unused vars
-#
-
 srcdir = @srcdir@
 top_srcdir = @top_srcdir@
 top_builddir = @top_builddir@
 prefix = @prefix@
 exec_prefix = @exec_prefix@
 libdir = @libdir@
-ICU_PREFIX = @ICU_PREFIX@
-SHREXT = @SHREXT@
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
 mkdir_p = @mkdir_p@
 
-CC = @CC@
-CXX = @CXX@
-AR = @AR@
-RANLIB = @RANLIB@
-CPPFLAGS = @CPPFLAGS@
-CFLAGS = @CFLAGS@
-CXXFLAGS = @CXXFLAGS@
-LIBTOOL = @LIBTOOL@
-LDFLAGS = @LDFLAGS@
-
-BUILD_SHARED = @BUILD_SHARED@
-BUILD_STATIC = @BUILD_STATIC@
-
-include $(top_srcdir)/version.incl
+ICU_PREFIX = @ICU_PREFIX@
 
 GENRB=$(ICU_PREFIX)/bin/genrb
-PKGDATA=$(ICU_PREFIX)/bin/pkgdata
+GENCCODE=$(ICU_PREFIX)/sbin/genccode
+GENCMN=$(ICU_PREFIX)/sbin/gencmn
 
-# Add -v if you want to see more verbose output.
-#
-PKGDATAOPTS=-d . -M '"CC=$(CC)" "CXX=$(CXX)" "AR=$(AR)" "RANLIB=$(RANLIB)" \
-"CPPFLAGS=$(CPPFLAGS)" "CFLAGS=$(CFLAGS)" "CXXFLAGS=$(CXXFLAGS)" "LDFLAGS=$(LDFLAGS)"'
+include $(top_srcdir)/version.incl
 
 # Resource shortname
 PKGNAME=xercesc_messages_$(INTERFACE_VER_U)
 
 # Resource files.  Add new ones for additional locales here. Keep in sync
-# with the file RESLIST and don't forget to add the object file below.
+# with the file RESLIST and don't forget to add the .lo entry in top-level
+# Makefile.am.
 #
 RESFILES=root.res
 
 # list of resource bundles  - keep in sync with RESFILES
+#
 RESLIST=$(srcdir)/res-file-list.txt
 
-#
-#
 .PHONY: all
-all: xercesc_messages.lo
+all: $(RESFILES:.res=_res.c) xercesc_messages.c
 
-# ICU makefiles use .o and .ao for non-PIC object file extensions
-# on different platforms. We need to account for that. Also on some
-# platforms ICU produces root_res.o. Overall, this is one hairy hack
-# to make ICU work with libtool. If you know of a better way to handle
-# this do let us (c-dev@xerces.apache.org) know.
-#
-xercesc_messages.lo: $(RESFILES)
-ifeq ($(BUILD_SHARED),yes)
-	@rm -f $(PKGNAME)_dat.o root_res.o
-	$(PKGDATA) --name $(PKGNAME) --mode dll $(PKGDATAOPTS) $(RESLIST)
-	mv $(PKGNAME)_dat.o $(PKGNAME)_dat-pic.o
-	@if test -f root_res.o; then mv root_res.o root_res-pic.o; fi
-endif
-ifeq ($(BUILD_STATIC),yes)
-	@rm -f $(PKGNAME)_dat.o $(PKGNAME)_dat.ao root_res.o root_res.ao
-	$(PKGDATA) --name $(PKGNAME) --mode static $(PKGDATAOPTS) $(RESLIST)
-	@if test -f $(PKGNAME)_dat.ao; then mv $(PKGNAME)_dat.ao $(PKGNAME)_dat.o; fi
-	@if test -f root_res.ao; then mv root_res.ao root_res.o; fi
-endif
-	@echo "# $@ - a libtool object file" >$@
-	@echo "# Generated by `$(LIBTOOL) --version | \
-sed -e 's/^\([^ ]*\) (GNU \(.*\)) \(.*\)$$/\1 - GNU \2 \3/' -e q`" >>$@
-	@echo "" >>$@
-ifeq ($(BUILD_SHARED),yes)
-	@echo "pic_object='$(PKGNAME)_dat-pic.o'" >>$@
-else
-	@echo "pic_object=none" >>$@
-endif
-ifeq ($(BUILD_STATIC),yes)
-	@echo "non_pic_object='$(PKGNAME)_dat.o'" >>$@
-else
-	@echo "non_pic_object=none" >>$@
-endif
-	@echo "# root_res.lo - a libtool object file" >root_res.lo
-	@echo "# Generated by `$(LIBTOOL) --version | \
-sed -e 's/^\([^ ]*\) (GNU \(.*\)) \(.*\)$$/\1 - GNU \2 \3/' -e q`" >>root_res.lo
-	@echo "" >>root_res.lo
-ifeq ($(BUILD_SHARED),yes)
-	@echo "pic_object='root_res-pic.o'" >>root_res.lo
-else
-	@echo "pic_object=none" >>root_res.lo
-endif
-ifeq ($(BUILD_STATIC),yes)
-	@echo "non_pic_object='root_res.o'" >>root_res.lo
-else
-	@echo "non_pic_object=none" >>root_res.lo
-endif
-	@if test ! -f root_res-pic.o -a ! -f root_res.o; then \
-$(LIBTOOL) --quiet --tag=CXX --mode=compile $(CXX) $(CPPFLAGS) $(CXXFLAGS) \
--c -o root_res.lo root_res_dummy.cpp; fi
+xercesc_messages.c: $(RESLIST)
+	$(GENCMN) --name $(PKGNAME) -S $(PKGNAME)_dat.c -d . $<
+	@mv $(PKGNAME)_dat.c xercesc_messages.c
 
+.PRECIOUS: %_res.c
+%_res.c: $(srcdir)/%.res
+	$(GENCCODE) --name $(PKGNAME) -d . $<
+
+.PRECIOUS: %.res
 %.res: $(srcdir)/%.txt
 	$(GENRB) $^
 
-# Let the corresponding tools (pkgdata, libtool) clean up their own
-# files. pkgdata does not remove the .dat and README file for some
-# reason.
-#
-clean:
-	rm -f xercesc_messages.lo root_res.lo
-ifeq ($(BUILD_SHARED),yes)
-	$(PKGDATA) --name $(PKGNAME) --mode dll --clean $(PKGDATAOPTS) $(RESLIST)
-	rm -f $(PKGNAME)_dat-pic.o root_res-pic.o
-	rm -rf .libs
-endif
-ifeq ($(BUILD_STATIC),yes)
-	$(PKGDATA) --name $(PKGNAME) --mode static --clean $(PKGDATAOPTS) $(RESLIST)
-	rm -f README_$(PKGNAME).txt root_res.o
-endif
-	rm -f $(RESFILES)
-	rm -f $(PKGNAME).dat
-
-# Distclean is invoked even if we are not building with ICU.
-# As a result, we cannot use pkgdata to clean up.
-#
-distclean:
-	rm -f xercesc_messages.lo root_res.lo
-	rm -f lib$(PKGNAME).so
-	rm -f lib$(PKGNAME).a
-	rm -f $(PKGNAME)_dat*.o root_res*.o
-	rm -f $(PKGNAME)*.lst
-	rm -f $(PKGNAME)*.mak
-	rm -f $(RESFILES)
-	rm -f $(PKGNAME).dat
-	rm -f README_$(PKGNAME).txt
-	rm -rf .libs
-
+# Clean
+#
+clean distclean:
+	rm -f $(RESFILES) $(RESFILES:.res=_res.c) xercesc_messages.c
 #
 #
 .PHONY: check
@@ -166,12 +72,12 @@
 distdir:
 	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='res-file-list.txt root.txt Makefile.in resources.mak root_res_dummy.cpp'; \
+	list='res-file-list.txt root.txt Makefile.in'; \
 	  dist_files=`for file in $$list; do echo $$file; done | \
 	  sed -e "s|^$$srcdirstrip/||;t" \
 	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
 	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+	  */*) $(mkdir_p) `echo "$$dist_files" | \
 			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
 			   sort -u` ;; \
 	esac; \



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org