summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew G. Morgan <morgan@kernel.org>2000-07-03 05:13:44 +0000
committerAndrew G. Morgan <morgan@kernel.org>2000-07-03 05:13:44 +0000
commit98551b255e1508fa43376b0974b28938e149ee3c (patch)
tree63df460e9d8888c7d0afcb9d2848308bb8658b02
parent414ae459f61f78c341a28bf84fb9122d44ebf3bd (diff)
downloadlinux-pam-git-98551b255e1508fa43376b0974b28938e149ee3c.tar.gz
Relevant BUGIDs: task 15788
Purpose of commit: more autoconf stuff Commit summary: --------------- Basic support for autoconf in all three libraries and one module: pam_permit. I've moved the pam_misc.h header sources to make them more consistent with libpam and libpamc. Later, when we tackle the top level makefile we'll need to fix the way we build the include stuff. At this point, one should 'autoconf' in the top level directory and then cd to each of the libraries to build them. The rest of the package is not expected to build yet.
-rw-r--r--.cvsignore2
-rw-r--r--Make.Rules.in1
-rw-r--r--configure.in3
-rw-r--r--libpam/Makefile4
-rw-r--r--libpam_misc/.cvsignore2
-rw-r--r--libpam_misc/Makefile121
-rw-r--r--libpam_misc/include/security/pam_misc.h (renamed from libpam_misc/pam_misc.h)0
-rw-r--r--libpamc/Makefile45
-rw-r--r--modules/pam_permit/Makefile51
9 files changed, 97 insertions, 132 deletions
diff --git a/.cvsignore b/.cvsignore
index c0005ad4..a2b39ffb 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -6,3 +6,5 @@ configure
config.status
config.log
config.cache
+pam_aconf.h
+Make.Rules
diff --git a/Make.Rules.in b/Make.Rules.in
index 52ffb67b..c0f3b01b 100644
--- a/Make.Rules.in
+++ b/Make.Rules.in
@@ -52,3 +52,4 @@ LD=@LD@
LD_D=@LD_D@
LD_L=@LD_L@
DYNTYPE=@DYNTYPE@
+MKDIR=@MKDIR@
diff --git a/configure.in b/configure.in
index 62a2e329..b54878ee 100644
--- a/configure.in
+++ b/configure.in
@@ -17,7 +17,7 @@ AC_DEFINE(LIBPAM_VERSION_MAJOR)
AC_DEFINE(LIBPAM_VERSION_MINOR)
dnl
-dnl Rules needed for the following (hardcoded Linux defaults)
+dnl Rules needed for the following (hardcoded Linux defaults for now)
dnl
CC=gcc ; AC_SUBST(CC)
@@ -25,6 +25,7 @@ CONF_CFLAGS= ; AC_SUBST(CONF_CFLAGS)
LD=ld ; AC_SUBST(LD)
LD_D="gcc -shared -Xlinker -x" ; AC_SUBST(LD_D)
LD_L="$LD -x -shared" ; AC_SUBST(LD_L)
+MKDIR="mkdir -p" ; AC_SUBST(MKDIR)
DYNTYPE=so ; AC_SUBST(DYNTYPE)
LIBDL=-ldl ; AC_SUBST(LIBDL)
USESONAME=yes ; AC_SUBST(USESONAME)
diff --git a/libpam/Makefile b/libpam/Makefile
index a62ffa3a..c7697f2d 100644
--- a/libpam/Makefile
+++ b/libpam/Makefile
@@ -74,10 +74,10 @@ all: dirs $(LIBPAM) $(LIBPAMSTATIC) ../Make.Rules
dirs:
ifeq ($(DYNAMIC_LIBPAM),yes)
- mkdir -p dynamic
+ $(MKDIR) dynamic
endif
ifeq ($(STATIC_LIBPAM),yes)
- mkdir -p static
+ $(MKDIR) static
endif
dynamic/%.o : %.c
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..dcc389c8 100644
--- a/libpam_misc/Makefile
+++ b/libpam_misc/Makefile
@@ -1,96 +1,105 @@
+#
# $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
+
+LIBOBJECTS = help_env.o misc_conv.o
+
+ifeq ($(DYNAMIC_LIBPAM),yes)
+DLIBOBJECTS = $(addprefix dynamic/,$(LIBOBJECTS))
+endif
+
+ifeq ($(STATIC_LIBPAM),yes)
+SLIBOBJECTS = $(addprefix static/,$(LIBOBJECTS))
+endif
-# sources and object files
+# ---------------------------------------------
+## rules
-LIBSRC = $(addsuffix .c,$(FILES))
-LIBOBJ = $(addsuffix .o,$(FILES))
+all: dirs $(LIBNAMED) $(LIBNAMEDSTATIC)
-# rules
+dirs:
+ifeq ($(DYNAMIC_LIBPAM),yes)
+ $(MKDIR) dynamic
+endif
+ifeq ($(STATIC_LIBPAM),yes)
+ $(MKDIR) static
+endif
-all: $(LIBSTATIC) $(LIBDYNAMIC)
+dynamic/%.o : %.c
+ $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
-$(LIBDYNAMIC): $(LIBOBJ)
-ifdef MAKE_DYNAMIC
+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)
+ $(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)
$(LDCONFIG)
- rm -f $(FAKEROOT)$(LIBDIR)/$(LIBSTATIC)
- rm -f $(FAKEROOT)$(INCLUDED)/chk_malloc.h
+ rm -f $(FAKEROOT)$(LIBDIR)/$(LIBNAMEDSTATIC)
-.c.o:
- $(CC) -c $(DEFS) $(CFLAGS) $<
-
-extraclean:
- @$(MAKE) clean
- rm -f *.o *.bak
+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/libpam_misc/pam_misc.h b/libpam_misc/include/security/pam_misc.h
index fbf7a9f1..fbf7a9f1 100644
--- a/libpam_misc/pam_misc.h
+++ b/libpam_misc/include/security/pam_misc.h
diff --git a/libpamc/Makefile b/libpamc/Makefile
index 08f17252..ffdfb018 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,24 +15,17 @@ endif
VERSION=.$(MAJOR_REL)
MODIFICATION=.$(MINOR_REL)
-# ---------------------------------------------
-
-dummy:
- @echo "*** This is not a top-level Makefile!"
-
-# ---------------------------------------------
-
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
@@ -45,14 +40,14 @@ endif
# ---------------------------------------------
## rules
-all: dirs $(LIBPAMC) $(LIBPAMCSTATIC)
+all: dirs $(LIBNAMED) $(LIBNAMEDSTATIC)
dirs:
ifeq ($(DYNAMIC_LIBPAM),yes)
- mkdir -p dynamic
+ $(MKDIR) dynamic
endif
ifeq ($(STATIC_LIBPAM),yes)
- mkdir -p static
+ $(MKDIR) static
endif
dynamic/%.o : %.c
@@ -61,22 +56,22 @@ dynamic/%.o : %.c
static/%.o : %.c
$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
-$(LIBPAMC): $(DLIBOBJECTS)
+$(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)
+$(LIBNAMEDSTATIC): $(SLIBOBJECTS)
ifeq ($(STATIC_LIBPAM),yes)
$(AR) $@ $(SLIBOBJECTS) $(MODULES)
$(RANLIB) $@
@@ -86,20 +81,20 @@ install: all
$(MKDIR) $(FAKEROOT)$(INCLUDED)
$(INSTALL) -m 644 include/security/pam_client.h $(FAKEROOT)$(INCLUDED)
ifeq ($(DYNAMIC_LIBPAM),yes)
- $(INSTALL) -m $(SHLIBMODE) $(LIBPAMC) $(FAKEROOT)$(LIBDIR)/$(LIBPAMCFULL)
+ $(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
ifeq ($(STATIC_LIBPAM),yes)
- $(INSTALL) -m 644 $(LIBPAMCSTATIC) $(FAKEROOT)$(LIBDIR)
+ $(INSTALL) -m 644 $(LIBNAMEDSTATIC) $(FAKEROOT)$(LIBDIR)
endif
remove:
rm -f $(FAKEROOT)$(INCLUDED)/pam_client.h
$(LDCONFIG)
- rm -f $(FAKEROOT)$(LIBDIR)/$(LIBPAMCSTATIC)
+ rm -f $(FAKEROOT)$(LIBDIR)/$(LIBNAMEDSTATIC)
clean:
rm -f a.out core *~ static/*.o dynamic/*.o
diff --git a/modules/pam_permit/Makefile b/modules/pam_permit/Makefile
index 904e84d7..5a01ad80 100644
--- a/modules/pam_permit/Makefile
+++ b/modules/pam_permit/Makefile
@@ -5,59 +5,13 @@
# Linux-PAM. You should not modify this Makefile (unless you know
# what you are doing!).
#
-# $Log$
-# Revision 1.1.1.1 2000/06/20 22:11:46 agmorgan
-# Imported 0.72 Linux-PAM sources
+# Created by Andrew Morgan <morgan@linux.kernel.org> 1996/3/11
#
-# Revision 1.1.1.1 1998/07/12 05:17:16 morgan
-# Linux PAM sources pre-0.66
-#
-# Revision 1.8 1997/04/05 06:33:25 morgan
-# fakeroot
-#
-# Revision 1.7 1997/02/15 19:02:27 morgan
-# updated email address
-#
-# Revision 1.6 1996/11/10 20:14:34 morgan
-# cross platform support
-#
-# Revision 1.5 1996/09/05 06:32:45 morgan
-# ld --> gcc
-#
-# Revision 1.4 1996/05/26 15:49:25 morgan
-# make dynamic and static dirs
-#
-# Revision 1.3 1996/05/26 04:04:26 morgan
-# automated static support
-#
-# Revision 1.2 1996/03/16 17:56:38 morgan
-# tidied up
-#
-#
-# Created by Andrew Morgan <morgan@parc.power.net> 1996/3/11
-#
-
-# Convenient defaults for compiling independently of the full source
-# tree.
-ifndef FULL_LINUX_PAM_SOURCE_TREE
-export DYNAMIC=-DPAM_DYNAMIC
-export CC=gcc
-export CFLAGS=-O2 -Dlinux -DLINUX_PAM \
- -ansi -D_POSIX_SOURCE -Wall -Wwrite-strings \
- -Wpointer-arith -Wcast-qual -Wcast-align -Wtraditional \
- -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline \
- -Wshadow -pedantic -fPIC
-export MKDIR=mkdir -p
-export LD_D=gcc -shared -Xlinker -x
-endif
-#
-#
+include ../../Make.Rules
TITLE=pam_permit
-#
-
LIBSRC = $(TITLE).c
LIBOBJ = $(TITLE).o
LIBOBJD = $(addprefix dynamic/,$(LIBOBJ))
@@ -126,6 +80,7 @@ clean:
extraclean: clean
rm -f *.a *.o *.so *.bak
+ rm -rf dynamic static
.c.o:
$(CC) $(CFLAGS) -c $<