From 73346dba777b023e46830a973148eb0ddbf8f8b4 Mon Sep 17 00:00:00 2001 From: "Andrew G. Morgan" Date: Sun, 19 Nov 2000 23:54:01 +0000 Subject: Relevant BUGIDs: task 15788, bugs 108297, 117476, 117474 Purpose of commit: autoconf support for Linux-PAM Commit summary: --------------- This is a merge of the autoconf support that was developed against a 0-72 branch. [Note, because CVS has some issues, this is actually only 95% of the actual commit. The other files were actually committed when the preparation branch Linux-PAM-0-73pre-autoconf was updated. Hopefully, this will complete the merge.] --- libpamc/Makefile | 73 ++++++++++++++++++++++++++----------------------------- libpamc/libpamc.h | 2 +- 2 files changed, 36 insertions(+), 39 deletions(-) (limited to 'libpamc') diff --git a/libpamc/Makefile b/libpamc/Makefile index 6052e96e..402f070f 100644 --- a/libpamc/Makefile +++ b/libpamc/Makefile @@ -5,6 +5,8 @@ # lots of debugging information goes to /tmp/pam-debug.log #MOREFLAGS += -D"DEBUG" +include ../Make.Rules + ifeq ($(DEBUG_REL),yes) LIBNAME=libpamcd else @@ -13,71 +15,64 @@ endif VERSION=.$(MAJOR_REL) MODIFICATION=.$(MINOR_REL) -# --------------------------------------------- - -dummy: - @echo "*** This is not a top-level Makefile!" - -# --------------------------------------------- - -CFLAGS += $(DYNAMIC) $(STATIC) $(MOREFLAGS) +CFLAGS += $(MOREFLAGS) $(DYNAMIC) $(STATIC) # dynamic library names -LIBPAMC = $(LIBNAME).$(DYNTYPE) -LIBPAMCNAME = $(LIBPAMC)$(VERSION) -LIBPAMCFULL = $(LIBPAMCNAME)$(MODIFICATION) +LIBNAMED = $(LIBNAME).$(DYNTYPE) +LIBNAMEDNAME = $(LIBNAMED)$(VERSION) +LIBNAMEDFULL = $(LIBNAMEDNAME)$(MODIFICATION) # static library name -LIBPAMCSTATIC = $(LIBNAME).a +LIBNAMEDSTATIC = $(LIBNAME).a LIBOBJECTS = pamc_client.o pamc_converse.o pamc_load.o -ifdef DYNAMIC_LIBPAM +ifeq ($(DYNAMIC_LIBPAM),yes) DLIBOBJECTS = $(addprefix dynamic/,$(LIBOBJECTS)) endif -ifdef STATIC_LIBPAM +ifeq ($(STATIC_LIBPAM),yes) SLIBOBJECTS = $(addprefix static/,$(LIBOBJECTS)) endif # --------------------------------------------- ## rules -all: dirs $(LIBPAMC) $(LIBPAMCSTATIC) +all: dirs $(LIBNAMED) $(LIBNAMEDSTATIC) dirs: -ifdef DYNAMIC_LIBPAM - mkdir -p dynamic +ifeq ($(DYNAMIC_LIBPAM),yes) + $(MKDIR) dynamic endif -ifdef STATIC_LIBPAM - mkdir -p static +ifeq ($(STATIC_LIBPAM),yes) + $(MKDIR) static endif dynamic/%.o : %.c - $(CC) $(CFLAGS) $(DYNAMIC) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@ + $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@ static/%.o : %.c - $(CC) $(CFLAGS) $(STATIC) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@ + $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@ -$(LIBPAMC): $(DLIBOBJECTS) -ifdef DYNAMIC_LIBPAM +$(LIBNAMED): $(DLIBOBJECTS) +ifeq ($(DYNAMIC_LIBPAM),yes) ifeq ($(USESONAME),yes) - $(LD_L) $(SOSWITCH) $(LIBPAMCNAME) -o $@ $(DLIBOBJECTS) $(MODULES) $(LINKLIBS) + $(LD_L) $(SOSWITCH) $(LIBNAMEDNAME) -o $@ $(DLIBOBJECTS) $(MODULES) $(LINKLIBS) else $(LD_L) -o $@ $(DLIBOBJECTS) $(MODULES) endif ifeq ($(NEEDSONAME),yes) - rm -f $(LIBPAMCFULL) - ln -s $(LIBPAMC) $(LIBPAMCFULL) - rm -f $(LIBPAMCNAME) - ln -s $(LIBPAMC) $(LIBPAMCNAME) + rm -f $(LIBNAMEDFULL) + ln -s $(LIBNAMED) $(LIBNAMEDFULL) + rm -f $(LIBNAMEDNAME) + ln -s $(LIBNAMED) $(LIBNAMEDNAME) endif endif -$(LIBPAMCSTATIC): $(SLIBOBJECTS) -ifdef STATIC_LIBPAM +$(LIBNAMEDSTATIC): $(SLIBOBJECTS) +ifeq ($(STATIC_LIBPAM),yes) $(AR) $@ $(SLIBOBJECTS) $(MODULES) $(RANLIB) $@ endif @@ -85,26 +80,28 @@ endif install: all $(MKDIR) $(FAKEROOT)$(INCLUDED) $(INSTALL) -m 644 include/security/pam_client.h $(FAKEROOT)$(INCLUDED) -ifdef DYNAMIC_LIBPAM - $(INSTALL) -m $(SHLIBMODE) $(LIBPAMC) $(FAKEROOT)$(LIBDIR)/$(LIBPAMCFULL) +ifeq ($(DYNAMIC_LIBPAM),yes) + $(MKDIR) $(FAKEROOT)$(libdir) + $(INSTALL) -m $(SHLIBMODE) $(LIBNAMED) $(FAKEROOT)$(libdir)/$(LIBNAMEDFULL) $(LDCONFIG) ifneq ($(DYNTYPE),"sl") - ( cd $(FAKEROOT)$(LIBDIR) ; rm -f $(LIBPAMC) ; ln -s $(LIBPAMCNAME) $(LIBPAMC) ) + ( cd $(FAKEROOT)$(libdir) ; rm -f $(LIBNAMED) ; ln -s $(LIBNAMEDNAME) $(LIBNAMED) ) endif endif -ifdef STATIC_LIBPAM - $(INSTALL) -m 644 $(LIBPAMCSTATIC) $(FAKEROOT)$(LIBDIR) +ifeq ($(STATIC_LIBPAM),yes) + $(INSTALL) -m 644 $(LIBNAMEDSTATIC) $(FAKEROOT)$(libdir) endif remove: rm -f $(FAKEROOT)$(INCLUDED)/pam_client.h + rm -f $(FAKEROOT)$(libdir)/$(LIBNAMEDFULL) + rm -f $(FAKEROOT)$(libdir)/$(LIBNAMED) $(LDCONFIG) - rm -f $(FAKEROOT)$(LIBDIR)/$(LIBPAMCSTATIC) + rm -f $(FAKEROOT)$(libdir)/$(LIBNAMEDSTATIC) clean: rm -f a.out core *~ static/*.o dynamic/*.o - -extraclean: clean rm -f *.a *.out *.o *.so ./include/security/*~ if [ -d dynamic ]; then rmdir dynamic ; fi if [ -d static ]; then rmdir static ; fi + diff --git a/libpamc/libpamc.h b/libpamc/libpamc.h index 15662cc3..93c833c6 100644 --- a/libpamc/libpamc.h +++ b/libpamc/libpamc.h @@ -9,7 +9,7 @@ #define LIBPAMC_H #include -#include +#include #include #include -- cgit v1.2.3