NEED_LINK_LIB_C=@PAM_NEEDS_LIBC@
HAVE_LCKPWDF=@HAVE_LCKPWDF@
HAVE_LIBCRACK=@HAVE_LIBCRACK@
+HAVE_LIBCAP=@HAVE_LIBCAP@
HAVE_LIBCRYPT=@HAVE_LIBCRYPT@
HAVE_LIBUTIL=@HAVE_LIBUTIL@
HAVE_NDBM_H=@HAVE_NDBM_H@
all: $(THINGSTOMAKE)
+ # Let's get a dynamic libpam.so first
+ bootstrap-libpam: _pam_aconf.h prep
+ $(MAKE) -C libpam bootstrap-libpam
+
prep:
rm -f security
ln -sf . security
@rm -f configure
@exit 1
-$(THINGSTOMAKE): _pam_aconf.h prep
+$(THINGSTOMAKE): _pam_aconf.h prep bootstrap-libpam
$(MAKE) -C $@ all
install: _pam_aconf.h prep
dnl These are most likely platform specific - I think HPUX differs
USESONAME=yes ; AC_SUBST(USESONAME)
-SOSWITCH=-soname ; AC_SUBST(SOSWITCH)
+SOSWITCH='-Xlinker -soname -Xlinker ' ; AC_SUBST(SOSWITCH)
NEEDSONAME=no ; AC_SUBST(NEEDSONAME)
LDCONFIG=/sbin/ldconfig ; AC_SUBST(LDCONFIG)
dnl Set FLAGS, linker options etc. depending on C compiler.
dnl gcc is tested and much preferred; others less so, if at all
dnl
-dnl If compiling with gcc, linking is also supposed to be done with gcc;
-dnl since we use linker-specific arguments, we may not gain anything by
-dnl switching LD_L over, but I think we can use LD_D as-is.
+dnl If compiling with gcc, linking is also supposed to be done with gcc
dnl
dnl For the moment, gcc is enforced above at "CC=gcc".
dnl
WARNINGS="$GCC_WARNINGS"
PIC="-fPIC"
DYNTYPE=so
- LD=ld
- LD_L="$LD -x -shared"
+ LD=gcc
+ LD_L="$LD -Xlinker -x -shared"
RANLIB=ranlib
STRIP=strip
CC_STATIC="-Xlinker -export-dynamic"
ifeq ($(WITH_LIBDEBUG),yes)
LIBNAME=libpamd
+ CFLAGS += -D"DEBUG"
+ CFLAGS += -g
else
LIBNAME=libpam
endif
LIBPAMSTATIC = $(LIBNAME).a
ifdef STATIC
-@echo Did you mean to set STATIC\?
+# @echo Did you mean to set STATIC\?
MODULES = $(shell cat ../modules/_static_module_objects)
STATICOBJ = pam_static.o
else
static/%.o : %.c
$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
+bootstrap-libpam: bootdir $(LIBPAM)
+bootdir:
+ test -d dynamic || mkdir dynamic
$(LIBPAM): $(DLIBOBJECTS)
ifeq ($(DYNAMIC_LIBPAM),yes)
LIBOBJD = $(addprefix dynamic/,$(LIBOBJ))
LIBOBJS = $(addprefix static/,$(LIBOBJ))
-LINK_PAMMODUTILS = -L../pammodutil -lpammodutil
+LINK_PAMMODUTILS = -L../pammodutil -lpammodutil -L../../libpam -lpam
INCLUDE_PAMMODUTILS = -I../pammodutil/include
ifdef DYNAMIC
TITLE=pam_access
LOCAL_CONFILE=./access.conf
INSTALLED_CONFILE=$(SCONFIGD)/access.conf
+ifeq ($(HAVE_LIBNSL),yes)
+MODULE_SIMPLE_EXTRALIBS=-lnsl
+endif
DEFS=-DDEFAULT_CONF_FILE=\"$(INSTALLED_CONFILE)\"
CFLAGS += $(DEFS)
MODULE_SIMPLE_INSTALL=bash -f ../install_conf "$(FAKEROOT)" "$(SCONFIGD)" "$(INSTALLED_CONFILE)" "$(TITLE)" "$(LOCAL_CONFILE)"
MODULE_SIMPLE_REMOVE=rm -f $(FAKEROOT)$(INSTALLED_CONFILE)
MODULE_SIMPLE_CLEAN=rm -f ./.ignore_age
+ifeq ($(HAVE_LIBCAP),yes)
+MODULE_SIMPLE_EXTRALIBS=-lcap
+endif
include ../Simple.Rules
$(LIBOBJD): $(LIBSRC)
$(LIBSHARED): $(LIBOBJD)
- $(LD_D) -o $@ $(LIBOBJD)
+ $(LD_D) -o $@ $(LIBOBJD) -L../../libpam -lpam $(NEED_LINK_LIB_C)
$(APPLICATION): $(APPOBJD) $(TITLE).c
$(CC) $(CFLAGS) -o $@ $(APPOBJD) $(LOADLIBES)
$(LIBOBJD): $(LIBSRC)
$(LIBSHARED): $(LIBOBJD)
- $(LD_D) -o $@ $(LIBOBJD) $(PLUS) $(CRACKLIB) $(LDLIBS) $(LIBNSL) $(LIBCRYPT)
+ $(LD_D) -o $@ $(LIBOBJD) $(PLUS) $(CRACKLIB) $(LDLIBS) $(LIBNSL) $(LIBCRYPT) $(NEED_LINK_LIB_C) -L../../libpam -lpam
endif
ifdef STATIC