diff options
author | Andrew G. Morgan <morgan@kernel.org> | 2000-11-19 23:54:01 +0000 |
---|---|---|
committer | Andrew G. Morgan <morgan@kernel.org> | 2000-11-19 23:54:01 +0000 |
commit | 73346dba777b023e46830a973148eb0ddbf8f8b4 (patch) | |
tree | 3ac12799a597cb2004f8ebf5b18a4469ccee9a44 /libpam_misc | |
parent | 47575925596c2af2a78c009fcdd14de72fc82d3e (diff) | |
download | pam-73346dba777b023e46830a973148eb0ddbf8f8b4.tar.gz pam-73346dba777b023e46830a973148eb0ddbf8f8b4.tar.bz2 pam-73346dba777b023e46830a973148eb0ddbf8f8b4.zip |
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.]
Diffstat (limited to 'libpam_misc')
-rw-r--r-- | libpam_misc/.cvsignore | 2 | ||||
-rw-r--r-- | libpam_misc/Makefile | 124 | ||||
-rw-r--r-- | libpam_misc/misc_conv.c | 5 |
3 files changed, 70 insertions, 61 deletions
diff --git a/libpam_misc/.cvsignore b/libpam_misc/.cvsignore index d04bebe5..b6cfd742 100644 --- a/libpam_misc/.cvsignore +++ b/libpam_misc/.cvsignore @@ -5,3 +5,5 @@ libpamd_misc.a help_env.o misc_conv.o xstrdup.o +dynamic +static diff --git a/libpam_misc/Makefile b/libpam_misc/Makefile index 89a27536..b41e61a0 100644 --- a/libpam_misc/Makefile +++ b/libpam_misc/Makefile @@ -1,96 +1,106 @@ +# # $Id$ # -dummy: - @echo "*** This is not a top-level Makefile!" - -# /////////////////////////////////////////////////////////////////// - -# uncomment if you wnat libpam_misc to be made as a dynamic library -# AGM has had some segfaulting from libdl when I did this. I have not -# investigated the cause... +# lots of debugging information goes to /tmp/pam-debug.log +#MOREFLAGS += -D"DEBUG" -MAKE_DYNAMIC=yes +include ../Make.Rules ifeq ($(DEBUG_REL),yes) - LIBNAME=pamd_misc + LIBNAME=libpam_miscd else - LIBNAME=pam_misc + LIBNAME=libpam_misc endif -LIBMAJOR=$(MAJOR_REL) -LIBMINOR=$(MINOR_REL) +VERSION=.$(MAJOR_REL) +MODIFICATION=.$(MINOR_REL) -FILES=misc_conv help_env - -# -# Probably no need to alter anything below here. -# +CFLAGS += $(MOREFLAGS) $(DYNAMIC) $(STATIC) -# build dynamic library names +# dynamic library names -LIBDYNAMIC=lib$(LIBNAME).$(DYNTYPE) -LIBDYNMAJ=$(LIBDYNAMIC).$(LIBMAJOR) -LIBDYNMIN=$(LIBDYNMAJ).$(LIBMINOR) +LIBNAMED = $(LIBNAME).$(DYNTYPE) +LIBNAMEDNAME = $(LIBNAMED)$(VERSION) +LIBNAMEDFULL = $(LIBNAMEDNAME)$(MODIFICATION) # static library name -LIBSTATIC = lib$(LIBNAME).a +LIBNAMEDSTATIC = $(LIBNAME).a -# sources and object files +LIBOBJECTS = help_env.o misc_conv.o -LIBSRC = $(addsuffix .c,$(FILES)) -LIBOBJ = $(addsuffix .o,$(FILES)) +ifeq ($(DYNAMIC_LIBPAM),yes) +DLIBOBJECTS = $(addprefix dynamic/,$(LIBOBJECTS)) +endif + +ifeq ($(STATIC_LIBPAM),yes) +SLIBOBJECTS = $(addprefix static/,$(LIBOBJECTS)) +endif -# rules +# --------------------------------------------- +## rules -all: $(LIBSTATIC) $(LIBDYNAMIC) +all: dirs $(LIBNAMED) $(LIBNAMEDSTATIC) -$(LIBDYNAMIC): $(LIBOBJ) -ifdef MAKE_DYNAMIC +dirs: +ifeq ($(DYNAMIC_LIBPAM),yes) + $(MKDIR) dynamic +endif +ifeq ($(STATIC_LIBPAM),yes) + $(MKDIR) static +endif + +dynamic/%.o : %.c + $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@ + +static/%.o : %.c + $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@ + +$(LIBNAMED): $(DLIBOBJECTS) +ifeq ($(DYNAMIC_LIBPAM),yes) ifeq ($(USESONAME),yes) - $(LD_L) $(SOSWITCH) $(LIBDYNMAJ) -o $@ $(LIBOBJ) $(LINKLIBS) + $(LD_L) $(SOSWITCH) $(LIBNAMEDNAME) -o $@ $(DLIBOBJECTS) $(MODULES) $(LINKLIBS) else - $(LD_L) -o $@ $(LIBOBJ) + $(LD_L) -o $@ $(DLIBOBJECTS) $(MODULES) endif ifeq ($(NEEDSONAME),yes) - rm -f $(LIBDYNMIN) - ln -s $(LIBDYNAMIC) $(LIBDYNMAJ) - rm -f $(LIBDYNMAJ) - ln -s $(LIBDYNAMIC) $(LIBDYNMIN) + rm -f $(LIBNAMEDFULL) + ln -s $(LIBNAMED) $(LIBNAMEDFULL) + rm -f $(LIBNAMEDNAME) + ln -s $(LIBNAMED) $(LIBNAMEDNAME) endif endif -$(LIBSTATIC): $(LIBOBJ) - $(AR) $@ $(LIBOBJ) +$(LIBNAMEDSTATIC): $(SLIBOBJECTS) +ifeq ($(STATIC_LIBPAM),yes) + $(AR) $@ $(SLIBOBJECTS) $(MODULES) $(RANLIB) $@ +endif install: all $(MKDIR) $(FAKEROOT)$(INCLUDED) - $(INSTALL) -m 644 ./pam_misc.h $(FAKEROOT)$(INCLUDED) -ifdef MAKE_DYNAMIC - $(INSTALL) -m $(SHLIBMODE) $(LIBDYNAMIC) $(FAKEROOT)$(LIBDIR)/$(LIBDYNMIN) + $(INSTALL) -m 644 include/security/pam_misc.h $(FAKEROOT)$(INCLUDED) +ifeq ($(DYNAMIC_LIBPAM),yes) + $(MKDIR) $(FAKEROOT)$(libdir) + $(INSTALL) -m $(SHLIBMODE) $(LIBNAMED) $(FAKEROOT)$(libdir)/$(LIBNAMEDFULL) $(LDCONFIG) ifneq ($(DYNTYPE),"sl") - ( cd $(FAKEROOT)$(LIBDIR) ; ln -sf $(LIBDYNMAJ) $(LIBDYNAMIC) ) + ( cd $(FAKEROOT)$(libdir) ; rm -f $(LIBNAMED) ; ln -s $(LIBNAMEDNAME) $(LIBNAMED) ) endif endif - $(INSTALL) -m 644 $(LIBSTATIC) $(FAKEROOT)$(LIBDIR) - -clean: - rm -f *.so *.a core a.out *~ +ifeq ($(STATIC_LIBPAM),yes) + $(INSTALL) -m 644 $(LIBNAMEDSTATIC) $(FAKEROOT)$(libdir) +endif remove: rm -f $(FAKEROOT)$(INCLUDED)/pam_misc.h - rm -f $(FAKEROOT)$(LIBDIR)/$(LIBDYNAMIC).* - rm -f $(FAKEROOT)$(LIBDIR)/$(LIBDYNAMIC) + rm -f $(FAKEROOT)$(libdir)/$(LIBNAMEDFULL) + rm -f $(FAKEROOT)$(libdir)/$(LIBNAMED) $(LDCONFIG) - rm -f $(FAKEROOT)$(LIBDIR)/$(LIBSTATIC) - rm -f $(FAKEROOT)$(INCLUDED)/chk_malloc.h - -.c.o: - $(CC) -c $(DEFS) $(CFLAGS) $< - -extraclean: - @$(MAKE) clean - rm -f *.o *.bak + rm -f $(FAKEROOT)$(libdir)/$(LIBNAMEDSTATIC) +clean: + rm -f a.out core *~ static/*.o dynamic/*.o + 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/libpam_misc/misc_conv.c b/libpam_misc/misc_conv.c index f2811a26..73ba5a83 100644 --- a/libpam_misc/misc_conv.c +++ b/libpam_misc/misc_conv.c @@ -6,10 +6,7 @@ * Written by Andrew Morgan <morgan@linux.kernel.org> */ -#ifdef linux -#define _GNU_SOURCE -#include <features.h> -#endif +#include <security/_pam_aconf.h> #include <signal.h> #include <stdio.h> |