Import argp-standalone 1.2.

This commit is contained in:
Érico Rolim 2021-02-10 16:18:08 -03:00
parent 3d5f6735d4
commit ede863a979
27 changed files with 9178 additions and 2225 deletions

300
ChangeLog Normal file
View File

@ -0,0 +1,300 @@
2003-03-13 Niels Möller <nisse@cuckoo.hack.org>
* Released argp-standalone-1.2.
* Updated copyright years.
2003-03-03 Niels Möller <nisse@cuckoo.hack.org>
* argp-fmtstream.h: Don't include config.h here, let the .c-files
do that. Deleted definition of PRINTF_STYLE, that's in config.h.
When defining or disabling i/o locking functions, use uppercase
macro names like PUTC_UNLOCKED. This avoids conflicts if the
underlying functions are really macros defined by stdio. For
example on freebsd. Updated the files using these functions.
2003-03-02 Niels Möller <nisse@cuckoo.hack.org>
* argp-help.c: Don't include malloc.h. If any system still needs
it, we need a configure test for it.
(hol_entry_help): Don't use a non-constant initializer, as that's
a GNU C extension.
2003-02-23 Niels Moller <nisse@carduelis>
* configure.ac: Use LSH_GCC_ATTRIBUTES. Deleted the definition of
UNUSED from the files that used it, it's now in config.h.
2003-02-16 Niels Möller <nisse@cuckoo.hack.org>
* argp-fmtstream.h: When disabling fwrite_unlocked, #undef it first.
* testsuite/permute-test: diff -q is not portable.
Redirect to /dev/null instead.
2003-02-12 Niels Möller <niels@s3.kth.se>
* argp-fmtstream.h: When disabling putc_unlocked, #undef it first.
2003-02-10 Niels Möller <niels@s3.kth.se>
* configure.ac (ARGP_CHECK_FUNC): Use AS_VAR_GET. Use AH_TEMPLATE.
2003-02-10 Niels Möller <nisse@cuckoo.hack.org>
* configure.ac (ARGP_CHECK_FUNC): New macro. Use it to test for
putc_unlocked.
2003-02-05 Niels Möller <nisse@lysator.liu.se>
* argp-parse.c (argp_default_options): Fixed initializer.
* argp-test.c (options): Likewise.
* testsuite/permute-test (die): Fixed sh-compatible function
definition.
* testsuite/ex4.c: Don't use error.h and the error function.
* .bootstrap: New file.
2003-02-05 Niels Möller <niels@s3.kth.se>
* Makefile.am (all): Deleted the explicit all target.
(LIBOBJS): Added explicit substitution.
* testsuite/ex3.c, testsuite/ex4.c: Complete initializers, to
avoid warnings from gcc.
* configure.ac: Updated for current autoconf and automake.
Fixed AC_CONFIG_HEADER call.
Use AC_GNU_SOURCE.
Use AC_CHECK_DECLS to check for program_invocation_name and
program_invocation_short_name.
* argp-test.c (sub_options): Complete initializer, to avoid
warnings from gcc.
(sub_argp): Likewise.
(options): Likewise.
* argp-parse.c (argp_default_parser):
HAVE_PROGRAM_INVOCATION_SHORT_NAME renamed to
HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME.
(argp_default_options): Complete initializer, to avoid
warnings from gcc.
* argp-help.c (uparam_names): Complete initializer, to avoid
warnings from gcc.
(__argp_short_program_name): HAVE_PROGRAM_INVOCATION_NAME renamed
to HAVE_DECL_PROGRAM_INVOCATION_NAME. Similarly for
HAVE_PROGRAM_INVOCATION_SHORT_NAME.
* acinclude.m4: Deleted file.
2003-02-04 Niels Möller <nisse@cuckoo.hack.org>
* configure.ac: Bumped version to standalone-1.2.
* argp-parse.c (parser_parse_next): Call exchange before
processing the final arguments. Fixes bug reported by Akim Demaille.
* Makefile.am (SUBDIRS): Added testsuite.
* configure.ac: Output testsuite/Makefile.
* testsuite/run-tests: Script copied from nettle.
* testsuite/permute-test: New testcase, exercising
argument option permuting.
* testsuite/ex1-test: New testcase.
* testsuite/ex1.c, testsuite/ex3.c,
testsuite/ex4.c: Added glibc example programs.
2002-07-18 Niels Möller <niels@s3.kth.se>
* configure.ac: Don't use -ggdb3 with gcc-2.96.
2002-05-06 Niels Möller <niels@s3.kth.se>
* configure.ac: Use AH_TEMPLATE for
PROGRAM_INVOCATION_NAME and PROGRAM_INVOCATION_SHORT_NAME. The
third arg to AC_DEFINE_UNQUOTED seems not to work here.
2002-05-05 Niels Möller <nisse@lysator.liu.se>
* acconfig.h: Deleted file.
* configure.ac: Pass no arguments to AM_INIT_AUTOMAKE.
Don't substitute LIBOBJS.
* acinclude.m4: Use the three-argument form of
AC_DEFINE_UNQUOTED.
* configure.ac: Update for automake-1.6.
* configure.ac: Renamed file, used to be configure.in.
2001-03-26 Niels Möller <nisse@cuckoo.localdomain>
* configure.in: Bumped argp version to standalone-1.1.
2001-03-26 Niels Möller <nisse@ehand.com>
* configure.in (CPPFLAGS): Added -D_GNU_SOURCE.
2001-02-18 Niels Möller <nisse@cuckoo.localdomain>
* argp-parse.c (argp_default_parser): Let OPT_HANG print
the process id to stderr.
2001-01-15 Niels Möller <nisse@ehand.com>
* argp.h: #define PRINTF_STYLE, and use it instead of
using __attribute__ directly.
2001-01-07 Niels Möller <nisse@cuckoo.localdomain>
* argp.h: Added _argp_short_program_name and
__argp_short_program_name.
* argp-parse.c (parser_init): Use
argp_short_program_name.
(parser_parse_next): Removed old permutation handling code.
2001-01-06 Niels Möller <nisse@cuckoo.localdomain>
* argp-namefrob.h: Added _argp_short_program_name.
2001-01-02 Niels Möller <nisse@cuckoo.localdomain>
* argp-help.c (hol_entry_help): Avoid using a
non-constant struct initializer.
(UNUSED): Define as a macro expanding to __attribute__ ..., if
compiling with gcc.
* argp-fmtstream.h (PRINTF_STYLE): Define this macro,
to expand to __attribute__ ... if compiling with gcc.
* argp-fmtstream.c (__argp_fmtstream_write,
__argp_fmtstream_puts, __argp_fmtstream_putc): Duplicate the
inline definitions in argp-fmtstream.h, for compilers that don't
do inlining.
2000-12-28 Niels Möller <nisse@cuckoo.localdomain>
* argp-help.c (fill_in_uparams): Use unsigned char * for
VAR and ARG. Fixed calls of isalnum, isspace and friends, reported
by Kalle Olavi Niemitalo.
(canon_doc_option): Fixed calls of isalnum, isspace and friends,
reported by Kalle Olavi Niemitalo.
(hol_entry_cmp): Fixed calls of tolower, reported by Kalle Olavi
Niemitalo.
2000-12-23 Niels Möller <nisse@lysator.liu.se>
* acinclude.m4: New file.
* acinclude.m4: Reverted the definition of AC_CHECK_VAR
to take includes as argument, and renamed it to ARGP_CHECK_VAR.
2000-12-11 Niels Möller <nisse@cuckoo.localdomain>
* Removed getopt.c, getopt.h and getopt1.c from the src/argp
directory.
* argp-parse.c (match_option, ARGP_COMPLETE): #if:ed out
completion code for long options.
2000-11-30 Niels Möller <nisse@cuckoo.localdomain>
* argp-parse.c (match_option): Better abbreviations.
Replaced try_getopt with args_only, changed calling convention for
parser_parse_arg.
* configure.in: Don't check for getopt.
* argp.h: Don't include getopt.h.
* argp-parse.c (calc_sizes): Updated comment.
2000-11-29 Niels Möller <nisse@cuckoo.localdomain>
* configure.in: Use AC_REPLACE_FUNCS for mempcpy, strndup
and strchrnul.
(AC_CHECK_VAR): Changed second argument to take the type of the
variable.
* argp-parse.c (struct parser): New fields
posixly_correct and ordering.
(parser_init): Choose ordering.
(enum arg_type): New value ARG_LONG_ONLY.
(parser_parse_next): Added error messages similar to getopt's.
* argp-help.c (STRNDUP): New macro to refer to strndup
or __strndup, as appropriate.
(STRERROR): Define this macro as a wrapper for strerror or
sys_errlist.
(__argp_basename): New function.
* argp-namefrob.h (__argp_basename): Added
__argp_basename.
* Makefile.am (libargp_a_LIBADD): Include LIBOBJS in
libargp.a.
* argp.h: Added prototype for _argp_basename and
__argp_basename.
* strndup.c, strchrnul.c mempcpy.c:
Moved replacement functions to separate files.
2000-11-28 Niels Möller <nisse@cuckoo.localdomain>
* argp-parse.c: Deleted getopt-related code.
(struct parser): New field nextchar. Deleted fields try_getotp and long_opts.
(find_short_option): New function.
(match_option): New function.
(find_long_option): New function.
(struct parser_convert_state): Deleted field long_end.
(convert_options): Don't build getopt_long-style option array.
(parser_convert): Deleted FLAGS arument.
(struct parser_sizes): Deleted field long_len.
(parser_init): Set short_opts to NULL, unless ARGP_LONG_ONLY is
used.
(classify_arg): New function.
(parser_parse_next): Don't use getopt_long().
2000-11-27 Niels Möller <nisse@cuckoo.localdomain>
* argp-help.c (argp_doc): Use the name strndup, not
__strndup. That probably breaks glibc builds.
2000-11-27 Niels Möller <nisse@lysator.liu.se>
* argp-test.c (asprintf): Bug fix.
* argp.h: Dummy definition of __THROW.
* argp-test.c: Fixed asprintf implementation.
* argp-parse.c (__argp_usage, __option_is_short,
__option_is_end): Define these function, in case the user isn't
inlining them.
* argp-help.c: #define __mempcpy if needed. Use unsigned
arguments to the ctype macros. Handle systems where
program_invocation_name and program_invocation_short_name doesn't
exist.
* argp-help.c (short_program_name): New function.
* Makefile.am: Use @LIBOBJS@ when building test program.
* configure.in: Check for getopt_long. Substitute
LIBOBJS. Add -I$srcdir to CPPFLAGS.
* src/argp: Added getopt.h, getopt.c and getopt1.c, which are
needed for separate compilation of argp.
2000-11-27 Niels Möller <nisse@cuckoo.localdomain>
* Updated argp from glibc-2.2.

View File

@ -1,6 +1,6 @@
# From glibc
# Copyright (C) 1997 Free Software Foundation, Inc.
# Copyright (C) 1997, 2003 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or
@ -19,13 +19,14 @@
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
AUTOMAKE_OPTIONS = foreign
SUBDIRS = . testsuite
LIBOBJS = @LIBOBJS@
noinst_LIBRARIES = libargp.a
noinst_PROGRAMS = argp-test
noinst_HEADERS = argp.h argp-fmtstream.h argp-namefrob.h # argp-comp.h
all: libargp.a
EXTRA_DIST = mempcpy.c strchrnul.c strndup.c Versions
# Leaves out argp-fs-xinl.c and argp-xinl.c
@ -33,7 +34,7 @@ libargp_a_SOURCES = argp-ba.c argp-eexst.c argp-fmtstream.c \
argp-help.c argp-parse.c argp-pv.c \
argp-pvh.c argp-eexst.c
libargp_a_LIBADD = @LIBOBJS@
libargp_a_LIBADD = $(LIBOBJS)
argp_test_LDADD = libargp.a

View File

