From: Bruno Haible Date: Mon, 31 Mar 2003 20:02:54 +0000 (+0000) Subject: More Woe32/MSVC support. X-Git-Tag: v0.12~128 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=68aba9d7055b14f2a3037b1549c6eb2ad3486aac;p=thirdparty%2Fgettext.git More Woe32/MSVC support. --- diff --git a/gettext-runtime/intl/ChangeLog b/gettext-runtime/intl/ChangeLog index 3a0758570..e68b8fd57 100644 --- a/gettext-runtime/intl/ChangeLog +++ b/gettext-runtime/intl/ChangeLog @@ -1,3 +1,7 @@ +2003-03-30 Bruno Haible + + * Makefile.in (INCLUDES): Mention the current directory first. + 2003-03-17 Bruno Haible Native Woe32/MSVC support. @@ -5,12 +9,17 @@ * Makefile.msvc: New file. * README.woe32: New file. * Makefile.in (HEADERS): Remove libgnuintl.h, add libgnuintl.h.in. - (DISTFILES.gettext): Add Makefile.msvc. + (DISTFILES.gettext): Add libgnuintl.h.msvc-shared, README.woe32, + Makefile.msvc. (DISTFILES.obsolete): Add libgnuintl.h. (libgnuintl.h): New rule. (libintl.h, $(OBJECTS)): Expect libgnuintl.h in builddir, not in srcdir. (mostlyclean): Also remove libgnuintl.h. + * dcigettext.c (alloca): Add support for MSVC. + * loadmsgcat.c (alloca): Likewise. + * localealias.c (alloca): Likewise. + * relocatable.h (RELOCATABLE_DLL_EXPORTED): New macro. * Makefile.in (loadmsgcat.$lo): Depend on hash-string.h. diff --git a/gettext-runtime/intl/Makefile.in b/gettext-runtime/intl/Makefile.in index 57407e124..85fea19a1 100644 --- a/gettext-runtime/intl/Makefile.in +++ b/gettext-runtime/intl/Makefile.in @@ -123,7 +123,8 @@ DISTFILES.common = Makefile.in \ config.charset locale.alias ref-add.sin ref-del.sin $(HEADERS) $(SOURCES) DISTFILES.generated = plural.c DISTFILES.normal = VERSION -DISTFILES.gettext = COPYING.LIB-2.0 COPYING.LIB-2.1 libintl.glibc Makefile.msvc +DISTFILES.gettext = COPYING.LIB-2.0 COPYING.LIB-2.1 libintl.glibc \ +libgnuintl.h.msvc-shared README.woe32 Makefile.msvc DISTFILES.obsolete = xopen-msg.sed linux-msg.sed po2tbl.sed.in cat-compat.c \ COPYING.LIB-2 gettext.h libgettext.h plural-eval.c libgnuintl.h @@ -217,7 +218,7 @@ ref-del.sed: $(srcdir)/ref-del.sin sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-del.sin > t-ref-del.sed mv t-ref-del.sed ref-del.sed -INCLUDES = -I.. -I. -I$(srcdir) +INCLUDES = -I. -I$(srcdir) -I.. libgnuintl.h: $(srcdir)/libgnuintl.h.in cp $(srcdir)/libgnuintl.h.in libgnuintl.h diff --git a/gettext-runtime/intl/Makefile.msvc b/gettext-runtime/intl/Makefile.msvc index e3801dbba..69f77220c 100644 --- a/gettext-runtime/intl/Makefile.msvc +++ b/gettext-runtime/intl/Makefile.msvc @@ -36,6 +36,14 @@ includedir = $(prefix)\include datadir = $(prefix)\share localedir = $(datadir)\locale aliaspath = +IIprefix = c:\\usr +IIexec_prefix = $(IIprefix) +IIbindir = $(IIexec_prefix)\\bin +IIlibdir = $(IIexec_prefix)\\lib +IIincludedir = $(IIprefix)\\include +IIdatadir = $(IIprefix)\\share +IIlocaledir = $(IIdatadir)\\locale +IIaliaspath = # Programs used by "make": @@ -60,9 +68,11 @@ OPTIMFLAGS = -Od -Z7 OPTIMFLAGS = -D_NDEBUG -O1 !endif -CFLAGS = $(MFLAGS) $(WARN_CFLAGS) $(OPTIMFLAGS) -DHAVE_CONFIG_H -DLOCALEDIR=\"$(localedir)\" -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" -DIN_LIBINTL -DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDIR=\"$(bindir)\" -DNO_XMALLOC -Dset_relocation_prefix=libintl_set_relocation_prefix -Drelocate=libintl_relocate +# -DBUILDING_LIBINTL: Change expansion of LIBINTL_DLL_EXPORTED macro. +# -DBUILDING_DLL: Change expansion of RELOCATABLE_DLL_EXPORTED macro. +CFLAGS = $(MFLAGS) $(WARN_CFLAGS) $(OPTIMFLAGS) -DHAVE_CONFIG_H -DBUILDING_LIBINTL -DBUILDING_DLL -DLOCALEDIR=\"$(IIlocaledir)\" -DLOCALE_ALIAS_PATH=\"$(IIaliaspath)\" -DIN_LIBINTL -DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDIR=\"$(IIbindir)\" -DNO_XMALLOC -Dset_relocation_prefix=libintl_set_relocation_prefix -Drelocate=libintl_relocate -INCLUDES = -I.. +INCLUDES = -I. -I.. -I$(includedir) AR = lib AR_FLAGS = /out: @@ -168,7 +178,7 @@ intl.lib : $(OBJECTS) # intl.dll and intl.lib are created together. intl.lib : $(OBJECTS) $(RESOURCES) - $(CC) $(MFLAGS) -LD $(OBJECTS) $(RESOURCES) + $(CC) $(MFLAGS) -LD $(OBJECTS) $(libdir)\iconv.lib $(RESOURCES) -Feintl.dll intl.res : $(srcdir)\..\windows\intl.rc rc -Fo intl.res $(srcdir)\..\windows\intl.rc diff --git a/gettext-runtime/intl/dcigettext.c b/gettext-runtime/intl/dcigettext.c index 593adb09f..f6edb95c0 100644 --- a/gettext-runtime/intl/dcigettext.c +++ b/gettext-runtime/intl/dcigettext.c @@ -1,5 +1,5 @@ /* Implementation of the internal dcigettext function. - Copyright (C) 1995-1999, 2000-2002 Free Software Foundation, Inc. + Copyright (C) 1995-1999, 2000-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published @@ -33,14 +33,19 @@ # define alloca __builtin_alloca # define HAVE_ALLOCA 1 #else -# if defined HAVE_ALLOCA_H || defined _LIBC -# include +# ifdef _MSC_VER +# include +# define alloca _alloca # else -# ifdef _AIX - #pragma alloca +# if defined HAVE_ALLOCA_H || defined _LIBC +# include # else -# ifndef alloca +# ifdef _AIX + #pragma alloca +# else +# ifndef alloca char *alloca (); +# endif # endif # endif # endif diff --git a/gettext-runtime/intl/loadmsgcat.c b/gettext-runtime/intl/loadmsgcat.c index a07d9de8a..8509bd345 100644 --- a/gettext-runtime/intl/loadmsgcat.c +++ b/gettext-runtime/intl/loadmsgcat.c @@ -1,5 +1,5 @@ /* Load needed message catalogs. - Copyright (C) 1995-1999, 2000-2002 Free Software Foundation, Inc. + Copyright (C) 1995-1999, 2000-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published @@ -38,14 +38,19 @@ # define alloca __builtin_alloca # define HAVE_ALLOCA 1 #else -# if defined HAVE_ALLOCA_H || defined _LIBC -# include +# ifdef _MSC_VER +# include +# define alloca _alloca # else -# ifdef _AIX - #pragma alloca +# if defined HAVE_ALLOCA_H || defined _LIBC +# include # else -# ifndef alloca +# ifdef _AIX + #pragma alloca +# else +# ifndef alloca char *alloca (); +# endif # endif # endif # endif diff --git a/gettext-runtime/intl/localealias.c b/gettext-runtime/intl/localealias.c index 12ad821e6..7c4ce58f2 100644 --- a/gettext-runtime/intl/localealias.c +++ b/gettext-runtime/intl/localealias.c @@ -39,14 +39,19 @@ # define alloca __builtin_alloca # define HAVE_ALLOCA 1 #else -# if defined HAVE_ALLOCA_H || defined _LIBC -# include +# ifdef _MSC_VER +# include +# define alloca _alloca # else -# ifdef _AIX - #pragma alloca +# if defined HAVE_ALLOCA_H || defined _LIBC +# include # else -# ifndef alloca +# ifdef _AIX + #pragma alloca +# else +# ifndef alloca char *alloca (); +# endif # endif # endif # endif diff --git a/gettext-runtime/intl/relocatable.h b/gettext-runtime/intl/relocatable.h index 9ca617ada..d141200a6 100644 --- a/gettext-runtime/intl/relocatable.h +++ b/gettext-runtime/intl/relocatable.h @@ -23,13 +23,23 @@ /* This can be enabled through the configure --enable-relocatable option. */ #if ENABLE_RELOCATABLE +/* When building a DLL, we must export some functions. Note that because + this is a private .h file, we don't need to use __declspec(dllimport) + in any case. */ +#if defined _MSC_VER && BUILDING_DLL +# define RELOCATABLE_DLL_EXPORTED __declspec(dllexport) +#else +# define RELOCATABLE_DLL_EXPORTED +#endif + /* Sets the original and the current installation prefix of the package. Relocation simply replaces a pathname starting with the original prefix by the corresponding pathname with the current prefix instead. Both prefixes should be directory names without trailing slash (i.e. use "" instead of "/"). */ -extern void set_relocation_prefix (const char *orig_prefix, - const char *curr_prefix); +extern RELOCATABLE_DLL_EXPORTED void + set_relocation_prefix (const char *orig_prefix, + const char *curr_prefix); /* Returns the pathname, relocated according to the current installation directory. */