diff options
76 files changed, 10010 insertions, 4498 deletions
diff --git a/doc/CHANGES b/doc/CHANGES index 17876e4df47..cc1972c5cbe 100644 --- a/doc/CHANGES +++ b/doc/CHANGES @@ -1,4 +1,4 @@ -$NetBSD: CHANGES,v 1.3189 2003/09/01 16:02:22 wiz Exp $ +$NetBSD: CHANGES,v 1.3190 2003/09/01 16:27:07 jlam Exp $ Changes to the packages collection and infrastructure in 2003: @@ -3447,3 +3447,4 @@ Changes to the packages collection and infrastructure in 2003: Updated apel to 10.6 [minoura 2003-09-01] Updated libnbcompat to 20020823 [jlam 2003-09-01] Updated grhino to 0.8.3 [wiz 2003-09-01] + Updated pkg_install to 20020823 [jlam 2003-09-01] diff --git a/pkgtools/pkg_install/Makefile b/pkgtools/pkg_install/Makefile index a315ed7b584..efc2c64f6a9 100644 --- a/pkgtools/pkg_install/Makefile +++ b/pkgtools/pkg_install/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.77 2003/08/31 11:55:09 jlam Exp $ +# $NetBSD: Makefile,v 1.78 2003/09/01 16:27:09 jlam Exp $ # Notes to package maintainers: # @@ -33,8 +33,10 @@ PKG_PRESERVE= # defined VERSION!= ${AWK} -F '"' '/PKGTOOLS_VERSION/ {print $$2}' \ ${FILESDIR}/lib/version.h +CPPFLAGS+= ${BUILDLINK_CPPFLAGS.libnbcompat} + PKG_DBDIR?= /var/db/pkg -PKG_ADMIN= ${SETENV} PKG_DBDIR=${PKG_DBDIR} ${PKG_ADMIN_CMD} +PKG_INFO= PKG_DBDIR=${PKG_DBDIR} ${PKG_INFO_CMD} .if ${OPSYS} == "NetBSD" && !exists(/usr/share/tmac/tmac.andoc) PKG_FAIL_REASON+= "You need to have the 'text' set installed to build this package!" @@ -51,6 +53,7 @@ post-install: ${PKG_ADMIN} rebuild; \ fi +.include "../../pkgtools/libnbcompat/buildlink2.mk" .include "../../mk/bsd.pkg.mk" PREFIX:= ${PKG_TOOLS_BIN:C|/[^/]?bin$||} diff --git a/pkgtools/pkg_install/PLIST b/pkgtools/pkg_install/PLIST index 14fe4f2606f..b15b6e87525 100644 --- a/pkgtools/pkg_install/PLIST +++ b/pkgtools/pkg_install/PLIST @@ -1,17 +1,23 @@ -@comment $NetBSD: PLIST,v 1.3 2003/07/31 09:51:00 grant Exp $ +@comment $NetBSD: PLIST,v 1.4 2003/09/01 16:27:09 jlam Exp $ +sbin/linkfarm sbin/pkg_add sbin/pkg_admin sbin/pkg_create sbin/pkg_delete sbin/pkg_info +sbin/pkg_view +share/man/cat1/linkfarm.0 share/man/cat1/pkg_add.0 share/man/cat1/pkg_admin.0 share/man/cat1/pkg_create.0 share/man/cat1/pkg_delete.0 share/man/cat1/pkg_info.0 +share/man/cat1/pkg_view.0 +share/man/man1/linkfarm.1 share/man/man1/pkg_add.1 share/man/man1/pkg_admin.1 share/man/man1/pkg_create.1 share/man/man1/pkg_delete.1 share/man/man1/pkg_info.1 +share/man/man1/pkg_view.1 @exec [ -f ${PKG_DBDIR:-/var/db/pkg}/pkgdb.byfile.db ] || pkg_admin rebuild diff --git a/pkgtools/pkg_install/files/Makefile.in b/pkgtools/pkg_install/files/Makefile.in index 9aa6d5409b3..2f44c0bf3b9 100644 --- a/pkgtools/pkg_install/files/Makefile.in +++ b/pkgtools/pkg_install/files/Makefile.in @@ -1,39 +1,15 @@ -# $NetBSD: Makefile.in,v 1.1.1.1 2002/12/20 18:13:52 schmonz Exp $ -# Original from FreeBSD, no rcs id. +# $NetBSD: Makefile.in,v 1.2 2003/09/01 16:27:09 jlam Exp $ -all: libdir adddir admindir createdir deletedir infodir +SUBDIRS= lib add admin create delete info view -libdir: - cd lib && ${MAKE} -adddir: - cd add && ${MAKE} -admindir: - cd admin && ${MAKE} -createdir: - cd create && ${MAKE} -deletedir: - cd delete && ${MAKE} -infodir: - cd info && ${MAKE} +.PHONY: all install clean distclean -install: all - @MKDIR@ -p @prefix@/sbin - cd add && ${MAKE} install - cd admin && ${MAKE} install - cd create && ${MAKE} install - cd delete && ${MAKE} install - cd info && ${MAKE} install - -clean: - cd lib && ${MAKE} clean - cd add && ${MAKE} clean - cd admin && ${MAKE} clean - cd create && ${MAKE} clean - cd delete && ${MAKE} clean - cd info && ${MAKE} clean +all install clean: + @for dir in $(SUBDIRS); do \ + ( cd $$dir && $(MAKE) $@ ); \ + done distclean: clean - rm -f config.log config.status config.cache + rm -f config.log config.status config.lineno rm -f Makefile */Makefile - rm -f lib/lib.h lib/config.h - + rm -f lib/config.h diff --git a/pkgtools/pkg_install/files/README b/pkgtools/pkg_install/files/README index d9690897850..c8f73bdb58e 100644 --- a/pkgtools/pkg_install/files/README +++ b/pkgtools/pkg_install/files/README @@ -1,4 +1,4 @@ -# $NetBSD: README,v 1.1.1.1 2002/12/20 18:13:52 schmonz Exp $ +# $NetBSD: README,v 1.2 2003/09/01 16:27:09 jlam Exp $ # Original from FreeBSD, no rcs id. This is the pkg_install suite of tools for doing maintainance of @@ -11,8 +11,8 @@ FreeBSD again by Jordan, who then proceeded to add another couple of dozen features on top. Whee! :-) In another round of enhancements, NetBSD changes were added by -Alistair Crooks and Hubert Feyrer, Thorsten Frueauf and Christian E. -Hopps. +Alistair Crooks, Hubert Feyrer, Thorsten Frueauf, Christian E. Hopps, +and Johnny Lam. When making snapshots, please modify PKGTOOLS_VERSION in lib/version.h to that day's date. diff --git a/pkgtools/pkg_install/files/TODO b/pkgtools/pkg_install/files/TODO deleted file mode 100644 index 9234464024a..00000000000 --- a/pkgtools/pkg_install/files/TODO +++ /dev/null @@ -1,16 +0,0 @@ -To Do -===== -add man page installation - -Done -==== -Do correct GNU Makefile-ish things -make a real mkdtemp thing -get rid of BINDIR -get rid of TAR_CMD -REMOVE_CMD -> RM -RMDIR_CMD -> RMDIR -use MKDIR for mkdir -p uses via vsystem. Use mkdir(2) for all other uses. -add digest files if MD5File not in -lc or -lmd -try it on Darwin -use full pathnames for utilities which are executed by vsystem() diff --git a/pkgtools/pkg_install/files/add/Makefile.in b/pkgtools/pkg_install/files/add/Makefile.in index d2c84f18119..f2ea05483f7 100644 --- a/pkgtools/pkg_install/files/add/Makefile.in +++ b/pkgtools/pkg_install/files/add/Makefile.in @@ -1,42 +1,47 @@ -# $NetBSD: Makefile.in,v 1.5 2003/07/31 09:51:01 grant Exp $ -# Original from FreeBSD, no rcs id. +# $NetBSD: Makefile.in,v 1.6 2003/09/01 16:27:11 jlam Exp $ -prefix= @prefix@ -INSTALL= @INSTALL@ +srcdir= @srcdir@ +prefix= @prefix@ +exec_prefix= @exec_prefix@ +sbindir= @sbindir@ mandir= @mandir@ -mandirman1= ${mandir}/man1 -mandircat1= ${mandir}/cat1 + +man1dir= $(mandir)/man1 +cat1dir= $(mandir)/cat1 CC= @CC@ CCLD= $(CC) LIBS= -linstall @LIBS@ -CPPFLAGS= @CPPFLAGS@ -DEFS= @DEFS@ -I. -I@srcdir@ -I../lib +CPPFLAGS= $(DEFS) @CPPFLAGS@ -I. -I$(srcdir) -I../lib +DEFS= @DEFS@ -DBINDIR=\"$(sbindir)\" CFLAGS= @CFLAGS@ LDFLAGS= @LDFLAGS@ -L../lib -LINK= $(CCLD) $(CFLAGS) $(LDFLAGS) -o $@ -COMPILE= $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) +INSTALL= @INSTALL@ PROG= pkg_add -SRCS= main.c perform.c futil.c extract.c verify.c -OBJS= main.o perform.o futil.o extract.o verify.o - -all: ${PROG} +SRCS= main.c perform.c futil.c extract.c verify.c +OBJS= $(SRCS:.c=.o) -${PROG}: ${OBJS} - ${LINK} ${OBJS} ${LIBS} +.PHONY: all clean install .c.o: - $(COMPILE) -c $< -o $@ + $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) -c $< + +all: $(PROG) + +$(PROG): $(OBJS) + $(CCLD) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) clean: - rm -f ${OBJS} ${PROG} + rm -f $(OBJS) $(PROG) install: - ${INSTALL} ${PROG} ${prefix}/sbin - ${INSTALL} -m 755 -d ${mandircat1} - ${INSTALL} -m 444 ${PROG}.1 ${mandirman1}/${PROG}.1 - ${INSTALL} -m 444 ${PROG}.cat1 ${mandircat1}/${PROG}.0 + $(INSTALL) -m 755 -d $(sbindir) + $(INSTALL) -m 755 -d $(man1dir) + $(INSTALL) -m 755 -d $(cat1dir) + $(INSTALL) $(PROG) $(sbindir) + $(INSTALL) -m 444 $(PROG).1 $(man1dir)/$(PROG).1 + $(INSTALL) -m 444 $(PROG).cat1 $(man1dir)/$(PROG).0 diff --git a/pkgtools/pkg_install/files/add/add.h b/pkgtools/pkg_install/files/add/add.h index 6452a2a7e9c..24826f8cd1c 100644 --- a/pkgtools/pkg_install/files/add/add.h +++ b/pkgtools/pkg_install/files/add/add.h @@ -1,4 +1,4 @@ -/* $NetBSD: add.h,v 1.1.1.1 2002/12/20 18:13:54 schmonz Exp $ */ +/* $NetBSD: add.h,v 1.2 2003/09/01 16:27:11 jlam Exp $ */ /* from FreeBSD Id: add.h,v 1.8 1997/02/22 16:09:15 peter Exp */ @@ -30,6 +30,9 @@ typedef enum { } add_mode_t; extern char *Prefix; +extern char *View; +extern char *Viewbase; +extern Boolean NoView; extern Boolean NoInstall; extern Boolean NoRecord; extern Boolean Force; diff --git a/pkgtools/pkg_install/files/add/extract.c b/pkgtools/pkg_install/files/add/extract.c index 2f64eb44ff1..9ce0089c288 100644 --- a/pkgtools/pkg_install/files/add/extract.c +++ b/pkgtools/pkg_install/files/add/extract.c @@ -1,13 +1,17 @@ -/* $NetBSD: extract.c,v 1.3 2003/02/11 16:42:06 grant Exp $ */ +/* $NetBSD: extract.c,v 1.4 2003/09/01 16:27:11 jlam Exp $ */ -#if 0 +#include <nbcompat.h> +#if HAVE_CONFIG_H +#include "config.h" +#endif +#if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> +#endif #ifndef lint #if 0 static const char *rcsid = "FreeBSD - Id: extract.c,v 1.17 1997/10/08 07:45:35 charnier Exp"; #else -__RCSID("$NetBSD: extract.c,v 1.3 2003/02/11 16:42:06 grant Exp $"); -#endif +__RCSID("$NetBSD: extract.c,v 1.4 2003/09/01 16:27:11 jlam Exp $"); #endif #endif @@ -30,19 +34,15 @@ __RCSID("$NetBSD: extract.c,v 1.3 2003/02/11 16:42:06 grant Exp $"); * This is the package extraction code for the add module. * */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#ifdef HAVE_ERR_H +#if HAVE_ERR_H #include <err.h> #endif - #include "lib.h" #include "add.h" #define TAR_ARGS " cf - " -#define TARX_CMD "|" TAR_FULLPATHNAME " xpf - -C " +#define TARX_CMD "|" TAR_CMD " xpf - -C " /* * This macro is used to determine if the 'where_args' buffer is big enough to add the @@ -58,16 +58,16 @@ __RCSID("$NetBSD: extract.c,v 1.3 2003/02/11 16:42:06 grant Exp $"); || (strlen(str) + 3 + perm_count >= maxargs)) #define PUSHOUT(todir) /* push out string */ \ - if (where_count > sizeof(TAR_FULLPATHNAME) + sizeof(TAR_ARGS)-1) { \ - strcat(where_args, TARX_CMD); \ - strcat(where_args, todir); \ + if (where_count > sizeof(TAR_CMD) + sizeof(TAR_ARGS)-1) { \ + strlcat(where_args, TARX_CMD, maxargs); \ + strlcat(where_args, todir, maxargs); \ if (system(where_args)) { \ cleanup(0); \ errx(2, "can not invoke %lu byte %s pipeline: %s", \ - (u_long)strlen(where_args), TAR_FULLPATHNAME, \ + (u_long)strlen(where_args), TAR_CMD, \ where_args); \ } \ - strcpy(where_args, TAR_FULLPATHNAME TAR_ARGS); \ + strlcpy(where_args, TAR_CMD TAR_ARGS, maxargs); \ where_count = strlen(where_args); \ } \ if (perm_count) { \ @@ -88,9 +88,7 @@ rollback(char *name, char *home, plist_t *start, plist_t *stop) if (q->type == PLIST_FILE) { (void) snprintf(try, sizeof(try), "%s/%s", dir, q->name); if (make_preserve_name(bup, sizeof(bup), name, try) && fexists(bup)) { -#ifdef HAVE_CHFLAGS (void) chflags(try, 0); -#endif (void) unlink(try); if (rename(bup, try)) warnx("rollback: unable to rename %s back to %s", bup, try); @@ -128,7 +126,7 @@ extract_plist(char *home, package_t *pkg) cleanup(0); errx(2, "can't get argument list space"); } - strcpy(where_args, TAR_FULLPATHNAME TAR_ARGS); + strlcpy(where_args, TAR_CMD TAR_ARGS, maxargs); /* * we keep track of how many characters are stored in 'where_args' with 'where_count'. * Note this doesn't include the trailing null character. @@ -183,9 +181,7 @@ extract_plist(char *home, package_t *pkg) /* first try to rename it into place */ (void) snprintf(try, sizeof(try), "%s/%s", Directory, p->name); if (fexists(try)) { -#ifdef HAVE_CHFLAGS (void) chflags(try, 0); /* XXX hack - if truly immutable, rename fails */ -#endif if (preserve && PkgName) { char pf[FILENAME_MAX]; diff --git a/pkgtools/pkg_install/files/add/futil.c b/pkgtools/pkg_install/files/add/futil.c index 2cbbfee9603..9e15585bca3 100644 --- a/pkgtools/pkg_install/files/add/futil.c +++ b/pkgtools/pkg_install/files/add/futil.c @@ -1,13 +1,17 @@ -/* $NetBSD: futil.c,v 1.1.1.1 2002/12/20 18:13:55 schmonz Exp $ */ +/* $NetBSD: futil.c,v 1.2 2003/09/01 16:27:11 jlam Exp $ */ -#if 0 +#include <nbcompat.h> +#if HAVE_CONFIG_H +#include "config.h" +#endif +#if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> +#endif #ifndef lint #if 0 static const char *rcsid = "from FreeBSD Id: futil.c,v 1.7 1997/10/08 07:45:39 charnier Exp"; #else -__RCSID("$NetBSD: futil.c,v 1.1.1.1 2002/12/20 18:13:55 schmonz Exp $"); -#endif +__RCSID("$NetBSD: futil.c,v 1.2 2003/09/01 16:27:11 jlam Exp $"); #endif #endif @@ -30,14 +34,10 @@ __RCSID("$NetBSD: futil.c,v 1.1.1.1 2002/12/20 18:13:55 schmonz Exp $"); * Miscellaneous file access utilities. * */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#ifdef HAVE_ERR_H +#if HAVE_ERR_H #include <err.h> #endif - #include "lib.h" #include "add.h" @@ -61,9 +61,8 @@ make_hierarchy(char *dir) if (!(isdir(dir) || islinktodir(dir))) return FAIL; } else { - if (mkdir(dir, 0755) < 0) { + if (fexec("mkdir", dir, NULL)) return FAIL; - } apply_perms(NULL, dir); } /* Put it back */ @@ -89,19 +88,25 @@ apply_perms(char *dir, char *arg) cd_to = dir; if (Mode) - if (vsystem("cd %s && %s -R %s %s", cd_to, CHMOD_CMD, Mode, arg)) - warnx("couldn't change modes of '%s' to '%s'", arg, Mode); - if (Owner && Group) { - if (vsystem("cd %s && %s -R %s.%s %s", cd_to, CHOWN_CMD, Owner, Group, arg)) + if (fcexec(cd_to, CHMOD_CMD, "-R", Mode, arg, NULL)) + warnx("couldn't change modes of '%s' to '%s'", arg, + Mode); + if (Owner != NULL && Group != NULL) { + if (vsystem("cd %s && %s -R %s.%s %s", cd_to, CHOWN_CMD, Owner, + Group, arg)) warnx("couldn't change owner/group of '%s' to '%s.%s'", arg, Owner, Group); return; } - if (Owner) { - if (vsystem("cd %s && %s -R %s %s", cd_to, CHOWN_CMD, Owner, arg)) - warnx("couldn't change owner of '%s' to '%s'", arg, Owner); + if (Owner != NULL) { + if (fcexec(cd_to, CHOWN_CMD, "-R", Owner, arg, NULL)) + warnx("couldn't change owner of '%s' to '%s'", arg, + Owner); return; - } else if (Group) - if (vsystem("cd %s && %s -R %s %s", cd_to, CHGRP_CMD, Group, arg)) - warnx("couldn't change group of '%s' to '%s'", arg, Group); + } + if (Group != NULL) { + if (fcexec(cd_to, CHGRP_CMD, "-R", Group, arg, NULL)) + warnx("couldn't change group of '%s' to '%s'", arg, + Group); + } } diff --git a/pkgtools/pkg_install/files/add/main.c b/pkgtools/pkg_install/files/add/main.c index aa9cf02d215..ffcb3306713 100644 --- a/pkgtools/pkg_install/files/add/main.c +++ b/pkgtools/pkg_install/files/add/main.c @@ -1,13 +1,17 @@ -/* $NetBSD: main.c,v 1.2 2003/01/14 15:18:32 jschauma Exp $ */ +/* $NetBSD: main.c,v 1.3 2003/09/01 16:27:11 jlam Exp $ */ -#if 0 +#include <nbcompat.h> +#if HAVE_CONFIG_H +#include "config.h" +#endif +#if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> +#endif #ifndef lint #if 0 static char *rcsid = "from FreeBSD Id: main.c,v 1.16 1997/10/08 07:45:43 charnier Exp"; #else -__RCSID("$NetBSD: main.c,v 1.2 2003/01/14 15:18:32 jschauma Exp $"); -#endif +__RCSID("$NetBSD: main.c,v 1.3 2003/09/01 16:27:11 jlam Exp $"); #endif #endif @@ -32,33 +36,25 @@ __RCSID("$NetBSD: main.c,v 1.2 2003/01/14 15:18:32 jschauma Exp $"); * */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_ERR_H +#if HAVE_ERR_H #include <err.h> #endif - -#ifdef HAVE_SYS_PARAM_H +#if HAVE_SYS_PARAM_H #include <sys/param.h> #endif - -#ifdef HAVE_SYS_TIME_H -#include <sys/time.h> -#endif - -#ifdef HAVE_SYS_RESOURCE_H +#if HAVE_SYS_RESOURCE_H #include <sys/resource.h> #endif - #include "lib.h" #include "add.h" #include "verify.h" -static char Options[] = "IMRSVfhnp:s:t:uv"; +static char Options[] = "IK:LMRSVW:fhnp:s:t:uvw:"; char *Prefix = NULL; +char *View = NULL; +char *Viewbase = NULL; +Boolean NoView = FALSE; Boolean NoInstall = FALSE; Boolean NoRecord = FALSE; @@ -69,14 +65,15 @@ char *PkgName = NULL; char *Directory = NULL; char FirstPen[FILENAME_MAX]; add_mode_t AddMode = NORMAL; -int upgrade = 0; +Boolean Replace = FALSE; static void usage(void) { - (void) fprintf(stderr, "%s\n%s\n", - "usage: pkg_add [-hVvInfRMSu] [-t template] [-p prefix]", - " [-s verification-type] pkg-name [pkg-name ...]"); + (void) fprintf(stderr, "%s\n%s\n%s\n", + "usage: pkg_add [-fhILMnRSuVv] [-p prefix] [-s verification-type]", + " [-t template] [-W viewbase] [-w view]", + " pkg-name [pkg-name ...]"); exit(1); } @@ -89,27 +86,30 @@ main(int argc, char **argv) int rc; setprogname(argv[0]); - while ((ch = getopt(argc, argv, Options)) != -1) { switch (ch) { - case 'v': - Verbose = TRUE; - break; - - case 'p': - Prefix = optarg; + case 'f': + Force = TRUE; break; case 'I': NoInstall = TRUE; break; - case 'R': - NoRecord = TRUE; + case 'K': + _pkgdb_setPKGDB_DIR(optarg); break; - case 'f': - Force = TRUE; + case 'L': + NoView = TRUE; + break; + + case 'M': + AddMode = MASTER; + break; + + case 'R': + NoRecord = TRUE; break; case 'n': @@ -117,29 +117,42 @@ main(int argc, char **argv) Verbose = TRUE; break; + case 'p': + Prefix = optarg; + break; + + case 'S': + AddMode = SLAVE; + break; + case 's': set_verification(optarg); break; case 't': - strcpy(FirstPen, optarg); - break; - - case 'S': - AddMode = SLAVE; + strlcpy(FirstPen, optarg, sizeof(FirstPen)); break; - case 'M': - AddMode = MASTER; + case 'u': + Replace = 1; break; case 'V': show_version(); /* NOTREACHED */ - case 'u': - upgrade = 1; + case 'v': + Verbose = TRUE; + break; + + case 'W': + Viewbase = optarg; break; + + case 'w': + View = optarg; + break; + case 'h': case '?': default: diff --git a/pkgtools/pkg_install/files/add/perform.c b/pkgtools/pkg_install/files/add/perform.c index 614d897170b..79288ce4515 100644 --- a/pkgtools/pkg_install/files/add/perform.c +++ b/pkgtools/pkg_install/files/add/perform.c @@ -1,13 +1,17 @@ -/* $NetBSD: perform.c,v 1.7 2003/04/23 10:27:39 seb Exp $ */ +/* $NetBSD: perform.c,v 1.8 2003/09/01 16:27:11 jlam Exp $ */ -#if 0 +#include <nbcompat.h> +#if HAVE_CONFIG_H +#include "config.h" +#endif +#if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> +#endif #ifndef lint #if 0 static const char *rcsid = "from FreeBSD Id: perform.c,v 1.44 1997/10/13 15:03:46 jkh Exp"; #else -__RCSID("$NetBSD: perform.c,v 1.7 2003/04/23 10:27:39 seb Exp $"); -#endif +__RCSID("$NetBSD: perform.c,v 1.8 2003/09/01 16:27:11 jlam Exp $"); #endif #endif @@ -30,30 +34,22 @@ __RCSID("$NetBSD: perform.c,v 1.7 2003/04/23 10:27:39 seb Exp $"); * This is the main body of the add module. * */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#ifdef HAVE_ASSERT_H +#if HAVE_ASSERT_H #include <assert.h> #endif - -#ifdef HAVE_ERR_H +#if HAVE_ERR_H #include <err.h> #endif - #include "lib.h" #include "add.h" #include "verify.h" +#if HAVE_SIGNAL_H #include <signal.h> - -#ifdef HAVE_STRING_H -#include <string.h> #endif - -#ifdef HAVE_SYS_WAIT_H -#include <sys/wait.h> +#if HAVE_STRING_H +#include <string.h> #endif static char LogDir[FILENAME_MAX]; @@ -90,9 +86,14 @@ installprereq(const char *name, int *errc) if (Verbose) printf("Loading it from %s.\n", name); path_setenv("PKG_PATH"); - if (vsystem("%s -s %s %s%s%s %s%s", - ADD_CMD, + if (vsystem("%s/pkg_add -s %s %s%s%s %s%s %s%s%s %s%s", + BINDIR, get_verification(), + NoView ? "-L " : "", + View ? "-w " : "", + View ? View : "", + Viewbase ? "-W " : "", + Viewbase ? Viewbase : "", Force ? "-f " : "", Prefix ? "-p " : "", Prefix ? Prefix : "", @@ -118,11 +119,11 @@ pkg_do(const char *pkg) { char playpen[FILENAME_MAX]; char extract_contents[FILENAME_MAX]; - char upgrade_from[FILENAME_MAX]; - char upgrade_via[FILENAME_MAX]; - char upgrade_to[FILENAME_MAX]; - int upgrading = 0; - char *where_to, *tmp, *extract; + char replace_from[FILENAME_MAX]; + char replace_via[FILENAME_MAX]; + char replace_to[FILENAME_MAX]; + int replacing = 0; + char *where_to, *extract; char *dbdir; const char *exact; FILE *cfile; @@ -131,21 +132,13 @@ pkg_do(const char *pkg) struct stat sb; int inPlace; int rc; + Boolean is_depoted_pkg = FALSE; errc = 0; zapLogDir = 0; LogDir[0] = '\0'; - strcpy(playpen, FirstPen); + strlcpy(playpen, FirstPen, sizeof(playpen)); inPlace = 0; - dbdir = (tmp = getenv(PKG_DBDIR)) ? tmp : DEF_LOG_DIR; - - /* make sure dbdir actually exists! */ - if (!(isdir(dbdir) || islinktodir(dbdir))) { - if (vsystem("%s -p -m 755 %s", MKDIR, dbdir)) { - errx(EXIT_FAILURE, "Database-dir %s cannot be generated, aborting.", - dbdir); - } - } /* Are we coming in for a second pass, everything already extracted? * (Slave mode) */ @@ -183,8 +176,7 @@ pkg_do(const char *pkg) warnx("Package %s will not be extracted", pkg); goto bomb; } - } - else { /* local */ + } else { /* local */ if (!IS_STDIN(pkg)) { /* not stdin */ if (!ispkgpattern(pkg)) { @@ -198,11 +190,7 @@ pkg_do(const char *pkg) goto bomb; } } -#if defined(HAVE_TAR__FAST_READ) (void) snprintf(extract_contents, sizeof(extract_contents), "--fast-read %s", CONTENTS_FNAME); -#else - (void) snprintf(extract_contents, sizeof(extract_contents), "%s", CONTENTS_FNAME); -#endif extract = extract_contents; } else { /* some values for stdin */ @@ -240,7 +228,7 @@ pkg_do(const char *pkg) if (!(isdir(p->name) || islinktodir(p->name)) && !Fake) { if (Verbose) printf("Desired prefix of %s does not exist, creating.\n", p->name); - (void) vsystem("%s -p %s", MKDIR, p->name); + (void) fexec("mkdir", "-p", p->name, NULL); } if (chdir(p->name) == -1) { warn("unable to change directory to `%s'", p->name); @@ -306,8 +294,33 @@ pkg_do(const char *pkg) /* Protect against old packages with bogus @name fields */ PkgName = (p = find_plist(&Plist, PLIST_NAME)) ? p->name : "anonymous"; - /* See if this package (exact version) is already registered */ + if (fexists(VIEWS_FNAME)) + is_depoted_pkg = TRUE; + + dbdir = _pkgdb_getPKGDB_DIR(); (void) snprintf(LogDir, sizeof(LogDir), "%s/%s", dbdir, PkgName); + + /* check if the dbdir is wrong because this is a depoted package */ + if (is_depoted_pkg) { + if ((p = find_plist(&Plist, PLIST_CWD))) { + if (strcmp(p->name, LogDir) != 0) { + warnx("%s is not the depot directory for %s.", + dbdir, PkgName); + goto success; + } + } + } + + /* make sure dbdir actually exists! */ + if (!(isdir(dbdir) || islinktodir(dbdir))) { + if (fexec("mkdir", "-m", "755", "-p", dbdir, NULL)) { + errx(EXIT_FAILURE, + "Database-dir %s cannot be generated, aborting.", + dbdir); + } + } + + /* See if this package (exact version) is already registered */ if ((isdir(LogDir) || islinktodir(LogDir)) && !Force) { warnx("package `%s' already recorded as installed", PkgName); goto success; /* close enough for government work */ @@ -323,23 +336,23 @@ pkg_do(const char *pkg) /* * See if the pkg is already installed. If so, we might - * want to upgrade it. + * want to upgrade/replace it. */ (void) snprintf(buf, sizeof(buf), "%.*s[0-9]*", (int)(s - PkgName) + 1, PkgName); if (findmatchingname(dbdir, buf, note_whats_installed, installed) > 0) { - if (upgrade) { - snprintf(upgrade_from, sizeof(upgrade_from), "%s/%s/" REQUIRED_BY_FNAME, + if (Replace) { + snprintf(replace_from, sizeof(replace_from), "%s/%s/" REQUIRED_BY_FNAME, dbdir, installed); - snprintf(upgrade_via, sizeof(upgrade_via), "%s/.%s." REQUIRED_BY_FNAME, + snprintf(replace_via, sizeof(replace_via), "%s/.%s." REQUIRED_BY_FNAME, dbdir, installed); - snprintf(upgrade_to, sizeof(upgrade_to), "%s/%s/" REQUIRED_BY_FNAME, + snprintf(replace_to, sizeof(replace_to), "%s/%s/" REQUIRED_BY_FNAME, dbdir, PkgName); if (Verbose) printf("Upgrading %s to %s.\n", installed, PkgName); - if (fexists(upgrade_from)) { /* Are there any dependencies? */ + if (fexists(replace_from)) { /* Are there any dependencies? */ /* * Upgrade step 1/4: Check if the new version is ok with all pkgs * (from +REQUIRED_BY) that require this pkg @@ -347,12 +360,12 @@ pkg_do(const char *pkg) FILE *rb; /* +REQUIRED_BY file */ char pkg2chk[FILENAME_MAX]; - rb = fopen(upgrade_from, "r"); + rb = fopen(replace_from, "r"); if (! rb) { - warnx("Cannot open '%s' for reading%s", upgrade_from, + warnx("Cannot open '%s' for reading%s", replace_from, Force ? " (proceeding anyways)" : ""); if (Force) - goto ignore_upgrade_depends_check; + goto ignore_replace_depends_check; else goto bomb; } @@ -376,7 +389,7 @@ pkg_do(const char *pkg) warnx("Cannot check depends in '%s'%s", depC, Force ? " (proceeding anyways)" : "!" ); if (Force) - goto ignore_upgrade_depends_check; + goto ignore_replace_depends_check; else goto bomb; } @@ -395,7 +408,7 @@ pkg_do(const char *pkg) * to see if we want to compare against that * one at all. */ - strcpy(base_new, PkgName); + strlcpy(base_new, PkgName, sizeof(base_new)); s2 = strpbrk(base_new, "<>[]?*{"); if (s2) *s2 = '\0'; @@ -404,7 +417,7 @@ pkg_do(const char *pkg) if (s2) *s2 = '\0'; } - strcpy(base_exist, depp->name); + strlcpy(base_exist, depp->name, sizeof(base_exist)); s2 = strpbrk(base_exist, "<>[]?*{"); if (s2) *s2 = '\0'; @@ -420,7 +433,7 @@ pkg_do(const char *pkg) printf("@pkgdep check: %s is ok for %s (in %s pkg)\n", PkgName, depp->name, pkg2chk); } else { - printf("Package %s requires %s, \n\tCannot perform upgrade to %s%s\n", + printf("Package %s requires %s, \n\tCannot replace with %s%s\n", pkg2chk, depp->name, PkgName, Force? " (proceeding anyways)" : "!"); if (! Force) @@ -431,7 +444,7 @@ pkg_do(const char *pkg) } fclose(rb); -ignore_upgrade_depends_check: +ignore_replace_depends_check: /* * Upgrade step 2/4: Do the actual update by moving aside * the +REQUIRED_BY file, deinstalling the old pkg, adding @@ -439,17 +452,24 @@ ignore_upgrade_depends_check: * into place (finished in step 3/4) */ if (Verbose) - printf("mv %s %s\n", upgrade_from, upgrade_via); - rc = rename(upgrade_from, upgrade_via); + printf("mv %s %s\n", replace_from, replace_via); + rc = rename(replace_from, replace_via); assert(rc == 0); - upgrading = 1; + replacing = 1; } - if (Verbose) - printf("pkg_delete '%s'\n", installed); - vsystem("%s/sbin/pkg_delete '%s'\n", PREFIX, installed); - + if (Verbose) { + printf("%s/pkg_delete -K %s '%s'\n", + BINDIR, + dbdir, + installed); + } + vsystem("%s/pkg_delete -K %s '%s'\n", + BINDIR, + dbdir, + installed); + } else { warnx("other version '%s' already installed", installed); @@ -468,9 +488,6 @@ ignore_upgrade_depends_check: continue; if (Verbose) printf("Package `%s' conflicts with `%s'.\n", PkgName, p->name); - - /* was: */ - /* if (!vsystem("/usr/sbin/pkg_info -qe '%s'", p->name)) { */ if (findmatchingname(dbdir, p->name, note_whats_installed, installed) > 0) { warnx("Conflicting package `%s'installed, please use\n" "\t\"pkg_delete %s\" first to remove it!", installed, installed); @@ -488,7 +505,6 @@ ignore_upgrade_depends_check: continue; if (Verbose) printf("Depends pre-scan: `%s' required.\n", p->name); - /* if (vsystem("/usr/sbin/pkg_info -qe '%s'", p->name)) { */ if (findmatchingname(dbdir, p->name, note_whats_installed, installed) <= 0) { /* * required pkg not found. look if it's available with a more liberal @@ -525,15 +541,15 @@ ignore_upgrade_depends_check: warnx("pkg `%s' required, but `%s' found installed.", p->name, installed); - if (upgrading) { - printf("HF: upgrade note -- could 'pkg_delete %s', and let the normal\n" - "dependency handling reinstall the updated package, assuming one IS\n" + if (replacing) { + printf("HF: replace note -- could 'pkg_delete %s', and let the normal\n" + "dependency handling reinstall the replaced package, assuming one IS\n" "available. But then I'd expect proper binary pkgs being available for\n" - "the upgrade case.\n", installed); + "the replace case.\n", installed); } if (Force) { - warnx("Proceeding anyways."); + warnx("Proceeding anyway."); } else { warnx("Please resolve this conflict!"); errc = 1; @@ -559,11 +575,12 @@ ignore_upgrade_depends_check: } if (Verbose) printf("Package `%s' depends on `%s'.\n", PkgName, p->name); - + if (findmatchingname(dbdir, p->name, note_whats_installed, installed) != 1) { /* required pkg not found - need to pull in */ + if (Fake) { - /* fake install (???) */ + /* fake install (???) */ if (Verbose) printf("Package dependency %s for %s not installed%s\n", p->name, pkg, Force ? " (proceeding anyway)" : "!"); @@ -582,7 +599,7 @@ ignore_upgrade_depends_check: errc += errc0; } } - } else if (Verbose) { + } else if (Verbose) { printf(" - %s already installed.\n", installed); } } @@ -592,7 +609,7 @@ ignore_upgrade_depends_check: /* Look for the requirements file */ if (fexists(REQUIRE_FNAME)) { - vsystem("%s +x %s", CHMOD_CMD, REQUIRE_FNAME); /* be sure */ + (void) fexec(CHMOD_CMD, "+x", REQUIRE_FNAME, NULL); /* be sure */ if (Verbose) printf("Running requirements file first for %s.\n", PkgName); if (!Fake && vsystem("./%s %s INSTALL", REQUIRE_FNAME, PkgName)) { @@ -607,7 +624,7 @@ ignore_upgrade_depends_check: /* If we're really installing, and have an installation file, run it */ if (!NoInstall && fexists(INSTALL_FNAME)) { - vsystem("%s +x %s", CHMOD_CMD, INSTALL_FNAME); /* make sure */ + (void) fexec(CHMOD_CMD, "+x", INSTALL_FNAME, NULL); /* make sure */ if (Verbose) printf("Running install with PRE-INSTALL for %s.\n", PkgName); if (!Fake && vsystem("./%s %s PRE-INSTALL", INSTALL_FNAME, PkgName)) { @@ -629,9 +646,9 @@ ignore_upgrade_depends_check: printf("Running mtree for %s.\n", PkgName); p = find_plist(&Plist, PLIST_CWD); if (Verbose) - printf("%s -U -f %s -d -e -p %s\n", MTREE, MTREE_FNAME, p ? p->name : "/"); + printf("mtree -U -f %s -d -e -p %s\n", MTREE_FNAME, p ? p->name : "/"); if (!Fake) { - if (vsystem("%s -U -f %s -d -e -p %s", MTREE, MTREE_FNAME, p ? p->name : "/")) + if (vsystem("%s/mtree -U -f %s -d -e -p %s", BINDIR, MTREE_FNAME, p ? p->name : "/")) warnx("mtree returned a non-zero status - continuing"); } unlink(MTREE_FNAME); /* remove this line to tar up pkg later - HF */ @@ -672,7 +689,9 @@ ignore_upgrade_depends_check: goto success; /* close enough for government work */ } /* Make sure pkg_info can read the entry */ - vsystem("%s a+rx %s", CHMOD_CMD, LogDir); + (void) fexec(CHMOD_CMD, "a+rx", LogDir, NULL); + if (fexists(INSTALL_FNAME)) + move_file(".", INSTALL_FNAME, LogDir); if (fexists(DEINSTALL_FNAME)) move_file(".", DEINSTALL_FNAME, LogDir); if (fexists(REQUIRE_FNAME)) @@ -700,6 +719,10 @@ ignore_upgrade_depends_check: move_file(".", DISPLAY_FNAME, LogDir); if (fexists(PRESERVE_FNAME)) move_file(".", PRESERVE_FNAME, LogDir); + if (fexists(VIEWS_FNAME)) { + is_depoted_pkg = TRUE; + move_file(".", VIEWS_FNAME, LogDir); + } /* register dependencies */ /* we could save some cycles here if we remembered what we @@ -726,8 +749,8 @@ ignore_upgrade_depends_check: /* this shouldn't happen... X-) */ } } - strcat(contents, "/"); - strcat(contents, REQUIRED_BY_FNAME); + strlcat(contents, "/", sizeof(contents)); + strlcat(contents, REQUIRED_BY_FNAME, sizeof(contents)); cfile = fopen(contents, "a"); if (!cfile) @@ -759,6 +782,28 @@ ignore_upgrade_depends_check: warnx("cannot open %s as display file", buf); } + /* Add the package to a default view. */ + if (!Fake && !NoView && is_depoted_pkg) { + if (Verbose) { + printf("%s/pkg_view %s%s %s%s %sadd %s\n", + BINDIR, + View ? "-w " : "", + View ? View : "", + Viewbase ? "-W " : "", + Viewbase ? Viewbase : "", + Verbose ? "-v " : "", + PkgName); + } + vsystem("%s/pkg_view %s%s %s%s %sadd %s", + BINDIR, + View ? "-w " : "", + View ? View : "", + Viewbase ? "-W " : "", + Viewbase ? Viewbase : "", + Verbose ? "-v " : "", + PkgName); + } + goto success; bomb: @@ -775,12 +820,12 @@ success: free_plist(&Plist); leave_playpen(Home); - if (upgrading) { + if (replacing) { /* * Upgrade step 3/4: move back +REQUIRED_BY file * (see also step 2/4) */ - rc = rename(upgrade_via, upgrade_to); + rc = rename(replace_via, replace_to); assert(rc == 0); /* @@ -808,7 +853,7 @@ cleanup(int signo) if (signo) printf("Signal %d received, cleaning up.\n", signo); if (!Fake && zapLogDir && LogDir[0]) - vsystem("%s -rf %s", RM, LogDir); + (void) fexec(REMOVE_CMD, "-fr", LogDir, NULL); leave_playpen(Home); if (signo) exit(1); diff --git a/pkgtools/pkg_install/files/add/pkg_add.1 b/pkgtools/pkg_install/files/add/pkg_add.1 index dd8c6b9d402..786e6e525c3 100644 --- a/pkgtools/pkg_install/files/add/pkg_add.1 +++ b/pkgtools/pkg_install/files/add/pkg_add.1 @@ -1,6 +1,6 @@ -.\" $NetBSD: pkg_add.1,v 1.2 2003/03/29 18:41:56 jschauma Exp $ +.\" $NetBSD: pkg_add.1,v 1.3 2003/09/01 16:27:11 jlam Exp $ .\" -.\" FreeBSD install - a package for the installation and maintainance +.\" FreeBSD install - a package for the installation and maintenance .\" of non-core utilities. .\" .\" Redistribution and use in source and binary forms, with or without @@ -24,8 +24,14 @@ .Nm pkg_add .Nd a utility for installing and upgrading software package distributions .Sh SYNOPSIS -.Nm "" -.Op Fl fIMnRSuVv +.Nm +.Op Fl fILMnRSuVv +.Bk -words +.Op Fl K Ar pkg_dbdir +.Ek +.Bk -words +.Op Fl p Ar prefix +.Ek .Bk -words .Op Fl s Ar verification-type .Ek @@ -33,7 +39,10 @@ .Op Fl t Ar template .Ek .Bk -words -.Op Fl p Ar prefix +.Op Fl W Ar viewbase +.Ek +.Bk -words +.Op Fl w Ar view .Ek .Ar \fR[ftp://[\fIuser\fR[:\fIpassword]\fR@]\fIhost\fR[:\fIport\fR]][/\fIpath/\fR]pkg-name ... .Sh DESCRIPTION @@ -105,6 +114,17 @@ will still try to find and auto-install missing prerequisite packages, a failure to find one will not be fatal. .It Fl I If an installation script exists for a given package, do not execute it. +.It Fl K Ar pkg_dbdir +Set +.Ar pkg_dbdir +as the package database directory. +If this option isn't specified, then the package database directory is +taken from the value of the environment variable +.Ev PKG_DBDIR +if it's set, otherwise it defaults to +.Pa /var/db/pkg . +.It Fl L +Don't add the package to any views after installation. .It Fl M Run in .Cm MASTER @@ -223,6 +243,22 @@ See below for a more detailed description of the process. Print version number and exit. .It Fl v Turn on verbose output. +.It Fl W Ar viewbase +Set +.Ar viewbase +as the base directory for the managed views. +The default +.Ar viewbase +directory is set by +.Xr pkg_view 1 . +.It Fl w Ar view +Set the +.Ar view +to which packages should be added after installation. +The default +.Ar view +is set by +.Xr pkg_view 1 . .El .Pp One or more @@ -233,7 +269,7 @@ URL pointing at a file available on an ftp or web site. Thus you may extract files directly from their anonymous ftp or WWW locations (e.g. .Nm -ftp://ftp.netbsd.org/pub/NetBSD/packages/1.5/i386/shells/bash-2.04.tgz). +ftp://ftp.NetBSD.org/pub/NetBSD/packages/1.5/i386/shells/bash-2.04.tgz). Note: If you wish to use .Bf -emphasis passive mode @@ -270,10 +306,10 @@ option is not given. .Pp If the .Fl u -option is given, it's assumed the package should be upgraded instead. -Before doing so, all packages that depend on the pkg being upgraded -are checked if they also work with the new version. If that test is -successful, the upgrade is prepared by moving an existing +option is given, it's assumed the package should be replaced by the +new version instead. Before doing so, all packages that depend on the +pkg being upgraded are checked if they also work with the new version. +If that test is successful, replacing is prepared by moving an existing .Pa +REQUIRED_BY file aside (if it exists), and running .Xr pkg_delete 1 @@ -398,10 +434,13 @@ for subsequent possible use by Any package dependencies are recorded in the other packages' .Pa /var/db/pkg/\*[Lt]other-pkg\*[Gt]/+REQUIRED_BY file -(if the environment variable PKG_DBDIR is set, this overrides the -.Pa /var/db/pkg/ +(if an alternate package database directory is specified, then it +overrides the +.Pa /var/db/pkg path shown above). .It +If the package is a depoted package, then add it to the default view. +.It The staging area is deleted and the program terminates. .It Finally, if we were upgrading a package, any @@ -426,7 +465,16 @@ is installed, even if the user might change it with the flag to .Cm pkg_add . .Sh ENVIRONMENT -.Ss PKG_PATH +.Bl -tag -width PKG_TMPDIR +.It Ev PKG_DBDIR +If the +.Fl K +flag isn't given, then +.Ev PKG_DBDIR +is the location of the package database directory. +The default package database directory is +.Pa /var/db/pkg . +.It Ev PKG_PATH The value of the .Ev PKG_PATH is used if a given package can't be found, it's usually set to @@ -437,13 +485,11 @@ Each entry consists of a directory name or URL. The current directory may be indicated implicitly by an empty directory name, or explicitly by a single period. FTP URLs may not end with a slash. -.Ss PKG_DBDIR -Where to register packages instead of -.Pa /var/db/pkg . -.Ss PKG_TMPDIR +.It Ev PKG_TMPDIR Staging directory for installing packages, defaults to /var/tmp. Set to directory with lots of free disk if you run out of space when installing a binary package. +.El .Sh EXAMPLES In all cases, .Nm @@ -470,9 +516,9 @@ a URL. The URL can be put into an environment variable, .Ev PKG_PATH . .Bd -literal -# pkg_add -v ftp://ftp.netbsd.org/pub/NetBSD/packages/1.5/i386/All/mozilla-0.8.1.tgz +# pkg_add -v ftp://ftp.NetBSD.org/pub/NetBSD/packages/1.5/i386/All/mozilla-0.8.1.tgz -# export PKG_PATH=ftp://ftp.netbsd.org/pub/NetBSD/packages/1.5/i386/All +# export PKG_PATH=ftp://ftp.NetBSD.org/pub/NetBSD/packages/1.5/i386/All # pkg_add -v mozilla .Ed .Sh SEE ALSO diff --git a/pkgtools/pkg_install/files/add/pkg_add.cat1 b/pkgtools/pkg_install/files/add/pkg_add.cat1 index 0ced1555a5d..94cc6072c31 100644 --- a/pkgtools/pkg_install/files/add/pkg_add.cat1 +++ b/pkgtools/pkg_install/files/add/pkg_add.cat1 @@ -5,7 +5,8 @@ NNAAMMEE butions SSYYNNOOPPSSIISS - ppkkgg__aadddd [--ffIIMMnnRRSSuuVVvv] [--ss _v_e_r_i_f_i_c_a_t_i_o_n_-_t_y_p_e] [--tt _t_e_m_p_l_a_t_e] [--pp _p_r_e_f_i_x] + ppkkgg__aadddd [--ffIILLMMnnRRSSuuVVvv] [--KK _p_k_g___d_b_d_i_r] [--pp _p_r_e_f_i_x] [--ss _v_e_r_i_f_i_c_a_t_i_o_n_-_t_y_p_e] + [--tt _t_e_m_p_l_a_t_e] [--WW _v_i_e_w_b_a_s_e] [--ww _v_i_e_w] [ftp://[_u_s_e_r[:_p_a_s_s_w_o_r_d_]@]_h_o_s_t[:_p_o_r_t]][/_p_a_t_h_/]pkg-name ... DDEESSCCRRIIPPTTIIOONN @@ -51,6 +52,14 @@ OOPPTTIIOONNSS --II If an installation script exists for a given package, do not exe- cute it. + --KK _p_k_g___d_b_d_i_r + Set _p_k_g___d_b_d_i_r as the package database directory. If this option + isn't specified, then the package database directory is taken + from the value of the environment variable PKG_DBDIR if it's set, + otherwise it defaults to _/_v_a_r_/_d_b_/_p_k_g. + + --LL Don't add the package to any views after installation. + --MM Run in MMAASSTTEERR mode. This is a very specialized mode for running ppkkgg__aadddd and is meant to be run in conjunction with SSLLAAVVEE mode. When run in this mode, ppkkgg__aadddd does no work beyond extracting the @@ -124,11 +133,19 @@ OOPPTTIIOONNSS --vv Turn on verbose output. + --WW _v_i_e_w_b_a_s_e + Set _v_i_e_w_b_a_s_e as the base directory for the managed views. The + default _v_i_e_w_b_a_s_e directory is set by pkg_view(1). + + --ww _v_i_e_w + Set the _v_i_e_w to which packages should be added after installa- + tion. The default _v_i_e_w is set by pkg_view(1). + One or more _p_k_g_-_n_a_m_e arguments may be specified, each being either a file containing the package (these usually ending with the ``.tgz'' suffix) or a URL pointing at a file available on an ftp or web site. Thus you may extract files directly from their anonymous ftp or WWW locations (e.g. - ppkkgg__aadddd ftp://ftp.netbsd.org/pub/NetBSD/pack- + ppkkgg__aadddd ftp://ftp.NetBSD.org/pub/NetBSD/pack- ages/1.5/i386/shells/bash-2.04.tgz). Note: If you wish to use _p_a_s_s_i_v_e _m_o_d_e ftp in such transfers, set the variable _F_T_P___P_A_S_S_I_V_E___M_O_D_E to some value in your environment. Otherwise, the more standard ACTIVE mode may @@ -146,11 +163,14 @@ TTEECCHHNNIICCAALL DDEETTAAIILLSS tion is terminated if the --uu option is not given. If the --uu option is given, it's assumed the package should be - upgraded instead. This is prepared by moving an existing - _+_R_E_Q_U_I_R_E_D___B_Y file aside (if it exists), and by running - pkg_delete(1) on the installed package. Installation then - proceeds as if the package was not installed, and restores the - _+_R_E_Q_U_I_R_E_D___B_Y file afterwards. + replaced by the new version instead. Before doing so, all + packages that depend on the pkg being upgraded are checked if + they also work with the new version. If that test is success- + ful, replacing is prepared by moving an existing _+_R_E_Q_U_I_R_E_D___B_Y + file aside (if it exists), and running pkg_delete(1) on the + installed package. Installation then proceeds as if the pack- + age was not installed, and restores the _+_R_E_Q_U_I_R_E_D___B_Y file af- + terwards. 2. A check is made to determine if the package conflicts (from @@ppkkggccffll directives, see pkg_create(1)) with an already record- @@ -224,12 +244,15 @@ TTEECCHHNNIICCAALL DDEETTAAIILLSS into _/_v_a_r_/_d_b_/_p_k_g_/_<_p_k_g_-_n_a_m_e_> for subsequent possible use by pkg_delete(1). Any package dependencies are recorded in the other packages' _/_v_a_r_/_d_b_/_p_k_g_/_<_o_t_h_e_r_-_p_k_g_>_/_+_R_E_Q_U_I_R_E_D___B_Y file (if - the environment variable PKG_DBDIR is set, this overrides the - _/_v_a_r_/_d_b_/_p_k_g_/ path shown above). + an alternate package database directory is specified, then it + overrides the _/_v_a_r_/_d_b_/_p_k_g path shown above). + + 12. If the package is a depoted package, then add it to the de- + fault view. - 12. The staging area is deleted and the program terminates. + 13. The staging area is deleted and the program terminates. - 13. Finally, if we were upgrading a package, any _+_R_E_Q_U_I_R_E_D___B_Y file + 14. Finally, if we were upgrading a package, any _+_R_E_Q_U_I_R_E_D___B_Y file that was moved aside before upgrading was started is now moved back into place. @@ -240,21 +263,21 @@ TTEECCHHNNIICCAALL DDEETTAAIILLSS user might change it with the --pp flag to ppkkgg__aadddd. EENNVVIIRROONNMMEENNTT - PPKKGG__PPAATTHH - The value of the PKG_PATH is used if a given package can't be found, it's - usually set to _/_u_s_r_/_p_k_g_s_r_c_/_p_a_c_k_a_g_e_s_/_A_l_l. The environment variable should - be a series of entries separated by semicolons. Each entry consists of a - directory name or URL. The current directory may be indicated implicitly - by an empty directory name, or explicitly by a single period. FTP URLs - may not end with a slash. - - PPKKGG__DDBBDDIIRR - Where to register packages instead of _/_v_a_r_/_d_b_/_p_k_g. - - PPKKGG__TTMMPPDDIIRR - Staging directory for installing packages, defaults to /var/tmp. Set to - directory with lots of free disk if you run out of space when installing - a binary package. + PKG_DBDIR If the --KK flag isn't given, then PKG_DBDIR is the location of + the package database directory. The default package database + directory is _/_v_a_r_/_d_b_/_p_k_g. + + PKG_PATH The value of the PKG_PATH is used if a given package can't be + found, it's usually set to _/_u_s_r_/_p_k_g_s_r_c_/_p_a_c_k_a_g_e_s_/_A_l_l. The en- + vironment variable should be a series of entries separated by + semicolons. Each entry consists of a directory name or URL. + The current directory may be indicated implicitly by an empty + directory name, or explicitly by a single period. FTP URLs + may not end with a slash. + + PKG_TMPDIR Staging directory for installing packages, defaults to + /var/tmp. Set to directory with lots of free disk if you run + out of space when installing a binary package. EEXXAAMMPPLLEESS In all cases, ppkkgg__aadddd will try to install binary packages listed in de- @@ -272,9 +295,9 @@ EEXXAAMMPPLLEESS You can grab a compiled binary package from remote location, by specify- ing a URL. The URL can be put into an environment variable, PKG_PATH. - # pkg_add -v ftp://ftp.netbsd.org/pub/NetBSD/packages/1.5/i386/All/mozilla-0.8.1.tgz + # pkg_add -v ftp://ftp.NetBSD.org/pub/NetBSD/packages/1.5/i386/All/mozilla-0.8.1.tgz - # export PKG_PATH=ftp://ftp.netbsd.org/pub/NetBSD/packages/1.5/i386/All + # export PKG_PATH=ftp://ftp.NetBSD.org/pub/NetBSD/packages/1.5/i386/All # pkg_add -v mozilla SSEEEE AALLSSOO @@ -302,4 +325,4 @@ BBUUGGSS Sure to be others. -NetBSD 1.6 August 15, 2002 5 +NetBSD 1.6.1_STABLE August 15, 2002 5 diff --git a/pkgtools/pkg_install/files/add/verify.c b/pkgtools/pkg_install/files/add/verify.c index 278d8da01fe..e179b3a94d6 100644 --- a/pkgtools/pkg_install/files/add/verify.c +++ b/pkgtools/pkg_install/files/add/verify.c @@ -1,4 +1,4 @@ -/* $NetBSD: verify.c,v 1.1.1.1 2002/12/20 18:13:57 schmonz Exp $ */ +/* $NetBSD: verify.c,v 1.2 2003/09/01 16:27:11 jlam Exp $ */ /* * Copyright (c) 2001 Alistair G. Crooks. All rights reserved. @@ -30,38 +30,42 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#if 0 +#include <nbcompat.h> +#if HAVE_CONFIG_H +#include "config.h" +#endif +#if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> +#endif #ifndef lint __COPYRIGHT("@(#) Copyright (c) 1999 \ The NetBSD Foundation, Inc. All rights reserved."); -__RCSID("$NetBSD: verify.c,v 1.1.1.1 2002/12/20 18:13:57 schmonz Exp $"); -#endif -#endif - -#ifdef HAVE_CONFIG_H -#include "config.h" +__RCSID("$NetBSD: verify.c,v 1.2 2003/09/01 16:27:11 jlam Exp $"); #endif +#if HAVE_SYS_TYPES_H #include <sys/types.h> - -#ifdef HAVE_SYS_PARAM_H +#endif +#if HAVE_SYS_PARAM_H #include <sys/param.h> #endif - -#ifdef HAVE_SYS_STAT_H +#if HAVE_SYS_STAT_H #include <sys/stat.h> #endif +#if HAVE_STDIO_H #include <stdio.h> +#endif +#if HAVE_STDLIB_H #include <stdlib.h> - -#ifdef HAVE_STRING_H +#endif +#if HAVE_STRING_H #include <string.h> #endif - +#if HAVE_UNISTD_H #include <unistd.h> +#endif #include "verify.h" #include "lib.h" diff --git a/pkgtools/pkg_install/files/add/verify.h b/pkgtools/pkg_install/files/add/verify.h index ef155a24896..c3143b3788f 100644 --- a/pkgtools/pkg_install/files/add/verify.h +++ b/pkgtools/pkg_install/files/add/verify.h @@ -1,4 +1,4 @@ -/* $NetBSD: verify.h,v 1.1.1.1 2002/12/20 18:13:57 schmonz Exp $ */ +/* $NetBSD: verify.h,v 1.2 2003/09/01 16:27:11 jlam Exp $ */ /* * Copyright (c) 2001 Alistair G. Crooks. All rights reserved. diff --git a/pkgtools/pkg_install/files/admin/Makefile.in b/pkgtools/pkg_install/files/admin/Makefile.in index ea6f44b9f8d..00ea90b6db8 100644 --- a/pkgtools/pkg_install/files/admin/Makefile.in +++ b/pkgtools/pkg_install/files/admin/Makefile.in @@ -1,42 +1,47 @@ -# $NetBSD: Makefile.in,v 1.6 2003/07/31 09:51:01 grant Exp $ -# Original from FreeBSD, no rcs id. +# $NetBSD: Makefile.in,v 1.7 2003/09/01 16:27:11 jlam Exp $ -prefix= @prefix@ -INSTALL= @INSTALL@ +srcdir= @srcdir@ +prefix= @prefix@ +exec_prefix= @exec_prefix@ +sbindir= @sbindir@ mandir= @mandir@ -mandirman1= ${mandir}/man1 -mandircat1= ${mandir}/cat1 + +man1dir= $(mandir)/man1 +cat1dir= $(mandir)/cat1 CC= @CC@ CCLD= $(CC) LIBS= -linstall @LIBS@ -CPPFLAGS= @CPPFLAGS@ -DEFS= @DEFS@ -I. -I@srcdir@ -I../lib +CPPFLAGS= $(DEFS) @CPPFLAGS@ -I. -I$(srcdir) -I../lib +DEFS= @DEFS@ CFLAGS= @CFLAGS@ LDFLAGS= @LDFLAGS@ -L../lib -LINK= $(CCLD) $(CFLAGS) $(LDFLAGS) -o $@ -COMPILE= $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) - -PROG= pkg_admin +INSTALL= @INSTALL@ -SRCS= main.c -OBJS= main.o +PROG= pkg_admin -all: ${PROG} +SRCS= main.c +OBJS= $(SRCS:.c=.o) -${PROG}: ${OBJS} - ${LINK} ${OBJS} ${LIBS} +.PHONY: all clean install .c.o: - $(COMPILE) -c $< -o $@ + $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) -c $< + +all: $(PROG) + +$(PROG): $(OBJS) + $(CCLD) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) clean: - rm -f ${OBJS} ${PROG} + rm -f $(OBJS) $(PROG) install: - ${INSTALL} ${PROG} ${prefix}/sbin - ${INSTALL} -m 755 -d ${mandircat1} - ${INSTALL} -m 444 ${PROG}.1 ${mandirman1}/${PROG}.1 - ${INSTALL} -m 444 ${PROG}.cat1 ${mandircat1}/${PROG}.0 + $(INSTALL) -m 755 -d $(sbindir) + $(INSTALL) -m 755 -d $(man1dir) + $(INSTALL) -m 755 -d $(cat1dir) + $(INSTALL) $(PROG) $(sbindir) + $(INSTALL) -m 444 $(PROG).1 $(man1dir)/$(PROG).1 + $(INSTALL) -m 444 $(PROG).cat1 $(man1dir)/$(PROG).0 diff --git a/pkgtools/pkg_install/files/admin/main.c b/pkgtools/pkg_install/files/admin/main.c index 504bec83dd3..b1adcb42f31 100644 --- a/pkgtools/pkg_install/files/admin/main.c +++ b/pkgtools/pkg_install/files/admin/main.c @@ -1,10 +1,14 @@ -/* $NetBSD: main.c,v 1.8 2003/04/17 14:00:55 grant Exp $ */ +/* $NetBSD: main.c,v 1.9 2003/09/01 16:27:11 jlam Exp $ */ -#if 0 +#include <nbcompat.h> +#if HAVE_CONFIG_H +#include "config.h" +#endif +#if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> -#ifndef lint -__RCSID("$NetBSD: main.c,v 1.8 2003/04/17 14:00:55 grant Exp $"); #endif +#ifndef lint +__RCSID("$NetBSD: main.c,v 1.9 2003/09/01 16:27:11 jlam Exp $"); #endif /* @@ -36,46 +40,41 @@ __RCSID("$NetBSD: main.c,v 1.8 2003/04/17 14:00:55 grant Exp $"); * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif +#if HAVE_SYS_TYPES_H #include <sys/types.h> - -#ifdef HAVE_SYS_STAT_H +#endif +#if HAVE_SYS_STAT_H #include <sys/stat.h> #endif - -#ifdef HAVE_DIRENT_H +#if HAVE_DIRENT_H #include <dirent.h> #endif - -#ifdef HAVE_ERR_H +#if HAVE_ERR_H #include <err.h> #endif - +#if HAVE_ERRNO_H #include <errno.h> - -#ifdef HAVE_FCNTL_H -#include <fcntl.h> #endif - -#ifdef HAVE_MD5GLOBAL_H -#include <md5global.h> +#if HAVE_FCNTL_H +#include <fcntl.h> #endif - -#ifdef HAVE_MD5_H +#if HAVE_MD5_H #include <md5.h> #endif - -#ifdef HAVE_LIMITS_H +#if HAVE_LIMITS_H #include <limits.h> #endif - +#if HAVE_STDIO_H #include <stdio.h> +#endif #include "lib.h" +#define DEFAULT_SFX ".t[bg]z" /* default suffix for ls{all,best} */ + +static const char Options[] = "K:s:V"; + void usage(void); int filecnt; @@ -367,21 +366,44 @@ lspattern_fn(const char *pkg, void *vp) int main(int argc, char *argv[]) { + int ch; + char sfx[FILENAME_MAX]; + Boolean use_default_sfx = TRUE; + setprogname(argv[0]); if (argc < 2) usage(); - if (strcmp(argv[1], "-V") == 0) { + while ((ch = getopt(argc, argv, Options)) != -1) + switch (ch) { + case 'K': + _pkgdb_setPKGDB_DIR(optarg); + break; - show_version(); - /* NOTREACHED */ + case 's': + (void) strlcpy(sfx, optarg, sizeof(sfx)); + use_default_sfx = FALSE; + break; - } else if (strcasecmp(argv[1], "pmatch") == 0) { + case 'V': + show_version(); + /* NOTREACHED */ + + default: + usage(); + /* NOTREACHED */ + } + argc -= optind; + argv += optind; + + if (use_default_sfx) + (void) snprintf(sfx, sizeof(sfx), "%s", DEFAULT_SFX); + + if (strcasecmp(argv[0], "pmatch") == 0) { char *pattern, *pkg; - argv++; /* argv[0] */ argv++; /* "pmatch" */ pattern = argv[0]; @@ -397,14 +419,13 @@ main(int argc, char *argv[]) return 1; } - } else if (strcasecmp(argv[1], "rebuild") == 0) { + } else if (strcasecmp(argv[0], "rebuild") == 0) { rebuild(); printf("Done.\n"); - } else if (strcasecmp(argv[1], "check") == 0) { + } else if (strcasecmp(argv[0], "check") == 0) { - argv++; /* argv[0] */ argv++; /* "check" */ if (*argv != NULL) { @@ -458,11 +479,10 @@ main(int argc, char *argv[]) } printf("Done.\n"); - } else if (strcasecmp(argv[1], "lsall") == 0) { + } else if (strcasecmp(argv[0], "lsall") == 0) { int saved_wd; - argv++; /* argv[0] */ - argv++; /* "check" */ + argv++; /* "lsall" */ /* preserve cwd */ saved_wd=open(".", O_RDONLY); @@ -478,7 +498,7 @@ main(int argc, char *argv[]) dir = dirname_of(*argv); basep = basename_of(*argv); - snprintf(base, sizeof(base), "%s.t[bg]z", basep); + snprintf(base, sizeof(base), "%s%s", basep, sfx); fchdir(saved_wd); rc = chdir(dir); @@ -496,11 +516,10 @@ main(int argc, char *argv[]) close(saved_wd); - } else if (strcasecmp(argv[1], "lsbest") == 0) { + } else if (strcasecmp(argv[0], "lsbest") == 0) { int saved_wd; - argv++; /* argv[0] */ - argv++; /* "check" */ + argv++; /* "lsbest" */ /* preserve cwd */ saved_wd=open(".", O_RDONLY); @@ -517,7 +536,7 @@ main(int argc, char *argv[]) dir = dirname_of(*argv); basep = basename_of(*argv); - snprintf(base, sizeof(base), "%s.t[bg]z", basep); + snprintf(base, sizeof(base), "%s%s", basep, sfx); fchdir(saved_wd); rc = chdir(dir); @@ -537,13 +556,15 @@ main(int argc, char *argv[]) close(saved_wd); - } else if (strcasecmp(argv[1], "list") == 0 || - strcasecmp(argv[1], "dump") == 0) { - pkgdb_dump(); + } else if (strcasecmp(argv[0], "list") == 0 || + strcasecmp(argv[0], "dump") == 0) { + + pkgdb_dump(); + } #ifdef PKGDB_DEBUG - else if (strcasecmp(argv[1], "del") == 0 || - strcasecmp(argv[1], "delete") == 0) { + else if (strcasecmp(argv[0], "del") == 0 || + strcasecmp(argv[0], "delete") == 0) { int rc; @@ -560,7 +581,7 @@ main(int argc, char *argv[]) pkgdb_close(); - } else if (strcasecmp(argv[1], "add") == 0) { + } else if (strcasecmp(argv[0], "add") == 0) { int rc; @@ -595,7 +616,7 @@ main(int argc, char *argv[]) void usage(void) { - printf("usage: pkg_admin [-V] command args ...\n" + printf("usage: pkg_admin [-V] [-s sfx] command args ...\n" "Where 'commands' and 'args' are:\n" " rebuild - rebuild pkgdb from +CONTENTS files\n" " check [pkg ...] - check md5 checksum of installed files\n" diff --git a/pkgtools/pkg_install/files/admin/pkg_admin.1 b/pkgtools/pkg_install/files/admin/pkg_admin.1 index 91c405b3557..903945ebdae 100644 --- a/pkgtools/pkg_install/files/admin/pkg_admin.1 +++ b/pkgtools/pkg_install/files/admin/pkg_admin.1 @@ -1,6 +1,6 @@ -.\" $NetBSD: pkg_admin.1,v 1.1.1.1 2002/12/20 18:13:54 schmonz Exp $ +.\" $NetBSD: pkg_admin.1,v 1.2 2003/09/01 16:27:12 jlam Exp $ .\" -.\" Copyright (c) 1999 Hubert Feyrer. All rights reserved. +.\" Copyright (c) 1999-2002 Hubert Feyrer. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -37,6 +37,12 @@ .Sh SYNOPSIS .Nm .Op Fl V +.Bk -words +.Op Fl K Ar pkg_dbdir +.Ek +.Bk -words +.Op Fl s Ar sfx_pattern +.Ek .Ar command Op args ... .Sh DESCRIPTION This command performs various administrative tasks around the @@ -45,8 +51,24 @@ Packages System. Available commands are: .Pp .Bl -tag -width check +.It Fl K Ar pkg_dbdir +Set +.Ar pkg_dbdir +as the package database directory. +If this option isn't specified, then the package database directory is +taken from the value of the environment variable +.Ev PKG_DBDIR +if it's set, otherwise it defaults to +.Pa /var/db/pkg . .It Fl V Print version number and exit. +.It Fl s Ar sfx_pattern +Set the shell glob pattern for package suffices when matching package +names for +.Cm lsall +and +.Cm lsbest . +The default pattern is ".t[bg]z". .It Cm check Op Ar pkg ... Use this command to check the files belonging to some or all of the packages installed on the local machine against their MD5 checksum @@ -84,15 +106,15 @@ yui# cd /usr/pkgsrc/packages/i386ELF/All/ yui# ls unzip* unzip-5.40.tgz unzip-5.41.tgz yui# pkg_admin lsall 'unzip*' -unzip-5.40.tgz -unzip-5.41.tgz +/usr/pkgsrc/packages/i386ELF/All/unzip-5.40.tgz +/usr/pkgsrc/packages/i386ELF/All/unzip-5.41.tgz yui# pkg_admin lsall 'unzip\*[Ge]5.40' -unzip-5.40.tgz -unzip-5.41.tgz +/usr/pkgsrc/packages/i386ELF/All/unzip-5.40.tgz +/usr/pkgsrc/packages/i386ELF/All/unzip-5.41.tgz yui# pkg_admin lsall 'unzip\*[Ge]5.41' -unzip-5.41.tgz +/usr/pkgsrc/packages/i386ELF/All/unzip-5.41.tgz yui# pkg_admin lsbest 'unzip\*[Ge]5.40' -unzip-5.41.tgz +/usr/pkgsrc/packages/i386ELF/All/unzip-5.41.tgz yui# pkg_admin lsall /usr/pkgsrc/packages/i386ELF/All/'{mit,unproven}-pthread*' /usr/pkgsrc/packages/i386ELF/All/mit-pthreads-1.60b6.tgz /usr/pkgsrc/packages/i386ELF/All/unproven-pthreads-0.15.tgz @@ -120,9 +142,14 @@ Needs to be run as root. .Pp .El .Sh ENVIRONMENT -.Bl -tag -width PKG_DBDIR -compact +.Bl -tag -width indent -compact .It Ev PKG_DBDIR -Where to register packages instead of +If the +.Fl K +flag isn't given, then +.Ev PKG_DBDIR +is the location of the package database directory. +The default package database directory is .Pa /var/db/pkg . .El .Sh FILES diff --git a/pkgtools/pkg_install/files/admin/pkg_admin.cat1 b/pkgtools/pkg_install/files/admin/pkg_admin.cat1 index b8b348004dc..6710b4eca03 100644 --- a/pkgtools/pkg_install/files/admin/pkg_admin.cat1 +++ b/pkgtools/pkg_install/files/admin/pkg_admin.cat1 @@ -4,14 +4,25 @@ NNAAMMEE ppkkgg__aaddmmiinn - perform various administrative tasks to the pkg system SSYYNNOOPPSSIISS - ppkkgg__aaddmmiinn [--VV] _c_o_m_m_a_n_d [args ...] + ppkkgg__aaddmmiinn [--VV] [--KK _p_k_g___d_b_d_i_r] [--ss _s_f_x___p_a_t_t_e_r_n] _c_o_m_m_a_n_d [args ...] DDEESSCCRRIIPPTTIIOONN This command performs various administrative tasks around the NetBSD Packages System. Available commands are: + --KK _p_k_g___d_b_d_i_r + Set _p_k_g___d_b_d_i_r as the package database directory. If this option + isn't specified, then the package database directory is taken from + the value of the environment variable PKG_DBDIR if it's set, oth- + erwise it defaults to _/_v_a_r_/_d_b_/_p_k_g. + --VV Print version number and exit. + --ss _s_f_x___p_a_t_t_e_r_n + Set the shell glob pattern for package suffices when matching + package names for llssaallll and llssbbeesstt. The default pattern is + ".t[bg]z". + cchheecckk [_p_k_g _._._.] Use this command to check the files belonging to some or all of the packages installed on the local machine against their MD5 @@ -44,15 +55,15 @@ DDEESSCCRRIIPPTTIIOONN yui# ls unzip* unzip-5.40.tgz unzip-5.41.tgz yui# pkg_admin lsall 'unzip*' - unzip-5.40.tgz - unzip-5.41.tgz + /usr/pkgsrc/packages/i386ELF/All/unzip-5.40.tgz + /usr/pkgsrc/packages/i386ELF/All/unzip-5.41.tgz yui# pkg_admin lsall 'unzip>=5.40' - unzip-5.40.tgz - unzip-5.41.tgz + /usr/pkgsrc/packages/i386ELF/All/unzip-5.40.tgz + /usr/pkgsrc/packages/i386ELF/All/unzip-5.41.tgz yui# pkg_admin lsall 'unzip>=5.41' - unzip-5.41.tgz + /usr/pkgsrc/packages/i386ELF/All/unzip-5.41.tgz yui# pkg_admin lsbest 'unzip>=5.40' - unzip-5.41.tgz + /usr/pkgsrc/packages/i386ELF/All/unzip-5.41.tgz yui# pkg_admin lsall /usr/pkgsrc/packages/i386ELF/All/'{mit,unproven}-pthread*' /usr/pkgsrc/packages/i386ELF/All/mit-pthreads-1.60b6.tgz /usr/pkgsrc/packages/i386ELF/All/unproven-pthreads-0.15.tgz @@ -74,7 +85,10 @@ DDEESSCCRRIIPPTTIIOONN Needs to be run as root. EENNVVIIRROONNMMEENNTT - PKG_DBDIR Where to register packages instead of _/_v_a_r_/_d_b_/_p_k_g. + PKG_DBDIR + If the --KK flag isn't given, then PKG_DBDIR is the location of the + package database directory. The default package database direc- + tory is _/_v_a_r_/_d_b_/_p_k_g. FFIILLEESS /var/db/pkg/pkgdb.byfile.db @@ -89,4 +103,4 @@ HHIISSTTOORRYY AAUUTTHHOORRSS The ppkkgg__aaddmmiinn command was written by Hubert Feyrer. -NetBSD 1.6 August 4, 2002 2 +NetBSD 1.6.1_STABLE August 4, 2002 2 diff --git a/pkgtools/pkg_install/files/config.guess b/pkgtools/pkg_install/files/config.guess new file mode 100755 index 00000000000..bcff683be85 --- /dev/null +++ b/pkgtools/pkg_install/files/config.guess @@ -0,0 +1,1354 @@ +#! /bin/sh +# +# $NetBSD: config.guess,v 1.1 2003/09/01 16:27:10 jlam Exp $ +# +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002 Free Software Foundation, Inc. + +timestamp='2002-07-09' + +# This file 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 of the License, 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. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Per Bothner <per@bothner.com>. +# Please send patches to <config-patches@gnu.org>. Submit a context +# diff and a properly formatted ChangeLog entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# The plan is that this can be called by configure scripts if you +# don't specify an explicit build system type. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to <config-patches@gnu.org>." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit 0 ;; + --version | -v ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# This shell variable is my proudest work .. or something. --bje + +set_cc_for_build='tmpdir=${TMPDIR-/tmp}/config-guess-$$ ; +(old=`umask` && umask 077 && mkdir $tmpdir && umask $old && unset old) + || (echo "$me: cannot create $tmpdir" >&2 && exit 1) ; +dummy=$tmpdir/dummy ; +files="$dummy.c $dummy.o $dummy.rel $dummy" ; +trap '"'"'rm -f $files; rmdir $tmpdir; exit 1'"'"' 1 2 15 ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + rm -f $files ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; +unset files' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep __ELF__ >/dev/null + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit 0 ;; + amiga:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + arc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + hp300:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mac68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + macppc:OpenBSD:*:*) + echo powerpc-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme88k:OpenBSD:*:*) + echo m88k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvmeppc:OpenBSD:*:*) + echo powerpc-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + pmax:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sgi:OpenBSD:*:*) + echo mipseb-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sun3:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + wgrisc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + *:OpenBSD:*:*) + echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + alpha:OSF1:*:*) + if test $UNAME_RELEASE = "V4.0"; then + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + fi + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + cat <<EOF >$dummy.s + .data +\$Lformat: + .byte 37,100,45,37,120,10,0 # "%d-%x\n" + + .text + .globl main + .align 4 + .ent main +main: + .frame \$30,16,\$26,0 + ldgp \$29,0(\$27) + .prologue 1 + .long 0x47e03d80 # implver \$0 + lda \$2,-1 + .long 0x47e20c21 # amask \$2,\$1 + lda \$16,\$Lformat + mov \$0,\$17 + not \$1,\$18 + jsr \$26,printf + ldgp \$29,0(\$26) + mov 0,\$16 + jsr \$26,exit + .end main +EOF + eval $set_cc_for_build + $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null + if test "$?" = 0 ; then + case `$dummy` in + 0-0) + UNAME_MACHINE="alpha" + ;; + 1-0) + UNAME_MACHINE="alphaev5" + ;; + 1-1) + UNAME_MACHINE="alphaev56" + ;; + 1-101) + UNAME_MACHINE="alphapca56" + ;; + 2-303) + UNAME_MACHINE="alphaev6" + ;; + 2-307) + UNAME_MACHINE="alphaev67" + ;; + 2-1307) + UNAME_MACHINE="alphaev68" + ;; + esac + fi + rm -f $dummy.s $dummy && rmdir $tmpdir + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit 0 ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit 0 ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit 0 ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit 0;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit 0 ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit 0 ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit 0 ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit 0;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit 0;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit 0 ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit 0 ;; + DRS?6000:UNIX_SV:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7 && exit 0 ;; + esac ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + i86pc:SunOS:5.*:*) + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit 0 ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit 0 ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit 0 ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit 0 ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit 0 ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit 0 ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit 0 ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit 0 ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit 0 ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit 0 ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include <stdio.h> /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD $dummy.c -o $dummy \ + && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ + && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 + rm -f $dummy.c $dummy && rmdir $tmpdir + echo mips-mips-riscos${UNAME_RELEASE} + exit 0 ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit 0 ;; + Night_Hawk:*:*:PowerMAX_OS) + echo powerpc-harris-powermax + exit 0 ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit 0 ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit 0 ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit 0 ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit 0 ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit 0 ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit 0 ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit 0 ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit 0 ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit 0 ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit 0 ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit 0 ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit 0 ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include <sys/systemcfg.h> + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + $CC_FOR_BUILD $dummy.c -o $dummy && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 + rm -f $dummy.c $dummy && rmdir $tmpdir + echo rs6000-ibm-aix3.2.5 + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit 0 ;; + *:AIX:*:[45]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit 0 ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit 0 ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit 0 ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit 0 ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit 0 ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit 0 ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit 0 ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit 0 ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include <stdlib.h> + #include <unistd.h> + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`$dummy` + if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi + rm -f $dummy.c $dummy && rmdir $tmpdir + fi ;; + esac + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit 0 ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit 0 ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include <unistd.h> + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD $dummy.c -o $dummy && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 + rm -f $dummy.c $dummy && rmdir $tmpdir + echo unknown-hitachi-hiuxwe2 + exit 0 ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit 0 ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit 0 ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit 0 ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit 0 ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit 0 ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit 0 ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit 0 ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit 0 ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit 0 ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit 0 ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit 0 ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*T3D:*:*:*) + echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit 0 ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit 0 ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:FreeBSD:*:*) + # Determine whether the default compiler uses glibc. + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include <features.h> + #if __GLIBC__ >= 2 + LIBC=gnu + #else + LIBC= + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` + rm -f $dummy.c && rmdir $tmpdir + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} + exit 0 ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit 0 ;; + i*:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit 0 ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit 0 ;; + x86:Interix*:3*) + echo i386-pc-interix3 + exit 0 ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i386-pc-interix + exit 0 ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit 0 ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit 0 ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + *:GNU:*:*) + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit 0 ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit 0 ;; + arm*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + mips:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips + #undef mipsel + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mipsel + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + rm -f $dummy.c && rmdir $tmpdir + test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0 + ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit 0 ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit 0 ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit 0 ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit 0 ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit 0 ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit 0 ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit 0 ;; + i*86:Linux:*:*) + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + # Set LC_ALL=C to ensure ld outputs messages in English. + ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ + | sed -ne '/supported targets:/!d + s/[ ][ ]*/ /g + s/.*supported targets: *// + s/ .*// + p'` + case "$ld_supported_targets" in + elf32-i386) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + ;; + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit 0 ;; + coff-i386) + echo "${UNAME_MACHINE}-pc-linux-gnucoff" + exit 0 ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit 0 ;; + esac + # Determine whether the default compiler is a.out or elf + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include <features.h> + #ifdef __ELF__ + # ifdef __GLIBC__ + # if __GLIBC__ >= 2 + LIBC=gnu + # else + LIBC=gnulibc1 + # endif + # else + LIBC=gnulibc1 + # endif + #else + #ifdef __INTEL_COMPILER + LIBC=gnu + #else + LIBC=gnuaout + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` + rm -f $dummy.c && rmdir $tmpdir + test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 + test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 + ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit 0 ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit 0 ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit 0 ;; + i*86:*:5:[78]*) + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit 0 ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` + echo ${UNAME_MACHINE}-pc-isc$UNAME_REL + elif /bin/uname -X 2>/dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit 0 ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit 0 ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i386. + echo i386-pc-msdosdjgpp + exit 0 ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit 0 ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit 0 ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit 0 ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit 0 ;; + M68*:*:R3V[567]*:*) + test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; + 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4.3${OS_REL} && exit 0 + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4 && exit 0 ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit 0 ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit 0 ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit 0 ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says <Richard.M.Bartel@ccMail.Census.GOV> + echo i586-unisys-sysv4 + exit 0 ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes <hewes@openmarket.com>. + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit 0 ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit 0 ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit 0 ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit 0 ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit 0 ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit 0 ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit 0 ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit 0 ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit 0 ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit 0 ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit 0 ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Darwin:*:*) + echo `uname -p`-apple-darwin${UNAME_RELEASE} + exit 0 ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit 0 ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit 0 ;; + NSR-[GKLNPTVW]:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit 0 ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit 0 ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit 0 ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit 0 ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit 0 ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit 0 ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit 0 ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit 0 ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit 0 ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit 0 ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit 0 ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit 0 ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit 0 ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit 0 ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c <<EOF +#ifdef _SEQUENT_ +# include <sys/types.h> +# include <sys/utsname.h> +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include <sys/param.h> + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include <sys/param.h> +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 +rm -f $dummy.c $dummy && rmdir $tmpdir + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit 0 ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + c34*) + echo c34-convex-bsd + exit 0 ;; + c38*) + echo c38-convex-bsd + exit 0 ;; + c4*) + echo c4-convex-bsd + exit 0 ;; + esac +fi + +cat >&2 <<EOF +$0: unable to guess system type + +This script, last modified $timestamp, has failed to recognize +the operating system you are using. It is advised that you +download the most up to date version of the config scripts from + + ftp://ftp.gnu.org/pub/gnu/config/ + +If the version you run ($0) is already up to date, please +send the following data and any information you think might be +pertinent to <config-patches@gnu.org> in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/pkgtools/pkg_install/files/config.sub b/pkgtools/pkg_install/files/config.sub new file mode 100755 index 00000000000..a6a5e937226 --- /dev/null +++ b/pkgtools/pkg_install/files/config.sub @@ -0,0 +1,1463 @@ +#! /bin/sh +# +# $NetBSD: config.sub,v 1.1 2003/09/01 16:27:10 jlam Exp $ +# +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002 Free Software Foundation, Inc. + +timestamp='2002-07-03' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file 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 of the License, 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. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Please send patches to <config-patches@gnu.org>. Submit a context +# diff and a properly formatted ChangeLog entry. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to <config-patches@gnu.org>." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit 0 ;; + --version | -v ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit 0;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | freebsd*-gnu* | storm-chaos* | os2-emx* | windows32-* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis) + os= + basic_machine=$1 + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k \ + | m32r | m68000 | m68k | m88k | mcore \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mipsisa32 | mipsisa32el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | ns16k | ns32k \ + | openrisc | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | sh | sh[1234] | sh3e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ + | strongarm \ + | tahoe | thumb | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xscale | xstormy16 | xtensa \ + | z8k) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* \ + | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c54x-* \ + | clipper-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* \ + | m32r-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | mcore-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64orion-* | mips64orionel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipstx39 | mipstx39el \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | sh-* | sh[1234]-* | sh3e-* | sh[34]eb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ + | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ + | xtensa-* \ + | ymp-* \ + | z8k-*) + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + crds | unos) + basic_machine=m68k-crds + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + mmix*) + basic_machine=mmix-knuth + os=-mmixware + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + or32 | or32-*) + basic_machine=or32-unknown + os=-coff + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon) + basic_machine=i686-pc + ;; + pentiumii | pentium2) + basic_machine=i686-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3d) + basic_machine=alpha-cray + os=-unicos + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + windows32) + basic_machine=i386-pc + os=-windows32-msvcrt + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh3 | sh4 | sh3eb | sh4eb | sh[1234]le | sh3ele) + basic_machine=sh-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparc | sparcv9 | sparcv9b) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + c4x*) + basic_machine=c4x-none + os=-coff + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ + | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* | -powermax*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto*) + os=-nto-qnx + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-ibm) + os=-aix + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/pkgtools/pkg_install/files/configure b/pkgtools/pkg_install/files/configure index a700cbf509b..467b818d4a4 100755 --- a/pkgtools/pkg_install/files/configure +++ b/pkgtools/pkg_install/files/configure @@ -1,29 +1,326 @@ #! /bin/sh - # Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.13 -# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# Generated by GNU Autoconf 2.57 for pkg_install 20030823. +# +# Report bugs to <grant@NetBSD.org>. # +# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 +# Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi + +# Support unset when possible. +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi -# Defaults: -ac_help= + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +exec 6>&1 + +# +# Initializations. +# ac_default_prefix=/usr/local -# Any additions from configure.in: -ac_default_prefix=/usr/pkg -ac_help="$ac_help - --with-pkgdbdir=DIR Where to put the pkg database (/var/db/pkg)" +ac_config_libobj_dir=. +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} + +# Identity of this package. +PACKAGE_NAME='pkg_install' +PACKAGE_TARNAME='pkg_install' +PACKAGE_VERSION='20030823' +PACKAGE_STRING='pkg_install 20030823' +PACKAGE_BUGREPORT='grant@NetBSD.org' + +ac_unique_file="lib/plist.c" +# Factoring default headers for most tests. +ac_includes_default="\ +#include <stdio.h> +#if HAVE_SYS_TYPES_H +# include <sys/types.h> +#endif +#if HAVE_SYS_STAT_H +# include <sys/stat.h> +#endif +#if STDC_HEADERS +# include <stdlib.h> +# include <stddef.h> +#else +# if HAVE_STDLIB_H +# include <stdlib.h> +# endif +#endif +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H +# include <memory.h> +# endif +# include <string.h> +#endif +#if HAVE_STRINGS_H +# include <strings.h> +#endif +#if HAVE_INTTYPES_H +# include <inttypes.h> +#else +# if HAVE_STDINT_H +# include <stdint.h> +# endif +#endif +#if HAVE_UNISTD_H +# include <unistd.h> +#endif" + +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os CANONICAL_HOST INCLUDES SET_MAKE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S RANLIB ac_ct_RANLIB AR AUTOCONF AUTOHEADER pkgdbdir CPP EGREP LIBOBJS LTLIBOBJS' +ac_subst_files='' # Initialize some variables set by options. +ac_init_help= +ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. -build=NONE -cache_file=./config.cache +cache_file=/dev/null exec_prefix=NONE -host=NONE no_create= -nonopt=NONE no_recursion= prefix=NONE program_prefix=NONE @@ -32,10 +329,15 @@ program_transform_name=s,x,x, silent= site= srcdir= -target=NONE verbose= x_includes=NONE x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' @@ -49,17 +351,9 @@ oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' -# Initialize some other variables. -subdirs= -MFLAGS= MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} -# Maximum number of lines to put in a shell here document. -ac_max_here_lines=12 - ac_prev= for ac_option do - # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" @@ -67,59 +361,59 @@ do continue fi - case "$ac_option" in - -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) ac_optarg= ;; - esac + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. - case "$ac_option" in + case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir="$ac_optarg" ;; + bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) - ac_prev=build ;; + ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build="$ac_optarg" ;; + build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file="$ac_optarg" ;; + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) - datadir="$ac_optarg" ;; + datadir=$ac_optarg ;; -disable-* | --disable-*) - ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - eval "enable_${ac_feature}=no" ;; + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) - ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac - eval "enable_${ac_feature}='$ac_optarg'" ;; + eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -128,95 +422,47 @@ do -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) - exec_prefix="$ac_optarg" ;; + exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; - -help | --help | --hel | --he) - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat << EOF -Usage: configure [options] [host] -Options: [defaults in brackets after descriptions] -Configuration: - --cache-file=FILE cache test results in FILE - --help print this message - --no-create do not create output files - --quiet, --silent do not print \`checking...' messages - --version print the version of autoconf that created configure -Directory and file names: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [same as prefix] - --bindir=DIR user executables in DIR [EPREFIX/bin] - --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] - --libexecdir=DIR program executables in DIR [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data in DIR - [PREFIX/share] - --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data in DIR - [PREFIX/com] - --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] - --libdir=DIR object code libraries in DIR [EPREFIX/lib] - --includedir=DIR C header files in DIR [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] - --infodir=DIR info documentation in DIR [PREFIX/info] - --mandir=DIR man documentation in DIR [PREFIX/man] - --srcdir=DIR find the sources in DIR [configure dir or ..] - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM - run sed PROGRAM on installed program names -EOF - cat << EOF -Host type: - --build=BUILD configure for building on BUILD [BUILD=HOST] - --host=HOST configure for HOST [guessed] - --target=TARGET configure for TARGET [TARGET=HOST] -Features and packages: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --x-includes=DIR X include files are in DIR - --x-libraries=DIR X library files are in DIR -EOF - if test -n "$ac_help"; then - echo "--enable and --with options recognized:$ac_help" - fi - exit 0 ;; + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; -host | --host | --hos | --ho) - ac_prev=host ;; + ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) - host="$ac_optarg" ;; + host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir="$ac_optarg" ;; + includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir="$ac_optarg" ;; + infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir="$ac_optarg" ;; + libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) - libexecdir="$ac_optarg" ;; + libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ @@ -225,19 +471,19 @@ EOF -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) - localstatedir="$ac_optarg" ;; + localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir="$ac_optarg" ;; + mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) + | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ @@ -251,26 +497,26 @@ EOF -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir="$ac_optarg" ;; + oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix="$ac_optarg" ;; + prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix="$ac_optarg" ;; + program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix="$ac_optarg" ;; + program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ @@ -287,7 +533,7 @@ EOF | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name="$ac_optarg" ;; + program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) @@ -297,7 +543,7 @@ EOF ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) - sbindir="$ac_optarg" ;; + sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ @@ -308,58 +554,57 @@ EOF | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) - sharedstatedir="$ac_optarg" ;; + sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) - site="$ac_optarg" ;; + site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir="$ac_optarg" ;; + srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir="$ac_optarg" ;; + sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target ;; + ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target="$ac_optarg" ;; + target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; - -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.13" - exit 0 ;; + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; -with-* | --with-*) - ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac - eval "with_${ac_package}='$ac_optarg'" ;; + eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) - ac_package=`echo $ac_option|sed -e 's/-*without-//'` + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - eval "with_${ac_package}=no" ;; + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. @@ -370,99 +615,110 @@ EOF ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes="$ac_optarg" ;; + x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries="$ac_optarg" ;; + x_libraries=$ac_optarg ;; - -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } ;; + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" + export $ac_envvar ;; + *) - if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then - echo "configure: warning: $ac_option: invalid host type" 1>&2 - fi - if test "x$nonopt" != xNONE; then - { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } - fi - nonopt="$ac_option" + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then - { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } fi -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -# File descriptor usage: -# 0 standard input -# 1 file creation -# 2 errors and warnings -# 3 some systems may open it to /dev/tty -# 4 used on the Kubota Titan -# 6 checking for... messages and results -# 5 compiler messages saved in config.log -if test "$silent" = yes; then - exec 6>/dev/null -else - exec 6>&1 -fi -exec 5>./config.log - -echo "\ -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. -" 1>&5 +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done -# Strip out --no-create and --no-recursion so they do not pile up. -# Also quote any args containing shell metacharacters. -ac_configure_args= -for ac_arg +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir do - case "$ac_arg" in - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) ;; - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) - ac_configure_args="$ac_configure_args '$ac_arg'" ;; - *) ac_configure_args="$ac_configure_args $ac_arg" ;; + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; esac done -# NLS nuisances. -# Only set these to C if already set. These must not be set unconditionally -# because not all systems understand e.g. LANG=C (notably SCO). -# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! -# Non-C LC_CTYPE values break the ctype check. -if test "${LANG+set}" = set; then LANG=C; export LANG; fi -if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi -if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi -if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo > confdefs.h +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null -# A filename unique to this package, relative to the directory that -# configure is in, which we can look for to find out if srcdir is correct. -ac_unique_file=add/add.h # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. - ac_prog=$0 - ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` - test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + ac_confdir=`(dirname "$0") 2>/dev/null || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$0" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. @@ -472,13 +728,436 @@ else fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then - { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } else - { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } fi fi -srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` +(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || + { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 + { (exit 1); exit 1; }; } +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_CPP_set=${CPP+set} +ac_env_CPP_value=$CPP +ac_cv_env_CPP_set=${CPP+set} +ac_cv_env_CPP_value=$CPP + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures pkg_install 20030823 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +_ACEOF + + cat <<_ACEOF +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data [PREFIX/share] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --infodir=DIR info documentation [PREFIX/info] + --mandir=DIR man documentation [PREFIX/man] +_ACEOF + + cat <<\_ACEOF + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of pkg_install 20030823:";; + esac + cat <<\_ACEOF + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-pkgdbdir=DIR Where to put the pkg database (/var/db/pkg) + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a + nonstandard directory <lib dir> + CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have + headers in a nonstandard directory <include dir> + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to <grant@NetBSD.org>. +_ACEOF +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + ac_popdir=`pwd` + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d $ac_dir || continue + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac +# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be +# absolute. +ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` +ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` +ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` +ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + + cd $ac_dir + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_srcdir/configure.gnu; then + echo + $SHELL $ac_srcdir/configure.gnu --help=recursive + elif test -f $ac_srcdir/configure; then + echo + $SHELL $ac_srcdir/configure --help=recursive + elif test -f $ac_srcdir/configure.ac || + test -f $ac_srcdir/configure.in; then + echo + $ac_configure --help + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi + cd $ac_popdir + done +fi + +test -n "$ac_init_help" && exit 0 +if $ac_init_version; then + cat <<\_ACEOF +pkg_install configure 20030823 +generated by GNU Autoconf 2.57 + +Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 +Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit 0 +fi +exec 5>config.log +cat >&5 <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by pkg_install $as_me 20030823, which was +generated by GNU Autoconf 2.57. Invocation command line was + + $ $0 $@ + +_ACEOF +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + echo "PATH: $as_dir" +done + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_sep= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$ac_configure_args1 '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + # Get rid of the leading space. + ac_sep=" " + ;; + esac + done +done +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Be sure not to use single quotes in there, as some shells, +# such as our DU 5.0 friend, will then `close' the trap. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +{ + (set) 2>&1 | + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) + sed -n \ + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; + *) + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------- ## +## Output files. ## +## ------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + sed "/^$/d" confdefs.h | sort + echo + fi + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" + } >&5 + rm -f core core.* *.core && + rm -rf conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status + ' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo >confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then @@ -489,55 +1168,117 @@ if test -z "$CONFIG_SITE"; then fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then - echo "loading site script $ac_site_file" + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then - echo "loading cache $cache_file" - . $cache_file + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; + esac + fi else - echo "creating cache $cache_file" - > $cache_file + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val="\$ac_cv_env_${ac_var}_value" + eval ac_new_val="\$ac_env_${ac_var}_value" + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } fi ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -ac_exeext= -ac_objext=o -if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then - # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. - if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then - ac_n= ac_c=' -' ac_t=' ' - else - ac_n=-n ac_c= ac_t= - fi -else - ac_n= ac_c='\c' ac_t= -fi +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + -# Check whether --with-pkgdbdir or --without-pkgdbdir was given. -if test "${with_pkgdbdir+set}" = set; then - withval="$with_pkgdbdir" - pkgdbdir="$with_pkgdbdir" -else - pkgdbdir="/var/db/pkg" -fi + + + + + + + + + + + + + + + + + + ac_config_headers="$ac_config_headers lib/config.h" + + ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then @@ -548,287 +1289,746 @@ for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break + elif test -f $ac_dir/shtool; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break fi done if test -z "$ac_aux_dir"; then - { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 +echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} + { (exit 1); exit 1; }; } +fi +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + +# Make sure we can run config.sub. +$ac_config_sub sun4 >/dev/null 2>&1 || + { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 +echo "$as_me: error: cannot run $ac_config_sub" >&2;} + { (exit 1); exit 1; }; } + +echo "$as_me:$LINENO: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6 +if test "${ac_cv_build+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_build_alias=$build_alias +test -z "$ac_cv_build_alias" && + ac_cv_build_alias=`$ac_config_guess` +test -z "$ac_cv_build_alias" && + { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 +echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + { (exit 1); exit 1; }; } +ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6 +build=$ac_cv_build +build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + +echo "$as_me:$LINENO: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6 +if test "${ac_cv_host+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_host_alias=$host_alias +test -z "$ac_cv_host_alias" && + ac_cv_host_alias=$ac_cv_build_alias +ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6 +host=$ac_cv_host +host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + +CANONICAL_HOST=$host + + + +# Checks for programs. +echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\_ACEOF +all: + @echo 'ac_maketemp="$(MAKE)"' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftest.make +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + SET_MAKE= +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + SET_MAKE="MAKE=${MAKE-make}" fi -ac_config_guess=$ac_aux_dir/config.guess -ac_config_sub=$ac_aux_dir/config.sub -ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# ./install, which can be erroneously created by make from ./install.sh. -echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:573: checking for a BSD compatible install" >&5 -if test -z "$INSTALL"; then -if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" - for ac_dir in $PATH; do - # Account for people who put trailing slashes in PATH elements. - case "$ac_dir/" in - /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - if test -f $ac_dir/$ac_prog; then - if test $ac_prog = install && - grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - else - ac_cv_path_install="$ac_dir/$ac_prog -c" - break 2 - fi - fi - done - ;; - esac - done - IFS="$ac_save_IFS" +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL="$ac_cv_path_install" - else - # As a last resort, use the slow shell script. We don't cache a - # path for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the path is relative. - INSTALL="$ac_install_sh" - fi fi -echo "$ac_t""$INSTALL" 1>&6 +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi -# Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:628: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="gcc" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -CC="$ac_cv_prog_CC" +CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC else - echo "$ac_t""no" 1>&6 + CC="$ac_cv_prog_CC" fi +fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:658: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_prog_rejected=no - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift - if test $# -gt 0; then + if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift - set dummy "$ac_dir/$ac_word" "$@" - shift - ac_cv_prog_CC="$@" + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi -CC="$ac_cv_prog_CC" +CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test -z "$CC"; then - case "`uname -s`" in - *win32* | *WIN32*) - # Extract the first word of "cl", so it can be a program name with args. -set dummy cl; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:709: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="cl" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -CC="$ac_cv_prog_CC" +CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 else - echo "$ac_t""no" 1>&6 -fi - ;; - esac - fi - test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:741: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 - -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -cat > conftest.$ac_ext << EOF - -#line 752 "configure" -#include "confdefs.h" - -main(){return(0);} -EOF -if { (eval echo configure:757: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - ac_cv_prog_cc_works=yes - # If we can't run a trivial program, we are probably using a cross compiler. - if (./conftest; exit) 2>/dev/null; then - ac_cv_prog_cc_cross=no - else - ac_cv_prog_cc_cross=yes - fi -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_prog_cc_works=no + test -n "$CC" && break + done fi -rm -fr conftest* -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 -if test $ac_cv_prog_cc_works = no; then - { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } -fi -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:783: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 -echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 -cross_compiling=$ac_cv_prog_cc_cross - -echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:788: checking whether we are using GNU C" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.c <<EOF -#ifdef __GNUC__ - yes; -#endif -EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:797: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then - ac_cv_prog_gcc=yes +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_prog_gcc=no + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CC" && break +done -echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + CC=$ac_ct_CC +fi + +fi + + +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5 + (eval $ac_compiler --version </dev/null >&5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5 + (eval $ac_compiler -v </dev/null >&5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5 + (eval $ac_compiler -V </dev/null >&5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ -if test $ac_cv_prog_gcc = yes; then - GCC=yes + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +echo "$as_me:$LINENO: checking for C compiler default output" >&5 +echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Find the output, starting from the most likely. This scheme is +# not robust to junk in `.', hence go to wildcards (a.*) only as a last +# resort. + +# Be careful to initialize this variable, since it used to be cached. +# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. +ac_cv_exeext= +# b.out is created by i960 compilers. +for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) + ;; + conftest.$ac_ext ) + # This is the source file. + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool, + # but it would be cool to find out if it's true. Does anybody + # maintain Libtool? --akim. + export ac_cv_exeext + break;; + * ) + break;; + esac +done else - GCC= + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6 + +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + fi + fi fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +rm -f a.out a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 + +echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6 + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ -ac_test_CFLAGS="${CFLAGS+set}" -ac_save_CFLAGS="$CFLAGS" -CFLAGS= -echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:816: checking whether ${CC-cc} accepts -g" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done else - echo 'void f(){}' > conftest.c -if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else - ac_cv_prog_cc_g=no -fi -rm -f conftest* + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_prog_cc_g=no fi - -echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then - CFLAGS="$ac_save_CFLAGS" + CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" @@ -842,552 +2042,927 @@ else CFLAGS= fi fi +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_stdc=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stdarg.h> +#include <stdio.h> +#include <sys/types.h> +#include <sys/stat.h> +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC -# Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:850: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_RANLIB="ranlib" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" -fi -fi -RANLIB="$ac_cv_prog_RANLIB" -if test -n "$RANLIB"; then - echo "$ac_t""$RANLIB" 1>&6 -else - echo "$ac_t""no" 1>&6 fi -for ac_prog in ar +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + ''\ + '#include <stdlib.h>' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' do -# Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:882: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stdlib.h> +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_AR="$ac_prog" - break - fi - done - IFS="$ac_save_ifs" -fi + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h fi -AR="$ac_cv_prog_AR" -if test -n "$AR"; then - echo "$ac_t""$AR" 1>&6 + else - echo "$ac_t""no" 1>&6 -fi + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -test -n "$AR" && break -done +fi +rm -f conftest.$ac_objext conftest.$ac_ext +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu -for ac_prog in chmod +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH do -# Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:916: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_CHMOD'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - case "$CHMOD" in - /*) - ac_cv_path_CHMOD="$CHMOD" # Let the user override the test with a path. - ;; - ?:/*) - ac_cv_path_CHMOD="$CHMOD" # Let the user override the test with a dos path. - ;; + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + /usr/ucb/* ) ;; *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_CHMOD="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" - ;; + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; esac +done + + fi -CHMOD="$ac_cv_path_CHMOD" -if test -n "$CHMOD"; then - echo "$ac_t""$CHMOD" 1>&6 -else - echo "$ac_t""no" 1>&6 + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL=$ac_install_sh + fi fi +echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6 -test -n "$CHMOD" && break -done +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' -for ac_prog in chown -do -# Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:956: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_CHOWN'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - case "$CHOWN" in - /*) - ac_cv_path_CHOWN="$CHOWN" # Let the user override the test with a path. - ;; - ?:/*) - ac_cv_path_CHOWN="$CHOWN" # Let the user override the test with a dos path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_CHOWN="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" - ;; -esac -fi -CHOWN="$ac_cv_path_CHOWN" -if test -n "$CHOWN"; then - echo "$ac_t""$CHOWN" 1>&6 +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo "$as_me:$LINENO: checking whether ln -s works" >&5 +echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no, using $LN_S" >&5 +echo "${ECHO_T}no, using $LN_S" >&6 fi -test -n "$CHOWN" && break +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done done -for ac_prog in chgrp -do -# Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:996: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_CHGRP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - case "$CHGRP" in - /*) - ac_cv_path_CHGRP="$CHGRP" # Let the user override the test with a path. - ;; - ?:/*) - ac_cv_path_CHGRP="$CHGRP" # Let the user override the test with a dos path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_CHGRP="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" - ;; -esac fi -CHGRP="$ac_cv_path_CHGRP" -if test -n "$CHGRP"; then - echo "$ac_t""$CHGRP" 1>&6 +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -test -n "$CHGRP" && break +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done done -for ac_prog in digest -do -# Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1036: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_DIGEST'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - case "$DIGEST" in - /*) - ac_cv_path_DIGEST="$DIGEST" # Let the user override the test with a path. - ;; - ?:/*) - ac_cv_path_DIGEST="$DIGEST" # Let the user override the test with a dos path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_DIGEST="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" - ;; -esac + test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" +fi fi -DIGEST="$ac_cv_path_DIGEST" -if test -n "$DIGEST"; then - echo "$ac_t""$DIGEST" 1>&6 +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -test -n "$DIGEST" && break -done - -for ac_prog in mkdir -do -# Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1076: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_MKDIR'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - case "$MKDIR" in - /*) - ac_cv_path_MKDIR="$MKDIR" # Let the user override the test with a path. - ;; - ?:/*) - ac_cv_path_MKDIR="$MKDIR" # Let the user override the test with a dos path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_MKDIR="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" - ;; -esac -fi -MKDIR="$ac_cv_path_MKDIR" -if test -n "$MKDIR"; then - echo "$ac_t""$MKDIR" 1>&6 + RANLIB=$ac_ct_RANLIB else - echo "$ac_t""no" 1>&6 + RANLIB="$ac_cv_prog_RANLIB" fi -test -n "$MKDIR" && break +# Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="ar" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done done -for ac_prog in mtree -do -# Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1116: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_MTREE'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - case "$MTREE" in - /*) - ac_cv_path_MTREE="$MTREE" # Let the user override the test with a path. - ;; - ?:/*) - ac_cv_path_MTREE="$MTREE" # Let the user override the test with a dos path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_MTREE="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" - ;; -esac fi -MTREE="$ac_cv_path_MTREE" -if test -n "$MTREE"; then - echo "$ac_t""$MTREE" 1>&6 +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + echo "$as_me:$LINENO: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -test -n "$MTREE" && break -done -for ac_prog in rm -do -# Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1156: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_RM'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - case "$RM" in - /*) - ac_cv_path_RM="$RM" # Let the user override the test with a path. - ;; - ?:/*) - ac_cv_path_RM="$RM" # Let the user override the test with a dos path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_RM="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" - ;; -esac -fi -RM="$ac_cv_path_RM" -if test -n "$RM"; then - echo "$ac_t""$RM" 1>&6 +AUTOCONF=${AUTOCONF-"$srcdir/missing --run autoconf"} + +AUTOHEADER=${AUTOHEADER-"$srcdir/missing --run autoheader"} + + + +# Check whether --with-pkgdbdir or --without-pkgdbdir was given. +if test "${with_pkgdbdir+set}" = set; then + withval="$with_pkgdbdir" + pkgdbdir="$with_pkgdbdir" else - echo "$ac_t""no" 1>&6 -fi + pkgdbdir="/var/db/pkg" +fi; -test -n "$RM" && break -done -for ac_prog in rmdir -do -# Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1196: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_RMDIR'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - case "$RMDIR" in - /*) - ac_cv_path_RMDIR="$RMDIR" # Let the user override the test with a path. - ;; - ?:/*) - ac_cv_path_RMDIR="$RMDIR" # Let the user override the test with a dos path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_RMDIR="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" - ;; -esac -fi -RMDIR="$ac_cv_path_RMDIR" -if test -n "$RMDIR"; then - echo "$ac_t""$RMDIR" 1>&6 + + +echo "$as_me:$LINENO: checking for dbopen in -ldb1" >&5 +echo $ECHO_N "checking for dbopen in -ldb1... $ECHO_C" >&6 +if test "${ac_cv_lib_db1_dbopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo "$ac_t""no" 1>&6 + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldb1 $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dbopen (); +int +main () +{ +dbopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_db1_dbopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_db1_dbopen=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_db1_dbopen" >&5 +echo "${ECHO_T}$ac_cv_lib_db1_dbopen" >&6 +if test $ac_cv_lib_db1_dbopen = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBDB1 1 +_ACEOF + + LIBS="-ldb1 $LIBS" + fi -test -n "$RMDIR" && break -done +echo "$as_me:$LINENO: checking for library containing tgetent" >&5 +echo $ECHO_N "checking for library containing tgetent... $ECHO_C" >&6 +if test "${ac_cv_search_tgetent+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS +ac_cv_search_tgetent=no +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -for ac_prog in tar -do -# Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1236: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_TAR_FULLPATHNAME'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - case "$TAR_FULLPATHNAME" in - /*) - ac_cv_path_TAR_FULLPATHNAME="$TAR_FULLPATHNAME" # Let the user override the test with a path. - ;; - ?:/*) - ac_cv_path_TAR_FULLPATHNAME="$TAR_FULLPATHNAME" # Let the user override the test with a dos path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_TAR_FULLPATHNAME="$ac_dir/$ac_word" - break - fi +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char tgetent (); +int +main () +{ +tgetent (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_tgetent="none required" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +if test "$ac_cv_search_tgetent" = no; then + for ac_lib in termcap termlib curses ncurses; do + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char tgetent (); +int +main () +{ +tgetent (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_tgetent="-l$ac_lib" +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext done - IFS="$ac_save_ifs" - ;; -esac fi -TAR_FULLPATHNAME="$ac_cv_path_TAR_FULLPATHNAME" -if test -n "$TAR_FULLPATHNAME"; then - echo "$ac_t""$TAR_FULLPATHNAME" 1>&6 -else - echo "$ac_t""no" 1>&6 +LIBS=$ac_func_search_save_LIBS fi +echo "$as_me:$LINENO: result: $ac_cv_search_tgetent" >&5 +echo "${ECHO_T}$ac_cv_search_tgetent" >&6 +if test "$ac_cv_search_tgetent" != no; then + test "$ac_cv_search_tgetent" = "none required" || LIBS="$ac_cv_search_tgetent $LIBS" -test -n "$TAR_FULLPATHNAME" && break -done +fi -echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1273: checking how to run the C preprocessor" >&5 +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then -if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - # This must be in double quotes, not single quotes, because CPP may get - # substituted into the Makefile and "${CC-cc}" will confuse make. - CPP="${CC-cc} -E" + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + # <limits.h> exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. - cat > conftest.$ac_ext <<EOF -#line 1288 "configure" -#include "confdefs.h" -#include <assert.h> -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1294: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP="${CC-cc} -E -traditional-cpp" - cat > conftest.$ac_ext <<EOF -#line 1305 "configure" -#include "confdefs.h" -#include <assert.h> -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1311: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then : else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP="${CC-cc} -nologo -E" - cat > conftest.$ac_ext <<EOF -#line 1322 "configure" -#include "confdefs.h" -#include <assert.h> -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1328: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <ac_nonexistent.h> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP=/lib/cpp + ac_cpp_err=yes fi -rm -f conftest* +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break fi -rm -f conftest* +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break fi -rm -f conftest* - ac_cv_prog_CPP="$CPP" + + done + ac_cv_prog_CPP=$CPP + fi - CPP="$ac_cv_prog_CPP" + CPP=$ac_cv_prog_CPP else - ac_cv_prog_CPP="$CPP" + ac_cv_prog_CPP=$CPP fi -echo "$ac_t""$CPP" 1>&6 +echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6 +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + # <limits.h> exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <ac_nonexistent.h> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1353: checking for ANSI C header files" >&5 -if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : else - cat > conftest.$ac_ext <<EOF -#line 1358 "configure" -#include "confdefs.h" + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6 +if test "${ac_cv_prog_egrep+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' + fi +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 +echo "${ECHO_T}$ac_cv_prog_egrep" >&6 + EGREP=$ac_cv_prog_egrep + + +echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <stdlib.h> #include <stdarg.h> #include <string.h> #include <float.h> -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1366: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_header_stdc=yes else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_header_stdc=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_stdc=no fi -rm -f conftest* +rm -f conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. -cat > conftest.$ac_ext <<EOF -#line 1383 "configure" -#include "confdefs.h" + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <string.h> -EOF + +_ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "memchr" >/dev/null 2>&1; then + $EGREP "memchr" >/dev/null 2>&1; then : else - rm -rf conftest* ac_cv_header_stdc=no fi rm -f conftest* @@ -1396,16 +2971,20 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. -cat > conftest.$ac_ext <<EOF -#line 1401 "configure" -#include "confdefs.h" + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <stdlib.h> -EOF + +_ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "free" >/dev/null 2>&1; then + $EGREP "free" >/dev/null 2>&1; then : else - rm -rf conftest* ac_cv_header_stdc=no fi rm -f conftest* @@ -1414,1716 +2993,1847 @@ fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. -if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : else - cat > conftest.$ac_ext <<EOF -#line 1422 "configure" -#include "confdefs.h" + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <ctype.h> -#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int main () { int i; for (i = 0; i < 256; i++) -if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); -exit (0); } +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif -EOF -if { (eval echo configure:1433: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + exit(2); + exit (0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then : else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_header_stdc=no + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no fi -rm -fr conftest* +rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi - fi fi - -echo "$ac_t""$ac_cv_header_stdc" 1>&6 +echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 -EOF +_ACEOF fi -for ac_hdr in db1/db.h -do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1460: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 1465 "configure" -#include "confdefs.h" -#include <$ac_hdr> -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1470: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - cat >> confdefs.h <<EOF -#define $ac_tr_hdr 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi -done +# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_hdr in assert.h db.h dirent.h err.h fcntl.h fnmatch.h limits.h md5.h md5global.h netdb.h pwd.h regex.h signal.h stdlib.h string.h termios.h time.h unistd.h vis.h -do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1500: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 1505 "configure" -#include "confdefs.h" -#include <$ac_hdr> -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1510: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - cat >> confdefs.h <<EOF -#define $ac_tr_hdr 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi -done - -for ac_hdr in sys/file.h sys/ioctl.h sys/mount.h sys/param.h sys/queue.h sys/resource.h sys/stat.h sys/time.h sys/types.h sys/vfs.h sys/wait.h -do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1540: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 1545 "configure" -#include "confdefs.h" -#include <$ac_hdr> -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1550: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - cat >> confdefs.h <<EOF -#define $ac_tr_hdr 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi -done -echo $ac_n "checking for MD5File in -lmd""... $ac_c" 1>&6 -echo "configure:1578: checking for MD5File in -lmd" >&5 -ac_lib_var=`echo md'_'MD5File | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lmd $LIBS" -cat > conftest.$ac_ext <<EOF -#line 1586 "configure" -#include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char MD5File(); - -int main() { -MD5File() -; return 0; } -EOF -if { (eval echo configure:1597: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo md | sed -e 's/[^a-zA-Z0-9_]/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` - cat >> confdefs.h <<EOF -#define $ac_tr_lib 1 -EOF - LIBS="-lmd $LIBS" -else - echo "$ac_t""no" 1>&6 -fi -echo $ac_n "checking for dbopen in -ldb1""... $ac_c" 1>&6 -echo "configure:1625: checking for dbopen in -ldb1" >&5 -ac_lib_var=`echo db1'_'dbopen | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-ldb1 $LIBS" -cat > conftest.$ac_ext <<EOF -#line 1633 "configure" -#include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dbopen(); - -int main() { -dbopen() -; return 0; } -EOF -if { (eval echo configure:1644: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo db1 | sed -e 's/[^a-zA-Z0-9_]/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` - cat >> confdefs.h <<EOF -#define $ac_tr_lib 1 -EOF - LIBS="-ldb1 $LIBS" +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_Header=no" +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF -else - echo "$ac_t""no" 1>&6 fi +done -for ac_func in chflags -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1675: 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 <<EOF -#line 1680 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include <assert.h> -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); -int main() { -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif -; return 0; } -EOF -if { (eval echo configure:1703: \"$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" +for ac_header in db1/db.h db.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc in + yes:no ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; + no:yes ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=$ac_header_preproc" fi -rm -f conftest* +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <<EOF -#define $ac_tr_func 1 -EOF - -else - echo "$ac_t""no" 1>&6 fi + done -for ac_func in dbopen -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1730: 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 <<EOF -#line 1735 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include <assert.h> -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); -int main() { -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif -; return 0; } -EOF -if { (eval echo configure:1758: \"$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" +for ac_header in fnmatch.h md5.h regex.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc in + yes:no ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; + no:yes ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" + eval "$as_ac_Header=$ac_header_preproc" fi -rm -f conftest* +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <<EOF -#define $ac_tr_func 1 -EOF - -else - echo "$ac_t""no" 1>&6 fi + done -for ac_func in err -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1785: 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 <<EOF -#line 1790 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include <assert.h> -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); -int main() { -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif -; return 0; } -EOF -if { (eval echo configure:1813: \"$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" +for ac_header in sys/ioctl.h sys/resource.h sys/wait.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc in + yes:no ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; + no:yes ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" + eval "$as_ac_Header=$ac_header_preproc" fi -rm -f conftest* +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <<EOF -#define $ac_tr_func 1 -EOF - -else - echo "$ac_t""no" 1>&6 fi + done -for ac_func in errx -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1840: 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 <<EOF -#line 1845 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include <assert.h> -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); -int main() { +# Checks for library functions. -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif -; return 0; } -EOF -if { (eval echo configure:1868: \"$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 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <<EOF -#define $ac_tr_func 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi -done - -for ac_func in fgetln +for ac_func in chflags dbopen tgetent do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1895: 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 <<EOF -#line 1900 "configure" -#include "confdefs.h" +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include <assert.h> + which can conflict with char $ac_func (); below. + Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + <limits.h> exists even on freestanding compilers. */ +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif /* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif /* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); - -int main() { - + builtin and then its argument prototype would still apply. */ +char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else -$ac_func(); +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} #endif -; return 0; } -EOF -if { (eval echo configure:1923: \"$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 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <<EOF -#define $ac_tr_func 1 -EOF - -else - echo "$ac_t""no" 1>&6 fi done -for ac_func in getprogname + + +for ac_func in getrlimit setrlimit do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1950: 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 <<EOF -#line 1955 "configure" -#include "confdefs.h" +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include <assert.h> + which can conflict with char $ac_func (); below. + Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + <limits.h> exists even on freestanding compilers. */ +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif /* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif /* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); - -int main() { - + builtin and then its argument prototype would still apply. */ +char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else -$ac_func(); +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} #endif -; return 0; } -EOF -if { (eval echo configure:1978: \"$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 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <<EOF -#define $ac_tr_func 1 -EOF - -else - echo "$ac_t""no" 1>&6 fi done -for ac_func in mkdtemp -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2005: 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 <<EOF -#line 2010 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include <assert.h> -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); -int main() { + ac_config_files="$ac_config_files Makefile add/Makefile admin/Makefile create/Makefile delete/Makefile info/Makefile lib/Makefile view/Makefile" -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. -; return 0; } -EOF -if { (eval echo configure:2033: \"$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 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +{ + (set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} | + sed ' + t clear + : clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if diff $cache_file confcache >/dev/null 2>&1; then :; else + if test -w $cache_file; then + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file + else + echo "not updating unwritable cache $cache_file" + fi fi +rm -f confcache -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <<EOF -#define $ac_tr_func 1 -EOF - -else - echo "$ac_t""no" 1>&6 +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' fi -done -for ac_func in setenv -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2060: 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 <<EOF -#line 2065 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include <assert.h> -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); +DEFS=-DHAVE_CONFIG_H -int main() { +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_i=`echo "$ac_i" | + sed 's/\$U\././;s/\.o$//;s/\.obj$//'` + # 2. Add them. + ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif +LTLIBOBJS=$ac_ltlibobjs -; return 0; } -EOF -if { (eval echo configure:2088: \"$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 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <<EOF -#define $ac_tr_func 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi -done -for ac_func in setprogname -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2115: 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 <<EOF -#line 2120 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include <assert.h> -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); +: ${CONFIG_STATUS=./config.status} +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. -int main() { +debug=false +ac_cs_recheck=false +ac_cs_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_ACEOF -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif +cat >>$CONFIG_STATUS <<\_ACEOF +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## -; return 0; } -EOF -if { (eval echo configure:2143: \"$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 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix fi -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <<EOF -#define $ac_tr_func 1 -EOF - +# Support unset when possible. +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then + as_unset=unset else - echo "$ac_t""no" 1>&6 + as_unset=false fi -done -for ac_func in statfs -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2170: 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 <<EOF -#line 2175 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include <assert.h> -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); -int main() { +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done -; return 0; } -EOF -if { (eval echo configure:2198: \"$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" +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* + as_expr=false fi -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <<EOF -#define $ac_tr_func 1 -EOF - +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename else - echo "$ac_t""no" 1>&6 + as_basename=false fi -done -for ac_func in statvfs -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2225: 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 <<EOF -#line 2230 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include <assert.h> -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); -int main() { +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif -; return 0; } -EOF -if { (eval echo configure:2253: \"$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 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <<EOF -#define $ac_tr_func 1 -EOF - -else - echo "$ac_t""no" 1>&6 +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done -for ac_func in strsep + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 +echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2280: 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 <<EOF -#line 2285 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include <assert.h> -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac -int main() { + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 +echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif -; return 0; } -EOF -if { (eval echo configure:2308: \"$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 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <<EOF -#define $ac_tr_func 1 -EOF - +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr else - echo "$ac_t""no" 1>&6 + as_expr=false fi -done -for ac_func in strlcpy -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2335: 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 <<EOF -#line 2340 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include <assert.h> -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif - -; return 0; } -EOF -if { (eval echo configure:2363: \"$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" +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* + as_ln_s='cp -p' fi +rm -f conf$$ conf$$.exe conf$$.file -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <<EOF -#define $ac_tr_func 1 -EOF - +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: else - echo "$ac_t""no" 1>&6 + as_mkdir_p=false fi -done -for ac_func in unsetenv -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2390: 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 <<EOF -#line 2395 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include <assert.h> -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif +as_executable_p="test -f" -; return 0; } -EOF -if { (eval echo configure:2418: \"$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 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <<EOF -#define $ac_tr_func 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi -done +# Sed expression to map a string onto a valid variable name. +as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" -for ac_func in warn -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2445: 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 <<EOF -#line 2450 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include <assert.h> -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); -int main() { +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif +# CDPATH. +$as_unset CDPATH -; return 0; } -EOF -if { (eval echo configure:2473: \"$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 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi +exec 6>&1 -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <<EOF -#define $ac_tr_func 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi -done +# Open the log real soon, to keep \$[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. Logging --version etc. is OK. +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX +} >&5 +cat >&5 <<_CSEOF -for ac_func in warnx -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2500: 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 <<EOF -#line 2505 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include <assert.h> -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); +This file was extended by pkg_install $as_me 20030823, which was +generated by GNU Autoconf 2.57. Invocation command line was -int main() { + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif +_CSEOF +echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 +echo >&5 +_ACEOF -; return 0; } -EOF -if { (eval echo configure:2528: \"$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 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" +# Files that config.status was made for. +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi -rm -f conftest* + +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <<EOF -#define $ac_tr_func 1 -EOF - -else - echo "$ac_t""no" 1>&6 +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi -done -for ac_func in MD5File -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2555: 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 <<EOF -#line 2560 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include <assert.h> -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi -int main() { +cat >>$CONFIG_STATUS <<\_ACEOF -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. -; return 0; } -EOF -if { (eval echo configure:2583: \"$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 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi +Usage: $0 [OPTIONS] [FILE]... -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <<EOF -#define $ac_tr_func 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi -done + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE +Configuration files: +$config_files +Configuration headers: +$config_headers -echo $ac_n "checking for __attribute__""... $ac_c" 1>&6 -echo "configure:2610: checking for __attribute__" >&5 -if eval "test \"`echo '$''{'ac_cv___attribute__'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - -cat > conftest.$ac_ext <<EOF -#line 2616 "configure" -#include "confdefs.h" +Report bugs to <bug-autoconf@gnu.org>." +_ACEOF -#include <stdlib.h> +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +pkg_install config.status 20030823 +configured by $0, generated by GNU Autoconf 2.57, + with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" -int main() { +Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." +srcdir=$srcdir +INSTALL="$INSTALL" +_ACEOF -static void foo(void) __attribute__ ((noreturn)); +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + ac_shift=: + ;; + -*) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_option=$1 + ac_need_defaults=false;; + esac -static void -foo(void) -{ - exit(1); -} + case $ac_option in + # Handling of the options. +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:$LINENO: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + ac_need_defaults=false;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; -; return 0; } -EOF -if { (eval echo configure:2633: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv___attribute__=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv___attribute__=no -fi -rm -f conftest* -fi + # This is an error. + -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; } ;; -if test "$ac_cv___attribute__" = "yes"; then - cat >> confdefs.h <<\EOF -#define HAVE___ATTRIBUTE__ 1 -EOF - -fi -echo "$ac_t""$ac_cv___attribute__" 1>&6 - -echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:2654: 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 <<EOF -#line 2659 "configure" -#include "confdefs.h" - -int main() { - -/* Ultrix mips cc rejects this. */ -typedef int charset[2]; const charset x; -/* SunOS 4.1.1 cc rejects this. */ -char const *const *ccp; -char **p; -/* NEC SVR4.0.2 mips cc rejects this. */ -struct point {int x, y;}; -static struct point const zero = {0,0}; -/* AIX XL C 1.02.0.0 rejects this. - It does not let you subtract one const X* pointer from another in an arm - of an if-expression whose if-part is not a constant expression */ -const char *g = "string"; -ccp = &g + (g ? g-g : 0); -/* HPUX 7.0 cc rejects these. */ -++ccp; -p = (char**) ccp; -ccp = (char const *const *) p; -{ /* SCO 3.2v4 cc rejects this. */ - char *t; - char const *s = 0 ? (char *) 0 : (char const *) 0; - - *t++ = 0; -} -{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ - int x[] = {25, 17}; - const int *foo = &x[0]; - ++foo; -} -{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ - typedef const int *iptr; - iptr p = 0; - ++p; -} -{ /* AIX XL C 1.02.0.0 rejects this saying - "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ - struct s { int j; const int *ap[3]; }; - struct s *b; b->j = 5; -} -{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ - const int foo = 10; -} + *) ac_config_targets="$ac_config_targets $1" ;; -; return 0; } -EOF -if { (eval echo configure:2708: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_c_const=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_c_const=no -fi -rm -f conftest* -fi + esac + shift +done -echo "$ac_t""$ac_cv_c_const" 1>&6 -if test $ac_cv_c_const = no; then - cat >> confdefs.h <<\EOF -#define const -EOF +ac_configure_extra_args= +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" fi -echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:2729: 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 <<EOF -#line 2734 "configure" -#include "confdefs.h" -#include <sys/types.h> -#if STDC_HEADERS -#include <stdlib.h> -#include <stddef.h> -#endif -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - rm -rf conftest* - ac_cv_type_size_t=yes -else - rm -rf conftest* - ac_cv_type_size_t=no +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +if \$ac_cs_recheck; then + echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi -rm -f conftest* -fi -echo "$ac_t""$ac_cv_type_size_t" 1>&6 -if test $ac_cv_type_size_t = no; then - cat >> confdefs.h <<\EOF -#define size_t unsigned -EOF +_ACEOF -fi -trap '' 1 2 15 -cat > confcache <<\EOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs. It is not useful on other systems. -# If it contains results you don't want to keep, you may remove or edit it. -# -# By default, configure uses ./config.cache as the cache file, -# creating it if it does not exist already. You can give configure -# the --cache-file=FILE option to use a different cache file; that is -# what configure does when it calls configure scripts in -# subdirectories, so they share the cache. -# Giving --cache-file=/dev/null disables caching, for debugging configure. -# config.status only pays attention to the cache file if you give it the -# --recheck option to rerun configure. -# -EOF -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -(set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote substitution - # turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - -e "s/'/'\\\\''/g" \ - -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' - ;; - esac >> confcache -if cmp -s $cache_file confcache; then - : -else - if test -w $cache_file; then - echo "updating cache $cache_file" - cat confcache > $cache_file - else - echo "not updating unwritable cache $cache_file" - fi -fi -rm -f confcache -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_config_target in $ac_config_targets +do + case "$ac_config_target" in + # Handling of arguments. + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "add/Makefile" ) CONFIG_FILES="$CONFIG_FILES add/Makefile" ;; + "admin/Makefile" ) CONFIG_FILES="$CONFIG_FILES admin/Makefile" ;; + "create/Makefile" ) CONFIG_FILES="$CONFIG_FILES create/Makefile" ;; + "delete/Makefile" ) CONFIG_FILES="$CONFIG_FILES delete/Makefile" ;; + "info/Makefile" ) CONFIG_FILES="$CONFIG_FILES info/Makefile" ;; + "lib/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; + "view/Makefile" ) CONFIG_FILES="$CONFIG_FILES view/Makefile" ;; + "lib/config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS lib/config.h" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac +done -# Any assignment to VPATH causes Sun make to only execute -# the first set of double-colon rules, so remove it if not needed. -# If there is a colon in the path, we need to keep it. -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi -trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 - -DEFS=-DHAVE_CONFIG_H - -# Without the "./", some shells look in PATH for config.status. -: ${CONFIG_STATUS=./config.status} +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason to put it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Create a temporary directory, and hook for its removal unless debugging. +$debug || +{ + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} -echo creating $CONFIG_STATUS -rm -f $CONFIG_STATUS -cat > $CONFIG_STATUS <<EOF -#! /bin/sh -# Generated automatically by configure. -# Run this file to recreate the current configuration. -# This directory was configured as follows, -# on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -# -# $0 $ac_configure_args -# -# Compiler output produced by configure, useful for debugging -# configure, is in ./config.log if it exists. +# Create a (secure) tmp directory for tmp files. -ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" -for ac_option -do - case "\$ac_option" in - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" - exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; - -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.13" - exit 0 ;; - -help | --help | --hel | --he | --h) - echo "\$ac_cs_usage"; exit 0 ;; - *) echo "\$ac_cs_usage"; exit 1 ;; - esac -done +{ + tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./confstat$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} -ac_given_srcdir=$srcdir -ac_given_INSTALL="$INSTALL" +_ACEOF -trap 'rm -fr `echo "Makefile lib/Makefile lib/lib.h add/Makefile admin/Makefile create/Makefile delete/Makefile info/Makefile lib/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 -EOF -cat >> $CONFIG_STATUS <<EOF +cat >>$CONFIG_STATUS <<_ACEOF -# Protect against being on the right side of a sed subst in config.status. -sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g; - s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF -$ac_vpsub -$extrasub -s%@SHELL@%$SHELL%g -s%@CFLAGS@%$CFLAGS%g -s%@CPPFLAGS@%$CPPFLAGS%g -s%@CXXFLAGS@%$CXXFLAGS%g -s%@FFLAGS@%$FFLAGS%g -s%@DEFS@%$DEFS%g -s%@LDFLAGS@%$LDFLAGS%g -s%@LIBS@%$LIBS%g -s%@exec_prefix@%$exec_prefix%g -s%@prefix@%$prefix%g -s%@program_transform_name@%$program_transform_name%g -s%@bindir@%$bindir%g -s%@sbindir@%$sbindir%g -s%@libexecdir@%$libexecdir%g -s%@datadir@%$datadir%g -s%@sysconfdir@%$sysconfdir%g -s%@sharedstatedir@%$sharedstatedir%g -s%@localstatedir@%$localstatedir%g -s%@libdir@%$libdir%g -s%@includedir@%$includedir%g -s%@oldincludedir@%$oldincludedir%g -s%@infodir@%$infodir%g -s%@mandir@%$mandir%g -s%@pkgdbdir@%$pkgdbdir%g -s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g -s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g -s%@INSTALL_DATA@%$INSTALL_DATA%g -s%@CC@%$CC%g -s%@RANLIB@%$RANLIB%g -s%@AR@%$AR%g -s%@CHMOD@%$CHMOD%g -s%@CHOWN@%$CHOWN%g -s%@CHGRP@%$CHGRP%g -s%@DIGEST@%$DIGEST%g -s%@MKDIR@%$MKDIR%g -s%@MTREE@%$MTREE%g -s%@RM@%$RM%g -s%@RMDIR@%$RMDIR%g -s%@TAR_FULLPATHNAME@%$TAR_FULLPATHNAME%g -s%@CPP@%$CPP%g +# +# CONFIG_FILES section. +# +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "\$CONFIG_FILES"; then + # Protect against being on the right side of a sed subst in config.status. + sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; + s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF +s,@SHELL@,$SHELL,;t t +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s,@exec_prefix@,$exec_prefix,;t t +s,@prefix@,$prefix,;t t +s,@program_transform_name@,$program_transform_name,;t t +s,@bindir@,$bindir,;t t +s,@sbindir@,$sbindir,;t t +s,@libexecdir@,$libexecdir,;t t +s,@datadir@,$datadir,;t t +s,@sysconfdir@,$sysconfdir,;t t +s,@sharedstatedir@,$sharedstatedir,;t t +s,@localstatedir@,$localstatedir,;t t +s,@libdir@,$libdir,;t t +s,@includedir@,$includedir,;t t +s,@oldincludedir@,$oldincludedir,;t t +s,@infodir@,$infodir,;t t +s,@mandir@,$mandir,;t t +s,@build_alias@,$build_alias,;t t +s,@host_alias@,$host_alias,;t t +s,@target_alias@,$target_alias,;t t +s,@DEFS@,$DEFS,;t t +s,@ECHO_C@,$ECHO_C,;t t +s,@ECHO_N@,$ECHO_N,;t t +s,@ECHO_T@,$ECHO_T,;t t +s,@LIBS@,$LIBS,;t t +s,@build@,$build,;t t +s,@build_cpu@,$build_cpu,;t t +s,@build_vendor@,$build_vendor,;t t +s,@build_os@,$build_os,;t t +s,@host@,$host,;t t +s,@host_cpu@,$host_cpu,;t t +s,@host_vendor@,$host_vendor,;t t +s,@host_os@,$host_os,;t t +s,@CANONICAL_HOST@,$CANONICAL_HOST,;t t +s,@INCLUDES@,$INCLUDES,;t t +s,@SET_MAKE@,$SET_MAKE,;t t +s,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;t t +s,@EXEEXT@,$EXEEXT,;t t +s,@OBJEXT@,$OBJEXT,;t t +s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t +s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t +s,@INSTALL_DATA@,$INSTALL_DATA,;t t +s,@LN_S@,$LN_S,;t t +s,@RANLIB@,$RANLIB,;t t +s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t +s,@AR@,$AR,;t t +s,@AUTOCONF@,$AUTOCONF,;t t +s,@AUTOHEADER@,$AUTOHEADER,;t t +s,@pkgdbdir@,$pkgdbdir,;t t +s,@CPP@,$CPP,;t t +s,@EGREP@,$EGREP,;t t +s,@LIBOBJS@,$LIBOBJS,;t t +s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF -EOF - -cat >> $CONFIG_STATUS <<\EOF - -# Split the substitutions into bite-sized pieces for seds with -# small command number limits, like on Digital OSF/1 and HP-UX. -ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. -ac_file=1 # Number of current file. -ac_beg=1 # First line for current file. -ac_end=$ac_max_sed_cmds # Line after last line for current file. -ac_more_lines=: -ac_sed_cmds="" -while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file - else - sed "${ac_end}q" conftest.subs > conftest.s$ac_file - fi - if test ! -s conftest.s$ac_file; then - ac_more_lines=false - rm -f conftest.s$ac_file - else - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f conftest.s$ac_file" + +_ACEOF + + cat >>$CONFIG_STATUS <<\_ACEOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false else - ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` fi - ac_file=`expr $ac_file + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_cmds` + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat fi -done -if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat -fi -EOF - -cat >> $CONFIG_STATUS <<EOF +fi # test -n "$CONFIG_FILES" -CONFIG_FILES=\${CONFIG_FILES-"Makefile lib/Makefile lib/lib.h add/Makefile admin/Makefile create/Makefile delete/Makefile info/Makefile"} -EOF -cat >> $CONFIG_STATUS <<\EOF -for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; esac - # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. - - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" - # A "../" for each directory in $ac_dir_suffix. - ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" else - ac_dir_suffix= ac_dots= - fi - - case "$ac_given_srcdir" in - .) srcdir=. - if test -z "$ac_dots"; then top_srcdir=. - else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; - /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; *) # Relative path. - srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" - top_srcdir="$ac_dots$ac_given_srcdir" ;; - esac + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac +# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be +# absolute. +ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` +ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` +ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` +ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` - case "$ac_given_INSTALL" in - [/$]*) INSTALL="$ac_given_INSTALL" ;; - *) INSTALL="$ac_dots$ac_given_INSTALL" ;; - esac - echo creating "$ac_file" - rm -f "$ac_file" - configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." - case "$ac_file" in - *Makefile*) ac_comsub="1i\\ -# $configure_input" ;; - *) ac_comsub= ;; + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - sed -e "$ac_comsub -s%@configure_input@%$configure_input%g -s%@srcdir@%$srcdir%g -s%@top_srcdir@%$top_srcdir%g -s%@INSTALL@%$INSTALL%g -" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file -fi; done -rm -f conftest.s* + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + configure_input= + else + configure_input="$ac_file. " + fi + configure_input=$configure_input"Generated from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo $f;; + *) # Relative + if test -f "$f"; then + # Build tree + echo $f + elif test -f "$srcdir/$f"; then + # Source tree + echo $srcdir/$f + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s,@configure_input@,$configure_input,;t t +s,@srcdir@,$ac_srcdir,;t t +s,@abs_srcdir@,$ac_abs_srcdir,;t t +s,@top_srcdir@,$ac_top_srcdir,;t t +s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t +s,@builddir@,$ac_builddir,;t t +s,@abs_builddir@,$ac_abs_builddir,;t t +s,@top_builddir@,$ac_top_builddir,;t t +s,@abs_top_builddir@,$ac_abs_top_builddir,;t t +s,@INSTALL@,$ac_INSTALL,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi + +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_HEADER section. +# # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. -ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' -ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' -ac_dC='\3' -ac_dD='%g' -# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". -ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_uB='\([ ]\)%\1#\2define\3' +ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='[ ].*$,\1#\2' +ac_dC=' ' +ac_dD=',;t' +# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='$,\1#\2define\3' ac_uC=' ' -ac_uD='\4%g' -# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_eB='$%\1#\2define\3' -ac_eC=' ' -ac_eD='%g' - -if test "${CONFIG_HEADERS+set}" != set; then -EOF -cat >> $CONFIG_STATUS <<EOF - CONFIG_HEADERS="lib/config.h" -EOF -cat >> $CONFIG_STATUS <<\EOF -fi -for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then +ac_uD=',;t' + +for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; esac - echo creating $ac_file - - rm -f conftest.frag conftest.in conftest.out - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - cat $ac_file_inputs > conftest.in - -EOF - -# Transform confdefs.h into a sed script conftest.vals that substitutes -# the proper values into config.h.in to produce config.h. And first: -# Protect against being on the right side of a sed subst in config.status. -# Protect against being in an unquoted here document in config.status. -rm -f conftest.vals -cat > conftest.hdr <<\EOF -s/[\\&%]/\\&/g -s%[\\$`]%\\&%g -s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp -s%ac_d%ac_u%gp -s%ac_u%ac_e%gp -EOF -sed -n -f conftest.hdr confdefs.h > conftest.vals -rm -f conftest.hdr + test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo $f;; + *) # Relative + if test -f "$f"; then + # Build tree + echo $f + elif test -f "$srcdir/$f"; then + # Source tree + echo $srcdir/$f + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } + # Remove the trailing spaces. + sed 's/[ ]*$//' $ac_file_inputs >$tmp/in + +_ACEOF + +# Transform confdefs.h into two sed scripts, `conftest.defines' and +# `conftest.undefs', that substitutes the proper values into +# config.h.in to produce config.h. The first handles `#define' +# templates, and the second `#undef' templates. +# And first: Protect against being on the right side of a sed subst in +# config.status. Protect against being in an unquoted here document +# in config.status. +rm -f conftest.defines conftest.undefs +# Using a here document instead of a string reduces the quoting nightmare. +# Putting comments in sed scripts is not portable. +# +# `end' is used to avoid that the second main sed command (meant for +# 0-ary CPP macros) applies to n-ary macro definitions. +# See the Autoconf documentation for `clear'. +cat >confdef2sed.sed <<\_ACEOF +s/[\\&,]/\\&/g +s,[\\$`],\\&,g +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp +t end +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp +: end +_ACEOF +# If some macros were called several times there might be several times +# the same #defines, which is useless. Nevertheless, we may not want to +# sort them, since we want the *last* AC-DEFINE to be honored. +uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines +sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs +rm -f confdef2sed.sed # This sed command replaces #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. -cat >> conftest.vals <<\EOF -s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% -EOF - -# Break up conftest.vals because some shells have a limit on -# the size of here documents, and old seds have small limits too. +cat >>conftest.undefs <<\_ACEOF +s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, +_ACEOF + +# Break up conftest.defines because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS +echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS +echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS +echo ' :' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.defines >/dev/null +do + # Write a limited-size here document to $tmp/defines.sed. + echo ' cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS + # Speed up: don't consider the non `#define' lines. + echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/defines.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail + rm -f conftest.defines + mv conftest.tail conftest.defines +done +rm -f conftest.defines +echo ' fi # grep' >>$CONFIG_STATUS +echo >>$CONFIG_STATUS +# Break up conftest.undefs because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #undef templates' >>$CONFIG_STATUS rm -f conftest.tail -while : +while grep . conftest.undefs >/dev/null do - ac_lines=`grep -c . conftest.vals` - # grep -c gives empty output for an empty file on some AIX systems. - if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi - # Write a limited-size here document to conftest.frag. - echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS + # Write a limited-size here document to $tmp/undefs.sed. + echo ' cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS + # Speed up: don't consider the non `#undef' + echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS echo 'CEOF - sed -f conftest.frag conftest.in > conftest.out - rm -f conftest.in - mv conftest.out conftest.in -' >> $CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail - rm -f conftest.vals - mv conftest.tail conftest.vals + sed -f $tmp/undefs.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail + rm -f conftest.undefs + mv conftest.tail conftest.undefs done -rm -f conftest.vals - -cat >> $CONFIG_STATUS <<\EOF - rm -f conftest.frag conftest.h - echo "/* $ac_file. Generated automatically by configure. */" > conftest.h - cat conftest.in >> conftest.h - rm -f conftest.in - if cmp -s $ac_file conftest.h 2>/dev/null; then - echo "$ac_file is unchanged" - rm -f conftest.h +rm -f conftest.undefs + +cat >>$CONFIG_STATUS <<\_ACEOF + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + echo "/* Generated by configure. */" >$tmp/config.h + else + echo "/* $ac_file. Generated by configure. */" >$tmp/config.h + fi + cat $tmp/in >>$tmp/config.h + rm -f $tmp/in + if test x"$ac_file" != x-; then + if diff $ac_file $tmp/config.h >/dev/null 2>&1; then + { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} + else + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" else - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + rm -f $ac_file + mv $tmp/config.h $ac_file fi - rm -f $ac_file - mv conftest.h $ac_file + else + cat $tmp/config.h + rm -f $tmp/config.h fi -fi; done - -EOF -cat >> $CONFIG_STATUS <<EOF +done +_ACEOF -EOF -cat >> $CONFIG_STATUS <<\EOF +cat >>$CONFIG_STATUS <<\_ACEOF -exit 0 -EOF +{ (exit 0); exit 0; } +_ACEOF chmod +x $CONFIG_STATUS -rm -fr confdefs* $ac_clean_files -test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 +ac_clean_files=$ac_clean_files_save + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi diff --git a/pkgtools/pkg_install/files/configure.ac b/pkgtools/pkg_install/files/configure.ac new file mode 100644 index 00000000000..e59c7300d6c --- /dev/null +++ b/pkgtools/pkg_install/files/configure.ac @@ -0,0 +1,47 @@ +dnl Process this file with autoconf to produce a configure script. +AC_PREREQ(2.52) +AC_INIT([pkg_install], [20030823], [grant@NetBSD.org]) +AC_CONFIG_SRCDIR([lib/plist.c]) +AC_CONFIG_HEADER(lib/config.h) + +AC_CANONICAL_HOST +CANONICAL_HOST=$host +AC_SUBST(CANONICAL_HOST) +AC_SUBST(INCLUDES) + +# Checks for programs. +AC_PROG_MAKE_SET +AC_PROG_CC +AC_PROG_INSTALL +AC_PROG_LN_S +AC_PROG_RANLIB +AC_CHECK_PROG(AR, ar, ar) + +AUTOCONF=${AUTOCONF-"$srcdir/missing --run autoconf"} +AC_SUBST(AUTOCONF) +AUTOHEADER=${AUTOHEADER-"$srcdir/missing --run autoheader"} +AC_SUBST(AUTOHEADER) + +dnl Set the default pkg dbdir +AC_ARG_WITH(pkgdbdir, +[ --with-pkgdbdir=DIR Where to put the pkg database (/var/db/pkg)], +[ pkgdbdir="$with_pkgdbdir" ], +[ pkgdbdir="/var/db/pkg" ]) +AC_SUBST(pkgdbdir) + +dnl Checks for libraries. +AC_CHECK_LIB(db1, dbopen) +AC_SEARCH_LIBS(tgetent, [termcap termlib curses ncurses]) + +dnl Checks for header files. +AC_HEADER_STDC +AC_CHECK_HEADERS([db1/db.h db.h]) +AC_CHECK_HEADERS([fnmatch.h md5.h regex.h]) +AC_CHECK_HEADERS([sys/ioctl.h sys/resource.h sys/wait.h]) + +# Checks for library functions. +AC_CHECK_FUNCS([chflags dbopen tgetent]) +AC_CHECK_FUNCS([getrlimit setrlimit]) + +AC_CONFIG_FILES([Makefile add/Makefile admin/Makefile create/Makefile delete/Makefile info/Makefile lib/Makefile view/Makefile]) +AC_OUTPUT diff --git a/pkgtools/pkg_install/files/configure.in b/pkgtools/pkg_install/files/configure.in deleted file mode 100644 index 6db6e9f61c6..00000000000 --- a/pkgtools/pkg_install/files/configure.in +++ /dev/null @@ -1,65 +0,0 @@ -enl Process this file with autoconf to produce a configure script. -AC_INIT(add/add.h) -AC_CONFIG_HEADER(lib/config.h) - -dnl Set the prefix -AC_PREFIX_DEFAULT(/usr/pkg) - -dnl Set the default pkg database dir -AC_ARG_WITH(pkgdbdir, -[ --with-pkgdbdir=DIR Where to put the pkg database (/var/db/pkg)], -[ pkgdbdir="$with_pkgdbdir" ], -[ pkgdbdir="/var/db/pkg" ]) -AC_SUBST(pkgdbdir) - -dnl Checks for programs. -AC_PROG_INSTALL -AC_PROG_CC -AC_PROG_RANLIB -AC_CHECK_PROGS(AR, ar) -AC_PATH_PROGS(CHMOD, chmod) -AC_PATH_PROGS(CHOWN, chown) -AC_PATH_PROGS(CHGRP, chgrp) -AC_PATH_PROGS(DIGEST, digest) -AC_PATH_PROGS(MKDIR, mkdir) -AC_PATH_PROGS(MTREE, mtree) -AC_PATH_PROGS(RM, rm) -AC_PATH_PROGS(RMDIR, rmdir) -AC_PATH_PROGS(TAR_FULLPATHNAME, tar) - -dnl Checks for header files. -AC_HEADER_STDC -AC_CHECK_HEADERS(db1/db.h) -AC_CHECK_HEADERS(assert.h db.h dirent.h err.h fcntl.h fnmatch.h limits.h md5.h md5global.h netdb.h pwd.h regex.h signal.h stdlib.h string.h termios.h time.h unistd.h vis.h) -AC_CHECK_HEADERS(sys/file.h sys/ioctl.h sys/mount.h sys/param.h sys/queue.h sys/resource.h sys/stat.h sys/time.h sys/types.h sys/vfs.h sys/wait.h) - -dnl Check for libraries -AC_CHECK_LIB(md, MD5File) -AC_CHECK_LIB(db1, dbopen) - -dnl Check for functions -AC_CHECK_FUNCS(chflags) -AC_CHECK_FUNCS(dbopen) -AC_CHECK_FUNCS(err) -AC_CHECK_FUNCS(errx) -AC_CHECK_FUNCS(fgetln) -AC_CHECK_FUNCS(getprogname) -AC_CHECK_FUNCS(mkdtemp) -AC_CHECK_FUNCS(setenv) -AC_CHECK_FUNCS(setprogname) -AC_CHECK_FUNCS(statfs) -AC_CHECK_FUNCS(statvfs) -AC_CHECK_FUNCS(strsep) -AC_CHECK_FUNCS(strlcpy) -AC_CHECK_FUNCS(unsetenv) -AC_CHECK_FUNCS(warn) -AC_CHECK_FUNCS(warnx) -AC_CHECK_FUNCS(MD5File) - -dnl Checks for typedefs, structures, and compiler characteristics. -AC_C___ATTRIBUTE__ -AC_C_CONST -AC_TYPE_SIZE_T - -dnl that's it for now... -AC_OUTPUT(Makefile lib/Makefile lib/lib.h add/Makefile admin/Makefile create/Makefile delete/Makefile info/Makefile) diff --git a/pkgtools/pkg_install/files/create/Makefile.in b/pkgtools/pkg_install/files/create/Makefile.in index ed35b47e18b..06f8f8de2b8 100644 --- a/pkgtools/pkg_install/files/create/Makefile.in +++ b/pkgtools/pkg_install/files/create/Makefile.in @@ -1,42 +1,47 @@ -# $NetBSD: Makefile.in,v 1.6 2003/07/31 09:51:02 grant Exp $ -# Original from FreeBSD, no rcs id. +# $NetBSD: Makefile.in,v 1.7 2003/09/01 16:27:12 jlam Exp $ -prefix= @prefix@ -INSTALL= @INSTALL@ +srcdir= @srcdir@ +prefix= @prefix@ +exec_prefix= @exec_prefix@ +sbindir= @sbindir@ mandir= @mandir@ -mandirman1= ${mandir}/man1 -mandircat1= ${mandir}/cat1 + +man1dir= $(mandir)/man1 +cat1dir= $(mandir)/cat1 CC= @CC@ CCLD= $(CC) LIBS= -linstall @LIBS@ -CPPFLAGS= @CPPFLAGS@ -DEFS= @DEFS@ -I. -I@srcdir@ -I../lib +CPPFLAGS= $(DEFS) @CPPFLAGS@ -I. -I$(srcdir) -I../lib +DEFS= @DEFS@ CFLAGS= @CFLAGS@ LDFLAGS= @LDFLAGS@ -L../lib -LINK= $(CCLD) $(CFLAGS) $(LDFLAGS) -o $@ -COMPILE= $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) - -PROG= pkg_create +INSTALL= @INSTALL@ -SRCS= main.c perform.c pl.c -OBJS= main.o perform.o pl.o +PROG= pkg_create -all: ${PROG} +SRCS= main.c perform.c pl.c +OBJS= $(SRCS:.c=.o) -${PROG}: ${OBJS} - ${LINK} ${OBJS} ${LIBS} +.PHONY: all clean install .c.o: - $(COMPILE) -c $< -o $@ + $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) -c $< + +all: $(PROG) + +$(PROG): $(OBJS) + $(CCLD) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) clean: - rm -f ${OBJS} ${PROG} + rm -f $(OBJS) $(PROG) install: - ${INSTALL} ${PROG} ${prefix}/sbin - ${INSTALL} -m 755 -d ${mandircat1} - ${INSTALL} -m 444 ${PROG}.1 ${mandirman1}/${PROG}.1 - ${INSTALL} -m 444 ${PROG}.cat1 ${mandircat1}/${PROG}.0 + $(INSTALL) -m 755 -d $(sbindir) + $(INSTALL) -m 755 -d $(man1dir) + $(INSTALL) -m 755 -d $(cat1dir) + $(INSTALL) $(PROG) $(sbindir) + $(INSTALL) -m 444 $(PROG).1 $(man1dir)/$(PROG).1 + $(INSTALL) -m 444 $(PROG).cat1 $(man1dir)/$(PROG).0 diff --git a/pkgtools/pkg_install/files/create/create.h b/pkgtools/pkg_install/files/create/create.h index 33a9e9609b6..a2cc37395aa 100644 --- a/pkgtools/pkg_install/files/create/create.h +++ b/pkgtools/pkg_install/files/create/create.h @@ -1,4 +1,4 @@ -/* $NetBSD: create.h,v 1.2 2003/01/14 15:18:33 jschauma Exp $ */ +/* $NetBSD: create.h,v 1.3 2003/09/01 16:27:12 jlam Exp $ */ /* from FreeBSD Id: create.h,v 1.13 1997/10/08 07:46:19 charnier Exp */ @@ -51,6 +51,7 @@ extern int PlistOnly; extern int RelativeLinks; extern int ReorderDirs; extern int update_pkgdb; +extern int create_views; void check_list(char *, package_t *, const char *); void copy_plist(char *, package_t *); diff --git a/pkgtools/pkg_install/files/create/main.c b/pkgtools/pkg_install/files/create/main.c index 7743e7faaaa..ca9537f6b79 100644 --- a/pkgtools/pkg_install/files/create/main.c +++ b/pkgtools/pkg_install/files/create/main.c @@ -1,13 +1,17 @@ -/* $NetBSD: main.c,v 1.2 2003/01/14 15:18:34 jschauma Exp $ */ +/* $NetBSD: main.c,v 1.3 2003/09/01 16:27:12 jlam Exp $ */ -#if 0 +#include <nbcompat.h> +#if HAVE_CONFIG_H +#include "config.h" +#endif +#if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> +#endif #ifndef lint #if 0 static const char *rcsid = "from FreeBSD Id: main.c,v 1.17 1997/10/08 07:46:23 charnier Exp"; #else -__RCSID("$NetBSD: main.c,v 1.2 2003/01/14 15:18:34 jschauma Exp $"); -#endif +__RCSID("$NetBSD: main.c,v 1.3 2003/09/01 16:27:12 jlam Exp $"); #endif #endif @@ -21,18 +25,14 @@ __RCSID("$NetBSD: main.c,v 1.2 2003/01/14 15:18:34 jschauma Exp $"); * This is the create module. * */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#ifdef HAVE_ERR_H +#if HAVE_ERR_H #include <err.h> #endif - #include "lib.h" #include "create.h" -static const char Options[] = "B:C:D:FI:L:OP:RS:UVX:b:c:d:f:hi:k:lm:n:p:r:s:t:v"; +static const char Options[] = "B:C:D:EFI:K:L:OP:RS:UVX:b:c:d:f:hi:k:lm:n:p:r:s:t:v"; char *Prefix = NULL; char *Comment = NULL; @@ -56,6 +56,7 @@ char *realprefix = NULL; char PlayPen[FILENAME_MAX]; size_t PlayPenSize = sizeof(PlayPen); int update_pkgdb = 1; +int create_views = 0; int Dereference = 0; int PlistOnly = 0; int RelativeLinks = 0; @@ -66,7 +67,7 @@ static void usage(void) { fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n", - "usage: pkg_create [-ORUhlVv] [-P dpkgs] [-C cpkgs] [-p prefix] [-f contents]", + "usage: pkg_create [-ORUEhlVv] [-P dpkgs] [-C cpkgs] [-p prefix] [-f contents]", " [-i iscript] [-k dscript] [-r rscript] [-t template]", " [-X excludefile] [-D displayfile] [-m mtreefile]", " [-b build-version-file] [-B build-info-file]", @@ -83,13 +84,16 @@ main(int argc, char **argv) lpkg_t *lpp; setprogname(argv[0]); - while ((ch = getopt(argc, argv, Options)) != -1) switch (ch) { case 'v': Verbose = TRUE; break; + case 'E': + create_views = 1; + break; + case 'I': realprefix = optarg; break; @@ -134,6 +138,10 @@ main(int argc, char **argv) Install = optarg; break; + case 'K': + _pkgdb_setPKGDB_DIR(optarg); + break; + case 'k': DeInstall = optarg; break; @@ -151,7 +159,7 @@ main(int argc, char **argv) break; case 't': - strcpy(PlayPen, optarg); + strlcpy(PlayPen, optarg, sizeof(PlayPen)); break; case 'X': diff --git a/pkgtools/pkg_install/files/create/perform.c b/pkgtools/pkg_install/files/create/perform.c index ca64b07467f..2792027ed29 100644 --- a/pkgtools/pkg_install/files/create/perform.c +++ b/pkgtools/pkg_install/files/create/perform.c @@ -1,13 +1,17 @@ -/* $NetBSD: perform.c,v 1.3 2003/04/11 19:58:50 grant Exp $ */ +/* $NetBSD: perform.c,v 1.4 2003/09/01 16:27:12 jlam Exp $ */ -#if 0 +#include <nbcompat.h> +#if HAVE_CONFIG_H +#include "config.h" +#endif +#if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> +#endif #ifndef lint #if 0 static const char *rcsid = "from FreeBSD Id: perform.c,v 1.38 1997/10/13 15:03:51 jkh Exp"; #else -__RCSID("$NetBSD: perform.c,v 1.3 2003/04/11 19:58:50 grant Exp $"); -#endif +__RCSID("$NetBSD: perform.c,v 1.4 2003/09/01 16:27:12 jlam Exp $"); #endif #endif @@ -34,17 +38,18 @@ __RCSID("$NetBSD: perform.c,v 1.3 2003/04/11 19:58:50 grant Exp $"); #include "lib.h" #include "create.h" -#ifdef HAVE_ERR_H +#if HAVE_ERR_H #include <err.h> #endif - +#if HAVE_SIGNAL_H #include <signal.h> - -#ifdef HAVE_SYS_WAIT_H +#endif +#if HAVE_SYS_WAIT_H #include <sys/wait.h> #endif - +#if HAVE_UNISTD_H #include <unistd.h> +#endif static char *Home; @@ -60,8 +65,8 @@ make_dist(const char *home, const char *pkg, const char *suffix, const package_t FILE *totar; pid_t pid; - if ((args[0] = strrchr(TAR_FULLPATHNAME, '/')) == NULL) - args[0] = TAR_FULLPATHNAME; + if ((args[0] = strrchr(TAR_CMD, '/')) == NULL) + args[0] = TAR_CMD; else args[0]++; @@ -88,9 +93,6 @@ make_dist(const char *home, const char *pkg, const char *suffix, const package_t args[nargs++] = "-"; /* Use stdin for the file. */ args[nargs] = NULL; - if (Verbose) - printf("Creating binary pkg '%s'\n", tball); - /* Set up a pipe for passing the filenames, and fork off a tar process. */ if (pipe(pipefds) == -1) { cleanup(0); @@ -98,15 +100,15 @@ make_dist(const char *home, const char *pkg, const char *suffix, const package_t } if ((pid = fork()) == -1) { cleanup(0); - errx(2, "cannot fork process for %s", TAR_FULLPATHNAME); + errx(2, "cannot fork process for %s", TAR_CMD); } if (pid == 0) { /* The child */ dup2(pipefds[0], 0); close(pipefds[0]); close(pipefds[1]); - execvp(TAR_FULLPATHNAME, args); + execvp(TAR_CMD, args); cleanup(0); - errx(2, "failed to execute %s command", TAR_FULLPATHNAME); + errx(2, "failed to execute %s command", TAR_CMD); } /* Meanwhile, back in the parent process ... */ @@ -150,6 +152,9 @@ make_dist(const char *home, const char *pkg, const char *suffix, const package_t if (Preserve) { (void) fprintf(totar, "%s\n", PRESERVE_FNAME); } + if (create_views) { + (void) fprintf(totar, "%s\n", VIEWS_FNAME); + } for (p = plist->head; p; p = p->next) { if (p->type == PLIST_FILE) { @@ -173,7 +178,7 @@ make_dist(const char *home, const char *pkg, const char *suffix, const package_t /* assume either signal or bad exit is enough for us */ if (ret) { cleanup(0); - errx(2, "%s command failed with code %d", TAR_FULLPATHNAME, ret); + errx(2, "%s command failed with code %d", TAR_CMD, ret); } } @@ -399,6 +404,11 @@ pkg_perform(lpkg_head_t *pkgs) add_plist(&plist, PLIST_IGNORE, NULL); add_plist(&plist, PLIST_FILE, PRESERVE_FNAME); } + if (create_views) { + write_file(VIEWS_FNAME, ""); + add_plist(&plist, PLIST_IGNORE, NULL); + add_plist(&plist, PLIST_FILE, VIEWS_FNAME); + } /* Finally, write out the packing list */ fp = fopen(CONTENTS_FNAME, "w"); diff --git a/pkgtools/pkg_install/files/create/pkg_create.1 b/pkgtools/pkg_install/files/create/pkg_create.1 index 0c7b7d8f998..edd79d1a98f 100644 --- a/pkgtools/pkg_install/files/create/pkg_create.1 +++ b/pkgtools/pkg_install/files/create/pkg_create.1 @@ -1,6 +1,6 @@ -.\" $NetBSD: pkg_create.1,v 1.3 2003/06/26 15:12:07 jschauma Exp $ +.\" $NetBSD: pkg_create.1,v 1.4 2003/09/01 16:27:12 jlam Exp $ .\" -.\" FreeBSD install - a package for the installation and maintainance +.\" FreeBSD install - a package for the installation and maintenance .\" of non-core utilities. .\" .\" Redistribution and use in source and binary forms, with or without @@ -32,7 +32,7 @@ .Nd a utility for creating software package distributions .Sh SYNOPSIS .Nm -.Op Fl hlORUVv +.Op Fl EhlORUVv .Bk -words .Op Fl B Ar build-info-file .Ek @@ -43,6 +43,9 @@ .Op Fl D Ar displayfile .Ek .Bk -words +.Op Fl K Ar pkg_dbdir +.Ek +.Bk -words .Op Fl P Ar dpkgs .Ek .Bk -words @@ -52,9 +55,6 @@ .Op Fl b Ar build-version-file .Ek .Bk -words -.Op Fl f Ar contents -.Ek -.Bk -words .Op Fl i Ar iscript .Ek .Bk -words @@ -156,13 +156,15 @@ Fetch long description for package from file or, if preceded by .Cm - , the argument itself. -.It Fl f Ar packinglist +.It Fl E +Add an empty views file to the package. +.It Fl f Ar packlist Fetch ``packing list'' for package from the file -.Ar packinglist +.Ar packlist or .Cm stdin if -.Ar packinglist +.Ar packlist is a .Cm - (dash). @@ -178,6 +180,15 @@ Set to be the install procedure for the package. This can be any executable program (or shell script). It will be invoked automatically when the package is later installed. +.It Fl K Ar pkg_dbdir +Set +.Ar pkg_dbdir +as the package database directory. +If this option isn't specified, then the package database directory is +taken from the value of the environment variable +.Ev PKG_DBDIR +if it's set, otherwise it defaults to +.Pa /var/db/pkg . .It Fl k Ar dscript Set .Ar dscript diff --git a/pkgtools/pkg_install/files/create/pkg_create.cat1 b/pkgtools/pkg_install/files/create/pkg_create.cat1 index 7ba95b827a2..942d0026e1e 100644 --- a/pkgtools/pkg_install/files/create/pkg_create.cat1 +++ b/pkgtools/pkg_install/files/create/pkg_create.cat1 @@ -4,11 +4,13 @@ NNAAMMEE ppkkgg__ccrreeaattee - a utility for creating software package distributions SSYYNNOOPPSSIISS - ppkkgg__ccrreeaattee [--hhllOORRUUVVvv] [--BB _b_u_i_l_d_-_i_n_f_o_-_f_i_l_e] [--CC _c_p_k_g_s] [--DD _d_i_s_p_l_a_y_f_i_l_e] - [--PP _d_p_k_g_s] [--XX _e_x_c_l_u_d_e_f_i_l_e] [--bb _b_u_i_l_d_-_v_e_r_s_i_o_n_-_f_i_l_e] [--ff _c_o_n_t_e_n_t_s] - [--ii _i_s_c_r_i_p_t] [--II _r_e_a_l_p_r_e_f_i_x] [--kk _d_s_c_r_i_p_t] [--LL _S_r_c_D_i_r] [--mm _m_t_r_e_e_f_i_l_e] - [--pp _p_r_e_f_i_x] [--rr _r_s_c_r_i_p_t] [--ss _s_i_z_e_-_p_k_g_-_f_i_l_e] [--SS _s_i_z_e_-_a_l_l_-_f_i_l_e] - [--tt _t_e_m_p_l_a_t_e] --cc _c_o_m_m_e_n_t --dd _d_e_s_c_r_i_p_t_i_o_n --ff _p_a_c_k_l_i_s_t _p_k_g_-_n_a_m_e + ppkkgg__ccrreeaattee [--EEhhllOORRUUVVvv] [--BB _b_u_i_l_d_-_i_n_f_o_-_f_i_l_e] [--CC _c_p_k_g_s] [--DD _d_i_s_p_l_a_y_f_i_l_e] + [--KK _p_k_g___d_b_d_i_r] [--PP _d_p_k_g_s] [--XX _e_x_c_l_u_d_e_f_i_l_e] + [--bb _b_u_i_l_d_-_v_e_r_s_i_o_n_-_f_i_l_e] [--ii _i_s_c_r_i_p_t] [--II _r_e_a_l_p_r_e_f_i_x] + [--kk _d_s_c_r_i_p_t] [--LL _S_r_c_D_i_r] [--mm _m_t_r_e_e_f_i_l_e] [--pp _p_r_e_f_i_x] + [--rr _r_s_c_r_i_p_t] [--ss _s_i_z_e_-_p_k_g_-_f_i_l_e] [--SS _s_i_z_e_-_a_l_l_-_f_i_l_e] + [--nn _p_r_e_s_e_r_v_e_-_f_i_l_e] [--tt _t_e_m_p_l_a_t_e] --cc _c_o_m_m_e_n_t --dd _d_e_s_c_r_i_p_t_i_o_n + --ff _p_a_c_k_l_i_s_t _p_k_g_-_n_a_m_e DDEESSCCRRIIPPTTIIOONN The ppkkgg__ccrreeaattee command is used to create packages that will subsequently @@ -58,9 +60,11 @@ OOPPTTIIOONNSS Fetch long description for package from file _d_e_s_c or, if preceded by --, the argument itself. - --ff _p_a_c_k_i_n_g_l_i_s_t - Fetch ``packing list'' for package from the file _p_a_c_k_i_n_g_l_i_s_t or - ssttddiinn if _p_a_c_k_i_n_g_l_i_s_t is a -- (dash). + --EE Add an empty views file to the package. + + --ff _p_a_c_k_l_i_s_t + Fetch ``packing list'' for package from the file _p_a_c_k_l_i_s_t or + ssttddiinn if _p_a_c_k_l_i_s_t is a -- (dash). --hh Force tar to follow symbolic links, so that the files they point to are dumped, rather than the links themselves. @@ -74,6 +78,12 @@ OOPPTTIIOONNSS can be any executable program (or shell script). It will be in- voked automatically when the package is later installed. + --KK _p_k_g___d_b_d_i_r + Set _p_k_g___d_b_d_i_r as the package database directory. If this option + isn't specified, then the package database directory is taken + from the value of the environment variable PKG_DBDIR if it's set, + otherwise it defaults to _/_v_a_r_/_d_b_/_p_k_g. + --kk _d_s_c_r_i_p_t Set _d_s_c_r_i_p_t to be the de-install procedure for the package. This can be any executable program (or shell script). It will be in- @@ -130,6 +140,11 @@ OOPPTTIIOONNSS files of this package plus any required packages added up and stored as a ASCII string, terminated by a newline. + --nn _p_r_e_s_e_r_v_e_-_f_i_l_e + The file is used to denote that the package should not be delet- + ed. This is intended for use where the deletion of packages may + present a bootstrap problem. + --ss _s_i_z_e_-_p_k_g_-_f_i_l_e Store the given file for later querying with the pkg_info(1) _-_s flag. The file is expected to contain the the size (in bytes) of @@ -295,4 +310,4 @@ BBUUGGSS cations due to exec argument-space limitations (this depends on the value returned by ssyyssccoonnff(___S_C___A_R_G___M_A_X)). -NetBSD 1.6 April 21, 1995 5 +NetBSD 1.6.1_STABLE January 10, 2003 5 diff --git a/pkgtools/pkg_install/files/create/pl.c b/pkgtools/pkg_install/files/create/pl.c index 73ea88a73cd..8322d05717b 100644 --- a/pkgtools/pkg_install/files/create/pl.c +++ b/pkgtools/pkg_install/files/create/pl.c @@ -1,13 +1,17 @@ -/* $NetBSD: pl.c,v 1.2 2003/01/06 04:34:16 jschauma Exp $ */ +/* $NetBSD: pl.c,v 1.3 2003/09/01 16:27:12 jlam Exp $ */ -#if 0 +#include <nbcompat.h> +#if HAVE_CONFIG_H +#include "config.h" +#endif +#if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> +#endif #ifndef lint #if 0 static const char *rcsid = "from FreeBSD Id: pl.c,v 1.11 1997/10/08 07:46:35 charnier Exp"; #else -__RCSID("$NetBSD: pl.c,v 1.2 2003/01/06 04:34:16 jschauma Exp $"); -#endif +__RCSID("$NetBSD: pl.c,v 1.3 2003/09/01 16:27:12 jlam Exp $"); #endif #endif @@ -33,16 +37,10 @@ __RCSID("$NetBSD: pl.c,v 1.2 2003/01/06 04:34:16 jschauma Exp $"); #include "lib.h" #include "create.h" - -#ifdef HAVE_ERR_H +#if HAVE_ERR_H #include <err.h> #endif - -#ifdef HAVE_MD5GLOBAL_H -#include <md5global.h> -#endif - -#ifdef HAVE_MD5_H +#if HAVE_MD5_H #include <md5.h> #endif @@ -161,7 +159,10 @@ check_list(char *home, package_t *pkg, const char *PkgName) if (update_pkgdb) { char *s, t[FILENAME_MAX]; - (void) snprintf(t, sizeof(t), "%s/%s", cwd, p->name); + (void) snprintf(t, sizeof(t), "%s%s%s", + cwd, + (strcmp(cwd, "/") == 0) ? "" : "/", + p->name); s = pkgdb_retrieve(t); #ifdef PKGDB_DEBUG @@ -184,7 +185,10 @@ check_list(char *home, package_t *pkg, const char *PkgName) } else { /* after @cwd */ /* prepend DESTDIR if set? - HF */ - (void) snprintf(name, sizeof(name), "%s/%s", cwd, p->name); + (void) snprintf(name, sizeof(name), "%s%s%s", + cwd, + (strcmp(cwd, "/") == 0) ? "" : "/", + p->name); } if (lstat(name, &st) < 0) { warnx("can't stat `%s'", name); @@ -207,7 +211,8 @@ check_list(char *home, package_t *pkg, const char *PkgName) warnx("Warning - block special device `%s' in PLIST", name); break; default: - (void) strcpy(buf, CHECKSUM_HEADER); + (void) strlcpy(buf, CHECKSUM_HEADER, + sizeof(buf)); if (MD5File(name, &buf[ChecksumHeaderLen]) != (char *) NULL) { tmp = new_plist_entry(); tmp->name = strdup(buf); diff --git a/pkgtools/pkg_install/files/delete/Makefile.in b/pkgtools/pkg_install/files/delete/Makefile.in index 5a66459dd25..85d98cbd609 100644 --- a/pkgtools/pkg_install/files/delete/Makefile.in +++ b/pkgtools/pkg_install/files/delete/Makefile.in @@ -1,42 +1,47 @@ -# $NetBSD: Makefile.in,v 1.6 2003/07/31 09:51:02 grant Exp $ -# Original from FreeBSD, no rcs id. +# $NetBSD: Makefile.in,v 1.7 2003/09/01 16:27:13 jlam Exp $ -prefix= @prefix@ -INSTALL= @INSTALL@ +srcdir= @srcdir@ +prefix= @prefix@ +exec_prefix= @exec_prefix@ +sbindir= @sbindir@ mandir= @mandir@ -mandirman1= ${mandir}/man1 -mandircat1= ${mandir}/cat1 + +man1dir= $(mandir)/man1 +cat1dir= $(mandir)/cat1 CC= @CC@ CCLD= $(CC) LIBS= -linstall @LIBS@ -CPPFLAGS= @CPPFLAGS@ -DEFS= @DEFS@ -I. -I@srcdir@ -I../lib +CPPFLAGS= $(DEFS) @CPPFLAGS@ -I. -I$(srcdir) -I../lib +DEFS= @DEFS@ CFLAGS= @CFLAGS@ LDFLAGS= @LDFLAGS@ -L../lib -LINK= $(CCLD) $(CFLAGS) $(LDFLAGS) -o $@ -COMPILE= $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) - -PROG= pkg_delete +INSTALL= @INSTALL@ -SRCS= main.c perform.c -OBJS= main.o perform.o +PROG= pkg_delete -all: ${PROG} +SRCS= main.c perform.c +OBJS= $(SRCS:.c=.o) -${PROG}: ${OBJS} - ${LINK} ${OBJS} ${LIBS} +.PHONY: all clean install .c.o: - $(COMPILE) -c $< -o $@ + $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) -c $< + +all: $(PROG) + +$(PROG): $(OBJS) + $(CCLD) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) clean: - rm -f ${OBJS} ${PROG} + rm -f $(OBJS) $(PROG) install: - ${INSTALL} ${PROG} ${prefix}/sbin - ${INSTALL} -m 755 -d ${mandircat1} - ${INSTALL} -m 444 ${PROG}.1 ${mandirman1}/${PROG}.1 - ${INSTALL} -m 444 ${PROG}.cat1 ${mandircat1}/${PROG}.0 + $(INSTALL) -m 755 -d $(sbindir) + $(INSTALL) -m 755 -d $(man1dir) + $(INSTALL) -m 755 -d $(cat1dir) + $(INSTALL) $(PROG) $(sbindir) + $(INSTALL) -m 444 $(PROG).1 $(man1dir)/$(PROG).1 + $(INSTALL) -m 444 $(PROG).cat1 $(man1dir)/$(PROG).0 diff --git a/pkgtools/pkg_install/files/delete/delete.h b/pkgtools/pkg_install/files/delete/delete.h index 62823872942..f8e714c493f 100644 --- a/pkgtools/pkg_install/files/delete/delete.h +++ b/pkgtools/pkg_install/files/delete/delete.h @@ -1,4 +1,4 @@ -/* $NetBSD: delete.h,v 1.1.1.1 2002/12/20 18:14:07 schmonz Exp $ */ +/* $NetBSD: delete.h,v 1.2 2003/09/01 16:27:13 jlam Exp $ */ /* from FreeBSD Id: delete.h,v 1.4 1997/02/22 16:09:35 peter Exp */ diff --git a/pkgtools/pkg_install/files/delete/main.c b/pkgtools/pkg_install/files/delete/main.c index 6d2c35c36d1..80cdc172b92 100644 --- a/pkgtools/pkg_install/files/delete/main.c +++ b/pkgtools/pkg_install/files/delete/main.c @@ -1,13 +1,17 @@ -/* $NetBSD: main.c,v 1.6 2003/06/26 00:29:01 jschauma Exp $ */ +/* $NetBSD: main.c,v 1.7 2003/09/01 16:27:13 jlam Exp $ */ -#if 0 +#include <nbcompat.h> +#if HAVE_CONFIG_H +#include "config.h" +#endif +#if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> +#endif #ifndef lint #if 0 static char *rcsid = "from FreeBSD Id: main.c,v 1.11 1997/10/08 07:46:48 charnier Exp"; #else -__RCSID("$NetBSD: main.c,v 1.6 2003/06/26 00:29:01 jschauma Exp $"); -#endif +__RCSID("$NetBSD: main.c,v 1.7 2003/09/01 16:27:13 jlam Exp $"); #endif #endif @@ -31,19 +35,17 @@ __RCSID("$NetBSD: main.c,v 1.6 2003/06/26 00:29:01 jschauma Exp $"); * This is the delete module. * */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#ifdef HAVE_ERR_H +#if HAVE_ERR_H #include <err.h> #endif - +#if HAVE_ERRNO_H #include <errno.h> +#endif #include "lib.h" #include "delete.h" -static char Options[] = "DFORVdfhnp:rv"; +static char Options[] = "DFK:ORVdfhnp:rv"; char *Prefix = NULL; char *ProgramPath = NULL; @@ -75,28 +77,24 @@ main(int argc, char **argv) while ((ch = getopt(argc, argv, Options)) != -1) switch (ch) { - case 'v': - Verbose = TRUE; + case 'D': + NoDeInstall = TRUE; break; - case 'f': - Force = TRUE; + case 'd': + CleanDirs = TRUE; break; case 'F': File2Pkg = TRUE; break; - case 'p': - Prefix = optarg; - break; - - case 'D': - NoDeInstall = TRUE; + case 'f': + Force += 1; break; - case 'd': - CleanDirs = TRUE; + case 'K': + _pkgdb_setPKGDB_DIR(optarg); break; case 'n': @@ -104,22 +102,30 @@ main(int argc, char **argv) Verbose = TRUE; break; - case 'r': - Recurse_up = TRUE; + case 'O': + OnlyDeleteFromPkgDB = TRUE; + break; + + case 'p': + Prefix = optarg; break; case 'R': Recurse_down = TRUE; break; - case 'O': - OnlyDeleteFromPkgDB = TRUE; + case 'r': + Recurse_up = TRUE; break; case 'V': show_version(); /* NOTREACHED */ + case 'v': + Verbose = TRUE; + break; + case 'h': case '?': default: @@ -134,8 +140,8 @@ main(int argc, char **argv) /* Get all the remaining package names, if any */ if (File2Pkg && !pkgdb_open(ReadOnly)) { - err(EXIT_FAILURE, "cannot open pkgdb"); - } + err(EXIT_FAILURE, "cannot open pkgdb"); + } /* Get all the remaining package names, if any */ for ( ; *argv ; argv++) { @@ -148,20 +154,29 @@ main(int argc, char **argv) if ((s = pkgdb_retrieve(*argv)) == NULL) { errx(EXIT_FAILURE, "No matching pkg for %s in pkgdb.", *argv); } - lpp = alloc_lpkg(s); - TAILQ_INSERT_TAIL(&pkgs, lpp, lp_link); + lpp = alloc_lpkg(s); + TAILQ_INSERT_TAIL(&pkgs, lpp, lp_link); } else if (ispkgpattern(*argv)) { switch(findmatchingname(_pkgdb_getPKGDB_DIR(), *argv, add_to_list_fn, &pkgs)) { case 0: - errx(EXIT_FAILURE, "No matching pkg for %s.", *argv); + errx(EXIT_FAILURE, "No matching pkg for %s.", *argv); case -1: errx(EXIT_FAILURE, "error expanding '%s' ('%s' nonexistent?)", *argv, _pkgdb_getPKGDB_DIR()); } - } else { - lpp = alloc_lpkg(*argv); - TAILQ_INSERT_TAIL(&pkgs, lpp, lp_link); + } else { + char *dbdir; + + dbdir = _pkgdb_getPKGDB_DIR(); + if (**argv == '/' && strncmp(*argv, dbdir, strlen(dbdir)) == 0) { + *argv += strlen(dbdir) + 1; + if ((*argv)[strlen(*argv) - 1] == '/') { + (*argv)[strlen(*argv) - 1] = 0; + } } + lpp = alloc_lpkg(*argv); + TAILQ_INSERT_TAIL(&pkgs, lpp, lp_link); } + } if (File2Pkg) { pkgdb_close(); @@ -188,11 +203,11 @@ main(int argc, char **argv) for (lpp = TAILQ_FIRST(&pkgs); lpp ; lpp = TAILQ_NEXT(lpp, lp_link)) { if (!pkgdb_remove_pkg(lpp->lp_name)) { ex = EXIT_FAILURE; - } - } + } + } pkgdb_close(); return ex; - } + } if ((ex = pkg_perform(&pkgs)) != 0) { if (Verbose) { warnx("%d package deletion(s) failed", ex); diff --git a/pkgtools/pkg_install/files/delete/perform.c b/pkgtools/pkg_install/files/delete/perform.c index 6fca0c8a4e6..ca871f88e25 100644 --- a/pkgtools/pkg_install/files/delete/perform.c +++ b/pkgtools/pkg_install/files/delete/perform.c @@ -1,13 +1,17 @@ -/* $NetBSD: perform.c,v 1.3 2003/01/14 15:18:34 jschauma Exp $ */ +/* $NetBSD: perform.c,v 1.4 2003/09/01 16:27:13 jlam Exp $ */ -#if 0 +#include <nbcompat.h> +#if HAVE_CONFIG_H +#include "config.h" +#endif +#if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> +#endif #ifndef lint #if 0 static const char *rcsid = "from FreeBSD Id: perform.c,v 1.15 1997/10/13 15:03:52 jkh Exp"; #else -__RCSID("$NetBSD: perform.c,v 1.3 2003/01/14 15:18:34 jschauma Exp $"); -#endif +__RCSID("$NetBSD: perform.c,v 1.4 2003/09/01 16:27:13 jlam Exp $"); #endif #endif @@ -58,18 +62,13 @@ __RCSID("$NetBSD: perform.c,v 1.3 2003/01/14 15:18:34 jschauma Exp $"); * * Added the require find and require delete code */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#ifdef HAVE_ERR_H +#if HAVE_ERR_H #include <err.h> #endif - -#ifdef HAVE_FCNTL_H +#if HAVE_FCNTL_H #include <fcntl.h> #endif - #include "lib.h" #include "delete.h" @@ -125,12 +124,10 @@ undepend(const char *deppkgname, void *vp) char fname[FILENAME_MAX], ftmp[FILENAME_MAX]; char fbuf[FILENAME_MAX]; FILE *fp, *fpwr; - char *tmp; int s; (void) snprintf(fname, sizeof(fname), "%s/%s/%s", - (tmp = getenv(PKG_DBDIR)) ? tmp : DEF_LOG_DIR, - deppkgname, REQUIRED_BY_FNAME); + _pkgdb_getPKGDB_DIR(), deppkgname, REQUIRED_BY_FNAME); fp = fopen(fname, "r"); if (fp == NULL) { warnx("couldn't open dependency file `%s'", fname); @@ -177,6 +174,92 @@ undepend(const char *deppkgname, void *vp) } /* + * Remove the current view's package dbdir from the +VIEWS file of the + * depoted package named by pkgname. + */ +static int +unview(const char *pkgname) +{ + char fname[FILENAME_MAX], ftmp[FILENAME_MAX]; + char fbuf[FILENAME_MAX]; + char dbdir[FILENAME_MAX]; + FILE *fp, *fpwr; + int s; + int cc; + + (void) snprintf(dbdir, sizeof(dbdir), "%s", _pkgdb_getPKGDB_DIR()); + + /* Get the depot directory. */ + (void) snprintf(fname, sizeof(fname), "%s/%s/%s", + dbdir, pkgname, DEPOT_FNAME); + if ((fp = fopen(fname, "r")) == NULL) { + warnx("unable to open `%s' file", fname); + return -1; + } + if (fgets(fbuf, sizeof(fbuf), fp) == NULL) { + (void) fclose(fp); + warnx("empty depot file `%s'", fname); + return -1; + } + if (fbuf[cc = strlen(fbuf) - 1] == '\n') { + fbuf[cc] = 0; + } + fclose(fp); + + /* + * Copy the contents of the +VIEWS file into a temp file, but + * skip copying the name of the current view's package dbdir. + */ + (void) snprintf(fname, sizeof(fname), "%s/%s", fbuf, VIEWS_FNAME); + if ((fp = fopen(fname, "r")) == NULL) { + warnx("unable to open `%s' file", fname); + return -1; + } + (void) snprintf(ftmp, sizeof(ftmp), "%s.XXXXXX", fname); + if ((s = mkstemp(ftmp)) == -1) { + (void) fclose(fp); + warnx("unable to open `%s' temp file", ftmp); + return -1; + } + if ((fpwr = fdopen(s, "w")) == NULL) { + (void) close(s); + (void) remove(ftmp); + (void) fclose(fp); + warnx("unable to fdopen `%s' temp file", ftmp); + return -1; + } + while (fgets(fbuf, sizeof(fbuf), fp) != NULL) { + if (fbuf[cc = strlen(fbuf) - 1] == '\n') { + fbuf[cc] = 0; + } + if (strcmp(fbuf, dbdir) != 0) { + (void) fputs(fbuf, fpwr); + (void) putc('\n', fpwr); + } + } + (void) fclose(fp); + if (fchmod(s, 0644) == FAIL) { + (void) fclose(fpwr); + (void) remove(ftmp); + warnx("unable to change permissions of `%s' temp file", ftmp); + return -1; + } + if (fclose(fpwr) == EOF) { + (void) remove(ftmp); + warnx("unable to close `%s' temp file", ftmp); + return -1; + } + + /* Rename the temp file to the +VIEWS file */ + if (rename(ftmp, fname) == -1) { + (void) remove(ftmp); + warnx("unable to rename `%s' to `%s'", ftmp, fname); + return -1; + } + return 0; +} + +/* * Delete from directory 'home' all packages on lpkg_list. * If tryall is set, ignore errors from pkg_delete(1). */ @@ -185,7 +268,6 @@ require_delete(char *home, int tryall) { lpkg_t *lpp; int rv, fail; - char *tmp; int oldcwd; /* save cwd */ @@ -193,8 +275,7 @@ require_delete(char *home, int tryall) if (oldcwd == -1) err(EXIT_FAILURE, "cannot open \".\""); - (void) snprintf(pkgdir, sizeof(pkgdir), "%s", - (tmp = getenv(PKG_DBDIR)) ? tmp : DEF_LOG_DIR); + (void) snprintf(pkgdir, sizeof(pkgdir), "%s", _pkgdb_getPKGDB_DIR()); /* walk list of things to delete */ fail = 0; @@ -244,7 +325,7 @@ require_delete(char *home, int tryall) Prefix ? "-p" : "", Prefix ? Prefix : "", Verbose ? "-v" : "", - Force ? "-f" : "", + (Force > 1) ? "-f -f" : (Force == 1) ? "-f" : "", NoDeInstall ? "-D" : "", CleanDirs ? "-d" : "", Fake ? "-n" : "", @@ -286,7 +367,7 @@ require_find_recursive_up(lpkg_t *thislpp) lpkg_head_t reqq; lpkg_t *lpp = NULL; FILE *cfile; - char *nl, *tmp; + char *nl; /* see if we are on the find queue -- circular dependency */ if ((lpp = find_on_queue(&lpfindq, thislpp->lp_name))) { @@ -297,7 +378,7 @@ require_find_recursive_up(lpkg_t *thislpp) TAILQ_INIT(&reqq); (void) snprintf(pkgdir, sizeof(pkgdir), "%s/%s", - (tmp = getenv(PKG_DBDIR)) ? tmp : DEF_LOG_DIR, thislpp->lp_name); + _pkgdb_getPKGDB_DIR(), thislpp->lp_name); /* change to package's dir */ if (chdir(pkgdir) == FAIL) { @@ -401,7 +482,6 @@ require_find_recursive_down(lpkg_t *thislpp, package_t *plist) while ((lpp = TAILQ_FIRST(&reqq))) { FILE *cfile; package_t rPlist; - char *tmp; /* remove a direct req from our queue */ TAILQ_REMOVE(&reqq, lpp, lp_link); @@ -411,7 +491,7 @@ require_find_recursive_down(lpkg_t *thislpp, package_t *plist) rPlist.tail = NULL; /* prepare for recursion */ - chdir ((tmp = getenv(PKG_DBDIR)) ? tmp : DEF_LOG_DIR); + chdir(_pkgdb_getPKGDB_DIR()); if (ispkgpattern(lpp->lp_name)) { char installed[FILENAME_MAX]; if (findmatchingname(".", lpp->lp_name, note_whats_installed, installed) != 1) { @@ -523,17 +603,20 @@ require_print(void) static int pkg_do(char *pkg) { - FILE *cfile; - char home[FILENAME_MAX]; - plist_t *p; - char *tmp; + plist_t *p; + FILE *cfile; + FILE *fp; + char home[FILENAME_MAX]; + char view[FILENAME_MAX]; + int cc; + Boolean is_depoted_pkg = FALSE; /* Reset some state */ if (Plist.head) free_plist(&Plist); - (void) snprintf(LogDir, sizeof(LogDir), "%s/%s", (tmp = getenv(PKG_DBDIR)) ? tmp : DEF_LOG_DIR, - pkg); + (void) snprintf(LogDir, sizeof(LogDir), "%s/%s", + _pkgdb_getPKGDB_DIR(), pkg); if (!fexists(LogDir) || !isdir(LogDir)) { { /* Check if the given package name matches something @@ -559,9 +642,14 @@ pkg_do(char *pkg) warnx("unable to change directory to %s! deinstall failed", LogDir); return 1; } + if (!fexists(CONTENTS_FNAME)) { + warnx("package '%s' is not installed, %s missing", pkg, CONTENTS_FNAME); + if (!Force) + return 1; + } if (fexists(PRESERVE_FNAME)) { printf("Package `%s' is marked as not for deletion\n", pkg); - if (!Force) { + if (Force <= 1) { return 1; } } @@ -585,6 +673,28 @@ pkg_do(char *pkg) } else require_delete(home, 0); } + if (!isemptyfile(VIEWS_FNAME)) { + /* This package has instances in other views */ + /* Delete them from the views */ + if ((fp = fopen(VIEWS_FNAME, "r")) == NULL) { + warnx("unable to open '%s' file", VIEWS_FNAME); + return 1; + } + while (fgets(view, sizeof(view), fp) != NULL) { + if (view[cc = strlen(view) - 1] == '\n') { + view[cc] = 0; + } + if (Verbose) { + printf("Deleting package %s instance from `%s' view\n", pkg, view); + } + if (vsystem("%s -K %s %s", ProgramPath, view, pkg) != 0) { + warnx("unable to delete package %s from view %s", pkg, view); + (void) fclose(fp); + return 1; + } + } + (void) fclose(fp); + } sanity_check(LogDir); cfile = fopen(CONTENTS_FNAME, "r"); if (!cfile) { @@ -613,7 +723,24 @@ pkg_do(char *pkg) return 1; } } - if (!NoDeInstall && fexists(DEINSTALL_FNAME)) { + /* + * Ensure that we don't do VIEW-DEINSTALL action for old packages + * or for the package in its depot directory. + */ + if (!NoDeInstall && fexists(DEINSTALL_FNAME) && fexists(DEPOT_FNAME)) { + if (Fake) { + printf("Would execute view de-install script at this point (arg: VIEW-DEINSTALL).\n"); + } else { + vsystem("%s +x %s", CHMOD_CMD, DEINSTALL_FNAME); /* make sure */ + if (vsystem("./%s %s VIEW-DEINSTALL", DEINSTALL_FNAME, pkg)) { + warnx("view deinstall script returned error status"); + if (!Force) { + return 1; + } + } + } + } + if (!NoDeInstall && fexists(DEINSTALL_FNAME) && !fexists(DEPOT_FNAME)) { if (Fake) printf("Would execute de-install script at this point (arg: DEINSTALL).\n"); else { @@ -632,15 +759,26 @@ pkg_do(char *pkg) "couldn't entirely delete package `%s'\n" "(perhaps the packing list is incorrectly specified?)", pkg); } - /* Remove this package from the +REQUIRED_BY list of the packages this depends on */ - for (p = Plist.head; p; p = p->next) { - if (p->type != PLIST_PKGDEP) - continue; + if (!isemptyfile(DEPOT_FNAME)) { if (Verbose) - printf("Attempting to remove dependency on package `%s'\n", p->name); + printf("Attempting to remove the %s registration on package `%s'\n", VIEWS_FNAME, pkg); if (!Fake) - findmatchingname((tmp = getenv(PKG_DBDIR)) ? tmp : DEF_LOG_DIR, - p->name, undepend, pkg); + (void) unview(pkg); + } + /* + * If this isn't a package in a view, then remove this package + * from the +REQUIRED_BY list of the packages this depends on. + */ + if (!fexists(DEPOT_FNAME)) { + for (p = Plist.head; p; p = p->next) { + if (p->type != PLIST_PKGDEP) + continue; + if (Verbose) + printf("Attempting to remove dependency on package `%s'\n", p->name); + if (!Fake) + findmatchingname(_pkgdb_getPKGDB_DIR(), + p->name, undepend, pkg); + } } if (Recurse_down) { /* Also remove the packages further down, now that there's @@ -652,11 +790,11 @@ pkg_do(char *pkg) require_delete(home, 1); } - if (!NoDeInstall && fexists(DEINSTALL_FNAME)) { + if (!NoDeInstall && fexists(DEINSTALL_FNAME) && !fexists(DEPOT_FNAME)) { if (Fake) printf("Would execute post-de-install script at this point (arg: POST-DEINSTALL).\n"); else { - vsystem("chmod +x %s", DEINSTALL_FNAME); /* make sure */ + vsystem("%s +x %s", CHMOD_CMD, DEINSTALL_FNAME); /* make sure */ if (vsystem("./%s %s POST-DEINSTALL", DEINSTALL_FNAME, pkg)) { warnx("post-deinstall script returned error status"); if (!Force) @@ -664,16 +802,28 @@ pkg_do(char *pkg) } } } + if (fexists(VIEWS_FNAME)) + is_depoted_pkg = TRUE; + /* Change out of LogDir before we remove it. - * Do not fail here, as the package is not yet completely deleted! */ + * Do not fail here, as the package is not yet completely deleted! */ if (chdir(home) == FAIL) warnx("Oops - removed current working directory. Oh, well."); if (!Fake) { /* Finally nuke the +-files and the pkgdb-dir (/var/db/pkg/foo) */ - if (vsystem("%s -r %s", RM, LogDir)) { - warnx("couldn't remove log entry in %s, deinstall failed", LogDir); - if (!Force) - return 1; + if (is_depoted_pkg) { + (void) vsystem("%s %s/+*", REMOVE_CMD, LogDir); + if (isemptydir(LogDir)) + (void) vsystem("%s %s", RMDIR_CMD, LogDir); + else + warnx("%s is not empty", LogDir); + return 0; + } else { + if (vsystem("%s -r %s", REMOVE_CMD, LogDir)) { + warnx("couldn't remove log entry in %s, deinstall failed", LogDir); + if (!Force) + return 1; + } } } return 0; diff --git a/pkgtools/pkg_install/files/delete/pkg_delete.1 b/pkgtools/pkg_install/files/delete/pkg_delete.1 index 3426bca45e4..daa1fc7ff8a 100644 --- a/pkgtools/pkg_install/files/delete/pkg_delete.1 +++ b/pkgtools/pkg_install/files/delete/pkg_delete.1 @@ -1,6 +1,6 @@ -.\" $NetBSD: pkg_delete.1,v 1.2 2003/01/14 15:18:34 jschauma Exp $ +.\" $NetBSD: pkg_delete.1,v 1.3 2003/09/01 16:27:13 jlam Exp $ .\" -.\" FreeBSD install - a package for the installation and maintainance +.\" FreeBSD install - a package for the installation and maintenance .\" of non-core utilities. .\" .\" Redistribution and use in source and binary forms, with or without @@ -27,6 +27,9 @@ .Nm .Op Fl DdFfnORrVv .Bk -words +.Op Fl K Ar pkg_dbdir +.Ek +.Bk -words .Op Fl p Ar prefix .Ek .Ar pkg-name ... @@ -99,6 +102,15 @@ instead of the package-name. .It Fl f Force removal of the package, even if a dependency is recorded or the deinstall or require script fails. +.It Fl K Ar pkg_dbdir +Set +.Ar pkg_dbdir +as the package database directory. +If this option isn't specified, then the package database directory is +taken from the value of the environment variable +.Ev PKG_DBDIR +if it's set, otherwise it defaults to +.Pa /var/db/pkg . .It Fl n Don't actually deinstall a package, just report the steps that would be taken if it were. @@ -139,7 +151,11 @@ Turn on verbose output. does pretty much what it says. It examines installed package records in .Pa /var/db/pkg/\*[Lt]pkg-name\*[Gt] , -deletes the package contents, and finally removes the package records. +deletes the package contents, and finally removes the package records +(if an alternate package database directory is specified, then it +overrides the +.Pa /var/db/pkg +path shown above). .Pp If a package is required by other installed packages, .Nm @@ -151,7 +167,7 @@ option is given). If a package has been marked as a .Cm preserved package, it will not be able to be deleted -(unless the +(unless more than one occurrence of the .Fl f option is given). .Pp @@ -197,6 +213,12 @@ script is called as: .Bd -filled -offset indent -compact .Cm deinstall .Ar \*[Lt]pkg-name\*[Gt] +.Ar VIEW-DEINSTALL +.Ed +before removing the package from a view, and as: +.Bd -filled -offset indent -compact +.Cm deinstall +.Ar \*[Lt]pkg-name\*[Gt] .Ar DEINSTALL .Ed before deleting all files and as: @@ -207,6 +229,7 @@ before deleting all files and as: .Ed after deleting them. Passing the keywords +.Ar VIEW-DEINSTALL , .Ar DEINSTALL and .Ar POST-DEINSTALL diff --git a/pkgtools/pkg_install/files/delete/pkg_delete.cat1 b/pkgtools/pkg_install/files/delete/pkg_delete.cat1 index 1f08bf8ae84..8157cb3b809 100644 --- a/pkgtools/pkg_install/files/delete/pkg_delete.cat1 +++ b/pkgtools/pkg_install/files/delete/pkg_delete.cat1 @@ -5,7 +5,7 @@ NNAAMMEE distributions SSYYNNOOPPSSIISS - ppkkgg__ddeelleettee [--DDddFFffnnOORRrrVVvv] [--pp _p_r_e_f_i_x] _p_k_g_-_n_a_m_e _._._. + ppkkgg__ddeelleettee [--DDddFFffnnOORRrrVVvv] [--KK _p_k_g___d_b_d_i_r] [--pp _p_r_e_f_i_x] _p_k_g_-_n_a_m_e _._._. DDEESSCCRRIIPPTTIIOONN The ppkkgg__ddeelleettee command is used to delete packages that have been previ- @@ -53,6 +53,12 @@ OOPPTTIIOONNSS --ff Force removal of the package, even if a dependency is recorded or the deinstall or require script fails. + --KK _p_k_g___d_b_d_i_r + Set _p_k_g___d_b_d_i_r as the package database directory. If this option + isn't specified, then the package database directory is taken + from the value of the environment variable PKG_DBDIR if it's set, + otherwise it defaults to _/_v_a_r_/_d_b_/_p_k_g. + --nn Don't actually deinstall a package, just report the steps that would be taken if it were. @@ -82,12 +88,18 @@ OOPPTTIIOONNSS TTEECCHHNNIICCAALL DDEETTAAIILLSS ppkkgg__ddeelleettee does pretty much what it says. It examines installed package records in _/_v_a_r_/_d_b_/_p_k_g_/_<_p_k_g_-_n_a_m_e_>, deletes the package contents, and fi- - nally removes the package records. + nally removes the package records (if an alternate package database di- + rectory is specified, then it overrides the _/_v_a_r_/_d_b_/_p_k_g path shown + above). If a package is required by other installed packages, ppkkgg__ddeelleettee will list those dependent packages and refuse to delete the package (unless the --ff option is given). + If a package has been marked as a pprreesseerrvveedd package, it will not be able + to be deleted (unless more than one occurrence of the --ff option is giv- + en). + If a filename is given instead of a package name, the package of which the given file belongs to can be deleted if the --FF Flag is given. The filename needs to be absolute, see the output produced by the pkg_info @@ -106,12 +118,14 @@ TTEECCHHNNIICCAALL DDEETTAAIILLSS up any additional messy details around the package's installation, since all ppkkgg__ddeelleettee knows how to do is delete the files created in the origi- nal distribution. The ddeeiinnssttaallll script is called as: + ddeeiinnssttaallll _<_p_k_g_-_n_a_m_e_> _V_I_E_W_-_D_E_I_N_S_T_A_L_L + before removing the package from a view, and as: ddeeiinnssttaallll _<_p_k_g_-_n_a_m_e_> _D_E_I_N_S_T_A_L_L before deleting all files and as: ddeeiinnssttaallll _<_p_k_g_-_n_a_m_e_> _P_O_S_T_-_D_E_I_N_S_T_A_L_L - after deleting them. Passing the keywords _D_E_I_N_S_T_A_L_L and _P_O_S_T_-_D_E_I_N_S_T_A_L_L - lets you potentially write only one program/script that handles all as- - pects of installation and deletion. + after deleting them. Passing the keywords _V_I_E_W_-_D_E_I_N_S_T_A_L_L, _D_E_I_N_S_T_A_L_L and + _P_O_S_T_-_D_E_I_N_S_T_A_L_L lets you potentially write only one program/script that + handles all aspects of installation and deletion. All scripts are called with the environment variable PKG_PREFIX set to the installation prefix (see the --pp option above). This allows a package @@ -132,4 +146,4 @@ AAUUTTHHOORRSS NetBSD wildcard dependency processing, pkgdb, recursive "down" delete, etc. -NetBSD 1.6 March 8, 1999 3 +NetBSD 1.6.1_STABLE March 8, 1999 3 diff --git a/pkgtools/pkg_install/files/info/Makefile.in b/pkgtools/pkg_install/files/info/Makefile.in index acddd5b933a..2b589ba9664 100644 --- a/pkgtools/pkg_install/files/info/Makefile.in +++ b/pkgtools/pkg_install/files/info/Makefile.in @@ -1,42 +1,47 @@ -# $NetBSD: Makefile.in,v 1.6 2003/07/31 09:51:02 grant Exp $ -# Original from FreeBSD, no rcs id. +# $NetBSD: Makefile.in,v 1.7 2003/09/01 16:27:13 jlam Exp $ -prefix= @prefix@ -INSTALL= @INSTALL@ +srcdir= @srcdir@ +prefix= @prefix@ +exec_prefix= @exec_prefix@ +sbindir= @sbindir@ mandir= @mandir@ -mandirman1= ${mandir}/man1 -mandircat1= ${mandir}/cat1 + +man1dir= $(mandir)/man1 +cat1dir= $(mandir)/cat1 CC= @CC@ CCLD= $(CC) LIBS= -linstall @LIBS@ -CPPFLAGS= @CPPFLAGS@ -DEFS= @DEFS@ -I. -I@srcdir@ -I../lib +CPPFLAGS= $(DEFS) @CPPFLAGS@ -I. -I$(srcdir) -I../lib +DEFS= @DEFS@ CFLAGS= @CFLAGS@ LDFLAGS= @LDFLAGS@ -L../lib -LINK= $(CCLD) $(CFLAGS) $(LDFLAGS) -o $@ -COMPILE= $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) - -PROG= pkg_info +INSTALL= @INSTALL@ -SRCS= main.c perform.c show.c -OBJS= main.o perform.o show.o +PROG= pkg_info -all: ${PROG} +SRCS= main.c perform.c show.c +OBJS= $(SRCS:.c=.o) -${PROG}: ${OBJS} - ${LINK} ${OBJS} ${LIBS} +.PHONY: all clean install .c.o: - $(COMPILE) -c $< -o $@ + $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) -c $< + +all: $(PROG) + +$(PROG): $(OBJS) + $(CCLD) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) clean: - rm -f ${OBJS} ${PROG} + rm -f $(OBJS) $(PROG) install: - ${INSTALL} ${PROG} ${prefix}/sbin - ${INSTALL} -m 755 -d ${mandircat1} - ${INSTALL} -m 444 ${PROG}.1 ${mandirman1}/${PROG}.1 - ${INSTALL} -m 444 ${PROG}.cat1 ${mandircat1}/${PROG}.0 + $(INSTALL) -m 755 -d $(sbindir) + $(INSTALL) -m 755 -d $(man1dir) + $(INSTALL) -m 755 -d $(cat1dir) + $(INSTALL) $(PROG) $(sbindir) + $(INSTALL) -m 444 $(PROG).1 $(man1dir)/$(PROG).1 + $(INSTALL) -m 444 $(PROG).cat1 $(man1dir)/$(PROG).0 diff --git a/pkgtools/pkg_install/files/info/info.h b/pkgtools/pkg_install/files/info/info.h index a18d450e195..24e61be2e07 100644 --- a/pkgtools/pkg_install/files/info/info.h +++ b/pkgtools/pkg_install/files/info/info.h @@ -1,4 +1,4 @@ -/* $NetBSD: info.h,v 1.1.1.1 2002/12/20 18:14:12 schmonz Exp $ */ +/* $NetBSD: info.h,v 1.2 2003/09/01 16:27:13 jlam Exp $ */ /* from FreeBSD Id: info.h,v 1.10 1997/02/22 16:09:40 peter Exp */ @@ -50,6 +50,7 @@ #define SHOW_DEPENDS 0x04000 #define SHOW_PKG_SIZE 0x08000 #define SHOW_ALL_SIZE 0x10000 +#define SHOW_BLD_DEPENDS 0x20000 extern int Flags; extern Boolean AllInstalled; @@ -66,6 +67,7 @@ extern void show_file(char *, char *); extern void show_plist(char *, package_t *, pl_ent_t); extern void show_files(char *, package_t *); extern void show_depends(char *, package_t *); +extern void show_bld_depends(char *, package_t *); extern void show_index(char *, char *); #endif /* _INST_INFO_H_INCLUDE */ diff --git a/pkgtools/pkg_install/files/info/main.c b/pkgtools/pkg_install/files/info/main.c index 58309bb60b1..c1677f5f3a5 100644 --- a/pkgtools/pkg_install/files/info/main.c +++ b/pkgtools/pkg_install/files/info/main.c @@ -1,13 +1,17 @@ -/* $NetBSD: main.c,v 1.3 2003/03/29 18:41:56 jschauma Exp $ */ +/* $NetBSD: main.c,v 1.4 2003/09/01 16:27:13 jlam Exp $ */ -#if 0 +#include <nbcompat.h> +#if HAVE_CONFIG_H +#include "config.h" +#endif +#if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> +#endif #ifndef lint #if 0 static char *rcsid = "from FreeBSD Id: main.c,v 1.14 1997/10/08 07:47:26 charnier Exp"; #else -__RCSID("$NetBSD: main.c,v 1.3 2003/03/29 18:41:56 jschauma Exp $"); -#endif +__RCSID("$NetBSD: main.c,v 1.4 2003/09/01 16:27:13 jlam Exp $"); #endif #endif @@ -32,26 +36,21 @@ __RCSID("$NetBSD: main.c,v 1.3 2003/03/29 18:41:56 jschauma Exp $"); * */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_SYS_IOCTL_H +#if HAVE_SYS_IOCTL_H #include <sys/ioctl.h> #endif -#ifdef HAVE_TERMIOS_H +#if HAVE_TERMIOS_H #include <termios.h> #endif - -#ifdef HAVE_ERR_H +#if HAVE_ERR_H #include <err.h> #endif #include "lib.h" #include "info.h" -static const char Options[] = "aBbcDde:fFhIikLl:mnpqRrsSvV"; +static const char Options[] = "aBbcDde:fFhIiK:kLl:mNnpqRrsSvV"; int Flags = 0; Boolean AllInstalled = FALSE; @@ -68,7 +67,7 @@ static void usage(void) { fprintf(stderr, "%s\n%s\n%s\n", - "usage: pkg_info [-BbcDdFfIikLmnpqRrSsVvh] [-e package] [-l prefix]", + "usage: pkg_info [-BbcDdFfIikLmNnpqRrSsVvh] [-e package] [-l prefix]", " pkg-name [pkg-name ...]", " pkg_info -a [flags]"); exit(1); @@ -77,11 +76,11 @@ usage(void) int main(int argc, char **argv) { - int ch, rc; lpkg_t *lpp; + int ch; + int rc; setprogname(argv[0]); - while ((ch = getopt(argc, argv, Options)) != -1) switch (ch) { case 'a': @@ -128,6 +127,10 @@ main(int argc, char **argv) Flags |= SHOW_INSTALL; break; + case 'K': + _pkgdb_setPKGDB_DIR(optarg); + break; + case 'k': Flags |= SHOW_DEINSTALL; break; @@ -144,6 +147,10 @@ main(int argc, char **argv) Flags |= SHOW_MTREE; break; + case 'N': + Flags |= SHOW_BLD_DEPENDS; + break; + case 'n': Flags |= SHOW_DEPENDS; break; @@ -177,7 +184,7 @@ main(int argc, char **argv) /* Reasonable definition of 'everything' */ Flags = SHOW_COMMENT | SHOW_DESC | SHOW_PLIST | SHOW_INSTALL | SHOW_DEINSTALL | SHOW_REQUIRE | SHOW_DISPLAY | SHOW_MTREE | - SHOW_REQBY | SHOW_DEPENDS | SHOW_PKG_SIZE | SHOW_ALL_SIZE; + SHOW_REQBY | SHOW_BLD_DEPENDS | SHOW_DEPENDS | SHOW_PKG_SIZE | SHOW_ALL_SIZE; break; case 'V': @@ -216,7 +223,7 @@ main(int argc, char **argv) if (CheckPkg && File2Pkg) { char *s; - if (pkgdb_open(ReadOnly) == -1) + if (!pkgdb_open(ReadOnly)) err(EXIT_FAILURE, "cannot open pkgdb"); s = pkgdb_retrieve(CheckPkg); @@ -256,6 +263,15 @@ main(int argc, char **argv) if (findmatchingname(_pkgdb_getPKGDB_DIR(), *argv, add_to_list_fn, &pkgs) <= 0) errx(EXIT_FAILURE, "No matching pkg for %s.", *argv); } else { + char *dbdir; + + dbdir = _pkgdb_getPKGDB_DIR(); + if (**argv == '/' && strncmp(*argv, dbdir, strlen(dbdir)) == 0) { + *argv += strlen(dbdir) + 1; + if ((*argv)[strlen(*argv) - 1] == '/') { + (*argv)[strlen(*argv) - 1] = 0; + } + } lpp = alloc_lpkg(*argv); TAILQ_INSERT_TAIL(&pkgs, lpp, lp_link); } diff --git a/pkgtools/pkg_install/files/info/perform.c b/pkgtools/pkg_install/files/info/perform.c index 6bc1fde433c..a2b439ec28e 100644 --- a/pkgtools/pkg_install/files/info/perform.c +++ b/pkgtools/pkg_install/files/info/perform.c @@ -1,13 +1,17 @@ -/* $NetBSD: perform.c,v 1.7 2003/03/29 18:41:56 jschauma Exp $ */ +/* $NetBSD: perform.c,v 1.8 2003/09/01 16:27:13 jlam Exp $ */ -#if 0 +#include <nbcompat.h> +#if HAVE_CONFIG_H +#include "config.h" +#endif +#if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> +#endif #ifndef lint #if 0 static const char *rcsid = "from FreeBSD Id: perform.c,v 1.23 1997/10/13 15:03:53 jkh Exp"; #else -__RCSID("$NetBSD: perform.c,v 1.7 2003/03/29 18:41:56 jschauma Exp $"); -#endif +__RCSID("$NetBSD: perform.c,v 1.8 2003/09/01 16:27:13 jlam Exp $"); #endif #endif @@ -30,30 +34,29 @@ __RCSID("$NetBSD: perform.c,v 1.7 2003/03/29 18:41:56 jschauma Exp $"); * This is the main body of the info module. * */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif #include "lib.h" #include "info.h" +#if HAVE_SYS_TYPES_H #include <sys/types.h> - -#ifdef HAVE_SYS_STAT_H +#endif +#if HAVE_SYS_STAT_H #include <sys/stat.h> #endif -#ifdef HAVE_ERR_H +#if HAVE_ERR_H #include <err.h> #endif - +#if HAVE_SIGNAL_H #include <signal.h> - -#ifdef HAVE_DIRENT_H +#endif +#if HAVE_DIRENT_H #include <dirent.h> #endif - +#if HAVE_CTYPE_H #include <ctype.h> +#endif static char *Home; @@ -69,7 +72,7 @@ pkg_do(char *pkg) if (IS_URL(pkg)) { if ((cp = fileGetURL(pkg)) != NULL) { - strcpy(fname, cp); + strlcpy(fname, cp, sizeof(fname)); isTMP = TRUE; } } else if (fexists(pkg) && isfile(pkg)) { @@ -83,7 +86,7 @@ pkg_do(char *pkg) len = strlen(fname); (void) snprintf(&fname[len], sizeof(fname) - len, "/%s", pkg); } else { - strcpy(fname, pkg); + strlcpy(fname, pkg, sizeof(fname)); } cp = fname; } else { @@ -104,7 +107,7 @@ pkg_do(char *pkg) char *cp2; if ((cp2 = fileGetURL(cp)) != NULL) { - strcpy(fname, cp2); + strlcpy(fname, cp2, sizeof(fname)); isTMP = TRUE; } strcpy(PlayPen, cp2); @@ -133,11 +136,8 @@ pkg_do(char *pkg) * It's not an uninstalled package, try and find it among the * installed */ - char *tmp; - (void) snprintf(log_dir, sizeof(log_dir), "%s/%s", - (tmp = getenv(PKG_DBDIR)) ? tmp : DEF_LOG_DIR, - pkg); + _pkgdb_getPKGDB_DIR(), pkg); if (!fexists(log_dir) || !isdir(log_dir)) { { /* Check if the given package name matches @@ -192,7 +192,7 @@ pkg_do(char *pkg) printf("%sInformation for %s:\n\n", InfoPrefix, pkg); if (fexists(PRESERVE_FNAME)) { printf("*** PACKAGE MAY NOT BE DELETED ***\n"); - } + } } if (Flags & SHOW_COMMENT) { show_file("Comment:\n", COMMENT_FNAME); @@ -200,6 +200,9 @@ pkg_do(char *pkg) if (Flags & SHOW_DEPENDS) { show_depends("Requires:\n", &plist); } + if (Flags & SHOW_BLD_DEPENDS) { + show_bld_depends("Built using:\n", &plist); + } if ((Flags & SHOW_REQBY) && !isemptyfile(REQUIRED_BY_FNAME)) { show_file("Required by:\n", REQUIRED_BY_FNAME); } @@ -328,19 +331,19 @@ int pkg_perform(lpkg_head_t *pkghead) { struct dirent *dp; - char *tmp; + char *dbdir; DIR *dirp; int err_cnt = 0; signal(SIGINT, cleanup); - tmp = _pkgdb_getPKGDB_DIR(); + dbdir = _pkgdb_getPKGDB_DIR(); /* Overriding action? */ if (CheckPkg) { - err_cnt += CheckForPkg(CheckPkg, tmp); + err_cnt += CheckForPkg(CheckPkg, dbdir); } else if (AllInstalled) { - if (!(isdir(tmp) || islinktodir(tmp))) + if (!(isdir(dbdir) || islinktodir(dbdir))) return 1; if (File2Pkg) { @@ -350,7 +353,7 @@ pkg_perform(lpkg_head_t *pkghead) } else { /* Show all packges with description */ - if ((dirp = opendir(tmp)) != (DIR *) NULL) { + if ((dirp = opendir(dbdir)) != (DIR *) NULL) { while ((dp = readdir(dirp)) != (struct dirent *) NULL) { char tmp2[FILENAME_MAX]; @@ -359,7 +362,7 @@ pkg_perform(lpkg_head_t *pkghead) continue; (void) snprintf(tmp2, sizeof(tmp2), "%s/%s", - tmp, dp->d_name); + dbdir, dp->d_name); if (isfile(tmp2)) continue; diff --git a/pkgtools/pkg_install/files/info/pkg_info.1 b/pkgtools/pkg_install/files/info/pkg_info.1 index 70494bceab6..8ff80ed9971 100644 --- a/pkgtools/pkg_install/files/info/pkg_info.1 +++ b/pkgtools/pkg_install/files/info/pkg_info.1 @@ -1,6 +1,6 @@ -.\" $NetBSD: pkg_info.1,v 1.1.1.1 2002/12/20 18:14:13 schmonz Exp $ +.\" $NetBSD: pkg_info.1,v 1.2 2003/09/01 16:27:13 jlam Exp $ .\" -.\" FreeBSD install - a package for the installation and maintainance +.\" FreeBSD install - a package for the installation and maintenance .\" of non-core utilities. .\" .\" Redistribution and use in source and binary forms, with or without @@ -25,11 +25,14 @@ .Nd a utility for displaying information on software packages .Sh SYNOPSIS .Nm -.Op Fl BbcDdFfhIikLmnpqRrSsVv +.Op Fl BbcDdFfhIikLmNnpqRrSsVv .Bk -words .Op Fl e Ar package .Ek .Bk -words +.Op Fl K Ar pkg_dbdir +.Ek +.Bk -words .Op Fl l Ar prefix .Ek .Ar pkg-name ... @@ -110,6 +113,12 @@ will match versions 1.3 and later of the package. The collating sequence of the various package version numbers is unusual, but strives to be consistent. +The magic string ``alpha'' equates to +.Pa alpha version +and sorts before a beta version. +The magic string ``beta'' equates to +.Pa beta version +and sorts before a release candidate. The magic string ``rc'' equates to .Pa release candidate and sorts before a release. @@ -119,6 +128,12 @@ will sort before .Pa name-1.3 and after .Pa name-1.2.9 +Similarily +.Pa name-1.3alpha2 +will sort before +.Pa name-1.3beta1 +and they both sort before +.Pa name-1.3rc1 In addition, alphabetic characters sort in the same place as their numeric counterparts, so that .Pa name-1.2e @@ -140,6 +155,15 @@ Show the packing list instructions for each package. Show the index entry for each package. .It Fl i Show the install script (if any) for each package. +.It Fl K Ar pkg_dbdir +Set +.Ar pkg_dbdir +as the package database directory. +If this option isn't specified, then the package database directory is +taken from the value of the environment variable +.Ev PKG_DBDIR +if it's set, otherwise it defaults to +.Pa /var/db/pkg . .It Fl k Show the de-install script (if any) for each package. .It Fl L @@ -158,6 +182,8 @@ organize it. This lets you add a special token to the start of each field. .It Fl m Show the mtree file (if any) for each package. +.It Fl N +Show which packages each package was built with (exact dependencies), if any. .It Fl n Show which packages each package needs (depends upon), if any. .It Fl p @@ -183,11 +209,13 @@ Turn on verbose output. .Sh ENVIRONMENT .Bl -tag -width PKG_DBDIR .It Ev PKG_DBDIR -The standard package database directory, -.Pa /var/db/pkg , -can be overridden by specifying an alternative directory in the +If the +.Fl K +flag isn't given, then .Ev PKG_DBDIR -environment variable. +is the location of the package database directory. +The default package database directory is +.Pa /var/db/pkg . .It Ev PKG_PATH This can be used to specify a semicolon-separated list of paths and URLs to search for package files. diff --git a/pkgtools/pkg_install/files/info/pkg_info.cat1 b/pkgtools/pkg_install/files/info/pkg_info.cat1 index 3dba143ceca..880ce4d797c 100644 --- a/pkgtools/pkg_install/files/info/pkg_info.cat1 +++ b/pkgtools/pkg_install/files/info/pkg_info.cat1 @@ -4,7 +4,8 @@ NNAAMMEE ppkkgg__iinnffoo - a utility for displaying information on software packages SSYYNNOOPPSSIISS - ppkkgg__iinnffoo [--BBbbccDDddFFffhhIIiikkLLmmnnppqqRRrrSSssVVvv] [--ee _p_a_c_k_a_g_e] [--ll _p_r_e_f_i_x] _p_k_g_-_n_a_m_e _._._. + ppkkgg__iinnffoo [--BBbbccDDddFFffhhIIiikkLLmmNNnnppqqRRrrSSssVVvv] [--ee _p_a_c_k_a_g_e] [--KK _p_k_g___d_b_d_i_r] + [--ll _p_r_e_f_i_x] _p_k_g_-_n_a_m_e _._._. ppkkgg__iinnffoo [--aa _f_l_a_g_s] DDEESSCCRRIIPPTTIIOONN @@ -51,13 +52,17 @@ DDEESSCCRRIIPPTTIIOONN _p_k_g___i_n_f_o _-_e _'_n_a_m_e_>_=_1_._3_' will match versions 1.3 and later of the _n_a_m_e package. The collating sequence of the various package ver- sion numbers is unusual, but strives to be consistent. The magic - string ``rc'' equates to _r_e_l_e_a_s_e _c_a_n_d_i_d_a_t_e and sorts before a re- - lease. For example, _n_a_m_e_-_1_._3_r_c_3 will sort before _n_a_m_e_-_1_._3 and - after _n_a_m_e_-_1_._2_._9 In addition, alphabetic characters sort in the - same place as their numeric counterparts, so that _n_a_m_e_-_1_._2_e has - the same sorting value as _n_a_m_e_-_1_._2_._5 The magic string ``pl'' - equates to a _p_a_t_c_h _l_e_v_e_l and has the same value as a dot in the - dewey-decimal ordering schemes. + string ``alpha'' equates to _a_l_p_h_a _v_e_r_s_i_o_n and sorts before a beta + version. The magic string ``beta'' equates to _b_e_t_a _v_e_r_s_i_o_n and + sorts before a release candidate. The magic string ``rc'' + equates to _r_e_l_e_a_s_e _c_a_n_d_i_d_a_t_e and sorts before a release. For ex- + ample, _n_a_m_e_-_1_._3_r_c_3 will sort before _n_a_m_e_-_1_._3 and after _n_a_m_e_-_1_._2_._9 + Similarily _n_a_m_e_-_1_._3_a_l_p_h_a_2 will sort before _n_a_m_e_-_1_._3_b_e_t_a_1 and they + both sort before _n_a_m_e_-_1_._3_r_c_1 In addition, alphabetic characters + sort in the same place as their numeric counterparts, so that + _n_a_m_e_-_1_._2_e has the same sorting value as _n_a_m_e_-_1_._2_._5 The magic + string ``pl'' equates to a _p_a_t_c_h _l_e_v_e_l and has the same value as + a dot in the dewey-decimal ordering schemes. --FF Interpret any pkg-name given as filename, and translate it to a package name using the Package Database. This can be used to @@ -70,6 +75,12 @@ DDEESSCCRRIIPPTTIIOONN --ii Show the install script (if any) for each package. + --KK _p_k_g___d_b_d_i_r + Set _p_k_g___d_b_d_i_r as the package database directory. If this option + isn't specified, then the package database directory is taken + from the value of the environment variable PKG_DBDIR if it's set, + otherwise it defaults to _/_v_a_r_/_d_b_/_p_k_g. + --kk Show the de-install script (if any) for each package. --LL Show the files within each package. This is different from just @@ -85,6 +96,9 @@ DDEESSCCRRIIPPTTIIOONN --mm Show the mtree file (if any) for each package. + --NN Show which packages each package was built with (exact dependen- + cies), if any. + --nn Show which packages each package needs (depends upon), if any. --pp Show the installation prefix for each package. @@ -107,9 +121,9 @@ DDEESSCCRRIIPPTTIIOONN --vv Turn on verbose output. EENNVVIIRROONNMMEENNTT - PKG_DBDIR The standard package database directory, _/_v_a_r_/_d_b_/_p_k_g, can be - overridden by specifying an alternative directory in the - PKG_DBDIR environment variable. + PKG_DBDIR If the --KK flag isn't given, then PKG_DBDIR is the location of + the package database directory. The default package database + directory is _/_v_a_r_/_d_b_/_p_k_g. PKG_PATH This can be used to specify a semicolon-separated list of paths and URLs to search for package files. If PKG_PATH is @@ -154,4 +168,4 @@ AAUUTTHHOORRSS NetBSD wildcard dependency processing, pkgdb, depends displaying, pkg size display etc. -NetBSD 1.6 March 4, 1999 3 +NetBSD 1.6.1_STABLE March 4, 1999 3 diff --git a/pkgtools/pkg_install/files/info/show.c b/pkgtools/pkg_install/files/info/show.c index 29c4b5a56cd..98e188dd44e 100644 --- a/pkgtools/pkg_install/files/info/show.c +++ b/pkgtools/pkg_install/files/info/show.c @@ -1,13 +1,17 @@ -/* $NetBSD: show.c,v 1.1.1.1 2002/12/20 18:14:14 schmonz Exp $ */ +/* $NetBSD: show.c,v 1.2 2003/09/01 16:27:13 jlam Exp $ */ -#if 0 +#include <nbcompat.h> +#if HAVE_CONFIG_H +#include "config.h" +#endif +#if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> +#endif #ifndef lint #if 0 static const char *rcsid = "from FreeBSD Id: show.c,v 1.11 1997/10/08 07:47:38 charnier Exp"; #else -__RCSID("$NetBSD: show.c,v 1.1.1.1 2002/12/20 18:14:14 schmonz Exp $"); -#endif +__RCSID("$NetBSD: show.c,v 1.2 2003/09/01 16:27:13 jlam Exp $"); #endif #endif @@ -59,11 +63,8 @@ __RCSID("$NetBSD: show.c,v 1.1.1.1 2002/12/20 18:14:14 schmonz Exp $"); * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#ifdef HAVE_ERR_H +#if HAVE_ERR_H #include <err.h> #endif @@ -235,7 +236,8 @@ show_files(char *title, package_t *plist) switch (p->type) { case PLIST_FILE: if (!ign) { - printf("%s/%s\n", dir, p->name); + printf("%s%s%s\n", dir, + (strcmp(dir, "/") == 0) ? "" : "/", p->name); } ign = FALSE; break; @@ -288,3 +290,41 @@ show_depends(char *title, package_t *plist) printf("\n"); } + +/* + * Show exact dependencies (packages this pkg was built with) + */ +void +show_bld_depends(char *title, package_t *plist) +{ + plist_t *p; + int nodepends; + + nodepends = 1; + for (p = plist->head; p && nodepends; p = p->next) { + switch (p->type) { + case PLIST_BLDDEP: + nodepends = 0; + break; + default: + break; + } + } + if (nodepends) + return; + + if (!Quiet) { + printf("%s%s", InfoPrefix, title); + } + for (p = plist->head; p; p = p->next) { + switch (p->type) { + case PLIST_BLDDEP: + printf("%s\n", p->name); + break; + default: + break; + } + } + + printf("\n"); +} diff --git a/pkgtools/pkg_install/files/lib/Makefile.in b/pkgtools/pkg_install/files/lib/Makefile.in index 0e590ddd3bf..ea8bfd90698 100644 --- a/pkgtools/pkg_install/files/lib/Makefile.in +++ b/pkgtools/pkg_install/files/lib/Makefile.in @@ -1,38 +1,35 @@ -# $NetBSD: Makefile.in,v 1.2 2003/02/11 16:48:23 grant Exp $ -# Original from FreeBSD, no rcs id. +# $NetBSD: Makefile.in,v 1.3 2003/09/01 16:27:14 jlam Exp $ + +srcdir= @srcdir@ + +pkgdbdir= @pkgdbdir@ RANLIB= @RANLIB@ AR= @AR@ CC= @CC@ -CCLD= $(CC) -LIBS= @LIBS@ -linstall -CPPFLAGS= @CPPFLAGS@ -DEFS= @DEFS@ -I. -I@srcdir@ +CPPFLAGS= $(DEFS) @CPPFLAGS@ -I. -I$(srcdir) +DEFS= @DEFS@ -DDEF_LOG_DIR=\"$(pkgdbdir)\" CFLAGS= @CFLAGS@ -LDFLAGS= @LDFLAGS@ -L../lib -LINK= $(CCLD) $(CFLAGS) $(LDFLAGS) -o $@ -COMPILE= $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) +LIB= libinstall.a -LIBINSTALL= libinstall.a +SRCS= exec.c fexec.c file.c ftpio.c global.c lpkg.c path.c pen.c \ + pkgdb.c plist.c str.c version.c +OBJS= $(SRCS:.c=.o) -SRCS= digest.c exec.c file.c fgetln.c ftpio.c global.c lpkg.c \ - pen.c pkgdb.c plist.c str.c version.c path.c \ - err.c setprogname.c setenv.c unsetenv.c -OBJS= digest.o exec.o file.o fgetln.o ftpio.o global.o lpkg.o \ - pen.o pkgdb.o plist.o str.o version.o path.o \ - err.o setprogname.o setenv.o unsetenv.o +.PHONY: all clean install -libinstall.a: ${OBJS} - ${AR} crv ${LIBINSTALL} ${OBJS} - ${RANLIB} ${LIBINSTALL} +.c.o: + $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) -c $< -version.o: version.h version.c +all: $(LIB) -.c.o: - $(COMPILE) -c $< -o $@ +$(LIB): $(OBJS) + $(AR) crv $@ $(OBJS) + $(RANLIB) $@ clean: - rm -f ${OBJS} ${LIBINSTALL} + rm -f $(OBJS) $(LIB) install: + # do nothing diff --git a/pkgtools/pkg_install/files/lib/config.h.in b/pkgtools/pkg_install/files/lib/config.h.in index e59eca74449..81707428ca5 100644 --- a/pkgtools/pkg_install/files/lib/config.h.in +++ b/pkgtools/pkg_install/files/lib/config.h.in @@ -1,175 +1,88 @@ -/* lib/config.h.in. Generated automatically from configure.in by autoheader. */ +/* lib/config.h.in. Generated from configure.ac by autoheader. */ -/* Define to empty if the keyword does not work. */ -#undef const - -/* Define to `unsigned' if <sys/types.h> doesn't define. */ -#undef size_t - -/* Define if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Define if you have the MD5File function. */ -#undef HAVE_MD5FILE - -/* Define if you have the chflags function. */ +/* Define to 1 if you have the `chflags' function. */ #undef HAVE_CHFLAGS -/* Define if you have the dbopen function. */ -#undef HAVE_DBOPEN - -/* Define if you have the err function. */ -#undef HAVE_ERR - -/* Define if you have the errx function. */ -#undef HAVE_ERRX - -/* Define if you have the fgetln function. */ -#undef HAVE_FGETLN - -/* Define if you have the getprogname function. */ -#undef HAVE_GETPROGNAME - -/* Define if you have the mkdtemp function. */ -#undef HAVE_MKDTEMP - -/* Define if you have the setenv function. */ -#undef HAVE_SETENV - -/* Define if you have the setprogname function. */ -#undef HAVE_SETPROGNAME - -/* Define if you have the statfs function. */ -#undef HAVE_STATFS - -/* Define if you have the statvfs function. */ -#undef HAVE_STATVFS - -/* Define if you have the strlcpy function. */ -#undef HAVE_STRLCPY - -/* Define if you have the strsep function. */ -#undef HAVE_STRSEP - -/* Define if you have the unsetenv function. */ -#undef HAVE_UNSETENV - -/* Define if you have the warn function. */ -#undef HAVE_WARN - -/* Define if you have the warnx function. */ -#undef HAVE_WARNX - -/* Define if you have the <assert.h> header file. */ -#undef HAVE_ASSERT_H - -/* Define if you have the <db_185.h> header file. */ -#undef HAVE_DB_185_H - -/* Define if you have the <db.h> header file. */ -#undef HAVE_DB_H - -/* Define if you have the <db1/db.h> header file. */ +/* Define to 1 if you have the <db1/db.h> header file. */ #undef HAVE_DB1_DB_H -/* Define if you have the <dirent.h> header file. */ -#undef HAVE_DIRENT_H - -/* Define if you have the <err.h> header file. */ -#undef HAVE_ERR_H +/* Define to 1 if you have the `dbopen' function. */ +#undef HAVE_DBOPEN -/* Define if you have the <fcntl.h> header file. */ -#undef HAVE_FCNTL_H +/* Define to 1 if you have the <db.h> header file. */ +#undef HAVE_DB_H -/* Define if you have the <fnmatch.h> header file. */ +/* Define to 1 if you have the <fnmatch.h> header file. */ #undef HAVE_FNMATCH_H -/* Define if you have the <limits.h> header file. */ -#undef HAVE_LIMITS_H +/* Define to 1 if you have the `getrlimit' function. */ +#undef HAVE_GETRLIMIT -/* Define if you have the <md5.h> header file. */ -#undef HAVE_MD5_H +/* Define to 1 if you have the <inttypes.h> header file. */ +#undef HAVE_INTTYPES_H -/* Define if you have the <md5global.h> header file. */ -#undef HAVE_MD5GLOBAL_H +/* Define to 1 if you have the `db1' library (-ldb1). */ +#undef HAVE_LIBDB1 -/* Define if you have the <netdb.h> header file. */ -#undef HAVE_NETDB_H +/* Define to 1 if you have the <md5.h> header file. */ +#undef HAVE_MD5_H -/* Define if you have the <pwd.h> header file. */ -#undef HAVE_PWD_H +/* Define to 1 if you have the <memory.h> header file. */ +#undef HAVE_MEMORY_H -/* Define if you have the <regex.h> header file. */ +/* Define to 1 if you have the <regex.h> header file. */ #undef HAVE_REGEX_H -/* Define if you have the <signal.h> header file. */ -#undef HAVE_SIGNAL_H +/* Define to 1 if you have the `setrlimit' function. */ +#undef HAVE_SETRLIMIT -/* Define if you have the <stdlib.h> header file. */ +/* Define to 1 if you have the <stdint.h> header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the <stdlib.h> header file. */ #undef HAVE_STDLIB_H -/* Define if you have the <string.h> header file. */ -#undef HAVE_STRING_H +/* Define to 1 if you have the <strings.h> header file. */ +#undef HAVE_STRINGS_H -/* Define if you have the <sys/file.h> header file. */ -#undef HAVE_SYS_FILE_H +/* Define to 1 if you have the <string.h> header file. */ +#undef HAVE_STRING_H -/* Define if you have the <sys/ioctl.h> header file. */ +/* Define to 1 if you have the <sys/ioctl.h> header file. */ #undef HAVE_SYS_IOCTL_H -/* Define if you have the <sys/mount.h> header file. */ -#undef HAVE_SYS_MOUNT_H - -/* Define if you have the <sys/param.h> header file. */ -#undef HAVE_SYS_PARAM_H - -/* Define if you have the <sys/queue.h> header file. */ -#undef HAVE_SYS_QUEUE_H - -/* Define if you have the <sys/resource.h> header file. */ +/* Define to 1 if you have the <sys/resource.h> header file. */ #undef HAVE_SYS_RESOURCE_H -/* Define if you have the <sys/stat.h> header file. */ +/* Define to 1 if you have the <sys/stat.h> header file. */ #undef HAVE_SYS_STAT_H -/* Define if you have the <sys/time.h> header file. */ -#undef HAVE_SYS_TIME_H - -/* Define if you have the <sys/types.h> header file. */ +/* Define to 1 if you have the <sys/types.h> header file. */ #undef HAVE_SYS_TYPES_H -/* Define if you have the <sys/vfs.h> header file. */ -#undef HAVE_SYS_VFS_H - -/* Define if you have the <sys/wait.h> header file. */ +/* Define to 1 if you have the <sys/wait.h> header file. */ #undef HAVE_SYS_WAIT_H -/* Define if you have the <termios.h> header file. */ -#undef HAVE_TERMIOS_H - -/* Define if you have the <time.h> header file. */ -#undef HAVE_TIME_H +/* Define to 1 if you have the `tgetent' function. */ +#undef HAVE_TGETENT -/* Define if you have the <unistd.h> header file. */ +/* Define to 1 if you have the <unistd.h> header file. */ #undef HAVE_UNISTD_H -/* Define if you have the <vis.h> header file. */ -#undef HAVE_VIS_H +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT -/* Define if you have the db1 library (-ldb1). */ -#undef HAVE_LIBDB1 +/* Define to the full name of this package. */ +#undef PACKAGE_NAME -/* Define if you have the md library (-lmd). */ -#undef HAVE_LIBMD +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING -/* Define if your compiler has __attribute__ */ -#undef HAVE___ATTRIBUTE__ +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME -#ifndef HAVE___ATTRIBUTE__ -# define __attribute__(x) -#endif - -#ifndef HAVE_GETPROGNAME -const char *getprogname(void); -#endif +/* Define to the version of this package. */ +#undef PACKAGE_VERSION +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS diff --git a/pkgtools/pkg_install/files/lib/defs.h b/pkgtools/pkg_install/files/lib/defs.h index 0a076049242..b9740ccaa28 100644 --- a/pkgtools/pkg_install/files/lib/defs.h +++ b/pkgtools/pkg_install/files/lib/defs.h @@ -1,4 +1,4 @@ -/* $NetBSD: defs.h,v 1.1.1.1 2002/12/20 18:13:59 schmonz Exp $ */ +/* $NetBSD: defs.h,v 1.2 2003/09/01 16:27:14 jlam Exp $ */ /* * Copyright (c) 1999-2000 Alistair G. Crooks. All rights reserved. @@ -33,12 +33,19 @@ #ifndef DEFS_H_ #define DEFS_H_ -#ifdef HAVE_ERR_H +#include <nbcompat.h> +#if HAVE_CONFIG_H +#include "config.h" +#endif +#if HAVE_ERR_H #include <err.h> #endif - +#if HAVE_STDLIB_H #include <stdlib.h> +#endif +#if HAVE_STRING_H #include <string.h> +#endif #define NEWARRAY(type,ptr,size,where,action) do { \ if ((ptr = (type *) calloc(sizeof(type), (unsigned)(size))) == NULL) { \ diff --git a/pkgtools/pkg_install/files/lib/digest.c b/pkgtools/pkg_install/files/lib/digest.c deleted file mode 100644 index f0ae0b8a146..00000000000 --- a/pkgtools/pkg_install/files/lib/digest.c +++ /dev/null @@ -1,97 +0,0 @@ -/* $NetBSD: digest.c,v 1.2 2002/12/22 12:15:11 grant Exp $ */ - -/* - * Copyright (c) 2002 Alistair G. Crooks. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Alistair G. Crooks. - * 4. The name of the author may not be used to endorse or promote - * products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -#if 0 -#include <sys/cdefs.h> - -#ifndef lint -__COPYRIGHT("@(#) Copyright (c) 2002 \ - The NetBSD Foundation, Inc. All rights reserved."); -__RCSID("$NetBSD: digest.c,v 1.2 2002/12/22 12:15:11 grant Exp $"); -#endif -#endif - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_ERR_H -#include <err.h> -#endif - -#include <stdio.h> -#include <stdlib.h> - -#ifdef HAVE_STRING_H -#include <string.h> -#endif - -#include <unistd.h> - -#include "lib.h" - -#ifndef HAVE_MD5FILE - -#define _MD5_ASCII_BUF_SIZE 33 - -char * -MD5File(char *filename, char *buf) -{ - char cmd[1024]; - char in[1024]; - FILE *pp; - char *cp; - - (void) snprintf(cmd, sizeof(cmd), "%s md5 %s", DIGEST, filename); - if ((pp = popen(cmd, "r")) == NULL) { - warn("MD5File: can't popen `%s'", cmd); - return NULL; - } - if (fgets(in, sizeof(in), pp) == NULL) { - warn("MD5File: can't read from `%s'", cmd); - (void) pclose(pp); - return NULL; - } - (void) pclose(pp); - cp = strrchr(in, ' '); - if (buf) - (void) strncpy(buf, cp + 1, _MD5_ASCII_BUF_SIZE); - else { - buf = malloc(_MD5_ASCII_BUF_SIZE); - if (buf == NULL) - return NULL; - (void) strncpy(buf, cp + 1, _MD5_ASCII_BUF_SIZE); - } - buf[_MD5_ASCII_BUF_SIZE - 1] = '\0'; - return buf; -} -#endif diff --git a/pkgtools/pkg_install/files/lib/err.c b/pkgtools/pkg_install/files/lib/err.c deleted file mode 100644 index fc3a007097a..00000000000 --- a/pkgtools/pkg_install/files/lib/err.c +++ /dev/null @@ -1,108 +0,0 @@ -/* $Id: err.c,v 1.1.1.1 2002/12/20 18:14:06 schmonz Exp $ */ - -/* - * Copyright 1997-2000 Luke Mewburn <lukem@netbsd.org>. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE - * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include <errno.h> -#include <stdarg.h> -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifndef HAVE_ERR -void -err(int eval, const char *fmt, ...) -{ - va_list ap; - int sverrno; - - sverrno = errno; - (void)fprintf(stderr, "%s: ", getprogname()); - va_start(ap, fmt); - if (fmt != NULL) { - (void)vfprintf(stderr, fmt, ap); - (void)fprintf(stderr, ": "); - } - va_end(ap); - (void)fprintf(stderr, "%s\n", strerror(sverrno)); - exit(eval); -} -#endif - -#ifndef HAVE_ERRX -void -errx(int eval, const char *fmt, ...) -{ - va_list ap; - - (void)fprintf(stderr, "%s: ", getprogname()); - va_start(ap, fmt); - if (fmt != NULL) - (void)vfprintf(stderr, fmt, ap); - va_end(ap); - (void)fprintf(stderr, "\n"); - exit(eval); -} -#endif - -#ifndef HAVE_WARN -void -warn(const char *fmt, ...) -{ - va_list ap; - int sverrno; - - sverrno = errno; - (void)fprintf(stderr, "%s: ", getprogname()); - va_start(ap, fmt); - if (fmt != NULL) { - (void)vfprintf(stderr, fmt, ap); - (void)fprintf(stderr, ": "); - } - va_end(ap); - (void)fprintf(stderr, "%s\n", strerror(sverrno)); -} -#endif - -#ifndef HAVE_WARNX -void -warnx(const char *fmt, ...) -{ - va_list ap; - - (void)fprintf(stderr, "%s: ", getprogname()); - va_start(ap, fmt); - if (fmt != NULL) - (void)vfprintf(stderr, fmt, ap); - va_end(ap); - (void)fprintf(stderr, "\n"); -} -#endif diff --git a/pkgtools/pkg_install/files/lib/exec.c b/pkgtools/pkg_install/files/lib/exec.c index a7a3af172f8..6268e238896 100644 --- a/pkgtools/pkg_install/files/lib/exec.c +++ b/pkgtools/pkg_install/files/lib/exec.c @@ -1,13 +1,17 @@ -/* $NetBSD: exec.c,v 1.1.1.1 2002/12/20 18:13:59 schmonz Exp $ */ +/* $NetBSD: exec.c,v 1.2 2003/09/01 16:27:14 jlam Exp $ */ -#if 0 +#include <nbcompat.h> +#if HAVE_CONFIG_H +#include "config.h" +#endif +#if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> +#endif #ifndef lint #if 0 static const char *rcsid = "from FreeBSD Id: exec.c,v 1.6 1997/10/08 07:47:50 charnier Exp"; #else -__RCSID("$NetBSD: exec.c,v 1.1.1.1 2002/12/20 18:13:59 schmonz Exp $"); -#endif +__RCSID("$NetBSD: exec.c,v 1.2 2003/09/01 16:27:14 jlam Exp $"); #endif #endif @@ -30,14 +34,10 @@ __RCSID("$NetBSD: exec.c,v 1.1.1.1 2002/12/20 18:13:59 schmonz Exp $"); * Miscellaneous system routines. * */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#ifdef HAVE_ERR_H +#if HAVE_ERR_H #include <err.h> #endif - #include "lib.h" /* diff --git a/pkgtools/pkg_install/files/lib/setenv.c b/pkgtools/pkg_install/files/lib/fexec.c index bce4c082930..9d1ab6f9e00 100644 --- a/pkgtools/pkg_install/files/lib/setenv.c +++ b/pkgtools/pkg_install/files/lib/fexec.c @@ -1,11 +1,9 @@ -/* $NetBSD: setenv.c,v 1.1.1.1 2002/12/20 18:14:06 schmonz Exp $ */ - /*- - * Copyright (c) 1998 The NetBSD Foundation, Inc. + * Copyright (c) 2003 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation - * by Christos Zoulas. + * by Matthias Scheler. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -36,39 +34,126 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifdef HAVE_CONFIG_H + +#include <nbcompat.h> +#if HAVE_CONFIG_H #include "config.h" #endif +#if HAVE_SYS_CDEFS_H +#include <sys/cdefs.h> +#endif +#if HAVE_SYS_WAIT_H +#include <sys/wait.h> +#endif -#include <stdio.h> +#if HAVE_ERR_H +#include <err.h> +#endif +#if HAVE_ERRNO_H +#include <errno.h> +#endif +#if HAVE_STDARG_H +#include <stdarg.h> +#endif +#if HAVE_STDLIB_H #include <stdlib.h> +#endif +#if HAVE_UNISTD_H #include <unistd.h> -#include <syslog.h> +#endif -#ifndef HAVE_SETENV -int -setenv(name, value, overwrite) - const char *name; - const char *value; - int overwrite; +#include "lib.h" + +#ifndef lint +__RCSID("$NetBSD: fexec.c,v 1.1 2003/09/01 16:27:14 jlam Exp $"); +#endif + +static int vfcexec(const char *, const char *, va_list); + +static int +vfcexec(const char *path, const char *arg, va_list ap) { - size_t len; - int ret; - char *p; + static unsigned int max = 4; + static const char **argv = NULL; + unsigned int argc; + pid_t child; + int status; + + if (argv == NULL) { + argv = malloc(max * sizeof(const char *)); + if (argv == NULL) { + warnx("vfcexec can't alloc arg space"); + return -1; + } + } + + argv[0] = arg; + argc = 1; + + do { + if (argc == max) { + unsigned int new; + const char **ptr; - if (overwrite == 0 && getenv(name)) - return 0; + new = max * 2; + ptr = realloc(argv, new * sizeof(const char *)); + if (ptr == NULL) { + warnx("vfcexec can't alloc arg space"); + return -1; + } + argv = ptr; + max = new; + } + arg = va_arg(ap, const char *); + argv[argc++] = arg; + } while (arg != NULL); - if (value == NULL) - value = ""; + child = vfork(); + switch (child) { + case 0: + if ((path != NULL) && (chdir(path) < 0)) + _exit(127); - len = strlen(name) + strlen(value) + 2; - p = (char *) malloc(len); - if (p == NULL) + (void) execvp(argv[0], (char ** const)argv); + _exit(127); + /* NOTREACHED */ + case -1: return -1; + } - (void) sprintf(p, "%s=%s", name, value); - ret = putenv(p); - return ret; + while (waitpid(child, &status, 0) < 0) { + if (errno != EINTR) + return -1; + } + + if (!WIFEXITED(status)) + return -1; + + return WEXITSTATUS(status); +} + +int +fexec(const char *arg, ...) +{ + va_list ap; + int result; + + va_start(ap, arg); + result = vfcexec(NULL, arg, ap); + va_end(ap); + + return result; +} + +int +fcexec(const char *path, const char *arg, ...) +{ + va_list ap; + int result; + + va_start(ap, arg); + result = vfcexec(path, arg, ap); + va_end(ap); + + return result; } -#endif diff --git a/pkgtools/pkg_install/files/lib/fgetln.c b/pkgtools/pkg_install/files/lib/fgetln.c deleted file mode 100644 index fb8f6cbffc5..00000000000 --- a/pkgtools/pkg_install/files/lib/fgetln.c +++ /dev/null @@ -1,88 +0,0 @@ -/* $Id: fgetln.c,v 1.1.1.1 2002/12/20 18:13:59 schmonz Exp $ */ - -/* - * Copyright 1999 Luke Mewburn <lukem@netbsd.org>. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE - * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifndef HAVE_FGETLN - -#ifdef HAVE_ERR_H -#include <err.h> -#endif - -#include <stdio.h> -#include <stdlib.h> - -#ifdef HAVE_STRING_H -#include <string.h> -#endif - -#include <unistd.h> - -#define BUFCHUNKS BUFSIZ - -char * -fgetln(FILE *fp, size_t *len) -{ - static char *buf; - static size_t bufsize; - size_t buflen; - char curbuf[BUFCHUNKS]; - char *p; - - if (buf == NULL) { - bufsize = BUFCHUNKS; - buf = (char *)malloc(bufsize); - if (buf == NULL) - err(1, "Unable to allocate buffer for fgetln()"); - } - - *buf = '\0'; - buflen = 0; - while ((p = fgets(curbuf, sizeof(curbuf), fp)) != NULL) { - size_t l; - - l = strlen(p); - if (bufsize < buflen + l) { - bufsize += BUFCHUNKS; - if ((buf = (char *)realloc(buf, bufsize)) == NULL) - err(1, "Unable to allocate %ld bytes of memory", - (long)bufsize); - } - strcpy(buf + buflen, p); - buflen += l; - if (p[l - 1] == '\n') - break; - } - if (p == NULL && *buf == '\0') - return (NULL); - *len = strlen(buf); - return (buf); -} -#endif diff --git a/pkgtools/pkg_install/files/lib/file.c b/pkgtools/pkg_install/files/lib/file.c index dcb8b434a41..64d4ef1a3e3 100644 --- a/pkgtools/pkg_install/files/lib/file.c +++ b/pkgtools/pkg_install/files/lib/file.c @@ -1,13 +1,17 @@ -/* $NetBSD: file.c,v 1.4 2003/04/11 14:40:36 grant Exp $ */ +/* $NetBSD: file.c,v 1.5 2003/09/01 16:27:14 jlam Exp $ */ -#if 0 +#include <nbcompat.h> +#if HAVE_CONFIG_H +#include "config.h" +#endif +#if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> +#endif #ifndef lint #if 0 static const char *rcsid = "from FreeBSD Id: file.c,v 1.29 1997/10/08 07:47:54 charnier Exp"; #else -__RCSID("$NetBSD: file.c,v 1.4 2003/04/11 14:40:36 grant Exp $"); -#endif +__RCSID("$NetBSD: file.c,v 1.5 2003/09/01 16:27:14 jlam Exp $"); #endif #endif @@ -33,31 +37,22 @@ __RCSID("$NetBSD: file.c,v 1.4 2003/04/11 14:40:36 grant Exp $"); #include "lib.h" -#ifdef HAVE_SYS_WAIT_H -#include <sys/wait.h> -#endif - -#ifdef HAVE_ASSERT_H +#if HAVE_ASSERT_H #include <assert.h> #endif - -#ifdef HAVE_ERR_H +#if HAVE_ERR_H #include <err.h> #endif - -#ifdef HAVE_NETDB_H +#if HAVE_NETDB_H #include <netdb.h> #endif - -#ifdef HAVE_PWD_H +#if HAVE_PWD_H #include <pwd.h> #endif - -#ifdef HAVE_TIME_H +#if HAVE_TIME_H #include <time.h> #endif - -#ifdef HAVE_FCNTL_H +#if HAVE_FCNTL_H #include <fcntl.h> #endif @@ -261,7 +256,7 @@ fileGetURL(const char *spec) rp = NULL; if (!IS_URL(spec)) { - errx(EXIT_FAILURE, "fileGetURL was called with non-url arg '%s'", spec); + errx(EXIT_FAILURE, "fileGetURL was called with non-URL arg '%s'", spec); } /* Some sanity checks on the URL */ @@ -377,7 +372,7 @@ fileFindByPath(const char *fname) struct path *path; /* - * 1. if fname is an absolute pathname or a url, + * 1. if fname is an absolute pathname or a URL, * just use it. */ if (IS_FULLPATH(fname) || IS_URL(fname)) @@ -559,12 +554,12 @@ unpack(const char *pkg, const char *flist) else if (!strcmp(suf, "tar")) decompress_cmd = "cat"; else - errx(EXIT_FAILURE, "don't know how to decompress %s", pkg); + errx(EXIT_FAILURE, "don't know how to decompress %s, sorry", pkg); } else decompress_cmd = GZIP_CMD " -c -d"; - strcat(args, "xpf -"); - if (vsystem("%s %s | %s %s %s", decompress_cmd, pkg, TAR_FULLPATHNAME, args, flist ? flist : "")) { - warnx("%s extract of %s failed!", TAR_FULLPATHNAME, pkg); + strlcat(args, "xpf -", sizeof(args)); + if (vsystem("%s %s | %s %s %s", decompress_cmd, pkg, TAR_CMD, args, flist ? flist : "")) { + warnx("%s extract of %s failed!", TAR_CMD, pkg); return 1; } return 0; diff --git a/pkgtools/pkg_install/files/lib/ftpio.c b/pkgtools/pkg_install/files/lib/ftpio.c index 5a5e631fe5c..7f7f742faf7 100644 --- a/pkgtools/pkg_install/files/lib/ftpio.c +++ b/pkgtools/pkg_install/files/lib/ftpio.c @@ -1,10 +1,14 @@ -/* $NetBSD: ftpio.c,v 1.2 2003/01/06 04:34:17 jschauma Exp $ */ +/* $NetBSD: ftpio.c,v 1.3 2003/09/01 16:27:14 jlam Exp $ */ -#if 0 +#include <nbcompat.h> +#if HAVE_CONFIG_H +#include "config.h" +#endif +#if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> -#ifndef lint -__RCSID("$NetBSD: ftpio.c,v 1.2 2003/01/06 04:34:17 jschauma Exp $"); #endif +#ifndef lint +__RCSID("$NetBSD: ftpio.c,v 1.3 2003/09/01 16:27:14 jlam Exp $"); #endif /* @@ -36,54 +40,54 @@ __RCSID("$NetBSD: ftpio.c,v 1.2 2003/01/06 04:34:17 jschauma Exp $"); * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif +#if HAVE_SYS_TYPES_H #include <sys/types.h> - -#ifdef HAVE_SYS_TIME_H +#endif +#if HAVE_SYS_TIME_H #include <sys/time.h> #endif - -#ifdef HAVE_SIGNAL_H +#if HAVE_SYS_POLL_H +#include <sys/poll.h> +#endif +#if HAVE_SIGNAL_H #include <signal.h> #endif - -#ifdef HAVE_ASSERT_H +#if HAVE_ASSERT_H #include <assert.h> #endif - +#if HAVE_CTYPE_H #include <ctype.h> - -#ifdef HAVE_ERR_H +#endif +#if HAVE_ERR_H #include <err.h> #endif - +#if HAVE_ERRNO_H #include <errno.h> - -#ifdef HAVE_FCNTL_H +#endif +#if HAVE_FCNTL_H #include <fcntl.h> #endif - -#ifdef HAVE_REGEX_H +#if HAVE_REGEX_H #include <regex.h> #endif - -#ifdef HAVE_STRING_H +#if HAVE_STRING_H #include <string.h> #endif - -#ifdef HAVE_NETDB_H -#include <netdb.h> -#endif - +#if HAVE_STDIO_H #include <stdio.h> +#endif +#if HAVE_STDLIB_H #include <stdlib.h> +#endif +#if HAVE_TERMCAP_H +#include <termcap.h> +#endif +#if HAVE_UNISTD_H #include <unistd.h> - +#endif #ifdef EXPECT_DEBUG -#ifdef HAVE_VIS_H +#if HAVE_VIS_H #include <vis.h> #endif #endif @@ -139,7 +143,7 @@ expect(int fd, const char *str, int *ftprc) #endif /* EXPECT_DEBUG */ regex_t rstr; int done; - struct timeval timeout; + struct pollfd set[1]; int retval; regmatch_t match; int verbose_expect=0; @@ -163,16 +167,12 @@ expect(int fd, const char *str, int *ftprc) memset(buf, '\n', sizeof(buf)); - timeout.tv_sec=10*60; /* seconds until next message from tar */ - timeout.tv_usec=0; done=0; retval=0; + set[0].fd = fd; + set[0].events = POLLIN; while(!done) { - fd_set fdset; - - FD_ZERO(&fdset); - FD_SET(fd, &fdset); - rc = select(FD_SETSIZE, &fdset, NULL, NULL, &timeout); + rc = poll(set, 1, 10*60*1000); /* seconds until next message from tar */ switch (rc) { case -1: if (errno == EINTR) @@ -203,6 +203,12 @@ expect(int fd, const char *str, int *ftprc) retval = -1; break; default: + if (set[0].revents & POLLHUP) { + done = 1; + retval = -1; + break; + } + rc=read(fd,&buf[sizeof(buf)-1],1); if (verbose_expect) @@ -376,7 +382,7 @@ setupCoproc(const char *base) static void sigchld_handler (int n) { - /* Make select(2) return EINTR */ + /* Make poll(2) return EINTR */ } @@ -451,14 +457,14 @@ ftp_start(char *base) const char *currentDir=getenv(PKG_FTPIO_CURRENTDIR); int urllen; +#if HAVE_TGETENT /* talk to termcap for bold on/off escape sequences */ -#if 0 - if (tgetent(term, getenv("TERM")) < 0) { - bold_on[0] = '\0'; - bold_off[0] = '\0'; - } else { + if (getenv("TERM") != NULL && tgetent(term, getenv("TERM")) > 0) { p = bold_on; tgetstr("md", &p); p = bold_off; tgetstr("me", &p); + } else { + bold_on[0] = '\0'; + bold_off[0] = '\0'; } #else bold_on[0] = '\0'; @@ -565,7 +571,7 @@ expandURL(char *expandedurl, const char *wildcardurl) pkg=strrchr(wildcardurl, '/'); if (pkg == NULL){ - warnx("expandURL: no '/' in url %s?!", wildcardurl); + warnx("expandURL: no '/' in URL %s?!", wildcardurl); return -1; } (void) snprintf(base, sizeof(base), "%*.*s/", (int)(pkg-wildcardurl), @@ -585,7 +591,7 @@ expandURL(char *expandedurl, const char *wildcardurl) char best[FILENAME_MAX]; int tfd; - strcpy(tmpname, "/var/tmp/pkg.XXXXXX"); + strlcpy(tmpname, "/var/tmp/pkg.XXXXXX", sizeof(tmpname)); tfd=mkstemp(tmpname); if (tfd == -1) { warnx("Cannot generate temp file for ftp(1)'s nlist output"); @@ -697,7 +703,7 @@ unpackURL(const char *url, const char *dir) char pkg_path[FILENAME_MAX]; { - /* Verify if the url is really ok */ + /* Verify if the URL is really ok */ char expnd[FILENAME_MAX]; rc=expandURL(expnd, url); @@ -714,7 +720,7 @@ unpackURL(const char *url, const char *dir) pkg=strrchr(url, '/'); if (pkg == NULL){ - warnx("unpackURL: no '/' in url %s?!", url); + warnx("unpackURL: no '/' in URL %s?!", url); return -1; } (void) snprintf(base, sizeof(base), "%*.*s/", (int)(pkg-url), @@ -745,7 +751,7 @@ unpackURL(const char *url, const char *dir) printf("unpackURL '%s' to '%s'\n", url, dir); /* yes, this is gross, but needed for borken ftp(1) */ - (void) snprintf(cmd, sizeof(cmd), "get %s \"| ( cd %s ; gunzip 2>/dev/null | " TAR_FULLPATHNAME " -%sx -f - | tee /dev/stderr )\"\n", pkg, dir, Verbose?"vv":""); + (void) snprintf(cmd, sizeof(cmd), "get %s \"| ( cd %s ; gunzip 2>/dev/null | " TAR_CMD " -%sx -f - | tee /dev/stderr )\"\n", pkg, dir, Verbose?"vv":""); rc = ftp_cmd(cmd, "\n(226|550).*\n"); if (rc != 226) { warnx("Cannot fetch file (%d!=226)!", rc); @@ -770,7 +776,7 @@ miscstuff(const char *url) pkg=strrchr(url, '/'); if (pkg == NULL){ - warnx("miscstuff: no '/' in url %s?!", url); + warnx("miscstuff: no '/' in URL %s?!", url); return -1; } (void) snprintf(base, sizeof(base), "%*.*s/", (int)(pkg-url), (int)(pkg-url), diff --git a/pkgtools/pkg_install/files/lib/global.c b/pkgtools/pkg_install/files/lib/global.c index 0c8b14806a8..794d493b938 100644 --- a/pkgtools/pkg_install/files/lib/global.c +++ b/pkgtools/pkg_install/files/lib/global.c @@ -1,13 +1,17 @@ -/* $NetBSD: global.c,v 1.1.1.1 2002/12/20 18:14:01 schmonz Exp $ */ +/* $NetBSD: global.c,v 1.2 2003/09/01 16:27:14 jlam Exp $ */ -#if 0 +#include <nbcompat.h> +#if HAVE_CONFIG_H +#include "config.h" +#endif +#if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> +#endif #ifndef lint #if 0 static const char *rcsid = "from FreeBSD Id: global.c,v 1.6 1997/10/08 07:47:58 charnier Exp"; #else -__RCSID("$NetBSD: global.c,v 1.1.1.1 2002/12/20 18:14:01 schmonz Exp $"); -#endif +__RCSID("$NetBSD: global.c,v 1.2 2003/09/01 16:27:14 jlam Exp $"); #endif #endif diff --git a/pkgtools/pkg_install/files/lib/lib.h.in b/pkgtools/pkg_install/files/lib/lib.h index bbeecbbc1ef..16d0173066f 100644 --- a/pkgtools/pkg_install/files/lib/lib.h.in +++ b/pkgtools/pkg_install/files/lib/lib.h @@ -1,4 +1,4 @@ -/* $NetBSD: lib.h.in,v 1.6 2003/04/11 21:27:43 grant Exp $ */ +/* $NetBSD: lib.h,v 1.1 2003/09/01 16:27:15 jlam Exp $ */ /* from FreeBSD Id: lib.h,v 1.25 1997/10/08 07:48:03 charnier Exp */ @@ -25,43 +25,46 @@ #ifndef _INST_LIB_LIB_H_ #define _INST_LIB_LIB_H_ -#ifdef HAVE_CONFIG_H +#include <nbcompat.h> +#if HAVE_CONFIG_H #include "config.h" #endif - -#include <sys/types.h> - -#if defined(HAVE_SYS_PARAM_H) +#if HAVE_SYS_PARAM_H #include <sys/param.h> #endif - -#if defined(HAVE_SYS_STAT_H) +#if HAVE_SYS_STAT_H #include <sys/stat.h> #endif - -#if defined(HAVE_SYS_FILE_H) +#if HAVE_SYS_FILE_H #include <sys/file.h> #endif - -#if defined(HAVE_SYS_QUEUE_H) +#if HAVE_SYS_QUEUE_H #include <sys/queue.h> #endif +#if HAVE_CTYPE_H #include <ctype.h> - -#if defined(HAVE_DIRENT_H) +#endif +#if HAVE_DIRENT_H #include <dirent.h> #endif - +#if HAVE_STDIO_H #include <stdio.h> +#endif +#if HAVE_STDLIB_H #include <stdlib.h> +#endif +#if HAVE_STDARG_H #include <stdarg.h> - -#if defined(HAVE_STRING_H) +#endif +#if HAVE_STRING_H #include <string.h> #endif - +#if HAVE_UNISTD_H #include <unistd.h> +#endif + +#include "path.h" /* Macros */ #define SUCCESS (0) @@ -75,72 +78,42 @@ #define FALSE (0) #endif -#ifndef TAR_FULLPATHNAME -#define TAR_FULLPATHNAME "@TAR_FULLPATHNAME@" -#endif +/* Usually "rm", but often "echo" during debugging! */ +#define REMOVE_CMD "rm" -/* Define ftp as a string, in case the ftp client is called something else */ -#ifndef FTP_CMD -#define FTP_CMD "ftp" +/* Usually "rm", but often "echo" during debugging! */ +#define RMDIR_CMD "rmdir" + +/* Define tar as a string, in case it's called gtar or something */ +#ifndef TAR_CMD +#define TAR_CMD "tar" #endif /* Define gzip and bzip2, used to unpack binary packages */ #ifndef GZIP_CMD -#define GZIP_CMD "gzip" +#define GZIP_CMD "gzip" #endif #ifndef BZIP2_CMD -#define BZIP2_CMD "bzip2" +#define BZIP2_CMD "bzip2" #endif -#ifndef ADD_CMD -#define ADD_CMD "@prefix@/sbin/pkg_add" -#endif -#ifndef CHMOD_CMD -#define CHMOD_CMD "@CHMOD@" +/* Define ftp as a string, in case the ftp client is called something else */ +#ifndef FTP_CMD +#define FTP_CMD "ftp" #endif + #ifndef CHOWN_CMD -#define CHOWN_CMD "@CHOWN@" -#endif -#ifndef CHGRP_CMD -#define CHGRP_CMD "@CHGRP@" -#endif -#ifndef DIGEST -#define DIGEST "@DIGEST@" -#endif -#ifndef MKDIR -#define MKDIR "@MKDIR@" -#endif -#ifndef MTREE -#define MTREE "@MTREE@" -#endif -#ifndef PREFIX -#define PREFIX "@prefix@" -#endif -#ifndef RM -#define RM "@RM@" -#endif -#ifndef RMDIR_CMD -#define RMDIR_CMD "@RMDIR@" +#define CHOWN_CMD "chown" #endif -#if defined(BSD4_4) -/* the BSD derivatives have added --fast-read to their tar(1) commands */ -#define HAVE_TAR__FAST_READ 1 +#ifndef CHMOD_CMD +#define CHMOD_CMD "chmod" #endif -enum { - ReadWrite, - ReadOnly -}; - - -/* Where we put logging information by default, else ${PKG_DBDIR} if set */ -#ifndef DEF_LOG_DIR -#define DEF_LOG_DIR "@pkgdbdir@" +#ifndef CHGRP_CMD +#define CHGRP_CMD "chgrp" #endif -/* just in case we change the environment variable name */ -#define PKG_DBDIR "PKG_DBDIR" /* The names of our "special" files */ #define CONTENTS_FNAME "+CONTENTS" @@ -157,121 +130,27 @@ enum { #define SIZE_PKG_FNAME "+SIZE_PKG" #define SIZE_ALL_FNAME "+SIZE_ALL" #define PRESERVE_FNAME "+PRESERVE" +#define VIEWS_FNAME "+VIEWS" +#define DEPOT_FNAME "+DEPOT" #define CMD_CHAR '@' /* prefix for extended PLIST cmd */ /* The name of the "prefix" environment variable given to scripts */ #define PKG_PREFIX_VNAME "PKG_PREFIX" -#define PKG_PATTERN_MAX FILENAME_MAX /* max length of pattern, including nul */ -#define PKG_SUFFIX_MAX 10 /* max length of suffix, including nul */ - +#define PKG_PATTERN_MAX FILENAME_MAX /* max length of pattern, including nul */ +#define PKG_SUFFIX_MAX 10 /* max length of suffix, including nul */ /* This should only happen on 1.3 and 1.3.1, not 1.3.2 and up */ #ifndef TAILQ_FIRST #define TAILQ_FIRST(head) ((head)->tqh_first) -#endif - -#ifndef TAILQ_NEXT #define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next) #endif -/* - * Tail queue definitions. - */ -#ifndef QUEUEDEBUG_TAILQ_INSERT_HEAD -#define QUEUEDEBUG_TAILQ_INSERT_HEAD(head, elm, field) -#endif - -#ifndef QUEUEDEBUG_TAILQ_INSERT_TAIL -#define QUEUEDEBUG_TAILQ_INSERT_TAIL(head, elm, field) -#endif - -#ifndef QUEUEDEBUG_TAILQ_OP -#define QUEUEDEBUG_TAILQ_OP(elm, field) -#endif - -#ifndef QUEUEDEBUG_TAILQ_POSTREMOVE -#define QUEUEDEBUG_TAILQ_POSTREMOVE(elm, field) -#endif - -#ifndef TAILQ_INIT -#define TAILQ_INIT(head) do { \ - (head)->tqh_first = NULL; \ - (head)->tqh_last = &(head)->tqh_first; \ -} while (/*CONSTCOND*/0) -#endif - -#ifndef TAILQ_HEAD -#define TAILQ_HEAD(name, type) \ -struct name { \ - struct type *tqh_first; /* first element */ \ - struct type **tqh_last; /* addr of last next element */ \ -} -#endif - -#ifndef TAILQ_HEAD_INITIALIZER -#define TAILQ_HEAD_INITIALIZER(head) \ - { NULL, &(head).tqh_first } -#endif - -#ifndef TAILQ_ENTRY -#define TAILQ_ENTRY(type) \ -struct { \ - struct type *tqe_next; /* next element */ \ - struct type **tqe_prev; /* address of previous next element */ \ -} -#endif - -#ifndef TAILQ_INSERT_HEAD -#define TAILQ_INSERT_HEAD(head, elm, field) do { \ - QUEUEDEBUG_TAILQ_INSERT_HEAD((head), (elm), field) \ - if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \ - (head)->tqh_first->field.tqe_prev = \ - &(elm)->field.tqe_next; \ - else \ - (head)->tqh_last = &(elm)->field.tqe_next; \ - (head)->tqh_first = (elm); \ - (elm)->field.tqe_prev = &(head)->tqh_first; \ -} while (/*CONSTCOND*/0) -#endif - -#ifndef TAILQ_INSERT_TAIL -#define TAILQ_INSERT_TAIL(head, elm, field) do { \ - QUEUEDEBUG_TAILQ_INSERT_TAIL((head), (elm), field) \ - (elm)->field.tqe_next = NULL; \ - (elm)->field.tqe_prev = (head)->tqh_last; \ - *(head)->tqh_last = (elm); \ - (head)->tqh_last = &(elm)->field.tqe_next; \ -} while (/*CONSTCOND*/0) -#endif /* !TAILQ_INSERT_TAIL */ - -#ifndef TAILQ_REMOVE -#define TAILQ_REMOVE(head, elm, field) do { \ - QUEUEDEBUG_TAILQ_OP((elm), field) \ - if (((elm)->field.tqe_next) != NULL) \ - (elm)->field.tqe_next->field.tqe_prev = \ - (elm)->field.tqe_prev; \ - else \ - (head)->tqh_last = (elm)->field.tqe_prev; \ - *(elm)->field.tqe_prev = (elm)->field.tqe_next; \ - QUEUEDEBUG_TAILQ_POSTREMOVE((elm), field); \ -} while (/*CONSTCOND*/0) -#endif - -#ifndef TAILQ_FOREACH -#define TAILQ_FOREACH(var, head, field) \ - for ((var) = ((head)->tqh_first); \ - (var); \ - (var) = ((var)->field.tqe_next)) -#endif - -#ifndef TAILQ_FOREACH_REVERSE -#define TAILQ_FOREACH_REVERSE(var, head, headname, field) \ - for ((var) = (*(((struct headname *)((head)->tqh_last))->tqh_last)); \ - (var); \ - (var) = (*(((struct headname *)((var)->field.tqe_prev))->tqh_last))) -#endif +enum { + ReadWrite, + ReadOnly +}; /* Enumerated constants for plist entry types */ @@ -339,8 +218,9 @@ typedef int (*matchfn) (const char *, void *); /* If URLlength()>0, then there is a ftp:// or http:// in the string, * and this must be an URL. Hide this behind a more obvious name. */ #define IS_URL(str) (URLlength(str) > 0) -#define IS_STDIN(str) ((str) != NULL && !strcmp((str), "-")) -#define IS_FULLPATH(str) ((str) != NULL && (str)[0] == '/') + +#define IS_STDIN(str) ((str) != NULL && !strcmp((str), "-")) +#define IS_FULLPATH(str) ((str) != NULL && (str)[0] == '/') /* Prototypes */ /* Misc */ @@ -350,66 +230,52 @@ void cleanup(int); char *make_playpen(char *, size_t, size_t); char *where_playpen(void); void leave_playpen(char *); -int64_t min_free(char *); +uint64_t min_free(char *); void save_dirs(char **c, char **p); void restore_dirs(char *c, char *p); void show_version(void); - -#ifndef HAVE_MD5FILE -char *MD5File(char *, char *); -#endif - -#ifndef HAVE_FGETLN -char *fgetln(FILE *, size_t *); -#endif +int fexec(const char *, ...); +int fcexec(const char *, const char *, ...); /* String */ char *get_dash_string(char **); void str_lowercase(char *); -const char *basename_of(const char *); -const char *dirname_of(const char *); +const char *basename_of(const char *); +const char *dirname_of(const char *); const char *suffix_of(const char *); int pmatch(const char *, const char *); -int findmatchingname(const char *, const char *, matchfn, void *); /* doesn't really belong to "strings" */ +int findmatchingname(const char *, const char *, matchfn, void *); /* doesn't really belong to "strings" */ char *findbestmatchingname(const char *, const char *); /* neither */ int ispkgpattern(const char *); char *strnncpy(char *to, size_t tosize, char *from, size_t cc); void strip_txz(char *buf, char *sfx, const char *fname); /* callback functions for findmatchingname */ -int findbestmatchingname_fn(const char *, void *); /* neither */ -int note_whats_installed(const char *, void *); -int add_to_list_fn(const char *, void *); +int findbestmatchingname_fn(const char *, void *); /* neither */ +int note_whats_installed(const char *, void *); +int add_to_list_fn(const char *, void *); -#ifndef HAVE_STRSEP -char *strsep(char **, const char *); -#endif - -#ifndef HAVE_STRLCPY -size_t strlcpy(char *, const char *, size_t); -#endif - /* File */ Boolean fexists(const char *); Boolean isdir(const char *); Boolean islinktodir(const char *); -Boolean isemptydir(const char *fname); -Boolean isemptyfile(const char *fname); +Boolean isemptydir(const char *); +Boolean isemptyfile(const char *); Boolean isfile(const char *); Boolean isempty(const char *); int URLlength(const char *); char *fileGetURL(const char *); -const char *fileURLFilename(const char *, char *, int); -char *fileFindByPath(const char *); -const char *fileURLHost(const char *, char *, int); +const char *fileURLFilename(const char *, char *, int); +const char *fileURLHost(const char *, char *, int); +char *fileFindByPath(const char *); char *fileGetContents(char *); Boolean make_preserve_name(char *, size_t, char *, char *); void write_file(char *, char *); void copy_file(char *, char *, char *); void move_file(char *, char *, char *); int delete_hierarchy(char *, Boolean, Boolean); -int unpack(const char *,const char *); +int unpack(const char *, const char *); void format_cmd(char *, size_t, char *, char *, char *); /* ftpio.c: FTP handling */ @@ -446,6 +312,7 @@ int pkgdb_remove(const char *); int pkgdb_remove_pkg(const char *); char *_pkgdb_getPKGDB_FILE(char *, unsigned); char *_pkgdb_getPKGDB_DIR(void); +void _pkgdb_setPKGDB_DIR(const char *); /* List of packages functions */ lpkg_t *alloc_lpkg(const char *); @@ -459,8 +326,6 @@ int pkg_perform(lpkg_head_t *); extern Boolean Verbose; extern Boolean Fake; extern Boolean Force; -extern int upgrade; +extern Boolean Replace; -/* We include it at the end, because it uses TAILQ_* */ -#include "path.h" #endif /* _INST_LIB_LIB_H_ */ diff --git a/pkgtools/pkg_install/files/lib/lpkg.c b/pkgtools/pkg_install/files/lib/lpkg.c index 6aad8c01b49..7901269acb5 100644 --- a/pkgtools/pkg_install/files/lib/lpkg.c +++ b/pkgtools/pkg_install/files/lib/lpkg.c @@ -1,4 +1,4 @@ -/* $NetBSD: lpkg.c,v 1.2 2003/01/06 04:34:17 jschauma Exp $ */ +/* $NetBSD: lpkg.c,v 1.3 2003/09/01 16:27:15 jlam Exp $ */ /* * Copyright (c) 1999 Christian E. Hopps @@ -28,14 +28,14 @@ * * Package-list auxiliary functions */ -#ifdef HAVE_CONFIG_H + +#include <nbcompat.h> +#if HAVE_CONFIG_H #include "config.h" #endif - -#ifdef HAVE_ERR_H +#if HAVE_ERR_H #include <err.h> #endif - #include "lib.h" /* diff --git a/pkgtools/pkg_install/files/lib/path.c b/pkgtools/pkg_install/files/lib/path.c index 1ef24c5f064..143a2df93b5 100644 --- a/pkgtools/pkg_install/files/lib/path.c +++ b/pkgtools/pkg_install/files/lib/path.c @@ -1,4 +1,4 @@ -/* $NetBSD: path.c,v 1.2 2003/01/06 04:34:17 jschauma Exp $ */ +/* $NetBSD: path.c,v 1.3 2003/09/01 16:27:15 jlam Exp $ */ /*- * Copyright (c)2002 YAMAMOTO Takashi, @@ -26,18 +26,18 @@ * SUCH DAMAGE. */ -#if 0 -#include <sys/cdefs.h> -#ifndef lint -__RCSID("$NetBSD: path.c,v 1.2 2003/01/06 04:34:17 jschauma Exp $"); +#include <nbcompat.h> +#if HAVE_CONFIG_H +#include "config.h" #endif +#if HAVE_SYS_CDEFS_H +#include <sys/cdefs.h> #endif - -#ifdef HAVE_CONFIG_H -#include "config.h" +#ifndef lint +__RCSID("$NetBSD: path.c,v 1.3 2003/09/01 16:27:15 jlam Exp $"); #endif -#ifdef HAVE_ERR_H +#if HAVE_ERR_H #include <err.h> #endif diff --git a/pkgtools/pkg_install/files/lib/path.h b/pkgtools/pkg_install/files/lib/path.h index 1b7a301e251..c348c176ec6 100644 --- a/pkgtools/pkg_install/files/lib/path.h +++ b/pkgtools/pkg_install/files/lib/path.h @@ -1,4 +1,4 @@ -/* $NetBSD: path.h,v 1.1.1.1 2002/12/20 18:14:06 schmonz Exp $ */ +/* $NetBSD: path.h,v 1.2 2003/09/01 16:27:15 jlam Exp $ */ /*- * Copyright (c)2002 YAMAMOTO Takashi, diff --git a/pkgtools/pkg_install/files/lib/pen.c b/pkgtools/pkg_install/files/lib/pen.c index e392ea25c0a..64377e716ba 100644 --- a/pkgtools/pkg_install/files/lib/pen.c +++ b/pkgtools/pkg_install/files/lib/pen.c @@ -1,13 +1,17 @@ -/* $NetBSD: pen.c,v 1.6 2003/04/11 21:27:43 grant Exp $ */ +/* $NetBSD: pen.c,v 1.7 2003/09/01 16:27:15 jlam Exp $ */ -#if 0 +#include <nbcompat.h> +#if HAVE_CONFIG_H +#include "config.h" +#endif +#if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> +#endif #ifndef lint #if 0 static const char *rcsid = "from FreeBSD Id: pen.c,v 1.25 1997/10/08 07:48:12 charnier Exp"; #else -__RCSID("$NetBSD: pen.c,v 1.6 2003/04/11 21:27:43 grant Exp $"); -#endif +__RCSID("$NetBSD: pen.c,v 1.7 2003/09/01 16:27:15 jlam Exp $"); #endif #endif @@ -30,36 +34,25 @@ __RCSID("$NetBSD: pen.c,v 1.6 2003/04/11 21:27:43 grant Exp $"); * Routines for managing the "play pen". * */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#ifdef HAVE_ERR_H +#if HAVE_ERR_H #include <err.h> #endif - #include "lib.h" - -#ifdef HAVE_SIGNAL_H -#include <signal.h> +#if HAVE_SYS_SIGNAL_H +#include <sys/signal.h> #endif - -#ifdef HAVE_SYS_PARAM_H +#if HAVE_SYS_PARAM_H #include <sys/param.h> #endif - -#ifdef HAVE_SYS_MOUNT_H +#if HAVE_SYS_MOUNT_H #include <sys/mount.h> #endif -#ifdef HAVE_SYS_VFS_H -#include <sys/vfs.h> -#endif - /* For keeping track of where we are */ static char Current[FILENAME_MAX]; static char Previous[FILENAME_MAX]; -static int CurrentSet; /* rm -rf Current only if it's really set! */ +static int CurrentSet; /* rm -fr Current only if it's really set! */ /* CurrentSet is set to 0 before strcpy()s * to prevent rm'ing of a partial string * when interrupted by ^C */ @@ -86,11 +79,11 @@ void restore_dirs(char *c, char *p) { CurrentSet = 0; /* prevent from deleting */ - strcpy(Current, c); + strlcpy(Current, c, sizeof(Current)); CurrentSet = 1; /* rm -fr Current is safe now */ free(c); - strcpy(Previous, p); + strlcpy(Previous, p, sizeof(Previous)); free(p); } #endif @@ -117,11 +110,11 @@ find_play_pen(char *pen, size_t pensize, size_t sz) else if ((cp = getenv("TMPDIR")) != NULL && stat(cp, &sb) != FAIL && (min_free(cp) >= sz)) (void) snprintf(pen, pensize, "%s/instmp.XXXXXX", cp); else if (stat("/var/tmp", &sb) != FAIL && min_free("/var/tmp") >= sz) - strcpy(pen, "/var/tmp/instmp.XXXXXX"); + strlcpy(pen, "/var/tmp/instmp.XXXXXX", pensize); else if (stat("/tmp", &sb) != FAIL && min_free("/tmp") >= sz) - strcpy(pen, "/tmp/instmp.XXXXXX"); + strlcpy(pen, "/tmp/instmp.XXXXXX", pensize); else if (stat("/usr/tmp", &sb) != FAIL && min_free("/usr/tmp") >= sz) - strcpy(pen, "/usr/tmp/instmp.XXXXXX"); + strlcpy(pen, "/usr/tmp/instmp.XXXXXX", pensize); else { cleanup(0); errx(2, @@ -133,23 +126,6 @@ find_play_pen(char *pen, size_t pensize, size_t sz) return pen; } -#if !defined(HAVE_MKDTEMP) -static char * -mkdtemp(char *template) -{ - /* mkdtemp(3) is not present on 1.3.3 and below */ - if (!mktemp(template)) { - cleanup(0); - errx(2, "can't mktemp '%s'", template); - } - if (mkdir(template, 0700) < 0) { - cleanup(0); - errx(2, "can't mkdir '%s'", template); - } - return template; -} -#endif - /* * Make a temporary directory to play in and chdir() to it, returning * pathname of previous working directory. @@ -160,10 +136,23 @@ make_playpen(char *pen, size_t pensize, size_t sz) if (!find_play_pen(pen, pensize, sz)) return NULL; +#if (defined(NetBSD1_3) || (NetBSD <= 199713)) && (NetBSD1_3 <9) + /* values from 1.3.2/1.3I */ + /* mkdtemp(3) is not present on 1.3.3 and below */ + if (!mktemp(pen)) { + cleanup(0); + errx(2, "can't mktemp '%s'", pen); + } + if (mkdir(pen, 0755) == FAIL) { + cleanup(0); + errx(2, "can't mkdir '%s'", pen); + } +#else if (!mkdtemp(pen)) { cleanup(0); errx(2, "can't mkdtemp '%s'", pen); } +#endif if (Verbose) { if (sz) fprintf(stderr, @@ -178,7 +167,7 @@ make_playpen(char *pen, size_t pensize, size_t sz) "with more space and\ntry the command again", pen); } if (Current[0]) - strcpy(Previous, Current); + strlcpy(Previous, Current, sizeof(Previous)); else if (!getcwd(Previous, FILENAME_MAX)) { cleanup(0); err(EXIT_FAILURE, "fatal error during execution: getcwd"); @@ -187,7 +176,7 @@ make_playpen(char *pen, size_t pensize, size_t sz) cleanup(0); errx(2, "can't chdir to '%s'", pen); } - CurrentSet = 0; strcpy(Current, pen); CurrentSet = 1; + CurrentSet = 0; strlcpy(Current, pen, sizeof(Current)); CurrentSet = 1; return Previous; } @@ -207,206 +196,26 @@ leave_playpen(char *save) errx(2, "can't chdir back to '%s'", Previous); } else if (CurrentSet && Current[0] && strcmp(Current, Previous)) { if (strcmp(Current, "/") == 0) { - fprintf(stderr, "PANIC: About to rm -rf / (not doing so, aborting)\n"); + fprintf(stderr, "PANIC: About to rm -fr / (not doing so, aborting)\n"); abort(); } - if (vsystem("%s -rf %s", RM, Current)) + if (fexec("rm", "-fr", Current, NULL)) warnx("couldn't remove temporary dir '%s'", Current); - strcpy(Current, Previous); + strlcpy(Current, Previous, sizeof(Current)); } if (save) - strcpy(Previous, save); + strlcpy(Previous, save, sizeof(Previous)); else Previous[0] = '\0'; signal(SIGINT, oldsig); } /* - * Solaris 2.7 and 2.8 have statfs(2), but it is deprecated, and has a - * different interface to NetBSD's statfs. - * We do this autoconf dance here to get around the old interface (it's - * in libc on 2.7 and 2.8, but not in 2.9) - */ -#if !defined(HAVE_STATFS) || (defined(HAVE_STATFS) && defined(HAVE_STATVFS) && !defined(__linux__) && !defined(__FreeBSD__)) -/* $NetBSD: pen.c,v 1.6 2003/04/11 21:27:43 grant Exp $ */ - -/*- - * Copyright (c) 1998 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Christos Zoulas. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include <string.h> -#include <sys/types.h> -#include <sys/mount.h> -#include <sys/statvfs.h> - -#define MFSNAMELEN 16 /* length of fs type name, including nul */ -#define MNAMELEN 90 /* length of buffer for returned name */ - -struct statfs { - short f_type; /* type of file system */ - u_short f_flags; /* copy of mount flags */ - long f_bsize; /* fundamental file system block size */ - long f_iosize; /* optimal transfer block size */ - long f_blocks; /* total data blocks in file system */ - long f_bfree; /* free blocks in fs */ - long f_bavail; /* free blocks avail to non-superuser */ - long f_files; /* total file nodes in file system */ - long f_ffree; /* free file nodes in fs */ - fsid_t f_fsid; /* file system id */ - uid_t f_owner; /* user that mounted the file system */ - long f_spare[4]; /* spare for later */ - char f_fstypename[MFSNAMELEN]; /* fs type name */ - char f_mntonname[MNAMELEN]; /* directory on which mounted */ - char f_mntfromname[MNAMELEN]; /* mounted file system */ -}; - -#ifndef MNT_RDONLY -#define MNT_RDONLY 0x00000001 /* read only filesystem */ -#endif - -#ifndef MNT_NOSUID -#define MNT_NOSUID 0x00000008 /* don't honor setuid bits on fs */ -#endif - -static void vfs2fs(struct statfs *, const struct statvfs *); - -static void -vfs2fs(struct statfs *sfs, const struct statvfs *vfs) -{ - sfs->f_type = 0; /* ok */ - sfs->f_flags = 0; - if (vfs->f_flag & ST_RDONLY) - sfs->f_flags |= MNT_RDONLY; - if (vfs->f_flag & ST_NOSUID) - sfs->f_flags |= MNT_NOSUID; - - /* - * From a quick survey of f_bsize, f_iosize, and f_frsize on - * various NetBSD and Solaris systems, with varying fragment and - * block sizes: - * - * f_bsize f_iosize f_frsize - * netbsd 1k/8k 1024 8192 - * netbsd 2k/16k 2048 16384 - * solaris 1k/8k 8192 1024 - * solaris 2k/8k 8192 2048 - * solaris 512/4k 4096 512 - * - * It is apparent that: - * - * - netbsd's f_bsize is equivalent to the fragment size of the - * underlying filesystem - * - netbsd's f_iosize is equivalent to the block size of the - * underlying filesystem - * - solaris's f_bsize is equivalent to the block size of the - * underlying filesystem - * - solaris's f_frsize is equivalent to the fragment size of the - * underlying filesystem - * - * NetBSD's statfs(2) man page (and sys/mount.h header file) says: - * - * long f_bsize; /* fundamental file system block size * / - * long f_iosize; /* optimal transfer block size * / - * - * and Solaris's statvfs(2) man page says: - * - * u_long f_bsize; /* preferred file system block size * / - * u_long f_frsize; /* fundamental filesystem block - * (size if supported) * / - * - * so it makes sense that their f_frsize == our f_bsize. - * - * I see that Solaris's sys/statvfs.h says: - * - * unsigned long f_bsize; /* fundamental file system block size * / - * unsigned long f_frsize; /* fragment size * / - * - * but empiric testing (above) seems to indicate that the comments - * in their code are wrong. The following two assignments, even - * though they may look wrong, are actually correct. - */ - sfs->f_bsize = vfs->f_frsize; - sfs->f_iosize = vfs->f_bsize; - sfs->f_blocks = vfs->f_blocks; - sfs->f_bfree = vfs->f_bfree; - sfs->f_bavail = vfs->f_bavail; - sfs->f_files = vfs->f_files; - sfs->f_ffree = vfs->f_ffree; - (void) memcpy(&sfs->f_fsid.val[0], &vfs->f_fsid, sizeof(fsid_t)); - sfs->f_owner = 0; /* XXX: root always here */ - (void)strncpy(sfs->f_fstypename, - vfs->f_basetype, sizeof(sfs->f_fstypename)); - sfs->f_mntonname[0] = '\0'; /* XXX: */ - sfs->f_mntfromname[0] = '\0'; /* XXX: */ -} - -int -statfs(path, sfs) - const char *path; - struct statfs *sfs; -{ - struct statvfs vfs; - - if (statvfs(path, &vfs) == -1) - return -1; - vfs2fs(sfs, &vfs); - return 0; - -} - -int -fstatfs(fd, sfs) - int fd; - struct statfs *sfs; -{ - struct statvfs vfs; - - if (fstatvfs(fd, &vfs) == -1) - return -1; - - vfs2fs(sfs, &vfs); - return 0; -} -#endif - -/* * Return free disk space (in bytes) on given file system. - * Returns size in a int64_t since off_t isn't 64 bits on all + * Returns size in a uint64_t since off_t isn't 64 bits on all * operating systems. */ -int64_t +uint64_t min_free(char *tmpdir) { struct statfs buf; @@ -415,5 +224,5 @@ min_free(char *tmpdir) warn("statfs"); return -1; } - return (int64_t) buf.f_bavail * (int64_t) buf.f_bsize; + return (uint64_t) buf.f_bavail * (uint64_t) buf.f_bsize; } diff --git a/pkgtools/pkg_install/files/lib/pkgdb.c b/pkgtools/pkg_install/files/lib/pkgdb.c index 2083d0f4965..9ad24071880 100644 --- a/pkgtools/pkg_install/files/lib/pkgdb.c +++ b/pkgtools/pkg_install/files/lib/pkgdb.c @@ -1,10 +1,14 @@ -/* $NetBSD: pkgdb.c,v 1.10 2003/04/11 14:40:37 grant Exp $ */ +/* $NetBSD: pkgdb.c,v 1.11 2003/09/01 16:27:15 jlam Exp $ */ -#if 0 +#include <nbcompat.h> +#if HAVE_CONFIG_H +#include "config.h" +#endif +#if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> -#ifndef lint -__RCSID("$NetBSD: pkgdb.c,v 1.10 2003/04/11 14:40:37 grant Exp $"); #endif +#ifndef lint +__RCSID("$NetBSD: pkgdb.c,v 1.11 2003/09/01 16:27:15 jlam Exp $"); #endif /* @@ -36,37 +40,43 @@ __RCSID("$NetBSD: pkgdb.c,v 1.10 2003/04/11 14:40:37 grant Exp $"); * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#ifdef HAVE_DB1_DB_H -#include <db1/db.h> -#elif defined(HAVE_DB_H) +#if HAVE_DB_H #include <db.h> #endif - -#ifdef HAVE_ERR_H +#if HAVE_ERR_H #include <err.h> #endif - +#if HAVE_ERRNO_H #include <errno.h> - -#ifdef HAVE_FCNTL_H +#endif +#if HAVE_FCNTL_H #include <fcntl.h> #endif - +#if HAVE_STDARG_H #include <stdarg.h> +#endif +#if HAVE_STDIO_H #include <stdio.h> +#endif #include "lib.h" #define PKGDB_FILE "pkgdb.byfile.db" /* indexed by filename */ -#if defined(HAVE_DBOPEN) -static DB *pkgdbp; -static int pkgdb_iter_flag; -#endif /* HAVE_DBOPEN */ +/* + * Where we put logging information by default if PKG_DBDIR is unset. + */ +#ifndef DEF_LOG_DIR +#define DEF_LOG_DIR "/var/db/pkg" +#endif + +/* just in case we change the environment variable name */ +#define PKG_DBDIR "PKG_DBDIR" + +static DB *pkgdbp; +static char *pkgdb_dir = NULL; +static char pkgdb_cache[FILENAME_MAX]; /* * Open the pkg-database @@ -77,12 +87,9 @@ static int pkgdb_iter_flag; int pkgdb_open(int mode) { -#if defined(HAVE_DBOPEN) BTREEINFO info; char cachename[FILENAME_MAX]; - pkgdb_iter_flag = 0; /* used in pkgdb_iter() */ - /* try our btree format first */ info.flags = 0; info.cachesize = 2*1024*1024; @@ -96,9 +103,6 @@ pkgdb_open(int mode) (mode == ReadOnly) ? O_RDONLY : O_RDWR | O_CREAT, 0644, DB_BTREE, (void *) &info); return (pkgdbp != NULL); -#else - return -1; -#endif /* HAVE_DBOPEN */ } /* @@ -107,12 +111,10 @@ pkgdb_open(int mode) void pkgdb_close(void) { -#if defined(HAVE_DBOPEN) if (pkgdbp != NULL) { (void) (*pkgdbp->close) (pkgdbp); pkgdbp = NULL; } -#endif /* HAVE_DBOPEN */ } /* @@ -125,7 +127,6 @@ pkgdb_close(void) int pkgdb_store(const char *key, const char *val) { -#if defined(HAVE_DBOPEN) DBT keyd, vald; if (pkgdbp == NULL) @@ -140,9 +141,6 @@ pkgdb_store(const char *key, const char *val) return -1; return (*pkgdbp->put) (pkgdbp, &keyd, &vald, R_NOOVERWRITE); -#else - return EXIT_SUCCESS; -#endif /* HAVE_DBOPEN */ } /* @@ -154,7 +152,6 @@ pkgdb_store(const char *key, const char *val) char * pkgdb_retrieve(const char *key) { -#if defined(HAVE_DBOPEN) DBT keyd, vald; int status; @@ -174,29 +171,25 @@ pkgdb_retrieve(const char *key) } return vald.data; -#else - return NULL; -#endif /* HAVE_DBOPEN */ } /* dump contents of the database to stdout */ void pkgdb_dump(void) { -#if defined(HAVE_DBOPEN) DBT key; - DBT val; - int type; + DBT val; + int type; if (pkgdb_open(ReadOnly)) { for (type = R_FIRST ; (*pkgdbp->seq)(pkgdbp, &key, &val, type) == 0 ; type = R_NEXT) { printf("file: %.*s pkg: %.*s\n", - (int) key.size, (char *) key.data, - (int) val.size, (char *) val.data); + (int) key.size, (char *) key.data, + (int) val.size, (char *) val.data); } pkgdb_close(); } -#endif /* HAVE_DBOPEN */ + } /* @@ -209,7 +202,6 @@ pkgdb_dump(void) int pkgdb_remove(const char *key) { -#if defined(HAVE_DBOPEN) DBT keyd; if (pkgdbp == NULL) @@ -221,16 +213,12 @@ pkgdb_remove(const char *key) return -1; return (*pkgdbp->del) (pkgdbp, &keyd, 0); -#else - return EXIT_SUCCESS; -#endif /* HAVE_DBOPEN */ } /* remove any entry from the cache which has a data field of `pkg' */ int pkgdb_remove_pkg(const char *pkg) { -#if defined(HAVE_DBOPEN) DBT data; DBT key; int type; @@ -247,25 +235,21 @@ pkgdb_remove_pkg(const char *pkg) printf("Removing file %s from pkgdb\n", (char *)key.data); } switch ((*pkgdbp->del)(pkgdbp, &key, 0)) { - case -1: - warn("Error removing %s from pkgdb", (char *) key.data); - ret = 0; - break; - case 1: - warn("Key %s not present in pkgdb", (char *) key.data); - ret = 0; - break; + case -1: + warn("Error removing %s from pkgdb", (char *) key.data); + ret = 0; + break; + case 1: + warn("Key %s not present in pkgdb", (char *) key.data); + ret = 0; + break; } } } return ret; -#else - return EXIT_SUCCESS; -#endif /* HAVE_DBOPEN */ } - /* * Return name of cache file in the buffer that was passed. */ @@ -282,11 +266,24 @@ _pkgdb_getPKGDB_FILE(char *buf, unsigned size) char * _pkgdb_getPKGDB_DIR(void) { - char *tmp; - static char *cache = NULL; + char *tmp; - if (cache == NULL) - cache = (tmp = getenv(PKG_DBDIR)) ? tmp : DEF_LOG_DIR; + if (pkgdb_dir == NULL) { + if ((tmp = getenv(PKG_DBDIR))) + _pkgdb_setPKGDB_DIR(tmp); + else + _pkgdb_setPKGDB_DIR(DEF_LOG_DIR); + } + + return pkgdb_dir; +} - return cache; +/* + * Set the first place we look for where pkgdb is stored. + */ +void +_pkgdb_setPKGDB_DIR(const char *dir) +{ + (void) snprintf(pkgdb_cache, sizeof(pkgdb_cache), "%s", dir); + pkgdb_dir = pkgdb_cache; } diff --git a/pkgtools/pkg_install/files/lib/plist.c b/pkgtools/pkg_install/files/lib/plist.c index a6495267925..6c71b187f9a 100644 --- a/pkgtools/pkg_install/files/lib/plist.c +++ b/pkgtools/pkg_install/files/lib/plist.c @@ -1,13 +1,17 @@ -/* $NetBSD: plist.c,v 1.3 2003/04/17 14:00:55 grant Exp $ */ +/* $NetBSD: plist.c,v 1.4 2003/09/01 16:27:15 jlam Exp $ */ -#if 0 +#include <nbcompat.h> +#if HAVE_CONFIG_H +#include "config.h" +#endif +#if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> +#endif #ifndef lint #if 0 static const char *rcsid = "from FreeBSD Id: plist.c,v 1.24 1997/10/08 07:48:15 charnier Exp"; #else -__RCSID("$NetBSD: plist.c,v 1.3 2003/04/17 14:00:55 grant Exp $"); -#endif +__RCSID("$NetBSD: plist.c,v 1.4 2003/09/01 16:27:15 jlam Exp $"); #endif #endif @@ -32,17 +36,13 @@ __RCSID("$NetBSD: plist.c,v 1.3 2003/04/17 14:00:55 grant Exp $"); */ #include "lib.h" +#if HAVE_ERRNO_H #include <errno.h> - -#ifdef HAVE_ERR_H -#include <err.h> #endif - -#ifdef HAVE_MD5GLOBAL_H -#include <md5global.h> +#if HAVE_ERR_H +#include <err.h> #endif - -#ifdef HAVE_MD5_H +#if HAVE_MD5_H #include <md5.h> #endif @@ -247,7 +247,7 @@ plist_cmd(char *s, char **arg) char *cp; char *sp; - (void) strcpy(cmd, s); + (void) strlcpy(cmd, s, sizeof(cmd)); str_lowercase(cmd); for (cp = cmd, sp = s; *cp; cp++, sp++) { if (isspace((unsigned char) *cp)) { @@ -467,8 +467,8 @@ delete_package(Boolean ign_err, Boolean nukedirs, package_t *pkg) } #ifdef DEBUG -#define RMDIR(dir) vsystem("%s %s", RMDIR, dir) -#define REMOVE(dir,ie) vsystem("%s %s%s", RM, (ie ? "-f " : ""), dir) +#define RMDIR(dir) vsystem("%s %s", RMDIR_CMD, dir) +#define REMOVE(dir,ie) vsystem("%s %s%s", REMOVE_CMD, (ie ? "-f " : ""), dir) #else #define RMDIR rmdir #define REMOVE(file,ie) (remove(file) && !(ie)) @@ -490,7 +490,7 @@ delete_hierarchy(char *dir, Boolean ign_err, Boolean nukedirs) isdir(dir) ? "directory" : "file", dir); return !ign_err; } else if (nukedirs) { - if (vsystem("%s -r%s %s", RM, (ign_err ? "f" : ""), dir)) + if (vsystem("%s -r%s %s", REMOVE_CMD, (ign_err ? "f" : ""), dir)) return 1; } else if (isdir(dir)) { if (RMDIR(dir) && !ign_err) diff --git a/pkgtools/pkg_install/files/lib/setprogname.c b/pkgtools/pkg_install/files/lib/setprogname.c deleted file mode 100644 index 1de44d32f4b..00000000000 --- a/pkgtools/pkg_install/files/lib/setprogname.c +++ /dev/null @@ -1,63 +0,0 @@ -/* $Id: setprogname.c,v 1.1.1.1 2002/12/20 18:14:06 schmonz Exp $ */ -/* $NetBSD: setprogname.c,v 1.1.1.1 2002/12/20 18:14:06 schmonz Exp $ */ - -/*- - * Copyright (c) 2001 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Todd Vierling. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include <string.h> -#include <stdio.h> - -static const char *__progname = "<unset_progname>"; - -#ifndef HAVE_SETPROGNAME -void -setprogname(const char *progname) -{ - __progname = strrchr(progname, '/'); - if (__progname == NULL) - __progname = progname; - else - __progname++; -} -#endif - -#ifndef HAVE_GETPROGNAME -const char * -getprogname(void) -{ - return __progname; -} -#endif diff --git a/pkgtools/pkg_install/files/lib/str.c b/pkgtools/pkg_install/files/lib/str.c index 63c8a34fbc8..a9cf0c19867 100644 --- a/pkgtools/pkg_install/files/lib/str.c +++ b/pkgtools/pkg_install/files/lib/str.c @@ -1,13 +1,17 @@ -/* $NetBSD: str.c,v 1.2 2003/01/06 04:34:17 jschauma Exp $ */ +/* $NetBSD: str.c,v 1.3 2003/09/01 16:27:15 jlam Exp $ */ -#if 0 +#include <nbcompat.h> +#if HAVE_CONFIG_H +#include "config.h" +#endif +#if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> +#endif #ifndef lint #if 0 static const char *rcsid = "Id: str.c,v 1.5 1997/10/08 07:48:21 charnier Exp"; #else -__RCSID("$NetBSD: str.c,v 1.2 2003/01/06 04:34:17 jschauma Exp $"); -#endif +__RCSID("$NetBSD: str.c,v 1.3 2003/09/01 16:27:15 jlam Exp $"); #endif #endif @@ -30,26 +34,16 @@ __RCSID("$NetBSD: str.c,v 1.2 2003/01/06 04:34:17 jschauma Exp $"); * Miscellaneous string utilities. * */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#ifdef HAVE_ASSERT_H +#if HAVE_ASSERT_H #include <assert.h> #endif - -#ifdef HAVE_ERR_H +#if HAVE_ERR_H #include <err.h> #endif - -#ifdef HAVE_FNMATCH_H +#if HAVE_FNMATCH_H #include <fnmatch.h> #endif - -#ifdef HAVE_LIMITS_H -#include <limits.h> -#endif - #include "lib.h" /* @@ -124,6 +118,8 @@ str_lowercase(char *s) /* do not modify these values, or things will NOT work */ enum { + Alpha = -3, + Beta = -2, RC = -1, Dot = 0, Patch = 1 @@ -164,6 +160,17 @@ static const test_t tests[] = { { NULL, 0, 0 } }; +static const test_t modifiers[] = { + { "alpha", 5, Alpha }, + { "beta", 4, Beta }, + { "rc", 2, RC }, + { "pl", 2, Dot }, + { "_", 1, Dot }, + { ".", 1, Dot }, + { NULL, 0, 0 } +}; + + /* locate the test in the tests array */ static int @@ -186,6 +193,8 @@ mktest(int *op, char *test) * '.' encodes as Dot which is '0' * '_' encodes as 'patch level', or 'Dot', which is 0. * 'pl' encodes as 'patch level', or 'Dot', which is 0. + * 'alpha' encodes as 'alpha version', or Alpha, which is -3. + * 'beta' encodes as 'beta version', or Beta, which is -2. * 'rc' encodes as 'release candidate', or RC, which is -1. * 'nb' encodes as 'netbsd version', which is used after all other tests */ @@ -193,6 +202,7 @@ static int mkcomponent(arr_t *ap, char *num) { static const char alphas[] = "abcdefghijklmnopqrstuvwxyz"; + const test_t *modp; int64_t n; char *cp; @@ -200,13 +210,6 @@ mkcomponent(arr_t *ap, char *num) return 0; } ALLOC(int64_t, ap->v, ap->size, ap->c, 62, "mkver", exit(EXIT_FAILURE)); - if (*num == '_') { - num += 1; - if (isdigit(*(num + 1))) { - ap->v[ap->c++] = Dot; - return 1; - } - } if (isdigit(*num)) { for (cp = num, n = 0 ; isdigit(*num) ; num++) { n = (n * 10) + (*num - '0'); @@ -214,13 +217,11 @@ mkcomponent(arr_t *ap, char *num) ap->v[ap->c++] = n; return (int)(num - cp); } - if (strncasecmp(num, "rc", 2) == 0) { - ap->v[ap->c++] = RC; - return 2; - } - if (strncasecmp(num, "pl", 2) == 0) { - ap->v[ap->c++] = Dot; - return 2; + for (modp = modifiers ; modp->s ; modp++) { + if (strncasecmp(num, modp->s, modp->len) == 0) { + ap->v[ap->c++] = modp->t; + return modp->len; + } } if (strncasecmp(num, "nb", 2) == 0) { for (cp = num, num += 2, n = 0 ; isdigit(*num) ; num++) { @@ -229,10 +230,6 @@ mkcomponent(arr_t *ap, char *num) ap->netbsd = n; return (int)(num - cp); } - if (*num == '.') { - ap->v[ap->c++] = Dot; - return 1; - } if (isalpha(*num)) { ap->v[ap->c++] = Dot; cp = strchr(alphas, tolower(*num)); @@ -666,76 +663,3 @@ add_to_list_fn(const char *pkg, void *vp) return 0; } - -#ifndef HAVE_STRSEP -/* - * Get next token from string *stringp, where tokens are possibly-empty - * strings separated by characters from delim. - * - * Writes NULs into the string at *stringp to end tokens. - * delim need not remain constant from call to call. - * On return, *stringp points past the last NUL written (if there might - * be further tokens), or is NULL (if there are definitely no more tokens). - * - * If *stringp is NULL, strsep returns NULL. - */ -char * -strsep(char **stringp, const char *delim) -{ - char *s; - const char *spanp; - int c, sc; - char *tok; - - if ((s = *stringp) == NULL) - return (NULL); - for (tok = s;;) { - c = *s++; - spanp = delim; - do { - if ((sc = *spanp++) == c) { - if (c == 0) - s = NULL; - else - s[-1] = 0; - *stringp = s; - return (tok); - } - } while (sc != 0); - } - /* NOTREACHED */ -} -#endif - -#ifndef HAVE_STRLCPY -/* - * Copy src to string dst of size siz. At most siz-1 characters - * will be copied. Always NUL terminates (unless siz == 0). - * Returns strlen(src); if retval >= siz, truncation occurred. - */ -size_t -strlcpy(char *dst, const char *src, size_t siz) -{ - char *d = dst; - const char *s = src; - size_t n = siz; - - /* Copy as many bytes as will fit */ - if (n != 0 && --n != 0) { - do { - if ((*d++ = *s++) == 0) - break; - } while (--n != 0); - } - - /* Not enough room in dst, add NUL and traverse rest of src */ - if (n == 0) { - if (siz != 0) - *d = '\0'; /* NUL-terminate dst */ - while (*s++) - ; - } - - return(s - src - 1); /* count does not include NUL */ -} -#endif diff --git a/pkgtools/pkg_install/files/lib/unsetenv.c b/pkgtools/pkg_install/files/lib/unsetenv.c deleted file mode 100644 index e713732239b..00000000000 --- a/pkgtools/pkg_install/files/lib/unsetenv.c +++ /dev/null @@ -1,63 +0,0 @@ -/* $NetBSD: unsetenv.c,v 1.1.1.1 2002/12/20 18:14:06 schmonz Exp $ */ - -/*- - * Copyright (c) 1998 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Christos Zoulas. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include <string.h> -#include <stdlib.h> - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -extern char **environ; - -#ifndef HAVE_UNSETENV -void -unsetenv(name) - const char *name; -{ - size_t len = strlen(name); - char **ptr, **p; - - for (ptr = environ; *ptr; ptr++) - if (strncmp(name, *ptr, len) == 0 && (*ptr)[len] == '=') { - for (p = ptr;; ++p) - if (!(*p = *(p + 1))) - break; - } -} -#endif diff --git a/pkgtools/pkg_install/files/lib/version.c b/pkgtools/pkg_install/files/lib/version.c index f90ee301c5f..821102f1a34 100644 --- a/pkgtools/pkg_install/files/lib/version.c +++ b/pkgtools/pkg_install/files/lib/version.c @@ -1,10 +1,14 @@ -/* $NetBSD: version.c,v 1.1.1.1 2002/12/20 18:14:05 schmonz Exp $ */ +/* $NetBSD: version.c,v 1.2 2003/09/01 16:27:16 jlam Exp $ */ -#if 0 +#include <nbcompat.h> +#if HAVE_CONFIG_H +#include "config.h" +#endif +#if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> -#ifndef lint -__RCSID("$NetBSD: version.c,v 1.1.1.1 2002/12/20 18:14:05 schmonz Exp $"); #endif +#ifndef lint +__RCSID("$NetBSD: version.c,v 1.2 2003/09/01 16:27:16 jlam Exp $"); #endif /* @@ -37,7 +41,9 @@ __RCSID("$NetBSD: version.c,v 1.1.1.1 2002/12/20 18:14:05 schmonz Exp $"); * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#if HAVE_STDIO_H #include <stdio.h> +#endif #include "lib.h" #include "version.h" diff --git a/pkgtools/pkg_install/files/lib/version.h b/pkgtools/pkg_install/files/lib/version.h index eb23731d242..4972bd9d10e 100644 --- a/pkgtools/pkg_install/files/lib/version.h +++ b/pkgtools/pkg_install/files/lib/version.h @@ -1,4 +1,4 @@ -/* $NetBSD: version.h,v 1.9 2003/04/23 10:27:40 seb Exp $ */ +/* $NetBSD: version.h,v 1.10 2003/09/01 16:27:16 jlam Exp $ */ /* * Copyright (c) 2001 Thomas Klausner. All rights reserved. @@ -33,6 +33,6 @@ #ifndef _INST_LIB_VERSION_H_ #define _INST_LIB_VERSION_H_ -#define PKGTOOLS_VERSION "20030423" +#define PKGTOOLS_VERSION "20030823" #endif /* _INST_LIB_VERSION_H_ */ diff --git a/pkgtools/pkg_install/files/src2nbcompat b/pkgtools/pkg_install/files/src2nbcompat new file mode 100755 index 00000000000..086fef83309 --- /dev/null +++ b/pkgtools/pkg_install/files/src2nbcompat @@ -0,0 +1,110 @@ +#!/bin/sh +# +# $NetBSD: src2nbcompat,v 1.1 2003/09/01 16:27:10 jlam Exp $ +# +# Copyright (c) 2003 The NetBSD Foundation, Inc. +# All rights reserved. +# +# This code is derived from software contributed to The NetBSD Foundation +# by +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. All advertising materials mentioning features or use of this software +# must display the following acknowledgement: +# This product includes software developed by the NetBSD +# Foundation, Inc. and its contributors. +# 4. Neither the name of The NetBSD Foundation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# + +if [ $# -ne 2 ]; then echo "src2nbcompat src dest"; exit 1; fi + +src=$1 +dest=$2 + +case "$src" in +/*) ;; +*) src=`pwd`/$src ;; +esac + +case "$dest" in +/*) ;; +*) dest=`pwd`/$dest ;; +esac + +echo "Preparing directory $dest" +mkdir -p $dest + +echo "Copying files and directories to $dest" +cd $src +dirs=`find . -type d -print` +for d in $dirs; do + newd=`echo $d | sed 's,^\./,,'` + case $newd in + *CVS) + ;; + .) + ;; + *) + mkdir -p $dest/$newd + ;; + esac +done +files=`find . \! -type d -print` +for f in $files; do + newf=`echo $f | sed 's,^\./,,'` + case $newf in + *CVS/*) + ;; + *Makefile|*Makefile.inc) + ;; + *.[ch]) + awk ' \ + BEGIN { seen = 0 } \ + /^\#[ ]*include[ ]+<[^ ]*>/ { \ + guard = toupper(gensub("[-/.]", "_", "g", gensub("\#[ ]*include[ ]+<\([^ ]*\)>", "HAVE_\\1", "g"))); \ + if (seen == 0) { \ + print "\#include <nbcompat.h>"; \ + print "\#if HAVE_CONFIG_H"; \ + print "\#include \"config.h\""; \ + print "\#endif"; \ + seen = 1; \ + }; \ + print "\#if " guard; \ + print $0; \ + print "\#endif"; \ + next; \ + } \ + { print } \ + ' $newf > $dest/$newf + ;; + *.[1-9]) + cp $newf $dest/$newf + catf=`echo $newf | sed 's,\.\([1-9]\),.cat\1,'` + nroff -mandoc $newf > $dest/$catf + ;; + *) + cp $newf $dest/$newf + ;; + esac +done diff --git a/pkgtools/pkg_install/files/view/Makefile.in b/pkgtools/pkg_install/files/view/Makefile.in new file mode 100644 index 00000000000..8f4057a790f --- /dev/null +++ b/pkgtools/pkg_install/files/view/Makefile.in @@ -0,0 +1,36 @@ +# $NetBSD: Makefile.in,v 1.1 2003/09/01 16:27:16 jlam Exp $ + +prefix= @prefix@ +exec_prefix= @exec_prefix@ +sbindir= @sbindir@ +mandir= @mandir@ + +man1dir= $(mandir)/man1 +cat1dir= $(mandir)/cat1 + +INSTALL= @INSTALL@ + +SCRIPTS= linkfarm pkg_view + +.PHONY: all clean install + +all: + # do nothing + +clean: + # do nothing + +install: + $(INSTALL) -m 755 -d $(sbindir) + $(INSTALL) -m 755 -d $(man1dir) + $(INSTALL) -m 755 -d $(cat1dir) + @for script in $(SCRIPTS); do \ + echo "$(INSTALL) $$script.sh $(sbindir)/$$script"; \ + $(INSTALL) $$script.sh $(sbindir)/$$script; \ + done + @for script in $(SCRIPTS); do \ + echo "$(INSTALL) -m 444 $$script.1 $(man1dir)/$$script.1"; \ + $(INSTALL) -m 444 $$script.1 $(man1dir)/$$script.1; \ + echo "$(INSTALL) -m 444 $$script.cat1 $(cat1dir)/$$script.0"; \ + $(INSTALL) -m 444 $$script.cat1 $(cat1dir)/$$script.0; \ + done diff --git a/pkgtools/pkg_install/files/view/linkfarm.1 b/pkgtools/pkg_install/files/view/linkfarm.1 new file mode 100644 index 00000000000..747d6771e8e --- /dev/null +++ b/pkgtools/pkg_install/files/view/linkfarm.1 @@ -0,0 +1,144 @@ +.\" $NetBSD: linkfarm.1,v 1.1 2003/09/01 16:27:16 jlam Exp $ +.\" +.\" Copyright (c) 2003 The NetBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the NetBSD +.\" Foundation, Inc. and its contributors. +.\" 4. Neither the name of The NetBSD Foundation nor the names of its +.\" contributors may be used to endorse or promote products derived +.\" from this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.Dd July 13, 2003 +.Dt LINKFARM 1 +.Os +.Sh NAME +.Nm linkfarm +.Nd a utility for managing symbolic links to package files +.Sh SYNOPSIS +.Nm +.Op Ar options +.Ar package +.Sh DESCRIPTION +The +.Nm +command is used to manage a "linkfarm", a directory tree of symbolic links in +.Ar target +to the files in the +.Ar package +sub-directory of +.Ar stowdir . +The default action is to create a linkfarm to a package. +.Pp +The following command-line options are supported: +.Bl -tag -width indent +.It Fl c +Check whether a package contains a linkfarm in +.Ar target . +If +.Ar package +has no symbolic links in +.Ar target +that correspond to its files, then return 0, otherwise return 1. +.It Fl D +Delete the linkfarm for +.Ar package . +.It Fl d Ar stowdir +Set +.Ar stowdir +as the directory in which +.Ar package +can be found. +The default +.Ar stowdir +is the +.Pa packages +sub-directory in the default +.Ar target +directory. +.It Fl n +Don't actually execute the commands for removing and creating the symbolic +links and directories. +.It Fl R +Delete and re-create the linkfarm for +.Ar package . +.It Fl s Ar subdir +The root of the package hierarchy for the linkfarm is the +.Ar subdir +sub-directory in the package. +By default, assume the root of the package hierarchy is simply the +.Ar package +directory. +.It Fl t Ar target +Set +.Ar target +as the directory in which to create and delete the linkfarm for +.Ar package . +The default +.Ar target +directory is +.Pa /usr/pkg +but may be overridden by the +.Ev LOCALBASE +environment variable. +.It Fl V +Print version number and exit. +.It Fl v +Turn on verbose output. +Specifying +.Fl v +multiple times increases the level of verbosity. +.El +.Sh ENVIRONMENT +.Bl -tag -width indent +.It Ev LOCALBASE +The standard packages directory, +.Pa /usr/pkg , +can be overridden by specifying an alternative directory in the +.Ev LOCALBASE +environment variable. This affects the default +.Ar target +and +.Ar stowdir +directories. +.It Ev PLIST_IGNORE_FILES +This can be used to specify files in +.Ar package +that should ignored when creating and deleting symbolic links in +.Ar target . +.Ev PLIST_IGNORE_FILES +is a space-separated list of shell glob patterns that match files relative +to the +.Ar package +directory, and it defaults to "info/dir *[~#] *.OLD *.orig *,v". +.El +.Sh SEE ALSO +.Xr pkg_views 1 , +.Xr lndir 1 +.Sh AUTHORS +The +.Nm +utility was written by +.An Alistair G. Crooks Aq agc@netbsd.org . diff --git a/pkgtools/pkg_install/files/view/linkfarm.cat1 b/pkgtools/pkg_install/files/view/linkfarm.cat1 new file mode 100644 index 00000000000..8492e07776b --- /dev/null +++ b/pkgtools/pkg_install/files/view/linkfarm.cat1 @@ -0,0 +1,67 @@ +LINKFARM(1) NetBSD Reference Manual LINKFARM(1) + +NNAAMMEE + lliinnkkffaarrmm - a utility for managing symbolic links to package files + +SSYYNNOOPPSSIISS + lliinnkkffaarrmm [_o_p_t_i_o_n_s] _p_a_c_k_a_g_e + +DDEESSCCRRIIPPTTIIOONN + The lliinnkkffaarrmm command is used to manage a "linkfarm", a directory tree of + symbolic links in _t_a_r_g_e_t to the files in the _p_a_c_k_a_g_e sub-directory of + _s_t_o_w_d_i_r. The default action is to create a linkfarm to a package. + + The following command-line options are supported: + + --cc Check whether a package contains a linkfarm in _t_a_r_g_e_t. If + _p_a_c_k_a_g_e has no symbolic links in _t_a_r_g_e_t that correspond to its + files, then return 0, otherwise return 1. + + --DD Delete the linkfarm for _p_a_c_k_a_g_e. + + --dd _s_t_o_w_d_i_r + Set _s_t_o_w_d_i_r as the directory in which _p_a_c_k_a_g_e can be found. The + default _s_t_o_w_d_i_r is the _p_a_c_k_a_g_e_s sub-directory in the default + _t_a_r_g_e_t directory. + + --nn Don't actually execute the commands for removing and creating the + symbolic links and directories. + + --RR Delete and re-create the linkfarm for _p_a_c_k_a_g_e. + + --ss _s_u_b_d_i_r + The root of the package hierarchy for the linkfarm is the _s_u_b_d_i_r + sub-directory in the package. By default, assume the root of the + package hierarchy is simply the _p_a_c_k_a_g_e directory. + + --tt _t_a_r_g_e_t + Set _t_a_r_g_e_t as the directory in which to create and delete the + linkfarm for _p_a_c_k_a_g_e. The default _t_a_r_g_e_t directory is _/_u_s_r_/_p_k_g + but may be overridden by the LOCALBASE environment variable. + + --VV Print version number and exit. + + --vv Turn on verbose output. Specifying --vv multiple times increases + the level of verbosity. + +EENNVVIIRROONNMMEENNTT + LOCALBASE + The standard packages directory, _/_u_s_r_/_p_k_g, can be overridden by + specifying an alternative directory in the LOCALBASE environment + variable. This affects the default _t_a_r_g_e_t and _s_t_o_w_d_i_r directo- + ries. + + PLIST_IGNORE_FILES + This can be used to specify files in _p_a_c_k_a_g_e that should ignored + when creating and deleting symbolic links in _t_a_r_g_e_t. + PLIST_IGNORE_FILES is a space-separated list of shell glob pat- + terns that match files relative to the _p_a_c_k_a_g_e directory, and it + defaults to "info/dir *[~#] *.OLD *.orig *,v". + +SSEEEE AALLSSOO + pkg_views(1), lndir(1) + +AAUUTTHHOORRSS + The lliinnkkffaarrmm utility was written by Alistair G. Crooks <agc@netbsd.org>. + +NetBSD 1.6.1_STABLE July 13, 2003 1 diff --git a/pkgtools/pkg_install/files/view/linkfarm.sh b/pkgtools/pkg_install/files/view/linkfarm.sh new file mode 100644 index 00000000000..c6df11ce7d7 --- /dev/null +++ b/pkgtools/pkg_install/files/view/linkfarm.sh @@ -0,0 +1,221 @@ +#! /bin/sh + +# $NetBSD: linkfarm.sh,v 1.1 2003/09/01 16:27:16 jlam Exp $ + +# +# Copyright (c) 2002 Alistair G. Crooks. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. All advertising materials mentioning features or use of this software +# must display the following acknowledgement: +# This product includes software developed by Alistair G. Crooks. +# 4. The name of the author may not be used to endorse or promote +# products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS +# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# set -x + +# set up program definitions +findprog=/usr/bin/find +grepprog=/usr/bin/grep +lnprog=/bin/ln +mkdirprog=/bin/mkdir +pkginfoprog=/usr/sbin/pkg_info +rmprog=/bin/rm +rmdirprog=/bin/rmdir +sedprog=/usr/bin/sed +sortprog=/usr/bin/sort + +usage() { + echo 'Usage: linkfarm [options] package' + exit 1 +} + +version() { + $pkginfoprog -V + exit 0 +} + +checkdir() { + if [ ! -d "$1" ]; then + echo "linkfarm: \`$1' doesn't exist" + exit 1 + fi +} + +ignorefiles=${PLIST_IGNORE_FILES:-"info/dir *[~#] *.OLD *.orig *,v"} +linktype=-s + +# default action: create a linkfarm in $target from $stowdir/$1 +# i.e. linkfarm --target=${prefix}/${view} --dir=${prefix}/packages $1 +# +doit="" +target=${LOCALBASE:-/usr/pkg} +stowdir=${target}/packages +subdir="" +verbose=0 + +# default action is to create +check=no +delete=no +create=yes + +# process args - can't use getopt(1) because of '--' style args +while [ $# -gt 0 ]; do + case "$1" in + -D) delete=yes; create=no ;; + -R) delete=yes; create=yes ;; + -V) version ;; + -c) check=yes; doit=":" ;; + -d) stowdir=$2; shift ;; + -d*) stowdir=`echo $1 | $sedprog -e 's|-d||'` ;; + -s) subdir=$2; shift ;; + -s*) subdir=`echo $1 | $sedprog -e 's|-s||'` ;; + -t) target=$2; shift ;; + -t*) target=`echo $1 | $sedprog -e 's|-t||'` ;; + -n) doit=":" ;; + -v) verbose=`expr $verbose + 1` ;; + + --delete) delete=yes; create=no ;; + --dir=*) stowdir=`echo $1 | $sedprog -e 's|--dir=||'` ;; + --restow) delete=yes; create=yes ;; + --subdir=*) subdir=`echo $1 | $sedprog -e 's|--subdir=||'` ;; + --target=*) target=`echo $1 | $sedprog -e 's|--target=||'` ;; + --version) version ;; + + --) shift; break ;; + *) break ;; + esac + shift +done + +# set the package name +package=$1 + +# make sure stowdir has a full pathname +case $stowdir in +/*) ;; +*) stowdir=`pwd`/$stowdir ;; +esac + +# Set the directory from which we symlink. +case $subdir in +"") fromdir=$stowdir/$package ;; +*) fromdir=$stowdir/$package/$subdir ;; +esac + +# Set the directory to which we symlink. +case $target in +/*) todir=$target ;; +*) todir=`pwd`/$target ;; +esac + +# if we're checking the entries, check, then exit +case $check in +yes) + checkdir $fromdir + (cd $fromdir; + ex=0; + for f in `$findprog . ! -type d -print`; do + newf=`echo $f | $sedprog -e 's|^\./||'` + if [ -e $todir/$newf ]; then + ignore=no + for i in $ignorefiles; do + case $newf in + $i) ignore=yes; break ;; + esac + done + case $ignore in + no) + echo "${newf}"; ex=1 ;; + esac + fi + done + exit $ex) || exit 1 + ;; +esac + +# if we need to get rid of old linkfarms, do it +case $delete in +yes) + checkdir $fromdir + (cd $fromdir; + for f in `$findprog . ! -type d -print`; do + newf=`echo $f | $sedprog -e 's|^\./||'` + ignore=no + for i in $ignorefiles; do + case $newf in + $i) ignore=yes; break ;; + esac + done + case $ignore in + no) + if [ $verbose -gt 0 ]; then + echo "$rmprog $todir/$newf" + fi + $doit $rmprog $todir/$f ;; + esac + done + for d in `$findprog . -type d -print | $sortprog -r`; do + if [ $verbose -gt 0 ]; then + echo "$rmdirprog $todir/$d" + fi + $doit $rmdirprog $todir/$d > /dev/null 2>&1 + done) + ;; +esac + +# if we need to create new linkfarms, do it +case $create in +yes) + checkdir $fromdir + (cd $fromdir; + for d in `$findprog . -type d -print`; do + newd=`echo $d | $sedprog -e 's|^\./||'` + case "$d" in + "") continue ;; + esac + if [ $verbose -gt 0 ]; then + echo "$mkdirprog -p $todir/$newd" + fi + $doit $mkdirprog -p $todir/$newd > /dev/null 2>&1 + done + for f in `$findprog . ! -type d -print`; do + newf=`echo $f | $sedprog -e 's|^\./||'` + ignore=no + for i in $ignorefiles; do + case $newf in + $i) ignore=yes; break ;; + esac + done + case $ignore in + no) + if [ $verbose -gt 0 ]; then + echo "$lnprog ${linktype} $fromdir/$newf $todir/$newf" + fi + $doit $lnprog ${linktype} $fromdir/$newf $todir/$newf ;; + esac + done) + ;; +esac + +exit 0 diff --git a/pkgtools/pkg_install/files/view/pkg_view.1 b/pkgtools/pkg_install/files/view/pkg_view.1 new file mode 100644 index 00000000000..8f91c1311c0 --- /dev/null +++ b/pkgtools/pkg_install/files/view/pkg_view.1 @@ -0,0 +1,269 @@ +.\" $NetBSD: pkg_view.1,v 1.1 2003/09/01 16:27:16 jlam Exp $ +.\" +.\" Copyright (c) 2003 The NetBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the NetBSD +.\" Foundation, Inc. and its contributors. +.\" 4. Neither the name of The NetBSD Foundation nor the names of its +.\" contributors may be used to endorse or promote products derived +.\" from this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.Dd July 13, 2003 +.Dt PKG_VIEW 1 +.Os +.Sh NAME +.Nm pkg_view +.Nd a utility for managing package views +.Sh SYNOPSIS +.Nm +.Op Ar options +.Ar command +.Ar package ... +.Sh DESCRIPTION +The +.Nm +command is used to add and delete packages in +.Ar stowdir +into a +.Ar view +in the +.Ar viewbase +directory. +.Sh WARNING +.Bf -emphasis +Since the +.Nm +command may execute scripts or programs contained within a package file, +your system may be susceptible to ``Trojan horses'' or other subtle +attacks from miscreants who create dangerous package files. +.Pp +You are advised to verify the competence and identity of those who +provide installable package files. +For extra protection, use the +.Fl M +flag to extract the package file, and inspect its contents and scripts +to ensure it poses no danger to your system's integrity. +Pay particular attention to any +INSTALL, +DEINSTALL, +REQUIRE +or +MTREE_DIRS files, and inspect the +CONTENTS file for +.Cm @cwd , +.Cm @mode +(check for setuid), +.Cm @dirrm , +.Cm @exec , +and +.Cm @unexec +directives, and/or use the +.Xr pkg_info 1 +command to examine the package file. +.Ef +.Sh OPTIONS +The following command-line options are supported: +.Bl -tag -width indent +.It Fl d Ar stowdir +Set +.Ar stowdir +as the directory in which the installed packages can be found. +If this option isn't specified, then the +.Ar stowdir +is taken from the value of the environment variable +.Ev DEPOTBASE +if it's set, otherwise the default +.Ar stowdir +is the +.Pa packages +directory under +.Ar viewbase . +.It Fl i Ar ignore +Add +.Ar ignore +to the list of files in +.Ar package +that should ignored when adding or removing the package from +.Ar view . +.It Fl k Ar pkg_dbdir +Set +.Ar pkg_dbdir +as the package database directory for the default (empty) view. +If this option isn't specified, then the package database directory is +taken from the value of the environment variable +.Ev PKG_DBDIR , +otherwise it defaults to +.Pa /var/db/pkg . +.It Fl n +Don't actually execute the commands for manipulating the depoted packages. +.It Fl V +Print the version number and exit. +.It Fl v +Turn on verbose output. +Specifying +.Fl v +multiple times increases the level of verbosity. +.It Fl W Ar viewbase +Set +.Ar viewbase +as the directory in which all the views are managed. +The default +.Ar viewbase +directory is +.Pa /usr/pkg +but may be overridden by the +.Ev LOCALBASE +environment variable. +.It Fl w Ar view +Set +.Ar view +as the directory in +.Ar viewbase +in which the packages should be added or removed. +The default +.Ar view +is the empty view but may be overridden by the +.Ev PKG_VIEW +environment variable. +.El +.Pp +The following commands are supported: +.Bl -tag -width indent +.It Ar add +Add the listed packages into +.Ar view . +.It Ar check +Check whether the listed packages are present in +.Ar view . +If they are not present, then return 0, otherwise return 1. +.It Ar delete +Delete the listed packages from +.Ar view . +.El +.Sh ENVIRONMENT +.Bl -tag -width indent +.It Ev DEPOTBASE +This is the location of the +.Ar stowdir +directory inside which all depoted packages are kept. +The default +.Ar stowdir +is the +.Pa packages +directory under +.Ar viewbase . +.It Ev LOCALBASE +This is the location of the +.Ar viewbase +directory in which all the views are managed. +The default +.Ar viewbase +directory is +.Pa /usr/pkg . +.It Ev PKG_DBDIR +If the +.Fl k +flag isn't given, then the value of the environment variable +.Ev PKG_DBDIR +is the package database directory for the default view, +otherwise it defaults to +.Pa /var/db/pkg . +.It Ev PLIST_IGNORE_FILES +This can be used to specify files in +.Ar package +that should ignored when adding or removing the package from +.Ar view . +.Ev PLIST_IGNORE_FILES +is a space-separated list of shell glob patterns that match files relative +to the +.Ar package +directory, and it defaults to "info/dir *[~#] *.OLD *.orig *,v". +This is overridden by any +.Ev _PLIST_IGNORE_FILES +setting in a package's +.Ar build-info-file +(see +.Xr pkg_create 1 +) if it exists. +.It Ev PKG_VIEW +The default view can be specified in the +.Ev PKG_VIEW +environment variable. +.El +.Sh FILES +.Bl -tag -width indent +.It Pa <pkg-dbdir>/<package>/+INSTALL +If the package contains an +.Ar install +script (see +.Xr pkg_create 1 ) , +then after the package is added into a view, the script is executed +with the following arguments: +.Bl -tag -width package +.It Ar package +The name of the package being installed. +.It Cm VIEW-INSTALL +Keyword denoting that the script is to perform any actions needed after +the package is added to a view. +.El +.Pp +If the +.Ar install +script exits with a non-zero status code, the installation is terminated. +.It Pa <pkg-dbdir>/<package>/+DEINSTALL +If the package contains an +.Ar deinstall +script (see +.Xr pkg_create 1 ) , +then before the package is removed from a view, the script is executed +with the following arguments: +.Bl -tag -width package +.It Ar package +The name of the package being installed. +.It Cm VIEW-DEINSTALL +Keyword denoting that the script is to perform any actions needed before +the package is removed from a view. +.El +.Pp +If the +.Ar deinstall +script exits with a non-zero status code, the de-installation is terminated. +.El +.Pp +The +.Ar install +and +.Ar deinstall +scripts are called with the environment variable +.Ev PKG_PREFIX +set to the path to the +.Ar view +directory. +.Sh SEE ALSO +.Xr pkg_delete 1 , +.Xr linkfarm 1 +.Sh BUGS +Only the empty view is supported. +.Sh AUTHORS +The +.Nm +utility was written by +.An Alistair G. Crooks Aq agc@netbsd.org . diff --git a/pkgtools/pkg_install/files/view/pkg_view.cat1 b/pkgtools/pkg_install/files/view/pkg_view.cat1 new file mode 100644 index 00000000000..ebd75fbe4c4 --- /dev/null +++ b/pkgtools/pkg_install/files/view/pkg_view.cat1 @@ -0,0 +1,144 @@ +PKG_VIEW(1) NetBSD Reference Manual PKG_VIEW(1) + +NNAAMMEE + ppkkgg__vviieeww - a utility for managing package views + +SSYYNNOOPPSSIISS + ppkkgg__vviieeww [_o_p_t_i_o_n_s] _c_o_m_m_a_n_d _p_a_c_k_a_g_e _._._. + +DDEESSCCRRIIPPTTIIOONN + The ppkkgg__vviieeww command is used to add and delete packages in _s_t_o_w_d_i_r into a + _v_i_e_w in the _v_i_e_w_b_a_s_e directory. + +WWAARRNNIINNGG + _S_i_n_c_e _t_h_e ppkkgg__vviieeww _c_o_m_m_a_n_d _m_a_y _e_x_e_c_u_t_e _s_c_r_i_p_t_s _o_r _p_r_o_g_r_a_m_s _c_o_n_t_a_i_n_e_d + _w_i_t_h_i_n _a _p_a_c_k_a_g_e _f_i_l_e_, _y_o_u_r _s_y_s_t_e_m _m_a_y _b_e _s_u_s_c_e_p_t_i_b_l_e _t_o _`_`_T_r_o_j_a_n _h_o_r_s_- + _e_s_'_' _o_r _o_t_h_e_r _s_u_b_t_l_e _a_t_t_a_c_k_s _f_r_o_m _m_i_s_c_r_e_a_n_t_s _w_h_o _c_r_e_a_t_e _d_a_n_g_e_r_o_u_s _p_a_c_k_a_g_e + _f_i_l_e_s_. + + _Y_o_u _a_r_e _a_d_v_i_s_e_d _t_o _v_e_r_i_f_y _t_h_e _c_o_m_p_e_t_e_n_c_e _a_n_d _i_d_e_n_t_i_t_y _o_f _t_h_o_s_e _w_h_o _p_r_o_- + _v_i_d_e _i_n_s_t_a_l_l_a_b_l_e _p_a_c_k_a_g_e _f_i_l_e_s_. _F_o_r _e_x_t_r_a _p_r_o_t_e_c_t_i_o_n_, _u_s_e _t_h_e --MM _f_l_a_g _t_o + _e_x_t_r_a_c_t _t_h_e _p_a_c_k_a_g_e _f_i_l_e_, _a_n_d _i_n_s_p_e_c_t _i_t_s _c_o_n_t_e_n_t_s _a_n_d _s_c_r_i_p_t_s _t_o _e_n_s_u_r_e + _i_t _p_o_s_e_s _n_o _d_a_n_g_e_r _t_o _y_o_u_r _s_y_s_t_e_m_'_s _i_n_t_e_g_r_i_t_y_. _P_a_y _p_a_r_t_i_c_u_l_a_r _a_t_t_e_n_t_i_o_n + _t_o _a_n_y _+_I_N_S_T_A_L_L_, _+_D_E_I_N_S_T_A_L_L_, _+_R_E_Q_U_I_R_E _o_r _+_M_T_R_E_E___D_I_R_S _f_i_l_e_s_, _a_n_d _i_n_s_p_e_c_t + _t_h_e _+_C_O_N_T_E_N_T_S _f_i_l_e _f_o_r @@ccwwdd_, @@mmooddee _(_c_h_e_c_k _f_o_r _s_e_t_u_i_d_)_, @@ddiirrrrmm_, @@eexxeecc_, _a_n_d + @@uunneexxeecc _d_i_r_e_c_t_i_v_e_s_, _a_n_d_/_o_r _u_s_e _t_h_e pkg_info(_1) _c_o_m_m_a_n_d _t_o _e_x_a_m_i_n_e _t_h_e + _p_a_c_k_a_g_e _f_i_l_e_. + +OOPPTTIIOONNSS + The following command-line options are supported: + + --dd _s_t_o_w_d_i_r + Set _s_t_o_w_d_i_r as the directory in which the installed packages can + be found. If this option isn't specified, then the _s_t_o_w_d_i_r is + taken from the value of the environment variable DEPOTBASE if + it's set, otherwise the default _s_t_o_w_d_i_r is the _p_a_c_k_a_g_e_s directory + under _v_i_e_w_b_a_s_e. + + --ii _i_g_n_o_r_e + Add _i_g_n_o_r_e to the list of files in _p_a_c_k_a_g_e that should ignored + when adding or removing the package from _v_i_e_w. + + --kk _p_k_g___d_b_d_i_r + Set _p_k_g___d_b_d_i_r as the package database directory for the default + (empty) view. If this option isn't specified, then the package + database directory is taken from the value of the environment + variable PKG_DBDIR, otherwise it defaults to _/_v_a_r_/_d_b_/_p_k_g. + + --nn Don't actually execute the commands for manipulating the depoted + packages. + + --VV Print the version number and exit. + + --vv Turn on verbose output. Specifying --vv multiple times increases + the level of verbosity. + + --WW _v_i_e_w_b_a_s_e + Set _v_i_e_w_b_a_s_e as the directory in which all the views are managed. + The default _v_i_e_w_b_a_s_e directory is _/_u_s_r_/_p_k_g but may be overridden + by the LOCALBASE environment variable. + + --ww _v_i_e_w + Set _v_i_e_w as the directory in _v_i_e_w_b_a_s_e in which the packages + should be added or removed. The default _v_i_e_w is the empty view + but may be overridden by the PKG_VIEW environment variable. + + The following commands are supported: + + _a_d_d Add the listed packages into _v_i_e_w. + + _c_h_e_c_k Check whether the listed packages are present in _v_i_e_w. If they + are not present, then return 0, otherwise return 1. + + _d_e_l_e_t_e Delete the listed packages from _v_i_e_w. + +EENNVVIIRROONNMMEENNTT + DEPOTBASE + This is the location of the _s_t_o_w_d_i_r directory inside which all + depoted packages are kept. The default _s_t_o_w_d_i_r is the _p_a_c_k_a_g_e_s + directory under _v_i_e_w_b_a_s_e. + + LOCALBASE + This is the location of the _v_i_e_w_b_a_s_e directory in which all the + views are managed. The default _v_i_e_w_b_a_s_e directory is _/_u_s_r_/_p_k_g. + + PKG_DBDIR + If the --kk flag isn't given, then the value of the environment + variable PKG_DBDIR is the package database directory for the de- + fault view, otherwise it defaults to _/_v_a_r_/_d_b_/_p_k_g. + + PLIST_IGNORE_FILES + This can be used to specify files in _p_a_c_k_a_g_e that should ignored + when adding or removing the package from _v_i_e_w. + PLIST_IGNORE_FILES is a space-separated list of shell glob pat- + terns that match files relative to the _p_a_c_k_a_g_e directory, and it + defaults to "info/dir *[~#] *.OLD *.orig *,v". This is overrid- + den by any _PLIST_IGNORE_FILES setting in a package's _b_u_i_l_d_-_i_n_f_o_- + _f_i_l_e (see pkg_create(1) ) if it exists. + + PKG_VIEW + The default view can be specified in the PKG_VIEW environment + variable. + +FFIILLEESS + <pkg-dbdir>/<package>/+INSTALL + If the package contains an _i_n_s_t_a_l_l script (see pkg_create(1)), + then after the package is added into a view, the script is exe- + cuted with the following arguments: + + _p_a_c_k_a_g_e The name of the package being installed. + + VVIIEEWW--IINNSSTTAALLLL + Keyword denoting that the script is to perform any ac- + tions needed after the package is added to a view. + + If the _i_n_s_t_a_l_l script exits with a non-zero status code, the in- + stallation is terminated. + + <pkg-dbdir>/<package>/+DEINSTALL + If the package contains an _d_e_i_n_s_t_a_l_l script (see pkg_create(1)), + then before the package is removed from a view, the script is ex- + ecuted with the following arguments: + + _p_a_c_k_a_g_e The name of the package being installed. + + VVIIEEWW--DDEEIINNSSTTAALLLL + Keyword denoting that the script is to perform any ac- + tions needed before the package is removed from a view. + + If the _d_e_i_n_s_t_a_l_l script exits with a non-zero status code, the + de-installation is terminated. + + The _i_n_s_t_a_l_l and _d_e_i_n_s_t_a_l_l scripts are called with the environment vari- + able PKG_PREFIX set to the path to the _v_i_e_w directory. + +SSEEEE AALLSSOO + pkg_delete(1), linkfarm(1) + +BBUUGGSS + Only the empty view is supported. + +AAUUTTHHOORRSS + The ppkkgg__vviieeww utility was written by Alistair G. Crooks <agc@netbsd.org>. + +NetBSD 1.6.1_STABLE July 13, 2003 3 diff --git a/pkgtools/pkg_install/files/view/pkg_view.sh b/pkgtools/pkg_install/files/view/pkg_view.sh new file mode 100644 index 00000000000..119aa939232 --- /dev/null +++ b/pkgtools/pkg_install/files/view/pkg_view.sh @@ -0,0 +1,276 @@ +#! /bin/sh + +# $NetBSD: pkg_view.sh,v 1.1 2003/09/01 16:27:16 jlam Exp $ + +# +# Copyright (c) 2001 Alistair G. Crooks. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. All advertising materials mentioning features or use of this software +# must display the following acknowledgement: +# This product includes software developed by Alistair G. Crooks. +# 4. The name of the author may not be used to endorse or promote +# products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS +# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# set -x + +# set up program definitions +chmodprog=/bin/chmod +cmpprog=/usr/bin/cmp +cpprog=/bin/cp +envprog=/usr/bin/env +findprog=/usr/bin/find +grepprog=/usr/bin/grep +linkfarmprog=/usr/sbin/linkfarm +lnprog=/bin/ln +mkdirprog=/bin/mkdir +paxprog=/bin/pax +pkginfoprog=/usr/sbin/pkg_info +rmprog=/bin/rm +rmdirprog=/bin/rmdir +sedprog=/usr/bin/sed +touchprog=/usr/bin/touch + +usage() { + echo 'Usage: pkg_view [-n] [-v] [-i ignore] [-k pkg_dbdir_dflt] [-w viewname] [-d stowdir] [-W viewbase] add|check|delete pkgname...' + exit 1 +} + +version() { + $pkginfoprog -V + exit 0 +} + +checkpkg() { + if [ ! -d "$2/$1" ]; then + echo "pkg_view: \`$1' doesn't exist in \`$2'" 1>&2 + exit 1 + fi +} + +######################################### +# Initialization and Options Processing # +######################################### + +doit="" +stowdir="" +viewbase=${LOCALBASE:-/usr/pkg} +view=${PKG_VIEW:-""} +dflt_ignorefiles=${PLIST_IGNORE_FILES:-"info/dir *[~#] *.OLD *.orig *,v"} +dflt_pkg_dbdir=${PKG_DBDIR:-/var/db/pkg} +ignorefiles="" +verbose=0 + +while [ $# -gt 0 ]; do + case "$1" in + -d) stowdir=$2; shift ;; + -d*) stowdir=`echo $1 | $sedprog -e 's|^-d||'` ;; + -i) ignorefiles="$ignorefiles $2"; shift ;; + -i*) ignorefiles="$ignorefiles `echo $1 | $sedprog -e 's|^-i||'`" ;; + -k) dflt_pkg_dbdir="$2"; shift ;; + -k*) dflt_pkg_dbdir=`echo $1 | $sedprog -e 's|^-k||'` ;; + -n) doit=":" ;; + -V) version ;; + -v) verbose=`expr $verbose + 1` ;; + -W) viewbase=$2; shift ;; + -W*) viewbase=`echo $1 | $sedprog -e 's|^-p||'` ;; + -w) view=$2; shift ;; + --view=*) view=`echo $1 | $sedprog -e 's|--view=||'` ;; + --) shift; break ;; + *) break ;; + esac + shift +done + +if [ $# -lt 1 ]; then + usage +fi + +# echoN will actually give output if ${verbose} > N. +echo1=":" +echo2=":" +if [ ${verbose} -gt 0 ]; then echo1=echo; fi +if [ ${verbose} -gt 1 ]; then echo2=echo; fi + +action="" +case "$1" in +add) action=add ;; +check) action=check ;; +delete|rm) action=delete ;; +*) usage ;; +esac +shift + +# XXX Only support the standard view for now. +case "$view" in +"") ;; +*) echo "pkg_view: only the standard view is supported" 1>&2 + exit 1 + ;; +esac + +# if standard view, put package info into ${dflt_pkg_dbdir} +# if not standard view, put package info into view's pkgdb +case "$view" in +"") + pkg_dbdir=${dflt_pkg_dbdir} + targetdir=${viewbase} + viewstr="the standard view" + ;; +*) + pkg_dbdir=${viewbase}/${view}/.pkgdb + targetdir=${viewbase}/${view} + viewstr="view \"${view}\"" + ;; +esac + +# Use stowdir if it's given, else fall back to ${DEPOTBASE} or else +# default to ${viewbase}/packages. +# +depot_pkg_dbdir=${stowdir:-${DEPOTBASE:-${viewbase}/packages}} + +case "${depot_pkg_dbdir}" in +${pkg_dbdir}) + echo "pkg_view: the depot and the view package database directories are the same" 1>&2 + exit 1 + ;; +esac + +########################## +# Shell helper functions # +########################## + +# symlinks check|add|delete <pkg> +# +# Calls linkfarm(1) to check, add or delete the symlink farm in +# ${targetdir}. We also ignore the right set of files when doing the +# linkfarm operations. +# +symlinks() { + pkg=$2 + case "$1" in + add) linkfarmflags="" ;; + check) linkfarmflags="-c" ;; + delete) linkfarmflags="-D" ;; + esac + if [ -f ${depot_pkg_dbdir}/$pkg/+BUILD_INFO ]; then + ignore=`$grepprog "^_PLIST_IGNORE_FILES=" ${depot_pkg_dbdir}/$pkg/+BUILD_INFO | $sedprog -e 's|^_PLIST_IGNORE_FILES=[ ]*||'` + fi + case "$ignore" in + "") ignore="${dflt_ignorefiles}" ;; + esac + dbs=`(cd ${depot_pkg_dbdir}/$pkg; echo +*)` + ignore="${ignore} ${ignorefiles} $dbs" + $doit $envprog PLIST_IGNORE_FILES="${ignore}" $linkfarmprog $linkfarmflags --target=${targetdir} --dir=${depot_pkg_dbdir} $pkg +} + +############# +# Main Loop # +############# + +while [ $# -gt 0 ]; do + case $action in + add) + checkpkg $1 ${depot_pkg_dbdir} + if [ -f ${pkg_dbdir}/$1/+DEPOT ]; then + echo "pkg_view: \`$1' already exists in $viewstr" 1>&2 + exit 1 + fi + $echo1 "Adding $1 to ${targetdir}." + symlinks add $1 + $doit $mkdirprog -p ${depot_pkg_dbdir}/$1 + temp=${depot_pkg_dbdir}/$1/+VIEWS.$$ + $doit $touchprog ${depot_pkg_dbdir}/$1/+VIEWS + $doit $cpprog ${depot_pkg_dbdir}/$1/+VIEWS ${temp} + case "$doit" in + "") ($grepprog -v '^'${pkg_dbdir}'$' ${temp} || true; echo ${pkg_dbdir}) > ${depot_pkg_dbdir}/$1/+VIEWS ;; + esac + $doit $rmprog ${temp} + $doit $mkdirprog -p ${pkg_dbdir}/$1 + # + # Copy all of the metadata files except for +VIEWS, + # which is only for the depoted package, and + # +REQUIRED_BY, which is irrelevant for a package in + # a view. + # + case "$doit" in + "") (cd ${depot_pkg_dbdir}/$1; $paxprog -rwpe '-s|\./\+VIEWS$||' '-s|\./\+REQUIRED_BY$||' ./+* ${pkg_dbdir}/$1) + $sedprog -e 's|'${depot_pkg_dbdir}/$1'|'${targetdir}'|g' < ${depot_pkg_dbdir}/$1/+CONTENTS > ${pkg_dbdir}/$1/+CONTENTS + echo "${depot_pkg_dbdir}/$1" > ${pkg_dbdir}/$1/+DEPOT + ;; + esac + if [ -f ${pkg_dbdir}/$1/+INSTALL ]; then + $doit $chmodprog +x ${pkg_dbdir}/$1/+INSTALL + $doit $envprog -i PKG_PREFIX=${targetdir} ${pkg_dbdir}/$1/+INSTALL $1 VIEW-INSTALL + ec=$? + if [ $ec != 0 ]; then + echo "pkg_view: install script returned an error." 1>&2 + exit $ec + fi + fi + ;; + check) + checkpkg $1 ${depot_pkg_dbdir} + $echo1 "Checking $1 in ${targetdir}." + symlinks check $1 + exit $? + ;; + delete) + checkpkg $1 ${depot_pkg_dbdir} + if [ ! -f ${pkg_dbdir}/$1/+DEPOT ]; then + echo "pkg_view: \`$1' doesn't exist in $viewstr" 1>&2 + exit 1 + fi + $echo1 "Deleting $1 from ${targetdir}." + if [ -f ${pkg_dbdir}/$1/+REQUIRED_BY ]; then + if $cmpprog -s ${pkg_dbdir}/$1/+REQUIRED_BY /dev/null; then + : # not really required by another pkg + else + (echo "pkg_view: \`$1' is required by other packages:" + $sedprog -e 's|^| |' ${pkg_dbdir}/$1/+REQUIRED_BY) 1>&2 + exit 1 + fi + fi + if [ -f ${pkg_dbdir}/$1/+DEINSTALL ]; then + $doit $chmodprog +x ${pkg_dbdir}/$1/+DEINSTALL + $doit $envprog -i PKG_PREFIX=${targetdir} ${pkg_dbdir}/$1/+DEINSTALL $1 VIEW-DEINSTALL + ec=$? + if [ $ec != 0 ]; then + echo "pkg_view: de-install script returned an error." 1>&2 + exit $ec + fi + fi + symlinks delete $1 + temp=${depot_pkg_dbdir}/$1/+VIEWS.$$ + $doit $cpprog ${depot_pkg_dbdir}/$1/+VIEWS ${temp} + case "$doit" in + "") ($grepprog -v '^'${pkg_dbdir}'$' ${temp} || true) > ${depot_pkg_dbdir}/$1/+VIEWS ;; + esac + $doit $rmprog ${temp} + $doit $rmprog -rf ${pkg_dbdir}/$1 + ;; + esac + shift +done + +exit 0 |