@ -1,6 +1,8 @@
# Makefile.in generated automatically by automake 1.4 from Makefile.am
# Makefile.in generated by automake 1.7.3 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@ -10,9 +12,11 @@
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
# From glibc
# Copyright (C) 1997 Free Software Foundation, Inc.
# Copyright (C) 1997, 2003 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or
@ -30,61 +34,102 @@
# not, write to the Free Software Foundation, Inc.,
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
DESTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = .
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
transform = @program_transform_name@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
ACLOCAL = @ACLOCAL@
ALLOCA = @ALLOCA@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
ac_ct_CC = @ac_ct_CC@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
bindir = @bindir@
build_alias = @build_alias@
datadir = @datadir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
AUTOMAKE_OPTIONS = foreign
SUBDIRS = . testsuite
noinst_LIBRARIES = libargp.a
noinst_PROGRAMS = argp-test
@ -93,320 +138,503 @@ noinst_HEADERS = argp.h argp-fmtstream.h argp-namefrob.h # argp-comp.h
EXTRA_DIST = mempcpy.c strchrnul.c strndup.c Versions
# Leaves out argp-fs-xinl.c and argp-xinl.c
libargp_a_SOURCES = argp-ba.c argp-eexst.c argp-fmtstream.c argp-help.c argp-parse.c argp-pv.c argp-pvh.c argp-eexst.c
libargp_a_SOURCES = argp-ba.c argp-eexst.c argp-fmtstream.c \
argp-help.c argp-parse.c argp-pv.c \
argp-pvh.c argp-eexst.c
libargp_a_LIBADD = @LIBOBJS@
libargp_a_LIBADD = $(LIBOBJS)
argp_test_LDADD = libargp.a
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES =
LIBRARIES = $(noinst_LIBRARIES)
CONFIG_CLEAN_FILES =
LIBRARIES = $(noinst_LIBRARIES)
DEFS = @DEFS@ -I. -I$(srcdir) -I.
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
libargp_a_DEPENDENCIES = @LIBOBJS@
libargp_a_OBJECTS = argp-ba.o argp-eexst.o argp-fmtstream.o argp-help.o \
argp-parse.o argp-pv.o argp-pvh.o argp-eexst.o
AR = ar
PROGRAMS = $(noinst_PROGRAMS)
libargp_a_AR = $(AR) cru
libargp_a_DEPENDENCIES = @LIBOBJS@
am_libargp_a_OBJECTS = argp-ba.$(OBJEXT) argp-eexst.$(OBJEXT) \
argp-fmtstream.$(OBJEXT) argp-help.$(OBJEXT) \
argp-parse.$(OBJEXT) argp-pv.$(OBJEXT) argp-pvh.$(OBJEXT) \
argp-eexst.$(OBJEXT)
libargp_a_OBJECTS = $(am_libargp_a_OBJECTS)
noinst_PROGRAMS = argp-test$(EXEEXT)
PROGRAMS = $(noinst_PROGRAMS)
argp_test_SOURCES = argp-test.c
argp_test_OBJECTS = argp-test.o
argp_test_DEPENDENCIES = libargp.a
argp_test_LDFLAGS =
CFLAGS = @CFLAGS@
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
argp_test_OBJECTS = argp-test.$(OBJEXT)
argp_test_DEPENDENCIES = libargp.a
argp_test_LDFLAGS =
DEFAULT_INCLUDES = -I. -I$(srcdir) -I.
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
@AMDEP_TRUE@DEP_FILES = $(DEPDIR)/mempcpy.Po $(DEPDIR)/strchrnul.Po \
@AMDEP_TRUE@ $(DEPDIR)/strndup.Po ./$(DEPDIR)/argp-ba.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/argp-eexst.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/argp-fmtstream.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/argp-help.Po ./$(DEPDIR)/argp-parse.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/argp-pv.Po ./$(DEPDIR)/argp-pvh.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/argp-test.Po
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
HEADERS = $(noinst_HEADERS)
DIST_COMMON = ./stamp-h.in Makefile.am Makefile.in acconfig.h \
acinclude.m4 aclocal.m4 config.h.in configure configure.in install-sh \
mempcpy.c missing mkinstalldirs strchrnul.c strndup.c
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
DIST_SOURCES = $(libargp_a_SOURCES) argp-test.c
HEADERS = $(noinst_HEADERS)
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
GZIP_ENV = --best
RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \
ps-recursive install-info-recursive uninstall-info-recursive \
all-recursive install-data-recursive install-exec-recursive \
installdirs-recursive install-recursive uninstall-recursive \
check-recursive installcheck-recursive
DIST_COMMON = $(noinst_HEADERS) ChangeLog Makefile.am Makefile.in TODO \
acinclude.m4 aclocal.m4 config.h.in configure configure.ac \
depcomp install-sh mempcpy.c missing mkinstalldirs strchrnul.c \
strndup.c
DIST_SUBDIRS = $(SUBDIRS)
SOURCES = $(libargp_a_SOURCES) argp-test.c
OBJECTS = $(libargp_a_OBJECTS) argp-test.o
all: all-redirect
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
.SUFFIXES:
.SUFFIXES: .S .c .o .s
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps Makefile
.SUFFIXES: .c .o .obj
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --foreign Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)
$(ACLOCAL_M4): configure.in acinclude.m4
cd $(srcdir) && $(ACLOCAL)
config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
$(srcdir)/configure: $(srcdir)/configure.ac $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
cd $(srcdir) && $(AUTOCONF)
config.h: stamp-h
$(ACLOCAL_M4): configure.ac acinclude.m4
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
config.h: stamp-h1
@if test ! -f $@; then \
rm -f stamp-h; \
$(MAKE) stamp-h; \
rm -f stamp-h1; \
$(MAKE) stamp-h1; \
else :; fi
stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES= CONFIG_HEADERS=config.h \
$(SHELL) ./config.status
@echo timestamp > stamp-h 2> /dev/null
$(srcdir)/config.h.in: $(srcdir)/stamp-h.in
@if test ! -f $@; then \
rm -f $(srcdir)/stamp-h.in; \
$(MAKE) $(srcdir)/stamp-h.in; \
else :; fi
$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
@rm -f stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status config.h
$(srcdir)/config.h.in: $(top_srcdir)/configure.ac $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOHEADER)
@echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null
mostlyclean-hdr:
clean-hdr:
touch $(srcdir)/config.h.in
distclean-hdr:
-rm -f config.h
-rm -f config.h stamp-h1
maintainer-clean-hdr:
mostlyclean-noinstLIBRARIES:
AR = ar
clean-noinstLIBRARIES:
-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
libargp.a: $(libargp_a_OBJECTS) $(libargp_a_DEPENDENCIES)
-rm -f libargp.a
$(libargp_a_AR) libargp.a $(libargp_a_OBJECTS) $(libargp_a_LIBADD)
$(RANLIB) libargp.a
distclean-noinstLIBRARIES:
maintainer-clean-noinstLIBRARIES:
.c.o:
$(COMPILE) -c $<
.s.o:
$(COMPILE) -c $<
.S.o:
$(COMPILE) -c $<
clean-noinstPROGRAMS:
-test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
argp-test$(EXEEXT): $(argp_test_OBJECTS) $(argp_test_DEPENDENCIES)
@rm -f argp-test$(EXEEXT)
$(LINK) $(argp_test_LDFLAGS) $(argp_test_OBJECTS) $(argp_test_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.o core *.core
clean-compile:
-rm -f *.$(OBJEXT) core *.core
distclean-compile:
-rm -f *.tab.c
maintainer-clean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/mempcpy.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strchrnul.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strndup.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/argp-ba.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/argp-eexst.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/argp-fmtstream.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/argp-help.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/argp-parse.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/argp-pv.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/argp-pvh.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/argp-test.Po@am__quote@
libargp.a: $(libargp_a_OBJECTS) $(libargp_a_DEPENDENCIES)
-rm -f libargp.a
$(AR) cru libargp.a $(libargp_a_OBJECTS) $(libargp_a_LIBADD)
$(RANLIB) libargp.a
distclean-depend:
-rm -rf $(DEPDIR) ./$(DEPDIR)
mostlyclean-noinstPROGRAMS:
.c.o:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
@am__fastdepCC_TRUE@ fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
clean-noinstPROGRAMS:
-test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
.c.obj:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \
@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
@am__fastdepCC_TRUE@ fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`
uninstall-info-am:
distclean-noinstPROGRAMS:
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
@set fnord $$MAKEFLAGS; amf=$$2; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
maintainer-clean-noinstPROGRAMS:
mostlyclean-recursive clean-recursive distclean-recursive \
maintainer-clean-recursive:
@set fnord $$MAKEFLAGS; amf=$$2; \
dot_seen=no; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
rev=''; for subdir in $$list; do \
if test "$$subdir" = "."; then :; else \
rev="$$subdir $$rev"; \
fi; \
done; \
rev="$$rev ."; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
argp-test: $(argp_test_OBJECTS) $(argp_test_DEPENDENCIES)
@rm -f argp-test
$(LINK) $(argp_test_LDFLAGS) $(argp_test_OBJECTS) $(argp_test_LDADD) $(LIBS)
ETAGS = etags
ETAGSFLAGS =
CTAGS = ctags
CTAGSFLAGS =
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP)
list='$(SOURCES) $(HEADERS)'; \
unique=`for i in $$list; do echo $$i; done | \
awk ' { files[$$0] = 1; } \
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
here=`pwd` && cd $(srcdir) \
&& mkid -f$$here/ID $$unique $(LISP)
mkid -fID $$unique
TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP)
TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS)'; \
unique=`for i in $$list; do echo $$i; done | \
awk ' { files[$$0] = 1; } \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \
|| (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP) -o $$here/TAGS)
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique
mostlyclean-tags:
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
clean-tags:
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID
maintainer-clean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = .
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
{ test ! -d $(distdir) \
|| { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -fr $(distdir); }; }
GZIP_ENV = --best
distuninstallcheck_listfiles = find . -type f -print
distcleancheck_listfiles = find . -type f -print
distdir: $(DISTFILES)
$(am__remove_distdir)
mkdir $(distdir)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkinstalldirs) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -d $(distdir)/$$subdir \
|| mkdir $(distdir)/$$subdir \
|| exit 1; \
(cd $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$(top_distdir)" \
distdir=../$(distdir)/$$subdir \
distdir) \
|| exit 1; \
fi; \
done
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r $(distdir)
dist-gzip: distdir
$(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
dist dist-all: distdir
$(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
-rm -rf $(distdir)
GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz
mkdir $(distdir)/=build
mkdir $(distdir)/=inst
dc_install_base=`cd $(distdir)/=inst && pwd`; \
cd $(distdir)/=build \
&& ../configure --srcdir=.. --prefix=$$dc_install_base \
$(am__remove_distdir)
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf -
chmod -R a-w $(distdir); chmod a+w $(distdir)
mkdir $(distdir)/_build
mkdir $(distdir)/_inst
chmod a-w $(distdir)
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& cd $(distdir)/_build \
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
$(DISTCHECK_CONFIGURE_FLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) dist
-rm -rf $(distdir)
@banner="$(distdir).tar.gz is ready for distribution"; \
dashes=`echo "$$banner" | sed s/./=/g`; \
echo "$$dashes"; \
echo "$$banner"; \
echo "$$dashes"
dist: distdir
-chmod -R a+r $(distdir)
GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
-rm -rf $(distdir)
dist-all: distdir
-chmod -R a+r $(distdir)
GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
-rm -rf $(distdir)
distdir: $(DISTFILES)
-rm -rf $(distdir)
mkdir $(distdir)
-chmod 777 $(distdir)
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
cp -pr $$/$$file $(distdir)/$$file; \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file || :; \
fi; \
done
argp-ba.o: argp-ba.c
argp-eexst.o: argp-eexst.c config.h argp.h
argp-fmtstream.o: argp-fmtstream.c config.h argp-fmtstream.h \
argp-namefrob.h
argp-help.o: argp-help.c config.h argp.h argp-fmtstream.h \
argp-namefrob.h
argp-parse.o: argp-parse.c config.h argp.h argp-namefrob.h
argp-pv.o: argp-pv.c
argp-pvh.o: argp-pvh.c config.h argp.h
argp-test.o: argp-test.c config.h argp.h
getopt.o: getopt.c config.h getopt.h
getopt1.o: getopt1.c config.h getopt.h
mempcpy.o: mempcpy.c
strchrnul.o: strchrnul.c
strndup.o: strndup.c
info-am:
info: info-am
dvi-am:
dvi: dvi-am
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
distuninstallcheck \
&& chmod -R a-w "$$dc_install_base" \
&& ({ \
(cd ../.. && $(mkinstalldirs) "$$dc_destdir") \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
} || { rm -rf "$$dc_destdir"; exit 1; }) \
&& rm -rf "$$dc_destdir" \
&& $(MAKE) $(AM_MAKEFLAGS) dist-gzip \
&& rm -f $(distdir).tar.gz \
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck
$(am__remove_distdir)
@echo "$(distdir).tar.gz is ready for distribution" | \
sed 'h;s/./=/g;p;x;p;x'
distuninstallcheck:
cd $(distuninstallcheck_dir) \
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
|| { echo "ERROR: files left after uninstall:" ; \
if test -n "$(DESTDIR)"; then \
echo " (check DESTDIR support)"; \
fi ; \
$(distuninstallcheck_listfiles) ; \
exit 1; } >&2
distcleancheck: distclean
if test '$(srcdir)' = . ; then \
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
exit 1 ; \
fi
test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left in build directory after distclean:" ; \
$(distcleancheck_listfiles) ; \
exit 1; } >&2
check-am: all-am
check: check-am
installcheck-am:
installcheck: installcheck-am
all-recursive-am: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
check: check-recursive
all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(HEADERS) config.h
installdirs: installdirs-recursive
installdirs-am:
install-exec-am:
install-exec: install-exec-am
install-data-am:
install-data: install-data-am
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
install: install-am
uninstall-am:
uninstall: uninstall-am
all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(HEADERS) config.h
all-redirect: all-am
installcheck: installcheck-recursive
install-strip:
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
installdirs:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic:
mostlyclean-am: mostlyclean-hdr mostlyclean-noinstLIBRARIES \
mostlyclean-compile mostlyclean-noinstPROGRAMS \
mostlyclean-tags mostlyclean-generic
mostlyclean: mostlyclean-am
clean-am: clean-hdr clean-noinstLIBRARIES clean-compile \
clean-noinstPROGRAMS clean-tags clean-generic \
mostlyclean-am
clean: clean-am
distclean-am: distclean-hdr distclean-noinstLIBRARIES distclean-compile \
distclean-noinstPROGRAMS distclean-tags \
distclean-generic clean-am
distclean: distclean-am
-rm -f config.status
maintainer-clean-am: maintainer-clean-hdr \
maintainer-clean-noinstLIBRARIES \
maintainer-clean-compile \
maintainer-clean-noinstPROGRAMS maintainer-clean-tags \
maintainer-clean-generic distclean-am
@echo "This command is intended for maintainers to use;"
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive
maintainer-clean: maintainer-clean-am
-rm -f config.status
clean-am: clean-generic clean-noinstLIBRARIES clean-noinstPROGRAMS \
mostlyclean-am
.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \
clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \
mostlyclean-compile distclean-compile clean-compile \
maintainer-clean-compile mostlyclean-noinstPROGRAMS \
distclean-noinstPROGRAMS clean-noinstPROGRAMS \
maintainer-clean-noinstPROGRAMS tags mostlyclean-tags distclean-tags \
clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \
check-am installcheck-am installcheck all-recursive-am install-exec-am \
install-exec install-data-am install-data install-am install \
uninstall-am uninstall all-redirect all-am all installdirs \
mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
distclean-am: clean-am distclean-compile distclean-depend \
distclean-generic distclean-hdr distclean-tags
dvi: dvi-recursive
all: libargp.a
dvi-am:
info: info-recursive
info-am:
install-data-am:
install-exec-am:
install-info: install-info-recursive
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf autom4te.cache
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-compile mostlyclean-generic
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am: uninstall-info-am
uninstall-info: uninstall-info-recursive
.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \
clean-generic clean-noinstLIBRARIES clean-noinstPROGRAMS \
clean-recursive ctags ctags-recursive dist dist-all dist-gzip \
distcheck distclean distclean-compile distclean-depend \
distclean-generic distclean-hdr distclean-recursive \
distclean-tags distcleancheck distdir distuninstallcheck dvi \
dvi-am dvi-recursive info info-am info-recursive install \
install-am install-data install-data-am install-data-recursive \
install-exec install-exec-am install-exec-recursive \
install-info install-info-am install-info-recursive install-man \
install-recursive install-strip installcheck installcheck-am \
installdirs installdirs-am installdirs-recursive \
maintainer-clean maintainer-clean-generic \
maintainer-clean-recursive mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-recursive pdf pdf-am \
pdf-recursive ps ps-am ps-recursive tags tags-recursive \
uninstall uninstall-am uninstall-info-am \
uninstall-info-recursive uninstall-recursive
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.

2
TODO Normal file
View File

@ -0,0 +1,2 @@
Figure out what to do about extern inline, as it's not supported by
newer gcc-3.x.

View File

@ -1,12 +1,315 @@
dnl ARGP_CHECK_VAR(VAR, INCLUDES)
AC_DEFUN(ARGP_CHECK_VAR,
[ AC_CACHE_CHECK(
[for $1],
lsh_cv_var_$1,
AC_TRY_LINK([$2], [void *p = (void *) &$1;],
[lsh_cv_var_$1=yes],
[lsh_cv_var_$1=no]))
if eval "test \"`echo '$lsh_cv_var_'$1`\" = yes"; then
AC_DEFINE_UNQUOTED(HAVE_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`)
fi
dnl Try to detect the type of the third arg to getsockname() et al
AC_DEFUN([LSH_TYPE_SOCKLEN_T],
[AH_TEMPLATE([socklen_t], [Length type used by getsockopt])
AC_CACHE_CHECK([for socklen_t in sys/socket.h], ac_cv_type_socklen_t,
[AC_EGREP_HEADER(socklen_t, sys/socket.h,
[ac_cv_type_socklen_t=yes], [ac_cv_type_socklen_t=no])])
if test $ac_cv_type_socklen_t = no; then
AC_MSG_CHECKING(for AIX)
AC_EGREP_CPP(yes, [
#ifdef _AIX
yes
#endif
],[
AC_MSG_RESULT(yes)
AC_DEFINE(socklen_t, size_t)
],[
AC_MSG_RESULT(no)
AC_DEFINE(socklen_t, int)
])
fi
])
dnl LSH_PATH_ADD(path-id, directory)
AC_DEFUN([LSH_PATH_ADD],
[AC_MSG_CHECKING($2)
ac_exists=no
if test -d "$2/." ; then
ac_real_dir=`cd $2 && pwd`
if test -n "$ac_real_dir" ; then
ac_exists=yes
for old in $1_REAL_DIRS ; do
ac_found=no
if test x$ac_real_dir = x$old ; then
ac_found=yes;
break;
fi
done
if test $ac_found = yes ; then
AC_MSG_RESULT(already added)
else
AC_MSG_RESULT(added)
# LDFLAGS="$LDFLAGS -L $2"
$1_REAL_DIRS="$ac_real_dir [$]$1_REAL_DIRS"
$1_DIRS="$2 [$]$1_DIRS"
fi
fi
fi
if test $ac_exists = no ; then
AC_MSG_RESULT(not found)
fi
])
dnl LSH_RPATH_ADD(dir)
AC_DEFUN([LSH_RPATH_ADD], [LSH_PATH_ADD(RPATH_CANDIDATE, $1)])
dnl LSH_RPATH_INIT(candidates)
AC_DEFUN([LSH_RPATH_INIT],
[AC_MSG_CHECKING([for -R flag])
RPATHFLAG=''
case `uname -sr` in
OSF1\ V4.*)
RPATHFLAG="-rpath "
;;
IRIX\ 6.*)
RPATHFLAG="-rpath "
;;
IRIX\ 5.*)
RPATHFLAG="-rpath "
;;
SunOS\ 5.*)
if test "$TCC" = "yes"; then
# tcc doesn't know about -R
RPATHFLAG="-Wl,-R,"
else
RPATHFLAG=-R
fi
;;
Linux\ 2.*)
RPATHFLAG="-Wl,-rpath,"
;;
*)
:
;;
esac
if test x$RPATHFLAG = x ; then
AC_MSG_RESULT(none)
else
AC_MSG_RESULT([using $RPATHFLAG])
fi
RPATH_CANDIDATE_REAL_DIRS=''
RPATH_CANDIDATE_DIRS=''
AC_MSG_RESULT([Searching for libraries])
for d in $1 ; do
LSH_RPATH_ADD($d)
done
])
dnl Try to execute a main program, and if it fails, try adding some
dnl -R flag.
dnl LSH_RPATH_FIX
AC_DEFUN([LSH_RPATH_FIX],
[if test $cross_compiling = no -a "x$RPATHFLAG" != x ; then
ac_success=no
AC_TRY_RUN([int main(int argc, char **argv) { return 0; }],
ac_success=yes, ac_success=no, :)
if test $ac_success = no ; then
AC_MSG_CHECKING([Running simple test program failed. Trying -R flags])
dnl echo RPATH_CANDIDATE_DIRS = $RPATH_CANDIDATE_DIRS
ac_remaining_dirs=''
ac_rpath_save_LDFLAGS="$LDFLAGS"
for d in $RPATH_CANDIDATE_DIRS ; do
if test $ac_success = yes ; then
ac_remaining_dirs="$ac_remaining_dirs $d"
else
LDFLAGS="$RPATHFLAG$d $LDFLAGS"
dnl echo LDFLAGS = $LDFLAGS
AC_TRY_RUN([int main(int argc, char **argv) { return 0; }],
[ac_success=yes
ac_rpath_save_LDFLAGS="$LDFLAGS"
AC_MSG_RESULT([adding $RPATHFLAG$d])
],
[ac_remaining_dirs="$ac_remaining_dirs $d"], :)
LDFLAGS="$ac_rpath_save_LDFLAGS"
fi
done
RPATH_CANDIDATE_DIRS=$ac_remaining_dirs
fi
if test $ac_success = no ; then
AC_MSG_RESULT(failed)
fi
fi
])
dnl Like AC_CHECK_LIB, but uses $KRB_LIBS rather than $LIBS.
dnl LSH_CHECK_KRB_LIB(LIBRARY, FUNCTION, [, ACTION-IF-FOUND [,
dnl ACTION-IF-NOT-FOUND [, OTHER-LIBRARIES]]])
AC_DEFUN([LSH_CHECK_KRB_LIB],
[AC_CHECK_LIB([$1], [$2],
ifelse([$3], ,
[[ac_tr_lib=HAVE_LIB`echo $1 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
AC_DEFINE_UNQUOTED($ac_tr_lib)
KRB_LIBS="-l$1 $KRB_LIBS"
]], [$3]),
ifelse([$4], , , [$4
])dnl
, [$5 $KRB_LIBS])
])
dnl LSH_LIB_ARGP(ACTION-IF-OK, ACTION-IF-BAD)
AC_DEFUN([LSH_LIB_ARGP],
[ ac_argp_save_LIBS="$LIBS"
ac_argp_save_LDFLAGS="$LDFLAGS"
ac_argp_ok=no
# First check if we can link with argp.
AC_SEARCH_LIBS(argp_parse, argp,
[ LSH_RPATH_FIX
AC_CACHE_CHECK([for working argp],
lsh_cv_lib_argp_works,
[ AC_TRY_RUN(
[#include <argp.h>
#include <stdlib.h>
static const struct argp_option
options[] =
{
{ NULL, 0, NULL, 0, NULL, 0 }
};
struct child_state
{
int n;
};
static error_t
child_parser(int key, char *arg, struct argp_state *state)
{
struct child_state *input = (struct child_state *) state->input;
switch(key)
{
default:
return ARGP_ERR_UNKNOWN;
case ARGP_KEY_END:
if (!input->n)
input->n = 1;
break;
}
return 0;
}
const struct argp child_argp =
{
options,
child_parser,
NULL, NULL, NULL, NULL, NULL
};
struct main_state
{
struct child_state child;
int m;
};
static error_t
main_parser(int key, char *arg, struct argp_state *state)
{
struct main_state *input = (struct main_state *) state->input;
switch(key)
{
default:
return ARGP_ERR_UNKNOWN;
case ARGP_KEY_INIT:
state->child_inputs[0] = &input->child;
break;
case ARGP_KEY_END:
if (!input->m)
input->m = input->child.n;
break;
}
return 0;
}
static const struct argp_child
main_children[] =
{
{ &child_argp, 0, "", 0 },
{ NULL, 0, NULL, 0}
};
static const struct argp
main_argp =
{ options, main_parser,
NULL,
NULL,
main_children,
NULL, NULL
};
int main(int argc, char **argv)
{
struct main_state input = { { 0 }, 0 };
char *v[2] = { "foo", NULL };
argp_parse(&main_argp, 1, v, 0, NULL, &input);
if ( (input.m == 1) && (input.child.n == 1) )
return 0;
else
return 1;
}
], lsh_cv_lib_argp_works=yes,
lsh_cv_lib_argp_works=no,
lsh_cv_lib_argp_works=no)])
if test x$lsh_cv_lib_argp_works = xyes ; then
ac_argp_ok=yes
else
# Reset link flags
LIBS="$ac_argp_save_LIBS"
LDFLAGS="$ac_argp_save_LDFLAGS"
fi])
if test x$ac_argp_ok = xyes ; then
ifelse([$1],, true, [$1])
else
ifelse([$2],, true, [$2])
fi
])
dnl LSH_GCC_ATTRIBUTES
dnl Check for gcc's __attribute__ construction
AC_DEFUN([LSH_GCC_ATTRIBUTES],
[AC_CACHE_CHECK(for __attribute__,
lsh_cv_c_attribute,
[ AC_TRY_COMPILE([
#include <stdlib.h>
],
[
static void foo(void) __attribute__ ((noreturn));
static void __attribute__ ((noreturn))
foo(void)
{
exit(1);
}
],
lsh_cv_c_attribute=yes,
lsh_cv_c_attribute=no)])
AH_TEMPLATE([HAVE_GCC_ATTRIBUTE], [Define if the compiler understands __attribute__])
if test "x$lsh_cv_c_attribute" = "xyes"; then
AC_DEFINE(HAVE_GCC_ATTRIBUTE)
fi
AH_BOTTOM(
[#if __GNUC__ && HAVE_GCC_ATTRIBUTE
# define NORETURN __attribute__ ((__noreturn__))
# define PRINTF_STYLE(f, a) __attribute__ ((__format__ (__printf__, f, a)))
# define UNUSED __attribute__ ((__unused__))
#else
# define NORETURN
# define PRINTF_STYLE(f, a)
# define UNUSED
#endif
])])

