* gettext-tools/tests/intl-version-prg.c: New file.
* gettext-tools/tests/intl-version: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
(check_PROGRAMS): Add intl-version-prg.
(intl_version_prg_SOURCES, intl_version_prg_LDADD): New variables.
/gettext-tools/tests/intl-thread-2-prg.exe
/gettext-tools/tests/intl-thread-3-prg
/gettext-tools/tests/intl-thread-3-prg.exe
+/gettext-tools/tests/intl-version-prg
+/gettext-tools/tests/intl-version-prg.exe
/gettext-tools/tests/sentence-1-prg
/gettext-tools/tests/sentence-1-prg.exe
/gettext-tools/tests/testlocale
intl-1 intl-2 intl-3 intl-4 intl-5 \
intl-setlocale-1 intl-setlocale-2 \
intl-thread-1 intl-thread-2 intl-thread-3 \
+ intl-version \
msgattrib-1 msgattrib-2 msgattrib-3 msgattrib-4 msgattrib-5 \
msgattrib-6 msgattrib-7 msgattrib-8 msgattrib-9 msgattrib-10 \
msgattrib-11 msgattrib-12 msgattrib-13 msgattrib-14 msgattrib-15 \
LDADD = $(LDADD_@USE_INCLUDED_LIBINTL@) @INTL_MACOSX_LIBS@
LDADD_yes = ../intl/libintl.la @LTLIBTHREAD@
LDADD_no = ../intl/libgnuintl.la @LTLIBTHREAD@ @LTLIBINTL@
-check_PROGRAMS = tstgettext tstngettext testlocale intl-1-prg intl-3-prg intl-4-prg intl-5-prg intl-setlocale-1-prg intl-setlocale-2-prg intl-thread-1-prg intl-thread-2-prg intl-thread-3-prg cake fc3 fc4 fc5 gettextpo-1-prg sentence-1-prg
+check_PROGRAMS = tstgettext tstngettext testlocale intl-1-prg intl-3-prg intl-4-prg intl-5-prg intl-setlocale-1-prg intl-setlocale-2-prg intl-thread-1-prg intl-thread-2-prg intl-thread-3-prg intl-version-prg cake fc3 fc4 fc5 gettextpo-1-prg sentence-1-prg
tstgettext_SOURCES = tstgettext.c setlocale.c
tstgettext_CFLAGS = -DINSTALLDIR=\".\"
tstgettext_LDADD = ../gnulib-lib/libgettextlib.la $(LDADD)
intl_thread_3_prg_CFLAGS_1 = -DUSE_POSIX_THREADS
intl_thread_3_prg_LDADD = ../gnulib-lib/libgettextlib.la $(LDADD) $(intl_thread_3_prg_LDADD_@HAVE_NEWLOCALE@)
intl_thread_3_prg_LDADD_1 = -lpthread
+intl_version_prg_SOURCES = intl-version-prg.c
+intl_version_prg_LDADD = ../gnulib-lib/libgettextlib.la $(LDADD)
cake_SOURCES = plural-1-prg.c setlocale.c
cake_LDADD = ../gnulib-lib/libgettextlib.la $(LDADD)
fc3_SOURCES = format-c-3-prg.c setlocale.c
--- /dev/null
+#! /bin/sh
+. "${srcdir=.}/init.sh"; path_prepend_ . ../src
+
+# Test that libintl_version has the expected value,
+# even when --enable-shared is used on Windows.
+
+../intl-version-prg
--- /dev/null
+/* Test of public API of <libintl.h>.
+ Copyright (C) 2019 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2019.
+
+ 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 Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+/* Make sure we use the included libintl, not the system's one. */
+#undef _LIBINTL_H
+#include "libgnuintl.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+/* Use the system functions, not the gnulib overrides in this file. */
+#undef fflush
+#undef fprintf
+
+#define ASSERT(expr) \
+ do \
+ { \
+ if (!(expr)) \
+ { \
+ fprintf (stderr, "%s:%d: assertion failed\n", \
+ __FILE__, __LINE__); \
+ fflush (stderr); \
+ abort (); \
+ } \
+ } \
+ while (0)
+
+int
+main (int argc, char *argv[])
+{
+ /* Test LIBINTL_VERSION. */
+ {
+ enum { version = LIBINTL_VERSION };
+ }
+
+ /* Test libintl_version. */
+ ASSERT (libintl_version == LIBINTL_VERSION);
+
+ return 0;
+}