mirror of
https://github.com/mirror/make.git
synced 2026-08-23 18:33:28 +08:00
Compare commits
183 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5d1d6aa6de | ||
|
|
e2403327e9 | ||
|
|
65a7296e2c | ||
|
|
99454e6a1e | ||
|
|
411a01acce | ||
|
|
33654a7af4 | ||
|
|
fa1ec9e1f3 | ||
|
|
fefeb0f7bd | ||
|
|
6cca2382f0 | ||
|
|
44309109fe | ||
|
|
d153373039 | ||
|
|
ccac245bf5 | ||
|
|
f106953139 | ||
|
|
54727192c0 | ||
|
|
20258f42d4 | ||
|
|
4f79de612b | ||
|
|
ea9504a609 | ||
|
|
511cb55530 | ||
|
|
65d7b12aeb | ||
|
|
2968844002 | ||
|
|
a709205e81 | ||
|
|
9391fb8e4c | ||
|
|
4950159344 | ||
|
|
91da8b09df | ||
|
|
e3e88767f1 | ||
|
|
76ae1bc064 | ||
|
|
e24c9e161a | ||
|
|
f0a7421adc | ||
|
|
8204f56f2f | ||
|
|
e97f8e6f57 | ||
|
|
20b68e968a | ||
|
|
9d31f1e1f1 | ||
|
|
2fcce1d3b0 | ||
|
|
1290679bc3 | ||
|
|
dc70a3bc0b | ||
|
|
aa9ec7c2c7 | ||
|
|
04c488df1c | ||
|
|
8de0e41662 | ||
|
|
e94d73997a | ||
|
|
7585dedefc | ||
|
|
57ba55d08c | ||
|
|
886748c02d | ||
|
|
d378e4204d | ||
|
|
e7e9b799c4 | ||
|
|
a3a7581c1a | ||
|
|
3e12cad198 | ||
|
|
e2ffc653aa | ||
|
|
4e58a6ca4c | ||
|
|
41dcca8426 | ||
|
|
161a026602 | ||
|
|
e244062995 | ||
|
|
24fec5cb53 | ||
|
|
b903988475 | ||
|
|
6ea87be73b | ||
|
|
f6490d62cf | ||
|
|
480ad62713 | ||
|
|
acd666ce50 | ||
|
|
be3fb0ae6d | ||
|
|
dd0c939e78 | ||
|
|
fff468765c | ||
|
|
63dff1e0bc | ||
|
|
e746a9c951 | ||
|
|
74d4418f1c | ||
|
|
062e5f6aae | ||
|
|
c495345f7c | ||
|
|
f0239bb0af | ||
|
|
2d29a55137 | ||
|
|
806c7aa46c | ||
|
|
47daa6787e | ||
|
|
eb4d510a74 | ||
|
|
c86587fb9b | ||
|
|
fd688f6e9c | ||
|
|
f96ef9a409 | ||
|
|
09616e5837 | ||
|
|
cf9aa5b70b | ||
|
|
9033f1a656 | ||
|
|
ccfe89b829 | ||
|
|
35f1bbbe23 | ||
|
|
9f88582943 | ||
|
|
b38d9d2ae9 | ||
|
|
132e0eda6c | ||
|
|
c297b2fbd5 | ||
|
|
ec08feae97 | ||
|
|
8c7887ac02 | ||
|
|
08cf536bfb | ||
|
|
b48b02c7f4 | ||
|
|
e7a0e14a43 | ||
|
|
6413a1d08e | ||
|
|
8f34c48e3f | ||
|
|
818bb8940c | ||
|
|
cc4d91d751 | ||
|
|
36d804bd51 | ||
|
|
f95d071efc | ||
|
|
c0deecf9ee | ||
|
|
dd63648825 | ||
|
|
229ba33d0e | ||
|
|
ccbe33db90 | ||
|
|
32efbf8dc3 | ||
|
|
6e3b0629f1 | ||
|
|
51659ed000 | ||
|
|
7827f1bde8 | ||
|
|
922730c406 | ||
|
|
5e91041347 | ||
|
|
9f7ba4a505 | ||
|
|
2745ed943b | ||
|
|
0cb72b4a51 | ||
|
|
73fcfdbe24 | ||
|
|
0ada207e2d | ||
|
|
7bb7ba7849 | ||
|
|
2a294c52d1 | ||
|
|
71515366cd | ||
|
|
d78f2db327 | ||
|
|
30c9fcfec3 | ||
|
|
e2b79aacf7 | ||
|
|
e981c049f4 | ||
|
|
9012013552 | ||
|
|
cda4f25fd4 | ||
|
|
b32b9197ab | ||
|
|
b66145d8bc | ||
|
|
d2fe84cab3 | ||
|
|
c2ea8e2486 | ||
|
|
db2384b9ab | ||
|
|
9b0b3a6e70 | ||
|
|
a71d56b4cc | ||
|
|
10011ce289 | ||
|
|
84a9fd68b7 | ||
|
|
262ca66cb7 | ||
|
|
a1eb3e67cd | ||
|
|
78a4848b83 | ||
|
|
b16829dc46 | ||
|
|
c71e4ac269 | ||
|
|
82e6316607 | ||
|
|
a8de4b93e3 | ||
|
|
6e7fa14c65 | ||
|
|
5206d3f2bc | ||
|
|
e2da48ca55 | ||
|
|
bc26243d90 | ||
|
|
b4db97478e | ||
|
|
4e361d0f01 | ||
|
|
d5d49d2e5a | ||
|
|
191dc2b434 | ||
|
|
6fa74367b7 | ||
|
|
4cee1500a4 | ||
|
|
2602fb8e71 | ||
|
|
bfce132399 | ||
|
|
30cf28ef63 | ||
|
|
a7f3831457 | ||
|
|
bcd11d854b | ||
|
|
bb01a1a810 | ||
|
|
c622dd9bdf | ||
|
|
7092951361 | ||
|
|
88d39b2a22 | ||
|
|
3863dbeb03 | ||
|
|
cca242e6e3 | ||
|
|
7082394702 | ||
|
|
1f0bf7b4db | ||
|
|
b18ce15130 | ||
|
|
c41efad63b | ||
|
|
683c716de3 | ||
|
|
29253a9683 | ||
|
|
9cc98648fd | ||
|
|
d3c192e4a6 | ||
|
|
08905cdcbc | ||
|
|
4b72e38789 | ||
|
|
ce17fda12f | ||
|
|
2df6034eb6 | ||
|
|
dd0fe8f1ee | ||
|
|
37fbc32ba4 | ||
|
|
64bdaa521f | ||
|
|
37ce7efdca | ||
|
|
4b92c539d4 | ||
|
|
a22f67aaf7 | ||
|
|
9fc574683d | ||
|
|
c8e016d07a | ||
|
|
c396f06a21 | ||
|
|
fc47a2c83c | ||
|
|
561b384313 | ||
|
|
88942403a6 | ||
|
|
8733fbd646 | ||
|
|
cf2db2cf3c | ||
|
|
f0cea20864 | ||
|
|
fcb18b988b | ||
|
|
8b24ec18b0 |
51
AUTHORS
Normal file
51
AUTHORS
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
-----------------------------------
|
||||||
|
|
||||||
|
GNU make development up to version 3.75 by:
|
||||||
|
Roland McGrath <roland@gnu.org>
|
||||||
|
|
||||||
|
|
||||||
|
Development starting with GNU make 3.76 by:
|
||||||
|
Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
|
||||||
|
GNU Make User's Manual written by:
|
||||||
|
Richard M. Stallman <rms@gnu.org>
|
||||||
|
|
||||||
|
User's Manual edited by:
|
||||||
|
Roland McGrath <roland@gnu.org>
|
||||||
|
Bob Chassell <bob@gnu.org>
|
||||||
|
Melissa Weisshaus <melissa@gnu.org>
|
||||||
|
Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
-----------------------------------
|
||||||
|
GNU make porting efforts:
|
||||||
|
|
||||||
|
Port to VMS by:
|
||||||
|
Klaus Kaempf <kkaempf@progis.de>
|
||||||
|
Archive support/Bug fixes by John W. Eaton <jwe@bevo.che.wisc.edu>
|
||||||
|
|
||||||
|
|
||||||
|
Port to Amiga by:
|
||||||
|
Aaron Digulla <digulla@fh-konstanz.de>
|
||||||
|
|
||||||
|
|
||||||
|
Port to MS-DOS (DJGPP) and MS-Windows 95/NT by:
|
||||||
|
DJ Delorie <dj@delorie.com>
|
||||||
|
Rob Tulloh <rob_tulloh@tivoli.com>
|
||||||
|
Eli Zaretskii <eliz@is.elta.co.il>
|
||||||
|
|
||||||
|
-----------------------------------
|
||||||
|
Other contributors:
|
||||||
|
|
||||||
|
Janet Carson <janet_carson@tivoli.com>
|
||||||
|
Paul Eggert <eggert@twinsun.com>
|
||||||
|
Klaus Heinz <kamar@ease.rhein-main.de>
|
||||||
|
Michael Joosten
|
||||||
|
Jim Kelton <jim_kelton@tivoli.com>
|
||||||
|
David Lubbren <uhay@rz.uni-karlsruhe.de>
|
||||||
|
Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
|
||||||
|
Carl Staelin (Princeton University)
|
||||||
|
Ian Stewartson (Data Logic Limited)
|
||||||
|
|
||||||
|
With suggestions/comments/bug reports from a cast of ... well ...
|
||||||
|
hundreds, anyway :)
|
||||||
5
COPYING
5
COPYING
@@ -2,7 +2,8 @@
|
|||||||
Version 2, June 1991
|
Version 2, June 1991
|
||||||
|
|
||||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||||
675 Mass Ave, Cambridge, MA 02139, USA
|
59 Temple Place - Suite 330, Boston, MA
|
||||||
|
02111-1307, USA.
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
of this license document, but changing it is not allowed.
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
@@ -305,7 +306,7 @@ the "copyright" line and a pointer to where the full notice is found.
|
|||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
|||||||
320
GNUmakefile
320
GNUmakefile
@@ -1,294 +1,54 @@
|
|||||||
# GNU Make-specific makefile for GNU Make.
|
# This is a maintainer's-only makefile
|
||||||
|
|
||||||
# Copyright (C) 1990, 91, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
|
|
||||||
# This file is part of GNU Make.
|
|
||||||
#
|
#
|
||||||
# GNU Make is free software; you can redistribute it and/or modify
|
# It bootstraps a GNU make maintainer's directory
|
||||||
# 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
|
.SUFFIXES:
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
NORECURSE = true
|
||||||
|
|
||||||
|
# If the user asked for a specific target, invoke the Makefile instead.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
.DEFAULT:
|
||||||
# along with GNU Make; see the file COPYING. If not, write to
|
@[ -f Makefile.in -a -f configure -a -f aclocal.m4 -a -f config.h.in ] \
|
||||||
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
|| $(MAKE) __cfg NORECURSE=
|
||||||
|
@[ -f Makefile ] \
|
||||||
|
|| ./configure
|
||||||
|
$(MAKE) -f Makefile $@
|
||||||
|
|
||||||
.PHONY: default
|
.PHONY: __cfg __cfg_basic
|
||||||
default:
|
|
||||||
|
|
||||||
# Set `ARCH' to a string for the type of machine.
|
# This is variable since the glob subdirectory doesn't use it.
|
||||||
ifndef ARCH
|
#
|
||||||
ifdef machine
|
ACCONFIG = acconfig.h
|
||||||
ARCH = $(machine)
|
|
||||||
endif # machine
|
|
||||||
endif # not ARCH
|
|
||||||
|
|
||||||
override srcdir := .
|
__cfg: __cfg_basic config.h.in TAGS
|
||||||
override CC := $(CC)
|
cd glob && $(MAKE) -f ../GNUmakefile __cfg_basic ACCONFIG=
|
||||||
|
ifdef NORECURSE
|
||||||
ifeq ($(ARCH),hp300)
|
@echo ""; echo "Now you should run one of:"; echo ""; \
|
||||||
#customs=yes
|
echo " make all"; \
|
||||||
endif
|
echo " make dist"; \
|
||||||
ifdef customs
|
echo " make distdir"; \
|
||||||
override REMOTE := cstms
|
echo " make distcheck"; echo ""; \
|
||||||
else
|
echo "Or similar to proceed.";\
|
||||||
override REMOTE := stub
|
echo ""
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Get most of the information from the Unix-compatible makefile.
|
__cfg_basic: aclocal.m4 stamp-h.in configure Makefile.in
|
||||||
include compatMakefile
|
|
||||||
|
|
||||||
MAKE = $(MAKE_COMMAND) $(MAKEOVERRIDES)
|
aclocal.m4: configure.in $(wildcard acinclude.m4)
|
||||||
|
aclocal
|
||||||
|
|
||||||
# Remove autoconf magic.
|
config.h.in: stamp-h.in
|
||||||
prefix = /usr/local
|
stamp-h.in: configure.in aclocal.m4 $(ACCONFIG)
|
||||||
exec_prefix = $(prefix)
|
autoheader
|
||||||
extras := $(filter-out getloadavg.o @%@,$(extras)) getloadavg.o
|
echo timestamp > $@
|
||||||
LOADLIBES := $(filter-out @%@,$(LOADLIBES))
|
|
||||||
ALLOCA := $(filter-out @%@,$(ALLOCA))
|
|
||||||
CPPFLAGS := $(filter-out @%@,$(defines) $(CPPFLAGS)) -DHAVE_CONFIG_H
|
|
||||||
|
|
||||||
ifdef AC_MACRODIR
|
|
||||||
configure config.h.in: $(patsubst %,$(AC_MACRODIR)/%.m4,acspecific acgeneral)
|
|
||||||
config.h.in: $(AC_MACRODIR)/acconfig.h
|
|
||||||
endif
|
|
||||||
configure: configure.in aclocal.m4
|
configure: configure.in aclocal.m4
|
||||||
autoconf $(ACFLAGS)
|
autoconf
|
||||||
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
|
Makefile.in: configure.in config.h.in Makefile.am aclocal.m4
|
||||||
defines := $(defines) -Ipmake/customs -Ipmake/lib/include
|
automake --add-missing
|
||||||
LOADLIBES := $(addprefix pmake/customs/,customslib.o rpc.o xlog.o) \
|
|
||||||
pmake/lib/sprite/libsprite.a
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef ARCH
|
TAGS:
|
||||||
|
find . -name '*.[ch]' -print | etags -
|
||||||
ifndef no_libc
|
|
||||||
libc_dir = /home/gd2/gnu/libc/$(ARCH)
|
|
||||||
ifneq ($(wildcard $(libc_dir)),)
|
|
||||||
ifneq ($(wildcard $(libc_dir)/works-for-make),)
|
|
||||||
#CPPFLAGS := -I$(libc_dir)/include
|
|
||||||
#LDFLAGS := -nostdlib $(libc_dir)/lib/start.o
|
|
||||||
#LOADLIBES := $(LOADLIBES) \
|
|
||||||
# $(libc_dir)/lib/mcheck-init.o \
|
|
||||||
# $(libc_dir)/lib/libc.a \
|
|
||||||
# -lgcc \
|
|
||||||
# $(libc_dir)/lib/libc.a
|
|
||||||
CC := $(CC) -b glibc
|
|
||||||
|
|
||||||
# getopt is in libc.
|
|
||||||
GETOPT =
|
|
||||||
#GETOPT_SRC = Don't clear this or dist will break.
|
|
||||||
|
|
||||||
# glob is in libc too.
|
|
||||||
GLOB =
|
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
endif # works-for-make
|
|
||||||
endif # $(libc_dir)
|
|
||||||
endif # !no_libc
|
|
||||||
|
|
||||||
# We know the type of machine, so put the binaries in subdirectories.
|
|
||||||
$(ARCH)/%.o: %.c
|
|
||||||
$(COMPILE.c) -Iglob $< $(OUTPUT_OPTION)
|
|
||||||
$(ARCH)/glob/libglob.a: FORCE
|
|
||||||
$(MAKE) -C $(@D) $(@F)
|
|
||||||
FORCE:
|
|
||||||
objs := $(addprefix $(ARCH)/,$(objs))
|
|
||||||
prog := $(ARCH)/make
|
|
||||||
|
|
||||||
archpfx = $(ARCH)/
|
|
||||||
|
|
||||||
$(archpfx)load.o: load.c
|
|
||||||
$(COMPILE.c) $(LOAD_AVG) $< -o $@
|
|
||||||
$(archpfx)load.dep: load.c
|
|
||||||
$(mkdep) $(LOAD_AVG) $< | sed 's,$*\.o,& $@,' > $@
|
|
||||||
|
|
||||||
CPPFLAGS := -I$(ARCH) -Iglob -DHAVE_CONFIG_H $(filter-out @%@,$(CPPFLAGS))
|
|
||||||
|
|
||||||
ifneq "$(wildcard $(ARCH)/makefile)" ""
|
|
||||||
include $(ARCH)/makefile
|
|
||||||
endif
|
|
||||||
objs := $(objs) $(addprefix $(ARCH)/,$(ALLOCA) $(extras))
|
|
||||||
|
|
||||||
else # Not ARCH
|
|
||||||
prog := make
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifneq "$(findstring gcc,$(CC))" ""
|
|
||||||
CFLAGS = -g -Wall -Wtraditional -Wid-clash-31 -Wpointer-arith \
|
|
||||||
-Wbad-function-cast -Wconversion
|
|
||||||
else
|
|
||||||
CFLAGS = -g
|
|
||||||
endif
|
|
||||||
LDFLAGS = -g
|
|
||||||
|
|
||||||
# Define the command to make dependencies.
|
|
||||||
ifneq "$(findstring gcc,$(CC))" ""
|
|
||||||
# Don't include system directories.
|
|
||||||
mkdep-nolib = $(CC) -MM $(CPPFLAGS)
|
|
||||||
else
|
|
||||||
mkdep-nolib = $(mkdep)
|
|
||||||
endif
|
|
||||||
mkdep = $(CC) -M $(CPPFLAGS)
|
|
||||||
|
|
||||||
depfiles = $(patsubst %.o,%.dep,$(filter %.o,$(objs)))
|
|
||||||
|
|
||||||
|
|
||||||
.PHONY: default
|
|
||||||
default: $(prog)
|
|
||||||
|
|
||||||
$(prog): $(objs) $(globdep) #$(addprefix $(ARCH)/,gmalloc.o mcheck.o)
|
|
||||||
$(CC) $(LDFLAGS) $^ $(globlib) $(LOADLIBES) -o $@.new
|
|
||||||
mv -f $@.new $@
|
|
||||||
|
|
||||||
libc-srcdir = ../libc
|
|
||||||
globfiles = $(addprefix glob/,COPYING.LIB configure.in configure Makefile.in \
|
|
||||||
Makefile.ami SCOPTIONS SMakefile \
|
|
||||||
configure.bat glob.c fnmatch.c glob.h fnmatch.h)
|
|
||||||
$(globfiles): stamp-glob ;
|
|
||||||
stamp-glob: $(libc-srcdir)/posix/glob.tar
|
|
||||||
-rm -f stamp-glob glob/*
|
|
||||||
tar xvf $< glob
|
|
||||||
cvs commit -m'Updated from libc' glob
|
|
||||||
touch $@
|
|
||||||
$(libc-srcdir)/posix/glob.tar: force
|
|
||||||
$(MAKE) -C $(@D) $(@F) no_deps=t
|
|
||||||
.PHONY: force
|
|
||||||
force:
|
|
||||||
|
|
||||||
# Make the Unix-compatible Makefile to be distributed by appending
|
|
||||||
# the automatically-generated dependencies to compatMakefile.
|
|
||||||
ifeq ($(mkdep),$(mkdep-nolib))
|
|
||||||
nolib-deps = $(depfiles)
|
|
||||||
else
|
|
||||||
%.dep: %.c
|
|
||||||
$(mkdep-nolib) $< | sed -e 's,$*\.o,$(@:.dep=.o) $@,' > $(@:.dep=.dtm)
|
|
||||||
mv -f $(@:.dep=.dtm) $@
|
|
||||||
nolib-deps = $(patsubst $(archpfx)%,%,$(depfiles))
|
|
||||||
endif
|
|
||||||
# The distributed Makefile.in should contain deps for remote-stub only.
|
|
||||||
Makefile.in: compatMakefile $(nolib-deps:remote-%.dep=remote-stub.dep)
|
|
||||||
(sed 's/^MAKE[ ]*=.*$$/@SET_MAKE@/' $<; \
|
|
||||||
echo '# Automatically generated dependencies.'; \
|
|
||||||
sed -e 's/ [^ ]*\.dep//' -e 's=$(archpfx)==' $(filter-out $<,$^) \
|
|
||||||
) > $@
|
|
||||||
cvs commit -mRegenerated $@
|
|
||||||
|
|
||||||
.SUFFIXES: .dep
|
|
||||||
# Maintain the automatically-generated dependencies.
|
|
||||||
ifndef no_deps
|
|
||||||
-include $(depfiles)
|
|
||||||
endif
|
|
||||||
$(archpfx)%.dep: %.c
|
|
||||||
$(mkdep) $< | sed 's,$*\.o,$(@:.dep=.o) $@,' > $@
|
|
||||||
|
|
||||||
ETAGS = etags -T # for v19 etags
|
|
||||||
|
|
||||||
# Run the tests.
|
|
||||||
.PHONY: tests
|
|
||||||
testdir := $(shell ls -d1 make-test-?.? | sort -n +0.10 -0.11 +0.12 | tail -1l)
|
|
||||||
tests:# $(testdir)/run_make_tests.pl $(prog)
|
|
||||||
# cd $(<D); MAKELEVEL=0 perl $(<F)
|
|
||||||
|
|
||||||
build.sh.in: build.template compatMakefile
|
|
||||||
sed -e 's@%objs%@$(filter-out remote-% $(GLOB) $(ALLOCA) $(extras),\
|
|
||||||
$(patsubst $(archpfx)%,%,$(objs)))\
|
|
||||||
$(patsubst %.c,%.o,$(filter %.c,$(globfiles)))@' \
|
|
||||||
$< > $@.new
|
|
||||||
chmod a+x $@.new
|
|
||||||
mv -f $@.new $@
|
|
||||||
cvs commit -mRegenerated $@
|
|
||||||
|
|
||||||
# Make the distribution tar files.
|
|
||||||
|
|
||||||
.PHONY: dist
|
|
||||||
# Figure out the version number from the source of `version.c'.
|
|
||||||
version := \
|
|
||||||
$(strip $(shell sed -e '/=/!d' -e 's/^.*"\(.*\)";$$/\1/' < version.c))
|
|
||||||
tarfiles := make # make-doc
|
|
||||||
tarfiles := $(addsuffix -$(version).tar,$(tarfiles))
|
|
||||||
tarfiles := $(tarfiles:%=%.gz) # no more compress $(tarfiles:%=%.Z)
|
|
||||||
# Depend on default and doc so we don't ship anything that won't compile.
|
|
||||||
dist: cvs-mark default info dvi tests tarfiles
|
|
||||||
.PHONY: tarfiles
|
|
||||||
tarfiles: $(tarfiles)
|
|
||||||
|
|
||||||
vmsfiles = config.h-vms makefile.com makefile.vms readme.vms \
|
|
||||||
vmsdir.h vmsfunctions.c vmsify.c
|
|
||||||
amigafiles = README.Amiga config.ami Makefile.ami SCOPTIONS SMakefile \
|
|
||||||
amiga.c amiga.h make.lnk
|
|
||||||
distfiles=README INSTALL COPYING ChangeLog NEWS \
|
|
||||||
configure Makefile.in configure.in build.sh.in mkinstalldirs \
|
|
||||||
configh.dos configure.bat \
|
|
||||||
$(amigafiles) $(vmsfiles) \
|
|
||||||
aclocal.m4 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
|
|
||||||
dist-flavor = alpha
|
|
||||||
endif
|
|
||||||
.PHONY: cvs-mark
|
|
||||||
cvs-mark: $(distfiles)
|
|
||||||
cvs tag -F make-$(subst .,-,$(version))
|
|
||||||
|
|
||||||
dist: local-inst
|
|
||||||
.PHONY: local-inst
|
|
||||||
local-inst: $(prog)
|
|
||||||
install -c -g kmem -o $(USER) -m 2755 $< /usr/local/gnubin/make
|
|
||||||
|
|
||||||
# Put the alpha distribution files in the anonymous FTP directory.
|
|
||||||
alpha-files = $(tarfiles) GNUmakefile compatMakefile $(testdir).tar.Z
|
|
||||||
dist: alpha
|
|
||||||
.PHONY: alpha
|
|
||||||
alpha-dir := ~ftp/gnu
|
|
||||||
alpha-files := $(addprefix $(alpha-dir)/,$(alpha-files))
|
|
||||||
alpha: $(alpha-dir) $(alpha-files)
|
|
||||||
$(alpha-dir)/%: %
|
|
||||||
@rm -f $@
|
|
||||||
cp $< $@
|
|
||||||
|
|
||||||
# Implicit rule to make README and README-doc.
|
|
||||||
%: %.template version.c
|
|
||||||
rm -f $@
|
|
||||||
sed 's/VERSION/$(version)/' < $< > $@
|
|
||||||
# Make sure I don't edit it by accident.
|
|
||||||
chmod a-w $@
|
|
||||||
cvs commit -m'Regenerated for $(version)' $@
|
|
||||||
|
|
||||||
define make-tar
|
|
||||||
@rm -fr make-$(version)
|
|
||||||
ln -s . make-$(version)
|
|
||||||
tar cvhof $@ $(addprefix make-$(version)/,$^)
|
|
||||||
rm -f make-$(version)
|
|
||||||
endef
|
|
||||||
|
|
||||||
%.Z: %; compress -c $< > $@
|
|
||||||
%.gz: %; gzip -9 -c -v $< > $@
|
|
||||||
|
|
||||||
make-$(version).tar: $(distfiles)
|
|
||||||
$(make-tar)
|
|
||||||
|
|
||||||
ifneq (,)
|
|
||||||
tests := $(filter-out %~,$(wildcard tests/*))
|
|
||||||
make-tests-$(version).tar.Z: $(tests)
|
|
||||||
@rm -fr make-tests-$(version)
|
|
||||||
ln -s tests make-tests-$(version)
|
|
||||||
tar cvhf $(@:.Z=) $(patsubst tests/%,make-tests-$(version)/%,$^)
|
|
||||||
rm -f make-tests-$(version)
|
|
||||||
compress -f $(@:.Z=)
|
|
||||||
endif
|
|
||||||
|
|
||||||
$(archpfx)loadtest: $(archpfx)load.o
|
|
||||||
|
|||||||
14
INSTALL
14
INSTALL
@@ -1,8 +1,6 @@
|
|||||||
Basic Installation
|
Basic Installation
|
||||||
==================
|
==================
|
||||||
|
|
||||||
These are generic installation instructions.
|
|
||||||
|
|
||||||
The `configure' shell script attempts to guess correct values for
|
The `configure' shell script attempts to guess correct values for
|
||||||
various system-dependent variables used during compilation. It uses
|
various system-dependent variables used during compilation. It uses
|
||||||
those values to create a `Makefile' in each directory of the package.
|
those values to create a `Makefile' in each directory of the package.
|
||||||
@@ -36,7 +34,13 @@ The simplest way to compile this package is:
|
|||||||
|
|
||||||
2. Type `make' to compile the package.
|
2. Type `make' to compile the package.
|
||||||
|
|
||||||
3. Optionally, type `make check' to run any self-tests that come with
|
If you're building GNU make on a system which does not already have
|
||||||
|
a `make', you can use the build.sh shell script to compile. Run
|
||||||
|
`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.
|
||||||
|
|
||||||
|
3. Optionally, type `./make check' to run any self-tests that come with
|
||||||
the package.
|
the package.
|
||||||
|
|
||||||
4. Type `make install' to install the programs and any data files and
|
4. Type `make install' to install the programs and any data files and
|
||||||
@@ -167,7 +171,9 @@ operates.
|
|||||||
`--quiet'
|
`--quiet'
|
||||||
`--silent'
|
`--silent'
|
||||||
`-q'
|
`-q'
|
||||||
Do not print messages saying which checks are being made.
|
Do not print messages saying which checks are being made. To
|
||||||
|
suppress all normal output, redirect it to `/dev/null' (any error
|
||||||
|
messages will still be shown).
|
||||||
|
|
||||||
`--srcdir=DIR'
|
`--srcdir=DIR'
|
||||||
Look for the package's source code in directory DIR. Usually
|
Look for the package's source code in directory DIR. Usually
|
||||||
|
|||||||
501
Makefile.DOS.template
Normal file
501
Makefile.DOS.template
Normal file
@@ -0,0 +1,501 @@
|
|||||||
|
# -*-Makefile-*- template for DJGPP
|
||||||
|
# Makefile.in generated automatically by automake 1.2 from Makefile.am
|
||||||
|
|
||||||
|
# Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||||
|
# This Makefile.DOS is free software; the Free Software Foundation
|
||||||
|
# gives unlimited permission to copy, distribute and modify it.
|
||||||
|
|
||||||
|
# -*-Makefile-*-, or close enough
|
||||||
|
|
||||||
|
|
||||||
|
SHELL = /bin/sh
|
||||||
|
|
||||||
|
srcdir = .
|
||||||
|
VPATH = $(srcdir)
|
||||||
|
# $DJDIR is defined automatically by DJGPP to point
|
||||||
|
# to the root of the DJGPP installation tree.
|
||||||
|
prefix = ${DJDIR}
|
||||||
|
exec_prefix = ${prefix}
|
||||||
|
|
||||||
|
bindir = ${exec_prefix}/bin
|
||||||
|
datadir = ${prefix}/share
|
||||||
|
libdir = ${prefix}/lib
|
||||||
|
infodir = ${prefix}/info
|
||||||
|
# DJGPP doesn't have separate man tree, use info instead.
|
||||||
|
mandir = ${prefix}/info
|
||||||
|
includedir = ${prefix}/include
|
||||||
|
oldincludedir = c:/djgpp/include
|
||||||
|
|
||||||
|
pkgdatadir = $(datadir)/make
|
||||||
|
pkglibdir = $(libdir)/make
|
||||||
|
pkgincludedir = $(includedir)/make
|
||||||
|
|
||||||
|
INSTALL = ${bindir}/ginstall -c
|
||||||
|
INSTALL_PROGRAM = ${bindir}/ginstall -c
|
||||||
|
INSTALL_DATA = ${bindir}/ginstall -c -m 644
|
||||||
|
INSTALL_SCRIPT = ${bindir}/ginstall -c
|
||||||
|
transform = s,x,x,
|
||||||
|
|
||||||
|
# This will fail even if they don't have a Unix-like shell (stock DOS
|
||||||
|
# shell doesn't know about `false'). The only difference is that they
|
||||||
|
# get "Error -1" instead of "Error 1".
|
||||||
|
EXIT_FAIL = false
|
||||||
|
|
||||||
|
NORMAL_INSTALL = :
|
||||||
|
PRE_INSTALL = :
|
||||||
|
POST_INSTALL = :
|
||||||
|
NORMAL_UNINSTALL = :
|
||||||
|
PRE_UNINSTALL = :
|
||||||
|
POST_UNINSTALL = :
|
||||||
|
AR = ar
|
||||||
|
CC = gcc
|
||||||
|
CPP = gcc -E
|
||||||
|
LIBOBJS =
|
||||||
|
MAKEINFO = ${bindir}/makeinfo
|
||||||
|
PACKAGE = make
|
||||||
|
RANLIB = ranlib
|
||||||
|
REMOTE = stub
|
||||||
|
VERSION = %VERSION%
|
||||||
|
|
||||||
|
AUTOMAKE_OPTIONS = 1.2
|
||||||
|
|
||||||
|
bin_PROGRAMS = %PROGRAMS%
|
||||||
|
|
||||||
|
make_SOURCES = %SOURCES%
|
||||||
|
# This should include the glob/ prefix
|
||||||
|
libglob_a_SOURCES = %GLOB_SOURCES%
|
||||||
|
make_LDADD = glob/libglob.a
|
||||||
|
|
||||||
|
info_TEXINFOS = make.texinfo
|
||||||
|
man_MANS = make.1
|
||||||
|
|
||||||
|
INCLUDES = -I$(srcdir)/glob -DLIBDIR=\"c:/djgpp/lib\" -DINCLUDEDIR=\"c:/djgpp/include\"
|
||||||
|
|
||||||
|
BUILT_SOURCES = README build.sh.in
|
||||||
|
|
||||||
|
EXTRA_DIST = $(BUILT_SOURCES) $(man_MANS) README.customs remote-cstms.c make-stds.texi texinfo.tex SCOPTIONS SMakefile Makefile.ami README.Amiga config.ami amiga.c amiga.h NMakefile README.DOS configh.dos configure.bat makefile.com README.W32 build_w32.bat config.h.W32 subproc.bat make.lnk config.h-vms makefile.vms readme.vms vmsdir.h vmsfunctions.c vmsify.c
|
||||||
|
|
||||||
|
SUBDIRS = glob
|
||||||
|
mkinstalldirs = ${bindir}/gmkdir -p
|
||||||
|
CONFIG_HEADER = config.h
|
||||||
|
CONFIG_CLEAN_FILES = build.sh
|
||||||
|
PROGRAMS = $(bin_PROGRAMS)
|
||||||
|
|
||||||
|
|
||||||
|
DEFS = -I. -I$(srcdir) -I.
|
||||||
|
CPPFLAGS = -DHAVE_CONFIG_H
|
||||||
|
LDFLAGS =
|
||||||
|
LIBS =
|
||||||
|
make_OBJECTS = %OBJECTS%
|
||||||
|
make_DEPENDENCIES = glob/libglob.a
|
||||||
|
make_LDFLAGS =
|
||||||
|
libglob_a_LIBADD =
|
||||||
|
libglob_a_OBJECTS = %GLOB_OBJECTS%
|
||||||
|
noinst_LIBRARIES = glob/libglob.a
|
||||||
|
CFLAGS = -O2 -g
|
||||||
|
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
|
||||||
|
LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@
|
||||||
|
TEXI2DVI = texi2dvi
|
||||||
|
TEXINFO_TEX = $(srcdir)/texinfo.tex
|
||||||
|
INFO_DEPS = make.info
|
||||||
|
DVIS = make.dvi
|
||||||
|
TEXINFOS = make.texinfo
|
||||||
|
man1dir = $(mandir)/man1
|
||||||
|
MANS = $(man_MANS)
|
||||||
|
|
||||||
|
NROFF = nroff
|
||||||
|
DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am Makefile.in NEWS acconfig.h aclocal.m4 alloca.c build.sh.in config.h.in configure configure.in getloadavg.c install-sh missing mkinstalldirs stamp-h.in texinfo.tex
|
||||||
|
|
||||||
|
|
||||||
|
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||||
|
|
||||||
|
TAR = gtar
|
||||||
|
GZIP = --best
|
||||||
|
SOURCES = $(make_SOURCES)
|
||||||
|
OBJECTS = $(make_OBJECTS)
|
||||||
|
HEADERS = $(wildcard $(srcdir)/*.h)
|
||||||
|
|
||||||
|
default: all
|
||||||
|
|
||||||
|
.SUFFIXES:
|
||||||
|
.SUFFIXES: .c .dvi .info .o .ps .texi .texinfo
|
||||||
|
|
||||||
|
distclean-hdr:
|
||||||
|
-rm -f config.h
|
||||||
|
|
||||||
|
maintainer-clean-hdr:
|
||||||
|
|
||||||
|
mostlyclean-binPROGRAMS:
|
||||||
|
|
||||||
|
clean-binPROGRAMS:
|
||||||
|
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
|
||||||
|
|
||||||
|
distclean-binPROGRAMS:
|
||||||
|
|
||||||
|
maintainer-clean-binPROGRAMS:
|
||||||
|
|
||||||
|
install-binPROGRAMS: $(bin_PROGRAMS)
|
||||||
|
@$(NORMAL_INSTALL)
|
||||||
|
$(mkinstalldirs) $(DESTDIR)$(bindir)
|
||||||
|
@list='$(bin_PROGRAMS)'; for p in $$list; do if test -f $$p; then echo " $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p | sed '$(transform)'`"; $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p | sed '$(transform)'`; else :; fi; done
|
||||||
|
|
||||||
|
uninstall-binPROGRAMS:
|
||||||
|
$(NORMAL_UNINSTALL)
|
||||||
|
list='$(bin_PROGRAMS)'; for p in $$list; do rm -f $(bindir)/`echo $$p|sed '$(transform)'`; done
|
||||||
|
|
||||||
|
.c.o:
|
||||||
|
$(COMPILE) -c $<
|
||||||
|
|
||||||
|
clean-noinstLIBRARIES:
|
||||||
|
-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
|
||||||
|
|
||||||
|
mostlyclean-compile:
|
||||||
|
-rm -f *.o *.exe make.new core
|
||||||
|
|
||||||
|
clean-compile:
|
||||||
|
|
||||||
|
distclean-compile:
|
||||||
|
-rm -f *.tab.c
|
||||||
|
|
||||||
|
maintainer-clean-compile:
|
||||||
|
|
||||||
|
make: $(make_OBJECTS) $(make_DEPENDENCIES)
|
||||||
|
@command.com /c if exist make del make
|
||||||
|
@command.com /c if exist make.exe del make.exe
|
||||||
|
$(LINK) $(make_LDFLAGS) $(make_OBJECTS) $(make_LDADD) $(LIBS)
|
||||||
|
|
||||||
|
make.info: make.texinfo
|
||||||
|
make.dvi: make.texinfo
|
||||||
|
|
||||||
|
|
||||||
|
DVIPS = dvips
|
||||||
|
|
||||||
|
.texi.info:
|
||||||
|
$(MAKEINFO) $(srcdir)/$< -o ./$@
|
||||||
|
|
||||||
|
.texi.dvi:
|
||||||
|
TEXINPUTS="$(srcdir);$$TEXINPUTS" MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
|
||||||
|
|
||||||
|
.texi:
|
||||||
|
$(MAKEINFO) $(srcdir)/$< -o ./$@
|
||||||
|
|
||||||
|
.texinfo.info:
|
||||||
|
$(MAKEINFO) $(srcdir)/$< -o ./$@
|
||||||
|
|
||||||
|
.texinfo:
|
||||||
|
$(MAKEINFO) $(srcdir)/$< -o ./$@
|
||||||
|
|
||||||
|
.texinfo.dvi:
|
||||||
|
TEXINPUTS="$(srcdir);$$TEXINPUTS" MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
|
||||||
|
|
||||||
|
.dvi.ps:
|
||||||
|
$(DVIPS) $< -o $@
|
||||||
|
|
||||||
|
install-info-am: $(INFO_DEPS)
|
||||||
|
@$(NORMAL_INSTALL)
|
||||||
|
$(mkinstalldirs) $(DESTDIR)$(infodir)
|
||||||
|
@for file in $(INFO_DEPS) make.i; do d=$(srcdir); for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9] $$file[0-9] $$file[0-9][0-9]`; do if test -f $$d/$$ifile; then echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; else : ; fi; done; done
|
||||||
|
@$(POST_INSTALL)
|
||||||
|
@if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then for file in $(INFO_DEPS); do echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file"; install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :; done; else : ; fi
|
||||||
|
|
||||||
|
uninstall-info:
|
||||||
|
$(PRE_UNINSTALL)
|
||||||
|
@if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then ii=yes; else ii=; fi; for file in $(INFO_DEPS); do test -z $ii || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; done
|
||||||
|
$(NORMAL_UNINSTALL)
|
||||||
|
for file in $(INFO_DEPS) make.i; do (cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9] $$file[0-9] $$file[0-9][0-9]); done
|
||||||
|
|
||||||
|
dist-info: $(INFO_DEPS)
|
||||||
|
for base in $(INFO_DEPS); do d=$(srcdir); for file in `cd $$d && eval echo $$base*`; do test -f $(distdir)/$$file || ln $$d/$$file $(distdir)/$$file 2> /dev/null || cp -p $$d/$$file $(distdir)/$$file; done; done
|
||||||
|
|
||||||
|
mostlyclean-aminfo:
|
||||||
|
rm -f make.aux make.cp make.cps make.dvi make.fn make.fns make.ky make.kys make.ps make.log make.pg make.toc make.tp make.tps make.vr make.vrs make.op make.tr make.cv make.cn
|
||||||
|
|
||||||
|
clean-aminfo:
|
||||||
|
|
||||||
|
distclean-aminfo:
|
||||||
|
|
||||||
|
maintainer-clean-aminfo:
|
||||||
|
for i in $(INFO_DEPS) make.i; do rm -f `eval echo $$i*`; done
|
||||||
|
|
||||||
|
install-man1:
|
||||||
|
$(mkinstalldirs) $(DESTDIR)$(man1dir)
|
||||||
|
@list='$(man1_MANS)'; \
|
||||||
|
l2='$(man_MANS)'; for i in $$l2; do \
|
||||||
|
case "$$i" in \
|
||||||
|
*.1*) list="$$list $$i" ;; \
|
||||||
|
esac; \
|
||||||
|
done; \
|
||||||
|
for i in $$list; do \
|
||||||
|
if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
|
||||||
|
else file=$$i; fi; \
|
||||||
|
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
|
||||||
|
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
|
||||||
|
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
|
||||||
|
echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \
|
||||||
|
$(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \
|
||||||
|
done
|
||||||
|
|
||||||
|
uninstall-man1:
|
||||||
|
@list='$(man1_MANS)'; \
|
||||||
|
l2='$(man_MANS)'; for i in $$l2; do \
|
||||||
|
case "$$i" in \
|
||||||
|
*.1*) list="$$list $$i" ;; \
|
||||||
|
esac; \
|
||||||
|
done; \
|
||||||
|
for i in $$list; do \
|
||||||
|
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
|
||||||
|
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
|
||||||
|
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
|
||||||
|
echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \
|
||||||
|
rm -f $(DESTDIR)$(man1dir)/$$inst; \
|
||||||
|
done
|
||||||
|
install-man: $(MANS)
|
||||||
|
@$(NORMAL_INSTALL)
|
||||||
|
$(MAKE) install-man1
|
||||||
|
uninstall-man:
|
||||||
|
@$(NORMAL_UNINSTALL)
|
||||||
|
$(MAKE) uninstall-man1
|
||||||
|
|
||||||
|
# Assume that the only thing to do in glob is to build libglob.a,
|
||||||
|
# but do a sanity check: if $SUBDIRS will ever have more than
|
||||||
|
# a single directory, yell bloody murder.
|
||||||
|
all-recursive:
|
||||||
|
ifeq ($(words $(SUBDIRS)), 1)
|
||||||
|
@command.com /c if not exist glob\\nul md glob
|
||||||
|
@echo Making all in $(SUBDIRS)
|
||||||
|
$(MAKE) -C $(SUBDIRS) -f ../Makefile INCLUDES='-I$(srcdir) -I$(srcdir)/glob' DEFS='-I.. -I$(srcdir)' VPATH=$(srcdir)/glob libglob.a
|
||||||
|
else
|
||||||
|
@echo FATAL: There is more than one directory in "($(SUBDIRS))"
|
||||||
|
@$(EXIT_FAIL)
|
||||||
|
endif
|
||||||
|
|
||||||
|
$(SUBDIRS):
|
||||||
|
command.com /c md $@
|
||||||
|
|
||||||
|
libglob.a: $(libglob_a_OBJECTS)
|
||||||
|
command.com /c if exist libglob.a del libglob.a
|
||||||
|
$(AR) cru libglob.a $(libglob_a_OBJECTS) $(libglob_a_LIBADD)
|
||||||
|
$(RANLIB) libglob.a
|
||||||
|
|
||||||
|
mostlyclean-recursive clean-recursive distclean-recursive maintainer-clean-recursive:
|
||||||
|
ifeq ($(words $(SUBDIRS)), 1)
|
||||||
|
@echo Making $(shell echo $@ | sed s/-recursive//) in $(SUBDIRS)
|
||||||
|
$(MAKE) -C $(SUBDIRS) -f ../Makefile $(shell echo $@ | sed s/-recursive//)-am
|
||||||
|
else
|
||||||
|
@echo FATAL: There is more than one directory in "($(SUBDIRS))"
|
||||||
|
@$(EXIT_FAIL)
|
||||||
|
endif
|
||||||
|
|
||||||
|
tags-in-glob: $(libglob_a_SOURCES)
|
||||||
|
etags $(addprefix $(srcdir)/,$^) -o ./glob/TAGS
|
||||||
|
|
||||||
|
tags-recursive:
|
||||||
|
ifeq ($(words $(SUBDIRS)), 1)
|
||||||
|
$(MAKE) tags-in-glob
|
||||||
|
else
|
||||||
|
@echo FATAL: There is more than one directory in "($(SUBDIRS))"
|
||||||
|
@$(EXIT_FAIL)
|
||||||
|
endif
|
||||||
|
|
||||||
|
tags: TAGS
|
||||||
|
|
||||||
|
ID: $(HEADERS) $(SOURCES)
|
||||||
|
mkid $(srcdir)/$(SOURCES) $(srcdir)/$(libglob_a_SOURCES) ./config.h $(HEADERS)
|
||||||
|
|
||||||
|
TAGS: tags-recursive $(HEADERS) $(srcdir)/$(SOURCES) config.h $(TAGS_DEPENDENCIES)
|
||||||
|
etags -i ./glob/TAGS $(ETAGS_ARGS) $(srcdir)/$(SOURCES) ./config.h $(HEADERS)
|
||||||
|
|
||||||
|
mostlyclean-tags:
|
||||||
|
|
||||||
|
clean-tags:
|
||||||
|
|
||||||
|
distclean-tags:
|
||||||
|
-rm -f TAGS ID
|
||||||
|
|
||||||
|
maintainer-clean-tags:
|
||||||
|
|
||||||
|
distdir = $(PACKAGE)-$(VERSION)
|
||||||
|
top_distdir = $(distdir)
|
||||||
|
|
||||||
|
# This target untars the dist file and tries a VPATH configuration. Then
|
||||||
|
# it guarantees that the distribution is self-contained by making another
|
||||||
|
# tarfile.
|
||||||
|
distcheck: dist
|
||||||
|
rm -rf $(distdir)
|
||||||
|
GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz
|
||||||
|
mkdir $(distdir)/=build
|
||||||
|
mkdir $(distdir)/=inst
|
||||||
|
dc_install_base=`cd $(distdir)/=inst && pwd`; cd $(distdir)/=build && ../configure --srcdir=.. --prefix=$$dc_install_base && $(MAKE) && $(MAKE) dvi && $(MAKE) check && $(MAKE) install && $(MAKE) installcheck && $(MAKE) dist
|
||||||
|
rm -rf $(distdir)
|
||||||
|
@echo "========================"; echo "$(distdir).tar.gz is ready for distribution"; echo "========================"
|
||||||
|
dist: distdir
|
||||||
|
-chmod -R a+r $(distdir)
|
||||||
|
GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir)
|
||||||
|
rm -rf $(distdir)
|
||||||
|
dist-all: distdir
|
||||||
|
-chmod -R a+r $(distdir)
|
||||||
|
GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir)
|
||||||
|
rm -rf $(distdir)
|
||||||
|
distdir: $(DISTFILES)
|
||||||
|
rm -rf $(distdir)
|
||||||
|
mkdir $(distdir)
|
||||||
|
-chmod 777 $(distdir)
|
||||||
|
@for file in $(DISTFILES); do d=$(srcdir); test -f $(distdir)/$$file || ln $$d/$$file $(distdir)/$$file 2> /dev/null || cp -p $$d/$$file $(distdir)/$$file; done; for subdir in $(SUBDIRS); do test -d $(distdir)/$$subdir || mkdir $(distdir)/$$subdir || exit 1; chmod 777 $(distdir)/$$subdir; (cd $$subdir && $(MAKE) top_distdir=../$(top_distdir)/$$subdir distdir=../$(distdir)/$$subdir distdir) || exit 1; done
|
||||||
|
$(MAKE) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info
|
||||||
|
$(MAKE) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-hook
|
||||||
|
|
||||||
|
info: $(INFO_DEPS) info-recursive
|
||||||
|
dvi: $(DVIS) dvi-recursive
|
||||||
|
check: all-am
|
||||||
|
$(MAKE) check-recursive check-local
|
||||||
|
installcheck: installcheck-recursive
|
||||||
|
all-recursive-am: config.h
|
||||||
|
$(MAKE) all-recursive
|
||||||
|
|
||||||
|
all-am: Makefile $(INFO_DEPS) $(PROGRAMS) config.h
|
||||||
|
|
||||||
|
install-exec-am: install-binPROGRAMS
|
||||||
|
|
||||||
|
install-data-am: install-info-am
|
||||||
|
|
||||||
|
uninstall-am: uninstall-binPROGRAMS uninstall-info
|
||||||
|
|
||||||
|
install-exec: install-exec-recursive install-exec-am
|
||||||
|
@$(NORMAL_INSTALL)
|
||||||
|
|
||||||
|
install-data: install-data-recursive install-data-am
|
||||||
|
@$(NORMAL_INSTALL)
|
||||||
|
|
||||||
|
install: install-recursive install-exec-am install-data-am
|
||||||
|
@:
|
||||||
|
|
||||||
|
uninstall: uninstall-recursive uninstall-am
|
||||||
|
|
||||||
|
all: all-recursive-am all-am
|
||||||
|
|
||||||
|
install-strip:
|
||||||
|
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
|
||||||
|
installdirs: installdirs-recursive
|
||||||
|
$(mkinstalldirs) $(bindir) $(infodir)
|
||||||
|
|
||||||
|
|
||||||
|
mostlyclean-generic:
|
||||||
|
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
|
||||||
|
|
||||||
|
clean-generic:
|
||||||
|
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||||
|
|
||||||
|
distclean-generic:
|
||||||
|
-rm -f Makefile $(DISTCLEANFILES)
|
||||||
|
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
|
||||||
|
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||||
|
|
||||||
|
maintainer-clean-generic:
|
||||||
|
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
|
||||||
|
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
|
||||||
|
mostlyclean-am: mostlyclean-hdr mostlyclean-binPROGRAMS mostlyclean-compile mostlyclean-aminfo mostlyclean-tags mostlyclean-generic
|
||||||
|
|
||||||
|
clean-am: clean-hdr clean-binPROGRAMS clean-compile clean-aminfo clean-tags clean-generic mostlyclean-am
|
||||||
|
|
||||||
|
distclean-am: distclean-hdr distclean-binPROGRAMS distclean-compile distclean-aminfo distclean-tags distclean-generic clean-am
|
||||||
|
|
||||||
|
maintainer-clean-am: maintainer-clean-hdr maintainer-clean-binPROGRAMS maintainer-clean-compile maintainer-clean-aminfo maintainer-clean-tags maintainer-clean-generic distclean-am
|
||||||
|
|
||||||
|
mostlyclean: mostlyclean-recursive mostlyclean-am
|
||||||
|
|
||||||
|
clean: clean-noinstLIBRARIES clean-recursive clean-am
|
||||||
|
|
||||||
|
distclean: distclean-recursive distclean-am
|
||||||
|
rm -f config.status
|
||||||
|
|
||||||
|
maintainer-clean: maintainer-clean-recursive maintainer-clean-am
|
||||||
|
@echo "This command is intended for maintainers to use;"
|
||||||
|
@echo "it deletes files that may require special tools to rebuild."
|
||||||
|
rm -f config.status
|
||||||
|
|
||||||
|
.PHONY: default mostlyclean-hdr distclean-hdr clean-hdr \
|
||||||
|
maintainer-clean-hdr mostlyclean-binPROGRAMS distclean-binPROGRAMS \
|
||||||
|
clean-binPROGRAMS maintainer-clean-binPROGRAMS uninstall-binPROGRAMS \
|
||||||
|
install-binPROGRAMS mostlyclean-compile distclean-compile clean-compile \
|
||||||
|
maintainer-clean-compile install-info-am uninstall-info \
|
||||||
|
mostlyclean-aminfo distclean-aminfo clean-aminfo \
|
||||||
|
maintainer-clean-aminfo install-data-recursive uninstall-data-recursive \
|
||||||
|
install-exec-recursive uninstall-exec-recursive installdirs-recursive \
|
||||||
|
uninstalldirs-recursive all-recursive check-recursive \
|
||||||
|
installcheck-recursive info-recursive dvi-recursive \
|
||||||
|
mostlyclean-recursive distclean-recursive clean-recursive \
|
||||||
|
maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
|
||||||
|
distclean-tags clean-tags maintainer-clean-tags distdir \
|
||||||
|
mostlyclean-depend distclean-depend clean-depend \
|
||||||
|
maintainer-clean-depend info dvi check-local installcheck \
|
||||||
|
all-recursive-am all-am install-exec-am install-data-am uninstall-am \
|
||||||
|
install-exec install-data install uninstall all installdirs \
|
||||||
|
mostlyclean-generic distclean-generic clean-generic \
|
||||||
|
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
|
||||||
|
|
||||||
|
|
||||||
|
# --------------- Local DIST Section
|
||||||
|
|
||||||
|
# Install the w32 subdirectory
|
||||||
|
#
|
||||||
|
dist-hook:
|
||||||
|
(cd $(srcdir); \
|
||||||
|
w32=`find w32 -follow \( -name CVS -prune \) -o -type f -print`; \
|
||||||
|
tar chf - $$w32) \
|
||||||
|
| (cd $(distdir); tar xfBp -)
|
||||||
|
|
||||||
|
# --------------- Local CHECK Section
|
||||||
|
|
||||||
|
check-local: check-loadavg check-regression
|
||||||
|
.PHONY: check-loadavg check-regression
|
||||||
|
|
||||||
|
# > check-loadavg
|
||||||
|
#
|
||||||
|
loadavg: loadavg.c config.h
|
||||||
|
@rm -f loadavg
|
||||||
|
$(LINK) -DTEST $(make_LDFLAGS) loadavg.c $(LIBS)
|
||||||
|
# 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-regression
|
||||||
|
#
|
||||||
|
# Look for the make test suite, and run it if found. Look in MAKE_TEST if
|
||||||
|
# specified, or else in the srcdir or the distdir, their parents, and _their_
|
||||||
|
# parents.
|
||||||
|
#
|
||||||
|
check-regression:
|
||||||
|
here=`pwd`; testdir=""; \
|
||||||
|
case "$(MAKE_TEST)" in "") \
|
||||||
|
for d1 in $$here $(srcdir); do \
|
||||||
|
for d2 in ../.. .. .; do \
|
||||||
|
all=`echo $$d1/$$d2/make-test-[0-9]*/run_make_tests`; \
|
||||||
|
case "$$all" in \
|
||||||
|
"$$d1/$$d2/make-test-[0-9]*/run_make_tests") : ;; \
|
||||||
|
*) try=`for x in $$all; do echo $$x; done | sort | tail -1`;\
|
||||||
|
testdir=`dirname $$try` ;; esac; \
|
||||||
|
done; done ;; \
|
||||||
|
*) testdir="$(MAKE_TEST)" ;; \
|
||||||
|
esac; \
|
||||||
|
case "$$testdir" in \
|
||||||
|
"") echo "Couldn't find make-test-* test suite."; exit 0;; \
|
||||||
|
esac; \
|
||||||
|
echo "cd $$testdir && ./run_make_tests -make_path $$here/make"; \
|
||||||
|
cd $$testdir && ./run_make_tests -make_path $$here/make
|
||||||
|
|
||||||
|
# --------------- Maintainer's Section
|
||||||
|
|
||||||
|
# Note this requires GNU make. Not to worry, since it will only be included
|
||||||
|
# in the Makefile if we're in the maintainer's environment.
|
||||||
|
#include $(srcdir)/maintMakefile
|
||||||
|
|
||||||
|
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||||
|
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||||
|
.NOEXPORT:
|
||||||
134
Makefile.am
Normal file
134
Makefile.am
Normal file
@@ -0,0 +1,134 @@
|
|||||||
|
# -*-Makefile-*-, or close enough
|
||||||
|
|
||||||
|
AUTOMAKE_OPTIONS = 1.3
|
||||||
|
|
||||||
|
bin_PROGRAMS = make
|
||||||
|
|
||||||
|
make_SOURCES = main.c commands.c job.c dir.c file.c misc.c read.c remake.c \
|
||||||
|
rule.c implicit.c default.c variable.c expand.c function.c \
|
||||||
|
vpath.c version.c ar.c arscan.c remote-$(REMOTE).c \
|
||||||
|
commands.h dep.h filedef.h job.h make.h rule.h variable.h \
|
||||||
|
signame.c signame.h \
|
||||||
|
getopt.c getopt1.c getopt.h
|
||||||
|
make_LDADD = @LIBOBJS@ @ALLOCA@ glob/libglob.a
|
||||||
|
|
||||||
|
info_TEXINFOS = make.texinfo
|
||||||
|
man_MANS = make.1
|
||||||
|
|
||||||
|
INCLUDES = -I$(srcdir)/glob -DLIBDIR=\"$(libdir)\" -DINCLUDEDIR=\"$(includedir)\"
|
||||||
|
|
||||||
|
BUILT_SOURCES = README build.sh.in
|
||||||
|
|
||||||
|
EXTRA_DIST = $(BUILT_SOURCES) $(man_MANS) README.customs remote-cstms.c\
|
||||||
|
make-stds.texi texinfo.tex SCOPTIONS SMakefile\
|
||||||
|
README.Amiga Makefile.ami config.ami make.lnk amiga.c amiga.h\
|
||||||
|
README.DOS Makefile.DOS configure.bat dosbuild.bat configh.dos\
|
||||||
|
README.W32 NMakefile config.h.W32 build_w32.bat subproc.bat\
|
||||||
|
readme.vms makefile.vms makefile.com config.h-vms vmsdir.h\
|
||||||
|
vmsfunctions.c vmsify.c
|
||||||
|
|
||||||
|
SUBDIRS = glob
|
||||||
|
|
||||||
|
MOSTLYCLEANFILES = loadavg.c
|
||||||
|
CLEANFILES = loadavg
|
||||||
|
|
||||||
|
|
||||||
|
# --------------- Local INSTALL Section
|
||||||
|
|
||||||
|
# If necessary, change the gid of the app and turn on the setgid flag.
|
||||||
|
#
|
||||||
|
|
||||||
|
# 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.
|
||||||
|
#
|
||||||
|
inst_setgid = @NEED_SETGID@
|
||||||
|
|
||||||
|
# Install make setgid to this group so it can get the load average.
|
||||||
|
#
|
||||||
|
inst_group = @KMEM_GROUP@
|
||||||
|
|
||||||
|
install-exec-local:
|
||||||
|
@if $(inst_setgid); then \
|
||||||
|
app=$(DESTDIR)$(bindir)/`echo $(bin_PROGRAMS)|sed '$(transform)'`; \
|
||||||
|
if chgrp $(inst_group) $$app && chmod g+s $$app; then \
|
||||||
|
echo "chgrp $(inst_group) $$app && chmod g+s $$app"; \
|
||||||
|
else \
|
||||||
|
echo "$$app needs to be owned by group $(inst_group) and setgid;"; \
|
||||||
|
echo "otherwise the \`-l' option will probably not work."; \
|
||||||
|
echo "You may need special privileges to complete the installation"; \
|
||||||
|
echo "of $$app."; \
|
||||||
|
fi; \
|
||||||
|
else true; fi
|
||||||
|
|
||||||
|
# --------------- Local DIST Section
|
||||||
|
|
||||||
|
# Install the w32 subdirectory
|
||||||
|
#
|
||||||
|
dist-hook:
|
||||||
|
(cd $(srcdir); \
|
||||||
|
w32=`find w32 -follow \( -name CVS -prune \) -o \( -name \*.orig -o -name \*.rej -o -name \*~ -prune \) -o -type f -print`; \
|
||||||
|
tar chf - $$w32) \
|
||||||
|
| (cd $(distdir); tar xfBp -)
|
||||||
|
|
||||||
|
|
||||||
|
# --------------- Local CHECK Section
|
||||||
|
|
||||||
|
check-local: check-loadavg check-regression
|
||||||
|
.PHONY: check-loadavg check-regression
|
||||||
|
|
||||||
|
# > check-loadavg
|
||||||
|
#
|
||||||
|
loadavg: loadavg.c config.h
|
||||||
|
@rm -f loadavg
|
||||||
|
$(LINK) -I. -I$(srcdir) -DHAVE_CONFIG_H -DTEST $(make_LDFLAGS) loadavg.c $(LIBS)
|
||||||
|
|
||||||
|
# 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-regression
|
||||||
|
#
|
||||||
|
# Look for the make test suite, and run it if found. Look in MAKE_TEST if
|
||||||
|
# specified, or else in the srcdir or the distdir, their parents, and _their_
|
||||||
|
# parents.
|
||||||
|
#
|
||||||
|
MAKETESTFLAGS =
|
||||||
|
|
||||||
|
check-regression: all
|
||||||
|
@here=`pwd`; testdir=""; \
|
||||||
|
case "$(MAKE_TEST)" in "") \
|
||||||
|
for d1 in $$here $(srcdir); do \
|
||||||
|
for d2 in ../.. .. .; do \
|
||||||
|
all=`echo $$d1/$$d2/make-test-[0-9]*/run_make_tests`; \
|
||||||
|
case "$$all" in \
|
||||||
|
"$$d1/$$d2/make-test-[0-9]*/run_make_tests") : ;; \
|
||||||
|
*) try=`for x in $$all; do echo $$x; done | sort | tail -1`;\
|
||||||
|
testdir=`dirname $$try` ;; esac; \
|
||||||
|
done; done ;; \
|
||||||
|
*) testdir="$(MAKE_TEST)" ;; \
|
||||||
|
esac; \
|
||||||
|
case "$$testdir" in \
|
||||||
|
"") echo "Couldn't find make-test-* regression test suite."; exit 0;; \
|
||||||
|
esac; \
|
||||||
|
echo "cd $$testdir && ./run_make_tests -make $$here/make $(MAKETESTFLAGS)"; \
|
||||||
|
cd $$testdir && ./run_make_tests -make $$here/make $(MAKETESTFLAGS)
|
||||||
|
|
||||||
|
|
||||||
|
# --------------- Maintainer's Section
|
||||||
|
|
||||||
|
if MAINT_MAKEFILE
|
||||||
|
# Note this requires GNU make. Not to worry, since it will only be included
|
||||||
|
# in the Makefile if we're in the maintainer's environment.
|
||||||
|
include $(srcdir)/maintMakefile
|
||||||
|
endif
|
||||||
@@ -22,11 +22,6 @@
|
|||||||
# Makefile for GNU Make
|
# Makefile for GNU Make
|
||||||
#
|
#
|
||||||
|
|
||||||
# Ultrix 2.2 make doesn't expand the value of VPATH.
|
|
||||||
VPATH = /make-3.74/
|
|
||||||
# This must repeat the value, because configure will remove `VPATH = .'.
|
|
||||||
srcdir = /make-3.74/
|
|
||||||
|
|
||||||
CC = sc
|
CC = sc
|
||||||
RM = delete
|
RM = delete
|
||||||
|
|
||||||
@@ -250,7 +245,7 @@ clean: glob-clean
|
|||||||
-$(RM) make loadavg "#?.o" core make.dvi
|
-$(RM) make loadavg "#?.o" core make.dvi
|
||||||
|
|
||||||
distclean: clean glob-realclean
|
distclean: clean glob-realclean
|
||||||
-$(RM) Makefile config.h config.status build.sh stamp-config
|
-$(RM) Makefile config.h config.status build.sh
|
||||||
-$(RM) config.log config.cache
|
-$(RM) config.log config.cache
|
||||||
-$(RM) TAGS tags
|
-$(RM) TAGS tags
|
||||||
-$(RM) make.?? make.??s make.log make.toc make.*aux
|
-$(RM) make.?? make.??s make.log make.toc make.*aux
|
||||||
|
|||||||
303
Makefile.in
303
Makefile.in
@@ -1,303 +0,0 @@
|
|||||||
# 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,95,96 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 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 \
|
|
||||||
getopt.o getopt1.o glob/libglob.a \
|
|
||||||
$(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 \
|
|
||||||
$(srcdir)/getopt.c $(srcdir)/getopt1.c $(srcdir)/getopt.h \
|
|
||||||
$(srcdir)/commands.h $(srcdir)/dep.h $(srcdir)/filedef.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 \
|
|
||||||
if [ -r ./make.info ]; then dir=.; else dir=$(srcdir); fi; \
|
|
||||||
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 filedef.h variable.h job.h \
|
|
||||||
commands.h
|
|
||||||
job.o: job.c make.h job.h filedef.h commands.h variable.h
|
|
||||||
dir.o: dir.c make.h
|
|
||||||
file.o: file.c make.h dep.h filedef.h job.h commands.h variable.h
|
|
||||||
misc.o: misc.c make.h dep.h
|
|
||||||
main.o: main.c make.h dep.h filedef.h variable.h job.h commands.h \
|
|
||||||
getopt.h
|
|
||||||
read.o: read.c make.h dep.h filedef.h job.h commands.h variable.h \
|
|
||||||
glob/glob.h
|
|
||||||
remake.o: remake.c make.h filedef.h job.h commands.h dep.h
|
|
||||||
rule.o: rule.c make.h dep.h filedef.h job.h commands.h variable.h \
|
|
||||||
rule.h
|
|
||||||
implicit.o: implicit.c make.h rule.h dep.h filedef.h
|
|
||||||
default.o: default.c make.h rule.h dep.h filedef.h job.h commands.h \
|
|
||||||
variable.h
|
|
||||||
variable.o: variable.c make.h dep.h filedef.h job.h commands.h \
|
|
||||||
variable.h
|
|
||||||
expand.o: expand.c make.h filedef.h job.h commands.h variable.h
|
|
||||||
function.o: function.c make.h filedef.h variable.h dep.h job.h \
|
|
||||||
commands.h
|
|
||||||
vpath.o: vpath.c make.h filedef.h variable.h
|
|
||||||
version.o: version.c
|
|
||||||
ar.o: ar.c make.h filedef.h dep.h
|
|
||||||
arscan.o: arscan.c make.h
|
|
||||||
signame.o: signame.c signame.h
|
|
||||||
remote-stub.o: remote-stub.c make.h filedef.h job.h commands.h
|
|
||||||
getopt.o: getopt.c
|
|
||||||
getopt1.o: getopt1.c getopt.h
|
|
||||||
getloadavg.o: getloadavg.c
|
|
||||||
108
NEWS
108
NEWS
@@ -1,9 +1,106 @@
|
|||||||
GNU make NEWS -- history of user-visible changes. 9 May 1996
|
GNU make NEWS -*-indented-text-*-
|
||||||
|
History of user-visible changes.
|
||||||
|
19 May 1998
|
||||||
|
|
||||||
Copyright (C) 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
|
Copyright (C) 1992,1993,1994,1995,1996,1997,1998 Free Software Foundation, Inc.
|
||||||
See the end for copying conditions.
|
See the end for copying conditions.
|
||||||
|
|
||||||
Please send GNU make bug reports to bug-gnu-utils@prep.ai.mit.edu.
|
Please send GNU make bug reports to bug-make@gnu.org.
|
||||||
|
|
||||||
|
Version 3.77
|
||||||
|
|
||||||
|
* Implement BSD make's "?=" variable assignment operator. The variable
|
||||||
|
is assigned the specified value only if that variable is not already
|
||||||
|
defined.
|
||||||
|
|
||||||
|
* Make defines a new variable, "CURDIR", to contain the current working
|
||||||
|
directory (after the -C option, if any, has been processed).
|
||||||
|
Modifying this variable has no effect on the operation of make.
|
||||||
|
|
||||||
|
* Make defines a new default RCS rule, for new-style master file
|
||||||
|
storage: ``% :: RCS/%'' (note no ``,v'' suffix).
|
||||||
|
|
||||||
|
Make defines new default rules for DOS-style C++ file naming
|
||||||
|
conventions, with ``.cpp'' suffixes. All the same rules as for
|
||||||
|
``.cc'' and ``.C'' suffixes are provided, along with LINK.cpp and
|
||||||
|
COMPILE.cpp macros (which default to the same value as LINK.cc and
|
||||||
|
COMPILE.cc). Note CPPFLAGS is still C preprocessor flags! You should
|
||||||
|
use CXXFLAGS to change C++ compiler flags.
|
||||||
|
|
||||||
|
* A new feature, "target-specific variable values", has been added.
|
||||||
|
This is a large change so please see the appropriate sections of the
|
||||||
|
manual for full details. Briefly, syntax like this:
|
||||||
|
|
||||||
|
TARGET: VARIABLE = VALUE
|
||||||
|
|
||||||
|
defines VARIABLE as VALUE within the context of TARGET. This is
|
||||||
|
similar to SunOS make's "TARGET := VARIABLE = VALUE" feature. Note
|
||||||
|
that the assignment may be of any type, not just recursive, and that
|
||||||
|
the override keyword is available.
|
||||||
|
|
||||||
|
COMPATIBILITY: This new syntax means that if you have any rules where
|
||||||
|
the first or second dependency has an equal sign (=) in its name,
|
||||||
|
you'll have to escape them with a backslash: "foo : bar\=baz".
|
||||||
|
Further, if you have any dependencies which already contain "\=",
|
||||||
|
you'll have to escape both of them: "foo : bar\\\=baz".
|
||||||
|
|
||||||
|
* A new appendix listing the most common error and warning messages
|
||||||
|
generated by GNU make, with some explanation, has been added to the
|
||||||
|
GNU make User's Manual.
|
||||||
|
|
||||||
|
* Updates to the GNU make Customs library support (see README.customs).
|
||||||
|
|
||||||
|
* Updates to the Windows 95/NT port from Rob Tulloh (see README.W32),
|
||||||
|
and to the DOS port from Eli Zaretski (see README.DOS).
|
||||||
|
|
||||||
|
Version 3.76.1
|
||||||
|
|
||||||
|
* Small (but serious) bug fix. Quick rollout to get into the GNU source CD.
|
||||||
|
|
||||||
|
Version 3.76
|
||||||
|
|
||||||
|
* GNU make now uses automake to control Makefile.in generation. This
|
||||||
|
should make it more consistent with the GNU standards.
|
||||||
|
|
||||||
|
* VPATH functionality has been changed to incorporate the VPATH+ patch,
|
||||||
|
previously maintained by Paul Smith <psmith@baynetworks.com>. See the
|
||||||
|
manual.
|
||||||
|
|
||||||
|
* Make defines a new variable, `MAKECMDGOALS', to contain the goals that
|
||||||
|
were specified on the command line, if any. Modifying this variable
|
||||||
|
has no effect on the operation of make.
|
||||||
|
|
||||||
|
* A new function, `$(wordlist S,E,TEXT)', is available: it returns a
|
||||||
|
list of words from number S to number E (inclusive) of TEXT.
|
||||||
|
|
||||||
|
* Instead of an error, detection of future modification times gives a
|
||||||
|
warning and continues. The warning is repeated just before GNU make
|
||||||
|
exits, so it is less likely to be lost.
|
||||||
|
|
||||||
|
* Fix the $(basename) and $(suffix) functions so they only operate on
|
||||||
|
the last filename, not the entire string:
|
||||||
|
|
||||||
|
Command Old Result New Result
|
||||||
|
------- ---------- ----------
|
||||||
|
$(basename a.b) a a
|
||||||
|
$(basename a.b/c) a a.b/c
|
||||||
|
$(suffix a.b) b b
|
||||||
|
$(suffix a.b/c) b/c <empty>
|
||||||
|
|
||||||
|
* The $(strip) function now removes newlines as well as TABs and spaces.
|
||||||
|
|
||||||
|
* The $(shell) function now changes CRLF (\r\n) pairs to a space as well
|
||||||
|
as newlines (\n).
|
||||||
|
|
||||||
|
* Updates to the Windows 95/NT port from Rob Tulloh (see README.W32).
|
||||||
|
|
||||||
|
* Eli Zaretskii has updated the port to 32-bit protected mode on MSDOS
|
||||||
|
and MS-Windows, building with the DJGPP v2 port of GNU C/C++ compiler
|
||||||
|
and utilities. See README.DOS for details, and direct all questions
|
||||||
|
concerning this port to Eli Zaretskii <eliz@is.elta.co.il> or DJ
|
||||||
|
Delorie <dj@delorie.com>.
|
||||||
|
|
||||||
|
* John W. Eaton has updated the VMS port to support libraries and VPATH.
|
||||||
|
|
||||||
Version 3.75
|
Version 3.75
|
||||||
|
|
||||||
@@ -23,7 +120,7 @@ Version 3.75
|
|||||||
details, and direct all Amiga-related questions to <digulla@fh-konstanz.de>.
|
details, and direct all Amiga-related questions to <digulla@fh-konstanz.de>.
|
||||||
|
|
||||||
* Rob Tulloh of Tivoli Systems has contributed a port to Windows NT or 95.
|
* Rob Tulloh of Tivoli Systems has contributed a port to Windows NT or 95.
|
||||||
See README.WIN32 for details, and direct all Windows-related questions to
|
See README.W32 for details, and direct all Windows-related questions to
|
||||||
<rob_tulloh@tivoli.com>.
|
<rob_tulloh@tivoli.com>.
|
||||||
|
|
||||||
Version 3.73
|
Version 3.73
|
||||||
@@ -39,7 +136,8 @@ Version 3.72
|
|||||||
* DJ Delorie has ported Make to MS-DOS using the GO32 extender.
|
* DJ Delorie has ported Make to MS-DOS using the GO32 extender.
|
||||||
He is maintaining the DOS port, not the GNU Make maintainer;
|
He is maintaining the DOS port, not the GNU Make maintainer;
|
||||||
please direct bugs and questions for DOS to <djgpp@sun.soe.clarkson.edu>.
|
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.
|
MS-DOS binaries are available for FTP from ftp.simtel.net in
|
||||||
|
/pub/simtelnet/gnu/djgpp/.
|
||||||
|
|
||||||
* The `MAKEFLAGS' variable (in the environment or in a makefile) can now
|
* The `MAKEFLAGS' variable (in the environment or in a makefile) can now
|
||||||
contain variable definitions itself; these are treated just like
|
contain variable definitions itself; these are treated just like
|
||||||
|
|||||||
@@ -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_w32.bat' instead.
|
# `build_w32.bat' instead.
|
||||||
#
|
#
|
||||||
# Copyright (C) 1988, 89, 91, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
|
# Copyright (C) 1988,89,91,92,93,94,95,96,97 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
|
||||||
@@ -29,16 +29,17 @@ OUTDIR=.
|
|||||||
MAKEFILE=NMakefile
|
MAKEFILE=NMakefile
|
||||||
SUBPROC_MAKEFILE=NMakefile
|
SUBPROC_MAKEFILE=NMakefile
|
||||||
|
|
||||||
CFLAGS_any = /nologo /MT /W3 /GX /Zi /YX /I . /I glob /I w32/include /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES
|
CFLAGS_any = /nologo /MT /W3 /GX /Zi /YX /I . /I glob /I w32/include /D WIN32 /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES
|
||||||
CFLAGS_debug = $(CFLAGS_any) /Od /D _DEBUG /FR.\WinDebug/ /Fp.\WinDebug/make.pch /Fo.\WinDebug/ /Fd.\WinDebug/make.pdb
|
CFLAGS_debug = $(CFLAGS_any) /Od /D DEBUG /D _DEBUG /FR.\WinDebug/ /Fp.\WinDebug/make.pch /Fo.\WinDebug/ /Fd.\WinDebug/make.pdb
|
||||||
CFLAGS_release = $(CFLAGS_any) /O2 /D NDEBUG /FR.\WinRel/ /Fp.\WinRel/make.pch /Fo.\WinRel/
|
CFLAGS_release = $(CFLAGS_any) /O2 /D NDEBUG /FR.\WinRel/ /Fp.\WinRel/make.pch /Fo.\WinRel/
|
||||||
|
|
||||||
LDFLAGS_debug = w32\subproc\WinDebug\subproc.lib /NOLOGO /SUBSYSTEM:console\
|
LDFLAGS_debug = w32\subproc\WinDebug\subproc.lib /NOLOGO /SUBSYSTEM:console\
|
||||||
/INCREMENTAL:no /PDB:WinRel/make.pdb /MACHINE:I386 /OUT:WinDebug/make.exe
|
/INCREMENTAL:no /PDB:WinDebug/make.pdb /MACHINE:I386 \
|
||||||
|
/OUT:WinDebug/make.exe /DEBUG
|
||||||
LDFLAGS_release = w32\subproc\WinRel\subproc.lib /NOLOGO /SUBSYSTEM:console\
|
LDFLAGS_release = w32\subproc\WinRel\subproc.lib /NOLOGO /SUBSYSTEM:console\
|
||||||
/INCREMENTAL:no /MACHINE:I386 /OUT:WinRel/make.exe
|
/INCREMENTAL:no /MACHINE:I386 /OUT:WinRel/make.exe
|
||||||
|
|
||||||
all: subproc Release Debug
|
all: config.h subproc Release Debug
|
||||||
|
|
||||||
#
|
#
|
||||||
# Make sure we build the subproc library first. It has it's own
|
# Make sure we build the subproc library first. It has it's own
|
||||||
@@ -49,15 +50,21 @@ all: subproc Release Debug
|
|||||||
subproc: w32/subproc/WinDebug/subproc.lib w32/subproc/WinRel/subproc.lib
|
subproc: w32/subproc/WinDebug/subproc.lib w32/subproc/WinRel/subproc.lib
|
||||||
|
|
||||||
w32/subproc/WinDebug/subproc.lib w32/subproc/WinRel/subproc.lib:
|
w32/subproc/WinDebug/subproc.lib w32/subproc/WinRel/subproc.lib:
|
||||||
subproc.bat $(SUBPROC_MAKEFILE)
|
subproc.bat $(SUBPROC_MAKEFILE) $(MAKE)
|
||||||
|
|
||||||
Release:
|
config.h: config.h.W32
|
||||||
nmake /f $(MAKEFILE) LDFLAGS="$(LDFLAGS_release)" CFLAGS="$(CFLAGS_release)" OUTDIR=WinRel WinRel/make.exe
|
copy $? $@
|
||||||
Debug:
|
|
||||||
nmake /f $(MAKEFILE) LDFLAGS="$(LDFLAGS_debug)" CFLAGS="$(CFLAGS_debug)" OUTDIR=WinDebug WinDebug/make.exe
|
Release:
|
||||||
|
$(MAKE) /f $(MAKEFILE) LDFLAGS="$(LDFLAGS_release)" CFLAGS="$(CFLAGS_release)" OUTDIR=WinRel WinRel/make.exe
|
||||||
|
Debug:
|
||||||
|
$(MAKE) /f $(MAKEFILE) LDFLAGS="$(LDFLAGS_debug)" CFLAGS="$(CFLAGS_debug)" OUTDIR=WinDebug WinDebug/make.exe
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rmdir /s /q WinDebug WinRel
|
rmdir /s /q WinDebug WinRel
|
||||||
|
rmdir /s /q w32\subproc\WinDebug w32\subproc\WinRel
|
||||||
|
erase config.h
|
||||||
|
erase *.pdb
|
||||||
|
|
||||||
$(OUTDIR):
|
$(OUTDIR):
|
||||||
if not exist .\$@\nul mkdir .\$@
|
if not exist .\$@\nul mkdir .\$@
|
||||||
@@ -100,30 +107,7 @@ $(OUTDIR)/make.exe: $(OUTDIR) $(OBJS)
|
|||||||
|
|
||||||
.c{$(OUTDIR)}.obj:
|
.c{$(OUTDIR)}.obj:
|
||||||
$(CC) $(CFLAGS) /c $<
|
$(CC) $(CFLAGS) /c $<
|
||||||
|
|
||||||
$(OUTDIR)/ar.obj : ar.c make.h filedef.h dep.h
|
|
||||||
$(OUTDIR)/arscan.obj : arscan.c make.h
|
|
||||||
$(OUTDIR)/commands.obj : commands.c
|
|
||||||
$(OUTDIR)/default.obj : default.c make.h rule.h dep.h filedef.h job.h commands.h variable.h
|
|
||||||
$(OUTDIR)/dir.obj : dir.c make.h
|
|
||||||
$(OUTDIR)/expand.obj : expand.c make.h filedef.h job.h commands.h variable.h
|
|
||||||
$(OUTDIR)/file.obj : file.c make.h dep.h filedef.h job.h commands.h variable.h
|
|
||||||
$(OUTDIR)/function.obj : function.c make.h filedef.h variable.h dep.h job.h commands.h
|
|
||||||
$(OUTDIR)/getloadavg.obj : getloadavg.c
|
|
||||||
$(OUTDIR)/getopt.obj : getopt.c
|
|
||||||
$(OUTDIR)/getopt1.obj : getopt1.c getopt.h
|
|
||||||
$(OUTDIR)/implicit.obj : implicit.c make.h rule.h dep.h filedef.h
|
|
||||||
$(OUTDIR)/job.obj : job.c make.h job.h filedef.h commands.h variable.h
|
|
||||||
$(OUTDIR)/main.obj : main.c make.h dep.h filedef.h variable.h job.h commands.h getopt.h
|
|
||||||
$(OUTDIR)/misc.obj : misc.c make.h dep.h
|
|
||||||
$(OUTDIR)/read.obj : read.c make.h dep.h filedef.h job.h commands.h variable.h glob/glob.h
|
|
||||||
$(OUTDIR)/remake.obj : remake.c make.h filedef.h job.h commands.h dep.h
|
|
||||||
$(OUTDIR)/remote-stub.obj : remote-stub.c make.h filedef.h job.h commands.h
|
|
||||||
$(OUTDIR)/rule.obj : rule.c make.h dep.h filedef.h job.h commands.h variable.h rule.h
|
|
||||||
$(OUTDIR)/signame.obj : signame.c signame.h
|
|
||||||
$(OUTDIR)/variable.obj : variable.c make.h dep.h filedef.h job.h commands.h variable.h
|
|
||||||
$(OUTDIR)/version.obj : version.c
|
|
||||||
$(OUTDIR)/vpath.obj : vpath.c make.h filedef.h variable.h
|
|
||||||
$(OUTDIR)/glob.obj : glob/glob.c
|
$(OUTDIR)/glob.obj : glob/glob.c
|
||||||
$(CC) $(CFLAGS) /c $?
|
$(CC) $(CFLAGS) /c $?
|
||||||
$(OUTDIR)/fnmatch.obj : glob/fnmatch.c
|
$(OUTDIR)/fnmatch.obj : glob/fnmatch.c
|
||||||
@@ -132,4 +116,3 @@ $(OUTDIR)/dirent.obj : w32/compat/dirent.c
|
|||||||
$(CC) $(CFLAGS) /c $?
|
$(CC) $(CFLAGS) /c $?
|
||||||
$(OUTDIR)/pathstuff.obj : w32/pathstuff.c
|
$(OUTDIR)/pathstuff.obj : w32/pathstuff.c
|
||||||
$(CC) $(CFLAGS) /c $?
|
$(CC) $(CFLAGS) /c $?
|
||||||
|
|
||||||
|
|||||||
32
README
32
README
@@ -1,32 +0,0 @@
|
|||||||
This directory contains the 3.74.5 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.
|
|
||||||
|
|
||||||
Some systems' Make programs are broken and cannot process the Makefile for
|
|
||||||
GNU Make. If you get errors from your system's Make when building GNU
|
|
||||||
Make, try using `build.sh' instead.
|
|
||||||
|
|
||||||
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.
|
|
||||||
@@ -3,7 +3,7 @@ Author: GNU, Amiga port by Aaron "Optimizer" Digulla
|
|||||||
Uploader: Aaron "Optimizer" Digulla (digulla@fh-konstanz.de)
|
Uploader: Aaron "Optimizer" Digulla (digulla@fh-konstanz.de)
|
||||||
Type: dev/c
|
Type: dev/c
|
||||||
|
|
||||||
This is a pure Amiga port of GNU make 3.74. It needs no extra libraries or
|
This is a pure Amiga port of GNU make. It needs no extra libraries or
|
||||||
anything. It has the following features (in addition to any features of
|
anything. It has the following features (in addition to any features of
|
||||||
GNU make):
|
GNU make):
|
||||||
|
|
||||||
|
|||||||
296
README.DOS.template
Normal file
296
README.DOS.template
Normal file
@@ -0,0 +1,296 @@
|
|||||||
|
Port of GNU Make to 32-bit protected mode on MSDOS and MS-Windows.
|
||||||
|
|
||||||
|
Builds with DJGPP v2 port of GNU C/C++ compiler and utilities.
|
||||||
|
|
||||||
|
|
||||||
|
New (since 3.74) DOS-specific features:
|
||||||
|
|
||||||
|
1. Supports long filenames when run from DOS box on Windows 95.
|
||||||
|
|
||||||
|
2. Supports both stock DOS COMMAND.COM and Unix-style shells
|
||||||
|
(details in ``Notes'' below).
|
||||||
|
|
||||||
|
3. Supports DOS drive letters in dependencies and pattern rules.
|
||||||
|
|
||||||
|
4. Better support for DOS-style backslashes in pathnames (but see
|
||||||
|
``Notes'' below).
|
||||||
|
|
||||||
|
5. The $(shell) built-in can run arbitrary complex commands,
|
||||||
|
including pipes and redirection, even when COMMAND.COM is your
|
||||||
|
shell.
|
||||||
|
|
||||||
|
6. Can be built without floating-point code (see below).
|
||||||
|
|
||||||
|
7. Supports signals in child programs and restores the original
|
||||||
|
directory if the child was interrupted.
|
||||||
|
|
||||||
|
8. Can be built without (a previous version of) Make.
|
||||||
|
|
||||||
|
9. The build process requires only standard tools. (Optional
|
||||||
|
targets like "install:" and "clean:" still need additional
|
||||||
|
programs, though, see below.)
|
||||||
|
|
||||||
|
|
||||||
|
To build:
|
||||||
|
|
||||||
|
1. Unzip the archive, preserving the directory structure (-d switch
|
||||||
|
if you use PKUNZIP). If you build Make on Windows 95, use an
|
||||||
|
unzip program that supports long filenames in zip files.
|
||||||
|
|
||||||
|
If you are unpacking an official GNU source distribution, use
|
||||||
|
either DJTAR (which is part of the DJGPP development
|
||||||
|
environment), or the DJGPP port of GNU Tar.
|
||||||
|
|
||||||
|
2. Invoke the `configure.bat' batch file.
|
||||||
|
|
||||||
|
If you are building Make in-place, i.e. in the same directory
|
||||||
|
where its sources are kept, just type "configure.bat" and press
|
||||||
|
[Enter]. Otherwise, you need to supply the path to the source
|
||||||
|
directory as an argument to the batch file, like this:
|
||||||
|
|
||||||
|
configure.bat c:/djgpp/gnu/make-%VERSION%
|
||||||
|
|
||||||
|
Note the forward slashes: you MUST use them here.
|
||||||
|
|
||||||
|
3. If configure.bat doesn't find a working Make, it will suggest to
|
||||||
|
use the `dosbuild.bat' batch file to build Make. Either do as it
|
||||||
|
suggests or install another Make program (a pre-compiled binary
|
||||||
|
should be available from the usual DJGPP sites) and rerun
|
||||||
|
configure.bat.
|
||||||
|
|
||||||
|
4. If you will need to run Make on machines without an FPU, you
|
||||||
|
might consider building a version of Make which doesn't issue
|
||||||
|
floating-point instructions (they don't help much on MSDOS
|
||||||
|
anyway). To this end, edit the Makefile created by
|
||||||
|
configure.bat and add -DNO_FLOAT to the value of CPPFLAGS.
|
||||||
|
|
||||||
|
5. Invoke Make.
|
||||||
|
|
||||||
|
If you are building from outside of the source directory, you
|
||||||
|
need to tell Make where the sources are, like this:
|
||||||
|
|
||||||
|
make srcdir=c:/djgpp/gnu/make-%VERSION%
|
||||||
|
|
||||||
|
(configure.bat will tell you this when it finishes). You MUST
|
||||||
|
use a full, not relative, name of the source directory here, or
|
||||||
|
else Make might fail.
|
||||||
|
|
||||||
|
6. After Make finishes, if you have a Unix-style shell installed,
|
||||||
|
you can use the `install' target to install the package. You
|
||||||
|
will also need GNU Fileutils and GNU Sed for this (they should
|
||||||
|
be available from the DJGPP sites).
|
||||||
|
|
||||||
|
Without a Unix-style shell, you will have to install programs
|
||||||
|
and the docs manually. Copy make.exe to a directory on your
|
||||||
|
PATH, make.i* info files to your Info directory, and update the
|
||||||
|
file `dir' in your Info directory by adding the following item
|
||||||
|
to the main menu:
|
||||||
|
|
||||||
|
* Make: (make.info). The GNU make utility.
|
||||||
|
|
||||||
|
If you have the `install-info' program (from the GNU Texinfo
|
||||||
|
package), it will do that for you if you invoke it like this:
|
||||||
|
|
||||||
|
install-info --info-dir=c:/djgpp/info c:/djgpp/info/make.info
|
||||||
|
|
||||||
|
(If your Info directory is other than C:\DJGPP\INFO, change this
|
||||||
|
command accordingly.)
|
||||||
|
|
||||||
|
7. The `clean' targets also require Unix-style shell, and GNU Sed
|
||||||
|
and `rm' programs (the latter from Fileutils).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Notes:
|
||||||
|
-----
|
||||||
|
|
||||||
|
1. The shell issue.
|
||||||
|
|
||||||
|
This is probably the most significant improvement, first
|
||||||
|
introduced in the port of GNU Make 3.75.
|
||||||
|
|
||||||
|
The original behavior of GNU Make is to invoke commands
|
||||||
|
directly, as long as they don't include characters special to
|
||||||
|
the shell or internal shell commands, because that is faster.
|
||||||
|
When shell features like redirection or filename wildcards are
|
||||||
|
involved, Make calls the shell.
|
||||||
|
|
||||||
|
This port supports both DOS shells (the stock COMMAND.COM and its
|
||||||
|
4DOS/NDOS replacements), and Unix-style shells (tested with the
|
||||||
|
venerable Stewartson's `ms_sh' 2.3 and the DJGPP port of `bash' by
|
||||||
|
Daisuke Aoyama <jack@st.rim.or.jp>).
|
||||||
|
|
||||||
|
When the $SHELL variable points to a Unix-style shell, Make
|
||||||
|
works just like you'd expect on Unix, calling the shell for any
|
||||||
|
command that involves characters special to the shell or
|
||||||
|
internal shell commands. The only difference is that, since
|
||||||
|
there is no standard way to pass command lines longer than the
|
||||||
|
infamous DOS 126-character limit, this port of Make writes the
|
||||||
|
command line to a temporary disk file and then invokes the shell
|
||||||
|
on that file.
|
||||||
|
|
||||||
|
If $SHELL points to a DOS-style shell, however, Make will not
|
||||||
|
call it automatically, as it does with Unix shells. Stock
|
||||||
|
COMMAND.COM is too dumb and would unnecessarily limit the
|
||||||
|
functionality of Make. For example, you would not be able to
|
||||||
|
use long command lines in commands that use redirection or
|
||||||
|
pipes. Therefore, when presented with a DOS shell, this port of
|
||||||
|
Make will emulate most of the shell functionality, like
|
||||||
|
redirection and pipes, and shall only call the shell when a
|
||||||
|
batch file or a command internal to the shell is invoked. (Even
|
||||||
|
when a command is an internal shell command, Make will first
|
||||||
|
search the $PATH for it, so that if a Makefile calls `mkdir',
|
||||||
|
you can install, say, a port of GNU `mkdir' and have it called
|
||||||
|
in that case.)
|
||||||
|
|
||||||
|
The key to all this is the extended functionality of `spawn' and
|
||||||
|
`system' functions from the DJGPP library; this port just calls
|
||||||
|
`system' where it would invoke the shell on Unix. The most
|
||||||
|
important aspect of these functions is that they use a special
|
||||||
|
mechanism to pass long (up to 16KB) command lines to DJGPP
|
||||||
|
programs. In addition, `system' emulates some internal
|
||||||
|
commands, like `cd' (so that you can now use forward slashes
|
||||||
|
with it, and can also change the drive if the directory is on
|
||||||
|
another drive). Another aspect worth mentioning is that you can
|
||||||
|
call Unix shell scripts directly, provided that the shell whose
|
||||||
|
name is mentioned on the first line of the script is installed
|
||||||
|
anywhere along the $PATH. It is impossible to tell here
|
||||||
|
everything about these functions; refer to the DJGPP library
|
||||||
|
reference for more details.
|
||||||
|
|
||||||
|
The $(shell) built-in is implemented in this port by calling
|
||||||
|
`popen'. Since `popen' calls `system', the above considerations
|
||||||
|
are valid for $(shell) as well. In particular, you can put
|
||||||
|
arbitrary complex commands, including pipes and redirection,
|
||||||
|
inside $(shell), which is in many cases a valid substitute for
|
||||||
|
the Unix-style command substitution (`command`) feature.
|
||||||
|
|
||||||
|
|
||||||
|
2. "SHELL=/bin/sh" -- or is it?
|
||||||
|
|
||||||
|
Many Unix Makefiles include a line which sets the SHELL, for
|
||||||
|
those versions of Make which don't have this as the default.
|
||||||
|
Since many DOS systems don't have `sh' installed (in fact, most
|
||||||
|
of them don't even have a `/bin' directory), this port takes
|
||||||
|
such directives with a grain of salt. It will only honor such a
|
||||||
|
directive if the basename of the shell name (like `sh' in the
|
||||||
|
above example) can indeed be found in the directory that is
|
||||||
|
mentioned in the SHELL= line (`/bin' in the above example), or
|
||||||
|
in the current working directory, or anywhere on the $PATH (in
|
||||||
|
that order). If the basename doesn't include a filename
|
||||||
|
extension, Make will look for any known extension that indicates
|
||||||
|
an executable file (.exe, .com, .bat, .btm, .sh, and even .sed
|
||||||
|
and .pl). If any such file is found, then $SHELL will be
|
||||||
|
defined to the exact pathname of that file, and that shell will
|
||||||
|
hence be used for the rest of processing. But if the named
|
||||||
|
shell is *not* found, the line which sets it will be effectively
|
||||||
|
ignored, leaving the value of $SHELL as it was before. Since a
|
||||||
|
lot of decisions that this port makes depend on the gender of
|
||||||
|
the shell, I feel it doesn't make any sense to tailor Make's
|
||||||
|
behavior to a shell which is nowhere to be found.
|
||||||
|
|
||||||
|
Note that the above special handling of "SHELL=" only happens
|
||||||
|
for Makefiles; if you set $SHELL in the environment or on the
|
||||||
|
Make command line, you are expected to give the complete
|
||||||
|
pathname of the shell, including the filename extension.
|
||||||
|
|
||||||
|
The default value of $SHELL is computed as on Unix (see the Make
|
||||||
|
manual for details), except that if $SHELL is not defined in the
|
||||||
|
environment, $COMSPEC is used. Also, if an environment variable
|
||||||
|
named $MAKESHELL is defined, it takes precedence over both
|
||||||
|
$COMSPEC and $SHELL. Note that, unlike Unix, $SHELL in the
|
||||||
|
environment *is* used to set the shell (since on MSDOS, it's
|
||||||
|
unlikely that the interactive shell will not be suitable for
|
||||||
|
Makefile processing).
|
||||||
|
|
||||||
|
The bottom line is that you can now write Makefiles where some
|
||||||
|
of the targets require a real (i.e. Unix-like) shell, which will
|
||||||
|
nevertheless work when such shell is not available (provided, of
|
||||||
|
course, that the commands which should always work, don't
|
||||||
|
require such a shell). More important, you can convert Unix
|
||||||
|
Makefiles to MSDOS and leave the line which sets the shell
|
||||||
|
intact, so that people who do have Unixy shell could use it for
|
||||||
|
targets which aren't converted to DOS (like `install' and
|
||||||
|
`uninstall', for example).
|
||||||
|
|
||||||
|
|
||||||
|
3. Default directories.
|
||||||
|
|
||||||
|
GNU Make knows about standard directories where it searches for
|
||||||
|
library and include files mentioned in the Makefile. Since
|
||||||
|
MSDOS machines don't have standard places for these, this port
|
||||||
|
will search ${DJDIR}/lib and ${DJDIR}/include respectively.
|
||||||
|
$DJDIR is defined automatically by the DJGPP startup code as the
|
||||||
|
root of the DJGPP installation tree (unless you've tampered with
|
||||||
|
the DJGPP.ENV file). This should provide reasonable default
|
||||||
|
values, unless you moved parts of DJGPP to other directories.
|
||||||
|
|
||||||
|
|
||||||
|
4. Letter-case in filenames.
|
||||||
|
|
||||||
|
If you run Make on Windows 95, you should be aware of the
|
||||||
|
letter-case issue. Make is internally case-sensitive, but all
|
||||||
|
file operations are case-insensitive on Windows 95, so
|
||||||
|
e.g. files `FAQ', `faq' and `Faq' all refer to the same file, as
|
||||||
|
far as Windows is concerned. The underlying DJGPP C library
|
||||||
|
functions honor the letter-case of the filenames they get from
|
||||||
|
the OS, except that by default, they down-case 8+3 DOS filenames
|
||||||
|
which are stored in upper case in the directory and would break
|
||||||
|
many Makefiles otherwise. (The details of which filenames are
|
||||||
|
converted to lower case are explained in the DJGPP libc docs,
|
||||||
|
under the `_preserve_fncase' and `_lfn_gen_short_fname'
|
||||||
|
functions, but as a thumb rule, any filename that is stored in
|
||||||
|
upper case in the directory, is a legal DOS 8+3 filename and
|
||||||
|
doesn't include characters illegal on MSDOS FAT filesystems,
|
||||||
|
will be automatically down-cased.) User reports that I have
|
||||||
|
indicate that this default behavior is generally what you'd
|
||||||
|
expect; however, your input is most welcome.
|
||||||
|
|
||||||
|
In any case, if you hit a situation where you must force Make to
|
||||||
|
get the 8+3 DOS filenames in upper case, set FNCASE=y in the
|
||||||
|
environment or in the Makefile.
|
||||||
|
|
||||||
|
|
||||||
|
5. DOS-style pathnames.
|
||||||
|
|
||||||
|
There are a lot of places throughout the program sources which
|
||||||
|
make implicit assumptions about the pathname syntax. In
|
||||||
|
particular, the directories are assumed to be separated by `/',
|
||||||
|
and any pathname which doesn't begin with a `/' is assumed to be
|
||||||
|
relative to the current directory. This port attempts to
|
||||||
|
support DOS-style pathnames which might include the drive letter
|
||||||
|
and use backslashes instead of forward slashes. However, this
|
||||||
|
support is not complete; I feel that pursuing this support too
|
||||||
|
far might break some more important features, particularly if
|
||||||
|
you use a Unix-style shell (where a backslash is a quote
|
||||||
|
character). I only consider support of backslashes desirable
|
||||||
|
because some Makefiles invoke non-DJGPP programs which don't
|
||||||
|
understand forward slashes. A notable example of such programs
|
||||||
|
is the standard programs which come with MSDOS. Otherwise, you
|
||||||
|
are advised to stay away from backslashes whenever possible. In
|
||||||
|
particular, filename globbing won't work on pathnames with
|
||||||
|
backslashes, because the GNU `glob' library doesn't support them
|
||||||
|
(backslash is special in filename wildcards, and I didn't want
|
||||||
|
to break that).
|
||||||
|
|
||||||
|
One feature which *does* work with backslashes is the filename-
|
||||||
|
related built-in functions such as $(dir), $(notdir), etc.
|
||||||
|
Drive letters in pathnames are also fully supported.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Bug reports:
|
||||||
|
-----------
|
||||||
|
|
||||||
|
Bugs that are clearly related to the MSDOS/DJGPP port should be
|
||||||
|
reported first on the comp.os.msdos.djgpp news group (if you cannot
|
||||||
|
post to Usenet groups, write to the DJGPP mailing list,
|
||||||
|
<djgpp@delorie.com>, which is an email gateway into the above news
|
||||||
|
group). For other bugs, please follow the procedure explained in
|
||||||
|
the "Bugs" chapter of the Info docs. If you don't have an Info
|
||||||
|
reader, look up that chapter in the `make.i1' file with any text
|
||||||
|
browser/editor.
|
||||||
|
|
||||||
|
|
||||||
|
Enjoy,
|
||||||
|
Eli Zaretskii <eliz@is.elta.co.il>
|
||||||
187
README.W32
187
README.W32
@@ -1,10 +1,10 @@
|
|||||||
Port of GNU make to Windows NT and Windows 95
|
Port of GNU make to Windows NT and Windows 95
|
||||||
Builds natively with MSVC 2.x or MSVC 4.x compilers.
|
Builds natively with MSVC 2.x or MSVC 4.x compilers.
|
||||||
|
|
||||||
To build with nmake on Windows NT or Windows 95:
|
To build with nmake on Windows NT or Windows 95:
|
||||||
|
|
||||||
1. Make sure cl.exe is in your %Path%. Example:
|
1. Make sure cl.exe is in your %Path%. Example:
|
||||||
|
|
||||||
set Path=%Path%;c:/msdev/bin
|
set Path=%Path%;c:/msdev/bin
|
||||||
|
|
||||||
2. Make sure %include% is set to msvc include directory. Example:
|
2. Make sure %include% is set to msvc include directory. Example:
|
||||||
@@ -19,13 +19,16 @@ To build with nmake on Windows NT or Windows 95:
|
|||||||
|
|
||||||
|
|
||||||
There is a bat file (build_w32.bat) for folks who have fear of nmake.
|
There is a bat file (build_w32.bat) for folks who have fear of nmake.
|
||||||
|
|
||||||
Outputs:
|
Outputs:
|
||||||
|
|
||||||
WinDebug/make.exe
|
WinDebug/make.exe
|
||||||
WinRel/make.exe
|
WinRel/make.exe
|
||||||
|
|
||||||
Notes:
|
|
||||||
|
-- Notes/Caveats --
|
||||||
|
|
||||||
|
GNU make and sh.exe:
|
||||||
|
|
||||||
This port prefers you have a working sh.exe somewhere on your
|
This port prefers you have a working sh.exe somewhere on your
|
||||||
system. If you don't have sh.exe, port falls back to
|
system. If you don't have sh.exe, port falls back to
|
||||||
@@ -33,17 +36,187 @@ Notes:
|
|||||||
The MSDOS mode style execution has not been tested too
|
The MSDOS mode style execution has not been tested too
|
||||||
carefully though (I use GNU bash as sh.exe).
|
carefully though (I use GNU bash as sh.exe).
|
||||||
|
|
||||||
|
There are very few true ports of Bourne shell for NT right now.
|
||||||
|
There is a version of GNU bash available from Cygnus gnu-win32
|
||||||
|
porting effort. Other possibilities are to get the MKS version
|
||||||
|
of sh.exe or to build your own with a package like
|
||||||
|
NutCracker (DataFocus) or Portage (Consensys).
|
||||||
|
|
||||||
|
Tivoli uses a homegrown port of GNU bash which is not (yet)
|
||||||
|
freely available. It may be available someday, but I am not in control
|
||||||
|
of this decision nor do I influence it. Sorry!
|
||||||
|
|
||||||
|
GNU make and Cygnus GNU WIN32 tools (BATCH_MODE_ONLY_SHELL)
|
||||||
|
|
||||||
|
GNU make now has support for the Cygnus GNU WIN32 toolset. The
|
||||||
|
GNU WIN32 version of Bourne shell does not behave well when
|
||||||
|
invoked as 'sh -c' from CreateProcess(). The main problem is it
|
||||||
|
seems to have a hard time handling quoted strings correctly. This
|
||||||
|
problem goes away when invoking the Cygnus shell on a shell script.
|
||||||
|
|
||||||
|
To work around this difficulty, this version of make supports
|
||||||
|
a new batch mode. When BATCH_MODE_ONLY_SHELL is defined at compile
|
||||||
|
time, make forces all command lines to be executed via script
|
||||||
|
files instead of by command line.
|
||||||
|
|
||||||
|
A native WIN32 system with no Bourne shell will also run
|
||||||
|
in batch mode. All command lines will be put into batch files
|
||||||
|
and executed via $(COMSPEC) (%COMSPEC%).
|
||||||
|
|
||||||
|
If you wish to use Cygnus' GNUWIN32 shell, be sure you define
|
||||||
|
BATCH_MODE_ONLY_SHELL in the config.h.W32 prior to building make.
|
||||||
|
The new feataure was tested with the b18 version of the Cygnus
|
||||||
|
user tools.
|
||||||
|
|
||||||
|
GNU make and MKS shell
|
||||||
|
|
||||||
|
There is now semi-official support for the MKS shell. To turn this
|
||||||
|
support on, define HAVE_MKS_SHELL in the config.h.W32 before you
|
||||||
|
build make. Do not define BATCH_MODE_ONLY_SHELL if you turn
|
||||||
|
on HAVE_MKS_SHELL.
|
||||||
|
|
||||||
|
GNU make handling of drive letters in pathnames (PATH, vpath, VPATH):
|
||||||
|
|
||||||
|
There is a caveat that should be noted with respect to handling
|
||||||
|
single character pathnames on Windows systems. When colon is
|
||||||
|
used in PATH variables, make tries to be smart about knowing when
|
||||||
|
you are using colon as a separator versus colon as a drive
|
||||||
|
letter. Unfortunately, something as simple as the string 'x:/'
|
||||||
|
could be interpreted 2 ways: (x and /) or (x:/).
|
||||||
|
|
||||||
|
Make chooses to interpret a letter plus colon (e.g. x:/) as a
|
||||||
|
drive letter pathname. If it is necessary to use single
|
||||||
|
character directories in paths (VPATH, vpath, Path, PATH), the
|
||||||
|
user must do one of two things:
|
||||||
|
|
||||||
|
a. Use semicolon as the separator to disambiguate colon. For
|
||||||
|
example use 'x;/' if you want to say 'x' and '/' are
|
||||||
|
separate components.
|
||||||
|
|
||||||
|
b. Qualify the directory name so that there is more than
|
||||||
|
one character in the path(s) used. For example, none
|
||||||
|
of these settings are ambiguous:
|
||||||
|
|
||||||
|
./x:./y
|
||||||
|
/some/path/x:/some/path/y
|
||||||
|
x:/some/path/x:x:/some/path/y
|
||||||
|
|
||||||
|
These caveats affect Windows systems only (Windows NT and
|
||||||
|
Windows 95) and can be ignored for other platforms.
|
||||||
|
|
||||||
|
Please note that you are free to mix colon and semi-colon in the
|
||||||
|
specification of paths. Make is able to figure out the intended
|
||||||
|
result and convert the paths internally to the format needed
|
||||||
|
when interacting with the operating system.
|
||||||
|
|
||||||
|
You are encouraged to use colon as the separator character.
|
||||||
|
This should ease the pain of deciding how to handle various path
|
||||||
|
problems which exist between platforms. If colon is used on
|
||||||
|
both Unix and Windows systems, then no ifdef'ing will be
|
||||||
|
necessary in the makefile source.
|
||||||
|
|
||||||
|
GNU make test suite:
|
||||||
|
|
||||||
I verified all functionality with a slightly modified version
|
I verified all functionality with a slightly modified version
|
||||||
of make-test-0.4.5 (modifications to get test suite to run
|
of make-test-0.4.5 (modifications to get test suite to run
|
||||||
on Windows NT). All tests pass in an environment that includes
|
on Windows NT). All tests pass in an environment that includes
|
||||||
sh.exe.
|
sh.exe. Tested on both Windows NT and Windows 95.
|
||||||
|
|
||||||
|
Building GNU make on Windows NT and Windows 95 with Microsoft Visual C
|
||||||
|
|
||||||
I did not provide a Visual C project file with this port as
|
I did not provide a Visual C project file with this port as
|
||||||
the project file would not be considered freely distributable
|
the project file would not be considered freely distributable
|
||||||
(or so I think). It is easy enough to create one though if
|
(or so I think). It is easy enough to create one though if
|
||||||
you know how to use Visual C.
|
you know how to use Visual C.
|
||||||
|
|
||||||
I build the program statically to avoid problems locating DLL's
|
I build the program statically to avoid problems locating DLL's
|
||||||
on machines that may not have MSVC runtime installed. If you
|
on machines that may not have MSVC runtime installed. If you
|
||||||
prefer, you can change make to build with shared libraries by
|
prefer, you can change make to build with shared libraries by
|
||||||
changing /MT to /MD in the NMakefile (or build_w32.bat).
|
changing /MT to /MD in the NMakefile (or build_w32.bat).
|
||||||
|
|
||||||
|
Program has not been built under non-Intel architectures (yet).
|
||||||
|
|
||||||
|
I have not tried to build with any other compilers than MSVC.
|
||||||
|
|
||||||
|
Pathnames and white space:
|
||||||
|
|
||||||
|
Unlike Unix, Windows 95/NT systems encourage pathnames which
|
||||||
|
contain white space (e.g. C:\Program Files\). These sorts of pathnames
|
||||||
|
are legal under Unix too, but are never encouraged. There is
|
||||||
|
at least one place in make (VPATH/vpath handling) where paths
|
||||||
|
containing white space will simply not work. There may be others
|
||||||
|
too. I chose to not try and port make in such a way so that
|
||||||
|
these sorts of paths could be handled. I offer these suggestions
|
||||||
|
as workarounds:
|
||||||
|
|
||||||
|
1. Use 8.3 notation
|
||||||
|
2. Rename the directory so it does not contain white space.
|
||||||
|
|
||||||
|
If you are unhappy with this choice, this is free software
|
||||||
|
and you are free to take a crack at making this work. The code
|
||||||
|
in w32/pathstuff.c and vpath.c would be the places to start.
|
||||||
|
|
||||||
|
Pathnames and Case insensitivity:
|
||||||
|
|
||||||
|
Unlike Unix, Windows 95/NT systems are case insensitive but case
|
||||||
|
preserving. For example if you tell the file system to create a
|
||||||
|
file named "Target", it will preserve the case. Subsequent access to
|
||||||
|
the file with other case permutations will succeed (i.e. opening a
|
||||||
|
file named "target" or "TARGET" will open the file "Target").
|
||||||
|
|
||||||
|
By default, GNU make retains its case sensitivity when comparing
|
||||||
|
target names and existing files or directories. It can be
|
||||||
|
configured, however, into a case preserving and case insensitive
|
||||||
|
mode by adding a define for HAVE_CASE_INSENSITIVE_FS to
|
||||||
|
config.h.W32.
|
||||||
|
|
||||||
|
For example, the following makefile will create a file named
|
||||||
|
Target in the directory subdir which will subsequently be used
|
||||||
|
to satisfy the dependency of SUBDIR/DepTarget on SubDir/TARGET.
|
||||||
|
Without HAVE_CASE_INSENSITIVE_FS configured, the dependency link
|
||||||
|
will not be made:
|
||||||
|
|
||||||
|
subdir/Target:
|
||||||
|
touch $@
|
||||||
|
|
||||||
|
SUBDIR/DepTarget: SubDir/TARGET
|
||||||
|
cp $^ $@
|
||||||
|
|
||||||
|
Reliance on this behavior also eliminates the ability of GNU make
|
||||||
|
to use case in comparison of matching rules. For example, it is
|
||||||
|
not possible to set up a C++ rule using %.C that is different
|
||||||
|
than a C rule using %.c. GNU make will consider these to be the
|
||||||
|
same rule and will issue a warning.
|
||||||
|
|
||||||
|
SAMBA/NTFS/VFAT:
|
||||||
|
|
||||||
|
I have not had any success building the debug version of this
|
||||||
|
package using SAMBA as my file server. The reason seems to be
|
||||||
|
related to the way VC++ 4.0 changes the case name of the pdb
|
||||||
|
filename it is passed on the command line. It seems to change
|
||||||
|
the name always to to lower case. I contend that
|
||||||
|
the VC++ compiler should not change the casename of files that
|
||||||
|
are passed as arguments on the command line. I don't think this
|
||||||
|
was a problem in MSVC 2.x, but I know it is a problem in MSVC 4.x.
|
||||||
|
|
||||||
|
The package builds fine on VFAT and NTFS filesystems.
|
||||||
|
|
||||||
|
Most all of the development I have done to date has been using
|
||||||
|
NTFS and long file names. I have not done any considerable work
|
||||||
|
under VFAT. VFAT users may wish to be aware that this port
|
||||||
|
of make does respect case sensitivity.
|
||||||
|
|
||||||
|
Version 3.76 contains some preliminary support for FAT. Make
|
||||||
|
now tries to work around some difficulties with stat'ing of
|
||||||
|
files and caching of filenames and directories internally.
|
||||||
|
There is still a known problem with filenames sometimes being
|
||||||
|
found to have modification dates in the future which cause make
|
||||||
|
to complain about the file and exit (remake.c).
|
||||||
|
|
||||||
|
Bug reports:
|
||||||
|
|
||||||
|
Please submit bugs via the normal bug reporting mechanism
|
||||||
|
which is described in one of the Texinfo files. If you don't
|
||||||
|
have Texinfo for Windows NT or Windows 95, these files are simple
|
||||||
|
text files and can be read with a text editor.
|
||||||
|
|
||||||
|
|||||||
49
README.WIN32
49
README.WIN32
@@ -1,49 +0,0 @@
|
|||||||
Port of GNU make to Windows NT and Windows 95
|
|
||||||
Builds natively with MSVC 2.x or MSVC 4.x compilers.
|
|
||||||
|
|
||||||
To build with nmake on Windows NT or Windows 95:
|
|
||||||
|
|
||||||
1. Make sure cl.exe is in your %Path%. Example:
|
|
||||||
|
|
||||||
set Path=%Path%;c:/msdev/bin
|
|
||||||
|
|
||||||
2. Make sure %include% is set to msvc include directory. Example:
|
|
||||||
|
|
||||||
set include=c:/msdev/include
|
|
||||||
|
|
||||||
3. Make sure %lib% is set to msvc lib directory. Example:
|
|
||||||
|
|
||||||
set lib=c:/msdev/lib
|
|
||||||
|
|
||||||
4. nmake /f NMakefile
|
|
||||||
|
|
||||||
|
|
||||||
There is a bat file (build_w32.bat) for folks who have fear of nmake.
|
|
||||||
|
|
||||||
Outputs:
|
|
||||||
|
|
||||||
WinDebug/make.exe
|
|
||||||
WinRel/make.exe
|
|
||||||
|
|
||||||
Notes:
|
|
||||||
|
|
||||||
This port prefers you have a working sh.exe somewhere on your
|
|
||||||
system. If you don't have sh.exe, port falls back to
|
|
||||||
MSDOS mode for launching programs (via a batch file).
|
|
||||||
The MSDOS mode style execution has not been tested too
|
|
||||||
carefully though (I use GNU bash as sh.exe).
|
|
||||||
|
|
||||||
I verified all functionality with a slightly modified version
|
|
||||||
of make-test-0.4.5 (modifications to get test suite to run
|
|
||||||
on Windows NT). All tests pass in an environment that includes
|
|
||||||
sh.exe.
|
|
||||||
|
|
||||||
I did not provide a Visual C project file with this port as
|
|
||||||
the project file would not be considered freely distributable
|
|
||||||
(or so I think). It is easy enough to create one though if
|
|
||||||
you know how to use Visual C.
|
|
||||||
|
|
||||||
I build the program statically to avoid problems locating DLL's
|
|
||||||
on machines that may not have MSVC runtime installed. If you
|
|
||||||
prefer, you can change make to build with shared libraries by
|
|
||||||
changing /MT to /MD in the NMakefile (or build_w32.bat).
|
|
||||||
73
README.customs
Normal file
73
README.customs
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
-*-indented-text-*-
|
||||||
|
|
||||||
|
GNU make can utilize the Customs library, distributed with Pmake, to
|
||||||
|
provide builds distributed across multiple hosts.
|
||||||
|
|
||||||
|
In order to utilize this capability, you must first download and build
|
||||||
|
the Customs library. It is contained in the Pmake distribution, which
|
||||||
|
can be obtained at:
|
||||||
|
|
||||||
|
ftp://ftp.icsi.berkeley.edu/pub/ai/stolcke/software/
|
||||||
|
|
||||||
|
This integration was tested (superficially) with Pmake 2.1.33.
|
||||||
|
|
||||||
|
|
||||||
|
BUILDING CUSTOMS
|
||||||
|
----------------
|
||||||
|
|
||||||
|
First, build pmake and Customs. You need to build pmake first, because
|
||||||
|
Customs require pmake to build. Unfortunately, this is not trivial;
|
||||||
|
please see the pmake and Customs documentation for details. The best
|
||||||
|
place to look for instructions is in the pmake-2.1.33/INSTALL file.
|
||||||
|
|
||||||
|
Note that the 2.1.33 Pmake distribution comes with a set of patches to
|
||||||
|
GNU make, distributed in the pmake-2.1.33/etc/gnumake/ directory. These
|
||||||
|
patches are based on GNU make 3.75 (there are patches for earlier
|
||||||
|
versions of GNU make, also). The parts of this patchfile which relate
|
||||||
|
directly to Customs support have already been incorporated into this
|
||||||
|
version of GNU make, so you should _NOT_ apply the patch file.
|
||||||
|
|
||||||
|
However, there are a few non-Customs specific (as far as I could tell)
|
||||||
|
changes here which are not incorporated (for example, the modification
|
||||||
|
to try expanding -lfoo to libfoo.so). If you rely on these changes
|
||||||
|
you'll need to re-apply them by hand.
|
||||||
|
|
||||||
|
Install the Customs library and header files according to the
|
||||||
|
documentation. You should also install the man pages (contrary to
|
||||||
|
comments in the documentation, they weren't installed automatically for
|
||||||
|
me; I had to cd to the ``pmake-2.1.33/doc'' directory and run ``pmake
|
||||||
|
install'' there directly).
|
||||||
|
|
||||||
|
|
||||||
|
BUILDING GNU MAKE
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
Once you've installed Customs, you can build GNU make to use it. When
|
||||||
|
configuring GNU make, merely use the ``--with-customs=DIR'' option.
|
||||||
|
Provide the directory containing the ``lib'' and ``include/customs''
|
||||||
|
subdirectories as DIR. For example, if you installed the customs
|
||||||
|
library in /usr/local/lib and the headers in /usr/local/include/customs,
|
||||||
|
then you'd pass ``--with-customs=/usr/local'' as an option to configure.
|
||||||
|
|
||||||
|
Run make (or use build.sh) normally to build GNU make as described in
|
||||||
|
the INSTALL file.
|
||||||
|
|
||||||
|
See the documentation for Customs for information on starting and
|
||||||
|
configuring Customs.
|
||||||
|
|
||||||
|
|
||||||
|
PROBLEMS
|
||||||
|
--------
|
||||||
|
|
||||||
|
SunOS 4.1.x:
|
||||||
|
The customs/sprite.h header file #includes the <malloc.h> header
|
||||||
|
files; this conflicts with GNU make's configuration so you'll get a
|
||||||
|
compile error if you use GCC (or any other ANSI-capable C compiler).
|
||||||
|
|
||||||
|
I commented out the #include in sprite.h:107:
|
||||||
|
|
||||||
|
#if defined(sun) || defined(ultrix) || defined(hpux) || defined(sgi)
|
||||||
|
/* #include <malloc.h> */
|
||||||
|
#else
|
||||||
|
|
||||||
|
YMMV.
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
This directory contains the VERSION test release of GNU Make.
|
This directory contains the %VERSION% release of GNU Make.
|
||||||
All bugs reported for previous test releases have been fixed.
|
All bugs reported for previous releases have been fixed.
|
||||||
Some bugs surely remain.
|
Some bugs surely remain.
|
||||||
|
|
||||||
For general building and installation instructions, see the file INSTALL.
|
For general building and installation instructions, see the file INSTALL.
|
||||||
@@ -14,6 +14,20 @@ Some systems' Make programs are broken and cannot process the Makefile for
|
|||||||
GNU Make. If you get errors from your system's Make when building GNU
|
GNU Make. If you get errors from your system's Make when building GNU
|
||||||
Make, try using `build.sh' instead.
|
Make, try using `build.sh' instead.
|
||||||
|
|
||||||
|
- See README.customs for details on integrating GNU make with the
|
||||||
|
Customs distributed build environment from the Pmake distribution.
|
||||||
|
|
||||||
|
- See README.W32 for details about GNU Make on Windows NT or 95.
|
||||||
|
|
||||||
|
- See README.Amiga for details about GNU Make on AmigaDOS.
|
||||||
|
|
||||||
|
- See README.DOS for compilation instructions on MS-DOS and MS-Windows
|
||||||
|
using DJGPP tools.
|
||||||
|
|
||||||
|
A precompiled binary of the MSDOS port of GNU Make is available as part
|
||||||
|
of DJGPP; see the WWW page http://www.delorie.com/djgpp/ for more
|
||||||
|
information.
|
||||||
|
|
||||||
It has been reported that the XLC 1.2 compiler on AIX 3.2 is buggy such
|
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.
|
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.
|
It is said that using `cc' without `-O' does work.
|
||||||
|
|||||||
@@ -192,7 +192,7 @@ clean: glob-clean
|
|||||||
-$(RM) -f make loadavg *.o core 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
|
||||||
-$(RM) -f config.log config.cache
|
-$(RM) -f config.log config.cache
|
||||||
-$(RM) -f TAGS tags
|
-$(RM) -f TAGS tags
|
||||||
-$(RM) -f make.?? make.??s make.log make.toc make.*aux
|
-$(RM) -f make.?? make.??s make.log make.toc make.*aux
|
||||||
@@ -210,67 +210,3 @@ glob-clean glob-realclean:
|
|||||||
cd glob
|
cd glob
|
||||||
smake $@
|
smake $@
|
||||||
<
|
<
|
||||||
|
|
||||||
# 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 filedef.h variable.h job.h \
|
|
||||||
commands.h
|
|
||||||
|
|
||||||
job.o: job.c make.h job.h filedef.h commands.h variable.h
|
|
||||||
|
|
||||||
dir.o: dir.c make.h
|
|
||||||
|
|
||||||
file.o: file.c make.h dep.h filedef.h job.h commands.h variable.h
|
|
||||||
|
|
||||||
misc.o: misc.c make.h dep.h
|
|
||||||
|
|
||||||
main.o: main.c make.h dep.h filedef.h variable.h job.h commands.h \
|
|
||||||
getopt.h
|
|
||||||
|
|
||||||
read.o: read.c make.h dep.h filedef.h job.h commands.h variable.h \
|
|
||||||
glob/glob.h
|
|
||||||
|
|
||||||
remake.o: remake.c make.h filedef.h job.h commands.h dep.h
|
|
||||||
|
|
||||||
rule.o: rule.c make.h dep.h filedef.h job.h commands.h variable.h \
|
|
||||||
rule.h
|
|
||||||
|
|
||||||
implicit.o: implicit.c make.h rule.h dep.h filedef.h
|
|
||||||
|
|
||||||
default.o: default.c make.h rule.h dep.h filedef.h job.h commands.h \
|
|
||||||
variable.h
|
|
||||||
|
|
||||||
variable.o: variable.c make.h dep.h filedef.h job.h commands.h \
|
|
||||||
variable.h
|
|
||||||
|
|
||||||
expand.o: expand.c make.h filedef.h job.h commands.h variable.h
|
|
||||||
|
|
||||||
function.o: function.c make.h filedef.h variable.h dep.h job.h \
|
|
||||||
commands.h amiga.h
|
|
||||||
|
|
||||||
vpath.o: vpath.c make.h filedef.h variable.h
|
|
||||||
|
|
||||||
version.o: version.c
|
|
||||||
|
|
||||||
ar.o: ar.c make.h filedef.h dep.h
|
|
||||||
|
|
||||||
arscan.o: arscan.c make.h
|
|
||||||
|
|
||||||
signame.o: signame.c signame.h
|
|
||||||
|
|
||||||
remote-stub.o: remote-stub.c make.h filedef.h job.h commands.h
|
|
||||||
|
|
||||||
getopt.o: getopt.c
|
|
||||||
|
|
||||||
getopt1.o : getopt1.c getopt.h
|
|
||||||
|
|
||||||
getloadavg.o: getloadavg.c
|
|
||||||
|
|
||||||
amiga.o: amiga.c make.h variable.h amiga.h
|
|
||||||
|
|
||||||
|
|||||||
51
TODO.private
Normal file
51
TODO.private
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
-*-Indented-Text-*-
|
||||||
|
GNU Make TODO List
|
||||||
|
------------------
|
||||||
|
|
||||||
|
This list comes both from the authors and from users of GNU make.
|
||||||
|
|
||||||
|
They are listed in no particular order!
|
||||||
|
|
||||||
|
Also, I don't gaurantee that all of them will be ultimately deemed "good
|
||||||
|
ideas" and implemented. These are just the ones that, at first blush,
|
||||||
|
seem to have some merit (and that I can remember).
|
||||||
|
|
||||||
|
However, if you see something here you really, really want, speak up.
|
||||||
|
All other things being equal, I will tend to implement things that seem
|
||||||
|
to maximize user satisfaction.
|
||||||
|
|
||||||
|
Also, this list doesn't include things which I'm pretty sure would
|
||||||
|
require serious, fundamental change to GNU make; those things belong on
|
||||||
|
the mythical "Make 4.0" list. I admit, that line can be somewhat fuzzy :)
|
||||||
|
|
||||||
|
|
||||||
|
* Per-target variable definitions (a la SunOS make's ":=" feature, but
|
||||||
|
note the syntax here will definitely be different!)
|
||||||
|
|
||||||
|
* Multi-token pattern rule matching (allow %1/%2.c : %1/obj/%2.o, etc.)
|
||||||
|
|
||||||
|
* More robust clock skew detection algorithm.
|
||||||
|
|
||||||
|
* Provide MAKETARGETS and MAKEVARIABLES variables, containing the
|
||||||
|
names of the targets and variables defined in the makefile.
|
||||||
|
|
||||||
|
* If the user asks for parallelization, rebuild any "include"'d files
|
||||||
|
in parallel as well (helps esp. when there are many .d files to be
|
||||||
|
built).
|
||||||
|
|
||||||
|
* Allow variables/functions to expand to other make rules which are
|
||||||
|
then interpreted, with newlines handled correctly.
|
||||||
|
|
||||||
|
* More intelligent submake handling when doing parallel makes:
|
||||||
|
currently each submake gets a "-j 1" option. It would be good if
|
||||||
|
make was smart enough to give some/all its slots to the submake
|
||||||
|
(esp. if there is no other rule that can be run by the parent in
|
||||||
|
parallel, a common situation). Doing this perfectly might be too
|
||||||
|
hard, but something less than perfect is certainly possible.
|
||||||
|
|
||||||
|
* Option to check more than timestamps to determine if targets have
|
||||||
|
changed (MD5 checksumming?)
|
||||||
|
|
||||||
|
* Some sort of operating-system independent way of handling paths
|
||||||
|
would be outstanding, so makefiles can be written for UNIX, VMS,
|
||||||
|
DOS, MS-Windows, Amiga, etc. with a minimum of specialization.
|
||||||
@@ -1,3 +1,9 @@
|
|||||||
|
/* Name of this package (needed by automake) */
|
||||||
|
#undef PACKAGE
|
||||||
|
|
||||||
|
/* Version of this package (needed by automake) */
|
||||||
|
#undef VERSION
|
||||||
|
|
||||||
/* Define to the name of the SCCS `get' command. */
|
/* Define to the name of the SCCS `get' command. */
|
||||||
#undef SCCS_GET
|
#undef SCCS_GET
|
||||||
|
|
||||||
|
|||||||
131
acinclude.m4
Normal file
131
acinclude.m4
Normal file
@@ -0,0 +1,131 @@
|
|||||||
|
dnl acinclude.m4 -- Extra macros needed for GNU make.
|
||||||
|
dnl
|
||||||
|
dnl Automake will incorporate this into its generated aclocal.m4.
|
||||||
|
|
||||||
|
dnl ---------------------------------------------------------------------------
|
||||||
|
dnl Got this from the lynx 2.8 distribution.
|
||||||
|
dnl by T.E.Dickey <dickey@clark.net>
|
||||||
|
dnl and Jim Spath <jspath@mail.bcpl.lib.md.us>
|
||||||
|
dnl and Philippe De Muyter <phdm@macqel.be>
|
||||||
|
dnl
|
||||||
|
dnl Created: 1997/1/28
|
||||||
|
dnl Updated: 1997/12/23
|
||||||
|
dnl ---------------------------------------------------------------------------
|
||||||
|
dnl After checking for functions in the default $LIBS, make a further check
|
||||||
|
dnl for the functions that are netlib-related (these aren't always in the
|
||||||
|
dnl libc, etc., and have to be handled specially because there are conflicting
|
||||||
|
dnl and broken implementations.
|
||||||
|
dnl Common library requirements (in order):
|
||||||
|
dnl -lresolv -lsocket -lnsl
|
||||||
|
dnl -lnsl -lsocket
|
||||||
|
dnl -lsocket
|
||||||
|
dnl -lbsd
|
||||||
|
AC_DEFUN([CF_NETLIBS],[
|
||||||
|
cf_test_netlibs=no
|
||||||
|
AC_MSG_CHECKING(for network libraries)
|
||||||
|
AC_CACHE_VAL(cf_cv_netlibs,[
|
||||||
|
AC_MSG_RESULT(working...)
|
||||||
|
cf_cv_netlibs=""
|
||||||
|
cf_test_netlibs=yes
|
||||||
|
AC_CHECK_FUNCS(gethostname,,[
|
||||||
|
CF_RECHECK_FUNC(gethostname,nsl,cf_cv_netlibs,[
|
||||||
|
CF_RECHECK_FUNC(gethostname,socket,cf_cv_netlibs)])])
|
||||||
|
#
|
||||||
|
# FIXME: sequent needs this library (i.e., -lsocket -linet -lnsl), but
|
||||||
|
# I don't know the entrypoints - 97/7/22 TD
|
||||||
|
AC_CHECK_LIB(inet,main,cf_cv_netlibs="-linet $cf_cv_netlibs")
|
||||||
|
#
|
||||||
|
if test "$ac_cv_func_lsocket" != no ; then
|
||||||
|
AC_CHECK_FUNCS(socket,,[
|
||||||
|
CF_RECHECK_FUNC(socket,socket,cf_cv_netlibs,[
|
||||||
|
CF_RECHECK_FUNC(socket,bsd,cf_cv_netlibs)])])
|
||||||
|
fi
|
||||||
|
#
|
||||||
|
AC_CHECK_FUNCS(gethostbyname,,[
|
||||||
|
CF_RECHECK_FUNC(gethostbyname,nsl,cf_cv_netlibs)])
|
||||||
|
#
|
||||||
|
AC_CHECK_FUNCS(strcasecmp,,[
|
||||||
|
CF_RECHECK_FUNC(strcasecmp,resolv,cf_cv_netlibs)])
|
||||||
|
])
|
||||||
|
LIBS="$LIBS $cf_cv_netlibs"
|
||||||
|
test $cf_test_netlibs = no && echo "$cf_cv_netlibs" >&AC_FD_MSG
|
||||||
|
])dnl
|
||||||
|
dnl ---------------------------------------------------------------------------
|
||||||
|
dnl Re-check on a function to see if we can pick it up by adding a library.
|
||||||
|
dnl $1 = function to check
|
||||||
|
dnl $2 = library to check in
|
||||||
|
dnl $3 = environment to update (e.g., $LIBS)
|
||||||
|
dnl $4 = what to do if this fails
|
||||||
|
dnl
|
||||||
|
dnl This uses 'unset' if the shell happens to support it, but leaves the
|
||||||
|
dnl configuration variable set to 'unknown' if not. This is a little better
|
||||||
|
dnl than the normal autoconf test, which gives misleading results if a test
|
||||||
|
dnl for the function is made (e.g., with AC_CHECK_FUNC) after this macro is
|
||||||
|
dnl used (autoconf does not distinguish between a null token and one that is
|
||||||
|
dnl set to 'no').
|
||||||
|
AC_DEFUN([CF_RECHECK_FUNC],[
|
||||||
|
AC_CHECK_LIB($2,$1,[
|
||||||
|
CF_UPPER(cf_tr_func,$1)
|
||||||
|
AC_DEFINE_UNQUOTED(HAVE_$cf_tr_func)
|
||||||
|
ac_cv_func_$1=yes
|
||||||
|
$3="-l$2 [$]$3"],[
|
||||||
|
ac_cv_func_$1=unknown
|
||||||
|
unset ac_cv_func_$1 2>/dev/null
|
||||||
|
$4],
|
||||||
|
[[$]$3])
|
||||||
|
])dnl
|
||||||
|
dnl ---------------------------------------------------------------------------
|
||||||
|
dnl Make an uppercase version of a variable
|
||||||
|
dnl $1=uppercase($2)
|
||||||
|
AC_DEFUN([CF_UPPER],
|
||||||
|
[
|
||||||
|
changequote(,)dnl
|
||||||
|
$1=`echo $2 | tr '[a-z]' '[A-Z]'`
|
||||||
|
changequote([,])dnl
|
||||||
|
])dnl
|
||||||
|
|
||||||
|
dnl ---------------------------------------------------------------------------
|
||||||
|
dnl Got this from the GNU fileutils 3.16r distribution
|
||||||
|
dnl by Paul Eggert <egger@twinsun.com>
|
||||||
|
dnl ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
dnl The problem is that the default compilation flags in Solaris 2.6 won't
|
||||||
|
dnl let programs access large files; you need to tell the compiler that
|
||||||
|
dnl you actually want your programs to work on large files. For more
|
||||||
|
dnl details about this brain damage please see:
|
||||||
|
dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html
|
||||||
|
|
||||||
|
AC_DEFUN(AC_LFS,
|
||||||
|
[dnl
|
||||||
|
# If available, prefer support for large files unless the user specified
|
||||||
|
# one of the CPPFLAGS, LDFLAGS, or LIBS variables.
|
||||||
|
AC_MSG_CHECKING(whether large file support needs explicit enabling)
|
||||||
|
ac_getconfs=''
|
||||||
|
ac_result=yes
|
||||||
|
ac_set=''
|
||||||
|
ac_shellvars='CPPFLAGS LDFLAGS LIBS'
|
||||||
|
for ac_shellvar in $ac_shellvars; do
|
||||||
|
case $ac_shellvar in
|
||||||
|
CPPFLAGS) ac_lfsvar=LFS_CFLAGS ;;
|
||||||
|
*) ac_lfsvar=LFS_$ac_shellvar ;;
|
||||||
|
esac
|
||||||
|
eval test '"${'$ac_shellvar'+set}"' = set && ac_set=$ac_shellvar
|
||||||
|
(getconf $ac_lfsvar) >/dev/null 2>&1 || { ac_result=no; break; }
|
||||||
|
ac_getconf=`getconf $ac_lfsvar`
|
||||||
|
ac_getconfs=$ac_getconfs$ac_getconf
|
||||||
|
eval ac_test_$ac_shellvar=\$ac_getconf
|
||||||
|
done
|
||||||
|
case "$ac_result$ac_getconfs" in
|
||||||
|
yes) ac_result=no ;;
|
||||||
|
esac
|
||||||
|
case "$ac_result$ac_set" in
|
||||||
|
yes?*) ac_result="yes, but $ac_set is already set, so use its settings"
|
||||||
|
esac
|
||||||
|
AC_MSG_RESULT($ac_result)
|
||||||
|
case $ac_result in
|
||||||
|
yes)
|
||||||
|
for ac_shellvar in $ac_shellvars; do
|
||||||
|
eval $ac_shellvar=\$ac_test_$ac_shellvar
|
||||||
|
done ;;
|
||||||
|
esac
|
||||||
|
])
|
||||||
19
aclocal.m4
vendored
19
aclocal.m4
vendored
@@ -1,19 +0,0 @@
|
|||||||
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
|
|
||||||
116
ar.c
116
ar.c
@@ -1,5 +1,5 @@
|
|||||||
/* Interface to `ar' archives for GNU Make.
|
/* Interface to `ar' archives for GNU Make.
|
||||||
Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
|
Copyright (C) 1988,89,90,91,92,93,97 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
|
||||||
@@ -26,9 +26,10 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||||||
|
|
||||||
/* Defined in arscan.c. */
|
/* Defined in arscan.c. */
|
||||||
extern long int ar_scan PARAMS ((char *archive, long int (*function) (), long int arg));
|
extern long int ar_scan PARAMS ((char *archive, long int (*function) (), long int arg));
|
||||||
extern int ar_member_touch PARAMS ((char *arname, char *memname));
|
|
||||||
extern int ar_name_equal PARAMS ((char *name, char *mem, int truncated));
|
extern int ar_name_equal PARAMS ((char *name, char *mem, int truncated));
|
||||||
|
#ifndef VMS
|
||||||
|
extern int ar_member_touch PARAMS ((char *arname, char *memname));
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Return nonzero if NAME is an archive-member reference, zero if not.
|
/* Return nonzero if NAME is an archive-member reference, zero if not.
|
||||||
An archive-member reference is a name like `lib(member)'.
|
An archive-member reference is a name like `lib(member)'.
|
||||||
@@ -40,7 +41,7 @@ ar_name (name)
|
|||||||
char *name;
|
char *name;
|
||||||
{
|
{
|
||||||
char *p = index (name, '('), *end = name + strlen (name) - 1;
|
char *p = index (name, '('), *end = name + strlen (name) - 1;
|
||||||
|
|
||||||
if (p == 0 || p == name || *end != ')')
|
if (p == 0 || p == name || *end != ')')
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@@ -66,111 +67,7 @@ ar_parse_name (name, arname_p, memname_p)
|
|||||||
|
|
||||||
if (memname_p != 0)
|
if (memname_p != 0)
|
||||||
*memname_p = savestring (p + 1, end - (p + 1));
|
*memname_p = savestring (p + 1, end - (p + 1));
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef VMS
|
|
||||||
#include <lbrdef.h>
|
|
||||||
#include <mhddef.h>
|
|
||||||
#include <credef.h>
|
|
||||||
#include <descrip.h>
|
|
||||||
#include <ctype.h>
|
|
||||||
#if __DECC
|
|
||||||
#include <lbr$routines.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define uppercasify(str) {char *str1; for (str1 = str; *str1; str1++) *str1 = _toupper(*str1);}
|
|
||||||
|
|
||||||
#define LBR$_KEYNOTFND 2527330 /* This isn't in any .h file anywhere so I got it from a MACRO library */
|
|
||||||
|
|
||||||
time_t
|
|
||||||
ar_member_date (name)
|
|
||||||
char *name;
|
|
||||||
{
|
|
||||||
static char *arname;
|
|
||||||
static char *memname;
|
|
||||||
char *p,*q;
|
|
||||||
long int val;
|
|
||||||
static struct {
|
|
||||||
struct mhddef mhd;
|
|
||||||
struct credef cre;
|
|
||||||
char garbage[256];
|
|
||||||
} buf;
|
|
||||||
int func=LBR$C_READ,
|
|
||||||
type=LBR$C_TYP_OBJ,
|
|
||||||
rfa[2],
|
|
||||||
lidx,
|
|
||||||
status;
|
|
||||||
$DESCRIPTOR(bufdesc,(char *)&buf);
|
|
||||||
$DESCRIPTOR(libdesc,arname);
|
|
||||||
$DESCRIPTOR(moddesc,memname);
|
|
||||||
|
|
||||||
/* This "file" is an archive member. */
|
|
||||||
p = index (name, '(');
|
|
||||||
arname = savestring (name, p - name);
|
|
||||||
val = strlen (p) - 2;
|
|
||||||
/*
|
|
||||||
if (val > 15)
|
|
||||||
val = 15;
|
|
||||||
*/
|
|
||||||
memname = savestring (p + 1, val);
|
|
||||||
#ifdef OLDWAY
|
|
||||||
p = rindex (memname, ')');
|
|
||||||
if (p != 0) {
|
|
||||||
q = rindex(p,'.');
|
|
||||||
if (q)
|
|
||||||
*q = '\0'; /* to get rid of extension */
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
q = rindex(memname,'.');
|
|
||||||
if (q)
|
|
||||||
*q = '\0'; /* to get rid of extension */
|
|
||||||
|
|
||||||
uppercasify(memname);
|
|
||||||
|
|
||||||
/* Make sure we know the modtime of the archive itself because
|
|
||||||
we are likely to be called just before commands to remake a
|
|
||||||
member are run, and they will change the archive itself. */
|
|
||||||
(void) f_mtime (enter_file (arname));
|
|
||||||
|
|
||||||
libdesc.dsc$a_pointer = arname;
|
|
||||||
libdesc.dsc$w_length = strlen(arname);
|
|
||||||
moddesc.dsc$a_pointer = memname;
|
|
||||||
moddesc.dsc$w_length = strlen(memname);
|
|
||||||
|
|
||||||
if (!((status = lbr$ini_control(&lidx,&func,&type,0)) & 1)) {
|
|
||||||
printf("Error in lbr$ini_control, %d\n",status);
|
|
||||||
return(-1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!((status = lbr$open(&lidx,&libdesc,0,0,0,0,0)) & 1)) {
|
|
||||||
printf("Error opening library %s to lookup member %s, %d\n",arname, memname ,status);
|
|
||||||
return(-1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!((status = lbr$lookup_key(&lidx,&moddesc,rfa)) & 1)) {
|
|
||||||
if (status != LBR$_KEYNOTFND)
|
|
||||||
printf("Error looking up module %s in library %s, %d\n",memname, arname ,status);
|
|
||||||
lbr$close(&lidx);
|
|
||||||
return(-1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!((status = lbr$set_module(&lidx,rfa,&bufdesc,&bufdesc,0)) & 1)) {
|
|
||||||
printf("Error getting module info, %d\n",status);
|
|
||||||
lbr$close(&lidx);
|
|
||||||
return(-1);
|
|
||||||
}
|
|
||||||
|
|
||||||
lbr$close(&lidx);
|
|
||||||
|
|
||||||
val = SHELL$FIX_TIME(&buf.mhd.mhd$l_datim);
|
|
||||||
|
|
||||||
free (arname);
|
|
||||||
free (memname);
|
|
||||||
return (val <= 0 ? (time_t) -1 : (time_t) val);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
static long int ar_member_date_1 PARAMS ((int desc, char *mem, int truncated, long int hdrpos,
|
static long int ar_member_date_1 PARAMS ((int desc, char *mem, int truncated, long int hdrpos,
|
||||||
long int datapos, long int size, long int date, int uid, int gid, int mode, char *name));
|
long int datapos, long int size, long int date, int uid, int gid, int mode, char *name));
|
||||||
@@ -232,13 +129,12 @@ ar_member_date_1 (desc, mem, truncated,
|
|||||||
{
|
{
|
||||||
return ar_name_equal (name, mem, truncated) ? date : 0;
|
return ar_name_equal (name, mem, truncated) ? date : 0;
|
||||||
}
|
}
|
||||||
#endif /* !VMS */
|
|
||||||
|
|
||||||
/* Set the archive-member NAME's modtime to now. */
|
/* Set the archive-member NAME's modtime to now. */
|
||||||
|
|
||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
int
|
int
|
||||||
ar_touch (name)
|
ar_touch (name)
|
||||||
char *name;
|
char *name;
|
||||||
{
|
{
|
||||||
error ("touch archive member is not available on VMS");
|
error ("touch archive member is not available on VMS");
|
||||||
|
|||||||
212
arscan.c
212
arscan.c
@@ -1,19 +1,19 @@
|
|||||||
/* Library function for scanning an archive file.
|
/* Library function for scanning an archive file.
|
||||||
Copyright (C) 1987, 89, 91, 92, 93, 94, 95 Free Software Foundation, Inc.
|
Copyright (C) 1987,89,91,92,93,94,95,97 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
|
||||||
the Free Software Foundation; either version 2, or (at your option)
|
the Free Software Foundation; either version 2, or (at your option)
|
||||||
any later version.
|
any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||||
|
|
||||||
#include "make.h"
|
#include "make.h"
|
||||||
|
|
||||||
@@ -25,6 +25,171 @@
|
|||||||
|
|
||||||
#ifndef NO_ARCHIVES
|
#ifndef NO_ARCHIVES
|
||||||
|
|
||||||
|
#ifdef VMS
|
||||||
|
#include <lbrdef.h>
|
||||||
|
#include <mhddef.h>
|
||||||
|
#include <credef.h>
|
||||||
|
#include <descrip.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
#if __DECC
|
||||||
|
#include <unixlib.h>
|
||||||
|
#include <lbr$routines.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define uppercasify(str) {char *str1; for (str1 = str; *str1; str1++) *str1 = _toupper(*str1);}
|
||||||
|
|
||||||
|
static void *VMS_lib_idx;
|
||||||
|
|
||||||
|
static char *VMS_saved_memname;
|
||||||
|
|
||||||
|
static time_t VMS_member_date;
|
||||||
|
|
||||||
|
static long int (*VMS_function) ();
|
||||||
|
|
||||||
|
static int
|
||||||
|
VMS_get_member_info (module, rfa)
|
||||||
|
struct dsc$descriptor_s *module;
|
||||||
|
unsigned long *rfa;
|
||||||
|
{
|
||||||
|
int status, i;
|
||||||
|
long int fnval;
|
||||||
|
|
||||||
|
time_t val;
|
||||||
|
|
||||||
|
static struct dsc$descriptor_s bufdesc =
|
||||||
|
{ 0, DSC$K_DTYPE_T, DSC$K_CLASS_S, NULL };
|
||||||
|
|
||||||
|
struct mhddef *mhd;
|
||||||
|
char filename[128];
|
||||||
|
|
||||||
|
bufdesc.dsc$a_pointer = filename;
|
||||||
|
bufdesc.dsc$w_length = sizeof (filename);
|
||||||
|
|
||||||
|
status = lbr$set_module (&VMS_lib_idx, rfa, &bufdesc,
|
||||||
|
&bufdesc.dsc$w_length, 0);
|
||||||
|
if (! status)
|
||||||
|
{
|
||||||
|
error ("lbr$set_module failed to extract module info, status = %d",
|
||||||
|
status);
|
||||||
|
|
||||||
|
lbr$close (&VMS_lib_idx);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
mhd = (struct mhddef *) filename;
|
||||||
|
|
||||||
|
val = decc$fix_time (&mhd->mhd$l_datim);
|
||||||
|
|
||||||
|
for (i = 0; i < module->dsc$w_length; i++)
|
||||||
|
filename[i] = _tolower (module->dsc$a_pointer[i]);
|
||||||
|
|
||||||
|
filename[i] = '\0';
|
||||||
|
|
||||||
|
VMS_member_date = (time_t) -1;
|
||||||
|
|
||||||
|
fnval =
|
||||||
|
(*VMS_function) (-1, filename, 0, 0, 0, 0, val, 0, 0, 0,
|
||||||
|
VMS_saved_memname);
|
||||||
|
|
||||||
|
if (fnval)
|
||||||
|
{
|
||||||
|
VMS_member_date = fnval;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Takes three arguments ARCHIVE, FUNCTION and ARG.
|
||||||
|
|
||||||
|
Open the archive named ARCHIVE, find its members one by one,
|
||||||
|
and for each one call FUNCTION with the following arguments:
|
||||||
|
archive file descriptor for reading the data,
|
||||||
|
member name,
|
||||||
|
member name might be truncated flag,
|
||||||
|
member header position in file,
|
||||||
|
member data position in file,
|
||||||
|
member data size,
|
||||||
|
member date,
|
||||||
|
member uid,
|
||||||
|
member gid,
|
||||||
|
member protection mode,
|
||||||
|
ARG.
|
||||||
|
|
||||||
|
NOTE: on VMS systems, only name, date, and arg are meaningful!
|
||||||
|
|
||||||
|
The descriptor is poised to read the data of the member
|
||||||
|
when FUNCTION is called. It does not matter how much
|
||||||
|
data FUNCTION reads.
|
||||||
|
|
||||||
|
If FUNCTION returns nonzero, we immediately return
|
||||||
|
what FUNCTION returned.
|
||||||
|
|
||||||
|
Returns -1 if archive does not exist,
|
||||||
|
Returns -2 if archive has invalid format.
|
||||||
|
Returns 0 if have scanned successfully. */
|
||||||
|
|
||||||
|
long int
|
||||||
|
ar_scan (archive, function, arg)
|
||||||
|
char *archive;
|
||||||
|
long int (*function) ();
|
||||||
|
long int arg;
|
||||||
|
{
|
||||||
|
char *p;
|
||||||
|
|
||||||
|
static struct dsc$descriptor_s libdesc =
|
||||||
|
{ 0, DSC$K_DTYPE_T, DSC$K_CLASS_S, NULL };
|
||||||
|
|
||||||
|
unsigned long func = LBR$C_READ;
|
||||||
|
unsigned long type = LBR$C_TYP_UNK;
|
||||||
|
unsigned long index = 1;
|
||||||
|
|
||||||
|
int status;
|
||||||
|
|
||||||
|
status = lbr$ini_control (&VMS_lib_idx, &func, &type, 0);
|
||||||
|
|
||||||
|
if (! status)
|
||||||
|
{
|
||||||
|
error ("lbr$ini_control failed with status = %d",status);
|
||||||
|
return -2;
|
||||||
|
}
|
||||||
|
|
||||||
|
libdesc.dsc$a_pointer = archive;
|
||||||
|
libdesc.dsc$w_length = strlen (archive);
|
||||||
|
|
||||||
|
status = lbr$open (&VMS_lib_idx, &libdesc, 0, 0, 0, 0, 0);
|
||||||
|
|
||||||
|
if (! status)
|
||||||
|
{
|
||||||
|
error ("unable to open library `%s' to lookup member `%s'",
|
||||||
|
archive, (char *)arg);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
VMS_saved_memname = (char *)arg;
|
||||||
|
|
||||||
|
/* For comparison, delete .obj from arg name. */
|
||||||
|
|
||||||
|
p = rindex (VMS_saved_memname, '.');
|
||||||
|
if (p)
|
||||||
|
*p = '\0';
|
||||||
|
|
||||||
|
VMS_function = function;
|
||||||
|
|
||||||
|
lbr$get_index (&VMS_lib_idx, &index, VMS_get_member_info, 0);
|
||||||
|
|
||||||
|
/* Undo the damage. */
|
||||||
|
if (p)
|
||||||
|
*p = '.';
|
||||||
|
|
||||||
|
lbr$close (&VMS_lib_idx);
|
||||||
|
|
||||||
|
return VMS_member_date > 0 ? VMS_member_date : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#else /* !VMS */
|
||||||
|
|
||||||
/* SCO Unix's compiler defines both of these. */
|
/* SCO Unix's compiler defines both of these. */
|
||||||
#ifdef M_UNIX
|
#ifdef M_UNIX
|
||||||
#undef M_XENIX
|
#undef M_XENIX
|
||||||
@@ -203,7 +368,7 @@ ar_scan (archive, function, arg)
|
|||||||
(void) close (desc);
|
(void) close (desc);
|
||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
|
|
||||||
name[name_len] = 0;
|
name[name_len] = 0;
|
||||||
|
|
||||||
sscanf (member_header.ar_date, "%12ld", &dateval);
|
sscanf (member_header.ar_date, "%12ld", &dateval);
|
||||||
@@ -277,7 +442,7 @@ ar_scan (archive, function, arg)
|
|||||||
&& name[2] == '/')
|
&& name[2] == '/')
|
||||||
{
|
{
|
||||||
int namesize = atoi (name + 3);
|
int namesize = atoi (name + 3);
|
||||||
|
|
||||||
name = (char *) alloca (namesize + 1);
|
name = (char *) alloca (namesize + 1);
|
||||||
nread = read (desc, name, namesize);
|
nread = read (desc, name, namesize);
|
||||||
if (nread != namesize)
|
if (nread != namesize)
|
||||||
@@ -351,7 +516,7 @@ ar_scan (archive, function, arg)
|
|||||||
(void) close (desc);
|
(void) close (desc);
|
||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The names are separated by newlines. Some formats have
|
/* The names are separated by newlines. Some formats have
|
||||||
a trailing slash. Null terminate the strings for
|
a trailing slash. Null terminate the strings for
|
||||||
convenience. */
|
convenience. */
|
||||||
@@ -365,7 +530,7 @@ ar_scan (archive, function, arg)
|
|||||||
clear[-1] = '\0';
|
clear[-1] = '\0';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
is_namemap = 0;
|
is_namemap = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -379,6 +544,7 @@ ar_scan (archive, function, arg)
|
|||||||
close (desc);
|
close (desc);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif /* !VMS */
|
||||||
|
|
||||||
/* Return nonzero iff NAME matches MEM.
|
/* Return nonzero iff NAME matches MEM.
|
||||||
If TRUNCATED is nonzero, MEM may be truncated to
|
If TRUNCATED is nonzero, MEM may be truncated to
|
||||||
@@ -426,7 +592,7 @@ ar_name_equal (name, mem, truncated)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#else /* AIX or APOLLO. */
|
#else /* AIX or APOLLO. */
|
||||||
|
#ifndef VMS
|
||||||
if (truncated)
|
if (truncated)
|
||||||
{
|
{
|
||||||
#ifdef AIAMAG
|
#ifdef AIAMAG
|
||||||
@@ -434,22 +600,21 @@ ar_name_equal (name, mem, truncated)
|
|||||||
abort ();
|
abort ();
|
||||||
#else
|
#else
|
||||||
struct ar_hdr hdr;
|
struct ar_hdr hdr;
|
||||||
return !strncmp (name, mem,
|
|
||||||
sizeof (hdr.ar_name) -
|
|
||||||
#if !defined (__hpux) && !defined (cray)
|
#if !defined (__hpux) && !defined (cray)
|
||||||
1
|
return !strncmp (name, mem, sizeof(hdr.ar_name) - 1);
|
||||||
#else
|
#else
|
||||||
2
|
return !strncmp (name, mem, sizeof(hdr.ar_name) - 2);
|
||||||
#endif /* !__hpux && !cray */
|
#endif /* !__hpux && !cray */
|
||||||
);
|
#endif /* !AIAMAG */
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif /* !VMS */
|
||||||
|
|
||||||
return !strcmp (name, mem);
|
return !strcmp (name, mem);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef VMS
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static long int
|
static long int
|
||||||
ar_member_pos (desc, mem, truncated,
|
ar_member_pos (desc, mem, truncated,
|
||||||
@@ -532,6 +697,7 @@ ar_member_touch (arname, memname)
|
|||||||
errno = i;
|
errno = i;
|
||||||
return -3;
|
return -3;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef TEST
|
#ifdef TEST
|
||||||
|
|
||||||
|
|||||||
69
build.sh.in
69
build.sh.in
@@ -1,69 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# Shell script to build GNU Make in the absence of any `make' program.
|
|
||||||
# @configure_input@
|
|
||||||
|
|
||||||
# Copyright (C) 1993, 1994 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.
|
|
||||||
|
|
||||||
# See Makefile.in for comments describing these variables.
|
|
||||||
|
|
||||||
srcdir='@srcdir@'
|
|
||||||
CC='@CC@'
|
|
||||||
CFLAGS='@CFLAGS@'
|
|
||||||
CPPFLAGS='@CPPFLAGS@'
|
|
||||||
LDFLAGS='@LDFLAGS@'
|
|
||||||
defines='@DEFS@ -DLIBDIR="${libdir}" -DINCLUDEDIR="${includedir}"'
|
|
||||||
ALLOCA='@ALLOCA@'
|
|
||||||
LOADLIBES='@LIBS@'
|
|
||||||
extras='@LIBOBJS@'
|
|
||||||
REMOTE='@REMOTE@'
|
|
||||||
|
|
||||||
# Common prefix for machine-independent installed files.
|
|
||||||
prefix='@prefix@'
|
|
||||||
# Common prefix for machine-dependent installed files.
|
|
||||||
exec_prefix='@exec_prefix@'
|
|
||||||
# Directory to find libraries in for `-lXXX'.
|
|
||||||
libdir=${exec_prefix}/lib
|
|
||||||
# Directory to search by default for included makefiles.
|
|
||||||
includedir=${prefix}/include
|
|
||||||
|
|
||||||
# Exit as soon as any command fails.
|
|
||||||
set -e
|
|
||||||
|
|
||||||
# These are all the objects we need to link together.
|
|
||||||
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 getopt.o getopt1.o glob/libglob.a glob/glob.o glob/fnmatch.o remote-${REMOTE}.o ${extras} ${ALLOCA}"
|
|
||||||
|
|
||||||
# Compile the source files into those objects.
|
|
||||||
for file in `echo ${objs} | sed 's/\.o/.c/g'`; do
|
|
||||||
echo compiling ${file}...
|
|
||||||
$CC $defines $CPPFLAGS $CFLAGS \
|
|
||||||
-c -I. -I${srcdir} -I${srcdir}/glob ${srcdir}/$file
|
|
||||||
done
|
|
||||||
|
|
||||||
# The object files were actually all put in the current directory.
|
|
||||||
# Remove the source directory names from the list.
|
|
||||||
srcobjs="$objs"
|
|
||||||
objs=
|
|
||||||
for obj in $srcobjs; do
|
|
||||||
objs="$objs `basename $obj`"
|
|
||||||
done
|
|
||||||
|
|
||||||
# Link all the objects together.
|
|
||||||
echo linking make...
|
|
||||||
$CC $LDFLAGS $objs $LOADLIBES -o make.new
|
|
||||||
echo done
|
|
||||||
mv -f make.new make
|
|
||||||
@@ -2,9 +2,9 @@
|
|||||||
# 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@
|
# @configure_input@
|
||||||
|
|
||||||
# Copyright (C) 1993, 1994 Free Software Foundation, Inc.
|
# Copyright (C) 1993, 1994, 1997 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
|
||||||
# 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
|
||||||
# the Free Software Foundation; either version 2, or (at your option)
|
# the Free Software Foundation; either version 2, or (at your option)
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with GNU Make; see the file COPYING. If not, write to
|
# along with GNU Make; see the file COPYING. If not, write to
|
||||||
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
|||||||
273
build_w32.bat
273
build_w32.bat
@@ -1,136 +1,137 @@
|
|||||||
cd w32\subproc
|
set make=gnumake
|
||||||
echo "Creating the subproc library"
|
cd w32\subproc
|
||||||
%ComSpec% /c build.bat
|
echo "Creating the subproc library"
|
||||||
cd ..\..
|
%ComSpec% /c build.bat
|
||||||
del link.dbg link.rel
|
cd ..\..
|
||||||
del config.h
|
del link.dbg link.rel
|
||||||
copy config.h.WIN32 config.h
|
del config.h
|
||||||
echo off
|
copy config.h.W32 config.h
|
||||||
echo "Creating GNU make 3.74 for Windows NT"
|
echo off
|
||||||
echo on
|
echo "Creating GNU make for Windows 95/NT"
|
||||||
if not exist .\WinDebug\nul mkdir .\WinDebug
|
echo on
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D TIVOLI /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c variable.c
|
if not exist .\WinDebug\nul mkdir .\WinDebug
|
||||||
echo WinDebug\variable.obj >>link.dbg
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D TIVOLI /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c variable.c
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c rule.c
|
echo WinDebug\variable.obj >>link.dbg
|
||||||
echo WinDebug\rule.obj >>link.dbg
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c rule.c
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c remote-stub.c
|
echo WinDebug\rule.obj >>link.dbg
|
||||||
echo WinDebug\remote-stub.obj >>link.dbg
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c remote-stub.c
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c commands.c
|
echo WinDebug\remote-stub.obj >>link.dbg
|
||||||
echo WinDebug\commands.obj >>link.dbg
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c commands.c
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c file.c
|
echo WinDebug\commands.obj >>link.dbg
|
||||||
echo WinDebug\file.obj >>link.dbg
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c file.c
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c getloadavg.c
|
echo WinDebug\file.obj >>link.dbg
|
||||||
echo WinDebug\getloadavg.obj >>link.dbg
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c getloadavg.c
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c default.c
|
echo WinDebug\getloadavg.obj >>link.dbg
|
||||||
echo WinDebug\default.obj >>link.dbg
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c default.c
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c signame.c
|
echo WinDebug\default.obj >>link.dbg
|
||||||
echo WinDebug\signame.obj >>link.dbg
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c signame.c
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c expand.c
|
echo WinDebug\signame.obj >>link.dbg
|
||||||
echo WinDebug\expand.obj >>link.dbg
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c expand.c
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c dir.c
|
echo WinDebug\expand.obj >>link.dbg
|
||||||
echo WinDebug\dir.obj >>link.dbg
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c dir.c
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c main.c
|
echo WinDebug\dir.obj >>link.dbg
|
||||||
echo WinDebug\main.obj >>link.dbg
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c main.c
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c getopt1.c
|
echo WinDebug\main.obj >>link.dbg
|
||||||
echo WinDebug\getopt1.obj >>link.dbg
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c getopt1.c
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c job.c
|
echo WinDebug\getopt1.obj >>link.dbg
|
||||||
echo WinDebug\job.obj >>link.dbg
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c job.c
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c read.c
|
echo WinDebug\job.obj >>link.dbg
|
||||||
echo WinDebug\read.obj >>link.dbg
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c read.c
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c version.c
|
echo WinDebug\read.obj >>link.dbg
|
||||||
echo WinDebug\version.obj >>link.dbg
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c version.c
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c getopt.c
|
echo WinDebug\version.obj >>link.dbg
|
||||||
echo WinDebug\getopt.obj >>link.dbg
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c getopt.c
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c arscan.c
|
echo WinDebug\getopt.obj >>link.dbg
|
||||||
echo WinDebug\arscan.obj >>link.dbg
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c arscan.c
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c remake.c
|
echo WinDebug\arscan.obj >>link.dbg
|
||||||
echo WinDebug\remake.obj >>link.dbg
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c remake.c
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c misc.c
|
echo WinDebug\remake.obj >>link.dbg
|
||||||
echo WinDebug\misc.obj >>link.dbg
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c misc.c
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c ar.c
|
echo WinDebug\misc.obj >>link.dbg
|
||||||
echo WinDebug\ar.obj >>link.dbg
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c ar.c
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c function.c
|
echo WinDebug\ar.obj >>link.dbg
|
||||||
echo WinDebug\function.obj >>link.dbg
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c function.c
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c vpath.c
|
echo WinDebug\function.obj >>link.dbg
|
||||||
echo WinDebug\vpath.obj >>link.dbg
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c vpath.c
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c implicit.c
|
echo WinDebug\vpath.obj >>link.dbg
|
||||||
echo WinDebug\implicit.obj >>link.dbg
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c implicit.c
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c .\w32\compat\dirent.c
|
echo WinDebug\implicit.obj >>link.dbg
|
||||||
echo WinDebug\dirent.obj >>link.dbg
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c .\w32\compat\dirent.c
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c .\glob\glob.c
|
echo WinDebug\dirent.obj >>link.dbg
|
||||||
echo WinDebug\glob.obj >>link.dbg
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c .\glob\glob.c
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c .\glob\fnmatch.c
|
echo WinDebug\glob.obj >>link.dbg
|
||||||
echo WinDebug\fnmatch.obj >>link.dbg
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c .\glob\fnmatch.c
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c .\w32\pathstuff.c
|
echo WinDebug\fnmatch.obj >>link.dbg
|
||||||
echo WinDebug\pathstuff.obj >>link.dbg
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c .\w32\pathstuff.c
|
||||||
echo off
|
echo WinDebug\pathstuff.obj >>link.dbg
|
||||||
echo "Linking WinDebug/make374.exe"
|
echo off
|
||||||
rem link.exe kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\windebug\subproc.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /PDB:.\WinDebug/make374.pdb /DEBUG /MACHINE:I386 /OUT:.\WinDebug/make374.exe .\WinDebug/variable.obj .\WinDebug/rule.obj .\WinDebug/remote-stub.obj .\WinDebug/commands.obj .\WinDebug/file.obj .\WinDebug/getloadavg.obj .\WinDebug/default.obj .\WinDebug/signame.obj .\WinDebug/expand.obj .\WinDebug/dir.obj .\WinDebug/main.obj .\WinDebug/getopt1.obj .\WinDebug/job.obj .\WinDebug/read.obj .\WinDebug/version.obj .\WinDebug/getopt.obj .\WinDebug/arscan.obj .\WinDebug/remake.obj .\WinDebug/misc.obj .\WinDebug/ar.obj .\WinDebug/function.obj .\WinDebug/vpath.obj .\WinDebug/implicit.obj .\WinDebug/dirent.obj .\WinDebug/glob.obj .\WinDebug/fnmatch.obj .\WinDebug/pathstuff.obj
|
echo "Linking WinDebug/%make%.exe"
|
||||||
echo kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\windebug\subproc.lib >>link.dbg
|
rem link.exe kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\windebug\subproc.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /PDB:.\WinDebug/%make%.pdb /DEBUG /MACHINE:I386 /OUT:.\WinDebug/%make%.exe .\WinDebug/variable.obj .\WinDebug/rule.obj .\WinDebug/remote-stub.obj .\WinDebug/commands.obj .\WinDebug/file.obj .\WinDebug/getloadavg.obj .\WinDebug/default.obj .\WinDebug/signame.obj .\WinDebug/expand.obj .\WinDebug/dir.obj .\WinDebug/main.obj .\WinDebug/getopt1.obj .\WinDebug/job.obj .\WinDebug/read.obj .\WinDebug/version.obj .\WinDebug/getopt.obj .\WinDebug/arscan.obj .\WinDebug/remake.obj .\WinDebug/misc.obj .\WinDebug/ar.obj .\WinDebug/function.obj .\WinDebug/vpath.obj .\WinDebug/implicit.obj .\WinDebug/dirent.obj .\WinDebug/glob.obj .\WinDebug/fnmatch.obj .\WinDebug/pathstuff.obj
|
||||||
link.exe /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /PDB:.\WinDebug/make374.pdb /DEBUG /MACHINE:I386 /OUT:.\WinDebug/make374.exe @link.dbg
|
echo kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\windebug\subproc.lib >>link.dbg
|
||||||
if not exist .\WinDebug/make374.exe echo "WinDebug build failed"
|
link.exe /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /PDB:.\WinDebug/%make%.pdb /DEBUG /MACHINE:I386 /OUT:.\WinDebug/%make%.exe @link.dbg
|
||||||
if exist .\WinDebug/make374.exe echo "WinDebug build succeeded!"
|
if not exist .\WinDebug/%make%.exe echo "WinDebug build failed"
|
||||||
if not exist .\WinRel\nul mkdir .\WinRel
|
if exist .\WinDebug/%make%.exe echo "WinDebug build succeeded!"
|
||||||
echo on
|
if not exist .\WinRel\nul mkdir .\WinRel
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /D TIVOLI /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c variable.c
|
echo on
|
||||||
echo WinRel\variable.obj >>link.rel
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /D TIVOLI /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c variable.c
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c rule.c
|
echo WinRel\variable.obj >>link.rel
|
||||||
echo WinRel\rule.obj >>link.rel
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c rule.c
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c remote-stub.c
|
echo WinRel\rule.obj >>link.rel
|
||||||
echo WinRel\remote-stub.obj >>link.rel
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c remote-stub.c
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c commands.c
|
echo WinRel\remote-stub.obj >>link.rel
|
||||||
echo WinRel\commands.obj >>link.rel
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c commands.c
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c file.c
|
echo WinRel\commands.obj >>link.rel
|
||||||
echo WinRel\file.obj >>link.rel
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c file.c
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c getloadavg.c
|
echo WinRel\file.obj >>link.rel
|
||||||
echo WinRel\getloadavg.obj >>link.rel
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c getloadavg.c
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c default.c
|
echo WinRel\getloadavg.obj >>link.rel
|
||||||
echo WinRel\default.obj >>link.rel
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c default.c
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c signame.c
|
echo WinRel\default.obj >>link.rel
|
||||||
echo WinRel\signame.obj >>link.rel
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c signame.c
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c expand.c
|
echo WinRel\signame.obj >>link.rel
|
||||||
echo WinRel\expand.obj >>link.rel
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c expand.c
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c dir.c
|
echo WinRel\expand.obj >>link.rel
|
||||||
echo WinRel\dir.obj >>link.rel
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c dir.c
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c main.c
|
echo WinRel\dir.obj >>link.rel
|
||||||
echo WinRel\main.obj >>link.rel
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c main.c
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c getopt1.c
|
echo WinRel\main.obj >>link.rel
|
||||||
echo WinRel\getopt1.obj >>link.rel
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c getopt1.c
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c job.c
|
echo WinRel\getopt1.obj >>link.rel
|
||||||
echo WinRel\job.obj >>link.rel
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c job.c
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c read.c
|
echo WinRel\job.obj >>link.rel
|
||||||
echo WinRel\read.obj >>link.rel
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c read.c
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c version.c
|
echo WinRel\read.obj >>link.rel
|
||||||
echo WinRel\version.obj >>link.rel
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c version.c
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c getopt.c
|
echo WinRel\version.obj >>link.rel
|
||||||
echo WinRel\getopt.obj >>link.rel
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c getopt.c
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c arscan.c
|
echo WinRel\getopt.obj >>link.rel
|
||||||
echo WinRel\arscan.obj >>link.rel
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c arscan.c
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c remake.c
|
echo WinRel\arscan.obj >>link.rel
|
||||||
echo WinRel\remake.obj >>link.rel
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c remake.c
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c misc.c
|
echo WinRel\remake.obj >>link.rel
|
||||||
echo WinRel\misc.obj >>link.rel
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c misc.c
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c ar.c
|
echo WinRel\misc.obj >>link.rel
|
||||||
echo WinRel\ar.obj >>link.rel
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c ar.c
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c function.c
|
echo WinRel\ar.obj >>link.rel
|
||||||
echo WinRel\function.obj >>link.rel
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c function.c
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c vpath.c
|
echo WinRel\function.obj >>link.rel
|
||||||
echo WinRel\vpath.obj >>link.rel
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c vpath.c
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c implicit.c
|
echo WinRel\vpath.obj >>link.rel
|
||||||
echo WinRel\implicit.obj >>link.rel
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c implicit.c
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c .\w32\compat\dirent.c
|
echo WinRel\implicit.obj >>link.rel
|
||||||
echo WinRel\dirent.obj >>link.rel
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c .\w32\compat\dirent.c
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c .\glob\glob.c
|
echo WinRel\dirent.obj >>link.rel
|
||||||
echo WinRel\glob.obj >>link.rel
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c .\glob\glob.c
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c .\glob\fnmatch.c
|
echo WinRel\glob.obj >>link.rel
|
||||||
echo WinRel\fnmatch.obj >>link.rel
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c .\glob\fnmatch.c
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c .\w32\pathstuff.c
|
echo WinRel\fnmatch.obj >>link.rel
|
||||||
echo WinRel\pathstuff.obj >>link.rel
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c .\w32\pathstuff.c
|
||||||
echo off
|
echo WinRel\pathstuff.obj >>link.rel
|
||||||
echo "Linking WinRel/make374.exe"
|
echo off
|
||||||
rem link.exe kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\winrel\subproc.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:no /PDB:.\WinRel/make374.pdb /MACHINE:I386 /OUT:.\WinRel/make374.exe .\WinRel/variable.obj .\WinRel/rule.obj .\WinRel/remote-stub.obj .\WinRel/commands.obj .\WinRel/file.obj .\WinRel/getloadavg.obj .\WinRel/default.obj .\WinRel/signame.obj .\WinRel/expand.obj .\WinRel/dir.obj .\WinRel/main.obj .\WinRel/getopt1.obj .\WinRel/job.obj .\WinRel/read.obj .\WinRel/version.obj .\WinRel/getopt.obj .\WinRel/arscan.obj .\WinRel/remake.obj .\WinRel/misc.obj .\WinRel/ar.obj .\WinRel/function.obj .\WinRel/vpath.obj .\WinRel/implicit.obj .\WinRel/dirent.obj .\WinRel/glob.obj .\WinRel/fnmatch.obj .\WinRel/pathstuff.obj
|
echo "Linking WinRel/%make%.exe"
|
||||||
echo kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\winrel\subproc.lib >>link.rel
|
rem link.exe kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\winrel\subproc.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:no /PDB:.\WinRel/%make%.pdb /MACHINE:I386 /OUT:.\WinRel/%make%.exe .\WinRel/variable.obj .\WinRel/rule.obj .\WinRel/remote-stub.obj .\WinRel/commands.obj .\WinRel/file.obj .\WinRel/getloadavg.obj .\WinRel/default.obj .\WinRel/signame.obj .\WinRel/expand.obj .\WinRel/dir.obj .\WinRel/main.obj .\WinRel/getopt1.obj .\WinRel/job.obj .\WinRel/read.obj .\WinRel/version.obj .\WinRel/getopt.obj .\WinRel/arscan.obj .\WinRel/remake.obj .\WinRel/misc.obj .\WinRel/ar.obj .\WinRel/function.obj .\WinRel/vpath.obj .\WinRel/implicit.obj .\WinRel/dirent.obj .\WinRel/glob.obj .\WinRel/fnmatch.obj .\WinRel/pathstuff.obj
|
||||||
link.exe /NOLOGO /SUBSYSTEM:console /INCREMENTAL:no /PDB:.\WinRel/make374.pdb /MACHINE:I386 /OUT:.\WinRel/make374.exe @link.rel
|
echo kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\winrel\subproc.lib >>link.rel
|
||||||
if not exist .\WinRel/make374.exe echo "WinRel build failed"
|
link.exe /NOLOGO /SUBSYSTEM:console /INCREMENTAL:no /PDB:.\WinRel/%make%.pdb /MACHINE:I386 /OUT:.\WinRel/%make%.exe @link.rel
|
||||||
if exist .\WinRel/make374.exe echo "WinRel build succeeded!"
|
if not exist .\WinRel/%make%.exe echo "WinRel build failed"
|
||||||
echo on
|
if exist .\WinRel/%make%.exe echo "WinRel build succeeded!"
|
||||||
|
echo on
|
||||||
|
|||||||
23
commands.c
23
commands.c
@@ -1,5 +1,5 @@
|
|||||||
/* Command processing for GNU Make.
|
/* Command processing for GNU Make.
|
||||||
Copyright (C) 1988, 89, 91, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
|
Copyright (C) 1988,89,91,92,93,94,95,96,97 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
|
||||||
@@ -369,17 +369,25 @@ RETSIGTYPE
|
|||||||
fatal_error_signal (sig)
|
fatal_error_signal (sig)
|
||||||
int sig;
|
int sig;
|
||||||
{
|
{
|
||||||
#if defined(__MSDOS__) || defined(_AMIGA)
|
#ifdef __MSDOS__
|
||||||
|
extern int dos_status, dos_command_running;
|
||||||
|
|
||||||
|
if (dos_command_running)
|
||||||
|
{
|
||||||
|
/* That was the child who got the signal, not us. */
|
||||||
|
dos_status |= (sig << 8);
|
||||||
|
return;
|
||||||
|
}
|
||||||
remove_intermediates (1);
|
remove_intermediates (1);
|
||||||
|
exit (1);
|
||||||
|
#else /* not __MSDOS__ */
|
||||||
#ifdef _AMIGA
|
#ifdef _AMIGA
|
||||||
|
remove_intermediates (1);
|
||||||
if (sig == SIGINT)
|
if (sig == SIGINT)
|
||||||
fputs ("*** Break.\n", stderr);
|
fputs ("*** Break.\n", stderr);
|
||||||
|
|
||||||
exit (10);
|
exit (10);
|
||||||
#else
|
#else /* not Amiga */
|
||||||
exit (1);
|
|
||||||
#endif
|
|
||||||
#else /* Not MSDOS. */
|
|
||||||
handling_fatal_signal = 1;
|
handling_fatal_signal = 1;
|
||||||
|
|
||||||
/* Set the handling for this signal to the default.
|
/* Set the handling for this signal to the default.
|
||||||
@@ -445,7 +453,8 @@ fatal_error_signal (sig)
|
|||||||
will be unblocked when we return and arrive then to kill us. */
|
will be unblocked when we return and arrive then to kill us. */
|
||||||
if (kill (getpid (), sig) < 0)
|
if (kill (getpid (), sig) < 0)
|
||||||
pfatal_with_name ("kill");
|
pfatal_with_name ("kill");
|
||||||
#endif /* MSDOS. */
|
#endif /* not Amiga */
|
||||||
|
#endif /* not __MSDOS__ */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Delete FILE unless it's precious or not actually a file (phony),
|
/* Delete FILE unless it's precious or not actually a file (phony),
|
||||||
|
|||||||
272
compatMakefile
272
compatMakefile
@@ -1,272 +0,0 @@
|
|||||||
# 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,95,96 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 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 \
|
|
||||||
getopt.o getopt1.o glob/libglob.a \
|
|
||||||
$(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 \
|
|
||||||
$(srcdir)/getopt.c $(srcdir)/getopt1.c $(srcdir)/getopt.h \
|
|
||||||
$(srcdir)/commands.h $(srcdir)/dep.h $(srcdir)/filedef.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
|
|
||||||
MAKE = 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 \
|
|
||||||
if [ -r ./make.info ]; then dir=.; else dir=$(srcdir); fi; \
|
|
||||||
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.
|
|
||||||
|
|
||||||
@@ -32,6 +32,9 @@
|
|||||||
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
|
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
|
||||||
#undef HAVE_ALLOCA_H
|
#undef HAVE_ALLOCA_H
|
||||||
|
|
||||||
|
/* Define if you have the memmove function. */
|
||||||
|
#define HAVE_MEMMOVE 1
|
||||||
|
|
||||||
/* Define if you don't have vprintf but do have _doprnt. */
|
/* Define if you don't have vprintf but do have _doprnt. */
|
||||||
#undef HAVE_DOPRNT
|
#undef HAVE_DOPRNT
|
||||||
|
|
||||||
@@ -159,6 +162,12 @@
|
|||||||
/* Define vfork as fork if vfork does not work. */
|
/* Define vfork as fork if vfork does not work. */
|
||||||
#undef vfork
|
#undef vfork
|
||||||
|
|
||||||
|
/* Name of this package (needed by automake) */
|
||||||
|
#define PACKAGE "%PACKAGE%"
|
||||||
|
|
||||||
|
/* Version of this package (needed by automake) */
|
||||||
|
#define VERSION "%VERSION%"
|
||||||
|
|
||||||
/* Define to the name of the SCCS `get' command. */
|
/* Define to the name of the SCCS `get' command. */
|
||||||
#define SCCS_GET "get"
|
#define SCCS_GET "get"
|
||||||
|
|
||||||
@@ -269,3 +278,6 @@
|
|||||||
|
|
||||||
/* Define if you have the sun library (-lsun). */
|
/* Define if you have the sun library (-lsun). */
|
||||||
#undef HAVE_LIBSUN
|
#undef HAVE_LIBSUN
|
||||||
|
|
||||||
|
/* Define for Case Insensitve behavior */
|
||||||
|
#define HAVE_CASE_INSENSITIVE_FS
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* config.h-vms. Generated by hand by Klaus Kämpf <kkaempf@didymus.rmi.de> */
|
/* config.h-vms. Generated by hand by Klaus Kämpf <kkaempf@progis.de> */
|
||||||
/* config.h. Generated automatically by configure. */
|
/* config.h. Generated automatically by configure. */
|
||||||
/* config.h.in. Generated automatically from configure.in by autoheader. */
|
/* config.h.in. Generated automatically from configure.in by autoheader. */
|
||||||
|
|
||||||
@@ -34,6 +34,9 @@
|
|||||||
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
|
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
|
||||||
/* #undef HAVE_ALLOCA_H 1 */
|
/* #undef HAVE_ALLOCA_H 1 */
|
||||||
|
|
||||||
|
/* Define if you have the memmove function. */
|
||||||
|
#define HAVE_MEMMOVE 1
|
||||||
|
|
||||||
/* Define if you don't have vprintf but do have _doprnt. */
|
/* Define if you don't have vprintf but do have _doprnt. */
|
||||||
/* #undef HAVE_DOPRNT */
|
/* #undef HAVE_DOPRNT */
|
||||||
|
|
||||||
@@ -111,7 +114,7 @@
|
|||||||
/* #undef NO_MINUS_C_MINUS_O */
|
/* #undef NO_MINUS_C_MINUS_O */
|
||||||
|
|
||||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||||
#define pid_t int
|
/* #undef pid_t */
|
||||||
|
|
||||||
/* Define if the system does not provide POSIX.1 features except
|
/* Define if the system does not provide POSIX.1 features except
|
||||||
with this defined. */
|
with this defined. */
|
||||||
@@ -150,7 +153,7 @@
|
|||||||
/* #undef SYS_SIGLIST_DECLARED */
|
/* #undef SYS_SIGLIST_DECLARED */
|
||||||
|
|
||||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||||
#define uid_t int
|
/* #undef uid_t */
|
||||||
|
|
||||||
/* Define for Encore UMAX. */
|
/* Define for Encore UMAX. */
|
||||||
/* #undef UMAX */
|
/* #undef UMAX */
|
||||||
@@ -159,6 +162,12 @@
|
|||||||
instead of <sys/cpustats.h>. */
|
instead of <sys/cpustats.h>. */
|
||||||
/* #undef UMAX4_3 */
|
/* #undef UMAX4_3 */
|
||||||
|
|
||||||
|
/* Name of this package (needed by automake) */
|
||||||
|
#define PACKAGE "%PACKAGE%"
|
||||||
|
|
||||||
|
/* Version of this package (needed by automake) */
|
||||||
|
#define VERSION "%VERSION%"
|
||||||
|
|
||||||
/* Define vfork as fork if vfork does not work. */
|
/* Define vfork as fork if vfork does not work. */
|
||||||
/* #undef vfork */
|
/* #undef vfork */
|
||||||
|
|
||||||
@@ -287,6 +296,6 @@
|
|||||||
#define PARAMS(protos) protos
|
#define PARAMS(protos) protos
|
||||||
#else /* Not C++ or ANSI C. */
|
#else /* Not C++ or ANSI C. */
|
||||||
#undef PARAMS
|
#undef PARAMS
|
||||||
#define PARAMS(protos) ()
|
#define PARAMS(protos) ()
|
||||||
#endif /* C++ or ANSI C. */
|
#endif /* C++ or ANSI C. */
|
||||||
|
|
||||||
|
|||||||
@@ -29,11 +29,15 @@
|
|||||||
|
|
||||||
/* Define if you have alloca, as a function or macro. */
|
/* Define if you have alloca, as a function or macro. */
|
||||||
#undef HAVE_ALLOCA
|
#undef HAVE_ALLOCA
|
||||||
#define HAVE_ALLOCA
|
#define HAVE_ALLOCA 1
|
||||||
|
|
||||||
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
|
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
|
||||||
#undef HAVE_ALLOCA_H
|
#undef HAVE_ALLOCA_H
|
||||||
|
|
||||||
|
/* Define if you have the memmove function. */
|
||||||
|
#undef HAVE_MEMMOVE
|
||||||
|
#define HAVE_MEMMOVE 1
|
||||||
|
|
||||||
/* Define if you don't have vprintf but do have _doprnt. */
|
/* Define if you don't have vprintf but do have _doprnt. */
|
||||||
#undef HAVE_DOPRNT
|
#undef HAVE_DOPRNT
|
||||||
|
|
||||||
@@ -48,7 +52,7 @@
|
|||||||
|
|
||||||
/* Define if you support file names longer than 14 characters. */
|
/* Define if you support file names longer than 14 characters. */
|
||||||
#undef HAVE_LONG_FILE_NAMES
|
#undef HAVE_LONG_FILE_NAMES
|
||||||
#define HAVE_LONG_FILE_NAMES
|
#define HAVE_LONG_FILE_NAMES 1
|
||||||
|
|
||||||
/* Define if you have a working `mmap' system call. */
|
/* Define if you have a working `mmap' system call. */
|
||||||
#undef HAVE_MMAP
|
#undef HAVE_MMAP
|
||||||
@@ -65,15 +69,15 @@
|
|||||||
|
|
||||||
/* Define if you have the strcoll function and it is properly defined. */
|
/* Define if you have the strcoll function and it is properly defined. */
|
||||||
#undef HAVE_STRCOLL
|
#undef HAVE_STRCOLL
|
||||||
#define HAVE_STRCOLL
|
#define HAVE_STRCOLL 1
|
||||||
|
|
||||||
/* Define if your struct stat has st_rdev. */
|
/* Define if your struct stat has st_rdev. */
|
||||||
#undef HAVE_ST_RDEV
|
#undef HAVE_ST_RDEV
|
||||||
#define HAVE_ST_RDEV
|
#define HAVE_ST_RDEV 1
|
||||||
|
|
||||||
/* Define if you have the strftime function. */
|
/* Define if you have the strftime function. */
|
||||||
#undef HAVE_STRFTIME
|
#undef HAVE_STRFTIME
|
||||||
#define HAVE_STRFTIME
|
#define HAVE_STRFTIME 1
|
||||||
|
|
||||||
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
|
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
|
||||||
#undef HAVE_SYS_WAIT_H
|
#undef HAVE_SYS_WAIT_H
|
||||||
@@ -84,21 +88,21 @@
|
|||||||
/* Define if you don't have tm_zone but do have the external array
|
/* Define if you don't have tm_zone but do have the external array
|
||||||
tzname. */
|
tzname. */
|
||||||
#undef HAVE_TZNAME
|
#undef HAVE_TZNAME
|
||||||
#define HAVE_TZNAME
|
#define HAVE_TZNAME 1
|
||||||
|
|
||||||
/* Define if you have <unistd.h>. */
|
/* Define if you have <unistd.h>. */
|
||||||
#undef HAVE_UNISTD_H
|
#undef HAVE_UNISTD_H
|
||||||
|
|
||||||
/* Define if utime(file, NULL) sets file's timestamp to the present. */
|
/* Define if utime(file, NULL) sets file's timestamp to the present. */
|
||||||
#undef HAVE_UTIME_NULL
|
#undef HAVE_UTIME_NULL
|
||||||
#define HAVE_UTIME_NULL
|
#define HAVE_UTIME_NULL 1
|
||||||
|
|
||||||
/* Define if you have <vfork.h>. */
|
/* Define if you have <vfork.h>. */
|
||||||
#undef HAVE_VFORK_H
|
#undef HAVE_VFORK_H
|
||||||
|
|
||||||
/* Define if you have the vprintf function. */
|
/* Define if you have the vprintf function. */
|
||||||
#undef HAVE_VPRINTF
|
#undef HAVE_VPRINTF
|
||||||
#define HAVE_VPRINTF
|
#define HAVE_VPRINTF 1
|
||||||
|
|
||||||
/* Define if you have the wait3 system call. */
|
/* Define if you have the wait3 system call. */
|
||||||
#undef HAVE_WAIT3
|
#undef HAVE_WAIT3
|
||||||
@@ -125,7 +129,7 @@
|
|||||||
|
|
||||||
/* Define if you need to in order for stat and other things to work. */
|
/* Define if you need to in order for stat and other things to work. */
|
||||||
#undef _POSIX_SOURCE
|
#undef _POSIX_SOURCE
|
||||||
#define _POSIX_SOURCE
|
#define _POSIX_SOURCE 1
|
||||||
|
|
||||||
/* Define as the return type of signal handlers (int or void). */
|
/* Define as the return type of signal handlers (int or void). */
|
||||||
#undef RETSIGTYPE
|
#undef RETSIGTYPE
|
||||||
@@ -150,7 +154,7 @@
|
|||||||
|
|
||||||
/* Define if you have the ANSI C header files. */
|
/* Define if you have the ANSI C header files. */
|
||||||
#undef STDC_HEADERS
|
#undef STDC_HEADERS
|
||||||
#define STDC_HEADERS
|
#define STDC_HEADERS 1
|
||||||
|
|
||||||
/* Define on System V Release 4. */
|
/* Define on System V Release 4. */
|
||||||
#undef SVR4
|
#undef SVR4
|
||||||
@@ -172,6 +176,12 @@
|
|||||||
/* Define vfork as fork if vfork does not work. */
|
/* Define vfork as fork if vfork does not work. */
|
||||||
#undef vfork
|
#undef vfork
|
||||||
|
|
||||||
|
/* Name of this package (needed by automake) */
|
||||||
|
#define PACKAGE "%PACKAGE%"
|
||||||
|
|
||||||
|
/* Version of this package (needed by automake) */
|
||||||
|
#define VERSION "%VERSION%"
|
||||||
|
|
||||||
/* Define to the name of the SCCS `get' command. */
|
/* Define to the name of the SCCS `get' command. */
|
||||||
#undef SCCS_GET
|
#undef SCCS_GET
|
||||||
#define SCCS_GET "echo no sccs get"
|
#define SCCS_GET "echo no sccs get"
|
||||||
@@ -190,18 +200,18 @@
|
|||||||
|
|
||||||
/* Define if you have the dup2 function. */
|
/* Define if you have the dup2 function. */
|
||||||
#undef HAVE_DUP2
|
#undef HAVE_DUP2
|
||||||
#define HAVE_DUP2
|
#define HAVE_DUP2 1
|
||||||
|
|
||||||
/* Define if you have the getcwd function. */
|
/* Define if you have the getcwd function. */
|
||||||
#undef HAVE_GETCWD
|
#undef HAVE_GETCWD
|
||||||
#define HAVE_GETCWD
|
#define HAVE_GETCWD 1
|
||||||
|
|
||||||
/* Define if you have the getgroups function. */
|
/* Define if you have the getgroups function. */
|
||||||
#undef HAVE_GETGROUPS
|
#undef HAVE_GETGROUPS
|
||||||
|
|
||||||
/* Define if you have the mktemp function. */
|
/* Define if you have the mktemp function. */
|
||||||
#undef HAVE_MKTEMP
|
#undef HAVE_MKTEMP
|
||||||
#define HAVE_MKTEMP
|
#define HAVE_MKTEMP 1
|
||||||
|
|
||||||
/* Define if you have the psignal function. */
|
/* Define if you have the psignal function. */
|
||||||
#undef HAVE_PSIGNAL
|
#undef HAVE_PSIGNAL
|
||||||
@@ -226,7 +236,7 @@
|
|||||||
|
|
||||||
/* Define if you have the strerror function. */
|
/* Define if you have the strerror function. */
|
||||||
#undef HAVE_STRERROR
|
#undef HAVE_STRERROR
|
||||||
#define HAVE_STRERROR
|
#define HAVE_STRERROR 1
|
||||||
|
|
||||||
/* Define if you have the strsignal function. */
|
/* Define if you have the strsignal function. */
|
||||||
#undef HAVE_STRSIGNAL
|
#undef HAVE_STRSIGNAL
|
||||||
@@ -239,29 +249,29 @@
|
|||||||
|
|
||||||
/* Define if you have the <dirent.h> header file. */
|
/* Define if you have the <dirent.h> header file. */
|
||||||
#undef HAVE_DIRENT_H
|
#undef HAVE_DIRENT_H
|
||||||
#define HAVE_DIRENT_H
|
#define HAVE_DIRENT_H 1
|
||||||
|
|
||||||
/* Define if you have the <fcntl.h> header file. */
|
/* Define if you have the <fcntl.h> header file. */
|
||||||
#undef HAVE_FCNTL_H
|
#undef HAVE_FCNTL_H
|
||||||
#define HAVE_FCNTL_H
|
#define HAVE_FCNTL_H 1
|
||||||
|
|
||||||
/* Define if you have the <limits.h> header file. */
|
/* Define if you have the <limits.h> header file. */
|
||||||
#undef HAVE_LIMITS_H
|
#undef HAVE_LIMITS_H
|
||||||
#define HAVE_LIMITS_H
|
#define HAVE_LIMITS_H 1
|
||||||
|
|
||||||
/* Define if you have the <mach/mach.h> header file. */
|
/* Define if you have the <mach/mach.h> header file. */
|
||||||
#undef HAVE_MACH_MACH_H
|
#undef HAVE_MACH_MACH_H
|
||||||
|
|
||||||
/* Define if you have the <memory.h> header file. */
|
/* Define if you have the <memory.h> header file. */
|
||||||
#undef HAVE_MEMORY_H
|
#undef HAVE_MEMORY_H
|
||||||
#define HAVE_MEMORY_H
|
#define HAVE_MEMORY_H 1
|
||||||
|
|
||||||
/* Define if you have the <ndir.h> header file. */
|
/* Define if you have the <ndir.h> header file. */
|
||||||
#undef HAVE_NDIR_H
|
#undef HAVE_NDIR_H
|
||||||
|
|
||||||
/* Define if you have the <string.h> header file. */
|
/* Define if you have the <string.h> header file. */
|
||||||
#undef HAVE_STRING_H
|
#undef HAVE_STRING_H
|
||||||
#define HAVE_STRING_H
|
#define HAVE_STRING_H 1
|
||||||
|
|
||||||
/* Define if you have the <sys/dir.h> header file. */
|
/* Define if you have the <sys/dir.h> header file. */
|
||||||
#undef HAVE_SYS_DIR_H
|
#undef HAVE_SYS_DIR_H
|
||||||
@@ -274,7 +284,7 @@
|
|||||||
|
|
||||||
/* Define if you have the <sys/timeb.h> header file. */
|
/* Define if you have the <sys/timeb.h> header file. */
|
||||||
#undef HAVE_SYS_TIMEB_H
|
#undef HAVE_SYS_TIMEB_H
|
||||||
#define HAVE_SYS_TIMEB_H
|
#define HAVE_SYS_TIMEB_H 1
|
||||||
|
|
||||||
/* Define if you have the <sys/wait.h> header file. */
|
/* Define if you have the <sys/wait.h> header file. */
|
||||||
#undef HAVE_SYS_WAIT_H
|
#undef HAVE_SYS_WAIT_H
|
||||||
@@ -287,3 +297,22 @@
|
|||||||
|
|
||||||
/* Define if you have the sun library (-lsun). */
|
/* Define if you have the sun library (-lsun). */
|
||||||
#undef HAVE_LIBSUN
|
#undef HAVE_LIBSUN
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Refer to README.W32 for info on the following settings
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
Define if you have the Cygnus GNU WIN32 tool set or a shell
|
||||||
|
that does not grok 'sh -c quoted-command-line' correctly.
|
||||||
|
*/
|
||||||
|
#undef BATCH_MODE_ONLY_SHELL
|
||||||
|
|
||||||
|
/*
|
||||||
|
Define if you have the MKS tool set or shell. Do NOT define
|
||||||
|
BATCH_MODE_ONLY_SHELL if you define HAVE_MKS_SHELL
|
||||||
|
*/
|
||||||
|
#undef HAVE_MKS_SHELL
|
||||||
|
|
||||||
|
/* Define if you prefer Case Insensitve behavior */
|
||||||
|
#undef HAVE_CASE_INSENSITIVE_FS
|
||||||
|
|||||||
289
config.h.WIN32
289
config.h.WIN32
@@ -1,289 +0,0 @@
|
|||||||
/* 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 gid_t int
|
|
||||||
|
|
||||||
/* Define if you have alloca, as a function or macro. */
|
|
||||||
#undef HAVE_ALLOCA
|
|
||||||
#define 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 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 HAVE_STRCOLL
|
|
||||||
|
|
||||||
/* Define if your struct stat has st_rdev. */
|
|
||||||
#undef HAVE_ST_RDEV
|
|
||||||
#define HAVE_ST_RDEV
|
|
||||||
|
|
||||||
/* Define if you have the strftime function. */
|
|
||||||
#undef HAVE_STRFTIME
|
|
||||||
#define 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 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 HAVE_UTIME_NULL
|
|
||||||
|
|
||||||
/* Define if you have <vfork.h>. */
|
|
||||||
#undef HAVE_VFORK_H
|
|
||||||
|
|
||||||
/* Define if you have the vprintf function. */
|
|
||||||
#undef HAVE_VPRINTF
|
|
||||||
#define 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 pid_t int
|
|
||||||
|
|
||||||
/* 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 _POSIX_SOURCE
|
|
||||||
|
|
||||||
/* Define as the return type of signal handlers (int or void). */
|
|
||||||
#undef RETSIGTYPE
|
|
||||||
#define RETSIGTYPE void
|
|
||||||
|
|
||||||
/* 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 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 uid_t int
|
|
||||||
|
|
||||||
/* 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 SCCS_GET "echo no 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 if you have the dup2 function. */
|
|
||||||
#undef HAVE_DUP2
|
|
||||||
#define HAVE_DUP2
|
|
||||||
|
|
||||||
/* Define if you have the getcwd function. */
|
|
||||||
#undef HAVE_GETCWD
|
|
||||||
#define HAVE_GETCWD
|
|
||||||
|
|
||||||
/* Define if you have the getgroups function. */
|
|
||||||
#undef HAVE_GETGROUPS
|
|
||||||
|
|
||||||
/* Define if you have the mktemp function. */
|
|
||||||
#undef HAVE_MKTEMP
|
|
||||||
#define 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 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 HAVE_DIRENT_H
|
|
||||||
|
|
||||||
/* Define if you have the <fcntl.h> header file. */
|
|
||||||
#undef HAVE_FCNTL_H
|
|
||||||
#define HAVE_FCNTL_H
|
|
||||||
|
|
||||||
/* Define if you have the <limits.h> header file. */
|
|
||||||
#undef HAVE_LIMITS_H
|
|
||||||
#define 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 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 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 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
|
|
||||||
264
config.h.in
264
config.h.in
@@ -1,264 +0,0 @@
|
|||||||
/* 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 if you have the dup2 function. */
|
|
||||||
#undef HAVE_DUP2
|
|
||||||
|
|
||||||
/* Define if you have the getcwd function. */
|
|
||||||
#undef HAVE_GETCWD
|
|
||||||
|
|
||||||
/* 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
|
|
||||||
@@ -1,68 +1,24 @@
|
|||||||
/* Generated automatically from configure.in by autoheader. DO NOT EDIT! */
|
/* Generated automatically from configure.in by autoheader. DO NOT EDIT! */
|
||||||
|
|
||||||
#define INCLUDEDIR "c:/djgpp/include"
|
/* Many things are defined already by a system header. */
|
||||||
#define LIBDIR "c:/djgpp/lib"
|
#include <sys/config.h>
|
||||||
|
|
||||||
/* Define if you have dirent.h. */
|
/* Name of this package (needed by automake) */
|
||||||
#define DIRENT
|
#define PACKAGE "%PACKAGE%"
|
||||||
|
|
||||||
/* Define if you have the strcoll function and it is properly defined. */
|
/* Version of this package (needed by automake) */
|
||||||
#define HAVE_STRCOLL
|
#define VERSION "%VERSION%"
|
||||||
|
|
||||||
/* Define if you have unistd.h. */
|
/* Define NSIG. */
|
||||||
#define HAVE_UNISTD_H
|
#define NSIG SIGMAX
|
||||||
|
|
||||||
/* Define as the return type of signal handlers (int or void). */
|
|
||||||
#define RETSIGTYPE void
|
|
||||||
|
|
||||||
/* Define if you have the ANSI C header files. */
|
|
||||||
#ifndef STDC_HEADERS
|
|
||||||
#define STDC_HEADERS
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Define if `sys_siglist' is declared by <signal.h>. */
|
|
||||||
#define SYS_SIGLIST_DECLARED
|
|
||||||
|
|
||||||
/* Define if you have getdtablesize. */
|
|
||||||
#define HAVE_GETDTABLESIZE
|
|
||||||
|
|
||||||
/* Define if you have dup2. */
|
|
||||||
#define HAVE_DUP2
|
|
||||||
|
|
||||||
/* Define if you have sys_siglist. */
|
|
||||||
#undef HAVE_SYS_SIGLIST
|
|
||||||
|
|
||||||
/* Define if you have _sys_siglist. */
|
|
||||||
#undef HAVE__SYS_SIGLIST
|
|
||||||
|
|
||||||
/* Define if you have psignal. */
|
|
||||||
#define HAVE_PSIGNAL
|
|
||||||
|
|
||||||
/* Define if you have getcwd. */
|
|
||||||
#define HAVE_GETCWD
|
|
||||||
|
|
||||||
/* Define if you have sigsetmask. */
|
/* Define if you have sigsetmask. */
|
||||||
#define HAVE_SIGSETMASK
|
#define HAVE_SIGSETMASK 1
|
||||||
|
|
||||||
/* Define if you have setlinebuf. */
|
|
||||||
#define HAVE_SETLINEBUF
|
|
||||||
|
|
||||||
/* Define if you have the <limits.h> header file. */
|
|
||||||
#define HAVE_LIMITS_H
|
|
||||||
|
|
||||||
/* Define if you have the <sys/param.h> header file. */
|
|
||||||
#undef HAVE_SYS_PARAM_H
|
|
||||||
|
|
||||||
/* Define if you have the <fcntl.h> header file. */
|
|
||||||
#define HAVE_FCNTL_H
|
|
||||||
|
|
||||||
/* Define if you have the <string.h> header file. */
|
|
||||||
#define HAVE_STRING_H
|
|
||||||
|
|
||||||
/* 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 1
|
||||||
|
|
||||||
/* Define if you have the `strerror' function. */
|
/* Define if you have the memmove function. */
|
||||||
#define HAVE_STRERROR
|
#define HAVE_MEMMOVE 1
|
||||||
|
|
||||||
#define SCCS_GET "get"
|
#define SCCS_GET "get"
|
||||||
|
|||||||
@@ -1,44 +1,44 @@
|
|||||||
@echo off
|
@echo off
|
||||||
echo Configuring MAKE for go32
|
echo Configuring MAKE for DJGPP
|
||||||
rem This batch file assumes a unix-type "sed" program
|
|
||||||
|
|
||||||
update configh.dos config.h
|
rem The SmallEnv trick protects against too small environment block,
|
||||||
|
rem in which case the values will be truncated and the whole thing
|
||||||
|
rem goes awry. COMMAND.COM will say "Out of environment space", but
|
||||||
|
rem many people don't care, so we force them to care by refusing to go.
|
||||||
|
|
||||||
echo # Makefile generated by "configure.bat"> Makefile
|
rem Where is the srcdir?
|
||||||
|
set XSRC=.
|
||||||
|
if not "%XSRC%"=="." goto SmallEnv
|
||||||
|
if "%1%"=="" goto SrcDone
|
||||||
|
set XSRC=%1
|
||||||
|
if not "%XSRC%"=="%1" goto SmallEnv
|
||||||
|
|
||||||
if exist config.sed del config.sed
|
:SrcDone
|
||||||
|
|
||||||
echo ": try_sl ">> config.sed
|
update %XSRC%/configh.dos ./config.h
|
||||||
echo "/\\$/ { ">> config.sed
|
|
||||||
echo " N ">> config.sed
|
|
||||||
echo " s/[ ]*\\\n[ ]*/ / ">> config.sed
|
|
||||||
echo " b try_sl ">> config.sed
|
|
||||||
echo "} ">> config.sed
|
|
||||||
|
|
||||||
echo "s/@srcdir@/./ ">> config.sed
|
rem Do they have Make?
|
||||||
echo "s/@CC@/gcc/ ">> config.sed
|
redir -o junk.$$$ -eo make -n -f NUL
|
||||||
echo "s/@CFLAGS@/-O2 -g/ ">> config.sed
|
rem REDIR will return 1 if it cannot run Make.
|
||||||
echo "s/@CPPFLAGS@/-DHAVE_CONFIG_H/ ">> config.sed
|
rem If it can run Make, it will usually return 2,
|
||||||
echo "s/@LDFLAGS@// ">> config.sed
|
rem but 0 is also OK with us.
|
||||||
echo "s/@RANLIB@/ranlib/ ">> config.sed
|
if errorlevel 2 goto MakeOk
|
||||||
echo "s/@DEFS@// ">> config.sed
|
if not errorlevel 1 goto MakeOk
|
||||||
echo "s/@REMOTE@/stub/ ">> config.sed
|
if exist junk.$$$ del junk.$$$
|
||||||
echo "s/@ALLOCA@// ">> config.sed
|
echo No Make program found--use DOSBUILD.BAT to build Make.
|
||||||
echo "s/@LIBS@// ">> config.sed
|
goto End
|
||||||
echo "s/@LIBOBJS@// ">> config.sed
|
|
||||||
echo "s/@SET_MAKE@// ">> config.sed
|
|
||||||
echo "s/^Makefile *:/_Makefile:/ ">> config.sed
|
|
||||||
echo "s/^config.h *:/_config.h:/ ">> config.sed
|
|
||||||
echo "s/^defines *=.*$/defines =/ ">> config.sed
|
|
||||||
echo "/mv -f make.new make/d ">> config.sed
|
|
||||||
|
|
||||||
echo "s/cd glob; $(MAKE)/$(MAKE) -C glob/ ">> config.sed
|
rem They do have Make. Generate the Makefile.
|
||||||
|
|
||||||
sed -e "s/^\"//" -e "s/\"$//" -e "s/[ ]*$//" config.sed > config2.sed
|
:MakeOk
|
||||||
sed -f config2.sed Makefile.in >> Makefile
|
del junk.$$$
|
||||||
del config.sed
|
update %XSRC%/Makefile.DOS ./Makefile
|
||||||
del config2.sed
|
echo Done.
|
||||||
|
if not "%XSRC%"=="." echo Invoke Make thus: "make srcdir=%XSRC%"
|
||||||
|
goto End
|
||||||
|
|
||||||
cd glob
|
:SmallEnv
|
||||||
call configure
|
echo Your environment is too small. Please enlarge it and run me again.
|
||||||
cd ..
|
|
||||||
|
:End
|
||||||
|
set XRSC=
|
||||||
|
|||||||
68
configure.in
68
configure.in
@@ -1,17 +1,30 @@
|
|||||||
dnl Process this file with autoconf to produce a configure script.
|
dnl Process this file with autoconf to produce a configure script.
|
||||||
AC_REVISION([$Id$])
|
AC_REVISION([$Id$])
|
||||||
AC_PREREQ(2.1)dnl dnl Minimum Autoconf version required.
|
AC_PREREQ(2.12)dnl dnl Minimum Autoconf version required.
|
||||||
AC_INIT(vpath.c)dnl dnl A distinctive file to look for in srcdir.
|
AC_INIT(vpath.c)dnl dnl A distinctive file to look for in srcdir.
|
||||||
AC_CONFIG_HEADER(config.h)
|
|
||||||
AC_CONFIG_SUBDIRS(glob) dnl Run configure in glob subdirectory.
|
AM_INIT_AUTOMAKE(make, 3.77)
|
||||||
|
AM_CONFIG_HEADER(config.h)
|
||||||
|
AC_CONFIG_SUBDIRS(glob)
|
||||||
|
|
||||||
|
AM_CONDITIONAL(MAINT_MAKEFILE, test -r $srcdir/maintMakefile)
|
||||||
|
|
||||||
|
dnl Regular configure stuff
|
||||||
|
|
||||||
AC_PROG_MAKE_SET
|
AC_PROG_MAKE_SET
|
||||||
AC_PROG_CC
|
AC_PROG_CC
|
||||||
AC_PROG_INSTALL
|
AC_PROG_INSTALL
|
||||||
AC_PROG_CPP dnl Later checks need this.
|
AC_PROG_CPP dnl Later checks need this.
|
||||||
|
dnl AC_ARG_PROGRAM -- implied by AM_INIT_AUTOMAKE; gives errors if run twice.
|
||||||
AC_AIX
|
AC_AIX
|
||||||
AC_ISC_POSIX
|
AC_ISC_POSIX
|
||||||
AC_MINIX
|
AC_MINIX
|
||||||
|
|
||||||
|
dnl This test must come as early as possible after the compiler configuration
|
||||||
|
dnl tests, because the choice of the file model can (in principle) affect
|
||||||
|
dnl whether functions and headers are available, whether they work, etc.
|
||||||
|
AC_LFS
|
||||||
|
|
||||||
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.
|
||||||
@@ -38,7 +51,7 @@ 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(psignal mktemp \
|
AC_CHECK_FUNCS(memmove psignal mktemp pstat_getdynamic \
|
||||||
dup2 getcwd sigsetmask getgroups setlinebuf \
|
dup2 getcwd sigsetmask getgroups setlinebuf \
|
||||||
seteuid setegid setreuid setregid strerror strsignal)
|
seteuid setegid setreuid setregid strerror strsignal)
|
||||||
AC_CHECK_SYMBOL(sys_siglist)
|
AC_CHECK_SYMBOL(sys_siglist)
|
||||||
@@ -46,6 +59,7 @@ AC_FUNC_ALLOCA
|
|||||||
AC_FUNC_VFORK
|
AC_FUNC_VFORK
|
||||||
AC_FUNC_SETVBUF_REVERSED
|
AC_FUNC_SETVBUF_REVERSED
|
||||||
AC_FUNC_GETLOADAVG
|
AC_FUNC_GETLOADAVG
|
||||||
|
AC_CHECK_LIB(kstat, kstat_open)
|
||||||
AC_FUNC_STRCOLL
|
AC_FUNC_STRCOLL
|
||||||
|
|
||||||
# Check out the wait reality.
|
# Check out the wait reality.
|
||||||
@@ -83,8 +97,25 @@ AC_DECL_SYS_SIGLIST
|
|||||||
AC_CHECK_LIB(sun, getpwnam)
|
AC_CHECK_LIB(sun, getpwnam)
|
||||||
|
|
||||||
AC_SUBST(REMOTE) REMOTE=stub
|
AC_SUBST(REMOTE) REMOTE=stub
|
||||||
AC_ARG_WITH(customs, [export jobs with the Customs daemon (NOT SUPPORTED)],
|
make_try_customs=no
|
||||||
[REMOTE=cstms LIBS="$LIBS libcustoms.a"])
|
AC_ARG_WITH(customs,
|
||||||
|
[ --with-customs=DIR Enable remote jobs via Customs--see README.customs],
|
||||||
|
[case "$withval" in
|
||||||
|
n|no) ;;
|
||||||
|
*) make_cppflags="$CPPFLAGS"
|
||||||
|
case "$withval" in
|
||||||
|
y|ye|yes) ;;
|
||||||
|
*) CPPFLAGS="$CPPFLAGS -I$with_customs/include/customs"
|
||||||
|
make_ldflags="$LDFLAGS -L$with_customs/lib" ;;
|
||||||
|
esac
|
||||||
|
CF_NETLIBS
|
||||||
|
AC_CHECK_HEADER(customs.h,
|
||||||
|
REMOTE=cstms
|
||||||
|
LIBS="$LIBS -lcustoms" LDFLAGS="$make_ldflags",
|
||||||
|
with_customs=no
|
||||||
|
CPPFLAGS="$make_cppflags" make_badcust=yes)
|
||||||
|
;;
|
||||||
|
esac])
|
||||||
|
|
||||||
echo checking for location of SCCS get command
|
echo checking for location of SCCS get command
|
||||||
if test -f /usr/sccs/get; then
|
if test -f /usr/sccs/get; then
|
||||||
@@ -106,10 +137,27 @@ if ( /usr/sccs/admin -n s.conftest || admin -n s.conftest ) >/dev/null 2>&1 &&
|
|||||||
fi
|
fi
|
||||||
rm -f s.conftest conftoast
|
rm -f s.conftest conftoast
|
||||||
|
|
||||||
AC_OUTPUT(Makefile build.sh, [
|
AC_OUTPUT(Makefile build.sh)
|
||||||
# Makefile uses this timestamp file to know when to remake Makefile,
|
|
||||||
# build.sh, and glob/Makefile.
|
case "$make_badcust" in
|
||||||
touch stamp-config])
|
yes) echo
|
||||||
|
echo "WARNING: --with-customs specified but no customs.h could be found;"
|
||||||
|
echo " disabling Customs support."
|
||||||
|
echo ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
case "$with_customs" in
|
||||||
|
""|n|no|y|ye|yes) ;;
|
||||||
|
*) if test -f "$with_customs/lib/libcustoms.a"; then
|
||||||
|
:
|
||||||
|
else
|
||||||
|
echo
|
||||||
|
echo "WARNING: \`$with_customs/lib' does not appear to contain the"
|
||||||
|
echo " Customs library. You must build and install Customs"
|
||||||
|
echo " before compiling GNU make."
|
||||||
|
echo
|
||||||
|
fi ;;
|
||||||
|
esac
|
||||||
|
|
||||||
dnl Local Variables:
|
dnl Local Variables:
|
||||||
dnl comment-start: "dnl "
|
dnl comment-start: "dnl "
|
||||||
|
|||||||
10
default.c
10
default.c
@@ -41,7 +41,7 @@ static char default_suffixes[]
|
|||||||
.mod .sym .def .h .info .dvi .tex .texinfo .texi .txinfo \
|
.mod .sym .def .h .info .dvi .tex .texinfo .texi .txinfo \
|
||||||
.w .ch .cweb .web .com .sh .elc .el";
|
.w .ch .cweb .web .com .sh .elc .el";
|
||||||
#else
|
#else
|
||||||
= ".out .a .ln .o .c .cc .C .p .f .F .r .y .l .s .S \
|
= ".out .a .ln .o .c .cc .C .cpp .p .f .F .r .y .l .s .S \
|
||||||
.mod .sym .def .h .info .dvi .tex .texinfo .texi .txinfo \
|
.mod .sym .def .h .info .dvi .tex .texinfo .texi .txinfo \
|
||||||
.w .ch .web .sh .elc .el";
|
.w .ch .web .sh .elc .el";
|
||||||
#endif
|
#endif
|
||||||
@@ -91,6 +91,8 @@ static struct pspec default_terminal_rules[] =
|
|||||||
"$(CHECKOUT,v)" },
|
"$(CHECKOUT,v)" },
|
||||||
{ "%", "RCS/%,v",
|
{ "%", "RCS/%,v",
|
||||||
"$(CHECKOUT,v)" },
|
"$(CHECKOUT,v)" },
|
||||||
|
{ "%", "RCS/%",
|
||||||
|
"$(CHECKOUT,v)" },
|
||||||
|
|
||||||
/* SCCS. */
|
/* SCCS. */
|
||||||
{ "%", "s.%",
|
{ "%", "s.%",
|
||||||
@@ -156,6 +158,8 @@ static char *default_suffix_rules[] =
|
|||||||
"$(LINK.cc) $^ $(LOADLIBES) $(LDLIBS) -o $@",
|
"$(LINK.cc) $^ $(LOADLIBES) $(LDLIBS) -o $@",
|
||||||
".C",
|
".C",
|
||||||
"$(LINK.C) $^ $(LOADLIBES) $(LDLIBS) -o $@",
|
"$(LINK.C) $^ $(LOADLIBES) $(LDLIBS) -o $@",
|
||||||
|
".cpp",
|
||||||
|
"$(LINK.cpp) $^ $(LOADLIBES) $(LDLIBS) -o $@",
|
||||||
".f",
|
".f",
|
||||||
"$(LINK.f) $^ $(LOADLIBES) $(LDLIBS) -o $@",
|
"$(LINK.f) $^ $(LOADLIBES) $(LDLIBS) -o $@",
|
||||||
".p",
|
".p",
|
||||||
@@ -183,6 +187,8 @@ static char *default_suffix_rules[] =
|
|||||||
"$(COMPILE.cc) $< $(OUTPUT_OPTION)",
|
"$(COMPILE.cc) $< $(OUTPUT_OPTION)",
|
||||||
".C.o",
|
".C.o",
|
||||||
"$(COMPILE.C) $< $(OUTPUT_OPTION)",
|
"$(COMPILE.C) $< $(OUTPUT_OPTION)",
|
||||||
|
".cpp.o",
|
||||||
|
"$(COMPILE.cpp) $< $(OUTPUT_OPTION)",
|
||||||
".f.o",
|
".f.o",
|
||||||
"$(COMPILE.f) $< $(OUTPUT_OPTION)",
|
"$(COMPILE.f) $< $(OUTPUT_OPTION)",
|
||||||
".p.o",
|
".p.o",
|
||||||
@@ -386,8 +392,10 @@ static char *default_variables[] =
|
|||||||
"LINK.c", "$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)",
|
"LINK.c", "$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)",
|
||||||
"COMPILE.cc", "$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c",
|
"COMPILE.cc", "$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c",
|
||||||
"COMPILE.C", "$(COMPILE.cc)",
|
"COMPILE.C", "$(COMPILE.cc)",
|
||||||
|
"COMPILE.cpp", "$(COMPILE.cc)",
|
||||||
"LINK.cc", "$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)",
|
"LINK.cc", "$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)",
|
||||||
"LINK.C", "$(LINK.cc)",
|
"LINK.C", "$(LINK.cc)",
|
||||||
|
"LINK.cpp", "$(LINK.cc)",
|
||||||
"YACC.y", "$(YACC) $(YFLAGS)",
|
"YACC.y", "$(YACC) $(YFLAGS)",
|
||||||
"LEX.l", "$(LEX) $(LFLAGS) -t",
|
"LEX.l", "$(LEX) $(LFLAGS) -t",
|
||||||
"COMPILE.f", "$(FC) $(FFLAGS) $(TARGET_ARCH) -c",
|
"COMPILE.f", "$(FC) $(FFLAGS) $(TARGET_ARCH) -c",
|
||||||
|
|||||||
252
dir.c
252
dir.c
@@ -1,5 +1,5 @@
|
|||||||
/* Directory hashing for GNU Make.
|
/* Directory hashing for GNU Make.
|
||||||
Copyright (C) 1988, 89, 91, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
|
Copyright (C) 1988,89,91,92,93,94,95,96,97 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
|
||||||
@@ -44,7 +44,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||||||
#define NAMLEN(d) _D_NAMLEN(d)
|
#define NAMLEN(d) _D_NAMLEN(d)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (defined (POSIX) || defined (WIN32)) && !defined (__GNU_LIBRARY__)
|
#if (defined (POSIX) || defined (WINDOWS32)) && !defined (__GNU_LIBRARY__)
|
||||||
/* Posix does not require that the d_ino field be present, and some
|
/* Posix does not require that the d_ino field be present, and some
|
||||||
systems do not provide it. */
|
systems do not provide it. */
|
||||||
#define REAL_DIR_ENTRY(dp) 1
|
#define REAL_DIR_ENTRY(dp) 1
|
||||||
@@ -56,6 +56,12 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||||||
|
|
||||||
#ifdef __MSDOS__
|
#ifdef __MSDOS__
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
|
||||||
|
/* If it's MSDOS that doesn't have _USE_LFN, disable LFN support. */
|
||||||
|
#ifndef _USE_LFN
|
||||||
|
#define _USE_LFN 0
|
||||||
|
#endif
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
dosify (filename)
|
dosify (filename)
|
||||||
@@ -65,9 +71,11 @@ dosify (filename)
|
|||||||
char *df;
|
char *df;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (filename == 0)
|
if (filename == 0 || _USE_LFN)
|
||||||
return 0;
|
return filename;
|
||||||
|
|
||||||
|
/* FIXME: what about filenames which violate
|
||||||
|
8+3 constraints, like "config.h.in", or ".emacs"? */
|
||||||
if (strpbrk (filename, "\"*+,;<=>?[\\]|") != 0)
|
if (strpbrk (filename, "\"*+,;<=>?[\\]|") != 0)
|
||||||
return filename;
|
return filename;
|
||||||
|
|
||||||
@@ -97,25 +105,31 @@ dosify (filename)
|
|||||||
}
|
}
|
||||||
#endif /* __MSDOS__ */
|
#endif /* __MSDOS__ */
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
#include "pathstuff.h"
|
#include "pathstuff.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _AMIGA
|
#ifdef _AMIGA
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_CASE_INSENSITIVE_FS
|
||||||
static char *
|
static char *
|
||||||
amigafy (filename)
|
downcase (filename)
|
||||||
char *filename;
|
char *filename;
|
||||||
{
|
{
|
||||||
static char amiga_filename[136];
|
#ifdef _AMIGA
|
||||||
|
static char new_filename[136];
|
||||||
|
#else
|
||||||
|
static char new_filename[PATH_MAX];
|
||||||
|
#endif
|
||||||
char *df;
|
char *df;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (filename == 0)
|
if (filename == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
df = amiga_filename;
|
df = new_filename;
|
||||||
|
|
||||||
/* First, transform the name part. */
|
/* First, transform the name part. */
|
||||||
for (i = 0; *filename != '\0'; ++i)
|
for (i = 0; *filename != '\0'; ++i)
|
||||||
@@ -126,9 +140,9 @@ amigafy (filename)
|
|||||||
|
|
||||||
*df = 0;
|
*df = 0;
|
||||||
|
|
||||||
return amiga_filename;
|
return new_filename;
|
||||||
}
|
}
|
||||||
#endif /* _AMIGA */
|
#endif /* HAVE_CASE_INSENSITIVE_FS */
|
||||||
|
|
||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
|
|
||||||
@@ -171,13 +185,16 @@ vmsstat_dir (name, st)
|
|||||||
{
|
{
|
||||||
*s++ = 0;
|
*s++ = 0;
|
||||||
st->st_dev = (char *)vms_hash (name);
|
st->st_dev = (char *)vms_hash (name);
|
||||||
|
h = vms_hash (s);
|
||||||
|
*(s-1) = ':';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
st->st_dev = 0;
|
st->st_dev = 0;
|
||||||
s = name;
|
s = name;
|
||||||
|
h = vms_hash (s);
|
||||||
}
|
}
|
||||||
h = vms_hash (s);
|
|
||||||
st->st_ino[0] = h & 0xff;
|
st->st_ino[0] = h & 0xff;
|
||||||
st->st_ino[1] = h & 0xff00;
|
st->st_ino[1] = h & 0xff00;
|
||||||
st->st_ino[2] = h >> 16;
|
st->st_ino[2] = h >> 16;
|
||||||
@@ -197,9 +214,9 @@ struct directory_contents
|
|||||||
struct directory_contents *next;
|
struct directory_contents *next;
|
||||||
|
|
||||||
dev_t dev; /* Device and inode numbers of this dir. */
|
dev_t dev; /* Device and inode numbers of this dir. */
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
/*
|
/*
|
||||||
* Inode means nothing on WIN32. Even file key information is
|
* Inode means nothing on WINDOWS32. Even file key information is
|
||||||
* unreliable because it is random per file open and undefined
|
* unreliable because it is random per file open and undefined
|
||||||
* for remote filesystems. The most unique attribute I can
|
* for remote filesystems. The most unique attribute I can
|
||||||
* come up with is the fully qualified name of the directory. Beware
|
* come up with is the fully qualified name of the directory. Beware
|
||||||
@@ -208,13 +225,17 @@ struct directory_contents
|
|||||||
*/
|
*/
|
||||||
char *path_key;
|
char *path_key;
|
||||||
int mtime; /* controls check for stale directory cache */
|
int mtime; /* controls check for stale directory cache */
|
||||||
|
int fs_flags; /* FS_FAT, FS_NTFS, ... */
|
||||||
|
#define FS_FAT 0x1
|
||||||
|
#define FS_NTFS 0x2
|
||||||
|
#define FS_UNKNOWN 0x4
|
||||||
#else
|
#else
|
||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
ino_t ino[3];
|
ino_t ino[3];
|
||||||
#else
|
#else
|
||||||
ino_t ino;
|
ino_t ino;
|
||||||
#endif
|
#endif
|
||||||
#endif /* WIN32 */
|
#endif /* WINDOWS32 */
|
||||||
struct dirfile **files; /* Files in this directory. */
|
struct dirfile **files; /* Files in this directory. */
|
||||||
DIR *dirstream; /* Stream reading this directory. */
|
DIR *dirstream; /* Stream reading this directory. */
|
||||||
};
|
};
|
||||||
@@ -270,8 +291,13 @@ find_directory (name)
|
|||||||
register unsigned int hash = 0;
|
register unsigned int hash = 0;
|
||||||
register char *p;
|
register char *p;
|
||||||
register struct directory *dir;
|
register struct directory *dir;
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
char* w32_path;
|
char* w32_path;
|
||||||
|
char fs_label[BUFSIZ];
|
||||||
|
char fs_type[BUFSIZ];
|
||||||
|
long fs_serno;
|
||||||
|
long fs_flags;
|
||||||
|
long fs_len;
|
||||||
#endif
|
#endif
|
||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
if ((*name == '.') && (*(name+1) == 0))
|
if ((*name == '.') && (*(name+1) == 0))
|
||||||
@@ -318,7 +344,7 @@ find_directory (name)
|
|||||||
|
|
||||||
struct directory_contents *dc;
|
struct directory_contents *dc;
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
w32_path = w32ify(name, 1);
|
w32_path = w32ify(name, 1);
|
||||||
hash = ((unsigned int) st.st_dev << 16) | (unsigned int) st.st_ctime;
|
hash = ((unsigned int) st.st_dev << 16) | (unsigned int) st.st_ctime;
|
||||||
#else
|
#else
|
||||||
@@ -334,8 +360,8 @@ find_directory (name)
|
|||||||
hash %= DIRECTORY_BUCKETS;
|
hash %= DIRECTORY_BUCKETS;
|
||||||
|
|
||||||
for (dc = directories_contents[hash]; dc != 0; dc = dc->next)
|
for (dc = directories_contents[hash]; dc != 0; dc = dc->next)
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
if (!strcmp(dc->path_key, w32_path))
|
if (strieq(dc->path_key, w32_path))
|
||||||
#else
|
#else
|
||||||
if (dc->dev == st.st_dev
|
if (dc->dev == st.st_dev
|
||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
@@ -345,7 +371,7 @@ find_directory (name)
|
|||||||
#else
|
#else
|
||||||
&& dc->ino == st.st_ino)
|
&& dc->ino == st.st_ino)
|
||||||
#endif
|
#endif
|
||||||
#endif /* WIN32 */
|
#endif /* WINDOWS32 */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (dc == 0)
|
if (dc == 0)
|
||||||
@@ -357,9 +383,27 @@ find_directory (name)
|
|||||||
|
|
||||||
/* Enter it in the contents hash table. */
|
/* Enter it in the contents hash table. */
|
||||||
dc->dev = st.st_dev;
|
dc->dev = st.st_dev;
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
dc->path_key = strdup(w32_path);
|
dc->path_key = strdup(w32_path);
|
||||||
dc->mtime = st.st_mtime;
|
dc->mtime = st.st_mtime;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* NTFS is the only WINDOWS32 filesystem that bumps mtime
|
||||||
|
* on a directory when files are added/deleted from
|
||||||
|
* a directory.
|
||||||
|
*/
|
||||||
|
w32_path[3] = '\0';
|
||||||
|
if (GetVolumeInformation(w32_path,
|
||||||
|
fs_label, sizeof (fs_label),
|
||||||
|
&fs_serno, &fs_len,
|
||||||
|
&fs_flags, fs_type, sizeof (fs_type)) == FALSE)
|
||||||
|
dc->fs_flags = FS_UNKNOWN;
|
||||||
|
else if (!strcmp(fs_type, "FAT"))
|
||||||
|
dc->fs_flags = FS_FAT;
|
||||||
|
else if (!strcmp(fs_type, "NTFS"))
|
||||||
|
dc->fs_flags = FS_NTFS;
|
||||||
|
else
|
||||||
|
dc->fs_flags = FS_UNKNOWN;
|
||||||
#else
|
#else
|
||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
dc->ino[0] = st.st_ino[0];
|
dc->ino[0] = st.st_ino[0];
|
||||||
@@ -368,7 +412,7 @@ find_directory (name)
|
|||||||
#else
|
#else
|
||||||
dc->ino = st.st_ino;
|
dc->ino = st.st_ino;
|
||||||
#endif
|
#endif
|
||||||
#endif /* WIN32 */
|
#endif /* WINDOWS32 */
|
||||||
dc->next = directories_contents[hash];
|
dc->next = directories_contents[hash];
|
||||||
directories_contents[hash] = dc;
|
directories_contents[hash] = dc;
|
||||||
|
|
||||||
@@ -416,7 +460,7 @@ dir_contents_file_exists_p (dir, filename)
|
|||||||
register char *p;
|
register char *p;
|
||||||
register struct dirfile *df;
|
register struct dirfile *df;
|
||||||
register struct dirent *d;
|
register struct dirent *d;
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
struct stat st;
|
struct stat st;
|
||||||
int rehash = 0;
|
int rehash = 0;
|
||||||
#endif
|
#endif
|
||||||
@@ -430,8 +474,8 @@ dir_contents_file_exists_p (dir, filename)
|
|||||||
filename = dosify (filename);
|
filename = dosify (filename);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _AMIGA
|
#ifdef HAVE_CASE_INSENSITIVE_FS
|
||||||
filename = amigafy (filename);
|
filename = downcase (filename);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
@@ -467,11 +511,16 @@ dir_contents_file_exists_p (dir, filename)
|
|||||||
|
|
||||||
if (dir->dirstream == 0)
|
if (dir->dirstream == 0)
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
/* Check to see if directory has changed since last read */
|
/*
|
||||||
|
* Check to see if directory has changed since last read. FAT
|
||||||
|
* filesystems force a rehash always as mtime does not change
|
||||||
|
* on directories (ugh!).
|
||||||
|
*/
|
||||||
if (dir->path_key &&
|
if (dir->path_key &&
|
||||||
stat(dir->path_key, &st) == 0 &&
|
(dir->fs_flags & FS_FAT ||
|
||||||
st.st_mtime > dir->mtime) {
|
(stat(dir->path_key, &st) == 0 &&
|
||||||
|
st.st_mtime > dir->mtime))) {
|
||||||
|
|
||||||
/* reset date stamp to show most recent re-process */
|
/* reset date stamp to show most recent re-process */
|
||||||
dir->mtime = st.st_mtime;
|
dir->mtime = st.st_mtime;
|
||||||
@@ -503,7 +552,7 @@ dir_contents_file_exists_p (dir, filename)
|
|||||||
for (i = 0; i < len; ++i)
|
for (i = 0; i < len; ++i)
|
||||||
HASHI (newhash, d->d_name[i]);
|
HASHI (newhash, d->d_name[i]);
|
||||||
newhash %= DIRFILE_BUCKETS;
|
newhash %= DIRFILE_BUCKETS;
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
/*
|
/*
|
||||||
* If re-reading a directory, check that this file isn't already
|
* If re-reading a directory, check that this file isn't already
|
||||||
* in the cache.
|
* in the cache.
|
||||||
@@ -527,7 +576,7 @@ dir_contents_file_exists_p (dir, filename)
|
|||||||
dir->files[newhash] = df;
|
dir->files[newhash] = df;
|
||||||
df->name = savestring (d->d_name, len);
|
df->name = savestring (d->d_name, len);
|
||||||
df->impossible = 0;
|
df->impossible = 0;
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
/* Check if the name matches the one we're searching for. */
|
/* Check if the name matches the one we're searching for. */
|
||||||
@@ -570,6 +619,7 @@ file_exists_p (name)
|
|||||||
{
|
{
|
||||||
char *dirend;
|
char *dirend;
|
||||||
char *dirname;
|
char *dirname;
|
||||||
|
char *slash;
|
||||||
|
|
||||||
#ifndef NO_ARCHIVES
|
#ifndef NO_ARCHIVES
|
||||||
if (ar_name (name))
|
if (ar_name (name))
|
||||||
@@ -583,12 +633,17 @@ file_exists_p (name)
|
|||||||
return dir_file_exists_p ("[]", name);
|
return dir_file_exists_p ("[]", name);
|
||||||
#else /* !VMS */
|
#else /* !VMS */
|
||||||
dirend = rindex (name, '/');
|
dirend = rindex (name, '/');
|
||||||
#ifdef WIN32
|
#if defined (WINDOWS32) || defined (__MSDOS__)
|
||||||
if (!dirend)
|
/* Forward and backslashes might be mixed. We need the rightmost one. */
|
||||||
dirend = rindex(name, '\\');
|
{
|
||||||
#endif /* WIN32 */
|
char *bslash = rindex(name, '\\');
|
||||||
if (dirend == 0)
|
if (!dirend || bslash > dirend)
|
||||||
return dir_file_exists_p (".", name);
|
dirend = bslash;
|
||||||
|
/* The case of "d:file". */
|
||||||
|
if (!dirend && name[0] && name[1] == ':')
|
||||||
|
dirend = name + 1;
|
||||||
|
}
|
||||||
|
#endif /* WINDOWS32 || __MSDOS__ */
|
||||||
if (dirend == 0)
|
if (dirend == 0)
|
||||||
#ifndef _AMIGA
|
#ifndef _AMIGA
|
||||||
return dir_file_exists_p (".", name);
|
return dir_file_exists_p (".", name);
|
||||||
@@ -597,10 +652,22 @@ file_exists_p (name)
|
|||||||
#endif /* AMIGA */
|
#endif /* AMIGA */
|
||||||
#endif /* VMS */
|
#endif /* VMS */
|
||||||
|
|
||||||
dirname = (char *) alloca (dirend - name + 1);
|
slash = dirend;
|
||||||
bcopy (name, dirname, dirend - name);
|
if (dirend == name)
|
||||||
dirname[dirend - name] = '\0';
|
dirname = "/";
|
||||||
return dir_file_exists_p (dirname, dirend + 1);
|
else
|
||||||
|
{
|
||||||
|
#if defined (WINDOWS32) || defined (__MSDOS__)
|
||||||
|
/* d:/ and d: are *very* different... */
|
||||||
|
if (dirend < name + 3 && name[1] == ':' &&
|
||||||
|
(*dirend == '/' || *dirend == '\\' || *dirend == ':'))
|
||||||
|
dirend++;
|
||||||
|
#endif
|
||||||
|
dirname = (char *) alloca (dirend - name + 1);
|
||||||
|
bcopy (name, dirname, dirend - name);
|
||||||
|
dirname[dirend - name] = '\0';
|
||||||
|
}
|
||||||
|
return dir_file_exists_p (dirname, slash + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Mark FILENAME as `impossible' for `file_impossible_p'.
|
/* Mark FILENAME as `impossible' for `file_impossible_p'.
|
||||||
@@ -624,6 +691,17 @@ file_impossible (filename)
|
|||||||
dir = find_directory ("[]");
|
dir = find_directory ("[]");
|
||||||
#else
|
#else
|
||||||
dirend = rindex (p, '/');
|
dirend = rindex (p, '/');
|
||||||
|
#if defined (WINDOWS32) || defined (__MSDOS__)
|
||||||
|
/* Forward and backslashes might be mixed. We need the rightmost one. */
|
||||||
|
{
|
||||||
|
char *bslash = rindex(p, '\\');
|
||||||
|
if (!dirend || bslash > dirend)
|
||||||
|
dirend = bslash;
|
||||||
|
/* The case of "d:file". */
|
||||||
|
if (!dirend && p[0] && p[1] == ':')
|
||||||
|
dirend = p + 1;
|
||||||
|
}
|
||||||
|
#endif /* WINDOWS32 or __MSDOS__ */
|
||||||
if (dirend == 0)
|
if (dirend == 0)
|
||||||
#ifdef _AMIGA
|
#ifdef _AMIGA
|
||||||
dir = find_directory ("");
|
dir = find_directory ("");
|
||||||
@@ -633,11 +711,24 @@ file_impossible (filename)
|
|||||||
#endif /* VMS */
|
#endif /* VMS */
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
char *dirname = (char *) alloca (dirend - p + 1);
|
char *dirname;
|
||||||
bcopy (p, dirname, dirend - p);
|
char *slash = dirend;
|
||||||
dirname[dirend - p] = '\0';
|
if (dirend == p)
|
||||||
|
dirname = "/";
|
||||||
|
else
|
||||||
|
{
|
||||||
|
#if defined (WINDOWS32) || defined (__MSDOS__)
|
||||||
|
/* d:/ and d: are *very* different... */
|
||||||
|
if (dirend < p + 3 && p[1] == ':' &&
|
||||||
|
(*dirend == '/' || *dirend == '\\' || *dirend == ':'))
|
||||||
|
dirend++;
|
||||||
|
#endif
|
||||||
|
dirname = (char *) alloca (dirend - p + 1);
|
||||||
|
bcopy (p, dirname, dirend - p);
|
||||||
|
dirname[dirend - p] = '\0';
|
||||||
|
}
|
||||||
dir = find_directory (dirname);
|
dir = find_directory (dirname);
|
||||||
filename = p = dirend + 1;
|
filename = p = slash + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (hash = 0; *p != '\0'; ++p)
|
for (hash = 0; *p != '\0'; ++p)
|
||||||
@@ -650,10 +741,10 @@ file_impossible (filename)
|
|||||||
structure for it, but leave it out of the contents hash table. */
|
structure for it, but leave it out of the contents hash table. */
|
||||||
dir->contents = (struct directory_contents *)
|
dir->contents = (struct directory_contents *)
|
||||||
xmalloc (sizeof (struct directory_contents));
|
xmalloc (sizeof (struct directory_contents));
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
dir->contents->path_key = NULL;
|
dir->contents->path_key = NULL;
|
||||||
dir->contents->mtime = 0;
|
dir->contents->mtime = 0;
|
||||||
#else /* WIN32 */
|
#else /* WINDOWS32 */
|
||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
dir->contents->dev = 0;
|
dir->contents->dev = 0;
|
||||||
dir->contents->ino[0] = dir->contents->ino[1] =
|
dir->contents->ino[0] = dir->contents->ino[1] =
|
||||||
@@ -661,7 +752,7 @@ file_impossible (filename)
|
|||||||
#else
|
#else
|
||||||
dir->contents->dev = dir->contents->ino = 0;
|
dir->contents->dev = dir->contents->ino = 0;
|
||||||
#endif
|
#endif
|
||||||
#endif /* WIN32 */
|
#endif /* WINDOWS32 */
|
||||||
dir->contents->files = 0;
|
dir->contents->files = 0;
|
||||||
dir->contents->dirstream = 0;
|
dir->contents->dirstream = 0;
|
||||||
}
|
}
|
||||||
@@ -702,10 +793,17 @@ file_impossible_p (filename)
|
|||||||
dir = find_directory ("[]")->contents;
|
dir = find_directory ("[]")->contents;
|
||||||
#else
|
#else
|
||||||
dirend = rindex (filename, '/');
|
dirend = rindex (filename, '/');
|
||||||
#ifdef WIN32
|
#if defined (WINDOWS32) || defined (__MSDOS__)
|
||||||
if (!dirend)
|
/* Forward and backslashes might be mixed. We need the rightmost one. */
|
||||||
dirend = rindex (filename, '\\');
|
{
|
||||||
#endif /* WIN32 */
|
char *bslash = rindex(filename, '\\');
|
||||||
|
if (!dirend || bslash > dirend)
|
||||||
|
dirend = bslash;
|
||||||
|
/* The case of "d:file". */
|
||||||
|
if (!dirend && filename[0] && filename[1] == ':')
|
||||||
|
dirend = filename + 1;
|
||||||
|
}
|
||||||
|
#endif /* WINDOWS32 || __MSDOS__ */
|
||||||
if (dirend == 0)
|
if (dirend == 0)
|
||||||
#ifdef _AMIGA
|
#ifdef _AMIGA
|
||||||
dir = find_directory ("")->contents;
|
dir = find_directory ("")->contents;
|
||||||
@@ -715,11 +813,24 @@ file_impossible_p (filename)
|
|||||||
#endif /* VMS */
|
#endif /* VMS */
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
char *dirname = (char *) alloca (dirend - filename + 1);
|
char *dirname;
|
||||||
bcopy (p, dirname, dirend - p);
|
char *slash = dirend;
|
||||||
dirname[dirend - p] = '\0';
|
if (dirend == filename)
|
||||||
|
dirname = "/";
|
||||||
|
else
|
||||||
|
{
|
||||||
|
#if defined (WINDOWS32) || defined (__MSDOS__)
|
||||||
|
/* d:/ and d: are *very* different... */
|
||||||
|
if (dirend < filename + 3 && filename[1] == ':' &&
|
||||||
|
(*dirend == '/' || *dirend == '\\' || *dirend == ':'))
|
||||||
|
dirend++;
|
||||||
|
#endif
|
||||||
|
dirname = (char *) alloca (dirend - filename + 1);
|
||||||
|
bcopy (p, dirname, dirend - p);
|
||||||
|
dirname[dirend - p] = '\0';
|
||||||
|
}
|
||||||
dir = find_directory (dirname)->contents;
|
dir = find_directory (dirname)->contents;
|
||||||
p = filename = dirend + 1;
|
p = filename = slash + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dir == 0 || dir->files == 0)
|
if (dir == 0 || dir->files == 0)
|
||||||
@@ -729,8 +840,8 @@ file_impossible_p (filename)
|
|||||||
#ifdef __MSDOS__
|
#ifdef __MSDOS__
|
||||||
p = filename = dosify (p);
|
p = filename = dosify (p);
|
||||||
#endif
|
#endif
|
||||||
#ifdef _AMIGA
|
#ifdef HAVE_CASE_INSENSITIVE_FS
|
||||||
p = filename = amigafy (p);
|
p = filename = downcase (p);
|
||||||
#endif
|
#endif
|
||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
p = filename = vmsify (p, 1);
|
p = filename = vmsify (p, 1);
|
||||||
@@ -775,10 +886,10 @@ print_dir_data_base ()
|
|||||||
if (dir->contents == 0)
|
if (dir->contents == 0)
|
||||||
printf ("# %s: could not be stat'd.\n", dir->name);
|
printf ("# %s: could not be stat'd.\n", dir->name);
|
||||||
else if (dir->contents->files == 0)
|
else if (dir->contents->files == 0)
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
printf ("# %s (key %s, mtime %d): could not be opened.\n",
|
printf ("# %s (key %s, mtime %d): could not be opened.\n",
|
||||||
dir->name, dir->contents->path_key,dir->contents->mtime);
|
dir->name, dir->contents->path_key,dir->contents->mtime);
|
||||||
#else /* WIN32 */
|
#else /* WINDOWS32 */
|
||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
printf ("# %s (device %d, inode [%d,%d,%d]): could not be opened.\n",
|
printf ("# %s (device %d, inode [%d,%d,%d]): could not be opened.\n",
|
||||||
dir->name, dir->contents->dev,
|
dir->name, dir->contents->dev,
|
||||||
@@ -789,7 +900,7 @@ print_dir_data_base ()
|
|||||||
dir->name, (long int) dir->contents->dev,
|
dir->name, (long int) dir->contents->dev,
|
||||||
(long int) dir->contents->ino);
|
(long int) dir->contents->ino);
|
||||||
#endif
|
#endif
|
||||||
#endif /* WIN32 */
|
#endif /* WINDOWS32 */
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
register unsigned int f = 0, im = 0;
|
register unsigned int f = 0, im = 0;
|
||||||
@@ -801,20 +912,21 @@ print_dir_data_base ()
|
|||||||
++im;
|
++im;
|
||||||
else
|
else
|
||||||
++f;
|
++f;
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
printf ("# %s (key %s, mtime %d): ",
|
printf ("# %s (key %s, mtime %d): ",
|
||||||
dir->name, dir->contents->path_key, dir->contents->mtime);
|
dir->name, dir->contents->path_key, dir->contents->mtime);
|
||||||
#else /* WIN32 */
|
#else /* WINDOWS32 */
|
||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
printf ("# %s (device %d, inode [%d,%d,%d]): ",
|
printf ("# %s (device %d, inode [%d,%d,%d]): ",
|
||||||
dir->name, dir->contents->dev,
|
dir->name, dir->contents->dev,
|
||||||
dir->contents->ino[0], dir->contents->ino[1],
|
dir->contents->ino[0], dir->contents->ino[1],
|
||||||
dir->contents->ino[2]);
|
dir->contents->ino[2]);
|
||||||
#else
|
#else
|
||||||
printf ("# %s (device %d, inode %d): ",
|
printf ("# %s (device %ld, inode %ld): ",
|
||||||
dir->name, dir->contents->dev, dir->contents->ino);
|
dir->name,
|
||||||
|
(long)dir->contents->dev, (long)dir->contents->ino);
|
||||||
#endif
|
#endif
|
||||||
#endif /* WIN32 */
|
#endif /* WINDOWS32 */
|
||||||
if (f == 0)
|
if (f == 0)
|
||||||
fputs ("No", stdout);
|
fputs ("No", stdout);
|
||||||
else
|
else
|
||||||
@@ -936,6 +1048,14 @@ read_dirstream (stream)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
ansi_free(p)
|
||||||
|
void *p;
|
||||||
|
{
|
||||||
|
if (p)
|
||||||
|
free(p);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
dir_setup_glob (gl)
|
dir_setup_glob (gl)
|
||||||
glob_t *gl;
|
glob_t *gl;
|
||||||
@@ -945,7 +1065,7 @@ dir_setup_glob (gl)
|
|||||||
/* Bogus sunos4 compiler complains (!) about & before functions. */
|
/* Bogus sunos4 compiler complains (!) about & before functions. */
|
||||||
gl->gl_opendir = open_dirstream;
|
gl->gl_opendir = open_dirstream;
|
||||||
gl->gl_readdir = read_dirstream;
|
gl->gl_readdir = read_dirstream;
|
||||||
gl->gl_closedir = free;
|
gl->gl_closedir = ansi_free;
|
||||||
gl->gl_stat = stat;
|
gl->gl_stat = stat;
|
||||||
/* We don't bother setting gl_lstat, since glob never calls it.
|
/* We don't bother setting gl_lstat, since glob never calls it.
|
||||||
The slot is only there for compatibility with 4.4 BSD. */
|
The slot is only there for compatibility with 4.4 BSD. */
|
||||||
|
|||||||
42
dosbuild.bat
Normal file
42
dosbuild.bat
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
@echo Building Make for MSDOS
|
||||||
|
|
||||||
|
@rem Echo ON so they will see what is going on.
|
||||||
|
|
||||||
|
@echo on
|
||||||
|
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g commands.c -o commands.o
|
||||||
|
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g job.c -o job.o
|
||||||
|
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g dir.c -o dir.o
|
||||||
|
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g file.c -o file.o
|
||||||
|
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g misc.c -o misc.o
|
||||||
|
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g main.c -o main.o
|
||||||
|
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -DINCLUDEDIR=\"c:/djgpp/include\" -O2 -g read.c -o read.o
|
||||||
|
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -DLIBDIR=\"c:/djgpp/lib\" -O2 -g remake.c -o remake.o
|
||||||
|
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g rule.c -o rule.o
|
||||||
|
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g implicit.c -o implicit.o
|
||||||
|
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g default.c -o default.o
|
||||||
|
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g variable.c -o variable.o
|
||||||
|
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g expand.c -o expand.o
|
||||||
|
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g function.c -o function.o
|
||||||
|
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g vpath.c -o vpath.o
|
||||||
|
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g version.c -o version.o
|
||||||
|
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g ar.c -o ar.o
|
||||||
|
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g arscan.c -o arscan.o
|
||||||
|
|
||||||
89
expand.c
89
expand.c
@@ -21,15 +21,24 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||||||
#include "job.h"
|
#include "job.h"
|
||||||
#include "commands.h"
|
#include "commands.h"
|
||||||
#include "variable.h"
|
#include "variable.h"
|
||||||
|
#include "rule.h"
|
||||||
|
|
||||||
/* The next two describe the variable output buffer.
|
/* The next two describe the variable output buffer.
|
||||||
This buffer is used to hold the variable-expansion of a line of the
|
This buffer is used to hold the variable-expansion of a line of the
|
||||||
makefile. It is made bigger with realloc whenever it is too small.
|
makefile. It is made bigger with realloc whenever it is too small.
|
||||||
variable_buffer_length is the size currently allocated.
|
variable_buffer_length is the size currently allocated.
|
||||||
variable_buffer is the address of the buffer. */
|
variable_buffer is the address of the buffer.
|
||||||
|
|
||||||
|
For efficiency, it's guaranteed that the buffer will always have
|
||||||
|
VARIABLE_BUFFER_ZONE extra bytes allocated. This allows you to add a few
|
||||||
|
extra chars without having to call a function. Note you should never use
|
||||||
|
these bytes unless you're _sure_ you have room (you know when the buffer
|
||||||
|
length was last checked. */
|
||||||
|
|
||||||
|
#define VARIABLE_BUFFER_ZONE 5
|
||||||
|
|
||||||
static unsigned int variable_buffer_length;
|
static unsigned int variable_buffer_length;
|
||||||
static char *variable_buffer;
|
char *variable_buffer;
|
||||||
|
|
||||||
/* Subroutine of variable_expand and friends:
|
/* Subroutine of variable_expand and friends:
|
||||||
The text to add is LENGTH chars starting at STRING to the variable_buffer.
|
The text to add is LENGTH chars starting at STRING to the variable_buffer.
|
||||||
@@ -45,7 +54,7 @@ variable_buffer_output (ptr, string, length)
|
|||||||
{
|
{
|
||||||
register unsigned int newlen = length + (ptr - variable_buffer);
|
register unsigned int newlen = length + (ptr - variable_buffer);
|
||||||
|
|
||||||
if (newlen > variable_buffer_length)
|
if ((newlen + VARIABLE_BUFFER_ZONE) > variable_buffer_length)
|
||||||
{
|
{
|
||||||
unsigned int offset = ptr - variable_buffer;
|
unsigned int offset = ptr - variable_buffer;
|
||||||
variable_buffer_length = (newlen + 100 > 2 * variable_buffer_length
|
variable_buffer_length = (newlen + 100 > 2 * variable_buffer_length
|
||||||
@@ -93,7 +102,7 @@ recursively_expand (v)
|
|||||||
v->name);
|
v->name);
|
||||||
else
|
else
|
||||||
makefile_fatal
|
makefile_fatal
|
||||||
(reading_filename, *reading_lineno_ptr,
|
(reading_filename, *reading_lineno_ptr,
|
||||||
"Recursive variable `%s' references itself (eventually)",
|
"Recursive variable `%s' references itself (eventually)",
|
||||||
v->name);
|
v->name);
|
||||||
}
|
}
|
||||||
@@ -153,20 +162,38 @@ reference_variable (o, name, length)
|
|||||||
return o;
|
return o;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Scan LINE for variable references and expansion-function calls.
|
/* Scan STRING for variable references and expansion-function calls. Only
|
||||||
Build in `variable_buffer' the result of expanding the references and calls.
|
LENGTH bytes of STRING are actually scanned. If LENGTH is -1, scan until
|
||||||
Return the address of the resulting string, which is null-terminated
|
a null byte is found.
|
||||||
and is valid only until the next time this function is called. */
|
|
||||||
|
Write the results to LINE, which must point into `variable_buffer'. If
|
||||||
|
LINE is NULL, start at the beginning of the buffer.
|
||||||
|
Return a pointer to LINE, or to the beginning of the buffer if LINE is
|
||||||
|
NULL. */
|
||||||
|
|
||||||
char *
|
char *
|
||||||
variable_expand (line)
|
variable_expand_string (line, string, length)
|
||||||
register char *line;
|
register char *line;
|
||||||
|
char *string;
|
||||||
|
long length;
|
||||||
{
|
{
|
||||||
register struct variable *v;
|
register struct variable *v;
|
||||||
register char *p, *o, *p1;
|
register char *p, *o, *p1;
|
||||||
|
char save_char = '\0';
|
||||||
|
unsigned int line_offset;
|
||||||
|
|
||||||
p = line;
|
if (!line)
|
||||||
o = initialize_variable_output ();
|
line = initialize_variable_output();
|
||||||
|
|
||||||
|
p = string;
|
||||||
|
o = line;
|
||||||
|
line_offset = line - variable_buffer;
|
||||||
|
|
||||||
|
if (length >= 0)
|
||||||
|
{
|
||||||
|
save_char = string[length];
|
||||||
|
string[length] = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
@@ -316,7 +343,7 @@ variable_expand (line)
|
|||||||
replace_end - replace_beg);
|
replace_end - replace_beg);
|
||||||
replace[replace_end - replace_beg] = '\0';
|
replace[replace_end - replace_beg] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
o = patsubst_expand (o, value, pattern, replace,
|
o = patsubst_expand (o, value, pattern, replace,
|
||||||
percent, (char *) 0);
|
percent, (char *) 0);
|
||||||
}
|
}
|
||||||
@@ -366,7 +393,7 @@ variable_expand (line)
|
|||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*p == '\0')
|
if (*p == '\0')
|
||||||
break;
|
break;
|
||||||
@@ -374,8 +401,23 @@ variable_expand (line)
|
|||||||
++p;
|
++p;
|
||||||
}
|
}
|
||||||
|
|
||||||
(void) variable_buffer_output (o, "", 1);
|
if (save_char)
|
||||||
return initialize_variable_output ();
|
string[length] = save_char;
|
||||||
|
|
||||||
|
(void)variable_buffer_output (o, "", 1);
|
||||||
|
return (variable_buffer + line_offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Scan LINE for variable references and expansion-function calls.
|
||||||
|
Build in `variable_buffer' the result of expanding the references and calls.
|
||||||
|
Return the address of the resulting string, which is null-terminated
|
||||||
|
and is valid only until the next time this function is called. */
|
||||||
|
|
||||||
|
char *
|
||||||
|
variable_expand (line)
|
||||||
|
char *line;
|
||||||
|
{
|
||||||
|
return variable_expand_string(NULL, line, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Expand an argument for an expansion function.
|
/* Expand an argument for an expansion function.
|
||||||
@@ -405,13 +447,13 @@ expand_argument (str, end)
|
|||||||
/* Expand LINE for FILE. Error messages refer to the file and line where
|
/* Expand LINE for FILE. Error messages refer to the file and line where
|
||||||
FILE's commands were found. Expansion uses FILE's variable set list. */
|
FILE's commands were found. Expansion uses FILE's variable set list. */
|
||||||
|
|
||||||
char *
|
static char *
|
||||||
variable_expand_for_file (line, file)
|
variable_expand_for_file (line, file)
|
||||||
char *line;
|
char *line;
|
||||||
register struct file *file;
|
register struct file *file;
|
||||||
{
|
{
|
||||||
char *result;
|
char *result;
|
||||||
struct variable_set_list *save;
|
struct variable_set_list *save, *fnext;
|
||||||
|
|
||||||
if (file == 0)
|
if (file == 0)
|
||||||
return variable_expand (line);
|
return variable_expand (line);
|
||||||
@@ -420,10 +462,23 @@ variable_expand_for_file (line, file)
|
|||||||
current_variable_set_list = file->variables;
|
current_variable_set_list = file->variables;
|
||||||
reading_filename = file->cmds->filename;
|
reading_filename = file->cmds->filename;
|
||||||
reading_lineno_ptr = &file->cmds->lineno;
|
reading_lineno_ptr = &file->cmds->lineno;
|
||||||
|
fnext = file->variables->next;
|
||||||
|
/* See if there's a pattern-specific variable struct for this target. */
|
||||||
|
if (!file->pat_searched)
|
||||||
|
{
|
||||||
|
file->patvar = lookup_pattern_var(file->name);
|
||||||
|
file->pat_searched = 1;
|
||||||
|
}
|
||||||
|
if (file->patvar != 0)
|
||||||
|
{
|
||||||
|
file->patvar->vars->next = fnext;
|
||||||
|
file->variables->next = file->patvar->vars;
|
||||||
|
}
|
||||||
result = variable_expand (line);
|
result = variable_expand (line);
|
||||||
current_variable_set_list = save;
|
current_variable_set_list = save;
|
||||||
reading_filename = 0;
|
reading_filename = 0;
|
||||||
reading_lineno_ptr = 0;
|
reading_lineno_ptr = 0;
|
||||||
|
file->variables->next = fnext;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
77
file.c
77
file.c
@@ -1,5 +1,5 @@
|
|||||||
/* Target file hash table management for GNU Make.
|
/* Target file hash table management for GNU Make.
|
||||||
Copyright (C) 1988,89,90,91,92,93,94,95,96 Free Software Foundation, Inc.
|
Copyright (C) 1988,89,90,91,92,93,94,95,96,97 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
|
||||||
@@ -49,6 +49,9 @@ lookup_file (name)
|
|||||||
register struct file *f;
|
register struct file *f;
|
||||||
register char *n;
|
register char *n;
|
||||||
register unsigned int hashval;
|
register unsigned int hashval;
|
||||||
|
#ifdef VMS
|
||||||
|
register char *lname, *ln;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (*name == '\0')
|
if (*name == '\0')
|
||||||
abort ();
|
abort ();
|
||||||
@@ -57,6 +60,12 @@ lookup_file (name)
|
|||||||
for names read from makefiles. It is here for names passed
|
for names read from makefiles. It is here for names passed
|
||||||
on the command line. */
|
on the command line. */
|
||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
|
lname = (char *)malloc(strlen(name) + 1);
|
||||||
|
for (n=name, ln=lname; *n != '\0'; ++n, ++ln)
|
||||||
|
*ln = isupper(*n) ? tolower(*n) : *n;
|
||||||
|
*ln = '\0';
|
||||||
|
name = lname;
|
||||||
|
|
||||||
while (name[0] == '[' && name[1] == ']' && name[2] != '\0')
|
while (name[0] == '[' && name[1] == ']' && name[2] != '\0')
|
||||||
name += 2;
|
name += 2;
|
||||||
#endif
|
#endif
|
||||||
@@ -87,11 +96,17 @@ lookup_file (name)
|
|||||||
|
|
||||||
for (f = files[hashval]; f != 0; f = f->next)
|
for (f = files[hashval]; f != 0; f = f->next)
|
||||||
{
|
{
|
||||||
if (strieq (f->name, name))
|
if (strieq (f->hname, name))
|
||||||
{
|
{
|
||||||
|
#ifdef VMS
|
||||||
|
free (lname);
|
||||||
|
#endif
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#ifdef VMS
|
||||||
|
free (lname);
|
||||||
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -128,7 +143,7 @@ enter_file (name)
|
|||||||
hashval %= FILE_BUCKETS;
|
hashval %= FILE_BUCKETS;
|
||||||
|
|
||||||
for (f = files[hashval]; f != 0; f = f->next)
|
for (f = files[hashval]; f != 0; f = f->next)
|
||||||
if (strieq (f->name, name))
|
if (strieq (f->hname, name))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (f != 0 && !f->double_colon)
|
if (f != 0 && !f->double_colon)
|
||||||
@@ -141,7 +156,7 @@ enter_file (name)
|
|||||||
|
|
||||||
new = (struct file *) xmalloc (sizeof (struct file));
|
new = (struct file *) xmalloc (sizeof (struct file));
|
||||||
bzero ((char *) new, sizeof (struct file));
|
bzero ((char *) new, sizeof (struct file));
|
||||||
new->name = name;
|
new->name = new->hname = name;
|
||||||
new->update_status = -1;
|
new->update_status = -1;
|
||||||
|
|
||||||
if (f == 0)
|
if (f == 0)
|
||||||
@@ -162,16 +177,16 @@ enter_file (name)
|
|||||||
return new;
|
return new;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Rename FILE to NAME. This is not as simple as resetting
|
/* Rehash FILE to NAME. This is not as simple as resetting
|
||||||
the `name' member, since it must be put in a new hash bucket,
|
the `hname' member, since it must be put in a new hash bucket,
|
||||||
and possibly merged with an existing file called NAME. */
|
and possibly merged with an existing file called NAME. */
|
||||||
|
|
||||||
void
|
void
|
||||||
rename_file (file, name)
|
rehash_file (file, name)
|
||||||
register struct file *file;
|
register struct file *file;
|
||||||
char *name;
|
char *name;
|
||||||
{
|
{
|
||||||
char *oldname = file->name;
|
char *oldname = file->hname;
|
||||||
register unsigned int oldhash;
|
register unsigned int oldhash;
|
||||||
register char *n;
|
register char *n;
|
||||||
|
|
||||||
@@ -187,6 +202,23 @@ rename_file (file, name)
|
|||||||
file_hash_enter (file, name, oldhash, file->name);
|
file_hash_enter (file, name, oldhash, file->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Rename FILE to NAME. This is not as simple as resetting
|
||||||
|
the `name' member, since it must be put in a new hash bucket,
|
||||||
|
and possibly merged with an existing file called NAME. */
|
||||||
|
|
||||||
|
void
|
||||||
|
rename_file (file, name)
|
||||||
|
register struct file *file;
|
||||||
|
char *name;
|
||||||
|
{
|
||||||
|
rehash_file(file, name);
|
||||||
|
while (file)
|
||||||
|
{
|
||||||
|
file->name = file->hname;
|
||||||
|
file = file->prev;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
file_hash_enter (file, name, oldhash, oldname)
|
file_hash_enter (file, name, oldhash, oldname)
|
||||||
register struct file *file;
|
register struct file *file;
|
||||||
@@ -208,9 +240,12 @@ file_hash_enter (file, name, oldhash, oldname)
|
|||||||
/* Look for an existing file under the new name. */
|
/* Look for an existing file under the new name. */
|
||||||
|
|
||||||
for (oldfile = files[newbucket]; oldfile != 0; oldfile = oldfile->next)
|
for (oldfile = files[newbucket]; oldfile != 0; oldfile = oldfile->next)
|
||||||
if (strieq (oldfile->name, name))
|
if (strieq (oldfile->hname, name))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
/* If the old file is the same as the new file, something's wrong. */
|
||||||
|
assert (oldfile != file);
|
||||||
|
|
||||||
if (oldhash != 0 && (newbucket != oldbucket || oldfile != 0))
|
if (oldhash != 0 && (newbucket != oldbucket || oldfile != 0))
|
||||||
{
|
{
|
||||||
/* Remove FILE from its hash bucket. */
|
/* Remove FILE from its hash bucket. */
|
||||||
@@ -228,9 +263,9 @@ file_hash_enter (file, name, oldhash, oldname)
|
|||||||
|
|
||||||
/* Give FILE its new name. */
|
/* Give FILE its new name. */
|
||||||
|
|
||||||
file->name = name;
|
file->hname = name;
|
||||||
for (f = file->double_colon; f != 0; f = f->prev)
|
for (f = file->double_colon; f != 0; f = f->prev)
|
||||||
f->name = name;
|
f->hname = name;
|
||||||
|
|
||||||
if (oldfile == 0)
|
if (oldfile == 0)
|
||||||
{
|
{
|
||||||
@@ -319,6 +354,7 @@ in favor of those for `%s'.",
|
|||||||
MERGE (is_target);
|
MERGE (is_target);
|
||||||
MERGE (cmd_target);
|
MERGE (cmd_target);
|
||||||
MERGE (phony);
|
MERGE (phony);
|
||||||
|
MERGE (ignore_vpath);
|
||||||
#undef MERGE
|
#undef MERGE
|
||||||
|
|
||||||
file->renamed = oldfile;
|
file->renamed = oldfile;
|
||||||
@@ -353,9 +389,9 @@ remove_intermediates (sig)
|
|||||||
if (f->update_status == -1)
|
if (f->update_status == -1)
|
||||||
/* If nothing would have created this file yet,
|
/* If nothing would have created this file yet,
|
||||||
don't print an "rm" command for it. */
|
don't print an "rm" command for it. */
|
||||||
continue;
|
continue;
|
||||||
else if (just_print_flag)
|
else if (just_print_flag)
|
||||||
status = 0;
|
status = 0;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
status = unlink (f->name);
|
status = unlink (f->name);
|
||||||
@@ -520,9 +556,7 @@ print_file (f)
|
|||||||
struct file *f;
|
struct file *f;
|
||||||
{
|
{
|
||||||
register struct dep *d;
|
register struct dep *d;
|
||||||
#ifdef VMS
|
|
||||||
extern char *cvt_time PARAMS ((unsigned long));
|
|
||||||
#endif
|
|
||||||
putchar ('\n');
|
putchar ('\n');
|
||||||
if (!f->is_target)
|
if (!f->is_target)
|
||||||
puts ("# Not a target:");
|
puts ("# Not a target:");
|
||||||
@@ -558,13 +592,8 @@ print_file (f)
|
|||||||
else if (f->last_mtime == (time_t) -1)
|
else if (f->last_mtime == (time_t) -1)
|
||||||
puts ("# File does not exist.");
|
puts ("# File does not exist.");
|
||||||
else
|
else
|
||||||
#ifdef VMS
|
|
||||||
printf ("# Last modified %.24s (%0lx)\n",
|
|
||||||
cvt_time(f->last_mtime), (unsigned long) f->last_mtime);
|
|
||||||
#else
|
|
||||||
printf ("# Last modified %.24s (%ld)\n",
|
printf ("# Last modified %.24s (%ld)\n",
|
||||||
ctime (&f->last_mtime), (long int) f->last_mtime);
|
ctime (&f->last_mtime), (long int) f->last_mtime);
|
||||||
#endif
|
|
||||||
printf ("# File has%s been updated.\n",
|
printf ("# File has%s been updated.\n",
|
||||||
f->updated ? "" : " not");
|
f->updated ? "" : " not");
|
||||||
switch (f->command_state)
|
switch (f->command_state)
|
||||||
@@ -646,8 +675,8 @@ print_file_data_base ()
|
|||||||
{
|
{
|
||||||
printf ("\n# %u files in %u hash buckets.\n", nfiles, FILE_BUCKETS);
|
printf ("\n# %u files in %u hash buckets.\n", nfiles, FILE_BUCKETS);
|
||||||
#ifndef NO_FLOAT
|
#ifndef NO_FLOAT
|
||||||
printf ("# average %.1f files per bucket, max %u files in one bucket.\n",
|
printf ("# average %.3f files per bucket, max %u files in one bucket.\n",
|
||||||
((double) nfiles) / ((double) FILE_BUCKETS) * 100.0, per_bucket);
|
((double) nfiles) / ((double) FILE_BUCKETS), per_bucket);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
24
filedef.h
24
filedef.h
@@ -1,5 +1,5 @@
|
|||||||
/* Definition of target file data structures for GNU Make.
|
/* Definition of target file data structures 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,97 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,8 @@ struct file
|
|||||||
{
|
{
|
||||||
struct file *next;
|
struct file *next;
|
||||||
char *name;
|
char *name;
|
||||||
|
char *hname; /* Hashed filename */
|
||||||
|
char *vpath; /* VPATH/vpath pathname */
|
||||||
struct dep *deps;
|
struct dep *deps;
|
||||||
struct commands *cmds; /* Commands to execute for this target. */
|
struct commands *cmds; /* Commands to execute for this target. */
|
||||||
int command_flags; /* Flags OR'd in for cmds; see commands.h. */
|
int command_flags; /* Flags OR'd in for cmds; see commands.h. */
|
||||||
@@ -50,6 +52,10 @@ struct file
|
|||||||
the same file. Otherwise this is null. */
|
the same file. Otherwise this is null. */
|
||||||
struct file *double_colon;
|
struct file *double_colon;
|
||||||
|
|
||||||
|
/* Pattern-specific variable reference for this target, or null if there
|
||||||
|
isn't one. Also see the pat_searched flag, below. */
|
||||||
|
struct pattern_var *patvar;
|
||||||
|
|
||||||
short int update_status; /* Status of the last attempt to update,
|
short int update_status; /* Status of the last attempt to update,
|
||||||
or -1 if none has been made. */
|
or -1 if none has been made. */
|
||||||
|
|
||||||
@@ -77,6 +83,10 @@ struct file
|
|||||||
unsigned int secondary:1;
|
unsigned int secondary:1;
|
||||||
unsigned int dontcare:1; /* Nonzero if no complaint is to be made if
|
unsigned int dontcare:1; /* Nonzero if no complaint is to be made if
|
||||||
this target cannot be remade. */
|
this target cannot be remade. */
|
||||||
|
unsigned int shownerror:1; /* Nonzero if we printed an error */
|
||||||
|
unsigned int ignore_vpath:1;/* Nonzero if we threw out VPATH name */
|
||||||
|
unsigned int pat_searched:1;/* Nonzero if we already searched for
|
||||||
|
pattern-specific variables */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Number of intermediate files entered. */
|
/* Number of intermediate files entered. */
|
||||||
@@ -88,7 +98,7 @@ extern struct file *default_goal_file, *suffix_file, *default_file;
|
|||||||
|
|
||||||
extern struct file *lookup_file (), *enter_file ();
|
extern struct file *lookup_file (), *enter_file ();
|
||||||
extern void remove_intermediates (), snap_deps ();
|
extern void remove_intermediates (), snap_deps ();
|
||||||
extern void rename_file (), file_hash_enter ();
|
extern void rename_file (), rehash_file (), file_hash_enter ();
|
||||||
extern void set_command_state ();
|
extern void set_command_state ();
|
||||||
|
|
||||||
|
|
||||||
@@ -111,10 +121,12 @@ extern time_t f_mtime ();
|
|||||||
targets, which need to be considered newer than anything that depends on
|
targets, which need to be considered newer than anything that depends on
|
||||||
them, even if said dependents' modtimes are in the future.
|
them, even if said dependents' modtimes are in the future.
|
||||||
|
|
||||||
NOTE: This assumes 32-bit `time_t's, but I cannot think of a portable way
|
If time_t is unsigned, its maximum value is the same as "(time_t) -1",
|
||||||
to produce the largest representable integer of a given signed type. */
|
so use one less than that, because -1 is used for non-existing files. */
|
||||||
#define NEW_MTIME ((time_t) 0x7fffffff)
|
#define NEW_MTIME \
|
||||||
|
(INTEGER_TYPE_SIGNED (time_t) \
|
||||||
|
? INTEGER_TYPE_MAXIMUM (time_t) \
|
||||||
|
: (INTEGER_TYPE_MAXIMUM (time_t) - 1))
|
||||||
|
|
||||||
#define check_renamed(file) \
|
#define check_renamed(file) \
|
||||||
while ((file)->renamed != 0) (file) = (file)->renamed /* No ; here. */
|
while ((file)->renamed != 0) (file) = (file)->renamed /* No ; here. */
|
||||||
|
|||||||
504
function.c
504
function.c
@@ -1,5 +1,5 @@
|
|||||||
/* Variable function expansion for GNU Make.
|
/* Variable function expansion for GNU Make.
|
||||||
Copyright (C) 1988, 89, 91, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
|
Copyright (C) 1988,89,91,92,93,94,95,96,97 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,14 +23,10 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||||||
#include "job.h"
|
#include "job.h"
|
||||||
#include "commands.h"
|
#include "commands.h"
|
||||||
|
|
||||||
#ifdef __MSDOS__
|
|
||||||
#include <process.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#endif
|
|
||||||
#ifdef _AMIGA
|
#ifdef _AMIGA
|
||||||
#include "amiga.h"
|
#include "amiga.h"
|
||||||
#endif
|
#endif
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
#include "sub_proc.h"
|
#include "sub_proc.h"
|
||||||
@@ -123,7 +119,7 @@ patsubst_expand (o, text, pattern, replace, pattern_percent, replace_percent)
|
|||||||
register char *pattern_percent, *replace_percent;
|
register char *pattern_percent, *replace_percent;
|
||||||
{
|
{
|
||||||
unsigned int pattern_prepercent_len, pattern_postpercent_len;
|
unsigned int pattern_prepercent_len, pattern_postpercent_len;
|
||||||
unsigned int replace_prepercent_len, replace_postpercent_len;
|
unsigned int replace_prepercent_len, replace_postpercent_len = 0;
|
||||||
char *t;
|
char *t;
|
||||||
unsigned int len;
|
unsigned int len;
|
||||||
int doneany = 0;
|
int doneany = 0;
|
||||||
@@ -164,14 +160,14 @@ patsubst_expand (o, text, pattern, replace, pattern_percent, replace_percent)
|
|||||||
if (len < pattern_prepercent_len + pattern_postpercent_len)
|
if (len < pattern_prepercent_len + pattern_postpercent_len)
|
||||||
fail = 1;
|
fail = 1;
|
||||||
|
|
||||||
/* Does the prefix match? */
|
/* Does the prefix match? */
|
||||||
if (!fail && pattern_prepercent_len > 0
|
if (!fail && pattern_prepercent_len > 0
|
||||||
&& (*t != *pattern
|
&& (*t != *pattern
|
||||||
|| t[pattern_prepercent_len - 1] != pattern_percent[-1]
|
|| t[pattern_prepercent_len - 1] != pattern_percent[-1]
|
||||||
|| strncmp (t + 1, pattern + 1, pattern_prepercent_len - 1)))
|
|| strncmp (t + 1, pattern + 1, pattern_prepercent_len - 1)))
|
||||||
fail = 1;
|
fail = 1;
|
||||||
|
|
||||||
/* Does the suffix match? */
|
/* Does the suffix match? */
|
||||||
if (!fail && pattern_postpercent_len > 0
|
if (!fail && pattern_postpercent_len > 0
|
||||||
&& (t[len - 1] != pattern_percent[pattern_postpercent_len]
|
&& (t[len - 1] != pattern_percent[pattern_postpercent_len]
|
||||||
|| t[len - pattern_postpercent_len] != pattern_percent[1]
|
|| t[len - pattern_postpercent_len] != pattern_percent[1]
|
||||||
@@ -235,6 +231,7 @@ enum function
|
|||||||
function_firstword,
|
function_firstword,
|
||||||
function_word,
|
function_word,
|
||||||
function_words,
|
function_words,
|
||||||
|
function_wordlist,
|
||||||
function_findstring,
|
function_findstring,
|
||||||
function_strip,
|
function_strip,
|
||||||
function_join,
|
function_join,
|
||||||
@@ -271,6 +268,7 @@ static struct
|
|||||||
{ "firstword", 9, function_firstword },
|
{ "firstword", 9, function_firstword },
|
||||||
{ "word", 4, function_word },
|
{ "word", 4, function_word },
|
||||||
{ "words", 5, function_words },
|
{ "words", 5, function_words },
|
||||||
|
{ "wordlist", 8, function_wordlist },
|
||||||
{ "findstring", 10, function_findstring },
|
{ "findstring", 10, function_findstring },
|
||||||
{ "strip", 5, function_strip },
|
{ "strip", 5, function_strip },
|
||||||
{ "join", 4, function_join },
|
{ "join", 4, function_join },
|
||||||
@@ -284,13 +282,13 @@ static struct
|
|||||||
{ 0, 0, function_invalid }
|
{ 0, 0, function_invalid }
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Return 1 if PATTERN matches WORD, 0 if not. */
|
/* Return 1 if PATTERN matches STR, 0 if not. */
|
||||||
|
|
||||||
int
|
int
|
||||||
pattern_matches (pattern, percent, word)
|
pattern_matches (pattern, percent, str)
|
||||||
register char *pattern, *percent, *word;
|
register char *pattern, *percent, *str;
|
||||||
{
|
{
|
||||||
unsigned int sfxlen, wordlen;
|
unsigned int sfxlen, strlength;
|
||||||
|
|
||||||
if (percent == 0)
|
if (percent == 0)
|
||||||
{
|
{
|
||||||
@@ -300,17 +298,17 @@ pattern_matches (pattern, percent, word)
|
|||||||
pattern = new;
|
pattern = new;
|
||||||
percent = find_percent (pattern);
|
percent = find_percent (pattern);
|
||||||
if (percent == 0)
|
if (percent == 0)
|
||||||
return streq (pattern, word);
|
return streq (pattern, str);
|
||||||
}
|
}
|
||||||
|
|
||||||
sfxlen = strlen (percent + 1);
|
sfxlen = strlen (percent + 1);
|
||||||
wordlen = strlen (word);
|
strlength = strlen (str);
|
||||||
|
|
||||||
if (wordlen < (percent - pattern) + sfxlen
|
if (strlength < (percent - pattern) + sfxlen
|
||||||
|| strncmp (pattern, word, percent - pattern))
|
|| strncmp (pattern, str, percent - pattern))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return !strcmp (percent + 1, word + (wordlen - sfxlen));
|
return !strcmp (percent + 1, str + (strlength - sfxlen));
|
||||||
}
|
}
|
||||||
|
|
||||||
int shell_function_pid = 0, shell_function_completed;
|
int shell_function_pid = 0, shell_function_completed;
|
||||||
@@ -320,13 +318,13 @@ int shell_function_pid = 0, shell_function_completed;
|
|||||||
The output is written into VARIABLE_BUFFER starting at O. */
|
The output is written into VARIABLE_BUFFER starting at O. */
|
||||||
|
|
||||||
/* Note this absorbs a semicolon and is safe to use in conditionals. */
|
/* Note this absorbs a semicolon and is safe to use in conditionals. */
|
||||||
#define BADARGS(func) \
|
#define BADARGS(func) do { \
|
||||||
if (reading_filename != 0) \
|
if (reading_filename != 0) \
|
||||||
makefile_fatal (reading_filename, *reading_lineno_ptr, \
|
makefile_fatal (reading_filename, *reading_lineno_ptr, \
|
||||||
"insufficient arguments to function `%s'", \
|
"insufficient arguments to function `%s'", \
|
||||||
func); \
|
func); \
|
||||||
else \
|
else \
|
||||||
fatal ("insufficient arguments to function `%s'", func)
|
fatal ("insufficient arguments to function `%s'", func); } while (0)
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
expand_function (o, function, text, end)
|
expand_function (o, function, text, end)
|
||||||
@@ -336,7 +334,7 @@ expand_function (o, function, text, end)
|
|||||||
char *end;
|
char *end;
|
||||||
{
|
{
|
||||||
char *p, *p2, *p3;
|
char *p, *p2, *p3;
|
||||||
unsigned int i, len;
|
unsigned int i, j, len;
|
||||||
int doneany = 0;
|
int doneany = 0;
|
||||||
int count;
|
int count;
|
||||||
char endparen = *end, startparen = *end == ')' ? '(' : '{';
|
char endparen = *end, startparen = *end == ')' ? '(' : '{';
|
||||||
@@ -350,13 +348,17 @@ expand_function (o, function, text, end)
|
|||||||
#ifndef VMS /* not supported for vms yet */
|
#ifndef VMS /* not supported for vms yet */
|
||||||
case function_shell:
|
case function_shell:
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
char* batch_filename = NULL;
|
||||||
SECURITY_ATTRIBUTES saAttr;
|
#ifdef WINDOWS32
|
||||||
HANDLE hIn;
|
SECURITY_ATTRIBUTES saAttr;
|
||||||
HANDLE hErr;
|
HANDLE hIn;
|
||||||
HANDLE hChildOutRd;
|
HANDLE hErr;
|
||||||
HANDLE hChildOutWr;
|
HANDLE hChildOutRd;
|
||||||
HANDLE hProcess;
|
HANDLE hChildOutWr;
|
||||||
|
HANDLE hProcess;
|
||||||
|
#endif
|
||||||
|
#ifdef __MSDOS__
|
||||||
|
FILE *fpipe;
|
||||||
#endif
|
#endif
|
||||||
char **argv;
|
char **argv;
|
||||||
char *error_prefix;
|
char *error_prefix;
|
||||||
@@ -369,15 +371,17 @@ expand_function (o, function, text, end)
|
|||||||
/* Expand the command line. */
|
/* Expand the command line. */
|
||||||
text = expand_argument (text, end);
|
text = expand_argument (text, end);
|
||||||
|
|
||||||
|
#ifndef __MSDOS__
|
||||||
/* Construct the argument list. */
|
/* Construct the argument list. */
|
||||||
argv = construct_command_argv (text,
|
argv = construct_command_argv (text,
|
||||||
(char **) NULL, (struct file *) 0);
|
(char **) NULL, (struct file *) 0, &batch_filename);
|
||||||
if (argv == 0)
|
if (argv == 0)
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef _AMIGA
|
#ifndef _AMIGA
|
||||||
/* Using a target environment for `shell' loses in cases like:
|
/* Using a target environment for `shell' loses in cases like:
|
||||||
export var = $(shell echo foobie)
|
export var = $(shell echo foobie)
|
||||||
because target_environment hits a loop trying to expand $(var)
|
because target_environment hits a loop trying to expand $(var)
|
||||||
to put it in the environment. This is even more confusing when
|
to put it in the environment. This is even more confusing when
|
||||||
var was not explicitly exported, but just appeared in the
|
var was not explicitly exported, but just appeared in the
|
||||||
@@ -388,7 +392,7 @@ expand_function (o, function, text, end)
|
|||||||
/* Construct the environment. */
|
/* Construct the environment. */
|
||||||
envp = target_environment ((struct file *) 0);
|
envp = target_environment ((struct file *) 0);
|
||||||
#endif
|
#endif
|
||||||
#endif /* Not Amiga. */
|
#endif /* Not Amiga. */
|
||||||
|
|
||||||
/* For error messages. */
|
/* For error messages. */
|
||||||
if (reading_filename != 0)
|
if (reading_filename != 0)
|
||||||
@@ -400,81 +404,129 @@ expand_function (o, function, text, end)
|
|||||||
else
|
else
|
||||||
error_prefix = "";
|
error_prefix = "";
|
||||||
|
|
||||||
#if !defined(__MSDOS__) && !defined(_AMIGA)
|
#ifndef _AMIGA
|
||||||
# ifdef WIN32
|
# ifdef WINDOWS32
|
||||||
saAttr.nLength = sizeof(SECURITY_ATTRIBUTES);
|
saAttr.nLength = sizeof(SECURITY_ATTRIBUTES);
|
||||||
saAttr.bInheritHandle = TRUE;
|
saAttr.bInheritHandle = TRUE;
|
||||||
saAttr.lpSecurityDescriptor = NULL;
|
saAttr.lpSecurityDescriptor = NULL;
|
||||||
|
|
||||||
if (DuplicateHandle(GetCurrentProcess(),
|
if (DuplicateHandle(GetCurrentProcess(),
|
||||||
GetStdHandle(STD_INPUT_HANDLE),
|
GetStdHandle(STD_INPUT_HANDLE),
|
||||||
GetCurrentProcess(),
|
GetCurrentProcess(),
|
||||||
&hIn,
|
&hIn,
|
||||||
0,
|
0,
|
||||||
TRUE,
|
TRUE,
|
||||||
DUPLICATE_SAME_ACCESS) == FALSE) {
|
DUPLICATE_SAME_ACCESS) == FALSE) {
|
||||||
fatal("create_child_process: DuplicateHandle(In) failed (e=%d)\n",
|
fatal("create_child_process: DuplicateHandle(In) failed (e=%d)\n",
|
||||||
GetLastError());
|
GetLastError());
|
||||||
}
|
}
|
||||||
if (DuplicateHandle(GetCurrentProcess(),
|
if (DuplicateHandle(GetCurrentProcess(),
|
||||||
GetStdHandle(STD_ERROR_HANDLE),
|
GetStdHandle(STD_ERROR_HANDLE),
|
||||||
GetCurrentProcess(),
|
GetCurrentProcess(),
|
||||||
&hErr,
|
&hErr,
|
||||||
0,
|
0,
|
||||||
TRUE,
|
TRUE,
|
||||||
DUPLICATE_SAME_ACCESS) == FALSE) {
|
DUPLICATE_SAME_ACCESS) == FALSE) {
|
||||||
fatal("create_child_process: DuplicateHandle(Err) failed (e=%d)\n",
|
fatal("create_child_process: DuplicateHandle(Err) failed (e=%d)\n",
|
||||||
GetLastError());
|
GetLastError());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!CreatePipe(&hChildOutRd, &hChildOutWr, &saAttr, 0))
|
if (!CreatePipe(&hChildOutRd, &hChildOutWr, &saAttr, 0))
|
||||||
fatal("CreatePipe() failed (e=%d)\n", GetLastError());
|
fatal("CreatePipe() failed (e=%d)\n", GetLastError());
|
||||||
|
|
||||||
hProcess = process_init_fd(hIn, hChildOutWr, hErr);
|
hProcess = process_init_fd(hIn, hChildOutWr, hErr);
|
||||||
|
|
||||||
if (!hProcess)
|
if (!hProcess)
|
||||||
fatal("expand_function: process_init_fd() failed\n");
|
fatal("expand_function: process_init_fd() failed\n");
|
||||||
else
|
else
|
||||||
process_register(hProcess);
|
process_register(hProcess);
|
||||||
|
|
||||||
/* make sure that CreateProcess() has Path it needs */
|
/* make sure that CreateProcess() has Path it needs */
|
||||||
sync_Path_environment();
|
sync_Path_environment();
|
||||||
|
|
||||||
if (!process_begin(hProcess, argv, envp, argv[0], NULL))
|
if (!process_begin(hProcess, argv, envp, argv[0], NULL))
|
||||||
pid = (int) hProcess;
|
pid = (int) hProcess;
|
||||||
else
|
else
|
||||||
fatal("expand_function: unable to launch process (e=%d)\n",
|
fatal("expand_function: unable to launch process (e=%d)\n",
|
||||||
process_last_err(hProcess));
|
process_last_err(hProcess));
|
||||||
|
|
||||||
/* set up to read data from child */
|
/* set up to read data from child */
|
||||||
pipedes[0] = _open_osfhandle((long) hChildOutRd, O_RDONLY);
|
pipedes[0] = _open_osfhandle((long) hChildOutRd, O_RDONLY);
|
||||||
|
|
||||||
/* this will be closed almost right away */
|
/* this will be closed almost right away */
|
||||||
pipedes[1] = _open_osfhandle((long) hChildOutWr, O_APPEND);
|
pipedes[1] = _open_osfhandle((long) hChildOutWr, O_APPEND);
|
||||||
# else /* WIN32 */
|
# else /* WINDOWS32 */
|
||||||
|
# ifdef __MSDOS__
|
||||||
|
{
|
||||||
|
/* MSDOS can't fork, but it has `popen'.
|
||||||
|
(Bwt, why isn't `popen' used in all the versions?) */
|
||||||
|
struct variable *sh = lookup_variable ("SHELL", 5);
|
||||||
|
int e;
|
||||||
|
extern int dos_command_running, dos_status;
|
||||||
|
|
||||||
|
/* Make sure not to bother processing an empty line. */
|
||||||
|
while (isblank (*text))
|
||||||
|
++text;
|
||||||
|
if (*text == '\0')
|
||||||
|
break;
|
||||||
|
|
||||||
|
if (sh)
|
||||||
|
{
|
||||||
|
char buf[PATH_MAX + 7];
|
||||||
|
/* This makes sure $SHELL value is used by $(shell), even
|
||||||
|
though the target environment is not passed to it. */
|
||||||
|
sprintf (buf, "SHELL=%s", sh->value);
|
||||||
|
putenv (buf);
|
||||||
|
}
|
||||||
|
|
||||||
|
e = errno;
|
||||||
|
errno = 0;
|
||||||
|
dos_command_running = 1;
|
||||||
|
dos_status = 0;
|
||||||
|
fpipe = popen (text, "rt");
|
||||||
|
dos_command_running = 0;
|
||||||
|
if (!fpipe || dos_status)
|
||||||
|
{
|
||||||
|
pipedes[0] = -1;
|
||||||
|
pid = -1;
|
||||||
|
if (dos_status)
|
||||||
|
errno = EINTR;
|
||||||
|
else if (errno == 0)
|
||||||
|
errno = ENOMEM;
|
||||||
|
shell_function_completed = -1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pipedes[0] = fileno (fpipe);
|
||||||
|
pid = 42;
|
||||||
|
errno = e;
|
||||||
|
shell_function_completed = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (pipedes[0] < 0)
|
||||||
|
# else /* ! __MSDOS__ */
|
||||||
if (pipe (pipedes) < 0)
|
if (pipe (pipedes) < 0)
|
||||||
|
# endif /* __MSDOS__ */
|
||||||
{
|
{
|
||||||
perror_with_name (error_prefix, "pipe");
|
perror_with_name (error_prefix, "pipe");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# ifndef __MSDOS__
|
||||||
pid = vfork ();
|
pid = vfork ();
|
||||||
if (pid < 0)
|
if (pid < 0)
|
||||||
perror_with_name (error_prefix, "fork");
|
perror_with_name (error_prefix, "fork");
|
||||||
else if (pid == 0)
|
else if (pid == 0)
|
||||||
child_execute_job (0, pipedes[1], argv, envp);
|
child_execute_job (0, pipedes[1], argv, envp);
|
||||||
else
|
else
|
||||||
# endif /* WIN32 */
|
# endif /* ! __MSDOS__ */
|
||||||
|
# endif /* WINDOWS32 */
|
||||||
{
|
{
|
||||||
/* We are the parent. */
|
/* We are the parent. */
|
||||||
|
|
||||||
char *buffer;
|
char *buffer;
|
||||||
unsigned int maxlen;
|
unsigned int maxlen;
|
||||||
int cc;
|
int cc;
|
||||||
|
|
||||||
/* Free the storage only the child needed. */
|
|
||||||
free (argv[0]);
|
|
||||||
free ((char *) argv);
|
|
||||||
#if 0
|
#if 0
|
||||||
for (i = 0; envp[i] != 0; ++i)
|
for (i = 0; envp[i] != 0; ++i)
|
||||||
free (envp[i]);
|
free (envp[i]);
|
||||||
@@ -483,17 +535,22 @@ expand_function (o, function, text, end)
|
|||||||
|
|
||||||
/* Record the PID for reap_children. */
|
/* Record the PID for reap_children. */
|
||||||
shell_function_pid = pid;
|
shell_function_pid = pid;
|
||||||
|
#ifndef __MSDOS__
|
||||||
shell_function_completed = 0;
|
shell_function_completed = 0;
|
||||||
|
|
||||||
|
/* Free the storage only the child needed. */
|
||||||
|
free (argv[0]);
|
||||||
|
free ((char *) argv);
|
||||||
|
|
||||||
|
/* Close the write side of the pipe. */
|
||||||
|
(void) close (pipedes[1]);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Set up and read from the pipe. */
|
/* Set up and read from the pipe. */
|
||||||
|
|
||||||
maxlen = 200;
|
maxlen = 200;
|
||||||
buffer = (char *) xmalloc (maxlen + 1);
|
buffer = (char *) xmalloc (maxlen + 1);
|
||||||
|
|
||||||
/* Close the write side of the pipe. */
|
|
||||||
(void) close (pipedes[1]);
|
|
||||||
|
|
||||||
/* Read from the pipe until it gets EOF. */
|
/* Read from the pipe until it gets EOF. */
|
||||||
i = 0;
|
i = 0;
|
||||||
do
|
do
|
||||||
@@ -516,13 +573,24 @@ expand_function (o, function, text, end)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Close the read side of the pipe. */
|
/* Close the read side of the pipe. */
|
||||||
|
#ifdef __MSDOS__
|
||||||
|
if (fpipe)
|
||||||
|
(void) pclose (fpipe);
|
||||||
|
#else
|
||||||
(void) close (pipedes[0]);
|
(void) close (pipedes[0]);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Loop until child_handler sets shell_function_completed
|
/* Loop until child_handler sets shell_function_completed
|
||||||
to the status of our child shell. */
|
to the status of our child shell. */
|
||||||
while (shell_function_completed == 0)
|
while (shell_function_completed == 0)
|
||||||
reap_children (1, 0);
|
reap_children (1, 0);
|
||||||
|
|
||||||
|
if (batch_filename) {
|
||||||
|
if (debug_flag)
|
||||||
|
printf("Cleaning up temporary batch file %s\n", batch_filename);
|
||||||
|
remove(batch_filename);
|
||||||
|
free(batch_filename);
|
||||||
|
}
|
||||||
shell_function_pid = 0;
|
shell_function_pid = 0;
|
||||||
|
|
||||||
/* The child_handler function will set shell_function_completed
|
/* The child_handler function will set shell_function_completed
|
||||||
@@ -545,85 +613,41 @@ expand_function (o, function, text, end)
|
|||||||
if (i > 0)
|
if (i > 0)
|
||||||
{
|
{
|
||||||
if (buffer[i - 1] == '\n')
|
if (buffer[i - 1] == '\n')
|
||||||
buffer[--i] = '\0';
|
{
|
||||||
|
if (i > 1 && buffer[i - 2] == '\r')
|
||||||
|
--i;
|
||||||
|
buffer[--i] = '\0';
|
||||||
|
}
|
||||||
else
|
else
|
||||||
buffer[i] = '\0';
|
buffer[i] = '\0';
|
||||||
|
|
||||||
p = buffer;
|
p = buffer;
|
||||||
while ((p = index (p, '\n')) != 0)
|
for (p2=p; *p != '\0'; ++p)
|
||||||
*p++ = ' ';
|
{
|
||||||
|
if (p[0] == '\r' && p[1] == '\n')
|
||||||
|
continue;
|
||||||
|
if (*p == '\n')
|
||||||
|
*p2++ = ' ';
|
||||||
|
else
|
||||||
|
*p2++ = *p;
|
||||||
|
}
|
||||||
|
*p2 = '\0';
|
||||||
o = variable_buffer_output (o, buffer, i);
|
o = variable_buffer_output (o, buffer, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
free (buffer);
|
free (buffer);
|
||||||
}
|
}
|
||||||
#else /* MSDOS or Amiga */
|
#else /* Amiga */
|
||||||
#ifndef _AMIGA
|
|
||||||
{
|
|
||||||
/* MS-DOS can't do fork, but it can do spawn. However, this
|
|
||||||
means that we don't have an opportunity to reopen stdout to
|
|
||||||
trap it. Thus, we save our own stdout onto a new descriptor
|
|
||||||
and dup a temp file's descriptor onto our stdout temporarily.
|
|
||||||
After we spawn the shell program, we dup our own stdout back
|
|
||||||
to the stdout descriptor. The buffer reading is the same as
|
|
||||||
above, except that we're now reading from a file. */
|
|
||||||
|
|
||||||
int save_stdout;
|
|
||||||
int child_stdout;
|
|
||||||
char tmp_output[FILENAME_MAX];
|
|
||||||
FILE *child_stream;
|
|
||||||
unsigned int maxlen = 200;
|
|
||||||
int cc;
|
|
||||||
char *buffer;
|
|
||||||
|
|
||||||
strcpy (tmp_output, "shXXXXXX");
|
|
||||||
mktemp (tmp_output);
|
|
||||||
child_stdout = open (tmp_output,
|
|
||||||
O_WRONLY|O_CREAT|O_TRUNC|O_TEXT, 0644);
|
|
||||||
save_stdout = dup (1);
|
|
||||||
dup2 (child_stdout, 1);
|
|
||||||
spawnvp (P_WAIT, argv[0], argv);
|
|
||||||
dup2 (save_stdout, 1);
|
|
||||||
close (child_stdout);
|
|
||||||
close (save_stdout);
|
|
||||||
|
|
||||||
child_stdout = open (tmp_output, O_RDONLY|O_TEXT, 0644);
|
|
||||||
|
|
||||||
buffer = xmalloc (maxlen);
|
|
||||||
i = 0;
|
|
||||||
do
|
|
||||||
{
|
|
||||||
if (i == maxlen)
|
|
||||||
{
|
|
||||||
maxlen += 512;
|
|
||||||
buffer = (char *) xrealloc (buffer, maxlen + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
cc = read (child_stdout, &buffer[i], maxlen - i);
|
|
||||||
if (cc > 0)
|
|
||||||
i += cc;
|
|
||||||
} while (cc > 0);
|
|
||||||
|
|
||||||
close (child_stdout);
|
|
||||||
unlink (tmp_output);
|
|
||||||
|
|
||||||
if (i > 0)
|
|
||||||
{
|
|
||||||
if (buffer[i - 1] == '\n')
|
|
||||||
buffer[--i] = '\0';
|
|
||||||
else
|
|
||||||
buffer[i] = '\0';
|
|
||||||
p = buffer;
|
|
||||||
while ((p = index (p, '\n')) != 0)
|
|
||||||
*p++ = ' ';
|
|
||||||
o = variable_buffer_output (o, buffer, i);
|
|
||||||
}
|
|
||||||
free (buffer);
|
|
||||||
}
|
|
||||||
#else /* Amiga */
|
|
||||||
{
|
{
|
||||||
/* Amiga can't fork nor spawn, but I can start a program with
|
/* Amiga can't fork nor spawn, but I can start a program with
|
||||||
redirection of my choice. The rest is the same as above. */
|
redirection of my choice. However, this means that we
|
||||||
|
don't have an opportunity to reopen stdout to trap it. Thus,
|
||||||
|
we save our own stdout onto a new descriptor and dup a temp
|
||||||
|
file's descriptor onto our stdout temporarily. After we
|
||||||
|
spawn the shell program, we dup our own stdout back to the
|
||||||
|
stdout descriptor. The buffer reading is the same as above,
|
||||||
|
except that we're now reading from a file. */
|
||||||
#include <dos/dos.h>
|
#include <dos/dos.h>
|
||||||
#include <proto/dos.h>
|
#include <proto/dos.h>
|
||||||
|
|
||||||
@@ -695,8 +719,7 @@ expand_function (o, function, text, end)
|
|||||||
}
|
}
|
||||||
free (buffer);
|
free (buffer);
|
||||||
}
|
}
|
||||||
#endif /* Not Amiga. */
|
#endif /* Not Amiga. */
|
||||||
#endif /* MSDOS or Amiga. */
|
|
||||||
|
|
||||||
free (text);
|
free (text);
|
||||||
break;
|
break;
|
||||||
@@ -836,6 +859,8 @@ expand_function (o, function, text, end)
|
|||||||
|
|
||||||
push_new_variable_scope ();
|
push_new_variable_scope ();
|
||||||
v = define_variable (var, strlen (var), "", o_automatic, 0);
|
v = define_variable (var, strlen (var), "", o_automatic, 0);
|
||||||
|
free (v->value);
|
||||||
|
v->value = 0;
|
||||||
p3 = list;
|
p3 = list;
|
||||||
while ((p = find_next_token (&p3, &len)) != 0)
|
while ((p = find_next_token (&p3, &len)) != 0)
|
||||||
{
|
{
|
||||||
@@ -866,10 +891,10 @@ expand_function (o, function, text, end)
|
|||||||
case function_filter:
|
case function_filter:
|
||||||
case function_filter_out:
|
case function_filter_out:
|
||||||
{
|
{
|
||||||
struct word
|
struct a_word
|
||||||
{
|
{
|
||||||
struct word *next;
|
struct a_word *next;
|
||||||
char *word;
|
char *str;
|
||||||
int matched;
|
int matched;
|
||||||
} *words, *wordtail, *wp;
|
} *words, *wordtail, *wp;
|
||||||
|
|
||||||
@@ -895,7 +920,7 @@ expand_function (o, function, text, end)
|
|||||||
p3 = text;
|
p3 = text;
|
||||||
while ((p = find_next_token (&p3, &len)) != 0)
|
while ((p = find_next_token (&p3, &len)) != 0)
|
||||||
{
|
{
|
||||||
struct word *w = (struct word *) alloca (sizeof (struct word));
|
struct a_word *w = (struct a_word *)alloca(sizeof(struct a_word));
|
||||||
if (words == 0)
|
if (words == 0)
|
||||||
words = w;
|
words = w;
|
||||||
else
|
else
|
||||||
@@ -905,7 +930,7 @@ expand_function (o, function, text, end)
|
|||||||
if (*p3 != '\0')
|
if (*p3 != '\0')
|
||||||
++p3;
|
++p3;
|
||||||
p[len] = '\0';
|
p[len] = '\0';
|
||||||
w->word = p;
|
w->str = p;
|
||||||
w->matched = 0;
|
w->matched = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -923,8 +948,8 @@ expand_function (o, function, text, end)
|
|||||||
|
|
||||||
percent = find_percent (p);
|
percent = find_percent (p);
|
||||||
for (wp = words; wp != 0; wp = wp->next)
|
for (wp = words; wp != 0; wp = wp->next)
|
||||||
wp->matched |= (percent == 0 ? streq (p, wp->word)
|
wp->matched |= (percent == 0 ? streq (p, wp->str)
|
||||||
: pattern_matches (p, percent, wp->word));
|
: pattern_matches (p, percent, wp->str));
|
||||||
|
|
||||||
p[len] = save;
|
p[len] = save;
|
||||||
}
|
}
|
||||||
@@ -933,7 +958,7 @@ expand_function (o, function, text, end)
|
|||||||
for (wp = words; wp != 0; wp = wp->next)
|
for (wp = words; wp != 0; wp = wp->next)
|
||||||
if (function == function_filter ? wp->matched : !wp->matched)
|
if (function == function_filter ? wp->matched : !wp->matched)
|
||||||
{
|
{
|
||||||
o = variable_buffer_output (o, wp->word, strlen (wp->word));
|
o = variable_buffer_output (o, wp->str, strlen (wp->str));
|
||||||
o = variable_buffer_output (o, " ", 1);
|
o = variable_buffer_output (o, " ", 1);
|
||||||
doneany = 1;
|
doneany = 1;
|
||||||
}
|
}
|
||||||
@@ -1046,8 +1071,15 @@ expand_function (o, function, text, end)
|
|||||||
text = expand_argument (text, end);
|
text = expand_argument (text, end);
|
||||||
|
|
||||||
p2 = text;
|
p2 = text;
|
||||||
while ((p = find_next_token (&p2, &i)) != 0)
|
while (*p2 != '\0')
|
||||||
{
|
{
|
||||||
|
while (isspace(*p2))
|
||||||
|
++p2;
|
||||||
|
p = p2;
|
||||||
|
for (i=0; *p2 != '\0' && !isspace(*p2); ++p2, ++i)
|
||||||
|
{}
|
||||||
|
if (!i)
|
||||||
|
break;
|
||||||
o = variable_buffer_output (o, p, i);
|
o = variable_buffer_output (o, p, i);
|
||||||
o = variable_buffer_output (o, " ", 1);
|
o = variable_buffer_output (o, " ", 1);
|
||||||
doneany = 1;
|
doneany = 1;
|
||||||
@@ -1194,6 +1226,91 @@ index argument");
|
|||||||
free (text);
|
free (text);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case function_wordlist:
|
||||||
|
/* Get two comma-separated arguments and expand each one. */
|
||||||
|
count = 0;
|
||||||
|
for (p = text; p < end; ++p)
|
||||||
|
{
|
||||||
|
if (*p == startparen)
|
||||||
|
++count;
|
||||||
|
else if (*p == endparen)
|
||||||
|
--count;
|
||||||
|
else if (*p == ',' && count <= 0)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (p == end)
|
||||||
|
BADARGS ("wordlist");
|
||||||
|
text = expand_argument (text, p);
|
||||||
|
|
||||||
|
/* Check the first argument. */
|
||||||
|
for (p2 = text; *p2 != '\0'; ++p2)
|
||||||
|
if (*p2 < '0' || *p2 > '9')
|
||||||
|
{
|
||||||
|
if (reading_filename != 0)
|
||||||
|
makefile_fatal (reading_filename, *reading_lineno_ptr,
|
||||||
|
"non-numeric first argument to `wordlist' function");
|
||||||
|
else
|
||||||
|
fatal ("non-numeric first argument to `wordlist' function");
|
||||||
|
}
|
||||||
|
i = (unsigned int)atoi(text);
|
||||||
|
free (text);
|
||||||
|
|
||||||
|
/* Check the next argument */
|
||||||
|
for (p2 = p + 1; isblank(*p2); ++p2)
|
||||||
|
{}
|
||||||
|
count = 0;
|
||||||
|
for (p = p2; p < end; ++p)
|
||||||
|
{
|
||||||
|
if (*p == startparen)
|
||||||
|
++count;
|
||||||
|
else if (*p == endparen)
|
||||||
|
--count;
|
||||||
|
else if (*p == ',' && count <= 0)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (p == end)
|
||||||
|
BADARGS ("wordlist");
|
||||||
|
text = expand_argument (p2, p);
|
||||||
|
|
||||||
|
for (p2 = text; *p2 != '\0'; ++p2)
|
||||||
|
if (*p2 < '0' || *p2 > '9')
|
||||||
|
{
|
||||||
|
if (reading_filename != 0)
|
||||||
|
makefile_fatal (reading_filename, *reading_lineno_ptr,
|
||||||
|
"non-numeric second argument to `wordlist' function");
|
||||||
|
else
|
||||||
|
fatal ("non-numeric second argument to `wordlist' function");
|
||||||
|
}
|
||||||
|
j = (unsigned int)atoi(text);
|
||||||
|
free (text);
|
||||||
|
|
||||||
|
if (j > i)
|
||||||
|
j -= i;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
unsigned int k;
|
||||||
|
k = j;
|
||||||
|
j = i - j;
|
||||||
|
i = k;
|
||||||
|
}
|
||||||
|
++j;
|
||||||
|
|
||||||
|
/* Extract the requested words */
|
||||||
|
text = expand_argument (p + 1, end);
|
||||||
|
p2 = text;
|
||||||
|
|
||||||
|
while (((p = find_next_token (&p2, &len)) != 0) && --i)
|
||||||
|
{}
|
||||||
|
if (p)
|
||||||
|
{
|
||||||
|
while (--j && (find_next_token (&p2, &len) != 0))
|
||||||
|
{}
|
||||||
|
o = variable_buffer_output (o, p, p2 - p);
|
||||||
|
}
|
||||||
|
|
||||||
|
free (text);
|
||||||
|
break;
|
||||||
|
|
||||||
case function_findstring:
|
case function_findstring:
|
||||||
/* Get two comma-separated arguments and expand each one. */
|
/* Get two comma-separated arguments and expand each one. */
|
||||||
count = 0;
|
count = 0;
|
||||||
@@ -1270,25 +1387,35 @@ index argument");
|
|||||||
{
|
{
|
||||||
p = p2 + len;
|
p = p2 + len;
|
||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
while (p >= p2 && *p != (function == function_dir ? ']' : '.'))
|
while (p >= p2 && *p != ']'
|
||||||
|
&& (function != function_basename || *p != '.'))
|
||||||
#else
|
#else
|
||||||
while (p >= p2 && *p != (function == function_dir ? '/' : '.'))
|
# ifdef __MSDOS__
|
||||||
|
while (p >= p2 && *p != '/' && *p != '\\'
|
||||||
|
&& (function != function_basename || *p != '.'))
|
||||||
|
# else
|
||||||
|
while (p >= p2 && *p != '/'
|
||||||
|
&& (function != function_basename || *p != '.'))
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
--p;
|
--p;
|
||||||
if (p >= p2)
|
if (p >= p2 && (function == function_dir))
|
||||||
{
|
o = variable_buffer_output (o, p2, ++p - p2);
|
||||||
if (function == function_dir)
|
else if (p >= p2 && (*p == '.'))
|
||||||
++p;
|
o = variable_buffer_output (o, p2, p - p2);
|
||||||
o = variable_buffer_output (o, p2, p - p2);
|
#if defined(WINDOWS32) || defined(__MSDOS__)
|
||||||
}
|
/* Handle the "d:foobar" case */
|
||||||
|
else if (p2[0] && p2[1] == ':' && function == function_dir)
|
||||||
|
o = variable_buffer_output (o, p2, 2);
|
||||||
|
#endif
|
||||||
else if (function == function_dir)
|
else if (function == function_dir)
|
||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
o = variable_buffer_output (o, "[]", 2);
|
o = variable_buffer_output (o, "[]", 2);
|
||||||
#else
|
#else
|
||||||
#ifndef _AMIGA
|
#ifndef _AMIGA
|
||||||
o = variable_buffer_output (o, "./", 2);
|
o = variable_buffer_output (o, "./", 2);
|
||||||
#else
|
#else
|
||||||
/* o = o */; /* Just a nop... */
|
/* o = o */; /* Just a nop... */
|
||||||
#endif /* AMIGA */
|
#endif /* AMIGA */
|
||||||
#endif /* !VMS */
|
#endif /* !VMS */
|
||||||
else
|
else
|
||||||
@@ -1315,17 +1442,34 @@ index argument");
|
|||||||
{
|
{
|
||||||
p = p2 + len;
|
p = p2 + len;
|
||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
while (p >= p2 && *p != (function == function_notdir ? ']' : '.'))
|
while (p >= p2 && *p != ']'
|
||||||
|
&& (function != function_suffix || *p != '.'))
|
||||||
#else
|
#else
|
||||||
while (p >= p2 && *p != (function == function_notdir ? '/' : '.'))
|
# ifdef __MSDOS__
|
||||||
|
while (p >= p2 && *p != '/' && *p != '\\'
|
||||||
|
&& (function != function_suffix || *p != '.'))
|
||||||
|
# else
|
||||||
|
while (p >= p2 && *p != '/'
|
||||||
|
&& (function != function_suffix || *p != '.'))
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
--p;
|
--p;
|
||||||
if (p >= p2)
|
if (p >= p2)
|
||||||
{
|
{
|
||||||
if (function == function_notdir)
|
if (function == function_notdir)
|
||||||
++p;
|
++p;
|
||||||
|
else if (*p != '.')
|
||||||
|
continue;
|
||||||
o = variable_buffer_output (o, p, len - (p - p2));
|
o = variable_buffer_output (o, p, len - (p - p2));
|
||||||
}
|
}
|
||||||
|
#if defined(WINDOWS32) || defined(__MSDOS__)
|
||||||
|
/* Handle the case of "d:foo/bar". */
|
||||||
|
else if (function == function_notdir && p2[0] && p2[1] == ':')
|
||||||
|
{
|
||||||
|
p = p2 + 2;
|
||||||
|
o = variable_buffer_output (o, p, len - (p - p2));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
else if (function == function_notdir)
|
else if (function == function_notdir)
|
||||||
o = variable_buffer_output (o, p2, len);
|
o = variable_buffer_output (o, p2, len);
|
||||||
|
|
||||||
|
|||||||
808
getloadavg.c
808
getloadavg.c
File diff suppressed because it is too large
Load Diff
133
getopt.h
Normal file
133
getopt.h
Normal file
@@ -0,0 +1,133 @@
|
|||||||
|
/* Declarations for getopt.
|
||||||
|
Copyright (C) 1989,90,91,92,93,94,96,97 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||||
|
Bugs can be reported to bug-glibc@gnu.org.
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by the
|
||||||
|
Free Software Foundation; either version 2, or (at your option) any
|
||||||
|
later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||||
|
USA. */
|
||||||
|
|
||||||
|
#ifndef _GETOPT_H
|
||||||
|
#define _GETOPT_H 1
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* For communication from `getopt' to the caller.
|
||||||
|
When `getopt' finds an option that takes an argument,
|
||||||
|
the argument value is returned here.
|
||||||
|
Also, when `ordering' is RETURN_IN_ORDER,
|
||||||
|
each non-option ARGV-element is returned here. */
|
||||||
|
|
||||||
|
extern char *optarg;
|
||||||
|
|
||||||
|
/* Index in ARGV of the next element to be scanned.
|
||||||
|
This is used for communication to and from the caller
|
||||||
|
and for communication between successive calls to `getopt'.
|
||||||
|
|
||||||
|
On entry to `getopt', zero means this is the first call; initialize.
|
||||||
|
|
||||||
|
When `getopt' returns -1, this is the index of the first of the
|
||||||
|
non-option elements that the caller should itself scan.
|
||||||
|
|
||||||
|
Otherwise, `optind' communicates from one call to the next
|
||||||
|
how much of ARGV has been scanned so far. */
|
||||||
|
|
||||||
|
extern int optind;
|
||||||
|
|
||||||
|
/* Callers store zero here to inhibit the error message `getopt' prints
|
||||||
|
for unrecognized options. */
|
||||||
|
|
||||||
|
extern int opterr;
|
||||||
|
|
||||||
|
/* Set to an option character which was unrecognized. */
|
||||||
|
|
||||||
|
extern int optopt;
|
||||||
|
|
||||||
|
/* Describe the long-named options requested by the application.
|
||||||
|
The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
|
||||||
|
of `struct option' terminated by an element containing a name which is
|
||||||
|
zero.
|
||||||
|
|
||||||
|
The field `has_arg' is:
|
||||||
|
no_argument (or 0) if the option does not take an argument,
|
||||||
|
required_argument (or 1) if the option requires an argument,
|
||||||
|
optional_argument (or 2) if the option takes an optional argument.
|
||||||
|
|
||||||
|
If the field `flag' is not NULL, it points to a variable that is set
|
||||||
|
to the value given in the field `val' when the option is found, but
|
||||||
|
left unchanged if the option is not found.
|
||||||
|
|
||||||
|
To have a long-named option do something other than set an `int' to
|
||||||
|
a compiled-in constant, such as set a value from `optarg', set the
|
||||||
|
option's `flag' field to zero and its `val' field to a nonzero
|
||||||
|
value (the equivalent single-letter option character, if there is
|
||||||
|
one). For long options that have a zero `flag' field, `getopt'
|
||||||
|
returns the contents of the `val' field. */
|
||||||
|
|
||||||
|
struct option
|
||||||
|
{
|
||||||
|
#if defined (__STDC__) && __STDC__
|
||||||
|
const char *name;
|
||||||
|
#else
|
||||||
|
char *name;
|
||||||
|
#endif
|
||||||
|
/* has_arg can't be an enum because some compilers complain about
|
||||||
|
type mismatches in all the code that assumes it is an int. */
|
||||||
|
int has_arg;
|
||||||
|
int *flag;
|
||||||
|
int val;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Names for the values of the `has_arg' field of `struct option'. */
|
||||||
|
|
||||||
|
#define no_argument 0
|
||||||
|
#define required_argument 1
|
||||||
|
#define optional_argument 2
|
||||||
|
|
||||||
|
#if defined (__STDC__) && __STDC__
|
||||||
|
#ifdef __GNU_LIBRARY__
|
||||||
|
/* Many other libraries have conflicting prototypes for getopt, with
|
||||||
|
differences in the consts, in stdlib.h. To avoid compilation
|
||||||
|
errors, only prototype getopt for the GNU C library. */
|
||||||
|
extern int getopt (int argc, char *const *argv, const char *shortopts);
|
||||||
|
#else /* not __GNU_LIBRARY__ */
|
||||||
|
extern int getopt ();
|
||||||
|
#endif /* __GNU_LIBRARY__ */
|
||||||
|
extern int getopt_long (int argc, char *const *argv, const char *shortopts,
|
||||||
|
const struct option *longopts, int *longind);
|
||||||
|
extern int getopt_long_only (int argc, char *const *argv,
|
||||||
|
const char *shortopts,
|
||||||
|
const struct option *longopts, int *longind);
|
||||||
|
|
||||||
|
/* Internal only. Users should not call this directly. */
|
||||||
|
extern int _getopt_internal (int argc, char *const *argv,
|
||||||
|
const char *shortopts,
|
||||||
|
const struct option *longopts, int *longind,
|
||||||
|
int long_only);
|
||||||
|
#else /* not __STDC__ */
|
||||||
|
extern int getopt ();
|
||||||
|
extern int getopt_long ();
|
||||||
|
extern int getopt_long_only ();
|
||||||
|
|
||||||
|
extern int _getopt_internal ();
|
||||||
|
#endif /* __STDC__ */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* getopt.h */
|
||||||
190
getopt1.c
Normal file
190
getopt1.c
Normal file
@@ -0,0 +1,190 @@
|
|||||||
|
/* getopt_long and getopt_long_only entry points for GNU getopt.
|
||||||
|
Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98
|
||||||
|
Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||||
|
Bugs can be reported to bug-glibc@prep.ai.mit.edu.
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by the
|
||||||
|
Free Software Foundation; either version 2, or (at your option) any
|
||||||
|
later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||||
|
USA. */
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include <config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "getopt.h"
|
||||||
|
|
||||||
|
#if !defined __STDC__ || !__STDC__
|
||||||
|
/* This is a separate conditional since some stdc systems
|
||||||
|
reject `defined (const)'. */
|
||||||
|
#ifndef const
|
||||||
|
#define const
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <stdio.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. */
|
||||||
|
|
||||||
|
#define GETOPT_INTERFACE_VERSION 2
|
||||||
|
#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2
|
||||||
|
#include <gnu-versions.h>
|
||||||
|
#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
|
||||||
|
#define ELIDE_CODE
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef ELIDE_CODE
|
||||||
|
|
||||||
|
|
||||||
|
/* This needs to come after some library #include
|
||||||
|
to get __GNU_LIBRARY__ defined. */
|
||||||
|
#ifdef __GNU_LIBRARY__
|
||||||
|
#include <stdlib.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef NULL
|
||||||
|
#define NULL 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int
|
||||||
|
getopt_long (argc, argv, options, long_options, opt_index)
|
||||||
|
int argc;
|
||||||
|
char *const *argv;
|
||||||
|
const char *options;
|
||||||
|
const struct option *long_options;
|
||||||
|
int *opt_index;
|
||||||
|
{
|
||||||
|
return _getopt_internal (argc, argv, options, long_options, opt_index, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Like getopt_long, but '-' as well as '--' can indicate a long option.
|
||||||
|
If an option that starts with '-' (not '--') doesn't match a long option,
|
||||||
|
but does match a short option, it is parsed as a short option
|
||||||
|
instead. */
|
||||||
|
|
||||||
|
int
|
||||||
|
getopt_long_only (argc, argv, options, long_options, opt_index)
|
||||||
|
int argc;
|
||||||
|
char *const *argv;
|
||||||
|
const char *options;
|
||||||
|
const struct option *long_options;
|
||||||
|
int *opt_index;
|
||||||
|
{
|
||||||
|
return _getopt_internal (argc, argv, options, long_options, opt_index, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* Not ELIDE_CODE. */
|
||||||
|
|
||||||
|
#ifdef TEST
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int
|
||||||
|
main (argc, argv)
|
||||||
|
int argc;
|
||||||
|
char **argv;
|
||||||
|
{
|
||||||
|
int c;
|
||||||
|
int digit_optind = 0;
|
||||||
|
|
||||||
|
while (1)
|
||||||
|
{
|
||||||
|
int this_option_optind = optind ? optind : 1;
|
||||||
|
int option_index = 0;
|
||||||
|
static struct option long_options[] =
|
||||||
|
{
|
||||||
|
{"add", 1, 0, 0},
|
||||||
|
{"append", 0, 0, 0},
|
||||||
|
{"delete", 1, 0, 0},
|
||||||
|
{"verbose", 0, 0, 0},
|
||||||
|
{"create", 0, 0, 0},
|
||||||
|
{"file", 1, 0, 0},
|
||||||
|
{0, 0, 0, 0}
|
||||||
|
};
|
||||||
|
|
||||||
|
c = getopt_long (argc, argv, "abc:d:0123456789",
|
||||||
|
long_options, &option_index);
|
||||||
|
if (c == -1)
|
||||||
|
break;
|
||||||
|
|
||||||
|
switch (c)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
printf ("option %s", long_options[option_index].name);
|
||||||
|
if (optarg)
|
||||||
|
printf (" with arg %s", optarg);
|
||||||
|
printf ("\n");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case '0':
|
||||||
|
case '1':
|
||||||
|
case '2':
|
||||||
|
case '3':
|
||||||
|
case '4':
|
||||||
|
case '5':
|
||||||
|
case '6':
|
||||||
|
case '7':
|
||||||
|
case '8':
|
||||||
|
case '9':
|
||||||
|
if (digit_optind != 0 && digit_optind != this_option_optind)
|
||||||
|
printf ("digits occur in two different argv-elements.\n");
|
||||||
|
digit_optind = this_option_optind;
|
||||||
|
printf ("option %c\n", c);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'a':
|
||||||
|
printf ("option a\n");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'b':
|
||||||
|
printf ("option b\n");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'c':
|
||||||
|
printf ("option c with value `%s'\n", optarg);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'd':
|
||||||
|
printf ("option d with value `%s'\n", optarg);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case '?':
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
printf ("?? getopt returned character code 0%o ??\n", c);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (optind < argc)
|
||||||
|
{
|
||||||
|
printf ("non-option ARGV-elements: ");
|
||||||
|
while (optind < argc)
|
||||||
|
printf ("%s ", argv[optind++]);
|
||||||
|
printf ("\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
exit (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* TEST */
|
||||||
@@ -1,481 +0,0 @@
|
|||||||
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!
|
|
||||||
232
glob/ChangeLog
232
glob/ChangeLog
@@ -1,3 +1,86 @@
|
|||||||
|
1998-07-29 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* glob.c, fnmatch.c: New versions from the GLIBC folks (Ulrich
|
||||||
|
Drepper). Fixes a bug reported by Eli Zaretski. Integrates
|
||||||
|
DOS/Windows32 support.
|
||||||
|
|
||||||
|
1998-07-27 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
|
||||||
|
|
||||||
|
* glob.c (glob): Cast away const on assignment of pattern to dirname.
|
||||||
|
Cast the return type of __alloca() for traditional C compilers.
|
||||||
|
|
||||||
|
1998-07-23 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* glob.c, fnmatch.c: New versions of these files from the GLIBC
|
||||||
|
folks (Ulrich Drepper). Had to re-integrate some DOS/Windows
|
||||||
|
code.
|
||||||
|
|
||||||
|
1998-07-10 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* glob.c (glob_in_dir): If no meta chars exist in PATTERN and
|
||||||
|
GLOB_NOCHECK is present, don't look for the file--whether it's
|
||||||
|
found or not, we'll always return it, so why bother searching?
|
||||||
|
|
||||||
|
Also, if we are searching and there are no meta chars, don't
|
||||||
|
bother trying fnmatch() if the strcmp() fails.
|
||||||
|
|
||||||
|
1998-05-30 Eli Zaretskii <eliz@is.elta.co.il>
|
||||||
|
|
||||||
|
* glob.c (glob) [__MSDOS__, WINDOWS32]: Compute the directory and
|
||||||
|
filename parts of the pattern correctly when it includes a drive
|
||||||
|
spec. Disallow wildcards in the drive spec. Prevent recursion
|
||||||
|
when dirname is of the form "d:/" or "d:".
|
||||||
|
(prefix_array) [__MSDOS__, WINDOWS32]: Don't append a slash to
|
||||||
|
"d:/" and "d:".
|
||||||
|
|
||||||
|
1998-05-13 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* SMakefile, Makefile.ami, glob.c, glob.h, fnmatch.c: Updated from
|
||||||
|
the latest glibc version.
|
||||||
|
|
||||||
|
1998-04-17 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* configure.in: Create a config.h file instead of setting things
|
||||||
|
on the compile line. This is because when build.sh runs it merely
|
||||||
|
passes -DHAVE_CONFIG_H to the glob files, just as it does to the
|
||||||
|
make files.
|
||||||
|
* config.h.in: Created by autoheader.
|
||||||
|
|
||||||
|
Tue Aug 12 10:52:34 1997 Paul D. Smith <psmith@baynetworks.com>
|
||||||
|
|
||||||
|
* configure.in: Require autoconf 2.12.
|
||||||
|
|
||||||
|
* glob: Updates from latest GNU libc glob code.
|
||||||
|
|
||||||
|
* glob.c,glob.h,fnmatch.h: Change all WIN32 references to WINDOWS32.
|
||||||
|
|
||||||
|
* glob.h: OSF4 defines macros in such a way that GLOB_ALTDIRFUNC
|
||||||
|
is not defined. Added a test to the #if which defines it if
|
||||||
|
_GNU_SOURCE is defined; that's set by both glob.c and GNU make.
|
||||||
|
|
||||||
|
* glob.c: SunOS4 w/ cc needs #include <stdio.h>, since assert.h
|
||||||
|
requires stderr but doesn't include stdio.h :-/.
|
||||||
|
(next_brace_sub): De-protoize function definition.
|
||||||
|
(glob): Cast __alloca(); on SunOS4 it uses the default return type
|
||||||
|
of int.
|
||||||
|
(glob): Irix defines getlogin_r() to return a char*; move the
|
||||||
|
extern for that into the _LIBC area since it isn't used except in
|
||||||
|
LIBC anyway. Likewise, move extern getlogin() into the "else".
|
||||||
|
|
||||||
|
Sat Jul 20 21:55:31 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
|
||||||
|
|
||||||
|
Win32 hacks from <Rob_Tulloh@tivoli.com>.
|
||||||
|
* posix/glob.c [WIN32]: Don't include <pwd.h>; don't use d_ino;
|
||||||
|
use void * for my_realloc; include <malloc.h> for alloca.
|
||||||
|
(glob) [WIN32]: Use "c:/users/default" for ~ if no HOME variable.
|
||||||
|
* posix/fnmatch.h [WIN32]: Use prototypes even if [!__STDC__].
|
||||||
|
* posix/glob.h: Likewise.
|
||||||
|
|
||||||
|
Fri Jul 19 16:56:41 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
|
||||||
|
|
||||||
|
* posix/glob.h [!_AMIGA && !VMS]: Check this instead of just [!_AMIGA]
|
||||||
|
for `struct stat;' forward decl.
|
||||||
|
|
||||||
Sat Jun 22 10:44:09 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
|
Sat Jun 22 10:44:09 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
|
||||||
|
|
||||||
* posix/glob.c: Include <alloca.h> only [HAVE_ALLOCA_H], not [sparc].
|
* posix/glob.c: Include <alloca.h> only [HAVE_ALLOCA_H], not [sparc].
|
||||||
@@ -7,152 +90,3 @@ Fri Jun 21 00:27:51 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
|
|||||||
* posix/fnmatch.c (fnmatch): Fix \*[*?]+ case to increment name ptr
|
* posix/fnmatch.c (fnmatch): Fix \*[*?]+ case to increment name ptr
|
||||||
only for ?s, not for *s. Fix from Chet Ramey.
|
only for ?s, not for *s. Fix from Chet Ramey.
|
||||||
|
|
||||||
Wed May 22 17:22:14 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
|
|
||||||
|
|
||||||
* posix/glob.c [VMS]: Don't include <pwd.h>.
|
|
||||||
[HAVE_VMSDIR_H]: Include "vmsdir.h".
|
|
||||||
(glob) [VMS]: Don't grok ~.
|
|
||||||
|
|
||||||
Mon May 13 12:03:03 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
|
|
||||||
|
|
||||||
* posix/glob.h [_AMIGA]: Remove `struct stat;' forward decl.
|
|
||||||
|
|
||||||
* posix/glob.c [_AMIGA]: Don't include <pwd.h>.
|
|
||||||
(glob): Remove bogus & in call to globfree.
|
|
||||||
[_AMIGA]: Use AmigaDOS file name conventions.
|
|
||||||
|
|
||||||
Thu May 9 09:17:46 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
|
|
||||||
|
|
||||||
* posix/glob/SMakefile, posix/glob/SCOPTIONS, posix/glob/Makefile.ami:
|
|
||||||
New files, AmigaDOS support from Aaron Digulla.
|
|
||||||
* posix/Makefile (glob.tar): Add AmigaDOS support files.
|
|
||||||
|
|
||||||
Tue Apr 2 21:27:01 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
|
|
||||||
|
|
||||||
* posix/glob.c (glob_pattern_p): Avoid scanning past eos if
|
|
||||||
the pattern ends with a backslash and quoting is enabled.
|
|
||||||
* posix/fnmatch.c (fnmatch): Likewise; return FNM_NOMATCH for such
|
|
||||||
patterns.
|
|
||||||
|
|
||||||
Thu Mar 14 06:01:07 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
|
|
||||||
|
|
||||||
* posix/glob.c (glob): In GLOB_BRACE brace expansion, fix buffer size
|
|
||||||
calculation to include trailing invariant portion. Don't use alloca;
|
|
||||||
instead use a dynamic auto array for GCC, malloc for non-GCC.
|
|
||||||
Handle nested braces properly.
|
|
||||||
|
|
||||||
Fri Mar 1 10:09:46 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
|
|
||||||
|
|
||||||
* posix/glob.c: Use canonical code from autoconf manual for dirent
|
|
||||||
include.
|
|
||||||
[_D_NAMLEN]: Redefine NAMLEN using this.
|
|
||||||
(glob_in_dir): Use NAMLEN macro.
|
|
||||||
|
|
||||||
Fri Jan 19 13:28:59 1996 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
|
||||||
|
|
||||||
* posix/glob.c (glob): Use prototype in getlogin decl.
|
|
||||||
|
|
||||||
Thu Jan 18 00:32:43 1996 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
|
||||||
|
|
||||||
* posix/glob.c (_GNU_SOURCE): Define if undefined, so glob.h
|
|
||||||
defines GNU extensions.
|
|
||||||
* posix/fnmatch.c: Likewise.
|
|
||||||
|
|
||||||
Fri Jan 12 13:40:01 1996 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
|
||||||
|
|
||||||
* posix/glob.c (glob): Add parens in glob call flags arg for
|
|
||||||
GLOB_BRACE case.
|
|
||||||
|
|
||||||
Thu Dec 14 02:28:22 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
|
||||||
|
|
||||||
* posix/glob.c (glob_in_dir): Cast result of opendir to __ptr_t,
|
|
||||||
and cast STREAM to DIR * before passing to readdir and closedir.
|
|
||||||
|
|
||||||
Mon Dec 11 20:07:54 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
|
||||||
|
|
||||||
* posix/glob.c [! STDC_HEADERS]: Declare getenv.
|
|
||||||
(glob): Avoid using function as value.
|
|
||||||
|
|
||||||
Fri Dec 8 13:04:51 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
|
||||||
|
|
||||||
* posix/glob.c: Implement new options GLOB_ALTDIRFUNC, GLOB_BRACE,
|
|
||||||
GLOB_TILDE, GLOB_NOMAGIC.
|
|
||||||
(glob): Use stat instead of lstat to determine directoriness.
|
|
||||||
* posix/glob.h (GLOB_ALTDIRFUNC, GLOB_BRACE, GLOB_NOMAGIC, GLOB_TILDE):
|
|
||||||
New flag bits.
|
|
||||||
(__GLOB_FLAGS): Include them.
|
|
||||||
(glob_t): New members gl_closedir, gl_readdir, gl_opendir, gl_lstat,
|
|
||||||
gl_stat.
|
|
||||||
|
|
||||||
Mon Sep 11 14:00:14 1995 Roland McGrath <roland@whiz-bang.gnu.ai.mit.edu>
|
|
||||||
|
|
||||||
* posix/glob.c (glob): Comment fix.
|
|
||||||
|
|
||||||
Wed Aug 30 16:44:55 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
|
||||||
|
|
||||||
* posix/glob.c (glob): Use realloc to extend strings for GLOB_MARK
|
|
||||||
slash.
|
|
||||||
(glob_in_dir): Don't allocate extra byte here.
|
|
||||||
|
|
||||||
Mon Aug 7 14:04:36 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
|
||||||
|
|
||||||
* posix/glob.c (glob_in_dir): Allocate GLOB_MARK byte in case when
|
|
||||||
(NFOUND == 0 && (FLAGS & GLOB_NOCHECK)).
|
|
||||||
|
|
||||||
Sat Apr 29 15:46:57 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
|
||||||
|
|
||||||
* posix/glob.c (S_ISDIR): Define if undefined.
|
|
||||||
|
|
||||||
Tue Apr 25 17:17:19 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
|
||||||
|
|
||||||
* posix/glob.c (glob): If GLOB_MARK set, stat names to find
|
|
||||||
directories and append slashes to them in final pass before
|
|
||||||
sorting.
|
|
||||||
(glob_in_dir): If GLOB_MARK set, just allocate the extra char for the
|
|
||||||
slash; never append it here.
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
|
|||||||
10
glob/Makefile.am
Normal file
10
glob/Makefile.am
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# -*-Makefile-*-, or close enough
|
||||||
|
|
||||||
|
AUTOMAKE_OPTIONS = 1.3 foreign
|
||||||
|
|
||||||
|
noinst_LIBRARIES = libglob.a
|
||||||
|
|
||||||
|
libglob_a_SOURCES = glob.c glob.h fnmatch.c fnmatch.h
|
||||||
|
|
||||||
|
EXTRA_DIST = COPYING.LIB Makefile.ami SCOPTIONS SMakefile \
|
||||||
|
configure.bat
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
# Makefile for standalone distribution of libglob.a (fnmatch, glob).
|
# Makefile for standalone distribution of libglob.a (fnmatch, glob).
|
||||||
|
|
||||||
# Copyright (C) 1991, 92, 93, 94, 95 Free Software Foundation, Inc.
|
# Copyright (C) 1991, 92, 93, 94, 95, 97, 98 Free Software Foundation, Inc.
|
||||||
# This file is part of the GNU C Library.
|
# This file is part of the GNU C Library.
|
||||||
|
|
||||||
# This library is free software; you can redistribute it and/or
|
# This library is free software; you can redistribute it and/or
|
||||||
@@ -15,8 +15,8 @@
|
|||||||
|
|
||||||
# You should have received a copy of the GNU Library General Public
|
# You should have received a copy of the GNU Library General Public
|
||||||
# License along with this library; see the file COPYING.LIB. If
|
# License along with this library; see the file COPYING.LIB. If
|
||||||
# not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
# not, write to the Free Software Foundation, Inc.,
|
||||||
# Cambridge, MA 02139, USA.
|
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
# Ultrix 2.2 make doesn't expand the value of VPATH.
|
# Ultrix 2.2 make doesn't expand the value of VPATH.
|
||||||
VPATH = /glob/
|
VPATH = /glob/
|
||||||
|
|||||||
@@ -1,66 +0,0 @@
|
|||||||
# 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 .. $@
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
# Makefile for standalone distribution of libglob.a (fnmatch, glob).
|
# Makefile for standalone distribution of libglob.a (fnmatch, glob).
|
||||||
|
|
||||||
# Copyright (C) 1991, 92, 93, 94, 95 Free Software Foundation, Inc.
|
# Copyright (C) 1991, 92, 93, 94, 95, 97, 98 Free Software Foundation, Inc.
|
||||||
# This file is part of the GNU C Library.
|
# This file is part of the GNU C Library.
|
||||||
|
|
||||||
# This library is free software; you can redistribute it and/or
|
# This library is free software; you can redistribute it and/or
|
||||||
@@ -15,8 +15,8 @@
|
|||||||
|
|
||||||
# You should have received a copy of the GNU Library General Public
|
# You should have received a copy of the GNU Library General Public
|
||||||
# License along with this library; see the file COPYING.LIB. If
|
# License along with this library; see the file COPYING.LIB. If
|
||||||
# not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
# not, write to the Free Software Foundation, Inc.,
|
||||||
# Cambridge, MA 02139, USA.
|
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
# Ultrix 2.2 make doesn't expand the value of VPATH.
|
# Ultrix 2.2 make doesn't expand the value of VPATH.
|
||||||
VPATH = /glob/
|
VPATH = /glob/
|
||||||
|
|||||||
1664
glob/configure
vendored
1664
glob/configure
vendored
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
|||||||
@echo off
|
@echo off
|
||||||
echo Configuring glob for GO32
|
echo Configuring glob for DJGPP
|
||||||
rem This batch file assumes a unix-type "sed" program
|
rem This batch file assumes a unix-type "sed" program
|
||||||
|
|
||||||
echo # Makefile generated by "configure.bat"> Makefile
|
echo # Makefile generated by "configure.bat"> Makefile
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
dnl Process this file with autoconf to produce a configure script.
|
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_INIT(fnmatch.c) dnl A distinctive file to look for in srcdir.
|
||||||
AC_PREREQ(2.1) dnl Minimum Autoconf version required.
|
AC_PREREQ(2.12) dnl Minimum Autoconf version required.
|
||||||
|
|
||||||
|
AM_INIT_AUTOMAKE(glob, 0.0, nodefs)
|
||||||
|
AM_CONFIG_HEADER(config.h)
|
||||||
|
|
||||||
AC_PROG_CC
|
AC_PROG_CC
|
||||||
AC_CHECK_PROG(AR, ar, ar, ar)
|
AC_CHECK_PROG(AR, ar, ar, ar)
|
||||||
AC_PROG_RANLIB
|
AC_PROG_RANLIB
|
||||||
|
|||||||
233
glob/fnmatch.c
233
glob/fnmatch.c
@@ -1,33 +1,51 @@
|
|||||||
/* Copyright (C) 1991, 1992, 1993, 1996 Free Software Foundation, Inc.
|
/* Copyright (C) 1991, 92, 93, 96, 97, 98 Free Software Foundation, Inc.
|
||||||
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public License as
|
modify it under the terms of the GNU Library General Public License as
|
||||||
published by the Free Software Foundation; either version 2 of the
|
published by the Free Software Foundation; either version 2 of the
|
||||||
License, or (at your option) any later version.
|
License, or (at your option) any later version.
|
||||||
|
|
||||||
This library is distributed in the hope that it will be useful,
|
This library is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
Library General Public License for more details.
|
Library General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU Library General Public
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; see the file COPYING.LIB. If
|
License along with this library; see the file COPYING.LIB. If not,
|
||||||
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
Cambridge, MA 02139, USA. */
|
Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#if HAVE_CONFIG_H
|
||||||
#include <config.h>
|
# include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Enable GNU extensions in fnmatch.h. */
|
/* Enable GNU extensions in fnmatch.h. */
|
||||||
#ifndef _GNU_SOURCE
|
#ifndef _GNU_SOURCE
|
||||||
#define _GNU_SOURCE 1
|
# define _GNU_SOURCE 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <fnmatch.h>
|
#include <fnmatch.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
|
#if HAVE_STRING_H
|
||||||
|
# include <string.h>
|
||||||
|
#else
|
||||||
|
# include <strings.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined STDC_HEADERS || defined _LIBC
|
||||||
|
# include <stdlib.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* For platform which support the ISO C amendement 1 functionality we
|
||||||
|
support user defined character classes. */
|
||||||
|
#if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
|
||||||
|
/* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>. */
|
||||||
|
# include <wchar.h>
|
||||||
|
# include <wctype.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Comment out all this code if we are using the GNU C Library, and are not
|
/* 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
|
actually compiling the library itself. This code is part of the GNU C
|
||||||
@@ -37,12 +55,77 @@ Cambridge, MA 02139, USA. */
|
|||||||
program understand `configure --with-gnu-libc' and omit the object files,
|
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. */
|
it is simpler to just do this in the source for each such file. */
|
||||||
|
|
||||||
#if defined (_LIBC) || !defined (__GNU_LIBRARY__)
|
#if defined _LIBC || !defined __GNU_LIBRARY__
|
||||||
|
|
||||||
|
|
||||||
#ifndef errno
|
# if defined STDC_HEADERS || !defined isascii
|
||||||
extern int errno;
|
# define ISASCII(c) 1
|
||||||
|
# else
|
||||||
|
# define ISASCII(c) isascii(c)
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#ifdef isblank
|
||||||
|
# define ISBLANK(c) (ISASCII (c) && isblank (c))
|
||||||
|
#else
|
||||||
|
# define ISBLANK(c) ((c) == ' ' || (c) == '\t')
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef isgraph
|
||||||
|
# define ISGRAPH(c) (ISASCII (c) && isgraph (c))
|
||||||
|
#else
|
||||||
|
# define ISGRAPH(c) (ISASCII (c) && isprint (c) && !isspace (c))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define ISPRINT(c) (ISASCII (c) && isprint (c))
|
||||||
|
#define ISDIGIT(c) (ISASCII (c) && isdigit (c))
|
||||||
|
#define ISALNUM(c) (ISASCII (c) && isalnum (c))
|
||||||
|
#define ISALPHA(c) (ISASCII (c) && isalpha (c))
|
||||||
|
#define ISCNTRL(c) (ISASCII (c) && iscntrl (c))
|
||||||
|
#define ISLOWER(c) (ISASCII (c) && islower (c))
|
||||||
|
#define ISPUNCT(c) (ISASCII (c) && ispunct (c))
|
||||||
|
#define ISSPACE(c) (ISASCII (c) && isspace (c))
|
||||||
|
#define ISUPPER(c) (ISASCII (c) && isupper (c))
|
||||||
|
#define ISXDIGIT(c) (ISASCII (c) && isxdigit (c))
|
||||||
|
|
||||||
|
# define STREQ(s1, s2) ((strcmp (s1, s2) == 0))
|
||||||
|
|
||||||
|
# if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
|
||||||
|
/* The GNU C library provides support for user-defined character classes
|
||||||
|
and the functions from ISO C amendement 1. */
|
||||||
|
# ifdef CHARCLASS_NAME_MAX
|
||||||
|
# define CHAR_CLASS_MAX_LENGTH CHARCLASS_NAME_MAX
|
||||||
|
# else
|
||||||
|
/* This shouldn't happen but some implementation might still have this
|
||||||
|
problem. Use a reasonable default value. */
|
||||||
|
# define CHAR_CLASS_MAX_LENGTH 256
|
||||||
|
# endif
|
||||||
|
|
||||||
|
# ifdef _LIBC
|
||||||
|
# define IS_CHAR_CLASS(string) __wctype (string)
|
||||||
|
# else
|
||||||
|
# define IS_CHAR_CLASS(string) wctype (string)
|
||||||
|
# endif
|
||||||
|
# else
|
||||||
|
# define CHAR_CLASS_MAX_LENGTH 6 /* Namely, `xdigit'. */
|
||||||
|
|
||||||
|
# define IS_CHAR_CLASS(string) \
|
||||||
|
(STREQ (string, "alpha") || STREQ (string, "upper") \
|
||||||
|
|| STREQ (string, "lower") || STREQ (string, "digit") \
|
||||||
|
|| STREQ (string, "alnum") || STREQ (string, "xdigit") \
|
||||||
|
|| STREQ (string, "space") || STREQ (string, "print") \
|
||||||
|
|| STREQ (string, "punct") || STREQ (string, "graph") \
|
||||||
|
|| STREQ (string, "cntrl") || STREQ (string, "blank"))
|
||||||
|
# endif
|
||||||
|
|
||||||
|
/* Avoid depending on library functions or files
|
||||||
|
whose names are inconsistent. */
|
||||||
|
|
||||||
|
# if !defined _LIBC && !defined getenv
|
||||||
|
extern char *getenv ();
|
||||||
|
# endif
|
||||||
|
|
||||||
|
# ifndef errno
|
||||||
|
extern int errno;
|
||||||
|
# endif
|
||||||
|
|
||||||
/* Match STRING against the filename pattern PATTERN, returning zero if
|
/* Match STRING against the filename pattern PATTERN, returning zero if
|
||||||
it matches, nonzero if not. */
|
it matches, nonzero if not. */
|
||||||
@@ -55,8 +138,12 @@ fnmatch (pattern, string, flags)
|
|||||||
register const char *p = pattern, *n = string;
|
register const char *p = pattern, *n = string;
|
||||||
register char c;
|
register char c;
|
||||||
|
|
||||||
/* Note that this evalutes C many times. */
|
/* Note that this evaluates C many times. */
|
||||||
#define FOLD(c) ((flags & FNM_CASEFOLD) && isupper (c) ? tolower (c) : (c))
|
# ifdef _LIBC
|
||||||
|
# define FOLD(c) ((flags & FNM_CASEFOLD) ? tolower (c) : (c))
|
||||||
|
# else
|
||||||
|
# define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) : (c))
|
||||||
|
# endif
|
||||||
|
|
||||||
while ((c = *p++) != '\0')
|
while ((c = *p++) != '\0')
|
||||||
{
|
{
|
||||||
@@ -127,67 +214,124 @@ fnmatch (pattern, string, flags)
|
|||||||
case '[':
|
case '[':
|
||||||
{
|
{
|
||||||
/* Nonzero if the sense of the character class is inverted. */
|
/* Nonzero if the sense of the character class is inverted. */
|
||||||
|
static int posixly_correct;
|
||||||
register int not;
|
register int not;
|
||||||
|
char cold;
|
||||||
|
|
||||||
|
if (posixly_correct == 0)
|
||||||
|
posixly_correct = getenv ("POSIXLY_CORRECT") != NULL ? 1 : -1;
|
||||||
|
|
||||||
if (*n == '\0')
|
if (*n == '\0')
|
||||||
return FNM_NOMATCH;
|
return FNM_NOMATCH;
|
||||||
|
|
||||||
if ((flags & FNM_PERIOD) && *n == '.' &&
|
if (*n == '.' && (flags & FNM_PERIOD) &&
|
||||||
(n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
|
(n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
|
||||||
return FNM_NOMATCH;
|
return FNM_NOMATCH;
|
||||||
|
|
||||||
not = (*p == '!' || *p == '^');
|
if (*n == '/' && (flags & FNM_FILE_NAME))
|
||||||
|
/* `/' cannot be matched. */
|
||||||
|
return FNM_NOMATCH;
|
||||||
|
|
||||||
|
not = (*p == '!' || (posixly_correct < 0 && *p == '^'));
|
||||||
if (not)
|
if (not)
|
||||||
++p;
|
++p;
|
||||||
|
|
||||||
c = *p++;
|
c = *p++;
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
register char cstart = c, cend = c;
|
int fn = FOLD (*n);
|
||||||
|
|
||||||
if (!(flags & FNM_NOESCAPE) && c == '\\')
|
if (!(flags & FNM_NOESCAPE) && c == '\\')
|
||||||
{
|
{
|
||||||
if (*p == '\0')
|
if (*p == '\0')
|
||||||
return FNM_NOMATCH;
|
return FNM_NOMATCH;
|
||||||
cstart = cend = *p++;
|
c = FOLD (*p++);
|
||||||
|
|
||||||
|
if (c == fn)
|
||||||
|
goto matched;
|
||||||
}
|
}
|
||||||
|
else if (c == '[' && *p == ':')
|
||||||
|
{
|
||||||
|
/* Leave room for the null. */
|
||||||
|
char str[CHAR_CLASS_MAX_LENGTH + 1];
|
||||||
|
size_t c1 = 0;
|
||||||
|
# if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
|
||||||
|
wctype_t wt;
|
||||||
|
# endif
|
||||||
|
|
||||||
cstart = cend = FOLD (cstart);
|
for (;;)
|
||||||
|
{
|
||||||
|
if (c1 == CHAR_CLASS_MAX_LENGTH)
|
||||||
|
/* The name is too long and therefore the pattern
|
||||||
|
is ill-formed. */
|
||||||
|
return FNM_NOMATCH;
|
||||||
|
|
||||||
if (c == '\0')
|
c = *++p;
|
||||||
|
if (c == ':' && p[1] == ']')
|
||||||
|
{
|
||||||
|
p += 2;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
str[c1++] = 'c';
|
||||||
|
}
|
||||||
|
str[c1] = '\0';
|
||||||
|
|
||||||
|
# if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
|
||||||
|
wt = IS_CHAR_CLASS (str);
|
||||||
|
if (wt == 0)
|
||||||
|
/* Invalid character class name. */
|
||||||
|
return FNM_NOMATCH;
|
||||||
|
|
||||||
|
if (__iswctype (__btowc (*n), wt))
|
||||||
|
goto matched;
|
||||||
|
# else
|
||||||
|
if ((STREQ (str, "alnum") && ISALNUM (*n))
|
||||||
|
|| (STREQ (str, "alpha") && ISALPHA (*n))
|
||||||
|
|| (STREQ (str, "blank") && ISBLANK (*n))
|
||||||
|
|| (STREQ (str, "cntrl") && ISCNTRL (*n))
|
||||||
|
|| (STREQ (str, "digit") && ISDIGIT (*n))
|
||||||
|
|| (STREQ (str, "graph") && ISGRAPH (*n))
|
||||||
|
|| (STREQ (str, "lower") && ISLOWER (*n))
|
||||||
|
|| (STREQ (str, "print") && ISPRINT (*n))
|
||||||
|
|| (STREQ (str, "punct") && ISPUNCT (*n))
|
||||||
|
|| (STREQ (str, "space") && ISSPACE (*n))
|
||||||
|
|| (STREQ (str, "upper") && ISUPPER (*n))
|
||||||
|
|| (STREQ (str, "xdigit") && ISXDIGIT (*n)))
|
||||||
|
goto matched;
|
||||||
|
# endif
|
||||||
|
}
|
||||||
|
else if (c == '\0')
|
||||||
/* [ (unterminated) loses. */
|
/* [ (unterminated) loses. */
|
||||||
return FNM_NOMATCH;
|
return FNM_NOMATCH;
|
||||||
|
else if (FOLD (c) == fn)
|
||||||
|
goto matched;
|
||||||
|
|
||||||
|
cold = c;
|
||||||
c = *p++;
|
c = *p++;
|
||||||
c = FOLD (c);
|
|
||||||
|
|
||||||
if ((flags & FNM_FILE_NAME) && c == '/')
|
|
||||||
/* [/] can never match. */
|
|
||||||
return FNM_NOMATCH;
|
|
||||||
|
|
||||||
if (c == '-' && *p != ']')
|
if (c == '-' && *p != ']')
|
||||||
{
|
{
|
||||||
cend = *p++;
|
/* It is a range. */
|
||||||
|
char cend = *p++;
|
||||||
if (!(flags & FNM_NOESCAPE) && cend == '\\')
|
if (!(flags & FNM_NOESCAPE) && cend == '\\')
|
||||||
cend = *p++;
|
cend = *p++;
|
||||||
if (cend == '\0')
|
if (cend == '\0')
|
||||||
return FNM_NOMATCH;
|
return FNM_NOMATCH;
|
||||||
cend = FOLD (cend);
|
|
||||||
|
if (cold <= fn && fn <= FOLD (cend))
|
||||||
|
goto matched;
|
||||||
|
|
||||||
c = *p++;
|
c = *p++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (FOLD (*n) >= cstart && FOLD (*n) <= cend)
|
|
||||||
goto matched;
|
|
||||||
|
|
||||||
if (c == ']')
|
if (c == ']')
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!not)
|
if (!not)
|
||||||
return FNM_NOMATCH;
|
return FNM_NOMATCH;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
matched:;
|
matched:
|
||||||
/* Skip the rest of the [...] that already matched. */
|
/* Skip the rest of the [...] that already matched. */
|
||||||
while (c != ']')
|
while (c != ']')
|
||||||
{
|
{
|
||||||
@@ -203,6 +347,15 @@ fnmatch (pattern, string, flags)
|
|||||||
/* XXX 1003.2d11 is unclear if this is right. */
|
/* XXX 1003.2d11 is unclear if this is right. */
|
||||||
++p;
|
++p;
|
||||||
}
|
}
|
||||||
|
else if (c == '[' && *p == ':')
|
||||||
|
{
|
||||||
|
do
|
||||||
|
if (*++p == '\0')
|
||||||
|
return FNM_NOMATCH;
|
||||||
|
while (*p != ':' || p[1] == ']');
|
||||||
|
p += 2;
|
||||||
|
c = *p;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (not)
|
if (not)
|
||||||
return FNM_NOMATCH;
|
return FNM_NOMATCH;
|
||||||
@@ -225,6 +378,8 @@ fnmatch (pattern, string, flags)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return FNM_NOMATCH;
|
return FNM_NOMATCH;
|
||||||
|
|
||||||
|
# undef FOLD
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* _LIBC or not __GNU_LIBRARY__. */
|
#endif /* _LIBC or not __GNU_LIBRARY__. */
|
||||||
|
|||||||
@@ -1,39 +1,46 @@
|
|||||||
/* Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
|
/* Copyright (C) 1991, 1992, 1993, 1996, 1997 Free Software Foundation, Inc.
|
||||||
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
This library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public License as
|
modify it under the terms of the GNU Library General Public License as
|
||||||
published by the Free Software Foundation; either version 2 of the
|
published by the Free Software Foundation; either version 2 of the
|
||||||
License, or (at your option) any later version.
|
License, or (at your option) any later version.
|
||||||
|
|
||||||
This library is distributed in the hope that it will be useful,
|
The GNU C Library is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
Library General Public License for more details.
|
Library General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU Library General Public
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; see the file COPYING.LIB. If
|
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||||
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
Cambridge, MA 02139, USA. */
|
Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
#ifndef _FNMATCH_H
|
#ifndef _FNMATCH_H
|
||||||
|
|
||||||
#define _FNMATCH_H 1
|
#define _FNMATCH_H 1
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined (__cplusplus) || (defined (__STDC__) && __STDC__)
|
#if defined __cplusplus || (defined __STDC__ && __STDC__) || defined WINDOWS32
|
||||||
#undef __P
|
# undef __P
|
||||||
#define __P(protos) protos
|
# define __P(protos) protos
|
||||||
#else /* Not C++ or ANSI C. */
|
#else /* Not C++ or ANSI C. */
|
||||||
#undef __P
|
# undef __P
|
||||||
#define __P(protos) ()
|
# define __P(protos) ()
|
||||||
/* We can get away without defining `const' here only because in this file
|
/* 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
|
it is used only inside the prototype for `fnmatch', which is elided in
|
||||||
non-ANSI C where `const' is problematical. */
|
non-ANSI C where `const' is problematical. */
|
||||||
#endif /* C++ or ANSI C. */
|
#endif /* C++ or ANSI C. */
|
||||||
|
|
||||||
|
#ifndef const
|
||||||
|
# if (defined __STDC__ && __STDC__) || defined __cplusplus
|
||||||
|
# define __const const
|
||||||
|
# else
|
||||||
|
# define __const
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/* We #undef these before defining them because some losing systems
|
/* We #undef these before defining them because some losing systems
|
||||||
(HP-UX A.08.07 for example) define these in <unistd.h>. */
|
(HP-UX A.08.07 for example) define these in <unistd.h>. */
|
||||||
@@ -46,18 +53,26 @@ extern "C" {
|
|||||||
#define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */
|
#define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */
|
||||||
#define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */
|
#define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */
|
||||||
|
|
||||||
#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_GNU_SOURCE)
|
#if !defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _GNU_SOURCE
|
||||||
#define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */
|
# define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */
|
||||||
#define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */
|
# define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */
|
||||||
#define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */
|
# define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Value returned by `fnmatch' if STRING does not match PATTERN. */
|
/* Value returned by `fnmatch' if STRING does not match PATTERN. */
|
||||||
#define FNM_NOMATCH 1
|
#define FNM_NOMATCH 1
|
||||||
|
|
||||||
|
/* This value is returned if the implementation does not support
|
||||||
|
`fnmatch'. Since this is not the case here it will never be
|
||||||
|
returned but the conformance test suites still require the symbol
|
||||||
|
to be defined. */
|
||||||
|
#if (_XOPEN_SOURCE - 0) == 500
|
||||||
|
# define FNM_NOSYS (-1)
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Match STRING against the filename pattern PATTERN,
|
/* Match STRING against the filename pattern PATTERN,
|
||||||
returning zero if it matches, FNM_NOMATCH if not. */
|
returning zero if it matches, FNM_NOMATCH if not. */
|
||||||
extern int fnmatch __P ((const char *__pattern, const char *__string,
|
extern int fnmatch __P ((__const char *__pattern, __const char *__string,
|
||||||
int __flags));
|
int __flags));
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|||||||
1108
glob/glob.c
1108
glob/glob.c
File diff suppressed because it is too large
Load Diff
114
glob/glob.h
114
glob/glob.h
@@ -1,40 +1,42 @@
|
|||||||
/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc.
|
/* Copyright (C) 1991, 1992, 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public License as
|
modify it under the terms of the GNU Library General Public License as
|
||||||
published by the Free Software Foundation; either version 2 of the
|
published by the Free Software Foundation; either version 2 of the
|
||||||
License, or (at your option) any later version.
|
License, or (at your option) any later version.
|
||||||
|
|
||||||
This library is distributed in the hope that it will be useful,
|
The GNU C Library is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
Library General Public License for more details.
|
Library General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU Library General Public
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; see the file COPYING.LIB. If
|
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||||
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
Cambridge, MA 02139, USA. */
|
Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
#ifndef _GLOB_H
|
#ifndef _GLOB_H
|
||||||
|
|
||||||
#define _GLOB_H 1
|
#define _GLOB_H 1
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C"
|
extern "C" {
|
||||||
{
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#undef __ptr_t
|
#undef __ptr_t
|
||||||
#if defined (__cplusplus) || (defined (__STDC__) && __STDC__)
|
#if defined __cplusplus || (defined __STDC__ && __STDC__) || defined WINDOWS32
|
||||||
#undef __P
|
# undef __P
|
||||||
#define __P(protos) protos
|
# define __P(protos) protos
|
||||||
#define __ptr_t void *
|
# define __ptr_t void *
|
||||||
|
# if !defined __GNUC__ || __GNUC__ < 2
|
||||||
|
# undef __const
|
||||||
|
# define __const const
|
||||||
|
# endif
|
||||||
#else /* Not C++ or ANSI C. */
|
#else /* Not C++ or ANSI C. */
|
||||||
#undef __P
|
# undef __P
|
||||||
#define __P(protos) ()
|
# define __P(protos) ()
|
||||||
#undef const
|
# undef __const
|
||||||
#define const
|
# define __const
|
||||||
#define __ptr_t char *
|
# define __ptr_t char *
|
||||||
#endif /* C++ or ANSI C. */
|
#endif /* C++ or ANSI C. */
|
||||||
|
|
||||||
/* Bits set in the FLAGS argument to `glob'. */
|
/* Bits set in the FLAGS argument to `glob'. */
|
||||||
@@ -46,26 +48,46 @@ extern "C"
|
|||||||
#define GLOB_APPEND (1 << 5)/* Append to results of a previous call. */
|
#define GLOB_APPEND (1 << 5)/* Append to results of a previous call. */
|
||||||
#define GLOB_NOESCAPE (1 << 6)/* Backslashes don't quote metacharacters. */
|
#define GLOB_NOESCAPE (1 << 6)/* Backslashes don't quote metacharacters. */
|
||||||
#define GLOB_PERIOD (1 << 7)/* Leading `.' can be matched by metachars. */
|
#define GLOB_PERIOD (1 << 7)/* Leading `.' can be matched by metachars. */
|
||||||
#define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
|
|
||||||
|
#if (!defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _BSD_SOURCE \
|
||||||
|
|| defined _GNU_SOURCE)
|
||||||
|
# define GLOB_MAGCHAR (1 << 8)/* Set in gl_flags if any metachars seen. */
|
||||||
|
# define GLOB_ALTDIRFUNC (1 << 9)/* Use gl_opendir et al functions. */
|
||||||
|
# define GLOB_BRACE (1 << 10)/* Expand "{a,b}" to "a" "b". */
|
||||||
|
# define GLOB_NOMAGIC (1 << 11)/* If no magic chars, return the pattern. */
|
||||||
|
# define GLOB_TILDE (1 << 12)/* Expand ~user and ~ to home directories. */
|
||||||
|
# define GLOB_ONLYDIR (1 << 13)/* Match only directories. */
|
||||||
|
# define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
|
||||||
GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \
|
GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \
|
||||||
GLOB_PERIOD|GLOB_ALTDIRFUNC|GLOB_BRACE| \
|
GLOB_PERIOD|GLOB_ALTDIRFUNC|GLOB_BRACE| \
|
||||||
GLOB_NOMAGIC|GLOB_TILDE)
|
GLOB_NOMAGIC|GLOB_TILDE|GLOB_ONLYDIR)
|
||||||
|
#else
|
||||||
#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_BSD_SOURCE)
|
# define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
|
||||||
#define GLOB_MAGCHAR (1 << 8)/* Set in gl_flags if any metachars seen. */
|
GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \
|
||||||
#define GLOB_ALTDIRFUNC (1 << 9)/* Use gl_opendir et al functions. */
|
GLOB_PERIOD)
|
||||||
#define GLOB_BRACE (1 << 10)/* Expand "{a,b}" to "a" "b". */
|
|
||||||
#define GLOB_NOMAGIC (1 << 11)/* If no magic chars, return the pattern. */
|
|
||||||
#define GLOB_TILDE (1 <<12)/* Expand ~user and ~ to home directories. */
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Error returns from `glob'. */
|
/* Error returns from `glob'. */
|
||||||
#define GLOB_NOSPACE 1 /* Ran out of memory. */
|
#define GLOB_NOSPACE 1 /* Ran out of memory. */
|
||||||
#define GLOB_ABEND 2 /* Read error. */
|
#define GLOB_ABORTED 2 /* Read error. */
|
||||||
#define GLOB_NOMATCH 3 /* No matches found. */
|
#define GLOB_NOMATCH 3 /* No matches found. */
|
||||||
|
|
||||||
|
#ifdef _GNU_SOURCE
|
||||||
|
/* Previous versions of this file defined GLOB_ABEND instead of
|
||||||
|
GLOB_ABORTED. Provide a compatibility definition here. */
|
||||||
|
# define GLOB_ABEND GLOB_ABORTED
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* This value is returned if the implementation does not support
|
||||||
|
`glob'. Since this is not the case here it will never be
|
||||||
|
returned but the conformance test suites still require the symbol
|
||||||
|
to be defined. */
|
||||||
|
#if (_XOPEN_SOURCE - 0) == 500
|
||||||
|
# define GLOB_NOSYS (-1)
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Structure describing a globbing run. */
|
/* Structure describing a globbing run. */
|
||||||
#ifndef _AMIGA /* Buggy compiler. */
|
#if !defined _AMIGA && !defined VMS /* Buggy compiler. */
|
||||||
struct stat;
|
struct stat;
|
||||||
#endif
|
#endif
|
||||||
typedef struct
|
typedef struct
|
||||||
@@ -79,9 +101,9 @@ typedef struct
|
|||||||
are used instead of the normal file access functions. */
|
are used instead of the normal file access functions. */
|
||||||
void (*gl_closedir) __P ((void *));
|
void (*gl_closedir) __P ((void *));
|
||||||
struct dirent *(*gl_readdir) __P ((void *));
|
struct dirent *(*gl_readdir) __P ((void *));
|
||||||
__ptr_t (*gl_opendir) __P ((const char *));
|
__ptr_t (*gl_opendir) __P ((__const char *));
|
||||||
int (*gl_lstat) __P ((const char *, struct stat *));
|
int (*gl_lstat) __P ((__const char *, struct stat *));
|
||||||
int (*gl_stat) __P ((const char *, struct stat *));
|
int (*gl_stat) __P ((__const char *, struct stat *));
|
||||||
} glob_t;
|
} glob_t;
|
||||||
|
|
||||||
/* Do glob searching for PATTERN, placing results in PGLOB.
|
/* Do glob searching for PATTERN, placing results in PGLOB.
|
||||||
@@ -92,14 +114,24 @@ typedef struct
|
|||||||
`glob' returns GLOB_ABEND; if it returns zero, the error is ignored.
|
`glob' returns GLOB_ABEND; if it returns zero, the error is ignored.
|
||||||
If memory cannot be allocated for PGLOB, GLOB_NOSPACE is returned.
|
If memory cannot be allocated for PGLOB, GLOB_NOSPACE is returned.
|
||||||
Otherwise, `glob' returns zero. */
|
Otherwise, `glob' returns zero. */
|
||||||
extern int glob __P ((const char *__pattern, int __flags,
|
extern int glob __P ((__const char *__pattern, int __flags,
|
||||||
int (*__errfunc) __P ((const char *, int)),
|
int (*__errfunc) __P ((__const char *, int)),
|
||||||
glob_t *__pglob));
|
glob_t *__pglob));
|
||||||
|
|
||||||
/* Free storage allocated in PGLOB by a previous `glob' call. */
|
/* Free storage allocated in PGLOB by a previous `glob' call. */
|
||||||
extern void globfree __P ((glob_t *__pglob));
|
extern void globfree __P ((glob_t *__pglob));
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef _GNU_SOURCE
|
||||||
|
/* Return nonzero if PATTERN contains any metacharacters.
|
||||||
|
Metacharacters can be quoted with backslashes if QUOTE is nonzero.
|
||||||
|
|
||||||
|
This function is not part of the interface specified by POSIX.2
|
||||||
|
but several programs want to use it. */
|
||||||
|
extern int __glob_pattern_p __P ((__const char *__pattern, int __quote));
|
||||||
|
extern int glob_pattern_p __P ((__const char *__pattern, int __quote));
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -349,9 +349,9 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License along
|
||||||
along with this program; if not, write to the Free Software
|
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
@end smallexample
|
@end smallexample
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|||||||
31
implicit.c
31
implicit.c
@@ -1,5 +1,5 @@
|
|||||||
/* Implicit rule searching for GNU Make.
|
/* Implicit rule searching 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,97 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
|
||||||
@@ -111,14 +111,14 @@ pattern_search (file, archive, depth, recursions)
|
|||||||
/* This buffer records all the dependencies actually found for a rule. */
|
/* This buffer records all the dependencies actually found for a rule. */
|
||||||
char **found_files = (char **) alloca (max_pattern_deps * sizeof (char *));
|
char **found_files = (char **) alloca (max_pattern_deps * sizeof (char *));
|
||||||
/* Number of dep names now in FOUND_FILES. */
|
/* Number of dep names now in FOUND_FILES. */
|
||||||
unsigned int deps_found;
|
unsigned int deps_found = 0;
|
||||||
|
|
||||||
/* Names of possible dependencies are constructed in this buffer. */
|
/* Names of possible dependencies are constructed in this buffer. */
|
||||||
register char *depname = (char *) alloca (namelen + max_pattern_dep_length);
|
register char *depname = (char *) alloca (namelen + max_pattern_dep_length);
|
||||||
|
|
||||||
/* The start and length of the stem of FILENAME for the current rule. */
|
/* The start and length of the stem of FILENAME for the current rule. */
|
||||||
register char *stem;
|
register char *stem = 0;
|
||||||
register unsigned int stemlen;
|
register unsigned int stemlen = 0;
|
||||||
|
|
||||||
/* Buffer in which we store all the rules that are possibly applicable. */
|
/* Buffer in which we store all the rules that are possibly applicable. */
|
||||||
struct rule **tryrules
|
struct rule **tryrules
|
||||||
@@ -152,7 +152,7 @@ pattern_search (file, archive, depth, recursions)
|
|||||||
register struct rule *rule;
|
register struct rule *rule;
|
||||||
register struct dep *dep;
|
register struct dep *dep;
|
||||||
|
|
||||||
char *p;
|
char *p, *vp;
|
||||||
|
|
||||||
#ifndef NO_ARCHIVES
|
#ifndef NO_ARCHIVES
|
||||||
if (archive || ar_name (filename))
|
if (archive || ar_name (filename))
|
||||||
@@ -167,6 +167,17 @@ pattern_search (file, archive, depth, recursions)
|
|||||||
lastslash = rindex (filename, ']');
|
lastslash = rindex (filename, ']');
|
||||||
#else
|
#else
|
||||||
lastslash = rindex (filename, '/');
|
lastslash = rindex (filename, '/');
|
||||||
|
#ifdef __MSDOS__
|
||||||
|
/* Handle backslashes (possibly mixed with forward slashes)
|
||||||
|
and the case of "d:file". */
|
||||||
|
{
|
||||||
|
char *bslash = rindex (filename, '\\');
|
||||||
|
if (lastslash == 0 || bslash > lastslash)
|
||||||
|
lastslash = bslash;
|
||||||
|
if (lastslash == 0 && filename[0] && filename[1] == ':')
|
||||||
|
lastslash = filename + 1;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
if (lastslash != 0 && lastslash[1] == '\0')
|
if (lastslash != 0 && lastslash[1] == '\0')
|
||||||
lastslash = 0;
|
lastslash = 0;
|
||||||
@@ -388,10 +399,12 @@ pattern_search (file, archive, depth, recursions)
|
|||||||
}
|
}
|
||||||
/* This code, given FILENAME = "lib/foo.o", dependency name
|
/* This code, given FILENAME = "lib/foo.o", dependency name
|
||||||
"lib/foo.c", and VPATH=src, searches for "src/lib/foo.c". */
|
"lib/foo.c", and VPATH=src, searches for "src/lib/foo.c". */
|
||||||
if (vpath_search (&p, (time_t *) 0))
|
vp = p;
|
||||||
|
if (vpath_search (&vp, (time_t *) 0))
|
||||||
{
|
{
|
||||||
DEBUGP2 ("Found dependency as `%s'.%s\n", p, "");
|
DEBUGP2 ("Found dependency `%s' as VPATH `%s'\n", p, vp);
|
||||||
found_files[deps_found++] = p;
|
strcpy(vp, p);
|
||||||
|
found_files[deps_found++] = vp;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -554,7 +567,7 @@ pattern_search (file, archive, depth, recursions)
|
|||||||
dep->next = file->deps;
|
dep->next = file->deps;
|
||||||
file->deps = dep;
|
file->deps = dep;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!checked_lastslash[foundrule])
|
if (!checked_lastslash[foundrule])
|
||||||
/* Always allocate new storage, since STEM might be
|
/* Always allocate new storage, since STEM might be
|
||||||
on the stack for an intermediate file. */
|
on the stack for an intermediate file. */
|
||||||
|
|||||||
3
job.h
3
job.h
@@ -44,6 +44,7 @@ struct child
|
|||||||
|
|
||||||
unsigned int good_stdin:1; /* Nonzero if this child has a good stdin. */
|
unsigned int good_stdin:1; /* Nonzero if this child has a good stdin. */
|
||||||
unsigned int deleted:1; /* Nonzero if targets have been deleted. */
|
unsigned int deleted:1; /* Nonzero if targets have been deleted. */
|
||||||
|
char* sh_batch_file; /* used to execute shell commands via scripts */
|
||||||
};
|
};
|
||||||
|
|
||||||
extern struct child *children;
|
extern struct child *children;
|
||||||
@@ -52,7 +53,7 @@ extern void new_job PARAMS ((struct file *file));
|
|||||||
extern void reap_children PARAMS ((int block, int err));
|
extern void reap_children PARAMS ((int block, int err));
|
||||||
extern void start_waiting_jobs PARAMS ((void));
|
extern void start_waiting_jobs PARAMS ((void));
|
||||||
|
|
||||||
extern char **construct_command_argv PARAMS ((char *line, char **restp, struct file *file));
|
extern char **construct_command_argv PARAMS ((char *line, char **restp, struct file *file, char** batch_file));
|
||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
extern int child_execute_job PARAMS ((char *argv, struct child *child));
|
extern int child_execute_job PARAMS ((char *argv, struct child *child));
|
||||||
#else
|
#else
|
||||||
|
|||||||
633
main.c
633
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, 95, 96 Free Software Foundation, Inc.
|
Copyright (C) 1988,89,90,91,94,95,96,97,98 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
|
||||||
@@ -28,7 +28,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||||||
# include <dos/dos.h>
|
# include <dos/dos.h>
|
||||||
# include <proto/dos.h>
|
# include <proto/dos.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include "pathstuff.h"
|
#include "pathstuff.h"
|
||||||
#endif
|
#endif
|
||||||
@@ -129,7 +129,7 @@ int just_print_flag;
|
|||||||
|
|
||||||
int debug_flag = 0;
|
int debug_flag = 0;
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
/* Suspend make in main for a short time to allow debugger to attach */
|
/* Suspend make in main for a short time to allow debugger to attach */
|
||||||
|
|
||||||
int suspend_flag = 0;
|
int suspend_flag = 0;
|
||||||
@@ -180,7 +180,6 @@ int print_version_flag = 0;
|
|||||||
|
|
||||||
static struct stringlist *makefiles = 0;
|
static struct stringlist *makefiles = 0;
|
||||||
|
|
||||||
|
|
||||||
/* Number of job slots (commands that can be run at once). */
|
/* Number of job slots (commands that can be run at once). */
|
||||||
|
|
||||||
unsigned int job_slots = 1;
|
unsigned int job_slots = 1;
|
||||||
@@ -240,7 +239,7 @@ static const struct command_switch switches[] =
|
|||||||
{ 'd', flag, (char *) &debug_flag, 1, 1, 0, 0, 0,
|
{ 'd', flag, (char *) &debug_flag, 1, 1, 0, 0, 0,
|
||||||
"debug", 0,
|
"debug", 0,
|
||||||
"Print lots of debugging information" },
|
"Print lots of debugging information" },
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
{ 'D', flag, (char *) &suspend_flag, 1, 1, 0, 0, 0,
|
{ 'D', flag, (char *) &suspend_flag, 1, 1, 0, 0, 0,
|
||||||
"suspend-for-debug", 0,
|
"suspend-for-debug", 0,
|
||||||
"Suspend process to allow a debugger to attach" },
|
"Suspend process to allow a debugger to attach" },
|
||||||
@@ -392,6 +391,12 @@ struct file *default_file;
|
|||||||
This turns on pedantic compliance with POSIX.2. */
|
This turns on pedantic compliance with POSIX.2. */
|
||||||
|
|
||||||
int posix_pedantic;
|
int posix_pedantic;
|
||||||
|
|
||||||
|
/* Nonzero if some rule detected clock skew; we keep track so (a) we only
|
||||||
|
print one warning about it during the run, and (b) we can print a final
|
||||||
|
warning at the end of the run. */
|
||||||
|
|
||||||
|
int clock_skew_detected;
|
||||||
|
|
||||||
/* Mask of signals that are being caught with fatal_error_signal. */
|
/* Mask of signals that are being caught with fatal_error_signal. */
|
||||||
|
|
||||||
@@ -450,6 +455,187 @@ debug_signal_handler (sig)
|
|||||||
debug_flag = ! debug_flag;
|
debug_flag = ! debug_flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef WINDOWS32
|
||||||
|
/*
|
||||||
|
* HANDLE runtime exceptions by avoiding a requestor on the GUI. Capture
|
||||||
|
* exception and print it to stderr instead.
|
||||||
|
*
|
||||||
|
* If debug_flag not set, just print a simple message and exit.
|
||||||
|
* If debug_flag set, print a more verbose message.
|
||||||
|
* If compiled for DEBUG, let exception pass through to GUI so that
|
||||||
|
* debuggers can attach.
|
||||||
|
*/
|
||||||
|
LONG WINAPI
|
||||||
|
handle_runtime_exceptions( struct _EXCEPTION_POINTERS *exinfo )
|
||||||
|
{
|
||||||
|
PEXCEPTION_RECORD exrec = exinfo->ExceptionRecord;
|
||||||
|
LPSTR cmdline = GetCommandLine();
|
||||||
|
LPSTR prg = strtok(cmdline, " ");
|
||||||
|
CHAR errmsg[1024];
|
||||||
|
#ifdef USE_EVENT_LOG
|
||||||
|
HANDLE hEventSource;
|
||||||
|
LPTSTR lpszStrings[1];
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (!debug_flag)
|
||||||
|
{
|
||||||
|
sprintf(errmsg, "%s: Interrupt/Exception caught ", prg);
|
||||||
|
sprintf(&errmsg[strlen(errmsg)],
|
||||||
|
"(code = 0x%x, addr = 0x%x)\r\n",
|
||||||
|
exrec->ExceptionCode, exrec->ExceptionAddress);
|
||||||
|
fprintf(stderr, errmsg);
|
||||||
|
exit(255);
|
||||||
|
}
|
||||||
|
|
||||||
|
sprintf(errmsg,
|
||||||
|
"\r\nUnhandled exception filter called from program %s\r\n", prg);
|
||||||
|
sprintf(&errmsg[strlen(errmsg)], "ExceptionCode = %x\r\n",
|
||||||
|
exrec->ExceptionCode);
|
||||||
|
sprintf(&errmsg[strlen(errmsg)], "ExceptionFlags = %x\r\n",
|
||||||
|
exrec->ExceptionFlags);
|
||||||
|
sprintf(&errmsg[strlen(errmsg)], "ExceptionAddress = %x\r\n",
|
||||||
|
exrec->ExceptionAddress);
|
||||||
|
|
||||||
|
if (exrec->ExceptionCode == EXCEPTION_ACCESS_VIOLATION
|
||||||
|
&& exrec->NumberParameters >= 2)
|
||||||
|
sprintf(&errmsg[strlen(errmsg)],
|
||||||
|
"Access violation: %s operation at address %x\r\n",
|
||||||
|
exrec->ExceptionInformation[0] ? "write": "read",
|
||||||
|
exrec->ExceptionInformation[1]);
|
||||||
|
|
||||||
|
/* turn this on if we want to put stuff in the event log too */
|
||||||
|
#ifdef USE_EVENT_LOG
|
||||||
|
hEventSource = RegisterEventSource(NULL, "GNU Make");
|
||||||
|
lpszStrings[0] = errmsg;
|
||||||
|
|
||||||
|
if (hEventSource != NULL)
|
||||||
|
{
|
||||||
|
ReportEvent(hEventSource, /* handle of event source */
|
||||||
|
EVENTLOG_ERROR_TYPE, /* event type */
|
||||||
|
0, /* event category */
|
||||||
|
0, /* event ID */
|
||||||
|
NULL, /* current user's SID */
|
||||||
|
1, /* strings in lpszStrings */
|
||||||
|
0, /* no bytes of raw data */
|
||||||
|
lpszStrings, /* array of error strings */
|
||||||
|
NULL); /* no raw data */
|
||||||
|
|
||||||
|
(VOID) DeregisterEventSource(hEventSource);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Write the error to stderr too */
|
||||||
|
fprintf(stderr, errmsg);
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
return EXCEPTION_CONTINUE_SEARCH;
|
||||||
|
#else
|
||||||
|
exit(255);
|
||||||
|
return (255); /* not reached */
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* On WIN32 systems we don't have the luxury of a /bin directory that
|
||||||
|
* is mapped globally to every drive mounted to the system. Since make could
|
||||||
|
* be invoked from any drive, and we don't want to propogate /bin/sh
|
||||||
|
* to every single drive. Allow ourselves a chance to search for
|
||||||
|
* a value for default shell here (if the default path does not exist).
|
||||||
|
*/
|
||||||
|
|
||||||
|
int
|
||||||
|
find_and_set_default_shell(char *token)
|
||||||
|
{
|
||||||
|
int sh_found = 0;
|
||||||
|
char* search_token;
|
||||||
|
PATH_VAR(sh_path);
|
||||||
|
extern char *default_shell;
|
||||||
|
|
||||||
|
if (!token)
|
||||||
|
search_token = default_shell;
|
||||||
|
else
|
||||||
|
search_token = token;
|
||||||
|
|
||||||
|
if (!no_default_sh_exe &&
|
||||||
|
(token == NULL || !strcmp(search_token, default_shell))) {
|
||||||
|
/* no new information, path already set or known */
|
||||||
|
sh_found = 1;
|
||||||
|
} else if (file_exists_p(search_token)) {
|
||||||
|
/* search token path was found */
|
||||||
|
sprintf(sh_path, "%s", search_token);
|
||||||
|
default_shell = strdup(w32ify(sh_path,0));
|
||||||
|
if (debug_flag)
|
||||||
|
printf("find_and_set_shell setting default_shell = %s\n", default_shell);
|
||||||
|
sh_found = 1;
|
||||||
|
} else {
|
||||||
|
char *p;
|
||||||
|
struct variable *v = lookup_variable ("Path", 4);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Search Path for shell
|
||||||
|
*/
|
||||||
|
if (v && v->value) {
|
||||||
|
char *ep;
|
||||||
|
|
||||||
|
p = v->value;
|
||||||
|
ep = strchr(p, PATH_SEPARATOR_CHAR);
|
||||||
|
|
||||||
|
while (ep && *ep) {
|
||||||
|
*ep = '\0';
|
||||||
|
|
||||||
|
if (dir_file_exists_p(p, search_token)) {
|
||||||
|
sprintf(sh_path, "%s/%s", p, search_token);
|
||||||
|
default_shell = strdup(w32ify(sh_path,0));
|
||||||
|
sh_found = 1;
|
||||||
|
*ep = PATH_SEPARATOR_CHAR;
|
||||||
|
|
||||||
|
/* terminate loop */
|
||||||
|
p += strlen(p);
|
||||||
|
} else {
|
||||||
|
*ep = PATH_SEPARATOR_CHAR;
|
||||||
|
p = ++ep;
|
||||||
|
}
|
||||||
|
|
||||||
|
ep = strchr(p, PATH_SEPARATOR_CHAR);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* be sure to check last element of Path */
|
||||||
|
if (p && *p && dir_file_exists_p(p, search_token)) {
|
||||||
|
sprintf(sh_path, "%s/%s", p, search_token);
|
||||||
|
default_shell = strdup(w32ify(sh_path,0));
|
||||||
|
sh_found = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (debug_flag && sh_found)
|
||||||
|
printf("find_and_set_shell path search set default_shell = %s\n", default_shell);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* naive test */
|
||||||
|
if (!unixy_shell && sh_found &&
|
||||||
|
(strstr(default_shell, "sh") || strstr(default_shell, "SH"))) {
|
||||||
|
unixy_shell = 1;
|
||||||
|
batch_mode_shell = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef BATCH_MODE_ONLY_SHELL
|
||||||
|
batch_mode_shell = 1;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return (sh_found);
|
||||||
|
}
|
||||||
|
#endif /* WINDOWS32 */
|
||||||
|
|
||||||
|
#ifdef __MSDOS__
|
||||||
|
|
||||||
|
static void
|
||||||
|
msdos_return_to_initial_directory ()
|
||||||
|
{
|
||||||
|
if (directory_before_chdir)
|
||||||
|
chdir (directory_before_chdir);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef _AMIGA
|
#ifndef _AMIGA
|
||||||
int
|
int
|
||||||
main (argc, argv, envp)
|
main (argc, argv, envp)
|
||||||
@@ -460,21 +646,39 @@ main (argc, argv, envp)
|
|||||||
int main (int argc, char ** argv)
|
int main (int argc, char ** argv)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
static char *stdin_nm = 0;
|
||||||
register struct file *f;
|
register struct file *f;
|
||||||
register unsigned int i;
|
register unsigned int i;
|
||||||
char **p;
|
char **p;
|
||||||
struct dep *read_makefiles;
|
struct dep *read_makefiles;
|
||||||
PATH_VAR (current_directory);
|
PATH_VAR (current_directory);
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
extern int no_default_sh_exe;
|
|
||||||
char *unix_path = NULL;
|
char *unix_path = NULL;
|
||||||
char *win32_path = NULL;
|
char *windows32_path = NULL;
|
||||||
|
|
||||||
|
SetUnhandledExceptionFilter(handle_runtime_exceptions);
|
||||||
|
|
||||||
|
/* start off assuming we have no shell */
|
||||||
|
unixy_shell = 0;
|
||||||
|
no_default_sh_exe = 1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
default_goal_file = 0;
|
default_goal_file = 0;
|
||||||
reading_filename = 0;
|
reading_filename = 0;
|
||||||
reading_lineno_ptr = 0;
|
reading_lineno_ptr = 0;
|
||||||
|
|
||||||
|
#if defined (__MSDOS__) && !defined (_POSIX_SOURCE)
|
||||||
|
/* Request the most powerful version of `system', to
|
||||||
|
make up for the dumb default shell. */
|
||||||
|
__system_flags = (__system_redirect
|
||||||
|
| __system_use_shell
|
||||||
|
| __system_allow_multiple_cmds
|
||||||
|
| __system_allow_long_cmds
|
||||||
|
| __system_handle_null_commands
|
||||||
|
| __system_emulate_chdir);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
#if !defined (HAVE_STRSIGNAL) && !defined (HAVE_SYS_SIGLIST)
|
#if !defined (HAVE_STRSIGNAL) && !defined (HAVE_SYS_SIGLIST)
|
||||||
signame_init ();
|
signame_init ();
|
||||||
#endif
|
#endif
|
||||||
@@ -547,8 +751,16 @@ int main (int argc, char ** argv)
|
|||||||
#ifdef __MSDOS__
|
#ifdef __MSDOS__
|
||||||
if (program == 0)
|
if (program == 0)
|
||||||
program = rindex (argv[0], '\\');
|
program = rindex (argv[0], '\\');
|
||||||
if (program == 0)
|
else
|
||||||
program = rindex (argv[0], ':');
|
{
|
||||||
|
/* Some weird environments might pass us argv[0] with
|
||||||
|
both kinds of slashes; we must find the rightmost. */
|
||||||
|
char *p = rindex (argv[0], '\\');
|
||||||
|
if (p && p > program)
|
||||||
|
program = p;
|
||||||
|
}
|
||||||
|
if (program == 0 && argv[0][1] == ':')
|
||||||
|
program = argv[0] + 1;
|
||||||
#endif
|
#endif
|
||||||
if (program == 0)
|
if (program == 0)
|
||||||
program = argv[0];
|
program = argv[0];
|
||||||
@@ -561,7 +773,7 @@ int main (int argc, char ** argv)
|
|||||||
|
|
||||||
/* Figure out where we are. */
|
/* Figure out where we are. */
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
if (getcwd_fs (current_directory, GET_PATH_MAX) == 0)
|
if (getcwd_fs (current_directory, GET_PATH_MAX) == 0)
|
||||||
#else
|
#else
|
||||||
if (getcwd (current_directory, GET_PATH_MAX) == 0)
|
if (getcwd (current_directory, GET_PATH_MAX) == 0)
|
||||||
@@ -578,28 +790,40 @@ int main (int argc, char ** argv)
|
|||||||
else
|
else
|
||||||
directory_before_chdir = savestring (current_directory,
|
directory_before_chdir = savestring (current_directory,
|
||||||
strlen (current_directory));
|
strlen (current_directory));
|
||||||
|
#ifdef __MSDOS__
|
||||||
|
/* Make sure we will return to the initial directory, come what may. */
|
||||||
|
atexit (msdos_return_to_initial_directory);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Read in variables from the environment. It is important that this be
|
/* Read in variables from the environment. It is important that this be
|
||||||
done before $(MAKE) is are figured out so its definitions will not be
|
done before $(MAKE) is figured out so its definitions will not be
|
||||||
one from the environment. */
|
from the environment. */
|
||||||
|
|
||||||
#ifndef _AMIGA
|
#ifndef _AMIGA
|
||||||
for (i = 0; envp[i] != 0; ++i)
|
for (i = 0; envp[i] != 0; ++i)
|
||||||
{
|
{
|
||||||
|
int do_not_define;
|
||||||
register char *ep = envp[i];
|
register char *ep = envp[i];
|
||||||
|
|
||||||
|
/* by default, everything gets defined and exported */
|
||||||
|
do_not_define = 0;
|
||||||
|
|
||||||
while (*ep != '=')
|
while (*ep != '=')
|
||||||
++ep;
|
++ep;
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
if (!strncmp(ep, "PATH", 4))
|
if (!unix_path && !strncmp(envp[i], "PATH=", 5))
|
||||||
unix_path = &ep[5];
|
unix_path = ep+1;
|
||||||
if (!strncmp(ep, "Path", 4))
|
else if (!windows32_path && !strnicmp(envp[i], "Path=", 5)) {
|
||||||
win32_path = &ep[5];
|
do_not_define = 1; /* it gets defined after loop exits */
|
||||||
|
windows32_path = ep+1;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
/* The result of pointer arithmetic is cast to unsigned int for
|
/* The result of pointer arithmetic is cast to unsigned int for
|
||||||
machines where ptrdiff_t is a different size that doesn't widen
|
machines where ptrdiff_t is a different size that doesn't widen
|
||||||
the same. */
|
the same. */
|
||||||
define_variable (envp[i], (unsigned int) (ep - envp[i]),
|
if (!do_not_define)
|
||||||
ep + 1, o_env, 1)
|
define_variable (envp[i], (unsigned int) (ep - envp[i]),
|
||||||
|
ep + 1, o_env, 1)
|
||||||
/* Force exportation of every variable culled from the environment.
|
/* Force exportation of every variable culled from the environment.
|
||||||
We used to rely on target_environment's v_default code to do this.
|
We used to rely on target_environment's v_default code to do this.
|
||||||
But that does not work for the case where an environment variable
|
But that does not work for the case where an environment variable
|
||||||
@@ -607,12 +831,22 @@ int main (int argc, char ** argv)
|
|||||||
be exported, because it was originally in the environment. */
|
be exported, because it was originally in the environment. */
|
||||||
->export = v_export;
|
->export = v_export;
|
||||||
}
|
}
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
|
/*
|
||||||
|
* Make sure that this particular spelling of 'Path' is available
|
||||||
|
*/
|
||||||
|
if (windows32_path)
|
||||||
|
define_variable("Path", 4, windows32_path, o_env, 1)->export = v_export;
|
||||||
|
else if (unix_path)
|
||||||
|
define_variable("Path", 4, unix_path, o_env, 1)->export = v_export;
|
||||||
|
else
|
||||||
|
define_variable("Path", 4, "", o_env, 1)->export = v_export;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* PATH defaults to Path iff PATH not found and Path is found.
|
* PATH defaults to Path iff PATH not found and Path is found.
|
||||||
*/
|
*/
|
||||||
if (!unix_path && win32_path)
|
if (!unix_path && windows32_path)
|
||||||
define_variable("PATH", 4, win32_path, o_env, 1)->export = v_export;
|
define_variable("PATH", 4, windows32_path, o_env, 1)->export = v_export;
|
||||||
#endif
|
#endif
|
||||||
#else /* For Amiga, read the ENV: device, ignoring all dirs */
|
#else /* For Amiga, read the ENV: device, ignoring all dirs */
|
||||||
{
|
{
|
||||||
@@ -655,7 +889,7 @@ int main (int argc, char ** argv)
|
|||||||
decode_env_switches ("MFLAGS", 6);
|
decode_env_switches ("MFLAGS", 6);
|
||||||
#endif
|
#endif
|
||||||
decode_switches (argc, argv, 0);
|
decode_switches (argc, argv, 0);
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
if (suspend_flag) {
|
if (suspend_flag) {
|
||||||
fprintf(stderr, "%s (pid = %d)\n", argv[0], GetCurrentProcessId());
|
fprintf(stderr, "%s (pid = %d)\n", argv[0], GetCurrentProcessId());
|
||||||
fprintf(stderr, "%s is suspending for 30 seconds...", argv[0]);
|
fprintf(stderr, "%s is suspending for 30 seconds...", argv[0]);
|
||||||
@@ -679,7 +913,7 @@ int main (int argc, char ** argv)
|
|||||||
so the result will run the same program regardless of the current dir.
|
so the result will run the same program regardless of the current dir.
|
||||||
If it is a name with no slash, we can only hope that PATH did not
|
If it is a name with no slash, we can only hope that PATH did not
|
||||||
find it in the current directory.) */
|
find it in the current directory.) */
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
/*
|
/*
|
||||||
* Convert from backslashes to forward slashes for
|
* Convert from backslashes to forward slashes for
|
||||||
* programs like sh which don't like them. Shouldn't
|
* programs like sh which don't like them. Shouldn't
|
||||||
@@ -690,11 +924,11 @@ int main (int argc, char ** argv)
|
|||||||
strstr(argv[0], "..") ||
|
strstr(argv[0], "..") ||
|
||||||
!strncmp(argv[0], "//", 2))
|
!strncmp(argv[0], "//", 2))
|
||||||
argv[0] = strdup(w32ify(argv[0],1));
|
argv[0] = strdup(w32ify(argv[0],1));
|
||||||
#else /* WIN32 */
|
#else /* WINDOWS32 */
|
||||||
if (current_directory[0] != '\0'
|
if (current_directory[0] != '\0'
|
||||||
&& argv[0] != 0 && argv[0][0] != '/' && index (argv[0], '/') != 0)
|
&& argv[0] != 0 && argv[0][0] != '/' && index (argv[0], '/') != 0)
|
||||||
argv[0] = concat (current_directory, "/", argv[0]);
|
argv[0] = concat (current_directory, "/", argv[0]);
|
||||||
#endif /* WIN32 */
|
#endif /* WINDOWS32 */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* The extra indirection through $(MAKE_COMMAND) is done
|
/* The extra indirection through $(MAKE_COMMAND) is done
|
||||||
@@ -718,7 +952,7 @@ int main (int argc, char ** argv)
|
|||||||
if (! v->recursive)
|
if (! v->recursive)
|
||||||
++len;
|
++len;
|
||||||
++len;
|
++len;
|
||||||
len += 2 * strlen (v->value);
|
len += 3 * strlen (v->value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now allocate a buffer big enough and fill it. */
|
/* Now allocate a buffer big enough and fill it. */
|
||||||
@@ -767,7 +1001,7 @@ int main (int argc, char ** argv)
|
|||||||
free (dir);
|
free (dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
/*
|
/*
|
||||||
* THIS BLOCK OF CODE MUST COME AFTER chdir() CALL ABOVE IN ORDER
|
* THIS BLOCK OF CODE MUST COME AFTER chdir() CALL ABOVE IN ORDER
|
||||||
* TO NOT CONFUSE THE DEPENDENCY CHECKING CODE IN implicit.c.
|
* TO NOT CONFUSE THE DEPENDENCY CHECKING CODE IN implicit.c.
|
||||||
@@ -777,69 +1011,9 @@ int main (int argc, char ** argv)
|
|||||||
* lookups to fail because the current directory (.) was pointing
|
* lookups to fail because the current directory (.) was pointing
|
||||||
* at the wrong place when it was first evaluated.
|
* at the wrong place when it was first evaluated.
|
||||||
*/
|
*/
|
||||||
|
no_default_sh_exe = !find_and_set_default_shell(NULL);
|
||||||
|
|
||||||
/*
|
#endif /* WINDOWS32 */
|
||||||
* On Windows/NT, we don't have the luxury of a /bin directory that
|
|
||||||
* is mapped globally to every drive mounted to the system. Since make could
|
|
||||||
* be invoked from any drive, and we don't want to propogate /bin/sh
|
|
||||||
* to every single drive. Allow ourselves a chance to search for
|
|
||||||
* a value for default shell here (if the default path does not exist).
|
|
||||||
*
|
|
||||||
* The value of default_shell is set here, but it could get reset after
|
|
||||||
* the Makefiles are read in. See logic below where SHELL is checked
|
|
||||||
* after the call to read_all_makefiles() completes.
|
|
||||||
*
|
|
||||||
* The reason SHELL is set here is so that macros can be safely evaluated
|
|
||||||
* as makefiles are read in (some macros require $SHELL).
|
|
||||||
*/
|
|
||||||
|
|
||||||
{
|
|
||||||
extern char *default_shell;
|
|
||||||
|
|
||||||
if (!file_exists_p(default_shell)) {
|
|
||||||
char *p;
|
|
||||||
struct variable *v = lookup_variable ("Path", 4);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Try and make sure we have a full path to default_shell before
|
|
||||||
* we parse makefiles.
|
|
||||||
*/
|
|
||||||
if (v && v->value) {
|
|
||||||
PATH_VAR(sh_path);
|
|
||||||
char *ep;
|
|
||||||
|
|
||||||
p = v->value;
|
|
||||||
ep = strchr(p, PATH_SEPARATOR_CHAR);
|
|
||||||
|
|
||||||
while (ep && *ep) {
|
|
||||||
*ep = '\0';
|
|
||||||
|
|
||||||
if (dir_file_exists_p(p, default_shell)) {
|
|
||||||
sprintf(sh_path, "%s/%s", p, default_shell);
|
|
||||||
default_shell = strdup(w32ify(sh_path,0));
|
|
||||||
no_default_sh_exe = 0;
|
|
||||||
*ep = PATH_SEPARATOR_CHAR;
|
|
||||||
|
|
||||||
/* terminate loop */
|
|
||||||
p += strlen(p);
|
|
||||||
} else {
|
|
||||||
*ep = PATH_SEPARATOR_CHAR;
|
|
||||||
p = ++ep;
|
|
||||||
}
|
|
||||||
|
|
||||||
ep = strchr(p, PATH_SEPARATOR_CHAR);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* be sure to check last element of Path */
|
|
||||||
if (p && *p && dir_file_exists_p(p, default_shell)) {
|
|
||||||
sprintf(sh_path, "%s/%s", p, default_shell);
|
|
||||||
default_shell = strdup(w32ify(sh_path,0));
|
|
||||||
no_default_sh_exe = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif /* WIN32 */
|
|
||||||
/* Figure out the level of recursion. */
|
/* Figure out the level of recursion. */
|
||||||
{
|
{
|
||||||
struct variable *v = lookup_variable ("MAKELEVEL", 9);
|
struct variable *v = lookup_variable ("MAKELEVEL", 9);
|
||||||
@@ -868,7 +1042,7 @@ int main (int argc, char ** argv)
|
|||||||
starting_directory = current_directory;
|
starting_directory = current_directory;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
if (getcwd_fs (current_directory, GET_PATH_MAX) == 0)
|
if (getcwd_fs (current_directory, GET_PATH_MAX) == 0)
|
||||||
#else
|
#else
|
||||||
if (getcwd (current_directory, GET_PATH_MAX) == 0)
|
if (getcwd (current_directory, GET_PATH_MAX) == 0)
|
||||||
@@ -885,6 +1059,8 @@ int main (int argc, char ** argv)
|
|||||||
starting_directory = current_directory;
|
starting_directory = current_directory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
(void) define_variable ("CURDIR", 6, current_directory, o_default, 0);
|
||||||
|
|
||||||
/* Read any stdin makefiles into temporary files. */
|
/* Read any stdin makefiles into temporary files. */
|
||||||
|
|
||||||
if (makefiles != 0)
|
if (makefiles != 0)
|
||||||
@@ -912,6 +1088,9 @@ int main (int argc, char ** argv)
|
|||||||
(void) tmpnam (name);
|
(void) tmpnam (name);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (stdin_nm)
|
||||||
|
fatal("Makefile from standard input specified twice.");
|
||||||
|
|
||||||
outfile = fopen (name, "w");
|
outfile = fopen (name, "w");
|
||||||
if (outfile == 0)
|
if (outfile == 0)
|
||||||
pfatal_with_name ("fopen (temporary file)");
|
pfatal_with_name ("fopen (temporary file)");
|
||||||
@@ -922,9 +1101,6 @@ int main (int argc, char ** argv)
|
|||||||
if (n > 0 && fwrite (buf, 1, n, outfile) != n)
|
if (n > 0 && fwrite (buf, 1, n, outfile) != n)
|
||||||
pfatal_with_name ("fwrite (temporary file)");
|
pfatal_with_name ("fwrite (temporary file)");
|
||||||
}
|
}
|
||||||
/* Try to make sure we won't remake the temporary
|
|
||||||
file when we are re-exec'd. Kludge-o-matic! */
|
|
||||||
fprintf (outfile, "%s:;\n", name);
|
|
||||||
(void) fclose (outfile);
|
(void) fclose (outfile);
|
||||||
|
|
||||||
/* Replace the name that read_all_makefiles will
|
/* Replace the name that read_all_makefiles will
|
||||||
@@ -938,14 +1114,15 @@ int main (int argc, char ** argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Make sure the temporary file will not be remade. */
|
/* Make sure the temporary file will not be remade. */
|
||||||
f = enter_file (savestring (name, sizeof name - 1));
|
stdin_nm = savestring (name, sizeof(name) -1);
|
||||||
|
f = enter_file (stdin_nm);
|
||||||
f->updated = 1;
|
f->updated = 1;
|
||||||
f->update_status = 0;
|
f->update_status = 0;
|
||||||
f->command_state = cs_finished;
|
f->command_state = cs_finished;
|
||||||
/* Let it be removed when we're done. */
|
/* Can't be intermediate, or it'll be removed too early for
|
||||||
f->intermediate = 1;
|
make re-exec. */
|
||||||
/* But don't mention it. */
|
f->intermediate = 0;
|
||||||
f->dontcare = 1;
|
f->dontcare = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -985,53 +1162,6 @@ int main (int argc, char ** argv)
|
|||||||
|
|
||||||
define_makeflags (0, 0);
|
define_makeflags (0, 0);
|
||||||
|
|
||||||
#ifdef WIN32
|
|
||||||
/*
|
|
||||||
* Now that makefiles are parsed, see if a Makefile gave a
|
|
||||||
* value for SHELL and use that for default_shell instead if
|
|
||||||
* that filename exists. This should speed up the
|
|
||||||
* construct_argv_internal() function by avoiding unnecessary
|
|
||||||
* recursion.
|
|
||||||
*/
|
|
||||||
{
|
|
||||||
struct variable *v = lookup_variable("SHELL", 5);
|
|
||||||
extern char* default_shell;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* to change value:
|
|
||||||
*
|
|
||||||
* SHELL must be found, SHELL must be set, value of SHELL
|
|
||||||
* must be different from current value, and the
|
|
||||||
* specified file must exist. Whew!
|
|
||||||
*/
|
|
||||||
if (v != 0 && *v->value != '\0') {
|
|
||||||
char *fn = recursively_expand(v);
|
|
||||||
|
|
||||||
if (fn && strcmp(fn, default_shell) && file_exists_p(fn)) {
|
|
||||||
char *p;
|
|
||||||
|
|
||||||
default_shell = fn;
|
|
||||||
|
|
||||||
/* if Makefile says SHELL is sh.exe, believe it */
|
|
||||||
if (strstr(default_shell, "sh.exe"))
|
|
||||||
no_default_sh_exe = 0;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Convert from backslashes to forward slashes so
|
|
||||||
* create_command_line_argv_internal() is not confused.
|
|
||||||
*/
|
|
||||||
for (p = strchr(default_shell, '\\'); p; p = strchr(default_shell, '\\'))
|
|
||||||
*p = '/';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (no_default_sh_exe && job_slots != 1) {
|
|
||||||
error("Do not specify -j or --jobs if sh.exe is not available.");
|
|
||||||
error("Resetting make for single job mode.");
|
|
||||||
job_slots = 1;
|
|
||||||
}
|
|
||||||
#endif /* WIN32 */
|
|
||||||
|
|
||||||
/* Define the default variables. */
|
/* Define the default variables. */
|
||||||
define_default_variables ();
|
define_default_variables ();
|
||||||
|
|
||||||
@@ -1042,6 +1172,40 @@ int main (int argc, char ** argv)
|
|||||||
read_makefiles
|
read_makefiles
|
||||||
= read_all_makefiles (makefiles == 0 ? (char **) 0 : makefiles->list);
|
= read_all_makefiles (makefiles == 0 ? (char **) 0 : makefiles->list);
|
||||||
|
|
||||||
|
#ifdef WINDOWS32
|
||||||
|
/* look one last time after reading all Makefiles */
|
||||||
|
if (no_default_sh_exe)
|
||||||
|
no_default_sh_exe = !find_and_set_default_shell(NULL);
|
||||||
|
|
||||||
|
if (no_default_sh_exe && job_slots != 1) {
|
||||||
|
error("Do not specify -j or --jobs if sh.exe is not available.");
|
||||||
|
error("Resetting make for single job mode.");
|
||||||
|
job_slots = 1;
|
||||||
|
}
|
||||||
|
#endif /* WINDOWS32 */
|
||||||
|
|
||||||
|
#ifdef __MSDOS__
|
||||||
|
/* We need to know what kind of shell we will be using. */
|
||||||
|
{
|
||||||
|
extern int _is_unixy_shell (const char *_path);
|
||||||
|
struct variable *shv = lookup_variable("SHELL", 5);
|
||||||
|
extern int unixy_shell;
|
||||||
|
extern char *default_shell;
|
||||||
|
|
||||||
|
if (shv && *shv->value)
|
||||||
|
{
|
||||||
|
char *shell_path = recursively_expand(shv);
|
||||||
|
|
||||||
|
if (shell_path && _is_unixy_shell (shell_path))
|
||||||
|
unixy_shell = 1;
|
||||||
|
else
|
||||||
|
unixy_shell = 0;
|
||||||
|
if (shell_path)
|
||||||
|
default_shell = shell_path;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif /* __MSDOS__ */
|
||||||
|
|
||||||
/* Decode switches again, in case the variables were set by the makefile. */
|
/* Decode switches again, in case the variables were set by the makefile. */
|
||||||
decode_env_switches ("MAKEFLAGS", 9);
|
decode_env_switches ("MAKEFLAGS", 9);
|
||||||
#if 0
|
#if 0
|
||||||
@@ -1111,6 +1275,8 @@ int main (int argc, char ** argv)
|
|||||||
|
|
||||||
time_t *makefile_mtimes = 0;
|
time_t *makefile_mtimes = 0;
|
||||||
unsigned int mm_idx = 0;
|
unsigned int mm_idx = 0;
|
||||||
|
char **nargv = argv;
|
||||||
|
int nargc = argc;
|
||||||
|
|
||||||
if (debug_flag)
|
if (debug_flag)
|
||||||
puts ("Updating makefiles....");
|
puts ("Updating makefiles....");
|
||||||
@@ -1149,7 +1315,7 @@ int main (int argc, char ** argv)
|
|||||||
/* Free the storage. */
|
/* Free the storage. */
|
||||||
free ((char *) d);
|
free ((char *) d);
|
||||||
|
|
||||||
d = last == 0 ? 0 : last->next;
|
d = last == 0 ? read_makefiles : last->next;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1193,52 +1359,47 @@ int main (int argc, char ** argv)
|
|||||||
in updating or could not be found at all. */
|
in updating or could not be found at all. */
|
||||||
int any_failed = 0;
|
int any_failed = 0;
|
||||||
register unsigned int i;
|
register unsigned int i;
|
||||||
|
struct dep *d;
|
||||||
|
|
||||||
for (i = 0; read_makefiles != 0; ++i)
|
for (i = 0, d = read_makefiles; d != 0; ++i, d = d->next)
|
||||||
{
|
if (d->file->updated)
|
||||||
struct dep *d = read_makefiles;
|
{
|
||||||
read_makefiles = d->next;
|
/* This makefile was updated. */
|
||||||
if (d->file->updated)
|
if (d->file->update_status == 0)
|
||||||
{
|
{
|
||||||
/* This makefile was updated. */
|
/* It was successfully updated. */
|
||||||
if (d->file->update_status == 0)
|
any_remade |= (file_mtime_no_search (d->file)
|
||||||
{
|
!= makefile_mtimes[i]);
|
||||||
/* It was successfully updated. */
|
}
|
||||||
any_remade |= (file_mtime_no_search (d->file)
|
else if (! (d->changed & RM_DONTCARE))
|
||||||
!= makefile_mtimes[i]);
|
{
|
||||||
}
|
time_t mtime;
|
||||||
else if (! (d->changed & RM_DONTCARE))
|
/* The update failed and this makefile was not
|
||||||
{
|
from the MAKEFILES variable, so we care. */
|
||||||
time_t mtime;
|
error ("Failed to remake makefile `%s'.",
|
||||||
/* The update failed and this makefile was not
|
d->file->name);
|
||||||
from the MAKEFILES variable, so we care. */
|
mtime = file_mtime_no_search (d->file);
|
||||||
error ("Failed to remake makefile `%s'.",
|
any_remade |= (mtime != (time_t) -1
|
||||||
d->file->name);
|
&& mtime != makefile_mtimes[i]);
|
||||||
mtime = file_mtime_no_search (d->file);
|
}
|
||||||
any_remade |= (mtime != (time_t) -1
|
}
|
||||||
&& mtime != makefile_mtimes[i]);
|
else
|
||||||
}
|
/* This makefile was not found at all. */
|
||||||
}
|
if (! (d->changed & RM_DONTCARE))
|
||||||
else
|
{
|
||||||
/* This makefile was not found at all. */
|
/* This is a makefile we care about. See how much. */
|
||||||
if (! (d->changed & RM_DONTCARE))
|
if (d->changed & RM_INCLUDED)
|
||||||
{
|
/* An included makefile. We don't need
|
||||||
/* This is a makefile we care about. See how much. */
|
to die, but we do want to complain. */
|
||||||
if (d->changed & RM_INCLUDED)
|
error ("Included makefile `%s' was not found.",
|
||||||
/* An included makefile. We don't need
|
dep_name (d));
|
||||||
to die, but we do want to complain. */
|
else
|
||||||
error ("Included makefile `%s' was not found.",
|
{
|
||||||
dep_name (d));
|
/* A normal makefile. We must die later. */
|
||||||
else
|
error ("Makefile `%s' was not found", dep_name (d));
|
||||||
{
|
any_failed = 1;
|
||||||
/* A normal makefile. We must die later. */
|
}
|
||||||
error ("Makefile `%s' was not found", dep_name (d));
|
}
|
||||||
any_failed = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
free ((char *) d);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (any_remade)
|
if (any_remade)
|
||||||
goto re_exec;
|
goto re_exec;
|
||||||
@@ -1264,7 +1425,7 @@ int main (int argc, char ** argv)
|
|||||||
/* These names might have changed. */
|
/* These names might have changed. */
|
||||||
register unsigned int i, j = 0;
|
register unsigned int i, j = 0;
|
||||||
for (i = 1; i < argc; ++i)
|
for (i = 1; i < argc; ++i)
|
||||||
if (!strcmp (argv[i], "-f")) /* XXX */
|
if (!strncmp (argv[i], "-f", 2)) /* XXX */
|
||||||
{
|
{
|
||||||
char *p = &argv[i][2];
|
char *p = &argv[i][2];
|
||||||
if (*p == '\0')
|
if (*p == '\0')
|
||||||
@@ -1275,6 +1436,15 @@ int main (int argc, char ** argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Add -o option for the stdin temporary file, if necessary. */
|
||||||
|
if (stdin_nm)
|
||||||
|
{
|
||||||
|
nargv = (char **)xmalloc((nargc + 2) * sizeof(char *));
|
||||||
|
bcopy(argv, nargv, argc * sizeof(char *));
|
||||||
|
nargv[nargc++] = concat("-o", stdin_nm, "");
|
||||||
|
nargv[nargc] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (directories != 0 && directories->idx > 0)
|
if (directories != 0 && directories->idx > 0)
|
||||||
{
|
{
|
||||||
char bad;
|
char bad;
|
||||||
@@ -1326,7 +1496,7 @@ int main (int argc, char ** argv)
|
|||||||
{
|
{
|
||||||
char **p;
|
char **p;
|
||||||
fputs ("Re-executing:", stdout);
|
fputs ("Re-executing:", stdout);
|
||||||
for (p = argv; *p != 0; ++p)
|
for (p = nargv; *p != 0; ++p)
|
||||||
printf (" %s", *p);
|
printf (" %s", *p);
|
||||||
puts ("");
|
puts ("");
|
||||||
}
|
}
|
||||||
@@ -1335,9 +1505,9 @@ int main (int argc, char ** argv)
|
|||||||
fflush (stderr);
|
fflush (stderr);
|
||||||
|
|
||||||
#ifndef _AMIGA
|
#ifndef _AMIGA
|
||||||
exec_command (argv, environ);
|
exec_command (nargv, environ);
|
||||||
#else
|
#else
|
||||||
exec_command (argv);
|
exec_command (nargv);
|
||||||
exit (0);
|
exit (0);
|
||||||
#endif
|
#endif
|
||||||
/* NOTREACHED */
|
/* NOTREACHED */
|
||||||
@@ -1347,6 +1517,11 @@ int main (int argc, char ** argv)
|
|||||||
/* Set up `MAKEFLAGS' again for the normal targets. */
|
/* Set up `MAKEFLAGS' again for the normal targets. */
|
||||||
define_makeflags (1, 0);
|
define_makeflags (1, 0);
|
||||||
|
|
||||||
|
/* If there is a temp file from reading a makefile from stdin, get rid of
|
||||||
|
it now. */
|
||||||
|
if (stdin_nm && unlink(stdin_nm) < 0 && errno != ENOENT)
|
||||||
|
perror_with_name("unlink (temporary file): ", stdin_nm);
|
||||||
|
|
||||||
{
|
{
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
@@ -1400,6 +1575,10 @@ int main (int argc, char ** argv)
|
|||||||
fatal ("No targets");
|
fatal ("No targets");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If we detected some clock skew, generate one last warning */
|
||||||
|
if (clock_skew_detected)
|
||||||
|
error("*** Warning: Clock skew detected. Your build may be incomplete.");
|
||||||
|
|
||||||
/* Exit. */
|
/* Exit. */
|
||||||
die (status);
|
die (status);
|
||||||
}
|
}
|
||||||
@@ -1514,6 +1693,29 @@ handle_non_switch_argument (arg, env)
|
|||||||
}
|
}
|
||||||
lastgoal->name = 0;
|
lastgoal->name = 0;
|
||||||
lastgoal->file = f;
|
lastgoal->file = f;
|
||||||
|
|
||||||
|
{
|
||||||
|
/* Add this target name to the MAKECMDGOALS variable. */
|
||||||
|
struct variable *v;
|
||||||
|
char *value;
|
||||||
|
|
||||||
|
v = lookup_variable("MAKECMDGOALS", 12);
|
||||||
|
if (v == 0)
|
||||||
|
value = f->name;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Paste the old and new values together */
|
||||||
|
unsigned int oldlen, newlen;
|
||||||
|
|
||||||
|
oldlen = strlen(v->value);
|
||||||
|
newlen = strlen(f->name);
|
||||||
|
value = (char *)alloca(oldlen + 1 + newlen + 1);
|
||||||
|
bcopy(v->value, value, oldlen);
|
||||||
|
value[oldlen] = ' ';
|
||||||
|
bcopy(f->name, &value[oldlen + 1], newlen + 1);
|
||||||
|
}
|
||||||
|
define_variable("MAKECMDGOALS", 12, value, o_default, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2040,8 +2242,11 @@ define_makeflags (all, makefile)
|
|||||||
/* No flags. */
|
/* No flags. */
|
||||||
flagstring[0] = '\0';
|
flagstring[0] = '\0';
|
||||||
else if (p[-1] == '-')
|
else if (p[-1] == '-')
|
||||||
/* Kill the final space and dash. */
|
{
|
||||||
p[-2] = '\0';
|
/* Kill the final space and dash. */
|
||||||
|
p -= 2;
|
||||||
|
*p = '\0';
|
||||||
|
}
|
||||||
else
|
else
|
||||||
/* Terminate the string. */
|
/* Terminate the string. */
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
@@ -2134,11 +2339,13 @@ 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, 95, 96\n\
|
%sCopyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98\n\
|
||||||
%s\tFree Software Foundation, Inc.\n\
|
%s\tFree 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, precede);
|
%sPARTICULAR PURPOSE.\n\n\
|
||||||
|
%sReport bugs to <bug-make@gnu.org>.\n\n",
|
||||||
|
precede, precede, precede, precede, precede, precede);
|
||||||
|
|
||||||
printed_version = 1;
|
printed_version = 1;
|
||||||
|
|
||||||
@@ -2152,7 +2359,6 @@ print_version ()
|
|||||||
static void
|
static void
|
||||||
print_data_base ()
|
print_data_base ()
|
||||||
{
|
{
|
||||||
extern char *ctime ();
|
|
||||||
time_t when;
|
time_t when;
|
||||||
|
|
||||||
when = time ((time_t *) 0);
|
when = time ((time_t *) 0);
|
||||||
@@ -2182,13 +2388,6 @@ die (status)
|
|||||||
|
|
||||||
dying = 1;
|
dying = 1;
|
||||||
|
|
||||||
/* Try to move back to the original directory. This is essential on
|
|
||||||
MS-DOS (where there is really only one process), and on Unix it
|
|
||||||
puts core files in the original directory instead of the -C
|
|
||||||
directory. */
|
|
||||||
if (directory_before_chdir != 0)
|
|
||||||
chdir (directory_before_chdir);
|
|
||||||
|
|
||||||
if (print_version_flag)
|
if (print_version_flag)
|
||||||
print_version ();
|
print_version ();
|
||||||
|
|
||||||
@@ -2205,6 +2404,14 @@ die (status)
|
|||||||
if (print_data_base_flag)
|
if (print_data_base_flag)
|
||||||
print_data_base ();
|
print_data_base ();
|
||||||
|
|
||||||
|
/* Try to move back to the original directory. This is essential on
|
||||||
|
MS-DOS (where there is really only one process), and on Unix it
|
||||||
|
puts core files in the original directory instead of the -C
|
||||||
|
directory. Must wait until after remove_intermediates(), or unlinks
|
||||||
|
of relative pathnames fail. */
|
||||||
|
if (directory_before_chdir != 0)
|
||||||
|
chdir (directory_before_chdir);
|
||||||
|
|
||||||
log_working_directory (0);
|
log_working_directory (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2219,7 +2426,7 @@ log_working_directory (entering)
|
|||||||
int entering;
|
int entering;
|
||||||
{
|
{
|
||||||
static int entered = 0;
|
static int entered = 0;
|
||||||
char *message = entering ? "Entering" : "Leaving";
|
char *msg = entering ? "Entering" : "Leaving";
|
||||||
|
|
||||||
/* Print nothing without the flag. Don't print the entering message
|
/* Print nothing without the flag. Don't print the entering message
|
||||||
again if we already have. Don't print the leaving message if we
|
again if we already have. Don't print the leaving message if we
|
||||||
@@ -2233,9 +2440,9 @@ log_working_directory (entering)
|
|||||||
fputs ("# ", stdout);
|
fputs ("# ", stdout);
|
||||||
|
|
||||||
if (makelevel == 0)
|
if (makelevel == 0)
|
||||||
printf ("%s: %s ", program, message);
|
printf ("%s: %s ", program, msg);
|
||||||
else
|
else
|
||||||
printf ("%s[%u]: %s ", program, makelevel, message);
|
printf ("%s[%u]: %s ", program, makelevel, msg);
|
||||||
|
|
||||||
if (starting_directory == 0)
|
if (starting_directory == 0)
|
||||||
puts ("an unknown directory");
|
puts ("an unknown directory");
|
||||||
|
|||||||
86
maintMakefile
Normal file
86
maintMakefile
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
# Maintainer-only makefile segment. This contains things that are relevant
|
||||||
|
# only if you have the full copy of the GNU make sources, not a dist copy.
|
||||||
|
#
|
||||||
|
|
||||||
|
# Find the glob source files... this might be dangerous, but we're maintainers!
|
||||||
|
#
|
||||||
|
globsrc := $(wildcard glob/*.c)
|
||||||
|
globhdr := $(wildcard glob/*.h)
|
||||||
|
|
||||||
|
TEMPLATES = README README.DOS config.ami configh.dos config.h.W32 config.h-vms
|
||||||
|
MTEMPLATES = Makefile.DOS SMakefile
|
||||||
|
|
||||||
|
# General rule for turning a .template into a regular file.
|
||||||
|
#
|
||||||
|
$(TEMPLATES) : % : %.template configure.in
|
||||||
|
rm -f $@
|
||||||
|
sed -e 's@%VERSION%@$(VERSION)@' \
|
||||||
|
-e 's@%PACKAGE%@$(PACKAGE)@' \
|
||||||
|
$< > $@
|
||||||
|
chmod a-w $@
|
||||||
|
|
||||||
|
# Construct Makefiles by adding on dependencies, etc.
|
||||||
|
#
|
||||||
|
$(MTEMPLATES) : % : %.template .dep_segment Makefile.am maintMakefile
|
||||||
|
rm -f $@
|
||||||
|
sed -e 's@%VERSION%@$(VERSION)@' \
|
||||||
|
-e 's@%PROGRAMS%@$(bin_PROGRAMS)@' \
|
||||||
|
-e 's@%SOURCES%@$(filter-out remote-%,$(make_SOURCES)) remote-$$(REMOTE).c@' \
|
||||||
|
-e 's@%OBJECTS%@$(filter-out remote-%,$(make_OBJECTS)) remote-$$(REMOTE).o@' \
|
||||||
|
-e 's@%GLOB_SOURCES%@$(globsrc) $(globhdr)@' \
|
||||||
|
-e 's@%GLOB_OBJECTS%@$(globsrc:glob/%.c=%.o)@' \
|
||||||
|
$< > $@
|
||||||
|
echo >>$@; echo '# --------------- DEPENDENCIES' >>$@; echo '#' >>$@; \
|
||||||
|
cat $(word 2,$^) >>$@
|
||||||
|
chmod a-w $@
|
||||||
|
|
||||||
|
NMakefile: NMakefile.template .dep_segment Makefile.am maintMakefile
|
||||||
|
rm -f $@
|
||||||
|
cp $< $@
|
||||||
|
echo >>$@; echo '# --------------- DEPENDENCIES' >>$@; echo '#' >>$@; \
|
||||||
|
sed 's/^\([^ ]*\)\.o:/$$(OUTDIR)\/\1.obj:/' $(word 2,$^) >>$@
|
||||||
|
chmod a-w $@
|
||||||
|
|
||||||
|
# Construct build.sh.in
|
||||||
|
#
|
||||||
|
build.sh.in: build.template Makefile.am maintMakefile
|
||||||
|
rm -f $@
|
||||||
|
sed -e 's@%objs%@$(filter-out remote-%, $(make_OBJECTS)\
|
||||||
|
$(patsubst %.c,%.o,$(globsrc)))@' \
|
||||||
|
$< > $@
|
||||||
|
chmod a-w+x $@
|
||||||
|
|
||||||
|
# Use automake to build a dependency list file, for "foreign" makefiles like
|
||||||
|
# Makefile.DOS.
|
||||||
|
#
|
||||||
|
.dep_segment: Makefile.am maintMakefile $(DEP_FILES)
|
||||||
|
$(AUTOMAKE) --generate-deps --build-dir=. --srcdir-name=.
|
||||||
|
|
||||||
|
# We clean everything here. The GNU standards for makefile conventions say
|
||||||
|
# you shouldn't remove configure, etc., but this makefile is only available
|
||||||
|
# in a full development distribution, so they'll only be removed then.
|
||||||
|
#
|
||||||
|
# And _I_ want them to be removed ;)
|
||||||
|
#
|
||||||
|
maintFILES = configure aclocal.m4 config.h.in Makefile.in stamp-h.in \
|
||||||
|
glob/configure glob/aclocal.m4 glob/config.h.in glob/Makefile.in \
|
||||||
|
glob/stamp-h.in
|
||||||
|
|
||||||
|
MAINTAINERCLEANFILES = $(maintFILES) $(TEMPLATES) $(MTEMPLATES) NMakefile \
|
||||||
|
missing build.sh.in .dep_segment
|
||||||
|
|
||||||
|
# Put the alpha distribution files up for anonymous FTP.
|
||||||
|
#
|
||||||
|
ALPHA := ~ftp/gnu
|
||||||
|
TARFILE := $(distdir).tar.gz
|
||||||
|
|
||||||
|
.PHONY: alpha
|
||||||
|
alpha: $(ALPHA) $(TARFILE)
|
||||||
|
@rm -f $(ALPHA)/$(TARFILE)
|
||||||
|
cp -p $(TARFILE) $(ALPHA)
|
||||||
|
|
||||||
|
# This is needed because normal builds with GCC don't compile alloca.c, so
|
||||||
|
# alloca.P doesn't get built :-/.
|
||||||
|
#
|
||||||
|
.deps/alloca.P: alloca.c
|
||||||
|
$(COMPILE) -M -o $@ $<
|
||||||
226
make-stds.texi
226
make-stds.texi
@@ -28,6 +28,8 @@ describes conventions for writing the Makefiles for GNU programs.
|
|||||||
* Command Variables:: Variables for Specifying Commands
|
* Command Variables:: Variables for Specifying Commands
|
||||||
* Directory Variables:: Variables for Installation Directories
|
* Directory Variables:: Variables for Installation Directories
|
||||||
* Standard Targets:: Standard Targets for Users
|
* Standard Targets:: Standard Targets for Users
|
||||||
|
* Install Command Categories:: Three categories of commands in the `install'
|
||||||
|
rule: normal, pre-install and post-install.
|
||||||
@end menu
|
@end menu
|
||||||
|
|
||||||
@node Makefile Basics
|
@node Makefile Basics
|
||||||
@@ -65,9 +67,10 @@ part of the make or @file{$(srcdir)/} if the file is an unchanging part
|
|||||||
of the source code. Without one of these prefixes, the current search
|
of the source code. Without one of these prefixes, the current search
|
||||||
path is used.
|
path is used.
|
||||||
|
|
||||||
The distinction between @file{./} and @file{$(srcdir)/} is important
|
The distinction between @file{./} (the @dfn{build directory}) and
|
||||||
when using the @samp{--srcdir} option to @file{configure}. A rule of
|
@file{$(srcdir)/} (the @dfn{source directory}) is important because
|
||||||
the form:
|
users can build in a separate directory using the @samp{--srcdir} option
|
||||||
|
to @file{configure}. A rule of the form:
|
||||||
|
|
||||||
@smallexample
|
@smallexample
|
||||||
foo.1 : foo.man sedscript
|
foo.1 : foo.man sedscript
|
||||||
@@ -75,9 +78,8 @@ foo.1 : foo.man sedscript
|
|||||||
@end smallexample
|
@end smallexample
|
||||||
|
|
||||||
@noindent
|
@noindent
|
||||||
will fail when the current directory is not the source directory,
|
will fail when the build directory is not the source directory, because
|
||||||
because @file{foo.man} and @file{sedscript} are not in the current
|
@file{foo.man} and @file{sedscript} are in the the source directory.
|
||||||
directory.
|
|
||||||
|
|
||||||
When using GNU @code{make}, relying on @samp{VPATH} to find the source
|
When using GNU @code{make}, relying on @samp{VPATH} to find the source
|
||||||
file will work in the case where there is a single dependency file,
|
file will work in the case where there is a single dependency file,
|
||||||
@@ -109,6 +111,18 @@ foo.1 : foo.man sedscript
|
|||||||
sed -e $(srcdir)/sedscript $(srcdir)/foo.man > $@@
|
sed -e $(srcdir)/sedscript $(srcdir)/foo.man > $@@
|
||||||
@end smallexample
|
@end smallexample
|
||||||
|
|
||||||
|
GNU distributions usually contain some files which are not source
|
||||||
|
files---for example, Info files, and the output from Autoconf, Automake,
|
||||||
|
Bison or Flex. Since these files normally appear in the source
|
||||||
|
directory, they should always appear in the source directory, not in the
|
||||||
|
build directory. So Makefile rules to update them should put the
|
||||||
|
updated files in the source directory.
|
||||||
|
|
||||||
|
However, if a file does not appear in the distribution, then the
|
||||||
|
Makefile should not put it in the source directory, because building a
|
||||||
|
program in ordinary circumstances should not modify the source directory
|
||||||
|
in any way.
|
||||||
|
|
||||||
Try to make the build and installation targets, at least (and all their
|
Try to make the build and installation targets, at least (and all their
|
||||||
subtargets) work correctly with a parallel @code{make}.
|
subtargets) work correctly with a parallel @code{make}.
|
||||||
|
|
||||||
@@ -122,11 +136,17 @@ special features of @code{ksh} or @code{bash}.
|
|||||||
The @code{configure} script and the Makefile rules for building and
|
The @code{configure} script and the Makefile rules for building and
|
||||||
installation should not use any utilities directly except these:
|
installation should not use any utilities directly except these:
|
||||||
|
|
||||||
|
@c dd find
|
||||||
|
@c gunzip gzip md5sum
|
||||||
|
@c mkfifo mknod tee uname
|
||||||
|
|
||||||
@example
|
@example
|
||||||
cat cmp cp echo egrep expr false grep
|
cat cmp cp diff echo egrep expr false grep install-info
|
||||||
ln mkdir mv pwd rm rmdir sed test touch true
|
ln ls mkdir mv pwd rm rmdir sed sleep sort tar test touch true
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
|
The compression program @code{gzip} can be used in the @code{dist} rule.
|
||||||
|
|
||||||
Stick to the generally supported options for these programs. For
|
Stick to the generally supported options for these programs. For
|
||||||
example, don't use @samp{mkdir -p}, convenient as it may be, because
|
example, don't use @samp{mkdir -p}, convenient as it may be, because
|
||||||
most systems don't support it.
|
most systems don't support it.
|
||||||
@@ -140,26 +160,33 @@ user can substitute alternatives. Here are some of the programs we
|
|||||||
mean:
|
mean:
|
||||||
|
|
||||||
@example
|
@example
|
||||||
ar bison cc flex install ld lex
|
ar bison cc flex install ld ldconfig lex
|
||||||
make makeinfo ranlib texi2dvi yacc
|
make makeinfo ranlib texi2dvi yacc
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
Use the following @code{make} variables:
|
Use the following @code{make} variables to run those programs:
|
||||||
|
|
||||||
@example
|
@example
|
||||||
$(AR) $(BISON) $(CC) $(FLEX) $(INSTALL) $(LD) $(LEX)
|
$(AR) $(BISON) $(CC) $(FLEX) $(INSTALL) $(LD) $(LDCONFIG) $(LEX)
|
||||||
$(MAKE) $(MAKEINFO) $(RANLIB) $(TEXI2DVI) $(YACC)
|
$(MAKE) $(MAKEINFO) $(RANLIB) $(TEXI2DVI) $(YACC)
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
When you use @code{ranlib}, you should make sure nothing bad happens if
|
When you use @code{ranlib} or @code{ldconfig}, you should make sure
|
||||||
the system does not have @code{ranlib}. Arrange to ignore an error
|
nothing bad happens if the system does not have the program in question.
|
||||||
from that command, and print a message before the command to tell the
|
Arrange to ignore an error from that command, and print a message before
|
||||||
user that failure of the @code{ranlib} command does not mean a problem.
|
the command to tell the user that failure of this command does not mean
|
||||||
(The Autoconf @samp{AC_PROG_RANLIB} macro can help with this.)
|
a problem. (The Autoconf @samp{AC_PROG_RANLIB} macro can help with
|
||||||
|
this.)
|
||||||
|
|
||||||
If you use symbolic links, you should implement a fallback for systems
|
If you use symbolic links, you should implement a fallback for systems
|
||||||
that don't have symbolic links.
|
that don't have symbolic links.
|
||||||
|
|
||||||
|
Additional utilities that can be used via Make variables are:
|
||||||
|
|
||||||
|
@example
|
||||||
|
chgrp chmod chown mknod
|
||||||
|
@end example
|
||||||
|
|
||||||
It is ok to use other utilities in Makefile portions (or scripts)
|
It is ok to use other utilities in Makefile portions (or scripts)
|
||||||
intended only for particular systems where you know those utilities
|
intended only for particular systems where you know those utilities
|
||||||
exist.
|
exist.
|
||||||
@@ -182,11 +209,12 @@ don't need to replace them with other programs.
|
|||||||
Each program-name variable should come with an options variable that is
|
Each program-name variable should come with an options variable that is
|
||||||
used to supply options to the program. Append @samp{FLAGS} to the
|
used to supply options to the program. Append @samp{FLAGS} to the
|
||||||
program-name variable name to get the options variable name---for
|
program-name variable name to get the options variable name---for
|
||||||
example, @code{BISONFLAGS}. (The name @code{CFLAGS} is an exception to
|
example, @code{BISONFLAGS}. (The names @code{CFLAGS} for the C
|
||||||
this rule, but we keep it because it is standard.) Use @code{CPPFLAGS}
|
compiler, @code{YFLAGS} for yacc, and @code{LFLAGS} for lex, are
|
||||||
in any compilation command that runs the preprocessor, and use
|
exceptions to this rule, but we keep them because they are standard.)
|
||||||
@code{LDFLAGS} in any compilation command that does linking as well as
|
Use @code{CPPFLAGS} in any compilation command that runs the
|
||||||
in any direct use of @code{ld}.
|
preprocessor, and use @code{LDFLAGS} in any compilation command that
|
||||||
|
does linking as well as in any direct use of @code{ld}.
|
||||||
|
|
||||||
If there are C compiler options that @emph{must} be used for proper
|
If there are C compiler options that @emph{must} be used for proper
|
||||||
compilation of certain files, do not include them in @code{CFLAGS}.
|
compilation of certain files, do not include them in @code{CFLAGS}.
|
||||||
@@ -212,6 +240,9 @@ Put @code{CFLAGS} last in the compilation command, after other variables
|
|||||||
containing compiler options, so the user can use @code{CFLAGS} to
|
containing compiler options, so the user can use @code{CFLAGS} to
|
||||||
override the others.
|
override the others.
|
||||||
|
|
||||||
|
@code{CFLAGS} should be used in every invocation of the C compiler,
|
||||||
|
both those which do compilation and those which do linking.
|
||||||
|
|
||||||
Every Makefile should define the variable @code{INSTALL}, which is the
|
Every Makefile should define the variable @code{INSTALL}, which is the
|
||||||
basic command for installing a file into the system.
|
basic command for installing a file into the system.
|
||||||
|
|
||||||
@@ -328,14 +359,11 @@ files. This directory should normally be @file{/usr/local/etc}, but
|
|||||||
write it as @file{$(prefix)/etc}.
|
write it as @file{$(prefix)/etc}.
|
||||||
(If you are using Autoconf, write it as @samp{@@sysconfdir@@}.)
|
(If you are using Autoconf, write it as @samp{@@sysconfdir@@}.)
|
||||||
|
|
||||||
@c rewritten to avoid overfull hbox --tower
|
Do not install executables here in this directory (they probably belong
|
||||||
Do not install executables
|
in @file{$(libexecdir)} or @file{$(sbindir)}). Also do not install
|
||||||
@c here
|
files that are modified in the normal course of their use (programs
|
||||||
in this directory (they probably
|
whose purpose is to change the configuration of the system excluded).
|
||||||
belong in @file{$(libexecdir)} or @file{$(sbindir)}). Also do not
|
Those probably belong in @file{$(localstatedir)}.
|
||||||
install files that are modified in the normal course of their use
|
|
||||||
(programs whose purpose is to change the configuration of the system
|
|
||||||
excluded). Those probably belong in @file{$(localstatedir)}.
|
|
||||||
|
|
||||||
@item sharedstatedir
|
@item sharedstatedir
|
||||||
The directory for installing architecture-independent data files which
|
The directory for installing architecture-independent data files which
|
||||||
@@ -388,7 +416,7 @@ should normally be @file{/usr/local/include}, but write it as
|
|||||||
@file{$(prefix)/include}.
|
@file{$(prefix)/include}.
|
||||||
(If you are using Autoconf, write it as @samp{@@includedir@@}.)
|
(If you are using Autoconf, write it as @samp{@@includedir@@}.)
|
||||||
|
|
||||||
Most compilers other than GCC do not look for header files in
|
Most compilers other than GCC do not look for header files in directory
|
||||||
@file{/usr/local/include}. So installing the header files this way is
|
@file{/usr/local/include}. So installing the header files this way is
|
||||||
only useful with GCC. Sometimes this is not a problem because some
|
only useful with GCC. Sometimes this is not a problem because some
|
||||||
libraries are only really intended to work with GCC. But some libraries
|
libraries are only really intended to work with GCC. But some libraries
|
||||||
@@ -541,6 +569,7 @@ Here is a sample rule to install an Info file:
|
|||||||
@comment Please do not reformat it without talking to roland@gnu.ai.mit.edu.
|
@comment Please do not reformat it without talking to roland@gnu.ai.mit.edu.
|
||||||
@smallexample
|
@smallexample
|
||||||
$(infodir)/foo.info: foo.info
|
$(infodir)/foo.info: foo.info
|
||||||
|
$(POST_INSTALL)
|
||||||
# There may be a newer info file in . than in srcdir.
|
# There may be a newer info file in . than in srcdir.
|
||||||
-if test -f foo.info; then d=.; \
|
-if test -f foo.info; then d=.; \
|
||||||
else d=$(srcdir); fi; \
|
else d=$(srcdir); fi; \
|
||||||
@@ -557,17 +586,24 @@ $(infodir)/foo.info: foo.info
|
|||||||
else true; fi
|
else true; fi
|
||||||
@end smallexample
|
@end smallexample
|
||||||
|
|
||||||
|
When writing the @code{install} target, you must classify all the
|
||||||
|
commands into three categories: normal ones, @dfn{pre-installation}
|
||||||
|
commands and @dfn{post-installation} commands. @xref{Install Command
|
||||||
|
Categories}.
|
||||||
|
|
||||||
@item uninstall
|
@item uninstall
|
||||||
Delete all the installed files that the @samp{install} target would
|
Delete all the installed files---the copies that the @samp{install}
|
||||||
create (but not the noninstalled files such as @samp{make all} would
|
target creates.
|
||||||
create).
|
|
||||||
|
|
||||||
This rule should not modify the directories where compilation is done,
|
This rule should not modify the directories where compilation is done,
|
||||||
only the directories where files are installed.
|
only the directories where files are installed.
|
||||||
|
|
||||||
|
The uninstallation commands are divided into three categories, just like
|
||||||
|
the installation commands. @xref{Install Command Categories}.
|
||||||
|
|
||||||
@item install-strip
|
@item install-strip
|
||||||
Like @code{install}, but strip the executable files while installing
|
Like @code{install}, but strip the executable files while installing
|
||||||
them. The definition of this target can be very simple:
|
them. In many cases, the definition of this target can be very simple:
|
||||||
|
|
||||||
@smallexample
|
@smallexample
|
||||||
install-strip:
|
install-strip:
|
||||||
@@ -652,6 +688,12 @@ You must define the variable @code{MAKEINFO} in the Makefile. It should
|
|||||||
run the @code{makeinfo} program, which is part of the Texinfo
|
run the @code{makeinfo} program, which is part of the Texinfo
|
||||||
distribution.
|
distribution.
|
||||||
|
|
||||||
|
Normally a GNU distribution comes with Info files, and that means the
|
||||||
|
Info files are present in the source directory. Therefore, the Make
|
||||||
|
rule for an info file should update it in the source directory. When
|
||||||
|
users build the package, ordinarily Make will not update the Info files
|
||||||
|
because they will already be up to date.
|
||||||
|
|
||||||
@item dvi
|
@item dvi
|
||||||
Generate DVI files for all Texinfo documentation.
|
Generate DVI files for all Texinfo documentation.
|
||||||
For example:
|
For example:
|
||||||
@@ -734,3 +776,119 @@ installdirs: mkinstalldirs
|
|||||||
This rule should not modify the directories where compilation is done.
|
This rule should not modify the directories where compilation is done.
|
||||||
It should do nothing but create installation directories.
|
It should do nothing but create installation directories.
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
|
@node Install Command Categories
|
||||||
|
@section Install Command Categories
|
||||||
|
|
||||||
|
@cindex pre-installation commands
|
||||||
|
@cindex post-installation commands
|
||||||
|
When writing the @code{install} target, you must classify all the
|
||||||
|
commands into three categories: normal ones, @dfn{pre-installation}
|
||||||
|
commands and @dfn{post-installation} commands.
|
||||||
|
|
||||||
|
Normal commands move files into their proper places, and set their
|
||||||
|
modes. They may not alter any files except the ones that come entirely
|
||||||
|
from the package they belong to.
|
||||||
|
|
||||||
|
Pre-installation and post-installation commands may alter other files;
|
||||||
|
in particular, they can edit global configuration files or data bases.
|
||||||
|
|
||||||
|
Pre-installation commands are typically executed before the normal
|
||||||
|
commands, and post-installation commands are typically run after the
|
||||||
|
normal commands.
|
||||||
|
|
||||||
|
The most common use for a post-installation command is to run
|
||||||
|
@code{install-info}. This cannot be done with a normal command, since
|
||||||
|
it alters a file (the Info directory) which does not come entirely and
|
||||||
|
solely from the package being installed. It is a post-installation
|
||||||
|
command because it needs to be done after the normal command which
|
||||||
|
installs the package's Info files.
|
||||||
|
|
||||||
|
Most programs don't need any pre-installation commands, but we have the
|
||||||
|
feature just in case it is needed.
|
||||||
|
|
||||||
|
To classify the commands in the @code{install} rule into these three
|
||||||
|
categories, insert @dfn{category lines} among them. A category line
|
||||||
|
specifies the category for the commands that follow.
|
||||||
|
|
||||||
|
A category line consists of a tab and a reference to a special Make
|
||||||
|
variable, plus an optional comment at the end. There are three
|
||||||
|
variables you can use, one for each category; the variable name
|
||||||
|
specifies the category. Category lines are no-ops in ordinary execution
|
||||||
|
because these three Make variables are normally undefined (and you
|
||||||
|
@emph{should not} define them in the makefile).
|
||||||
|
|
||||||
|
Here are the three possible category lines, each with a comment that
|
||||||
|
explains what it means:
|
||||||
|
|
||||||
|
@smallexample
|
||||||
|
$(PRE_INSTALL) # @r{Pre-install commands follow.}
|
||||||
|
$(POST_INSTALL) # @r{Post-install commands follow.}
|
||||||
|
$(NORMAL_INSTALL) # @r{Normal commands follow.}
|
||||||
|
@end smallexample
|
||||||
|
|
||||||
|
If you don't use a category line at the beginning of the @code{install}
|
||||||
|
rule, all the commands are classified as normal until the first category
|
||||||
|
line. If you don't use any category lines, all the commands are
|
||||||
|
classified as normal.
|
||||||
|
|
||||||
|
These are the category lines for @code{uninstall}:
|
||||||
|
|
||||||
|
@smallexample
|
||||||
|
$(PRE_UNINSTALL) # @r{Pre-uninstall commands follow.}
|
||||||
|
$(POST_UNINSTALL) # @r{Post-uninstall commands follow.}
|
||||||
|
$(NORMAL_UNINSTALL) # @r{Normal commands follow.}
|
||||||
|
@end smallexample
|
||||||
|
|
||||||
|
Typically, a pre-uninstall command would be used for deleting entries
|
||||||
|
from the Info directory.
|
||||||
|
|
||||||
|
If the @code{install} or @code{uninstall} target has any dependencies
|
||||||
|
which act as subroutines of installation, then you should start
|
||||||
|
@emph{each} dependency's commands with a category line, and start the
|
||||||
|
main target's commands with a category line also. This way, you can
|
||||||
|
ensure that each command is placed in the right category regardless of
|
||||||
|
which of the dependencies actually run.
|
||||||
|
|
||||||
|
Pre-installation and post-installation commands should not run any
|
||||||
|
programs except for these:
|
||||||
|
|
||||||
|
@example
|
||||||
|
[ basename bash cat chgrp chmod chown cmp cp dd diff echo
|
||||||
|
egrep expand expr false fgrep find getopt grep gunzip gzip
|
||||||
|
hostname install install-info kill ldconfig ln ls md5sum
|
||||||
|
mkdir mkfifo mknod mv printenv pwd rm rmdir sed sort tee
|
||||||
|
test touch true uname xargs yes
|
||||||
|
@end example
|
||||||
|
|
||||||
|
@cindex binary packages
|
||||||
|
The reason for distinguishing the commands in this way is for the sake
|
||||||
|
of making binary packages. Typically a binary package contains all the
|
||||||
|
executables and other files that need to be installed, and has its own
|
||||||
|
method of installing them---so it does not need to run the normal
|
||||||
|
installation commands. But installing the binary package does need to
|
||||||
|
execute the pre-installation and post-installation commands.
|
||||||
|
|
||||||
|
Programs to build binary packages work by extracting the
|
||||||
|
pre-installation and post-installation commands. Here is one way of
|
||||||
|
extracting the pre-installation commands:
|
||||||
|
|
||||||
|
@smallexample
|
||||||
|
make -n install -o all \
|
||||||
|
PRE_INSTALL=pre-install \
|
||||||
|
POST_INSTALL=post-install \
|
||||||
|
NORMAL_INSTALL=normal-install \
|
||||||
|
| gawk -f pre-install.awk
|
||||||
|
@end smallexample
|
||||||
|
|
||||||
|
@noindent
|
||||||
|
where the file @file{pre-install.awk} could contain this:
|
||||||
|
|
||||||
|
@smallexample
|
||||||
|
$0 ~ /^\t[ \t]*(normal_install|post_install)[ \t]*$/ @{on = 0@}
|
||||||
|
on @{print $0@}
|
||||||
|
$0 ~ /^\t[ \t]*pre_install[ \t]*$/ @{on = 1@}
|
||||||
|
@end smallexample
|
||||||
|
|
||||||
|
The resulting file of pre-installation commands is executed as a shell
|
||||||
|
script as part of installing the binary package.
|
||||||
|
|||||||
32
make.1
32
make.1
@@ -5,17 +5,16 @@ make \- GNU make utility to maintain groups of programs
|
|||||||
.B "make "
|
.B "make "
|
||||||
[
|
[
|
||||||
.B \-f
|
.B \-f
|
||||||
makefile ] [ option ] ...
|
.I makefile
|
||||||
|
] [ option ] ...
|
||||||
target ...
|
target ...
|
||||||
.SH WARNING
|
.SH WARNING
|
||||||
This man paage is an extract of the documentation of
|
This man page is an extract of the documentation of
|
||||||
.I GNU make .
|
.I GNU make .
|
||||||
It is updated only occasionally, because the GNU project does not use nroff.
|
It is updated only occasionally, because the GNU project does not use nroff.
|
||||||
For complete, current documentation, refer to the Info file
|
For complete, current documentation, refer to the Info file
|
||||||
.B make
|
.B make.info
|
||||||
or the DVI file
|
which is made from the Texinfo source file
|
||||||
.B make.dvi
|
|
||||||
which are made from the Texinfo source file
|
|
||||||
.BR make.texinfo .
|
.BR make.texinfo .
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
.LP
|
.LP
|
||||||
@@ -24,7 +23,7 @@ The purpose of the
|
|||||||
utility is to determine automatically which
|
utility is to determine automatically which
|
||||||
pieces of a large program need to be recompiled, and issue the commands to
|
pieces of a large program need to be recompiled, and issue the commands to
|
||||||
recompile them.
|
recompile them.
|
||||||
This manual describes the GNU implementation of
|
The manual describes the GNU implementation of
|
||||||
.IR make ,
|
.IR make ,
|
||||||
which was written by Richard Stallman and Roland McGrath.
|
which was written by Richard Stallman and Roland McGrath.
|
||||||
Our examples show C programs, since they are most common, but you can use
|
Our examples show C programs, since they are most common, but you can use
|
||||||
@@ -110,7 +109,7 @@ or if the target does not exist.
|
|||||||
.B \-b
|
.B \-b
|
||||||
.TP 0.5i
|
.TP 0.5i
|
||||||
.B \-m
|
.B \-m
|
||||||
These options are ignored for compatibility with other versions of
|
These options are ignored for compatibility with other versions of
|
||||||
.IR make .
|
.IR make .
|
||||||
.TP 0.5i
|
.TP 0.5i
|
||||||
.BI "\-C " dir
|
.BI "\-C " dir
|
||||||
@@ -157,7 +156,7 @@ If several
|
|||||||
.B \-I
|
.B \-I
|
||||||
options are used to specify several directories, the directories are
|
options are used to specify several directories, the directories are
|
||||||
searched in the order specified.
|
searched in the order specified.
|
||||||
Unlike the arguments to other flags of
|
Unlike the arguments to other flags of
|
||||||
.IR make ,
|
.IR make ,
|
||||||
directories given with
|
directories given with
|
||||||
.B \-I
|
.B \-I
|
||||||
@@ -236,11 +235,11 @@ Silent operation; do not print the commands as they are executed.
|
|||||||
Cancel the effect of the
|
Cancel the effect of the
|
||||||
.B \-k
|
.B \-k
|
||||||
option.
|
option.
|
||||||
This is never necessary except in a recursive
|
This is never necessary except in a recursive
|
||||||
.I make
|
.I make
|
||||||
where
|
where
|
||||||
.B \-k
|
.B \-k
|
||||||
might be inherited from the top-level
|
might be inherited from the top-level
|
||||||
.I make
|
.I make
|
||||||
via MAKEFLAGS or if you set
|
via MAKEFLAGS or if you set
|
||||||
.B \-k
|
.B \-k
|
||||||
@@ -254,7 +253,7 @@ future invocations of
|
|||||||
.IR make .
|
.IR make .
|
||||||
.TP 0.5i
|
.TP 0.5i
|
||||||
.B \-v
|
.B \-v
|
||||||
Print the version of the
|
Print the version of the
|
||||||
.I make
|
.I make
|
||||||
program plus a copyright, a list of authors and a notice that there
|
program plus a copyright, a list of authors and a notice that there
|
||||||
is no warranty.
|
is no warranty.
|
||||||
@@ -285,15 +284,10 @@ it is almost the same as running a
|
|||||||
.I touch
|
.I touch
|
||||||
command on the given file before running
|
command on the given file before running
|
||||||
.IR make ,
|
.IR make ,
|
||||||
except that the modification time is changed only in the imagination of
|
except that the modification time is changed only in the imagination of
|
||||||
.IR make .
|
.IR make .
|
||||||
.SH "SEE ALSO"
|
.SH "SEE ALSO"
|
||||||
.PD 0
|
.I "The GNU Make Manual"
|
||||||
.TP 2.0i
|
|
||||||
/usr/local/doc/gnumake.dvi
|
|
||||||
.I
|
|
||||||
The GNU Make Manual
|
|
||||||
.PD
|
|
||||||
.SH BUGS
|
.SH BUGS
|
||||||
See the chapter `Problems and Bugs' in
|
See the chapter `Problems and Bugs' in
|
||||||
.I "The GNU Make Manual" .
|
.I "The GNU Make Manual" .
|
||||||
|
|||||||
70
make.h
70
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,95,96 Free Software Foundation, Inc.
|
Copyright (C) 1988,89,90,91,92,93,94,95,96,97 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
|
||||||
@@ -72,7 +72,7 @@ extern int errno;
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
/* Ultrix's unistd.h always defines _POSIX_VERSION, but you only get
|
/* Ultrix's unistd.h always defines _POSIX_VERSION, but you only get
|
||||||
POSIX.1 behavior with `cc -YPOSIX', which predefines POSIX itself! */
|
POSIX.1 behavior with `cc -YPOSIX', which predefines POSIX itself! */
|
||||||
#if defined (_POSIX_VERSION) && !defined (ultrix)
|
#if defined (_POSIX_VERSION) && !defined (ultrix) && !defined (VMS)
|
||||||
#define POSIX
|
#define POSIX
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
@@ -86,11 +86,11 @@ extern int errno;
|
|||||||
#define POSIX
|
#define POSIX
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_SYS_SIGLIST
|
#if defined (HAVE_SYS_SIGLIST) && !defined (SYS_SIGLIST_DECLARED)
|
||||||
#ifndef SYS_SIGLIST_DECLARED
|
|
||||||
extern char *sys_siglist[];
|
extern char *sys_siglist[];
|
||||||
#endif
|
#endif
|
||||||
#else
|
|
||||||
|
#if !defined (HAVE_SYS_SIGLIST) || !defined (HAVE_STRSIGNAL)
|
||||||
#include "signame.h"
|
#include "signame.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -137,6 +137,19 @@ extern unsigned int get_path_max PARAMS ((void));
|
|||||||
#define PATH_VAR(var) char *var = (char *) alloca (GET_PATH_MAX)
|
#define PATH_VAR(var) char *var = (char *) alloca (GET_PATH_MAX)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef CHAR_BIT
|
||||||
|
#define CHAR_BIT 8
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Nonzero if the integer type T is signed. */
|
||||||
|
#define INTEGER_TYPE_SIGNED(t) ((t) -1 < 0)
|
||||||
|
|
||||||
|
/* The minimum and maximum values for the integer type T.
|
||||||
|
Use ~ (t) 0, not -1, for portability to 1's complement hosts. */
|
||||||
|
#define INTEGER_TYPE_MINIMUM(t) \
|
||||||
|
(! INTEGER_TYPE_SIGNED (t) ? (t) 0 : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))
|
||||||
|
#define INTEGER_TYPE_MAXIMUM(t) (~ (t) 0 - INTEGER_TYPE_MINIMUM (t))
|
||||||
|
|
||||||
#ifdef STAT_MACROS_BROKEN
|
#ifdef STAT_MACROS_BROKEN
|
||||||
#ifdef S_ISREG
|
#ifdef S_ISREG
|
||||||
#undef S_ISREG
|
#undef S_ISREG
|
||||||
@@ -202,8 +215,8 @@ extern void exit PARAMS ((int));
|
|||||||
#ifndef bzero
|
#ifndef bzero
|
||||||
#define bzero(s, n) memset ((s), 0, (n))
|
#define bzero(s, n) memset ((s), 0, (n))
|
||||||
#endif
|
#endif
|
||||||
#ifndef bcopy
|
#if defined(HAVE_MEMMOVE) && !defined(bcopy)
|
||||||
#define bcopy(s, d, n) memcpy ((d), (s), (n))
|
#define bcopy(s, d, n) memmove ((d), (s), (n))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#else /* Not ANSI_STRING. */
|
#else /* Not ANSI_STRING. */
|
||||||
@@ -228,6 +241,11 @@ extern void bcopy ();
|
|||||||
extern char *strerror PARAMS ((int errnum));
|
extern char *strerror PARAMS ((int errnum));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef __attribute__
|
||||||
|
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
|
||||||
|
# define __attribute__(x)
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
#undef alloca
|
#undef alloca
|
||||||
@@ -246,7 +264,7 @@ extern char *alloca ();
|
|||||||
#define streq(a, b) \
|
#define streq(a, b) \
|
||||||
((a) == (b) || \
|
((a) == (b) || \
|
||||||
(*(a) == *(b) && (*(a) == '\0' || !strcmp ((a) + 1, (b) + 1))))
|
(*(a) == *(b) && (*(a) == '\0' || !strcmp ((a) + 1, (b) + 1))))
|
||||||
#ifdef _AMIGA
|
#ifdef HAVE_CASE_INSENSITIVE_FS
|
||||||
#define strieq(a, b) \
|
#define strieq(a, b) \
|
||||||
((a) == (b) || \
|
((a) == (b) || \
|
||||||
(tolower(*(a)) == tolower(*(b)) && (*(a) == '\0' || !strcmpi ((a) + 1, (b) + 1))))
|
(tolower(*(a)) == tolower(*(b)) && (*(a) == '\0' || !strcmpi ((a) + 1, (b) + 1))))
|
||||||
@@ -264,7 +282,7 @@ extern char *alloca ();
|
|||||||
/* Add to VAR the hashing value of C, one character in a name. */
|
/* Add to VAR the hashing value of C, one character in a name. */
|
||||||
#define HASH(var, c) \
|
#define HASH(var, c) \
|
||||||
((var += (c)), (var = ((var) << 7) + ((var) >> 20)))
|
((var += (c)), (var = ((var) << 7) + ((var) >> 20)))
|
||||||
#ifdef _AMIGA /* Fold filenames on #amiga */
|
#ifdef HAVE_CASE_INSENSITIVE_FS /* Fold filenames */
|
||||||
#define HASHI(var, c) \
|
#define HASHI(var, c) \
|
||||||
((var += tolower((c))), (var = ((var) << 7) + ((var) >> 20)))
|
((var += tolower((c))), (var = ((var) << 7) + ((var) >> 20)))
|
||||||
#else
|
#else
|
||||||
@@ -277,13 +295,17 @@ extern char *alloca ();
|
|||||||
#define ENUM_BITFIELD(bits)
|
#define ENUM_BITFIELD(bits)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__MSDOS__) || defined(WIN32)
|
#if defined(__MSDOS__) || defined(WINDOWS32)
|
||||||
#define PATH_SEPARATOR_CHAR ';'
|
#define PATH_SEPARATOR_CHAR ';'
|
||||||
#else
|
#else
|
||||||
|
#if defined(VMS)
|
||||||
|
#define PATH_SEPARATOR_CHAR ','
|
||||||
|
#else
|
||||||
#define PATH_SEPARATOR_CHAR ':'
|
#define PATH_SEPARATOR_CHAR ':'
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#define pipe(p) _pipe(p, 512, O_BINARY)
|
#define pipe(p) _pipe(p, 512, O_BINARY)
|
||||||
@@ -293,16 +315,23 @@ extern void sync_Path_environment(void);
|
|||||||
extern int kill(int pid, int sig);
|
extern int kill(int pid, int sig);
|
||||||
extern int safe_stat(char *file, struct stat *sb);
|
extern int safe_stat(char *file, struct stat *sb);
|
||||||
extern char *end_of_token_w32();
|
extern char *end_of_token_w32();
|
||||||
#endif
|
extern int find_and_set_default_shell(char *token);
|
||||||
|
|
||||||
|
/* indicates whether or not we have Bourne shell */
|
||||||
|
extern int no_default_sh_exe;
|
||||||
|
|
||||||
|
/* is default_shell unixy? */
|
||||||
|
extern int unixy_shell;
|
||||||
|
#endif /* WINDOWS32 */
|
||||||
|
|
||||||
extern void die ();
|
extern void die () __attribute__ ((noreturn));
|
||||||
extern void message ();
|
extern void message ();
|
||||||
extern void fatal ();
|
extern void fatal () __attribute__ ((noreturn));
|
||||||
extern void error ();
|
extern void error ();
|
||||||
extern void log_working_directory ();
|
extern void log_working_directory ();
|
||||||
extern void makefile_error ();
|
extern void makefile_error ();
|
||||||
extern void makefile_fatal ();
|
extern void makefile_fatal () __attribute__ ((noreturn));
|
||||||
extern void pfatal_with_name ();
|
extern void pfatal_with_name () __attribute__ ((noreturn));
|
||||||
extern void perror_with_name ();
|
extern void perror_with_name ();
|
||||||
extern char *savestring ();
|
extern char *savestring ();
|
||||||
extern char *concat ();
|
extern char *concat ();
|
||||||
@@ -346,6 +375,7 @@ extern void create_pattern_rule ();
|
|||||||
extern void build_vpath_lists ();
|
extern void build_vpath_lists ();
|
||||||
extern void construct_vpath_list ();
|
extern void construct_vpath_list ();
|
||||||
extern int vpath_search ();
|
extern int vpath_search ();
|
||||||
|
extern int gpath_search ();
|
||||||
|
|
||||||
extern void construct_include_path ();
|
extern void construct_include_path ();
|
||||||
extern void uniquize_deps ();
|
extern void uniquize_deps ();
|
||||||
@@ -362,9 +392,9 @@ extern void child_access ();
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* We omit these declarations on non-POSIX systems which define _POSIX_VERSION,
|
/* We omit these declarations on non-POSIX systems which define _POSIX_VERSION,
|
||||||
because such systems often declare the in header files anyway. */
|
because such systems often declare them in header files anyway. */
|
||||||
|
|
||||||
#if !defined (__GNU_LIBRARY__) && !defined (POSIX) && !defined (_POSIX_VERSION) && !defined(WIN32)
|
#if !defined (__GNU_LIBRARY__) && !defined (POSIX) && !defined (_POSIX_VERSION) && !defined(WINDOWS32)
|
||||||
|
|
||||||
extern long int atol ();
|
extern long int atol ();
|
||||||
#ifndef VMS
|
#ifndef VMS
|
||||||
@@ -393,6 +423,10 @@ extern int debug_flag, print_data_base_flag, question_flag, touch_flag;
|
|||||||
extern int env_overrides, no_builtin_rules_flag, print_version_flag;
|
extern int env_overrides, no_builtin_rules_flag, print_version_flag;
|
||||||
extern int print_directory_flag, warn_undefined_variables_flag;
|
extern int print_directory_flag, warn_undefined_variables_flag;
|
||||||
extern int posix_pedantic;
|
extern int posix_pedantic;
|
||||||
|
extern int clock_skew_detected;
|
||||||
|
|
||||||
|
/* can we run commands via 'sh -c xxx' or must we use batch files? */
|
||||||
|
extern int batch_mode_shell;
|
||||||
|
|
||||||
extern unsigned int job_slots;
|
extern unsigned int job_slots;
|
||||||
#ifndef NO_FLOAT
|
#ifndef NO_FLOAT
|
||||||
|
|||||||
708
make.texinfo
708
make.texinfo
File diff suppressed because it is too large
Load Diff
48
makefile.com
48
makefile.com
@@ -4,10 +4,37 @@ $!
|
|||||||
$! P1 is non-empty if you want to link with the VAXCRTL library instead
|
$! P1 is non-empty if you want to link with the VAXCRTL library instead
|
||||||
$! of the shareable executable
|
$! of the shareable executable
|
||||||
$!
|
$!
|
||||||
$ def/nolog sys sys$library:
|
$! In case of problems with the install you might contact me at
|
||||||
$ filelist = "alloca commands default dir expand file function implicit job main misc read remake remote-stub rule signame variable version vmsfunctions vmsify vpath [.glob]glob [.glob]fnmatch getopt getopt1"
|
$! zinser@decus.decus.de (preferred) or eurmpz@eur.sas.com
|
||||||
|
$!
|
||||||
|
$! Look for the compiler used
|
||||||
|
$!
|
||||||
|
$ lval = ""
|
||||||
|
$ if f$search("SYS$SYSTEM:DECC$COMPILER.EXE").eqs.""
|
||||||
|
$ then
|
||||||
|
$ if f$trnlnm("SYS").eqs."" then def/nolog sys sys$library:
|
||||||
|
$ ccopt = ""
|
||||||
|
$ else
|
||||||
|
$ ccopt = "/decc/prefix=all"
|
||||||
|
$ if f$trnlnm("SYS").eqs.""
|
||||||
|
$ then
|
||||||
|
$ if f$trnlnm("DECC$LIBRARY_INCLUDE").nes.""
|
||||||
|
$ then
|
||||||
|
$ define sys decc$library_include:
|
||||||
|
$ else
|
||||||
|
$ if f$search("SYS$COMMON:[DECC$LIB.REFERENCE]DECC$RTLDEF.DIR").nes."" -
|
||||||
|
then lval = "SYS$COMMON:[DECC$LIB.REFERENCE.DECC$RTLDEF],"
|
||||||
|
$ if f$search("SYS$COMMON:[DECC$LIB.REFERENCE]SYS$STARLET_C.DIR").nes."" -
|
||||||
|
then lval = lval+"SYS$COMMON:[DECC$LIB.REFERENCE.SYS$STARLET_C],"
|
||||||
|
$ lval=lval+"SYS$LIBRARY:"
|
||||||
|
$ define sys 'lval
|
||||||
|
$ endif
|
||||||
|
$ endif
|
||||||
|
$ endif
|
||||||
|
$ filelist = "alloca ar arscan commands default dir expand file function implicit job main misc read remake remote-stub rule signame variable version vmsfunctions vmsify vpath [.glob]glob [.glob]fnmatch getopt1 getopt"
|
||||||
$ copy config.h-vms config.h
|
$ copy config.h-vms config.h
|
||||||
$ n=0
|
$ n=0
|
||||||
|
$ open/write optf make.opt
|
||||||
$ loop:
|
$ loop:
|
||||||
$ cfile = f$elem(n," ",filelist)
|
$ cfile = f$elem(n," ",filelist)
|
||||||
$ if cfile .eqs. " " then goto linkit
|
$ if cfile .eqs. " " then goto linkit
|
||||||
@@ -16,19 +43,18 @@ $ call compileit 'cfile' 'p1'
|
|||||||
$ n = n + 1
|
$ n = n + 1
|
||||||
$ goto loop
|
$ goto loop
|
||||||
$ linkit:
|
$ linkit:
|
||||||
|
$ close optf
|
||||||
$ if p1 .nes. "" then goto link_using_library
|
$ if p1 .nes. "" then goto link_using_library
|
||||||
$ link/exe=make alloca,commands,default,dir,expand,file,function,-
|
$ link/exe=make make.opt/opt
|
||||||
implicit,job,main,misc,read,remake,remote-stub,rule,-
|
|
||||||
signame,variable,version,vmsfunctions,vmsify,vpath,-
|
|
||||||
glob,fnmatch,getopt,getopt1
|
|
||||||
$ exit
|
$ exit
|
||||||
$ link_using_library:
|
$ link_using_library:
|
||||||
$ link/exe=make alloca,commands,default,dir,expand,file,function,-
|
$ link/exe=make make.opt/opt,sys$library:vaxcrtl/lib
|
||||||
implicit,job,main,misc,read,remake,remote-stub,rule,-
|
|
||||||
signame,variable,version,vmsfunctions,vmsify,vpath,-
|
|
||||||
glob,fnmatch,getopt,getopt1,sys$library:vaxcrtl/lib
|
|
||||||
$!
|
$!
|
||||||
$ compileit : subroutine
|
$ compileit : subroutine
|
||||||
$ cc/include=([],[.glob])/define=("allocated_variable_expand_for_file=alloc_var_expand_for_file","unlink=remove","HAVE_CONFIG_H","VMS","NO_ARCHIVES") 'p1'
|
$ ploc = f$locate("]",p1)
|
||||||
|
$ filnam = p1
|
||||||
|
$ if ploc .lt. f$length(p1) then filnam=f$extract(ploc+1,100,p1)
|
||||||
|
$ write optf "''filnam'"
|
||||||
|
$ cc'ccopt'/include=([],[.glob])/define=("allocated_variable_expand_for_file=alloc_var_expand_for_file","unlink=remove","HAVE_CONFIG_H","VMS") 'p1'
|
||||||
$ exit
|
$ exit
|
||||||
$ endsubroutine : compileit
|
$ endsubroutine : compileit
|
||||||
|
|||||||
56
makefile.vms
56
makefile.vms
@@ -1,19 +1,19 @@
|
|||||||
# Copyright (C) 1988, 1989 Free Software Foundation, Inc.
|
# Copyright (C) 1988, 1989, 1996, 1997 Free Software Foundation, Inc.
|
||||||
# This file is part of GNU Make.
|
# This file is part of GNU Make.
|
||||||
#
|
#
|
||||||
# VMS extensions from GNU Make 3.60 imported by
|
# VMS extensions from GNU Make 3.60 imported by
|
||||||
# Klaus Kämpf (kkaempf@didymus.rmi.de)
|
# Klaus Kämpf (kkaempf@progis.de) of proGIS Software, Aachen, Germany
|
||||||
#
|
#
|
||||||
# GNU Make is free software; you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation; either version 1, or (at your option)
|
# the Free Software Foundation; either version 2, or (at your option)
|
||||||
# any later version.
|
# any later version.
|
||||||
#
|
#
|
||||||
# GNU Make is distributed in the hope that it will be useful,
|
# GNU Make is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with GNU Make; see the file COPYING. If not, write to
|
# along with GNU Make; see the file COPYING. If not, write to
|
||||||
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
@@ -29,21 +29,21 @@ CP = copy
|
|||||||
|
|
||||||
CFLAGS = $(defines) /debug/noopt/include=([],[.glob])
|
CFLAGS = $(defines) /debug/noopt/include=([],[.glob])
|
||||||
#LDFLAGS = /deb
|
#LDFLAGS = /deb
|
||||||
LDFLAGS =
|
LDFLAGS =
|
||||||
|
|
||||||
defines = /define=("unlink=remove","HAVE_CONFIG_H","VMS","NO_ARCHIVES","allocated_variable_expand_for_file=alloc_var_expand_for_file")
|
defines = /define=("unlink=remove","HAVE_CONFIG_H","VMS","allocated_variable_expand_for_file=alloc_var_expand_for_file")
|
||||||
|
|
||||||
LOAD_AVG = /define="NO_LDAV"
|
LOAD_AVG = /define="NO_LDAV"
|
||||||
|
|
||||||
# If you don't want archive support, comment these out.
|
# If you don't want archive support, comment these out.
|
||||||
#ARCHIVES = ,ar.obj,arscan.obj
|
ARCHIVES = ,ar.obj,arscan.obj
|
||||||
#ARCHIVES_SRC = ar.c arscan.c
|
ARCHIVES_SRC = ar.c arscan.c
|
||||||
|
|
||||||
# If your system needs extra libraries loaded in, define them here.
|
# If your system needs extra libraries loaded in, define them here.
|
||||||
# System V probably need -lPW for alloca.
|
# System V probably need -lPW for alloca.
|
||||||
# if on vax, uncomment the following line
|
# if on vax, uncomment the following line
|
||||||
#LOADLIBES = ,c.opt/opt
|
#LOADLIBES = ,c.opt/opt
|
||||||
LOADLIBES =,sys$$library:vaxcrtl.obl/lib
|
LOADLIBES =,sys$$library:vaxcrtl.olb/lib
|
||||||
|
|
||||||
# If your system doesn't have alloca, or the one provided is bad,
|
# If your system doesn't have alloca, or the one provided is bad,
|
||||||
# get it from the Emacs distribution and define these.
|
# get it from the Emacs distribution and define these.
|
||||||
@@ -57,7 +57,7 @@ REMOTE =
|
|||||||
# Any extra object files your system needs.
|
# Any extra object files your system needs.
|
||||||
extras = ,signame.obj,remote-stub.obj,vmsfunctions.obj,vmsify.obj
|
extras = ,signame.obj,remote-stub.obj,vmsfunctions.obj,vmsify.obj
|
||||||
#,directory.obj
|
#,directory.obj
|
||||||
# as an alternative:
|
# as an alternative:
|
||||||
glob = ,[.glob]glob.obj,[.glob]fnmatch.obj
|
glob = ,[.glob]glob.obj,[.glob]fnmatch.obj
|
||||||
getopt = ,getopt.obj,getopt1.obj
|
getopt = ,getopt.obj,getopt1.obj
|
||||||
# Directory to install `make' in.
|
# Directory to install `make' in.
|
||||||
@@ -92,24 +92,24 @@ clean:
|
|||||||
-$(RM) make.exe;,*.obj;*
|
-$(RM) make.exe;,*.obj;*
|
||||||
|
|
||||||
# Automatically generated dependencies.
|
# Automatically generated dependencies.
|
||||||
commands.obj: commands.c make.h dep.h commands.h filedef.h variable.h job.h
|
commands.obj: commands.c make.h dep.h commands.h filedef.h variable.h job.h
|
||||||
job.obj: job.c make.h commands.h job.h filedef.h variable.h
|
job.obj: job.c make.h commands.h job.h filedef.h variable.h
|
||||||
dir.obj: dir.c make.h
|
dir.obj: dir.c make.h
|
||||||
file.obj: file.c make.h commands.h dep.h filedef.h variable.h
|
file.obj: file.c make.h commands.h dep.h filedef.h variable.h
|
||||||
misc.obj: misc.c make.h dep.h
|
misc.obj: misc.c make.h dep.h
|
||||||
main.obj: main.c make.h commands.h dep.h filedef.h variable.h job.h
|
main.obj: main.c make.h commands.h dep.h filedef.h variable.h job.h
|
||||||
read.obj: read.c make.h commands.h dep.h filedef.h variable.h
|
read.obj: read.c make.h commands.h dep.h filedef.h variable.h
|
||||||
remake.obj: remake.c make.h commands.h job.h dep.h filedef.h
|
remake.obj: remake.c make.h commands.h job.h dep.h filedef.h
|
||||||
rule.obj: rule.c make.h commands.h dep.h filedef.h variable.h rule.h
|
rule.obj: rule.c make.h commands.h dep.h filedef.h variable.h rule.h
|
||||||
implicit.obj: implicit.c make.h rule.h dep.h filedef.h
|
implicit.obj: implicit.c make.h rule.h dep.h filedef.h
|
||||||
default.obj: default.c make.h rule.h dep.h filedef.h commands.h variable.h
|
default.obj: default.c make.h rule.h dep.h filedef.h commands.h variable.h
|
||||||
variable.obj: variable.c make.h commands.h variable.h dep.h filedef.h
|
variable.obj: variable.c make.h commands.h variable.h dep.h filedef.h
|
||||||
expand.obj: expand.c make.h commands.h filedef.h variable.h
|
expand.obj: expand.c make.h commands.h filedef.h variable.h
|
||||||
function.obj: function.c make.h variable.h dep.h commands.h job.h
|
function.obj: function.c make.h variable.h dep.h commands.h job.h
|
||||||
vpath.obj: vpath.c make.h filedef.h variable.h
|
vpath.obj: vpath.c make.h filedef.h variable.h
|
||||||
version.obj: version.c
|
version.obj: version.c
|
||||||
arscan.obj: arscan.c
|
arscan.obj: arscan.c
|
||||||
ar.obj: ar.c make.h filedef.h
|
ar.obj: ar.c make.h filedef.h
|
||||||
signame.obj: signame.c
|
signame.obj: signame.c
|
||||||
remote-stub.obj: remote-stub.c
|
remote-stub.obj: remote-stub.c
|
||||||
[.glob]glob.obj: [.glob]glob.c
|
[.glob]glob.obj: [.glob]glob.c
|
||||||
|
|||||||
14
misc.c
14
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, 1995 Free Software Foundation, Inc.
|
Copyright (C) 1988,89,90,91,92,93,94,95,97 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
|
||||||
@@ -253,6 +253,9 @@ makefile_fatal (file, lineno, s1, s2, s3, s4, s5, s6)
|
|||||||
unsigned int lineno;
|
unsigned int lineno;
|
||||||
char *s1, *s2, *s3, *s4, *s5, *s6;
|
char *s1, *s2, *s3, *s4, *s5, *s6;
|
||||||
{
|
{
|
||||||
|
if (!file)
|
||||||
|
fatal(s1, s2, s3, s4, s5, s6);
|
||||||
|
|
||||||
log_working_directory (1);
|
log_working_directory (1);
|
||||||
|
|
||||||
fprintf (stderr, "%s:%u: *** ", file, lineno);
|
fprintf (stderr, "%s:%u: *** ", file, lineno);
|
||||||
@@ -397,7 +400,7 @@ end_of_token (s)
|
|||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
/*
|
/*
|
||||||
* Same as end_of_token, but take into account a stop character
|
* Same as end_of_token, but take into account a stop character
|
||||||
*/
|
*/
|
||||||
@@ -470,7 +473,7 @@ copy_dep_chain (d)
|
|||||||
{
|
{
|
||||||
register struct dep *c;
|
register struct dep *c;
|
||||||
struct dep *firstnew = 0;
|
struct dep *firstnew = 0;
|
||||||
struct dep *lastnew;
|
struct dep *lastnew = 0;
|
||||||
|
|
||||||
while (d != 0)
|
while (d != 0)
|
||||||
{
|
{
|
||||||
@@ -564,8 +567,9 @@ log_access (flavor)
|
|||||||
but we write this one to stderr because it might be
|
but we write this one to stderr because it might be
|
||||||
run in a child fork whose stdout is piped. */
|
run in a child fork whose stdout is piped. */
|
||||||
|
|
||||||
fprintf (stderr, "%s access: user %d (real %d), group %d (real %d)\n",
|
fprintf (stderr, "%s access: user %lu (real %lu), group %lu (real %lu)\n",
|
||||||
flavor, geteuid (), getuid (), getegid (), getgid ());
|
flavor, (unsigned long) geteuid (), (unsigned long) getuid (),
|
||||||
|
(unsigned long) getegid (), (unsigned long) getgid ());
|
||||||
fflush (stderr);
|
fflush (stderr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
26
readme.vms
26
readme.vms
@@ -1,20 +1,17 @@
|
|||||||
This is the VMS port of GNU Make version 3.74.
|
This is the VMS port of GNU Make.
|
||||||
|
|
||||||
It is based on the VMS port of GNU Make 3.60 by Mike Moretti.
|
It is based on the VMS port of GNU Make 3.60 by Mike Moretti.
|
||||||
|
|
||||||
This port was done by Klaus Kämpf (kkaempf@didymus.rmi.de)
|
This port was done by Klaus Kämpf <kkaempf@progis.de> of
|
||||||
|
proGIS Software, Aachen, Germany.
|
||||||
|
|
||||||
To build Make, simply type @makefile. This should compile all the
|
To build Make, simply type @makefile. This should compile all the
|
||||||
necessary files and link Make.
|
necessary files and link Make. There is also a file called
|
||||||
There is also a file called makefile.vms. If you already have GNU
|
makefile.vms. If you already have GNU Make built you can just use
|
||||||
Make 3.74 built you can just use Make with this makefile to rebuild.
|
Make with this makefile to rebuild.
|
||||||
|
|
||||||
Here are some notes about GNU Make for VMS:
|
Here are some notes about GNU Make for VMS:
|
||||||
|
|
||||||
Libraries are not supported. They were in GNU Make 3.60 but somehow I didn't
|
|
||||||
care porting the code. If there is enough interest, I'll do it at some
|
|
||||||
later time.
|
|
||||||
|
|
||||||
The variable $^ separates files with commas instead of spaces (It's the
|
The variable $^ separates files with commas instead of spaces (It's the
|
||||||
natural thing to do for VMS).
|
natural thing to do for VMS).
|
||||||
|
|
||||||
@@ -40,8 +37,6 @@ less than what vms provides. This might be a problem on the faster Alphas.
|
|||||||
You can use a : in a filename only if you preceed it with a backslash ('\').
|
You can use a : in a filename only if you preceed it with a backslash ('\').
|
||||||
E.g.- hobbes\:[bogas.files]
|
E.g.- hobbes\:[bogas.files]
|
||||||
|
|
||||||
None of the stuff in vpath.c has been implemented yet.
|
|
||||||
|
|
||||||
Make ignores success, informational, or warning errors (-S-, -I-, or -W-).
|
Make ignores success, informational, or warning errors (-S-, -I-, or -W-).
|
||||||
But it will stop on -E- and -F- errors. (unless you do something to override
|
But it will stop on -E- and -F- errors. (unless you do something to override
|
||||||
this in your makefile, or whatever).
|
this in your makefile, or whatever).
|
||||||
@@ -52,8 +47,15 @@ Multiple line DCL commands, such as "if" statements, must be put inside
|
|||||||
command files. You can run a command file by using \@.
|
command files. You can run a command file by using \@.
|
||||||
|
|
||||||
|
|
||||||
VMS changes made for 3.74.3
|
Change history:
|
||||||
|
|
||||||
|
3.76.x
|
||||||
|
======
|
||||||
|
Added VMS help version (make.hlp) of the Unix man page. To integrate
|
||||||
|
that with an existing Help library use a command like the following
|
||||||
|
$lib/ins/help sys$help:helplib.hlb make.hlp
|
||||||
|
3.74.3
|
||||||
|
======
|
||||||
Lots of default settings are adapted for VMS. See default.c.
|
Lots of default settings are adapted for VMS. See default.c.
|
||||||
|
|
||||||
Long command lines are now converted to command files.
|
Long command lines are now converted to command files.
|
||||||
|
|||||||
267
remake.c
267
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,95,96 Free Software Foundation, Inc.
|
Copyright (C) 1988,89,90,91,92,93,94,95,96,97 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
|
||||||
@@ -29,10 +29,14 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||||||
#include <sys/file.h>
|
#include <sys/file.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __MSDOS__
|
||||||
|
#include "variable.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
#include <starlet.h>
|
#include <starlet.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -52,10 +56,6 @@ static int library_search PARAMS ((char **lib, time_t *mtime_ptr));
|
|||||||
|
|
||||||
extern time_t f_mtime PARAMS ((struct file *file, int search));
|
extern time_t f_mtime PARAMS ((struct file *file, int search));
|
||||||
|
|
||||||
#ifdef VMS
|
|
||||||
extern int vms_stat PARAMS ((char *name, struct stat *buf));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* Remake all the goals in the `struct dep' chain GOALS. Return -1 if nothing
|
/* Remake all the goals in the `struct dep' chain GOALS. Return -1 if nothing
|
||||||
was done, 0 if all goals were updated successfully, or 1 if a goal failed.
|
was done, 0 if all goals were updated successfully, or 1 if a goal failed.
|
||||||
@@ -91,9 +91,14 @@ update_goal_chain (goals, makefiles)
|
|||||||
g->changed = 0;
|
g->changed = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
/* Only run one job at a time when building makefiles.
|
||||||
|
No one seems to know why this was done, and no one can think of a good
|
||||||
|
reason to do it. Hopefully an obvious one won't appear as soon as we
|
||||||
|
release the next version :-/. */
|
||||||
if (makefiles)
|
if (makefiles)
|
||||||
/* Only run one job at a time. */
|
|
||||||
job_slots = 1;
|
job_slots = 1;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Update all the goals until they are all finished. */
|
/* Update all the goals until they are all finished. */
|
||||||
|
|
||||||
@@ -115,7 +120,7 @@ update_goal_chain (goals, makefiles)
|
|||||||
{
|
{
|
||||||
/* Iterate over all double-colon entries for this file. */
|
/* Iterate over all double-colon entries for this file. */
|
||||||
struct file *file = g->file;
|
struct file *file = g->file;
|
||||||
int stop, any_not_updated = 0;
|
int stop = 0, any_not_updated = 0;
|
||||||
|
|
||||||
for (file = g->file->double_colon ? g->file->double_colon : g->file;
|
for (file = g->file->double_colon ? g->file->double_colon : g->file;
|
||||||
file != NULL;
|
file != NULL;
|
||||||
@@ -248,6 +253,38 @@ update_goal_chain (goals, makefiles)
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Generate an error/fatal message if no rules are available for the target.
|
||||||
|
*/
|
||||||
|
static void
|
||||||
|
no_rule_error(file)
|
||||||
|
struct file *file;
|
||||||
|
{
|
||||||
|
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 (!file->dontcare)
|
||||||
|
{
|
||||||
|
if (file->parent == 0)
|
||||||
|
error (msg_noparent, "*** ", file->name, ".");
|
||||||
|
else
|
||||||
|
error (msg_parent, "*** ",
|
||||||
|
file->name, file->parent->name, ".");
|
||||||
|
file->shownerror = 1;
|
||||||
|
}
|
||||||
|
file->update_status = 2;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (file->parent == 0)
|
||||||
|
fatal (msg_noparent, "", file->name, "");
|
||||||
|
else
|
||||||
|
fatal (msg_parent, "", file->name, file->parent->name, "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* If FILE is not up to date, execute the commands for it.
|
/* If FILE is not up to date, execute the commands for it.
|
||||||
Return 0 if successful, 1 if unsuccessful;
|
Return 0 if successful, 1 if unsuccessful;
|
||||||
but with some flag settings, just call `exit' if unsuccessful.
|
but with some flag settings, just call `exit' if unsuccessful.
|
||||||
@@ -317,6 +354,13 @@ update_file_1 (file, depth)
|
|||||||
if (file->update_status > 0)
|
if (file->update_status > 0)
|
||||||
{
|
{
|
||||||
DEBUGPR ("Recently tried and failed to update file `%s'.\n");
|
DEBUGPR ("Recently tried and failed to update file `%s'.\n");
|
||||||
|
if (!file->shownerror)
|
||||||
|
{
|
||||||
|
int dontcare = file->dontcare;
|
||||||
|
file->dontcare = 0;
|
||||||
|
no_rule_error(file);
|
||||||
|
file->dontcare = dontcare;
|
||||||
|
}
|
||||||
return file->update_status;
|
return file->update_status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -394,18 +438,14 @@ update_file_1 (file, depth)
|
|||||||
{
|
{
|
||||||
error ("Circular %s <- %s dependency dropped.",
|
error ("Circular %s <- %s dependency dropped.",
|
||||||
file->name, d->file->name);
|
file->name, d->file->name);
|
||||||
|
/* We cannot free D here because our the caller will still have
|
||||||
|
a reference to it when we were called recursively via
|
||||||
|
check_dep below. */
|
||||||
if (lastd == 0)
|
if (lastd == 0)
|
||||||
{
|
file->deps = d->next;
|
||||||
file->deps = d->next;
|
|
||||||
free ((char *) d);
|
|
||||||
d = file->deps;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
lastd->next = d->next;
|
||||||
lastd->next = d->next;
|
d = d->next;
|
||||||
free ((char *) d);
|
|
||||||
d = lastd->next;
|
|
||||||
}
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -566,13 +606,46 @@ update_file_1 (file, depth)
|
|||||||
|
|
||||||
if (!must_make)
|
if (!must_make)
|
||||||
{
|
{
|
||||||
DEBUGPR ("No need to remake target `%s'.\n");
|
if (debug_flag)
|
||||||
|
{
|
||||||
|
print_spaces(depth);
|
||||||
|
printf("No need to remake target `%s'", file->name);
|
||||||
|
if (!streq(file->name, file->hname))
|
||||||
|
printf("; using VPATH name `%s'", file->hname);
|
||||||
|
printf(".\n");
|
||||||
|
fflush(stdout);
|
||||||
|
}
|
||||||
|
|
||||||
notice_finished_file (file);
|
notice_finished_file (file);
|
||||||
|
|
||||||
|
/* Since we don't need to remake the file, convert it to use the
|
||||||
|
VPATH filename if we found one. hfile will be either the
|
||||||
|
local name if no VPATH or the VPATH name if one was found. */
|
||||||
|
|
||||||
|
while (file)
|
||||||
|
{
|
||||||
|
file->name = file->hname;
|
||||||
|
file = file->prev;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEBUGPR ("Must remake target `%s'.\n");
|
DEBUGPR ("Must remake target `%s'.\n");
|
||||||
|
|
||||||
|
/* It needs to be remade. If it's VPATH and not reset via GPATH, toss the
|
||||||
|
VPATH. */
|
||||||
|
if (!streq(file->name, file->hname))
|
||||||
|
{
|
||||||
|
if (debug_flag)
|
||||||
|
{
|
||||||
|
print_spaces (depth);
|
||||||
|
printf(" Ignoring VPATH name `%s'.\n", file->hname);
|
||||||
|
fflush(stdout);
|
||||||
|
}
|
||||||
|
file->ignore_vpath = 1;
|
||||||
|
}
|
||||||
|
|
||||||
/* Now, take appropriate actions to remake the file. */
|
/* Now, take appropriate actions to remake the file. */
|
||||||
remake_file (file);
|
remake_file (file);
|
||||||
|
|
||||||
@@ -745,7 +818,7 @@ check_dep (file, depth, this_mtime, must_make_ptr)
|
|||||||
check_renamed (file);
|
check_renamed (file);
|
||||||
mtime = file_mtime (file);
|
mtime = file_mtime (file);
|
||||||
check_renamed (file);
|
check_renamed (file);
|
||||||
if (mtime > this_mtime)
|
if (mtime != (time_t) -1 && mtime > this_mtime)
|
||||||
*must_make_ptr = 1;
|
*must_make_ptr = 1;
|
||||||
/* Otherwise, update all non-intermediate files we depend on,
|
/* Otherwise, update all non-intermediate files we depend on,
|
||||||
if necessary, and see whether any of them is more
|
if necessary, and see whether any of them is more
|
||||||
@@ -877,32 +950,7 @@ remake_file (file)
|
|||||||
Pretend it was successfully remade. */
|
Pretend it was successfully remade. */
|
||||||
file->update_status = 0;
|
file->update_status = 0;
|
||||||
else
|
else
|
||||||
{
|
no_rule_error(file);
|
||||||
/* This is a dependency file we cannot remake. Fail. */
|
|
||||||
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 (!file->dontcare)
|
|
||||||
{
|
|
||||||
if (file->parent == 0)
|
|
||||||
error (msg_noparent, "*** ", file->name, ".");
|
|
||||||
else
|
|
||||||
error (msg_parent, "*** ",
|
|
||||||
file->name, file->parent->name, ".");
|
|
||||||
}
|
|
||||||
file->update_status = 2;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (file->parent == 0)
|
|
||||||
fatal (msg_noparent, "", file->name, "");
|
|
||||||
else
|
|
||||||
fatal (msg_parent, "", file->name, file->parent->name, "");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -961,11 +1009,12 @@ f_mtime (file, search)
|
|||||||
}
|
}
|
||||||
mtime = f_mtime (arfile, search);
|
mtime = f_mtime (arfile, search);
|
||||||
check_renamed (arfile);
|
check_renamed (arfile);
|
||||||
if (search && strcmp (arfile->name, arname))
|
if (search && strcmp (arfile->hname, arname))
|
||||||
{
|
{
|
||||||
/* The archive's name has changed.
|
/* The archive's name has changed.
|
||||||
Change the archive-member reference accordingly. */
|
Change the archive-member reference accordingly. */
|
||||||
|
|
||||||
|
char *name;
|
||||||
unsigned int arlen, memlen;
|
unsigned int arlen, memlen;
|
||||||
|
|
||||||
if (!arname_used)
|
if (!arname_used)
|
||||||
@@ -974,18 +1023,26 @@ f_mtime (file, search)
|
|||||||
arname_used = 1;
|
arname_used = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
arname = arfile->name;
|
arname = arfile->hname;
|
||||||
arlen = strlen (arname);
|
arlen = strlen (arname);
|
||||||
memlen = strlen (memname);
|
memlen = strlen (memname);
|
||||||
|
|
||||||
free (file->name);
|
/* free (file->name); */
|
||||||
|
|
||||||
file->name = (char *) xmalloc (arlen + 1 + memlen + 2);
|
name = (char *) xmalloc (arlen + 1 + memlen + 2);
|
||||||
bcopy (arname, file->name, arlen);
|
bcopy (arname, name, arlen);
|
||||||
file->name[arlen] = '(';
|
name[arlen] = '(';
|
||||||
bcopy (memname, file->name + arlen + 1, memlen);
|
bcopy (memname, name + arlen + 1, memlen);
|
||||||
file->name[arlen + 1 + memlen] = ')';
|
name[arlen + 1 + memlen] = ')';
|
||||||
file->name[arlen + 1 + memlen + 1] = '\0';
|
name[arlen + 1 + memlen + 1] = '\0';
|
||||||
|
|
||||||
|
/* If the archive was found with GPATH, make the change permanent;
|
||||||
|
otherwise defer it until later. */
|
||||||
|
if (arfile->name == arfile->hname)
|
||||||
|
rename_file (file, name);
|
||||||
|
else
|
||||||
|
rehash_file (file, name);
|
||||||
|
check_renamed (file);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!arname_used)
|
if (!arname_used)
|
||||||
@@ -996,14 +1053,14 @@ f_mtime (file, search)
|
|||||||
/* The archive doesn't exist, so it's members don't exist either. */
|
/* The archive doesn't exist, so it's members don't exist either. */
|
||||||
return (time_t) -1;
|
return (time_t) -1;
|
||||||
|
|
||||||
mtime = ar_member_date (file->name);
|
mtime = ar_member_date (file->hname);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
mtime = name_mtime (file->name);
|
mtime = name_mtime (file->name);
|
||||||
|
|
||||||
if (mtime == (time_t) -1 && search)
|
if (mtime == (time_t) -1 && search && !file->ignore_vpath)
|
||||||
{
|
{
|
||||||
/* If name_mtime failed, search VPATH. */
|
/* If name_mtime failed, search VPATH. */
|
||||||
char *name = file->name;
|
char *name = file->name;
|
||||||
@@ -1016,9 +1073,20 @@ f_mtime (file, search)
|
|||||||
/* vpath_search and library_search store zero in MTIME
|
/* vpath_search and library_search store zero in MTIME
|
||||||
if they didn't need to do a stat call for their work. */
|
if they didn't need to do a stat call for their work. */
|
||||||
file->last_mtime = mtime;
|
file->last_mtime = mtime;
|
||||||
rename_file (file, name);
|
|
||||||
|
/* If we found it in VPATH, see if it's in GPATH too; if so,
|
||||||
|
change the name right now; if not, defer until after the
|
||||||
|
dependencies are updated. */
|
||||||
|
if (gpath_search (name, strlen(name) - strlen(file->name) - 1))
|
||||||
|
{
|
||||||
|
rename_file (file, name);
|
||||||
|
check_renamed (file);
|
||||||
|
return file_mtime (file);
|
||||||
|
}
|
||||||
|
|
||||||
|
rehash_file (file, name);
|
||||||
check_renamed (file);
|
check_renamed (file);
|
||||||
return file_mtime (file);
|
mtime = name_mtime (name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1026,37 +1094,42 @@ f_mtime (file, search)
|
|||||||
{
|
{
|
||||||
/* Files can have bogus timestamps that nothing newly made will be
|
/* Files can have bogus timestamps that nothing newly made will be
|
||||||
"newer" than. Updating their dependents could just result in loops.
|
"newer" than. Updating their dependents could just result in loops.
|
||||||
So notify the user of the anomaly by treating future files as
|
So notify the user of the anomaly with a warning.
|
||||||
unrecoverably absent. */
|
|
||||||
|
|
||||||
static time_t now;
|
We only need to do this once, for now. */
|
||||||
#ifdef VMS
|
|
||||||
/* Handle vms 64bit to 32bit time hack introduced in vms_stat() ... */
|
|
||||||
static unsigned long vms_now[2]; /* assumes 32 bit long ! */
|
|
||||||
static int vms_now_set = 0;
|
|
||||||
|
|
||||||
if (!vms_now_set)
|
static time_t now = 0;
|
||||||
{
|
if (!clock_skew_detected
|
||||||
sys$gettim(vms_now);
|
&& mtime != (time_t)-1 && mtime > now
|
||||||
now = ((vms_now[0]>>24) & 0xff) + ((vms_now[1]<<8) & 0xffffff00);
|
&& !file->updated)
|
||||||
vms_now_set = 1;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
if (mtime > now && ! file->updated)
|
|
||||||
{
|
{
|
||||||
/* This file's time appears to be in the future.
|
/* This file's time appears to be in the future.
|
||||||
Update our concept of the present, and compare again. */
|
Update our concept of the present, and compare again. */
|
||||||
#ifndef VMS
|
|
||||||
extern time_t time ();
|
extern time_t time ();
|
||||||
if (mtime > time (&now))
|
time (&now);
|
||||||
|
|
||||||
|
#ifdef WINDOWS32
|
||||||
|
/*
|
||||||
|
* FAT filesystems round time to nearest even second(!). Just
|
||||||
|
* allow for any file (NTFS or FAT) to perhaps suffer from this
|
||||||
|
* braindamage.
|
||||||
|
*/
|
||||||
|
if (mtime > now && (((mtime % 2) == 0) && ((mtime-1) > now)))
|
||||||
#else
|
#else
|
||||||
if ((mtime != -1) && (mtime > now))
|
#ifdef __MSDOS__
|
||||||
|
/* Scrupulous testing indicates that some Windows
|
||||||
|
filesystems can set file times up to 3 sec into the future! */
|
||||||
|
if (mtime > now + 3)
|
||||||
|
#else
|
||||||
|
if (mtime > now)
|
||||||
#endif
|
#endif
|
||||||
{
|
#endif
|
||||||
error ("*** File `%s' has modification time in the future",
|
{
|
||||||
file->name);
|
error("*** Warning: File `%s' has modification time in the future (%ld > %ld)",
|
||||||
file->update_status = 2;
|
file->name, mtime, now);
|
||||||
}
|
clock_skew_detected = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1081,11 +1154,7 @@ name_mtime (name)
|
|||||||
{
|
{
|
||||||
struct stat st;
|
struct stat st;
|
||||||
|
|
||||||
#ifdef VMS
|
|
||||||
if (vms_stat (name, &st) < 0)
|
|
||||||
#else
|
|
||||||
if (stat (name, &st) < 0)
|
if (stat (name, &st) < 0)
|
||||||
#endif
|
|
||||||
return (time_t) -1;
|
return (time_t) -1;
|
||||||
|
|
||||||
return (time_t) st.st_mtime;
|
return (time_t) st.st_mtime;
|
||||||
@@ -1107,7 +1176,7 @@ library_search (lib, mtime_ptr)
|
|||||||
"/lib",
|
"/lib",
|
||||||
"/usr/lib",
|
"/usr/lib",
|
||||||
#endif
|
#endif
|
||||||
#if defined(WIN32) && !defined(LIBDIR)
|
#if defined(WINDOWS32) && !defined(LIBDIR)
|
||||||
/*
|
/*
|
||||||
* This is completely up to the user at product install time. Just define
|
* This is completely up to the user at product install time. Just define
|
||||||
* a placeholder.
|
* a placeholder.
|
||||||
@@ -1153,6 +1222,30 @@ library_search (lib, mtime_ptr)
|
|||||||
|
|
||||||
/* Now try the standard set of directories. */
|
/* Now try the standard set of directories. */
|
||||||
|
|
||||||
|
#ifdef __MSDOS__
|
||||||
|
{
|
||||||
|
/* The default library directory is at ${DJDIR}/lib. */
|
||||||
|
struct variable *djdir = lookup_variable ("DJDIR", 5);
|
||||||
|
|
||||||
|
if (djdir)
|
||||||
|
{
|
||||||
|
size_t djdir_len = strlen (djdir->value);
|
||||||
|
|
||||||
|
if (djdir_len > sizeof(LIBDIR) + 8 + strlen(libname) + 4 + 2)
|
||||||
|
buf = (char *) xrealloc (djdir_len + 1);
|
||||||
|
sprintf (buf, "%s/lib/lib%s.a", djdir->value, libname);
|
||||||
|
mtime = name_mtime (buf);
|
||||||
|
if (mtime != (time_t) -1)
|
||||||
|
{
|
||||||
|
*lib = buf;
|
||||||
|
if (mtime_ptr != 0)
|
||||||
|
*mtime_ptr = mtime;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
for (dp = dirs; *dp != 0; ++dp)
|
for (dp = dirs; *dp != 0; ++dp)
|
||||||
{
|
{
|
||||||
#ifndef _AMIGA
|
#ifndef _AMIGA
|
||||||
|
|||||||
@@ -21,15 +21,15 @@ along with GNU Make; see the file COPYING. If not, write to
|
|||||||
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||||
|
|
||||||
#include "make.h"
|
#include "make.h"
|
||||||
|
#include "job.h"
|
||||||
|
#include "filedef.h"
|
||||||
#include "commands.h"
|
#include "commands.h"
|
||||||
#include "job.h"
|
#include "job.h"
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
|
|
||||||
#define __STRICT_BSD__ /* Don't make conflicting declarations. */
|
|
||||||
#include "customs.h"
|
#include "customs.h"
|
||||||
|
|
||||||
|
|
||||||
char *remote_description = "Customs";
|
char *remote_description = "Customs";
|
||||||
|
|
||||||
/* File name of the Customs `export' client command.
|
/* File name of the Customs `export' client command.
|
||||||
@@ -42,25 +42,47 @@ static ExportPermit permit;
|
|||||||
/* Normalized path name of the current directory. */
|
/* Normalized path name of the current directory. */
|
||||||
static char *normalized_cwd;
|
static char *normalized_cwd;
|
||||||
|
|
||||||
|
/* Call once at startup even if no commands are run. */
|
||||||
|
|
||||||
|
void
|
||||||
|
remote_setup ()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Called before exit. */
|
||||||
|
|
||||||
|
void
|
||||||
|
remote_cleanup ()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/* Return nonzero if the next job should be done remotely. */
|
/* Return nonzero if the next job should be done remotely. */
|
||||||
|
|
||||||
int
|
int
|
||||||
start_remote_job_p ()
|
start_remote_job_p (first_p)
|
||||||
|
int first_p;
|
||||||
{
|
{
|
||||||
static int inited = 0;
|
static int inited = 0;
|
||||||
int status;
|
int status;
|
||||||
|
int njobs;
|
||||||
/* Allow the user to turn off job exportation
|
|
||||||
(useful while he is debugging Customs, for example). */
|
|
||||||
if (getenv ("GNU_MAKE_NO_CUSTOMS") != 0)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (!inited)
|
if (!inited)
|
||||||
{
|
{
|
||||||
|
/* Allow the user to turn off job exportation (useful while he is
|
||||||
|
debugging Customs, for example). */
|
||||||
|
if (getenv ("GNU_MAKE_NO_CUSTOMS") != 0)
|
||||||
|
{
|
||||||
|
inited = -1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* For secure Customs, make is installed setuid root and
|
/* For secure Customs, make is installed setuid root and
|
||||||
Customs requires a privileged source port be used. */
|
Customs requires a privileged source port be used. */
|
||||||
make_access ();
|
make_access ();
|
||||||
|
|
||||||
|
if (debug_flag)
|
||||||
|
Rpc_Debug(1);
|
||||||
|
|
||||||
/* Ping the daemon once to see if it is there. */
|
/* Ping the daemon once to see if it is there. */
|
||||||
inited = Customs_Ping () == RPC_SUCCESS ? 1 : -1;
|
inited = Customs_Ping () == RPC_SUCCESS ? 1 : -1;
|
||||||
|
|
||||||
@@ -87,6 +109,15 @@ start_remote_job_p ()
|
|||||||
if (inited < 0)
|
if (inited < 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
njobs = job_slots_used;
|
||||||
|
if (!first_p)
|
||||||
|
njobs -= 1; /* correction for being called from reap_children() */
|
||||||
|
|
||||||
|
/* the first job should run locally, or, if the -l flag is given, we use
|
||||||
|
that as clue as to how many local jobs should be scheduled locally */
|
||||||
|
if (max_load_average < 0 && njobs == 0 || njobs < max_load_average)
|
||||||
|
return 0;
|
||||||
|
|
||||||
status = Customs_Host (EXPORT_SAME, &permit);
|
status = Customs_Host (EXPORT_SAME, &permit);
|
||||||
if (status != RPC_SUCCESS)
|
if (status != RPC_SUCCESS)
|
||||||
{
|
{
|
||||||
@@ -113,8 +144,8 @@ start_remote_job (argv, envp, stdin_fd, is_remote, id_ptr, used_stdin)
|
|||||||
int *id_ptr;
|
int *id_ptr;
|
||||||
int *used_stdin;
|
int *used_stdin;
|
||||||
{
|
{
|
||||||
extern int vfork (), execve ();
|
|
||||||
char waybill[MAX_DATA_SIZE], msg[128];
|
char waybill[MAX_DATA_SIZE], msg[128];
|
||||||
|
struct hostent *host;
|
||||||
struct timeval timeout;
|
struct timeval timeout;
|
||||||
struct sockaddr_in sin;
|
struct sockaddr_in sin;
|
||||||
int len;
|
int len;
|
||||||
@@ -150,8 +181,8 @@ start_remote_job (argv, envp, stdin_fd, is_remote, id_ptr, used_stdin)
|
|||||||
/* Modify the waybill as if the remote child had done `child_access ()'. */
|
/* Modify the waybill as if the remote child had done `child_access ()'. */
|
||||||
{
|
{
|
||||||
WayBill *wb = (WayBill *) waybill;
|
WayBill *wb = (WayBill *) waybill;
|
||||||
wb->euid = wb->ruid;
|
wb->ruid = wb->euid;
|
||||||
wb->rgid = wb->rgid;
|
wb->rgid = wb->egid;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Send the request to the server, timing out in 20 seconds. */
|
/* Send the request to the server, timing out in 20 seconds. */
|
||||||
@@ -164,26 +195,31 @@ start_remote_job (argv, envp, stdin_fd, is_remote, id_ptr, used_stdin)
|
|||||||
len, (Rpc_Opaque) waybill,
|
len, (Rpc_Opaque) waybill,
|
||||||
sizeof(msg), (Rpc_Opaque) msg,
|
sizeof(msg), (Rpc_Opaque) msg,
|
||||||
1, &timeout);
|
1, &timeout);
|
||||||
|
|
||||||
|
host = gethostbyaddr((char *)&permit.addr, sizeof(permit.addr), AF_INET);
|
||||||
|
|
||||||
if (status != RPC_SUCCESS)
|
if (status != RPC_SUCCESS)
|
||||||
{
|
{
|
||||||
(void) close (retsock);
|
(void) close (retsock);
|
||||||
(void) close (sock);
|
(void) close (sock);
|
||||||
error ("exporting: %s", Rpc_ErrorMessage (status));
|
error ("exporting to %s: %s",
|
||||||
|
host ? host->h_name : inet_ntoa (permit.addr),
|
||||||
|
Rpc_ErrorMessage (status));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else if (msg[0] != 'O' || msg[1] != 'k' || msg[2] != '\0')
|
else if (msg[0] != 'O' || msg[1] != 'k' || msg[2] != '\0')
|
||||||
{
|
{
|
||||||
(void) close (retsock);
|
(void) close (retsock);
|
||||||
(void) close (sock);
|
(void) close (sock);
|
||||||
error ("CUSTOMS_IMPORT: %s", msg);
|
error ("exporting to %s: %s",
|
||||||
|
host ? host->h_name : inet_ntoa (permit.addr),
|
||||||
|
msg);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else if (debug_flag)
|
else
|
||||||
{
|
{
|
||||||
struct hostent *host = gethostbyaddr (&permit.addr, sizeof (permit.addr),
|
error ("*** exported to %s (id %u)",
|
||||||
AF_INET);
|
host ? host->h_name : inet_ntoa (permit.addr),
|
||||||
printf ("Job exported to %s ID %u\n",
|
|
||||||
host == 0 ? inet_ntoa (permit.addr) : host->h_name,
|
|
||||||
permit.id);
|
permit.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -225,6 +261,7 @@ start_remote_job (argv, envp, stdin_fd, is_remote, id_ptr, used_stdin)
|
|||||||
(void) close (sock);
|
(void) close (sock);
|
||||||
*is_remote = 0;
|
*is_remote = 0;
|
||||||
*id_ptr = pid;
|
*id_ptr = pid;
|
||||||
|
*used_stdin = 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,8 @@ remote_cleanup ()
|
|||||||
/* Return nonzero if the next job should be done remotely. */
|
/* Return nonzero if the next job should be done remotely. */
|
||||||
|
|
||||||
int
|
int
|
||||||
start_remote_job_p ()
|
start_remote_job_p (first_p)
|
||||||
|
int first_p;
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
108
rule.c
108
rule.c
@@ -50,6 +50,14 @@ unsigned int max_pattern_deps;
|
|||||||
|
|
||||||
unsigned int max_pattern_dep_length;
|
unsigned int max_pattern_dep_length;
|
||||||
|
|
||||||
|
/* Chain of all pattern-specific variables. */
|
||||||
|
|
||||||
|
static struct pattern_var *pattern_vars;
|
||||||
|
|
||||||
|
/* Pointer to last struct in the chain, so we can add onto the end. */
|
||||||
|
|
||||||
|
static struct pattern_var *last_pattern_var;
|
||||||
|
|
||||||
/* Pointer to structure for the file .SUFFIXES
|
/* Pointer to structure for the file .SUFFIXES
|
||||||
whose dependencies are the suffixes to be searched. */
|
whose dependencies are the suffixes to be searched. */
|
||||||
|
|
||||||
@@ -86,7 +94,7 @@ count_implicit_rule_limits ()
|
|||||||
unsigned int ntargets;
|
unsigned int ntargets;
|
||||||
|
|
||||||
++num_pattern_rules;
|
++num_pattern_rules;
|
||||||
|
|
||||||
ntargets = 0;
|
ntargets = 0;
|
||||||
while (rule->targets[ntargets] != 0)
|
while (rule->targets[ntargets] != 0)
|
||||||
++ntargets;
|
++ntargets;
|
||||||
@@ -157,7 +165,7 @@ count_implicit_rule_limits ()
|
|||||||
end_main_loop:
|
end_main_loop:
|
||||||
rule = next;
|
rule = next;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (name != 0)
|
if (name != 0)
|
||||||
free (name);
|
free (name);
|
||||||
}
|
}
|
||||||
@@ -336,7 +344,7 @@ new_pattern_rule (rule, override)
|
|||||||
else
|
else
|
||||||
last_pattern_rule->next = rule;
|
last_pattern_rule->next = rule;
|
||||||
last_pattern_rule = rule;
|
last_pattern_rule = rule;
|
||||||
|
|
||||||
/* We got one. Stop looking. */
|
/* We got one. Stop looking. */
|
||||||
goto matched;
|
goto matched;
|
||||||
}
|
}
|
||||||
@@ -519,6 +527,78 @@ create_pattern_rule (targets, target_percents,
|
|||||||
r->terminal = terminal;
|
r->terminal = terminal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Create a new pattern-specific variable struct. */
|
||||||
|
|
||||||
|
struct pattern_var *
|
||||||
|
create_pattern_var (target, suffix)
|
||||||
|
char *target, *suffix;
|
||||||
|
{
|
||||||
|
register struct pattern_var *p = 0;
|
||||||
|
unsigned int len = strlen(target);
|
||||||
|
|
||||||
|
/* Look to see if this pattern already exists in the list. */
|
||||||
|
for (p = pattern_vars; p != NULL; p = p->next)
|
||||||
|
if (p->len == len && !strcmp(p->target, target))
|
||||||
|
break;
|
||||||
|
|
||||||
|
if (p == 0)
|
||||||
|
{
|
||||||
|
p = (struct pattern_var *) xmalloc (sizeof (struct pattern_var));
|
||||||
|
if (last_pattern_var != 0)
|
||||||
|
last_pattern_var->next = p;
|
||||||
|
else
|
||||||
|
pattern_vars = p;
|
||||||
|
last_pattern_var = p;
|
||||||
|
p->next = 0;
|
||||||
|
p->target = target;
|
||||||
|
p->len = len;
|
||||||
|
p->suffix = suffix + 1;
|
||||||
|
p->vars = create_new_variable_set();
|
||||||
|
}
|
||||||
|
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Look up a target in the pattern-specific variable list. */
|
||||||
|
|
||||||
|
struct pattern_var *
|
||||||
|
lookup_pattern_var (target)
|
||||||
|
char *target;
|
||||||
|
{
|
||||||
|
struct pattern_var *p;
|
||||||
|
unsigned int targlen = strlen(target);
|
||||||
|
|
||||||
|
for (p = pattern_vars; p != 0; p = p->next)
|
||||||
|
{
|
||||||
|
char *stem;
|
||||||
|
unsigned int stemlen;
|
||||||
|
|
||||||
|
if (p->len > targlen)
|
||||||
|
/* It can't possibly match. */
|
||||||
|
continue;
|
||||||
|
|
||||||
|
/* From the lengths of the filename and the pattern parts,
|
||||||
|
find the stem: the part of the filename that matches the %. */
|
||||||
|
stem = target + (p->suffix - p->target - 1);
|
||||||
|
stemlen = targlen - p->len + 1;
|
||||||
|
|
||||||
|
/* Compare the text in the pattern before the stem, if any. */
|
||||||
|
if (stem > target && strncmp (p->target, target, stem - target))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
/* Compare the text in the pattern after the stem, if any.
|
||||||
|
We could test simply use streq, but this way we compare the
|
||||||
|
first two characters immediately. This saves time in the very
|
||||||
|
common case where the first character matches because it is a
|
||||||
|
period. */
|
||||||
|
if (*p->suffix == stem[stemlen]
|
||||||
|
&& (*p->suffix == '\0'|| streq (&p->suffix[1], &stem[stemlen+1])))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
/* Print the data base of rules. */
|
/* Print the data base of rules. */
|
||||||
|
|
||||||
static void /* Useful to call from gdb. */
|
static void /* Useful to call from gdb. */
|
||||||
@@ -586,4 +666,26 @@ print_rule_data_base ()
|
|||||||
if (num_pattern_rules != rules)
|
if (num_pattern_rules != rules)
|
||||||
fatal ("BUG: num_pattern_rules wrong! %u != %u",
|
fatal ("BUG: num_pattern_rules wrong! %u != %u",
|
||||||
num_pattern_rules, rules);
|
num_pattern_rules, rules);
|
||||||
|
|
||||||
|
puts ("\n# Pattern-specific variable values");
|
||||||
|
|
||||||
|
{
|
||||||
|
struct pattern_var *p;
|
||||||
|
|
||||||
|
rules = 0;
|
||||||
|
for (p = pattern_vars; p != 0; p = p->next)
|
||||||
|
{
|
||||||
|
++rules;
|
||||||
|
|
||||||
|
printf ("\n%s :\n", p->target);
|
||||||
|
print_variable_set (p->vars->set, "# ");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rules == 0)
|
||||||
|
puts ("\n# No pattern-specific variable values.");
|
||||||
|
else
|
||||||
|
{
|
||||||
|
printf ("\n# %u pattern-specific variable values", rules);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
11
rule.h
11
rule.h
@@ -30,6 +30,15 @@ struct rule
|
|||||||
char in_use; /* If in use by a parent pattern_search. */
|
char in_use; /* If in use by a parent pattern_search. */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct pattern_var
|
||||||
|
{
|
||||||
|
struct pattern_var *next;
|
||||||
|
char *target;
|
||||||
|
unsigned int len;
|
||||||
|
char *suffix;
|
||||||
|
struct variable_set_list *vars;
|
||||||
|
};
|
||||||
|
|
||||||
/* For calling install_pattern_rule. */
|
/* For calling install_pattern_rule. */
|
||||||
struct pspec
|
struct pspec
|
||||||
{
|
{
|
||||||
@@ -51,3 +60,5 @@ extern unsigned int maxsuffix;
|
|||||||
|
|
||||||
extern void install_pattern_rule PARAMS ((struct pspec *p, int terminal));
|
extern void install_pattern_rule PARAMS ((struct pspec *p, int terminal));
|
||||||
extern int new_pattern_rule PARAMS ((struct rule *rule, int override));
|
extern int new_pattern_rule PARAMS ((struct rule *rule, int override));
|
||||||
|
extern struct pattern_var *create_pattern_var PARAMS ((char *target, char *suffix));
|
||||||
|
extern struct pattern_var *lookup_pattern_var PARAMS ((char *target));
|
||||||
|
|||||||
27
signame.c
27
signame.c
@@ -1,19 +1,21 @@
|
|||||||
/* Convert between signal names and numbers.
|
/* Convert between signal names and numbers.
|
||||||
Copyright (C) 1990, 1992, 1993, 1995, 1996 Free Software Foundation, Inc.
|
Copyright (C) 1990, 1992, 1993, 1995, 1996 Free Software Foundation, Inc.
|
||||||
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
it under the terms of the GNU General Public License as published by
|
modify it under the terms of the GNU Library General Public License as
|
||||||
the Free Software Foundation; either version 2, or (at your option)
|
published by the Free Software Foundation; either version 2 of the
|
||||||
any later version.
|
License, or (at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
The GNU C Library is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
GNU General Public License for more details.
|
Library General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU Library General Public
|
||||||
along with this program; see the file COPYING. If not, write to
|
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||||
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
|
Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
@@ -231,6 +233,9 @@ signame_init ()
|
|||||||
#if defined (SIGINFO)
|
#if defined (SIGINFO)
|
||||||
init_sig (SIGINFO, "INFO", "Information request");
|
init_sig (SIGINFO, "INFO", "Information request");
|
||||||
#endif
|
#endif
|
||||||
|
#if defined (SIGNOFP)
|
||||||
|
init_sig (SIGNOFP, "NOFP", "Floating point co-processor not available");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return the abbreviation for signal NUMBER. */
|
/* Return the abbreviation for signal NUMBER. */
|
||||||
|
|||||||
26
signame.h
26
signame.h
@@ -1,19 +1,21 @@
|
|||||||
/* Convert between signal names and numbers.
|
/* Convert between signal names and numbers.
|
||||||
Copyright (C) 1990, 1992, 1993, 1995 Free Software Foundation, Inc.
|
Copyright (C) 1990, 1992, 1993, 1995, 1997 Free Software Foundation, Inc.
|
||||||
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
it under the terms of the GNU General Public License as published by
|
modify it under the terms of the GNU Library General Public License as
|
||||||
the Free Software Foundation; either version 2, or (at your option)
|
published by the Free Software Foundation; either version 2 of the
|
||||||
any later version.
|
License, or (at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
The GNU C Library is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
GNU General Public License for more details.
|
Library General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU Library General Public
|
||||||
along with this program; see the file COPYING. If not, write to
|
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||||
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
|
Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
#if defined (__STDC__) && __STDC__
|
#if defined (__STDC__) && __STDC__
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
cd w32\subproc
|
cd w32\subproc
|
||||||
nmake /f %1
|
set MAKE=%2
|
||||||
cd ..\..
|
set MAKEFILE=%1
|
||||||
|
if x%2 == x set MAKE=nmake
|
||||||
|
%MAKE% /f %MAKEFILE%
|
||||||
|
cd ..\..
|
||||||
|
|||||||
5428
texinfo.tex
Normal file
5428
texinfo.tex
Normal file
File diff suppressed because it is too large
Load Diff
301
variable.c
301
variable.c
@@ -1,5 +1,5 @@
|
|||||||
/* Internals of variables for GNU Make.
|
/* Internals of variables for GNU Make.
|
||||||
Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 96 Free Software Foundation, Inc.
|
Copyright (C) 1988,89,90,91,92,93,94,96,97 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
|
||||||
@@ -22,7 +22,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||||||
#include "job.h"
|
#include "job.h"
|
||||||
#include "commands.h"
|
#include "commands.h"
|
||||||
#include "variable.h"
|
#include "variable.h"
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
#include "pathstuff.h"
|
#include "pathstuff.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -44,10 +44,8 @@ static struct variable_set_list global_setlist
|
|||||||
= { 0, &global_variable_set };
|
= { 0, &global_variable_set };
|
||||||
struct variable_set_list *current_variable_set_list = &global_setlist;
|
struct variable_set_list *current_variable_set_list = &global_setlist;
|
||||||
|
|
||||||
static struct variable *define_variable_in_set PARAMS ((char *name, unsigned int length,
|
static struct variable *lookup_variable_in_set PARAMS ((char *name,
|
||||||
char *value, enum variable_origin origin,
|
unsigned int length, struct variable_set *set));
|
||||||
int recursive, struct variable_set *set));
|
|
||||||
|
|
||||||
|
|
||||||
/* Implement variables. */
|
/* Implement variables. */
|
||||||
|
|
||||||
@@ -58,7 +56,7 @@ static struct variable *define_variable_in_set PARAMS ((char *name, unsigned int
|
|||||||
If RECURSIVE is nonzero a flag is set in the variable saying
|
If RECURSIVE is nonzero a flag is set in the variable saying
|
||||||
that it should be recursively re-expanded. */
|
that it should be recursively re-expanded. */
|
||||||
|
|
||||||
static struct variable *
|
struct variable *
|
||||||
define_variable_in_set (name, length, value, origin, recursive, set)
|
define_variable_in_set (name, length, value, origin, recursive, set)
|
||||||
char *name;
|
char *name;
|
||||||
unsigned int length;
|
unsigned int length;
|
||||||
@@ -114,6 +112,7 @@ define_variable_in_set (name, length, value, origin, recursive, set)
|
|||||||
v->origin = origin;
|
v->origin = origin;
|
||||||
v->recursive = recursive;
|
v->recursive = recursive;
|
||||||
v->expanding = 0;
|
v->expanding = 0;
|
||||||
|
v->per_target = 0;
|
||||||
v->export = v_default;
|
v->export = v_default;
|
||||||
v->next = set->table[hashval];
|
v->next = set->table[hashval];
|
||||||
set->table[hashval] = v;
|
set->table[hashval] = v;
|
||||||
@@ -184,6 +183,34 @@ lookup_variable (name, length)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Lookup a variable whose name is a string starting at NAME
|
||||||
|
and with LENGTH chars in set SET. NAME need not be null-terminated.
|
||||||
|
Returns address of the `struct variable' containing all info
|
||||||
|
on the variable, or nil if no such variable is defined. */
|
||||||
|
|
||||||
|
static struct variable *
|
||||||
|
lookup_variable_in_set (name, length, set)
|
||||||
|
char *name;
|
||||||
|
unsigned int length;
|
||||||
|
struct variable_set *set;
|
||||||
|
{
|
||||||
|
register unsigned int i;
|
||||||
|
register unsigned int hash = 0;
|
||||||
|
register struct variable *v;
|
||||||
|
|
||||||
|
for (i = 0; i < length; ++i)
|
||||||
|
HASH (hash, name[i]);
|
||||||
|
hash %= set->buckets;
|
||||||
|
|
||||||
|
for (v = set->table[hash]; v != 0; v = v->next)
|
||||||
|
if (*v->name == *name
|
||||||
|
&& !strncmp (v->name + 1, name + 1, length - 1)
|
||||||
|
&& v->name[length] == 0)
|
||||||
|
return v;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* Initialize FILE's variable set list. If FILE already has a variable set
|
/* Initialize FILE's variable set list. If FILE already has a variable set
|
||||||
list, the topmost variable set is left intact, but the the rest of the
|
list, the topmost variable set is left intact, but the the rest of the
|
||||||
chain is replaced with FILE->parent's setlist. */
|
chain is replaced with FILE->parent's setlist. */
|
||||||
@@ -245,10 +272,8 @@ pop_variable_scope ()
|
|||||||
free ((char *) set);
|
free ((char *) set);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create a new variable set and push it on the current setlist. */
|
struct variable_set_list *
|
||||||
|
create_new_variable_set ()
|
||||||
void
|
|
||||||
push_new_variable_scope ()
|
|
||||||
{
|
{
|
||||||
register struct variable_set_list *setlist;
|
register struct variable_set_list *setlist;
|
||||||
register struct variable_set *set;
|
register struct variable_set *set;
|
||||||
@@ -263,7 +288,16 @@ push_new_variable_scope ()
|
|||||||
xmalloc (sizeof (struct variable_set_list));
|
xmalloc (sizeof (struct variable_set_list));
|
||||||
setlist->set = set;
|
setlist->set = set;
|
||||||
setlist->next = current_variable_set_list;
|
setlist->next = current_variable_set_list;
|
||||||
current_variable_set_list = setlist;
|
|
||||||
|
return setlist;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Create a new variable set and push it on the current setlist. */
|
||||||
|
|
||||||
|
struct variable_set_list *
|
||||||
|
push_new_variable_scope ()
|
||||||
|
{
|
||||||
|
return (current_variable_set_list = create_new_variable_set());
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Merge SET1 into SET0, freeing unused storage in SET1. */
|
/* Merge SET1 into SET0, freeing unused storage in SET1. */
|
||||||
@@ -333,8 +367,6 @@ merge_variable_set_lists (setlist0, setlist1)
|
|||||||
|
|
||||||
merge_variable_sets (list0->set, next->set);
|
merge_variable_sets (list0->set, next->set);
|
||||||
|
|
||||||
free ((char *) next);
|
|
||||||
|
|
||||||
last0 = list0;
|
last0 = list0;
|
||||||
list0 = list0->next;
|
list0 = list0->next;
|
||||||
}
|
}
|
||||||
@@ -354,7 +386,7 @@ merge_variable_set_lists (setlist0, setlist1)
|
|||||||
void
|
void
|
||||||
define_automatic_variables ()
|
define_automatic_variables ()
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
extern char* default_shell;
|
extern char* default_shell;
|
||||||
#else
|
#else
|
||||||
extern char default_shell[];
|
extern char default_shell[];
|
||||||
@@ -373,12 +405,39 @@ define_automatic_variables ()
|
|||||||
? "" : remote_description);
|
? "" : remote_description);
|
||||||
(void) define_variable ("MAKE_VERSION", 12, buf, o_default, 0);
|
(void) define_variable ("MAKE_VERSION", 12, buf, o_default, 0);
|
||||||
|
|
||||||
|
#ifdef __MSDOS__
|
||||||
|
/* Allow to specify a special shell just for Make,
|
||||||
|
and use $COMSPEC as the default $SHELL when appropriate. */
|
||||||
|
{
|
||||||
|
static char shell_str[] = "SHELL";
|
||||||
|
const int shlen = sizeof (shell_str) - 1;
|
||||||
|
struct variable *mshp = lookup_variable ("MAKESHELL", 9);
|
||||||
|
struct variable *comp = lookup_variable ("COMSPEC", 7);
|
||||||
|
|
||||||
|
/* Make $MAKESHELL override $SHELL even if -e is in effect. */
|
||||||
|
if (mshp)
|
||||||
|
(void) define_variable (shell_str, shlen,
|
||||||
|
mshp->value, o_env_override, 0);
|
||||||
|
else if (comp)
|
||||||
|
{
|
||||||
|
/* $COMSPEC shouldn't override $SHELL. */
|
||||||
|
struct variable *shp = lookup_variable (shell_str, shlen);
|
||||||
|
|
||||||
|
if (!shp)
|
||||||
|
(void) define_variable (shell_str, shlen, comp->value, o_env, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* This won't override any definition, but it
|
/* This won't override any definition, but it
|
||||||
will provide one if there isn't one there. */
|
will provide one if there isn't one there. */
|
||||||
v = define_variable ("SHELL", 5, default_shell, o_default, 0);
|
v = define_variable ("SHELL", 5, default_shell, o_default, 0);
|
||||||
v->export = v_export; /* Always export SHELL. */
|
v->export = v_export; /* Always export SHELL. */
|
||||||
|
|
||||||
|
/* On MSDOS we do use SHELL from environment, since
|
||||||
|
it isn't a standard environment variable on MSDOS,
|
||||||
|
so whoever sets it, does that on purpose. */
|
||||||
|
#ifndef __MSDOS__
|
||||||
/* Don't let SHELL come from the environment. */
|
/* Don't let SHELL come from the environment. */
|
||||||
if (*v->value == '\0' || v->origin == o_env || v->origin == o_env_override)
|
if (*v->value == '\0' || v->origin == o_env || v->origin == o_env_override)
|
||||||
{
|
{
|
||||||
@@ -386,6 +445,7 @@ define_automatic_variables ()
|
|||||||
v->origin = o_file;
|
v->origin = o_file;
|
||||||
v->value = savestring (default_shell, strlen (default_shell));
|
v->value = savestring (default_shell, strlen (default_shell));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Make sure MAKEFILES gets exported if it is set. */
|
/* Make sure MAKEFILES gets exported if it is set. */
|
||||||
v = define_variable ("MAKEFILES", 9, "", o_default, 0);
|
v = define_variable ("MAKEFILES", 9, "", o_default, 0);
|
||||||
@@ -480,6 +540,19 @@ target_environment (file)
|
|||||||
added specially at the end. */
|
added specially at the end. */
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
/* If this is a per-target variable and it hasn't been touched
|
||||||
|
already then look up the global version and take its export
|
||||||
|
value. */
|
||||||
|
if (v->per_target && v->export == v_default)
|
||||||
|
{
|
||||||
|
struct variable *gv;
|
||||||
|
|
||||||
|
gv = lookup_variable_in_set(v->name, strlen(v->name),
|
||||||
|
&global_variable_set);
|
||||||
|
if (gv)
|
||||||
|
v->export = gv->export;
|
||||||
|
}
|
||||||
|
|
||||||
switch (v->export)
|
switch (v->export)
|
||||||
{
|
{
|
||||||
case v_default:
|
case v_default:
|
||||||
@@ -498,15 +571,16 @@ target_environment (file)
|
|||||||
for (++p; *p != '\0'; ++p)
|
for (++p; *p != '\0'; ++p)
|
||||||
if (*p != '_' && (*p < 'a' || *p > 'z')
|
if (*p != '_' && (*p < 'a' || *p > 'z')
|
||||||
&& (*p < 'A' || *p > 'Z') && (*p < '0' || *p > '9'))
|
&& (*p < 'A' || *p > 'Z') && (*p < '0' || *p > '9'))
|
||||||
break;
|
continue;
|
||||||
if (*p != '\0')
|
if (*p != '\0')
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
case v_export:
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case v_noexport:
|
case v_export:
|
||||||
continue;
|
break;
|
||||||
|
|
||||||
|
case v_noexport:
|
||||||
|
continue;
|
||||||
|
|
||||||
case v_ifset:
|
case v_ifset:
|
||||||
if (v->origin == o_default)
|
if (v->origin == o_default)
|
||||||
@@ -514,9 +588,22 @@ target_environment (file)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If this was from a different-sized hash table, then
|
||||||
|
recalculate the bucket it goes in. */
|
||||||
|
if (set->buckets != buckets)
|
||||||
|
{
|
||||||
|
register char *np;
|
||||||
|
|
||||||
|
j = 0;
|
||||||
|
for (np = v->name; *np != '\0'; ++np)
|
||||||
|
HASH (j, *np);
|
||||||
|
j %= buckets;
|
||||||
|
}
|
||||||
|
|
||||||
for (ov = table[j]; ov != 0; ov = ov->next)
|
for (ov = table[j]; ov != 0; ov = ov->next)
|
||||||
if (streq (v->name, ov->variable->name))
|
if (streq (v->name, ov->variable->name))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (ov == 0)
|
if (ov == 0)
|
||||||
{
|
{
|
||||||
register struct variable_bucket *entry;
|
register struct variable_bucket *entry;
|
||||||
@@ -539,6 +626,7 @@ target_environment (file)
|
|||||||
for (b = table[i]; b != 0; b = b->next)
|
for (b = table[i]; b != 0; b = b->next)
|
||||||
{
|
{
|
||||||
register struct variable *v = b->variable;
|
register struct variable *v = b->variable;
|
||||||
|
|
||||||
/* If V is recursively expanded and didn't come from the environment,
|
/* If V is recursively expanded and didn't come from the environment,
|
||||||
expand its value. If it came from the environment, it should
|
expand its value. If it came from the environment, it should
|
||||||
go back into the environment unchanged. */
|
go back into the environment unchanged. */
|
||||||
@@ -546,20 +634,20 @@ target_environment (file)
|
|||||||
&& v->origin != o_env && v->origin != o_env_override)
|
&& v->origin != o_env && v->origin != o_env_override)
|
||||||
{
|
{
|
||||||
char *value = recursively_expand (v);
|
char *value = recursively_expand (v);
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
if (strcmp(v->name, "Path") == 0 ||
|
if (strcmp(v->name, "Path") == 0 ||
|
||||||
strcmp(v->name, "PATH") == 0)
|
strcmp(v->name, "PATH") == 0)
|
||||||
convert_Path_to_win32(value, ';');
|
convert_Path_to_windows32(value, ';');
|
||||||
#endif
|
#endif
|
||||||
result[nvariables++] = concat (v->name, "=", value);
|
result[nvariables++] = concat (v->name, "=", value);
|
||||||
free (value);
|
free (value);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
{
|
{
|
||||||
if (strcmp(v->name, "Path") == 0 ||
|
if (strcmp(v->name, "Path") == 0 ||
|
||||||
strcmp(v->name, "PATH") == 0)
|
strcmp(v->name, "PATH") == 0)
|
||||||
convert_Path_to_win32(v->value, ';');
|
convert_Path_to_windows32(v->value, ';');
|
||||||
result[nvariables++] = concat (v->name, "=", v->value);
|
result[nvariables++] = concat (v->name, "=", v->value);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
@@ -581,14 +669,11 @@ target_environment (file)
|
|||||||
from a makefile, an override directive, the environment with
|
from a makefile, an override directive, the environment with
|
||||||
or without the -e switch, or the command line.
|
or without the -e switch, or the command line.
|
||||||
|
|
||||||
A variable definition has the form "name = value" or "name := value".
|
See the comments for parse_variable_definition().
|
||||||
Any whitespace around the "=" or ":=" is removed. The first form
|
|
||||||
defines a variable that is recursively re-evaluated. The second form
|
|
||||||
defines a variable whose value is variable-expanded at the time of
|
|
||||||
definition and then is evaluated only once at the time of expansion.
|
|
||||||
|
|
||||||
If a variable was defined, a pointer to its `struct variable' is returned.
|
If LINE was recognized as a variable definition, a pointer to its `struct
|
||||||
If not, NULL is returned. */
|
variable' is returned. If LINE is not a variable definition, NULL is
|
||||||
|
returned. */
|
||||||
|
|
||||||
struct variable *
|
struct variable *
|
||||||
try_variable_definition (filename, lineno, line, origin)
|
try_variable_definition (filename, lineno, line, origin)
|
||||||
@@ -601,7 +686,8 @@ try_variable_definition (filename, lineno, line, origin)
|
|||||||
register char *p = line;
|
register char *p = line;
|
||||||
register char *beg;
|
register char *beg;
|
||||||
register char *end;
|
register char *end;
|
||||||
enum { bogus, simple, recursive, append } flavor = bogus;
|
enum { f_bogus,
|
||||||
|
f_simple, f_recursive, f_append, f_conditional } flavor = f_bogus;
|
||||||
char *name, *expanded_name, *value;
|
char *name, *expanded_name, *value;
|
||||||
struct variable *v;
|
struct variable *v;
|
||||||
|
|
||||||
@@ -613,14 +699,14 @@ try_variable_definition (filename, lineno, line, origin)
|
|||||||
if (c == '=')
|
if (c == '=')
|
||||||
{
|
{
|
||||||
end = p - 1;
|
end = p - 1;
|
||||||
flavor = recursive;
|
flavor = f_recursive;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if (c == ':')
|
else if (c == ':')
|
||||||
if (*p == '=')
|
if (*p == '=')
|
||||||
{
|
{
|
||||||
end = p++ - 1;
|
end = p++ - 1;
|
||||||
flavor = simple;
|
flavor = f_simple;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -629,9 +715,15 @@ try_variable_definition (filename, lineno, line, origin)
|
|||||||
else if (c == '+' && *p == '=')
|
else if (c == '+' && *p == '=')
|
||||||
{
|
{
|
||||||
end = p++ - 1;
|
end = p++ - 1;
|
||||||
flavor = append;
|
flavor = f_append;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
else if (c == '?' && *p == '=')
|
||||||
|
{
|
||||||
|
end = p++ - 1;
|
||||||
|
flavor = f_conditional;
|
||||||
|
break;
|
||||||
|
}
|
||||||
else if (c == '$')
|
else if (c == '$')
|
||||||
{
|
{
|
||||||
/* This might begin a variable expansion reference. Make sure we
|
/* This might begin a variable expansion reference. Make sure we
|
||||||
@@ -674,31 +766,35 @@ try_variable_definition (filename, lineno, line, origin)
|
|||||||
expanded_name = allocated_variable_expand (name);
|
expanded_name = allocated_variable_expand (name);
|
||||||
|
|
||||||
if (expanded_name[0] == '\0')
|
if (expanded_name[0] == '\0')
|
||||||
{
|
makefile_fatal (filename, lineno, "empty variable name");
|
||||||
if (filename == 0)
|
|
||||||
fatal ("empty variable name");
|
|
||||||
else
|
|
||||||
makefile_fatal (filename, lineno, "empty variable name");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Calculate the variable's new value in VALUE. */
|
/* Calculate the variable's new value in VALUE. */
|
||||||
|
|
||||||
switch (flavor)
|
switch (flavor)
|
||||||
{
|
{
|
||||||
case bogus:
|
case f_bogus:
|
||||||
/* Should not be possible. */
|
/* Should not be possible. */
|
||||||
abort ();
|
abort ();
|
||||||
return 0;
|
case f_simple:
|
||||||
case simple:
|
|
||||||
/* A simple variable definition "var := value". Expand the value. */
|
/* A simple variable definition "var := value". Expand the value. */
|
||||||
value = variable_expand (p);
|
value = variable_expand (p);
|
||||||
break;
|
break;
|
||||||
case recursive:
|
case f_conditional:
|
||||||
|
/* A conditional variable definition "var ?= value".
|
||||||
|
The value is set IFF the variable is not defined yet. */
|
||||||
|
v = lookup_variable(expanded_name, strlen(expanded_name));
|
||||||
|
if (v)
|
||||||
|
{
|
||||||
|
free(expanded_name);
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
/* FALLTHROUGH */
|
||||||
|
case f_recursive:
|
||||||
/* A recursive variable definition "var = value".
|
/* A recursive variable definition "var = value".
|
||||||
The value is used verbatim. */
|
The value is used verbatim. */
|
||||||
value = p;
|
value = p;
|
||||||
break;
|
break;
|
||||||
case append:
|
case f_append:
|
||||||
/* An appending variable definition "var += value".
|
/* An appending variable definition "var += value".
|
||||||
Extract the old value and append the new one. */
|
Extract the old value and append the new one. */
|
||||||
v = lookup_variable (expanded_name, strlen (expanded_name));
|
v = lookup_variable (expanded_name, strlen (expanded_name));
|
||||||
@@ -707,7 +803,7 @@ try_variable_definition (filename, lineno, line, origin)
|
|||||||
/* There was no old value.
|
/* There was no old value.
|
||||||
This becomes a normal recursive definition. */
|
This becomes a normal recursive definition. */
|
||||||
value = p;
|
value = p;
|
||||||
flavor = recursive;
|
flavor = f_recursive;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -718,7 +814,7 @@ try_variable_definition (filename, lineno, line, origin)
|
|||||||
if (v->recursive)
|
if (v->recursive)
|
||||||
/* The previous definition of the variable was recursive.
|
/* The previous definition of the variable was recursive.
|
||||||
The new value comes from the unexpanded old and new values. */
|
The new value comes from the unexpanded old and new values. */
|
||||||
flavor = recursive;
|
flavor = f_recursive;
|
||||||
else
|
else
|
||||||
/* The previous definition of the variable was simple.
|
/* The previous definition of the variable was simple.
|
||||||
The new value comes from the old value, which was expanded
|
The new value comes from the old value, which was expanded
|
||||||
@@ -734,8 +830,107 @@ try_variable_definition (filename, lineno, line, origin)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __MSDOS__
|
||||||
|
/* Many Unix Makefiles include a line saying "SHELL=/bin/sh", but
|
||||||
|
non-Unix systems don't conform to this default configuration (in
|
||||||
|
fact, most of them don't even have `/bin'). On the other hand,
|
||||||
|
$SHELL in the environment, if set, points to the real pathname of
|
||||||
|
the shell.
|
||||||
|
Therefore, we generally won't let lines like "SHELL=/bin/sh" from
|
||||||
|
the Makefile override $SHELL from the environment. But first, we
|
||||||
|
look for the basename of the shell in the directory where SHELL=
|
||||||
|
points, and along the $PATH; if it is found in any of these places,
|
||||||
|
we define $SHELL to be the actual pathname of the shell. Thus, if
|
||||||
|
you have bash.exe installed as d:/unix/bash.exe, and d:/unix is on
|
||||||
|
your $PATH, then SHELL=/usr/local/bin/bash will have the effect of
|
||||||
|
defining SHELL to be "d:/unix/bash.exe". */
|
||||||
|
if (origin == o_file
|
||||||
|
&& strcmp (expanded_name, "SHELL") == 0)
|
||||||
|
{
|
||||||
|
char shellpath[PATH_MAX];
|
||||||
|
extern char * __dosexec_find_on_path (const char *, char *[], char *);
|
||||||
|
|
||||||
|
/* See if we can find "/bin/sh.exe", "/bin/sh.com", etc. */
|
||||||
|
if (__dosexec_find_on_path (value, (char **)0, shellpath))
|
||||||
|
{
|
||||||
|
char *p;
|
||||||
|
|
||||||
|
for (p = shellpath; *p; p++)
|
||||||
|
{
|
||||||
|
if (*p == '\\')
|
||||||
|
*p = '/';
|
||||||
|
}
|
||||||
|
v = define_variable (expanded_name, strlen (expanded_name),
|
||||||
|
shellpath, origin, flavor == f_recursive);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
char *shellbase, *bslash;
|
||||||
|
struct variable *pathv = lookup_variable ("PATH", 4);
|
||||||
|
char *path_string;
|
||||||
|
char *fake_env[2];
|
||||||
|
size_t pathlen = 0;
|
||||||
|
|
||||||
|
shellbase = rindex (value, '/');
|
||||||
|
bslash = rindex (value, '\\');
|
||||||
|
if (!shellbase || bslash > shellbase)
|
||||||
|
shellbase = bslash;
|
||||||
|
if (!shellbase && value[1] == ':')
|
||||||
|
shellbase = value + 1;
|
||||||
|
if (shellbase)
|
||||||
|
shellbase++;
|
||||||
|
else
|
||||||
|
shellbase = value;
|
||||||
|
|
||||||
|
/* Search for the basename of the shell (with standard
|
||||||
|
executable extensions) along the $PATH. */
|
||||||
|
if (pathv)
|
||||||
|
pathlen = strlen (pathv->value);
|
||||||
|
path_string = (char *)xmalloc (5 + pathlen + 2 + 1);
|
||||||
|
/* On MSDOS, current directory is considered as part of $PATH. */
|
||||||
|
sprintf (path_string, "PATH=.;%s", pathv ? pathv->value : "");
|
||||||
|
fake_env[0] = path_string;
|
||||||
|
fake_env[1] = (char *)0;
|
||||||
|
if (__dosexec_find_on_path (shellbase, fake_env, shellpath))
|
||||||
|
{
|
||||||
|
char *p;
|
||||||
|
|
||||||
|
for (p = shellpath; *p; p++)
|
||||||
|
{
|
||||||
|
if (*p == '\\')
|
||||||
|
*p = '/';
|
||||||
|
}
|
||||||
|
v = define_variable (expanded_name, strlen (expanded_name),
|
||||||
|
shellpath, origin, flavor == f_recursive);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
v = lookup_variable (expanded_name, strlen (expanded_name));
|
||||||
|
|
||||||
|
free (path_string);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#endif /* __MSDOS__ */
|
||||||
|
#ifdef WINDOWS32
|
||||||
|
if (origin == o_file
|
||||||
|
&& strcmp (expanded_name, "SHELL") == 0) {
|
||||||
|
extern char* default_shell;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Call shell locator function. If it returns TRUE, then
|
||||||
|
* set no_default_sh_exe to indicate sh was found and
|
||||||
|
* set new value for SHELL variable.
|
||||||
|
*/
|
||||||
|
if (find_and_set_default_shell(value)) {
|
||||||
|
v = define_variable (expanded_name, strlen (expanded_name),
|
||||||
|
default_shell, origin, flavor == f_recursive);
|
||||||
|
no_default_sh_exe = 0;
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
#endif
|
||||||
|
|
||||||
v = define_variable (expanded_name, strlen (expanded_name),
|
v = define_variable (expanded_name, strlen (expanded_name),
|
||||||
value, origin, flavor == recursive);
|
value, origin, flavor == f_recursive);
|
||||||
|
|
||||||
free (expanded_name);
|
free (expanded_name);
|
||||||
|
|
||||||
@@ -815,7 +1010,7 @@ print_variable (v, prefix)
|
|||||||
/* Print all the variables in SET. PREFIX is printed before
|
/* Print all the variables in SET. PREFIX is printed before
|
||||||
the actual variable definitions (everything else is comments). */
|
the actual variable definitions (everything else is comments). */
|
||||||
|
|
||||||
static void
|
void
|
||||||
print_variable_set (set, prefix)
|
print_variable_set (set, prefix)
|
||||||
register struct variable_set *set;
|
register struct variable_set *set;
|
||||||
char *prefix;
|
char *prefix;
|
||||||
@@ -884,7 +1079,7 @@ print_file_variables (file)
|
|||||||
print_variable_set (file->variables->set, "# ");
|
print_variable_set (file->variables->set, "# ");
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
void
|
void
|
||||||
sync_Path_environment(void)
|
sync_Path_environment(void)
|
||||||
{
|
{
|
||||||
@@ -902,9 +1097,9 @@ sync_Path_environment(void)
|
|||||||
free(environ_path);
|
free(environ_path);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Create something WIN32 world can grok
|
* Create something WINDOWS32 world can grok
|
||||||
*/
|
*/
|
||||||
convert_Path_to_win32(path, ';');
|
convert_Path_to_windows32(path, ';');
|
||||||
environ_path = concat("Path", "=", path);
|
environ_path = concat("Path", "=", path);
|
||||||
putenv(environ_path);
|
putenv(environ_path);
|
||||||
free(path);
|
free(path);
|
||||||
|
|||||||
15
variable.h
15
variable.h
@@ -43,7 +43,8 @@ struct variable
|
|||||||
origin ENUM_BITFIELD (3); /* Variable origin. */
|
origin ENUM_BITFIELD (3); /* Variable origin. */
|
||||||
unsigned int recursive:1; /* Gets recursively re-evaluated. */
|
unsigned int recursive:1; /* Gets recursively re-evaluated. */
|
||||||
unsigned int expanding:1; /* Nonzero if currently being expanded. */
|
unsigned int expanding:1; /* Nonzero if currently being expanded. */
|
||||||
enum
|
unsigned int per_target:1; /* Nonzero if a target-specific variable. */
|
||||||
|
enum variable_export
|
||||||
{
|
{
|
||||||
v_export, /* Export this variable. */
|
v_export, /* Export this variable. */
|
||||||
v_noexport, /* Don't export this variable. */
|
v_noexport, /* Don't export this variable. */
|
||||||
@@ -68,20 +69,22 @@ struct variable_set_list
|
|||||||
struct variable_set *set; /* Variable set. */
|
struct variable_set *set; /* Variable set. */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extern char *variable_buffer;
|
||||||
extern struct variable_set_list *current_variable_set_list;
|
extern struct variable_set_list *current_variable_set_list;
|
||||||
|
|
||||||
/* expand.c */
|
/* expand.c */
|
||||||
extern char *variable_buffer_output PARAMS ((char *ptr, char *string, unsigned int length));
|
extern char *variable_buffer_output PARAMS ((char *ptr, char *string, unsigned int length));
|
||||||
extern char *variable_expand PARAMS ((char *line));
|
extern char *variable_expand PARAMS ((char *line));
|
||||||
extern char *variable_expand_for_file PARAMS ((char *line, struct file *file));
|
|
||||||
extern char *allocated_variable_expand_for_file PARAMS ((char *line, struct file *file));
|
extern char *allocated_variable_expand_for_file PARAMS ((char *line, struct file *file));
|
||||||
#define allocated_variable_expand(line) \
|
#define allocated_variable_expand(line) \
|
||||||
allocated_variable_expand_for_file (line, (struct file *) 0)
|
allocated_variable_expand_for_file (line, (struct file *) 0)
|
||||||
extern char *expand_argument PARAMS ((char *str, char *end));
|
extern char *expand_argument PARAMS ((char *str, char *end));
|
||||||
|
extern char *variable_expand_string PARAMS ((char *line, char *string,
|
||||||
|
long length));
|
||||||
|
|
||||||
/* function.c */
|
/* function.c */
|
||||||
extern int handle_function PARAMS ((char **op, char **stringp));
|
extern int handle_function PARAMS ((char **op, char **stringp));
|
||||||
extern int pattern_matches PARAMS ((char *pattern, char *percent, char *word));
|
extern int pattern_matches PARAMS ((char *pattern, char *percent, char *str));
|
||||||
extern char *subst_expand PARAMS ((char *o, char *text, char *subst, char *replace,
|
extern char *subst_expand PARAMS ((char *o, char *text, char *subst, char *replace,
|
||||||
unsigned int slen, unsigned int rlen, int by_word, int suffix_only));
|
unsigned int slen, unsigned int rlen, int by_word, int suffix_only));
|
||||||
extern char *patsubst_expand PARAMS ((char *o, char *text, char *pattern, char *replace,
|
extern char *patsubst_expand PARAMS ((char *o, char *text, char *pattern, char *replace,
|
||||||
@@ -91,17 +94,21 @@ extern char *patsubst_expand PARAMS ((char *o, char *text, char *pattern, char *
|
|||||||
extern char *recursively_expand PARAMS ((struct variable *v));
|
extern char *recursively_expand PARAMS ((struct variable *v));
|
||||||
|
|
||||||
/* variable.c */
|
/* variable.c */
|
||||||
extern void push_new_variable_scope PARAMS ((void));
|
extern struct variable_set_list *create_new_variable_set PARAMS ((void));
|
||||||
|
extern struct variable_set_list *push_new_variable_scope PARAMS ((void));
|
||||||
extern void pop_variable_scope PARAMS ((void));
|
extern void pop_variable_scope PARAMS ((void));
|
||||||
extern void define_automatic_variables PARAMS ((void));
|
extern void define_automatic_variables PARAMS ((void));
|
||||||
extern void initialize_file_variables PARAMS ((struct file *file));
|
extern void initialize_file_variables PARAMS ((struct file *file));
|
||||||
extern void print_file_variables PARAMS ((struct file *file));
|
extern void print_file_variables PARAMS ((struct file *file));
|
||||||
|
extern void print_variable_set PARAMS ((struct variable_set *set, char *prefix));
|
||||||
extern void merge_variable_set_lists PARAMS ((struct variable_set_list **setlist0, struct variable_set_list *setlist1));
|
extern void merge_variable_set_lists PARAMS ((struct variable_set_list **setlist0, struct variable_set_list *setlist1));
|
||||||
extern struct variable *try_variable_definition PARAMS ((char *filename, unsigned int lineno, char *line, enum variable_origin origin));
|
extern struct variable *try_variable_definition PARAMS ((char *filename, unsigned int lineno, char *line, enum variable_origin origin));
|
||||||
|
|
||||||
extern struct variable *lookup_variable PARAMS ((char *name, unsigned int length));
|
extern struct variable *lookup_variable PARAMS ((char *name, unsigned int length));
|
||||||
extern struct variable *define_variable PARAMS ((char *name, unsigned int length, char *value,
|
extern struct variable *define_variable PARAMS ((char *name, unsigned int length, char *value,
|
||||||
enum variable_origin origin, int recursive));
|
enum variable_origin origin, int recursive));
|
||||||
|
extern struct variable *define_variable_in_set PARAMS ((char *name, unsigned int length,
|
||||||
|
char *value, enum variable_origin origin, int recursive, struct variable_set *set));
|
||||||
extern struct variable *define_variable_for_file PARAMS ((char *name, unsigned int length,
|
extern struct variable *define_variable_for_file PARAMS ((char *name, unsigned int length,
|
||||||
char *value, enum variable_origin origin, int recursive, struct file *file));
|
char *value, enum variable_origin origin, int recursive, struct file *file));
|
||||||
extern char **target_environment PARAMS ((struct file *file));
|
extern char **target_environment PARAMS ((struct file *file));
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
char *version_string = "3.74.4";
|
/* We use <config.h> instead of "config.h" so that a compilation
|
||||||
|
using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h
|
||||||
|
(which it would do because make.h was found in $srcdir). */
|
||||||
|
#include <config.h>
|
||||||
|
|
||||||
|
char *version_string = VERSION;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Local variables:
|
Local variables:
|
||||||
|
|||||||
2
vmsdir.h
2
vmsdir.h
@@ -4,8 +4,10 @@
|
|||||||
|
|
||||||
#define MAXNAMLEN 255
|
#define MAXNAMLEN 255
|
||||||
|
|
||||||
|
#ifndef __DECC
|
||||||
typedef unsigned long u_long;
|
typedef unsigned long u_long;
|
||||||
typedef unsigned short u_short;
|
typedef unsigned short u_short;
|
||||||
|
#endif
|
||||||
|
|
||||||
struct direct {
|
struct direct {
|
||||||
off_t d_off;
|
off_t d_off;
|
||||||
|
|||||||
255
vmsfunctions.c
255
vmsfunctions.c
@@ -1,7 +1,9 @@
|
|||||||
#define KDEBUG 0
|
|
||||||
/* vmsfunctions.c */
|
/* vmsfunctions.c */
|
||||||
|
|
||||||
|
#define KDEBUG 0
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <ctype.h>
|
||||||
#include "make.h"
|
#include "make.h"
|
||||||
#ifdef __DECC
|
#ifdef __DECC
|
||||||
#include <starlet.h>
|
#include <starlet.h>
|
||||||
@@ -13,114 +15,147 @@
|
|||||||
#include <fibdef.h>
|
#include <fibdef.h>
|
||||||
#include "vmsdir.h"
|
#include "vmsdir.h"
|
||||||
|
|
||||||
DIR *opendir(char *dspec)
|
#if __VMS_VER < 70000000
|
||||||
|
|
||||||
|
DIR *
|
||||||
|
opendir (dspec)
|
||||||
|
char *dspec;
|
||||||
{
|
{
|
||||||
static struct FAB *dfab;
|
static struct FAB *dfab;
|
||||||
struct NAM *dnam;
|
struct NAM *dnam;
|
||||||
char *searchspec;
|
char *searchspec;
|
||||||
|
|
||||||
if ((dfab = (struct FAB *)xmalloc(sizeof (struct FAB))) == NULL) {
|
dfab = (struct FAB *) xmalloc (sizeof (struct FAB));
|
||||||
printf("Error mallocing for FAB\n");
|
if (! dfab)
|
||||||
return(NULL);
|
{
|
||||||
}
|
printf ("Error mallocing for FAB\n");
|
||||||
if ((dnam = (struct NAM *)xmalloc(sizeof (struct NAM))) == NULL) {
|
return (NULL);
|
||||||
printf("Error mallocing for NAM\n");
|
}
|
||||||
free(dfab);
|
|
||||||
return(NULL);
|
|
||||||
}
|
|
||||||
if ((searchspec = (char *)xmalloc(MAXNAMLEN+1)) == NULL) {
|
|
||||||
printf("Error mallocing for searchspec\n");
|
|
||||||
free(dfab);
|
|
||||||
free(dnam);
|
|
||||||
return(NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
sprintf(searchspec,"%s*.*;",dspec);
|
dnam = (struct NAM *) xmalloc (sizeof (struct NAM));
|
||||||
|
if (! dnam)
|
||||||
|
{
|
||||||
|
printf ("Error mallocing for NAM\n");
|
||||||
|
free (dfab);
|
||||||
|
return (NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
searchspec = (char *) xmalloc (MAXNAMLEN + 1);
|
||||||
|
if (! searchspec)
|
||||||
|
{
|
||||||
|
printf ("Error mallocing for searchspec\n");
|
||||||
|
free (dfab);
|
||||||
|
free (dnam);
|
||||||
|
return (NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
sprintf (searchspec, "%s*.*;", dspec);
|
||||||
|
|
||||||
*dfab = cc$rms_fab;
|
*dfab = cc$rms_fab;
|
||||||
dfab->fab$l_fna = searchspec;
|
dfab->fab$l_fna = searchspec;
|
||||||
dfab->fab$b_fns = strlen(searchspec);
|
dfab->fab$b_fns = strlen (searchspec);
|
||||||
dfab->fab$l_nam = dnam;
|
dfab->fab$l_nam = dnam;
|
||||||
|
|
||||||
*dnam = cc$rms_nam;
|
*dnam = cc$rms_nam;
|
||||||
dnam->nam$l_esa = searchspec;
|
dnam->nam$l_esa = searchspec;
|
||||||
dnam->nam$b_ess = MAXNAMLEN;
|
dnam->nam$b_ess = MAXNAMLEN;
|
||||||
|
|
||||||
if (!(sys$parse(dfab) & 1)) {
|
if (! (sys$parse (dfab) & 1))
|
||||||
free(dfab);
|
{
|
||||||
free(dnam);
|
free (dfab);
|
||||||
free(searchspec);
|
free (dnam);
|
||||||
return(NULL);
|
free (searchspec);
|
||||||
}
|
return (NULL);
|
||||||
|
}
|
||||||
|
|
||||||
return(dfab);
|
return (dfab);
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <ctype.h>
|
#define uppercasify(str) \
|
||||||
#define uppercasify(str) { char *tmp; for(tmp = (str); *tmp != '\0'; tmp++) if(islower(*tmp)) *tmp = toupper(*tmp); }
|
do \
|
||||||
|
{ \
|
||||||
|
char *tmp; \
|
||||||
|
for (tmp = (str); *tmp != '\0'; tmp++) \
|
||||||
|
if (islower (*tmp)) \
|
||||||
|
*tmp = toupper (*tmp); \
|
||||||
|
} \
|
||||||
|
while (0)
|
||||||
|
|
||||||
struct direct *readdir(DIR *dfd)
|
struct direct *
|
||||||
|
readdir (dfd)
|
||||||
|
DIR * dfd;
|
||||||
{
|
{
|
||||||
static struct direct *dentry;
|
static struct direct *dentry;
|
||||||
static char resultspec[MAXNAMLEN+1];
|
static char resultspec[MAXNAMLEN + 1];
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if ((dentry = (struct direct *)xmalloc(sizeof (struct direct))) == NULL) {
|
dentry = (struct direct *) xmalloc (sizeof (struct direct));
|
||||||
printf("Error mallocing for direct\n");
|
if (! dentry)
|
||||||
return(NULL);
|
{
|
||||||
}
|
printf ("Error mallocing for direct\n");
|
||||||
|
return (NULL);
|
||||||
|
}
|
||||||
|
|
||||||
dfd->fab$l_nam->nam$l_rsa = resultspec;
|
dfd->fab$l_nam->nam$l_rsa = resultspec;
|
||||||
dfd->fab$l_nam->nam$b_rss = MAXNAMLEN;
|
dfd->fab$l_nam->nam$b_rss = MAXNAMLEN;
|
||||||
|
|
||||||
if (debug_flag)
|
if (debug_flag)
|
||||||
printf(".");
|
printf (".");
|
||||||
|
|
||||||
if (!((i = sys$search(dfd)) & 1)) {
|
if (!((i = sys$search (dfd)) & 1))
|
||||||
if (debug_flag)
|
{
|
||||||
printf("sys$search failed with %d\n", i);
|
if (debug_flag)
|
||||||
free(dentry);
|
printf ("sys$search failed with %d\n", i);
|
||||||
return(NULL);
|
free (dentry);
|
||||||
}
|
return (NULL);
|
||||||
|
}
|
||||||
|
|
||||||
dentry->d_off = 0;
|
dentry->d_off = 0;
|
||||||
if (dfd->fab$l_nam->nam$w_fid == 0)
|
if (dfd->fab$l_nam->nam$w_fid == 0)
|
||||||
dentry->d_fileno = 1;
|
dentry->d_fileno = 1;
|
||||||
else dentry->d_fileno = dfd->fab$l_nam->nam$w_fid[0]
|
else
|
||||||
+dfd->fab$l_nam->nam$w_fid[1]<<16;
|
dentry->d_fileno = dfd->fab$l_nam->nam$w_fid[0]
|
||||||
|
+ dfd->fab$l_nam->nam$w_fid[1] << 16;
|
||||||
dentry->d_reclen = sizeof (struct direct);
|
dentry->d_reclen = sizeof (struct direct);
|
||||||
/*
|
#if 0
|
||||||
if (!strcmp(dfd->fab$l_nam->nam$l_type,".DIR"))
|
if (!strcmp(dfd->fab$l_nam->nam$l_type, ".DIR"))
|
||||||
dentry->d_namlen = dfd->fab$l_nam->nam$b_name;
|
dentry->d_namlen = dfd->fab$l_nam->nam$b_name;
|
||||||
else
|
else
|
||||||
*/
|
#endif
|
||||||
dentry->d_namlen = dfd->fab$l_nam->nam$b_name+dfd->fab$l_nam->nam$b_type;
|
dentry->d_namlen = dfd->fab$l_nam->nam$b_name + dfd->fab$l_nam->nam$b_type;
|
||||||
strncpy(dentry->d_name,dfd->fab$l_nam->nam$l_name,dentry->d_namlen);
|
strncpy (dentry->d_name, dfd->fab$l_nam->nam$l_name, dentry->d_namlen);
|
||||||
dentry->d_name[dentry->d_namlen] = '\0';
|
dentry->d_name[dentry->d_namlen] = '\0';
|
||||||
uppercasify(dentry->d_name);
|
uppercasify (dentry->d_name);
|
||||||
/* uvUnFixRCSSeparator(dentry->d_name);*/
|
#if 0
|
||||||
|
uvUnFixRCSSeparator(dentry->d_name);
|
||||||
|
#endif
|
||||||
|
|
||||||
return(dentry);
|
return (dentry);
|
||||||
}
|
}
|
||||||
|
|
||||||
closedir(DIR *dfd)
|
closedir (dfd)
|
||||||
|
DIR *dfd;
|
||||||
{
|
{
|
||||||
if (dfd != NULL) {
|
if (dfd)
|
||||||
if (dfd->fab$l_nam != NULL)
|
{
|
||||||
free(dfd->fab$l_nam->nam$l_esa);
|
if (dfd->fab$l_nam)
|
||||||
free(dfd->fab$l_nam);
|
free (dfd->fab$l_nam->nam$l_esa);
|
||||||
free(dfd);
|
free (dfd->fab$l_nam);
|
||||||
}
|
free (dfd);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
#endif /* compiled for OpenVMS prior to V7.x */
|
||||||
|
|
||||||
char *getwd(char *cwd)
|
char *
|
||||||
|
getwd (cwd)
|
||||||
|
char *cwd;
|
||||||
{
|
{
|
||||||
static char buf[512];
|
static char buf[512];
|
||||||
|
|
||||||
if (cwd)
|
if (cwd)
|
||||||
return(getcwd(cwd,512));
|
return (getcwd (cwd, 512));
|
||||||
else
|
else
|
||||||
return(getcwd(buf,512));
|
return (getcwd (buf, 512));
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
@@ -133,23 +168,33 @@ vms_stat (name, buf)
|
|||||||
|
|
||||||
static struct FAB Fab;
|
static struct FAB Fab;
|
||||||
static struct NAM Nam;
|
static struct NAM Nam;
|
||||||
static struct fibdef Fib; /* short fib */
|
static struct fibdef Fib; /* short fib */
|
||||||
static struct dsc$descriptor FibDesc =
|
static struct dsc$descriptor FibDesc =
|
||||||
{sizeof(Fib), DSC$K_DTYPE_Z, DSC$K_CLASS_S, (char *)&Fib};
|
{ sizeof (Fib), DSC$K_DTYPE_Z, DSC$K_CLASS_S, (char *) &Fib };
|
||||||
static struct dsc$descriptor_s DevDesc =
|
static struct dsc$descriptor_s DevDesc =
|
||||||
{0, DSC$K_DTYPE_T, DSC$K_CLASS_S, &Nam.nam$t_dvi[1]};
|
{ 0, DSC$K_DTYPE_T, DSC$K_CLASS_S, &Nam.nam$t_dvi[1] };
|
||||||
static char EName[NAM$C_MAXRSS];
|
static char EName[NAM$C_MAXRSS];
|
||||||
static char RName[NAM$C_MAXRSS];
|
static char RName[NAM$C_MAXRSS];
|
||||||
static struct dsc$descriptor_s FileName =
|
static struct dsc$descriptor_s FileName =
|
||||||
{0, DSC$K_DTYPE_T, DSC$K_CLASS_S, 0};
|
{ 0, DSC$K_DTYPE_T, DSC$K_CLASS_S, 0 };
|
||||||
static struct dsc$descriptor_s string =
|
static struct dsc$descriptor_s string =
|
||||||
{0, DSC$K_DTYPE_T, DSC$K_CLASS_S, 0};
|
{ 0, DSC$K_DTYPE_T, DSC$K_CLASS_S, 0 };
|
||||||
static unsigned long Rdate[2];
|
static unsigned long Rdate[2];
|
||||||
static unsigned long Cdate[2];
|
static unsigned long Cdate[2];
|
||||||
static struct atrdef Atr[] = {
|
static struct atrdef Atr[] =
|
||||||
{sizeof(Rdate),ATR$C_REVDATE,&Rdate[0]}, /* Revision date */
|
{
|
||||||
{sizeof(Cdate),ATR$C_CREDATE,&Cdate[0]}, /* Creation date */
|
#if defined(VAX)
|
||||||
{0,0,0}
|
/* Revision date */
|
||||||
|
{ sizeof (Rdate), ATR$C_REVDATE, (unsigned int) &Rdate[0] },
|
||||||
|
/* Creation date */
|
||||||
|
{ sizeof (Cdate), ATR$C_CREDATE, (unsigned int) &Cdate[0] },
|
||||||
|
#else
|
||||||
|
/* Revision date */
|
||||||
|
{ sizeof (Rdate), ATR$C_REVDATE, &Rdate[0] },
|
||||||
|
/* Creation date */
|
||||||
|
{ sizeof (Cdate), ATR$C_CREDATE, &Cdate[0]},
|
||||||
|
#endif
|
||||||
|
{ 0, 0, 0 }
|
||||||
};
|
};
|
||||||
static short int DevChan;
|
static short int DevChan;
|
||||||
static short int iosb[4];
|
static short int iosb[4];
|
||||||
@@ -158,43 +203,44 @@ vms_stat (name, buf)
|
|||||||
|
|
||||||
/* initialize RMS structures, we need a NAM to retrieve the FID */
|
/* initialize RMS structures, we need a NAM to retrieve the FID */
|
||||||
Fab = cc$rms_fab;
|
Fab = cc$rms_fab;
|
||||||
Fab.fab$l_fna = name ; /* name of file */
|
Fab.fab$l_fna = name; /* name of file */
|
||||||
Fab.fab$b_fns = strlen(name);
|
Fab.fab$b_fns = strlen (name);
|
||||||
Fab.fab$l_nam = &Nam; /* FAB has an associated NAM */
|
Fab.fab$l_nam = &Nam; /* FAB has an associated NAM */
|
||||||
|
|
||||||
Nam = cc$rms_nam;
|
Nam = cc$rms_nam;
|
||||||
Nam.nam$l_esa = EName; /* expanded filename */
|
Nam.nam$l_esa = EName; /* expanded filename */
|
||||||
Nam.nam$b_ess = sizeof(EName);
|
Nam.nam$b_ess = sizeof (EName);
|
||||||
Nam.nam$l_rsa = RName; /* resultant filename */
|
Nam.nam$l_rsa = RName; /* resultant filename */
|
||||||
Nam.nam$b_rss = sizeof(RName);
|
Nam.nam$b_rss = sizeof (RName);
|
||||||
|
|
||||||
/* do $PARSE and $SEARCH here */
|
/* do $PARSE and $SEARCH here */
|
||||||
status = sys$parse(&Fab);
|
status = sys$parse (&Fab);
|
||||||
if (!(status & 1))
|
if (!(status & 1))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
DevDesc.dsc$w_length = Nam.nam$t_dvi[0];
|
DevDesc.dsc$w_length = Nam.nam$t_dvi[0];
|
||||||
status = sys$assign(&DevDesc,&DevChan,0,0);
|
status = sys$assign (&DevDesc, &DevChan, 0, 0);
|
||||||
if (!(status & 1))
|
if (!(status & 1))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
FileName.dsc$a_pointer = Nam.nam$l_name;
|
FileName.dsc$a_pointer = Nam.nam$l_name;
|
||||||
FileName.dsc$w_length = Nam.nam$b_name+Nam.nam$b_type+Nam.nam$b_ver;
|
FileName.dsc$w_length = Nam.nam$b_name + Nam.nam$b_type + Nam.nam$b_ver;
|
||||||
|
|
||||||
/* Initialize the FIB */
|
/* Initialize the FIB */
|
||||||
for (i=0;i<3;i++)
|
for (i = 0; i < 3; i++)
|
||||||
{
|
{
|
||||||
#if __DECC
|
#if __DECC
|
||||||
Fib.fib$w_fid[i]=Nam.nam$w_fid[i];
|
Fib.fib$w_fid[i] = Nam.nam$w_fid[i];
|
||||||
Fib.fib$w_did[i]=Nam.nam$w_did[i];
|
Fib.fib$w_did[i] = Nam.nam$w_did[i];
|
||||||
#else
|
#else
|
||||||
Fib.fib$r_fid_overlay.fib$w_fid[i]=Nam.nam$w_fid[i];
|
Fib.fib$r_fid_overlay.fib$w_fid[i] = Nam.nam$w_fid[i];
|
||||||
Fib.fib$r_did_overlay.fib$w_did[i]=Nam.nam$w_did[i];
|
Fib.fib$r_did_overlay.fib$w_did[i] = Nam.nam$w_did[i];
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
status = sys$qiow(0,DevChan,IO$_ACCESS,&iosb,0,0,
|
status = sys$qiow (0, DevChan, IO$_ACCESS, &iosb, 0, 0,
|
||||||
&FibDesc,&FileName,0,0,&Atr,0);
|
&FibDesc, &FileName, 0, 0, &Atr, 0);
|
||||||
|
sys$dassgn (DevChan);
|
||||||
if (!(status & 1))
|
if (!(status & 1))
|
||||||
return -1;
|
return -1;
|
||||||
status = iosb[0];
|
status = iosb[0];
|
||||||
@@ -205,30 +251,29 @@ vms_stat (name, buf)
|
|||||||
if (status)
|
if (status)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
buf->st_mtime = ((Rdate[0]>>24) & 0xff) + ((Rdate[1]<<8) & 0xffffff00);
|
buf->st_mtime = ((Rdate[0] >> 24) & 0xff) + ((Rdate[1] << 8) & 0xffffff00);
|
||||||
buf->st_ctime = ((Cdate[0]>>24) & 0xff) + ((Cdate[1]<<8) & 0xffffff00);
|
buf->st_ctime = ((Cdate[0] >> 24) & 0xff) + ((Cdate[1] << 8) & 0xffffff00);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
char *
|
||||||
cvt_time(tval)
|
cvt_time (tval)
|
||||||
unsigned long tval;
|
unsigned long tval;
|
||||||
{
|
{
|
||||||
static long int date[2];
|
static long int date[2];
|
||||||
static char str[27];
|
static char str[27];
|
||||||
static struct dsc$descriptor date_str =
|
static struct dsc$descriptor date_str =
|
||||||
{26, DSC$K_DTYPE_T, DSC$K_CLASS_S, str};
|
{ 26, DSC$K_DTYPE_T, DSC$K_CLASS_S, str };
|
||||||
|
|
||||||
date[0] = (tval & 0xff) << 24;
|
date[0] = (tval & 0xff) << 24;
|
||||||
date[1] = ((tval>>8) & 0xffffff);
|
date[1] = ((tval >> 8) & 0xffffff);
|
||||||
|
|
||||||
if ((date[0]==0) && (date[1]==0))
|
if ((date[0] == 0) && (date[1] == 0))
|
||||||
return("never");
|
return ("never");
|
||||||
|
|
||||||
sys$asctim(0,&date_str,date,0);
|
|
||||||
str[26]='\0';
|
|
||||||
|
|
||||||
return(str);
|
sys$asctim (0, &date_str, date, 0);
|
||||||
|
str[26] = '\0';
|
||||||
|
|
||||||
|
return (str);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* EOF */
|
|
||||||
|
|||||||
157
vmsify.c
157
vmsify.c
@@ -3,7 +3,8 @@
|
|||||||
|
|
||||||
Module for vms <-> unix file name conversion
|
Module for vms <-> unix file name conversion
|
||||||
|
|
||||||
Written by Klaus Kämpf (kkaempf@didymus.rmi.de)
|
Written by Klaus Kämpf (kkaempf@progis.de)
|
||||||
|
of proGIS Software, Aachen, Germany
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -329,9 +330,9 @@ vmsify (name, type)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
strcpy (vptr, "[.");
|
strcpy (vptr, "[.");
|
||||||
nstate = N_DOT;
|
|
||||||
vptr += 2;
|
vptr += 2;
|
||||||
copyto (&vptr, &fptr, '/', 1);
|
copyto (&vptr, &fptr, '/', 1);
|
||||||
|
nstate = N_OPEN;
|
||||||
state = 9;
|
state = 9;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -726,47 +727,21 @@ vmsify (name, type)
|
|||||||
while (*fptr == '/');
|
while (*fptr == '/');
|
||||||
}
|
}
|
||||||
{ /* got '..' or '../' */
|
{ /* got '..' or '../' */
|
||||||
char cwdbuf[MAXPATHLEN+1];
|
nstate = N_OPEN;
|
||||||
|
*vptr++ = '[';
|
||||||
|
while (count--)
|
||||||
|
*vptr++ = '-';
|
||||||
|
|
||||||
s1 = getcwd(cwdbuf, MAXPATHLEN);
|
if (*fptr == 0) /* had '..' or '../' */
|
||||||
if (s1 == 0)
|
|
||||||
{
|
{
|
||||||
return ""; /* FIXME, err getcwd */
|
*vptr++ = ']';
|
||||||
|
state = -1;
|
||||||
}
|
}
|
||||||
strcpy (vptr, s1);
|
else /* had '../xxx' */
|
||||||
s = strchr (vptr, ']');
|
|
||||||
if (s != 0)
|
|
||||||
{
|
{
|
||||||
while (s > vptr)
|
state = 9;
|
||||||
{
|
|
||||||
s--;
|
|
||||||
if (*s == '[')
|
|
||||||
{
|
|
||||||
s++;
|
|
||||||
strcpy (s, "000000]");
|
|
||||||
state = -1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
else if (*s == '.')
|
|
||||||
{
|
|
||||||
if (--count == 0)
|
|
||||||
{
|
|
||||||
if (*fptr == 0) /* had '..' or '../' */
|
|
||||||
{
|
|
||||||
*s++ = ']';
|
|
||||||
state = -1;
|
|
||||||
}
|
|
||||||
else /* had '../xxx' */
|
|
||||||
{
|
|
||||||
state = 9;
|
|
||||||
}
|
|
||||||
*s = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
vptr += strlen (vptr);
|
*vptr = 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -780,34 +755,86 @@ vmsify (name, type)
|
|||||||
fptr++;
|
fptr++;
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
if (*fptr)
|
||||||
char cwdbuf[MAXPATHLEN+1];
|
{
|
||||||
|
state = 9;
|
||||||
|
|
||||||
s1 = getcwd(cwdbuf, MAXPATHLEN);
|
switch (type)
|
||||||
if (s1 == 0)
|
{
|
||||||
{
|
case 0:
|
||||||
return ""; /*FIXME, err getcwd */
|
nstate = N_CLOSED;
|
||||||
}
|
*vptr++ = '[';
|
||||||
strcpy (vptr, s1);
|
*vptr++ = ']';
|
||||||
if (*fptr == 0)
|
break;
|
||||||
{
|
|
||||||
state = -1;
|
case 1:
|
||||||
break;
|
nstate = N_OPEN;
|
||||||
}
|
*vptr++ = '[';
|
||||||
else
|
break;
|
||||||
{
|
|
||||||
s = strchr (vptr, ']');
|
case 2:
|
||||||
if (s == 0)
|
nstate = N_CLOSED;
|
||||||
{
|
break;
|
||||||
state = -1;
|
}
|
||||||
break;
|
}
|
||||||
}
|
else
|
||||||
*s = 0;
|
{
|
||||||
nstate = N_OPEN;
|
if (type == 1)
|
||||||
vptr += strlen (vptr);
|
{
|
||||||
state = 9;
|
*vptr++ = '[';
|
||||||
}
|
*vptr++ = ']';
|
||||||
}
|
state = -1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
char cwdbuf[MAXPATHLEN+1];
|
||||||
|
|
||||||
|
s1 = getcwd(cwdbuf, MAXPATHLEN);
|
||||||
|
if (s1 == 0)
|
||||||
|
{
|
||||||
|
return "foo"; /*FIXME, err getcwd */
|
||||||
|
}
|
||||||
|
strcpy (vptr, s1);
|
||||||
|
vptr += strlen (vptr);
|
||||||
|
|
||||||
|
if (type == 2)
|
||||||
|
{
|
||||||
|
s = vptr;
|
||||||
|
while (s > vmsname)
|
||||||
|
{
|
||||||
|
if (*s == '.')
|
||||||
|
{
|
||||||
|
*s = ']';
|
||||||
|
vptr--;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (*s == '[')
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
char *t = vptr - 2;
|
||||||
|
while (t > s)
|
||||||
|
{
|
||||||
|
*(t+7) = *t;
|
||||||
|
t--;
|
||||||
|
}
|
||||||
|
s++;
|
||||||
|
for (i = 0; i < 6; i++)
|
||||||
|
*s++ = '0';
|
||||||
|
*s = ']';
|
||||||
|
vptr += 6;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
s--;
|
||||||
|
}
|
||||||
|
|
||||||
|
strcpy (vptr, ".dir");
|
||||||
|
vptr += 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
state = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
128
vpath.c
128
vpath.c
@@ -1,5 +1,5 @@
|
|||||||
/* Implementation of pattern-matching file search paths for GNU Make.
|
/* Implementation of pattern-matching file search paths for GNU Make.
|
||||||
Copyright (C) 1988, 89, 91, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
|
Copyright (C) 1988,89,91,92,93,94,95,96,97 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
|
||||||
@@ -19,7 +19,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||||||
#include "make.h"
|
#include "make.h"
|
||||||
#include "filedef.h"
|
#include "filedef.h"
|
||||||
#include "variable.h"
|
#include "variable.h"
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
#include "pathstuff.h"
|
#include "pathstuff.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -43,6 +43,10 @@ static struct vpath *vpaths;
|
|||||||
/* Structure for the general VPATH given in the variable. */
|
/* Structure for the general VPATH given in the variable. */
|
||||||
|
|
||||||
static struct vpath *general_vpath;
|
static struct vpath *general_vpath;
|
||||||
|
|
||||||
|
/* Structure for GPATH given in the variable. */
|
||||||
|
|
||||||
|
static struct vpath *gpaths;
|
||||||
|
|
||||||
static int selective_vpath_search PARAMS ((struct vpath *path, char **file, time_t *mtime_ptr));
|
static int selective_vpath_search PARAMS ((struct vpath *path, char **file, time_t *mtime_ptr));
|
||||||
|
|
||||||
@@ -98,6 +102,38 @@ build_vpath_lists ()
|
|||||||
general_vpath = vpaths;
|
general_vpath = vpaths;
|
||||||
vpaths = save_vpaths;
|
vpaths = save_vpaths;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If there is a GPATH variable with a nonnull value, construct the
|
||||||
|
GPATH list from it. We use variable_expand rather than just
|
||||||
|
calling lookup_variable so that it will be recursively expanded. */
|
||||||
|
|
||||||
|
{
|
||||||
|
/* Turn off --warn-undefined-variables while we expand SHELL and IFS. */
|
||||||
|
int save = warn_undefined_variables_flag;
|
||||||
|
warn_undefined_variables_flag = 0;
|
||||||
|
|
||||||
|
p = variable_expand ("$(strip $(GPATH))");
|
||||||
|
|
||||||
|
warn_undefined_variables_flag = save;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (*p != '\0')
|
||||||
|
{
|
||||||
|
/* Save the list of vpaths. */
|
||||||
|
struct vpath *save_vpaths = vpaths;
|
||||||
|
|
||||||
|
/* Empty `vpaths' so the new one will have no next, and `vpaths'
|
||||||
|
will still be nil if P contains no existing directories. */
|
||||||
|
vpaths = 0;
|
||||||
|
|
||||||
|
/* Parse P. */
|
||||||
|
construct_vpath_list ("%", p);
|
||||||
|
|
||||||
|
/* Store the created path as the GPATH,
|
||||||
|
and restore the old list of vpaths. */
|
||||||
|
gpaths = vpaths;
|
||||||
|
vpaths = save_vpaths;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Construct the VPATH listing for the pattern and searchpath given.
|
/* Construct the VPATH listing for the pattern and searchpath given.
|
||||||
@@ -109,14 +145,15 @@ build_vpath_lists ()
|
|||||||
variable.
|
variable.
|
||||||
|
|
||||||
If SEARCHPATH is nil, remove all previous listings with the same
|
If SEARCHPATH is nil, remove all previous listings with the same
|
||||||
pattern. If PATTERN is nil, remove all VPATH listings.
|
pattern. If PATTERN is nil, remove all VPATH listings. Existing
|
||||||
Existing and readable directories that are not "." given in the
|
and readable directories that are not "." given in the searchpath
|
||||||
searchpath separated by colons are loaded into the directory hash
|
separated by the path element separator (defined in make.h) are
|
||||||
table if they are not there already and put in the VPATH searchpath
|
loaded into the directory hash table if they are not there already
|
||||||
for the given pattern with trailing slashes stripped off if present
|
and put in the VPATH searchpath for the given pattern with trailing
|
||||||
(and if the directory is not the root, "/").
|
slashes stripped off if present (and if the directory is not the
|
||||||
The length of the longest entry in the list is put in the structure as well.
|
root, "/"). The length of the longest entry in the list is put in
|
||||||
The new entry will be at the head of the VPATHS chain. */
|
the structure as well. The new entry will be at the head of the
|
||||||
|
VPATHS chain. */
|
||||||
|
|
||||||
void
|
void
|
||||||
construct_vpath_list (pattern, dirpath)
|
construct_vpath_list (pattern, dirpath)
|
||||||
@@ -127,7 +164,7 @@ construct_vpath_list (pattern, dirpath)
|
|||||||
register char **vpath;
|
register char **vpath;
|
||||||
register unsigned int maxvpath;
|
register unsigned int maxvpath;
|
||||||
unsigned int maxelem;
|
unsigned int maxelem;
|
||||||
char *percent;
|
char *percent = NULL;
|
||||||
|
|
||||||
if (pattern != 0)
|
if (pattern != 0)
|
||||||
{
|
{
|
||||||
@@ -173,14 +210,14 @@ construct_vpath_list (pattern, dirpath)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
convert_vpath_to_win32(dirpath, ';');
|
convert_vpath_to_windows32(dirpath, ';');
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Figure out the maximum number of VPATH entries and
|
/* Figure out the maximum number of VPATH entries and put it in
|
||||||
put it in MAXELEM. We start with 2, one before the
|
MAXELEM. We start with 2, one before the first separator and one
|
||||||
first colon and one nil, the list terminator and
|
nil (the list terminator) and increment our estimated number for
|
||||||
increment our estimated number for each colon or blank we find. */
|
each separator or blank we find. */
|
||||||
maxelem = 2;
|
maxelem = 2;
|
||||||
p = dirpath;
|
p = dirpath;
|
||||||
while (*p != '\0')
|
while (*p != '\0')
|
||||||
@@ -190,7 +227,7 @@ construct_vpath_list (pattern, dirpath)
|
|||||||
vpath = (char **) xmalloc (maxelem * sizeof (char *));
|
vpath = (char **) xmalloc (maxelem * sizeof (char *));
|
||||||
maxvpath = 0;
|
maxvpath = 0;
|
||||||
|
|
||||||
/* Skip over any initial colons and blanks. */
|
/* Skip over any initial separators and blanks. */
|
||||||
p = dirpath;
|
p = dirpath;
|
||||||
while (*p == PATH_SEPARATOR_CHAR || isblank (*p))
|
while (*p == PATH_SEPARATOR_CHAR || isblank (*p))
|
||||||
++p;
|
++p;
|
||||||
@@ -209,6 +246,10 @@ construct_vpath_list (pattern, dirpath)
|
|||||||
len = p - v;
|
len = p - v;
|
||||||
/* Make sure there's no trailing slash,
|
/* Make sure there's no trailing slash,
|
||||||
but still allow "/" as a directory. */
|
but still allow "/" as a directory. */
|
||||||
|
#ifdef __MSDOS__
|
||||||
|
/* We need also to leave alone a trailing slash in "d:/". */
|
||||||
|
if (len > 3 || (len > 1 && v[1] != ':'))
|
||||||
|
#endif
|
||||||
if (len > 1 && p[-1] == '/')
|
if (len > 1 && p[-1] == '/')
|
||||||
--len;
|
--len;
|
||||||
|
|
||||||
@@ -231,7 +272,7 @@ construct_vpath_list (pattern, dirpath)
|
|||||||
free (v);
|
free (v);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Skip over colons and blanks between entries. */
|
/* Skip over separators and blanks between entries. */
|
||||||
while (*p == PATH_SEPARATOR_CHAR || isblank (*p))
|
while (*p == PATH_SEPARATOR_CHAR || isblank (*p))
|
||||||
++p;
|
++p;
|
||||||
}
|
}
|
||||||
@@ -270,6 +311,24 @@ construct_vpath_list (pattern, dirpath)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Search the GPATH list for a pathname string that matches the one passed
|
||||||
|
in. If it is found, return 1. Otherwise we return 0. */
|
||||||
|
|
||||||
|
int
|
||||||
|
gpath_search (file, len)
|
||||||
|
char *file;
|
||||||
|
int len;
|
||||||
|
{
|
||||||
|
register char **gp;
|
||||||
|
|
||||||
|
if (gpaths && (len <= gpaths->maxlen))
|
||||||
|
for (gp = gpaths->searchpath; *gp != NULL; ++gp)
|
||||||
|
if (!strncmp(*gp, file, len) && (*gp)[len] == '\0')
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* Search the VPATH list whose pattern matches *FILE for a directory
|
/* Search the VPATH list whose pattern matches *FILE for a directory
|
||||||
where the name pointed to by FILE exists. If it is found, we set *FILE to
|
where the name pointed to by FILE exists. If it is found, we set *FILE to
|
||||||
the newly malloc'd name of the existing file, *MTIME_PTR (if MTIME_PTR is
|
the newly malloc'd name of the existing file, *MTIME_PTR (if MTIME_PTR is
|
||||||
@@ -287,8 +346,8 @@ vpath_search (file, mtime_ptr)
|
|||||||
there is nothing we can do. */
|
there is nothing we can do. */
|
||||||
|
|
||||||
if (**file == '/'
|
if (**file == '/'
|
||||||
#ifdef WIN32
|
#if defined (WINDOWS32) || defined (__MSDOS__)
|
||||||
|| **file == '\\'
|
|| **file == '\\'
|
||||||
|| (*file)[1] == ':'
|
|| (*file)[1] == ':'
|
||||||
#endif
|
#endif
|
||||||
|| (vpaths == 0 && general_vpath == 0))
|
|| (vpaths == 0 && general_vpath == 0))
|
||||||
@@ -343,9 +402,13 @@ selective_vpath_search (path, file, mtime_ptr)
|
|||||||
pointer to the name-within-directory and FLEN is its length. */
|
pointer to the name-within-directory and FLEN is its length. */
|
||||||
|
|
||||||
n = rindex (*file, '/');
|
n = rindex (*file, '/');
|
||||||
#ifdef WIN32
|
#if defined (WINDOWS32) || defined (__MSDOS__)
|
||||||
if (!n)
|
/* We need the rightmost slash or backslash. */
|
||||||
n = rindex(*file,, '\\');
|
{
|
||||||
|
char *bslash = rindex(*file, '\\');
|
||||||
|
if (!n || bslash > n)
|
||||||
|
n = bslash;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
name_dplen = n != 0 ? n - *file : 0;
|
name_dplen = n != 0 ? n - *file : 0;
|
||||||
filename = name_dplen > 0 ? n + 1 : *file;
|
filename = name_dplen > 0 ? n + 1 : *file;
|
||||||
@@ -373,18 +436,27 @@ selective_vpath_search (path, file, mtime_ptr)
|
|||||||
/* Add the directory prefix already in *FILE. */
|
/* Add the directory prefix already in *FILE. */
|
||||||
if (name_dplen > 0)
|
if (name_dplen > 0)
|
||||||
{
|
{
|
||||||
|
#ifndef VMS
|
||||||
*n++ = '/';
|
*n++ = '/';
|
||||||
|
#endif
|
||||||
bcopy (*file, n, name_dplen);
|
bcopy (*file, n, name_dplen);
|
||||||
n += name_dplen;
|
n += name_dplen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined (WINDOWS32) || defined (__MSDOS__)
|
||||||
|
/* Cause the next if to treat backslash and slash alike. */
|
||||||
|
if (n != name && n[-1] == '\\' )
|
||||||
|
n[-1] = '/';
|
||||||
|
#endif
|
||||||
/* Now add the name-within-directory at the end of NAME. */
|
/* Now add the name-within-directory at the end of NAME. */
|
||||||
|
#ifndef VMS
|
||||||
if (n != name && n[-1] != '/')
|
if (n != name && n[-1] != '/')
|
||||||
{
|
{
|
||||||
*n = '/';
|
*n = '/';
|
||||||
bcopy (filename, n + 1, flen + 1);
|
bcopy (filename, n + 1, flen + 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
#endif
|
||||||
bcopy (filename, n, flen + 1);
|
bcopy (filename, n, flen + 1);
|
||||||
|
|
||||||
/* Check if the file is mentioned in a makefile. If *FILE is not
|
/* Check if the file is mentioned in a makefile. If *FILE is not
|
||||||
@@ -397,7 +469,7 @@ selective_vpath_search (path, file, mtime_ptr)
|
|||||||
inadequately commented change in July 1990; I am not sure off
|
inadequately commented change in July 1990; I am not sure off
|
||||||
hand what problem it fixes.
|
hand what problem it fixes.
|
||||||
|
|
||||||
In December 1993 I loosened of this restriction to allow a file
|
In December 1993 I loosened this restriction to allow a file
|
||||||
to be chosen if it is mentioned as a target in a makefile. This
|
to be chosen if it is mentioned as a target in a makefile. This
|
||||||
seem logical. */
|
seem logical. */
|
||||||
{
|
{
|
||||||
@@ -411,6 +483,9 @@ selective_vpath_search (path, file, mtime_ptr)
|
|||||||
/* That file wasn't mentioned in the makefile.
|
/* That file wasn't mentioned in the makefile.
|
||||||
See if it actually exists. */
|
See if it actually exists. */
|
||||||
|
|
||||||
|
#ifdef VMS
|
||||||
|
exists_in_cache = exists = dir_file_exists_p (vpath[i], filename);
|
||||||
|
#else
|
||||||
/* Clobber a null into the name at the last slash.
|
/* Clobber a null into the name at the last slash.
|
||||||
Now NAME is the name of the directory to look in. */
|
Now NAME is the name of the directory to look in. */
|
||||||
*n = '\0';
|
*n = '\0';
|
||||||
@@ -419,6 +494,7 @@ selective_vpath_search (path, file, mtime_ptr)
|
|||||||
construct_vpath_list or the code just above put it there.
|
construct_vpath_list or the code just above put it there.
|
||||||
Does the file we seek exist in it? */
|
Does the file we seek exist in it? */
|
||||||
exists_in_cache = exists = dir_file_exists_p (name, filename);
|
exists_in_cache = exists = dir_file_exists_p (name, filename);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (exists)
|
if (exists)
|
||||||
@@ -431,8 +507,10 @@ selective_vpath_search (path, file, mtime_ptr)
|
|||||||
|
|
||||||
struct stat st;
|
struct stat st;
|
||||||
|
|
||||||
|
#ifndef VMS
|
||||||
/* Put the slash back in NAME. */
|
/* Put the slash back in NAME. */
|
||||||
*n = '/';
|
*n = '/';
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!exists_in_cache /* Makefile-mentioned file need not exist. */
|
if (!exists_in_cache /* Makefile-mentioned file need not exist. */
|
||||||
|| stat (name, &st) == 0) /* Does it really exist? */
|
|| stat (name, &st) == 0) /* Does it really exist? */
|
||||||
|
|||||||
@@ -1,188 +1,188 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "dirent.h"
|
#include "dirent.h"
|
||||||
|
|
||||||
|
|
||||||
DIR*
|
DIR*
|
||||||
opendir(const char* pDirName)
|
opendir(const char* pDirName)
|
||||||
{
|
{
|
||||||
struct stat sb;
|
struct stat sb;
|
||||||
DIR* pDir;
|
DIR* pDir;
|
||||||
char* pEndDirName;
|
char* pEndDirName;
|
||||||
int nBufferLen;
|
int nBufferLen;
|
||||||
|
|
||||||
/* sanity checks */
|
/* sanity checks */
|
||||||
if (!pDirName) {
|
if (!pDirName) {
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (stat(pDirName, &sb) != 0) {
|
if (stat(pDirName, &sb) != 0) {
|
||||||
errno = ENOENT;
|
errno = ENOENT;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if ((sb.st_mode & S_IFMT) != S_IFDIR) {
|
if ((sb.st_mode & S_IFMT) != S_IFDIR) {
|
||||||
errno = ENOTDIR;
|
errno = ENOTDIR;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* allocate a DIR structure to return */
|
/* allocate a DIR structure to return */
|
||||||
pDir = (DIR *) malloc(sizeof (DIR));
|
pDir = (DIR *) malloc(sizeof (DIR));
|
||||||
|
|
||||||
if (!pDir)
|
if (!pDir)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
/* input directory name length */
|
/* input directory name length */
|
||||||
nBufferLen = strlen(pDirName);
|
nBufferLen = strlen(pDirName);
|
||||||
|
|
||||||
/* copy input directory name to DIR buffer */
|
/* copy input directory name to DIR buffer */
|
||||||
strcpy(pDir->dir_pDirectoryName, pDirName);
|
strcpy(pDir->dir_pDirectoryName, pDirName);
|
||||||
|
|
||||||
/* point to end of the copied directory name */
|
/* point to end of the copied directory name */
|
||||||
pEndDirName = &pDir->dir_pDirectoryName[nBufferLen - 1];
|
pEndDirName = &pDir->dir_pDirectoryName[nBufferLen - 1];
|
||||||
|
|
||||||
/* if directory name did not end in '/' or '\', add '/' */
|
/* if directory name did not end in '/' or '\', add '/' */
|
||||||
if ((*pEndDirName != '/') && (*pEndDirName != '\\')) {
|
if ((*pEndDirName != '/') && (*pEndDirName != '\\')) {
|
||||||
pEndDirName++;
|
pEndDirName++;
|
||||||
*pEndDirName = '/';
|
*pEndDirName = '/';
|
||||||
}
|
}
|
||||||
|
|
||||||
/* now append the wildcard character to the buffer */
|
/* now append the wildcard character to the buffer */
|
||||||
pEndDirName++;
|
pEndDirName++;
|
||||||
*pEndDirName = '*';
|
*pEndDirName = '*';
|
||||||
pEndDirName++;
|
pEndDirName++;
|
||||||
*pEndDirName = '\0';
|
*pEndDirName = '\0';
|
||||||
|
|
||||||
/* other values defaulted */
|
/* other values defaulted */
|
||||||
pDir->dir_nNumFiles = 0;
|
pDir->dir_nNumFiles = 0;
|
||||||
pDir->dir_hDirHandle = INVALID_HANDLE_VALUE;
|
pDir->dir_hDirHandle = INVALID_HANDLE_VALUE;
|
||||||
pDir->dir_ulCookie = __DIRENT_COOKIE;
|
pDir->dir_ulCookie = __DIRENT_COOKIE;
|
||||||
|
|
||||||
return pDir;
|
return pDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
closedir(DIR *pDir)
|
closedir(DIR *pDir)
|
||||||
{
|
{
|
||||||
/* got a valid pointer? */
|
/* got a valid pointer? */
|
||||||
if (!pDir) {
|
if (!pDir) {
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* sanity check that this is a DIR pointer */
|
/* sanity check that this is a DIR pointer */
|
||||||
if (pDir->dir_ulCookie != __DIRENT_COOKIE) {
|
if (pDir->dir_ulCookie != __DIRENT_COOKIE) {
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* close the WIN32 directory handle */
|
/* close the WINDOWS32 directory handle */
|
||||||
if (pDir->dir_hDirHandle != INVALID_HANDLE_VALUE)
|
if (pDir->dir_hDirHandle != INVALID_HANDLE_VALUE)
|
||||||
FindClose(pDir->dir_hDirHandle);
|
FindClose(pDir->dir_hDirHandle);
|
||||||
|
|
||||||
free(pDir);
|
free(pDir);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct dirent *
|
struct dirent *
|
||||||
readdir(DIR* pDir)
|
readdir(DIR* pDir)
|
||||||
{
|
{
|
||||||
WIN32_FIND_DATA wfdFindData;
|
WIN32_FIND_DATA wfdFindData;
|
||||||
|
|
||||||
if (!pDir) {
|
if (!pDir) {
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* sanity check that this is a DIR pointer */
|
/* sanity check that this is a DIR pointer */
|
||||||
if (pDir->dir_ulCookie != __DIRENT_COOKIE) {
|
if (pDir->dir_ulCookie != __DIRENT_COOKIE) {
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pDir->dir_nNumFiles == 0) {
|
if (pDir->dir_nNumFiles == 0) {
|
||||||
pDir->dir_hDirHandle = FindFirstFile(pDir->dir_pDirectoryName, &wfdFindData);
|
pDir->dir_hDirHandle = FindFirstFile(pDir->dir_pDirectoryName, &wfdFindData);
|
||||||
if (pDir->dir_hDirHandle == INVALID_HANDLE_VALUE)
|
if (pDir->dir_hDirHandle == INVALID_HANDLE_VALUE)
|
||||||
return NULL;
|
return NULL;
|
||||||
} else if (!FindNextFile(pDir->dir_hDirHandle, &wfdFindData))
|
} else if (!FindNextFile(pDir->dir_hDirHandle, &wfdFindData))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
/* bump count for next call to readdir() or telldir() */
|
/* bump count for next call to readdir() or telldir() */
|
||||||
pDir->dir_nNumFiles++;
|
pDir->dir_nNumFiles++;
|
||||||
|
|
||||||
/* fill in struct dirent values */
|
/* fill in struct dirent values */
|
||||||
pDir->dir_sdReturn.d_ino = -1;
|
pDir->dir_sdReturn.d_ino = -1;
|
||||||
strcpy(pDir->dir_sdReturn.d_name, wfdFindData.cFileName);
|
strcpy(pDir->dir_sdReturn.d_name, wfdFindData.cFileName);
|
||||||
|
|
||||||
return &pDir->dir_sdReturn;
|
return &pDir->dir_sdReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
rewinddir(DIR* pDir)
|
rewinddir(DIR* pDir)
|
||||||
{
|
{
|
||||||
if (!pDir) {
|
if (!pDir) {
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* sanity check that this is a DIR pointer */
|
/* sanity check that this is a DIR pointer */
|
||||||
if (pDir->dir_ulCookie != __DIRENT_COOKIE) {
|
if (pDir->dir_ulCookie != __DIRENT_COOKIE) {
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* close the WIN32 directory handle */
|
/* close the WINDOWS32 directory handle */
|
||||||
if (pDir->dir_hDirHandle != INVALID_HANDLE_VALUE)
|
if (pDir->dir_hDirHandle != INVALID_HANDLE_VALUE)
|
||||||
if (!FindClose(pDir->dir_hDirHandle))
|
if (!FindClose(pDir->dir_hDirHandle))
|
||||||
errno = EBADF;
|
errno = EBADF;
|
||||||
|
|
||||||
/* reset members which control readdir() */
|
/* reset members which control readdir() */
|
||||||
pDir->dir_hDirHandle = INVALID_HANDLE_VALUE;
|
pDir->dir_hDirHandle = INVALID_HANDLE_VALUE;
|
||||||
pDir->dir_nNumFiles = 0;
|
pDir->dir_nNumFiles = 0;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
telldir(DIR* pDir)
|
telldir(DIR* pDir)
|
||||||
{
|
{
|
||||||
if (!pDir) {
|
if (!pDir) {
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* sanity check that this is a DIR pointer */
|
/* sanity check that this is a DIR pointer */
|
||||||
if (pDir->dir_ulCookie != __DIRENT_COOKIE) {
|
if (pDir->dir_ulCookie != __DIRENT_COOKIE) {
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* return number of times readdir() called */
|
/* return number of times readdir() called */
|
||||||
return pDir->dir_nNumFiles;
|
return pDir->dir_nNumFiles;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
seekdir(DIR* pDir, long nPosition)
|
seekdir(DIR* pDir, long nPosition)
|
||||||
{
|
{
|
||||||
if (!pDir)
|
if (!pDir)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* sanity check that this is a DIR pointer */
|
/* sanity check that this is a DIR pointer */
|
||||||
if (pDir->dir_ulCookie != __DIRENT_COOKIE)
|
if (pDir->dir_ulCookie != __DIRENT_COOKIE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* go back to beginning of directory */
|
/* go back to beginning of directory */
|
||||||
rewinddir(pDir);
|
rewinddir(pDir);
|
||||||
|
|
||||||
/* loop until we have found position we care about */
|
/* loop until we have found position we care about */
|
||||||
for (--nPosition; nPosition && readdir(pDir); nPosition--);
|
for (--nPosition; nPosition && readdir(pDir); nPosition--);
|
||||||
|
|
||||||
/* flag invalid nPosition value */
|
/* flag invalid nPosition value */
|
||||||
if (nPosition)
|
if (nPosition)
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,37 +1,37 @@
|
|||||||
#ifndef _DIRENT_H
|
#ifndef _DIRENT_H
|
||||||
#define _DIRENT_H
|
#define _DIRENT_H
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#ifndef NAME_MAX
|
#ifndef NAME_MAX
|
||||||
#define NAME_MAX 255
|
#define NAME_MAX 255
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define __DIRENT_COOKIE 0xfefeabab
|
#define __DIRENT_COOKIE 0xfefeabab
|
||||||
|
|
||||||
|
|
||||||
struct dirent
|
struct dirent
|
||||||
{
|
{
|
||||||
ino_t d_ino; /* unused - no equivalent on WIN32 */
|
ino_t d_ino; /* unused - no equivalent on WINDOWS32 */
|
||||||
char d_name[NAME_MAX+1];
|
char d_name[NAME_MAX+1];
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct dir_struct {
|
typedef struct dir_struct {
|
||||||
ULONG dir_ulCookie;
|
ULONG dir_ulCookie;
|
||||||
HANDLE dir_hDirHandle;
|
HANDLE dir_hDirHandle;
|
||||||
DWORD dir_nNumFiles;
|
DWORD dir_nNumFiles;
|
||||||
char dir_pDirectoryName[NAME_MAX+1];
|
char dir_pDirectoryName[NAME_MAX+1];
|
||||||
struct dirent dir_sdReturn;
|
struct dirent dir_sdReturn;
|
||||||
} DIR;
|
} DIR;
|
||||||
|
|
||||||
DIR *opendir(const char *);
|
DIR *opendir(const char *);
|
||||||
struct dirent *readdir(DIR *);
|
struct dirent *readdir(DIR *);
|
||||||
void rewinddir(DIR *);
|
void rewinddir(DIR *);
|
||||||
void closedir(DIR *);
|
void closedir(DIR *);
|
||||||
int telldir(DIR *);
|
int telldir(DIR *);
|
||||||
void seekdir(DIR *, long);
|
void seekdir(DIR *, long);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
#ifndef _PATHSTUFF_H
|
#ifndef _PATHSTUFF_H
|
||||||
#define _PATHSTUFF_H
|
#define _PATHSTUFF_H
|
||||||
|
|
||||||
extern char * convert_Path_to_win32(char *Path, char to_delim);
|
extern char * convert_Path_to_windows32(char *Path, char to_delim);
|
||||||
|
extern char * convert_vpath_to_windows32(char *Path, char to_delim);
|
||||||
extern char * w32ify(char *file, int resolve);
|
extern char * w32ify(char *file, int resolve);
|
||||||
extern char * getcwd_fs(char *buf, int len);
|
extern char * getcwd_fs(char *buf, int len);
|
||||||
|
|
||||||
#define convert_vpath_to_win32(vpath, delim) convert_Path_to_win32(vpath, delim)
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,54 +1,47 @@
|
|||||||
#ifndef SUB_PROC_H
|
#ifndef SUB_PROC_H
|
||||||
#define SUB_PROC_H
|
#define SUB_PROC_H
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Component Name:
|
* Component Name:
|
||||||
*
|
*
|
||||||
* $Date$
|
* $Date$
|
||||||
*
|
*
|
||||||
* $Source$
|
* $Source$
|
||||||
*
|
*
|
||||||
* $Revision$
|
* $Revision$
|
||||||
*
|
*/
|
||||||
* Description:
|
|
||||||
*
|
/* $Id$ */
|
||||||
* (C) COPYRIGHT TIVOLI Systems, Inc. 1991-1994
|
|
||||||
* Unpublished Work
|
#ifdef WINDOWS32
|
||||||
* All Rights Reserved
|
|
||||||
* Licensed Material - Property of TIVOLI Systems, Inc.
|
#define EXTERN_DECL(entry, args) extern entry args
|
||||||
*/
|
#define VOID_DECL void
|
||||||
|
|
||||||
/* $Id$ */
|
EXTERN_DECL(HANDLE process_init, (VOID_DECL));
|
||||||
|
EXTERN_DECL(HANDLE process_init_fd, (HANDLE stdinh, HANDLE stdouth,
|
||||||
#ifdef WIN32
|
HANDLE stderrh));
|
||||||
|
EXTERN_DECL(long process_begin, (HANDLE proc, char **argv, char **envp,
|
||||||
#define EXTERN_DECL(entry, args) extern entry args
|
char *exec_path, char *as_user));
|
||||||
#define VOID_DECL void
|
EXTERN_DECL(long process_pipe_io, (HANDLE proc, char *stdin_data,
|
||||||
|
int stdin_data_len));
|
||||||
EXTERN_DECL(HANDLE process_init, (VOID_DECL));
|
EXTERN_DECL(long process_file_io, (HANDLE proc));
|
||||||
EXTERN_DECL(HANDLE process_init_fd, (HANDLE stdinh, HANDLE stdouth,
|
EXTERN_DECL(void process_cleanup, (HANDLE proc));
|
||||||
HANDLE stderrh));
|
EXTERN_DECL(HANDLE process_wait_for_any, (VOID_DECL));
|
||||||
EXTERN_DECL(long process_begin, (HANDLE proc, char **argv, char **envp,
|
EXTERN_DECL(void process_register, (HANDLE proc));
|
||||||
char *exec_path, char *as_user));
|
EXTERN_DECL(HANDLE process_easy, (char** argv, char** env));
|
||||||
EXTERN_DECL(long process_pipe_io, (HANDLE proc, char *stdin_data,
|
EXTERN_DECL(BOOL process_kill, (HANDLE proc, int signal));
|
||||||
int stdin_data_len));
|
|
||||||
EXTERN_DECL(long process_file_io, (HANDLE proc));
|
/* support routines */
|
||||||
EXTERN_DECL(void process_cleanup, (HANDLE proc));
|
EXTERN_DECL(long process_errno, (HANDLE proc));
|
||||||
EXTERN_DECL(HANDLE process_wait_for_any, (VOID_DECL));
|
EXTERN_DECL(long process_last_err, (HANDLE proc));
|
||||||
EXTERN_DECL(void process_register, (HANDLE proc));
|
EXTERN_DECL(long process_exit_code, (HANDLE proc));
|
||||||
EXTERN_DECL(HANDLE process_easy, (char** argv, char** env));
|
EXTERN_DECL(long process_signal, (HANDLE proc));
|
||||||
EXTERN_DECL(BOOL process_kill, (HANDLE proc, int signal));
|
EXTERN_DECL(char * process_outbuf, (HANDLE proc));
|
||||||
|
EXTERN_DECL(char * process_errbuf, (HANDLE proc));
|
||||||
/* support routines */
|
EXTERN_DECL(int process_outcnt, (HANDLE proc));
|
||||||
EXTERN_DECL(long process_errno, (HANDLE proc));
|
EXTERN_DECL(int process_errcnt, (HANDLE proc));
|
||||||
EXTERN_DECL(long process_last_err, (HANDLE proc));
|
EXTERN_DECL(void process_pipes, (HANDLE proc, int pipes[3]));
|
||||||
EXTERN_DECL(long process_exit_code, (HANDLE proc));
|
|
||||||
EXTERN_DECL(long process_signal, (HANDLE proc));
|
#endif
|
||||||
EXTERN_DECL(char * process_outbuf, (HANDLE proc));
|
#endif
|
||||||
EXTERN_DECL(char * process_errbuf, (HANDLE proc));
|
|
||||||
EXTERN_DECL(int process_outcnt, (HANDLE proc));
|
|
||||||
EXTERN_DECL(int process_errcnt, (HANDLE proc));
|
|
||||||
EXTERN_DECL(void process_pipes, (HANDLE proc, int pipes[3]));
|
|
||||||
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
#ifndef _W32ERR_H_
|
#ifndef _W32ERR_H_
|
||||||
#define _W32ERR_H_
|
#define _W32ERR_H_
|
||||||
|
|
||||||
#ifndef EXTERN_DECL
|
#ifndef EXTERN_DECL
|
||||||
#define EXTERN_DECL(entry, args) entry args
|
#define EXTERN_DECL(entry, args) entry args
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
EXTERN_DECL(char * map_win32_error_to_string, (DWORD error));
|
EXTERN_DECL(char * map_windows32_error_to_string, (DWORD error));
|
||||||
|
|
||||||
#endif /* !_W32ERR_H */
|
#endif /* !_W32ERR_H */
|
||||||
|
|||||||
@@ -1,47 +1,66 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "make.h"
|
#include "make.h"
|
||||||
|
#include "pathstuff.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Convert delimiter separated path to Canonical format.
|
* Convert delimiter separated vpath to Canonical format.
|
||||||
*/
|
*/
|
||||||
char *
|
char *
|
||||||
convert_Path_to_win32(char *Path, char to_delim)
|
convert_vpath_to_windows32(char *Path, char to_delim)
|
||||||
|
{
|
||||||
|
char *etok; /* token separator for old Path */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Convert all spaces to delimiters. Note that pathnames which
|
||||||
|
* contain blanks get trounced here. Use 8.3 format as a workaround.
|
||||||
|
*/
|
||||||
|
for (etok = Path; etok && *etok; etok++)
|
||||||
|
if (isblank(*etok))
|
||||||
|
*etok = to_delim;
|
||||||
|
|
||||||
|
return (convert_Path_to_windows32(Path, to_delim));
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Convert delimiter separated path to Canonical format.
|
||||||
|
*/
|
||||||
|
char *
|
||||||
|
convert_Path_to_windows32(char *Path, char to_delim)
|
||||||
{
|
{
|
||||||
char *etok; /* token separator for old Path */
|
char *etok; /* token separator for old Path */
|
||||||
char *p; /* points to element of old Path */
|
char *p; /* points to element of old Path */
|
||||||
|
|
||||||
/* is this a multi-element Path ? */
|
/* is this a multi-element Path ? */
|
||||||
for (p = Path, etok = strpbrk(p, ":;");
|
for (p = Path, etok = strpbrk(p, ":;");
|
||||||
etok;
|
etok;
|
||||||
etok = strpbrk(p, ":;"))
|
etok = strpbrk(p, ":;"))
|
||||||
if ((etok - p) == 1) {
|
if ((etok - p) == 1) {
|
||||||
if (*(etok - 1) == ';' ||
|
if (*(etok - 1) == ';' ||
|
||||||
*(etok - 1) == ':') {
|
*(etok - 1) == ':') {
|
||||||
etok[-1] = to_delim;
|
etok[-1] = to_delim;
|
||||||
etok[0] = to_delim;
|
etok[0] = to_delim;
|
||||||
p = ++etok;
|
p = ++etok;
|
||||||
continue; /* ignore empty bucket */
|
continue; /* ignore empty bucket */
|
||||||
} else if (etok = strpbrk(etok+1, ":;")) {
|
} else if (!isalpha(*p)) {
|
||||||
|
/* found one to count, handle things like '.' */
|
||||||
|
*etok = to_delim;
|
||||||
|
p = ++etok;
|
||||||
|
} else if ((*etok == ':') && (etok = strpbrk(etok+1, ":;"))) {
|
||||||
/* found one to count, handle drive letter */
|
/* found one to count, handle drive letter */
|
||||||
*etok = to_delim;
|
*etok = to_delim;
|
||||||
p = ++etok;
|
p = ++etok;
|
||||||
} else
|
} else
|
||||||
/* all finished, force abort */
|
/* all finished, force abort */
|
||||||
p += strlen(p);
|
p += strlen(p);
|
||||||
} else {
|
} else {
|
||||||
/* found another one, no drive letter */
|
/* found another one, no drive letter */
|
||||||
*etok = to_delim;
|
*etok = to_delim;
|
||||||
p = ++etok;
|
p = ++etok;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
/* convert to backward slashes */
|
|
||||||
for (p = Path, p = strchr(p, '/'); p; p = strchr(p, '/'))
|
|
||||||
*p = '\\';
|
|
||||||
#endif
|
|
||||||
return Path;
|
return Path;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Convert to forward slashes. Resolve to full pathname optionally
|
* Convert to forward slashes. Resolve to full pathname optionally
|
||||||
@@ -80,10 +99,10 @@ getcwd_fs(char* buf, int len)
|
|||||||
#ifdef unused
|
#ifdef unused
|
||||||
/*
|
/*
|
||||||
* Convert delimiter separated pathnames (e.g. PATH) or single file pathname
|
* Convert delimiter separated pathnames (e.g. PATH) or single file pathname
|
||||||
* (e.g. c:/foo, c:\bar) to NutC format. If we are handed a string that
|
* (e.g. c:/foo, c:\bar) to NutC format. If we are handed a string that
|
||||||
* _NutPathToNutc() fails to convert, just return the path we were handed
|
* _NutPathToNutc() fails to convert, just return the path we were handed
|
||||||
* and assume the caller will know what to do with it (It was probably
|
* and assume the caller will know what to do with it (It was probably
|
||||||
* a mistake to try and convert it anyway due to some of the bizarre things
|
* a mistake to try and convert it anyway due to some of the bizarre things
|
||||||
* that might look like pathnames in makefiles).
|
* that might look like pathnames in makefiles).
|
||||||
*/
|
*/
|
||||||
char *
|
char *
|
||||||
@@ -99,8 +118,8 @@ convert_path_to_nutc(char *path)
|
|||||||
char *rval;
|
char *rval;
|
||||||
|
|
||||||
/* is this a multi-element path ? */
|
/* is this a multi-element path ? */
|
||||||
for (p = path, etok = strpbrk(p, ":;"), count = 0;
|
for (p = path, etok = strpbrk(p, ":;"), count = 0;
|
||||||
etok;
|
etok;
|
||||||
etok = strpbrk(p, ":;"))
|
etok = strpbrk(p, ":;"))
|
||||||
if ((etok - p) == 1) {
|
if ((etok - p) == 1) {
|
||||||
if (*(etok - 1) == ';' ||
|
if (*(etok - 1) == ';' ||
|
||||||
@@ -112,15 +131,15 @@ convert_path_to_nutc(char *path)
|
|||||||
p = ++etok, count++;
|
p = ++etok, count++;
|
||||||
else
|
else
|
||||||
/* all finished, force abort */
|
/* all finished, force abort */
|
||||||
p += strlen(p);
|
p += strlen(p);
|
||||||
} else
|
} else
|
||||||
/* found another one, no drive letter */
|
/* found another one, no drive letter */
|
||||||
p = ++etok, count++;
|
p = ++etok, count++;
|
||||||
|
|
||||||
if (count) {
|
if (count) {
|
||||||
count++; /* x1;x2;x3 <- need to count x3 */
|
count++; /* x1;x2;x3 <- need to count x3 */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Hazard a guess on how big the buffer needs to be.
|
* Hazard a guess on how big the buffer needs to be.
|
||||||
* We have to convert things like c:/foo to /c=/foo.
|
* We have to convert things like c:/foo to /c=/foo.
|
||||||
*/
|
*/
|
||||||
@@ -134,10 +153,10 @@ convert_path_to_nutc(char *path)
|
|||||||
* a time. Single file pathnames will fail this and fall
|
* a time. Single file pathnames will fail this and fall
|
||||||
* to the logic below loop.
|
* to the logic below loop.
|
||||||
*/
|
*/
|
||||||
for (p = path, etok = strpbrk(p, ":;");
|
for (p = path, etok = strpbrk(p, ":;");
|
||||||
etok;
|
etok;
|
||||||
etok = strpbrk(p, ":;")) {
|
etok = strpbrk(p, ":;")) {
|
||||||
|
|
||||||
/* don't trip up on device specifiers or empty path slots */
|
/* don't trip up on device specifiers or empty path slots */
|
||||||
if ((etok - p) == 1)
|
if ((etok - p) == 1)
|
||||||
if (*(etok - 1) == ';' ||
|
if (*(etok - 1) == ';' ||
|
||||||
@@ -145,14 +164,14 @@ convert_path_to_nutc(char *path)
|
|||||||
p = ++etok;
|
p = ++etok;
|
||||||
continue;
|
continue;
|
||||||
} else if ((etok = strpbrk(etok+1, ":;")) == NULL)
|
} else if ((etok = strpbrk(etok+1, ":;")) == NULL)
|
||||||
break; /* thing found was a WIN32 pathname */
|
break; /* thing found was a WINDOWS32 pathname */
|
||||||
|
|
||||||
/* save separator */
|
/* save separator */
|
||||||
sep = *etok;
|
sep = *etok;
|
||||||
|
|
||||||
/* terminate the current path element -- temporarily */
|
/* terminate the current path element -- temporarily */
|
||||||
*etok = '\0';
|
*etok = '\0';
|
||||||
|
|
||||||
#ifdef __NUTC__
|
#ifdef __NUTC__
|
||||||
/* convert to NutC format */
|
/* convert to NutC format */
|
||||||
if (_NutPathToNutc(p, pathp, 0) == FALSE) {
|
if (_NutPathToNutc(p, pathp, 0) == FALSE) {
|
||||||
@@ -167,20 +186,20 @@ convert_path_to_nutc(char *path)
|
|||||||
*pathp++ = '/';
|
*pathp++ = '/';
|
||||||
strcpy(pathp, &p[2]);
|
strcpy(pathp, &p[2]);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
pathp += strlen(pathp);
|
pathp += strlen(pathp);
|
||||||
*pathp++ = ':'; /* use Unix style path separtor for new path */
|
*pathp++ = ':'; /* use Unix style path separtor for new path */
|
||||||
*pathp = '\0'; /* make sure we are null terminaed */
|
*pathp = '\0'; /* make sure we are null terminaed */
|
||||||
|
|
||||||
/* restore path separator */
|
/* restore path separator */
|
||||||
*etok = sep;
|
*etok = sep;
|
||||||
|
|
||||||
/* point p to first char of next path element */
|
/* point p to first char of next path element */
|
||||||
p = ++etok;
|
p = ++etok;
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
nutc_path_len = strlen(path) + 3;
|
nutc_path_len = strlen(path) + 3;
|
||||||
nutc_path = xmalloc(nutc_path_len);
|
nutc_path = xmalloc(nutc_path_len);
|
||||||
pathp = nutc_path;
|
pathp = nutc_path;
|
||||||
*pathp = '\0';
|
*pathp = '\0';
|
||||||
@@ -191,7 +210,7 @@ convert_path_to_nutc(char *path)
|
|||||||
* OK, here we handle the last element in PATH (e.g. c of a;b;c)
|
* OK, here we handle the last element in PATH (e.g. c of a;b;c)
|
||||||
* or the path was a single filename and will be converted
|
* or the path was a single filename and will be converted
|
||||||
* here. Note, testing p here assures that we don't trip up
|
* here. Note, testing p here assures that we don't trip up
|
||||||
* on paths like a;b; which have trailing delimiter followed by
|
* on paths like a;b; which have trailing delimiter followed by
|
||||||
* nothing.
|
* nothing.
|
||||||
*/
|
*/
|
||||||
if (*p != '\0') {
|
if (*p != '\0') {
|
||||||
@@ -214,6 +233,6 @@ convert_path_to_nutc(char *path)
|
|||||||
rval = savestring(nutc_path, strlen(nutc_path));
|
rval = savestring(nutc_path, strlen(nutc_path));
|
||||||
free(nutc_path);
|
free(nutc_path);
|
||||||
return rval;
|
return rval;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user