1240
aclocal.m4 vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
/* Word-wrapping and line-truncating streams
Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
Copyright (C) 1997, 1998, 1999, 2001 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
@ -94,7 +94,7 @@ __argp_fmtstream_free (argp_fmtstream_t fs)
{
__argp_fmtstream_update (fs);
if (fs->p > fs->buf)
fwrite_unlocked (fs->buf, 1, fs->p - fs->buf, fs->stream);
FWRITE_UNLOCKED (fs->buf, 1, fs->p - fs->buf, fs->stream);
free (fs->buf);
free (fs);
}
@ -134,7 +134,7 @@ __argp_fmtstream_update (argp_fmtstream_t fs)
/* No buffer space for spaces. Must flush. */
size_t i;
for (i = 0; i < pad; i++)
putc_unlocked (' ', fs->stream);
PUTC_UNLOCKED (' ', fs->stream);
}
fs->point_col = pad;
}
@ -268,8 +268,8 @@ __argp_fmtstream_update (argp_fmtstream_t fs)
/* Output the first line so we can use the space. */
{
if (nl > fs->buf)
fwrite_unlocked (fs->buf, 1, nl - fs->buf, fs->stream);
putc_unlocked ('\n', fs->stream);
FWRITE_UNLOCKED (fs->buf, 1, nl - fs->buf, fs->stream);
PUTC_UNLOCKED ('\n', fs->stream);
len += buf - fs->buf;
nl = buf = fs->buf;
}
@ -286,7 +286,7 @@ __argp_fmtstream_update (argp_fmtstream_t fs)
*nl++ = ' ';
else
for (i = 0; i < fs->wmargin; ++i)
putc_unlocked (' ', fs->stream);
PUTC_UNLOCKED (' ', fs->stream);
/* Copy the tail of the original buffer into the current buffer
position. */
@ -323,7 +323,7 @@ __argp_fmtstream_ensure (struct argp_fmtstream *fs, size_t amount)
/* Flush FS's buffer. */
__argp_fmtstream_update (fs);
wrote = fwrite_unlocked (fs->buf, 1, fs->p - fs->buf, fs->stream);
wrote = FWRITE_UNLOCKED (fs->buf, 1, fs->p - fs->buf, fs->stream);
if (wrote == fs->p - fs->buf)
{
fs->p = fs->buf;

View File

@ -1,5 +1,5 @@
/* Word-wrapping and line-truncating streams.
Copyright (C) 1997 Free Software Foundation, Inc.
Copyright (C) 1997, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
@ -26,27 +26,26 @@
#ifndef _ARGP_FMTSTREAM_H
#define _ARGP_FMTSTREAM_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#if !_LIBC
# if ! (defined (HAVE_FLOCKFILE) && defined(HAVE_PUTC_UNLOCKED) \
#if _LIBC || (defined (HAVE_FLOCKFILE) && defined(HAVE_PUTC_UNLOCKED) \
&& defined (HAVE_FPUTS_UNLOCKED) && defined (HAVE_FWRITE_UNLOCKED) )
/* Don't use stdio locking */
# define flockfile(f)
# define funlockfile(f)
# define putc_unlocked(c, f) putc((c), (f))
# define fputs_unlocked(s, f) fputs((s), (f))
# define fwrite_unlocked(b, s, n, f) fwrite((b), (s), (n), (f))
# endif /* No thread safe i/o */
#endif /* !_LIBC */
/* Use locking funxtions */
# define FLOCKFILE(f) flockfile(f)
# define FUNLOCKFILE(f) funlockfile(f)
# define PUTC_UNLOCKED(c, f) putc_unlocked((c), (f))
# define FPUTS_UNLOCKED(s, f) fputs_unlocked((s), (f))
# define FWRITE_UNLOCKED(b, s, n, f) fwrite_unlocked((b), (s), (n), (f))
#else
/* Disable stdio locking */
# define FLOCKFILE(f)
# define FUNLOCKFILE(f)
# define PUTC_UNLOCKED(c, f) putc((c), (f))
# define FPUTS_UNLOCKED(s, f) fputs((s), (f))
# define FWRITE_UNLOCKED(b, s, n, f) fwrite((b), (s), (n), (f))
#endif /* No thread safe i/o */
#if (_LIBC - 0 && !defined (USE_IN_LIBIO)) \
|| (defined (__GNU_LIBRARY__) && defined (HAVE_LINEWRAP_H))
@ -100,16 +99,6 @@ typedef FILE *argp_fmtstream_t;
#define __const const
#endif
/* FIXME: We could use a configure test to check for __attribute__,
* just like lsh does. */
#ifndef PRINTF_STYLE
# if __GNUC__ >= 2
# define PRINTF_STYLE(f, a) __attribute__ ((__format__ (__printf__, f, a)))
# else
# define PRINTF_STYLE(f, a)
# endif
#endif
struct argp_fmtstream
{

View File

@ -1,5 +1,5 @@
/* Hierarchial argument parsing help output
Copyright (C) 1995,1996,1997,1998,1999,2000 Free Software Foundation, Inc.
Copyright (C) 1995,96,97,98,99,2000, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
@ -50,9 +50,9 @@ char *alloca ();
#include <string.h>
#include <assert.h>
#include <stdarg.h>
#include <malloc.h>
#include <ctype.h>
/* Does any system still need malloc.h? If so, we'd need a configure
test. */
#ifndef _
/* This is for other GNU distributions with internationalized messages. */
@ -72,16 +72,6 @@ char *alloca ();
#include "argp-namefrob.h"
/* FIXME: We could use a configure test to check for __attribute__,
* just like lsh does. */
#ifndef UNUSED
# if __GNUC__ >= 2
# define UNUSED __attribute__ ((__unused__))
# else
# define UNUSED
# endif
#endif
#ifndef _LIBC
# ifndef __strchrnul
# define __strchrnul strchrnul
@ -91,18 +81,14 @@ char *alloca ();
# endif
/* We need to use a different name, as __strndup is likely a macro. */
# define STRNDUP strndup
# ifndef __flockfile
# define __flockfile flockfile
# endif
# ifndef __funlockfile
# define __funlockfile funlockfile
# endif
# if HAVE_STRERROR
# define STRERROR strerror
# else
# define STRERROR(x) (sys_errlist[x])
# endif
#else /* _LIBC */
# define FLOCKFILE __flockfile
# define FUNLOCKFILE __funlockfile
# define STRNDUP __strndup
# define STRERROR strerror
#endif
@ -196,7 +182,7 @@ static const struct uparam_name uparam_names[] =
{ "header-col", 0, offsetof (struct uparams, header_col) },
{ "usage-indent", 0, offsetof (struct uparams, usage_indent) },
{ "rmargin", 0, offsetof (struct uparams, rmargin) },
{ 0 }
{ 0, 0, 0 }
};
/* Read user options from the environment, and fill in UPARAMS appropiately. */
@ -1114,17 +1100,14 @@ hol_entry_help (struct hol_entry *entry, const struct argp_state *state,
int old_wm = __argp_fmtstream_wmargin (stream);
/* PEST is a state block holding some of our variables that we'd like to
share with helper functions. */
#ifdef __GNUC__
struct pentry_state pest = { entry, stream, hhstate, 1, state };
#else /* !__GNUC__ */
/* Decent initializers are a GNU extension */
/* Decent initializers are a GNU extension, so don't use it here. */
struct pentry_state pest;
pest.entry = entry;
pest.stream = stream;
pest.hhstate = hhstate;
pest.first = 1;
pest.state = state;
#endif /* !__GNUC__ */
if (! odoc (real))
for (opt = real, num = entry->num; num > 0; opt++, num--)
@ -1596,7 +1579,7 @@ _help (const struct argp *argp, const struct argp_state *state, FILE *stream,
if (! stream)
return;
__flockfile (stream);
FLOCKFILE (stream);
if (! uparams.valid)
fill_in_uparams (state);
@ -1604,7 +1587,7 @@ _help (const struct argp *argp, const struct argp_state *state, FILE *stream,
fs = __argp_make_fmtstream (stream, 0, uparams.rmargin, 0);
if (! fs)
{
__funlockfile (stream);
FUNLOCKFILE (stream);
return;
}
@ -1712,7 +1695,7 @@ Try `%s --help' or `%s --usage' for more information.\n"),
anything = 1;
}
__funlockfile (stream);
FUNLOCKFILE (stream);
if (hol)
hol_free (hol);
@ -1742,11 +1725,11 @@ __argp_short_program_name(const struct argp_state *state)
{
if (state)
return state->name;
#if HAVE_PROGRAM_INVOCATION_SHORT_NAME
#if HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME
return program_invocation_short_name;
#elif HAVE_PROGRAM_INVOCATION_NAME
#elif HAVE_DECL_PROGRAM_INVOCATION_NAME
return __argp_basename(program_invocation_name);
#else /* !HAVE_PROGRAM_INVOCATION_NAME */
#else /* !HAVE_DECL_PROGRAM_INVOCATION_NAME */
/* FIXME: What now? Miles suggests that it is better to use NULL,
but currently the value is passed on directly to fputs_unlocked,
so that requires more changes. */
@ -1754,7 +1737,7 @@ __argp_short_program_name(const struct argp_state *state)
# warning No reasonable value to return
return "";
# endif /* __GNUC__ */
#endif /* !HAVE_PROGRAM_INVOCATION_NAME */
#endif /* !HAVE_DECL_PROGRAM_INVOCATION_NAME */
}
/* Output, if appropriate, a usage message for STATE to STREAM. FLAGS are
@ -1797,22 +1780,22 @@ __argp_error (const struct argp_state *state, const char *fmt, ...)
{
va_list ap;
__flockfile (stream);
FLOCKFILE (stream);
fputs_unlocked (__argp_short_program_name(state),
FPUTS_UNLOCKED (__argp_short_program_name(state),
stream);
putc_unlocked (':', stream);
putc_unlocked (' ', stream);
PUTC_UNLOCKED (':', stream);
PUTC_UNLOCKED (' ', stream);
va_start (ap, fmt);
vfprintf (stream, fmt, ap);
va_end (ap);
putc_unlocked ('\n', stream);
PUTC_UNLOCKED ('\n', stream);
__argp_state_help (state, stream, ARGP_HELP_STD_ERR);
__funlockfile (stream);
FUNLOCKFILE (stream);
}
}
}
@ -1838,17 +1821,17 @@ __argp_failure (const struct argp_state *state, int status, int errnum,
if (stream)
{
__flockfile (stream);
FLOCKFILE (stream);
fputs_unlocked (__argp_short_program_name(state),
FPUTS_UNLOCKED (__argp_short_program_name(state),
stream);
if (fmt)
{
va_list ap;
putc_unlocked (':', stream);
putc_unlocked (' ', stream);
PUTC_UNLOCKED (':', stream);
PUTC_UNLOCKED (' ', stream);
va_start (ap, fmt);
vfprintf (stream, fmt, ap);
@ -1857,14 +1840,14 @@ __argp_failure (const struct argp_state *state, int status, int errnum,
if (errnum)
{
putc_unlocked (':', stream);
putc_unlocked (' ', stream);
PUTC_UNLOCKED (':', stream);
PUTC_UNLOCKED (' ', stream);
fputs (STRERROR (errnum), stream);
}
putc_unlocked ('\n', stream);
PUTC_UNLOCKED ('\n', stream);
__funlockfile (stream);
FUNLOCKFILE (stream);
if (status && (!state || !(state->flags & ARGP_NO_EXIT)))
exit (status);

View File

@ -1,5 +1,5 @@
/* Hierarchial argument parsing
Copyright (C) 1995, 96, 97, 98, 99, 2000 Free Software Foundation, Inc.
Copyright (C) 1995, 96, 97, 98, 99, 2000,2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
@ -32,14 +32,6 @@
#include <limits.h>
#include <assert.h>
#ifndef UNUSED
# if __GNUC__ >= 2
# define UNUSED __attribute__ ((__unused__))
# else
# define UNUSED
# endif
#endif
#ifndef _
/* This is for other GNU distributions with internationalized messages.
When compiling libc, the _ macro is predefined. */
@ -93,11 +85,12 @@ volatile int _argp_hang;
static const struct argp_option argp_default_options[] =
{
{"help", '?', 0, 0, N_("Give this help list"), -1},
{"usage", OPT_USAGE, 0, 0, N_("Give a short usage message")},
{"program-name",OPT_PROGNAME,"NAME", OPTION_HIDDEN, N_("Set the program name")},
{"usage", OPT_USAGE, 0, 0, N_("Give a short usage message"), 0 },
{"program-name",OPT_PROGNAME,"NAME", OPTION_HIDDEN,
N_("Set the program name"), 0},
{"HANG", OPT_HANG, "SECS", OPTION_ARG_OPTIONAL | OPTION_HIDDEN,
N_("Hang for SECS seconds (default 3600)")},
{0, 0}
N_("Hang for SECS seconds (default 3600)"), 0 },
{0, 0, 0, 0, 0, 0}
};
static error_t
@ -114,7 +107,7 @@ argp_default_parser (int key, char *arg, struct argp_state *state)
break;
case OPT_PROGNAME: /* Set the program name. */
#if HAVE_PROGRAM_INVOCATION_NAME
#if HAVE_DECL_PROGRAM_INVOCATION_NAME
program_invocation_name = arg;
#endif
/* [Note that some systems only have PROGRAM_INVOCATION_SHORT_NAME (aka
@ -125,7 +118,7 @@ argp_default_parser (int key, char *arg, struct argp_state *state)
state->name = __argp_basename(arg);
#if HAVE_PROGRAM_INVOCATION_SHORT_NAME
#if HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME
program_invocation_short_name = state->name;
#endif
@ -157,7 +150,7 @@ static const struct argp argp_default_argp =
static const struct argp_option argp_version_options[] =
{
{"version", 'V', 0, 0, N_("Print program version"), -1},
{0, 0}
{0, 0, 0, 0, 0, 0 }
};
static error_t
@ -1021,6 +1014,8 @@ parser_parse_next (struct parser *parser, int *arg_ebadkey)
*arg_ebadkey = 1;
if (parser->first_nonopt != parser->last_nonopt)
{
exchange(parser);
/* Start processing the arguments we skipped previously. */
parser->state.next = parser->first_nonopt;

View File

@ -33,14 +33,6 @@
#include "argp.h"
#ifndef UNUSED
# if __GNUC__ >= 2
# define UNUSED __attribute__ ((__unused__))
# else
# define UNUSED
# endif
#endif
#if !HAVE_ASPRINTF
#include <stdarg.h>
@ -81,15 +73,15 @@ const char *argp_program_version = "argp-test 1.0";
struct argp_option sub_options[] =
{
{"subopt1", 's', 0, 0, "Nested option 1"},
{"subopt2", 'S', 0, 0, "Nested option 2"},
{"subopt1", 's', 0, 0, "Nested option 1", 0},
{"subopt2", 'S', 0, 0, "Nested option 2", 0},
{ 0, 0, 0, 0, "Some more nested options:", 10},
{"subopt3", 'p', 0, 0, "Nested option 3"},
{"subopt3", 'p', 0, 0, "Nested option 3", 0},
{"subopt4", 'q', 0, 0, "Nested option 4", 1},
{0}
{0, 0, 0, 0, 0, 0}
};
static const char sub_args_doc[] = "STRING...\n-";
@ -128,7 +120,7 @@ is preceded by a blank line).");
}
static struct argp sub_argp = {
sub_options, sub_parse_opt, sub_args_doc, sub_doc, 0, sub_help_filter
sub_options, sub_parse_opt, sub_args_doc, sub_doc, 0, sub_help_filter, 0
};
/* Structure used to communicate with the parsing functions. */
@ -143,26 +135,26 @@ struct params
struct argp_option options[] =
{
{"pid", 'p', "PID", 0, "List the process PID"},
{"pgrp", OPT_PGRP,"PGRP",0, "List processes in the process group PGRP"},
{"no-parent", 'P', 0, 0, "Include processes without parents"},
{0, 'x', 0, OPTION_ALIAS},
{"pid", 'p', "PID", 0, "List the process PID", 0},
{"pgrp", OPT_PGRP,"PGRP",0, "List processes in the process group PGRP", 0},
{"no-parent", 'P', 0, 0, "Include processes without parents", 0},
{0, 'x', 0, OPTION_ALIAS, NULL, 0},
{"all-fields",'Q', 0, 0, "Don't elide unusable fields (normally"
" if there's some reason ps can't"
" print a field for any process, it's"
" removed from the output entirely)" },
{"reverse", 'r', 0, 0, "Reverse the order of any sort"},
{"gratuitously-long-reverse-option", 0, 0, OPTION_ALIAS},
" removed from the output entirely)", 0},
{"reverse", 'r', 0, 0, "Reverse the order of any sort", 0},
{"gratuitously-long-reverse-option", 0, 0, OPTION_ALIAS, NULL, 0},
{"session", OPT_SESS,"SID", OPTION_ARG_OPTIONAL,
"Add the processes from the session"
" SID (which defaults to the sid of"
" the current process)" },
" the current process)", 0},
{0,0,0,0, "Here are some more options:"},
{"foonly", 'f', "ZOT", OPTION_ARG_OPTIONAL, "Glork a foonly"},
{"zaza", 'z', 0, 0, "Snit a zar"},
{0,0,0,0, "Here are some more options:", 0},
{"foonly", 'f', "ZOT", OPTION_ARG_OPTIONAL, "Glork a foonly", 0},
{"zaza", 'z', 0, 0, "Snit a zar", 0},
{0}
{0, 0, 0, 0, 0, 0}
};
static const char args_doc[] = "STRING";
@ -242,9 +234,12 @@ help_filter (int key, const char *text, void *input)
return new_text;
}
static struct argp_child argp_children[] = { { &sub_argp }, { 0 } };
static struct argp_child argp_children[] = {
{ &sub_argp, 0, 0, 0 }, { 0, 0, 0, 0 }
};
static struct argp argp = {
options, parse_opt, args_doc, doc, argp_children, help_filter
options, parse_opt, args_doc, doc, argp_children, help_filter, 0
};
int

