From 7486bfb6e8df7c4e504d92209b7d9af82acd19f2 Mon Sep 17 00:00:00 2001 From: George Rhoten Date: Wed, 31 Mar 2004 22:33:46 +0000 Subject: [PATCH] ICU-3389 CygWin/MSVC changes X-SVN-Rev: 14813 --- icu4c/source/config/mh-cygwin-msvc | 7 ++++- icu4c/source/data/Makefile.in | 6 +++-- icu4c/source/extra/uconv/Makefile.in | 4 +-- icu4c/source/icudefs.mk.in | 5 ++++ icu4c/source/runConfigureICU | 37 +++++++++----------------- icu4c/source/test/cintltst/Makefile.in | 5 ++-- icu4c/source/test/intltest/Makefile.in | 5 ++-- 7 files changed, 36 insertions(+), 33 deletions(-) diff --git a/icu4c/source/config/mh-cygwin-msvc b/icu4c/source/config/mh-cygwin-msvc index ed5f53bbe9..2eb12254d0 100644 --- a/icu4c/source/config/mh-cygwin-msvc +++ b/icu4c/source/config/mh-cygwin-msvc @@ -3,7 +3,7 @@ ## Copyright (c) 2001-2004, International Business Machines Corporation and ## others. All Rights Reserved. ## -## $Id: mh-cygwin-msvc,v 1.20 2004/03/29 22:58:46 grhoten-oss Exp $ +## $Id: mh-cygwin-msvc,v 1.21 2004/03/31 22:33:46 grhoten-oss Exp $ ## Commands to generate dependency files GEN_DEPS.c= : @@ -79,6 +79,10 @@ LIBCTESTFW= $(top_builddir)/tools/ctestfw/$(LIBICU)ctestfw$(ICULIBSUFFIX)$(SO_TA LIBICUTOOLUTIL= $(LIBDIR)/$(LIBICU)tu$(ICULIBSUFFIX)$(SO_TARGET_VERSION_MAJOR).lib LIBUSTDIO= $(LIBDIR)/$(LIBICU)io$(ICULIBSUFFIX)$(SO_TARGET_VERSION_MAJOR).lib +# Current full path directory. +CURR_FULL_DIR=$(shell cygpath -wma .) +# Current full path directory for use in source code in a -D compiler option. +CURR_SRCCODE_FULL_DIR=$(subst \,\\\\,$(shell cygpath -wa .)) ## Compilation rules %.$(STATIC_O): $(srcdir)/%.c @@ -125,6 +129,7 @@ LIBUSTDIO= $(LIBDIR)/$(LIBICU)io$(ICULIBSUFFIX)$(SO_TARGET_VERSION_MAJOR).lib ## Versioned target for a shared library. FINAL_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO) MIDDLE_SO_TARGET=$(SO_TARGET) +PKGDATA_VERSIONING = -r $(SO_TARGET_VERSION_MAJOR) ## Versioned import library names. IMPORT_LIB = $(LIBICU)$(TARGET_STUBNAME)$(ICULIBSUFFIX)$(IMPORT_LIB_EXT) diff --git a/icu4c/source/data/Makefile.in b/icu4c/source/data/Makefile.in index 221df8ff79..d9cc8ea238 100644 --- a/icu4c/source/data/Makefile.in +++ b/icu4c/source/data/Makefile.in @@ -27,11 +27,13 @@ ICUDT=$(ICUDATA_PLATFORM_NAME)_ ifeq ($(PKGDATA_OPTS),) PKGDATA_OPTS = -O $(top_builddir)/data/icupkg.inc endif +ifeq ($(PKGDATA_VERSIONING),) +PKGDATA_VERSIONING = -r $(SO_TARGET_VERSION) +endif top_builddir_from_tmp = $(patsubst ..%,../..%,$(top_builddir)) -CURDIR=$(shell pwd) +CURDIR:=$(CURR_FULL_DIR) PKGDATA = $(BINDIR)/pkgdata $(PKGDATA_OPTS) -c -d $(CURDIR)/out -PKGDATA_VERSIONING = -r $(SO_TARGET_VERSION) # OBJDATADIR must be a short path (with ..'s) to the data. diff --git a/icu4c/source/extra/uconv/Makefile.in b/icu4c/source/extra/uconv/Makefile.in index f941e74ee4..ba419eb329 100644 --- a/icu4c/source/extra/uconv/Makefile.in +++ b/icu4c/source/extra/uconv/Makefile.in @@ -57,7 +57,7 @@ UCONVMSG_LIB=dummy ## Static mode ifeq ($(UCONVMSG_MODE),static) DEFS += -DUCONVMSG_LINK=$(MSGNAME) -UCONVMSG_LIB = $(RESDIR)/lib$(MSGNAME).a +UCONVMSG_LIB = $(RESDIR)/lib$(MSGNAME).$(A) LIBS += $(UCONVMSG_LIB) PKGMODE=static INSTALLTO=$(libdir) @@ -143,7 +143,7 @@ $(RESDIR)/$(RESDIR).lst: Makefile pkgdata.inc $(srcdir)/resfiles.mk @$(MKINSTALLDIRS) $(RESDIR) @-$(RMV) $@ @for file in $(RESFILES); do \ - echo `pwd`/$$file >> $@; \ + echo $(CURR_FULL_DIR)/$$file >> $@; \ done; # no install for static mode diff --git a/icu4c/source/icudefs.mk.in b/icu4c/source/icudefs.mk.in index d1a72bd337..a781164278 100644 --- a/icu4c/source/icudefs.mk.in +++ b/icu4c/source/icudefs.mk.in @@ -172,6 +172,11 @@ LIBDIR=$(top_builddir)/lib # Location of the executables before "make install" is used BINDIR=$(top_builddir)/bin +# Current full path directory. +CURR_FULL_DIR=$(shell pwd) +# Current full path directory for use in source code in a -D compiler option. +CURR_SRCCODE_FULL_DIR=$(subst \,\\\\,$(shell cygpath -wa .)) + # Link commands to link to ICU libs LIBICUDT= -L$(LIBDIR) -l$(ICUPREFIX)data$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX) LIBICUUC= -L$(LIBDIR) -l$(ICUPREFIX)uc$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX) $(LIBICUDT) diff --git a/icu4c/source/runConfigureICU b/icu4c/source/runConfigureICU index cb24e8a76c..21bd8f33b8 100755 --- a/icu4c/source/runConfigureICU +++ b/icu4c/source/runConfigureICU @@ -37,6 +37,7 @@ The following names can be supplied as the argument for platform: ALPHA/LINUXCCC Use Compaq C compiler on Alpha/Linux systems BeOS Use the GNU C++ compiler on BeOS CygWin Use the GNU C++ compiler on CygWin + CygWin/MSVC Use the Microsoft Visual C++ compiler on CygWin FreeBSD Use the GNU C++ compiler on Free BSD HP-UX11ACC Use the Advanced C++ compiler on HP-UX 11 HP-UX11CC Use HP's C++ compiler on HP-UX 11 @@ -151,24 +152,13 @@ case $platform in RELEASE_CXXFLAGS="-O2 -qmaxmem=-1" #LDFLAGS=-L/usr/lpp/xlC/lib; export LDFLAGS ;; +# For no threads use --enable-threads=no. Visual Age makes no distinction between xlC and xlC_r or any other _r programs. AIXGCC) THE_OS=AIX THE_COMP="gcc" CC=`which gcc`; export CC CXX=`which g++`; export CXX ;; -# Just use --enable-threads=no. Visual Age makes no distinction between xlC and xlC_r or any other _r programs. -# AIX4.3VA_nothreads) -# THE_OS=AIX -# THE_COMP="xlC" -# # Only in Visual Age, there is no different between xlc and xlc_r. -# CC=`which xlc`; export CC -# CXX=`which xlC`; export CXX -# OPTS="$OPTS --enable-threads=no" -# RELEASE_CFLAGS="-O2 -qmaxmem=-1" -# RELEASE_CXXFLAGS="-O2 -qmaxmem=-1" -# #LDFLAGS=-L/usr/lpp/xlC/lib; export LDFLAGS -# ;; SOLARISX86) THE_OS="SOLARIS X86" THE_COMP="Sun's CC" @@ -268,18 +258,17 @@ case $platform in RELEASE_CFLAGS='-O3' RELEASE_CXXFLAGS='-O3' ;; -# This doesn't work yet. -# CygWin/MSVC) -# THE_OS="CygWin" -# THE_COMP="Microsoft Visual C++" -# CC=cl; export CC -# CXX=cl; export CXX -# RELEASE_CFLAGS='/O2 /Ob2' -# RELEASE_CXXFLAGS='/O2 /Ob2' -# DEBUG_CFLAGS='/Zi' -# DEBUG_CXXFLAGS='/Zi' -# DEBUG_LDFLAGS='/DEBUG' -# ;; + CygWin/MSVC) + THE_OS="CygWin" + THE_COMP="Microsoft Visual C++" + CC=cl; export CC + CXX=cl; export CXX + RELEASE_CFLAGS='/O2 /Ob2' + RELEASE_CXXFLAGS='/O2 /Ob2' + DEBUG_CFLAGS='/Zi' + DEBUG_CXXFLAGS='/Zi' + DEBUG_LDFLAGS='/DEBUG' + ;; MacOSX) THE_OS="MacOS X (Darwin)" THE_COMP="the GNU C++" diff --git a/icu4c/source/test/cintltst/Makefile.in b/icu4c/source/test/cintltst/Makefile.in index 96b05c168e..c6083554ed 100644 --- a/icu4c/source/test/cintltst/Makefile.in +++ b/icu4c/source/test/cintltst/Makefile.in @@ -1,5 +1,5 @@ ## Makefile.in for ICU - test/cintltst -## Copyright (c) 1999-2003, International Business Machines Corporation and +## Copyright (c) 1999-2004, International Business Machines Corporation and ## others. All Rights Reserved. ## Source directory information @@ -29,8 +29,9 @@ else LINK = $(LINK.c) endif -BUILDDIR := $(shell pwd)/../../ +BUILDDIR := $(CURR_SRCCODE_FULL_DIR)/../../ BUILDDIR := $(BUILDDIR:test/cintltst/../../=) +BUILDDIR := $(BUILDDIR:test\\\\cintltst/../../=) # we define ICU_UNICODE_VERSION so we can test it CPPFLAGS += -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(top_srcdir)/tools/ctestfw -I$(top_srcdir)/tools/toolutil diff --git a/icu4c/source/test/intltest/Makefile.in b/icu4c/source/test/intltest/Makefile.in index d4210def17..a8443675a7 100644 --- a/icu4c/source/test/intltest/Makefile.in +++ b/icu4c/source/test/intltest/Makefile.in @@ -1,5 +1,5 @@ ## Makefile.in for ICU - test/intltest -## Copyright (c) 1999-2003, International Business Machines Corporation and +## Copyright (c) 1999-2004, International Business Machines Corporation and ## others. All Rights Reserved. ## Source directory information @@ -19,8 +19,9 @@ CLEANFILES = *~ $(DEPS) ## Target information TARGET = intltest$(EXEEXT) -BUILDDIR := $(shell pwd)/../../ +BUILDDIR := $(CURR_SRCCODE_FULL_DIR)/../../ BUILDDIR := $(BUILDDIR:test/intltest/../../=) +BUILDDIR := $(BUILDDIR:test\\\\intltest/../../=) CPPFLAGS += -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw DEFS += -D'U_TOPSRCDIR="$(top_srcdir)/"' -D'U_TOPBUILDDIR="$(BUILDDIR)"'