]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Ugly hack to build the PAM modules PIC
authorRuss Allbery <rra@debian.org>
Sat, 28 Jun 2008 04:43:32 +0000 (21:43 -0700)
committerRuss Allbery <rra@debian.org>
Sat, 28 Jun 2008 04:43:32 +0000 (21:43 -0700)
Apply quilt patch pam-build: Apply an incredibly ugly hack to build the
PAM modules against the shared objects generated for the shared libraries.
Not suitable upstream in its current form.  The right upstream solution is
to standardize the shared library ABI and install it with a real SONAME,
and then link the PAM modules against it.  It may be that we'll drop
kaserver support and stop building the PAM modules before we get to that,
though.

Makefile.in
src/pam/Makefile.in

index 2ace1eb89d65d5aa5bc18251c2fc8ae046b8be3c..673a192d9fd4f7abb06ef5c49629965fdb5979c2 100644 (file)
@@ -512,8 +512,6 @@ libafsauthent: ubik auth kauth libafsrpc
 # pthread based user space RX library
 shlibafsrpc: rx rxkad des
        case ${SYS_NAME} in \
-       amd64_linux24) \
-               echo Skipping shlibafsrpc for amd64_linux24 ;; \
        alpha_dux*|sgi_*|sun4x_*|sunx86_*|rs_aix*|*linux*|hp_ux11*|ia64_hpux*) \
        ${COMPILE_PART1} shlibafsrpc ${COMPILE_PART2} ;; \
        *) \
@@ -522,8 +520,6 @@ shlibafsrpc: rx rxkad des
 
 shlibafsauthent: ubik auth kauth shlibafsrpc
        case ${SYS_NAME} in \
-       amd64_linux24) \
-               echo Skipping shlibafsauthent for amd64_linux24 ;; \
        alpha_dux*|sgi_*|sun4x_*|sunx86_*|rs_aix*|*linux*|hp_ux11*|ia64_hpux*) \
        ${COMPILE_PART1} shlibafsauthent ${COMPILE_PART2} ;; \
        *) \
index 4d5b0fd0a0a66d9429b7af1aa2811f493fc3a33e..c198ab0133e89af2d351eb24c2715dba1baf0a1f 100644 (file)
@@ -25,7 +25,17 @@ LDFLAGS = ${SHLIB_LDFLAGS}
          afs_pam_msg.o afs_message.o AFS_component_version_number.o
    OBJS = $(SHOBJS) test_pam.o
 INCLUDES=-I${TOP_OBJDIR}/src/config -I${TOP_INCDIR} 
-CFLAGS =  ${DEBUG} ${INCLUDES} ${PAM_CFLAGS}
+CFLAGS =  ${DEBUG} ${INCLUDES} ${PAM_CFLAGS} ${MT_CFLAGS}
+
+# For Debian, we link directly with the object files that would have gone
+# into the libafsrpc and libafsauthent shared libraries.  The shared libraries
+# themselves cannot be used because the interface isn't stable and they have
+# no SONAME, but this is the easiest way of getting PIC objects built with the
+# pthread API.
+SHLIB_OBJS     := `ls ../shlibafsauthent/*.o | grep -v version_num` \
+                  `ls ../shlibafsrpc/*.o | grep -v version_num`
+KRB_SHLIB_OBJS := `ls ../shlibafsauthent/*.o | egrep -v 'version_num|ktc.o'` \
+                  `ls ../shlibafsrpc/*.o | grep -v version_num`
 
 all: test_pam ${TOP_LIBDIR}/pam_afs.so.1 ${TOP_LIBDIR}/pam_afs.krb.so.1
 
@@ -47,6 +57,9 @@ afs_util.o: afs_util.c afs_pam_msg.h afs_message.h afs_util.h
 afs_util_krb.o: afs_util.c afs_pam_msg.h afs_message.h afs_util.h
        ${CC} ${CFLAGS} -DAFS_KERBEROS_ENV -c ${srcdir}/afs_util.c -o afs_util_krb.o
 
+ktc.o: ${srcdir}/../auth/ktc.c
+       ${CC} ${CFLAGS} -DAFS_KERBEROS_ENV -c ${srcdir}/../auth/ktc.c
+
 pam_afs.so.1: $(SHOBJS) afs_setcred.o afs_auth.o afs_util.o
        set -x; \
        case "$(SYS_NAME)" in \
@@ -59,8 +72,9 @@ pam_afs.so.1: $(SHOBJS) afs_setcred.o afs_auth.o afs_util.o
                        afs_setcred.o afs_auth.o afs_util.o \
                        $(SHOBJS) $(LIBS) ;; \
        *linux*) \
-               $(CC) $(LDFLAGS) -o $@ afs_setcred.o \
-                       afs_auth.o afs_util.o $(SHOBJS) $(LIBS) ;;\
+               $(CC) $(LDFLAGS) $(PAM_CFLAGS) -o $@ afs_setcred.o \
+                       afs_auth.o afs_util.o $(SHOBJS) $(SHLIB_OBJS) \
+                       $(MT_LIBS) -lpam -lresolv;;\
        *fbsd*| *nbsd*) \
                $(CC) $(LDFLAGS) -o $@ afs_setcred.o \
                        afs_auth.o afs_util.o $(SHOBJS) $(LIBS) ;;\
@@ -68,7 +82,7 @@ pam_afs.so.1: $(SHOBJS) afs_setcred.o afs_auth.o afs_util.o
                echo No link line for system $(SYS_NAME). ;; \
        esac
 
-pam_afs.krb.so.1: $(SHOBJS) afs_setcred_krb.o afs_auth_krb.o afs_util_krb.o
+pam_afs.krb.so.1: $(SHOBJS) afs_setcred_krb.o afs_auth_krb.o afs_util_krb.o ktc.o
        set -x; \
        case "$(SYS_NAME)" in \
        hp_ux* | ia64_hpux*) \
@@ -81,7 +95,8 @@ pam_afs.krb.so.1: $(SHOBJS) afs_setcred_krb.o afs_auth_krb.o afs_util_krb.o
                        $(SHOBJS) $(LDFLAGS) $(KLIBS) ;; \
        *linux*) \
                $(CC) $(LDFLAGS) -o $@ afs_setcred_krb.o \
-                       afs_auth_krb.o afs_util_krb.o $(SHOBJS) $(KLIBS) ;;\
+                       afs_auth_krb.o afs_util_krb.o ktc.o $(SHOBJS) \
+                       $(KRB_SHLIB_OBJS) $(MT_LIBS) -lpam -lresolv;;\
        *fbsd*| *nbsd*) \
                $(CC) $(LDFLAGS) -o $@ afs_setcred_krb.o \
                        afs_auth_krb.o afs_util_krb.o $(SHOBJS) $(KLIBS) ;;\