Skip to content
This repository has been archived by the owner on Apr 15, 2020. It is now read-only.

Commit

Permalink
Enable a "none" argument for the --with-pam configuration option
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Willing <chris.willing@iinet.net.au>
  • Loading branch information
Christoph Willing committed Sep 18, 2015
1 parent d08109e commit 035df25
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
3 changes: 3 additions & 0 deletions Makefile.am
Expand Up @@ -136,6 +136,7 @@ TESTS_CGM_CONCURRENT: tests/cgm-concurrent.o
$(CCLD) -o tests/cgm-concurrent tests/cgm-concurrent.o \
$(NIH_LIBS) $(NIH_DBUS_LIBS) $(DBUS_LIBS) -lpthread -lcgmanager

if HAVE_PAM
pam_LTLIBRARIES = pam_cgm.la
pam_cgm_la_SOURCES = pam/pam_cgm.c pam/cgmanager.c pam/cgmanager.h
pam_cgm_la_CFLAGS = $(AM_CFLAGS)
Expand All @@ -148,4 +149,6 @@ install-data-hook: install-pamLTLIBRARIES
rm -f "$(DESTDIR)$(pamdir)/pam_cgm.a"
uninstall-local:
rm -f "$(DESTDIR)$(pamdir)/pam_cgm.so"
endif

tests: TESTS_CGM_CONCURRENT TESTS_SCM TEST_NSTEST
28 changes: 16 additions & 12 deletions configure.ac
Expand Up @@ -130,7 +130,8 @@ AS_AC_EXPAND(LIBEXECDIR, "$libexecdir")

AC_ARG_WITH(
[pamdir],
[AS_HELP_STRING([--with-pamdir=PATH],[Specify the directory where PAM modules are stored])],
[AS_HELP_STRING([--with-pamdir=PATH],[Specify the directory where PAM modules are stored,
or "none" if PAM modules are not to be built])],
[pamdir="${withval}"],
[
if test "${prefix}" = "/usr"; then
Expand All @@ -141,16 +142,19 @@ AC_ARG_WITH(
]
)

AC_ARG_VAR([PAM_CFLAGS], [C compiler flags for pam])
AC_ARG_VAR([PAM_LIBS], [linker flags for pam])
AC_CHECK_LIB(
[pam],
[pam_authenticate],
[PAM_LIBS="-lpam"],
[AC_MSG_ERROR([*** libpam not found.])
])

AC_SUBST(PAM_LIBS)
AC_SUBST([pamdir])
AM_CONDITIONAL([HAVE_PAM], [test x"$pamdir" != "xnone"])
if test "z$pamdir" != "znone"; then
AC_ARG_VAR([PAM_CFLAGS], [C compiler flags for pam])
AC_ARG_VAR([PAM_LIBS], [linker flags for pam])
AC_CHECK_LIB(
[pam],
[pam_authenticate],
[PAM_LIBS="-lpam"],
[AC_MSG_ERROR([*** libpam not found.])
])

AC_SUBST(PAM_LIBS)
AC_SUBST([pamdir])
fi

AC_OUTPUT

0 comments on commit 035df25

Please sign in to comment.