dnl Configuration for the gettext-runtime directory of GNU gettext
-dnl Copyright (C) 1995-2024 Free Software Foundation, Inc.
+dnl Copyright (C) 1995-2025 Free Software Foundation, Inc.
dnl
dnl This program is free software: you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
is_woe32dll=no
fi
AM_CONDITIONAL([WOE32DLL], [test $is_woe32dll = yes])
+if test $is_woe32dll = yes; then
+ AC_DEFINE([WOE32DLL], [1],
+ [Define when --enable-shared is used on Windows.])
+fi
dnl Put some default definitions into config.h.
AH_BOTTOM([
the C macro DLL_EXPORT (together with PIC) when compiling for a shared
library (called DLL under Windows) and does not define it when compiling
an object file meant to be linked statically into some executable. */
-#if (defined _WIN32 || defined __CYGWIN__) && defined DLL_EXPORT && !defined IN_RELOCWRAPPER
-# define DLL_VARIABLE __declspec (dllimport)
-#else
-# define DLL_VARIABLE
-#endif
+/* But in the scope of this configure file (gettext-runtime/ without intl and
+ libasprintf), there is no shared library. So it's simple. */
+#define DLL_VARIABLE
/* Extra OS/2 (emx+gcc) defines. */
#if defined __EMX__ && !defined __KLIBC__
is_woe32dll=no
fi
AM_CONDITIONAL([WOE32DLL], [test $is_woe32dll = yes])
+if test $is_woe32dll = yes; then
+ AC_DEFINE([WOE32DLL], [1],
+ [Define when --enable-shared is used on Windows.])
+fi
GETTEXTLIB_EXPORTS_FLAGS=
dnl woe32dll/gettextlib-exports.c needs to know whether the getopt facility
the C macro DLL_EXPORT (together with PIC) when compiling for a shared
library (called DLL under Windows) and does not define it when compiling
an object file meant to be linked statically into some executable. */
-#if (defined _WIN32 || defined __CYGWIN__) && defined DLL_EXPORT && !defined IN_RELOCWRAPPER
+/* DLL_VARIABLE is used for variables defined in libgettextlib.
+ LIBGETTEXTSRC_DLL_VARIABLE is used for variables defined in libgettextsrc.
+ */
+#if defined _MSC_VER && WOE32DLL && !defined IN_RELOCWRAPPER
+# if IN_LIBGETTEXTLIB && defined DLL_EXPORT
+# define DLL_VARIABLE __declspec(dllexport)
+# else
+# define DLL_VARIABLE __declspec(dllimport)
+# endif
+#elif (defined _WIN32 || defined __CYGWIN__) && defined DLL_EXPORT && !defined IN_RELOCWRAPPER
# define DLL_VARIABLE __declspec (dllimport)
#else
# define DLL_VARIABLE
#endif
+#if defined _MSC_VER && WOE32DLL && !defined IN_RELOCWRAPPER
+# if IN_LIBGETTEXTSRC && defined DLL_EXPORT
+# define LIBGETTEXTSRC_DLL_VARIABLE __declspec(dllexport)
+# else
+# define LIBGETTEXTSRC_DLL_VARIABLE __declspec(dllimport)
+# endif
+#elif (defined _WIN32 || defined __CYGWIN__) && defined DLL_EXPORT && !defined IN_RELOCWRAPPER
+# define LIBGETTEXTSRC_DLL_VARIABLE __declspec (dllimport)
+#else
+# define LIBGETTEXTSRC_DLL_VARIABLE
+#endif
/* Extra OS/2 (emx+gcc) defines. */
#if defined __EMX__ && !defined __KLIBC__
## Makefile for the gettext-tools/gnulib-lib subdirectory of GNU gettext
-## Copyright (C) 1995-2024 Free Software Foundation, Inc.
+## Copyright (C) 1995-2025 Free Software Foundation, Inc.
##
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
# Needed so that woe32dll/export.h is found.
AM_CPPFLAGS += -I$(top_srcdir)
+# Needed for the expansion of DLL_VARIABLE on MSVC.
+AM_CPPFLAGS += -DIN_LIBGETTEXTLIB
+
# Parametrization of the 'relocatable' module.
AM_CPPFLAGS += -DDEPENDS_ON_LIBICONV=1 -DDEPENDS_ON_LIBINTL=1
## Makefile for the gettext-tools/libgettextpo subdirectory of GNU gettext
-## Copyright (C) 1995-2024 Free Software Foundation, Inc.
+## Copyright (C) 1995-2025 Free Software Foundation, Inc.
##
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
all check install: config.h
config.h: $(BUILT_SOURCES)
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
- : "Avoid double inclusion, to avoid a warning about redefinition of DLL_VARIABLE."; \
+ : "Avoid double inclusion, to avoid a warning about redefinition of DLL_VARIABLE and LIBGETTEXTSRC_DLL_VARIABLE."; \
echo '#ifndef GTPO_CONFIG_H'; \
echo '#define GTPO_CONFIG_H'; \
echo; \
: "No references to variables in other libraries exist."; \
echo '#undef DLL_VARIABLE'; \
echo '#define DLL_VARIABLE'; \
+ echo '#undef LIBGETTEXTSRC_DLL_VARIABLE'; \
+ echo '#define LIBGETTEXTSRC_DLL_VARIABLE'; \
echo; \
echo '#endif /* GTPO_CONFIG_H */'; \
} > config.h && \
libgettextsrc_la_CPPFLAGS = $(AM_CPPFLAGS) $(INCXML)
+# Needed for the expansion of LIBGETTEXTSRC_DLL_VARIABLE on MSVC.
+libgettextsrc_la_CPPFLAGS += -DIN_LIBGETTEXTSRC
+
# Tell the mingw or Cygwin linker which symbols to export.
if WOE32DLL
libgettextsrc_la_SOURCES += ../woe32dll/gettextsrc-exports.c
/* Format strings.
- Copyright (C) 2001-2024 Free Software Foundation, Inc.
+ Copyright (C) 2001-2025 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software: you can redistribute it and/or modify
};
/* Format string parsers, each defined in its own file. */
-extern DLL_VARIABLE struct formatstring_parser formatstring_c;
-extern DLL_VARIABLE struct formatstring_parser formatstring_objc;
-extern DLL_VARIABLE struct formatstring_parser formatstring_cplusplus_brace;
-extern DLL_VARIABLE struct formatstring_parser formatstring_python;
-extern DLL_VARIABLE struct formatstring_parser formatstring_python_brace;
-extern DLL_VARIABLE struct formatstring_parser formatstring_java;
-extern DLL_VARIABLE struct formatstring_parser formatstring_java_printf;
-extern DLL_VARIABLE struct formatstring_parser formatstring_csharp;
-extern DLL_VARIABLE struct formatstring_parser formatstring_javascript;
-extern DLL_VARIABLE struct formatstring_parser formatstring_scheme;
-extern DLL_VARIABLE struct formatstring_parser formatstring_lisp;
-extern DLL_VARIABLE struct formatstring_parser formatstring_elisp;
-extern DLL_VARIABLE struct formatstring_parser formatstring_librep;
-extern DLL_VARIABLE struct formatstring_parser formatstring_ruby;
-extern DLL_VARIABLE struct formatstring_parser formatstring_sh;
-extern DLL_VARIABLE struct formatstring_parser formatstring_awk;
-extern DLL_VARIABLE struct formatstring_parser formatstring_lua;
-extern DLL_VARIABLE struct formatstring_parser formatstring_pascal;
-extern DLL_VARIABLE struct formatstring_parser formatstring_smalltalk;
-extern DLL_VARIABLE struct formatstring_parser formatstring_qt;
-extern DLL_VARIABLE struct formatstring_parser formatstring_qt_plural;
-extern DLL_VARIABLE struct formatstring_parser formatstring_kde;
-extern DLL_VARIABLE struct formatstring_parser formatstring_kde_kuit;
-extern DLL_VARIABLE struct formatstring_parser formatstring_boost;
-extern DLL_VARIABLE struct formatstring_parser formatstring_tcl;
-extern DLL_VARIABLE struct formatstring_parser formatstring_perl;
-extern DLL_VARIABLE struct formatstring_parser formatstring_perl_brace;
-extern DLL_VARIABLE struct formatstring_parser formatstring_php;
-extern DLL_VARIABLE struct formatstring_parser formatstring_gcc_internal;
-extern DLL_VARIABLE struct formatstring_parser formatstring_gfc_internal;
-extern DLL_VARIABLE struct formatstring_parser formatstring_ycp;
+extern LIBGETTEXTSRC_DLL_VARIABLE struct formatstring_parser formatstring_c;
+extern LIBGETTEXTSRC_DLL_VARIABLE struct formatstring_parser formatstring_objc;
+extern LIBGETTEXTSRC_DLL_VARIABLE struct formatstring_parser formatstring_cplusplus_brace;
+extern LIBGETTEXTSRC_DLL_VARIABLE struct formatstring_parser formatstring_python;
+extern LIBGETTEXTSRC_DLL_VARIABLE struct formatstring_parser formatstring_python_brace;
+extern LIBGETTEXTSRC_DLL_VARIABLE struct formatstring_parser formatstring_java;
+extern LIBGETTEXTSRC_DLL_VARIABLE struct formatstring_parser formatstring_java_printf;
+extern LIBGETTEXTSRC_DLL_VARIABLE struct formatstring_parser formatstring_csharp;
+extern LIBGETTEXTSRC_DLL_VARIABLE struct formatstring_parser formatstring_javascript;
+extern LIBGETTEXTSRC_DLL_VARIABLE struct formatstring_parser formatstring_scheme;
+extern LIBGETTEXTSRC_DLL_VARIABLE struct formatstring_parser formatstring_lisp;
+extern LIBGETTEXTSRC_DLL_VARIABLE struct formatstring_parser formatstring_elisp;
+extern LIBGETTEXTSRC_DLL_VARIABLE struct formatstring_parser formatstring_librep;
+extern LIBGETTEXTSRC_DLL_VARIABLE struct formatstring_parser formatstring_ruby;
+extern LIBGETTEXTSRC_DLL_VARIABLE struct formatstring_parser formatstring_sh;
+extern LIBGETTEXTSRC_DLL_VARIABLE struct formatstring_parser formatstring_awk;
+extern LIBGETTEXTSRC_DLL_VARIABLE struct formatstring_parser formatstring_lua;
+extern LIBGETTEXTSRC_DLL_VARIABLE struct formatstring_parser formatstring_pascal;
+extern LIBGETTEXTSRC_DLL_VARIABLE struct formatstring_parser formatstring_smalltalk;
+extern LIBGETTEXTSRC_DLL_VARIABLE struct formatstring_parser formatstring_qt;
+extern LIBGETTEXTSRC_DLL_VARIABLE struct formatstring_parser formatstring_qt_plural;
+extern LIBGETTEXTSRC_DLL_VARIABLE struct formatstring_parser formatstring_kde;
+extern LIBGETTEXTSRC_DLL_VARIABLE struct formatstring_parser formatstring_kde_kuit;
+extern LIBGETTEXTSRC_DLL_VARIABLE struct formatstring_parser formatstring_boost;
+extern LIBGETTEXTSRC_DLL_VARIABLE struct formatstring_parser formatstring_tcl;
+extern LIBGETTEXTSRC_DLL_VARIABLE struct formatstring_parser formatstring_perl;
+extern LIBGETTEXTSRC_DLL_VARIABLE struct formatstring_parser formatstring_perl_brace;
+extern LIBGETTEXTSRC_DLL_VARIABLE struct formatstring_parser formatstring_php;
+extern LIBGETTEXTSRC_DLL_VARIABLE struct formatstring_parser formatstring_gcc_internal;
+extern LIBGETTEXTSRC_DLL_VARIABLE struct formatstring_parser formatstring_gfc_internal;
+extern LIBGETTEXTSRC_DLL_VARIABLE struct formatstring_parser formatstring_ycp;
/* Table of all format string parsers. */
-extern DLL_VARIABLE struct formatstring_parser *formatstring_parsers[NFORMATS];
+extern LIBGETTEXTSRC_DLL_VARIABLE struct formatstring_parser *formatstring_parsers[NFORMATS];
/* Returns an array of the ISO C 99 <inttypes.h> format directives and other
format flags or directives with a system dependent expansion contained in
/* GNU gettext - internationalization aids
- Copyright (C) 1995-2024 Free Software Foundation, Inc.
+ Copyright (C) 1995-2025 Free Software Foundation, Inc.
This file was written by Peter Miller <millerp@canb.auug.org.au>
format_ycp
};
#define NFORMATS 31 /* Number of format_type enum values. */
-extern DLL_VARIABLE const char *const format_language[NFORMATS];
-extern DLL_VARIABLE const char *const format_language_pretty[NFORMATS];
+extern LIBGETTEXTSRC_DLL_VARIABLE const char *const format_language[NFORMATS];
+extern LIBGETTEXTSRC_DLL_VARIABLE const char *const format_language_pretty[NFORMATS];
/* Is current msgid a format string? */
enum is_format
sc_bullet_unicode
};
#define NSYNTAXCHECKS 4
-extern DLL_VARIABLE const char *const syntax_check_name[NSYNTAXCHECKS];
+extern LIBGETTEXTSRC_DLL_VARIABLE const char *const syntax_check_name[NSYNTAXCHECKS];
/* Is current msgid subject to a syntax check? */
#if 0
/* Message list concatenation and duplicate handling.
- Copyright (C) 2001-2003, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2001-2025 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software: you can redistribute it and/or modify
/* These variables control which messages are selected. */
-extern DLL_VARIABLE int more_than;
-extern DLL_VARIABLE int less_than;
+extern LIBGETTEXTSRC_DLL_VARIABLE int more_than;
+extern LIBGETTEXTSRC_DLL_VARIABLE int less_than;
/* If true, use the first available translation.
If false, merge all available translations into one and fuzzy it. */
-extern DLL_VARIABLE bool use_first;
+extern LIBGETTEXTSRC_DLL_VARIABLE bool use_first;
/* If true, merge like msgcomm.
If false, merge like msgcat and msguniq. */
-extern DLL_VARIABLE bool msgcomm_mode;
+extern LIBGETTEXTSRC_DLL_VARIABLE bool msgcomm_mode;
/* If true, omit the header entry.
If false, keep the header entry present in the input. */
-extern DLL_VARIABLE bool omit_header;
+extern LIBGETTEXTSRC_DLL_VARIABLE bool omit_header;
extern msgdomain_list_ty *
catenate_msgdomain_list (string_list_ty *file_list,
/* Table of known plural form expressions.
- Copyright (C) 2001-2003 Free Software Foundation, Inc.
+ Copyright (C) 2001-2025 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2002.
This program is free software: you can redistribute it and/or modify
const char *value;
};
-extern DLL_VARIABLE struct plural_table_entry plural_table[];
-extern DLL_VARIABLE const size_t plural_table_size;
+extern LIBGETTEXTSRC_DLL_VARIABLE struct plural_table_entry plural_table[];
+extern LIBGETTEXTSRC_DLL_VARIABLE const size_t plural_table_size;
#endif /* _PLURAL_TABLE_H */
/* Charset handling while reading PO files.
- Copyright (C) 2001-2024 Free Software Foundation, Inc.
+ Copyright (C) 2001-2025 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software: you can redistribute it and/or modify
extern const char *po_charset_canonicalize (const char *charset);
/* The canonicalized encoding name for ASCII. */
-extern DLL_VARIABLE const char *po_charset_ascii;
+extern LIBGETTEXTSRC_DLL_VARIABLE const char *po_charset_ascii;
/* The canonicalized encoding name for UTF-8. */
-extern DLL_VARIABLE const char *po_charset_utf8;
+extern LIBGETTEXTSRC_DLL_VARIABLE const char *po_charset_utf8;
/* Test for ASCII compatibility. */
extern bool po_charset_ascii_compatible (const char *canon_charset);
/* Error handling during reading and writing of PO files.
- Copyright (C) 2004, 2006, 2012 Free Software Foundation, Inc.
+ Copyright (C) 2004-2025 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2004.
This program is free software: you can redistribute it and/or modify
- The functions must increment the error_message_count variable declared
in error.h. */
-extern DLL_VARIABLE
+extern LIBGETTEXTSRC_DLL_VARIABLE
void (*po_error) (int status, int errnum,
const char *format, ...)
#if (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) || __GNUC__ > 3
__attribute__ ((__format__ (__printf__, 3, 4)))
#endif
;
-extern DLL_VARIABLE
+extern LIBGETTEXTSRC_DLL_VARIABLE
void (*po_error_at_line) (int status, int errnum,
const char *filename, unsigned int lineno,
const char *format, ...)
- multiline_error must increment the error_message_count variable declared
in error.h if prefix != NULL. */
-extern DLL_VARIABLE
+extern LIBGETTEXTSRC_DLL_VARIABLE
void (*po_multiline_warning) (char *prefix, char *message);
-extern DLL_VARIABLE
+extern LIBGETTEXTSRC_DLL_VARIABLE
void (*po_multiline_error) (char *prefix, char *message);
/* Reading textual message catalogs (such as PO files).
- Copyright (C) 1995-2024 Free Software Foundation, Inc.
+ Copyright (C) 1995-2025 Free Software Foundation, Inc.
This file was written by Bruno Haible <haible@clisp.cons.org>.
This program is free software: you can redistribute it and/or modify
/* If false, duplicate msgids in the same domain and file generate an error.
If true, such msgids are allowed; the caller should treat them
appropriately. Defaults to false. */
-extern DLL_VARIABLE bool allow_duplicates;
+extern LIBGETTEXTSRC_DLL_VARIABLE bool allow_duplicates;
/* Read the input file from a stream. Returns a list of messages. */
extern msgdomain_list_ty *
/* Reading PO files.
- Copyright (C) 2006-2024 Free Software Foundation, Inc.
+ Copyright (C) 2006-2025 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2006.
This program is free software: you can redistribute it and/or modify
/* Describes a .po / .pot file parser. */
-extern DLL_VARIABLE const struct catalog_input_format input_format_po;
+extern LIBGETTEXTSRC_DLL_VARIABLE const struct catalog_input_format input_format_po;
/* Global variables. */
/* Number of parse errors within a PO file that cause the program to
terminate. Cf. error_message_count, declared in <error.h>. */
-extern DLL_VARIABLE unsigned int gram_max_allowed_errors;
+extern LIBGETTEXTSRC_DLL_VARIABLE unsigned int gram_max_allowed_errors;
#ifdef __cplusplus
/* Reading Java .properties files.
- Copyright (C) 2003, 2006, 2019 Free Software Foundation, Inc.
+ Copyright (C) 2003-2025 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2003.
This program is free software: you can redistribute it and/or modify
/* Describes a .properties file parser. */
-extern DLL_VARIABLE const struct catalog_input_format input_format_properties;
+extern LIBGETTEXTSRC_DLL_VARIABLE const struct catalog_input_format input_format_properties;
#ifdef __cplusplus
/* Reading NeXTstep/GNUstep .strings files.
- Copyright (C) 2003, 2006, 2019 Free Software Foundation, Inc.
+ Copyright (C) 2003-2025 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2003.
This program is free software: you can redistribute it and/or modify
/* Describes a .strings file parser. */
-extern DLL_VARIABLE const struct catalog_input_format input_format_stringtable;
+extern LIBGETTEXTSRC_DLL_VARIABLE const struct catalog_input_format input_format_stringtable;
#ifdef __cplusplus
/* Sentence handling.
- Copyright (C) 2015-2024 Free Software Foundation, Inc.
+ Copyright (C) 2015-2025 Free Software Foundation, Inc.
Written by Daiki Ueno <ueno@gnu.org>, 2015.
This program is free software: you can redistribute it and/or modify
/* The minimal number of white spaces which should follow after the
end of sentence. */
-extern DLL_VARIABLE int sentence_end_required_spaces;
+extern LIBGETTEXTSRC_DLL_VARIABLE int sentence_end_required_spaces;
/* Locates the position of a sentence end marker (a period, a question
mark, etc.) in a null-terminated string STR.
/* GNU gettext - internationalization aids
- Copyright (C) 1995-1998, 2000-2003, 2006, 2008, 2014, 2018-2019, 2021, 2023 Free Software Foundation, Inc.
+ Copyright (C) 1995-2025 Free Software Foundation, Inc.
This file was written by Peter Miller <millerp@canb.auug.org.au>
/* Describes a PO file in .po syntax. */
-extern DLL_VARIABLE const struct catalog_output_format output_format_po;
+extern LIBGETTEXTSRC_DLL_VARIABLE const struct catalog_output_format output_format_po;
#ifdef __cplusplus
/* Writing Java .properties files.
- Copyright (C) 2003, 2006, 2019 Free Software Foundation, Inc.
+ Copyright (C) 2003-2025 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2003.
This program is free software: you can redistribute it and/or modify
/* Describes a PO file in Java .properties syntax. */
-extern DLL_VARIABLE const struct catalog_output_format output_format_properties;
+extern LIBGETTEXTSRC_DLL_VARIABLE const struct catalog_output_format output_format_properties;
#ifdef __cplusplus
/* Writing NeXTstep/GNUstep .strings files.
- Copyright (C) 2003, 2006, 2019 Free Software Foundation, Inc.
+ Copyright (C) 2003-2025 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2003.
This program is free software: you can redistribute it and/or modify
/* Describes a PO file in .strings syntax. */
-extern DLL_VARIABLE const struct catalog_output_format output_format_stringtable;
+extern LIBGETTEXTSRC_DLL_VARIABLE const struct catalog_output_format output_format_stringtable;
#ifdef __cplusplus
/* Error handling during reading and writing of textual message catalogs.
- Copyright (C) 2005-2024 Free Software Foundation, Inc.
+ Copyright (C) 2005-2025 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
/* The default xerror_handler, that uses the global variable error_message_count
from <error.h>, and therefore is not multithread-safe. */
-extern DLL_VARIABLE const struct xerror_handler textmode_xerror_handler_struct;
+extern LIBGETTEXTSRC_DLL_VARIABLE const struct xerror_handler textmode_xerror_handler_struct;
#define textmode_xerror_handler (&textmode_xerror_handler_struct)