From 25e1623bc53bf9d06b5b95f8009c8a8b25a13b84 Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Wed, 22 Sep 2004 22:59:46 +0000 Subject: [PATCH] Better support for using libutil on systems that need it for various pty-related functions. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16777 dc483132-0cff-0310-8789-dd5450dbe970 --- src/ChangeLog | 2 ++ src/aclocal.m4 | 12 ++++++++++++ src/appl/bsd/ChangeLog | 6 ++++++ src/appl/bsd/Makefile.in | 4 ++-- src/appl/bsd/configure.in | 3 +-- src/appl/gssftp/configure.in | 2 +- src/appl/gssftp/ftpd/ChangeLog | 4 ++++ src/appl/gssftp/ftpd/Makefile.in | 2 +- src/appl/telnet/ChangeLog | 4 ++++ src/appl/telnet/configure.in | 2 +- src/appl/telnet/telnetd/ChangeLog | 4 ++++ src/appl/telnet/telnetd/Makefile.in | 2 +- src/config/ChangeLog | 2 ++ src/config/pre.in | 3 +++ src/util/pty/ChangeLog | 4 ++++ src/util/pty/pty-int.h | 3 +++ 16 files changed, 51 insertions(+), 8 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 5c92e94ef..61138a43b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,7 @@ 2004-09-22 Tom Yu + * aclocal.m4 (KRB5_AC_LIBUTIL): New macro to check for libutil. + * aclocal.m4 (WITH_CC): Check for GNU linker. 2004-09-21 Tom Yu diff --git a/src/aclocal.m4 b/src/aclocal.m4 index 32934fac7..a3b32fff0 100644 --- a/src/aclocal.m4 +++ b/src/aclocal.m4 @@ -1700,3 +1700,15 @@ fi]) dnl dnl m4_include(config/ac-archive/acx_pthread.m4) +# +# KRB5_AC_LIBUTIL +# +# Check for libutil, for NetBSD, et al.; needed for openpty() and +# logwtmp() on some platforms. +# +AC_DEFUN([KRB5_AC_LIBUTIL], + [AC_CHECK_LIB(util, main, + [AC_DEFINE(HAVE_LIBUTIL) + UTIL_LIB=-lutil])dnl +AC_SUBST(UTIL_LIB) +]) diff --git a/src/appl/bsd/ChangeLog b/src/appl/bsd/ChangeLog index 6430cf57f..9ba9fc160 100644 --- a/src/appl/bsd/ChangeLog +++ b/src/appl/bsd/ChangeLog @@ -1,3 +1,9 @@ +2004-09-22 Tom Yu + + * configure.in: Use KRB5_AC_LIBUTIL. + + * Makefile.in (kshd, klogind): Use UTIL_LIB. + 2004-09-08 Tom Yu * login.c (main): Don't overwrite "PATH" environment variable if diff --git a/src/appl/bsd/Makefile.in b/src/appl/bsd/Makefile.in index fb40d0684..81b338e41 100644 --- a/src/appl/bsd/Makefile.in +++ b/src/appl/bsd/Makefile.in @@ -67,10 +67,10 @@ install:: fi kshd: krshd.o kcmd.o forward.o compat_recv.o $(SETENVOBJ) $(LIBOBJS) $(PTY_DEPLIB) $(KRB4COMPAT_DEPLIBS) $(APPUTILS_DEPLIB) - $(CC_LINK) -o kshd krshd.o kcmd.o forward.o compat_recv.o $(SETENVOBJ) $(LIBOBJS) $(KRSHDLIBS) $(PTY_LIB) $(KRB4COMPAT_LIBS) $(APPUTILS_LIB) + $(CC_LINK) -o kshd krshd.o kcmd.o forward.o compat_recv.o $(SETENVOBJ) $(LIBOBJS) $(KRSHDLIBS) $(PTY_LIB) $(UTIL_LIB) $(KRB4COMPAT_LIBS) $(APPUTILS_LIB) klogind: krlogind.o kcmd.o forward.o compat_recv.o $(SETENVOBJ) $(LIBOBJS) $(PTY_DEPLIB) $(KRB4COMPAT_DEPLIBS) $(APPUTILS_DEPLIB) - $(CC_LINK) -o klogind krlogind.o kcmd.o forward.o compat_recv.o $(SETENVOBJ) $(LIBOBJS) $(PTY_LIB) $(KRB4COMPAT_LIBS) $(APPUTILS_LIB) + $(CC_LINK) -o klogind krlogind.o kcmd.o forward.o compat_recv.o $(SETENVOBJ) $(LIBOBJS) $(PTY_LIB) $(UTIL_LIB) $(KRB4COMPAT_LIBS) $(APPUTILS_LIB) install:: for f in kshd klogind; do \ diff --git a/src/appl/bsd/configure.in b/src/appl/bsd/configure.in index e2716453b..71f1f6815 100644 --- a/src/appl/bsd/configure.in +++ b/src/appl/bsd/configure.in @@ -12,7 +12,6 @@ if test $with_afs != no; then fi AC_PROG_INSTALL dnl dbm libs for use of an_to_ln -AC_CHECK_LIB(util,main) save_LIBS="$LIBS" LIBS= AC_CHECK_LIB(crypt,crypt) @@ -191,6 +190,6 @@ else fi AC_CHECK_HEADERS(krb4-proto.h) - +KRB5_AC_LIBUTIL KRB5_BUILD_PROGRAM V5_AC_OUTPUT_MAKEFILE diff --git a/src/appl/gssftp/configure.in b/src/appl/gssftp/configure.in index bf6d3b832..cd012e631 100644 --- a/src/appl/gssftp/configure.in +++ b/src/appl/gssftp/configure.in @@ -20,7 +20,7 @@ DECLARE_SYS_ERRLIST AC_REPLACE_FUNCS(getdtablesize) AC_CHECK_FUNCS(getcwd getdtablesize getusershell seteuid setreuid setresuid strerror getenv) AC_CHECK_LIB(crypt,crypt) dnl -AC_CHECK_LIB(util,logwtmp) dnl +KRB5_AC_LIBUTIL dnl dnl copied from appl/bsd/configure.in dnl diff --git a/src/appl/gssftp/ftpd/ChangeLog b/src/appl/gssftp/ftpd/ChangeLog index 8038333cb..6ead450fc 100644 --- a/src/appl/gssftp/ftpd/ChangeLog +++ b/src/appl/gssftp/ftpd/ChangeLog @@ -1,3 +1,7 @@ +2004-09-22 Tom Yu + + * Makefile.in (ftpd): Use UTIL_LIB. + 2004-08-27 Ken Raeburn * ftpd.c (ftpd_gss_convert_creds): Terminate argument list to diff --git a/src/appl/gssftp/ftpd/Makefile.in b/src/appl/gssftp/ftpd/Makefile.in index 9adaa613e..67e601e11 100644 --- a/src/appl/gssftp/ftpd/Makefile.in +++ b/src/appl/gssftp/ftpd/Makefile.in @@ -30,7 +30,7 @@ LOCALINCLUDES = -I$(srcdir)/.. -I$(srcdir) @KRB4_INCLUDES@ all:: ftpd ftpd: $(OBJS) $(PTY_DEPLIB) $(GSS_DEPLIBS) $(KRB4COMPAT_DEPLIBS) - $(CC_LINK) -o $@ $(OBJS) $(FTPD_LIBS) $(PTY_LIB) $(GSS_LIBS) $(KRB4COMPAT_LIBS) + $(CC_LINK) -o $@ $(OBJS) $(FTPD_LIBS) $(PTY_LIB) $(UTIL_LIB) $(GSS_LIBS) $(KRB4COMPAT_LIBS) clean:: $(RM) ftpd ftpcmd.c diff --git a/src/appl/telnet/ChangeLog b/src/appl/telnet/ChangeLog index 8a847a286..5457af948 100644 --- a/src/appl/telnet/ChangeLog +++ b/src/appl/telnet/ChangeLog @@ -1,3 +1,7 @@ +2004-09-22 Tom Yu + + * configure.in: Use KRB5_AC_LIBUTIL. + 2004-03-07 Ken Raeburn * configure.in: Move test for setupterm back down below addition diff --git a/src/appl/telnet/configure.in b/src/appl/telnet/configure.in index 30a4cbfbe..818c2e45f 100644 --- a/src/appl/telnet/configure.in +++ b/src/appl/telnet/configure.in @@ -96,7 +96,6 @@ dnl dnl from old telnetd/configure.in dnl dnl AC_PROG_INSTALL -AC_CHECK_LIB(util,main) AC_CHECK_LIB(termcap,main,AC_DEFINE(TERMCAP) LIBS="$LIBS -ltermcap", AC_CHECK_LIB(curses,setupterm,LIBS="$LIBS -lcurses", @@ -172,4 +171,5 @@ TELNETD_LIBS="$LIBS" AC_SUBST(TELNETD_LIBS) LIBS="$old_LIBS" dnl +KRB5_AC_LIBUTIL V5_AC_OUTPUT_MAKEFILE(. libtelnet telnet telnetd) diff --git a/src/appl/telnet/telnetd/ChangeLog b/src/appl/telnet/telnetd/ChangeLog index d1b44c702..1902a32f7 100644 --- a/src/appl/telnet/telnetd/ChangeLog +++ b/src/appl/telnet/telnetd/ChangeLog @@ -1,3 +1,7 @@ +2004-09-22 Tom Yu + + * Makefile.in (telnetd): Use UTIL_LIB. + 2004-03-04 Ken Raeburn * configure.in: Deleted; configure this dir from parent now. diff --git a/src/appl/telnet/telnetd/Makefile.in b/src/appl/telnet/telnetd/Makefile.in index fb1dd94be..bb2dffb32 100644 --- a/src/appl/telnet/telnetd/Makefile.in +++ b/src/appl/telnet/telnetd/Makefile.in @@ -61,7 +61,7 @@ OBJS= telnetd.o \ all:: telnetd telnetd: $(OBJS) $(PTY_DEPLIB) $(KRB4COMPAT_DEPLIBS) ../libtelnet/libtelnet.a - $(CC_LINK) -o $@ $(OBJS) ../libtelnet/libtelnet.a $(PTY_LIB) $(KRB4COMPAT_LIBS) + $(CC_LINK) -o $@ $(OBJS) ../libtelnet/libtelnet.a $(PTY_LIB) $(UTIL_LIB) $(KRB4COMPAT_LIBS) clean:: $(RM) telnetd diff --git a/src/config/ChangeLog b/src/config/ChangeLog index 2f1bb9f64..af06a5f82 100644 --- a/src/config/ChangeLog +++ b/src/config/ChangeLog @@ -1,5 +1,7 @@ 2004-09-22 Tom Yu + * pre.in (UTIL_LIB): Set if we need libutil. + * shlib.conf (alpha*-dec-osf*): Only use -Wl,-oldstyle_liblookup if using native linker, with check for native linker if gcc is being used. diff --git a/src/config/pre.in b/src/config/pre.in index 79a089129..93a1520ae 100644 --- a/src/config/pre.in +++ b/src/config/pre.in @@ -395,6 +395,9 @@ KADMCLNT_LIBS = -lkadm5clnt $(KADM_COMM_LIBS) # need fixing if ever used on Mac OS X! PTY_LIB = -lpty +# libutil for NetBSD, et al. for openpty(), etc. +UTIL_LIB = @UTIL_LIB@ + # Misc stuff for linking server programs (and maybe some others, # eventually) but which we don't want to install. APPUTILS_LIB = -lapputils diff --git a/src/util/pty/ChangeLog b/src/util/pty/ChangeLog index 5ef03f5f5..3fb21b9ac 100644 --- a/src/util/pty/ChangeLog +++ b/src/util/pty/ChangeLog @@ -1,3 +1,7 @@ +2004-09-22 Tom Yu + + * pty-int.h: Include util.h if present. + 2004-07-30 Tom Yu * configure.in: Only sanity-check setutent() API if there is no diff --git a/src/util/pty/pty-int.h b/src/util/pty/pty-int.h index 1fa20a1d0..30f01d6ab 100644 --- a/src/util/pty/pty-int.h +++ b/src/util/pty/pty-int.h @@ -83,6 +83,9 @@ #include #include +#ifdef HAVE_UTIL_H +#include +#endif #ifdef HAVE_STREAMS /* krlogin doesn't test sys/tty... */ -- 2.26.2