configure.ac, Makefile.am, pcre.c, regexp.c: Overhaul conditional building.
[anag] / Makefile.am
index 6374697..9425a68 100644 (file)
@@ -30,6 +30,11 @@ SUFFIXES              =
 bin_PROGRAMS            =
 bin_SCRIPTS             =
 
+LDADD                   =
+if HAVE_PCRE
+  LDADD                        += $(PCRE_LIBS)
+endif
+
 ###--------------------------------------------------------------------------
 ### Making substitutions.
 
@@ -54,8 +59,12 @@ anag_SOURCES          = anag.c anag.h util.c
 anag_SOURCES           += anagram.c
 anag_SOURCES           += longest.c
 anag_SOURCES           += mono.c
-anag_SOURCES           += pcre.c
-anag_SOURCES           += regexp.c
+if HAVE_PCRE
+  anag_SOURCES         += pcre.c
+endif
+if HAVE_REGCOMP
+  anag_SOURCES         += regexp.c
+endif
 anag_SOURCES           += trackword.c
 anag_SOURCES           += wildcard.c