mirror of
https://github.com/mirror/make.git
synced 2026-08-23 18:33:28 +08:00
Compare commits
103 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b59f5f30b9 | ||
|
|
acdd73ea34 | ||
|
|
38b5b27eb5 | ||
|
|
e8325b9be2 | ||
|
|
f8eb0fc41b | ||
|
|
ea38e1fe78 | ||
|
|
ed276c008d | ||
|
|
910d25619e | ||
|
|
2ae5430550 | ||
|
|
e53ac8a6fc | ||
|
|
cb51d55ab2 | ||
|
|
0b4723a689 | ||
|
|
3f9ce84b4a | ||
|
|
bdbe8501c6 | ||
|
|
3a12be3a73 | ||
|
|
2346f99368 | ||
|
|
d855846472 | ||
|
|
b9f7d21e42 | ||
|
|
db089ad3e3 | ||
|
|
1331cca1fa | ||
|
|
fe05aaf7f2 | ||
|
|
cc35ff7381 | ||
|
|
a146085382 | ||
|
|
79fcb77ad1 | ||
|
|
3608635ec6 | ||
|
|
ca53696814 | ||
|
|
61dac07200 | ||
|
|
9e42026e08 | ||
|
|
b52ea79ee6 | ||
|
|
e483431569 | ||
|
|
28b622b8a1 | ||
|
|
cbfc50cb51 | ||
|
|
deb7cced6e | ||
|
|
f9af56ac67 | ||
|
|
3ba2e947ac | ||
|
|
13d0eeb8e5 | ||
|
|
d9f063656b | ||
|
|
aceefb74da | ||
|
|
f38d98e988 | ||
|
|
ff8ff73e65 | ||
|
|
8478b0c10a | ||
|
|
1adf3a07dc | ||
|
|
a5a27a893d | ||
|
|
595f7598ae | ||
|
|
8bc1a424e2 | ||
|
|
5e69859273 | ||
|
|
3a0f9ce0cb | ||
|
|
3aabdf96a1 | ||
|
|
55b99d4151 | ||
|
|
f3699ad75f | ||
|
|
0af0c8dba0 | ||
|
|
1280ee49bb | ||
|
|
8fc1187283 | ||
|
|
e8dcf11ae0 | ||
|
|
ce40d6af9f | ||
|
|
636435e5c2 | ||
|
|
0733d6947d | ||
|
|
b91d62feb3 | ||
|
|
f6d5cdba19 | ||
|
|
fcb29e5e96 | ||
|
|
d7a043b46c | ||
|
|
d85ab5953a | ||
|
|
93dd485ab6 | ||
|
|
5c350f4fd5 | ||
|
|
514c4bac33 | ||
|
|
8f24715a10 | ||
|
|
4c7f18cd09 | ||
|
|
c5af4810ff | ||
|
|
551c4322cb | ||
|
|
e33c50b1e2 | ||
|
|
bc1e6b66f1 | ||
|
|
bbd5e695f5 | ||
|
|
f3cfccf0b8 | ||
|
|
016e1beef5 | ||
|
|
21a8ec0d72 | ||
|
|
fecd9e661a | ||
|
|
2914c705e5 | ||
|
|
3f506aaf90 | ||
|
|
75ea6c3ce2 | ||
|
|
3fb9ebf83f | ||
|
|
b4890bdb1c | ||
|
|
2cbfa1024a | ||
|
|
258dad0f9a | ||
|
|
37358a9a82 | ||
|
|
e167e0a3c2 | ||
|
|
7879457545 | ||
|
|
d525f4dd72 | ||
|
|
bd19554ea7 | ||
|
|
fffc384bfc | ||
|
|
afd1d69e7d | ||
|
|
c1305a1a18 | ||
|
|
43d5fbfc88 | ||
|
|
a4642a6a57 | ||
|
|
11ca7f1ead | ||
|
|
4aa992616f | ||
|
|
ab0fb2fa6f | ||
|
|
e1dd3bfa4a | ||
|
|
86238ec9d3 | ||
|
|
2e9779fdb4 | ||
|
|
b61a13463d | ||
|
|
d3b9c35c8f | ||
|
|
c50b75b439 | ||
|
|
7376280c33 |
17
.cvsignore
Normal file
17
.cvsignore
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
*.gz *.Z *.tar *.tgz
|
||||||
|
=*
|
||||||
|
TODO COPYING*
|
||||||
|
make-3* make-test*
|
||||||
|
*.info *.info-*
|
||||||
|
stamp-*
|
||||||
|
makebook*
|
||||||
|
|
||||||
|
.*gdbinit
|
||||||
|
|
||||||
|
*.dep *.dvi *.toc *.aux *.log
|
||||||
|
*.cp *.cps *.fn *.fns *.vr *.vrs *.tp *.tps *.ky *.kys *.pg *.pgs
|
||||||
|
|
||||||
|
sun4 i386 i386-netbsd hp300-netbsd hp300 rs6000 sun3 news800 amiga
|
||||||
|
hp700 hp834 mips
|
||||||
|
|
||||||
|
customs
|
||||||
55
GNUmakefile
55
GNUmakefile
@@ -1,6 +1,6 @@
|
|||||||
# GNU Make-specific makefile for GNU Make.
|
# GNU Make-specific makefile for GNU Make.
|
||||||
|
|
||||||
# Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
|
# Copyright (C) 1990, 91, 92, 93, 94, 95 Free Software Foundation, Inc.
|
||||||
# This file is part of GNU Make.
|
# This file is part of GNU Make.
|
||||||
#
|
#
|
||||||
# GNU Make is free software; you can redistribute it and/or modify
|
# GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -50,13 +50,18 @@ exec_prefix = $(prefix)
|
|||||||
extras := $(filter-out getloadavg.o @%@,$(extras)) getloadavg.o
|
extras := $(filter-out getloadavg.o @%@,$(extras)) getloadavg.o
|
||||||
LOADLIBES := $(filter-out @%@,$(LOADLIBES))
|
LOADLIBES := $(filter-out @%@,$(LOADLIBES))
|
||||||
ALLOCA := $(filter-out @%@,$(ALLOCA))
|
ALLOCA := $(filter-out @%@,$(ALLOCA))
|
||||||
|
CPPFLAGS := $(filter-out @%@,$(CPPFLAGS)) -DHAVE_CONFIG_H
|
||||||
|
|
||||||
ifdef AC_MACRODIR
|
ifdef AC_MACRODIR
|
||||||
configure config.h.in: $(patsubst %,$(AC_MACRODIR)/%.m4,acspecific acgeneral)
|
configure config.h.in: $(patsubst %,$(AC_MACRODIR)/%.m4,acspecific acgeneral)
|
||||||
config.h.in: $(AC_MACRODIR)/acconfig.h
|
config.h.in: $(AC_MACRODIR)/acconfig.h
|
||||||
endif
|
endif
|
||||||
configure: configure.in; autoconf $(ACFLAGS)
|
configure: configure.in aclocal.m4
|
||||||
config.h.in: configure.in; autoheader $(ACFLAGS)
|
autoconf $(ACFLAGS)
|
||||||
|
test -d CVS && cvs commit -m'autoconf $(ACFLAGS)' $@
|
||||||
|
config.h.in: configure.in aclocal.m4
|
||||||
|
autoheader $(ACFLAGS)
|
||||||
|
test -d CVS && cvs commit -m'autoheader $(ACFLAGS)' $@
|
||||||
|
|
||||||
ifdef customs
|
ifdef customs
|
||||||
defines := $(defines) -Ipmake/customs -Ipmake/lib/include
|
defines := $(defines) -Ipmake/customs -Ipmake/lib/include
|
||||||
@@ -88,8 +93,6 @@ GLOB =
|
|||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
CPPFLAGS := $(filter-out @%@,$(CPPFLAGS)) -Iglob
|
|
||||||
|
|
||||||
endif # works-for-make
|
endif # works-for-make
|
||||||
endif # $(libc_dir)
|
endif # $(libc_dir)
|
||||||
endif # !no_libc
|
endif # !no_libc
|
||||||
@@ -110,7 +113,7 @@ $(archpfx)load.o: load.c
|
|||||||
$(archpfx)load.dep: load.c
|
$(archpfx)load.dep: load.c
|
||||||
$(mkdep) $(LOAD_AVG) $< | sed 's,$*\.o,& $@,' > $@
|
$(mkdep) $(LOAD_AVG) $< | sed 's,$*\.o,& $@,' > $@
|
||||||
|
|
||||||
CPPFLAGS := -I$(ARCH) $(CPPFLAGS) -DHAVE_CONFIG_H $(filter-out @%@,$(defines))
|
CPPFLAGS := -I$(ARCH) -DHAVE_CONFIG_H $(filter-out @%@,$(CPPFLAGS))
|
||||||
|
|
||||||
ifneq "$(wildcard $(ARCH)/makefile)" ""
|
ifneq "$(wildcard $(ARCH)/makefile)" ""
|
||||||
include $(ARCH)/makefile
|
include $(ARCH)/makefile
|
||||||
@@ -147,12 +150,13 @@ $(prog): $(objs) $(globdep) #$(addprefix $(ARCH)/,gmalloc.o mcheck.o)
|
|||||||
$(CC) $(LDFLAGS) $^ $(globlib) $(LOADLIBES) -o $@.new
|
$(CC) $(LDFLAGS) $^ $(globlib) $(LOADLIBES) -o $@.new
|
||||||
mv -f $@.new $@
|
mv -f $@.new $@
|
||||||
|
|
||||||
globfiles = $(addprefix glob/,COPYING.LIB Makefile.in \
|
globfiles = $(addprefix glob/,COPYING.LIB configure.in configure Makefile.in \
|
||||||
glob.c fnmatch.c glob.h fnmatch.h)
|
configure.bat glob.c fnmatch.c glob.h fnmatch.h)
|
||||||
$(globfiles): stamp-glob ;
|
$(globfiles): stamp-glob ;
|
||||||
stamp-glob: /home/gd/gnu/libc/posix/glob.tar
|
stamp-glob: /home/gd/gnu/libc/posix/glob.tar
|
||||||
-rm -rf glob
|
-rm -f $(globfiles)
|
||||||
tar xvf $< glob
|
tar xvf $< glob
|
||||||
|
cvs commit -m'Updated from libc' glob
|
||||||
touch $@
|
touch $@
|
||||||
/home/gd/gnu/libc/posix/glob.tar: force
|
/home/gd/gnu/libc/posix/glob.tar: force
|
||||||
$(MAKE) -C $(@D) $(@F) no_deps=t
|
$(MAKE) -C $(@D) $(@F) no_deps=t
|
||||||
@@ -175,6 +179,7 @@ Makefile.in: compatMakefile $(nolib-deps:remote-%.dep=remote-stub.dep)
|
|||||||
echo '# Automatically generated dependencies.'; \
|
echo '# Automatically generated dependencies.'; \
|
||||||
sed -e 's/ [^ ]*\.dep//' -e 's=$(archpfx)==' $(filter-out $<,$^) \
|
sed -e 's/ [^ ]*\.dep//' -e 's=$(archpfx)==' $(filter-out $<,$^) \
|
||||||
) > $@
|
) > $@
|
||||||
|
cvs commit -mRegenerated $@
|
||||||
|
|
||||||
.SUFFIXES: .dep
|
.SUFFIXES: .dep
|
||||||
# Maintain the automatically-generated dependencies.
|
# Maintain the automatically-generated dependencies.
|
||||||
@@ -197,7 +202,9 @@ build.sh.in: build.template compatMakefile
|
|||||||
$(patsubst $(archpfx)%,%,$(objs)))\
|
$(patsubst $(archpfx)%,%,$(objs)))\
|
||||||
$(patsubst %.c,%.o,$(filter %.c,$(globfiles)))@' \
|
$(patsubst %.c,%.o,$(filter %.c,$(globfiles)))@' \
|
||||||
$< > $@.new
|
$< > $@.new
|
||||||
|
chmod a+x $@.new
|
||||||
mv -f $@.new $@
|
mv -f $@.new $@
|
||||||
|
cvs commit -mRegenerated $@
|
||||||
|
|
||||||
# Make the distribution tar files.
|
# Make the distribution tar files.
|
||||||
|
|
||||||
@@ -209,18 +216,25 @@ tarfiles := make # make-doc
|
|||||||
tarfiles := $(addsuffix -$(version).tar,$(tarfiles))
|
tarfiles := $(addsuffix -$(version).tar,$(tarfiles))
|
||||||
tarfiles := $(tarfiles:%=%.gz) # no more compress $(tarfiles:%=%.Z)
|
tarfiles := $(tarfiles:%=%.gz) # no more compress $(tarfiles:%=%.Z)
|
||||||
# Depend on default and doc so we don't ship anything that won't compile.
|
# Depend on default and doc so we don't ship anything that won't compile.
|
||||||
dist: rcs-mark default info dvi tests tarfiles
|
dist: cvs-mark default info dvi tests tarfiles
|
||||||
.PHONY: tarfiles
|
.PHONY: tarfiles
|
||||||
tarfiles: $(tarfiles)
|
tarfiles: $(tarfiles)
|
||||||
|
|
||||||
|
distfiles=README INSTALL COPYING ChangeLog NEWS \
|
||||||
|
configure Makefile.in configure.in build.sh.in mkinstalldirs \
|
||||||
|
configh.dos configure.bat \
|
||||||
|
acconfig.h $(srcs) remote-*.c $(globfiles) \
|
||||||
|
make.texinfo make-stds.texi \
|
||||||
|
make.?? make.??s make.toc make.aux make.man texinfo.tex TAGS tags \
|
||||||
|
install-sh \
|
||||||
|
make.info make.info*
|
||||||
|
|
||||||
ifndef dist-flavor
|
ifndef dist-flavor
|
||||||
dist-flavor = alpha
|
dist-flavor = alpha
|
||||||
endif
|
endif
|
||||||
.PHONY: rcs-mark rcs-mark-alpha rcs-mark-beta
|
.PHONY: cvs-mark
|
||||||
rcs-mark: rcs-mark-$(dist-flavor)
|
cvs-mark: $(distfiles)
|
||||||
rcs-mark-alpha: RCS/[!=]*,v;rcs -sAlpha -Nmake-$(version-): $^
|
cvs tag -F make-$(subst .,-,$(version))
|
||||||
rcs-mark-beta: RCS/[!=]*,v;rcs -sBeta -Nmake-$(version-): $^
|
|
||||||
version- = $(subst .,-,$(version))
|
|
||||||
|
|
||||||
dist: local-inst
|
dist: local-inst
|
||||||
.PHONY: local-inst
|
.PHONY: local-inst
|
||||||
@@ -244,6 +258,7 @@ $(alpha-dir)/%: %
|
|||||||
sed 's/VERSION/$(version)/' < $< > $@
|
sed 's/VERSION/$(version)/' < $< > $@
|
||||||
# Make sure I don't edit it by accident.
|
# Make sure I don't edit it by accident.
|
||||||
chmod a-w $@
|
chmod a-w $@
|
||||||
|
cvs commit -m'Regenerated for $(version)' $@
|
||||||
|
|
||||||
define make-tar
|
define make-tar
|
||||||
@rm -fr make-$(version)
|
@rm -fr make-$(version)
|
||||||
@@ -255,15 +270,7 @@ endef
|
|||||||
%.Z: %; compress -c $< > $@
|
%.Z: %; compress -c $< > $@
|
||||||
%.gz: %; gzip -9 -c -v $< > $@
|
%.gz: %; gzip -9 -c -v $< > $@
|
||||||
|
|
||||||
make-doc-$(version).tar: README-doc COPYING make.dvi make.info make.info*
|
make-$(version).tar: $(distfiles)
|
||||||
$(make-tar)
|
|
||||||
make-$(version).tar: README INSTALL COPYING ChangeLog NEWS \
|
|
||||||
configure Makefile.in configure.in build.sh.in mkinstalldirs \
|
|
||||||
acconfig.h $(srcs) remote-*.c $(globfiles) \
|
|
||||||
make.texinfo make-stds.texi \
|
|
||||||
make.?? make.??s make.toc make.aux make.man texinfo.tex TAGS tags \
|
|
||||||
install-sh \
|
|
||||||
make.info make.info*
|
|
||||||
$(make-tar)
|
$(make-tar)
|
||||||
|
|
||||||
ifneq (,)
|
ifneq (,)
|
||||||
|
|||||||
306
Makefile.in
Normal file
306
Makefile.in
Normal file
@@ -0,0 +1,306 @@
|
|||||||
|
# NOTE: If you have no `make' program at all to process this makefile, run
|
||||||
|
# `build.sh' instead.
|
||||||
|
#
|
||||||
|
# Copyright (C) 1988, 89, 91, 92, 93, 94, 1995 Free Software Foundation, Inc.
|
||||||
|
# This file is part of GNU Make.
|
||||||
|
#
|
||||||
|
# GNU Make 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.
|
||||||
|
#
|
||||||
|
# GNU Make 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 GNU Make; see the file COPYING. If not, write to
|
||||||
|
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
|
||||||
|
#
|
||||||
|
# Makefile for GNU Make
|
||||||
|
#
|
||||||
|
|
||||||
|
# Ultrix 2.2 make doesn't expand the value of VPATH.
|
||||||
|
VPATH = @srcdir@
|
||||||
|
# This must repeat the value, because configure will remove `VPATH = .'.
|
||||||
|
srcdir = @srcdir@
|
||||||
|
|
||||||
|
CC = @CC@
|
||||||
|
|
||||||
|
CFLAGS = @CFLAGS@
|
||||||
|
CPPFLAGS = @CPPFLAGS@
|
||||||
|
LDFLAGS = @LDFLAGS@
|
||||||
|
|
||||||
|
# Define these for your system as follows:
|
||||||
|
# -DNO_ARCHIVES To disable `ar' archive support.
|
||||||
|
# -DNO_FLOAT To avoid using floating-point numbers.
|
||||||
|
# -DENUM_BITFIELDS If the compiler isn't GCC but groks enum foo:2.
|
||||||
|
# Some compilers apparently accept this
|
||||||
|
# without complaint but produce losing code,
|
||||||
|
# so beware.
|
||||||
|
# NeXT 1.0a uses an old version of GCC, which required -D__inline=inline.
|
||||||
|
# See also `config.h'.
|
||||||
|
defines = @DEFS@ -DLIBDIR=\"$(libdir)\" -DINCLUDEDIR=\"$(includedir)\"
|
||||||
|
|
||||||
|
# Which flavor of remote job execution support to use.
|
||||||
|
# The code is found in `remote-$(REMOTE).c'.
|
||||||
|
REMOTE = @REMOTE@
|
||||||
|
|
||||||
|
# If you are using the GNU C library, or have the GNU getopt functions in
|
||||||
|
# your C library, you can comment these out.
|
||||||
|
GETOPT = getopt.o getopt1.o
|
||||||
|
GETOPT_SRC = $(srcdir)/getopt.c $(srcdir)/getopt1.c $(srcdir)/getopt.h
|
||||||
|
|
||||||
|
# If you are using the GNU C library, or have the GNU glob functions in
|
||||||
|
# your C library, you can comment this out. GNU make uses special hooks
|
||||||
|
# into the glob functions to be more efficient (by using make's directory
|
||||||
|
# cache for globbing), so you must use the GNU functions even if your
|
||||||
|
# system's C library has the 1003.2 glob functions already. Also, the glob
|
||||||
|
# functions in the AIX and HPUX C libraries are said to be buggy.
|
||||||
|
GLOB = glob/libglob.a
|
||||||
|
|
||||||
|
# If your system doesn't have alloca, or the one provided is bad, define this.
|
||||||
|
ALLOCA = @ALLOCA@
|
||||||
|
ALLOCA_SRC = $(srcdir)/alloca.c
|
||||||
|
|
||||||
|
# If your system needs extra libraries loaded in, define them here.
|
||||||
|
# System V probably need -lPW for alloca. HP-UX 7.0's alloca in
|
||||||
|
# libPW.a is broken on HP9000s300 and HP9000s400 machines. Use
|
||||||
|
# alloca.c instead on those machines.
|
||||||
|
LOADLIBES = @LIBS@
|
||||||
|
|
||||||
|
# Any extra object files your system needs.
|
||||||
|
extras = @LIBOBJS@
|
||||||
|
|
||||||
|
# Common prefix for machine-independent installed files.
|
||||||
|
prefix = @prefix@
|
||||||
|
# Common prefix for machine-dependent installed files.
|
||||||
|
exec_prefix = @exec_prefix@
|
||||||
|
|
||||||
|
# Directory to install `make' in.
|
||||||
|
bindir = $(exec_prefix)/bin
|
||||||
|
# Directory to find libraries in for `-lXXX'.
|
||||||
|
libdir = $(exec_prefix)/lib
|
||||||
|
# Directory to search by default for included makefiles.
|
||||||
|
includedir = $(prefix)/include
|
||||||
|
# Directory to install the Info files in.
|
||||||
|
infodir = $(prefix)/info
|
||||||
|
# Directory to install the man page in.
|
||||||
|
mandir = $(prefix)/man/man$(manext)
|
||||||
|
# Number to put on the man page filename.
|
||||||
|
manext = 1
|
||||||
|
# Prefix to put on installed `make' binary file name.
|
||||||
|
binprefix =
|
||||||
|
# Prefix to put on installed `make' man page file name.
|
||||||
|
manprefix = $(binprefix)
|
||||||
|
|
||||||
|
# Whether or not make needs to be installed setgid.
|
||||||
|
# The value should be either `true' or `false'.
|
||||||
|
# On many systems, the getloadavg function (used to implement the `-l'
|
||||||
|
# switch) will not work unless make is installed setgid kmem.
|
||||||
|
install_setgid = @NEED_SETGID@
|
||||||
|
# Install make setgid to this group so it can read /dev/kmem.
|
||||||
|
group = @KMEM_GROUP@
|
||||||
|
|
||||||
|
# Program to install `make'.
|
||||||
|
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||||
|
# Program to install the man page.
|
||||||
|
INSTALL_DATA = @INSTALL_DATA@
|
||||||
|
# Generic install program.
|
||||||
|
INSTALL = @INSTALL@
|
||||||
|
|
||||||
|
# Program to format Texinfo source into Info files.
|
||||||
|
MAKEINFO = makeinfo
|
||||||
|
# Program to format Texinfo source into DVI files.
|
||||||
|
TEXI2DVI = texi2dvi
|
||||||
|
|
||||||
|
# Programs to make tags files.
|
||||||
|
ETAGS = etags -w
|
||||||
|
CTAGS = ctags -w
|
||||||
|
|
||||||
|
objs = commands.o job.o dir.o file.o misc.o main.o read.o remake.o \
|
||||||
|
rule.o implicit.o default.o variable.o expand.o function.o \
|
||||||
|
vpath.o version.o ar.o arscan.o signame.o remote-$(REMOTE).o \
|
||||||
|
$(GLOB) $(GETOPT) $(ALLOCA) $(extras)
|
||||||
|
srcs = $(srcdir)/commands.c $(srcdir)/job.c $(srcdir)/dir.c \
|
||||||
|
$(srcdir)/file.c $(srcdir)/getloadavg.c $(srcdir)/misc.c \
|
||||||
|
$(srcdir)/main.c $(srcdir)/read.c $(srcdir)/remake.c \
|
||||||
|
$(srcdir)/rule.c $(srcdir)/implicit.c $(srcdir)/default.c \
|
||||||
|
$(srcdir)/variable.c $(srcdir)/expand.c $(srcdir)/function.c \
|
||||||
|
$(srcdir)/vpath.c $(srcdir)/version.c \
|
||||||
|
$(srcdir)/remote-$(REMOTE).c \
|
||||||
|
$(srcdir)/ar.c $(srcdir)/arscan.c \
|
||||||
|
$(srcdir)/signame.c $(srcdir)/signame.h $(GETOPT_SRC) \
|
||||||
|
$(srcdir)/commands.h $(srcdir)/dep.h $(srcdir)/file.h \
|
||||||
|
$(srcdir)/job.h $(srcdir)/make.h $(srcdir)/rule.h \
|
||||||
|
$(srcdir)/variable.h $(ALLOCA_SRC) $(srcdir)/config.h.in
|
||||||
|
|
||||||
|
|
||||||
|
.SUFFIXES:
|
||||||
|
.SUFFIXES: .o .c .h .ps .dvi .info .texinfo
|
||||||
|
|
||||||
|
all: make
|
||||||
|
info: make.info
|
||||||
|
dvi: make.dvi
|
||||||
|
# Some makes apparently use .PHONY as the default goal if it is before `all'.
|
||||||
|
.PHONY: all check info dvi
|
||||||
|
|
||||||
|
make.info: make.texinfo
|
||||||
|
$(MAKEINFO) -I$(srcdir) $(srcdir)/make.texinfo -o make.info
|
||||||
|
|
||||||
|
make.dvi: make.texinfo
|
||||||
|
$(TEXI2DVI) $(srcdir)/make.texinfo
|
||||||
|
|
||||||
|
make.ps: make.dvi
|
||||||
|
dvi2ps make.dvi > make.ps
|
||||||
|
|
||||||
|
make: $(objs)
|
||||||
|
$(CC) $(LDFLAGS) $(objs) $(LOADLIBES) -o make.new
|
||||||
|
mv -f make.new make
|
||||||
|
|
||||||
|
# -I. is needed to find config.h in the build directory.
|
||||||
|
.c.o:
|
||||||
|
$(CC) $(defines) -c -I. -I$(srcdir) -I$(srcdir)/glob \
|
||||||
|
$(CPPFLAGS) $(CFLAGS) $< $(OUTPUT_OPTION)
|
||||||
|
|
||||||
|
# For some losing Unix makes.
|
||||||
|
SHELL = /bin/sh
|
||||||
|
@SET_MAKE@
|
||||||
|
|
||||||
|
glob/libglob.a: FORCE config.h
|
||||||
|
cd glob; $(MAKE) libglob.a
|
||||||
|
FORCE:
|
||||||
|
|
||||||
|
tagsrcs = $(srcs) $(srcdir)/remote-*.c
|
||||||
|
TAGS: $(tagsrcs)
|
||||||
|
$(ETAGS) $(tagsrcs)
|
||||||
|
tags: $(tagsrcs)
|
||||||
|
$(CTAGS) $(tagsrcs)
|
||||||
|
|
||||||
|
.PHONY: install installdirs
|
||||||
|
install: installdirs \
|
||||||
|
$(bindir)/$(binprefix)make $(infodir)/make.info \
|
||||||
|
$(mandir)/$(manprefix)make.$(manext)
|
||||||
|
|
||||||
|
installdirs:
|
||||||
|
$(SHELL) ${srcdir}/mkinstalldirs $(bindir) $(infodir) $(mandir)
|
||||||
|
|
||||||
|
$(bindir)/$(binprefix)make: make
|
||||||
|
$(INSTALL_PROGRAM) make $@.new
|
||||||
|
@if $(install_setgid); then \
|
||||||
|
if chgrp $(group) $@.new && chmod g+s $@.new; then \
|
||||||
|
echo "chgrp $(group) $@.new && chmod g+s $@.new"; \
|
||||||
|
else \
|
||||||
|
echo "$@ needs to be owned by group $(group) and setgid;"; \
|
||||||
|
echo "otherwise the \`-l' option will probably not work."; \
|
||||||
|
echo "You may need special privileges to install $@."; \
|
||||||
|
fi; \
|
||||||
|
else true; fi
|
||||||
|
# Some systems can't deal with renaming onto a running binary.
|
||||||
|
-rm -f $@.old
|
||||||
|
-mv $@ $@.old
|
||||||
|
mv $@.new $@
|
||||||
|
|
||||||
|
$(infodir)/make.info: make.info
|
||||||
|
if [ -r ./make.info ]; then dir=.; else dir=$(srcdir); fi; \
|
||||||
|
for file in $${dir}/make.info*; do \
|
||||||
|
name="`basename $$file`"; \
|
||||||
|
$(INSTALL_DATA) $$file \
|
||||||
|
`echo $@ | sed "s,make.info\$$,$$name,"`; \
|
||||||
|
done
|
||||||
|
# Run install-info only if it exists.
|
||||||
|
# Use `if' instead of just prepending `-' to the
|
||||||
|
# line so we notice real errors from install-info.
|
||||||
|
# We use `$(SHELL) -c' because some shells do not
|
||||||
|
# fail gracefully when there is an unknown command.
|
||||||
|
if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
|
||||||
|
install-info --infodir=$(infodir) $$dir/make.info; \
|
||||||
|
else true; fi
|
||||||
|
|
||||||
|
$(mandir)/$(manprefix)make.$(manext): make.man
|
||||||
|
$(INSTALL_DATA) $(srcdir)/make.man $@
|
||||||
|
|
||||||
|
|
||||||
|
loadavg: loadavg.c config.h
|
||||||
|
$(CC) $(defines) -DTEST -I. -I$(srcdir) $(CFLAGS) $(LDFLAGS) \
|
||||||
|
loadavg.c $(LOADLIBES) -o $@
|
||||||
|
# We copy getloadavg.c into a different file rather than compiling it
|
||||||
|
# directly because some compilers clobber getloadavg.o in the process.
|
||||||
|
loadavg.c: getloadavg.c
|
||||||
|
ln $(srcdir)/getloadavg.c loadavg.c || \
|
||||||
|
cp $(srcdir)/getloadavg.c loadavg.c
|
||||||
|
check-loadavg: loadavg
|
||||||
|
@echo The system uptime program believes the load average to be:
|
||||||
|
-uptime
|
||||||
|
@echo The GNU load average checking code believes:
|
||||||
|
./loadavg
|
||||||
|
check: check-loadavg
|
||||||
|
|
||||||
|
|
||||||
|
.PHONY: clean realclean distclean mostlyclean
|
||||||
|
clean: glob-clean
|
||||||
|
-rm -f make loadavg *.o core make.dvi
|
||||||
|
distclean: clean glob-realclean
|
||||||
|
-rm -f Makefile config.h config.status build.sh stamp-config
|
||||||
|
-rm -f config.log config.cache
|
||||||
|
-rm -f TAGS tags
|
||||||
|
-rm -f make.?? make.??s make.log make.toc make.*aux
|
||||||
|
-rm -f loadavg.c
|
||||||
|
realclean: distclean
|
||||||
|
-rm -f make.info*
|
||||||
|
mostlyclean: clean
|
||||||
|
|
||||||
|
.PHONY: glob-clean glob-realclean
|
||||||
|
glob-clean glob-realclean:
|
||||||
|
cd glob; $(MAKE) $@
|
||||||
|
|
||||||
|
Makefile: config.status $(srcdir)/Makefile.in
|
||||||
|
$(SHELL) config.status
|
||||||
|
glob/Makefile: config.status $(srcdir)/glob/Makefile.in
|
||||||
|
$(SHELL) config.status
|
||||||
|
config.h: stamp-config ;
|
||||||
|
stamp-config: config.status $(srcdir)/config.h.in
|
||||||
|
$(SHELL) config.status
|
||||||
|
touch stamp-config
|
||||||
|
|
||||||
|
#configure: configure.in aclocal.m4
|
||||||
|
# cd $(srcdir) && autoconf $(ACFLAGS)
|
||||||
|
#config.h.in: configure.in aclocal.m4
|
||||||
|
# cd $(srcdir) && autoheader $(ACFLAGS)
|
||||||
|
|
||||||
|
# This tells versions [3.59,3.63) of GNU make not to export all variables.
|
||||||
|
.NOEXPORT:
|
||||||
|
|
||||||
|
# The automatically generated dependencies below may omit config.h
|
||||||
|
# because it is included with ``#include <config.h>'' rather than
|
||||||
|
# ``#include "config.h"''. So we add the explicit dependency to make sure.
|
||||||
|
$(objs): config.h
|
||||||
|
|
||||||
|
# Automatically generated dependencies will be put at the end of the file.
|
||||||
|
|
||||||
|
# Automatically generated dependencies.
|
||||||
|
commands.o : commands.c make.h dep.h commands.h file.h variable.h job.h
|
||||||
|
job.o: job.c make.h commands.h job.h file.h variable.h
|
||||||
|
dir.o: dir.c make.h
|
||||||
|
file.o : file.c make.h commands.h dep.h file.h variable.h
|
||||||
|
misc.o: misc.c make.h dep.h
|
||||||
|
main.o: main.c make.h commands.h dep.h file.h variable.h job.h getopt.h
|
||||||
|
read.o: read.c make.h commands.h dep.h file.h variable.h glob/glob.h
|
||||||
|
remake.o: remake.c make.h commands.h job.h dep.h file.h
|
||||||
|
rule.o : rule.c make.h config.h commands.h dep.h file.h variable.h rule.h
|
||||||
|
implicit.o : implicit.c make.h rule.h dep.h file.h
|
||||||
|
default.o: default.c make.h rule.h dep.h file.h commands.h variable.h
|
||||||
|
variable.o : variable.c make.h commands.h variable.h dep.h file.h
|
||||||
|
expand.o: expand.c make.h commands.h file.h variable.h
|
||||||
|
function.o : function.c make.h variable.h dep.h commands.h job.h
|
||||||
|
vpath.o : vpath.c make.h file.h variable.h
|
||||||
|
version.o: version.c
|
||||||
|
ar.o : ar.c make.h file.h dep.h
|
||||||
|
arscan.o: arscan.c make.h
|
||||||
|
signame.o: signame.c signame.h
|
||||||
|
remote-stub.o : remote-stub.c make.h commands.h
|
||||||
|
getopt.o: getopt.c getopt.h
|
||||||
|
getopt1.o : getopt1.c getopt.h
|
||||||
|
getloadavg.o: getloadavg.c
|
||||||
557
NEWS
Normal file
557
NEWS
Normal file
@@ -0,0 +1,557 @@
|
|||||||
|
GNU make NEWS -- history of user-visible changes. 26 January 1995
|
||||||
|
|
||||||
|
Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
|
||||||
|
See the end for copying conditions.
|
||||||
|
|
||||||
|
Please send GNU make bug reports to bug-gnu-utils@prep.ai.mit.edu.
|
||||||
|
|
||||||
|
Version 3.73
|
||||||
|
|
||||||
|
* Converted to use Autoconf version 2, so `configure' has some new options.
|
||||||
|
See INSTALL for details.
|
||||||
|
|
||||||
|
* You can now send a SIGUSR1 signal to Make to toggle printing of debugging
|
||||||
|
output enable by -d, at any time during the run.
|
||||||
|
|
||||||
|
Version 3.72
|
||||||
|
|
||||||
|
* DJ Delorie has ported Make to MS-DOS using the GO32 extender.
|
||||||
|
He is maintaining the DOS port, not the GNU Make maintainer;
|
||||||
|
please direct bugs and questions for DOS to <djgpp@sun.soe.clarkson.edu>.
|
||||||
|
MS-DOS binaries are available for FTP from oak.oakland.edu:pub/msdos/djgpp.
|
||||||
|
|
||||||
|
* The `MAKEFLAGS' variable (in the environment or in a makefile) can now
|
||||||
|
contain variable definitions itself; these are treated just like
|
||||||
|
command-line variable definitions. Make will automatically insert any
|
||||||
|
variable definitions from the environment value of `MAKEFLAGS' or from
|
||||||
|
the command line, into the `MAKEFLAGS' value exported to children. The
|
||||||
|
`MAKEOVERRIDES' variable previously included in the value of `$(MAKE)'
|
||||||
|
for sub-makes is now included in `MAKEFLAGS' instead. As before, you can
|
||||||
|
reset `MAKEOVERRIDES' in your makefile to avoid putting all the variables
|
||||||
|
in the environment when its size is limited.
|
||||||
|
|
||||||
|
* If `.DELETE_ON_ERROR' appears as a target, Make will delete the target of
|
||||||
|
a rule if it has changed when its commands exit with a nonzero status,
|
||||||
|
just as when the commands get a signal.
|
||||||
|
|
||||||
|
* The automatic variable `$+' is new. It lists all the dependencies like
|
||||||
|
`$^', but preserves duplicates listed in the makefile. This is useful
|
||||||
|
for linking rules, where library files sometimes need to be listed twice
|
||||||
|
in the link order.
|
||||||
|
|
||||||
|
* You can now specify the `.IGNORE' and `.SILENT' special targets with
|
||||||
|
dependencies to limit their effects to those files. If a file appears as
|
||||||
|
a dependency of `.IGNORE', then errors will be ignored while running the
|
||||||
|
commands to update that file. Likewise if a file appears as a dependency
|
||||||
|
of `.SILENT', then the commands to update that file will not be printed
|
||||||
|
before they are run. (This change was made to conform to POSIX.2.)
|
||||||
|
|
||||||
|
Version 3.71
|
||||||
|
|
||||||
|
* The automatic variables `$(@D)', `$(%D)', `$(*D)', `$(<D)', `$(?D)', and
|
||||||
|
`$(^D)' now omit the trailing slash from the directory name. (This change
|
||||||
|
was made to comply with POSIX.2.)
|
||||||
|
|
||||||
|
* The source distribution now includes the Info files for the Make manual.
|
||||||
|
There is no longer a separate distribution containing Info and DVI files.
|
||||||
|
|
||||||
|
* You can now set the variables `binprefix' and/or `manprefix' in
|
||||||
|
Makefile.in (or on the command line when installing) to install GNU make
|
||||||
|
under a name other than `make' (i.e., ``make binprefix=g install''
|
||||||
|
installs GNU make as `gmake').
|
||||||
|
|
||||||
|
* The built-in Texinfo rules use the new variables `TEXI2DVI_FLAGS' for
|
||||||
|
flags to the `texi2dvi' script, and `MAKEINFO_FLAGS' for flags to the
|
||||||
|
Makeinfo program.
|
||||||
|
|
||||||
|
* The exit status of Make when it runs into errors is now 2 instead of 1.
|
||||||
|
The exit status is 1 only when using -q and some target is not up to date.
|
||||||
|
(This change was made to comply with POSIX.2.)
|
||||||
|
|
||||||
|
Version 3.70
|
||||||
|
|
||||||
|
* It is no longer a fatal error to have a NUL character in a makefile.
|
||||||
|
You should never put a NUL in a makefile because it can have strange
|
||||||
|
results, but otherwise empty lines full of NULs (such as produced by
|
||||||
|
the `xmkmf' program) will always work fine.
|
||||||
|
|
||||||
|
* The error messages for nonexistent included makefiles now refer to the
|
||||||
|
makefile name and line number where the `include' appeared, so Emacs's
|
||||||
|
C-x ` command takes you there (in case it's a typo you need to fix).
|
||||||
|
|
||||||
|
Version 3.69
|
||||||
|
|
||||||
|
* Implicit rule search for archive member references is now done in the
|
||||||
|
opposite order from previous versions: the whole target name `LIB(MEM)'
|
||||||
|
first, and just the member name and parentheses `(MEM)' second.
|
||||||
|
|
||||||
|
* Make now gives an error for an unterminated variable or function reference.
|
||||||
|
For example, `$(foo' with no matching `)' or `${bar' with no matching `}'.
|
||||||
|
|
||||||
|
* The new default variable `MAKE_VERSION' gives the version number of
|
||||||
|
Make, and a string describing the remote job support compiled in (if any).
|
||||||
|
Thus the value (in this release) is something like `3.69' or `3.69-Customs'.
|
||||||
|
|
||||||
|
* Commands in an invocation of the `shell' function are no longer run with
|
||||||
|
a modified environment like target commands are. As in versions before
|
||||||
|
3.68, they now run with the environment that `make' started with. We
|
||||||
|
have reversed the change made in version 3.68 because it turned out to
|
||||||
|
cause a paradoxical situation in cases like:
|
||||||
|
|
||||||
|
export variable = $(shell echo value)
|
||||||
|
|
||||||
|
When Make attempted to put this variable in the environment for a target
|
||||||
|
command, it would try expand the value by running the shell command
|
||||||
|
`echo value'. In version 3.68, because it constructed an environment
|
||||||
|
for that shell command in the same way, Make would begin to go into an
|
||||||
|
infinite loop and then get a fatal error when it detected the loop.
|
||||||
|
|
||||||
|
* The commands given for `.DEFAULT' are now used for phony targets with no
|
||||||
|
commands.
|
||||||
|
|
||||||
|
Version 3.68
|
||||||
|
|
||||||
|
* You can list several archive member names inside parenthesis:
|
||||||
|
`lib(mem1 mem2 mem3)' is equivalent to `lib(mem1) lib(mem2) lib(mem3)'.
|
||||||
|
|
||||||
|
* You can use wildcards inside archive member references. For example,
|
||||||
|
`lib(*.o)' expands to all existing members of `lib' whose names end in
|
||||||
|
`.o' (e.g. `lib(a.o) lib(b.o)'); `*.a(*.o)' expands to all such members
|
||||||
|
of all existing files whose names end in `.a' (e.g. `foo.a(a.o)
|
||||||
|
foo.a(b.o) bar.a(c.o) bar.a(d.o)'.
|
||||||
|
|
||||||
|
* A suffix rule `.X.a' now produces two pattern rules:
|
||||||
|
(%.o): %.X # Previous versions produced only this.
|
||||||
|
%.a: %.X # Now produces this as well, just like other suffixes.
|
||||||
|
|
||||||
|
* The new flag `--warn-undefined-variables' says to issue a warning message
|
||||||
|
whenever Make expands a reference to an undefined variable.
|
||||||
|
|
||||||
|
* The new `-include' directive is just like `include' except that there is
|
||||||
|
no error (not even a warning) for a nonexistent makefile.
|
||||||
|
|
||||||
|
* Commands in an invocation of the `shell' function are now run with a
|
||||||
|
modified environment like target commands are, so you can use `export' et
|
||||||
|
al to set up variables for them. They used to run with the environment
|
||||||
|
that `make' started with.
|
||||||
|
|
||||||
|
Version 3.66
|
||||||
|
|
||||||
|
* `make --version' (or `make -v') now exits immediately after printing
|
||||||
|
the version number.
|
||||||
|
|
||||||
|
Version 3.65
|
||||||
|
|
||||||
|
* Make now supports long-named members in `ar' archive files.
|
||||||
|
|
||||||
|
Version 3.64
|
||||||
|
|
||||||
|
* Make now supports the `+=' syntax for a variable definition which appends
|
||||||
|
to the variable's previous value. See the section `Appending More Text
|
||||||
|
to Variables' in the manual for full details.
|
||||||
|
|
||||||
|
* The new option `--no-print-directory' inhibits the `-w' or
|
||||||
|
`--print-directory' feature. Make turns on `--print-directory'
|
||||||
|
automatically if you use `-C' or `--directory', and in sub-makes; some
|
||||||
|
users have found this behavior undesirable.
|
||||||
|
|
||||||
|
* The built-in implicit rules now support the alternative extension
|
||||||
|
`.txinfo' for Texinfo files, just like `.texinfo' and `.texi'.
|
||||||
|
|
||||||
|
Version 3.63
|
||||||
|
|
||||||
|
* Make now uses a standard GNU `configure' script. See the new file
|
||||||
|
INSTALL for the new (and much simpler) installation procedure.
|
||||||
|
|
||||||
|
* There is now a shell script to build Make the first time, if you have no
|
||||||
|
other `make' program. `build.sh' is created by `configure'; see README.
|
||||||
|
|
||||||
|
* GNU Make now completely conforms to the POSIX.2 specification for `make'.
|
||||||
|
|
||||||
|
* Elements of the `$^' and `$?' automatic variables that are archive
|
||||||
|
member references now list only the member name, as in Unix and POSIX.2.
|
||||||
|
|
||||||
|
* You should no longer ever need to specify the `-w' switch, which prints
|
||||||
|
the current directory before and after Make runs. The `-C' switch to
|
||||||
|
change directory, and recursive use of Make, now set `-w' automatically.
|
||||||
|
|
||||||
|
* Multiple double-colon rules for the same target will no longer have their
|
||||||
|
commands run simultaneously under -j, as this could result in the two
|
||||||
|
commands trying to change the file at the same time and interfering with
|
||||||
|
one another.
|
||||||
|
|
||||||
|
* The `SHELL' variable is now never taken from the environment.
|
||||||
|
Each makefile that wants a shell other than the default (/bin/sh) must
|
||||||
|
set SHELL itself. SHELL is always exported to child processes.
|
||||||
|
This change was made for compatibility with POSIX.2.
|
||||||
|
|
||||||
|
* Make now accepts long options. There is now an informative usage message
|
||||||
|
that tells you what all the options are and what they do. Try `make --help'.
|
||||||
|
|
||||||
|
* There are two new directives: `export' and `unexport'. All variables are
|
||||||
|
no longer automatically put into the environments of the commands that
|
||||||
|
Make runs. Instead, only variables specified on the command line or in
|
||||||
|
the environment are exported by default. To export others, use:
|
||||||
|
export VARIABLE
|
||||||
|
or you can define variables with:
|
||||||
|
export VARIABLE = VALUE
|
||||||
|
or:
|
||||||
|
export VARIABLE := VALUE
|
||||||
|
You can use just:
|
||||||
|
export
|
||||||
|
or:
|
||||||
|
.EXPORT_ALL_VARIABLES:
|
||||||
|
to get the old behavior. See the node `Variables/Recursion' in the manual
|
||||||
|
for a full description.
|
||||||
|
|
||||||
|
* The commands from the `.DEFAULT' special target are only applied to
|
||||||
|
targets which have no rules at all, not all targets with no commands.
|
||||||
|
This change was made for compatibility with Unix make.
|
||||||
|
|
||||||
|
* All fatal error messages now contain `***', so they are easy to find in
|
||||||
|
compilation logs.
|
||||||
|
|
||||||
|
* Dependency file names like `-lNAME' are now replaced with the actual file
|
||||||
|
name found, as with files found by normal directory search (VPATH).
|
||||||
|
The library file `libNAME.a' may now be found in the current directory,
|
||||||
|
which is checked before VPATH; the standard set of directories (/lib,
|
||||||
|
/usr/lib, /usr/local/lib) is now checked last.
|
||||||
|
See the node `Libraries/Search' in the manual for full details.
|
||||||
|
|
||||||
|
* A single `include' directive can now specify more than one makefile to
|
||||||
|
include, like this:
|
||||||
|
include file1 file2
|
||||||
|
You can also use shell file name patterns in an `include' directive:
|
||||||
|
include *.mk
|
||||||
|
|
||||||
|
* The default directories to search for included makefiles, and for
|
||||||
|
libraries specified with `-lNAME', are now set by configuration.
|
||||||
|
|
||||||
|
* You can now use blanks as well as colons to separate the directories in a
|
||||||
|
search path for the `vpath' directive or the `VPATH' variable.
|
||||||
|
|
||||||
|
* You can now use variables and functions in the left hand side of a
|
||||||
|
variable assignment, as in "$(foo)bar = value".
|
||||||
|
|
||||||
|
* The `MAKE' variable is always defined as `$(MAKE_COMMAND) $(MAKEOVERRIDES)'.
|
||||||
|
The `MAKE_COMMAND' variable is now defined to the name with which make
|
||||||
|
was invoked.
|
||||||
|
|
||||||
|
* The built-in rules for C++ compilation now use the variables `$(CXX)' and
|
||||||
|
`$(CXXFLAGS)' instead of `$(C++)' and `$(C++FLAGS)'. The old names had
|
||||||
|
problems with shells that cannot have `+' in environment variable names.
|
||||||
|
|
||||||
|
* The value of a recursively expanded variable is now expanded when putting
|
||||||
|
it into the environment for child processes. This change was made for
|
||||||
|
compatibility with Unix make.
|
||||||
|
|
||||||
|
* A rule with no targets before the `:' is now accepted and ignored.
|
||||||
|
This change was made for compatibility with SunOS 4 make.
|
||||||
|
We do not recommend that you write your makefiles to take advantage of this.
|
||||||
|
|
||||||
|
* The `-I' switch can now be used in MAKEFLAGS, and are put there
|
||||||
|
automatically just like other switches.
|
||||||
|
|
||||||
|
Version 3.61
|
||||||
|
|
||||||
|
* Built-in rules for C++ source files with the `.C' suffix.
|
||||||
|
We still recommend that you use `.cc' instead.
|
||||||
|
|
||||||
|
* If commands are given too many times for a single target,
|
||||||
|
the last set given is used, and a warning message is printed.
|
||||||
|
|
||||||
|
* Error messages about makefiles are in standard GNU error format,
|
||||||
|
so C-x ` in Emacs works on them.
|
||||||
|
|
||||||
|
* Dependencies of pattern rules which contain no % need not actually exist
|
||||||
|
if they can be created (just like dependencies which do have a %).
|
||||||
|
|
||||||
|
Version 3.60
|
||||||
|
|
||||||
|
* A message is always printed when Make decides there is nothing to be done.
|
||||||
|
It used to be that no message was printed for top-level phony targets
|
||||||
|
(because "`phony' is up to date" isn't quite right). Now a different
|
||||||
|
message "Nothing to be done for `phony'" is printed in that case.
|
||||||
|
|
||||||
|
* Archives on AIX now supposedly work.
|
||||||
|
|
||||||
|
* When the commands specified for .DEFAULT are used to update a target,
|
||||||
|
the $< automatic variable is given the same value as $@ for that target.
|
||||||
|
This is how Unix make behaves, and this behavior is mandated by POSIX.2.
|
||||||
|
|
||||||
|
Version 3.59
|
||||||
|
|
||||||
|
* The -n, -q, and -t options are not put in the `MAKEFLAGS' and `MFLAG'
|
||||||
|
variables while remaking makefiles, so recursive makes done while remaking
|
||||||
|
makefiles will behave properly.
|
||||||
|
|
||||||
|
* If the special target `.NOEXPORT' is specified in a makefile,
|
||||||
|
only variables that came from the environment and variables
|
||||||
|
defined on the command line are exported.
|
||||||
|
|
||||||
|
Version 3.58
|
||||||
|
|
||||||
|
* Suffix rules may have dependencies (which are ignored).
|
||||||
|
|
||||||
|
Version 3.57
|
||||||
|
|
||||||
|
* Dependencies of the form `-lLIB' are searched for as /usr/local/lib/libLIB.a
|
||||||
|
as well as libLIB.a in /usr/lib, /lib, the current directory, and VPATH.
|
||||||
|
|
||||||
|
Version 3.55
|
||||||
|
|
||||||
|
* There is now a Unix man page for GNU Make. It is certainly not a replacement
|
||||||
|
for the Texinfo manual, but it documents the basic functionality and the
|
||||||
|
switches. For full documentation, you should still read the Texinfo manual.
|
||||||
|
Thanks to Dennis Morse of Stanford University for contributing the initial
|
||||||
|
version of this.
|
||||||
|
|
||||||
|
* Variables which are defined by default (e.g., `CC') will no longer be put
|
||||||
|
into the environment for child processes. (If these variables are reset by the
|
||||||
|
environment, makefiles, or the command line, they will still go into the
|
||||||
|
environment.)
|
||||||
|
|
||||||
|
* Makefiles which have commands but no dependencies (and thus are always
|
||||||
|
considered out of date and in need of remaking), will not be remade (if they
|
||||||
|
were being remade only because they were makefiles). This means that GNU
|
||||||
|
Make will no longer go into an infinite loop when fed the makefiles that
|
||||||
|
`imake' (necessary to build X Windows) produces.
|
||||||
|
|
||||||
|
* There is no longer a warning for using the `vpath' directive with an explicit
|
||||||
|
pathname (instead of a `%' pattern).
|
||||||
|
|
||||||
|
Version 3.51
|
||||||
|
|
||||||
|
* When removing intermediate files, only one `rm' command line is printed,
|
||||||
|
listing all file names.
|
||||||
|
|
||||||
|
* There are now automatic variables `$(^D)', `$(^F)', `$(?D)', and `$(?F)'.
|
||||||
|
These are the directory-only and file-only versions of `$^' and `$?'.
|
||||||
|
|
||||||
|
* Library dependencies given as `-lNAME' will use "libNAME.a" in the current
|
||||||
|
directory if it exists.
|
||||||
|
|
||||||
|
* The automatic variable `$($/)' is no longer defined.
|
||||||
|
|
||||||
|
* Leading `+' characters on a command line make that line be executed even
|
||||||
|
under -n, -t, or -q (as if the line contained `$(MAKE)').
|
||||||
|
|
||||||
|
* For command lines containing `$(MAKE)', `${MAKE}', or leading `+' characters,
|
||||||
|
only those lines are executed, not their entire rules.
|
||||||
|
(This is how Unix make behaves for lines containing `$(MAKE)' or `${MAKE}'.)
|
||||||
|
|
||||||
|
Version 3.50
|
||||||
|
|
||||||
|
* Filenames in rules will now have ~ and ~USER expanded.
|
||||||
|
|
||||||
|
* The `-p' output has been changed so it can be used as a makefile.
|
||||||
|
(All information that isn't specified by makefiles is prefaced with comment
|
||||||
|
characters.)
|
||||||
|
|
||||||
|
Version 3.49
|
||||||
|
|
||||||
|
* The % character can be quoted with backslash in implicit pattern rules,
|
||||||
|
static pattern rules, `vpath' directives, and `patsubst', `filter', and
|
||||||
|
`filter-out' functions. A warning is issued if a `vpath' directive's
|
||||||
|
pattern contains no %.
|
||||||
|
|
||||||
|
* The `wildcard' variable expansion function now expands ~ and ~USER.
|
||||||
|
|
||||||
|
* Messages indicating failed commands now contain the target name:
|
||||||
|
make: *** [target] Error 1
|
||||||
|
|
||||||
|
* The `-p' output format has been changed somewhat to look more like
|
||||||
|
makefile rules and to give all information that Make has about files.
|
||||||
|
|
||||||
|
Version 3.48
|
||||||
|
|
||||||
|
Version 3.47
|
||||||
|
|
||||||
|
* The `-l' switch with no argument removes any previous load-average limit.
|
||||||
|
|
||||||
|
* When the `-w' switch is in effect, and Make has updated makefiles,
|
||||||
|
it will write a `Leaving directory' messagfe before re-executing itself.
|
||||||
|
This makes the `directory change tracking' changes to Emacs's compilation
|
||||||
|
commands work properly.
|
||||||
|
|
||||||
|
Version 3.46
|
||||||
|
|
||||||
|
* The automatic variable `$*' is now defined for explicit rules,
|
||||||
|
as it is in Unix make.
|
||||||
|
|
||||||
|
Version 3.45
|
||||||
|
|
||||||
|
* The `-j' switch is now put in the MAKEFLAGS and MFLAGS variables when
|
||||||
|
specified without an argument (indicating infinite jobs).
|
||||||
|
The `-l' switch is not always put in the MAKEFLAGS and MFLAGS variables.
|
||||||
|
|
||||||
|
* Make no longer checks hashed directories after running commands.
|
||||||
|
The behavior implemented in 3.41 caused too much slowdown.
|
||||||
|
|
||||||
|
Version 3.44
|
||||||
|
|
||||||
|
* A dependency is NOT considered newer than its dependent if
|
||||||
|
they have the same modification time. The behavior implemented
|
||||||
|
in 3.43 conflicts with RCS.
|
||||||
|
|
||||||
|
Version 3.43
|
||||||
|
|
||||||
|
* Dependency loops are no longer fatal errors.
|
||||||
|
|
||||||
|
* A dependency is considered newer than its dependent if
|
||||||
|
they have the same modification time.
|
||||||
|
|
||||||
|
Version 3.42
|
||||||
|
|
||||||
|
* The variables F77 and F77FLAGS are now set by default to $(FC) and
|
||||||
|
$(FFLAGS). Makefiles designed for System V make may use these variables in
|
||||||
|
explicit rules and expect them to be set. Unfortunately, there is no way to
|
||||||
|
make setting these affect the Fortran implicit rules unless FC and FFLAGS
|
||||||
|
are not used (and these are used by BSD make).
|
||||||
|
|
||||||
|
Version 3.41
|
||||||
|
|
||||||
|
* Make now checks to see if its hashed directories are changed by commands.
|
||||||
|
Other makes that hash directories (Sun, 4.3 BSD) don't do this.
|
||||||
|
|
||||||
|
Version 3.39
|
||||||
|
|
||||||
|
* The `shell' function no longer captures standard error output.
|
||||||
|
|
||||||
|
Version 3.32
|
||||||
|
|
||||||
|
* A file beginning with a dot can be the default target if it also contains
|
||||||
|
a slash (e.g., `../bin/foo'). (Unix make allows this as well.)
|
||||||
|
|
||||||
|
Version 3.31
|
||||||
|
|
||||||
|
* Archive member names are truncated to 15 characters.
|
||||||
|
|
||||||
|
* Yet more USG stuff.
|
||||||
|
|
||||||
|
* Minimal support for Microport System V (a 16-bit machine and a
|
||||||
|
brain-damaged compiler). This has even lower priority than other USG
|
||||||
|
support, so if it gets beyond trivial, I will take it out completely.
|
||||||
|
|
||||||
|
* Revamped default implicit rules (not much visible change).
|
||||||
|
|
||||||
|
* The -d and -p options can come from the environment.
|
||||||
|
|
||||||
|
Version 3.30
|
||||||
|
|
||||||
|
* Improved support for USG and HPUX (hopefully).
|
||||||
|
|
||||||
|
* A variable reference like `$(foo:a=b)', if `a' contains a `%', is
|
||||||
|
equivalent to `$(patsubst a,b,$(foo))'.
|
||||||
|
|
||||||
|
* Defining .DEFAULT with no deps or commands clears its commands.
|
||||||
|
|
||||||
|
* New default implicit rules for .S (cpp, then as), and .sh (copy and make
|
||||||
|
executable). All default implicit rules that use cpp (even indirectly), use
|
||||||
|
$(CPPFLAGS).
|
||||||
|
|
||||||
|
Version 3.29
|
||||||
|
|
||||||
|
* Giving the -j option with no arguments gives you infinite jobs.
|
||||||
|
|
||||||
|
Version 3.28
|
||||||
|
|
||||||
|
* New option: "-l LOAD" says not to start any new jobs while others are
|
||||||
|
running if the load average is not below LOAD (a floating-point number).
|
||||||
|
|
||||||
|
* There is support in place for implementations of remote command execution
|
||||||
|
in Make. See the file remote.c.
|
||||||
|
|
||||||
|
Version 3.26
|
||||||
|
|
||||||
|
* No more than 10 directories will be kept open at once.
|
||||||
|
(This number can be changed by redefining MAX_OPEN_DIRECTORIES in dir.c.)
|
||||||
|
|
||||||
|
Version 3.25
|
||||||
|
|
||||||
|
* Archive files will have their modification times recorded before doing
|
||||||
|
anything that might change their modification times by updating an archive
|
||||||
|
member.
|
||||||
|
|
||||||
|
Version 3.20
|
||||||
|
|
||||||
|
* The `MAKELEVEL' variable is defined for use by makefiles.
|
||||||
|
|
||||||
|
Version 3.19
|
||||||
|
|
||||||
|
* The recursion level indications in error messages are much shorter than
|
||||||
|
they were in version 3.14.
|
||||||
|
|
||||||
|
Version 3.18
|
||||||
|
|
||||||
|
* Leading spaces before directives are ignored (as documented).
|
||||||
|
|
||||||
|
* Included makefiles can determine the default goal target.
|
||||||
|
(System V Make does it this way, so we are being compatible).
|
||||||
|
|
||||||
|
Version 3.14.
|
||||||
|
|
||||||
|
* Variables that are defaults built into Make will not be put in the
|
||||||
|
environment for children. This just saves some environment space and,
|
||||||
|
except under -e, will be transparent to sub-makes.
|
||||||
|
|
||||||
|
* Error messages from sub-makes will indicate the level of recursion.
|
||||||
|
|
||||||
|
* Hopefully some speed-up for large directories due to a change in the
|
||||||
|
directory hashing scheme.
|
||||||
|
|
||||||
|
* One child will always get a standard input that is usable.
|
||||||
|
|
||||||
|
* Default makefiles that don't exist will be remade and read in.
|
||||||
|
|
||||||
|
Version 3.13.
|
||||||
|
|
||||||
|
* Count parentheses inside expansion function calls so you can
|
||||||
|
have nested calls: `$(sort $(foreach x,a b,$(x)))'.
|
||||||
|
|
||||||
|
Version 3.12.
|
||||||
|
|
||||||
|
* Several bug fixes, including USG and Sun386i support.
|
||||||
|
|
||||||
|
* `shell' function to expand shell commands a la `
|
||||||
|
|
||||||
|
* If the `-d' flag is given, version information will be printed.
|
||||||
|
|
||||||
|
* The `-c' option has been renamed to `-C' for compatibility with tar.
|
||||||
|
|
||||||
|
* The `-p' option no longer inhibits other normal operation.
|
||||||
|
|
||||||
|
* Makefiles will be updated and re-read if necessary.
|
||||||
|
|
||||||
|
* Can now run several commands at once (parallelism), -j option.
|
||||||
|
|
||||||
|
* Error messages will contain the level of Make recursion, if any.
|
||||||
|
|
||||||
|
* The `MAKEFLAGS' and `MFLAGS' variables will be scanned for options after
|
||||||
|
makefiles are read.
|
||||||
|
|
||||||
|
* A double-colon rule with no dependencies will always have its commands run.
|
||||||
|
(This is how both the BSD and System V versions of Make do it.)
|
||||||
|
|
||||||
|
Version 3.05
|
||||||
|
|
||||||
|
(Changes from versions 1 through 3.05 were never recorded. Sorry.)
|
||||||
|
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
Copyright information:
|
||||||
|
|
||||||
|
Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Permission is granted to anyone to make or distribute verbatim copies
|
||||||
|
of this document as received, in any medium, provided that the
|
||||||
|
copyright notice and this permission notice are preserved,
|
||||||
|
thus giving the recipient permission to redistribute in turn.
|
||||||
|
|
||||||
|
Permission is granted to distribute modified versions
|
||||||
|
of this document, or of portions of it,
|
||||||
|
under the above conditions, provided also that they
|
||||||
|
carry prominent notices stating who last changed them.
|
||||||
|
|
||||||
|
Local variables:
|
||||||
|
version-control: never
|
||||||
|
end:
|
||||||
28
README
Normal file
28
README
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
This directory contains the 3.73 test release of GNU Make.
|
||||||
|
All bugs reported for previous test releases have been fixed.
|
||||||
|
Some bugs surely remain.
|
||||||
|
|
||||||
|
For general building and installation instructions, see the file INSTALL.
|
||||||
|
If you need to build GNU Make and have no other `make' program to use,
|
||||||
|
you can use the shell script `build.sh' instead. To do this, first run
|
||||||
|
`configure' as described in INSTALL. Then, instead of typing `make' to
|
||||||
|
build the program, type `sh build.sh'. This should compile the program
|
||||||
|
in the current directory. Then you will have a Make program that you can
|
||||||
|
use for `make install', or whatever else.
|
||||||
|
|
||||||
|
It has been reported that the XLC 1.2 compiler on AIX 3.2 is buggy such
|
||||||
|
that if you compile make with `cc -O' on AIX 3.2, it will not work correctly.
|
||||||
|
It is said that using `cc' without `-O' does work.
|
||||||
|
|
||||||
|
One area that is often a problem in configuration and porting is the code
|
||||||
|
to check the system's current load average. To make it easier to test and
|
||||||
|
debug this code, you can do `make check-loadavg' to see if it works
|
||||||
|
properly on your system. (You must run `configure' beforehand, but you
|
||||||
|
need not build Make itself to run this test.)
|
||||||
|
|
||||||
|
See the file NEWS for what has changed since previous releases.
|
||||||
|
|
||||||
|
GNU Make is fully documented in make.texinfo. See the section entitled
|
||||||
|
`Problems and Bugs' for information on submitting bug reports.
|
||||||
|
|
||||||
|
GNU Make is free software. See the file COPYING for copying conditions.
|
||||||
@@ -12,3 +12,6 @@
|
|||||||
|
|
||||||
/* Define this if you have the `union wait' type in <sys/wait.h>. */
|
/* Define this if you have the `union wait' type in <sys/wait.h>. */
|
||||||
#undef HAVE_UNION_WAIT
|
#undef HAVE_UNION_WAIT
|
||||||
|
|
||||||
|
/* Define this if the POSIX.1 call `sysconf (_SC_OPEN_MAX)' works properly. */
|
||||||
|
#undef HAVE_SYSCONF_OPEN_MAX
|
||||||
|
|||||||
19
aclocal.m4
vendored
Normal file
19
aclocal.m4
vendored
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
dnl
|
||||||
|
dnl Check for a symbol
|
||||||
|
dnl
|
||||||
|
AC_DEFUN(AC_CHECK_SYMBOL, [dnl
|
||||||
|
AC_MSG_CHECKING(for $1)
|
||||||
|
AC_CACHE_VAL(ac_cv_check_symbol_$1, [dnl
|
||||||
|
AC_TRY_LINK(,
|
||||||
|
changequote(,)dnl
|
||||||
|
extern char *$1[]; puts(*$1);,
|
||||||
|
changequote([,])dnl
|
||||||
|
ac_cv_check_symbol_$1=yes, ac_cv_check_symbol_$1=no)])
|
||||||
|
if test "$ac_cv_check_symbol_$1" = yes; then
|
||||||
|
changequote(,)dnl
|
||||||
|
ac_tr_symbol=`echo $1 | tr '[a-z]' '[A-Z]'`
|
||||||
|
changequote([,])dnl
|
||||||
|
AC_DEFINE_UNQUOTED(HAVE_${ac_tr_symbol})
|
||||||
|
fi
|
||||||
|
AC_MSG_RESULT($ac_cv_check_symbol_$1)])dnl
|
||||||
|
dnl
|
||||||
4
arscan.c
4
arscan.c
@@ -429,11 +429,11 @@ ar_name_equal (name, mem, truncated)
|
|||||||
struct ar_hdr hdr;
|
struct ar_hdr hdr;
|
||||||
return !strncmp (name, mem,
|
return !strncmp (name, mem,
|
||||||
sizeof (hdr.ar_name) -
|
sizeof (hdr.ar_name) -
|
||||||
#ifndef __hpux
|
#if !defined (__hpux) && !defined (cray)
|
||||||
1
|
1
|
||||||
#else
|
#else
|
||||||
2
|
2
|
||||||
#endif /* __hpux */
|
#endif /* !__hpux && !cray */
|
||||||
);
|
);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
12
build.sh.in
12
build.sh.in
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Shell script to build GNU Make in the absence of any `make' program.
|
# Shell script to build GNU Make in the absence of any `make' program.
|
||||||
|
# @configure_input@
|
||||||
|
|
||||||
# Copyright (C) 1993, 1994 Free Software Foundation, Inc.
|
# Copyright (C) 1993, 1994 Free Software Foundation, Inc.
|
||||||
# This file is part of GNU Make.
|
# This file is part of GNU Make.
|
||||||
@@ -33,10 +33,10 @@ extras='@LIBOBJS@'
|
|||||||
REMOTE='@REMOTE@'
|
REMOTE='@REMOTE@'
|
||||||
|
|
||||||
# Common prefix for machine-independent installed files.
|
# Common prefix for machine-independent installed files.
|
||||||
prefix=@prefix@
|
prefix='@prefix@'
|
||||||
# Common prefix for machine-dependent installed files.
|
# Common prefix for machine-dependent installed files.
|
||||||
exec_prefix=@exec_prefix@
|
exec_prefix='@exec_prefix@'
|
||||||
# Directory to find libraries in for `-lLIB'.
|
# Directory to find libraries in for `-lXXX'.
|
||||||
libdir=${exec_prefix}/lib
|
libdir=${exec_prefix}/lib
|
||||||
# Directory to search by default for included makefiles.
|
# Directory to search by default for included makefiles.
|
||||||
includedir=${prefix}/include
|
includedir=${prefix}/include
|
||||||
@@ -50,8 +50,8 @@ objs="commands.o job.o dir.o file.o misc.o main.o read.o remake.o rule.o implici
|
|||||||
# Compile the source files into those objects.
|
# Compile the source files into those objects.
|
||||||
for file in `echo ${objs} | sed 's/\.o/.c/g'`; do
|
for file in `echo ${objs} | sed 's/\.o/.c/g'`; do
|
||||||
echo compiling ${file}...
|
echo compiling ${file}...
|
||||||
$CC $CPPFLAGS $CFLAGS $defines -c \
|
$CC $defines $CPPFLAGS $CFLAGS \
|
||||||
-I. -I${srcdir} -I${srcdir}/glob ${srcdir}/$file
|
-c -I. -I${srcdir} -I${srcdir}/glob ${srcdir}/$file
|
||||||
done
|
done
|
||||||
|
|
||||||
# The object files were actually all put in the current directory.
|
# The object files were actually all put in the current directory.
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Shell script to build GNU Make in the absence of any `make' program.
|
# Shell script to build GNU Make in the absence of any `make' program.
|
||||||
|
# @configure_input@
|
||||||
|
|
||||||
# Copyright (C) 1993 Free Software Foundation, Inc.
|
# Copyright (C) 1993, 1994 Free Software Foundation, Inc.
|
||||||
# This file is part of GNU Make.
|
# This file is part of GNU Make.
|
||||||
#
|
#
|
||||||
# GNU Make is free software; you can redistribute it and/or modify
|
# GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -24,6 +24,7 @@
|
|||||||
srcdir='@srcdir@'
|
srcdir='@srcdir@'
|
||||||
CC='@CC@'
|
CC='@CC@'
|
||||||
CFLAGS='@CFLAGS@'
|
CFLAGS='@CFLAGS@'
|
||||||
|
CPPFLAGS='@CPPFLAGS@'
|
||||||
LDFLAGS='@LDFLAGS@'
|
LDFLAGS='@LDFLAGS@'
|
||||||
defines='@DEFS@ -DLIBDIR="${libdir}" -DINCLUDEDIR="${includedir}"'
|
defines='@DEFS@ -DLIBDIR="${libdir}" -DINCLUDEDIR="${includedir}"'
|
||||||
ALLOCA='@ALLOCA@'
|
ALLOCA='@ALLOCA@'
|
||||||
@@ -32,9 +33,9 @@ extras='@LIBOBJS@'
|
|||||||
REMOTE='@REMOTE@'
|
REMOTE='@REMOTE@'
|
||||||
|
|
||||||
# Common prefix for machine-independent installed files.
|
# Common prefix for machine-independent installed files.
|
||||||
prefix=/usr/local
|
prefix='@prefix@'
|
||||||
# Common prefix for machine-dependent installed files.
|
# Common prefix for machine-dependent installed files.
|
||||||
exec_prefix=/usr/local
|
exec_prefix='@exec_prefix@'
|
||||||
# Directory to find libraries in for `-lXXX'.
|
# Directory to find libraries in for `-lXXX'.
|
||||||
libdir=${exec_prefix}/lib
|
libdir=${exec_prefix}/lib
|
||||||
# Directory to search by default for included makefiles.
|
# Directory to search by default for included makefiles.
|
||||||
@@ -49,7 +50,8 @@ objs="%objs% remote-${REMOTE}.o ${extras} ${ALLOCA}"
|
|||||||
# Compile the source files into those objects.
|
# Compile the source files into those objects.
|
||||||
for file in `echo ${objs} | sed 's/\.o/.c/g'`; do
|
for file in `echo ${objs} | sed 's/\.o/.c/g'`; do
|
||||||
echo compiling ${file}...
|
echo compiling ${file}...
|
||||||
$CC $CFLAGS $defines -c -I. -I${srcdir} -I${srcdir}/glob ${srcdir}/$file
|
$CC $defines $CPPFLAGS $CFLAGS \
|
||||||
|
-c -I. -I${srcdir} -I${srcdir}/glob ${srcdir}/$file
|
||||||
done
|
done
|
||||||
|
|
||||||
# The object files were actually all put in the current directory.
|
# The object files were actually all put in the current directory.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# NOTE: If you have no `make' program at all to process this makefile, run
|
# NOTE: If you have no `make' program at all to process this makefile, run
|
||||||
# `build.sh' instead.
|
# `build.sh' instead.
|
||||||
#
|
#
|
||||||
# Copyright (C) 1988, 89, 91, 92, 93, 94 Free Software Foundation, Inc.
|
# Copyright (C) 1988, 89, 91, 92, 93, 94, 1995 Free Software Foundation, Inc.
|
||||||
# This file is part of GNU Make.
|
# This file is part of GNU Make.
|
||||||
#
|
#
|
||||||
# GNU Make is free software; you can redistribute it and/or modify
|
# GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -117,8 +117,8 @@ MAKEINFO = makeinfo
|
|||||||
TEXI2DVI = texi2dvi
|
TEXI2DVI = texi2dvi
|
||||||
|
|
||||||
# Programs to make tags files.
|
# Programs to make tags files.
|
||||||
ETAGS = etags -tw
|
ETAGS = etags -w
|
||||||
CTAGS = ctags -tw
|
CTAGS = ctags -w
|
||||||
|
|
||||||
objs = commands.o job.o dir.o file.o misc.o main.o read.o remake.o \
|
objs = commands.o job.o dir.o file.o misc.o main.o read.o remake.o \
|
||||||
rule.o implicit.o default.o variable.o expand.o function.o \
|
rule.o implicit.o default.o variable.o expand.o function.o \
|
||||||
@@ -142,10 +142,9 @@ srcs = $(srcdir)/commands.c $(srcdir)/job.c $(srcdir)/dir.c \
|
|||||||
.SUFFIXES: .o .c .h .ps .dvi .info .texinfo
|
.SUFFIXES: .o .c .h .ps .dvi .info .texinfo
|
||||||
|
|
||||||
all: make
|
all: make
|
||||||
check: # No tests.
|
|
||||||
info: make.info
|
info: make.info
|
||||||
dvi: make.dvi
|
dvi: make.dvi
|
||||||
# Some makes apparently use .PHONY as the default goal is it is before `all'.
|
# Some makes apparently use .PHONY as the default goal if it is before `all'.
|
||||||
.PHONY: all check info dvi
|
.PHONY: all check info dvi
|
||||||
|
|
||||||
make.info: make.texinfo
|
make.info: make.texinfo
|
||||||
@@ -196,7 +195,7 @@ $(bindir)/$(binprefix)make: make
|
|||||||
else \
|
else \
|
||||||
echo "$@ needs to be owned by group $(group) and setgid;"; \
|
echo "$@ needs to be owned by group $(group) and setgid;"; \
|
||||||
echo "otherwise the \`-l' option will probably not work."; \
|
echo "otherwise the \`-l' option will probably not work."; \
|
||||||
echo "You may need special priveleges to install $@."; \
|
echo "You may need special privileges to install $@."; \
|
||||||
fi; \
|
fi; \
|
||||||
else true; fi
|
else true; fi
|
||||||
# Some systems can't deal with renaming onto a running binary.
|
# Some systems can't deal with renaming onto a running binary.
|
||||||
@@ -242,7 +241,7 @@ check: check-loadavg
|
|||||||
|
|
||||||
.PHONY: clean realclean distclean mostlyclean
|
.PHONY: clean realclean distclean mostlyclean
|
||||||
clean: glob-clean
|
clean: glob-clean
|
||||||
-rm -f make loadavg *.o core make.info* make.dvi
|
-rm -f make loadavg *.o core make.dvi
|
||||||
distclean: clean glob-realclean
|
distclean: clean glob-realclean
|
||||||
-rm -f Makefile config.h config.status build.sh stamp-config
|
-rm -f Makefile config.h config.status build.sh stamp-config
|
||||||
-rm -f config.log config.cache
|
-rm -f config.log config.cache
|
||||||
@@ -250,6 +249,7 @@ distclean: clean glob-realclean
|
|||||||
-rm -f make.?? make.??s make.log make.toc make.*aux
|
-rm -f make.?? make.??s make.log make.toc make.*aux
|
||||||
-rm -f loadavg.c
|
-rm -f loadavg.c
|
||||||
realclean: distclean
|
realclean: distclean
|
||||||
|
-rm -f make.info*
|
||||||
mostlyclean: clean
|
mostlyclean: clean
|
||||||
|
|
||||||
.PHONY: glob-clean glob-realclean
|
.PHONY: glob-clean glob-realclean
|
||||||
@@ -265,11 +265,10 @@ stamp-config: config.status $(srcdir)/config.h.in
|
|||||||
$(SHELL) config.status
|
$(SHELL) config.status
|
||||||
touch stamp-config
|
touch stamp-config
|
||||||
|
|
||||||
# These rules cause too much trouble.
|
#configure: configure.in aclocal.m4
|
||||||
#configure: configure.in
|
# cd $(srcdir) && autoconf $(ACFLAGS)
|
||||||
# autoconf $(ACFLAGS)
|
#config.h.in: configure.in aclocal.m4
|
||||||
#config.h.in: configure.in
|
# cd $(srcdir) && autoheader $(ACFLAGS)
|
||||||
# autoheader $(ACFLAGS)
|
|
||||||
|
|
||||||
# This tells versions [3.59,3.63) of GNU make not to export all variables.
|
# This tells versions [3.59,3.63) of GNU make not to export all variables.
|
||||||
.NOEXPORT:
|
.NOEXPORT:
|
||||||
|
|||||||
270
config.h.in
Normal file
270
config.h.in
Normal file
@@ -0,0 +1,270 @@
|
|||||||
|
/* config.h.in. Generated automatically from configure.in by autoheader. */
|
||||||
|
|
||||||
|
/* Define if on AIX 3.
|
||||||
|
System headers sometimes define this.
|
||||||
|
We just want to avoid a redefinition error message. */
|
||||||
|
#ifndef _ALL_SOURCE
|
||||||
|
#undef _ALL_SOURCE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* 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. */
|
||||||
|
#undef CRAY_STACKSEG_END
|
||||||
|
|
||||||
|
/* Define for DGUX with <sys/dg_sys_info.h>. */
|
||||||
|
#undef DGUX
|
||||||
|
|
||||||
|
/* Define if the `getloadavg' function needs to be run setuid or setgid. */
|
||||||
|
#undef GETLOADAVG_PRIVILEGED
|
||||||
|
|
||||||
|
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||||
|
#undef gid_t
|
||||||
|
|
||||||
|
/* Define 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). */
|
||||||
|
#undef HAVE_ALLOCA_H
|
||||||
|
|
||||||
|
/* Define if you don't have vprintf but do have _doprnt. */
|
||||||
|
#undef HAVE_DOPRNT
|
||||||
|
|
||||||
|
/* Define if your system has its own `getloadavg' function. */
|
||||||
|
#undef HAVE_GETLOADAVG
|
||||||
|
|
||||||
|
/* Define if you have the getmntent function. */
|
||||||
|
#undef HAVE_GETMNTENT
|
||||||
|
|
||||||
|
/* Define if the `long double' type works. */
|
||||||
|
#undef HAVE_LONG_DOUBLE
|
||||||
|
|
||||||
|
/* Define if you support file names longer than 14 characters. */
|
||||||
|
#undef HAVE_LONG_FILE_NAMES
|
||||||
|
|
||||||
|
/* Define if you have a working `mmap' system call. */
|
||||||
|
#undef HAVE_MMAP
|
||||||
|
|
||||||
|
/* Define if system calls automatically restart after interruption
|
||||||
|
by a signal. */
|
||||||
|
#undef HAVE_RESTARTABLE_SYSCALLS
|
||||||
|
|
||||||
|
/* Define if your struct stat has st_blksize. */
|
||||||
|
#undef HAVE_ST_BLKSIZE
|
||||||
|
|
||||||
|
/* Define if your struct stat has st_blocks. */
|
||||||
|
#undef HAVE_ST_BLOCKS
|
||||||
|
|
||||||
|
/* Define if you have the strcoll function and it is properly defined. */
|
||||||
|
#undef HAVE_STRCOLL
|
||||||
|
|
||||||
|
/* Define if your struct stat has st_rdev. */
|
||||||
|
#undef HAVE_ST_RDEV
|
||||||
|
|
||||||
|
/* Define if you have the strftime function. */
|
||||||
|
#undef HAVE_STRFTIME
|
||||||
|
|
||||||
|
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
|
||||||
|
#undef HAVE_SYS_WAIT_H
|
||||||
|
|
||||||
|
/* Define if your struct tm has tm_zone. */
|
||||||
|
#undef HAVE_TM_ZONE
|
||||||
|
|
||||||
|
/* Define if you don't have tm_zone but do have the external array
|
||||||
|
tzname. */
|
||||||
|
#undef HAVE_TZNAME
|
||||||
|
|
||||||
|
/* Define if you have <unistd.h>. */
|
||||||
|
#undef HAVE_UNISTD_H
|
||||||
|
|
||||||
|
/* Define if utime(file, NULL) sets file's timestamp to the present. */
|
||||||
|
#undef HAVE_UTIME_NULL
|
||||||
|
|
||||||
|
/* Define if you have <vfork.h>. */
|
||||||
|
#undef HAVE_VFORK_H
|
||||||
|
|
||||||
|
/* Define if you have the vprintf function. */
|
||||||
|
#undef HAVE_VPRINTF
|
||||||
|
|
||||||
|
/* Define if you have the wait3 system call. */
|
||||||
|
#undef HAVE_WAIT3
|
||||||
|
|
||||||
|
/* Define if on MINIX. */
|
||||||
|
#undef _MINIX
|
||||||
|
|
||||||
|
/* Define if your struct nlist has an n_un member. */
|
||||||
|
#undef NLIST_NAME_UNION
|
||||||
|
|
||||||
|
/* Define if you have <nlist.h>. */
|
||||||
|
#undef NLIST_STRUCT
|
||||||
|
|
||||||
|
/* Define if your C compiler doesn't accept -c and -o together. */
|
||||||
|
#undef NO_MINUS_C_MINUS_O
|
||||||
|
|
||||||
|
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||||
|
#undef pid_t
|
||||||
|
|
||||||
|
/* Define if the system does not provide POSIX.1 features except
|
||||||
|
with this defined. */
|
||||||
|
#undef _POSIX_1_SOURCE
|
||||||
|
|
||||||
|
/* Define if you need to in order for stat and other things to work. */
|
||||||
|
#undef _POSIX_SOURCE
|
||||||
|
|
||||||
|
/* Define as the return type of signal handlers (int or void). */
|
||||||
|
#undef RETSIGTYPE
|
||||||
|
|
||||||
|
/* Define if the setvbuf function takes the buffering type as its second
|
||||||
|
argument and the buffer pointer as the third, as on System V
|
||||||
|
before release 3. */
|
||||||
|
#undef SETVBUF_REVERSED
|
||||||
|
|
||||||
|
/* 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 the `S_IS*' macros in <sys/stat.h> do not work properly. */
|
||||||
|
#undef STAT_MACROS_BROKEN
|
||||||
|
|
||||||
|
/* Define if you have the ANSI C header files. */
|
||||||
|
#undef STDC_HEADERS
|
||||||
|
|
||||||
|
/* Define on System V Release 4. */
|
||||||
|
#undef SVR4
|
||||||
|
|
||||||
|
/* Define if `sys_siglist' is declared by <signal.h>. */
|
||||||
|
#undef SYS_SIGLIST_DECLARED
|
||||||
|
|
||||||
|
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||||
|
#undef uid_t
|
||||||
|
|
||||||
|
/* Define for Encore UMAX. */
|
||||||
|
#undef UMAX
|
||||||
|
|
||||||
|
/* Define for Encore UMAX 4.3 that has <inq_status/cpustats.h>
|
||||||
|
instead of <sys/cpustats.h>. */
|
||||||
|
#undef UMAX4_3
|
||||||
|
|
||||||
|
/* Define vfork as fork if vfork does not work. */
|
||||||
|
#undef vfork
|
||||||
|
|
||||||
|
/* Define to the name of the SCCS `get' command. */
|
||||||
|
#undef SCCS_GET
|
||||||
|
|
||||||
|
/* Define this if the SCCS `get' command understands the `-G<file>' option. */
|
||||||
|
#undef SCCS_GET_MINUS_G
|
||||||
|
|
||||||
|
/* Define this if the C library defines the variable `sys_siglist'. */
|
||||||
|
#undef HAVE_SYS_SIGLIST
|
||||||
|
|
||||||
|
/* Define this if the C library defines the variable `_sys_siglist'. */
|
||||||
|
#undef HAVE__SYS_SIGLIST
|
||||||
|
|
||||||
|
/* Define this if you have the `union wait' type in <sys/wait.h>. */
|
||||||
|
#undef HAVE_UNION_WAIT
|
||||||
|
|
||||||
|
/* Define this if the POSIX.1 call `sysconf (_SC_OPEN_MAX)' works properly. */
|
||||||
|
#undef HAVE_SYSCONF_OPEN_MAX
|
||||||
|
|
||||||
|
/* Define if you have the dup2 function. */
|
||||||
|
#undef HAVE_DUP2
|
||||||
|
|
||||||
|
/* Define if you have the getcwd function. */
|
||||||
|
#undef HAVE_GETCWD
|
||||||
|
|
||||||
|
/* Define if you have the getdtablesize function. */
|
||||||
|
#undef HAVE_GETDTABLESIZE
|
||||||
|
|
||||||
|
/* Define if you have the getgroups function. */
|
||||||
|
#undef HAVE_GETGROUPS
|
||||||
|
|
||||||
|
/* Define if you have the mktemp function. */
|
||||||
|
#undef HAVE_MKTEMP
|
||||||
|
|
||||||
|
/* Define if you have the psignal function. */
|
||||||
|
#undef HAVE_PSIGNAL
|
||||||
|
|
||||||
|
/* Define if you have the setegid function. */
|
||||||
|
#undef HAVE_SETEGID
|
||||||
|
|
||||||
|
/* Define if you have the seteuid function. */
|
||||||
|
#undef HAVE_SETEUID
|
||||||
|
|
||||||
|
/* Define if you have the setlinebuf function. */
|
||||||
|
#undef HAVE_SETLINEBUF
|
||||||
|
|
||||||
|
/* Define if you have the setregid function. */
|
||||||
|
#undef HAVE_SETREGID
|
||||||
|
|
||||||
|
/* Define if you have the setreuid function. */
|
||||||
|
#undef HAVE_SETREUID
|
||||||
|
|
||||||
|
/* Define if you have the sigsetmask function. */
|
||||||
|
#undef HAVE_SIGSETMASK
|
||||||
|
|
||||||
|
/* Define if you have the strerror function. */
|
||||||
|
#undef HAVE_STRERROR
|
||||||
|
|
||||||
|
/* Define if you have the strsignal function. */
|
||||||
|
#undef HAVE_STRSIGNAL
|
||||||
|
|
||||||
|
/* Define if you have the wait3 function. */
|
||||||
|
#undef HAVE_WAIT3
|
||||||
|
|
||||||
|
/* Define if you have the waitpid function. */
|
||||||
|
#undef HAVE_WAITPID
|
||||||
|
|
||||||
|
/* Define if you have the <dirent.h> header file. */
|
||||||
|
#undef HAVE_DIRENT_H
|
||||||
|
|
||||||
|
/* Define if you have the <fcntl.h> header file. */
|
||||||
|
#undef HAVE_FCNTL_H
|
||||||
|
|
||||||
|
/* Define if you have the <limits.h> header file. */
|
||||||
|
#undef HAVE_LIMITS_H
|
||||||
|
|
||||||
|
/* Define if you have the <mach/mach.h> header file. */
|
||||||
|
#undef HAVE_MACH_MACH_H
|
||||||
|
|
||||||
|
/* Define if you have the <memory.h> header file. */
|
||||||
|
#undef HAVE_MEMORY_H
|
||||||
|
|
||||||
|
/* Define if you have the <ndir.h> header file. */
|
||||||
|
#undef HAVE_NDIR_H
|
||||||
|
|
||||||
|
/* Define if you have the <string.h> header file. */
|
||||||
|
#undef HAVE_STRING_H
|
||||||
|
|
||||||
|
/* Define if you have the <sys/dir.h> header file. */
|
||||||
|
#undef HAVE_SYS_DIR_H
|
||||||
|
|
||||||
|
/* Define if you have the <sys/ndir.h> header file. */
|
||||||
|
#undef HAVE_SYS_NDIR_H
|
||||||
|
|
||||||
|
/* Define if you have the <sys/param.h> header file. */
|
||||||
|
#undef HAVE_SYS_PARAM_H
|
||||||
|
|
||||||
|
/* Define if you have the <sys/timeb.h> header file. */
|
||||||
|
#undef HAVE_SYS_TIMEB_H
|
||||||
|
|
||||||
|
/* Define if you have the <sys/wait.h> header file. */
|
||||||
|
#undef HAVE_SYS_WAIT_H
|
||||||
|
|
||||||
|
/* Define if you have the <unistd.h> header file. */
|
||||||
|
#undef HAVE_UNISTD_H
|
||||||
|
|
||||||
|
/* Define if you have the dgc library (-ldgc). */
|
||||||
|
#undef HAVE_LIBDGC
|
||||||
|
|
||||||
|
/* Define if you have the sun library (-lsun). */
|
||||||
|
#undef HAVE_LIBSUN
|
||||||
@@ -16,7 +16,9 @@
|
|||||||
#define RETSIGTYPE void
|
#define RETSIGTYPE void
|
||||||
|
|
||||||
/* Define if you have the ANSI C header files. */
|
/* Define if you have the ANSI C header files. */
|
||||||
|
#ifndef STDC_HEADERS
|
||||||
#define STDC_HEADERS
|
#define STDC_HEADERS
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Define if `sys_siglist' is declared by <signal.h>. */
|
/* Define if `sys_siglist' is declared by <signal.h>. */
|
||||||
#define SYS_SIGLIST_DECLARED
|
#define SYS_SIGLIST_DECLARED
|
||||||
@@ -49,7 +51,7 @@
|
|||||||
#define HAVE_LIMITS_H
|
#define HAVE_LIMITS_H
|
||||||
|
|
||||||
/* Define if you have the <sys/param.h> header file. */
|
/* Define if you have the <sys/param.h> header file. */
|
||||||
#define HAVE_SYS_PARAM_H
|
#undef HAVE_SYS_PARAM_H
|
||||||
|
|
||||||
/* Define if you have the <fcntl.h> header file. */
|
/* Define if you have the <fcntl.h> header file. */
|
||||||
#define HAVE_FCNTL_H
|
#define HAVE_FCNTL_H
|
||||||
@@ -60,6 +62,7 @@
|
|||||||
/* Define if you have the <memory.h> header file. */
|
/* Define if you have the <memory.h> header file. */
|
||||||
#define HAVE_MEMORY_H
|
#define HAVE_MEMORY_H
|
||||||
|
|
||||||
#define INCLUDEDIR "c:/djgpp/include"
|
/* Define if you have the `strerror' function. */
|
||||||
#define LIBDIR "c:/djgpp/lib"
|
#define HAVE_STRERROR
|
||||||
|
|
||||||
#define SCCS_GET "get"
|
#define SCCS_GET "get"
|
||||||
|
|||||||
@@ -17,7 +17,8 @@ echo "} ">> config.sed
|
|||||||
|
|
||||||
echo "s/@srcdir@/./ ">> config.sed
|
echo "s/@srcdir@/./ ">> config.sed
|
||||||
echo "s/@CC@/gcc/ ">> config.sed
|
echo "s/@CC@/gcc/ ">> config.sed
|
||||||
echo "s/@CFLAGS@/-O2 -g -DHAVE_CONFIG_H/ ">> config.sed
|
echo "s/@CFLAGS@/-O2 -g/ ">> config.sed
|
||||||
|
echo "s/@CPPFLAGS@/-DHAVE_CONFIG_H/ ">> config.sed
|
||||||
echo "s/@LDFLAGS@// ">> config.sed
|
echo "s/@LDFLAGS@// ">> config.sed
|
||||||
echo "s/@RANLIB@/ranlib/ ">> config.sed
|
echo "s/@RANLIB@/ranlib/ ">> config.sed
|
||||||
echo "s/@DEFS@// ">> config.sed
|
echo "s/@DEFS@// ">> config.sed
|
||||||
|
|||||||
24
configure.in
24
configure.in
@@ -5,10 +5,6 @@ AC_INIT(vpath.c)dnl dnl A distinctive file to look for in srcdir.
|
|||||||
AC_CONFIG_HEADER(config.h)
|
AC_CONFIG_HEADER(config.h)
|
||||||
AC_CONFIG_SUBDIRS(glob) dnl Run configure in glob subdirectory.
|
AC_CONFIG_SUBDIRS(glob) dnl Run configure in glob subdirectory.
|
||||||
|
|
||||||
# We want these before the checks, so the checks can modify their values.
|
|
||||||
test -z "$CFLAGS" && CFLAGS=-g AC_SUBST(CFLAGS)
|
|
||||||
test -z "$LDFLAGS" && LDFLAGS=-g AC_SUBST(LDFLAGS)
|
|
||||||
|
|
||||||
AC_PROG_MAKE_SET
|
AC_PROG_MAKE_SET
|
||||||
AC_PROG_CC
|
AC_PROG_CC
|
||||||
AC_PROG_INSTALL
|
AC_PROG_INSTALL
|
||||||
@@ -19,7 +15,6 @@ AC_MINIX
|
|||||||
AC_HEADER_STDC
|
AC_HEADER_STDC
|
||||||
AC_HEADER_DIRENT
|
AC_HEADER_DIRENT
|
||||||
AC_TYPE_UID_T dnl Also does gid_t.
|
AC_TYPE_UID_T dnl Also does gid_t.
|
||||||
AC_TYPE_GETGROUPS
|
|
||||||
AC_TYPE_PID_T
|
AC_TYPE_PID_T
|
||||||
AC_TYPE_SIGNAL
|
AC_TYPE_SIGNAL
|
||||||
AC_CHECK_HEADERS(unistd.h limits.h sys/param.h fcntl.h string.h memory.h \
|
AC_CHECK_HEADERS(unistd.h limits.h sys/param.h fcntl.h string.h memory.h \
|
||||||
@@ -43,9 +38,9 @@ changequote([,])dnl
|
|||||||
fi
|
fi
|
||||||
AC_MSG_RESULT($ac_cv_check_symbol_$1)])dnl
|
AC_MSG_RESULT($ac_cv_check_symbol_$1)])dnl
|
||||||
|
|
||||||
AC_CHECK_FUNCS(getdtablesize psignal \
|
AC_CHECK_FUNCS(getdtablesize psignal mktemp \
|
||||||
dup2 getcwd sigsetmask getgroups setlinebuf \
|
dup2 getcwd sigsetmask getgroups setlinebuf \
|
||||||
seteuid setegid setreuid setregid strerror)
|
seteuid setegid setreuid setregid strerror strsignal)
|
||||||
AC_CHECK_SYMBOL(sys_siglist)
|
AC_CHECK_SYMBOL(sys_siglist)
|
||||||
AC_CHECK_SYMBOL(_sys_siglist)
|
AC_CHECK_SYMBOL(_sys_siglist)
|
||||||
AC_FUNC_ALLOCA
|
AC_FUNC_ALLOCA
|
||||||
@@ -54,6 +49,17 @@ AC_FUNC_SETVBUF_REVERSED
|
|||||||
AC_FUNC_GETLOADAVG
|
AC_FUNC_GETLOADAVG
|
||||||
AC_FUNC_STRCOLL
|
AC_FUNC_STRCOLL
|
||||||
|
|
||||||
|
if test $ac_cv_func_getdtablesize = no; then
|
||||||
|
AC_MSG_CHECKING(for sysconf (_SC_OPEN_MAX))
|
||||||
|
AC_CACHE_VAL(make_cv_sysconf_open_max, [dnl
|
||||||
|
AC_TRY_LINK([#include <unistd.h>], [int max = sysconf (_SC_OPEN_MAX);],
|
||||||
|
[make_cv_sysconf_open_max=yes], [make_cv_sysconf_open_max=no])])
|
||||||
|
if test $make_cv_sysconf_open_max = yes; then
|
||||||
|
AC_DEFINE(HAVE_SYSCONF_OPEN_MAX)
|
||||||
|
fi
|
||||||
|
AC_MSG_RESULT($make_cv_sysconf_open_max)
|
||||||
|
fi
|
||||||
|
|
||||||
# Check out the wait reality.
|
# Check out the wait reality.
|
||||||
AC_CHECK_HEADERS(sys/wait.h) AC_CHECK_FUNCS(waitpid wait3)
|
AC_CHECK_HEADERS(sys/wait.h) AC_CHECK_FUNCS(waitpid wait3)
|
||||||
AC_MSG_CHECKING(for union wait)
|
AC_MSG_CHECKING(for union wait)
|
||||||
@@ -66,6 +72,10 @@ AC_TRY_LINK([#include <sys/types.h>
|
|||||||
union wait type, and they do not work together. If union wait
|
union wait type, and they do not work together. If union wait
|
||||||
conflicts with WEXITSTATUS et al, we don't want to use it at all. */
|
conflicts with WEXITSTATUS et al, we don't want to use it at all. */
|
||||||
if (WEXITSTATUS (status) != 0) pid = -1;
|
if (WEXITSTATUS (status) != 0) pid = -1;
|
||||||
|
#ifdef WTERMSIG
|
||||||
|
/* If we have WEXITSTATUS and WTERMSIG, just use them on ints. */
|
||||||
|
-- blow chunks here --
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_WAITPID
|
#ifdef HAVE_WAITPID
|
||||||
/* Make sure union wait works with waitpid. */
|
/* Make sure union wait works with waitpid. */
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/* Data base of default implicit rules for GNU Make.
|
/* Data base of default implicit rules for GNU Make.
|
||||||
Copyright (C) 1988, 89, 90, 91, 92, 93, 94 Free Software Foundation, Inc.
|
Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 1995 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify
|
GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -209,13 +209,7 @@ static char *default_suffix_rules[] =
|
|||||||
static char *default_variables[] =
|
static char *default_variables[] =
|
||||||
{
|
{
|
||||||
"AR", "ar",
|
"AR", "ar",
|
||||||
#ifndef __hpux
|
|
||||||
"ARFLAGS", "rv",
|
"ARFLAGS", "rv",
|
||||||
#else
|
|
||||||
/* HPUX ar's f flag says to truncate the file names to archive member
|
|
||||||
name length in comparisons, so replacement notices the equality. */
|
|
||||||
"ARFLAGS", "rfv",
|
|
||||||
#endif
|
|
||||||
"AS", "as",
|
"AS", "as",
|
||||||
#ifdef GCC_IS_NATIVE
|
#ifdef GCC_IS_NATIVE
|
||||||
"CC", "gcc",
|
"CC", "gcc",
|
||||||
|
|||||||
208
expand.c
208
expand.c
@@ -1,5 +1,5 @@
|
|||||||
/* Variable expansion functions for GNU Make.
|
/* Variable expansion functions for GNU Make.
|
||||||
Copyright (C) 1988, 1989, 1991, 1992, 1993 Free Software Foundation, Inc.
|
Copyright (C) 1988, 89, 91, 92, 93, 95 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify
|
GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -197,9 +197,9 @@ variable_expand (line)
|
|||||||
char openparen = *p;
|
char openparen = *p;
|
||||||
char closeparen = (openparen == '(') ? ')' : '}';
|
char closeparen = (openparen == '(') ? ')' : '}';
|
||||||
register char *beg = p + 1;
|
register char *beg = p + 1;
|
||||||
|
int free_beg = 0;
|
||||||
char *op, *begp;
|
char *op, *begp;
|
||||||
char *end;
|
char *end, *colon;
|
||||||
char *colon = 0;
|
|
||||||
|
|
||||||
op = o;
|
op = o;
|
||||||
begp = p;
|
begp = p;
|
||||||
@@ -213,10 +213,18 @@ variable_expand (line)
|
|||||||
/* Is there a variable reference inside the parens or braces?
|
/* Is there a variable reference inside the parens or braces?
|
||||||
If so, expand it before expanding the entire reference. */
|
If so, expand it before expanding the entire reference. */
|
||||||
|
|
||||||
p1 = index (beg, closeparen);
|
end = index (beg, closeparen);
|
||||||
|
if (end == 0)
|
||||||
|
{
|
||||||
|
/* Unterminated variable reference. */
|
||||||
|
if (reading_filename != 0)
|
||||||
|
makefile_fatal (reading_filename, *reading_lineno_ptr,
|
||||||
|
"unterminated variable reference");
|
||||||
|
else
|
||||||
|
fatal ("unterminated variable reference");
|
||||||
|
}
|
||||||
|
p1 = lindex (beg, end, '$');
|
||||||
if (p1 != 0)
|
if (p1 != 0)
|
||||||
p1 = lindex (beg, p1, '$');
|
|
||||||
if (p1 != 0 && lindex (beg, p1, ':') == 0)
|
|
||||||
{
|
{
|
||||||
/* BEG now points past the opening paren or brace.
|
/* BEG now points past the opening paren or brace.
|
||||||
Count parens or braces until it is matched. */
|
Count parens or braces until it is matched. */
|
||||||
@@ -227,133 +235,109 @@ variable_expand (line)
|
|||||||
++count;
|
++count;
|
||||||
else if (*p == closeparen && --count < 0)
|
else if (*p == closeparen && --count < 0)
|
||||||
break;
|
break;
|
||||||
else if (colon == 0 && count == 0 && *p == ':')
|
|
||||||
/* Record where we found a colon, which
|
|
||||||
indicates a substitution reference.
|
|
||||||
We want to expand the text before the
|
|
||||||
reference only. */
|
|
||||||
colon = p;
|
|
||||||
}
|
}
|
||||||
/* If COUNT is >= 0, there were unmatched opening parens
|
/* If COUNT is >= 0, there were unmatched opening parens
|
||||||
or braces, so we go to the simple case of a variable name
|
or braces, so we go to the simple case of a variable name
|
||||||
such as `$($(a)'. */
|
such as `$($(a)'. */
|
||||||
if (count < 0)
|
if (count < 0)
|
||||||
{
|
{
|
||||||
char *name = expand_argument (beg, colon == 0 ? p : colon);
|
beg = expand_argument (beg, p); /* Expand the name. */
|
||||||
unsigned int namelen = strlen (name);
|
free_beg = 1; /* Remember to free BEG when finished. */
|
||||||
if (colon == 0)
|
end = index (beg, '\0');
|
||||||
{
|
|
||||||
/* This is a simple reference to the expanded name. */
|
|
||||||
o = reference_variable (o, name, namelen);
|
|
||||||
free (name);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* This is a substitution reference to the expanded
|
|
||||||
name. We replace the pending text with a copy
|
|
||||||
containing the expanded name in place of the
|
|
||||||
original name, and then fall through to
|
|
||||||
the normal substitution reference code below. */
|
|
||||||
unsigned int restlen = strlen (colon) + 1;
|
|
||||||
beg = (char *) alloca (namelen + restlen);
|
|
||||||
bcopy (name, beg, namelen);
|
|
||||||
bcopy (colon, &beg[namelen], restlen);
|
|
||||||
/* Point COLON into the new copy. */
|
|
||||||
colon = &beg[namelen];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
/* Advance P to the end of this reference. After we are
|
||||||
|
finished expanding this one, P will be incremented to
|
||||||
|
continue the scan. */
|
||||||
|
p = end;
|
||||||
|
|
||||||
/* This is not a reference to a built-in function and
|
/* This is not a reference to a built-in function and
|
||||||
it does not contain any variable references inside.
|
any variable references inside are now expanded.
|
||||||
There are several things it could be. */
|
Is the resultant text a substitution reference? */
|
||||||
|
|
||||||
if (colon == 0)
|
colon = lindex (beg, end, ':');
|
||||||
colon = index (beg, ':');
|
if (colon != 0)
|
||||||
if (colon != 0 && lindex (beg, colon, closeparen) == 0)
|
|
||||||
{
|
{
|
||||||
/* This is a substitution reference: $(FOO:A=B). */
|
/* This looks like a substitution reference: $(FOO:A=B). */
|
||||||
int count;
|
|
||||||
char *subst_beg, *subst_end, *replace_beg, *replace_end;
|
char *subst_beg, *subst_end, *replace_beg, *replace_end;
|
||||||
|
|
||||||
v = lookup_variable (beg, colon - beg);
|
|
||||||
if (v == 0)
|
|
||||||
warn_undefined (beg, colon - beg);
|
|
||||||
|
|
||||||
subst_beg = colon + 1;
|
subst_beg = colon + 1;
|
||||||
count = 0;
|
subst_end = index (subst_beg, '=');
|
||||||
for (p = subst_beg; *p != '\0'; ++p)
|
if (subst_end == 0)
|
||||||
|
/* There is no = in sight. Punt on the substitution
|
||||||
|
reference and treat this as a variable name containing
|
||||||
|
a colon, in the code below. */
|
||||||
|
colon = 0;
|
||||||
|
else
|
||||||
{
|
{
|
||||||
if (*p == openparen)
|
replace_beg = subst_end + 1;
|
||||||
++count;
|
replace_end = end;
|
||||||
else if (*p == closeparen)
|
|
||||||
--count;
|
/* Extract the variable name before the colon
|
||||||
else if (*p == '=' && count <= 0)
|
and look up that variable. */
|
||||||
break;
|
v = lookup_variable (beg, colon - beg);
|
||||||
|
if (v == 0)
|
||||||
|
warn_undefined (beg, colon - beg);
|
||||||
|
|
||||||
|
if (v != 0 && *v->value != '\0')
|
||||||
|
{
|
||||||
|
char *value = (v->recursive ? recursively_expand (v)
|
||||||
|
: v->value);
|
||||||
|
char *pattern, *percent;
|
||||||
|
if (free_beg)
|
||||||
|
{
|
||||||
|
*subst_end = '\0';
|
||||||
|
pattern = subst_beg;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pattern = (char *) alloca (subst_end - subst_beg
|
||||||
|
+ 1);
|
||||||
|
bcopy (subst_beg, pattern, subst_end - subst_beg);
|
||||||
|
pattern[subst_end - subst_beg] = '\0';
|
||||||
|
}
|
||||||
|
percent = find_percent (pattern);
|
||||||
|
if (percent != 0)
|
||||||
|
{
|
||||||
|
char *replace;
|
||||||
|
if (free_beg)
|
||||||
|
{
|
||||||
|
*replace_end = '\0';
|
||||||
|
replace = replace_beg;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
replace = (char *) alloca (replace_end
|
||||||
|
- replace_beg
|
||||||
|
+ 1);
|
||||||
|
bcopy (replace_beg, replace,
|
||||||
|
replace_end - replace_beg);
|
||||||
|
replace[replace_end - replace_beg] = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
|
o = patsubst_expand (o, value, pattern, replace,
|
||||||
|
percent, (char *) 0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
o = subst_expand (o, value,
|
||||||
|
pattern, replace_beg,
|
||||||
|
strlen (pattern),
|
||||||
|
end - replace_beg,
|
||||||
|
0, 1);
|
||||||
|
if (v->recursive)
|
||||||
|
free (value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (count > 0)
|
|
||||||
/* There were unmatched opening parens. */
|
|
||||||
return initialize_variable_output ();
|
|
||||||
subst_end = p;
|
|
||||||
|
|
||||||
replace_beg = p + 1;
|
|
||||||
count = 0;
|
|
||||||
for (p = replace_beg; *p != '\0'; ++p)
|
|
||||||
{
|
|
||||||
if (*p == openparen)
|
|
||||||
++count;
|
|
||||||
else if (*p == closeparen && --count < 0)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (count > 0)
|
|
||||||
/* There were unmatched opening parens. */
|
|
||||||
return initialize_variable_output ();
|
|
||||||
end = p;
|
|
||||||
replace_end = p;
|
|
||||||
|
|
||||||
p = expand_argument (subst_beg, subst_end);
|
|
||||||
p1 = expand_argument (replace_beg, replace_end);
|
|
||||||
|
|
||||||
if (v != 0 && *v->value != '\0')
|
|
||||||
{
|
|
||||||
char *value = (v->recursive ? recursively_expand (v)
|
|
||||||
: v->value);
|
|
||||||
char *percent = find_percent (p);
|
|
||||||
if (percent != 0)
|
|
||||||
o = patsubst_expand (o, value, p, p1,
|
|
||||||
percent, (char *) 0);
|
|
||||||
else
|
|
||||||
o = subst_expand (o, value,
|
|
||||||
p, p1, strlen (p), strlen (p1),
|
|
||||||
0, 1);
|
|
||||||
if (v->recursive)
|
|
||||||
free (value);
|
|
||||||
}
|
|
||||||
|
|
||||||
free (p);
|
|
||||||
free (p1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* No, this must be an ordinary variable reference. */
|
if (colon == 0)
|
||||||
else
|
/* This is an ordinary variable reference.
|
||||||
{
|
Look up the value of the variable. */
|
||||||
/* Look up the value of the variable. */
|
|
||||||
end = index (beg, closeparen);
|
|
||||||
if (end == 0)
|
|
||||||
{
|
|
||||||
/* Unterminated variable reference. */
|
|
||||||
if (reading_filename != 0)
|
|
||||||
makefile_fatal (reading_filename, *reading_lineno_ptr,
|
|
||||||
"unterminated variable reference");
|
|
||||||
else
|
|
||||||
fatal ("unterminated variable reference");
|
|
||||||
}
|
|
||||||
o = reference_variable (o, beg, end - beg);
|
o = reference_variable (o, beg, end - beg);
|
||||||
}
|
|
||||||
|
|
||||||
/* Advance p past the variable reference to resume scan. */
|
if (free_beg)
|
||||||
p = end;
|
free (beg);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
11
getloadavg.c
11
getloadavg.c
@@ -1,5 +1,5 @@
|
|||||||
/* Get the system load averages.
|
/* Get the system load averages.
|
||||||
Copyright (C) 1985, 86, 87, 88, 89, 91, 92, 93, 1994
|
Copyright (C) 1985, 86, 87, 88, 89, 91, 92, 93, 1994, 1995
|
||||||
Free Software Foundation, Inc.
|
Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
@@ -59,6 +59,11 @@
|
|||||||
We also #define LDAV_PRIVILEGED if a program will require
|
We also #define LDAV_PRIVILEGED if a program will require
|
||||||
special installation to be able to call getloadavg. */
|
special installation to be able to call getloadavg. */
|
||||||
|
|
||||||
|
/* This should always be first. */
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include <config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
/* Both the Emacs and non-Emacs sections want this. Some
|
/* Both the Emacs and non-Emacs sections want this. Some
|
||||||
@@ -69,10 +74,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Exclude all the code except the test program at the end
|
/* Exclude all the code except the test program at the end
|
||||||
if the system has its own `getloadavg' function.
|
if the system has its own `getloadavg' function.
|
||||||
|
|
||||||
|
|||||||
481
glob/COPYING.LIB.old
Executable file
481
glob/COPYING.LIB.old
Executable file
@@ -0,0 +1,481 @@
|
|||||||
|
GNU LIBRARY GENERAL PUBLIC LICENSE
|
||||||
|
Version 2, June 1991
|
||||||
|
|
||||||
|
Copyright (C) 1991 Free Software Foundation, Inc.
|
||||||
|
675 Mass Ave, Cambridge, MA 02139, USA
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
[This is the first released version of the library GPL. It is
|
||||||
|
numbered 2 because it goes with version 2 of the ordinary GPL.]
|
||||||
|
|
||||||
|
Preamble
|
||||||
|
|
||||||
|
The licenses for most software are designed to take away your
|
||||||
|
freedom to share and change it. By contrast, the GNU General Public
|
||||||
|
Licenses are intended to guarantee your freedom to share and change
|
||||||
|
free software--to make sure the software is free for all its users.
|
||||||
|
|
||||||
|
This license, the Library General Public License, applies to some
|
||||||
|
specially designated Free Software Foundation software, and to any
|
||||||
|
other libraries whose authors decide to use it. You can use it for
|
||||||
|
your libraries, too.
|
||||||
|
|
||||||
|
When we speak of free software, we are referring to freedom, not
|
||||||
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
|
have the freedom to distribute copies of free software (and charge for
|
||||||
|
this service if you wish), that you receive source code or can get it
|
||||||
|
if you want it, that you can change the software or use pieces of it
|
||||||
|
in new free programs; and that you know you can do these things.
|
||||||
|
|
||||||
|
To protect your rights, we need to make restrictions that forbid
|
||||||
|
anyone to deny you these rights or to ask you to surrender the rights.
|
||||||
|
These restrictions translate to certain responsibilities for you if
|
||||||
|
you distribute copies of the library, or if you modify it.
|
||||||
|
|
||||||
|
For example, if you distribute copies of the library, whether gratis
|
||||||
|
or for a fee, you must give the recipients all the rights that we gave
|
||||||
|
you. You must make sure that they, too, receive or can get the source
|
||||||
|
code. If you link a program with the library, you must provide
|
||||||
|
complete object files to the recipients so that they can relink them
|
||||||
|
with the library, after making changes to the library and recompiling
|
||||||
|
it. And you must show them these terms so they know their rights.
|
||||||
|
|
||||||
|
Our method of protecting your rights has two steps: (1) copyright
|
||||||
|
the library, and (2) offer you this license which gives you legal
|
||||||
|
permission to copy, distribute and/or modify the library.
|
||||||
|
|
||||||
|
Also, for each distributor's protection, we want to make certain
|
||||||
|
that everyone understands that there is no warranty for this free
|
||||||
|
library. If the library is modified by someone else and passed on, we
|
||||||
|
want its recipients to know that what they have is not the original
|
||||||
|
version, so that any problems introduced by others will not reflect on
|
||||||
|
the original authors' reputations.
|
||||||
|
|
||||||
|
Finally, any free program is threatened constantly by software
|
||||||
|
patents. We wish to avoid the danger that companies distributing free
|
||||||
|
software will individually obtain patent licenses, thus in effect
|
||||||
|
transforming the program into proprietary software. To prevent this,
|
||||||
|
we have made it clear that any patent must be licensed for everyone's
|
||||||
|
free use or not licensed at all.
|
||||||
|
|
||||||
|
Most GNU software, including some libraries, is covered by the ordinary
|
||||||
|
GNU General Public License, which was designed for utility programs. This
|
||||||
|
license, the GNU Library General Public License, applies to certain
|
||||||
|
designated libraries. This license is quite different from the ordinary
|
||||||
|
one; be sure to read it in full, and don't assume that anything in it is
|
||||||
|
the same as in the ordinary license.
|
||||||
|
|
||||||
|
The reason we have a separate public license for some libraries is that
|
||||||
|
they blur the distinction we usually make between modifying or adding to a
|
||||||
|
program and simply using it. Linking a program with a library, without
|
||||||
|
changing the library, is in some sense simply using the library, and is
|
||||||
|
analogous to running a utility program or application program. However, in
|
||||||
|
a textual and legal sense, the linked executable is a combined work, a
|
||||||
|
derivative of the original library, and the ordinary General Public License
|
||||||
|
treats it as such.
|
||||||
|
|
||||||
|
Because of this blurred distinction, using the ordinary General
|
||||||
|
Public License for libraries did not effectively promote software
|
||||||
|
sharing, because most developers did not use the libraries. We
|
||||||
|
concluded that weaker conditions might promote sharing better.
|
||||||
|
|
||||||
|
However, unrestricted linking of non-free programs would deprive the
|
||||||
|
users of those programs of all benefit from the free status of the
|
||||||
|
libraries themselves. This Library General Public License is intended to
|
||||||
|
permit developers of non-free programs to use free libraries, while
|
||||||
|
preserving your freedom as a user of such programs to change the free
|
||||||
|
libraries that are incorporated in them. (We have not seen how to achieve
|
||||||
|
this as regards changes in header files, but we have achieved it as regards
|
||||||
|
changes in the actual functions of the Library.) The hope is that this
|
||||||
|
will lead to faster development of free libraries.
|
||||||
|
|
||||||
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow. Pay close attention to the difference between a
|
||||||
|
"work based on the library" and a "work that uses the library". The
|
||||||
|
former contains code derived from the library, while the latter only
|
||||||
|
works together with the library.
|
||||||
|
|
||||||
|
Note that it is possible for a library to be covered by the ordinary
|
||||||
|
General Public License rather than by this special one.
|
||||||
|
|
||||||
|
GNU LIBRARY GENERAL PUBLIC LICENSE
|
||||||
|
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||||
|
|
||||||
|
0. This License Agreement applies to any software library which
|
||||||
|
contains a notice placed by the copyright holder or other authorized
|
||||||
|
party saying it may be distributed under the terms of this Library
|
||||||
|
General Public License (also called "this License"). Each licensee is
|
||||||
|
addressed as "you".
|
||||||
|
|
||||||
|
A "library" means a collection of software functions and/or data
|
||||||
|
prepared so as to be conveniently linked with application programs
|
||||||
|
(which use some of those functions and data) to form executables.
|
||||||
|
|
||||||
|
The "Library", below, refers to any such software library or work
|
||||||
|
which has been distributed under these terms. A "work based on the
|
||||||
|
Library" means either the Library or any derivative work under
|
||||||
|
copyright law: that is to say, a work containing the Library or a
|
||||||
|
portion of it, either verbatim or with modifications and/or translated
|
||||||
|
straightforwardly into another language. (Hereinafter, translation is
|
||||||
|
included without limitation in the term "modification".)
|
||||||
|
|
||||||
|
"Source code" for a work means the preferred form of the work for
|
||||||
|
making modifications to it. For a library, complete source code means
|
||||||
|
all the source code for all modules it contains, plus any associated
|
||||||
|
interface definition files, plus the scripts used to control compilation
|
||||||
|
and installation of the library.
|
||||||
|
|
||||||
|
Activities other than copying, distribution and modification are not
|
||||||
|
covered by this License; they are outside its scope. The act of
|
||||||
|
running a program using the Library is not restricted, and output from
|
||||||
|
such a program is covered only if its contents constitute a work based
|
||||||
|
on the Library (independent of the use of the Library in a tool for
|
||||||
|
writing it). Whether that is true depends on what the Library does
|
||||||
|
and what the program that uses the Library does.
|
||||||
|
|
||||||
|
1. You may copy and distribute verbatim copies of the Library's
|
||||||
|
complete source code as you receive it, in any medium, provided that
|
||||||
|
you conspicuously and appropriately publish on each copy an
|
||||||
|
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||||
|
all the notices that refer to this License and to the absence of any
|
||||||
|
warranty; and distribute a copy of this License along with the
|
||||||
|
Library.
|
||||||
|
|
||||||
|
You may charge a fee for the physical act of transferring a copy,
|
||||||
|
and you may at your option offer warranty protection in exchange for a
|
||||||
|
fee.
|
||||||
|
|
||||||
|
2. You may modify your copy or copies of the Library or any portion
|
||||||
|
of it, thus forming a work based on the Library, and copy and
|
||||||
|
distribute such modifications or work under the terms of Section 1
|
||||||
|
above, provided that you also meet all of these conditions:
|
||||||
|
|
||||||
|
a) The modified work must itself be a software library.
|
||||||
|
|
||||||
|
b) You must cause the files modified to carry prominent notices
|
||||||
|
stating that you changed the files and the date of any change.
|
||||||
|
|
||||||
|
c) You must cause the whole of the work to be licensed at no
|
||||||
|
charge to all third parties under the terms of this License.
|
||||||
|
|
||||||
|
d) If a facility in the modified Library refers to a function or a
|
||||||
|
table of data to be supplied by an application program that uses
|
||||||
|
the facility, other than as an argument passed when the facility
|
||||||
|
is invoked, then you must make a good faith effort to ensure that,
|
||||||
|
in the event an application does not supply such function or
|
||||||
|
table, the facility still operates, and performs whatever part of
|
||||||
|
its purpose remains meaningful.
|
||||||
|
|
||||||
|
(For example, a function in a library to compute square roots has
|
||||||
|
a purpose that is entirely well-defined independent of the
|
||||||
|
application. Therefore, Subsection 2d requires that any
|
||||||
|
application-supplied function or table used by this function must
|
||||||
|
be optional: if the application does not supply it, the square
|
||||||
|
root function must still compute square roots.)
|
||||||
|
|
||||||
|
These requirements apply to the modified work as a whole. If
|
||||||
|
identifiable sections of that work are not derived from the Library,
|
||||||
|
and can be reasonably considered independent and separate works in
|
||||||
|
themselves, then this License, and its terms, do not apply to those
|
||||||
|
sections when you distribute them as separate works. But when you
|
||||||
|
distribute the same sections as part of a whole which is a work based
|
||||||
|
on the Library, the distribution of the whole must be on the terms of
|
||||||
|
this License, whose permissions for other licensees extend to the
|
||||||
|
entire whole, and thus to each and every part regardless of who wrote
|
||||||
|
it.
|
||||||
|
|
||||||
|
Thus, it is not the intent of this section to claim rights or contest
|
||||||
|
your rights to work written entirely by you; rather, the intent is to
|
||||||
|
exercise the right to control the distribution of derivative or
|
||||||
|
collective works based on the Library.
|
||||||
|
|
||||||
|
In addition, mere aggregation of another work not based on the Library
|
||||||
|
with the Library (or with a work based on the Library) on a volume of
|
||||||
|
a storage or distribution medium does not bring the other work under
|
||||||
|
the scope of this License.
|
||||||
|
|
||||||
|
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||||
|
License instead of this License to a given copy of the Library. To do
|
||||||
|
this, you must alter all the notices that refer to this License, so
|
||||||
|
that they refer to the ordinary GNU General Public License, version 2,
|
||||||
|
instead of to this License. (If a newer version than version 2 of the
|
||||||
|
ordinary GNU General Public License has appeared, then you can specify
|
||||||
|
that version instead if you wish.) Do not make any other change in
|
||||||
|
these notices.
|
||||||
|
|
||||||
|
Once this change is made in a given copy, it is irreversible for
|
||||||
|
that copy, so the ordinary GNU General Public License applies to all
|
||||||
|
subsequent copies and derivative works made from that copy.
|
||||||
|
|
||||||
|
This option is useful when you wish to copy part of the code of
|
||||||
|
the Library into a program that is not a library.
|
||||||
|
|
||||||
|
4. You may copy and distribute the Library (or a portion or
|
||||||
|
derivative of it, under Section 2) in object code or executable form
|
||||||
|
under the terms of Sections 1 and 2 above provided that you accompany
|
||||||
|
it with the complete corresponding machine-readable source code, which
|
||||||
|
must be distributed under the terms of Sections 1 and 2 above on a
|
||||||
|
medium customarily used for software interchange.
|
||||||
|
|
||||||
|
If distribution of object code is made by offering access to copy
|
||||||
|
from a designated place, then offering equivalent access to copy the
|
||||||
|
source code from the same place satisfies the requirement to
|
||||||
|
distribute the source code, even though third parties are not
|
||||||
|
compelled to copy the source along with the object code.
|
||||||
|
|
||||||
|
5. A program that contains no derivative of any portion of the
|
||||||
|
Library, but is designed to work with the Library by being compiled or
|
||||||
|
linked with it, is called a "work that uses the Library". Such a
|
||||||
|
work, in isolation, is not a derivative work of the Library, and
|
||||||
|
therefore falls outside the scope of this License.
|
||||||
|
|
||||||
|
However, linking a "work that uses the Library" with the Library
|
||||||
|
creates an executable that is a derivative of the Library (because it
|
||||||
|
contains portions of the Library), rather than a "work that uses the
|
||||||
|
library". The executable is therefore covered by this License.
|
||||||
|
Section 6 states terms for distribution of such executables.
|
||||||
|
|
||||||
|
When a "work that uses the Library" uses material from a header file
|
||||||
|
that is part of the Library, the object code for the work may be a
|
||||||
|
derivative work of the Library even though the source code is not.
|
||||||
|
Whether this is true is especially significant if the work can be
|
||||||
|
linked without the Library, or if the work is itself a library. The
|
||||||
|
threshold for this to be true is not precisely defined by law.
|
||||||
|
|
||||||
|
If such an object file uses only numerical parameters, data
|
||||||
|
structure layouts and accessors, and small macros and small inline
|
||||||
|
functions (ten lines or less in length), then the use of the object
|
||||||
|
file is unrestricted, regardless of whether it is legally a derivative
|
||||||
|
work. (Executables containing this object code plus portions of the
|
||||||
|
Library will still fall under Section 6.)
|
||||||
|
|
||||||
|
Otherwise, if the work is a derivative of the Library, you may
|
||||||
|
distribute the object code for the work under the terms of Section 6.
|
||||||
|
Any executables containing that work also fall under Section 6,
|
||||||
|
whether or not they are linked directly with the Library itself.
|
||||||
|
|
||||||
|
6. As an exception to the Sections above, you may also compile or
|
||||||
|
link a "work that uses the Library" with the Library to produce a
|
||||||
|
work containing portions of the Library, and distribute that work
|
||||||
|
under terms of your choice, provided that the terms permit
|
||||||
|
modification of the work for the customer's own use and reverse
|
||||||
|
engineering for debugging such modifications.
|
||||||
|
|
||||||
|
You must give prominent notice with each copy of the work that the
|
||||||
|
Library is used in it and that the Library and its use are covered by
|
||||||
|
this License. You must supply a copy of this License. If the work
|
||||||
|
during execution displays copyright notices, you must include the
|
||||||
|
copyright notice for the Library among them, as well as a reference
|
||||||
|
directing the user to the copy of this License. Also, you must do one
|
||||||
|
of these things:
|
||||||
|
|
||||||
|
a) Accompany the work with the complete corresponding
|
||||||
|
machine-readable source code for the Library including whatever
|
||||||
|
changes were used in the work (which must be distributed under
|
||||||
|
Sections 1 and 2 above); and, if the work is an executable linked
|
||||||
|
with the Library, with the complete machine-readable "work that
|
||||||
|
uses the Library", as object code and/or source code, so that the
|
||||||
|
user can modify the Library and then relink to produce a modified
|
||||||
|
executable containing the modified Library. (It is understood
|
||||||
|
that the user who changes the contents of definitions files in the
|
||||||
|
Library will not necessarily be able to recompile the application
|
||||||
|
to use the modified definitions.)
|
||||||
|
|
||||||
|
b) Accompany the work with a written offer, valid for at
|
||||||
|
least three years, to give the same user the materials
|
||||||
|
specified in Subsection 6a, above, for a charge no more
|
||||||
|
than the cost of performing this distribution.
|
||||||
|
|
||||||
|
c) If distribution of the work is made by offering access to copy
|
||||||
|
from a designated place, offer equivalent access to copy the above
|
||||||
|
specified materials from the same place.
|
||||||
|
|
||||||
|
d) Verify that the user has already received a copy of these
|
||||||
|
materials or that you have already sent this user a copy.
|
||||||
|
|
||||||
|
For an executable, the required form of the "work that uses the
|
||||||
|
Library" must include any data and utility programs needed for
|
||||||
|
reproducing the executable from it. However, as a special exception,
|
||||||
|
the source code distributed need not include anything that is normally
|
||||||
|
distributed (in either source or binary form) with the major
|
||||||
|
components (compiler, kernel, and so on) of the operating system on
|
||||||
|
which the executable runs, unless that component itself accompanies
|
||||||
|
the executable.
|
||||||
|
|
||||||
|
It may happen that this requirement contradicts the license
|
||||||
|
restrictions of other proprietary libraries that do not normally
|
||||||
|
accompany the operating system. Such a contradiction means you cannot
|
||||||
|
use both them and the Library together in an executable that you
|
||||||
|
distribute.
|
||||||
|
|
||||||
|
7. You may place library facilities that are a work based on the
|
||||||
|
Library side-by-side in a single library together with other library
|
||||||
|
facilities not covered by this License, and distribute such a combined
|
||||||
|
library, provided that the separate distribution of the work based on
|
||||||
|
the Library and of the other library facilities is otherwise
|
||||||
|
permitted, and provided that you do these two things:
|
||||||
|
|
||||||
|
a) Accompany the combined library with a copy of the same work
|
||||||
|
based on the Library, uncombined with any other library
|
||||||
|
facilities. This must be distributed under the terms of the
|
||||||
|
Sections above.
|
||||||
|
|
||||||
|
b) Give prominent notice with the combined library of the fact
|
||||||
|
that part of it is a work based on the Library, and explaining
|
||||||
|
where to find the accompanying uncombined form of the same work.
|
||||||
|
|
||||||
|
8. You may not copy, modify, sublicense, link with, or distribute
|
||||||
|
the Library except as expressly provided under this License. Any
|
||||||
|
attempt otherwise to copy, modify, sublicense, link with, or
|
||||||
|
distribute the Library is void, and will automatically terminate your
|
||||||
|
rights under this License. However, parties who have received copies,
|
||||||
|
or rights, from you under this License will not have their licenses
|
||||||
|
terminated so long as such parties remain in full compliance.
|
||||||
|
|
||||||
|
9. You are not required to accept this License, since you have not
|
||||||
|
signed it. However, nothing else grants you permission to modify or
|
||||||
|
distribute the Library or its derivative works. These actions are
|
||||||
|
prohibited by law if you do not accept this License. Therefore, by
|
||||||
|
modifying or distributing the Library (or any work based on the
|
||||||
|
Library), you indicate your acceptance of this License to do so, and
|
||||||
|
all its terms and conditions for copying, distributing or modifying
|
||||||
|
the Library or works based on it.
|
||||||
|
|
||||||
|
10. Each time you redistribute the Library (or any work based on the
|
||||||
|
Library), the recipient automatically receives a license from the
|
||||||
|
original licensor to copy, distribute, link with or modify the Library
|
||||||
|
subject to these terms and conditions. You may not impose any further
|
||||||
|
restrictions on the recipients' exercise of the rights granted herein.
|
||||||
|
You are not responsible for enforcing compliance by third parties to
|
||||||
|
this License.
|
||||||
|
|
||||||
|
11. If, as a consequence of a court judgment or allegation of patent
|
||||||
|
infringement or for any other reason (not limited to patent issues),
|
||||||
|
conditions are imposed on you (whether by court order, agreement or
|
||||||
|
otherwise) that contradict the conditions of this License, they do not
|
||||||
|
excuse you from the conditions of this License. If you cannot
|
||||||
|
distribute so as to satisfy simultaneously your obligations under this
|
||||||
|
License and any other pertinent obligations, then as a consequence you
|
||||||
|
may not distribute the Library at all. For example, if a patent
|
||||||
|
license would not permit royalty-free redistribution of the Library by
|
||||||
|
all those who receive copies directly or indirectly through you, then
|
||||||
|
the only way you could satisfy both it and this License would be to
|
||||||
|
refrain entirely from distribution of the Library.
|
||||||
|
|
||||||
|
If any portion of this section is held invalid or unenforceable under any
|
||||||
|
particular circumstance, the balance of the section is intended to apply,
|
||||||
|
and the section as a whole is intended to apply in other circumstances.
|
||||||
|
|
||||||
|
It is not the purpose of this section to induce you to infringe any
|
||||||
|
patents or other property right claims or to contest validity of any
|
||||||
|
such claims; this section has the sole purpose of protecting the
|
||||||
|
integrity of the free software distribution system which is
|
||||||
|
implemented by public license practices. Many people have made
|
||||||
|
generous contributions to the wide range of software distributed
|
||||||
|
through that system in reliance on consistent application of that
|
||||||
|
system; it is up to the author/donor to decide if he or she is willing
|
||||||
|
to distribute software through any other system and a licensee cannot
|
||||||
|
impose that choice.
|
||||||
|
|
||||||
|
This section is intended to make thoroughly clear what is believed to
|
||||||
|
be a consequence of the rest of this License.
|
||||||
|
|
||||||
|
12. If the distribution and/or use of the Library is restricted in
|
||||||
|
certain countries either by patents or by copyrighted interfaces, the
|
||||||
|
original copyright holder who places the Library under this License may add
|
||||||
|
an explicit geographical distribution limitation excluding those countries,
|
||||||
|
so that distribution is permitted only in or among countries not thus
|
||||||
|
excluded. In such case, this License incorporates the limitation as if
|
||||||
|
written in the body of this License.
|
||||||
|
|
||||||
|
13. The Free Software Foundation may publish revised and/or new
|
||||||
|
versions of the Library General Public License from time to time.
|
||||||
|
Such new versions will be similar in spirit to the present version,
|
||||||
|
but may differ in detail to address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the Library
|
||||||
|
specifies a version number of this License which applies to it and
|
||||||
|
"any later version", you have the option of following the terms and
|
||||||
|
conditions either of that version or of any later version published by
|
||||||
|
the Free Software Foundation. If the Library does not specify a
|
||||||
|
license version number, you may choose any version ever published by
|
||||||
|
the Free Software Foundation.
|
||||||
|
|
||||||
|
14. If you wish to incorporate parts of the Library into other free
|
||||||
|
programs whose distribution conditions are incompatible with these,
|
||||||
|
write to the author to ask for permission. For software which is
|
||||||
|
copyrighted by the Free Software Foundation, write to the Free
|
||||||
|
Software Foundation; we sometimes make exceptions for this. Our
|
||||||
|
decision will be guided by the two goals of preserving the free status
|
||||||
|
of all derivatives of our free software and of promoting the sharing
|
||||||
|
and reuse of software generally.
|
||||||
|
|
||||||
|
NO WARRANTY
|
||||||
|
|
||||||
|
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||||
|
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||||
|
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||||
|
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||||
|
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||||
|
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||||
|
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||||
|
|
||||||
|
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||||
|
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||||
|
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||||
|
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||||
|
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||||
|
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||||
|
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||||
|
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||||
|
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||||
|
DAMAGES.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
Appendix: How to Apply These Terms to Your New Libraries
|
||||||
|
|
||||||
|
If you develop a new library, and you want it to be of the greatest
|
||||||
|
possible use to the public, we recommend making it free software that
|
||||||
|
everyone can redistribute and change. You can do so by permitting
|
||||||
|
redistribution under these terms (or, alternatively, under the terms of the
|
||||||
|
ordinary General Public License).
|
||||||
|
|
||||||
|
To apply these terms, attach the following notices to the library. It is
|
||||||
|
safest to attach them to the start of each source file to most effectively
|
||||||
|
convey the exclusion of warranty; and each file should have at least the
|
||||||
|
"copyright" line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
|
<one line to give the library's name and a brief idea of what it does.>
|
||||||
|
Copyright (C) <year> <name of author>
|
||||||
|
|
||||||
|
This library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU Library General Public
|
||||||
|
License as published by the Free Software Foundation; either
|
||||||
|
version 2 of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This library 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
|
||||||
|
Library General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Library General Public
|
||||||
|
License along with this library; if not, write to the Free
|
||||||
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
|
||||||
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
You should also get your employer (if you work as a programmer) or your
|
||||||
|
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||||
|
necessary. Here is a sample; alter the names:
|
||||||
|
|
||||||
|
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||||
|
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||||
|
|
||||||
|
<signature of Ty Coon>, 1 April 1990
|
||||||
|
Ty Coon, President of Vice
|
||||||
|
|
||||||
|
That's all there is to it!
|
||||||
315
glob/ChangeLog
Normal file
315
glob/ChangeLog
Normal file
@@ -0,0 +1,315 @@
|
|||||||
|
Wed Mar 8 13:38:13 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||||
|
|
||||||
|
* posix/glob/configure.bat: Fixes from DJ.
|
||||||
|
|
||||||
|
Wed Feb 22 00:44:41 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||||
|
|
||||||
|
* posix/glob/configure.in: Put AC_ISC_POSIX before AC_CONST.
|
||||||
|
|
||||||
|
Sun Feb 5 17:59:53 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||||
|
|
||||||
|
* malloc/malloc.c (__malloc_extra_blocks): New variable.
|
||||||
|
(malloc): When getting more core, get __malloc_extra_blocks extra;
|
||||||
|
put the new block at the end of the free list and let the next loop
|
||||||
|
iteration use the initial portion of it.
|
||||||
|
* malloc/free.c (_free_internal): Account for twice
|
||||||
|
__malloc_extra_blocks in deciding if we have so much extra memory
|
||||||
|
we should return it to the system.
|
||||||
|
* malloc/malloc.h (__malloc_extra_blocks): Declare it.
|
||||||
|
* posix/glob.c (prefix_array, glob_pattern_p): Remove gratuitous
|
||||||
|
const in parameter decl.
|
||||||
|
|
||||||
|
Fri Jan 27 17:53:49 1995 Jim Meyering (meyering@comco.com)
|
||||||
|
|
||||||
|
* posix/fnmatch.c: Declare errno if it's not defined.
|
||||||
|
That's simpler than testing #if !defined(__GNU_LIBRARY__)
|
||||||
|
&& !defined(STDC_HEADERS).
|
||||||
|
|
||||||
|
Thu Jan 26 00:02:01 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||||
|
|
||||||
|
* io/ftw.c: Avoid `ret' as variable name.
|
||||||
|
* posix/glob.c: Likewise.
|
||||||
|
|
||||||
|
Wed Jan 25 00:45:56 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||||
|
|
||||||
|
* posix/glob/configure.in: Put AC_AIX and AC_MINIX early, before
|
||||||
|
any compile tests.
|
||||||
|
|
||||||
|
Mon Jan 16 15:49:07 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||||
|
|
||||||
|
* posix/glob/Makefile.in: Remove config.h and config.log.
|
||||||
|
|
||||||
|
Sun Jan 15 06:56:47 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||||
|
|
||||||
|
* posix/glob/configure.in: Add AC_CONST check.
|
||||||
|
|
||||||
|
Wed Dec 7 14:05:12 1994 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||||
|
|
||||||
|
* posix/glob/Makefile.in (realclean): Remove config.status.
|
||||||
|
|
||||||
|
* posix/glob/Makefile.in (DEFS): New variable, set from @DEFS@.
|
||||||
|
(CPPFLAGS): Remove @DEFS@ from here.
|
||||||
|
(.c.o): Use $(DEFS).
|
||||||
|
|
||||||
|
Tue Dec 6 19:04:50 1994 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||||
|
|
||||||
|
* posix/glob/Makefile.in (CPPFLAGS): Include @DEFS@.
|
||||||
|
|
||||||
|
Mon Dec 5 12:05:10 1994 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||||
|
|
||||||
|
* posix/glob/configure.in: Add AC_PROG_CC.
|
||||||
|
|
||||||
|
Mon Nov 7 00:38:45 1994 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||||
|
|
||||||
|
* posix/glob/configure.in: Converted to Autoconf v2.
|
||||||
|
* posix/glob.c: Test HAVE_DIRENT_H, HAVE_SYS_DIR_H, HAVE_NDIR_H
|
||||||
|
instead of DIRENT, SYSDIR, NDIR.
|
||||||
|
* posix/glob/Makefile.in (CC): New variable, set from @CC@.
|
||||||
|
(CPPFLAGS): Set from @CPPFLAGS@, not @DEFS@.
|
||||||
|
|
||||||
|
Sun Oct 09 01:19:38 1994 Jim Meyering (meyering@comco.com)
|
||||||
|
|
||||||
|
* posix/fnmatch.c: Remove CONFIG_BROKETS conditional.
|
||||||
|
|
||||||
|
Sun Oct 2 18:35:16 1994 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||||
|
|
||||||
|
* posix/glob.h (__P): Change arg name to `protos', for congruence
|
||||||
|
with 4.4 BSD.
|
||||||
|
* posix/fnmatch.h (__P): Likewise.
|
||||||
|
|
||||||
|
Tue Sep 6 19:06:00 1994 Roland McGrath <roland@geech.gnu.ai.mit.edu>
|
||||||
|
|
||||||
|
* posix/glob.c (prefix_array, glob): Avoid const on initialized
|
||||||
|
variables. Some compiler generates bad code.
|
||||||
|
|
||||||
|
Mon Jul 25 17:17:28 1994 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||||
|
|
||||||
|
* posix/glob/configure.bat: New file.
|
||||||
|
* posix/Makefile (glob.tar): Add glob/configure.bat.
|
||||||
|
|
||||||
|
Tue Dec 14 13:08:35 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
|
||||||
|
|
||||||
|
* posix/fnmatch.h: #undef FNM_PATHNAME, FNM_NOESCAPE, and
|
||||||
|
FNM_PERIOD before defining them.
|
||||||
|
|
||||||
|
Mon Oct 18 04:22:42 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
|
||||||
|
|
||||||
|
* posix/glob/configure.in: Use AC_HAVE_HEADERS instead of
|
||||||
|
AC_MEMORY_H and AC_UNISTD_H; omit AC_USG (not needed).
|
||||||
|
|
||||||
|
Sun Oct 10 14:31:35 1993 Jim Meyering (meyering@comco.com)
|
||||||
|
|
||||||
|
* posix/fnmatch.c [CONFIG_BROKETS]: Include <config.h> only under
|
||||||
|
this condition, else "config.h".
|
||||||
|
|
||||||
|
Wed May 12 16:24:23 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu)
|
||||||
|
|
||||||
|
* posix/glob.c: Move include <unistd.h> before dir includes.
|
||||||
|
[HAVE_UNISTD_H] [! POSIX] [_POSIX_SOURCE]: Define POSIX.
|
||||||
|
|
||||||
|
Thu Apr 22 17:40:28 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
|
||||||
|
|
||||||
|
* posix/glob/Makefile.in (.c.o): Put $(CFLAGS) last.
|
||||||
|
(glob.o): Depend on glob.c.
|
||||||
|
(fnmatch.o): Depend on fnmatch.c.
|
||||||
|
|
||||||
|
Fri Apr 16 12:24:21 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
|
||||||
|
|
||||||
|
* posix/glob.c, posix/fnmatch.c: Surround code with
|
||||||
|
#if defined (_LIBC) || !defined (__GNU_LIBRARY__)
|
||||||
|
|
||||||
|
Wed Apr 14 12:49:10 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
|
||||||
|
|
||||||
|
* posix/glob.c [USG, NeXT]: Don't test these.
|
||||||
|
[HAVE_STRING_H]: Test this to include string.h and define ANSI_STRING.
|
||||||
|
[HAVE_MEMORY_H]: Test this instead of NEED_MEMORY_H.
|
||||||
|
[! ANSI_STRING]: Put decls of bcopy and #define of memcpy et al here.
|
||||||
|
|
||||||
|
* posix/fnmatch.c [HAVE_CONFIG_H]: #include "config.h".
|
||||||
|
|
||||||
|
Mon Apr 12 16:34:53 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
|
||||||
|
|
||||||
|
* posix/glob.c: Rationalize directory header conditionals.
|
||||||
|
|
||||||
|
Sun Apr 11 18:53:50 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
|
||||||
|
|
||||||
|
* posix/fnmatch.h [__cplusplus || __STDC__]: Don't #define const.
|
||||||
|
|
||||||
|
Sun Mar 28 16:12:33 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu)
|
||||||
|
|
||||||
|
* posix/fnmatch.c (case '*'): Before final loop, fold C1, rather
|
||||||
|
than foling *P before it goes into C1. C might need folding instead.
|
||||||
|
|
||||||
|
Thu Mar 25 13:40:17 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
|
||||||
|
|
||||||
|
* posix/fnmatch.h [!_POSIX_C_SOURCE || ...]: Make this test
|
||||||
|
_GNU_SOURCE, not _BSD_SOURCE; these are our extensions, not theirs.
|
||||||
|
(FNM_CASEFOLD): New bit.
|
||||||
|
(__FNM_FLAGS): Removed macro.
|
||||||
|
* posix/fnmatch.c (fnmatch): Don't test for bogus flag bits; who cares?
|
||||||
|
(FOLD): New macro to casefold a char if FNM_CASEFOLD.
|
||||||
|
Use it to fold all chars before comparison.
|
||||||
|
|
||||||
|
Mon Mar 8 13:20:02 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu)
|
||||||
|
|
||||||
|
* posix/glob/Makefile.in (VPATH): Set this to @srcdir@.
|
||||||
|
(srcdir): Set this to $(VPATH).
|
||||||
|
|
||||||
|
* posix/glob.c (glob): In no matches with GLOB_NOCHECK set case,
|
||||||
|
add NULL terminator to PGLOB->gl_pathv.
|
||||||
|
(prefix_array): Renamed arg PREFIX to DIRNAME, local var PRELEN to
|
||||||
|
DIRLEN. If DIRNAME is just "/", don't prepend it, so we get
|
||||||
|
"/foo" instead of "//foo".
|
||||||
|
(glob): Move qsort call outside of the else clause of the
|
||||||
|
glob_pattern_p test; it should always be done.
|
||||||
|
|
||||||
|
Thu Jan 21 20:12:25 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu)
|
||||||
|
|
||||||
|
* posix/glob.c: Put #includes of <glob.h> and <fnmatch.h> after
|
||||||
|
all system includes, in case one of them has conflicting defns of
|
||||||
|
FNM_* or GLOB_*, so we will redefine. #undef FNM_* and GLOB_*
|
||||||
|
before including our headers.
|
||||||
|
|
||||||
|
Tue Jan 19 16:16:05 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu)
|
||||||
|
|
||||||
|
* posix/glob.c (my_realloc): Cast result of malloc/realloc to (char *).
|
||||||
|
|
||||||
|
Thu Jan 14 13:52:43 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
|
||||||
|
|
||||||
|
* posix/glob/Makefile.in (realclean): Remove Makefile.
|
||||||
|
|
||||||
|
Mon Jan 4 17:05:44 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu)
|
||||||
|
|
||||||
|
* posix/glob/Makefile.in (RANLIB): Define to @RANLIB@.
|
||||||
|
(RANLIB_TEST): Removed.
|
||||||
|
(libglob.a): Don't use it.
|
||||||
|
|
||||||
|
Mon Dec 28 15:50:31 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
|
||||||
|
|
||||||
|
* posix/glob.c [HAVE_CONFIG_H]: Test this, not SHELL, to decide
|
||||||
|
whether or not we want to #include "config.h".
|
||||||
|
|
||||||
|
Wed Nov 18 13:42:09 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
|
||||||
|
|
||||||
|
* posix/fnmatch.h (FNM_LEADING_DIR): New flag.
|
||||||
|
* posix/fnmatch.c (fnmatch): Support it.
|
||||||
|
|
||||||
|
Sun Oct 11 16:58:36 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
|
||||||
|
|
||||||
|
* posix/glob.c (__glob_{open,read,close}dir_hook): New vars.
|
||||||
|
(glob_in_dir): Use them.
|
||||||
|
* posix/glob.h: Declare them.
|
||||||
|
|
||||||
|
Fri Sep 18 16:32:16 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
|
||||||
|
|
||||||
|
* posix/glob/Makefile.in (AR, ARFLAGS): Define.
|
||||||
|
(libglob.a): Use those vars instead of hardcoding.
|
||||||
|
|
||||||
|
Thu Aug 13 18:30:58 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
|
||||||
|
|
||||||
|
* posix/glob.c: Always #include <sys/types.h>.
|
||||||
|
[! USG]: Don't do it here.
|
||||||
|
[STDC_HEADERS]: Test this instead of __STDC__ for size_t.
|
||||||
|
[HAVE_STRCOLL]: Test this instead of ANSI_STRING for strcoll.
|
||||||
|
|
||||||
|
* posix/glob/Makefile.in (Makefile): Remove rule.
|
||||||
|
|
||||||
|
Tue Aug 11 15:01:50 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
|
||||||
|
|
||||||
|
* posix/glob.c [_AIX]: Don't declare alloca.
|
||||||
|
|
||||||
|
Thu Jul 30 15:42:01 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
|
||||||
|
|
||||||
|
* posix/glob/Makefile.in (Makefile): Depend on config.status; invoke
|
||||||
|
it directly instead of using $(SHELL).
|
||||||
|
|
||||||
|
* posix/glob.c [! USG]: #include <sys/types.h> before <sys/dir.h>.
|
||||||
|
|
||||||
|
Sun Jul 26 17:03:31 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
|
||||||
|
|
||||||
|
* posix/glob.c [_AIX]: #pragma alloca first thing.
|
||||||
|
[ANSI_STRING]: Remove #define's for index et al.
|
||||||
|
|
||||||
|
Thu Jul 9 21:27:39 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
|
||||||
|
|
||||||
|
* posix/glob.c [STDC_STRINGS]: Don't test this.
|
||||||
|
[! ANSI_STRING]: Put memcpy, strrchr, memset defns here instead.
|
||||||
|
|
||||||
|
* posix/glob/Makefile.in (glob.o, fnmatch.o): / after $(srcdir).
|
||||||
|
|
||||||
|
Sat Jul 4 20:44:42 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
|
||||||
|
|
||||||
|
* posix/glob/Makefile.in (glob.o, fnmatch.o): Put $(srcdir) on deps.
|
||||||
|
|
||||||
|
Wed Jul 1 00:13:40 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
|
||||||
|
|
||||||
|
* posix/glob.c [! ANSI_STRING]: #define strcoll to strcmp.
|
||||||
|
Remove extra decls of free, qsort, malloc, and realloc.
|
||||||
|
|
||||||
|
Wed Jun 24 19:09:04 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
|
||||||
|
|
||||||
|
* posix/glob.c [DIRENT] (direct): Don't define to dirent.
|
||||||
|
[! DIRENT] (direct): Define to dirent.
|
||||||
|
|
||||||
|
Wed Jun 17 17:58:05 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
|
||||||
|
|
||||||
|
* posix/glob.c (my_realloc): Test only __GNU_LIBRARY__. Can't trust
|
||||||
|
STDC_HEADERS.
|
||||||
|
|
||||||
|
Tue Jun 16 20:20:01 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
|
||||||
|
|
||||||
|
* posix/glob/Makefile: Moved to posix/glob/Makefile.in.
|
||||||
|
(VPATH, srcdir, CPPFLAGS): Define to be replaced by autoconf.
|
||||||
|
|
||||||
|
* posix/glob.c: Rearranged conditionals for use with autoconf.
|
||||||
|
|
||||||
|
Tue Jun 9 20:15:12 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
|
||||||
|
|
||||||
|
* posix/glob/Makefile: Fixed copyright notice.
|
||||||
|
(realclean): Don't remove ~ backup files.
|
||||||
|
|
||||||
|
Tue Jun 2 21:49:22 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
|
||||||
|
|
||||||
|
* posix/glob.c (__ptr_t): Define.
|
||||||
|
|
||||||
|
Wed May 27 18:09:40 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
|
||||||
|
|
||||||
|
* posix/fnmatch.h (FNM_FILE_NAME): Alias for FNM_PATHNAME.
|
||||||
|
|
||||||
|
Fri May 22 01:52:04 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
|
||||||
|
|
||||||
|
* posix/glob.h, posix/fnmatch.h: Use explicit cruft for C++.
|
||||||
|
Define __P and const for C++/ANSI vs old C ourselves, to avoid
|
||||||
|
dependence on <sys/cdefs.h>.
|
||||||
|
|
||||||
|
Sun May 17 15:50:00 1992 Roland McGrath (roland@albert.gnu.ai.mit.edu)
|
||||||
|
|
||||||
|
* posix/glob.c (glob): Don't let us fall off the end without returning.
|
||||||
|
|
||||||
|
Thu May 14 01:45:12 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
|
||||||
|
|
||||||
|
* posix/glob.h (GLOB_MAGCHAR): Check user feature-test macros,
|
||||||
|
rather than __USE_BSD, so we don't depend on features.h.
|
||||||
|
|
||||||
|
* posix/glob.h [__USE_BSD] (GLOB_MAGCHAR): Declare.
|
||||||
|
(glob_t): Added member `gl_flags'.
|
||||||
|
* posix/glob.c (glob, glob_in_dir): Set gl_flags member to FLAGS;
|
||||||
|
or in GLOB_MAGCHAR if any metachars are seen.
|
||||||
|
|
||||||
|
Thu Jan 16 18:43:05 1992 Roland McGrath (roland@albert.gnu.ai.mit.edu)
|
||||||
|
|
||||||
|
* posix/glob.c [sgi]: No alloca.h, after all.
|
||||||
|
|
||||||
|
Fri Oct 18 15:27:58 1991 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
|
||||||
|
|
||||||
|
* posix/glob.c [sgi]: Use <sys/dir.h>.
|
||||||
|
|
||||||
|
Tue Jul 23 14:11:29 1991 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
|
||||||
|
|
||||||
|
* posix/glob.c: Don't #include <stddef.h> #ifdef sun.
|
||||||
|
Is there anyone on the face of the planet other than me capable of
|
||||||
|
implementing the ANSI C standard to spec????
|
||||||
|
|
||||||
|
* posix/glob.c [DIRENT]: #include <sys/types.h> before <dirent.h>
|
||||||
|
#ifdef USG.
|
||||||
|
|
||||||
66
glob/Makefile.in
Normal file
66
glob/Makefile.in
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
# Makefile for standalone distribution of libglob.a (fnmatch, glob).
|
||||||
|
|
||||||
|
# Copyright (C) 1991, 92, 93, 94, 95 Free Software Foundation, Inc.
|
||||||
|
# This file is part of the GNU C Library.
|
||||||
|
|
||||||
|
# This library is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU Library General Public License
|
||||||
|
# as published by the Free Software Foundation; either version 2 of
|
||||||
|
# the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
# This library 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
|
||||||
|
# Library General Public License for more details.
|
||||||
|
|
||||||
|
# You should have received a copy of the GNU Library General Public
|
||||||
|
# License along with this library; see the file COPYING.LIB. If
|
||||||
|
# not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
||||||
|
# Cambridge, MA 02139, USA.
|
||||||
|
|
||||||
|
# Ultrix 2.2 make doesn't expand the value of VPATH.
|
||||||
|
VPATH = @srcdir@
|
||||||
|
# This must repeat the value, because configure will remove `VPATH = .'.
|
||||||
|
srcdir = @srcdir@
|
||||||
|
|
||||||
|
CC = @CC@
|
||||||
|
CPPFLAGS = @CPPFLAGS@
|
||||||
|
CFLAGS = @CFLAGS@
|
||||||
|
|
||||||
|
# Information determined by configure.
|
||||||
|
DEFS = @DEFS@
|
||||||
|
|
||||||
|
# How to invoke ar.
|
||||||
|
AR = @AR@
|
||||||
|
ARFLAGS = rv
|
||||||
|
|
||||||
|
# How to invoke ranlib.
|
||||||
|
RANLIB = @RANLIB@
|
||||||
|
|
||||||
|
.PHONY: all
|
||||||
|
all: libglob.a
|
||||||
|
|
||||||
|
libglob.a: glob.o fnmatch.o
|
||||||
|
$(AR) $(ARFLAGS) $@ glob.o fnmatch.o
|
||||||
|
$(RANLIB) $@
|
||||||
|
|
||||||
|
# For some reason, Unix make wants the dependencies on the source files.
|
||||||
|
# Otherwise it refuses to use an implicit rule!
|
||||||
|
# And, get this: it doesn't work to use $(srcdir)/foo.c!!
|
||||||
|
glob.o: $(srcdir)/glob.h $(srcdir)/fnmatch.h glob.c
|
||||||
|
fnmatch.o: $(srcdir)/fnmatch.h fnmatch.c
|
||||||
|
|
||||||
|
.c.o:
|
||||||
|
$(CC) -I. -I$(srcdir) -c \
|
||||||
|
$(DEFS) $(CPPFLAGS) $(CFLAGS) $< $(OUTPUT_OPTION)
|
||||||
|
|
||||||
|
.PHONY: clean realclean glob-clean glob-realclean distclean
|
||||||
|
clean glob-clean:
|
||||||
|
-rm -f libglob.a *.o core
|
||||||
|
distclean glob-realclean: clean
|
||||||
|
-rm -f TAGS tags Makefile config.status config.h config.log
|
||||||
|
realcean: distclean
|
||||||
|
|
||||||
|
# For inside the C library.
|
||||||
|
glob.tar glob.tar.Z:
|
||||||
|
$(MAKE) -C .. $@
|
||||||
1547
glob/configure
vendored
Executable file
1547
glob/configure
vendored
Executable file
File diff suppressed because it is too large
Load Diff
26
glob/configure.bat
Normal file
26
glob/configure.bat
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
@echo off
|
||||||
|
echo Configuring glob for GO32
|
||||||
|
rem This batch file assumes a unix-type "sed" program
|
||||||
|
|
||||||
|
echo # Makefile generated by "configure.bat"> Makefile
|
||||||
|
|
||||||
|
if exist config.sed del config.sed
|
||||||
|
|
||||||
|
echo "s/@srcdir@/./ ">> config.sed
|
||||||
|
echo "s/@CC@/gcc/ ">> config.sed
|
||||||
|
echo "s/@CFLAGS@/-O2 -g/ ">> config.sed
|
||||||
|
echo "s/@CPPFLAGS@/-DHAVE_CONFIG_H -I../ ">> config.sed
|
||||||
|
echo "s/@AR@/ar/ ">> config.sed
|
||||||
|
echo "s/@RANLIB@/ranlib/ ">> config.sed
|
||||||
|
echo "s/@LDFLAGS@// ">> config.sed
|
||||||
|
echo "s/@DEFS@// ">> config.sed
|
||||||
|
echo "s/@ALLOCA@// ">> config.sed
|
||||||
|
echo "s/@LIBS@// ">> config.sed
|
||||||
|
echo "s/@LIBOBJS@// ">> config.sed
|
||||||
|
echo "s/^Makefile *:/_Makefile:/ ">> config.sed
|
||||||
|
echo "s/^config.h *:/_config.h:/ ">> config.sed
|
||||||
|
|
||||||
|
sed -e "s/^\"//" -e "s/\"$//" -e "s/[ ]*$//" config.sed > config2.sed
|
||||||
|
sed -f config2.sed Makefile.in >> Makefile
|
||||||
|
del config.sed
|
||||||
|
del config2.sed
|
||||||
19
glob/configure.in
Normal file
19
glob/configure.in
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
dnl Process this file with autoconf to produce a configure script.
|
||||||
|
AC_INIT(fnmatch.c) dnl A distinctive file to look for in srcdir.
|
||||||
|
AC_PREREQ(2.1) dnl Minimum Autoconf version required.
|
||||||
|
AC_PROG_CC
|
||||||
|
AC_CHECK_PROG(AR, ar, ar, ar)
|
||||||
|
AC_PROG_RANLIB
|
||||||
|
AC_PROG_CPP dnl Later checks need this.
|
||||||
|
dnl These two want to come early.
|
||||||
|
AC_AIX
|
||||||
|
AC_MINIX
|
||||||
|
AC_ISC_POSIX
|
||||||
|
AC_CONST
|
||||||
|
AC_HEADER_STDC
|
||||||
|
AC_CHECK_HEADERS(memory.h unistd.h string.h)
|
||||||
|
AC_HEADER_DIRENT
|
||||||
|
AC_FUNC_CLOSEDIR_VOID
|
||||||
|
AC_FUNC_ALLOCA
|
||||||
|
AC_FUNC_STRCOLL
|
||||||
|
AC_OUTPUT(Makefile)
|
||||||
200
glob/fnmatch.c
Normal file
200
glob/fnmatch.c
Normal file
@@ -0,0 +1,200 @@
|
|||||||
|
/* Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
This library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU Library General Public License as
|
||||||
|
published by the Free Software Foundation; either version 2 of the
|
||||||
|
License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This library 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
|
||||||
|
Library General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Library General Public
|
||||||
|
License along with this library; see the file COPYING.LIB. If
|
||||||
|
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
||||||
|
Cambridge, MA 02139, USA. */
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include <config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
|
#include <fnmatch.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
|
|
||||||
|
/* Comment out all this code if we are using the GNU C Library, and are not
|
||||||
|
actually compiling the library itself. This code is part of the GNU C
|
||||||
|
Library, but also included in many other GNU distributions. Compiling
|
||||||
|
and linking in this code is a waste when using the GNU C library
|
||||||
|
(especially if it is a shared library). Rather than having every GNU
|
||||||
|
program understand `configure --with-gnu-libc' and omit the object files,
|
||||||
|
it is simpler to just do this in the source for each such file. */
|
||||||
|
|
||||||
|
#if defined (_LIBC) || !defined (__GNU_LIBRARY__)
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef errno
|
||||||
|
extern int errno;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Match STRING against the filename pattern PATTERN, returning zero if
|
||||||
|
it matches, nonzero if not. */
|
||||||
|
int
|
||||||
|
fnmatch (pattern, string, flags)
|
||||||
|
const char *pattern;
|
||||||
|
const char *string;
|
||||||
|
int flags;
|
||||||
|
{
|
||||||
|
register const char *p = pattern, *n = string;
|
||||||
|
register char c;
|
||||||
|
|
||||||
|
/* Note that this evalutes C many times. */
|
||||||
|
#define FOLD(c) ((flags & FNM_CASEFOLD) && isupper (c) ? tolower (c) : (c))
|
||||||
|
|
||||||
|
while ((c = *p++) != '\0')
|
||||||
|
{
|
||||||
|
c = FOLD (c);
|
||||||
|
|
||||||
|
switch (c)
|
||||||
|
{
|
||||||
|
case '?':
|
||||||
|
if (*n == '\0')
|
||||||
|
return FNM_NOMATCH;
|
||||||
|
else if ((flags & FNM_FILE_NAME) && *n == '/')
|
||||||
|
return FNM_NOMATCH;
|
||||||
|
else if ((flags & FNM_PERIOD) && *n == '.' &&
|
||||||
|
(n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
|
||||||
|
return FNM_NOMATCH;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case '\\':
|
||||||
|
if (!(flags & FNM_NOESCAPE))
|
||||||
|
{
|
||||||
|
c = *p++;
|
||||||
|
c = FOLD (c);
|
||||||
|
}
|
||||||
|
if (FOLD (*n) != c)
|
||||||
|
return FNM_NOMATCH;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case '*':
|
||||||
|
if ((flags & FNM_PERIOD) && *n == '.' &&
|
||||||
|
(n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
|
||||||
|
return FNM_NOMATCH;
|
||||||
|
|
||||||
|
for (c = *p++; c == '?' || c == '*'; c = *p++, ++n)
|
||||||
|
if (((flags & FNM_FILE_NAME) && *n == '/') ||
|
||||||
|
(c == '?' && *n == '\0'))
|
||||||
|
return FNM_NOMATCH;
|
||||||
|
|
||||||
|
if (c == '\0')
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
{
|
||||||
|
char c1 = (!(flags & FNM_NOESCAPE) && c == '\\') ? *p : c;
|
||||||
|
c1 = FOLD (c1);
|
||||||
|
for (--p; *n != '\0'; ++n)
|
||||||
|
if ((c == '[' || FOLD (*n) == c1) &&
|
||||||
|
fnmatch (p, n, flags & ~FNM_PERIOD) == 0)
|
||||||
|
return 0;
|
||||||
|
return FNM_NOMATCH;
|
||||||
|
}
|
||||||
|
|
||||||
|
case '[':
|
||||||
|
{
|
||||||
|
/* Nonzero if the sense of the character class is inverted. */
|
||||||
|
register int not;
|
||||||
|
|
||||||
|
if (*n == '\0')
|
||||||
|
return FNM_NOMATCH;
|
||||||
|
|
||||||
|
if ((flags & FNM_PERIOD) && *n == '.' &&
|
||||||
|
(n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
|
||||||
|
return FNM_NOMATCH;
|
||||||
|
|
||||||
|
not = (*p == '!' || *p == '^');
|
||||||
|
if (not)
|
||||||
|
++p;
|
||||||
|
|
||||||
|
c = *p++;
|
||||||
|
for (;;)
|
||||||
|
{
|
||||||
|
register char cstart = c, cend = c;
|
||||||
|
|
||||||
|
if (!(flags & FNM_NOESCAPE) && c == '\\')
|
||||||
|
cstart = cend = *p++;
|
||||||
|
|
||||||
|
cstart = cend = FOLD (cstart);
|
||||||
|
|
||||||
|
if (c == '\0')
|
||||||
|
/* [ (unterminated) loses. */
|
||||||
|
return FNM_NOMATCH;
|
||||||
|
|
||||||
|
c = *p++;
|
||||||
|
c = FOLD (c);
|
||||||
|
|
||||||
|
if ((flags & FNM_FILE_NAME) && c == '/')
|
||||||
|
/* [/] can never match. */
|
||||||
|
return FNM_NOMATCH;
|
||||||
|
|
||||||
|
if (c == '-' && *p != ']')
|
||||||
|
{
|
||||||
|
cend = *p++;
|
||||||
|
if (!(flags & FNM_NOESCAPE) && cend == '\\')
|
||||||
|
cend = *p++;
|
||||||
|
if (cend == '\0')
|
||||||
|
return FNM_NOMATCH;
|
||||||
|
cend = FOLD (cend);
|
||||||
|
|
||||||
|
c = *p++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (FOLD (*n) >= cstart && FOLD (*n) <= cend)
|
||||||
|
goto matched;
|
||||||
|
|
||||||
|
if (c == ']')
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (!not)
|
||||||
|
return FNM_NOMATCH;
|
||||||
|
break;
|
||||||
|
|
||||||
|
matched:;
|
||||||
|
/* Skip the rest of the [...] that already matched. */
|
||||||
|
while (c != ']')
|
||||||
|
{
|
||||||
|
if (c == '\0')
|
||||||
|
/* [... (unterminated) loses. */
|
||||||
|
return FNM_NOMATCH;
|
||||||
|
|
||||||
|
c = *p++;
|
||||||
|
if (!(flags & FNM_NOESCAPE) && c == '\\')
|
||||||
|
/* XXX 1003.2d11 is unclear if this is right. */
|
||||||
|
++p;
|
||||||
|
}
|
||||||
|
if (not)
|
||||||
|
return FNM_NOMATCH;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
if (c != FOLD (*n))
|
||||||
|
return FNM_NOMATCH;
|
||||||
|
}
|
||||||
|
|
||||||
|
++n;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (*n == '\0')
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if ((flags & FNM_LEADING_DIR) && *n == '/')
|
||||||
|
/* The FNM_LEADING_DIR flag says that "foo*" matches "foobar/frobozz". */
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return FNM_NOMATCH;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* _LIBC or not __GNU_LIBRARY__. */
|
||||||
67
glob/fnmatch.h
Normal file
67
glob/fnmatch.h
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
/* Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
This library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU Library General Public License as
|
||||||
|
published by the Free Software Foundation; either version 2 of the
|
||||||
|
License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This library 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
|
||||||
|
Library General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Library General Public
|
||||||
|
License along with this library; see the file COPYING.LIB. If
|
||||||
|
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
||||||
|
Cambridge, MA 02139, USA. */
|
||||||
|
|
||||||
|
#ifndef _FNMATCH_H
|
||||||
|
|
||||||
|
#define _FNMATCH_H 1
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined (__cplusplus) || (defined (__STDC__) && __STDC__)
|
||||||
|
#undef __P
|
||||||
|
#define __P(protos) protos
|
||||||
|
#else /* Not C++ or ANSI C. */
|
||||||
|
#undef __P
|
||||||
|
#define __P(protos) ()
|
||||||
|
/* We can get away without defining `const' here only because in this file
|
||||||
|
it is used only inside the prototype for `fnmatch', which is elided in
|
||||||
|
non-ANSI C where `const' is problematical. */
|
||||||
|
#endif /* C++ or ANSI C. */
|
||||||
|
|
||||||
|
|
||||||
|
/* We #undef these before defining them because some losing systems
|
||||||
|
(HP-UX A.08.07 for example) define these in <unistd.h>. */
|
||||||
|
#undef FNM_PATHNAME
|
||||||
|
#undef FNM_NOESCAPE
|
||||||
|
#undef FNM_PERIOD
|
||||||
|
|
||||||
|
/* Bits set in the FLAGS argument to `fnmatch'. */
|
||||||
|
#define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */
|
||||||
|
#define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */
|
||||||
|
#define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */
|
||||||
|
|
||||||
|
#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_GNU_SOURCE)
|
||||||
|
#define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */
|
||||||
|
#define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */
|
||||||
|
#define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Value returned by `fnmatch' if STRING does not match PATTERN. */
|
||||||
|
#define FNM_NOMATCH 1
|
||||||
|
|
||||||
|
/* Match STRING against the filename pattern PATTERN,
|
||||||
|
returning zero if it matches, FNM_NOMATCH if not. */
|
||||||
|
extern int fnmatch __P ((const char *__pattern, const char *__string,
|
||||||
|
int __flags));
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* fnmatch.h */
|
||||||
671
glob/glob.c
Normal file
671
glob/glob.c
Normal file
@@ -0,0 +1,671 @@
|
|||||||
|
/* Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
This library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU Library General Public License as
|
||||||
|
published by the Free Software Foundation; either version 2 of the
|
||||||
|
License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This library 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
|
||||||
|
Library General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Library General Public
|
||||||
|
License along with this library; see the file COPYING.LIB. If
|
||||||
|
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
||||||
|
Cambridge, MA 02139, USA. */
|
||||||
|
|
||||||
|
/* AIX requires this to be the first thing in the file. */
|
||||||
|
#if defined (_AIX) && !defined (__GNUC__)
|
||||||
|
#pragma alloca
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include <config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
|
||||||
|
/* Comment out all this code if we are using the GNU C Library, and are not
|
||||||
|
actually compiling the library itself. This code is part of the GNU C
|
||||||
|
Library, but also included in many other GNU distributions. Compiling
|
||||||
|
and linking in this code is a waste when using the GNU C library
|
||||||
|
(especially if it is a shared library). Rather than having every GNU
|
||||||
|
program understand `configure --with-gnu-libc' and omit the object files,
|
||||||
|
it is simpler to just do this in the source for each such file. */
|
||||||
|
|
||||||
|
#if defined (_LIBC) || !defined (__GNU_LIBRARY__)
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef STDC_HEADERS
|
||||||
|
#include <stddef.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_UNISTD_H
|
||||||
|
#include <unistd.h>
|
||||||
|
#ifndef POSIX
|
||||||
|
#ifdef _POSIX_VERSION
|
||||||
|
#define POSIX
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(__GNU_LIBRARY__) && !defined(STDC_HEADERS)
|
||||||
|
extern int errno;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef NULL
|
||||||
|
#define NULL 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#if defined (POSIX) || defined (HAVE_DIRENT_H) || defined (__GNU_LIBRARY__)
|
||||||
|
#include <dirent.h>
|
||||||
|
#ifndef __GNU_LIBRARY__
|
||||||
|
#define D_NAMLEN(d) strlen((d)->d_name)
|
||||||
|
#else /* GNU C library. */
|
||||||
|
#define D_NAMLEN(d) ((d)->d_namlen)
|
||||||
|
#endif /* Not GNU C library. */
|
||||||
|
#else /* Not POSIX or HAVE_DIRENT_H. */
|
||||||
|
#define direct dirent
|
||||||
|
#define D_NAMLEN(d) ((d)->d_namlen)
|
||||||
|
#ifdef HAVE_SYS_NDIR_H
|
||||||
|
#include <sys/ndir.h>
|
||||||
|
#endif /* HAVE_SYS_NDIR_H */
|
||||||
|
#ifdef HAVE_SYS_DIR_H
|
||||||
|
#include <sys/dir.h>
|
||||||
|
#endif /* HAVE_SYS_DIR_H */
|
||||||
|
#ifdef HAVE_NDIR_H
|
||||||
|
#include <ndir.h>
|
||||||
|
#endif /* HAVE_NDIR_H */
|
||||||
|
#endif /* POSIX or HAVE_DIRENT_H or __GNU_LIBRARY__. */
|
||||||
|
|
||||||
|
#if defined (POSIX) && !defined (__GNU_LIBRARY__)
|
||||||
|
/* Posix does not require that the d_ino field be present, and some
|
||||||
|
systems do not provide it. */
|
||||||
|
#define REAL_DIR_ENTRY(dp) 1
|
||||||
|
#else
|
||||||
|
#define REAL_DIR_ENTRY(dp) (dp->d_ino != 0)
|
||||||
|
#endif /* POSIX */
|
||||||
|
|
||||||
|
#if (defined (STDC_HEADERS) || defined (__GNU_LIBRARY__))
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#define ANSI_STRING
|
||||||
|
#else /* No standard headers. */
|
||||||
|
|
||||||
|
#ifdef HAVE_STRING_H
|
||||||
|
#include <string.h>
|
||||||
|
#define ANSI_STRING
|
||||||
|
#else
|
||||||
|
#include <strings.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_MEMORY_H
|
||||||
|
#include <memory.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
extern char *malloc (), *realloc ();
|
||||||
|
extern void free ();
|
||||||
|
|
||||||
|
extern void qsort ();
|
||||||
|
extern void abort (), exit ();
|
||||||
|
|
||||||
|
#endif /* Standard headers. */
|
||||||
|
|
||||||
|
#ifndef ANSI_STRING
|
||||||
|
|
||||||
|
#ifndef bzero
|
||||||
|
extern void bzero ();
|
||||||
|
#endif
|
||||||
|
#ifndef bcopy
|
||||||
|
extern void bcopy ();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define memcpy(d, s, n) bcopy ((s), (d), (n))
|
||||||
|
#define strrchr rindex
|
||||||
|
/* memset is only used for zero here, but let's be paranoid. */
|
||||||
|
#define memset(s, better_be_zero, n) \
|
||||||
|
((void) ((better_be_zero) == 0 ? (bzero((s), (n)), 0) : (abort(), 0)))
|
||||||
|
#endif /* Not ANSI_STRING. */
|
||||||
|
|
||||||
|
#ifndef HAVE_STRCOLL
|
||||||
|
#define strcoll strcmp
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef __GNU_LIBRARY__
|
||||||
|
#ifdef __GNUC__
|
||||||
|
__inline
|
||||||
|
#endif
|
||||||
|
static char *
|
||||||
|
my_realloc (p, n)
|
||||||
|
char *p;
|
||||||
|
unsigned int n;
|
||||||
|
{
|
||||||
|
/* These casts are the for sake of the broken Ultrix compiler,
|
||||||
|
which warns of illegal pointer combinations otherwise. */
|
||||||
|
if (p == NULL)
|
||||||
|
return (char *) malloc (n);
|
||||||
|
return (char *) realloc (p, n);
|
||||||
|
}
|
||||||
|
#define realloc my_realloc
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#if !defined(__alloca) && !defined(__GNU_LIBRARY__)
|
||||||
|
|
||||||
|
#ifdef __GNUC__
|
||||||
|
#undef alloca
|
||||||
|
#define alloca(n) __builtin_alloca (n)
|
||||||
|
#else /* Not GCC. */
|
||||||
|
#if defined (sparc) || defined (HAVE_ALLOCA_H)
|
||||||
|
#include <alloca.h>
|
||||||
|
#else /* Not sparc or HAVE_ALLOCA_H. */
|
||||||
|
#ifndef _AIX
|
||||||
|
extern char *alloca ();
|
||||||
|
#endif /* Not _AIX. */
|
||||||
|
#endif /* sparc or HAVE_ALLOCA_H. */
|
||||||
|
#endif /* GCC. */
|
||||||
|
|
||||||
|
#define __alloca alloca
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef STDC_HEADERS
|
||||||
|
#undef size_t
|
||||||
|
#define size_t unsigned int
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Some system header files erroneously define these.
|
||||||
|
We want our own definitions from <fnmatch.h> to take precedence. */
|
||||||
|
#undef FNM_PATHNAME
|
||||||
|
#undef FNM_NOESCAPE
|
||||||
|
#undef FNM_PERIOD
|
||||||
|
#include <fnmatch.h>
|
||||||
|
|
||||||
|
/* Some system header files erroneously define these.
|
||||||
|
We want our own definitions from <glob.h> to take precedence. */
|
||||||
|
#undef GLOB_ERR
|
||||||
|
#undef GLOB_MARK
|
||||||
|
#undef GLOB_NOSORT
|
||||||
|
#undef GLOB_DOOFFS
|
||||||
|
#undef GLOB_NOCHECK
|
||||||
|
#undef GLOB_APPEND
|
||||||
|
#undef GLOB_NOESCAPE
|
||||||
|
#undef GLOB_PERIOD
|
||||||
|
#include <glob.h>
|
||||||
|
|
||||||
|
__ptr_t (*__glob_opendir_hook) __P ((const char *directory));
|
||||||
|
const char *(*__glob_readdir_hook) __P ((__ptr_t stream));
|
||||||
|
void (*__glob_closedir_hook) __P ((__ptr_t stream));
|
||||||
|
|
||||||
|
static int glob_pattern_p __P ((const char *pattern, int quote));
|
||||||
|
static int glob_in_dir __P ((const char *pattern, const char *directory,
|
||||||
|
int flags,
|
||||||
|
int (*errfunc) __P ((const char *, int)),
|
||||||
|
glob_t *pglob));
|
||||||
|
static int prefix_array __P ((const char *prefix, char **array, size_t n));
|
||||||
|
static int collated_compare __P ((const __ptr_t, const __ptr_t));
|
||||||
|
|
||||||
|
/* Do glob searching for PATTERN, placing results in PGLOB.
|
||||||
|
The bits defined above may be set in FLAGS.
|
||||||
|
If a directory cannot be opened or read and ERRFUNC is not nil,
|
||||||
|
it is called with the pathname that caused the error, and the
|
||||||
|
`errno' value from the failing call; if it returns non-zero
|
||||||
|
`glob' returns GLOB_ABEND; if it returns zero, the error is ignored.
|
||||||
|
If memory cannot be allocated for PGLOB, GLOB_NOSPACE is returned.
|
||||||
|
Otherwise, `glob' returns zero. */
|
||||||
|
int
|
||||||
|
glob (pattern, flags, errfunc, pglob)
|
||||||
|
const char *pattern;
|
||||||
|
int flags;
|
||||||
|
int (*errfunc) __P ((const char *, int));
|
||||||
|
glob_t *pglob;
|
||||||
|
{
|
||||||
|
const char *filename;
|
||||||
|
char *dirname;
|
||||||
|
size_t dirlen;
|
||||||
|
int status;
|
||||||
|
int oldcount;
|
||||||
|
|
||||||
|
if (pattern == NULL || pglob == NULL || (flags & ~__GLOB_FLAGS) != 0)
|
||||||
|
{
|
||||||
|
errno = EINVAL;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Find the filename. */
|
||||||
|
filename = strrchr (pattern, '/');
|
||||||
|
if (filename == NULL)
|
||||||
|
{
|
||||||
|
filename = pattern;
|
||||||
|
dirname = (char *) ".";
|
||||||
|
dirlen = 0;
|
||||||
|
}
|
||||||
|
else if (filename == pattern)
|
||||||
|
{
|
||||||
|
/* "/pattern". */
|
||||||
|
dirname = (char *) "/";
|
||||||
|
dirlen = 1;
|
||||||
|
++filename;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dirlen = filename - pattern;
|
||||||
|
dirname = (char *) __alloca (dirlen + 1);
|
||||||
|
memcpy (dirname, pattern, dirlen);
|
||||||
|
dirname[dirlen] = '\0';
|
||||||
|
++filename;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (filename[0] == '\0' && dirlen > 1)
|
||||||
|
/* "pattern/". Expand "pattern", appending slashes. */
|
||||||
|
{
|
||||||
|
int val = glob (dirname, flags | GLOB_MARK, errfunc, pglob);
|
||||||
|
if (val == 0)
|
||||||
|
pglob->gl_flags = (pglob->gl_flags & ~GLOB_MARK) | (flags & GLOB_MARK);
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(flags & GLOB_APPEND))
|
||||||
|
{
|
||||||
|
pglob->gl_pathc = 0;
|
||||||
|
pglob->gl_pathv = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
oldcount = pglob->gl_pathc;
|
||||||
|
|
||||||
|
if (glob_pattern_p (dirname, !(flags & GLOB_NOESCAPE)))
|
||||||
|
{
|
||||||
|
/* The directory name contains metacharacters, so we
|
||||||
|
have to glob for the directory, and then glob for
|
||||||
|
the pattern in each directory found. */
|
||||||
|
glob_t dirs;
|
||||||
|
register int i;
|
||||||
|
|
||||||
|
status = glob (dirname,
|
||||||
|
((flags & (GLOB_ERR | GLOB_NOCHECK | GLOB_NOESCAPE)) |
|
||||||
|
GLOB_NOSORT),
|
||||||
|
errfunc, &dirs);
|
||||||
|
if (status != 0)
|
||||||
|
return status;
|
||||||
|
|
||||||
|
/* We have successfully globbed the preceding directory name.
|
||||||
|
For each name we found, call glob_in_dir on it and FILENAME,
|
||||||
|
appending the results to PGLOB. */
|
||||||
|
for (i = 0; i < dirs.gl_pathc; ++i)
|
||||||
|
{
|
||||||
|
int oldcount;
|
||||||
|
|
||||||
|
#ifdef SHELL
|
||||||
|
{
|
||||||
|
/* Make globbing interruptible in the bash shell. */
|
||||||
|
extern int interrupt_state;
|
||||||
|
|
||||||
|
if (interrupt_state)
|
||||||
|
{
|
||||||
|
globfree (&dirs);
|
||||||
|
globfree (&files);
|
||||||
|
return GLOB_ABEND;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif /* SHELL. */
|
||||||
|
|
||||||
|
oldcount = pglob->gl_pathc;
|
||||||
|
status = glob_in_dir (filename, dirs.gl_pathv[i],
|
||||||
|
(flags | GLOB_APPEND) & ~GLOB_NOCHECK,
|
||||||
|
errfunc, pglob);
|
||||||
|
if (status == GLOB_NOMATCH)
|
||||||
|
/* No matches in this directory. Try the next. */
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (status != 0)
|
||||||
|
{
|
||||||
|
globfree (&dirs);
|
||||||
|
globfree (pglob);
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Stick the directory on the front of each name. */
|
||||||
|
if (prefix_array (dirs.gl_pathv[i],
|
||||||
|
&pglob->gl_pathv[oldcount],
|
||||||
|
pglob->gl_pathc - oldcount))
|
||||||
|
{
|
||||||
|
globfree (&dirs);
|
||||||
|
globfree (pglob);
|
||||||
|
return GLOB_NOSPACE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
flags |= GLOB_MAGCHAR;
|
||||||
|
|
||||||
|
if (pglob->gl_pathc == oldcount)
|
||||||
|
/* No matches. */
|
||||||
|
if (flags & GLOB_NOCHECK)
|
||||||
|
{
|
||||||
|
size_t len = strlen (pattern) + 1;
|
||||||
|
char *patcopy = (char *) malloc (len);
|
||||||
|
if (patcopy == NULL)
|
||||||
|
return GLOB_NOSPACE;
|
||||||
|
memcpy (patcopy, pattern, len);
|
||||||
|
|
||||||
|
pglob->gl_pathv
|
||||||
|
= (char **) realloc (pglob->gl_pathv,
|
||||||
|
(pglob->gl_pathc +
|
||||||
|
((flags & GLOB_DOOFFS) ?
|
||||||
|
pglob->gl_offs : 0) +
|
||||||
|
1 + 1) *
|
||||||
|
sizeof (char *));
|
||||||
|
if (pglob->gl_pathv == NULL)
|
||||||
|
{
|
||||||
|
free (patcopy);
|
||||||
|
return GLOB_NOSPACE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (flags & GLOB_DOOFFS)
|
||||||
|
while (pglob->gl_pathc < pglob->gl_offs)
|
||||||
|
pglob->gl_pathv[pglob->gl_pathc++] = NULL;
|
||||||
|
|
||||||
|
pglob->gl_pathv[pglob->gl_pathc++] = patcopy;
|
||||||
|
pglob->gl_pathv[pglob->gl_pathc] = NULL;
|
||||||
|
pglob->gl_flags = flags;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return GLOB_NOMATCH;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
status = glob_in_dir (filename, dirname, flags, errfunc, pglob);
|
||||||
|
if (status != 0)
|
||||||
|
return status;
|
||||||
|
|
||||||
|
if (dirlen > 0)
|
||||||
|
{
|
||||||
|
/* Stick the directory on the front of each name. */
|
||||||
|
if (prefix_array (dirname,
|
||||||
|
&pglob->gl_pathv[oldcount],
|
||||||
|
pglob->gl_pathc - oldcount))
|
||||||
|
{
|
||||||
|
globfree (pglob);
|
||||||
|
return GLOB_NOSPACE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(flags & GLOB_NOSORT))
|
||||||
|
/* Sort the vector. */
|
||||||
|
qsort ((__ptr_t) & pglob->gl_pathv[oldcount],
|
||||||
|
pglob->gl_pathc - oldcount,
|
||||||
|
sizeof (char *), collated_compare);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Free storage allocated in PGLOB by a previous `glob' call. */
|
||||||
|
void
|
||||||
|
globfree (pglob)
|
||||||
|
register glob_t *pglob;
|
||||||
|
{
|
||||||
|
if (pglob->gl_pathv != NULL)
|
||||||
|
{
|
||||||
|
register int i;
|
||||||
|
for (i = 0; i < pglob->gl_pathc; ++i)
|
||||||
|
if (pglob->gl_pathv[i] != NULL)
|
||||||
|
free ((__ptr_t) pglob->gl_pathv[i]);
|
||||||
|
free ((__ptr_t) pglob->gl_pathv);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Do a collated comparison of A and B. */
|
||||||
|
static int
|
||||||
|
collated_compare (a, b)
|
||||||
|
const __ptr_t a;
|
||||||
|
const __ptr_t b;
|
||||||
|
{
|
||||||
|
const char *const s1 = *(const char *const * const) a;
|
||||||
|
const char *const s2 = *(const char *const * const) b;
|
||||||
|
|
||||||
|
if (s1 == s2)
|
||||||
|
return 0;
|
||||||
|
if (s1 == NULL)
|
||||||
|
return 1;
|
||||||
|
if (s2 == NULL)
|
||||||
|
return -1;
|
||||||
|
return strcoll (s1, s2);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Prepend DIRNAME to each of N members of ARRAY, replacing ARRAY's
|
||||||
|
elements in place. Return nonzero if out of memory, zero if successful.
|
||||||
|
A slash is inserted between DIRNAME and each elt of ARRAY,
|
||||||
|
unless DIRNAME is just "/". Each old element of ARRAY is freed. */
|
||||||
|
static int
|
||||||
|
prefix_array (dirname, array, n)
|
||||||
|
const char *dirname;
|
||||||
|
char **array;
|
||||||
|
size_t n;
|
||||||
|
{
|
||||||
|
register size_t i;
|
||||||
|
size_t dirlen = strlen (dirname);
|
||||||
|
|
||||||
|
if (dirlen == 1 && dirname[0] == '/')
|
||||||
|
/* DIRNAME is just "/", so normal prepending would get us "//foo".
|
||||||
|
We want "/foo" instead, so don't prepend any chars from DIRNAME. */
|
||||||
|
dirlen = 0;
|
||||||
|
|
||||||
|
for (i = 0; i < n; ++i)
|
||||||
|
{
|
||||||
|
size_t eltlen = strlen (array[i]) + 1;
|
||||||
|
char *new = (char *) malloc (dirlen + 1 + eltlen);
|
||||||
|
if (new == NULL)
|
||||||
|
{
|
||||||
|
while (i > 0)
|
||||||
|
free ((__ptr_t) array[--i]);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
memcpy (new, dirname, dirlen);
|
||||||
|
new[dirlen] = '/';
|
||||||
|
memcpy (&new[dirlen + 1], array[i], eltlen);
|
||||||
|
free ((__ptr_t) array[i]);
|
||||||
|
array[i] = new;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Return nonzero if PATTERN contains any metacharacters.
|
||||||
|
Metacharacters can be quoted with backslashes if QUOTE is nonzero. */
|
||||||
|
static int
|
||||||
|
glob_pattern_p (pattern, quote)
|
||||||
|
const char *pattern;
|
||||||
|
int quote;
|
||||||
|
{
|
||||||
|
register const char *p;
|
||||||
|
int open = 0;
|
||||||
|
|
||||||
|
for (p = pattern; *p != '\0'; ++p)
|
||||||
|
switch (*p)
|
||||||
|
{
|
||||||
|
case '?':
|
||||||
|
case '*':
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
case '\\':
|
||||||
|
if (quote)
|
||||||
|
++p;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case '[':
|
||||||
|
open = 1;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ']':
|
||||||
|
if (open)
|
||||||
|
return 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Like `glob', but PATTERN is a final pathname component,
|
||||||
|
and matches are searched for in DIRECTORY.
|
||||||
|
The GLOB_NOSORT bit in FLAGS is ignored. No sorting is ever done.
|
||||||
|
The GLOB_APPEND flag is assumed to be set (always appends). */
|
||||||
|
static int
|
||||||
|
glob_in_dir (pattern, directory, flags, errfunc, pglob)
|
||||||
|
const char *pattern;
|
||||||
|
const char *directory;
|
||||||
|
int flags;
|
||||||
|
int (*errfunc) __P ((const char *, int));
|
||||||
|
glob_t *pglob;
|
||||||
|
{
|
||||||
|
__ptr_t stream;
|
||||||
|
|
||||||
|
struct globlink
|
||||||
|
{
|
||||||
|
struct globlink *next;
|
||||||
|
char *name;
|
||||||
|
};
|
||||||
|
struct globlink *names = NULL;
|
||||||
|
size_t nfound = 0;
|
||||||
|
|
||||||
|
if (!glob_pattern_p (pattern, !(flags & GLOB_NOESCAPE)))
|
||||||
|
{
|
||||||
|
stream = NULL;
|
||||||
|
flags |= GLOB_NOCHECK;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
flags |= GLOB_MAGCHAR;
|
||||||
|
|
||||||
|
stream = (__glob_opendir_hook ? (*__glob_opendir_hook) (directory)
|
||||||
|
: (__ptr_t) opendir (directory));
|
||||||
|
if (stream == NULL)
|
||||||
|
{
|
||||||
|
if ((errfunc != NULL && (*errfunc) (directory, errno)) ||
|
||||||
|
(flags & GLOB_ERR))
|
||||||
|
return GLOB_ABEND;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
while (1)
|
||||||
|
{
|
||||||
|
const char *name;
|
||||||
|
size_t len;
|
||||||
|
|
||||||
|
if (__glob_readdir_hook)
|
||||||
|
{
|
||||||
|
name = (*__glob_readdir_hook) (stream);
|
||||||
|
if (name == NULL)
|
||||||
|
break;
|
||||||
|
len = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
struct dirent *d = readdir ((DIR *) stream);
|
||||||
|
if (d == NULL)
|
||||||
|
break;
|
||||||
|
if (! REAL_DIR_ENTRY (d))
|
||||||
|
continue;
|
||||||
|
name = d->d_name;
|
||||||
|
#ifdef HAVE_D_NAMLEN
|
||||||
|
len = d->d_namlen;
|
||||||
|
#else
|
||||||
|
len = 0;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fnmatch (pattern, name,
|
||||||
|
(!(flags & GLOB_PERIOD) ? FNM_PERIOD : 0) |
|
||||||
|
((flags & GLOB_NOESCAPE) ? FNM_NOESCAPE : 0)) == 0)
|
||||||
|
{
|
||||||
|
struct globlink *new
|
||||||
|
= (struct globlink *) __alloca (sizeof (struct globlink));
|
||||||
|
if (len == 0)
|
||||||
|
len = strlen (name);
|
||||||
|
new->name
|
||||||
|
= (char *) malloc (len + ((flags & GLOB_MARK) ? 1 : 0) + 1);
|
||||||
|
if (new->name == NULL)
|
||||||
|
goto memory_error;
|
||||||
|
memcpy ((__ptr_t) new->name, name, len);
|
||||||
|
if (flags & GLOB_MARK)
|
||||||
|
new->name[len++] = '/';
|
||||||
|
new->name[len] = '\0';
|
||||||
|
new->next = names;
|
||||||
|
names = new;
|
||||||
|
++nfound;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nfound == 0 && (flags & GLOB_NOCHECK))
|
||||||
|
{
|
||||||
|
size_t len = strlen (pattern);
|
||||||
|
nfound = 1;
|
||||||
|
names = (struct globlink *) __alloca (sizeof (struct globlink));
|
||||||
|
names->next = NULL;
|
||||||
|
names->name = (char *) malloc (len + ((flags & GLOB_MARK) ? 1 : 0) + 1);
|
||||||
|
if (names->name == NULL)
|
||||||
|
goto memory_error;
|
||||||
|
memcpy (names->name, pattern, len);
|
||||||
|
if (flags & GLOB_MARK)
|
||||||
|
names->name[len++] = '/';
|
||||||
|
names->name[len] = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
|
pglob->gl_pathv
|
||||||
|
= (char **) realloc (pglob->gl_pathv,
|
||||||
|
(pglob->gl_pathc +
|
||||||
|
((flags & GLOB_DOOFFS) ? pglob->gl_offs : 0) +
|
||||||
|
nfound + 1) *
|
||||||
|
sizeof (char *));
|
||||||
|
if (pglob->gl_pathv == NULL)
|
||||||
|
goto memory_error;
|
||||||
|
|
||||||
|
if (flags & GLOB_DOOFFS)
|
||||||
|
while (pglob->gl_pathc < pglob->gl_offs)
|
||||||
|
pglob->gl_pathv[pglob->gl_pathc++] = NULL;
|
||||||
|
|
||||||
|
for (; names != NULL; names = names->next)
|
||||||
|
pglob->gl_pathv[pglob->gl_pathc++] = names->name;
|
||||||
|
pglob->gl_pathv[pglob->gl_pathc] = NULL;
|
||||||
|
|
||||||
|
pglob->gl_flags = flags;
|
||||||
|
|
||||||
|
if (stream != NULL)
|
||||||
|
{
|
||||||
|
int save = errno;
|
||||||
|
if (__glob_closedir_hook)
|
||||||
|
(*__glob_closedir_hook) (stream);
|
||||||
|
else
|
||||||
|
(void) closedir ((DIR *) stream);
|
||||||
|
errno = save;
|
||||||
|
}
|
||||||
|
return nfound == 0 ? GLOB_NOMATCH : 0;
|
||||||
|
|
||||||
|
memory_error:
|
||||||
|
{
|
||||||
|
int save = errno;
|
||||||
|
if (__glob_closedir_hook)
|
||||||
|
(*__glob_closedir_hook) (stream);
|
||||||
|
else
|
||||||
|
(void) closedir ((DIR *) stream);
|
||||||
|
errno = save;
|
||||||
|
}
|
||||||
|
while (names != NULL)
|
||||||
|
{
|
||||||
|
if (names->name != NULL)
|
||||||
|
free ((__ptr_t) names->name);
|
||||||
|
names = names->next;
|
||||||
|
}
|
||||||
|
return GLOB_NOSPACE;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* _LIBC or not __GNU_LIBRARY__. */
|
||||||
97
glob/glob.h
Normal file
97
glob/glob.h
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
/* Copyright (C) 1991, 1992 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
This library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU Library General Public License as
|
||||||
|
published by the Free Software Foundation; either version 2 of the
|
||||||
|
License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This library 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
|
||||||
|
Library General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Library General Public
|
||||||
|
License along with this library; see the file COPYING.LIB. If
|
||||||
|
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
||||||
|
Cambridge, MA 02139, USA. */
|
||||||
|
|
||||||
|
#ifndef _GLOB_H
|
||||||
|
|
||||||
|
#define _GLOB_H 1
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C"
|
||||||
|
{
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#undef __ptr_t
|
||||||
|
#if defined (__cplusplus) || (defined (__STDC__) && __STDC__)
|
||||||
|
#undef __P
|
||||||
|
#define __P(protos) protos
|
||||||
|
#define __ptr_t void *
|
||||||
|
#else /* Not C++ or ANSI C. */
|
||||||
|
#undef __P
|
||||||
|
#define __P(protos) ()
|
||||||
|
#undef const
|
||||||
|
#define const
|
||||||
|
#define __ptr_t char *
|
||||||
|
#endif /* C++ or ANSI C. */
|
||||||
|
|
||||||
|
/* Bits set in the FLAGS argument to `glob'. */
|
||||||
|
#define GLOB_ERR (1 << 0)/* Return on read errors. */
|
||||||
|
#define GLOB_MARK (1 << 1)/* Append a slash to each name. */
|
||||||
|
#define GLOB_NOSORT (1 << 2)/* Don't sort the names. */
|
||||||
|
#define GLOB_DOOFFS (1 << 3)/* Insert PGLOB->gl_offs NULLs. */
|
||||||
|
#define GLOB_NOCHECK (1 << 4)/* If nothing matches, return the pattern. */
|
||||||
|
#define GLOB_APPEND (1 << 5)/* Append to results of a previous call. */
|
||||||
|
#define GLOB_NOESCAPE (1 << 6)/* Backslashes don't quote metacharacters. */
|
||||||
|
#define GLOB_PERIOD (1 << 7)/* Leading `.' can be matched by metachars. */
|
||||||
|
#define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
|
||||||
|
GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND|GLOB_PERIOD)
|
||||||
|
|
||||||
|
#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_BSD_SOURCE)
|
||||||
|
#define GLOB_MAGCHAR (1 << 8)/* Set in gl_flags if any metachars seen. */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Error returns from `glob'. */
|
||||||
|
#define GLOB_NOSPACE 1 /* Ran out of memory. */
|
||||||
|
#define GLOB_ABEND 2 /* Read error. */
|
||||||
|
#define GLOB_NOMATCH 3 /* No matches found. */
|
||||||
|
|
||||||
|
/* Structure describing a globbing run. */
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
int gl_pathc; /* Count of paths matched by the pattern. */
|
||||||
|
char **gl_pathv; /* List of matched pathnames. */
|
||||||
|
int gl_offs; /* Slots to reserve in `gl_pathv'. */
|
||||||
|
int gl_flags; /* Set to FLAGS, maybe | GLOB_MAGCHAR. */
|
||||||
|
} glob_t;
|
||||||
|
|
||||||
|
/* Do glob searching for PATTERN, placing results in PGLOB.
|
||||||
|
The bits defined above may be set in FLAGS.
|
||||||
|
If a directory cannot be opened or read and ERRFUNC is not nil,
|
||||||
|
it is called with the pathname that caused the error, and the
|
||||||
|
`errno' value from the failing call; if it returns non-zero
|
||||||
|
`glob' returns GLOB_ABEND; if it returns zero, the error is ignored.
|
||||||
|
If memory cannot be allocated for PGLOB, GLOB_NOSPACE is returned.
|
||||||
|
Otherwise, `glob' returns zero. */
|
||||||
|
extern int glob __P ((const char *__pattern, int __flags,
|
||||||
|
int (*__errfunc) __P ((const char *, int)),
|
||||||
|
glob_t *__pglob));
|
||||||
|
|
||||||
|
/* Free storage allocated in PGLOB by a previous `glob' call. */
|
||||||
|
extern void globfree __P ((glob_t *__pglob));
|
||||||
|
|
||||||
|
|
||||||
|
#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_GNU_SOURCE)
|
||||||
|
/* If they are not NULL, `glob' uses these functions to read directories. */
|
||||||
|
extern __ptr_t (*__glob_opendir_hook) __P ((const char *__directory));
|
||||||
|
extern const char *(*__glob_readdir_hook) __P ((__ptr_t __stream));
|
||||||
|
extern void (*__glob_closedir_hook) __P ((__ptr_t __stream));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* glob.h */
|
||||||
270
job.c
270
job.c
@@ -1,5 +1,5 @@
|
|||||||
/* Job execution and handling for GNU Make.
|
/* Job execution and handling for GNU Make.
|
||||||
Copyright (C) 1988, 89, 90, 91, 92, 93, 94 Free Software Foundation, Inc.
|
Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 1995 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify
|
GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -23,9 +23,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||||||
#include "variable.h"
|
#include "variable.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
/* Default path to search for executables. */
|
|
||||||
static char default_path[] = ":/bin:/usr/bin";
|
|
||||||
|
|
||||||
/* Default shell to use. */
|
/* Default shell to use. */
|
||||||
char default_shell[] = "/bin/sh";
|
char default_shell[] = "/bin/sh";
|
||||||
|
|
||||||
@@ -125,6 +122,9 @@ extern int setgid (), getgid ();
|
|||||||
#ifdef HAVE_GETDTABLESIZE
|
#ifdef HAVE_GETDTABLESIZE
|
||||||
extern int getdtablesize ();
|
extern int getdtablesize ();
|
||||||
#else
|
#else
|
||||||
|
#ifdef HAVE_SYSCONF_OPEN_MAX
|
||||||
|
#define getdtablesize() ((int) sysconf (_SC_OPEN_MAX))
|
||||||
|
#else
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#define getdtablesize() NOFILE
|
#define getdtablesize() NOFILE
|
||||||
#if !defined (NOFILE) && defined (NOFILES_MAX)
|
#if !defined (NOFILE) && defined (NOFILES_MAX)
|
||||||
@@ -133,6 +133,7 @@ extern int getdtablesize ();
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
extern int getloadavg ();
|
extern int getloadavg ();
|
||||||
extern int start_remote_job_p ();
|
extern int start_remote_job_p ();
|
||||||
@@ -173,14 +174,9 @@ child_error (target_name, exit_code, exit_sig, coredump, ignored)
|
|||||||
"*** [%s] Error %d",
|
"*** [%s] Error %d",
|
||||||
target_name, exit_code);
|
target_name, exit_code);
|
||||||
else
|
else
|
||||||
{
|
error ("*** [%s] %s%s",
|
||||||
char *coredump_string = coredump ? " (core dumped)" : "";
|
target_name, strsignal (exit_sig),
|
||||||
if (exit_sig > 0 && exit_sig < NSIG)
|
coredump ? " (core dumped)" : "");
|
||||||
error ("*** [%s] %s%s",
|
|
||||||
target_name, sys_siglist[exit_sig], coredump_string);
|
|
||||||
else
|
|
||||||
error ("*** [%s] Signal %d%s", target_name, exit_sig, coredump_string);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static unsigned int dead_children = 0;
|
static unsigned int dead_children = 0;
|
||||||
@@ -381,7 +377,7 @@ reap_children (block, err)
|
|||||||
delete non-precious targets, and abort. */
|
delete non-precious targets, and abort. */
|
||||||
static int delete_on_error = -1;
|
static int delete_on_error = -1;
|
||||||
child_error (c->file->name, exit_code, exit_sig, coredump, 0);
|
child_error (c->file->name, exit_code, exit_sig, coredump, 0);
|
||||||
c->file->update_status = 1;
|
c->file->update_status = 2;
|
||||||
if (delete_on_error == -1)
|
if (delete_on_error == -1)
|
||||||
{
|
{
|
||||||
struct file *f = lookup_file (".DELETE_ON_ERROR");
|
struct file *f = lookup_file (".DELETE_ON_ERROR");
|
||||||
@@ -409,7 +405,7 @@ reap_children (block, err)
|
|||||||
Since there are more commands that wanted to be run,
|
Since there are more commands that wanted to be run,
|
||||||
the target was not completely remade. So we treat
|
the target was not completely remade. So we treat
|
||||||
this as if a command had failed. */
|
this as if a command had failed. */
|
||||||
c->file->update_status = 1;
|
c->file->update_status = 2;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -437,7 +433,7 @@ reap_children (block, err)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* When we get here, all the commands for C->file are finished
|
/* When we get here, all the commands for C->file are finished
|
||||||
(or aborted) and C->file->update_status contains 0 or 1. But
|
(or aborted) and C->file->update_status contains 0 or 2. But
|
||||||
C->file->command_state is still cs_running if all the commands
|
C->file->command_state is still cs_running if all the commands
|
||||||
ran; notice_finish_file looks for cs_running to tell it that
|
ran; notice_finish_file looks for cs_running to tell it that
|
||||||
it's interesting to check the file's modtime again now. */
|
it's interesting to check the file's modtime again now. */
|
||||||
@@ -591,6 +587,7 @@ start_job_command (child)
|
|||||||
|
|
||||||
if (argv == 0)
|
if (argv == 0)
|
||||||
{
|
{
|
||||||
|
next_command:
|
||||||
/* This line has no commands. Go to the next. */
|
/* This line has no commands. Go to the next. */
|
||||||
if (job_next_command (child))
|
if (job_next_command (child))
|
||||||
start_job_command (child);
|
start_job_command (child);
|
||||||
@@ -623,10 +620,7 @@ start_job_command (child)
|
|||||||
{
|
{
|
||||||
free (argv[0]);
|
free (argv[0]);
|
||||||
free ((char *) argv);
|
free ((char *) argv);
|
||||||
if (job_next_command (child))
|
goto next_command;
|
||||||
start_job_command (child);
|
|
||||||
child->file->update_status = 0;
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Flush the output streams so they won't have things written twice. */
|
/* Flush the output streams so they won't have things written twice. */
|
||||||
@@ -689,6 +683,8 @@ start_job_command (child)
|
|||||||
{
|
{
|
||||||
/* Fork the child process. */
|
/* Fork the child process. */
|
||||||
|
|
||||||
|
char **parent_environ;
|
||||||
|
|
||||||
#ifdef POSIX
|
#ifdef POSIX
|
||||||
(void) sigprocmask (SIG_BLOCK, &fatal_signal_set, (sigset_t *) 0);
|
(void) sigprocmask (SIG_BLOCK, &fatal_signal_set, (sigset_t *) 0);
|
||||||
#else
|
#else
|
||||||
@@ -698,7 +694,9 @@ start_job_command (child)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
child->remote = 0;
|
child->remote = 0;
|
||||||
|
parent_environ = environ;
|
||||||
child->pid = vfork ();
|
child->pid = vfork ();
|
||||||
|
environ = parent_environ; /* Restore value child may have clobbered. */
|
||||||
if (child->pid == 0)
|
if (child->pid == 0)
|
||||||
{
|
{
|
||||||
/* We are the child side. */
|
/* We are the child side. */
|
||||||
@@ -768,7 +766,7 @@ start_waiting_job (c)
|
|||||||
{
|
{
|
||||||
/* Put this child on the chain of children waiting
|
/* Put this child on the chain of children waiting
|
||||||
for the load average to go down. */
|
for the load average to go down. */
|
||||||
c->file->command_state = cs_running;
|
set_command_state (c->file, cs_running);
|
||||||
c->next = waiting_jobs;
|
c->next = waiting_jobs;
|
||||||
waiting_jobs = c;
|
waiting_jobs = c;
|
||||||
return 0;
|
return 0;
|
||||||
@@ -1073,105 +1071,6 @@ child_execute_job (stdin_fd, stdout_fd, argv, envp)
|
|||||||
exec_command (argv, envp);
|
exec_command (argv, envp);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Search PATH for FILE.
|
|
||||||
If successful, store the full pathname in PROGRAM and return 1.
|
|
||||||
If not sucessful, return zero. */
|
|
||||||
|
|
||||||
static int
|
|
||||||
search_path (file, path, program)
|
|
||||||
char *file, *path, *program;
|
|
||||||
{
|
|
||||||
if (path == 0 || path[0] == '\0')
|
|
||||||
path = default_path;
|
|
||||||
|
|
||||||
if (
|
|
||||||
#ifdef __MSDOS__
|
|
||||||
strpbrk (file, "/\\:")
|
|
||||||
#else
|
|
||||||
index (file, '/')
|
|
||||||
#endif
|
|
||||||
!= 0)
|
|
||||||
{
|
|
||||||
strcpy (program, file);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
unsigned int len;
|
|
||||||
|
|
||||||
#ifdef HAVE_GETGROUPS
|
|
||||||
#ifndef HAVE_UNISTD_H
|
|
||||||
extern int getgroups ();
|
|
||||||
#endif
|
|
||||||
static int ngroups = -1;
|
|
||||||
#ifdef NGROUPS_MAX
|
|
||||||
static GETGROUPS_T groups[NGROUPS_MAX];
|
|
||||||
#define ngroups_max NGROUPS_MAX
|
|
||||||
#else
|
|
||||||
static GETGROUPS_T *groups = 0;
|
|
||||||
static int ngroups_max;
|
|
||||||
if (groups == 0)
|
|
||||||
{
|
|
||||||
ngroups_max = GET_NGROUPS_MAX;
|
|
||||||
groups = (GETGROUPS_T *) malloc (ngroups_max * sizeof (GETGROUPS_T));
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
if (groups != 0 && ngroups == -1)
|
|
||||||
ngroups = getgroups (ngroups_max, groups);
|
|
||||||
#endif /* Have getgroups. */
|
|
||||||
|
|
||||||
len = strlen (file) + 1;
|
|
||||||
do
|
|
||||||
{
|
|
||||||
struct stat st;
|
|
||||||
int perm;
|
|
||||||
char *p;
|
|
||||||
|
|
||||||
p = index (path, PATH_SEPARATOR_CHAR);
|
|
||||||
if (p == 0)
|
|
||||||
p = path + strlen (path);
|
|
||||||
|
|
||||||
if (p == path)
|
|
||||||
bcopy (file, program, len);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
bcopy (path, program, p - path);
|
|
||||||
program[p - path] = '/';
|
|
||||||
bcopy (file, program + (p - path) + 1, len);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (safe_stat (program, &st) == 0
|
|
||||||
&& S_ISREG (st.st_mode))
|
|
||||||
{
|
|
||||||
if (st.st_uid == geteuid ())
|
|
||||||
perm = (st.st_mode & 0100);
|
|
||||||
else if (st.st_gid == getegid ())
|
|
||||||
perm = (st.st_mode & 0010);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
#ifdef HAVE_GETGROUPS
|
|
||||||
register int i;
|
|
||||||
for (i = 0; i < ngroups; ++i)
|
|
||||||
if (groups[i] == st.st_gid)
|
|
||||||
break;
|
|
||||||
if (i < ngroups)
|
|
||||||
perm = (st.st_mode & 0010);
|
|
||||||
else
|
|
||||||
#endif /* Have getgroups. */
|
|
||||||
perm = (st.st_mode & 0001);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (perm != 0)
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
path = p + 1;
|
|
||||||
} while (*path != '\0');
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Replace the current process with one running the command in ARGV,
|
/* Replace the current process with one running the command in ARGV,
|
||||||
with environment ENVP. This function does not return. */
|
with environment ENVP. This function does not return. */
|
||||||
|
|
||||||
@@ -1179,82 +1078,65 @@ void
|
|||||||
exec_command (argv, envp)
|
exec_command (argv, envp)
|
||||||
char **argv, **envp;
|
char **argv, **envp;
|
||||||
{
|
{
|
||||||
char *shell, *path;
|
|
||||||
PATH_VAR (program);
|
|
||||||
register char **ep;
|
|
||||||
|
|
||||||
shell = path = 0;
|
|
||||||
for (ep = envp; *ep != 0; ++ep)
|
|
||||||
{
|
|
||||||
if (shell == 0 && !strncmp(*ep, "SHELL=", 6))
|
|
||||||
shell = &(*ep)[6];
|
|
||||||
else if (path == 0 && !strncmp(*ep, "PATH=", 5))
|
|
||||||
path = &(*ep)[5];
|
|
||||||
else if (path != 0 && shell != 0)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Be the user, permanently. */
|
/* Be the user, permanently. */
|
||||||
child_access ();
|
child_access ();
|
||||||
|
|
||||||
if (!search_path (argv[0], path, program))
|
/* Run the program. */
|
||||||
error ("%s: Command not found", argv[0]);
|
environ = envp;
|
||||||
else
|
execvp (argv[0], argv);
|
||||||
|
|
||||||
|
switch (errno)
|
||||||
{
|
{
|
||||||
/* Run the program. */
|
case ENOENT:
|
||||||
execve (program, argv, envp);
|
error ("%s: Command not found", argv[0]);
|
||||||
|
break;
|
||||||
|
case ENOEXEC:
|
||||||
|
{
|
||||||
|
/* The file is not executable. Try it as a shell script. */
|
||||||
|
extern char *getenv ();
|
||||||
|
char *shell;
|
||||||
|
char **new_argv;
|
||||||
|
int argc;
|
||||||
|
|
||||||
if (errno == ENOEXEC)
|
shell = getenv ("SHELL");
|
||||||
{
|
if (shell == 0)
|
||||||
PATH_VAR (shell_program);
|
shell = default_shell;
|
||||||
char *shell_path;
|
|
||||||
if (shell == 0)
|
|
||||||
shell_path = default_shell;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (search_path (shell, path, shell_program))
|
|
||||||
shell_path = shell_program;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
shell_path = 0;
|
|
||||||
error ("%s: Shell program not found", shell);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (shell_path != 0)
|
argc = 1;
|
||||||
{
|
while (argv[argc] != 0)
|
||||||
char **new_argv;
|
++argc;
|
||||||
int argc;
|
|
||||||
|
|
||||||
argc = 1;
|
new_argv = (char **) alloca ((1 + argc + 1) * sizeof (char *));
|
||||||
while (argv[argc] != 0)
|
new_argv[0] = shell;
|
||||||
++argc;
|
new_argv[1] = program;
|
||||||
|
while (argc > 0)
|
||||||
|
{
|
||||||
|
new_argv[1 + argc] = argv[argc];
|
||||||
|
--argc;
|
||||||
|
}
|
||||||
|
|
||||||
new_argv = (char **) alloca ((1 + argc + 1) * sizeof (char *));
|
execvp (shell, new_argv);
|
||||||
new_argv[0] = shell_path;
|
if (errno == ENOENT)
|
||||||
new_argv[1] = program;
|
error ("%s: Shell program not found", shell);
|
||||||
while (argc > 0)
|
else
|
||||||
{
|
perror_with_name ("execvp: ", shell);
|
||||||
new_argv[1 + argc] = argv[argc];
|
break;
|
||||||
--argc;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
execve (shell_path, new_argv, envp);
|
default:
|
||||||
perror_with_name ("execve: ", shell_path);
|
perror_with_name ("execvp: ", argv[0]);
|
||||||
}
|
break;
|
||||||
}
|
|
||||||
else
|
|
||||||
perror_with_name ("execve: ", program);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_exit (127);
|
_exit (127);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Figure out the argument list necessary to run LINE as a command.
|
/* Figure out the argument list necessary to run LINE as a command. Try to
|
||||||
Try to avoid using a shell. This routine handles only ' quoting.
|
avoid using a shell. This routine handles only ' quoting, and " quoting
|
||||||
Starting quotes may be escaped with a backslash. If any of the
|
when no backslash, $ or ` characters are seen in the quotes. Starting
|
||||||
characters in sh_chars[] is seen, or any of the builtin commands
|
quotes may be escaped with a backslash. If any of the characters in
|
||||||
listed in sh_cmds[] is the first word of a line, the shell is used.
|
sh_chars[] is seen, or any of the builtin commands listed in sh_cmds[]
|
||||||
|
is the first word of a line, the shell is used.
|
||||||
|
|
||||||
If RESTP is not NULL, *RESTP is set to point to the first newline in LINE.
|
If RESTP is not NULL, *RESTP is set to point to the first newline in LINE.
|
||||||
If *RESTP is NULL, newlines will be ignored.
|
If *RESTP is NULL, newlines will be ignored.
|
||||||
@@ -1332,7 +1214,7 @@ construct_command_argv_internal (line, restp, shell, ifs)
|
|||||||
string_char:
|
string_char:
|
||||||
/* Inside a string, just copy any char except a closing quote
|
/* Inside a string, just copy any char except a closing quote
|
||||||
or a backslash-newline combination. */
|
or a backslash-newline combination. */
|
||||||
if (*p == '\'')
|
if (*p == instring)
|
||||||
instring = 0;
|
instring = 0;
|
||||||
else if (*p == '\\' && p[1] == '\n')
|
else if (*p == '\\' && p[1] == '\n')
|
||||||
goto swallow_escaped_newline;
|
goto swallow_escaped_newline;
|
||||||
@@ -1342,6 +1224,10 @@ construct_command_argv_internal (line, restp, shell, ifs)
|
|||||||
*restp = p;
|
*restp = p;
|
||||||
goto end_of_line;
|
goto end_of_line;
|
||||||
}
|
}
|
||||||
|
/* Backslash, $, and ` are special inside double quotes.
|
||||||
|
If we see any of those, punt. */
|
||||||
|
else if (instring == '"' && index ("\\$`", *p) != 0)
|
||||||
|
goto slow;
|
||||||
else
|
else
|
||||||
*ap++ = *p;
|
*ap++ = *p;
|
||||||
}
|
}
|
||||||
@@ -1399,7 +1285,8 @@ construct_command_argv_internal (line, restp, shell, ifs)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case '\'':
|
case '\'':
|
||||||
instring = 1;
|
case '"':
|
||||||
|
instring = *p;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '\n':
|
case '\n':
|
||||||
@@ -1505,7 +1392,7 @@ construct_command_argv_internal (line, restp, shell, ifs)
|
|||||||
strcat (dos_bname, ".bat");
|
strcat (dos_bname, ".bat");
|
||||||
strcat (dos_bename, ".err");
|
strcat (dos_bename, ".err");
|
||||||
}
|
}
|
||||||
batch = fopen(bename, "w"); /* Create a file. */
|
batch = fopen (dos_bename, "w"); /* Create a file. */
|
||||||
if (batch != NULL)
|
if (batch != NULL)
|
||||||
fclose (batch);
|
fclose (batch);
|
||||||
batch = fopen (dos_bname, "w");
|
batch = fopen (dos_bname, "w");
|
||||||
@@ -1514,7 +1401,7 @@ construct_command_argv_internal (line, restp, shell, ifs)
|
|||||||
fprintf (batch, "\nif errorlevel 1 del %s\n", dos_bename);
|
fprintf (batch, "\nif errorlevel 1 del %s\n", dos_bename);
|
||||||
fclose (batch);
|
fclose (batch);
|
||||||
new_argv = (char **) xmalloc(2 * sizeof(char *));
|
new_argv = (char **) xmalloc(2 * sizeof(char *));
|
||||||
new_argv[0] = strdup (bname);
|
new_argv[0] = strdup (dos_bname);
|
||||||
new_argv[1] = 0;
|
new_argv[1] = 0;
|
||||||
}
|
}
|
||||||
#else /* Not MSDOS. */
|
#else /* Not MSDOS. */
|
||||||
@@ -1564,7 +1451,7 @@ construct_command_argv_internal (line, restp, shell, ifs)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*p == '\\' || *p == '\''
|
if (*p == '\\' || *p == '\'' || *p == '"'
|
||||||
|| isspace (*p)
|
|| isspace (*p)
|
||||||
|| index (sh_chars, *p) != 0)
|
|| index (sh_chars, *p) != 0)
|
||||||
*ap++ = '\\';
|
*ap++ = '\\';
|
||||||
@@ -1580,11 +1467,12 @@ construct_command_argv_internal (line, restp, shell, ifs)
|
|||||||
return new_argv;
|
return new_argv;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Figure out the argument list necessary to run LINE as a command.
|
/* Figure out the argument list necessary to run LINE as a command. Try to
|
||||||
Try to avoid using a shell. This routine handles only ' quoting.
|
avoid using a shell. This routine handles only ' quoting, and " quoting
|
||||||
Starting quotes may be escaped with a backslash. If any of the
|
when no backslash, $ or ` characters are seen in the quotes. Starting
|
||||||
characters in sh_chars[] is seen, or any of the builtin commands
|
quotes may be escaped with a backslash. If any of the characters in
|
||||||
listed in sh_cmds[] is the first word of a line, the shell is used.
|
sh_chars[] is seen, or any of the builtin commands listed in sh_cmds[]
|
||||||
|
is the first word of a line, the shell is used.
|
||||||
|
|
||||||
If RESTP is not NULL, *RESTP is set to point to the first newline in LINE.
|
If RESTP is not NULL, *RESTP is set to point to the first newline in LINE.
|
||||||
If *RESTP is NULL, newlines will be ignored.
|
If *RESTP is NULL, newlines will be ignored.
|
||||||
|
|||||||
31
loadtest.c
Normal file
31
loadtest.c
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
extern volatile void exit (int);
|
||||||
|
extern double load_average (void);
|
||||||
|
|
||||||
|
double max_load_average = -1;
|
||||||
|
unsigned int job_slots_used = 0;
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
printf ("load_average () = %.2f\n", load_average ());
|
||||||
|
exit (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
error (char *fmt, ...)
|
||||||
|
{
|
||||||
|
exit (1);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
perror_with_name (char *a, char *b)
|
||||||
|
{
|
||||||
|
exit (1);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
wait_for_children (int i)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
163
main.c
163
main.c
@@ -1,5 +1,5 @@
|
|||||||
/* Argument parsing and main program of GNU Make.
|
/* Argument parsing and main program of GNU Make.
|
||||||
Copyright (C) 1988, 89, 90, 91, 94 Free Software Foundation, Inc.
|
Copyright (C) 1988, 89, 90, 91, 94, 1995 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify
|
GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -23,6 +23,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||||||
#include "variable.h"
|
#include "variable.h"
|
||||||
#include "job.h"
|
#include "job.h"
|
||||||
#include "getopt.h"
|
#include "getopt.h"
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
|
|
||||||
extern void print_variable_data_base ();
|
extern void print_variable_data_base ();
|
||||||
@@ -397,6 +398,15 @@ enter_command_line_file (name)
|
|||||||
return enter_file (savestring (name, strlen (name)));
|
return enter_file (savestring (name, strlen (name)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Toggle -d on receipt of SIGUSR1. */
|
||||||
|
|
||||||
|
static RETSIGTYPE
|
||||||
|
debug_signal_handler (sig)
|
||||||
|
int sig;
|
||||||
|
{
|
||||||
|
debug_flag = ! debug_flag;
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
main (argc, argv, envp)
|
main (argc, argv, envp)
|
||||||
int argc;
|
int argc;
|
||||||
@@ -415,7 +425,7 @@ main (argc, argv, envp)
|
|||||||
reading_filename = 0;
|
reading_filename = 0;
|
||||||
reading_lineno_ptr = 0;
|
reading_lineno_ptr = 0;
|
||||||
|
|
||||||
#ifndef HAVE_SYS_SIGLIST
|
#if !defined (HAVE_STRSIGNAL) && !defined (HAVE_SYS_SIGLIST)
|
||||||
signame_init ();
|
signame_init ();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -589,7 +599,7 @@ main (argc, argv, envp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Now allocate a buffer big enough and fill it. */
|
/* Now allocate a buffer big enough and fill it. */
|
||||||
p = value = alloca (len);
|
p = value = (char *) alloca (len);
|
||||||
for (cv = command_variables; cv != 0; cv = cv->next)
|
for (cv = command_variables; cv != 0; cv = cv->next)
|
||||||
{
|
{
|
||||||
v = cv->variable;
|
v = cv->variable;
|
||||||
@@ -691,11 +701,16 @@ main (argc, argv, envp)
|
|||||||
/* This makefile is standard input. Since we may re-exec
|
/* This makefile is standard input. Since we may re-exec
|
||||||
and thus re-read the makefiles, we read standard input
|
and thus re-read the makefiles, we read standard input
|
||||||
into a temporary file and read from that. */
|
into a temporary file and read from that. */
|
||||||
static char name[] = "/tmp/GmXXXXXX";
|
|
||||||
FILE *outfile;
|
FILE *outfile;
|
||||||
|
|
||||||
/* Make a unique filename. */
|
/* Make a unique filename. */
|
||||||
|
#ifdef HAVE_MKTEMP
|
||||||
|
static char name[] = "/tmp/GmXXXXXX";
|
||||||
(void) mktemp (name);
|
(void) mktemp (name);
|
||||||
|
#else
|
||||||
|
static char name[L_tmpnam];
|
||||||
|
(void) tmpnam (name);
|
||||||
|
#endif
|
||||||
|
|
||||||
outfile = fopen (name, "w");
|
outfile = fopen (name, "w");
|
||||||
if (outfile == 0)
|
if (outfile == 0)
|
||||||
@@ -744,6 +759,11 @@ main (argc, argv, envp)
|
|||||||
(void) signal (SIGCLD, child_handler);
|
(void) signal (SIGCLD, child_handler);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Let the user send us SIGUSR1 to toggle the -d flag during the run. */
|
||||||
|
#ifdef SIGUSR1
|
||||||
|
(void) signal (SIGUSR1, debug_signal_handler);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Define the initial list of suffixes for old-style rules. */
|
/* Define the initial list of suffixes for old-style rules. */
|
||||||
|
|
||||||
set_default_suffixes ();
|
set_default_suffixes ();
|
||||||
@@ -904,14 +924,17 @@ main (argc, argv, envp)
|
|||||||
|
|
||||||
switch (update_goal_chain (read_makefiles, 1))
|
switch (update_goal_chain (read_makefiles, 1))
|
||||||
{
|
{
|
||||||
|
case 1:
|
||||||
default:
|
default:
|
||||||
abort ();
|
#define BOGUS_UPDATE_STATUS 0
|
||||||
|
assert (BOGUS_UPDATE_STATUS);
|
||||||
|
break;
|
||||||
|
|
||||||
case -1:
|
case -1:
|
||||||
/* Did nothing. */
|
/* Did nothing. */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1:
|
case 2:
|
||||||
/* Failed to update. Figure out if we care. */
|
/* Failed to update. Figure out if we care. */
|
||||||
{
|
{
|
||||||
/* Nonzero if any makefile was successfully remade. */
|
/* Nonzero if any makefile was successfully remade. */
|
||||||
@@ -1179,6 +1202,51 @@ init_switches ()
|
|||||||
long_options[i].name = 0;
|
long_options[i].name = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
handle_non_switch_argument (arg, env)
|
||||||
|
char *arg;
|
||||||
|
int env;
|
||||||
|
{
|
||||||
|
/* Non-option argument. It might be a variable definition. */
|
||||||
|
struct variable *v;
|
||||||
|
if (arg[0] == '-' && arg[1] == '\0')
|
||||||
|
/* Ignore plain `-' for compatibility. */
|
||||||
|
return;
|
||||||
|
v = try_variable_definition ((char *) 0, 0, arg, o_command);
|
||||||
|
if (v != 0)
|
||||||
|
{
|
||||||
|
/* It is indeed a variable definition. Record a pointer to
|
||||||
|
the variable for later use in define_makeflags. */
|
||||||
|
struct command_variable *cv
|
||||||
|
= (struct command_variable *) xmalloc (sizeof (*cv));
|
||||||
|
cv->variable = v;
|
||||||
|
cv->next = command_variables;
|
||||||
|
command_variables = cv;
|
||||||
|
}
|
||||||
|
else if (! env)
|
||||||
|
{
|
||||||
|
/* Not an option or variable definition; it must be a goal
|
||||||
|
target! Enter it as a file and add it to the dep chain of
|
||||||
|
goals. */
|
||||||
|
struct file *f = enter_command_line_file (arg);
|
||||||
|
f->cmd_target = 1;
|
||||||
|
|
||||||
|
if (goals == 0)
|
||||||
|
{
|
||||||
|
goals = (struct dep *) xmalloc (sizeof (struct dep));
|
||||||
|
lastgoal = goals;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lastgoal->next
|
||||||
|
= (struct dep *) xmalloc (sizeof (struct dep));
|
||||||
|
lastgoal = lastgoal->next;
|
||||||
|
}
|
||||||
|
lastgoal->name = 0;
|
||||||
|
lastgoal->file = f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Decode switches from ARGC and ARGV.
|
/* Decode switches from ARGC and ARGV.
|
||||||
They came from the environment if ENV is nonzero. */
|
They came from the environment if ENV is nonzero. */
|
||||||
|
|
||||||
@@ -1204,64 +1272,16 @@ decode_switches (argc, argv, env)
|
|||||||
/* Reset getopt's state. */
|
/* Reset getopt's state. */
|
||||||
optind = 0;
|
optind = 0;
|
||||||
|
|
||||||
c = 0;
|
|
||||||
while (optind < argc)
|
while (optind < argc)
|
||||||
{
|
{
|
||||||
|
/* Parse the next argument. */
|
||||||
|
c = getopt_long (argc, argv, options, long_options, (int *) 0);
|
||||||
if (c == EOF)
|
if (c == EOF)
|
||||||
{
|
/* End of arguments, or "--" marker seen. */
|
||||||
/* There are no more options according to getting getopt, but
|
break;
|
||||||
there are some arguments left. Since we have asked for
|
else if (c == 1)
|
||||||
non-option arguments to be returned in order, I think this
|
/* An argument not starting with a dash. */
|
||||||
only happens when there is a "--" argument to prevent later
|
handle_non_switch_argument (optarg, env);
|
||||||
argument from being options. Since getopt has finished its
|
|
||||||
job, just update its state variables for the next argument and
|
|
||||||
set C as if it had returned 1, indicating a non-option
|
|
||||||
argument. */
|
|
||||||
optarg = argv[optind++];
|
|
||||||
c = 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
/* Parse the next argument. */
|
|
||||||
c = getopt_long (argc, argv, options, long_options, (int *) 0);
|
|
||||||
|
|
||||||
if (c == 1)
|
|
||||||
{
|
|
||||||
/* Non-option argument. It might be a variable definition. */
|
|
||||||
struct variable *v;
|
|
||||||
v = try_variable_definition ((char *) 0, 0, optarg, o_command);
|
|
||||||
if (v != 0)
|
|
||||||
{
|
|
||||||
/* It is indeed a variable definition. Record a pointer to
|
|
||||||
the variable for later use in define_makeflags. */
|
|
||||||
struct command_variable *cv
|
|
||||||
= (struct command_variable *) xmalloc (sizeof (*cv));
|
|
||||||
cv->variable = v;
|
|
||||||
cv->next = command_variables;
|
|
||||||
command_variables = cv;
|
|
||||||
}
|
|
||||||
else if (! env)
|
|
||||||
{
|
|
||||||
/* Not an option or variable definition; it must be a goal
|
|
||||||
target! Enter it as a file and add it to the dep chain of
|
|
||||||
goals. */
|
|
||||||
struct file *f = enter_command_line_file (optarg);
|
|
||||||
f->cmd_target = 1;
|
|
||||||
|
|
||||||
if (goals == 0)
|
|
||||||
{
|
|
||||||
goals = (struct dep *) xmalloc (sizeof (struct dep));
|
|
||||||
lastgoal = goals;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
lastgoal->next
|
|
||||||
= (struct dep *) xmalloc (sizeof (struct dep));
|
|
||||||
lastgoal = lastgoal->next;
|
|
||||||
}
|
|
||||||
lastgoal->name = 0;
|
|
||||||
lastgoal->file = f;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (c == '?')
|
else if (c == '?')
|
||||||
/* Bad option. We will print a usage message and die later.
|
/* Bad option. We will print a usage message and die later.
|
||||||
But continue to parse the other options so the user can
|
But continue to parse the other options so the user can
|
||||||
@@ -1364,16 +1384,27 @@ positive integral argument",
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* There are no more options according to getting getopt, but there may
|
||||||
|
be some arguments left. Since we have asked for non-option arguments
|
||||||
|
to be returned in order, this only happens when there is a "--"
|
||||||
|
argument to prevent later arguments from being options. */
|
||||||
|
while (optind < argc)
|
||||||
|
handle_non_switch_argument (argv[optind++], env);
|
||||||
|
|
||||||
|
|
||||||
if (!env && (bad || print_usage_flag))
|
if (!env && (bad || print_usage_flag))
|
||||||
{
|
{
|
||||||
/* Print a nice usage message. */
|
/* Print a nice usage message. */
|
||||||
|
FILE *usageto;
|
||||||
|
|
||||||
if (print_version_flag)
|
if (print_version_flag)
|
||||||
print_version ();
|
print_version ();
|
||||||
|
|
||||||
fprintf (stderr, "Usage: %s [options] [target] ...\n", program);
|
usageto = bad ? stderr : stdout;
|
||||||
|
|
||||||
fputs ("Options:\n", stderr);
|
fprintf (usageto, "Usage: %s [options] [target] ...\n", program);
|
||||||
|
|
||||||
|
fputs ("Options:\n", usageto);
|
||||||
for (cs = switches; cs->c != '\0'; ++cs)
|
for (cs = switches; cs->c != '\0'; ++cs)
|
||||||
{
|
{
|
||||||
char buf[1024], shortarg[50], longarg[50], *p;
|
char buf[1024], shortarg[50], longarg[50], *p;
|
||||||
@@ -1444,11 +1475,11 @@ positive integral argument",
|
|||||||
line with the description, leaving at least two spaces.
|
line with the description, leaving at least two spaces.
|
||||||
Print it on its own line instead. */
|
Print it on its own line instead. */
|
||||||
{
|
{
|
||||||
fprintf (stderr, "%s\n", buf);
|
fprintf (usageto, "%s\n", buf);
|
||||||
buf[0] = '\0';
|
buf[0] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf (stderr, "%*s%s.\n",
|
fprintf (usageto, "%*s%s.\n",
|
||||||
- DESCRIPTION_COLUMN,
|
- DESCRIPTION_COLUMN,
|
||||||
buf, cs->description);
|
buf, cs->description);
|
||||||
}
|
}
|
||||||
@@ -1834,7 +1865,7 @@ print_version ()
|
|||||||
printf ("-%s", remote_description);
|
printf ("-%s", remote_description);
|
||||||
|
|
||||||
printf (", by Richard Stallman and Roland McGrath.\n\
|
printf (", by Richard Stallman and Roland McGrath.\n\
|
||||||
%sCopyright (C) 1988, 89, 90, 91, 92, 93, 94 Free Software Foundation, Inc.\n\
|
%sCopyright (C) 1988, 89, 90, 91, 92, 93, 94, 95 Free Software Foundation, Inc.\n\
|
||||||
%sThis is free software; see the source for copying conditions.\n\
|
%sThis is free software; see the source for copying conditions.\n\
|
||||||
%sThere is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A\n\
|
%sThere is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A\n\
|
||||||
%sPARTICULAR PURPOSE.\n\n", precede, precede, precede, precede);
|
%sPARTICULAR PURPOSE.\n\n", precede, precede, precede, precede);
|
||||||
|
|||||||
@@ -163,6 +163,11 @@ the file names where they should reside for actual use. If there is a
|
|||||||
simple test to verify that a program is properly installed, this target
|
simple test to verify that a program is properly installed, this target
|
||||||
should run that test.
|
should run that test.
|
||||||
|
|
||||||
|
If possible, write the @code{install} target rule so that it does not
|
||||||
|
modify anything in the directory where the program was built, provided
|
||||||
|
@samp{make all} has just been done. This is convenient for building the
|
||||||
|
program under one user name and installing it under another.
|
||||||
|
|
||||||
The commands should create all the directories in which files are to be
|
The commands should create all the directories in which files are to be
|
||||||
installed, if they don't already exist. This includes the directories
|
installed, if they don't already exist. This includes the directories
|
||||||
specified as the values of the variables @code{prefix} and
|
specified as the values of the variables @code{prefix} and
|
||||||
@@ -205,6 +210,9 @@ Delete all the installed files that the @samp{install} target would
|
|||||||
create (but not the noninstalled files such as @samp{make all} would
|
create (but not the noninstalled files such as @samp{make all} would
|
||||||
create).
|
create).
|
||||||
|
|
||||||
|
This rule should not modify the directories where compilation is done,
|
||||||
|
only the directories where files are installed.
|
||||||
|
|
||||||
@comment The gratuitous blank line here is to make the table look better
|
@comment The gratuitous blank line here is to make the table look better
|
||||||
@comment in the printed Make manual. Please leave it in.
|
@comment in the printed Make manual. Please leave it in.
|
||||||
@item clean
|
@item clean
|
||||||
@@ -228,17 +236,34 @@ normally don't want to recompile. For example, the @samp{mostlyclean}
|
|||||||
target for GCC does not delete @file{libgcc.a}, because recompiling it
|
target for GCC does not delete @file{libgcc.a}, because recompiling it
|
||||||
is rarely necessary and takes a lot of time.
|
is rarely necessary and takes a lot of time.
|
||||||
|
|
||||||
@item realclean
|
@item maintainer-clean
|
||||||
Delete everything from the current directory that can be reconstructed
|
Delete almost everything from the current directory that can be
|
||||||
with this Makefile. This typically includes everything deleted by
|
reconstructed with this Makefile. This typically includes everything
|
||||||
@code{distclean}, plus more: C source files produced by Bison, tags tables,
|
deleted by @code{distclean}, plus more: C source files produced by
|
||||||
Info files, and so on.
|
Bison, tags tables, Info files, and so on.
|
||||||
|
|
||||||
One exception, however: @samp{make realclean} should not delete
|
The reason we say ``almost everything'' is that @samp{make
|
||||||
@file{configure} even if @file{configure} can be remade using a rule in
|
maintainer-clean} should not delete @file{configure} even if
|
||||||
the Makefile. More generally, @samp{make realclean} should not delete
|
@file{configure} can be remade using a rule in the Makefile. More
|
||||||
anything that needs to exist in order to run @file{configure}
|
generally, @samp{make maintainer-clean} should not delete anything that
|
||||||
and then begin to build the program.
|
needs to exist in order to run @file{configure} and then begin to build
|
||||||
|
the program. This is the only exception; @code{maintainer-clean} should
|
||||||
|
delete everything else that can be rebuilt.
|
||||||
|
|
||||||
|
The @samp{maintainer-clean} is intended to be used by a maintainer of
|
||||||
|
the package, not by ordinary users. You may need special tools to
|
||||||
|
reconstruct some of the files that @samp{make maintainer-clean} deletes.
|
||||||
|
Since these files are normally included in the distribution, we don't
|
||||||
|
take care to make them easy to reconstruct. If you find you need to
|
||||||
|
unpack the full distribution again, don't blame us.
|
||||||
|
|
||||||
|
To help make users aware of this, the commands for
|
||||||
|
@code{maintainer-clean} should start with these two:
|
||||||
|
|
||||||
|
@example
|
||||||
|
@@echo "This command is intended for maintainers to use;"
|
||||||
|
@@echo "it deletes files that may require special tools to rebuild."
|
||||||
|
@end example
|
||||||
|
|
||||||
@item TAGS
|
@item TAGS
|
||||||
Update a tags table for this program.
|
Update a tags table for this program.
|
||||||
@@ -327,6 +352,9 @@ installdirs: mkinstalldirs
|
|||||||
$(libdir) $(infodir) \
|
$(libdir) $(infodir) \
|
||||||
$(mandir)
|
$(mandir)
|
||||||
@end smallexample
|
@end smallexample
|
||||||
|
|
||||||
|
This rule should not modify the directories where compilation is done.
|
||||||
|
It should do nothing but create installation directories.
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
@node Command Variables
|
@node Command Variables
|
||||||
|
|||||||
3
make.h
3
make.h
@@ -1,5 +1,5 @@
|
|||||||
/* Miscellaneous global declarations and portability cruft for GNU Make.
|
/* Miscellaneous global declarations and portability cruft for GNU Make.
|
||||||
Copyright (C) 1988, 89, 90, 91, 92, 93, 94 Free Software Foundation, Inc.
|
Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 95 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify
|
GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -173,7 +173,6 @@ extern unsigned int get_path_max ();
|
|||||||
extern char *malloc (), *realloc ();
|
extern char *malloc (), *realloc ();
|
||||||
extern void free ();
|
extern void free ();
|
||||||
|
|
||||||
extern void qsort ();
|
|
||||||
extern void abort (), exit ();
|
extern void abort (), exit ();
|
||||||
|
|
||||||
#endif /* Standard headers. */
|
#endif /* Standard headers. */
|
||||||
|
|||||||
25
make.texinfo
25
make.texinfo
@@ -8,10 +8,11 @@
|
|||||||
@c FSF publishers: format makebook.texi instead of using this file directly.
|
@c FSF publishers: format makebook.texi instead of using this file directly.
|
||||||
|
|
||||||
@set RCSID $Id$
|
@set RCSID $Id$
|
||||||
@set EDITION 0.47
|
@set EDITION 0.48
|
||||||
@set VERSION 3.72 Beta
|
@set VERSION 3.73 Beta
|
||||||
@set UPDATED 1 November 1994
|
@set UPDATED 4 April 1995
|
||||||
@set UPDATE-MONTH November 1994
|
@set UPDATE-MONTH April 1995
|
||||||
|
@comment The ISBN number might need to change on next publication.
|
||||||
@set ISBN 1-882114-50-7
|
@set ISBN 1-882114-50-7
|
||||||
|
|
||||||
@c finalout
|
@c finalout
|
||||||
@@ -31,7 +32,8 @@ and issues the commands to recompile them.
|
|||||||
This is Edition @value{EDITION}, last updated @value{UPDATED},
|
This is Edition @value{EDITION}, last updated @value{UPDATED},
|
||||||
of @cite{The GNU Make Manual}, for @code{make}, Version @value{VERSION}.
|
of @cite{The GNU Make Manual}, for @code{make}, Version @value{VERSION}.
|
||||||
|
|
||||||
Copyright (C) 1988, '89, '90, '91, '92, '93, '94 Free Software Foundation, Inc.
|
Copyright (C) 1988, '89, '90, '91, '92, '93, '94, '95
|
||||||
|
Free Software Foundation, Inc.
|
||||||
|
|
||||||
Permission is granted to make and distribute verbatim copies of
|
Permission is granted to make and distribute verbatim copies of
|
||||||
this manual provided the copyright notice and this permission notice
|
this manual provided the copyright notice and this permission notice
|
||||||
@@ -66,7 +68,7 @@ by the Free Software Foundation.
|
|||||||
@author Richard M. Stallman and Roland McGrath
|
@author Richard M. Stallman and Roland McGrath
|
||||||
@page
|
@page
|
||||||
@vskip 0pt plus 1filll
|
@vskip 0pt plus 1filll
|
||||||
Copyright @copyright{} 1988, '89, '90, '91, '92, '93, '94 Free Software Foundation, Inc.
|
Copyright @copyright{} 1988, '89, '90, '91, '92, '93, '94, '95 Free Software Foundation, Inc.
|
||||||
@sp 2
|
@sp 2
|
||||||
Published by the Free Software Foundation @*
|
Published by the Free Software Foundation @*
|
||||||
675 Massachusetts Avenue, @*
|
675 Massachusetts Avenue, @*
|
||||||
@@ -3294,23 +3296,20 @@ definitions just as if they appeared on the command line.
|
|||||||
|
|
||||||
@cindex @code{-C}, and recursion
|
@cindex @code{-C}, and recursion
|
||||||
@cindex @code{-f}, and recursion
|
@cindex @code{-f}, and recursion
|
||||||
@cindex @code{-I}, and recursion
|
|
||||||
@cindex @code{-o}, and recursion
|
@cindex @code{-o}, and recursion
|
||||||
@cindex @code{-W}, and recursion
|
@cindex @code{-W}, and recursion
|
||||||
@cindex @code{--directory}, and recursion
|
@cindex @code{--directory}, and recursion
|
||||||
@cindex @code{--file}, and recursion
|
@cindex @code{--file}, and recursion
|
||||||
@cindex @code{--include-dir}, and recursion
|
|
||||||
@cindex @code{--old-file}, and recursion
|
@cindex @code{--old-file}, and recursion
|
||||||
@cindex @code{--assume-old}, and recursion
|
@cindex @code{--assume-old}, and recursion
|
||||||
@cindex @code{--assume-new}, and recursion
|
@cindex @code{--assume-new}, and recursion
|
||||||
@cindex @code{--new-file}, and recursion
|
@cindex @code{--new-file}, and recursion
|
||||||
@cindex recursion, and @code{-C}
|
@cindex recursion, and @code{-C}
|
||||||
@cindex recursion, and @code{-f}
|
@cindex recursion, and @code{-f}
|
||||||
@cindex recursion, and @code{-I}
|
|
||||||
@cindex recursion, and @code{-o}
|
@cindex recursion, and @code{-o}
|
||||||
@cindex recursion, and @code{-W}
|
@cindex recursion, and @code{-W}
|
||||||
The options @samp{-C}, @samp{-f}, @samp{-I}, @samp{-o}, and @samp{-W}
|
The options @samp{-C}, @samp{-f}, @samp{-o}, and @samp{-W} are not put
|
||||||
are not put into @code{MAKEFLAGS}; these options are not passed down.@refill
|
into @code{MAKEFLAGS}; these options are not passed down.@refill
|
||||||
|
|
||||||
@cindex @code{-j}, and recursion
|
@cindex @code{-j}, and recursion
|
||||||
@cindex @code{--jobs}, and recursion
|
@cindex @code{--jobs}, and recursion
|
||||||
@@ -5400,12 +5399,12 @@ variable names because many strange things are valid variable names, but
|
|||||||
are probably not what you intended. For example,
|
are probably not what you intended. For example,
|
||||||
|
|
||||||
@smallexample
|
@smallexample
|
||||||
files := $(foreach Es escrito en espanol!,b c ch,$(find_files))
|
files := $(foreach Esta escrito en espanol!,b c ch,$(find_files))
|
||||||
@end smallexample
|
@end smallexample
|
||||||
|
|
||||||
@noindent
|
@noindent
|
||||||
might be useful if the value of @code{find_files} references the variable
|
might be useful if the value of @code{find_files} references the variable
|
||||||
whose name is @samp{Es escrito en espanol!} (es un nombre bastante largo,
|
whose name is @samp{Esta escrito en espanol!} (es un nombre bastante largo,
|
||||||
no?), but it is more likely to be a mistake.
|
no?), but it is more likely to be a mistake.
|
||||||
|
|
||||||
@node Origin Function, Shell Function, Foreach Function, Functions
|
@node Origin Function, Shell Function, Foreach Function, Functions
|
||||||
|
|||||||
6
misc.c
6
misc.c
@@ -1,5 +1,5 @@
|
|||||||
/* Miscellaneous generic support functions for GNU Make.
|
/* Miscellaneous generic support functions for GNU Make.
|
||||||
Copyright (C) 1988, 89, 90, 91, 92, 93, 94 Free Software Foundation, Inc.
|
Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 1995 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify
|
GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -126,7 +126,7 @@ remove_comments (line)
|
|||||||
{
|
{
|
||||||
char *comment;
|
char *comment;
|
||||||
|
|
||||||
comment = find_char_unquote (line, '#', 0);
|
comment = find_char_unquote (line, "#", 0);
|
||||||
|
|
||||||
if (comment != 0)
|
if (comment != 0)
|
||||||
/* Cut off the line at the #. */
|
/* Cut off the line at the #. */
|
||||||
@@ -260,7 +260,7 @@ strerror (errnum)
|
|||||||
if (errno < sys_nerr)
|
if (errno < sys_nerr)
|
||||||
return sys_errlist[errnum];
|
return sys_errlist[errnum];
|
||||||
|
|
||||||
sprintf ("Unknown error %d", buf, errnum);
|
sprintf (buf, "Unknown error %d", errnum);
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
72
read.c
72
read.c
@@ -1,5 +1,5 @@
|
|||||||
/* Reading and parsing of makefiles for GNU Make.
|
/* Reading and parsing of makefiles for GNU Make.
|
||||||
Copyright (C) 1988, 89, 90, 91, 92, 93, 94 Free Software Foundation, Inc.
|
Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 1995 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify
|
GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -631,7 +631,7 @@ read_makefile (filename, flags)
|
|||||||
;
|
;
|
||||||
else if (lb.buffer[0] == '\t')
|
else if (lb.buffer[0] == '\t')
|
||||||
{
|
{
|
||||||
p = lb.buffer;
|
p = collapsed; /* Ignore comments. */
|
||||||
while (isblank (*p))
|
while (isblank (*p))
|
||||||
++p;
|
++p;
|
||||||
if (*p == '\0')
|
if (*p == '\0')
|
||||||
@@ -723,6 +723,11 @@ read_makefile (filename, flags)
|
|||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#ifdef __MSDOS__
|
||||||
|
/* For MS-DOS, skip a "C:\...". */
|
||||||
|
if (p != 0 && p[1] == '\\' && isalpha (p[-1]))
|
||||||
|
p = 0;
|
||||||
|
#endif
|
||||||
if (p != 0)
|
if (p != 0)
|
||||||
{
|
{
|
||||||
struct nameseq *target;
|
struct nameseq *target;
|
||||||
@@ -1432,9 +1437,9 @@ record_files (filenames, pattern, pattern_percent, deps, commands_started,
|
|||||||
one, or nil if there are none. */
|
one, or nil if there are none. */
|
||||||
|
|
||||||
char *
|
char *
|
||||||
find_char_unquote (string, stopchar, blank)
|
find_char_unquote (string, stopchars, blank)
|
||||||
char *string;
|
char *string;
|
||||||
int stopchar;
|
char *stopchars;
|
||||||
int blank;
|
int blank;
|
||||||
{
|
{
|
||||||
unsigned int string_len = strlen (string);
|
unsigned int string_len = strlen (string);
|
||||||
@@ -1442,19 +1447,12 @@ find_char_unquote (string, stopchar, blank)
|
|||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
if (blank)
|
while (*p != '\0' && index (stopchars, *p) == 0
|
||||||
{
|
&& (!blank || !isblank (*p)))
|
||||||
while (*p != '\0' && *p != stopchar && !isblank (*p))
|
++p;
|
||||||
++p;
|
if (*p == '\0')
|
||||||
if (*p == '\0')
|
break;
|
||||||
break;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
p = index (p, stopchar);
|
|
||||||
if (p == 0)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (p > string && p[-1] == '\\')
|
if (p > string && p[-1] == '\\')
|
||||||
{
|
{
|
||||||
/* Search for more backslashes. */
|
/* Search for more backslashes. */
|
||||||
@@ -1488,7 +1486,7 @@ char *
|
|||||||
find_percent (pattern)
|
find_percent (pattern)
|
||||||
char *pattern;
|
char *pattern;
|
||||||
{
|
{
|
||||||
return find_char_unquote (pattern, '%', 0);
|
return find_char_unquote (pattern, "%", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Search STRING for an unquoted ; that is not after an unquoted #. */
|
/* Search STRING for an unquoted ; that is not after an unquoted #. */
|
||||||
@@ -1497,8 +1495,11 @@ static char *
|
|||||||
find_semicolon (string)
|
find_semicolon (string)
|
||||||
char *string;
|
char *string;
|
||||||
{
|
{
|
||||||
return (find_char_unquote (string, '#', 0) == 0
|
char *match = find_char_unquote (string, ";#", 0);
|
||||||
? find_char_unquote (string, ';', 0) : 0);
|
if (match != 0 && *match == '#')
|
||||||
|
/* We found a comment before a semicolon. No match. */
|
||||||
|
match = 0;
|
||||||
|
return match;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Parse a string into a sequence of filenames represented as a
|
/* Parse a string into a sequence of filenames represented as a
|
||||||
@@ -1526,6 +1527,9 @@ parse_file_seq (stringp, stopchar, size, strip)
|
|||||||
register char *p = *stringp;
|
register char *p = *stringp;
|
||||||
char *q;
|
char *q;
|
||||||
char *name;
|
char *name;
|
||||||
|
char stopchars[2];
|
||||||
|
stopchars[0] = stopchar;
|
||||||
|
stopchars[1] = '\0';
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
@@ -1537,7 +1541,12 @@ parse_file_seq (stringp, stopchar, size, strip)
|
|||||||
break;
|
break;
|
||||||
/* Yes, find end of next name. */
|
/* Yes, find end of next name. */
|
||||||
q = p;
|
q = p;
|
||||||
p = find_char_unquote (q, stopchar, 1);
|
p = find_char_unquote (q, stopchars, 1);
|
||||||
|
#ifdef __MSDOS__
|
||||||
|
/* For MS-DOS, skip a "C:\...". */
|
||||||
|
if (stopchar == ':' && p != 0 && p[1] == '\\' && isalpha (p[-1]))
|
||||||
|
p = 0;
|
||||||
|
#endif
|
||||||
if (p == 0)
|
if (p == 0)
|
||||||
p = q + strlen (q);
|
p = q + strlen (q);
|
||||||
|
|
||||||
@@ -1573,7 +1582,9 @@ parse_file_seq (stringp, stopchar, size, strip)
|
|||||||
an elt further down the chain (i.e., previous in the file list)
|
an elt further down the chain (i.e., previous in the file list)
|
||||||
with an unmatched `(' (e.g., "lib(mem"). */
|
with an unmatched `(' (e.g., "lib(mem"). */
|
||||||
|
|
||||||
for (new1 = new, lastnew1 = 0; new1 != 0; lastnew1 = new1, new1 = new1->next)
|
new1 = new;
|
||||||
|
lastnew1 = 0;
|
||||||
|
while (new1 != 0)
|
||||||
if (new1->name[0] != '(' /* Don't catch "(%)" and suchlike. */
|
if (new1->name[0] != '(' /* Don't catch "(%)" and suchlike. */
|
||||||
&& new1->name[strlen (new1->name) - 1] == ')'
|
&& new1->name[strlen (new1->name) - 1] == ')'
|
||||||
&& index (new1->name, '(') == 0)
|
&& index (new1->name, '(') == 0)
|
||||||
@@ -1654,14 +1665,21 @@ parse_file_seq (stringp, stopchar, size, strip)
|
|||||||
name = concat (libname, new1->name, ")");
|
name = concat (libname, new1->name, ")");
|
||||||
free (new1->name);
|
free (new1->name);
|
||||||
new1->name = name;
|
new1->name = name;
|
||||||
|
lastnew1 = new1;
|
||||||
new1 = new1->next;
|
new1 = new1->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (new1 == 0)
|
|
||||||
/* We might have slurped up the whole list,
|
|
||||||
and continuing the loop would dereference NEW1. */
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* No frobnication happening. Just step down the list. */
|
||||||
|
lastnew1 = new1;
|
||||||
|
new1 = new1->next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lastnew1 = new1;
|
||||||
|
new1 = new1->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
56
remake.c
56
remake.c
@@ -1,5 +1,5 @@
|
|||||||
/* Basic dependency engine for GNU Make.
|
/* Basic dependency engine for GNU Make.
|
||||||
Copyright (C) 1988, 89, 90, 91, 92, 93, 94 Free Software Foundation, Inc.
|
Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 1995 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify
|
GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -491,7 +491,16 @@ update_file_1 (file, depth)
|
|||||||
return dep_status;
|
return dep_status;
|
||||||
}
|
}
|
||||||
|
|
||||||
set_command_state (file, cs_not_started);
|
if (file->command_state == cs_deps_running)
|
||||||
|
/* The commands for some deps were running on the last iteration, but
|
||||||
|
they have finished now. Reset the command_state to not_started to
|
||||||
|
simplify later bookkeeping. It is important that we do this only
|
||||||
|
when the prior state was cs_deps_running, because that prior state
|
||||||
|
was definitely propagated to FILE's also_make's by set_command_state
|
||||||
|
(called above), but in another state an also_make may have
|
||||||
|
independently changed to finished state, and we would confuse that
|
||||||
|
file's bookkeeping (updated, but not_started is bogus state). */
|
||||||
|
set_command_state (file, cs_not_started);
|
||||||
|
|
||||||
/* Now record which dependencies are more
|
/* Now record which dependencies are more
|
||||||
recent than this file, so we can define $?. */
|
recent than this file, so we can define $?. */
|
||||||
@@ -547,7 +556,6 @@ update_file_1 (file, depth)
|
|||||||
if (!must_make)
|
if (!must_make)
|
||||||
{
|
{
|
||||||
DEBUGPR ("No need to remake target `%s'.\n");
|
DEBUGPR ("No need to remake target `%s'.\n");
|
||||||
file->update_status = 0;
|
|
||||||
notice_finished_file (file);
|
notice_finished_file (file);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -565,14 +573,17 @@ update_file_1 (file, depth)
|
|||||||
|
|
||||||
switch (file->update_status)
|
switch (file->update_status)
|
||||||
{
|
{
|
||||||
case 1:
|
case 2:
|
||||||
DEBUGPR ("Failed to remake target file `%s'.\n");
|
DEBUGPR ("Failed to remake target file `%s'.\n");
|
||||||
break;
|
break;
|
||||||
case 0:
|
case 0:
|
||||||
DEBUGPR ("Successfully remade target file `%s'.\n");
|
DEBUGPR ("Successfully remade target file `%s'.\n");
|
||||||
break;
|
break;
|
||||||
|
case 1:
|
||||||
|
DEBUGPR ("Target file `%s' needs remade under -q.\n");
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
assert (file->update_status == 0 || file->update_status == 1);
|
assert (file->update_status >= 0 && file->update_status <= 2);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -596,12 +607,12 @@ notice_finished_file (file)
|
|||||||
|
|
||||||
if (touch_flag
|
if (touch_flag
|
||||||
/* The update status will be:
|
/* The update status will be:
|
||||||
-1 if no commands were run;
|
-1 if this target was not remade;
|
||||||
0 if some commands (+ or ${MAKE}) were run and won;
|
0 if 0 or more commands (+ or ${MAKE}) were run and won;
|
||||||
1 if some commands were run and lost.
|
1 if some commands were run and lost.
|
||||||
The only time we don't want to touch the target is if
|
We touch the target if it has commands which either were not run
|
||||||
it had some recursive commands, and they lost. */
|
or won when they ran (i.e. status is 0). */
|
||||||
&& file->update_status != 1)
|
&& file->update_status == 0)
|
||||||
{
|
{
|
||||||
if (file->cmds != 0 && file->cmds->any_recurse)
|
if (file->cmds != 0 && file->cmds->any_recurse)
|
||||||
{
|
{
|
||||||
@@ -825,15 +836,29 @@ remake_file (file)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* This is a dependency file we cannot remake. Fail. */
|
/* This is a dependency file we cannot remake. Fail. */
|
||||||
static char noway[] = "No rule to make target";
|
static const char msg_noparent[]
|
||||||
|
= "%sNo rule to make target `%s'%s";
|
||||||
|
static const char msg_parent[]
|
||||||
|
= "%sNo rule to make target `%s', needed by `%s'%s";
|
||||||
if (keep_going_flag || file->dontcare)
|
if (keep_going_flag || file->dontcare)
|
||||||
{
|
{
|
||||||
if (!file->dontcare)
|
if (!file->dontcare)
|
||||||
error ("*** %s `%s'.", noway, file->name);
|
{
|
||||||
file->update_status = 1;
|
if (file->parent == 0)
|
||||||
|
error (msg_noparent, "*** ", file->name, ".");
|
||||||
|
else
|
||||||
|
error (msg_parent, "*** ",
|
||||||
|
file->name, file->parent->name, ".");
|
||||||
|
}
|
||||||
|
file->update_status = 2;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
fatal ("%s `%s'", noway, file->name);
|
{
|
||||||
|
if (file->parent == 0)
|
||||||
|
fatal (msg_noparent, "", file->name, "");
|
||||||
|
else
|
||||||
|
fatal (msg_parent, "", file->name, file->parent->name, "");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -845,6 +870,9 @@ remake_file (file)
|
|||||||
execute_file_commands (file);
|
execute_file_commands (file);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
/* This tells notice_finished_file it is ok to touch the file. */
|
||||||
|
file->update_status = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This does the touching under -t. */
|
/* This does the touching under -t. */
|
||||||
|
|||||||
22
signame.c
22
signame.c
@@ -1,5 +1,5 @@
|
|||||||
/* Convert between signal names and numbers.
|
/* Convert between signal names and numbers.
|
||||||
Copyright (C) 1990, 1992, 1993 Free Software Foundation, Inc.
|
Copyright (C) 1990, 1992, 1993, 1995 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
@@ -216,6 +216,9 @@ signame_init ()
|
|||||||
#if defined (SIGDANGER)
|
#if defined (SIGDANGER)
|
||||||
init_sig (SIGDANGER, "DANGER", "Danger signal");
|
init_sig (SIGDANGER, "DANGER", "Danger signal");
|
||||||
#endif
|
#endif
|
||||||
|
#if defined (SIGINFO)
|
||||||
|
init_sig (SIGINFO, "INFO", "Information request");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return the abbreviation for signal NUMBER. */
|
/* Return the abbreviation for signal NUMBER. */
|
||||||
@@ -273,3 +276,20 @@ psignal (signal, message)
|
|||||||
fprintf (stderr, "%s: %s\n", message, sys_siglist[signal]);
|
fprintf (stderr, "%s: %s\n", message, sys_siglist[signal]);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAVE_STRSIGNAL
|
||||||
|
/* Return the string associated with the signal number. */
|
||||||
|
|
||||||
|
char *
|
||||||
|
strsignal (signal)
|
||||||
|
int signal;
|
||||||
|
{
|
||||||
|
static char buf[] = "Signal 12345678901234567890";
|
||||||
|
|
||||||
|
if (signal > 0 || signal < NSIG)
|
||||||
|
return (char *) sys_siglist[signal];
|
||||||
|
|
||||||
|
sprintf (buf, "Signal %d", signal);
|
||||||
|
return buf;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|||||||
12
signame.h
12
signame.h
@@ -1,5 +1,5 @@
|
|||||||
/* Convert between signal names and numbers.
|
/* Convert between signal names and numbers.
|
||||||
Copyright (C) 1990, 1992, 1993 Free Software Foundation, Inc.
|
Copyright (C) 1990, 1992, 1993, 1995 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
@@ -29,7 +29,7 @@ char *sig_abbrev (int number);
|
|||||||
signal by that name. */
|
signal by that name. */
|
||||||
int sig_number (const char *abbrev);
|
int sig_number (const char *abbrev);
|
||||||
|
|
||||||
/* Avoid conflicts with a system header file that might define these two. */
|
/* Avoid conflicts with a system header file that might define these three. */
|
||||||
|
|
||||||
#ifndef HAVE_PSIGNAL
|
#ifndef HAVE_PSIGNAL
|
||||||
/* Print to standard error the name of SIGNAL, preceded by MESSAGE and
|
/* Print to standard error the name of SIGNAL, preceded by MESSAGE and
|
||||||
@@ -37,6 +37,11 @@ int sig_number (const char *abbrev);
|
|||||||
void psignal (int signal, const char *message);
|
void psignal (int signal, const char *message);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAVE_STRSIGNAL
|
||||||
|
/* Return the name of SIGNAL. */
|
||||||
|
char *strsignal (int signal);
|
||||||
|
#endif
|
||||||
|
|
||||||
#if !defined (HAVE_SYS_SIGLIST)
|
#if !defined (HAVE_SYS_SIGLIST)
|
||||||
/* Names for signals from 0 to NSIG-1. */
|
/* Names for signals from 0 to NSIG-1. */
|
||||||
extern const char *sys_siglist[];
|
extern const char *sys_siglist[];
|
||||||
@@ -50,6 +55,9 @@ int sig_number ();
|
|||||||
#if !defined (HAVE_SYS_SIGLIST) && !defined (HAVE_PSIGNAL)
|
#if !defined (HAVE_SYS_SIGLIST) && !defined (HAVE_PSIGNAL)
|
||||||
void psignal ();
|
void psignal ();
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef HAVE_STRSIGNAL
|
||||||
|
char *strsignal ();
|
||||||
|
#endif
|
||||||
#if !defined (HAVE_SYS_SIGLIST)
|
#if !defined (HAVE_SYS_SIGLIST)
|
||||||
extern char *sys_siglist[];
|
extern char *sys_siglist[];
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user