7
argp.h
View File

@ -1,5 +1,5 @@
/* Hierarchial argument parsing.
Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
Copyright (C) 1995, 96, 97, 98, 99, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
@ -40,8 +40,9 @@ typedef int error_t;
# define __error_t_defined
#endif
/* FIXME: We could use a configure test to check for __attribute__,
* just like lsh does. */
/* NOTE: We can't use the autoconf tests, since this is supposed to be
an installed header file and argp's config.h is of course not
installed. */
#ifndef PRINTF_STYLE
# if __GNUC__ >= 2
# define PRINTF_STYLE(f, a) __attribute__ ((__format__ (__printf__, f, a)))

View File

@ -1,91 +1,154 @@
/* config.h.in. Generated automatically from configure.in by autoheader. */
/* config.h.in. Generated from configure.ac by autoheader. */
/* Define if using alloca.c. */
#undef C_ALLOCA
/* Define to empty if the keyword does not work. */
#undef const
/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
This function is required for alloca.c support on those systems. */
/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
systems. This function is required for `alloca.c' support on those systems.
*/
#undef CRAY_STACKSEG_END
/* Define if you have alloca, as a function or macro. */
/* Define to 1 if using `alloca.c'. */
#undef C_ALLOCA
/* Define to 1 if you have `alloca', as a function or macro. */
#undef HAVE_ALLOCA
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
*/
#undef HAVE_ALLOCA_H
/* Define if you don't have vprintf but do have _doprnt. */
#undef HAVE_DOPRNT
/* Define if you have the vprintf function. */
#undef HAVE_VPRINTF
/* Define as __inline if that's what the C compiler calls it. */
#undef inline
/* Define to `unsigned' if <sys/types.h> doesn't define. */
#undef size_t
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
automatically deduced at run-time.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown
*/
#undef STACK_DIRECTION
/* Define if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Global variables needed by argp */
#undef HAVE_PROGRAM_INVOCATION_NAME
#undef HAVE_PROGRAM_INVOCATION_SHORT_NAME
/* Define if you have the asprintf function. */
/* Define to 1 if you have the `asprintf' function. */
#undef HAVE_ASPRINTF
/* Define if you have the flockfile function. */
/* Define to 1 if you have the declaration of `program_invocation_name', and
to 0 if you don't. */
#undef HAVE_DECL_PROGRAM_INVOCATION_NAME
/* Define to 1 if you have the declaration of `program_invocation_short_name',
and to 0 if you don't. */
#undef HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME
/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
#undef HAVE_DOPRNT
/* Define to 1 if you have the `flockfile' function. */
#undef HAVE_FLOCKFILE
/* Define if you have the fputs_unlocked function. */
/* Define to 1 if you have the `fputs_unlocked' function. */
#undef HAVE_FPUTS_UNLOCKED
/* Define if you have the fwrite_unlocked function. */
/* Define to 1 if you have the `fwrite_unlocked' function. */
#undef HAVE_FWRITE_UNLOCKED
/* Define if you have the mempcpy function. */
#undef HAVE_MEMPCPY
/* Define if the compiler understands __attribute__ */
#undef HAVE_GCC_ATTRIBUTE
/* Define if you have the putc_unlocked function. */
#undef HAVE_PUTC_UNLOCKED
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define if you have the strchrnul function. */
#undef HAVE_STRCHRNUL
/* Define if you have the strdup function. */
#undef HAVE_STRDUP
/* Define if you have the strerror function. */
#undef HAVE_STRERROR
/* Define if you have the strndup function. */
#undef HAVE_STRNDUP
/* Define if you have the <limits.h> header file. */
/* Define to 1 if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
/* Define if you have the <malloc.h> header file. */
/* Define to 1 if you have the <malloc.h> header file. */
#undef HAVE_MALLOC_H
/* Define if you have the <unistd.h> header file. */
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the `mempcpy' function. */
#undef HAVE_MEMPCPY
/* Define to 1 if you have the `putc_unlocked' function. */
#undef HAVE_PUTC_UNLOCKED
/* 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 to 1 if you have the `strchrnul' function. */
#undef HAVE_STRCHRNUL
/* Define to 1 if you have the `strdup' function. */
#undef HAVE_STRDUP
/* Define to 1 if you have the `strerror' function. */
#undef HAVE_STRERROR
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the `strndup' function. */
#undef HAVE_STRNDUP
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if you have the `vprintf' function. */
#undef HAVE_VPRINTF
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
automatically deduced at run-time.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown */
#undef STACK_DIRECTION
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Version number of package */
#undef VERSION
/* Enable GNU extensions on systems that have them. */
#ifndef _GNU_SOURCE
# undef _GNU_SOURCE
#endif
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
/* Define as `__inline' if that's what the C compiler calls it, or to nothing
if it is not supported. */
#undef inline
/* Define to `unsigned' if <sys/types.h> does not define. */
#undef size_t
#if __GNUC__ && HAVE_GCC_ATTRIBUTE
# define NORETURN __attribute__ ((__noreturn__))
# define PRINTF_STYLE(f, a) __attribute__ ((__format__ (__printf__, f, a)))
# define UNUSED __attribute__ ((__unused__))
#else
# define NORETURN
# define PRINTF_STYLE(f, a)
# define UNUSED
#endif

