summaryrefslogtreecommitdiff
path: root/src/Makefile.am
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2010-03-22 11:21:45 -0600
committerEric Blake <eblake@redhat.com>2010-03-22 12:09:58 -0600
commit8a3a47de77958ec2781b94068919083d8abde388 (patch)
tree237accba1e834ebec251fba63015b185f73aa9f1 /src/Makefile.am
parentf17211efe374200d532a9f27173e15b018e5538e (diff)
downloadgrep-8a3a47de77958ec2781b94068919083d8abde388.tar.gz
build: fix cygwin build
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 <eblake@redhat.com>
Diffstat (limited to 'src/Makefile.am')
-rw-r--r--src/Makefile.am8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 5376b97b..08f7aacf 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)\"