summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxhe <xw897002528@gmail.com>2017-05-30 09:27:14 +0800
committerxhe <xw897002528@gmail.com>2017-05-30 09:54:44 +0800
commit2771fc569e41a1e37305383261c1231ea41d0825 (patch)
tree813df37848d70562841dd4fbba97597acf4504fe
parent6164461b7ee850da5b577b96b120e2a4b1b05a09 (diff)
downloadgettext-tiny-2771fc569e41a1e37305383261c1231ea41d0825.tar.gz
fix: functions of musl overrided by libintl.amusl
libvirt is linked to libintl.a, and functions of musl is overrided by those of libintl.a. this commit adds a switch, use make MUSL=yes to install appropriate libintl.a and other files
-rw-r--r--Makefile11
-rw-r--r--libintl/libintl-musl.c5
2 files changed, 12 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index bd709d4..b1c82c1 100644
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,13 @@ libdir=$(prefix)/lib
sysconfdir=$(prefix)/etc
m4dir=$(prefix)/share/gettext-tiny
-LIBSRC = $(sort $(wildcard libintl/*.c))
+ifeq ($(MUSL),yes)
+ LIBSRC = libintl/libintl-musl.c
+ HEADERS =
+else
+ LIBSRC = libintl/libintl.c
+ HEADERS = libintl.h
+endif
PROGSRC = $(sort $(wildcard src/*.c))
PARSEROBJS = src/poparser.o src/StringEscape.o
@@ -13,10 +19,7 @@ PROGOBJS = $(PROGSRC:.c=.o)
LIBOBJS = $(LIBSRC:.c=.o)
OBJS = $(PROGOBJS) $(LIBOBJS)
-
-HEADERS = libintl.h
ALL_INCLUDES = $(HEADERS)
-
ALL_LIBS=libintl.a
ALL_TOOLS=msgfmt msgmerge xgettext autopoint
ALL_M4S=$(sort $(wildcard m4/*.m4))
diff --git a/libintl/libintl-musl.c b/libintl/libintl-musl.c
new file mode 100644
index 0000000..eb00506
--- /dev/null
+++ b/libintl/libintl-musl.c
@@ -0,0 +1,5 @@
+#include <stdio.h>
+
+/* trick configure tests checking for gnu libintl, as in the copy included in gdb */
+const char *_nl_expand_alias () { return NULL; }
+int _nl_msg_cat_cntr = 0;