6805
configure vendored

File diff suppressed because it is too large Load Diff

96
configure.ac Normal file
View File

@ -0,0 +1,96 @@
dnl Process this file with autoconf to produce a configure script.
dnl This configure.ac is only for building a standalone argp library.
AC_PREREQ(2.54)
AC_INIT(argp-ba.c)
AM_INIT_AUTOMAKE(argp, standalone-1.2)
AM_CONFIG_HEADER(config.h)
# GNU libc defaults to supplying the ISO C library functions only. The
# _GNU_SOURCE define enables these extensions, in particular we want
# errno.h to declare program_invocation_name. Enable it on all
# systems; no problems have been reported with it so far.
AC_GNU_SOURCE
# Checks for programs.
AC_PROG_CC
AC_PROG_MAKE_SET
AC_PROG_RANLIB
AM_PROG_CC_STDC
if test "x$am_cv_prog_cc_stdc" = xno ; then
AC_ERROR([the C compiler doesn't handle ANSI-C])
fi
# Checks for libraries.
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(limits.h malloc.h unistd.h)
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
LSH_GCC_ATTRIBUTES
# Checks for library functions.
AC_FUNC_ALLOCA
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(strerror)
AC_REPLACE_FUNCS(mempcpy strndup strchrnul)
dnl ARGP_CHECK_FUNC(includes, function-call [, if-found [, if-not-found]])
AC_DEFUN([ARGP_CHECK_FUNC],
[AS_VAR_PUSHDEF([ac_func], m4_substr([$2], 0, m4_index([$2], [(])))
AS_VAR_PUSHDEF([ac_var], [ac_cv_func_call_]ac_func)
AH_TEMPLATE(AS_TR_CPP(HAVE_[]ac_func),
[Define to 1 if you have the `]ac_func[' function.])
AC_CACHE_CHECK([for $2], ac_var,
[AC_TRY_LINK([$1], [$2],
[AS_VAR_SET(ac_var, yes)],
[AS_VAR_SET(ac_var, no)])])
if test AS_VAR_GET(ac_var) = yes ; then
ifelse([$3],,
[AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_[]ac_func))],
[$3
])
else
ifelse([$4],, true, [$4])
fi
AS_VAR_POPDEF([ac_var])
AS_VAR_POPDEF([ac_func])
])
# At least on freebsd, putc_unlocked is a macro, so the standard
# AC_CHECK_FUNCS doesn't work well.
ARGP_CHECK_FUNC([#include <stdio.h>], [putc_unlocked('x', stdout)])
AC_CHECK_FUNCS(flockfile)
AC_CHECK_FUNCS(fputs_unlocked fwrite_unlocked)
# Used only by argp-test.c, so don't use AC_REPLACE_FUNCS.
AC_CHECK_FUNCS(strdup asprintf)
AC_CHECK_DECLS([program_invocation_name, program_invocation_short_name],
[], [], [[#include <errno.h>]])
# Set these flags *last*, or else the test programs won't compile
if test x$GCC = xyes ; then
# Using -ggdb3 makes (some versions of) Redhat's gcc-2.96 dump core
if "$CC" --version | grep '^2\.96$' 1>/dev/null 2>&1; then
true
else
CFLAGS="$CFLAGS -ggdb3"
fi
CFLAGS="$CFLAGS -Wall -W \
-Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes \
-Waggregate-return \
-Wpointer-arith -Wbad-function-cast -Wnested-externs"
fi
CPPFLAGS="$CPPFLAGS -I$srcdir"
AC_OUTPUT(Makefile testsuite/Makefile)

View File

@ -1,66 +0,0 @@
dnl Process this file with autoconf to produce a configure script.
dnl This configure.in is only for building a standalone argp library.
AC_INIT(argp-ba.c)
AM_INIT_AUTOMAKE(argp, standalone-1.1)
AM_CONFIG_HEADER(config.h)
# GNU libc defaults to supplying the ISO C library functions only. The
# _GNU_SOURCE define enables these extensions, in particular we want
# errno.h to declare program_invocation_name. Enable it on all
# systems; no problems have been reported with it so far.
CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
dnl Checks for programs.
AC_PROG_CC
AC_PROG_MAKE_SET
AC_PROG_RANLIB
AM_PROG_CC_STDC
if test "x$am_cv_prog_cc_stdc" = xno ; then
AC_ERROR([the C compiler doesn't handle ANSI-C])
fi
dnl Checks for libraries.
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(limits.h malloc.h unistd.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
dnl Checks for library functions.
AC_FUNC_ALLOCA
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(strerror)
AC_REPLACE_FUNCS(mempcpy strndup strchrnul)
AC_CHECK_FUNCS(flockfile putc_unlocked)
AC_CHECK_FUNCS(fputs_unlocked fwrite_unlocked)
dnl Used only by argp-test.c, so don't use AC_REPLACE_FUNCS.
AC_CHECK_FUNCS(strdup asprintf)
ARGP_CHECK_VAR(program_invocation_name, [#include <errno.h>])
ARGP_CHECK_VAR(program_invocation_short_name, [#include <errno.h>])
# Set these flags *last*, or else the test programs won't compile
if test x$GCC = xyes ; then
CFLAGS="$CFLAGS -ggdb3 -Wall -W \
-Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes \
-Waggregate-return \
-Wpointer-arith -Wbad-function-cast -Wnested-externs"
fi
CPPFLAGS="$CPPFLAGS -I$srcdir"
AC_SUBST(LIBOBJS)
AC_OUTPUT(Makefile)

411
depcomp Executable file
View File

@ -0,0 +1,411 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
# Copyright 1999, 2000 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# 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 Alexandre Oliva <oliva@dcc.unicamp.br>.
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
fi
# `libtool' can also be set to `yes' or `no'.
depfile=${depfile-`echo "$object" | sed 's,\([^/]*\)$,.deps/\1,;s/\.\([^.]*\)$/.P\1/'`}
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
# Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case
# here, because this file can only contain one case statement.
if test "$depmode" = hp; then
# HP compiler uses -M and no extra arg.
gccflag=-M
depmode=gcc
fi
if test "$depmode" = dashXmstdout; then
# This is just like dashmstdout with a different argument.
dashmflag=-xM
depmode=dashmstdout
fi
case "$depmode" in
gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm.
"$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
mv "$tmpdepfile" "$depfile"
;;
gcc)
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
## -MM, not -M (despite what the docs say).
## - Using -M directly means running the compiler twice (even worse
## than renaming).
if test -z "$gccflag"; then
gccflag=-MD,
fi
"$@" -Wp,"$gccflag$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
## The second -e expression handles DOS-style file names with drive letters.
sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the `deleted header file' problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly.
tr ' ' '
' < "$tmpdepfile" |
## Some versions of gcc put a space before the `:'. On the theory
## that the space means something, we add a space to the output as
## well.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
sgi)
if test "$libtool" = yes; then
"$@" "-Wp,-MDupdate,$tmpdepfile"
else
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile"
# Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
# the IRIX cc adds comments like `#:fec' to the end of the
# dependency line.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
tr '
' ' ' >> $depfile
echo >> $depfile
# The second pass generates a dummy entry for each header file.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> $depfile
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
aix)
# The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. This file always lives in the current directory.
# Also, the AIX compiler puts `$object:' at the start of each line;
# $object doesn't have directory information.
stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'`
tmpdepfile="$stripped.u"
outname="$stripped.o"
if test "$libtool" = yes; then
"$@" -Wc,-M
else
"$@" -M
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
if test -f "$tmpdepfile"; then
# Each line is of the form `foo.o: dependent.h'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
tru64)
# The Tru64 AIX compiler uses -MD to generate dependencies as a side
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
# dependencies in `foo.d' instead, so we check for that too.
# Subdirectories are respected.
tmpdepfile1="$object.d"
tmpdepfile2=`echo "$object" | sed -e 's/.o$/.d/'`
if test "$libtool" = yes; then
"$@" -Wc,-MD
else
"$@" -MD
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2"
exit $stat
fi
if test -f "$tmpdepfile1"; then
tmpdepfile="$tmpdepfile1"
else
tmpdepfile="$tmpdepfile2"
fi
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
# That's a space and a tab in the [].
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
#nosideeffect)
# This comment above is used by automake to tell side-effect
# dependency tracking mechanisms from slower ones.
dashmstdout)
# Important note: in order to support this mode, a compiler *must*
# always write the proprocessed file to stdout, regardless of -o,
# because we must use -o when running libtool.
test -z "$dashmflag" && dashmflag=-M
( IFS=" "
case " $* " in
*" --mode=compile "*) # this is libtool, let us make it quiet
for arg
do # cycle over the arguments
case "$arg" in
"--mode=compile")
# insert --quiet before "--mode=compile"
set fnord "$@" --quiet
shift # fnord
;;
esac
set fnord "$@" "$arg"
shift # fnord
shift # "$arg"
done
;;
esac
"$@" $dashmflag | sed 's:^[^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
) &
proc=$!
"$@"
stat=$?
wait "$proc"
if test "$stat" != 0; then exit $stat; fi
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
tr ' ' '
' < "$tmpdepfile" | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
dashXmstdout)
# This case only exists to satisfy depend.m4. It is never actually
# run, as this mode is specially recognized in the preamble.
exit 1
;;
makedepend)
# X makedepend
(
shift
cleared=no
for arg in "$@"; do
case $cleared in no)
set ""; shift
cleared=yes
esac
case "$arg" in
-D*|-I*)
set fnord "$@" "$arg"; shift;;
-*)
;;
*)
set fnord "$@" "$arg"; shift;;
esac
done
obj_suffix="`echo $object | sed 's/^.*\././'`"
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} 2>/dev/null -o"$obj_suffix" -f"$tmpdepfile" "$@"
) &
proc=$!
"$@"
stat=$?
wait "$proc"
if test "$stat" != 0; then exit $stat; fi
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
tail +3 "$tmpdepfile" | tr ' ' '
' | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak
;;
cpp)
# Important note: in order to support this mode, a compiler *must*
# always write the proprocessed file to stdout, regardless of -o,
# because we must use -o when running libtool.
( IFS=" "
case " $* " in
*" --mode=compile "*)
for arg
do # cycle over the arguments
case $arg in
"--mode=compile")
# insert --quiet before "--mode=compile"
set fnord "$@" --quiet
shift # fnord
;;
esac
set fnord "$@" "$arg"
shift # fnord
shift # "$arg"
done
;;
esac
"$@" -E |
sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
sed '$ s: \\$::' > "$tmpdepfile"
) &
proc=$!
"$@"
stat=$?
wait "$proc"
if test "$stat" != 0; then exit $stat; fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvisualcpp)
# Important note: in order to support this mode, a compiler *must*
# always write the proprocessed file to stdout, regardless of -o,
# because we must use -o when running libtool.
( IFS=" "
case " $* " in
*" --mode=compile "*)
for arg
do # cycle over the arguments
case $arg in
"--mode=compile")
# insert --quiet before "--mode=compile"
set fnord "$@" --quiet
shift # fnord
;;
esac
set fnord "$@" "$arg"
shift # fnord
shift # "$arg"
done
;;
esac
"$@" -E |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
) &
proc=$!
"$@"
stat=$?
wait "$proc"
if test "$stat" != 0; then exit $stat; fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
echo " " >> "$depfile"
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
none)
exec "$@"
;;
*)
echo "Unknown depmode $depmode" 1>&2
exit 1
;;
esac
exit 0

