From cd9de6d9669c86e9429e9ef87d91e326bee34e24 Mon Sep 17 00:00:00 2001 From: George Rhoten Date: Mon, 17 Feb 2003 17:48:50 +0000 Subject: [PATCH] ICU-2705 Fixes for CygWin/MSVC configuration X-SVN-Rev: 11075 --- icu4c/source/config/mh-cygwin | 4 ++-- icu4c/source/config/mh-cygwin-msvc | 20 ++++++++++++-------- icu4c/source/test/cintltst/Makefile.in | 1 + icu4c/source/test/intltest/Makefile.in | 2 ++ icu4c/source/tools/toolutil/toolutil.c | 9 +++++++++ 5 files changed, 26 insertions(+), 10 deletions(-) diff --git a/icu4c/source/config/mh-cygwin b/icu4c/source/config/mh-cygwin index d3e7dc53636..5f447658502 100644 --- a/icu4c/source/config/mh-cygwin +++ b/icu4c/source/config/mh-cygwin @@ -3,7 +3,7 @@ ## Copyright (c) 2001, International Business Machines Corporation and ## others. All Rights Reserved. ## -## $Id: mh-cygwin,v 1.7 2003/02/11 00:13:03 grhoten-oss Exp $ +## $Id: mh-cygwin,v 1.8 2003/02/17 17:48:50 grhoten-oss Exp $ ## Commands to generate dependency files GEN_DEPS.c= $(CC) -E -MM $(DEFS) $(CPPFLAGS) @@ -32,7 +32,7 @@ LD_SONAME = -Wl,-soname -Wl,$(MIDDLE_SO_TARGET) ## Shared object suffix SO = dll ## Non-shared intermediate object suffix -STATIC_O = lib +STATIC_O = o #LIBICU = $(ICUPREFIX) ## Link commands to link to ICU libs diff --git a/icu4c/source/config/mh-cygwin-msvc b/icu4c/source/config/mh-cygwin-msvc index eda1b70b2a5..14bda466bc0 100644 --- a/icu4c/source/config/mh-cygwin-msvc +++ b/icu4c/source/config/mh-cygwin-msvc @@ -3,7 +3,7 @@ ## Copyright (c) 2001, International Business Machines Corporation and ## others. All Rights Reserved. ## -## $Id: mh-cygwin-msvc,v 1.1 2003/02/11 00:13:48 grhoten-oss Exp $ +## $Id: mh-cygwin-msvc,v 1.2 2003/02/17 17:48:50 grhoten-oss Exp $ ## Commands to generate dependency files GEN_DEPS.c= : @@ -23,16 +23,16 @@ DEFS+=/D"WIN32" LDFLAGS+=/nologo # Commands to compile -COMPILE.c= $(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) /c -COMPILE.cc= $(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) /c +COMPILE.c= $(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) /GF /c +COMPILE.cc= $(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) /GF /c # Commands to link -LINK.c= LINK.EXE /subsystem:console $(CFLAGS) $(LDFLAGS) -LINK.cc= LINK.EXE /subsystem:console $(CXXFLAGS) $(LDFLAGS) +LINK.c= LINK.EXE /subsystem:console $(LDFLAGS) +LINK.cc= LINK.EXE /subsystem:console $(LDFLAGS) ## Commands to make a shared library -SHLIB.c= LINK.EXE /DLL $(CFLAGS) $(LDFLAGS) -SHLIB.cc= LINK.EXE /DLL $(CXXFLAGS) $(LDFLAGS) +SHLIB.c= LINK.EXE /DLL $(LDFLAGS) +SHLIB.cc= LINK.EXE /DLL $(LDFLAGS) ## Compiler switch to embed a runtime search path LD_RPATH= @@ -44,7 +44,7 @@ LD_SONAME = ## Shared object suffix SO = dll ## Non-shared intermediate object suffix -STATIC_O = lib +STATIC_O = o # OUTOPT is for creating a specific output name OUTOPT = /out: @@ -97,6 +97,10 @@ LIBUSTDIO= $(top_builddir)/extra/ustdio/libustdio$(ICULIBSUFFIX)$(SO_TARGET_VERS @echo "generating dependency information for $<" @$(GEN_DEPS.cc) $< > $@ +## Compile a Windows resource file +%.res : $(srcdir)/%.rc + @rc.exe /fo$@ $< + ## Versioned target for a shared library. FINAL_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR)$(ICULIBSUFFIX).$(SO) MIDDLE_SO_TARGET= diff --git a/icu4c/source/test/cintltst/Makefile.in b/icu4c/source/test/cintltst/Makefile.in index d89f7518ea4..06f773455ee 100644 --- a/icu4c/source/test/cintltst/Makefile.in +++ b/icu4c/source/test/cintltst/Makefile.in @@ -30,6 +30,7 @@ LINK = $(LINK.c) endif BUILDDIR := $(shell pwd)/../../ +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 10f17114adc..21638251d71 100644 --- a/icu4c/source/test/intltest/Makefile.in +++ b/icu4c/source/test/intltest/Makefile.in @@ -20,6 +20,8 @@ CLEANFILES = *~ $(DEPS) TARGET = intltest$(EXEEXT) BUILDDIR := $(shell pwd)/../../ +BUILDDIR := $(BUILDDIR:test/intltest/../../=) + CPPFLAGS += -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(top_srcdir)/tools/toolutil DEFS += -D'U_TOPSRCDIR="$(top_srcdir)/"' -D'U_TOPBUILDDIR="$(BUILDDIR)"' LIBS = $(LIBICUI18N) $(LIBICUUC) $(LIBICUTOOLUTIL) $(DEFAULT_LIBS) $(LIB_M) diff --git a/icu4c/source/tools/toolutil/toolutil.c b/icu4c/source/tools/toolutil/toolutil.c index 8b773d849a9..1a2c5af7f03 100644 --- a/icu4c/source/tools/toolutil/toolutil.c +++ b/icu4c/source/tools/toolutil/toolutil.c @@ -61,6 +61,15 @@ findBasename(const char *filename) { if(basename!=NULL) { return basename+1; } else { +#ifdef WIN32 + /* Use lenient matching on Windows, which can accept either \ or / + This is useful for CygWin environments which has both + */ + basename=uprv_strrchr(filename, '/'); + if(basename!=NULL) { + return basename+1; + } +#endif return filename; } }