diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2015-10-04 11:22:56 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2015-10-04 11:22:56 +0300 |
commit | 2626d04d332dd87d4e6e9effe943dd6aa3d21cac (patch) | |
tree | 705737cb3eda7b80afaec1c0b22c620491e212e0 /awklib | |
parent | b08964cd1db8da56e2a16cebde05d493d4f6ae1b (diff) | |
parent | d992c45de5c007fc28a8e0cafec81bb9308a342c (diff) | |
download | gawk-2626d04d332dd87d4e6e9effe943dd6aa3d21cac.tar.gz |
Merge branch 'gawk-4.1-stable' (zOS updates included)
Diffstat (limited to 'awklib')
-rw-r--r-- | awklib/ChangeLog | 12 | ||||
-rw-r--r-- | awklib/Makefile.am | 20 | ||||
-rw-r--r-- | awklib/Makefile.in | 28 | ||||
-rw-r--r-- | awklib/eg/lib/grcat.c | 6 | ||||
-rw-r--r-- | awklib/eg/lib/pwcat.c | 10 |
5 files changed, 52 insertions, 24 deletions
diff --git a/awklib/ChangeLog b/awklib/ChangeLog index 791c25f6..eb9ffcd6 100644 --- a/awklib/ChangeLog +++ b/awklib/ChangeLog @@ -1,3 +1,15 @@ +2015-08-28 Daniel Richard G. <skunk@iSKUNK.ORG> + + * Makefile.am: Build pwcat.c and grcat.c with (copied) + source in the current directory, so that (1) we can use + Automake-generated build rules instead of rolling our own, and + (2) Automake doesn't then admonish us to enable subdir-objects + due to the source files being in another directory. + * Makefile.am: Make the $(srcdir)/stamp-eg rule depend + on gawktexi.in instead of the gawk.texi file that is generated + from same, so that the build doesn't break if the latter is + missing. + 2015-06-19 Arnold D. Robbins <arnold@skeeve.com> * extract.awk: Sync with current version in the doc. Thanks to diff --git a/awklib/Makefile.am b/awklib/Makefile.am index 27bb269f..902c1937 100644 --- a/awklib/Makefile.am +++ b/awklib/Makefile.am @@ -44,6 +44,8 @@ AUXAWK = passwd.awk group.awk nodist_grcat_SOURCES = grcat.c nodist_pwcat_SOURCES = pwcat.c +CLEANFILES = $(nodist_grcat_SOURCES) $(nodist_pwcat_SOURCES) + all: $(srcdir)/stamp-eg $(AUXPROGS) $(AUXAWK) install-exec-hook: $(AUXAWK) @@ -62,22 +64,24 @@ clean-local: rm -fr eg.old rm -fr grcat.dSYM pwcat.dSYM -$(srcdir)/stamp-eg: $(srcdir)/../doc/gawk.texi $(srcdir)/../doc/gawkinet.texi +$(srcdir)/stamp-eg: $(srcdir)/../doc/gawktexi.in $(srcdir)/../doc/gawkinet.texi cd $(srcdir) && \ rm -fr eg && \ rm -fr stamp-eg && \ - $(AWKPROG) -f ./extract.awk ../doc/gawk.texi ../doc/gawkinet.texi + $(AWKPROG) -f ./extract.awk ../doc/gawktexi.in ../doc/gawkinet.texi @echo 'some makes are stupid and will not check a directory' > $(srcdir)/stamp-eg @echo 'against a file, so this file is a place holder. gack.' >> $(srcdir)/stamp-eg -$(srcdir)/eg/lib/pwcat.c $(srcdir)/eg/lib/grcat.c \ -$(srcdir)/eg/lib/passwdawk.in $(srcdir)/eg/lib/groupawk.in: stamp-eg; @: +pwcat.c: $(srcdir)/eg/lib/pwcat.c + rm -f $@ + $(LN_S) $(srcdir)/eg/lib/pwcat.c . -pwcat$(EXEEXT): $(srcdir)/eg/lib/pwcat.c - $(COMPILE) $(srcdir)/eg/lib/pwcat.c $(LDFLAGS) -o $@ +grcat.c: $(srcdir)/eg/lib/grcat.c + rm -f $@ + $(LN_S) $(srcdir)/eg/lib/grcat.c . -grcat$(EXEEXT): $(srcdir)/eg/lib/grcat.c - $(COMPILE) $(srcdir)/eg/lib/grcat.c $(LDFLAGS) -o $@ +$(srcdir)/eg/lib/pwcat.c $(srcdir)/eg/lib/grcat.c $(srcdir)/eg/prog/igawk.sh \ +$(srcdir)/eg/lib/passwdawk.in $(srcdir)/eg/lib/groupawk.in: stamp-eg; @: passwd.awk: $(srcdir)/eg/lib/passwdawk.in sed 's;/usr/local/libexec/awk;$(pkglibexecdir);' < $(srcdir)/eg/lib/passwdawk.in > passwd.awk diff --git a/awklib/Makefile.in b/awklib/Makefile.in index be314945..597ba20b 100644 --- a/awklib/Makefile.in +++ b/awklib/Makefile.in @@ -335,6 +335,7 @@ AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) AUXAWK = passwd.awk group.awk nodist_grcat_SOURCES = grcat.c nodist_pwcat_SOURCES = pwcat.c +CLEANFILES = $(nodist_grcat_SOURCES) $(nodist_pwcat_SOURCES) all: all-am .SUFFIXES: @@ -411,6 +412,14 @@ uninstall-pkglibexecPROGRAMS: clean-pkglibexecPROGRAMS: -test -z "$(pkglibexec_PROGRAMS)" || rm -f $(pkglibexec_PROGRAMS) +grcat$(EXEEXT): $(grcat_OBJECTS) $(grcat_DEPENDENCIES) $(EXTRA_grcat_DEPENDENCIES) + @rm -f grcat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(grcat_OBJECTS) $(grcat_LDADD) $(LIBS) + +pwcat$(EXEEXT): $(pwcat_OBJECTS) $(pwcat_DEPENDENCIES) $(EXTRA_pwcat_DEPENDENCIES) + @rm -f pwcat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(pwcat_OBJECTS) $(pwcat_LDADD) $(LIBS) + mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -545,6 +554,7 @@ install-strip: mostlyclean-generic: clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) @@ -662,22 +672,24 @@ clean-local: rm -fr eg.old rm -fr grcat.dSYM pwcat.dSYM -$(srcdir)/stamp-eg: $(srcdir)/../doc/gawk.texi $(srcdir)/../doc/gawkinet.texi +$(srcdir)/stamp-eg: $(srcdir)/../doc/gawktexi.in $(srcdir)/../doc/gawkinet.texi cd $(srcdir) && \ rm -fr eg && \ rm -fr stamp-eg && \ - $(AWKPROG) -f ./extract.awk ../doc/gawk.texi ../doc/gawkinet.texi + $(AWKPROG) -f ./extract.awk ../doc/gawktexi.in ../doc/gawkinet.texi @echo 'some makes are stupid and will not check a directory' > $(srcdir)/stamp-eg @echo 'against a file, so this file is a place holder. gack.' >> $(srcdir)/stamp-eg -$(srcdir)/eg/lib/pwcat.c $(srcdir)/eg/lib/grcat.c \ -$(srcdir)/eg/lib/passwdawk.in $(srcdir)/eg/lib/groupawk.in: stamp-eg; @: +pwcat.c: $(srcdir)/eg/lib/pwcat.c + rm -f $@ + $(LN_S) $(srcdir)/eg/lib/pwcat.c . -pwcat$(EXEEXT): $(srcdir)/eg/lib/pwcat.c - $(COMPILE) $(srcdir)/eg/lib/pwcat.c $(LDFLAGS) -o $@ +grcat.c: $(srcdir)/eg/lib/grcat.c + rm -f $@ + $(LN_S) $(srcdir)/eg/lib/grcat.c . -grcat$(EXEEXT): $(srcdir)/eg/lib/grcat.c - $(COMPILE) $(srcdir)/eg/lib/grcat.c $(LDFLAGS) -o $@ +$(srcdir)/eg/lib/pwcat.c $(srcdir)/eg/lib/grcat.c $(srcdir)/eg/prog/igawk.sh \ +$(srcdir)/eg/lib/passwdawk.in $(srcdir)/eg/lib/groupawk.in: stamp-eg; @: passwd.awk: $(srcdir)/eg/lib/passwdawk.in sed 's;/usr/local/libexec/awk;$(pkglibexecdir);' < $(srcdir)/eg/lib/passwdawk.in > passwd.awk diff --git a/awklib/eg/lib/grcat.c b/awklib/eg/lib/grcat.c index 7d6b6a74..cf39083c 100644 --- a/awklib/eg/lib/grcat.c +++ b/awklib/eg/lib/grcat.c @@ -31,11 +31,11 @@ main(int argc, char **argv) int i; while ((g = getgrent()) != NULL) { -#ifdef ZOS_USS - printf("%s:%ld:", g->gr_name, (long) g->gr_gid); -#else +#ifdef HAVE_STRUCT_GROUP_GR_PASSWD printf("%s:%s:%ld:", g->gr_name, g->gr_passwd, (long) g->gr_gid); +#else + printf("%s:*:%ld:", g->gr_name, (long) g->gr_gid); #endif for (i = 0; g->gr_mem[i] != NULL; i++) { printf("%s", g->gr_mem[i]); diff --git a/awklib/eg/lib/pwcat.c b/awklib/eg/lib/pwcat.c index 934ef34e..cfe250c3 100644 --- a/awklib/eg/lib/pwcat.c +++ b/awklib/eg/lib/pwcat.c @@ -26,14 +26,14 @@ main(int argc, char **argv) struct passwd *p; while ((p = getpwent()) != NULL) -#ifdef ZOS_USS - printf("%s:%ld:%ld:%s:%s\n", - p->pw_name, (long) p->pw_uid, - (long) p->pw_gid, p->pw_dir, p->pw_shell); -#else +#ifdef HAVE_STRUCT_PASSWD_PW_PASSWD printf("%s:%s:%ld:%ld:%s:%s:%s\n", p->pw_name, p->pw_passwd, (long) p->pw_uid, (long) p->pw_gid, p->pw_gecos, p->pw_dir, p->pw_shell); +#else + printf("%s:*:%ld:%ld:%s:%s\n", + p->pw_name, (long) p->pw_uid, + (long) p->pw_gid, p->pw_dir, p->pw_shell); #endif endpwent(); |