View File

@ -1,27 +1,17 @@
#!/bin/sh
#! /bin/sh
#
# $Id: install-sh,v 1.1 1999/01/17 15:53:42 nisse Exp $
#
# install - install a program, script, or datafile
# This comes from X11R5 (mit/util/scripts/install.sh).
#
# Copyright 1991 by the Massachusetts Institute of Technology
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of M.I.T. not be used in advertising or
# publicity pertaining to distribution of the software without specific,
# written prior permission. M.I.T. makes no representations about the
# suitability of this software for any purpose. It is provided "as is"
# without express or implied warranty.
# This comes from X11R5.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch. It can only install one file at a time, a restriction
# shared with many OS's install programs.
# from scratch.
#
# set DOITPROG to echo to test this script
@ -118,7 +108,6 @@ if [ x"$dir_arg" != x ]; then
if [ -d $dst ]; then
instcmd=:
chmodcmd=""
else
instcmd=mkdir
fi
@ -249,3 +238,4 @@ fi &&
exit 0

109
missing
View File

@ -1,7 +1,7 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
# Copyright (C) 1996, 1997 Free Software Foundation, Inc.
# Franc,ois Pinard <pinard@iro.umontreal.ca>, 1996.
# Copyright 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -18,11 +18,37 @@
# 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.
if test $# -eq 0; then
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
fi
run=:
# In the cases where this matters, `missing' is being run in the
# srcdir already.
if test -f configure.ac; then
configure_ac=configure.ac
else
configure_ac=configure.in
fi
case "$1" in
--run)
# Try to run requested program, and just exit if it succeeds.
run=
shift
"$@" && exit 0
;;
esac
# If it does not exist, or fails to run (possibly an outdated version),
# try to emulate it.
case "$1" in
-h|--h|--he|--hel|--help)
@ -35,6 +61,7 @@ error status if there is no known handling for PROGRAM.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
--run try to run the given command, and emulate it if it fails
Supported PROGRAM values:
aclocal touch file \`aclocal.m4'
@ -43,13 +70,15 @@ Supported PROGRAM values:
automake touch all \`Makefile.in' files
bison create \`y.tab.[ch]', if possible, from existing .[ch]
flex create \`lex.yy.c', if possible, from existing .c
help2man touch the output file
lex create \`lex.yy.c', if possible, from existing .c
makeinfo touch the output file
tar try tar, gnutar, gtar, then tar without non-portable flags
yacc create \`y.tab.[ch]', if possible, from existing .[ch]"
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing - GNU libit 0.0"
echo "missing 0.3 - GNU automake"
;;
-*)
@ -61,7 +90,7 @@ Supported PROGRAM values:
aclocal)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`acinclude.m4' or \`configure.in'. You might want
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
to install the \`Automake' and \`Perl' packages. Grab them from
any GNU archive site."
touch aclocal.m4
@ -70,7 +99,7 @@ WARNING: \`$1' is missing on your system. You should only need it if
autoconf)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`configure.in'. You might want to install the
you modified \`${configure_ac}'. You might want to install the
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
archive site."
touch configure
@ -79,10 +108,10 @@ WARNING: \`$1' is missing on your system. You should only need it if
autoheader)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`acconfig.h' or \`configure.in'. You might want
you modified \`acconfig.h' or \`${configure_ac}'. You might want
to install the \`Autoconf' and \`GNU m4' packages. Grab them
from any GNU archive site."
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' configure.in`
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
@ -98,7 +127,7 @@ WARNING: \`$1' is missing on your system. You should only need it if
automake)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'.
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
You might want to install the \`Automake' and \`Perl' packages.
Grab them from any GNU archive site."
find . -type f -name Makefile.am -print |
@ -159,7 +188,32 @@ WARNING: \`$1' is missing on your system. You should only need it if
fi
;;
help2man)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified a dependency of a manual page. You may need the
\`Help2man' package in order for those modifications to take
effect. You can get \`Help2man' from any GNU archive site."
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
if test -z "$file"; then
file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
fi
if [ -f "$file" ]; then
touch $file
else
test -z "$file" || exec >$file
echo ".ab help2man is required to generate this page"
exit 1
fi
;;
makeinfo)
if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then
# We have makeinfo, but it failed.
exit 1
fi
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified a \`.texi' or \`.texinfo' file, or any other file
@ -175,6 +229,45 @@ WARNING: \`$1' is missing on your system. You should only need it if
touch $file
;;
tar)
shift
if test -n "$run"; then
echo 1>&2 "ERROR: \`tar' requires --run"
exit 1
fi
# We have already tried tar in the generic part.
# Look for gnutar/gtar before invocation to avoid ugly error
# messages.
if (gnutar --version > /dev/null 2>&1); then
gnutar ${1+"$@"} && exit 0
fi
if (gtar --version > /dev/null 2>&1); then
gtar ${1+"$@"} && exit 0
fi
firstarg="$1"
if shift; then
case "$firstarg" in
*o*)
firstarg=`echo "$firstarg" | sed s/o//`
tar "$firstarg" ${1+"$@"} && exit 0
;;
esac
case "$firstarg" in
*h*)
firstarg=`echo "$firstarg" | sed s/h//`
tar "$firstarg" ${1+"$@"} && exit 0
;;
esac
fi
echo 1>&2 "\
WARNING: I can't seem to be able to run \`tar' with the given arguments.
You may want to install GNU tar or Free paxutils, or check the
command line arguments."
exit 1
;;
*)
echo 1>&2 "\
WARNING: \`$1' is needed, and you do not seem to have it handy on your

