From d66ecd8caf597bcc794f9b9b1716a4f4ab4cfed2 Mon Sep 17 00:00:00 2001 From: "Andrew G. Morgan" Date: Sat, 10 Feb 2001 07:17:52 +0000 Subject: Relevant BUGIDs: 131783 Purpose of commit: bugfix Commit summary: --------------- static library and debugging library support fixed - post autoconf stuff. --- CHANGELOG | 7 ++++ Make.Rules.in | 2 + configure | 102 +++++++++++++++++++++++++++------------------------ configure.in | 6 +++ examples/Makefile | 16 +++++++- libpam/Makefile | 4 +- libpam_misc/Makefile | 4 +- libpamc/Makefile | 2 +- 8 files changed, 91 insertions(+), 52 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index fe5e0abf..5586f345 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -30,6 +30,11 @@ related bug description with the following URL: http://sourceforge.net/bugs/?func=detailbug&bug_id=XXXXX&group_id=6663 Where you should replace XXXXX with a bug-id. + +If you have found a bug in Linux-PAM, please consider filing such a +bug report (see the 'submit bug' button on this page): + + http://sourceforge.net/bugs/?group_id=6663 ==================================================================== 0.75: please submit patches for this section with actual code/doc @@ -42,6 +47,8 @@ libpam. Prior versions were buggy - see bugfix for Bug 129775. ** WARNING ** +* fixes for static library builds and also the examples when linked + with the debugging build of the libraries. (Bug 131783 - agmorgan) * fixed URL for original RFC to a cached kernel.org file. (Bug 131503 - agmorgan) * quoted the $CRACKLIB_DICTPATH test in configure.in (Bug 130130 - diff --git a/Make.Rules.in b/Make.Rules.in index e6c77fa0..e8e559a6 100644 --- a/Make.Rules.in +++ b/Make.Rules.in @@ -86,6 +86,8 @@ DYNTYPE=@DYNTYPE@ LIBDL=@LIBDL@ MKDIR=@MKDIR@ INSTALL=@INSTALL@ +RANLIB=@RANLIB@ STRIP=@STRIP@ +CC_STATIC=@CC_STATIC@ LINKLIBS = $(NEED_LINK_LIB_C) $(LIBDL) diff --git a/configure b/configure index 74224ed0..345ba14f 100755 --- a/configure +++ b/configure @@ -2209,7 +2209,9 @@ if test "$GCC" = yes; then LD=ld LD_D="gcc -shared -Xlinker -x" LD_L="$LD -x -shared" + RANLIB=ranlib STRIP=strip + CC_STATIC="-Xlinker -export-dynamic" else ### ### Non-gcc needs attention on per-OS basis @@ -2221,7 +2223,9 @@ else LD=ld LD_D="cc -z text -G -R." LD_L="$LD_D" + RANLIB=ranlib STRIP=strip + CC_STATIC= fi @@ -2232,15 +2236,17 @@ fi + + echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:2237: checking whether byte ordering is bigendian" >&5 +echo "configure:2243: checking whether byte ordering is bigendian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < #include @@ -2251,11 +2257,11 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:2255: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2261: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < #include @@ -2266,7 +2272,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:2270: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2276: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -2286,7 +2292,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2309: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no else @@ -2323,12 +2329,12 @@ EOF fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:2327: checking for working const" >&5 +echo "configure:2333: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2387: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -2398,12 +2404,12 @@ EOF fi echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:2402: checking for uid_t in sys/types.h" >&5 +echo "configure:2408: checking for uid_t in sys/types.h" >&5 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF @@ -2432,12 +2438,12 @@ EOF fi echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:2436: checking for off_t" >&5 +echo "configure:2442: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2465,12 +2471,12 @@ EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:2469: checking for pid_t" >&5 +echo "configure:2475: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2498,12 +2504,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:2502: checking for size_t" >&5 +echo "configure:2508: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2531,12 +2537,12 @@ EOF fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:2535: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:2541: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2545,7 +2551,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:2549: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2555: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -2566,12 +2572,12 @@ EOF fi echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 -echo "configure:2570: checking whether struct tm is in sys/time.h or time.h" >&5 +echo "configure:2576: checking whether struct tm is in sys/time.h or time.h" >&5 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2579,7 +2585,7 @@ int main() { struct tm *tp; tp->tm_sec; ; return 0; } EOF -if { (eval echo configure:2583: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2589: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else @@ -2601,7 +2607,7 @@ fi echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6 -echo "configure:2605: checking type of array argument to getgroups" >&5 +echo "configure:2611: checking type of array argument to getgroups" >&5 if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2609,7 +2615,7 @@ else ac_cv_type_getgroups=cross else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2644: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_type_getgroups=gid_t else @@ -2648,7 +2654,7 @@ fi if test $ac_cv_type_getgroups = cross; then cat > conftest.$ac_ext < EOF @@ -2673,13 +2679,13 @@ EOF if test $ac_cv_prog_gcc = yes; then echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 -echo "configure:2677: checking whether ${CC-cc} needs -traditional" >&5 +echo "configure:2683: checking whether ${CC-cc} needs -traditional" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_pattern="Autoconf.*'x'" cat > conftest.$ac_ext < Autoconf TIOCGETP @@ -2697,7 +2703,7 @@ rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext < Autoconf TCGETA @@ -2719,7 +2725,7 @@ echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&6 fi echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6 -echo "configure:2723: checking for 8-bit clean memcmp" >&5 +echo "configure:2729: checking for 8-bit clean memcmp" >&5 if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2727,7 +2733,7 @@ else ac_cv_func_memcmp_clean=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_memcmp_clean=yes else @@ -2755,12 +2761,12 @@ echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}" echo $ac_n "checking for vprintf""... $ac_c" 1>&6 -echo "configure:2759: checking for vprintf" >&5 +echo "configure:2765: checking for vprintf" >&5 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2793: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_vprintf=yes" else @@ -2807,12 +2813,12 @@ fi if test "$ac_cv_func_vprintf" != yes; then echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 -echo "configure:2811: checking for _doprnt" >&5 +echo "configure:2817: checking for _doprnt" >&5 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2845: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func__doprnt=yes" else @@ -2862,12 +2868,12 @@ fi for ac_func in gethostname gettimeofday mkdir select strcspn strdup strerror strspn strstr strtol uname do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2866: checking for $ac_func" >&5 +echo "configure:2872: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2900: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2918,7 +2924,7 @@ done # Extract the first word of "sgml2txt", so it can be a program name with args. set dummy sgml2txt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2922: checking for $ac_word" >&5 +echo "configure:2928: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_HAVE_SGML2TXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2948,7 +2954,7 @@ fi # Extract the first word of "sgml2html", so it can be a program name with args. set dummy sgml2html; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2952: checking for $ac_word" >&5 +echo "configure:2958: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_HAVE_SGML2HTML'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2978,7 +2984,7 @@ fi # Extract the first word of "sgml2latex", so it can be a program name with args. set dummy sgml2latex; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2982: checking for $ac_word" >&5 +echo "configure:2988: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_HAVE_SGML2LATEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3015,7 +3021,7 @@ else # Extract the first word of "sgml2ps", so it can be a program name with args. set dummy sgml2ps; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3019: checking for $ac_word" >&5 +echo "configure:3025: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_HAVE_SGML2PS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3230,7 +3236,9 @@ s%@PIC@%$PIC%g s%@LD@%$LD%g s%@LD_D@%$LD_D%g s%@LD_L@%$LD_L%g +s%@RANLIB@%$RANLIB%g s%@STRIP@%$STRIP%g +s%@CC_STATIC@%$CC_STATIC%g s%@LIBOBJS@%$LIBOBJS%g s%@HAVE_SGML2TXT@%$HAVE_SGML2TXT%g s%@HAVE_SGML2HTML@%$HAVE_SGML2HTML%g diff --git a/configure.in b/configure.in index a1d501dc..cc93723e 100644 --- a/configure.in +++ b/configure.in @@ -265,7 +265,9 @@ if test "$GCC" = yes; then LD=ld LD_D="gcc -shared -Xlinker -x" LD_L="$LD -x -shared" + RANLIB=ranlib STRIP=strip + CC_STATIC="-Xlinker -export-dynamic" else ### ### Non-gcc needs attention on per-OS basis @@ -277,7 +279,9 @@ else LD=ld LD_D="cc -z text -G -R." LD_L="$LD_D" + RANLIB=ranlib STRIP=strip + CC_STATIC= fi AC_SUBST(OS_CFLAGS) @@ -286,7 +290,9 @@ AC_SUBST(PIC) AC_SUBST(LD) AC_SUBST(LD_D) AC_SUBST(LD_L) +AC_SUBST(RANLIB) AC_SUBST(STRIP) +AC_SUBST(CC_STATIC) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_BIGENDIAN diff --git a/examples/Makefile b/examples/Makefile index 0e985c59..e9432ba7 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -8,9 +8,23 @@ PROGS = blank xsh check_user SRCS = blank.c xsh.c check_user.c PROGSUID = +ifeq ($(WITH_LIBDEBUG),yes) + LIBSUFFIX=d +else + LIBSUFFIX= +endif + CFLAGS += -I../libpam_misc/include -I../libpamc/include -LOADLIBES = -L../libpam -L../libpamc -L../libpam_misc -lpam -lpam_misc +LOADLIBES = -L../libpam -L../libpamc -L../libpam_misc \ + -lpam$(LIBSUFFIX) -lpam_misc$(LIBSUFFIX) + +ifeq ($(STATIC_LIBPAM),yes) + ifneq ($(DYNAMIC),) + CFLAGS += $(CC_STATIC) + LOADLIBES += $(LIBDL) + endif +endif all: $(PROGS) diff --git a/libpam/Makefile b/libpam/Makefile index 64fe13a4..80fbf957 100644 --- a/libpam/Makefile +++ b/libpam/Makefile @@ -40,6 +40,8 @@ ifdef STATIC @echo Did you mean to set STATIC\? MODULES = $(shell cat ../modules/_static_module_objects) STATICOBJ = pam_static.o +else +MODULES = endif ifdef MEMORY_DEBUG @@ -105,7 +107,7 @@ endif $(LIBPAMSTATIC): $(SLIBOBJECTS) ifeq ($(STATIC_LIBPAM),yes) - $(AR) $@ $(SLIBOBJECTS) $(MODULES) + ar cr $@ $(SLIBOBJECTS) $(MODULES) $(RANLIB) $@ endif diff --git a/libpam_misc/Makefile b/libpam_misc/Makefile index b41e61a0..9cd464c8 100644 --- a/libpam_misc/Makefile +++ b/libpam_misc/Makefile @@ -7,7 +7,7 @@ include ../Make.Rules -ifeq ($(DEBUG_REL),yes) +ifeq ($(WITH_LIBDEBUG),yes) LIBNAME=libpam_miscd else LIBNAME=libpam_misc @@ -73,7 +73,7 @@ endif $(LIBNAMEDSTATIC): $(SLIBOBJECTS) ifeq ($(STATIC_LIBPAM),yes) - $(AR) $@ $(SLIBOBJECTS) $(MODULES) + $(AR) rc $@ $(SLIBOBJECTS) $(MODULES) $(RANLIB) $@ endif diff --git a/libpamc/Makefile b/libpamc/Makefile index 402f070f..45d42051 100644 --- a/libpamc/Makefile +++ b/libpamc/Makefile @@ -73,7 +73,7 @@ endif $(LIBNAMEDSTATIC): $(SLIBOBJECTS) ifeq ($(STATIC_LIBPAM),yes) - $(AR) $@ $(SLIBOBJECTS) $(MODULES) + $(AR) rc $@ $(SLIBOBJECTS) $(MODULES) $(RANLIB) $@ endif -- cgit v1.2.3