summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2005-07-18 11:28:21 +0000
committerBruno Haible <bruno@clisp.org>2009-06-23 12:12:38 +0200
commitc53d435e9a616a28e3bb78dc371df940519c9b16 (patch)
treee1d9135dfefb486f0561c02eb6acf5cb10af2ca6
parent6c4eda658c18d792871d4a2f3d1a7ce94692be7b (diff)
downloadexternal_gettext-c53d435e9a616a28e3bb78dc371df940519c9b16.zip
external_gettext-c53d435e9a616a28e3bb78dc371df940519c9b16.tar.gz
external_gettext-c53d435e9a616a28e3bb78dc371df940519c9b16.tar.bz2
Use lock.h.
-rw-r--r--ChangeLog4
-rw-r--r--PACKAGING1
-rw-r--r--gettext-runtime/ChangeLog8
-rw-r--r--gettext-runtime/Makefile.am5
-rw-r--r--gettext-runtime/configure.ac10
-rw-r--r--gettext-runtime/intl/ChangeLog32
-rw-r--r--gettext-runtime/intl/Makefile.in6
-rw-r--r--gettext-runtime/intl/Makefile.msvc17
-rw-r--r--gettext-runtime/intl/Makefile.vms17
-rw-r--r--gettext-runtime/intl/bindtextdom.c36
-rw-r--r--gettext-runtime/intl/dcigettext.c56
-rw-r--r--gettext-runtime/intl/finddomain.c36
-rw-r--r--gettext-runtime/intl/loadmsgcat.c56
-rw-r--r--gettext-runtime/intl/localealias.c34
-rw-r--r--gettext-runtime/intl/log.c31
-rw-r--r--gettext-runtime/intl/textdomain.c36
-rw-r--r--gettext-runtime/m4/ChangeLog8
-rw-r--r--gettext-runtime/m4/Makefile.am1
-rw-r--r--gettext-runtime/m4/gettext.m494
-rw-r--r--gettext-runtime/tests/ChangeLog7
-rw-r--r--gettext-tools/doc/ChangeLog4
-rw-r--r--gettext-tools/doc/gettext.texi2
-rw-r--r--gettext-tools/examples/ChangeLog15
-rwxr-xr-xgettext-tools/examples/hello-c++-gnome/autoclean.sh3
-rw-r--r--gettext-tools/examples/hello-c++-gnome/m4/Makefile.am4
-rwxr-xr-xgettext-tools/examples/hello-c++-kde/autoclean.sh3
-rwxr-xr-xgettext-tools/examples/hello-c++/autoclean.sh3
-rw-r--r--gettext-tools/examples/hello-c++/m4/Makefile.am4
-rwxr-xr-xgettext-tools/examples/hello-c-gnome/autoclean.sh3
-rwxr-xr-xgettext-tools/examples/hello-c/autoclean.sh3
-rw-r--r--gettext-tools/examples/hello-c/m4/Makefile.am4
-rwxr-xr-xgettext-tools/examples/hello-objc-gnome/autoclean.sh3
-rw-r--r--gettext-tools/examples/hello-objc-gnome/m4/Makefile.am4
-rwxr-xr-xgettext-tools/examples/hello-objc/autoclean.sh3
-rw-r--r--gettext-tools/examples/hello-objc/m4/Makefile.am4
-rw-r--r--gettext-tools/m4/ChangeLog4
-rw-r--r--gettext-tools/m4/Makefile.am1
-rw-r--r--gettext-tools/misc/ChangeLog4
-rw-r--r--gettext-tools/misc/gettextize.in12
39 files changed, 204 insertions, 374 deletions
diff --git a/ChangeLog b/ChangeLog
index d556106..06f1a67 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2005-07-16 Bruno Haible <bruno@clisp.org>
+
+ * PACKAGING: Add lock.m4.
+
2005-07-08 Bruno Haible <bruno@clisp.org>
* m4/libtool.m4 (postinstall_cmds) [cygwin,mingw,pw32]: Make DLL
diff --git a/PACKAGING b/PACKAGING
index 904debf..ab24c9a 100644
--- a/PACKAGING
+++ b/PACKAGING
@@ -130,6 +130,7 @@ following file list.
$prefix/share/aclocal/lib-ld.m4
$prefix/share/aclocal/lib-link.m4
$prefix/share/aclocal/lib-prefix.m4
+ $prefix/share/aclocal/lock.m4
$prefix/share/aclocal/longdouble.m4
$prefix/share/aclocal/longlong.m4
$prefix/share/aclocal/nls.m4
diff --git a/gettext-runtime/ChangeLog b/gettext-runtime/ChangeLog
index a751959..6521f0d 100644
--- a/gettext-runtime/ChangeLog
+++ b/gettext-runtime/ChangeLog
@@ -1,3 +1,11 @@
+2005-07-16 Bruno Haible <bruno@clisp.org>
+
+ * tests: New directory.
+ * configure.ac (LIBSCHED): New variable.
+ Add AC_CONFIG of tests/Makefile.
+ * Makefile.am (SUBDIRS, DIST_SUBDIRS): Add tests.
+ (config.h.msvc): Define USE_WIN32_THREADS.
+
2005-07-05 Bruno Haible <bruno@clisp.org>
* configure.ac (DLL_VARIABLE): Define also as nonempty when building
diff --git a/gettext-runtime/Makefile.am b/gettext-runtime/Makefile.am
index 34d2dd2..62f1440 100644
--- a/gettext-runtime/Makefile.am
+++ b/gettext-runtime/Makefile.am
@@ -22,8 +22,8 @@ ACLOCAL_AMFLAGS = -I m4 -I ../gettext-tools/m4 -I ../autoconf-lib-link/m4 -I ../
MAKEINFO = env LANG= LC_MESSAGES= LC_ALL= LANGUAGE= @MAKEINFO@
-SUBDIRS = doc intl intl-java intl-csharp lib @SUBDIR_libasprintf@ src po man m4
-DIST_SUBDIRS = doc intl intl-java intl-csharp lib libasprintf src po man m4
+SUBDIRS = doc intl intl-java intl-csharp lib @SUBDIR_libasprintf@ src po man m4 tests
+DIST_SUBDIRS = doc intl intl-java intl-csharp lib libasprintf src po man m4 tests
EXTRA_DIST = BUGS
@@ -161,6 +161,7 @@ config.h.msvc: config.h.in ../version.sh
-e 's/#undef STACK_DIRECTION$$/#define STACK_DIRECTION -1/' \
-e 's/#undef STDC_HEADERS$$/#define STDC_HEADERS 1/' \
-e 's/#undef USE_UNLOCKED_IO$$/#define USE_UNLOCKED_IO 1/' \
+ -e 's/#undef USE_WIN32_THREADS$$/#define USE_WIN32_THREADS 1/' \
-e 's/#undef __GETOPT_PREFIX$$/#define __GETOPT_PREFIX/' \
-e 's/#undef inline$$/#define inline __inline/' \
-e 's/#undef ssize_t$$/#define ssize_t int/' \
diff --git a/gettext-runtime/configure.ac b/gettext-runtime/configure.ac
index 8efdc54..f8797e8 100644
--- a/gettext-runtime/configure.ac
+++ b/gettext-runtime/configure.ac
@@ -127,6 +127,14 @@ AC_SUBST(CROSS_COMPILING)
dnl Checks for optional programs for the tests/lang-* tests.
gt_PROG_ANSI_CXX
+dnl Checks for special libraries for the tests/test-lock test.
+dnl On some systems, sched_yield is in librt, rather than in libpthread.
+LIBSCHED=
+if test $gl_threads_api = posix; then
+ AC_CHECK_LIB(rt, sched_yield, [LIBSCHED=-lrt])
+fi
+AC_SUBST([LIBSCHED])
+
dnl Determine whether to build libasprintf.
AC_ARG_ENABLE(libasprintf,
[ --disable-libasprintf do not build libasprintf],
@@ -170,4 +178,6 @@ AC_CONFIG_FILES([man/x-to-1])
AC_CONFIG_FILES([m4/Makefile])
+AC_CONFIG_FILES([tests/Makefile])
+
AC_OUTPUT
diff --git a/gettext-runtime/intl/ChangeLog b/gettext-runtime/intl/ChangeLog
index 2551c9c..9c9db70 100644
--- a/gettext-runtime/intl/ChangeLog
+++ b/gettext-runtime/intl/ChangeLog
@@ -1,3 +1,33 @@
+2005-07-16 Bruno Haible <bruno@clisp.org>
+
+ * lock.h: New file.
+ * lock.c: New file.
+ * bindtextdom.c: Include lock.h. Don't include THREAD_H. Remove
+ definitions of __libc_rwlock_*.
+ * finddomain.c: Likewise.
+ * textdomain.c: Likewise.
+ * dcigettext.c: Include lock.h. Don't include THREAD_H. Remove
+ definitions of __libc_lock_*, __libc_rwlock_*.
+ * loadmsgcat.c: Include lock.h. Don't include THREAD_H. Remove
+ definitions of __libc_lock_*_recursive.
+ * localealias.c: Include lock.h. Don't include THREAD_H. Remove
+ definitions of __libc_lock_*.
+ * log.c: Likewise.
+ * Makefile.in (HEADERS): Add lock.h.
+ (SOURCES): Add lock.c.
+ (OBJECTS): Add lock.$lo.
+ (lock.lo): New rule.
+ (bindtextdom.$lo, dcigettext.$lo, finddomain.$lo, loadmsgcat.$lo,
+ localealias.$lo, lock.$lo, log.$lo): Depend on lock.h.
+ * Makefile.msvc (OBJECTS): Add lock.obj.
+ (bindtextdom.obj, finddomain.obj, loadmsgcat.obj, localealias.obj,
+ dcigettext.obj, log.obj): Depend on lock.h.
+ (lock.obj): New rule.
+ * Makefile.vms (OBJECTS): Add lock.obj.
+ (bindtextdom.obj, finddomain.obj, loadmsgcat.obj, localealias.obj,
+ dcigettext.obj, log.obj): Depend on lock.h.
+ (lock.obj): New rule.
+
2005-07-05 Bruno Haible <bruno@clisp.org>
* printf-args.c (printf_fetchargs): Work around broken definition of
@@ -61,7 +91,7 @@
__libc_lock_lock_recursive, __libc_lock_unlock_recursive): Define
fallbacks.
(_nl_load_domain): Fix portability problems in last patch.
-
+
2004-09-25 Ulrich Drepper <drepper@redhat.com>
* dcigettext.c (DCIGETTEXT): Protect tfind/tsearch calls.
diff --git a/gettext-runtime/intl/Makefile.in b/gettext-runtime/intl/Makefile.in
index 1368eb4..8da3e10 100644
--- a/gettext-runtime/intl/Makefile.in
+++ b/gettext-runtime/intl/Makefile.in
@@ -72,6 +72,7 @@ HEADERS = \
plural-exp.h \
eval-plural.h \
localcharset.h \
+ lock.h \
relocatable.h \
xsize.h \
printf-args.h printf-args.c \
@@ -98,6 +99,7 @@ SOURCES = \
plural.y \
plural-exp.c \
localcharset.c \
+ lock.c \
relocatable.c \
langprefs.c \
localename.c \
@@ -125,6 +127,7 @@ OBJECTS = \
plural.$lo \
plural-exp.$lo \
localcharset.$lo \
+ lock.$lo \
relocatable.$lo \
langprefs.$lo \
localename.$lo \
@@ -216,6 +219,8 @@ plural-exp.lo: $(srcdir)/plural-exp.c
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/plural-exp.c
localcharset.lo: $(srcdir)/localcharset.c
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localcharset.c
+lock.lo: $(srcdir)/lock.c
+ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/lock.c
relocatable.lo: $(srcdir)/relocatable.c
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/relocatable.c
langprefs.lo: $(srcdir)/langprefs.c
@@ -435,6 +440,7 @@ explodename.$lo l10nflist.$lo: $(srcdir)/loadinfo.h
dcigettext.$lo loadmsgcat.$lo plural.$lo plural-exp.$lo: $(srcdir)/plural-exp.h
dcigettext.$lo: $(srcdir)/eval-plural.h
localcharset.$lo: $(srcdir)/localcharset.h
+bindtextdom.$lo dcigettext.$lo finddomain.$lo loadmsgcat.$lo localealias.$lo lock.$lo log.$lo: $(srcdir)/lock.h
localealias.$lo localcharset.$lo relocatable.$lo: $(srcdir)/relocatable.h
printf.$lo: $(srcdir)/printf-args.h $(srcdir)/printf-args.c $(srcdir)/printf-parse.h $(srcdir)/wprintf-parse.h $(srcdir)/xsize.h $(srcdir)/printf-parse.c $(srcdir)/vasnprintf.h $(srcdir)/vasnwprintf.h $(srcdir)/vasnprintf.c
diff --git a/gettext-runtime/intl/Makefile.msvc b/gettext-runtime/intl/Makefile.msvc
index c48e1d9..f639f0f 100644
--- a/gettext-runtime/intl/Makefile.msvc
+++ b/gettext-runtime/intl/Makefile.msvc
@@ -99,7 +99,7 @@ INSTALL_DATA = copy
SHELL = /bin/sh
-OBJECTS = bindtextdom.obj dcgettext.obj dgettext.obj gettext.obj finddomain.obj hash-string.obj loadmsgcat.obj localealias.obj textdomain.obj l10nflist.obj explodename.obj dcigettext.obj dcngettext.obj dngettext.obj ngettext.obj plural.obj plural-exp.obj localcharset.obj relocatable.obj langprefs.obj localename.obj log.obj printf.obj osdep.obj intl-compat.obj
+OBJECTS = bindtextdom.obj dcgettext.obj dgettext.obj gettext.obj finddomain.obj hash-string.obj loadmsgcat.obj localealias.obj textdomain.obj l10nflist.obj explodename.obj dcigettext.obj dcngettext.obj dngettext.obj ngettext.obj plural.obj plural-exp.obj localcharset.obj lock.obj relocatable.obj langprefs.obj localename.obj log.obj printf.obj osdep.obj intl-compat.obj
RESOURCES = intl.res
@@ -112,7 +112,7 @@ libgnuintl.h :
$(LN) $(srcdir)\libgnuintl.h.msvc-shared libgnuintl.h
!endif
-bindtextdom.obj : $(srcdir)\bindtextdom.c libgnuintl.h $(srcdir)\gettextP.h $(srcdir)\gmo.h $(srcdir)\loadinfo.h
+bindtextdom.obj : $(srcdir)\bindtextdom.c libgnuintl.h $(srcdir)\gettextP.h $(srcdir)\gmo.h $(srcdir)\loadinfo.h $(srcdir)\lock.h
$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c $(srcdir)\bindtextdom.c
dcgettext.obj : $(srcdir)\dcgettext.c libgnuintl.h $(srcdir)\gettextP.h $(srcdir)\gmo.h $(srcdir)\loadinfo.h
@@ -124,16 +124,16 @@ dgettext.obj : $(srcdir)\dgettext.c libgnuintl.h $(srcdir)\gettextP.h $(srcdir)\
gettext.obj : $(srcdir)\gettext.c libgnuintl.h $(srcdir)\gettextP.h $(srcdir)\gmo.h $(srcdir)\loadinfo.h
$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c $(srcdir)\gettext.c
-finddomain.obj : $(srcdir)\finddomain.c libgnuintl.h $(srcdir)\gettextP.h $(srcdir)\gmo.h $(srcdir)\loadinfo.h
+finddomain.obj : $(srcdir)\finddomain.c libgnuintl.h $(srcdir)\gettextP.h $(srcdir)\gmo.h $(srcdir)\loadinfo.h $(srcdir)\lock.h
$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c $(srcdir)\finddomain.c
hash-string.obj : $(srcdir)\hash-string.c $(srcdir)\hash-string.h
$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c $(srcdir)\hash-string.c
-loadmsgcat.obj : $(srcdir)\loadmsgcat.c libgnuintl.h $(srcdir)\gettextP.h $(srcdir)\gmo.h $(srcdir)\loadinfo.h $(srcdir)\hash-string.h $(srcdir)\plural-exp.h
+loadmsgcat.obj : $(srcdir)\loadmsgcat.c libgnuintl.h $(srcdir)\gettextP.h $(srcdir)\gmo.h $(srcdir)\loadinfo.h $(srcdir)\hash-string.h $(srcdir)\plural-exp.h $(srcdir)\lock.h
$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c $(srcdir)\loadmsgcat.c
-localealias.obj : $(srcdir)\localealias.c libgnuintl.h $(srcdir)\gettextP.h $(srcdir)\gmo.h $(srcdir)\loadinfo.h $(srcdir)\relocatable.h
+localealias.obj : $(srcdir)\localealias.c libgnuintl.h $(srcdir)\gettextP.h $(srcdir)\gmo.h $(srcdir)\loadinfo.h $(srcdir)\lock.h $(srcdir)\relocatable.h
$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c $(srcdir)\localealias.c
textdomain.obj : $(srcdir)\textdomain.c libgnuintl.h $(srcdir)\gettextP.h $(srcdir)\gmo.h $(srcdir)\loadinfo.h
@@ -145,7 +145,7 @@ l10nflist.obj : $(srcdir)\l10nflist.c libgnuintl.h $(srcdir)\loadinfo.h
explodename.obj : $(srcdir)\explodename.c libgnuintl.h $(srcdir)\loadinfo.h
$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c $(srcdir)\explodename.c
-dcigettext.obj : $(srcdir)\dcigettext.c libgnuintl.h $(srcdir)\gettextP.h $(srcdir)\gmo.h $(srcdir)\loadinfo.h $(srcdir)\hash-string.h $(srcdir)\plural-exp.h $(srcdir)\eval-plural.h
+dcigettext.obj : $(srcdir)\dcigettext.c libgnuintl.h $(srcdir)\gettextP.h $(srcdir)\gmo.h $(srcdir)\loadinfo.h $(srcdir)\hash-string.h $(srcdir)\plural-exp.h $(srcdir)\eval-plural.h $(srcdir)\lock.h
$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c $(srcdir)\dcigettext.c
dcngettext.obj : $(srcdir)\dcngettext.c libgnuintl.h $(srcdir)\gettextP.h $(srcdir)\gmo.h $(srcdir)\loadinfo.h
@@ -166,6 +166,9 @@ plural-exp.obj : $(srcdir)\plural-exp.c libgnuintl.h $(srcdir)\plural-exp.h
localcharset.obj : $(srcdir)\localcharset.c libgnuintl.h $(srcdir)\localcharset.h $(srcdir)\relocatable.h
$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c $(srcdir)\localcharset.c
+lock.obj : $(srcdir)\lock.c $(srcdir)\lock.h
+ $(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c $(srcdir)\lock.c
+
relocatable.obj : $(srcdir)\relocatable.c libgnuintl.h $(srcdir)\relocatable.h
$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c $(srcdir)\relocatable.c
@@ -175,7 +178,7 @@ langprefs.obj : $(srcdir)\langprefs.c libgnuintl.h
localename.obj : $(srcdir)\localename.c libgnuintl.h
$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c $(srcdir)\localename.c
-log.obj : $(srcdir)\log.c libgnuintl.h
+log.obj : $(srcdir)\log.c libgnuintl.h $(srcdir)\lock.h
$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c $(srcdir)\log.c
printf.obj : $(srcdir)\printf.c libgnuintl.h $(srcdir)\printf-args.h $(srcdir)\printf-args.c $(srcdir)\printf-parse.h $(srcdir)\wprintf-parse.h $(srcdir)\printf-parse.c $(srcdir)\vasnprintf.h $(srcdir)\vasnwprintf.h $(srcdir)\vasnprintf.c
diff --git a/gettext-runtime/intl/Makefile.vms b/gettext-runtime/intl/Makefile.vms
index 65d814d..1c28f06 100644
--- a/gettext-runtime/intl/Makefile.vms
+++ b/gettext-runtime/intl/Makefile.vms
@@ -45,7 +45,7 @@ INSTALL_DATA = copy
#### End of system configuration section. ####
-OBJECTS = bindtextdom.obj,dcgettext.obj,dgettext.obj,gettext.obj,finddomain.obj,hash-string.obj,loadmsgcat.obj,localealias.obj,textdomain.obj,l10nflist.obj,explodename.obj,dcigettext.obj,dcngettext.obj,dngettext.obj,ngettext.obj,plural-parse.obj,plural-exp.obj,localcharset.obj,relocatable.obj,langprefs.obj,localename.obj,log.obj,osdep.obj,intl-compat.obj
+OBJECTS = bindtextdom.obj,dcgettext.obj,dgettext.obj,gettext.obj,finddomain.obj,hash-string.obj,loadmsgcat.obj,localealias.obj,textdomain.obj,l10nflist.obj,explodename.obj,dcigettext.obj,dcngettext.obj,dngettext.obj,ngettext.obj,plural-parse.obj,plural-exp.obj,localcharset.obj,lock.obj,relocatable.obj,langprefs.obj,localename.obj,log.obj,osdep.obj,intl-compat.obj
all : intl.olb,libintl.h
write sys$output "Nothing else to be done for 'all'."
@@ -53,7 +53,7 @@ all : intl.olb,libintl.h
libgnuintl.h :
$(LN) $(srcdir)libgnuintl.h_vms libgnuintl.h
-bindtextdom.obj : $(srcdir)bindtextdom.c,libgnuintl.h,$(srcdir)gettextP.h,$(srcdir)gmo.h,$(srcdir)loadinfo.h
+bindtextdom.obj : $(srcdir)bindtextdom.c,libgnuintl.h,$(srcdir)gettextP.h,$(srcdir)gmo.h,$(srcdir)loadinfo.h,$(srcdir)lock.h
$(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) $(srcdir)bindtextdom.c
dcgettext.obj : $(srcdir)dcgettext.c,libgnuintl.h,$(srcdir)gettextP.h,$(srcdir)gmo.h,$(srcdir)loadinfo.h
@@ -65,16 +65,16 @@ dgettext.obj : $(srcdir)dgettext.c,libgnuintl.h,$(srcdir)gettextP.h,$(srcdir)gmo
gettext.obj : $(srcdir)gettext.c,libgnuintl.h,$(srcdir)gettextP.h,$(srcdir)gmo.h,$(srcdir)loadinfo.h
$(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) $(srcdir)gettext.c
-finddomain.obj : $(srcdir)finddomain.c,libgnuintl.h,$(srcdir)gettextP.h,$(srcdir)gmo.h,$(srcdir)loadinfo.h
+finddomain.obj : $(srcdir)finddomain.c,libgnuintl.h,$(srcdir)gettextP.h,$(srcdir)gmo.h,$(srcdir)loadinfo.h,$(srcdir)lock.h
$(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) $(srcdir)finddomain.c
hash-string.obj : $(srcdir)hash-string.c,$(srcdir)hash-string.h
$(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) $(srcdir)hash-string.c
-loadmsgcat.obj : $(srcdir)loadmsgcat.c,libgnuintl.h,$(srcdir)gettextP.h,$(srcdir)gmo.h,$(srcdir)loadinfo.h,$(srcdir)hash-string.h,$(srcdir)plural-exp.h
+loadmsgcat.obj : $(srcdir)loadmsgcat.c,libgnuintl.h,$(srcdir)gettextP.h,$(srcdir)gmo.h,$(srcdir)loadinfo.h,$(srcdir)hash-string.h,$(srcdir)plural-exp.h,$(srcdir)lock.h
$(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) $(srcdir)loadmsgcat.c
-localealias.obj : $(srcdir)localealias.c,libgnuintl.h,$(srcdir)gettextP.h,$(srcdir)gmo.h,$(srcdir)loadinfo.h,$(srcdir)relocatable.h
+localealias.obj : $(srcdir)localealias.c,libgnuintl.h,$(srcdir)gettextP.h,$(srcdir)gmo.h,$(srcdir)loadinfo.h,$(srcdir)lock.h,$(srcdir)relocatable.h
$(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) $(srcdir)localealias.c
textdomain.obj : $(srcdir)textdomain.c,libgnuintl.h,$(srcdir)gettextP.h,$(srcdir)gmo.h,$(srcdir)loadinfo.h
@@ -86,7 +86,7 @@ l10nflist.obj : $(srcdir)l10nflist.c,libgnuintl.h,$(srcdir)loadinfo.h
explodename.obj : $(srcdir)explodename.c,libgnuintl.h,$(srcdir)loadinfo.h
$(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) $(srcdir)explodename.c
-dcigettext.obj : $(srcdir)dcigettext.c,libgnuintl.h,$(srcdir)gettextP.h,$(srcdir)gmo.h,$(srcdir)loadinfo.h,$(srcdir)hash-string.h,$(srcdir)plural-exp.h,$(srcdir)eval-plural.h
+dcigettext.obj : $(srcdir)dcigettext.c,libgnuintl.h,$(srcdir)gettextP.h,$(srcdir)gmo.h,$(srcdir)loadinfo.h,$(srcdir)hash-string.h,$(srcdir)plural-exp.h,$(srcdir)eval-plural.h,$(srcdir)lock.h
$(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) $(srcdir)dcigettext.c
dcngettext.obj : $(srcdir)dcngettext.c,libgnuintl.h,$(srcdir)gettextP.h,$(srcdir)gmo.h,$(srcdir)loadinfo.h
@@ -107,6 +107,9 @@ plural-exp.obj : $(srcdir)plural-exp.c,libgnuintl.h,$(srcdir)plural-exp.h
localcharset.obj : $(srcdir)localcharset.c,libgnuintl.h,$(srcdir)localcharset.h,$(srcdir)relocatable.h
$(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) $(srcdir)localcharset.c
+lock.obj : $(srcdir)lock.c,$(srcdir)lock.h
+ $(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) $(srcdir)lock.c
+
relocatable.obj : $(srcdir)relocatable.c,libgnuintl.h,$(srcdir)relocatable.h
$(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) $(srcdir)relocatable.c
@@ -116,7 +119,7 @@ langprefs.obj : $(srcdir)langprefs.c,libgnuintl.h
localename.obj : $(srcdir)localename.c,libgnuintl.h
$(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) $(srcdir)localename.c
-log.obj : $(srcdir)log.c,libgnuintl.h
+log.obj : $(srcdir)log.c,libgnuintl.h,$(srcdir)lock.h
$(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) $(srcdir)log.c
osdep.obj : $(srcdir)osdep.c,libgnuintl.h
diff --git a/gettext-runtime/intl/bindtextdom.c b/gettext-runtime/intl/bindtextdom.c
index 4c34f61..069ac6e 100644
--- a/gettext-runtime/intl/bindtextdom.c
+++ b/gettext-runtime/intl/bindtextdom.c
@@ -32,44 +32,10 @@
#include "gettextP.h"
/* Handle multi-threaded applications. */
-#ifdef THREAD_H
-# include THREAD_H
-#endif
#ifdef _LIBC
# include <bits/libc-lock.h>
#else
-# if USE_POSIX_THREADS
-# define __libc_rwlock_define(CLASS, NAME) \
- CLASS pthread_rwlock_t NAME;
-# define __libc_rwlock_define_initialized(CLASS, NAME) \
- CLASS pthread_rwlock_t NAME = PTHREAD_RWLOCK_INITIALIZER;
-# define __libc_rwlock_rdlock(NAME) \
- if (pthread_rwlock_rdlock (&NAME) != 0) abort ()
-# define __libc_rwlock_wrlock(NAME) \
- if (pthread_rwlock_wrlock (&NAME) != 0) abort ()
-# define __libc_rwlock_unlock(NAME) \
- if (pthread_rwlock_unlock (&NAME) != 0) abort ()
-# else
-# if USE_PTH_THREADS
-# define __libc_rwlock_define(CLASS, NAME) \
- CLASS pth_rwlock_t NAME;
-# define __libc_rwlock_define_initialized(CLASS, NAME) \
- CLASS pth_rwlock_t NAME = PTH_RWLOCK_INIT;
-# define __libc_rwlock_rdlock(NAME) \
- if (!pth_rwlock_acquire (&NAME, PTH_RWLOCK_RD, 0, NULL)) abort ()
-# define __libc_rwlock_wrlock(NAME) \
- if (!pth_rwlock_acquire (&NAME, PTH_RWLOCK_RW, 0, NULL)) abort ()
-# define __libc_rwlock_unlock(NAME) \
- if (!pth_rwlock_release (&NAME)) abort ()
-# else
-/* Provide dummy implementation if threads are not supported. */
-# define __libc_rwlock_define(CLASS, NAME)
-# define __libc_rwlock_define_initialized(CLASS, NAME)
-# define __libc_rwlock_rdlock(NAME)
-# define __libc_rwlock_wrlock(NAME)
-# define __libc_rwlock_unlock(NAME)
-# endif
-# endif
+# include "lock.h"
#endif
/* The internal variables in the standalone libintl.a must have different
diff --git a/gettext-runtime/intl/dcigettext.c b/gettext-runtime/intl/dcigettext.c
index 5763cf3..e5a3fab 100644
--- a/gettext-runtime/intl/dcigettext.c
+++ b/gettext-runtime/intl/dcigettext.c
@@ -101,64 +101,10 @@ extern int errno;
#include "hash-string.h"
/* Handle multi-threaded applications. */
-#ifdef THREAD_H
-# include THREAD_H
-#endif
#ifdef _LIBC
# include <bits/libc-lock.h>
#else
-# if USE_POSIX_THREADS
-# define __libc_lock_define(CLASS, NAME) \
- CLASS pthread_mutex_t NAME;
-# define __libc_lock_define_initialized(CLASS, NAME) \
- CLASS pthread_mutex_t NAME = PTHREAD_MUTEX_INITIALIZER;
-# define __libc_lock_lock(NAME) \
- if (pthread_mutex_lock (&NAME) != 0) abort ()
-# define __libc_lock_unlock(NAME) \
- if (pthread_mutex_unlock (&NAME) != 0) abort ()
-# define __libc_rwlock_define(CLASS, NAME) \
- CLASS pthread_rwlock_t NAME;
-# define __libc_rwlock_define_initialized(CLASS, NAME) \
- CLASS pthread_rwlock_t NAME = PTHREAD_RWLOCK_INITIALIZER;
-# define __libc_rwlock_rdlock(NAME) \
- if (pthread_rwlock_rdlock (&NAME) != 0) abort ()
-# define __libc_rwlock_wrlock(NAME) \
- if (pthread_rwlock_wrlock (&NAME) != 0) abort ()
-# define __libc_rwlock_unlock(NAME) \
- if (pthread_rwlock_unlock (&NAME) != 0) abort ()
-# else
-# if USE_PTH_THREADS
-# define __libc_lock_define(CLASS, NAME) \
- CLASS pth_mutex_t NAME;
-# define __libc_lock_define_initialized(CLASS, NAME) \
- CLASS pth_mutex_t NAME = PTH_MUTEX_INIT;
-# define __libc_lock_lock(NAME) \
- if (!pth_mutex_acquire (&NAME, 0, NULL)) abort ()
-# define __libc_lock_unlock(NAME) \
- if (!pth_mutex_release (&NAME)) abort ()
-# define __libc_rwlock_define(CLASS, NAME) \
- CLASS pth_rwlock_t NAME;
-# define __libc_rwlock_define_initialized(CLASS, NAME) \
- CLASS pth_rwlock_t NAME = PTH_RWLOCK_INIT;
-# define __libc_rwlock_rdlock(NAME) \
- if (!pth_rwlock_acquire (&NAME, PTH_RWLOCK_RD, 0, NULL)) abort ()
-# define __libc_rwlock_wrlock(NAME) \
- if (!pth_rwlock_acquire (&NAME, PTH_RWLOCK_RW, 0, NULL)) abort ()
-# define __libc_rwlock_unlock(NAME) \
- if (!pth_rwlock_release (&NAME)) abort ()
-# else
-/* Provide dummy implementation if threads are not supported. */
-# define __libc_lock_define(CLASS, NAME)
-# define __libc_lock_define_initialized(CLASS, NAME)
-# define __libc_lock_lock(NAME)
-# define __libc_lock_unlock(NAME)
-# define __libc_rwlock_define(CLASS, NAME)
-# define __libc_rwlock_define_initialized(CLASS, NAME)
-# define __libc_rwlock_rdlock(NAME)
-# define __libc_rwlock_wrlock(NAME)
-# define __libc_rwlock_unlock(NAME)
-# endif
-# endif
+# include "lock.h"
#endif
/* Alignment of types. */
diff --git a/gettext-runtime/intl/finddomain.c b/gettext-runtime/intl/finddomain.c
index a7a024d..8b014e9 100644
--- a/gettext-runtime/intl/finddomain.c
+++ b/gettext-runtime/intl/finddomain.c
@@ -38,44 +38,10 @@
#endif
/* Handle multi-threaded applications. */
-#ifdef THREAD_H
-# include THREAD_H
-#endif
#ifdef _LIBC
# include <bits/libc-lock.h>
#else
-# if USE_POSIX_THREADS
-# define __libc_rwlock_define(CLASS, NAME) \
- CLASS pthread_rwlock_t NAME;
-# define __libc_rwlock_define_initialized(CLASS, NAME) \
- CLASS pthread_rwlock_t NAME = PTHREAD_RWLOCK_INITIALIZER;
-# define __libc_rwlock_rdlock(NAME) \
- if (pthread_rwlock_rdlock (&NAME) != 0) abort ()
-# define __libc_rwlock_wrlock(NAME) \
- if (pthread_rwlock_wrlock (&NAME) != 0) abort ()
-# define __libc_rwlock_unlock(NAME) \
- if (pthread_rwlock_unlock (&NAME) != 0) abort ()
-# else
-# if USE_PTH_THREADS
-# define __libc_rwlock_define(CLASS, NAME) \
- CLASS pth_rwlock_t NAME;
-# define __libc_rwlock_define_initialized(CLASS, NAME) \
- CLASS pth_rwlock_t NAME = PTH_RWLOCK_INIT;
-# define __libc_rwlock_rdlock(NAME) \
- if (!pth_rwlock_acquire (&NAME, PTH_RWLOCK_RD, 0, NULL)) abort ()
-# define __libc_rwlock_wrlock(NAME) \
- if (!pth_rwlock_acquire (&NAME, PTH_RWLOCK_RW, 0, NULL)) abort ()
-# define __libc_rwlock_unlock(NAME) \
- if (!pth_rwlock_release (&NAME)) abort ()
-# else
-/* Provide dummy implementation if threads are not supported. */
-# define __libc_rwlock_define(CLASS, NAME)
-# define __libc_rwlock_define_initialized(CLASS, NAME)
-# define __libc_rwlock_rdlock(NAME)
-# define __libc_rwlock_wrlock(NAME)
-# define __libc_rwlock_unlock(NAME)
-# endif
-# endif
+# include "lock.h"
#endif
/* @@ end of prolog @@ */
diff --git a/gettext-runtime/intl/loadmsgcat.c b/gettext-runtime/intl/loadmsgcat.c
index babed63..4b01dca 100644
--- a/gettext-runtime/intl/loadmsgcat.c
+++ b/gettext-runtime/intl/loadmsgcat.c
@@ -95,64 +95,10 @@ char *alloca ();
#endif
/* Handle multi-threaded applications. */
-#ifdef THREAD_H
-# include THREAD_H
-#endif
#ifdef _LIBC
# include <bits/libc-lock.h>
#else
-# if USE_POSIX_THREADS
-# define __libc_lock_define_recursive(CLASS, NAME) \
- CLASS pthread_mutex_t NAME;
-# define __libc_lock_define_initialized_recursive(CLASS, NAME) \
- CLASS pthread_mutex_t NAME; \
- static pthread_mutex_t NAME##_aux = PTHREAD_MUTEX_INITIALIZER; \
- static int NAME##_initialized = 0; \
- auto int NAME##_dummy = \
- ((NAME##_initialized == 0 \
- ? mutex_init_recursive (&NAME, &NAME##_aux), NAME##_initialized = 1, 0 \
- : 0), NAME##_dummy);
-static inline void
-mutex_init_recursive (pthread_mutex_t *mutex, pthread_mutex_t *mutex_aux)
-{
- pthread_mutexattr_t attributes;
-
- if (pthread_mutex_lock (mutex_aux) != 0)
- abort ();
- if (pthread_mutexattr_init (&attributes) != 0)
- abort ();
- if (pthread_mutexattr_settype (&attributes, PTHREAD_MUTEX_RECURSIVE) != 0)
- abort ();
- if (pthread_mutex_init (mutex, &attributes) != 0)
- abort ();
- if (pthread_mutexattr_destroy (&attributes) != 0)
- abort ();
- if (pthread_mutex_unlock (mutex_aux) != 0)
- abort ();
-}
-# define __libc_lock_lock_recursive(NAME) \
- if (pthread_mutex_lock (&NAME) != 0) abort ()
-# define __libc_lock_unlock_recursive(NAME) \
- if (pthread_mutex_unlock (&NAME) != 0) abort ()
-# else
-# if USE_PTH_THREADS
- /* In Pth, mutexes are recursive by default. */
-# define __libc_lock_define_recursive(CLASS, NAME) \
- CLASS pth_mutex_t NAME;
-# define __libc_lock_define_initialized_recursive(CLASS, NAME) \
- CLASS pth_mutex_t NAME = PTH_MUTEX_INIT;
-# define __libc_lock_lock_recursive(NAME) \
- if (!pth_mutex_acquire (&NAME, 0, NULL)) abort ()
-# define __libc_lock_unlock_recursive(NAME) \
- if (!pth_mutex_release (&NAME)) abort ()
-# else
-/* Provide dummy implementation if threads are not supported. */
-# define __libc_lock_define_recursive(CLASS, NAME)
-# define __libc_lock_define_initialized_recursive(CLASS, NAME)
-# define __libc_lock_lock_recursive(NAME)
-# define __libc_lock_unlock_recursive(NAME)
-# endif
-# endif
+# include "lock.h"
#endif
/* Provide fallback values for macros that ought to be defined in <inttypes.h>.
diff --git a/gettext-runtime/intl/localealias.c b/gettext-runtime/intl/localealias.c
index 6dfcc8b..5fbd172 100644
--- a/gettext-runtime/intl/localealias.c
+++ b/gettext-runtime/intl/localealias.c
@@ -83,41 +83,11 @@ char *alloca ();
# define HAVE___FSETLOCKING 1
#endif
-/* Handle multi-threaded applications.
- We need locking here since we can be called from different places. */
-#ifdef THREAD_H
-# include THREAD_H
-#endif
+/* Handle multi-threaded applications. */
#ifdef _LIBC
# include <bits/libc-lock.h>
#else
-# if USE_POSIX_THREADS
-# define __libc_lock_define(CLASS, NAME) \
- CLASS pthread_mutex_t NAME;
-# define __libc_lock_define_initialized(CLASS, NAME) \
- CLASS pthread_mutex_t NAME = PTHREAD_MUTEX_INITIALIZER;
-# define __libc_lock_lock(NAME) \
- if (pthread_mutex_lock (&NAME) != 0) abort ()
-# define __libc_lock_unlock(NAME) \
- if (pthread_mutex_unlock (&NAME) != 0) abort ()
-# else
-# if USE_PTH_THREADS
-# define __libc_lock_define(CLASS, NAME) \
- CLASS pth_mutex_t NAME;
-# define __libc_lock_define_initialized(CLASS, NAME) \
- CLASS pth_mutex_t NAME = PTH_MUTEX_INIT;
-# define __libc_lock_lock(NAME) \
- if (!pth_mutex_acquire (&NAME, 0, NULL)) abort ()
-# define __libc_lock_unlock(NAME) \
- if (!pth_mutex_release (&NAME)) abort ()
-# else
-/* Provide dummy implementation if threads are not supported. */
-# define __libc_lock_define(CLASS, NAME)
-# define __libc_lock_define_initialized(CLASS, NAME)
-# define __libc_lock_lock(NAME)
-# define __libc_lock_unlock(NAME)
-# endif
-# endif
+# include "lock.h"
#endif
#ifndef internal_function
diff --git a/gettext-runtime/intl/log.c b/gettext-runtime/intl/log.c
index 92b4dab..e3ab5d0 100644
--- a/gettext-runtime/intl/log.c
+++ b/gettext-runtime/intl/log.c
@@ -27,35 +27,10 @@
#include <string.h>
/* Handle multi-threaded applications. */
-#ifdef THREAD_H
-# include THREAD_H
-#endif
-#if USE_POSIX_THREADS
-# define __libc_lock_define(CLASS, NAME) \
- CLASS pthread_mutex_t NAME;
-# define __libc_lock_define_initialized(CLASS, NAME) \
- CLASS pthread_mutex_t NAME = PTHREAD_MUTEX_INITIALIZER;
-# define __libc_lock_lock(NAME) \
- if (pthread_mutex_lock (&NAME) != 0) abort ()
-# define __libc_lock_unlock(NAME) \
- if (pthread_mutex_unlock (&NAME) != 0) abort ()
+#ifdef _LIBC
+# include <bits/libc-lock.h>
#else
-# if USE_PTH_THREADS
-# define __libc_lock_define(CLASS, NAME) \
- CLASS pth_mutex_t NAME;
-# define __libc_lock_define_initialized(CLASS, NAME) \
- CLASS pth_mutex_t NAME = PTH_MUTEX_INIT;
-# define __libc_lock_lock(NAME) \
- if (!pth_mutex_acquire (&NAME, 0, NULL)) abort ()
-# define __libc_lock_unlock(NAME) \
- if (!pth_mutex_release (&NAME)) abort ()
-# else
-/* Provide dummy implementation if threads are not supported. */
-# define __libc_lock_define(CLASS, NAME)
-# define __libc_lock_define_initialized(CLASS, NAME)
-# define __libc_lock_lock(NAME)
-# define __libc_lock_unlock(NAME)
-# endif
+# include "lock.h"
#endif
/* Print an ASCII string with quotes and escape sequences where needed. */
diff --git a/gettext-runtime/intl/textdomain.c b/gettext-runtime/intl/textdomain.c
index d484df5..6f50edf 100644
--- a/gettext-runtime/intl/textdomain.c
+++ b/gettext-runtime/intl/textdomain.c
@@ -31,44 +31,10 @@
#include "gettextP.h"
/* Handle multi-threaded applications. */
-#ifdef THREAD_H
-# include THREAD_H
-#endif
#ifdef _LIBC
# include <bits/libc-lock.h>
#else
-# if USE_POSIX_THREADS
-# define __libc_rwlock_define(CLASS, NAME) \
- CLASS pthread_rwlock_t NAME;
-# define __libc_rwlock_define_initialized(CLASS, NAME) \
- CLASS pthread_rwlock_t NAME = PTHREAD_RWLOCK_INITIALIZER;
-# define __libc_rwlock_rdlock(NAME) \
- if (pthread_rwlock_rdlock (&NAME) != 0) abort ()
-# define __libc_rwlock_wrlock(NAME) \
- if (pthread_rwlock_wrlock (&NAME) != 0) abort ()
-# define __libc_rwlock_unlock(NAME) \
- if (pthread_rwlock_unlock (&NAME) != 0) abort ()
-# else
-# if USE_PTH_THREADS
-# define __libc_rwlock_define(CLASS, NAME) \
- CLASS pth_rwlock_t NAME;
-# define __libc_rwlock_define_initialized(CLASS, NAME) \
- CLASS pth_rwlock_t NAME = PTH_RWLOCK_INIT;
-# define __libc_rwlock_rdlock(NAME) \
- if (!pth_rwlock_acquire (&NAME, PTH_RWLOCK_RD, 0, NULL)) abort ()
-# define __libc_rwlock_wrlock(NAME) \
- if (!pth_rwlock_acquire (&NAME, PTH_RWLOCK_RW, 0, NULL)) abort ()
-# define __libc_rwlock_unlock(NAME) \
- if (!pth_rwlock_release (&NAME)) abort ()
-# else
-/* Provide dummy implementation if threads are not supported. */
-# define __libc_rwlock_define(CLASS, NAME)
-# define __libc_rwlock_define_initialized(CLASS, NAME)
-# define __libc_rwlock_rdlock(NAME)
-# define __libc_rwlock_wrlock(NAME)
-# define __libc_rwlock_unlock(NAME)
-# endif
-# endif
+# include "lock.h"
#endif
/* The internal variables in the standalone libintl.a must have different
diff --git a/gettext-runtime/m4/ChangeLog b/gettext-runtime/m4/ChangeLog
index ad7638c..49ef094 100644
--- a/gettext-runtime/m4/ChangeLog
+++ b/gettext-runtime/m4/ChangeLog
@@ -1,3 +1,11 @@
+2005-07-16 Bruno Haible <bruno@clisp.org>
+
+ * lock.m4: New file.
+ * gettext.m4 (AM_INTL_SUBDIR): Remove multithreading checks. Instead
+ require gl_LOCK and define __libc_lock_*, __libc_rwlock_*,
+ __libc_lock_*recursive*, glthread_* as macros.
+ * Makefile.am (EXTRA_DIST): Add lock.m4.
+
2005-05-05 Bruno Haible <bruno@clisp.org>
* gettext.m4 (AM_GNU_GETTEXT): Add LIBTHREAD to LIBINTL and
diff --git a/gettext-runtime/m4/Makefile.am b/gettext-runtime/m4/Makefile.am
index 5f2dff3..f08ee1e 100644
--- a/gettext-runtime/m4/Makefile.am
+++ b/gettext-runtime/m4/Makefile.am
@@ -16,6 +16,7 @@ inttypes.m4 \
inttypes_h.m4 \
isc-posix.m4 \
lcmessage.m4 \
+lock.m4 \
longdouble.m4 \
longlong.m4 \
nls.m4 \
diff --git a/gettext-runtime/m4/gettext.m4 b/gettext-runtime/m4/gettext.m4
index e42a8e3..d8686cf 100644
--- a/gettext-runtime/m4/gettext.m4
+++ b/gettext-runtime/m4/gettext.m4
@@ -388,6 +388,7 @@ AC_DEFUN([AM_INTL_SUBDIR],
AC_REQUIRE([gt_INTTYPES_PRI])dnl
AC_REQUIRE([gl_XSIZE])dnl
AC_REQUIRE([gt_INTL_MACOSX])dnl
+ AC_REQUIRE([gl_LOCK])dnl
AC_CHECK_TYPE([ptrdiff_t], ,
[AC_DEFINE([ptrdiff_t], [long],
@@ -457,64 +458,41 @@ __fsetlocking])
[Define if you have <langinfo.h> and it defines the NL_LOCALE_NAME macro if _GNU_SOURCE is defined.])
fi
- dnl Check for multithreading.
- AC_ARG_ENABLE(threads,
- AC_HELP_STRING([--disable-threads], [build without multithread safety]),
- gt_use_threads=$enableval, gt_use_threads=yes)
- LIBTHREAD=
- LTLIBTHREAD=
- if test "$gt_use_threads" != no; then
- THREAD_H=
- if test "$gt_use_threads" = yes || test "$gt_use_threads" = posix; then
- AC_CHECK_HEADER(pthread.h, gt_have_pthread_h=yes, gt_have_pthread_h=no)
- if test "$gt_have_pthread_h" = yes; then
- # Other possible tests:
- # compiler flag -pthread
- # -lc_r (AIX, FreeBSD)
- # -lpthreads (FSU threads, PCthreads)
- # -lthread
- # -lgthreads
- gt_have_pthread=
- if test -z "$gt_have_pthread"; then
- AC_CHECK_LIB(pthread, pthread_self,
- [gt_have_pthread=yes LIBTHREAD=-lpthread LTLIBTHREAD=-lpthread])
- fi
- if test -n "$gt_have_pthread"; then
- THREAD_H='<pthread.h>'
- CPPFLAGS="$CPPFLAGS -DUSE_POSIX_THREADS"
- case "$host_os" in
- # aix*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;;
- # freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;;
- # linux*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;;
- solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;;
- esac
- fi
- fi
- fi
- if test "$gt_use_threads" = pth; then
- gt_save_CPPFLAGS="$CPPFLAGS"
- AC_LIB_LINKFLAGS(pth)
- gt_have_pth=
- gt_save_LIBS="$LIBS"
- LIBS="$LIBS -lpth"
- AC_TRY_LINK([#include <pth.h>], [pth_self();], gt_have_pth=yes)
- LIBS="$gt_save_LIBS"
- if test -n "$gt_have_pth"; then
- LIBTHREAD="$LIBPTH"
- LTLIBTHREAD="$LTLIBPTH"
- THREAD_H='<pth.h>'
- CPPFLAGS="$CPPFLAGS -DUSE_PTH_THREADS"
- else
- CPPFLAGS="$gt_save_CPPFLAGS"
- fi
- fi
- if test -n "$THREAD_H"; then
- AC_DEFINE_UNQUOTED(THREAD_H, [$THREAD_H],
- [Define to the header that declares multithreading facilities.])
- fi
- fi
- AC_SUBST(LIBTHREAD)
- AC_SUBST(LTLIBTHREAD)
+ dnl Rename some macros and functions used for locking.
+ AH_BOTTOM([
+#define __libc_lock_t gl_lock_t
+#define __libc_lock_define gl_lock_define
+#define __libc_lock_define_initialized gl_lock_define_initialized
+#define __libc_lock_init gl_lock_init
+#define __libc_lock_lock gl_lock_lock
+#define __libc_lock_unlock gl_lock_unlock
+#define __libc_rwlock_t gl_rwlock_t
+#define __libc_rwlock_define gl_rwlock_define
+#define __libc_rwlock_define_initialized gl_rwlock_define_initialized
+#define __libc_rwlock_init gl_rwlock_init
+#define __libc_rwlock_rdlock gl_rwlock_rdlock
+#define __libc_rwlock_wrlock gl_rwlock_wrlock
+#define __libc_rwlock_unlock gl_rwlock_unlock
+#define __libc_lock_recursive_t gl_recursive_lock_t
+#define __libc_lock_define_recursive gl_recursive_lock_define
+#define __libc_lock_define_initialized_recursive gl_recursive_lock_define_initialized
+#define __libc_lock_init_recursive gl_recursive_lock_init
+#define __libc_lock_lock_recursive gl_recursive_lock_lock
+#define __libc_lock_unlock_recursive gl_recursive_lock_unlock
+#define glthread_lock_init libintl_lock_init
+#define glthread_lock_lock libintl_lock_lock
+#define glthread_lock_unlock libintl_lock_unlock
+#define glthread_lock_destroy libintl_lock_destroy
+#define glthread_rwlock_init libintl_rwlock_init
+#define glthread_rwlock_rdlock libintl_rwlock_rdlock
+#define glthread_rwlock_wrlock libintl_rwlock_wrlock
+#define glthread_rwlock_unlock libintl_rwlock_unlock
+#define glthread_rwlock_destroy libintl_rwlock_destroy
+#define glthread_recursive_lock_init libintl_recursive_lock_init
+#define glthread_recursive_lock_lock libintl_recursive_lock_lock
+#define glthread_recursive_lock_unlock libintl_recursive_lock_unlock
+#define glthread_recursive_lock_destroy libintl_recursive_lock_destroy
+])
dnl intl/plural.c is generated from intl/plural.y. It requires bison,
dnl because plural.y uses bison specific features. It requires at least
diff --git a/gettext-runtime/tests/ChangeLog b/gettext-runtime/tests/ChangeLog
new file mode 100644
index 0000000..62b5213
--- /dev/null
+++ b/gettext-runtime/tests/ChangeLog
@@ -0,0 +1,7 @@
+2005-07-16 Bruno Haible <bruno@clisp.org>
+
+ * tests-lock.c: New file.
+ * Makefile.am: New file.
+ * Makefile.msvc: New file.
+ * Makefile.vms: New file.
+
diff --git a/gettext-tools/doc/ChangeLog b/gettext-tools/doc/ChangeLog
index 9ef2fb3..94a0eb9 100644
--- a/gettext-tools/doc/ChangeLog
+++ b/gettext-tools/doc/ChangeLog
@@ -1,3 +1,7 @@
+2005-07-16 Bruno Haible <bruno@clisp.org>
+
+ * gettext.texi (aclocal): Add lock.m4 to file list.
+
2005-07-01 Bruno Haible <bruno@clisp.org>
* FAQ.html (windows_howto): Mention the three debugging runtime libs.
diff --git a/gettext-tools/doc/gettext.texi b/gettext-tools/doc/gettext.texi
index e0cbe1e..d2046a4 100644
--- a/gettext-tools/doc/gettext.texi
+++ b/gettext-tools/doc/gettext.texi
@@ -6655,7 +6655,7 @@ the simplest is to concatenate the files @file{codeset.m4},
@file{gettext.m4}, @file{glibc2.m4}, @file{glibc21.m4}, @file{iconv.m4},
@file{intdiv0.m4}, @file{intmax.m4}, @file{inttypes.m4}, @file{inttypes_h.m4},
@file{inttypes-pri.m4}, @file{isc-posix.m4}, @file{lcmessage.m4},
-@file{lib-ld.m4}, @file{lib-link.m4}, @file{lib-prefix.m4},
+@file{lib-ld.m4}, @file{lib-link.m4}, @file{lib-prefix.m4}, @file{lock.m4},
@file{longdouble.m4}, @file{longlong.m4}, @file{printf-posix.m4},
@file{progtest.m4}, @file{signed.m4}, @file{size_max.m4},
@file{stdint_h.m4}, @file{uintmax_t.m4}, @file{ulonglong.m4},
diff --git a/gettext-tools/examples/ChangeLog b/gettext-tools/examples/ChangeLog
index 7433894..f4ff8e7 100644
--- a/gettext-tools/examples/ChangeLog
+++ b/gettext-tools/examples/ChangeLog
@@ -1,3 +1,18 @@
+2005-07-16 Bruno Haible <bruno@clisp.org>
+
+ * hello-c/m4/Makefile.am (EXTRA_DIST): Add lock.m4.
+ * hello-c++/m4/Makefile.am (EXTRA_DIST): Likewise.
+ * hello-c++-gnome/m4/Makefile.am (EXTRA_DIST): Likewise.
+ * hello-objc/m4/Makefile.am (EXTRA_DIST): Likewise.
+ * hello-objc-gnome/m4/Makefile.am (EXTRA_DIST): Likewise.
+ * hello-c/autoclean.sh: Remove also m4/lock.m4.
+ * hello-c-gnome/autoclean.sh: Likewise.
+ * hello-c++/autoclean.sh: Likewise.
+ * hello-c++-gnome/autoclean.sh: Likewise.
+ * hello-c++-kde/autoclean.sh: Likewise.
+ * hello-objc/autoclean.sh: Likewise.
+ * hello-objc-gnome/autoclean.sh: Likewise.
+
2005-05-01 Bruno Haible <bruno@clisp.org>
* hello-csharp/configure.ac, hello-csharp-forms/configure.ac: Call
diff --git a/gettext-tools/examples/hello-c++-gnome/autoclean.sh b/gettext-tools/examples/hello-c++-gnome/autoclean.sh
index 5efa49d..97a6bdf 100755
--- a/gettext-tools/examples/hello-c++-gnome/autoclean.sh
+++ b/gettext-tools/examples/hello-c++-gnome/autoclean.sh
@@ -1,6 +1,6 @@
#!/bin/sh
# Example for use of GNU gettext.
-# Copyright (C) 2003-2004 Free Software Foundation, Inc.
+# Copyright (C) 2003-2005 Free Software Foundation, Inc.
# This file is in the public domain.
#
# Script for cleaning all autogenerated files.
@@ -25,6 +25,7 @@ rm -f m4/lcmessage.m4
rm -f m4/lib-ld.m4
rm -f m4/lib-link.m4
rm -f m4/lib-prefix.m4
+rm -f m4/lock.m4
rm -f m4/longdouble.m4
rm -f m4/longlong.m4
rm -f m4/nls.m4
diff --git a/gettext-tools/examples/hello-c++-gnome/m4/Makefile.am b/gettext-tools/examples/hello-c++-gnome/m4/Makefile.am
index 65d9c85..b9234cb 100644
--- a/gettext-tools/examples/hello-c++-gnome/m4/Makefile.am
+++ b/gettext-tools/examples/hello-c++-gnome/m4/Makefile.am
@@ -1,7 +1,7 @@
EXTRA_DIST = \
codeset.m4 gettext.m4 glibc2.m4 glibc21.m4 iconv.m4 intdiv0.m4 inttypes.m4 \
inttypes_h.m4 inttypes-pri.m4 isc-posix.m4 lcmessage.m4 lib-ld.m4 \
- lib-link.m4 lib-prefix.m4 nls.m4 po.m4 progtest.m4 stdint_h.m4 uintmax_t.m4 \
- ulonglong.m4 \
+ lib-link.m4 lib-prefix.m4 lock.m4 nls.m4 po.m4 progtest.m4 stdint_h.m4 \
+ uintmax_t.m4 ulonglong.m4 \
gnome.m4 gnome-gnorba-check.m4 gnome-orbit-check.m4 \
gtk.m4 gtk--.m4
diff --git a/gettext-tools/examples/hello-c++-kde/autoclean.sh b/gettext-tools/examples/hello-c++-kde/autoclean.sh
index f63eea0..a1ac65d 100755
--- a/gettext-tools/examples/hello-c++-kde/autoclean.sh
+++ b/gettext-tools/examples/hello-c++-kde/autoclean.sh
@@ -1,6 +1,6 @@
#!/bin/sh
# Example for use of GNU gettext.
-# Copyright (C) 2003-2004 Free Software Foundation, Inc.
+# Copyright (C) 2003-2005 Free Software Foundation, Inc.
# This file is in the public domain.
#
# Script for cleaning all autogenerated files.
@@ -31,6 +31,7 @@ rm -f m4/lcmessage.m4
rm -f m4/lib-ld.m4
rm -f m4/lib-link.m4
rm -f m4/lib-prefix.m4
+rm -f m4/lock.m4
rm -f m4/longdouble.m4
rm -f m4/longlong.m4
rm -f m4/nls.m4
diff --git a/gettext-tools/examples/hello-c++/autoclean.sh b/gettext-tools/examples/hello-c++/autoclean.sh
index c91baf0..4ba50c6 100755
--- a/gettext-tools/examples/hello-c++/autoclean.sh
+++ b/gettext-tools/examples/hello-c++/autoclean.sh
@@ -1,6 +1,6 @@
#!/bin/sh
# Example for use of GNU gettext.
-# Copyright (C) 2003-2004 Free Software Foundation, Inc.
+# Copyright (C) 2003-2005 Free Software Foundation, Inc.
# This file is in the public domain.
#
# Script for cleaning all autogenerated files.
@@ -28,6 +28,7 @@ rm -f m4/lcmessage.m4
rm -f m4/lib-ld.m4
rm -f m4/lib-link.m4
rm -f m4/lib-prefix.m4
+rm -f m4/lock.m4
rm -f m4/longdouble.m4
rm -f m4/longlong.m4
rm -f m4/nls.m4
diff --git a/gettext-tools/examples/hello-c++/m4/Makefile.am b/gettext-tools/examples/hello-c++/m4/Makefile.am
index 17eb691..9b035f9 100644
--- a/gettext-tools/examples/hello-c++/m4/Makefile.am
+++ b/gettext-tools/examples/hello-c++/m4/Makefile.am
@@ -1,5 +1,5 @@
EXTRA_DIST = \
codeset.m4 gettext.m4 glibc2.m4 glibc21.m4 iconv.m4 intdiv0.m4 inttypes.m4 \
inttypes_h.m4 inttypes-pri.m4 isc-posix.m4 lcmessage.m4 lib-ld.m4 \
- lib-link.m4 lib-prefix.m4 nls.m4 po.m4 progtest.m4 stdint_h.m4 uintmax_t.m4 \
- ulonglong.m4
+ lib-link.m4 lib-prefix.m4 lock.m4 nls.m4 po.m4 progtest.m4 stdint_h.m4 \
+ uintmax_t.m4 ulonglong.m4
diff --git a/gettext-tools/examples/hello-c-gnome/autoclean.sh b/gettext-tools/examples/hello-c-gnome/autoclean.sh
index 5efa49d..97a6bdf 100755
--- a/gettext-tools/examples/hello-c-gnome/autoclean.sh
+++ b/gettext-tools/examples/hello-c-gnome/autoclean.sh
@@ -1,6 +1,6 @@
#!/bin/sh
# Example for use of GNU gettext.
-# Copyright (C) 2003-2004 Free Software Foundation, Inc.
+# Copyright (C) 2003-2005 Free Software Foundation, Inc.
# This file is in the public domain.
#
# Script for cleaning all autogenerated files.
@@ -25,6 +25,7 @@ rm -f m4/lcmessage.m4
rm -f m4/lib-ld.m4
rm -f m4/lib-link.m4
rm -f m4/lib-prefix.m4
+rm -f m4/lock.m4
rm -f m4/longdouble.m4
rm -f m4/longlong.m4
rm -f m4/nls.m4
diff --git a/gettext-tools/examples/hello-c/autoclean.sh b/gettext-tools/examples/hello-c/autoclean.sh
index c91baf0..4ba50c6 100755
--- a/gettext-tools/examples/hello-c/autoclean.sh
+++ b/gettext-tools/examples/hello-c/autoclean.sh
@@ -1,6 +1,6 @@
#!/bin/sh
# Example for use of GNU gettext.
-# Copyright (C) 2003-2004 Free Software Foundation, Inc.
+# Copyright (C) 2003-2005 Free Software Foundation, Inc.
# This file is in the public domain.
#
# Script for cleaning all autogenerated files.
@@ -28,6 +28,7 @@ rm -f m4/lcmessage.m4
rm -f m4/lib-ld.m4
rm -f m4/lib-link.m4
rm -f m4/lib-prefix.m4
+rm -f m4/lock.m4
rm -f m4/longdouble.m4
rm -f m4/longlong.m4
rm -f m4/nls.m4
diff --git a/gettext-tools/examples/hello-c/m4/Makefile.am b/gettext-tools/examples/hello-c/m4/Makefile.am
index 17eb691..9b035f9 100644
--- a/gettext-tools/examples/hello-c/m4/Makefile.am
+++ b/gettext-tools/examples/hello-c/m4/Makefile.am
@@ -1,5 +1,5 @@
EXTRA_DIST = \
codeset.m4 gettext.m4 glibc2.m4 glibc21.m4 iconv.m4 intdiv0.m4 inttypes.m4 \
inttypes_h.m4 inttypes-pri.m4 isc-posix.m4 lcmessage.m4 lib-ld.m4 \
- lib-link.m4 lib-prefix.m4 nls.m4 po.m4 progtest.m4 stdint_h.m4 uintmax_t.m4 \
- ulonglong.m4
+ lib-link.m4 lib-prefix.m4 lock.m4 nls.m4 po.m4 progtest.m4 stdint_h.m4 \
+ uintmax_t.m4 ulonglong.m4
diff --git a/gettext-tools/examples/hello-objc-gnome/autoclean.sh b/gettext-tools/examples/hello-objc-gnome/autoclean.sh
index 5efa49d..97a6bdf 100755
--- a/gettext-tools/examples/hello-objc-gnome/autoclean.sh
+++ b/gettext-tools/examples/hello-objc-gnome/autoclean.sh
@@ -1,6 +1,6 @@
#!/bin/sh
# Example for use of GNU gettext.
-# Copyright (C) 2003-2004 Free Software Foundation, Inc.
+# Copyright (C) 2003-2005 Free Software Foundation, Inc.
# This file is in the public domain.
#
# Script for cleaning all autogenerated files.
@@ -25,6 +25,7 @@ rm -f m4/lcmessage.m4
rm -f m4/lib-ld.m4
rm -f m4/lib-link.m4
rm -f m4/lib-prefix.m4
+rm -f m4/lock.m4
rm -f m4/longdouble.m4
rm -f m4/longlong.m4
rm -f m4/nls.m4
diff --git a/gettext-tools/examples/hello-objc-gnome/m4/Makefile.am b/gettext-tools/examples/hello-objc-gnome/m4/Makefile.am
index 52a0787..18662e8 100644
--- a/gettext-tools/examples/hello-objc-gnome/m4/Makefile.am
+++ b/gettext-tools/examples/hello-objc-gnome/m4/Makefile.am
@@ -1,6 +1,6 @@
EXTRA_DIST = \
codeset.m4 gettext.m4 glibc2.m4 glibc21.m4 iconv.m4 intdiv0.m4 inttypes.m4 \
inttypes_h.m4 inttypes-pri.m4 isc-posix.m4 lcmessage.m4 lib-ld.m4 \
- lib-link.m4 lib-prefix.m4 nls.m4 po.m4 progtest.m4 stdint_h.m4 uintmax_t.m4 \
- ulonglong.m4 \
+ lib-link.m4 lib-prefix.m4 lock.m4 nls.m4 po.m4 progtest.m4 stdint_h.m4 \
+ uintmax_t.m4 ulonglong.m4 \
gnome.m4 gnome-gnorba-check.m4 gnome-orbit-check.m4
diff --git a/gettext-tools/examples/hello-objc/autoclean.sh b/gettext-tools/examples/hello-objc/autoclean.sh
index c91baf0..4ba50c6 100755
--- a/gettext-tools/examples/hello-objc/autoclean.sh
+++ b/gettext-tools/examples/hello-objc/autoclean.sh
@@ -1,6 +1,6 @@
#!/bin/sh
# Example for use of GNU gettext.
-# Copyright (C) 2003-2004 Free Software Foundation, Inc.
+# Copyright (C) 2003-2005 Free Software Foundation, Inc.
# This file is in the public domain.
#
# Script for cleaning all autogenerated files.
@@ -28,6 +28,7 @@ rm -f m4/lcmessage.m4
rm -f m4/lib-ld.m4
rm -f m4/lib-link.m4
rm -f m4/lib-prefix.m4
+rm -f m4/lock.m4
rm -f m4/longdouble.m4
rm -f m4/longlong.m4
rm -f m4/nls.m4
diff --git a/gettext-tools/examples/hello-objc/m4/Makefile.am b/gettext-tools/examples/hello-objc/m4/Makefile.am
index 17eb691..9b035f9 100644
--- a/gettext-tools/examples/hello-objc/m4/Makefile.am
+++ b/gettext-tools/examples/hello-objc/m4/Makefile.am
@@ -1,5 +1,5 @@
EXTRA_DIST = \
codeset.m4 gettext.m4 glibc2.m4 glibc21.m4 iconv.m4 intdiv0.m4 inttypes.m4 \
inttypes_h.m4 inttypes-pri.m4 isc-posix.m4 lcmessage.m4 lib-ld.m4 \
- lib-link.m4 lib-prefix.m4 nls.m4 po.m4 progtest.m4 stdint_h.m4 uintmax_t.m4 \
- ulonglong.m4
+ lib-link.m4 lib-prefix.m4 lock.m4 nls.m4 po.m4 progtest.m4 stdint_h.m4 \
+ uintmax_t.m4 ulonglong.m4
diff --git a/gettext-tools/m4/ChangeLog b/gettext-tools/m4/ChangeLog
index c51cbc6..b005395 100644
--- a/gettext-tools/m4/ChangeLog
+++ b/gettext-tools/m4/ChangeLog
@@ -1,3 +1,7 @@
+2005-07-16 Bruno Haible <bruno@clisp.org>
+
+ * Makefile.am (aclocal_DATA): Add lock.m4.
+
2005-07-05 Bruno Haible <bruno@clisp.org>
* relocatable.m4 (AC_RELOCATABLE): On mingw, simply set
diff --git a/gettext-tools/m4/Makefile.am b/gettext-tools/m4/Makefile.am
index 8fee92a..cca4321 100644
--- a/gettext-tools/m4/Makefile.am
+++ b/gettext-tools/m4/Makefile.am
@@ -19,6 +19,7 @@ aclocal_DATA = \
../../gettext-runtime/m4/inttypes-pri.m4 \
../../gettext-runtime/m4/isc-posix.m4 \
../../gettext-runtime/m4/lcmessage.m4 \
+ ../../gettext-runtime/m4/lock.m4 \
../../gettext-runtime/m4/longdouble.m4 \
../../gettext-runtime/m4/longlong.m4 \
../../gettext-runtime/m4/nls.m4 \
diff --git a/gettext-tools/misc/ChangeLog b/gettext-tools/misc/ChangeLog
index a5678aa..3922c5d 100644
--- a/gettext-tools/misc/ChangeLog
+++ b/gettext-tools/misc/ChangeLog
@@ -1,3 +1,7 @@
+2005-07-16 Bruno Haible <bruno@clisp.org>
+
+ * gettextize.in (m4filelist): Add lock.m4.
+
2005-07-09 Bruno Haible <bruno@clisp.org>
* po-mode.el (po-validate): Require the 'compile' module before
diff --git a/gettext-tools/misc/gettextize.in b/gettext-tools/misc/gettextize.in
index 2c10dc7..0d79b69 100644
--- a/gettext-tools/misc/gettextize.in
+++ b/gettext-tools/misc/gettextize.in
@@ -719,14 +719,14 @@ $do_changelog && func_poChangeLog_finish
m4filelist=' codeset.m4 gettext.m4 glibc2.m4 glibc21.m4 iconv.m4 intdiv0.m4
intmax.m4 inttypes.m4 inttypes_h.m4 inttypes-pri.m4 isc-posix.m4 lcmessage.m4
- lib-ld.m4 lib-link.m4 lib-prefix.m4 longdouble.m4 longlong.m4 nls.m4 po.m4
- printf-posix.m4 progtest.m4 signed.m4 size_max.m4 stdint_h.m4 uintmax_t.m4
- ulonglong.m4 wchar_t.m4 wint_t.m4 xsize.m4'
+ lib-ld.m4 lib-link.m4 lib-prefix.m4 lock.m4 longdouble.m4 longlong.m4 nls.m4
+ po.m4 printf-posix.m4 progtest.m4 signed.m4 size_max.m4 stdint_h.m4
+ uintmax_t.m4 ulonglong.m4 wchar_t.m4 wint_t.m4 xsize.m4'
# We cannot omit codeset.m4, glibc2.m4, glibc21.m4, intdiv0.m4, intmax.m4,
# inttypes.m4, inttypes_h.m4, inttypes-pri.m4, isc-posix.m4, lcmessage.m4,
-# longdouble.m4, longlong.m4, nls.m4, po.m4, printf-posix.m4, signed.m4,
-# size_max.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, wchar_t.m4, wint_t.m4,
-# xsize.m4
+# lock.m4, longdouble.m4, longlong.m4, nls.m4, po.m4, printf-posix.m4,
+# signed.m4, size_max.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, wchar_t.m4,
+# wint_t.m4, xsize.m4
# if test -z "$intldir", otherwise "aclocal -I m4" might give an error.
# (aclocal doesn't know which macros are really needed, it looks which macros
# are potentially needed.)