From 8e28da7d3da3d0db2a06e81ad24246765530d509 Mon Sep 17 00:00:00 2001 From: Yves Arrouye Date: Tue, 24 Oct 2000 19:50:20 +0000 Subject: [PATCH] ICU-692 factor in some common definitions, and include the platform file to make porting easier. X-SVN-Rev: 2772 --- .gitignore | 1 + icu4c/source/.cvsignore | 2 + icu4c/source/Makefile.in | 56 ++++++------------ icu4c/source/aclocal.m4 | 32 +++++------ icu4c/source/common/Makefile.in | 33 ++--------- icu4c/source/config/Makefile.inc.in | 12 ++-- icu4c/source/configure | 44 +++++++------- icu4c/source/configure.in | 10 ++-- icu4c/source/data/Makefile.in | 34 +---------- icu4c/source/data/icupkg.inc.in | 5 +- icu4c/source/extra/Makefile.in | 31 +--------- icu4c/source/extra/uconv/pkgdata.inc.in | 5 +- icu4c/source/extra/ustdio/Makefile.in | 33 ++--------- icu4c/source/icudefs.mk.in | 57 +++++++++++++++++++ icu4c/source/samples/Makefile.in | 31 +--------- icu4c/source/samples/XMLConverter/Makefile.in | 30 +--------- icu4c/source/samples/cal/Makefile.in | 30 +--------- icu4c/source/samples/date/Makefile.in | 32 +---------- icu4c/source/test/Makefile.in | 38 ++----------- icu4c/source/test/cintltst/Makefile.in | 35 +----------- icu4c/source/test/ieeetest/Makefile.in | 32 +---------- icu4c/source/test/intltest/Makefile.in | 32 +---------- icu4c/source/test/testdata/Makefile.in | 38 ++----------- icu4c/source/test/testmap/Makefile.in | 34 +---------- icu4c/source/tools/Makefile.in | 35 +++--------- icu4c/source/tools/ctestfw/Makefile.in | 33 +---------- icu4c/source/tools/genccode/Makefile.in | 32 +---------- icu4c/source/tools/gencmn/Makefile.in | 32 +---------- icu4c/source/tools/gencnval/Makefile.in | 54 +++++------------- icu4c/source/tools/gennames/Makefile.in | 40 ++----------- icu4c/source/tools/genprops/Makefile.in | 42 +++----------- icu4c/source/tools/genrb/Makefile.in | 34 ++--------- icu4c/source/tools/gentest/Makefile.in | 40 +++---------- icu4c/source/tools/gentz/Makefile.in | 42 +++----------- icu4c/source/tools/makeconv/Makefile.in | 56 +++++------------- icu4c/source/tools/pkgdata/Makefile.in | 32 +---------- icu4c/source/tools/pkgdata/icupkg.inc.in | 5 +- icu4c/source/tools/rbdump/Makefile.in | 32 +---------- icu4c/source/tools/toolutil/Makefile.in | 39 +++---------- 39 files changed, 266 insertions(+), 969 deletions(-) create mode 100644 icu4c/source/icudefs.mk.in diff --git a/.gitignore b/.gitignore index 6d1ae8968c..244e2075b9 100644 --- a/.gitignore +++ b/.gitignore @@ -55,6 +55,7 @@ icu4c/source/i18n/Debug icu4c/source/i18n/Makefile icu4c/source/i18n/Release icu4c/source/i18n/libicu*.* +icu4c/source/icudefs.mk icu4c/source/samples/Makefile icu4c/source/samples/XMLConverter/*.d icu4c/source/samples/XMLConverter/*.pdb diff --git a/icu4c/source/.cvsignore b/icu4c/source/.cvsignore index 9bae16c74c..e56b30c552 100644 --- a/icu4c/source/.cvsignore +++ b/icu4c/source/.cvsignore @@ -2,3 +2,5 @@ config.log config.cache config.status Makefile +icudefs.mk + diff --git a/icu4c/source/Makefile.in b/icu4c/source/Makefile.in index 831caa3227..0b5539927a 100644 --- a/icu4c/source/Makefile.in +++ b/icu4c/source/Makefile.in @@ -7,48 +7,21 @@ ## Top-level Makefile.in for ICU ## Stephen F. Booth -## Shell to use -SHELL = @SHELL@ - -## Install directory information srcdir = @srcdir@ top_srcdir = @top_srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ -bindir = @bindir@ -sbindir = @sbindir@ -datadir = @datadir@ -libdir = @libdir@ -includedir = @includedir@ - -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ +include $(top_srcdir)/icudefs.mk ## Build directory information top_builddir = . subdir = . -## Install program information -MKINSTALLDIRS = $(SHELL) $(top_srcdir)/mkinstalldirs - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ +## AUTOCONF = @AUTOCONF@ - ## Platform-specific setup -@host_frag@ - - -## Package information -PACKAGE = @PACKAGE@ -VERSION = @VERSION@ -UNICODE_VERSION = @UNICODE_VERSION@ +include @platform_make_fragment@ ## Optional directory setup @EXTRAS_TRUE@EXTRA = extra @@ -99,7 +72,7 @@ all-recursive install-recursive clean-recursive distclean-recursive dist-recursi else \ local_target="$$target"; \ fi; \ - (cd $$subdir && $(MAKE) $$local_target) || exit; \ + (cd $$subdir && $(MAKE) RECURSIVE=YES $$local_target) || exit; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) "$$target-local" || exit; \ @@ -108,15 +81,17 @@ all-recursive install-recursive clean-recursive distclean-recursive dist-recursi clean-recursive-with-twist: $(MAKE) clean-recursive LOCAL_SUBDIRS='$(CLEAN_FIRST_SUBDIRS) $(filter-out $(CLEAN_FIRST_SUBDIRS),$(LOCAL_SUBDIRS))' -all-local: $(srcdir)/configure +all-local: $(srcdir)/configure $(srcdir)/icudefs.mk -install-local: $(top_builddir)/config/Makefile.inc $(EXTRA_DATA:%=$(DESTDIR)$(pkgdatadir)/$(VERSION)/%) - @$(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir) +install-local: $(top_builddir)/config/Makefile.inc @platform_make_fragment@ $(EXTRA_DATA:%=$(DESTDIR)$(pkglibdir)/$(VERSION)/%) + @$(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/config + @$(MKINSTALLDIRS) $(DESTDIR)$(pkglibdir) @$(MKINSTALLDIRS) $(DESTDIR)$(sbindir) - $(INSTALL_DATA) $(top_builddir)/config/Makefile.inc $(DESTDIR)$(pkgdatadir)/Makefile.inc + $(INSTALL_DATA) $(top_builddir)/config/Makefile.inc $(DESTDIR)$(pkglibdir)/Makefile.inc + $(INSTALL_DATA) @platform_make_fragment@ $(DESTDIR)$(pkgdatadir)/config/@platform_make_fragment_name@ $(INSTALL_SCRIPT) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(pkgdatadir)/mkinstalldirs -$(DESTDIR)$(pkgdatadir)/$(VERSION)/%: $(top_srcdir)/../data/% +$(DESTDIR)$(pkglibdir)/$(VERSION)/%: $(top_srcdir)/../data/% $(INSTALL_DATA) $< $@ ## Generate HTML documentation @@ -138,8 +113,9 @@ clean-local: test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES) distclean-local: clean-local - $(RMV) Makefile config.cache config.log config.status config/Makefile + $(RMV) Makefile icudefs.mk config/Makefile $(RMV) $(top_builddir)/config/Makefile.inc + $(RMV) config.cache config.log config.status $(RMV) common/unicode/platform.h common/icucfg.h check-local: @@ -147,7 +123,11 @@ check-local: #$(srcdir)/configure : $(srcdir)/configure.in $(top_srcdir)/aclocal.m4 # cd $(srcdir) && $(AUTOCONF) -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status +icudefs.mk: $(srcdir)/icudefs.mk.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + +Makefile: $(srcdir)/Makefile.in $(srcdir)/icudefs.mk $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status diff --git a/icu4c/source/aclocal.m4 b/icu4c/source/aclocal.m4 index b9cc7026e6..a1b8c26140 100644 --- a/icu4c/source/aclocal.m4 +++ b/icu4c/source/aclocal.m4 @@ -14,33 +14,33 @@ AC_DEFUN(ICU_CHECK_MH_FRAG, [ case "${host}" in *-*-solaris*) if test "$ac_cv_prog_gcc" = yes; then - icu_cv_host_frag=$srcdir/config/mh-solaris-gcc + icu_cv_host_frag=mh-solaris-gcc else if test "$SOL64" = yes; then - icu_cv_host_frag=$srcdir/config/mh-solaris-sparcv9 + icu_cv_host_frag=mh-solaris-sparcv9 else - icu_cv_host_frag=$srcdir/config/mh-solaris + icu_cv_host_frag=mh-solaris fi fi ;; -*-*-mips*) icu_cv_host_frag=$srcdir/config/mh-irix ;; -*-*-linux*) icu_cv_host_frag=$srcdir/config/mh-linux ;; -*-*-freebsd*|*-*-netbsd*) icu_cv_host_frag=$srcdir/config/mh-bsd-gcc ;; +*-*-mips*) icu_cv_host_frag=mh-irix ;; +*-*-linux*) icu_cv_host_frag=mh-linux ;; +*-*-freebsd*|*-*-netbsd*) icu_cv_host_frag=mh-bsd-gcc ;; *-*-aix*) case "$CXX" in - *vacpp*)icu_cv_host_frag=$srcdir/config/mh-aix-va ;; - *) icu_cv_host_frag=$srcdir/config/mh-aix ;; + *vacpp*)icu_cv_host_frag=mh-aix-va ;; + *) icu_cv_host_frag=mh-aix ;; esac;; -*-sequent-*) icu_cv_host_frag=$srcdir/config/mh-ptx ;; +*-sequent-*) icu_cv_host_frag=mh-ptx ;; *-*-hpux*) case "$CXX" in - *aCC) icu_cv_host_frag=$srcdir/config/mh-hpux-acc ;; - *CC) icu_cv_host_frag=$srcdir/config/mh-hpux-cc ;; + *aCC) icu_cv_host_frag=mh-hpux-acc ;; + *CC) icu_cv_host_frag=mh-hpux-cc ;; esac;; -*-*-os390*) icu_cv_host_frag=$srcdir/config/mh-os390 ;; -*-*-os400*) icu_cv_host_frag=$srcdir/config/mh-os400 ;; -*-apple-rhapsody*) icu_cv_host_frag=$srcdir/config/mh-darwin ;; -*-apple-darwin*) icu_cv_host_frag=$srcdir/config/mh-darwin ;; -*) icu_cv_host_frag=$srcdir/config/mh-unknown ;; +*-*-os390*) icu_cv_host_frag=mh-os390 ;; +*-*-os400*) icu_cv_host_frag=mh-os400 ;; +*-apple-rhapsody*) icu_cv_host_frag=mh-darwin ;; +*-apple-darwin*) icu_cv_host_frag=mh-darwin ;; +*) icu_cv_host_frag=mh-unknown ;; esac ] ) diff --git a/icu4c/source/common/Makefile.in b/icu4c/source/common/Makefile.in index 3392ff278f..d51265ff48 100644 --- a/icu4c/source/common/Makefile.in +++ b/icu4c/source/common/Makefile.in @@ -7,42 +7,17 @@ ## Makefile.in for ICU - icu.so ## Stephen F. Booth -## Shell to use -SHELL = @SHELL@ +SO_TARGET_VERSION = @LIB_VERSION@ +SO_TARGET_VERSION_MAJOR = @LIB_VERSION_MAJOR@ ## Install directory information srcdir = @srcdir@ top_srcdir = @top_srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ -bindir = @bindir@ -sbindir = @sbindir@ -datadir = @datadir@ -libdir = @libdir@ -includedir = @includedir@ - -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ - -## Install program information -MKINSTALLDIRS = $(SHELL) $(top_srcdir)/mkinstalldirs - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ - -## Compiler/tools information -CC = @CC@ -CXX = @CXX@ -PACKAGE = @PACKAGE@ -SO_TARGET_VERSION = @LIB_VERSION@ -SO_TARGET_VERSION_MAJOR = @LIB_VERSION_MAJOR@ -VERSION = @VERSION@ +include $(top_srcdir)/icudefs.mk ## Platform-specific setup -@host_frag@ +include @platform_make_fragment@ ## Build directory information top_builddir = .. diff --git a/icu4c/source/config/Makefile.inc.in b/icu4c/source/config/Makefile.inc.in index 3bcf698455..da554f25c1 100644 --- a/icu4c/source/config/Makefile.inc.in +++ b/icu4c/source/config/Makefile.inc.in @@ -2,12 +2,11 @@ #****************************************************************************** # Copyright (C) 1999, International Business Machines # Corporation and others. All Rights Reserved. -# $Revision: 1.14 $ +# $Revision: 1.15 $ #****************************************************************************** # This Makefile is designed to be included into projects which make use # of the ICU. - SHELL = @SHELL@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ $(LIBCPPFLAGS) -I$(prefix)/include @@ -53,7 +52,10 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_DATA = @INSTALL_DATA@ AUTOCONF = @AUTOCONF@ -MKINSTALLDIRS = $(SHELL) $(datadir)/$(PACKAGE)/mkinstalldirs +pkgdatadir = $(datadir)/$(PACKAGE) +pkglibdir = $(libdir)/$(PACKAGE) + +MKINSTALLDIRS = $(SHELL) $(pkgdatadir)/mkinstalldirs host = @host@ host_alias = @host_alias@ @@ -83,9 +85,7 @@ platform = @platform@ ld_rpath_suf = @ld_rpath_suf@ -# begin host fragment -@host_frag@ -# end host fragment +include $(pkgdatadir)/config/@platform_make_fragment_name@ DEFAULT_MODE = @DATA_PACKAGING_MODE@ diff --git a/icu4c/source/configure b/icu4c/source/configure index 5cdc61a826..66dc271840 100755 --- a/icu4c/source/configure +++ b/icu4c/source/configure @@ -1215,33 +1215,33 @@ else case "${host}" in *-*-solaris*) if test "$ac_cv_prog_gcc" = yes; then - icu_cv_host_frag=$srcdir/config/mh-solaris-gcc + icu_cv_host_frag=mh-solaris-gcc else if test "$SOL64" = yes; then - icu_cv_host_frag=$srcdir/config/mh-solaris-sparcv9 + icu_cv_host_frag=mh-solaris-sparcv9 else - icu_cv_host_frag=$srcdir/config/mh-solaris + icu_cv_host_frag=mh-solaris fi fi ;; -*-*-mips*) icu_cv_host_frag=$srcdir/config/mh-irix ;; -*-*-linux*) icu_cv_host_frag=$srcdir/config/mh-linux ;; -*-*-freebsd*|*-*-netbsd*) icu_cv_host_frag=$srcdir/config/mh-bsd-gcc ;; +*-*-mips*) icu_cv_host_frag=mh-irix ;; +*-*-linux*) icu_cv_host_frag=mh-linux ;; +*-*-freebsd*|*-*-netbsd*) icu_cv_host_frag=mh-bsd-gcc ;; *-*-aix*) case "$CXX" in - *vacpp*)icu_cv_host_frag=$srcdir/config/mh-aix-va ;; - *) icu_cv_host_frag=$srcdir/config/mh-aix ;; + *vacpp*)icu_cv_host_frag=mh-aix-va ;; + *) icu_cv_host_frag=mh-aix ;; esac;; -*-sequent-*) icu_cv_host_frag=$srcdir/config/mh-ptx ;; +*-sequent-*) icu_cv_host_frag=mh-ptx ;; *-*-hpux*) case "$CXX" in - *aCC) icu_cv_host_frag=$srcdir/config/mh-hpux-acc ;; - *CC) icu_cv_host_frag=$srcdir/config/mh-hpux-cc ;; + *aCC) icu_cv_host_frag=mh-hpux-acc ;; + *CC) icu_cv_host_frag=mh-hpux-cc ;; esac;; -*-*-os390*) icu_cv_host_frag=$srcdir/config/mh-os390 ;; -*-*-os400*) icu_cv_host_frag=$srcdir/config/mh-os400 ;; -*-apple-rhapsody*) icu_cv_host_frag=$srcdir/config/mh-darwin ;; -*-apple-darwin*) icu_cv_host_frag=$srcdir/config/mh-darwin ;; -*) icu_cv_host_frag=$srcdir/config/mh-unknown ;; +*-*-os390*) icu_cv_host_frag=mh-os390 ;; +*-*-os400*) icu_cv_host_frag=mh-os400 ;; +*-apple-rhapsody*) icu_cv_host_frag=mh-darwin ;; +*-apple-darwin*) icu_cv_host_frag=mh-darwin ;; +*) icu_cv_host_frag=mh-unknown ;; esac @@ -3692,7 +3692,9 @@ case "${host}" in *) platform=U_UNKNOWN_PLATFORM ;; esac -host_frag=$icu_cv_host_frag +platform_make_fragment_name="$icu_cv_host_frag" +platform_make_fragment='$(top_srcdir)/config/'"$platform_make_fragment_name" + case "${host}" in @@ -3855,7 +3857,7 @@ done ac_given_srcdir=$srcdir ac_given_INSTALL="$INSTALL" -trap 'rm -fr `echo "Makefile \ +trap 'rm -fr `echo "icudefs.mk Makefile \ data/Makefile \ common/Makefile config/Makefile.inc i18n/Makefile \ extra/Makefile extra/ustdio/Makefile \ @@ -3963,8 +3965,8 @@ s%@TESTS_FALSE@%$TESTS_FALSE%g s%@SAMPLES_TRUE@%$SAMPLES_TRUE%g s%@SAMPLES_FALSE@%$SAMPLES_FALSE%g s%@platform@%$platform%g -/@host_frag@/r $host_frag -s%@host_frag@%%g +s%@platform_make_fragment_name@%$platform_make_fragment_name%g +s%@platform_make_fragment@%$platform_make_fragment%g s%@ld_rpath_suf@%$ld_rpath_suf%g CEOF @@ -4007,7 +4009,7 @@ EOF cat >> $CONFIG_STATUS <