15
testsuite/Makefile.am Normal file
View File

@ -0,0 +1,15 @@
TS_SH = ex1-test permute-test
TS_PROGS =
TS_ALL = $(TS_PROGS) $(TS_SH)
noinst_PROGRAMS = $(TS_PROGS) ex1 ex3 ex4
LDADD = ../libargp.a
EXTRA_DIST = $(TS_SH) run-tests
CLEANFILES = test.out
.PHONY: check
check: $(TS_ALL) $(srcdir)/run-tests
srcdir="$(srcdir)" $(srcdir)/run-tests $(TS_ALL)

392
testsuite/Makefile.in Normal file
View File

@ -0,0 +1,392 @@
# Makefile.in generated by automake 1.7.3 from Makefile.am.
# @configure_input@
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
ACLOCAL = @ACLOCAL@
ALLOCA = @ALLOCA@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
ac_ct_CC = @ac_ct_CC@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
bindir = @bindir@
build_alias = @build_alias@
datadir = @datadir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
TS_SH = ex1-test permute-test
TS_PROGS =
TS_ALL = $(TS_PROGS) $(TS_SH)
noinst_PROGRAMS = $(TS_PROGS) ex1 ex3 ex4
LDADD = ../libargp.a
EXTRA_DIST = $(TS_SH) run-tests
CLEANFILES = test.out
subdir = testsuite
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
noinst_PROGRAMS = ex1$(EXEEXT) ex3$(EXEEXT) ex4$(EXEEXT)
PROGRAMS = $(noinst_PROGRAMS)
ex1_SOURCES = ex1.c
ex1_OBJECTS = ex1.$(OBJEXT)
ex1_LDADD = $(LDADD)
ex1_DEPENDENCIES = ../libargp.a
ex1_LDFLAGS =
ex3_SOURCES = ex3.c
ex3_OBJECTS = ex3.$(OBJEXT)
ex3_LDADD = $(LDADD)
ex3_DEPENDENCIES = ../libargp.a
ex3_LDFLAGS =
ex4_SOURCES = ex4.c
ex4_OBJECTS = ex4.$(OBJEXT)
ex4_LDADD = $(LDADD)
ex4_DEPENDENCIES = ../libargp.a
ex4_LDFLAGS =
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/ex1.Po ./$(DEPDIR)/ex3.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/ex4.Po
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
DIST_SOURCES = ex1.c ex3.c ex4.c
DIST_COMMON = Makefile.am Makefile.in
SOURCES = ex1.c ex3.c ex4.c
all: all-am
.SUFFIXES:
.SUFFIXES: .c .o .obj
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu testsuite/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
clean-noinstPROGRAMS:
-test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
ex1$(EXEEXT): $(ex1_OBJECTS) $(ex1_DEPENDENCIES)
@rm -f ex1$(EXEEXT)
$(LINK) $(ex1_LDFLAGS) $(ex1_OBJECTS) $(ex1_LDADD) $(LIBS)
ex3$(EXEEXT): $(ex3_OBJECTS) $(ex3_DEPENDENCIES)
@rm -f ex3$(EXEEXT)
$(LINK) $(ex3_LDFLAGS) $(ex3_OBJECTS) $(ex3_LDADD) $(LIBS)
ex4$(EXEEXT): $(ex4_OBJECTS) $(ex4_DEPENDENCIES)
@rm -f ex4$(EXEEXT)
$(LINK) $(ex4_LDFLAGS) $(ex4_OBJECTS) $(ex4_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT) core *.core
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ex1.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ex3.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ex4.Po@am__quote@
distclean-depend:
-rm -rf ./$(DEPDIR)
.c.o:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
@am__fastdepCC_TRUE@ fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
.c.obj:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \
@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
@am__fastdepCC_TRUE@ fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`
uninstall-info-am:
ETAGS = etags
ETAGSFLAGS =
CTAGS = ctags
CTAGSFLAGS =
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = ..
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkinstalldirs) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(PROGRAMS)
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-noinstPROGRAMS mostlyclean-am
distclean: distclean-am
distclean-am: clean-am distclean-compile distclean-depend \
distclean-generic distclean-tags
dvi: dvi-am
dvi-am:
info: info-am
info-am:
install-data-am:
install-exec-am:
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-info-am
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
clean-noinstPROGRAMS ctags distclean distclean-compile \
distclean-depend distclean-generic distclean-tags distdir dvi \
dvi-am info info-am install install-am install-data \
install-data-am install-exec install-exec-am install-info \
install-info-am install-man install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
uninstall-am uninstall-info-am
.PHONY: check
check: $(TS_ALL) $(srcdir)/run-tests
srcdir="$(srcdir)" $(srcdir)/run-tests $(TS_ALL)
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

18
testsuite/ex1-test Executable file
View File

@ -0,0 +1,18 @@
#! /bin/sh
# Success with no args
./ex1 || exit 1
# Fail with args
if ./ex1 foo 2>/dev/null ; then exit 1 ; fi
# Respond to --help
./ex1 --help >/dev/null || exit 1
# Not using ARGP_LONG_ONLY
if ./ex1 -help 2>/dev/null ; then exit 1 ; fi
(./ex1 --help | grep Usage: >/dev/null ) || exit 1
exit 0

16
testsuite/ex1.c Normal file
View File

@ -0,0 +1,16 @@
/* Argp example #1 - a minimal program using argp */
/* This is (probably) the smallest possible program that
uses argp. It won't do much except give an error
messages and exit when there are any arguments, and print
a (rather pointless) messages for -help. */
#include <argp.h>
#include <stdlib.h>
int main (int argc, char **argv)
{
argp_parse (0, argc, argv, 0, 0, 0);
exit (0);
}

154
testsuite/ex3.c Normal file
View File

@ -0,0 +1,154 @@
/* Argp example #3 - a program with options and arguments using argp */
/* This program uses the same features as example 2, and uses options and
arguments.
We now use the first four fields in ARGP, so here's a description of them:
OPTIONS - A pointer to a vector of struct argp_option (see below)
PARSER - A function to parse a single option, called by argp
ARGS_DOC - A string describing how the non-option arguments should look
DOC - A descriptive string about this program; if it contains a
vertical tab character (\v), the part after it will be
printed *following* the options
The function PARSER takes the following arguments:
KEY - An integer specifying which option this is (taken
from the KEY field in each struct argp_option), or
a special key specifying something else; the only
special keys we use here are ARGP_KEY_ARG, meaning
a non-option argument, and ARGP_KEY_END, meaning
that all arguments have been parsed
ARG - For an option KEY, the string value of its
argument, or NULL if it has none
STATE- A pointer to a struct argp_state, containing
various useful information about the parsing state; used here
are the INPUT field, which reflects the INPUT argument to
argp_parse, and the ARG_NUM field, which is the number of the
current non-option argument being parsed
It should return either 0, meaning success, ARGP_ERR_UNKNOWN, meaning the
given KEY wasn't recognized, or an errno value indicating some other
error.
Note that in this example, main uses a structure to communicate with the
parse_opt function, a pointer to which it passes in the INPUT argument to
argp_parse. Of course, it's also possible to use global variables
instead, but this is somewhat more flexible.
The OPTIONS field contains a pointer to a vector of struct argp_option's;
that structure has the following fields (if you assign your option
structures using array initialization like this example, unspecified
fields will be defaulted to 0, and need not be specified):
NAME - The name of this option's long option (may be zero)
KEY - The KEY to pass to the PARSER function when parsing this option,
*and* the name of this option's short option, if it is a
printable ascii character
ARG - The name of this option's argument, if any
FLAGS - Flags describing this option; some of them are:
OPTION_ARG_OPTIONAL - The argument to this option is optional
OPTION_ALIAS - This option is an alias for the
previous option
OPTION_HIDDEN - Don't show this option in -help output
DOC - A documentation string for this option, shown in -help output
An options vector should be terminated by an option with all fields zero. */
#include <argp.h>
#include <stdlib.h>
const char *argp_program_version =
"argp-ex3 1.0";
const char *argp_program_bug_address =
"<bug-gnu-utils@gnu.org>";
/* Program documentation. */
static char doc[] =
"Argp example #3 -- a program with options and arguments using argp";
/* A description of the arguments we accept. */
static char args_doc[] = "ARG1 ARG2";
/* The options we understand. */
static struct argp_option options[] = {
{"verbose", 'v', 0, 0, "Produce verbose output", 0},
{"quiet", 'q', 0, 0, "Don't produce any output", 0},
{"silent", 's', 0, OPTION_ALIAS, 0, 0},
{"output", 'o', "FILE", 0,
"Output to FILE instead of standard output", 0},
{0, 0, 0, 0, 0, 0}
};
/* Used by `main' to communicate with `parse_opt'. */
struct arguments
{
char *args[2]; /* ARG1 & ARG2 */
int silent, verbose;
char *output_file;
};
/* Parse a single option. */
static error_t
parse_opt (int key, char *arg, struct argp_state *state)
{
/* Get the INPUT argument from `argp_parse', which we
know is a pointer to our arguments structure. */
struct arguments *arguments = state->input;
switch (key)
{
case 'q': case 's':
arguments->silent = 1;
break;
case 'v':
arguments->verbose = 1;
break;
case 'o':
arguments->output_file = arg;
break;
case ARGP_KEY_ARG:
if (state->arg_num >= 2)
/* Too many arguments. */
argp_usage (state);
arguments->args[state->arg_num] = arg;
break;
case ARGP_KEY_END:
if (state->arg_num < 2)
/* Not enough arguments. */
argp_usage (state);
break;
default:
return ARGP_ERR_UNKNOWN;
}
return 0;
}
/* Our argp parser. */
static struct argp argp = { options, parse_opt, args_doc, doc, 0, 0, 0 };
int main (int argc, char **argv)
{
struct arguments arguments;
/* Default values. */
arguments.silent = 0;
arguments.verbose = 0;
arguments.output_file = "-";
/* Parse our arguments; every option seen by `parse_opt' will
be reflected in `arguments'. */
argp_parse (&argp, argc, argv, 0, 0, &arguments);
printf ("ARG1 = %s\nARG2 = %s\nOUTPUT_FILE = %s\n"
"VERBOSE = %s\nSILENT = %s\n",
arguments.args[0], arguments.args[1],
arguments.output_file,
arguments.verbose ? "yes" : "no",
arguments.silent ? "yes" : "no");
exit (0);
}

