[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCHv2] build: fix cygwin build
From: |
Eric Blake |
Subject: |
[PATCHv2] build: fix cygwin build |
Date: |
Mon, 22 Mar 2010 12:14:15 -0600 |
Portions of gnulib depend on -lintl, and cygwin does not allow
lazy linking.
* src/Makefile.am (LDADD): Include libraries in correct order.
Signed-off-by: Eric Blake <address@hidden>
---
> Can you confirm that the equivalent also solves the Cygwin
> build problem?
Yes, the build still succeeds. Okay to push?
src/Makefile.am | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index 5376b97..08f7aac 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -28,7 +28,13 @@ noinst_LIBRARIES = libgrep.a
libgrep_a_SOURCES = kwset.c dfa.c searchutils.c dfasearch.c kwsearch.c \
pcresearch.c main.c
-LDADD = $(LIBINTL) libgrep.a ../lib/libgreputils.a
+# Sometimes, the expansion of $(LIBINTL) includes -lc which may
+# include modules defining variables like `optind', so libgreputils.a
+# must precede $(LIBINTL) in order to ensure we use GNU getopt.
+# But libgreputils.a must also follow $(LIBINTL), since libintl uses
+# replacement functions defined in libgreputils.a.
+LDADD = libgrep.a ../lib/libgreputils.a $(LIBINTL) ../lib/libgreputils.a
+
grep_LDADD = $(LDADD) $(PCRE_LIBS)
localedir = $(datadir)/locale
INCLUDES = -I$(top_srcdir)/lib -DLOCALEDIR=\"$(localedir)\"
--
1.6.6.1