From 5515fde49a6cd81e01d88c27105578955e19c547 Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Sat, 8 Jul 2000 14:22:12 +0000 Subject: [PATCH] merge roken independence stuff git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@8597 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/roken/Makefile.am | 30 +- lib/roken/Makefile.in | 989 ++++++++++++++++++++++++++++------- lib/roken/acconfig.h | 36 ++ lib/roken/acinclude.m4 | 9 + lib/roken/configure.in | 518 ++++++++++++++++++ lib/roken/getaddrinfo-test.c | 4 +- lib/roken/install-sh | 251 +++++++++ lib/roken/missing | 190 +++++++ lib/roken/mkinstalldirs | 40 ++ lib/roken/roken.awk | 4 + lib/roken/roken.def | 17 - lib/roken/roken.dsp | 156 ------ lib/roken/roken.mak | 316 ----------- lib/roken/roken.rc | 105 ---- lib/roken/snprintf.c | 246 ++++++++- lib/roken/socket.c | 4 +- lib/roken/strftime.c | 2 +- 17 files changed, 2089 insertions(+), 828 deletions(-) create mode 100644 lib/roken/acconfig.h create mode 100644 lib/roken/acinclude.m4 create mode 100644 lib/roken/configure.in create mode 100755 lib/roken/install-sh create mode 100755 lib/roken/missing create mode 100755 lib/roken/mkinstalldirs delete mode 100644 lib/roken/roken.def delete mode 100644 lib/roken/roken.dsp delete mode 100644 lib/roken/roken.mak delete mode 100644 lib/roken/roken.rc diff --git a/lib/roken/Makefile.am b/lib/roken/Makefile.am index 8a1056f57..d111730fe 100644 --- a/lib/roken/Makefile.am +++ b/lib/roken/Makefile.am @@ -1,11 +1,13 @@ # $Id$ -include $(top_srcdir)/Makefile.am.common +AUTOMAKE_OPTIONS = foreign no-dependencies + +AM_CFLAGS += $(WFLAGS) CLEANFILES = roken.h make-roken.c lib_LTLIBRARIES = libroken.la -libroken_la_LDFLAGS = -version-info 8:1:3 +libroken_la_LDFLAGS = -version-info @VERSION@:0:0 noinst_PROGRAMS = make-roken @@ -16,11 +18,15 @@ check_PROGRAMS = parse_bytes-test \ TESTS = $(check_PROGRAMS) -getaddrinfo_test_LDADD = libroken.la -parse_bytes_test_LDADD = libroken.la +LIB_crypt = @LIB_crypt@ + +common_LDADD = libroken.la $(LIB_crypt) + strpftime_test_SOURCES = strpftime-test.c strftime.c strptime.c snprintf.c snprintf_test_SOURCES = snprintf-test.c snprintf.c -snprintf_test_LDADD = -lm +snprintf_test_LDADD = $(common_LDADD) -lm +getaddrinfo_test_LDADD = $(common_LDADD) +parse_bytes_test_LDADD = $(common_LDADD) libroken_la_SOURCES = \ base64.c \ @@ -131,20 +137,16 @@ EXTRA_libroken_la_SOURCES = \ warnx.c \ writev.c -EXTRA_DIST = resource.h roken.awk roken.def roken.dsp roken.h.in \ - roken.mak roken.rc - - +EXTRA_DIST = roken.awk roken.h.in libroken_la_LIBADD = @LTLIBOBJS@ $(LTLIBOBJS) $(libroken_la_OBJECTS): roken.h -include_HEADERS = $(err_h) base64.h getarg.h \ - parse_bytes.h parse_time.h parse_units.h \ - resolve.h roken.h roken-common.h - -build_HEADERZ = $(err_h) $(fnmatch_h) $(glob_h) xdbm.h +include_HEADERS = $(err_h) base64.h getarg.h \ + parse_bytes.h parse_time.h parse_units.h \ + resolve.h roken.h roken-common.h \ + $(err_h) $(fnmatch_h) $(glob_h) xdbm.h if have_err_h err_h = diff --git a/lib/roken/Makefile.in b/lib/roken/Makefile.in index 3672473c4..8cfeb37ea 100644 --- a/lib/roken/Makefile.in +++ b/lib/roken/Makefile.in @@ -1,232 +1,825 @@ -# -# $Id$ -# +# Makefile.in generated automatically by automake 1.4 from Makefile.am -SHELL = /bin/sh +# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# $Id$ + + +# $Id$ + + +# $Id$ + + +SHELL = @SHELL@ srcdir = @srcdir@ +top_srcdir = @top_srcdir@ VPATH = @srcdir@ - -CC = @CC@ -LINK = @LINK@ -CPP = @CPP@ -AR = ar -RANLIB = @RANLIB@ -DEFS = @DEFS@ -CFLAGS = @CFLAGS@ $(WFLAGS) -WFLAGS = @WFLAGS@ -AWK = @AWK@ - -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -MKINSTALLDIRS = @top_srcdir@/mkinstalldirs - prefix = @prefix@ exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ libdir = @libdir@ -EXECSUFFIX = @EXECSUFFIX@ -PICFLAGS = # @PICFLAGS@ - -LIBNAME = $(LIBPREFIX)roken -#LIBEXT = @LIBEXT@ Always build archive library and don't install! -LIBEXT = a -LIBPREFIX = @LIBPREFIX@ -SHLIBEXT = @SHLIBEXT@ -LDSHARED = @LDSHARED@ -LIB = $(LIBNAME).$(LIBEXT) +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include -SOURCES = \ - base64.c \ - chown.c \ - concat.c \ - copyhostent.c \ - daemon.c \ - emalloc.c \ - erealloc.c \ - estrdup.c \ - eread.c \ - err.c \ - errx.c \ - ewrite.c \ - fchown.c \ - flock.c \ - fnmatch.c \ - freeaddrinfo.c \ - freehostent.c \ - gai_strerror.c \ - get_window_size.c \ - getaddrinfo.c \ - getarg.c \ - getcwd.c \ - get_default_username.c \ - getdtablesize.c \ - gethostname.c \ - getipnodebyaddr.c \ - getipnodebyname.c \ - getnameinfo.c \ - getnameinfo_verified.c \ - getopt.c \ - getusershell.c \ - glob.c \ - hstrerror.c \ - inet_aton.c \ - inet_ntop.c \ - initgroups.c \ - iruserok.c \ - issuid.c \ - k_getpwnam.c \ - k_getpwuid.c \ - lstat.c \ - memmove.c \ - mini_inetd.c \ - mkstemp.c \ - net_read.c \ - net_write.c \ - parse_time.c \ - parse_units.c \ - print_version.c \ - putenv.c \ - resolve.c \ - rcmd.c \ - roken_gethostby.c \ - readv.c \ - setegid.c \ - setenv.c \ - seteuid.c \ - signal.c \ - simple_exec.c \ - snprintf.c \ - socket.c \ - strcasecmp.c \ - strcollect.c \ - strdup.c \ - strerror.c \ - strftime.c \ - strlcat.c \ - strlcpy.c \ - strlwr.c \ - strncasecmp.c \ - strndup.c \ - strnlen.c \ - strsep.c \ - strtok_r.c \ - strupr.c \ - tm2time.c \ - timeval.c \ - unsetenv.c \ - verify.c \ - verr.c \ - verrx.c \ - vsyslog.c \ - vwarn.c \ - vwarnx.c \ - warn.c \ - warnerr.c \ - warnx.c +DESTDIR = -EXTRA_SOURCES = \ - make-print-version.c \ - getaddrinfo-test.c +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ -OBJECTS = \ - base64.o \ - concat.o \ - emalloc.o \ - eread.o \ - erealloc.o \ - estrdup.o \ - ewrite.o \ - get_default_username.o \ - get_window_size.o \ - getarg.o \ - getnameinfo_verified.o \ - issuid.o \ - k_getpwnam.o \ - k_getpwuid.o \ - mini_inetd.o \ - net_read.o \ - net_write.o \ - parse_time.o \ - parse_units.o \ - print_version.o \ - resolve.o \ - roken_gethostby.o \ - signal.o \ - simple_exec.o \ - snprintf.o \ - socket.o \ - strcollect.o \ - tm2time.o \ - verify.o \ - warnerr.o \ - @LIBOBJS@ +top_builddir = ../.. -all: $(LIB) install-roken-h +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ -Wall: - make CFLAGS="-g -Wall -Wno-comment -Wmissing-prototypes -Wmissing-declarations -D__USE_FIXED_PROTOTYPES__" +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AFS_EXTRA_LD = @AFS_EXTRA_LD@ +AIX_EXTRA_KAFS = @AIX_EXTRA_KAFS@ +APPL_dce = @APPL_dce@ +AS = @AS@ +AWK = @AWK@ +CANONICAL_HOST = @CANONICAL_HOST@ +CATMAN = @CATMAN@ +CATMANEXT = @CATMANEXT@ +CC = @CC@ +CPPFLAGS_roken = @CPPFLAGS_roken@ +DBLIB = @DBLIB@ +DIR_otp = @DIR_otp@ +DIR_roken = @DIR_roken@ +DLLTOOL = @DLLTOOL@ +EXEEXT = @EXEEXT@ +EXTRA_LIB45 = @EXTRA_LIB45@ +GROFF = @GROFF@ +INCLUDE_ = @INCLUDE_@ +LD = @LD@ +LEX = @LEX@ +LIBOBJS = @LIBOBJS@ +LIBTOOL = @LIBTOOL@ +LIB_ = @LIB_@ +LIB_AUTH_SUBDIRS = @LIB_AUTH_SUBDIRS@ +LIB_dce = @LIB_dce@ +LIB_kdb = @LIB_kdb@ +LIB_otp = @LIB_otp@ +LIB_roken = @LIB_roken@ +LIB_security = @LIB_security@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MAKE_X_PROGS_BIN_PROGS = @MAKE_X_PROGS_BIN_PROGS@ +MAKE_X_PROGS_BIN_SCRPTS = @MAKE_X_PROGS_BIN_SCRPTS@ +MAKE_X_PROGS_LIBEXEC_PROGS = @MAKE_X_PROGS_LIBEXEC_PROGS@ +NEED_WRITEAUTH_FALSE = @NEED_WRITEAUTH_FALSE@ +NEED_WRITEAUTH_TRUE = @NEED_WRITEAUTH_TRUE@ +NM = @NM@ +NROFF = @NROFF@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +VOID_RETSIGTYPE = @VOID_RETSIGTYPE@ +WFLAGS = @WFLAGS@ +WFLAGS_NOIMPLICITINT = @WFLAGS_NOIMPLICITINT@ +WFLAGS_NOUNUSED = @WFLAGS_NOUNUSED@ +YACC = @YACC@ + +AUTOMAKE_OPTIONS = foreign no-dependencies + +SUFFIXES = .et .h .1 .3 .5 .8 .cat1 .cat3 .cat5 .cat8 .x + +INCLUDES = -I$(top_builddir)/include + +AM_CFLAGS = $(WFLAGS) + +CP = cp + +COMPILE_ET = $(top_builddir)/lib/com_err/compile_et + +buildinclude = $(top_builddir)/include + +LIB_XauReadAuth = @LIB_XauReadAuth@ +LIB_crypt = @LIB_crypt@ +LIB_dbm_firstkey = @LIB_dbm_firstkey@ +LIB_dbopen = @LIB_dbopen@ +LIB_dlopen = @LIB_dlopen@ +LIB_dn_expand = @LIB_dn_expand@ +LIB_el_init = @LIB_el_init@ +LIB_getattr = @LIB_getattr@ +LIB_gethostbyname = @LIB_gethostbyname@ +LIB_getpwent_r = @LIB_getpwent_r@ +LIB_getpwnam_r = @LIB_getpwnam_r@ +LIB_getsockopt = @LIB_getsockopt@ +LIB_logout = @LIB_logout@ +LIB_logwtmp = @LIB_logwtmp@ +LIB_odm_initialize = @LIB_odm_initialize@ +LIB_readline = @LIB_readline@ +LIB_res_search = @LIB_res_search@ +LIB_setpcred = @LIB_setpcred@ +LIB_setsockopt = @LIB_setsockopt@ +LIB_socket = @LIB_socket@ +LIB_syslog = @LIB_syslog@ +LIB_tgetent = @LIB_tgetent@ + +HESIODLIB = @HESIODLIB@ +HESIODINCLUDE = @HESIODINCLUDE@ +INCLUDE_hesiod = @INCLUDE_hesiod@ +LIB_hesiod = @LIB_hesiod@ + +INCLUDE_krb4 = @INCLUDE_krb4@ +LIB_krb4 = @LIB_krb4@ + +INCLUDE_openldap = @INCLUDE_openldap@ +LIB_openldap = @LIB_openldap@ + +INCLUDE_readline = @INCLUDE_readline@ + +LEXLIB = @LEXLIB@ + +cat1dir = $(mandir)/cat1 +cat3dir = $(mandir)/cat3 +cat5dir = $(mandir)/cat5 +cat8dir = $(mandir)/cat8 + +MANRX = \(.*\)\.\([0-9]\) +CATSUFFIX = @CATSUFFIX@ + +NROFF_MAN = groff -mandoc -Tascii + +@KRB4_TRUE@LIB_kafs = $(top_builddir)/lib/kafs/libkafs.la $(AIX_EXTRA_KAFS) + +@KRB5_TRUE@LIB_krb5 = $(top_builddir)/lib/krb5/libkrb5.la $(top_builddir)/lib/asn1/libasn1.la +@KRB5_TRUE@LIB_gssapi = $(top_builddir)/lib/gssapi/libgssapi.la + +CHECK_LOCAL = $(PROGRAMS) + +CLEANFILES = roken.h make-roken.c print_version.h + +lib_LTLIBRARIES = libroken.la +libroken_la_LDFLAGS = -version-info 8:1:3 + +noinst_PROGRAMS = make-roken make-print-version + +check_PROGRAMS = parse_bytes-test strpftime-test getaddrinfo-test snprintf-test + + +TESTS = $(check_PROGRAMS) + +getaddrinfo_test_LDADD = libroken.la +parse_bytes_test_LDADD = libroken.la +strpftime_test_SOURCES = strpftime-test.c strftime.c strptime.c snprintf.c +snprintf_test_SOURCES = snprintf-test.c snprintf.c +snprintf_test_LDADD = -lm + +@KRB4_TRUE@@KRB5_TRUE@make_print_version_LDADD = $(LIB_krb4) -ldes + +libroken_la_SOURCES = base64.c concat.c emalloc.c environment.c eread.c erealloc.c estrdup.c ewrite.c getaddrinfo_hostspec.c get_default_username.c get_window_size.c getarg.c getnameinfo_verified.c issuid.c k_getpwnam.c k_getpwuid.c mini_inetd.c net_read.c net_write.c parse_bytes.c parse_time.c parse_units.c resolve.c roken_gethostby.c signal.c simple_exec.c snprintf.c socket.c strcollect.c timeval.c tm2time.c verify.c warnerr.c write_pid.c xdbm.h + + +EXTRA_libroken_la_SOURCES = chown.c copyhostent.c daemon.c err.c err.h errx.c fchown.c flock.c fnmatch.c fnmatch.h freeaddrinfo.c freehostent.c gai_strerror.c getaddrinfo.c getdtablesize.c getegid.c geteuid.c getgid.c gethostname.c getipnodebyaddr.c getipnodebyname.c getnameinfo.c getopt.c gettimeofday.c getuid.c getusershell.c glob.h hstrerror.c inet_aton.c inet_ntop.c inet_pton.c initgroups.c innetgr.c iruserok.c lstat.c memmove.c mkstemp.c putenv.c rcmd.c readv.c recvmsg.c sendmsg.c setegid.c setenv.c seteuid.c strcasecmp.c strdup.c strerror.c strftime.c strlcat.c strlcpy.c strlwr.c strncasecmp.c strndup.c strnlen.c strptime.c strsep.c strsep_copy.c strtok_r.c strupr.c swab.c unsetenv.c verr.c verrx.c vsyslog.c vwarn.c vwarnx.c warn.c warnx.c writev.c + + +EXTRA_DIST = resource.h roken.awk roken.def roken.dsp roken.h.in roken.mak roken.rc + + +libroken_la_LIBADD = @LTLIBOBJS@ + +include_HEADERS = $(err_h) base64.h getarg.h parse_bytes.h parse_time.h parse_units.h resolve.h roken.h roken-common.h + + +build_HEADERZ = $(err_h) $(fnmatch_h) $(glob_h) xdbm.h +@have_err_h_TRUE@err_h = +@have_err_h_FALSE@err_h = err.h +@have_fnmatch_h_TRUE@fnmatch_h = +@have_fnmatch_h_FALSE@fnmatch_h = fnmatch.h +@have_glob_h_TRUE@glob_h = +@have_glob_h_FALSE@glob_h = glob.h +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../../include/config.h +CONFIG_CLEAN_FILES = +LTLIBRARIES = $(lib_LTLIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) -I../../include +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +X_CFLAGS = @X_CFLAGS@ +X_LIBS = @X_LIBS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +libroken_la_DEPENDENCIES = @LTLIBOBJS@ +libroken_la_OBJECTS = base64.lo concat.lo emalloc.lo environment.lo \ +eread.lo erealloc.lo estrdup.lo ewrite.lo getaddrinfo_hostspec.lo \ +get_default_username.lo get_window_size.lo getarg.lo \ +getnameinfo_verified.lo issuid.lo k_getpwnam.lo k_getpwuid.lo \ +mini_inetd.lo net_read.lo net_write.lo parse_bytes.lo parse_time.lo \ +parse_units.lo resolve.lo roken_gethostby.lo signal.lo simple_exec.lo \ +snprintf.lo socket.lo strcollect.lo timeval.lo tm2time.lo verify.lo \ +warnerr.lo write_pid.lo +check_PROGRAMS = parse_bytes-test$(EXEEXT) strpftime-test$(EXEEXT) \ +getaddrinfo-test$(EXEEXT) snprintf-test$(EXEEXT) +noinst_PROGRAMS = make-roken$(EXEEXT) make-print-version$(EXEEXT) +PROGRAMS = $(noinst_PROGRAMS) + +parse_bytes_test_SOURCES = parse_bytes-test.c +parse_bytes_test_OBJECTS = parse_bytes-test.$(OBJEXT) +parse_bytes_test_DEPENDENCIES = libroken.la +parse_bytes_test_LDFLAGS = +strpftime_test_OBJECTS = strpftime-test.$(OBJEXT) strftime.$(OBJEXT) \ +strptime.$(OBJEXT) snprintf.$(OBJEXT) +strpftime_test_LDADD = $(LDADD) +strpftime_test_DEPENDENCIES = +strpftime_test_LDFLAGS = +getaddrinfo_test_SOURCES = getaddrinfo-test.c +getaddrinfo_test_OBJECTS = getaddrinfo-test.$(OBJEXT) +getaddrinfo_test_DEPENDENCIES = libroken.la +getaddrinfo_test_LDFLAGS = +snprintf_test_OBJECTS = snprintf-test.$(OBJEXT) snprintf.$(OBJEXT) +snprintf_test_DEPENDENCIES = +snprintf_test_LDFLAGS = +make_roken_SOURCES = make-roken.c +make_roken_OBJECTS = make-roken.$(OBJEXT) +make_roken_LDADD = $(LDADD) +make_roken_DEPENDENCIES = +make_roken_LDFLAGS = +make_print_version_SOURCES = make-print-version.c +make_print_version_OBJECTS = make-print-version.$(OBJEXT) +@KRB4_TRUE@@KRB5_TRUE@make_print_version_DEPENDENCIES = +make_print_version_LDFLAGS = +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ +HEADERS = $(include_HEADERS) + +DIST_COMMON = ChangeLog Makefile.am Makefile.in getcap.c glob.c \ +make-print-version.c + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +SOURCES = $(libroken_la_SOURCES) $(EXTRA_libroken_la_SOURCES) parse_bytes-test.c $(strpftime_test_SOURCES) getaddrinfo-test.c $(snprintf_test_SOURCES) make-roken.c make-print-version.c +OBJECTS = $(libroken_la_OBJECTS) parse_bytes-test.$(OBJEXT) $(strpftime_test_OBJECTS) getaddrinfo-test.$(OBJEXT) $(snprintf_test_OBJECTS) make-roken.$(OBJEXT) make-print-version.$(OBJEXT) + +all: all-redirect +.SUFFIXES: +.SUFFIXES: .1 .3 .5 .8 .S .c .cat1 .cat3 .cat5 .cat8 .et .h .lo .o .obj .s .x +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) $(top_srcdir)/Makefile.am.common $(top_srcdir)/cf/Makefile.am.common + cd $(top_srcdir) && $(AUTOMAKE) --foreign lib/roken/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + + +mostlyclean-libLTLIBRARIES: + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + +distclean-libLTLIBRARIES: + +maintainer-clean-libLTLIBRARIES: + +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(libdir) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + echo "$(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p"; \ + $(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p; \ + else :; fi; \ + done + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \ + done .c.o: - $(CC) -c $(DEFS) -I. -I../../include -I$(srcdir) $(CFLAGS) $(CPPFLAGS) $(PICFLAGS) $< + $(COMPILE) -c $< -install: all +# FIXME: We should only use cygpath when building on Windows, +# and only if it is available. +.c.obj: + $(COMPILE) -c `cygpath -w $<` -uninstall: +.s.o: + $(COMPILE) -c $< -TAGS: $(SOURCES) $(EXTRA_SOURCES) - etags $(SOURCES) $(EXTRA_SOURCES) +.S.o: + $(COMPILE) -c $< -check: +mostlyclean-compile: + -rm -f *.o core *.core + -rm -f *.$(OBJEXT) -clean: - rm -f $(LIB) *.o *.a roken.h make-roken$(EXECSUFFIX) make-roken.c \ - make-print-version$(EXECSUFFIX) print_version.h +clean-compile: -mostlyclean: clean +distclean-compile: + -rm -f *.tab.c -distclean: clean - rm -f Makefile *.tab.c *~ +maintainer-clean-compile: -realclean: distclean - rm -f TAGS +.c.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< -$(LIBNAME).a: $(OBJECTS) - rm -f $@ - $(AR) cr $@ $(OBJECTS) - -$(RANLIB) $@ +.s.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< -$(LIBNAME).$(SHLIBEXT): $(OBJECTS) - rm -f $@ - $(LDSHARED) -o $@ $(OBJECTS) +.S.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< -roken.h: make-roken$(EXECSUFFIX) - @./make-roken > tmp.h ;\ +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + +maintainer-clean-libtool: + +libroken.la: $(libroken_la_OBJECTS) $(libroken_la_DEPENDENCIES) + $(LINK) -rpath $(libdir) $(libroken_la_LDFLAGS) $(libroken_la_OBJECTS) $(libroken_la_LIBADD) $(LIBS) + +mostlyclean-checkPROGRAMS: + +clean-checkPROGRAMS: + -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) + +distclean-checkPROGRAMS: + +maintainer-clean-checkPROGRAMS: + +mostlyclean-noinstPROGRAMS: + +clean-noinstPROGRAMS: + -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) + +distclean-noinstPROGRAMS: + +maintainer-clean-noinstPROGRAMS: + +parse_bytes-test$(EXEEXT): $(parse_bytes_test_OBJECTS) $(parse_bytes_test_DEPENDENCIES) + @rm -f parse_bytes-test$(EXEEXT) + $(LINK) $(parse_bytes_test_LDFLAGS) $(parse_bytes_test_OBJECTS) $(parse_bytes_test_LDADD) $(LIBS) + +strpftime-test$(EXEEXT): $(strpftime_test_OBJECTS) $(strpftime_test_DEPENDENCIES) + @rm -f strpftime-test$(EXEEXT) + $(LINK) $(strpftime_test_LDFLAGS) $(strpftime_test_OBJECTS) $(strpftime_test_LDADD) $(LIBS) + +getaddrinfo-test$(EXEEXT): $(getaddrinfo_test_OBJECTS) $(getaddrinfo_test_DEPENDENCIES) + @rm -f getaddrinfo-test$(EXEEXT) + $(LINK) $(getaddrinfo_test_LDFLAGS) $(getaddrinfo_test_OBJECTS) $(getaddrinfo_test_LDADD) $(LIBS) + +snprintf-test$(EXEEXT): $(snprintf_test_OBJECTS) $(snprintf_test_DEPENDENCIES) + @rm -f snprintf-test$(EXEEXT) + $(LINK) $(snprintf_test_LDFLAGS) $(snprintf_test_OBJECTS) $(snprintf_test_LDADD) $(LIBS) + +make-roken$(EXEEXT): $(make_roken_OBJECTS) $(make_roken_DEPENDENCIES) + @rm -f make-roken$(EXEEXT) + $(LINK) $(make_roken_LDFLAGS) $(make_roken_OBJECTS) $(make_roken_LDADD) $(LIBS) + +make-print-version$(EXEEXT): $(make_print_version_OBJECTS) $(make_print_version_DEPENDENCIES) + @rm -f make-print-version$(EXEEXT) + $(LINK) $(make_print_version_LDFLAGS) $(make_print_version_OBJECTS) $(make_print_version_LDADD) $(LIBS) + +install-includeHEADERS: $(include_HEADERS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(includedir) + @list='$(include_HEADERS)'; for p in $$list; do \ + if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \ + echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(includedir)/$$p"; \ + $(INSTALL_DATA) $$d$$p $(DESTDIR)$(includedir)/$$p; \ + done + +uninstall-includeHEADERS: + @$(NORMAL_UNINSTALL) + list='$(include_HEADERS)'; for p in $$list; do \ + rm -f $(DESTDIR)$(includedir)/$$p; \ + done + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = lib/roken + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done + $(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-hook +check-TESTS: $(TESTS) + @failed=0; all=0; \ + srcdir=$(srcdir); export srcdir; \ + for tst in $(TESTS); do \ + if test -f $$tst; then dir=.; \ + else dir="$(srcdir)"; fi; \ + if $(TESTS_ENVIRONMENT) $$dir/$$tst; then \ + all=`expr $$all + 1`; \ + echo "PASS: $$tst"; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + failed=`expr $$failed + 1`; \ + echo "FAIL: $$tst"; \ + fi; \ + done; \ + if test "$$failed" -eq 0; then \ + banner="All $$all tests passed"; \ + else \ + banner="$$failed of $$all tests failed"; \ + fi; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + echo "$$dashes"; \ + test "$$failed" -eq 0 +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS check-local +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: install-libLTLIBRARIES + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-exec-hook +install-exec: install-exec-am + +install-data-am: install-includeHEADERS install-data-local +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: uninstall-libLTLIBRARIES uninstall-includeHEADERS +uninstall: uninstall-am +all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(HEADERS) all-local +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir) + + +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-libLTLIBRARIES mostlyclean-compile \ + mostlyclean-libtool mostlyclean-checkPROGRAMS \ + mostlyclean-noinstPROGRAMS mostlyclean-tags \ + mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-libLTLIBRARIES clean-compile clean-libtool \ + clean-checkPROGRAMS clean-noinstPROGRAMS clean-tags \ + clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-libLTLIBRARIES distclean-compile \ + distclean-libtool distclean-checkPROGRAMS \ + distclean-noinstPROGRAMS distclean-tags \ + distclean-generic clean-am + -rm -f libtool + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-libLTLIBRARIES \ + maintainer-clean-compile maintainer-clean-libtool \ + maintainer-clean-checkPROGRAMS \ + maintainer-clean-noinstPROGRAMS maintainer-clean-tags \ + maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: mostlyclean-libLTLIBRARIES distclean-libLTLIBRARIES \ +clean-libLTLIBRARIES maintainer-clean-libLTLIBRARIES \ +uninstall-libLTLIBRARIES install-libLTLIBRARIES mostlyclean-compile \ +distclean-compile clean-compile maintainer-clean-compile \ +mostlyclean-libtool distclean-libtool clean-libtool \ +maintainer-clean-libtool mostlyclean-checkPROGRAMS \ +distclean-checkPROGRAMS clean-checkPROGRAMS \ +maintainer-clean-checkPROGRAMS mostlyclean-noinstPROGRAMS \ +distclean-noinstPROGRAMS clean-noinstPROGRAMS \ +maintainer-clean-noinstPROGRAMS uninstall-includeHEADERS \ +install-includeHEADERS tags mostlyclean-tags distclean-tags clean-tags \ +maintainer-clean-tags distdir check-TESTS info-am info dvi-am dvi \ +check-local check check-am installcheck-am installcheck install-exec-am \ +install-exec install-data-local install-data-am install-data install-am \ +install uninstall-am uninstall all-local all-redirect all-am all \ +installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +install-suid-programs: + @foo='$(bin_SUIDS)'; \ + for file in $$foo; do \ + x=$(DESTDIR)$(bindir)/$$file; \ + if chown 0:0 $$x && chmod u+s $$x; then :; else \ + chmod 0 $$x; fi; done + +install-exec-hook: install-suid-programs + +install-build-headers:: $(include_HEADERS) $(build_HEADERZ) + @foo='$(include_HEADERS) $(build_HEADERZ)'; \ + for f in $$foo; do \ + f=`basename $$f`; \ + if test -f "$(srcdir)/$$f"; then file="$(srcdir)/$$f"; \ + else file="$$f"; fi; \ + if cmp -s $$file $(buildinclude)/$$f 2> /dev/null ; then \ + : ; else \ + echo " $(CP) $$file $(buildinclude)/$$f"; \ + $(CP) $$file $(buildinclude)/$$f; \ + fi ; \ + done + +all-local: install-build-headers +#NROFF_MAN = nroff -man +.1.cat1: + $(NROFF_MAN) $< > $@ +.3.cat3: + $(NROFF_MAN) $< > $@ +.5.cat5: + $(NROFF_MAN) $< > $@ +.8.cat8: + $(NROFF_MAN) $< > $@ + +dist-cat1-mans: + @foo='$(man1_MANS)'; \ + bar='$(man_MANS)'; \ + for i in $$bar; do \ + case $$i in \ + *.1) foo="$$foo $$i";; \ + esac; done ;\ + for i in $$foo; do \ + x=`echo $$i | sed 's/\.[^.]*$$/.cat1/'`; \ + echo "$(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x"; \ + $(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x; \ + done + +dist-cat3-mans: + @foo='$(man3_MANS)'; \ + bar='$(man_MANS)'; \ + for i in $$bar; do \ + case $$i in \ + *.3) foo="$$foo $$i";; \ + esac; done ;\ + for i in $$foo; do \ + x=`echo $$i | sed 's/\.[^.]*$$/.cat3/'`; \ + echo "$(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x"; \ + $(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x; \ + done + +dist-cat5-mans: + @foo='$(man5_MANS)'; \ + bar='$(man_MANS)'; \ + for i in $$bar; do \ + case $$i in \ + *.5) foo="$$foo $$i";; \ + esac; done ;\ + for i in $$foo; do \ + x=`echo $$i | sed 's/\.[^.]*$$/.cat5/'`; \ + echo "$(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x"; \ + $(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x; \ + done + +dist-cat8-mans: + @foo='$(man8_MANS)'; \ + bar='$(man_MANS)'; \ + for i in $$bar; do \ + case $$i in \ + *.8) foo="$$foo $$i";; \ + esac; done ;\ + for i in $$foo; do \ + x=`echo $$i | sed 's/\.[^.]*$$/.cat8/'`; \ + echo "$(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x"; \ + $(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x; \ + done + +dist-hook: dist-cat1-mans dist-cat3-mans dist-cat5-mans dist-cat8-mans + +install-cat1-mans: + @ext=1;\ + foo='$(man1_MANS)'; \ + bar='$(man_MANS)'; \ + for i in $$bar; do \ + case $$i in \ + *.1) foo="$$foo $$i";; \ + esac; done; \ + if test "$$foo"; then \ + $(mkinstalldirs) $(DESTDIR)$(cat1dir); \ + for x in $$foo; do \ + f=`echo $$x | sed 's/\.[^.]*$$/.cat1/'`; \ + if test -f "$(srcdir)/$$f"; then \ + b=`echo $$x | sed 's!$(MANRX)!\1!'`; \ + echo "$(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)$(cat1dir)/$$b.$(CATSUFFIX)";\ + $(INSTALL_DATA) $(srcdir)/$$g $(DESTDIR)$(cat1dir)/$$b.$(CATSUFFIX);\ + fi; \ + done ;\ + fi + +install-cat3-mans: + @ext=3;\ + foo='$(man3_MANS)'; \ + bar='$(man_MANS)'; \ + for i in $$bar; do \ + case $$i in \ + *.3) foo="$$foo $$i";; \ + esac; done; \ + if test "$$foo"; then \ + $(mkinstalldirs) $(DESTDIR)$(cat3dir); \ + for x in $$foo; do \ + f=`echo $$x | sed 's/\.[^.]*$$/.cat3/'`; \ + if test -f "$(srcdir)/$$f"; then \ + b=`echo $$x | sed 's!$(MANRX)!\1!'`; \ + echo "$(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)$(cat3dir)/$$b.$(CATSUFFIX)";\ + $(INSTALL_DATA) $(srcdir)/$$g $(DESTDIR)$(cat3dir)/$$b.$(CATSUFFIX);\ + fi; \ + done ;\ + fi + +install-cat5-mans: + @ext=5;\ + foo='$(man5_MANS)'; \ + bar='$(man_MANS)'; \ + for i in $$bar; do \ + case $$i in \ + *.5) foo="$$foo $$i";; \ + esac; done; \ + if test "$$foo"; then \ + $(mkinstalldirs) $(DESTDIR)$(cat5dir); \ + for x in $$foo; do \ + f=`echo $$x | sed 's/\.[^.]*$$/.cat5/'`; \ + if test -f "$(srcdir)/$$f"; then \ + b=`echo $$x | sed 's!$(MANRX)!\1!'`; \ + echo "$(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)$(cat5dir)/$$b.$(CATSUFFIX)";\ + $(INSTALL_DATA) $(srcdir)/$$g $(DESTDIR)$(cat5dir)/$$b.$(CATSUFFIX);\ + fi; \ + done ;\ + fi + +install-cat8-mans: + @ext=8;\ + foo='$(man8_MANS)'; \ + bar='$(man_MANS)'; \ + for i in $$bar; do \ + case $$i in \ + *.8) foo="$$foo $$i";; \ + esac; done; \ + if test "$$foo"; then \ + $(mkinstalldirs) $(DESTDIR)$(cat8dir); \ + for x in $$foo; do \ + f=`echo $$x | sed 's/\.[^.]*$$/.cat8/'`; \ + if test -f "$(srcdir)/$$f"; then \ + b=`echo $$x | sed 's!$(MANRX)!\1!'`; \ + echo "$(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)$(cat8dir)/$$b.$(CATSUFFIX)";\ + $(INSTALL_DATA) $(srcdir)/$$g $(DESTDIR)$(cat8dir)/$$b.$(CATSUFFIX);\ + fi; \ + done ;\ + fi + +install-cat-mans: install-cat1-mans install-cat3-mans install-cat5-mans install-cat8-mans + +install-data-local: install-cat-mans + +.et.h: + $(COMPILE_ET) $< +.et.c: + $(COMPILE_ET) $< + +.x.c: + @cmp -s $< $@ 2> /dev/null || cp $< $@ + +check-local:: + @foo='$(CHECK_LOCAL)'; \ + if test "$$foo"; then \ + failed=0; all=0; \ + for i in $$foo; do \ + all=`expr $$all + 1`; \ + if ./$$i --version > /dev/null 2>&1; then \ + echo "PASS: $$i"; \ + else \ + echo "FAIL: $$i"; \ + failed=`expr $$failed + 1`; \ + fi; \ + done; \ + if test "$$failed" -eq 0; then \ + banner="All $$all tests passed"; \ + else \ + banner="$$failed of $$all tests failed"; \ + fi; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + echo "$$dashes"; \ + test "$$failed" -eq 0; \ + fi + +$(LTLIBOBJS) $(libroken_la_OBJECTS): roken.h + +roken.h: make-roken$(EXEEXT) + @./make-roken$(EXEEXT) > tmp.h ;\ if [ -f roken.h ] && cmp -s tmp.h roken.h ; then rm -f tmp.h ; \ else rm -f roken.h; mv tmp.h roken.h; fi -make-roken$(EXECSUFFIX): make-roken.o - $(LINK) $(CFLAGS) -o $@ make-roken.o - make-roken.c: roken.h.in roken.awk $(AWK) -f $(srcdir)/roken.awk $(srcdir)/roken.h.in > make-roken.c -print_version.o: print_version.h +print_version.lo: print_version.h -print_version.h: make-print-version$(EXECSUFFIX) - @./make-print-version$(EXECSUFFIX) print_version.h +print_version.h: make-print-version$(EXEEXT) + ./make-print-version$(EXEEXT) print_version.h -make-print-version$(EXECSUFFIX): make-print-version.o - $(LINK) $(CFLAGS) -o $@ make-print-version.o +make-print-version.o: $(top_builddir)/include/version.h -getaddrinfo-test$(EXECSUFFIX): getaddrinfo-test.o - $(LINK) $(CFLAGS) -o $@ getaddrinfo-test.o -L. -lroken - -install-roken-h: roken.h - @if [ -f ../../include/roken.h ] && cmp -s ../../include/roken.h roken.h ; \ - then :; else \ - echo " $(INSTALL) roken.h ../../include/roken.h"; \ - $(INSTALL) roken.h ../../include/roken.h; fi - -$(OBJECTS): ../../include/config.h roken.h - -.PHONY: all Wall install uninstall check clean mostlyclean distclean realclean install-roken-h +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/lib/roken/acconfig.h b/lib/roken/acconfig.h new file mode 100644 index 000000000..5fbe685ce --- /dev/null +++ b/lib/roken/acconfig.h @@ -0,0 +1,36 @@ +@BOTTOM@ + +#ifdef BROKEN_REALLOC +#define realloc(X, Y) isoc_realloc((X), (Y)) +#define isoc_realloc(X, Y) ((X) ? realloc((X), (Y)) : malloc(Y)) +#endif + +#ifdef VOID_RETSIGTYPE +#define SIGRETURN(x) return +#else +#define SIGRETURN(x) return (RETSIGTYPE)(x) +#endif + +#define RCSID(msg) \ +static /**/const char *const rcsid[] = { (const char *)rcsid, "\100(#)" msg } + +#undef PROTOTYPES + +/* Maximum values on all known systems */ +#define MaxHostNameLen (64+4) +#define MaxPathLen (1024+4) + +/* + * Define NDBM if you are using the 4.3 ndbm library (which is part of + * libc). If not defined, 4.2 dbm will be assumed. + */ +#if defined(HAVE_DBM_FIRSTKEY) +#define NDBM +#endif + +/* + * Defining this enables lots of useful (and used) extensions on + * glibc-based systems such as Linux + */ + +#define _GNU_SOURCE diff --git a/lib/roken/acinclude.m4 b/lib/roken/acinclude.m4 new file mode 100644 index 000000000..1d0197c5c --- /dev/null +++ b/lib/roken/acinclude.m4 @@ -0,0 +1,9 @@ +dnl $Id$ +dnl +dnl Only put things that for some reason can't live in the `cf' +dnl directory in this file. +dnl + +dnl $xId: misc.m4,v 1.1 1997/12/14 15:59:04 joda Exp $ +dnl +define(upcase,`echo $1 | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`)dnl diff --git a/lib/roken/configure.in b/lib/roken/configure.in new file mode 100644 index 000000000..e9b3bb324 --- /dev/null +++ b/lib/roken/configure.in @@ -0,0 +1,518 @@ +dnl Process this file with autoconf to produce a configure script. +AC_REVISION($Revision$) +AC_INIT(snprintf.c) +AM_CONFIG_HEADER(config.h) +AM_INIT_AUTOMAKE(roken,9) + +dnl options + +berkeley_db=db +AC_ARG_WITH(berkeley-db, +[ --without-berkeley-db if you don't want berkeley db],[ +if test "$withval" = no; then + berkeley_db="" +fi +]) + +dnl Checks for programs +AC_PROG_CC +AC_PROG_AWK +AC_CYGWIN +AC_OBJEXT +AC_EXEEXT +AM_PROG_LIBTOOL + +AC_MIPS_ABI +CC="$CC $abi" +libdir="$libdir$abilibdirext" + +dnl C characteristics + +AC_C___ATTRIBUTE__ +AC_C_INLINE +AC_C_CONST +AC_WFLAGS(-Wall -Wmissing-prototypes -Wpointer-arith -Wbad-function-cast -Wmissing-declarations -Wnested-externs) + +dnl C types + +AC_TYPE_SIZE_T +AC_CHECK_TYPE_EXTRA(ssize_t, int, [#include ]) +AC_TYPE_PID_T +AC_TYPE_UID_T +AC_HAVE_TYPE([long long]) + +AC_TYPE_SIGNAL +if test "$ac_cv_type_signal" = "void" ; then + AC_DEFINE(VOID_RETSIGTYPE, 1, [Define if signal handlers return void.]) +fi +AC_SUBST(VOID_RETSIGTYPE) + +dnl Checks for header files. +AC_HEADER_STDC +AC_HEADER_TIME + +if test "$berkeley_db"; then + AC_CHECK_HEADERS([ \ + db.h \ + db_185.h \ + ]) +fi + +AC_CHECK_HEADERS([\ + arpa/nameser.h \ + arpa/inet.h \ + config.h \ + crypt.h \ + dbm.h \ + db.h \ + errno.h \ + err.h \ + dirent.h \ + fcntl.h \ + fnmatch.h \ + grp.h \ + ndbm.h \ + netdb.h \ + netinet/in.h \ + netinet/in_systm.h \ + paths.h \ + pwd.h \ + resolv.h \ + rpcsvc/dbm.h \ + rpcsvc/ypclnt.h \ + shadow.h \ + sys/ioctl.h \ + sys/param.h \ + sys/proc.h \ + sys/resource.h \ + sys/socket.h \ + sys/stat.h \ + sys/sysctl.h \ + sys/time.h \ + sys/tty.h \ + sys/types.h \ + sys/uio.h \ + sys/utsname.h \ + sys/wait.h \ + syslog.h \ + termios.h \ + unistd.h \ + userconf.h \ + usersec.h \ + winsock.h \ +]) + +CHECK_NETINET_IP_AND_TCP + +AM_CONDITIONAL(have_err_h, test "$ac_cv_header_err_h" = yes) +AM_CONDITIONAL(have_fnmatch_h, test "$ac_cv_header_fnmatch_h" = yes) + +dnl Check for functions and libraries + +AC_KRB_IPV6 + +AC_FIND_FUNC(socket, socket) +AC_FIND_FUNC(gethostbyname, nsl) +AC_FIND_FUNC(syslog, syslog) +AC_FIND_FUNC(gethostbyname2, inet6 ip6) + +AC_FIND_FUNC(res_search, resolv, +[ +#include +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_ARPA_NAMESER_H +#include +#endif +#ifdef HAVE_RESOLV_H +#include +#endif +], +[0,0,0,0,0]) + +AC_FIND_FUNC(dn_expand, resolv, +[ +#include +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_ARPA_NAMESER_H +#include +#endif +#ifdef HAVE_RESOLV_H +#include +#endif +], +[0,0,0,0,0]) + +AC_BROKEN_SNPRINTF +AC_BROKEN_VSNPRINTF + +AC_BROKEN_GLOB +if test "$ac_cv_func_glob_working" != yes; then + LIBOBJS="$LIBOBJS glob.o" +fi +AM_CONDITIONAL(have_glob_h, test "$ac_cv_func_glob_working" = yes) + +dnl these should happen after tests for *snprintf + +AC_FIND_FUNC_NO_LIBS2(dbopen, $berkeley_db, [ +#include +#if defined(HAVE_DB_185_H) +#include +#elif defined(HAVE_DB_H) +#include +#endif +],[NULL, 0, 0, 0, NULL]) + +AC_FIND_FUNC_NO_LIBS(dbm_firstkey, $berkeley_db gdbm ndbm) + +DBLIB="$LIB_dbopen" +if test "$LIB_dbopen" != "$LIB_dbm_firstkey"; then + DBLIB="$DBLIB $LIB_dbm_firstkey" +fi +AC_SUBST(DBLIB)dnl + +AC_CHECK_FUNCS([ \ + asnprintf \ + asprintf \ + cgetent \ + vasnprintf \ + vasprintf \ +]) + +if test "$ac_cv_func_cgetent" = no; then + LIBOBJS="$LIBOBJS getcap.o" +fi + +AC_FUNC_GETLOGIN + +AC_FIND_IF_NOT_BROKEN(hstrerror, resolv, +[#ifdef HAVE_NETDB_H +#include +#endif], +17) +if test "$ac_cv_func_hstrerror" = yes; then +AC_NEED_PROTO([ +#ifdef HAVE_NETDB_H +#include +#endif], +hstrerror) +fi + +dnl sigh, wish this could be done in a loop +if test "$ac_cv_func_asprintf" = yes; then +AC_NEED_PROTO([ +#include +#include ], +asprintf)dnl +fi +if test "$ac_cv_func_vasprintf" = yes; then +AC_NEED_PROTO([ +#include +#include ], +vasprintf)dnl +fi +if test "$ac_cv_func_asnprintf" = yes; then +AC_NEED_PROTO([ +#include +#include ], +asnprintf)dnl +fi +if test "$ac_cv_func_vasnprintf" = yes; then +AC_NEED_PROTO([ +#include +#include ], +vasnprintf)dnl +fi + +AC_BROKEN([ \ + chown \ + copyhostent \ + daemon \ + err \ + errx \ + fchown \ + flock \ + fnmatch \ + freeaddrinfo \ + freehostent \ + gai_strerror \ + getaddrinfo \ + getdtablesize \ + getegid \ + geteuid \ + getgid \ + gethostname \ + getipnodebyaddr \ + getipnodebyname \ + getnameinfo \ + getopt \ + gettimeofday \ + getuid \ + getusershell \ + inet_aton \ + inet_ntop \ + inet_pton \ + initgroups \ + innetgr \ + iruserok \ + lstat \ + memmove \ + mkstemp \ + putenv \ + rcmd \ + readv \ + recvmsg \ + sendmsg \ + setegid \ + setenv \ + seteuid \ + strcasecmp \ + strdup \ + strerror \ + strftime \ + strlcat \ + strlcpy \ + strlwr \ + strncasecmp \ + strndup \ + strnlen \ + strptime \ + strsep \ + strtok_r \ + strupr \ + swab \ + unsetenv \ + verr \ + verrx \ + vsyslog \ + vwarn \ + vwarnx \ + warn \ + warnx \ + writev \ +]) + +AC_NEED_PROTO([#include ], setenv) +AC_NEED_PROTO([#include ], unsetenv) +AC_NEED_PROTO([#include ], gethostname) +AC_NEED_PROTO([#include ], mkstemp) +AC_NEED_PROTO([#include ], getusershell) + +AC_NEED_PROTO([ +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_ARPA_INET_H +#include +#endif], +inet_aton) + +AC_FIND_FUNC_NO_LIBS(crypt, crypt)dnl + +AC_CACHE_CHECK(if realloc if broken, ac_cv_func_realloc_broken, [ +ac_cv_func_realloc_broken=no +AC_TRY_RUN([ +#include +#include + +int main() +{ + return realloc(NULL, 17) == NULL; +} +],:, ac_cv_func_realloc_broken=yes, :) +]) +if test "$ac_cv_func_realloc_broken" = yes ; then + AC_DEFINE(BROKEN_REALLOC, 1, [Define if realloc(NULL) doesn't work.]) +fi + +dnl AC_KRB_FUNC_GETCWD_BROKEN + +dnl +dnl Checks for prototypes and declarations +dnl + +AC_PROTO_COMPAT([ +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_ARPA_INET_H +#include +#endif +#ifdef HAVE_NETDB_H +#include +#endif +], +gethostbyname, struct hostent *gethostbyname(const char *)) + +AC_PROTO_COMPAT([ +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_ARPA_INET_H +#include +#endif +#ifdef HAVE_NETDB_H +#include +#endif +], +gethostbyaddr, struct hostent *gethostbyaddr(const void *, size_t, int)) + +AC_PROTO_COMPAT([ +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_ARPA_INET_H +#include +#endif +#ifdef HAVE_NETDB_H +#include +#endif +], +getservbyname, struct servent *getservbyname(const char *, const char *)) + +AC_PROTO_COMPAT([ +#ifdef HAVE_SYSLOG_H +#include +#endif +], +openlog, void openlog(const char *, int, int)) + +AC_NEED_PROTO([ +#ifdef HAVE_CRYPT_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif +], +crypt) + +AC_NEED_PROTO([ +#include +], +strtok_r) + +AC_NEED_PROTO([ +#include +], +strsep) + +dnl variables + +AC_CHECK_VAR([#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_NETDB_H +#include +#endif], +h_errno) + +AC_CHECK_VAR([#ifdef HAVE_NETDB_H +#include +#endif], +h_errlist) + +AC_CHECK_VAR([#ifdef HAVE_NETDB_H +#include +#endif], +h_nerr) + +AC_CHECK_VAR([#ifdef HAVE_ERR_H +#include +#endif],[__progname]) + +AC_CHECK_DECLARATION([#include +#ifdef HAVE_UNISTD_H +#include +#endif], optarg) +AC_CHECK_DECLARATION([#include +#ifdef HAVE_UNISTD_H +#include +#endif], optind) +AC_CHECK_DECLARATION([#include +#ifdef HAVE_UNISTD_H +#include +#endif], opterr) +AC_CHECK_DECLARATION([#include +#ifdef HAVE_UNISTD_H +#include +#endif], optopt) + +AC_CHECK_DECLARATION([#include ], environ) + +dnl +dnl Check for fields in struct tm +dnl + +AC_HAVE_STRUCT_FIELD(struct tm, tm_gmtoff, [#include ]) +AC_HAVE_STRUCT_FIELD(struct tm, tm_zone, [#include ]) + +dnl +dnl or do we have a variable `timezone' ? +dnl + +AC_CHECK_VAR( +[#include ], +timezone) + +AC_HAVE_TYPE([sa_family_t],[#include ]) +AC_HAVE_TYPE([socklen_t],[#include ]) +AC_HAVE_TYPE([struct sockaddr], [#include ]) +AC_HAVE_TYPE([struct sockaddr_storage], [#include ]) +AC_HAVE_TYPE([struct addrinfo], [#include ]) + +dnl +dnl Check for struct winsize +dnl + +AC_KRB_STRUCT_WINSIZE + +dnl +dnl Check for struct spwd +dnl + +AC_KRB_STRUCT_SPWD + +dnl +dnl Check for sa_len in struct sockaddr +dnl + +AC_HAVE_STRUCT_FIELD(struct sockaddr, sa_len, [#include +#include ]) + +LTLIBOBJS=`echo "$LIBOBJS" | sed 's/\.o/\.lo/g'` +AC_SUBST(LTLIBOBJS) +AC_OUTPUT(Makefile) diff --git a/lib/roken/getaddrinfo-test.c b/lib/roken/getaddrinfo-test.c index bc90989a6..c5a30efcf 100644 --- a/lib/roken/getaddrinfo-test.c +++ b/lib/roken/getaddrinfo-test.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999 Kungliga Tekniska Högskolan + * Copyright (c) 1999 - 2000 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -122,7 +122,7 @@ main(int argc, char **argv) usage (0); if (version_flag) { - print_version (NULL); + fprintf (stderr, "%s from %s-%s)\n", __progname, PACKAGE, VERSION); return 0; } diff --git a/lib/roken/install-sh b/lib/roken/install-sh new file mode 100755 index 000000000..e9de23842 --- /dev/null +++ b/lib/roken/install-sh @@ -0,0 +1,251 @@ +#!/bin/sh +# +# install - install a program, script, or datafile +# This comes from X11R5 (mit/util/scripts/install.sh). +# +# Copyright 1991 by the Massachusetts Institute of Technology +# +# Permission to use, copy, modify, distribute, and sell this software and its +# documentation for any purpose is hereby granted without fee, provided that +# the above copyright notice appear in all copies and that both that +# copyright notice and this permission notice appear in supporting +# documentation, and that the name of M.I.T. not be used in advertising or +# publicity pertaining to distribution of the software without specific, +# written prior permission. M.I.T. makes no representations about the +# suitability of this software for any purpose. It is provided "as is" +# without express or implied warranty. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. It can only install one file at a time, a restriction +# shared with many OS's install programs. + + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" + + +# put in absolute paths if you don't have them in your path; or use env. vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" +mkdirprog="${MKDIRPROG-mkdir}" + +transformbasename="" +transform_arg="" +instcmd="$mvprog" +chmodcmd="$chmodprog 0755" +chowncmd="" +chgrpcmd="" +stripcmd="" +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src="" +dst="" +dir_arg="" + +while [ x"$1" != x ]; do + case $1 in + -c) instcmd="$cpprog" + shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + -s) stripcmd="$stripprog" + shift + continue;; + + -t=*) transformarg=`echo $1 | sed 's/-t=//'` + shift + continue;; + + -b=*) transformbasename=`echo $1 | sed 's/-b=//'` + shift + continue;; + + *) if [ x"$src" = x ] + then + src=$1 + else + # this colon is to work around a 386BSD /bin/sh bug + : + dst=$1 + fi + shift + continue;; + esac +done + +if [ x"$src" = x ] +then + echo "install: no input file specified" + exit 1 +else + true +fi + +if [ x"$dir_arg" != x ]; then + dst=$src + src="" + + if [ -d $dst ]; then + instcmd=: + chmodcmd="" + else + instcmd=mkdir + fi +else + +# Waiting for this to be detected by the "$instcmd $src $dsttmp" command +# might cause directories to be created, which would be especially bad +# if $src (and thus $dsttmp) contains '*'. + + if [ -f $src -o -d $src ] + then + true + else + echo "install: $src does not exist" + exit 1 + fi + + if [ x"$dst" = x ] + then + echo "install: no destination specified" + exit 1 + else + true + fi + +# If destination is a directory, append the input filename; if your system +# does not like double slashes in filenames, you may need to add some logic + + if [ -d $dst ] + then + dst="$dst"/`basename $src` + else + true + fi +fi + +## this sed command emulates the dirname command +dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` + +# Make sure that the destination directory exists. +# this part is taken from Noah Friedman's mkinstalldirs script + +# Skip lots of stat calls in the usual case. +if [ ! -d "$dstdir" ]; then +defaultIFS=' +' +IFS="${IFS-${defaultIFS}}" + +oIFS="${IFS}" +# Some sh's can't handle IFS=/ for some reason. +IFS='%' +set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` +IFS="${oIFS}" + +pathcomp='' + +while [ $# -ne 0 ] ; do + pathcomp="${pathcomp}${1}" + shift + + if [ ! -d "${pathcomp}" ] ; + then + $mkdirprog "${pathcomp}" + else + true + fi + + pathcomp="${pathcomp}/" +done +fi + +if [ x"$dir_arg" != x ] +then + $doit $instcmd $dst && + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi +else + +# If we're going to rename the final executable, determine the name now. + + if [ x"$transformarg" = x ] + then + dstfile=`basename $dst` + else + dstfile=`basename $dst $transformbasename | + sed $transformarg`$transformbasename + fi + +# don't allow the sed command to completely eliminate the filename + + if [ x"$dstfile" = x ] + then + dstfile=`basename $dst` + else + true + fi + +# Make a temp file name in the proper directory. + + dsttmp=$dstdir/#inst.$$# + +# Move or copy the file name to the temp name + + $doit $instcmd $src $dsttmp && + + trap "rm -f ${dsttmp}" 0 && + +# and set any options; do chmod last to preserve setuid bits + +# If any of these fail, we abort the whole thing. If we want to +# ignore errors from any of these, just make sure not to ignore +# errors from the above "$doit $instcmd $src $dsttmp" command. + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && + +# Now rename the file to the real destination. + + $doit $rmcmd -f $dstdir/$dstfile && + $doit $mvcmd $dsttmp $dstdir/$dstfile + +fi && + + +exit 0 diff --git a/lib/roken/missing b/lib/roken/missing new file mode 100755 index 000000000..7789652e8 --- /dev/null +++ b/lib/roken/missing @@ -0,0 +1,190 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. +# Copyright (C) 1996, 1997 Free Software Foundation, Inc. +# Franc,ois Pinard , 1996. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 +fi + +case "$1" in + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +error status if there is no known handling for PROGRAM. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + +Supported PROGRAM values: + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + yacc create \`y.tab.[ch]', if possible, from existing .[ch]" + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing - GNU libit 0.0" + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + + aclocal) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`acinclude.m4' or \`configure.in'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`configure.in'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`acconfig.h' or \`configure.in'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' configure.in` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case "$f" in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done + ;; + + bison|yacc) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + rm -f y.tab.c y.tab.h + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if [ ! -f y.tab.h ]; then + echo >y.tab.h + fi + if [ ! -f y.tab.c ]; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex|flex) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if [ ! -f lex.yy.c ]; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + makeinfo) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` + fi + touch $file + ;; + + *) + echo 1>&2 "\ +WARNING: \`$1' is needed, and you do not seem to have it handy on your + system. You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequirements for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; +esac + +exit 0 diff --git a/lib/roken/mkinstalldirs b/lib/roken/mkinstalldirs new file mode 100755 index 000000000..6b3b5fc5d --- /dev/null +++ b/lib/roken/mkinstalldirs @@ -0,0 +1,40 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy +# Author: Noah Friedman +# Created: 1993-05-16 +# Public domain + +# $Id$ + +errstatus=0 + +for file +do + set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` + shift + + pathcomp= + for d + do + pathcomp="$pathcomp$d" + case "$pathcomp" in + -* ) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + fi + fi + + pathcomp="$pathcomp/" + done +done + +exit $errstatus + +# mkinstalldirs ends here diff --git a/lib/roken/roken.awk b/lib/roken/roken.awk index 626fae590..7ccaee8bb 100644 --- a/lib/roken/roken.awk +++ b/lib/roken/roken.awk @@ -1,3 +1,5 @@ +# $Id$ + BEGIN { print "#include " print "#ifdef HAVE_CONFIG_H" @@ -13,6 +15,8 @@ BEGIN { print "puts(\"\");" } END { + print "puts(\"#define ROKEN_VERSION \" VERSION );" + print "puts(\"\");" print "puts(\"#endif /* __ROKEN_H__ */\");" print "exit(0);" print "}" diff --git a/lib/roken/roken.def b/lib/roken/roken.def deleted file mode 100644 index f9b0369dd..000000000 --- a/lib/roken/roken.def +++ /dev/null @@ -1,17 +0,0 @@ -LIBRARY roken BASE=0x68f0000 -EXPORTS - gettimeofday - strcasecmp - strtok_r - snprintf - asprintf - vsnprintf - base64_decode - base64_encode - roken_concat - roken_vconcat - roken_vmconcat - roken_mconcat - getuid - dns_free_data - dns_lookup diff --git a/lib/roken/roken.dsp b/lib/roken/roken.dsp deleted file mode 100644 index d84854e3d..000000000 --- a/lib/roken/roken.dsp +++ /dev/null @@ -1,156 +0,0 @@ -# Microsoft Developer Studio Project File - Name="roken" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=roken - Win32 Release -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "roken.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "roken.mak" CFG="roken - Win32 Release" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "roken - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "roken - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "roken - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir ".\Release" -# PROP BASE Intermediate_Dir ".\Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir ".\Release" -# PROP Intermediate_Dir ".\Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c -# ADD CPP /nologo /MT /GX /O2 /I "..\krb" /I "..\des" /I "..\..\include" /I "..\..\include\win32" /I "." /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "HAVE_CONFIG_H" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x68e7780" /subsystem:windows /dll /machine:I386 - -!ELSEIF "$(CFG)" == "roken - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir ".\Debug" -# PROP BASE Intermediate_Dir ".\Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir ".\Debug" -# PROP Intermediate_Dir ".\Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c -# ADD CPP /nologo /MDd /Gm /GX /Zi /Od /I "..\krb" /I "..\des" /I "..\..\include" /I "..\..\include\win32" /I "." /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "HAVE_CONFIG_H" /YX /FD /c -# ADD BASE MTL /nologo /D "_DEBUG" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /debug /machine:I386 /def:".\roken.def" -# SUBTRACT LINK32 /pdb:none - -!ENDIF - -# Begin Target - -# Name "roken - Win32 Release" -# Name "roken - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90" -# Begin Source File - -SOURCE=.\base64.c -# End Source File -# Begin Source File - -SOURCE=.\concat.c -# End Source File -# Begin Source File - -SOURCE=.\gettimeofday.c -# End Source File -# Begin Source File - -SOURCE=.\getuid.c -# End Source File -# Begin Source File - -SOURCE=.\resolve.c -# End Source File -# Begin Source File - -SOURCE=.\roken.def - -!IF "$(CFG)" == "roken - Win32 Release" - -!ELSEIF "$(CFG)" == "roken - Win32 Debug" - -# PROP Exclude_From_Build 1 - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\snprintf.c -# End Source File -# Begin Source File - -SOURCE=.\strcasecmp.c -# End Source File -# Begin Source File - -SOURCE=.\strtok_r.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd" -# Begin Source File - -SOURCE=.\resolve.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe" -# Begin Source File - -SOURCE=.\roken.rc -# End Source File -# End Group -# End Target -# End Project diff --git a/lib/roken/roken.mak b/lib/roken/roken.mak deleted file mode 100644 index da9a834e5..000000000 --- a/lib/roken/roken.mak +++ /dev/null @@ -1,316 +0,0 @@ -# Microsoft Developer Studio Generated NMAKE File, Based on roken.dsp -!IF "$(CFG)" == "" -CFG=roken - Win32 Release -!MESSAGE No configuration specified. Defaulting to roken - Win32 Release. -!ENDIF - -!IF "$(CFG)" != "roken - Win32 Release" && "$(CFG)" != "roken - Win32 Debug" -!MESSAGE Invalid configuration "$(CFG)" specified. -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "roken.mak" CFG="roken - Win32 Release" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "roken - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "roken - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE -!ERROR An invalid configuration is specified. -!ENDIF - -!IF "$(OS)" == "Windows_NT" -NULL= -!ELSE -NULL=nul -!ENDIF - -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "roken - Win32 Release" - -OUTDIR=.\Release -INTDIR=.\Release -# Begin Custom Macros -OutDir=.\.\Release -# End Custom Macros - -!IF "$(RECURSE)" == "0" - -ALL : "$(OUTDIR)\roken.dll" - -!ELSE - -ALL : "$(OUTDIR)\roken.dll" - -!ENDIF - -CLEAN : - -@erase "$(INTDIR)\base64.obj" - -@erase "$(INTDIR)\concat.obj" - -@erase "$(INTDIR)\gettimeofday.obj" - -@erase "$(INTDIR)\getuid.obj" - -@erase "$(INTDIR)\resolve.obj" - -@erase "$(INTDIR)\roken.res" - -@erase "$(INTDIR)\snprintf.obj" - -@erase "$(INTDIR)\strcasecmp.obj" - -@erase "$(INTDIR)\strtok_r.obj" - -@erase "$(INTDIR)\vc50.idb" - -@erase "$(OUTDIR)\roken.dll" - -@erase "$(OUTDIR)\roken.exp" - -@erase "$(OUTDIR)\roken.lib" - -"$(OUTDIR)" : - if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" - -CPP_PROJ=/nologo /MT /GX /O2 /I "..\krb" /I "..\des" /I "..\..\include" /I\ - "..\..\include\win32" /I "." /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D\ - "HAVE_CONFIG_H" /Fp"$(INTDIR)\roken.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\"\ - /FD /c -CPP_OBJS=.\Release/ -CPP_SBRS=. -MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 -RSC_PROJ=/l 0x409 /fo"$(INTDIR)\roken.res" /d "NDEBUG" -BSC32=bscmake.exe -BSC32_FLAGS=/nologo /o"$(OUTDIR)\roken.bsc" -BSC32_SBRS= \ - -LINK32=link.exe -LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\ - advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo\ - /base:"0x68e7780" /subsystem:windows /dll /incremental:no\ - /pdb:"$(OUTDIR)\roken.pdb" /machine:I386 /def:".\roken.def"\ - /out:"$(OUTDIR)\roken.dll" /implib:"$(OUTDIR)\roken.lib" -DEF_FILE= \ - ".\roken.def" -LINK32_OBJS= \ - "$(INTDIR)\base64.obj" \ - "$(INTDIR)\concat.obj" \ - "$(INTDIR)\gettimeofday.obj" \ - "$(INTDIR)\getuid.obj" \ - "$(INTDIR)\resolve.obj" \ - "$(INTDIR)\roken.res" \ - "$(INTDIR)\snprintf.obj" \ - "$(INTDIR)\strcasecmp.obj" \ - "$(INTDIR)\strtok_r.obj" - -"$(OUTDIR)\roken.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) - $(LINK32) @<< - $(LINK32_FLAGS) $(LINK32_OBJS) -<< - -!ELSEIF "$(CFG)" == "roken - Win32 Debug" - -OUTDIR=.\Debug -INTDIR=.\Debug -# Begin Custom Macros -OutDir=.\.\Debug -# End Custom Macros - -!IF "$(RECURSE)" == "0" - -ALL : "$(OUTDIR)\roken.dll" - -!ELSE - -ALL : "$(OUTDIR)\roken.dll" - -!ENDIF - -CLEAN : - -@erase "$(INTDIR)\base64.obj" - -@erase "$(INTDIR)\concat.obj" - -@erase "$(INTDIR)\gettimeofday.obj" - -@erase "$(INTDIR)\getuid.obj" - -@erase "$(INTDIR)\resolve.obj" - -@erase "$(INTDIR)\roken.res" - -@erase "$(INTDIR)\snprintf.obj" - -@erase "$(INTDIR)\strcasecmp.obj" - -@erase "$(INTDIR)\strtok_r.obj" - -@erase "$(INTDIR)\vc50.idb" - -@erase "$(INTDIR)\vc50.pdb" - -@erase "$(OUTDIR)\roken.dll" - -@erase "$(OUTDIR)\roken.exp" - -@erase "$(OUTDIR)\roken.ilk" - -@erase "$(OUTDIR)\roken.lib" - -@erase "$(OUTDIR)\roken.pdb" - -"$(OUTDIR)" : - if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" - -CPP_PROJ=/nologo /MDd /Gm /GX /Zi /Od /I "..\krb" /I "..\des" /I\ - "..\..\include" /I "..\..\include\win32" /I "." /D "_DEBUG" /D "WIN32" /D\ - "_WINDOWS" /D "HAVE_CONFIG_H" /Fp"$(INTDIR)\roken.pch" /YX /Fo"$(INTDIR)\\"\ - /Fd"$(INTDIR)\\" /FD /c -CPP_OBJS=.\Debug/ -CPP_SBRS=. -MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32 -RSC_PROJ=/l 0x409 /fo"$(INTDIR)\roken.res" /d "_DEBUG" -BSC32=bscmake.exe -BSC32_FLAGS=/nologo /o"$(OUTDIR)\roken.bsc" -BSC32_SBRS= \ - -LINK32=link.exe -LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\ - advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo\ - /subsystem:windows /dll /incremental:yes /pdb:"$(OUTDIR)\roken.pdb" /debug\ - /machine:I386 /def:".\roken.def" /out:"$(OUTDIR)\roken.dll"\ - /implib:"$(OUTDIR)\roken.lib" -LINK32_OBJS= \ - "$(INTDIR)\base64.obj" \ - "$(INTDIR)\concat.obj" \ - "$(INTDIR)\gettimeofday.obj" \ - "$(INTDIR)\getuid.obj" \ - "$(INTDIR)\resolve.obj" \ - "$(INTDIR)\roken.res" \ - "$(INTDIR)\snprintf.obj" \ - "$(INTDIR)\strcasecmp.obj" \ - "$(INTDIR)\strtok_r.obj" - -"$(OUTDIR)\roken.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) - $(LINK32) @<< - $(LINK32_FLAGS) $(LINK32_OBJS) -<< - -!ENDIF - -.c{$(CPP_OBJS)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cpp{$(CPP_OBJS)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cxx{$(CPP_OBJS)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.c{$(CPP_SBRS)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cpp{$(CPP_SBRS)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cxx{$(CPP_SBRS)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - - -!IF "$(CFG)" == "roken - Win32 Release" || "$(CFG)" == "roken - Win32 Debug" -SOURCE=.\base64.c -DEP_CPP_BASE6=\ - "..\..\include\win32\config.h"\ - ".\base64.h"\ - - -"$(INTDIR)\base64.obj" : $(SOURCE) $(DEP_CPP_BASE6) "$(INTDIR)" - - -SOURCE=.\concat.c -DEP_CPP_CONCA=\ - "..\..\include\win32\config.h"\ - "..\..\include\win32\roken.h"\ - ".\err.h"\ - ".\roken-common.h"\ - {$(INCLUDE)}"sys\stat.h"\ - {$(INCLUDE)}"sys\types.h"\ - - -"$(INTDIR)\concat.obj" : $(SOURCE) $(DEP_CPP_CONCA) "$(INTDIR)" - - -SOURCE=.\gettimeofday.c -DEP_CPP_GETTI=\ - "..\..\include\win32\config.h"\ - "..\..\include\win32\roken.h"\ - ".\err.h"\ - ".\roken-common.h"\ - {$(INCLUDE)}"sys\stat.h"\ - {$(INCLUDE)}"sys\types.h"\ - - -"$(INTDIR)\gettimeofday.obj" : $(SOURCE) $(DEP_CPP_GETTI) "$(INTDIR)" - - -SOURCE=.\getuid.c -DEP_CPP_GETUI=\ - "..\..\include\win32\config.h"\ - "..\..\include\win32\roken.h"\ - ".\err.h"\ - ".\roken-common.h"\ - {$(INCLUDE)}"sys\stat.h"\ - {$(INCLUDE)}"sys\types.h"\ - - -"$(INTDIR)\getuid.obj" : $(SOURCE) $(DEP_CPP_GETUI) "$(INTDIR)" - - -SOURCE=.\resolve.c -DEP_CPP_RESOL=\ - "..\..\include\win32\config.h"\ - "..\..\include\win32\roken.h"\ - ".\err.h"\ - ".\resolve.h"\ - ".\roken-common.h"\ - {$(INCLUDE)}"sys\stat.h"\ - {$(INCLUDE)}"sys\types.h"\ - - -"$(INTDIR)\resolve.obj" : $(SOURCE) $(DEP_CPP_RESOL) "$(INTDIR)" - - -SOURCE=.\snprintf.c -DEP_CPP_SNPRI=\ - "..\..\include\win32\config.h"\ - "..\..\include\win32\roken.h"\ - ".\err.h"\ - ".\roken-common.h"\ - {$(INCLUDE)}"sys\stat.h"\ - {$(INCLUDE)}"sys\types.h"\ - - -"$(INTDIR)\snprintf.obj" : $(SOURCE) $(DEP_CPP_SNPRI) "$(INTDIR)" - - -SOURCE=.\strcasecmp.c -DEP_CPP_STRCA=\ - "..\..\include\win32\config.h"\ - {$(INCLUDE)}"sys\types.h"\ - - -"$(INTDIR)\strcasecmp.obj" : $(SOURCE) $(DEP_CPP_STRCA) "$(INTDIR)" - - -SOURCE=.\strtok_r.c -DEP_CPP_STRTO=\ - "..\..\include\win32\config.h"\ - "..\..\include\win32\roken.h"\ - ".\err.h"\ - ".\roken-common.h"\ - {$(INCLUDE)}"sys\stat.h"\ - {$(INCLUDE)}"sys\types.h"\ - - -"$(INTDIR)\strtok_r.obj" : $(SOURCE) $(DEP_CPP_STRTO) "$(INTDIR)" - - -SOURCE=.\roken.rc - -"$(INTDIR)\roken.res" : $(SOURCE) "$(INTDIR)" - $(RSC) $(RSC_PROJ) $(SOURCE) - - - -!ENDIF - diff --git a/lib/roken/roken.rc b/lib/roken/roken.rc deleted file mode 100644 index e7e2f3e49..000000000 --- a/lib/roken/roken.rc +++ /dev/null @@ -1,105 +0,0 @@ -//Microsoft Developer Studio generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// Swedish resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_SVE) -#ifdef _WIN32 -LANGUAGE LANG_SWEDISH, SUBLANG_DEFAULT -#pragma code_page(1252) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include ""afxres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -#ifndef _MAC -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,1 - PRODUCTVERSION 1,0,0,1 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x40004L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "CompanyName", "Royal Institute of Technology (KTH)\0" - VALUE "FileDescription", "roken\0" - VALUE "FileVersion", "4, 0, 9, 9\0" - VALUE "InternalName", "roken\0" - VALUE "LegalCopyright", "Copyright © 1996 - 1998 Royal Institute of Technology (KTH)\0" - VALUE "OriginalFilename", "roken.dll\0" - VALUE "ProductName", "KTH Kerberos\0" - VALUE "ProductVersion", "4,0,9,9\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - -#endif // !_MAC - -#endif // Swedish resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/lib/roken/snprintf.c b/lib/roken/snprintf.c index 4a60b4620..f81da79ce 100644 --- a/lib/roken/snprintf.c +++ b/lib/roken/snprintf.c @@ -43,11 +43,11 @@ RCSID("$Id$"); #include enum format_flags { - minus_flag = 1, - plus_flag = 2, - space_flag = 4, - alternate_flag = 8, - zero_flag = 16 + minus_flag = 0x01, + plus_flag = 0x02, + space_flag = 0x04, + alternate_flag = 0x08, + zero_flag = 0x10 }; /* @@ -118,13 +118,20 @@ as_append_char (struct state *state, unsigned char c) } } +#ifdef HAVE_LONG_LONG +typedef unsigned long long ulong_type; +#else +typedef unsigned long ulong_type; +#endif + static int append_number(struct state *state, - unsigned long num, unsigned base, char *rep, + ulong_type num, unsigned base, char *rep, int width, int prec, int flags, int minusp) { int len = 0; int i; + ulong_type orig_num = num; /* given precision, ignore zero flag */ if(prec != -1) @@ -148,7 +155,7 @@ append_number(struct state *state, len++; } /* add length of alternate prefix (added later) to len */ - if(flags & alternate_flag && (base == 16 || base == 8)) + if(orig_num && (flags & alternate_flag) && (base == 16 || base == 8)) len += base / 8; /* pad with zeros */ if(flags & zero_flag){ @@ -162,10 +169,11 @@ append_number(struct state *state, } } /* add alternate prefix */ - if(flags & alternate_flag && (base == 16 || base == 8)){ - if(base == 16) + if(orig_num && (flags & alternate_flag) && (base == 16 || base == 8)){ + if(base == 16) { if((*state->append_char)(state, rep[10] + 23)) /* XXX */ return 1; + } if((*state->append_char)(state, '0')) return 1; } @@ -207,6 +215,187 @@ append_number(struct state *state, return 0; } +#if !defined(NO_SNPRINTF_FLOAT) && 0 + +#include + +/* + * alternate -> always decimal point + * [Gg] -> don't remove trailing zeros + * zero/negative/space/plus + */ + +static int +append_double (struct state *state, double num, int c, + int width, int prec, int flags) +{ + int i; + int len = 0; + int n; + int sign = 1; + double l; + int trail_zero = 1; + int dec_point = 0; + + if (num < 0) { + sign = -1; + num = -num; + } + if (prec == -1) + prec = 6; + if (prec == 0 && tolower(c) == 'g') + prec = 1; + + if (flags & alternate_flag) + dec_point = 1; + + if (tolower(c) == 'g' || tolower(c) == 'e') { + l = log10 (num); + if (tolower (c) == 'g') { + if (l < -4.0 || l >= prec) { + c -= 'G' - 'E'; + --prec; + } else { + c = 'f'; + n = num / pow (10, (int)l); + do { + --prec; + n /= 10; + } while (n > 0); + } + if (!(flags & alternate_flag)) + trail_zero = 0; +/* prec -= log10 (num + 1); */ + } + } + + if (tolower(c) == 'e') { + int sign_n = 1; + double d; + + n = l; + num = ((num * pow (10, n)) + 0.5) / pow (10, n); + l = log10 (num); + n = l; + num /= pow (10, n); + if (num >= 10) + abort (); + if (n < 0) { + n = -n; + sign_n = 1; + } + + do { + int digit = (int)(d + 0.5) % 10; + + if ((*state->append_char)(state, "012345678"[digit])) + return 1; + ++len; + d /= 10; + } while (d > 0); + if (len == 1) { + if ((*state->append_char)(state, '0')) + return 1; + ++len; + } + + if (sign_n < 0) { + if ((*state->append_char)(state, '-')) + return 1; + } else { + if ((*state->append_char)(state, '+')) + return 1; + } + ++len; + if ((*state->append_char)(state, c)) + return 1; + ++len; + } + + + if (prec) { + double int_part, frac_part; + + frac_part = modf (num, &int_part); + n = frac_part * pow (10, prec) + 0.5; + for (i = 0; i < prec; ++i) { + int digit = n % 10; + + if (digit > 0 || trail_zero) { + if ((*state->append_char)(state, "0123456789"[digit])) + return 1; + ++len; + trail_zero = 1; + dec_point = 1; + } + n /= 10; + } + n = int_part; + } else + n = num + 0.5; + + if (dec_point) { + if ((*state->append_char)(state, '.')) + return 1; + ++len; + } + + do { + if ((*state->append_char)(state, "0123456789"[n % 10])) + return 1; + ++len; + n /= 10; + } while (n > 0); + + if (flags & zero_flag) { + width -= len; + if (sign < 0 || (flags & space_flag) || (flags & plus_flag)) + width--; + while (width-- > 0) { + if((*state->append_char)(state, '0')) + return 1; + len++; + } + } + if(sign < 0){ + if((*state->append_char)(state, '-')) + return 1; + len++; + } else if(flags & plus_flag) { + if((*state->append_char)(state, '+')) + return 1; + len++; + } else if(flags & space_flag) { + if((*state->append_char)(state, ' ')) + return 1; + len++; + } + if(flags & minus_flag) + /* swap before padding with spaces */ + for(i = 0; i < len / 2; i++){ + char c = state->s[-i-1]; + state->s[-i-1] = state->s[-len+i]; + state->s[-len+i] = c; + } + width -= len; + while(width-- > 0){ + if((*state->append_char)(state, ' ')) + return 1; + len++; + } + if(!(flags & minus_flag)) + /* swap after padding with spaces */ + for(i = 0; i < len / 2; i++){ + char c = state->s[-i-1]; + state->s[-i-1] = state->s[-len+i]; + state->s[-len+i] = c; + } + + return 0; +} + +#endif /* WANT_SNPRINTF_FLOAT */ + static int append_string (struct state *state, unsigned char *arg, @@ -261,14 +450,26 @@ append_char(struct state *state, * This can't be made into a function... */ -#define PARSE_INT_FORMAT(res, arg, unsig) \ -if (long_flag) \ - res = (unsig long)va_arg(arg, unsig long); \ -else if (short_flag) \ - res = (unsig short)va_arg(arg, unsig int); \ -else \ +#define PARSE_INT_FORMAT_VANILLA(res, arg, unsig) \ +if (long_arg == 1) \ + res = (unsig long)va_arg(arg, unsig long); \ +else if (short_flag) \ + res = (unsig short)va_arg(arg, unsig int); \ +else \ res = (unsig int)va_arg(arg, unsig int) +#ifdef HAVE_LONG_LONG +#define PARSE_INT_FORMAT(res, arg, unsig) \ +if (long_arg == 2) \ + res = (unsig long long)va_arg(arg, unsig long long); \ +else PARSE_INT_FORMAT_VANILLA(res, arg, unsig) + +#else /* !HAVE_LONG_LONG */ +#define PARSE_INT_FORMAT(res, arg, unsig) \ +PARSE_INT_FORMAT_VANILLA(res, arg, unsig) + +#endif /* HAVE_LONG_LONG */ + /* * zyxprintf - return 0 or -1 */ @@ -284,7 +485,7 @@ xyzprintf (struct state *state, const char *char_format, va_list ap) int flags = 0; int width = 0; int prec = -1; - int long_flag = 0; + int long_arg = 0; int short_flag = 0; /* flags */ @@ -341,7 +542,7 @@ xyzprintf (struct state *state, const char *char_format, va_list ap) short_flag = 1; c = *format++; } else if (c == 'l') { - long_flag = 1; + ++long_arg; c = *format++; } @@ -425,6 +626,17 @@ xyzprintf (struct state *state, const char *char_format, va_list ap) return -1; break; } +#if !defined(NO_SNPRINTF_FLOAT) && 0 + case 'e' : + case 'E' : + case 'f' : + case 'g' : + case 'G' : + if (append_double (state, va_arg(ap, double), c, + width, prec, flags)) + return -1; + break; +#endif case 'n' : { int *arg = va_arg(ap, int*); *arg = state->s - state->str; diff --git a/lib/roken/socket.c b/lib/roken/socket.c index fc552c4eb..4d237d678 100644 --- a/lib/roken/socket.c +++ b/lib/roken/socket.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999 Kungliga Tekniska Högskolan + * Copyright (c) 1999 - 2000 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -246,9 +246,9 @@ socket_set_port (struct sockaddr *sa, int port) void socket_set_debug (int sock) { +#if defined(SO_DEBUG) && defined(HAVE_SETSOCKOPT) int on = 1; -#if defined(SO_DEBUG) && defined(HAVE_SETSOCKOPT) if (setsockopt (sock, SOL_SOCKET, SO_DEBUG, (void *) &on, sizeof (on)) < 0) warn ("setsockopt SO_DEBUG (ignored)"); #endif diff --git a/lib/roken/strftime.c b/lib/roken/strftime.c index 87fb4228b..ffb2fc276 100644 --- a/lib/roken/strftime.c +++ b/lib/roken/strftime.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999 Kungliga Tekniska Högskolan + * Copyright (c) 1999 - 2000 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. *