You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/net-irc/atheme-services/files/atheme-services-7.0.0_alpha...

79 lines
2.8 KiB

From ca15c587e5c102abe0bc72a3112f7c5c6c879483 Mon Sep 17 00:00:00 2001
From: Nathan Phillip Brink <binki@gentoo.org>
Date: Tue, 3 Jan 2012 01:47:31 +0000
Subject: [PATCH] Add --with-cracklib/--without-cracklib ./configure options and only pass -lcrack when compiling nickserv/cracklib module.
Being able to disable cracklib at ./configure time fixes an automagic
dependency (https://bugs.gentoo.org/397401 with original patch from
kensington). Only linking against cracklib when necessary hopefully
makes compilation and loading of modules slightly more efficient.
---
configure | 27 ++++++++++++++++++++++++++-
configure.ac | 16 +++++++++++++++-
extra.mk.in | 1 +
modules/nickserv/Makefile | 9 +++++++++
4 files changed, 51 insertions(+), 2 deletions(-)
diff --git a/configure b/configure
index 14a14da..fe8024f 100755
diff --git a/configure.ac b/configure.ac
index ed7d105..ab0adb5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -97,8 +97,22 @@ AC_SEARCH_LIBS(crypt, crypt, [POSIX_CRYPTC="posix.c"])
AC_SUBST(POSIX_CRYPTC)
CRACKLIB_C=""
-AC_SEARCH_LIBS(FascistCheck, crack, [CRACKLIB_C="cracklib.c"])
+CRACKLIB_LIBS=""
+AC_ARG_WITH([cracklib],
+ [AS_HELP_STRING([--with-cracklib], [Compile cracklib nickserv submodule for checking password strength.])],
+ [],
+ [with_cracklib="auto"])
+AS_IF([test "x$with_cracklib" != "xno"],
+ [LIBS_save="$LIBS"
+ AC_SEARCH_LIBS([FascistCheck], [crack],
+ [CRACKLIB_C="cracklib.c"
+ AS_IF([test "x$ac_cv_search_FascistCheck" != "xnone required"],
+ [CRACKLIB_LIBS="$ac_cv_search_FascistCheck"])],
+ [AS_IF([test "x$with_cracklib" != "xauto"],
+ [AC_MSG_ERROR([--with-cracklib was specified but cracklib could not be found.])])])
+ LIBS="$LIBS_save"])
AC_SUBST(CRACKLIB_C)
+AC_SUBST([CRACKLIB_LIBS])
AC_ARG_WITH([ldap],
[AS_HELP_STRING([--without-ldap],[Disable building ldap auth module.])],
diff --git a/extra.mk.in b/extra.mk.in
index a59418c..bdce891 100644
--- a/extra.mk.in
+++ b/extra.mk.in
@@ -123,6 +123,7 @@ EGREP ?= @EGREP@
VERSION ?= @VERSION@
prefix ?= @prefix@
CRACKLIB_C ?= @CRACKLIB_C@
+CRACKLIB_LIBS ?= @CRACKLIB_LIBS@
CONTRIB_ENABLE ?= @CONTRIB_ENABLE@
PERL_ENABLE ?= @PERL_ENABLE@
PERL_CFLAGS ?= @PERL_CFLAGS@
diff --git a/modules/nickserv/Makefile b/modules/nickserv/Makefile
index 3014bbb..2506be4 100644
--- a/modules/nickserv/Makefile
+++ b/modules/nickserv/Makefile
@@ -72,3 +72,12 @@ include ../../buildsys.module.mk
CPPFLAGS += -I../../include
LIBS += -L../../libathemecore -lathemecore ${LDFLAGS_RPATH}
+# Custom rule for cracklib.c which is the only module to ever need
+# -lcrack.
+cracklib$(PLUGIN_SUFFIX): cracklib.c
+ ${COMPILE_STATUS}
+ if ${CC} -MMD -MP ${CFLAGS} ${PLUGIN_CFLAGS} ${CPPFLAGS} ${PLUGIN_LDFLAGS} ${LDFLAGS} -o $@ ${CRACKLIB_C} ${LIBS} ${CRACKLIB_LIBS}; then \
+ ${COMPILE_OK}; \
+ else \
+ ${COMPILE_FAILED}; \
+ fi
--
1.7.3.4