172
testsuite/ex4.c Normal file
View File

@ -0,0 +1,172 @@
/* Argp example #4 - a program with somewhat more complicated options */
/* This program uses the same features as example 3, but has more
options, and somewhat more structure in the -help output. It
also shows how you can `steal' the remainder of the input
arguments past a certain point, for programs that accept a
list of items. It also shows the special argp KEY value
ARGP_KEY_NO_ARGS, which is only given if no non-option
arguments were supplied to the program.
For structuring the help output, two features are used,
*headers* which are entries in the options vector with the
first four fields being zero, and a two part documentation
string (in the variable DOC), which allows documentation both
before and after the options; the two parts of DOC are
separated by a vertical-tab character ('\v', or '\013'). By
convention, the documentation before the options is just a
short string saying what the program does, and that afterwards
is longer, describing the behavior in more detail. All
documentation strings are automatically filled for output,
although newlines may be included to force a line break at a
particular point. All documentation strings are also passed to
the `gettext' function, for possible translation into the
current locale. */
#include <stdlib.h>
#include <stdio.h>
#include <argp.h>
const char *argp_program_version =
"argp-ex4 1.0";
const char *argp_program_bug_address =
"<bug-gnu-utils@prep.ai.mit.edu>";
/* Program documentation. */
static char doc[] =
"Argp example #4 -- a program with somewhat more complicated\
options\
\vThis part of the documentation comes *after* the options;\
note that the text is automatically filled, but it's possible\
to force a line-break, e.g.\n<-- here.";
/* A description of the arguments we accept. */
static char args_doc[] = "ARG1 [STRING...]";
/* Keys for options without short-options. */
#define OPT_ABORT 1 /* -abort */
/* The options we understand. */
static struct argp_option options[] = {
{"verbose", 'v', 0, 0, "Produce verbose output", 0},
{"quiet", 'q', 0, 0, "Don't produce any output", 0},
{"silent", 's', 0, OPTION_ALIAS, 0, 0},
{"output", 'o', "FILE", 0,
"Output to FILE instead of standard output", 0},
{0,0,0,0, "The following options should be grouped together:", 0},
{"repeat", 'r', "COUNT", OPTION_ARG_OPTIONAL,
"Repeat the output COUNT (default 10) times", 0},
{"abort", OPT_ABORT, 0, 0, "Abort before showing any output", 0},
{0, 0, 0, 0, 0, 0}
};
/* Used by `main' to communicate with `parse_opt'. */
struct arguments
{
char *arg1; /* ARG1 */
char **strings; /* [STRING...] */
int silent, verbose, abort; /* `-s', `-v', `--abort' */
char *output_file; /* FILE arg to `--output' */
int repeat_count; /* COUNT arg to `--repeat' */
};
/* Parse a single option. */
static error_t
parse_opt (int key, char *arg, struct argp_state *state)
{
/* Get the `input' argument from `argp_parse', which we
know is a pointer to our arguments structure. */
struct arguments *arguments = state->input;
switch (key)
{
case 'q': case 's':
arguments->silent = 1;
break;
case 'v':
arguments->verbose = 1;
break;
case 'o':
arguments->output_file = arg;
break;
case 'r':
arguments->repeat_count = arg ? atoi (arg) : 10;
break;
case OPT_ABORT:
arguments->abort = 1;
break;
case ARGP_KEY_NO_ARGS:
argp_usage (state);
case ARGP_KEY_ARG:
/* Here we know that `state->arg_num == 0', since we
force argument parsing to end before any more arguments can
get here. */
arguments->arg1 = arg;
/* Now we consume all the rest of the arguments.
`state->next' is the index in `state->argv' of the
next argument to be parsed, which is the first STRING
we're interested in, so we can just use
`&state->argv[state->next]' as the value for
arguments->strings.
_In addition_, by setting `state->next' to the end
of the arguments, we can force argp to stop parsing here and
return. */
arguments->strings = &state->argv[state->next];
state->next = state->argc;
break;
default:
return ARGP_ERR_UNKNOWN;
}
return 0;
}
/* Our argp parser. */
static struct argp argp = { options, parse_opt, args_doc, doc, 0, 0, 0};
int main (int argc, char **argv)
{
int i, j;
struct arguments arguments;
/* Default values. */
arguments.silent = 0;
arguments.verbose = 0;
arguments.output_file = "-";
arguments.repeat_count = 1;
arguments.abort = 0;
/* Parse our arguments; every option seen by `parse_opt' will be
reflected in `arguments'. */
argp_parse (&argp, argc, argv, 0, 0, &arguments);
if (arguments.abort)
{
/* The glibc example used error (10, 0, "ABORTED"), but that's
not portable. */
fprintf(stderr, "ex4: ABORTED\n");
exit(10);
}
for (i = 0; i < arguments.repeat_count; i++)
{
printf ("ARG1 = %s\n", arguments.arg1);
printf ("STRINGS = ");
for (j = 0; arguments.strings[j]; j++)
printf (j == 0 ? "%s" : ", %s", arguments.strings[j]);
printf ("\n");
printf ("OUTPUT_FILE = %s\nVERBOSE = %s\nSILENT = %s\n",
arguments.output_file,
arguments.verbose ? "yes" : "no",
arguments.silent ? "yes" : "no");
}
exit (0);
}

24
testsuite/permute-test Executable file
View File

@ -0,0 +1,24 @@
#! /bin/sh
# Test the somewhat hairy permuting of arguments.
cat >test.out <<EOF
ARG1 = foo
ARG2 = bar
OUTPUT_FILE = -
VERBOSE = yes
SILENT = no
EOF
die () {
echo "$@" 1>&2
exit 1
}
for args in "-v foo bar" \
"-v -v foo bar" "-v foo -v bar" "-v foo bar -v" \
"foo -v bar -v" "foo bar -v -v" "foo -v -v bar" ; do
./ex3 $args | diff - test.out >/dev/null || die "Test failed with args $args"
done
exit 0

69
testsuite/run-tests Executable file
View File

@ -0,0 +1,69 @@
#! /bin/sh
failed=0
all=0
if [ -z "$srcdir" ] ; then
srcdir=`pwd`
fi
export srcdir
find_program () {
if [ -x "$1" ] ; then
echo "./$1"
else
echo "$srcdir/$1"
fi
}
env_program () {
if [ -x "$1" ] ; then
if "$1"; then : ; else
echo FAIL: $1
exit 1
fi
fi
}
test_program () {
testname=`basename "$1" -test`
"$1"
case "$?" in
0)
echo PASS: $testname
all=`expr $all + 1`
;;
77)
echo SKIP: $testname
;;
*)
echo FAIL: $testname
failed=`expr $failed + 1`
all=`expr $all + 1`
;;
esac
}
env_program `find_program setup-env`
if [ $# -eq 0 ] ; then
for f in *-test; do test_program "./$f"; done
else
for f in "$@" ; do test_program `find_program "$f"`; done
fi
if [ $failed -eq 0 ] ; then
banner="All $all tests passed"
else
banner="$failed of $all tests failed"
fi
dashes=`echo "$banner" | sed s/./=/g`
echo "$dashes"
echo "$banner"
echo "$dashes"
env_program `find_program teardown-env`
[ "$failed" -eq 0 ]