Compare commits

...

131 Commits

Author SHA1 Message Date
Paul Smith
b134da5505 * A few cleanups, and 3.77.94 release. 1999-08-25 21:39:28 +00:00
Paul Smith
d0b03e9355 * Terminology change in docs and code. 1999-08-24 04:49:39 +00:00
Paul Smith
5dc4b92b60 * Fix jobserver algorithm again.
* A couple of nits.
* Fix considered pruning for double-colon rules.
1999-08-23 22:15:17 +00:00
Paul Smith
b3fa4b3c7e * Start rewrite of jobserver to avoid unique tokens for debugging. 1999-08-23 05:35:14 +00:00
Paul Smith
6fa76a7d15 * Various changes. 1999-08-22 17:50:57 +00:00
Paul Smith
4ff6c62456 * Code cleanup. 1999-08-19 04:43:46 +00:00
Paul Smith
cbb9e38d10 * Rework jobserver yet one more time.
* Install the $(if ...) function and document it.  Still need some examples.
1999-08-13 07:36:26 +00:00
Paul Smith
9e79637ec3 * Some DOS fixes. 1999-08-12 23:16:42 +00:00
Paul Smith
e34540f79b * Release 3.77.92.
* Complete implementation of new jobserver algorithm.
* A few minor fixups.
1999-08-01 08:12:06 +00:00
Paul Smith
09f1e4cf83 * Applied some DOS updates.
* Started reworking the jobserver algorithm; not complete yet.
1999-08-01 06:05:17 +00:00
Paul Smith
28ef4c4dac * Add gettext macros to start i18n support. 1999-07-28 06:23:37 +00:00
Paul Smith
3a945a665e * Update the manual. 1999-07-26 05:06:58 +00:00
Paul Smith
6dbd348522 * Forgot ChangeLog. 1999-07-24 04:56:06 +00:00
Paul Smith
a9166bb7bc * Some configure fixes. 1999-07-24 04:55:08 +00:00
Paul Smith
4e7ee4fc01 * Bugfix for NT archive support.
* Rework how the jobserver stuff works.
1999-07-23 22:46:47 +00:00
Paul Smith
b05cb1d99e * Make some portability fixes. 1999-07-22 06:29:02 +00:00
Paul Smith
c8a60e7431 * Update the AUTHORS file. 1999-07-22 04:41:51 +00:00
Paul Smith
6d2984e0b2 * Fix backward incompatibility in new function implementation.
* Add support for ARFZMAG archive formats.
1999-07-22 04:31:11 +00:00
Paul Smith
ec50fe2a2b * Installed new versions of GLIBC glob library.
* Installed Tim Magill's "graph pruning" performance enhancement.
* Update version to 3.77.90 for the release.
* Require automake 1.4.
1999-07-22 04:20:14 +00:00
Paul Smith
c69d4c95bf * Installed VMS fixes. 1999-07-21 16:06:18 +00:00
Paul Smith
588da9812e * Add configure option to enable dmalloc library.
* Various code cleanups.
1999-07-21 05:53:23 +00:00
Paul Smith
73846549f6 * Fix memory leaks, fd leaks, and some long-standing bugs recognizing when
targets need to have their modtimes rechecked (-n, etc.)
1999-07-20 22:34:41 +00:00
Karl Berry
169e6b8c3d pdfimage takes braces 1999-07-18 18:19:53 +00:00
Paul Smith
826ab14b26 * Fix some memory and file descriptor leaks. 1999-07-16 22:28:46 +00:00
Paul Smith
a3cf773e29 * Various bug fixes. 1999-07-16 02:25:03 +00:00
Paul Smith
9d89ad56bf * Fix up and document $(apply ...) function. 1999-07-15 07:36:44 +00:00
Paul Eggert
adb1632033 Sync to ftp.gnu.org version of 1999-07-06. 1999-07-13 04:50:09 +00:00
Paul Smith
8df9d54020 * Fixed error rebuilding makefiles with -j>1
* Fixed problem with job pipe and -j>1 when waiting on -l loads.
1999-07-09 22:55:44 +00:00
Paul Smith
9035aa27b7 * Minor code cleanup. 1999-07-08 22:32:38 +00:00
Paul Smith
e1d72ad3f1 * Added -R / --no-builtin-variables flag. 1999-07-08 06:49:52 +00:00
Paul Smith
012254e81e * Various bugfixes/updates. See ChangeLog. 1999-07-06 21:09:32 +00:00
Paul Smith
2858f7a8f1 * Various bug fixes. 1999-06-14 06:50:28 +00:00
Paul Smith
187787286d * Various bug fixes. 1999-06-14 05:26:28 +00:00
Paul Smith
fc0fe4103a * Add new jobserver feature.
* Small updates to the manual
* E.Zaretskii fix for new DJGPP version.
1999-04-25 04:30:55 +00:00
Paul Smith
7f3ffd4019 Clean up some logic. 1999-04-13 02:28:27 +00:00
Paul Smith
a2ea1bd27f If a file declared .INTERMEDIATE already exists before make starts, we
won't delete it--this is how normal intermediate files behave, too.
1999-04-09 05:57:35 +00:00
Paul Smith
3d1cdf4106 * Fix possible memory stomp.
* A few admin file cleanups.
1999-04-02 06:19:33 +00:00
Paul Smith
7052a57152 * Ignore CR in CRLF line terminators for compatibility with DOSsy
makefiles.
1999-03-31 23:25:13 +00:00
Karl Berry
47922a5a65 * texinfo.tex (\defopheader): missing word space before `on'.
Report from: Chris Hanson <cph@martigny.ai.mit.edu>.
1999-03-31 18:30:14 +00:00
Paul Smith
e005a48b9f * More build fixes. I think a vanilla CVS checkout should build OK now. 1999-03-30 06:19:17 +00:00
Karl Berry
0798a61169 * texinfo.tex (\imagexxx): Equalize space above and below if in
vmode.  From rms.
.,
1999-03-27 10:32:23 +00:00
Paul Smith
ecb3bca9f5 * Manual updates: added xrefs, some typos sent by users.
* Change the build env. to not link libglob.a unless we need it.
1999-03-26 07:08:57 +00:00
Paul Smith
c4353af3f9 * Reworked function.c to use separate functions instead of a huge case stmt.
* Added new functions $(error ...) and $(warning ...) and documented same.
* In windows/dos shells, only treat \ as an escape for special chars.
1999-03-26 04:04:42 +00:00
Karl Berry
8363e0496d * texinfo.tex (&): be sure active & is defined for @deftypefn
operator&.
	Report from: Nathan Sidwell <nathan@acm.org>.
1999-03-24 16:04:27 +00:00
Karl Berry
4025030d96 * texinfo.tex: Changes from Andreas to use \sl\$ inside italics
and to avoid extra spaces around @anchor.
	* texinfo.tex (\image, \imagexx): move pdf test to imagexxx for
 		correct filename parsing.
1999-03-20 21:49:38 +00:00
Paul Smith
1e0513335f * Add strneq() (streq only n chars) macro
* fix return type of xstrdup.
1999-03-19 04:27:56 +00:00
Karl Berry
e3d0d562da * texinfo.tex (\imagexxx): reset catcode ^^M in case we're inside
in an example.  Report from kama.
1999-03-16 12:49:21 +00:00
Karl Berry
db865774df * texinfo.tex (\putwordin): new macro for word `in'.
(\xrefX): use it.
1999-03-15 22:34:20 +00:00
Paul Smith
a6a9ebb54f * Define and use xstrdup() instead of strdup(). 1999-03-05 07:13:12 +00:00
Paul Smith
9e6ba6a148 * Update FSF address info in copyright notices.
* Update maintainers build process; remove GNUmakefile.  Require builders to
  run automake && autoreconf by hand.
* Use AC_SUBST_FILE to get the maintMakefile included, rather than GNU
  make's include directive, which conflicts with automake 1.4's include
  directive.
1999-03-05 05:55:11 +00:00
Paul Smith
ede263043c Fix a bug where conditional variables weren't being expanded correctly. 1999-03-04 17:03:56 +00:00
Karl Berry
a8f7173799 * texinfo.tex: Expand tabs. 1999-02-22 12:59:43 +00:00
Paul Smith
a66668aabc * New feature: .LIBPATTERNS controls the way -lfoo dependencies are expanded.
* A few tweaks to the system glob test, after trying it on a system where
  it's true.
* Installed patches to archive handling for AIX 4.3 big archives.
* Fix a memory stomp in target-specific variables.
* Fix a memory leak in foreach functions.
1999-02-22 07:23:30 +00:00
Paul Smith
84f38c9c6f * Updates for automake 1.4 and autoconf 2.13
* Check for a libc version of GNU glob and, if found, don't use the local
  glob headers.
* Fix a bug in OpenVMS archive handling.
* Fix a bug in VMS siglist processing.
1999-02-19 18:07:49 +00:00
Karl Berry
5808507144 * texinfo.tex (\paragraphindent): implement.
Suggestion from: Paul DuBois <dubois@primate.wisc.edu>.
	* texinfo.tex (\alias): use def rather than \let.
	Change timestamp format to include hours.
1999-02-15 13:15:05 +00:00
Karl Berry
e3ef8e974c * texinfo.tex: New commands @alias and @definfoenclose.
From: "Eric S. Raymond" <esr@snark.thyrsus.com>.
1999-02-09 15:10:17 +00:00
Karl Berry
281cdd5d74 * texinfo.tex (\scanmacro): Use \endinput to avoid spurious space,
and various other space fixes.  From: Andreas Schwab
 		<schwab@ls5.informatik.uni-dortmund.de>.
1999-02-08 19:55:39 +00:00
Karl Berry
3634e15fe3 * texinfo.tex (\uref): implement optional third arg.
* texinfo.tex (\dosubind): Include index entry in third arg to
		\entry instead of writing as bogus fourth arg.
	Report from: kama@hippo.fido.de (Karl Heinz Marbaise).
	* texinfo.tex (\setemergencystretch): Increase somewhat.
	* texinfo.tex (\putwordof): rename from \putwordOf.
	* texinfo.tex (defivarhead, \defcvarheader): Use \putwordof.
1999-02-05 10:33:07 +00:00
Karl Berry
9c95acec4b * texinfo.tex (\documentlanguage, \documentencoding): new
commands.  \documentlanguage based on an implementation by kama.
1999-02-03 11:35:04 +00:00
Karl Berry
8b55cda094 * texinfo.tex: Fix @macro expansion inside @section. Patch from
Andreas:
	From: Andreas Schwab <schwab@ls5.informatik.uni-dortmund.de>
	The general idea is to construct a list a all defined macros in
 		the form \do\macro1\do\macro2..., then temporarily define
 		\do to something appropriate and execute the list to do
 		whatever is needed.  Here is a patch, and i have also
 		fixed a few other bugs that i found while browsing through
 		the @macro implementation.  Additionally i have added a
 		check to prevent the user from doing silly things like
 		@macro shipout.
1999-01-30 13:16:18 +00:00
Karl Berry
9d9111c450 * texinfo.tex (\obstexwarn): Don't use *** in message, it
interferes with make output parsing.
1999-01-24 16:04:24 +00:00
Karl Berry
0f686c1e6b * texinfo.tex: Internationalization improvements from kama. 1999-01-22 10:24:18 +00:00
Karl Berry
6eeae809a8 * texinfo.tex (\contents, \shortcontents): Run \contentspagealignmacro.
From: Trond Endrestol <trond@agamemnon.gtf.ol.no>
1999-01-21 10:37:08 +00:00
Karl Berry
5b16b3c015 * texinfo.tex (\begindoublecolumns): Ship out \partialpage
immediately if it is nonvoid, instead of saving it.  This avoids a
	bug where the index could end up printing one line per page (see
	the indexspread.tex test).
	From: Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>

	* texinfo.tex (\image): If running pdftex, do \pdfimage{imagefile.pdf}.
 	From: Samuel Tardieu <sam@inf.enst.fr>

 	Also, update copyright year.
1999-01-15 09:29:00 +00:00
Karl Berry
c0ec561e37 * texinfo.tex (\enddoublecolumns): Move \pagegoal reset to after
the \endgroup so we get the restored single-column \vsize
 		as intended.
1999-01-06 11:11:58 +00:00
Karl Berry
71aacd9fe0 * texinfo.tex (\indexdummies): Set \{ and \} to \mylbrace and
\mybrace to avoid braces in the index file, which
	texindex can't handle.
1998-12-21 15:36:12 +00:00
Karl Berry
dc7cf1c4b2 * texinfo.tex (\pickupwholefraction): Ignore whole-number part.
(\setuptable): Always pass whole-number part and decimal point.  This
	allows leading zeroes.
	Suggestion from: Ben Bullock <ben@hayamasa.demon.co.uk>.
	Date: Fri, 21 Aug 1998 14:06:50 +0100 (BST)
1998-12-20 12:55:40 +00:00
Karl Berry
7f83bfe911 * texinfo.tex (\indexdummies): set \{ and \} to \lbracecmd and
\rbracecmd to avoid lossage if @tex is active during \shipout.
	Report from: "Peter Kabal" <Kabal@ece.mcgill.ca>.
1998-12-15 21:48:39 +00:00
Karl Berry
45406fc744 doc fix 1998-12-12 20:44:40 +00:00
Karl Berry
76468fbaa1 update date 1998-11-13 23:00:02 +00:00
Karl Berry
2116c80dc7 1998-11-11 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
* doc/texinfo.tex (\onepageout): Put the cropmarks in vboxes of
	zero height so that they don't contribute space themselves.
	Compensate for \topandbottommargin.
	(\internalpagesizes): Advance \outervsize by 2\topandbottommargin,
	not only 0.6in.
1998-11-13 22:49:41 +00:00
Karl Berry
28eecbb94f * texinfo.tex: Use standard time-stamp.el package instead of
update-date.el.
.,
1998-11-08 18:39:08 +00:00
Karl Berry
9ad3cb03b7 * texinfo.tex (\indexnofonts,\indexdummies): add \url and \uref to
list.
1998-11-01 12:43:32 +00:00
Karl Berry
0be25c6986 * texinfo.tex (@env, @command, @option): Must disable for index
and xref commands.  Also, \input plain if necessary before
 		using {} in the version number.
1998-10-27 16:59:40 +00:00
Richard M. Stallman
4dfe38353e Mention Automake.
Mention DESTDIR.
Comment on changing prefix or exec_prefix.
1998-10-15 15:29:00 +00:00
Paul Smith
3948640154 Ignore non-empty lines which become empty after variable expansion.
Don't choke on invalid pattern rules if we fail during makefile parsing.
Don't dump core if a non-empty command becomes empty after expansion.
1998-10-13 20:59:08 +00:00
Paul Smith
2c64fb221a Checkpoint changes. Bug fixes, mostly. 1998-10-03 05:39:55 +00:00
Paul Smith
e90887e68a Don't use a separate configure.in for the glob directory. It now uses
the configure script for make proper.
1998-10-03 05:23:25 +00:00
Karl Berry
321b447568 * texinfo.tex: Use date as version number instead of RCS, and
update-date to update it.
1998-09-30 15:43:32 +00:00
Richard M. Stallman
b5722838c2 Treat __GNU__ line NeXT: undefine BSD and FSCALE. 1998-09-27 07:29:59 +00:00
Karl Berry
7a43e6cd30 * texinfo.tex: Fix @macro expansion of @code with _ in the
argument.
 	From: Zack Weinberg <zack@rabi.columbia.edu>.
1998-09-17 17:25:42 +00:00
Karl Berry
84d159bb64 * texinfo.tex (\itemzzz): take \itemmargin into account when
unhboxing.  Reported by Bob.
1998-08-28 14:29:37 +00:00
Karl Berry
050f9d9f5d * texinfo.tex: Change @defun environments so that right margin is
not changed, and instead the defun type label is outdented
 		into the margin.
1998-08-14 20:54:46 +00:00
Karl Berry
50b5c15b54 * texinfo.tex (\smartslanted): define this separately from
\smartitalic.
	(\emph, \i): use \smartitalic for true italics.
1998-08-13 17:33:06 +00:00
Karl Berry
fc6cca1c7c * texinfo.tex (\value): handle active _ or - in argument (happens
if called from @code).
 	Report from: Dave Love <d.love@dl.ac.uk>.
1998-08-10 19:17:34 +00:00
Paul Smith
5d1d6aa6de Attempt to add back ^M's. 1998-07-31 05:18:21 +00:00
Paul Smith
e2403327e9 GNU make release 3.77. 1998-07-30 20:54:47 +00:00
Karl Berry
65a7296e2c * texinfo.tex (\dosubind): Don't do \vskip to preserve \lastskip
unless we are in vertical mode.  Otherwise we might end a
 		paragraph prematurely, and \folio won't get expanded by
 		\output.
 	Report from: "Richard E. Stone" <res@rstone.mn.org>
1998-07-19 14:20:42 +00:00
Karl Berry
99454e6a1e * texinfo.tex: Keep track of how negative the page numbers have
gotten:
	(\lastnegativepageno): New \count register.
	(\startcontents): Use it.
	(\contents, \summarycontents): set it.
1998-07-17 12:00:43 +00:00
Karl Berry
411a01acce * texinfo.tex (\imagexxx): Add some space around the image if it's
by itself.
1998-07-14 19:03:08 +00:00
Karl Berry
33654a7af4 1998-07-09 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* texinfo.tex (chapterzzz): Put a space before the chapter number
	in the message.
	(appendixzzz): Use \putwordAppendix in the message.

Thu Jul  9 08:39:53 1998  Karl Berry  <karl@cs.umb.edu>

	* texinfo.tex (\macro): Globalize assignments since it's done
		inside a group.  From Zack.

Mon Jul  6 17:21:25 1998  Karl Berry  <karl@cs.umb.edu>

	* texinfo.tex (\comment): Speed up.
	(\loggingall): Turn on eTeX's extended tracing.
	More macro fixes.
	Date: Sat, 04 Jul 1998 14:51:49 -0400
	From: Zack Weinberg <zack@rabi.phys.columbia.edu>
1998-07-12 17:28:02 +00:00
Karl Berry
fa1ec9e1f3 * texinfo.tex (\contents, \summarycontents, \startcontents): Use
roman numerals for toc, arabic outside, even when toc is
 		at the beginning.
1998-07-02 14:22:24 +00:00
Karl Berry
fefeb0f7bd * texinfo.tex (\anchor): New command @anchor.
(\xrefX): Avoid double space when xref to an @anchor or an @unnumbered.

	* texinfo.tex (\itemzzz): Use kerns and \unhbox when item text
		fits in the space, so footnotes can work.
1998-07-01 14:28:14 +00:00
Karl Berry
6cca2382f0 * texinfo.tex (\setref): Take additional argument for the -snt
xref.  Call \indexdummies.
	(\donoderef, \appendixnoderef, \unnumbnoderef): Change \setref calls.
1998-06-29 14:07:11 +00:00
Karl Berry
44309109fe * texinfo.tex (\contents, \summarycontents): Must not be \outer. 1998-06-27 23:30:48 +00:00
Karl Berry
d153373039 * texinfo.tex (\writetocentry): New macro.
(\chapternofonts): No longer needed.
	(\chapter, ..., \unnumberedsubsubsec): Change all the sectioning
		commands to call \writetocentry instead of doing it inline.
	Also, do not call \chapternofonts, we avoid expansion with
		\the\toks instead.
	(\opencontents): No longer needed, instead \writetocentry opens
		the file when necessary.
	(\setfilename): Don't call \opencontents.
	(\ifsetcontentsaftertitlepage, \ifsetshortcontentsaftertitlepage):
		New conditionals.
	(\Etitlepage): Call \contents and/or \shortcontents if
		conditionals are set.

	Global: use \nobreak instead of \penalty 10000 for epsilon efficiency.
1998-06-27 19:12:04 +00:00
Karl Berry
ccac245bf5 * texinfo.tex (\acronym): New Texinfo command. 1998-06-25 12:31:28 +00:00
Karl Berry
f106953139 * texinfo.tex (\dots, \enddots): Missing \leavevmode.
Report from: Thomas Esken <esken@nmlab.informatik.fh-dortmund.de>
	Date: Tue, 23 Jun 1998 14:22:27 +0200 (MET DST)
1998-06-24 11:45:50 +00:00
Karl Berry
54727192c0 * texinfo.tex: Rewrite of index stuff to do better column breaking
and balancing.
	The old code failed miserably when the index was just the wrong size,
	e.g., the Autoconf manual with @afourpaper.
	Bug report from: Wilhelm Mueller <muewi@hb.senbvs43.uni-bremen.de>
	Date: Fri, 12 Jun 1998 16:34:49 +0200 (MET DST)
	(\initial): Add more glue around the initial, and make it a
		multiple of \baselineskip.
	(\entry): Add glue before each entry so the columns can always be the
	 same height.
	(\doublecolumnout): Available space no longer needs to handle
	 \partialpage specially.
	(\pagesofar): Take \ht\partialpage into account with \vsize.
	(\enddoublecolumns): Reset \output to avoid calling
		\balancecolumns twice
	(\balancecolumns): Format for readability.
	(\initialskipamount): No longer needed, remove.

	(\hbadness): Increase a bit, boxes that are a little underfull look ok.
1998-06-23 14:28:30 +00:00
Karl Berry
20258f42d4 * texinfo.tex (\ninettsl): cmsltt10 is not standard, so use
cmsltt10 scaled 900.
 	Date: Mon, 15 Jun 1998 12:35:41 +0200 (MET DST)
 	From: Werner Struckmann <struck@ips.cs.tu-bs.de>.
1998-06-22 13:00:05 +00:00
Karl Berry
4f79de612b * texinfo.tex: @macro fixes from Zack Weinberg
<zack@rabi.phys.columbia.edu>.
 	- @ifblah did not work inside @macro
        - spaces in parameter lists in macro definitions caused errors
        - leading spaces in parameter lists in macro invocations were
	  preserved inappropriately.
1998-06-19 11:50:37 +00:00
Karl Berry
ea9504a609 * texinfo.tex (\smallformatx, \smalldisplayx): New macros.
(\smallbook): Arrange to use them.
	(\display, \flushleft, etc.): Rewrite to avoid duplication.
1998-06-12 19:10:27 +00:00
Karl Berry
511cb55530 * texinfo.tex (\pagesizes): Rename to \internalpagesizes.
(\custompaper): Rename to \pagesizes.
1998-06-08 21:37:20 +00:00
Karl Berry
65d7b12aeb * texinfo.tex: Rewrite paper size definitions, add @custompaper.
* texinfo.tex: Fix for macros in arguments to other commands.
  		From Zack.
1998-06-07 13:35:32 +00:00
Karl Berry
2968844002 * texinfo.tex: Better @macro implementation.
From: Zack Weinberg <zack@rabi.phys.columbia.edu>.
1998-06-05 20:10:04 +00:00
Karl Berry
a709205e81 * texinfo.tex (\imagexxx): Center image if it is not part of a
paragraph.
1998-05-27 21:04:33 +00:00
Karl Berry
9391fb8e4c Tue May 19 17:17:12 1998 Karl Berry <karl@cs.umb.edu>
* texinfo.tex: \linkstrue by default.
	Also, first implementation of @macro; can only handle some cases,
 		but that is better than nothing.
	From: Zack Weinberg <zack@rabi.phys.columbia.edu>

Thu May 14 17:32:47 1998  Karl Berry  <karl@cs.umb.edu>

	* texinfo.tex: New command @novalidate along the lines of makeinfo
		--no-validate.
	Date: Sun, 26 Oct 1997 18:54:47 -0500
	From: Zack Weinberg <zack@rabi.phys.columbia.edu>
1998-05-19 21:26:03 +00:00
Ulrich Drepper
4950159344 automatically generated from GPLed version 1998-05-19 07:09:32 +00:00
Karl Berry
91da8b09df * texinfo.tex (\valuexxx): Split up into expandable and
non-expandable parts.
	(\expandablevalue): New macro.
	(\indexdummies): \let\value = \expandable value.

	* texinfo.tex: Doc fixes.

	* texinfo.tex (\doind): Just call \dosubind with empty third arg.
	(\dosubind): Replace with \doind definition and suitable code to handle
	possible third arg.  And propagate glue past the whatsit from the
 	\write so index entries don't cause extra space between
 	@defuns (for example).

Wed May  6 12:51:27 1998  Karl Berry  <karl@cs.umb.edu>

	* texinfo.tex (\deftypemethparsebody): Handle the extra arg in
 	@deftypemethodx, too.
	(\deftypefunx): Error definition was misspelled as \deftypeunx.
1998-05-13 12:44:07 +00:00
Karl Berry
e3e88767f1 (\putwordon, \putwordMethodon): New macros.
* texinfo/texinfo.tex (\putwordon, \putwordMethodon): New macros.
  	Use in \def... commands.
	(\indexdummies): make `\ ' be just ` ' for sorting.
	(\deftypemethparsebody): New macro.
	(\defmethod): Call it.
	Various doc fixes.
	Repored by: KHMarbaise@p69.ks.fido.de (Karl Heinz Marbaise)
	Date: Wed, 07 Jan 1998 10:19:42 +0100
1998-05-02 14:14:31 +00:00
Ulrich Drepper
76ae1bc064 automatically generated from GPLed version 1998-04-27 23:45:12 +00:00
Ulrich Drepper
e24c9e161a automatically generated from GPLed version 1998-04-27 23:45:12 +00:00
Ulrich Drepper
f0a7421adc automatically generated from GPLed version 1998-04-13 23:54:17 +00:00
Ulrich Drepper
8204f56f2f automatically generated from GPLed version 1998-04-13 23:54:16 +00:00
Karl Berry
e97f8e6f57 @cartouche: Align right side correctly.
From: dale.smith@bellhow.com (Dale Smith)
Date: Fri, 06 Mar 1998 14:47:02 GMT
1998-04-10 20:54:46 +00:00
Karl Berry
20b68e968a (\dosetq): Use \normalturnoffactive instead of just \turnoffactive,
so \'s in node names are handled properly.
(\tie): Move definition to more rational position in the file.
(\@, \{, etc.): Use decimal numbers in all cases, to avoid use of '.
Paranoia only.
(\+): Turn off once and for all at the beginning, and define as
\tabalign in @tex.
1998-04-05 21:19:01 +00:00
Karl Berry
9d31f1e1f1 (\synindex, \syncodeindex): \closeout the redirected index.
From: Jakob Stoklund Olesen <stoklund@mi.aau.dk>
1998-04-01 00:36:53 +00:00
Karl Berry
2fcce1d3b0 (\doignore): Ignore everything after `c', so @end ifinfo and the like
can be commented out.
(\macrocsname): New macro.
Reported by: "James A. Lupo" <lupoja@feynman.ml.wpafb.af.mil>
1998-04-01 00:33:30 +00:00
Karl Berry
1290679bc3 (\doprintindex): Change catcode of @ before \read, in case of
\initial{@} being the line that is read.
Reported by: Drew Csillag <drew_csillag@geocities.com>
1998-02-25 22:54:34 +00:00
Karl Berry
dc70a3bc0b (\dotable): Don't inherit \rightskip from
surrounding environment.  Add \leftskip to \hsize in the first
column.  Set \item to \crcr to avoid empty first row.  Prepend
\parskip glue before table.  Set \everycr locally outside of
alignment, don't reset it explicitly in \Emultitable.
From Andreas Schwab.

Also, work on leading commentary in file a bit.
1998-02-25 20:48:50 +00:00
Karl Berry
aa9ec7c2c7 \!: Save and restore this for @tex.
From: Jean-Pierre Moreau <jpmoreau@ciframedical.com>
Date: Fri, 22 Aug 1997 16:47:36 -0400
1998-02-24 23:05:08 +00:00
Karl Berry
04c488df1c (\angleleft, \angleright): New macros.
(\refx, \email, \key): Use them.
From: Stephen Gildea <gildea@intouchsys.com>
Date: Fri, 26 Dec 1997 11:43:32 EST
1998-02-24 22:48:24 +00:00
Karl Berry
8de0e41662 1997-08-28 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* doc/texinfo.tex (xrdef): Read the second argument with \ as an
	escape character.
1998-02-23 22:34:20 +00:00
Karl Berry
e94d73997a (\tocentry): Don't \turnoffactive before
typesetting the arguments, it causes special characters to be
printed incorrectly.
1998-01-26 20:40:21 +00:00
Karl Berry
7585dedefc (\dots, \enddots): Use current font instead of always using math italic. 1997-12-24 18:59:06 +00:00
Karl Berry
57ba55d08c Spurious xepsf.tex should be epsf.tex. 1997-12-23 16:33:04 +00:00
Ulrich Drepper
886748c02d automatically generated from GPLed version 1997-12-04 01:16:52 +00:00
Ulrich Drepper
d378e4204d automatically generated from GPLed version 1997-11-06 00:43:09 +00:00
Karl Heuer
e7e9b799c4 Mention YFLAGS and LFLAGS along with CFLAGS. 1997-10-27 03:47:03 +00:00
Karl Berry
a3a7581c1a (\titlefont): Explicitly set \rm. 1997-10-13 19:49:25 +00:00
Paul Smith
3e12cad198 Quick changes for make 3.76.1. 1997-09-19 19:47:55 +00:00
82 changed files with 14548 additions and 7640 deletions

View File

@@ -11,7 +11,16 @@ makebook*
*.dep *.dvi *.toc *.aux *.log *.dep *.dvi *.toc *.aux *.log
*.cp *.cps *.fn *.fns *.vr *.vrs *.tp *.tps *.ky *.kys *.pg *.pgs *.cp *.cps *.fn *.fns *.vr *.vrs *.tp *.tps *.ky *.kys *.pg *.pgs
README aclocal.m4 config.h.in config.h configure Makefile.in
build.sh.in build.sh SMakefile config.ami README.DOS Makefile.DOS configh.dos
NMakefile config.h.W32 config.h-vms
.deps .dep_segment
_*
sun4 i386 i386-netbsd hp300-netbsd hp300 rs6000 sun3 news800 amiga sun4 i386 i386-netbsd hp300-netbsd hp300 rs6000 sun3 news800 amiga
hp700 hp834 mips sol2 i486-linux hp700 hp834 mips sol2 i486-linux
customs customs
install-sh mkinstalldirs

12
.purify Normal file
View File

@@ -0,0 +1,12 @@
# Solaris (2.5.1) has a couple if issues.
#
suppress plk malloc; setvbuf "libc*"; main "main.c"
suppress umr kstat_read; kstat_chain_update; kstat_open; getloadavg
suppress umr kstat_chain_update; kstat_open; getloadavg
# The command line options stuff leaks a little bit. No big deal.
#
suppress mlk malloc; xmalloc "misc.c"; decode_env_switches "main.c"
suppress plk malloc; xmalloc "misc.c"; decode_env_switches "main.c"
suppress mlk malloc; xmalloc "misc.c"; concat "misc.c"; decode_env_switches "main.c"
suppress plk malloc; xmalloc "misc.c"; concat "misc.c"; decode_env_switches "main.c"

32
AUTHORS
View File

@@ -1,28 +1,31 @@
----------------------------------- -----------------------------------
GNU make development up to version 3.75 by: GNU make development up to version 3.75 by:
Roland McGrath <roland@gnu.ai.mit.edu> Roland McGrath <roland@gnu.org>
GNU Make User's Manual written by: Development starting with GNU make 3.76 by:
Richard M. Stallman <rms@gnu.ai.mit.edu> Paul D. Smith <psmith@gnu.org>
User's Manual edited by:
Roland McGrath <roland@gnu.ai.mit.edu>
Bob Chassell <bob@gnu.ai.mit.edu>
Melissa Weisshaus <melissa@gnu.ai.mit.edu>
Development and maintenance starting with GNU make 3.76 by: GNU Make User's Manual
Paul D. Smith <psmith@gnu.ai.mit.edu> Written by:
Richard M. Stallman <rms@gnu.org>
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: GNU make porting efforts:
Port to VMS by: Port to VMS by:
Klaus Kaempf <kkaempf@progis.de> Klaus Kaempf <kkaempf@progis.de>
Archive support/Bug fixes by John W. Eaton <jwe@bevo.che.wisc.edu> Archive support/Bug fixes by:
John W. Eaton <jwe@bevo.che.wisc.edu>
Martin Zinser <zinser@decus.decus.de>
Port to Amiga by: Port to Amiga by:
Aaron Digulla <digulla@fh-konstanz.de> Aaron Digulla <digulla@fh-konstanz.de>
@@ -37,11 +40,14 @@ GNU Make porting efforts:
Other contributors: Other contributors:
Janet Carson <janet_carson@tivoli.com> Janet Carson <janet_carson@tivoli.com>
Paul Eggert <eggert@twinsun.com> Howard Chu <hyc@highlandsun.com>
Paul Eggert <eggert@twinsun.com>
Klaus Heinz <kamar@ease.rhein-main.de> Klaus Heinz <kamar@ease.rhein-main.de>
Michael Joosten Michael Joosten
Jim Kelton <jim_kelton@tivoli.com> Jim Kelton <jim_kelton@tivoli.com>
David Lubbren <uhay@rz.uni-karlsruhe.de> David Lubbren <uhay@rz.uni-karlsruhe.de>
Tim Magill <tim.magill@telops.gte.com>
Han-Wen Nienhuys <hanwen@cs.uu.nl>
Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
Carl Staelin (Princeton University) Carl Staelin (Princeton University)
Ian Stewartson (Data Logic Limited) Ian Stewartson (Data Logic Limited)

1497
ChangeLog

File diff suppressed because it is too large Load Diff

View File

@@ -1,54 +0,0 @@
# This is a maintainer's-only makefile
#
# It bootstraps a GNU make maintainer's directory
#
.SUFFIXES:
NORECURSE = true
# If the user asked for a specific target, invoke the Mkaefile instead.
#
.DEFAULT:
@[ -f Makefile.in -a -f configure -a -f aclocal.m4 -a -f config.h.in ] \
|| $(MAKE) __cfg NORECURSE=
@[ -f Makefile ] \
|| ./configure
$(MAKE) -f Makefile $@
.PHONY: __cfg __cfg_basic TAGS
# This is variable since the glob subdirectory doesn't use it.
#
ACCONFIG = acconfig.h
__cfg: __cfg_basic config.h.in TAGS
cd glob && $(MAKE) -f ../GNUmakefile __cfg_basic ACCONFIG=
ifdef NORECURSE
@echo ""; echo "Now you should run one of:"; echo ""; \
echo " make all"; \
echo " make dist"; \
echo " make distdir"; \
echo " make distcheck"; echo ""; \
echo "Or similar to proceed.";\
echo ""
endif
__cfg_basic: aclocal.m4 stamp-h.in configure Makefile.in
aclocal.m4: configure.in
aclocal
config.h.in: stamp-h.in
stamp-h.in: configure.in aclocal.m4 $(ACCONFIG)
autoheader
echo timestamp > $@
configure: configure.in aclocal.m4
autoconf
Makefile.in: configure.in config.h.in Makefile.am aclocal.m4
automake --add-missing
TAGS:
find . -name '*.[ch]' -print | etags -

10
INSTALL
View File

@@ -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

View File

@@ -1,7 +1,7 @@
# -*-Makefile-*- template for DJGPP # -*-Makefile-*- template for DJGPP
# Makefile.in generated automatically by automake 1.2 from Makefile.am # Makefile.in generated automatically by automake 1.2 from Makefile.am
# Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc. # Copyright (C) 1994, 1995-1998, 1999 Free Software Foundation, Inc.
# This Makefile.DOS is free software; the Free Software Foundation # This Makefile.DOS is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it. # gives unlimited permission to copy, distribute and modify it.
@@ -41,12 +41,12 @@ transform = s,x,x,
# get "Error -1" instead of "Error 1". # get "Error -1" instead of "Error 1".
EXIT_FAIL = false EXIT_FAIL = false
NORMAL_INSTALL = true NORMAL_INSTALL = :
PRE_INSTALL = true PRE_INSTALL = :
POST_INSTALL = true POST_INSTALL = :
NORMAL_UNINSTALL = true NORMAL_UNINSTALL = :
PRE_UNINSTALL = true PRE_UNINSTALL = :
POST_UNINSTALL = true POST_UNINSTALL = :
AR = ar AR = ar
CC = gcc CC = gcc
CPP = gcc -E CPP = gcc -E
@@ -67,12 +67,13 @@ libglob_a_SOURCES = %GLOB_SOURCES%
make_LDADD = glob/libglob.a make_LDADD = glob/libglob.a
info_TEXINFOS = make.texinfo info_TEXINFOS = make.texinfo
man_MANS = make.1
INCLUDES = -I$(srcdir)/glob -DLIBDIR=\"c:/djgpp/lib\" -DINCLUDEDIR=\"c:/djgpp/include\" INCLUDES = -I$(srcdir)/glob -DLIBDIR=\"c:/djgpp/lib\" -DINCLUDEDIR=\"c:/djgpp/include\"
BUILT_SOURCES = README build.sh.in BUILT_SOURCES = README build.sh.in
EXTRA_DIST = make.man $(BUILT_SOURCES) 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 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 SUBDIRS = glob
mkinstalldirs = ${bindir}/gmkdir -p mkinstalldirs = ${bindir}/gmkdir -p
@@ -99,6 +100,10 @@ TEXINFO_TEX = $(srcdir)/texinfo.tex
INFO_DEPS = make.info INFO_DEPS = make.info
DVIS = make.dvi DVIS = make.dvi
TEXINFOS = make.texinfo 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 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
@@ -113,17 +118,21 @@ HEADERS = $(wildcard $(srcdir)/*.h)
default: all default: all
.SUFFIXES: .SUFFIXES:
.SUFFIXES: .c .dvi .info .o .ps .texi .texinfo .SUFFIXES: .S .c .dvi .info .o .ps .s .texi .texinfo .txi
mostlyclean-hdr:
clean-hdr:
distclean-hdr: distclean-hdr:
rm -f config.h -rm -f config.h
maintainer-clean-hdr: maintainer-clean-hdr:
mostlyclean-binPROGRAMS: mostlyclean-binPROGRAMS:
clean-binPROGRAMS: clean-binPROGRAMS:
test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
distclean-binPROGRAMS: distclean-binPROGRAMS:
@@ -131,26 +140,32 @@ maintainer-clean-binPROGRAMS:
install-binPROGRAMS: $(bin_PROGRAMS) install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL) @$(NORMAL_INSTALL)
$(mkinstalldirs) $(bindir) $(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 @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: uninstall-binPROGRAMS:
$(NORMAL_UNINSTALL) $(NORMAL_UNINSTALL)
list='$(bin_PROGRAMS)'; for p in $$list; do rm -f $(bindir)/`echo $$p|sed '$(transform)'`; done list='$(bin_PROGRAMS)'; for p in $$list; do rm -f $(bindir)/`echo $$p|sed '$(transform)'`.exe; done
.c.o: .c.o:
$(COMPILE) -c $< $(COMPILE) -c $<
.s.o:
$(COMPILE) -c $<
.S.o:
$(COMPILE) -c $<
clean-noinstLIBRARIES: clean-noinstLIBRARIES:
test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
mostlyclean-compile: mostlyclean-compile:
rm -f *.o *.exe make.new core -rm -f *.o *.exe make.new core
clean-compile: clean-compile:
distclean-compile: distclean-compile:
rm -f *.tab.c -rm -f *.tab.c *_tab.c
maintainer-clean-compile: maintainer-clean-compile:
@@ -183,27 +198,35 @@ DVIPS = dvips
.texinfo.dvi: .texinfo.dvi:
TEXINPUTS="$(srcdir);$$TEXINPUTS" MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< TEXINPUTS="$(srcdir);$$TEXINPUTS" MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
.txi.info:
$(MAKEINFO) $(srcdir)/$< -o ./$@
.txi.dvi:
TEXINPUTS="$(srcdir);$$TEXINPUTS" MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
.dvi.ps: .dvi.ps:
$(DVIPS) $< -o $@ $(DVIPS) $< -o $@
install-info-am: $(INFO_DEPS) install-info-am: $(INFO_DEPS)
@$(NORMAL_INSTALL) @$(NORMAL_INSTALL)
$(mkinstalldirs) $(infodir) $(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 $(infodir)/$$ifile"; $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile; else : ; fi; done; done @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) @$(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=$(infodir) $(infodir)/$$file"; install-info --info-dir=$(infodir) $(infodir)/$$file || :; done; else : ; fi @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: uninstall-info:
$(PRE_UNINSTALL) $(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=$(infodir) --remove $$file; done @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) $(NORMAL_UNINSTALL)
for file in $(INFO_DEPS) make.i; do (cd $(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9] $$file[0-9] $$file[0-9][0-9]); done 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) 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 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: mostlyclean-aminfo:
rm -f make.aux make.cp make.cps make.dvi make.fn make.fns make.ky make.log make.pg make.toc make.tp make.tps make.vr make.vrs make.op make.tr make.cv -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: clean-aminfo:
@@ -212,6 +235,45 @@ distclean-aminfo:
maintainer-clean-aminfo: maintainer-clean-aminfo:
for i in $(INFO_DEPS) make.i; do rm -f `eval echo $$i*`; done 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, # 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 # but do a sanity check: if $SUBDIRS will ever have more than
# a single directory, yell bloody murder. # a single directory, yell bloody murder.
@@ -266,7 +328,7 @@ mostlyclean-tags:
clean-tags: clean-tags:
distclean-tags: distclean-tags:
rm -f TAGS ID -rm -f TAGS ID
maintainer-clean-tags: maintainer-clean-tags:
@@ -299,32 +361,6 @@ distdir: $(DISTFILES)
@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 @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-info
$(MAKE) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-hook $(MAKE) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-hook
alloca.o alloca.lo: alloca.c config.h
ar.o ar.lo: ar.c make.h config.h filedef.h dep.h glob/fnmatch.h
arscan.o arscan.lo: arscan.c make.h config.h
commands.o commands.lo: commands.c make.h config.h dep.h filedef.h variable.h job.h commands.h
default.o default.lo: default.c make.h config.h rule.h dep.h filedef.h job.h commands.h variable.h
dir.o dir.lo: dir.c make.h config.h glob/glob.h
expand.o expand.lo: expand.c make.h config.h filedef.h job.h commands.h variable.h
file.o file.lo: file.c make.h config.h dep.h filedef.h job.h commands.h variable.h
function.o function.lo: function.c make.h config.h filedef.h variable.h dep.h job.h commands.h
getloadavg.o getloadavg.lo: getloadavg.c config.h
getopt.o getopt.lo: getopt.c config.h getopt.h
getopt1.o getopt1.lo: getopt1.c config.h getopt.h
implicit.o implicit.lo: implicit.c make.h config.h rule.h dep.h filedef.h
job.o job.lo: job.c make.h config.h job.h filedef.h commands.h variable.h
main.o main.lo: main.c make.h config.h dep.h filedef.h variable.h job.h commands.h getopt.h
misc.o misc.lo: misc.c make.h config.h dep.h
read.o read.lo: read.c make.h config.h dep.h filedef.h job.h commands.h variable.h glob/glob.h
remake.o remake.lo: remake.c make.h config.h filedef.h job.h commands.h dep.h
remote-stub.o remote-stub.lo: remote-stub.c make.h config.h filedef.h job.h commands.h
rule.o rule.lo: rule.c make.h config.h dep.h filedef.h job.h commands.h variable.h rule.h
signame.o signame.lo: signame.c config.h signame.h
variable.o variable.lo: variable.c make.h config.h dep.h filedef.h job.h commands.h variable.h
version.o version.lo: version.c config.h
vpath.o vpath.lo: vpath.c make.h config.h filedef.h variable.h
fnmatch.o fnmatch.lo: fnmatch.c fnmatch.h ../config.h
glob.o glob.lo: glob.c fnmatch.h glob.h ../config.h
info: $(INFO_DEPS) info-recursive info: $(INFO_DEPS) info-recursive
dvi: $(DVIS) dvi-recursive dvi: $(DVIS) dvi-recursive
@@ -362,19 +398,19 @@ installdirs: installdirs-recursive
mostlyclean-generic: mostlyclean-generic:
test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic: clean-generic:
test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic: distclean-generic:
rm -f Makefile $(DISTCLEANFILES) -rm -f Makefile $(DISTCLEANFILES)
rm -f config.cache config.log stamp-h stamp-h[0-9]* -rm -f config.cache config.log stamp-h stamp-h[0-9]*
test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic: maintainer-clean-generic:
test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
mostlyclean-am: mostlyclean-hdr mostlyclean-binPROGRAMS mostlyclean-compile mostlyclean-aminfo mostlyclean-tags mostlyclean-generic 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 clean-am: clean-hdr clean-binPROGRAMS clean-compile clean-aminfo clean-tags clean-generic mostlyclean-am

View File

@@ -1,6 +1,6 @@
# -*-Makefile-*-, or close enough # This is a -*-Makefile-*-, or close enough
AUTOMAKE_OPTIONS = 1.2 AUTOMAKE_OPTIONS = 1.4
bin_PROGRAMS = make bin_PROGRAMS = make
@@ -10,15 +10,14 @@ make_SOURCES = main.c commands.c job.c dir.c file.c misc.c read.c remake.c \
commands.h dep.h filedef.h job.h make.h rule.h variable.h \ commands.h dep.h filedef.h job.h make.h rule.h variable.h \
signame.c signame.h \ signame.c signame.h \
getopt.c getopt1.c getopt.h getopt.c getopt1.c getopt.h
make_LDADD = @LIBOBJS@ @ALLOCA@ glob/libglob.a make_LDADD = @LIBOBJS@ @ALLOCA@ @GLOBLIB@
info_TEXINFOS = make.texinfo info_TEXINFOS = make.texinfo
man_MANS = make.1
INCLUDES = -I$(srcdir)/glob -DLIBDIR=\"$(libdir)\" -DINCLUDEDIR=\"$(includedir)\" INCLUDES = -DLIBDIR=\"$(libdir)\" -DINCLUDEDIR=\"$(includedir)\"
BUILT_SOURCES = README build.sh.in EXTRA_DIST = README build.sh.in $(man_MANS) README.customs remote-cstms.c\
EXTRA_DIST = make.man $(BUILT_SOURCES) remote-cstms.c\
make-stds.texi texinfo.tex SCOPTIONS SMakefile\ make-stds.texi texinfo.tex SCOPTIONS SMakefile\
README.Amiga Makefile.ami config.ami make.lnk amiga.c amiga.h\ README.Amiga Makefile.ami config.ami make.lnk amiga.c amiga.h\
README.DOS Makefile.DOS configure.bat dosbuild.bat configh.dos\ README.DOS Makefile.DOS configure.bat dosbuild.bat configh.dos\
@@ -28,13 +27,46 @@ EXTRA_DIST = make.man $(BUILT_SOURCES) remote-cstms.c\
SUBDIRS = glob 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 # --------------- Local DIST Section
# Install the w32 subdirectory # Install the w32 subdirectory
# #
dist-hook: dist-hook:
(cd $(srcdir); \ (cd $(srcdir); \
w32=`find w32 -follow \( -name CVS -prune \) -o -type f -print`; \ w32=`find w32 -follow \( -name CVS -prune \) -o \( -name \*.orig -o -name \*.rej -o -name \*~ -prune \) -o -type f -print`; \
tar chf - $$w32) \ tar chf - $$w32) \
| (cd $(distdir); tar xfBp -) | (cd $(distdir); tar xfBp -)
@@ -49,11 +81,14 @@ check-local: check-loadavg check-regression
loadavg: loadavg.c config.h loadavg: loadavg.c config.h
@rm -f loadavg @rm -f loadavg
$(LINK) -I. -I$(srcdir) -DHAVE_CONFIG_H -DTEST $(make_LDFLAGS) loadavg.c $(LIBS) $(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 # We copy getloadavg.c into a different file rather than compiling it
# directly because some compilers clobber getloadavg.o in the process. # directly because some compilers clobber getloadavg.o in the process.
#
loadavg.c: getloadavg.c loadavg.c: getloadavg.c
ln $(srcdir)/getloadavg.c loadavg.c || \ ln $(srcdir)/getloadavg.c loadavg.c || \
cp $(srcdir)/getloadavg.c loadavg.c cp $(srcdir)/getloadavg.c loadavg.c
check-loadavg: loadavg check-loadavg: loadavg
@echo The system uptime program believes the load average to be: @echo The system uptime program believes the load average to be:
-uptime -uptime
@@ -66,8 +101,10 @@ check-loadavg: loadavg
# specified, or else in the srcdir or the distdir, their parents, and _their_ # specified, or else in the srcdir or the distdir, their parents, and _their_
# parents. # parents.
# #
check-regression: MAKETESTFLAGS =
here=`pwd`; testdir=""; \
check-regression: all
@here=`pwd`; testdir=""; \
case "$(MAKE_TEST)" in "") \ case "$(MAKE_TEST)" in "") \
for d1 in $$here $(srcdir); do \ for d1 in $$here $(srcdir); do \
for d2 in ../.. .. .; do \ for d2 in ../.. .. .; do \
@@ -80,16 +117,18 @@ check-regression:
*) testdir="$(MAKE_TEST)" ;; \ *) testdir="$(MAKE_TEST)" ;; \
esac; \ esac; \
case "$$testdir" in \ case "$$testdir" in \
"") echo "Couldn't find make-test-* test suite."; exit 0;; \ "") echo "Couldn't find make-test-* regression test suite."; exit 0;; \
esac; \ esac; \
echo "cd $$testdir && ./run_make_tests -make_path $$here/make"; \ echo "cd $$testdir && ./run_make_tests -make $$here/make $(MAKETESTFLAGS)"; \
cd $$testdir && ./run_make_tests -make_path $$here/make cd $$testdir && ./run_make_tests -make $$here/make $(MAKETESTFLAGS)
# --------------- Local CLEAN section
maintainer-clean-local:
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
# --------------- Maintainer's Section # --------------- Maintainer's Section
if MAINT_MAKEFILE @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

View File

@@ -16,7 +16,8 @@
# #
# 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, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
# #
# Makefile for GNU Make # Makefile for GNU Make
@@ -245,7 +246,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

117
NEWS
View File

@@ -1,11 +1,105 @@
GNU make NEWS -*-indented-text-*- GNU make NEWS -*-indented-text-*-
History of user-visible changes. History of user-visible changes.
18 Aug 1997 21 Jul 1999
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc. Copyright (C) 1992,93,94,95,96,97,98,1999 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. All changes mentioned here are more fully described in the GNU make
manual, which is contained in this distribution as the file make.texinfo.
Please send GNU make bug reports to bug-make@gnu.org.
Version 3.78
* Two new functions, $(error ...) and $(warning ...) are available. The
former will cause make to fail and exit immediately upon expansion of
the function, with the text provided as the error message. The latter
causes the text provided to be printed as a warning message, but make
proceeds normally.
* A new function $(call ...) is available. This allows users to create
their own parameterized macros and invoke them later. Original
implementation of this function was provided by Han-Wen Nienhuys
<hanwen@cs.uu.nl>.
* A new function $(if ...) is available. It provides if-then-else
capabilities in a builtin function. Original implementation of this
function was provided by Han-Wen Nienhuys <hanwen@cs.uu.nl>.
* Make defines a new variable, .LIBPATTERNS. This variable controls how
library dependency expansion (dependencies like ``-lfoo'') is performed.
* Make accepts CRLF sequences as well as traditional LF, for
compatibility with makefiles created on other operating systems.
* Make accepts a new option: -R, or --no-builtin-variables. This option
disables the definition of the rule-specific builtin variables (CC,
LD, AR, etc.). Specifying this option forces -r (--no-builtin-rules)
as well.
* A "job server" feature, suggested by Howard Chu <hyc@highlandsun.com>.
On systems that support POSIX pipe(2) semantics, GNU make can now pass
-jN options to submakes rather than forcing them all to use -j1. The
top make and all its sub-make processes use a pipe to communicate with
each other to ensure that no more than N jobs are started across all
makes. To get the old behavior of -j back, you can configure make
with the --disable-job-server option.
* The confusing term "dependency" has been replaced by the more accurate
and standard term "prerequisite", both in the manual and in all GNU make
output.
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 Version 3.76
@@ -609,18 +703,11 @@ Version 3.05
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright information: Copyright information:
Copyright (C) 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
Permission is granted to anyone to make or distribute verbatim copies Permission is granted to anyone to make or distribute verbatim copies
of this document as received, in any medium, provided that the of this document as received, in any medium, provided that the
copyright notice and this permission notice are preserved, copyright notice and this permission notice are preserved, thus
thus giving the recipient permission to redistribute in turn. giving the recipient permission to redistribute in turn.
Permission is granted to distribute modified versions Permission is granted to distribute modified versions of this
of this document, or of portions of it, document, or of portions of it, under the above conditions, provided
under the above conditions, provided also that they also that they carry prominent notices stating who last changed them.
carry prominent notices stating who last changed them.
Local variables:
version-control: never
end:

View File

@@ -1,141 +1,119 @@
# 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,96,97 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
# 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.
# #
# 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, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
#
# NMakefile for GNU Make #
# # NMakefile for GNU Make
#
LINK = link
CC = cl LINK = link
CC = cl
OUTDIR=.
MAKEFILE=NMakefile OUTDIR=.
SUBPROC_MAKEFILE=NMakefile MAKEFILE=NMakefile
SUBPROC_MAKEFILE=NMakefile
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_any = /nologo /MT /W3 /GX /Zi /YX /I . /I glob /I w32/include /D WIN32 /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H
CFLAGS_release = $(CFLAGS_any) /O2 /D NDEBUG /FR.\WinRel/ /Fp.\WinRel/make.pch /Fo.\WinRel/ 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/
LDFLAGS_debug = w32\subproc\WinDebug\subproc.lib /NOLOGO /SUBSYSTEM:console\
/INCREMENTAL:no /PDB:WinDebug/make.pdb /MACHINE:I386 \ LDFLAGS_debug = w32\subproc\WinDebug\subproc.lib /NOLOGO /SUBSYSTEM:console\
/OUT:WinDebug/make.exe /DEBUG /INCREMENTAL:no /PDB:WinDebug/make.pdb /MACHINE:I386 \
LDFLAGS_release = w32\subproc\WinRel\subproc.lib /NOLOGO /SUBSYSTEM:console\ /OUT:WinDebug/make.exe /DEBUG
/INCREMENTAL:no /MACHINE:I386 /OUT:WinRel/make.exe LDFLAGS_release = w32\subproc\WinRel\subproc.lib /NOLOGO /SUBSYSTEM:console\
/INCREMENTAL:no /MACHINE:I386 /OUT:WinRel/make.exe
all: config.h subproc Release Debug
all: config.h subproc Release Debug
#
# Make sure we build the subproc library first. It has it's own #
# makefile. To be portable to Windows 95, we put the instructions # Make sure we build the subproc library first. It has it's own
# on how to build the library into a batch file. On NT, we could # makefile. To be portable to Windows 95, we put the instructions
# simply have done foo && bar && dog, but this doesn't port. # on how to build the library into a batch file. On NT, we could
# # simply have done foo && bar && dog, but this doesn't port.
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:
subproc.bat $(SUBPROC_MAKEFILE) w32/subproc/WinDebug/subproc.lib w32/subproc/WinRel/subproc.lib:
subproc.bat $(SUBPROC_MAKEFILE) $(MAKE)
config.h: config.h.W32
copy $? $@ config.h: config.h.W32
copy $? $@
Release:
nmake /f $(MAKEFILE) LDFLAGS="$(LDFLAGS_release)" CFLAGS="$(CFLAGS_release)" OUTDIR=WinRel WinRel/make.exe Release:
Debug: $(MAKE) /f $(MAKEFILE) LDFLAGS="$(LDFLAGS_release)" CFLAGS="$(CFLAGS_release)" OUTDIR=WinRel WinRel/make.exe
nmake /f $(MAKEFILE) LDFLAGS="$(LDFLAGS_debug)" CFLAGS="$(CFLAGS_debug)" OUTDIR=WinDebug WinDebug/make.exe Debug:
$(MAKE) /f $(MAKEFILE) LDFLAGS="$(LDFLAGS_debug)" CFLAGS="$(CFLAGS_debug)" OUTDIR=WinDebug WinDebug/make.exe
clean:
rmdir /s /q WinDebug WinRel clean:
rmdir /s /q w32\subproc\WinDebug w32\subproc\WinRel rmdir /s /q WinDebug WinRel
erase config.h rmdir /s /q w32\subproc\WinDebug w32\subproc\WinRel
erase config.h
$(OUTDIR): erase *.pdb
if not exist .\$@\nul mkdir .\$@
$(OUTDIR):
LIBS = kernel32.lib user32.lib advapi32.lib if not exist .\$@\nul mkdir .\$@
OBJS = \ LIBS = kernel32.lib user32.lib advapi32.lib
$(OUTDIR)/ar.obj \
$(OUTDIR)/arscan.obj \ OBJS = \
$(OUTDIR)/commands.obj \ $(OUTDIR)/ar.obj \
$(OUTDIR)/default.obj \ $(OUTDIR)/arscan.obj \
$(OUTDIR)/dir.obj \ $(OUTDIR)/commands.obj \
$(OUTDIR)/expand.obj \ $(OUTDIR)/default.obj \
$(OUTDIR)/file.obj \ $(OUTDIR)/dir.obj \
$(OUTDIR)/function.obj \ $(OUTDIR)/expand.obj \
$(OUTDIR)/getloadavg.obj \ $(OUTDIR)/file.obj \
$(OUTDIR)/getopt.obj \ $(OUTDIR)/function.obj \
$(OUTDIR)/getopt1.obj \ $(OUTDIR)/getloadavg.obj \
$(OUTDIR)/implicit.obj \ $(OUTDIR)/getopt.obj \
$(OUTDIR)/job.obj \ $(OUTDIR)/getopt1.obj \
$(OUTDIR)/main.obj \ $(OUTDIR)/implicit.obj \
$(OUTDIR)/misc.obj \ $(OUTDIR)/job.obj \
$(OUTDIR)/read.obj \ $(OUTDIR)/main.obj \
$(OUTDIR)/remake.obj \ $(OUTDIR)/misc.obj \
$(OUTDIR)/remote-stub.obj \ $(OUTDIR)/read.obj \
$(OUTDIR)/rule.obj \ $(OUTDIR)/remake.obj \
$(OUTDIR)/signame.obj \ $(OUTDIR)/remote-stub.obj \
$(OUTDIR)/variable.obj \ $(OUTDIR)/rule.obj \
$(OUTDIR)/version.obj \ $(OUTDIR)/signame.obj \
$(OUTDIR)/vpath.obj \ $(OUTDIR)/variable.obj \
$(OUTDIR)/glob.obj \ $(OUTDIR)/version.obj \
$(OUTDIR)/fnmatch.obj \ $(OUTDIR)/vpath.obj \
$(OUTDIR)/dirent.obj \ $(OUTDIR)/glob.obj \
$(OUTDIR)/pathstuff.obj $(OUTDIR)/fnmatch.obj \
$(OUTDIR)/dirent.obj \
$(OUTDIR)/make.exe: $(OUTDIR) $(OBJS) $(OUTDIR)/pathstuff.obj
$(LINK) @<<
$(LDFLAGS) $(LIBS) $(OBJS) $(OUTDIR)/make.exe: $(OUTDIR) $(OBJS)
<< $(LINK) @<<
$(LDFLAGS) $(LIBS) $(OBJS)
.c{$(OUTDIR)}.obj: <<
$(CC) $(CFLAGS) /c $<
.c{$(OUTDIR)}.obj:
$(OUTDIR)/ar.obj : ar.c make.h filedef.h dep.h $(CC) $(CFLAGS) /c $<
$(OUTDIR)/arscan.obj : arscan.c make.h
$(OUTDIR)/commands.obj : commands.c $(OUTDIR)/glob.obj : glob/glob.c
$(OUTDIR)/default.obj : default.c make.h rule.h dep.h filedef.h job.h commands.h variable.h $(CC) $(CFLAGS) /c $?
$(OUTDIR)/dir.obj : dir.c make.h $(OUTDIR)/fnmatch.obj : glob/fnmatch.c
$(OUTDIR)/expand.obj : expand.c make.h filedef.h job.h commands.h variable.h $(CC) $(CFLAGS) /c $?
$(OUTDIR)/file.obj : file.c make.h dep.h filedef.h job.h commands.h variable.h $(OUTDIR)/dirent.obj : w32/compat/dirent.c
$(OUTDIR)/function.obj : function.c make.h filedef.h variable.h dep.h job.h commands.h $(CC) $(CFLAGS) /c $?
$(OUTDIR)/getloadavg.obj : getloadavg.c $(OUTDIR)/pathstuff.obj : w32/pathstuff.c
$(OUTDIR)/getopt.obj : getopt.c $(CC) $(CFLAGS) /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
$(CC) $(CFLAGS) /c $?
$(OUTDIR)/fnmatch.obj : glob/fnmatch.c
$(CC) $(CFLAGS) /c $?
$(OUTDIR)/dirent.obj : w32/compat/dirent.c
$(CC) $(CFLAGS) /c $?
$(OUTDIR)/pathstuff.obj : w32/pathstuff.c
$(CC) $(CFLAGS) /c $?

View File

@@ -5,7 +5,7 @@ Builds with DJGPP v2 port of GNU C/C++ compiler and utilities.
New (since 3.74) DOS-specific features: New (since 3.74) DOS-specific features:
1. Supports long filenames when run from DOS box on Windows 95. 1. Supports long filenames when run from DOS box on Windows 9x.
2. Supports both stock DOS COMMAND.COM and Unix-style shells 2. Supports both stock DOS COMMAND.COM and Unix-style shells
(details in ``Notes'' below). (details in ``Notes'' below).
@@ -37,6 +37,10 @@ To build:
if you use PKUNZIP). If you build Make on Windows 95, use an if you use PKUNZIP). If you build Make on Windows 95, use an
unzip program that supports long filenames in zip files. 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. 2. Invoke the `configure.bat' batch file.
If you are building Make in-place, i.e. in the same directory If you are building Make in-place, i.e. in the same directory
@@ -44,9 +48,10 @@ To build:
[Enter]. Otherwise, you need to supply the path to the source [Enter]. Otherwise, you need to supply the path to the source
directory as an argument to the batch file, like this: directory as an argument to the batch file, like this:
configure.bat c:/djgpp/gnu/make-3.76 c:\djgpp\gnu\make-%VERSION%\configure.bat c:/djgpp/gnu/make-%VERSION%
Note the forward slashes: you MUST use them here. Note the forward slashes in the source path argument: you MUST
use them here.
3. If configure.bat doesn't find a working Make, it will suggest to 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 use the `dosbuild.bat' batch file to build Make. Either do as it
@@ -65,7 +70,7 @@ To build:
If you are building from outside of the source directory, you If you are building from outside of the source directory, you
need to tell Make where the sources are, like this: need to tell Make where the sources are, like this:
make srcdir=c:/djgpp/gnu/make-3.76 make srcdir=c:/djgpp/gnu/make-%VERSION%
(configure.bat will tell you this when it finishes). You MUST (configure.bat will tell you this when it finishes). You MUST
use a full, not relative, name of the source directory here, or use a full, not relative, name of the source directory here, or
@@ -73,8 +78,8 @@ To build:
6. After Make finishes, if you have a Unix-style shell installed, 6. After Make finishes, if you have a Unix-style shell installed,
you can use the `install' target to install the package. You you can use the `install' target to install the package. You
will also need GNU Fileutils and GNU Sh-utils for this (they will also need GNU Fileutils and GNU Sed for this (they should
should be available from the DJGPP sites). be available from the DJGPP sites).
Without a Unix-style shell, you will have to install programs Without a Unix-style shell, you will have to install programs
and the docs manually. Copy make.exe to a directory on your and the docs manually. Copy make.exe to a directory on your
@@ -82,7 +87,7 @@ To build:
file `dir' in your Info directory by adding the following item file `dir' in your Info directory by adding the following item
to the main menu: to the main menu:
* GNU make: (make.info). The GNU make utility. * Make: (make.info). The GNU make utility.
If you have the `install-info' program (from the GNU Texinfo If you have the `install-info' program (from the GNU Texinfo
package), it will do that for you if you invoke it like this: package), it will do that for you if you invoke it like this:
@@ -92,8 +97,8 @@ To build:
(If your Info directory is other than C:\DJGPP\INFO, change this (If your Info directory is other than C:\DJGPP\INFO, change this
command accordingly.) command accordingly.)
7. The `clean' targets also require Unix-style shell and `test' and 7. The `clean' targets also require Unix-style shell, and GNU Sed
`rm' programs (from Fileutils and Sh-utils, accordingly). and `rm' programs (the latter from Fileutils).
@@ -224,9 +229,9 @@ Notes:
4. Letter-case in filenames. 4. Letter-case in filenames.
If you run Make on Windows 95, you should be aware of the If you run Make on Windows 9x, you should be aware of the
letter-case issue. Make is internally case-sensitive, but all letter-case issue. Make is internally case-sensitive, but all
file operations are case-insensitive on Windows 95, so file operations are case-insensitive on Windows 9x, so
e.g. files `FAQ', `faq' and `Faq' all refer to the same file, as e.g. files `FAQ', `faq' and `Faq' all refer to the same file, as
far as Windows is concerned. The underlying DJGPP C library far as Windows is concerned. The underlying DJGPP C library
functions honor the letter-case of the filenames they get from functions honor the letter-case of the filenames they get from
@@ -236,12 +241,11 @@ Notes:
converted to lower case are explained in the DJGPP libc docs, converted to lower case are explained in the DJGPP libc docs,
under the `_preserve_fncase' and `_lfn_gen_short_fname' under the `_preserve_fncase' and `_lfn_gen_short_fname'
functions, but as a thumb rule, any filename that is stored in 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 upper case in the directory, is a valid DOS 8+3 filename and
doesn't include characters illegal on MSDOS FAT filesystems, doesn't include characters invalid on MSDOS FAT filesystems,
will be automatically down-cased.) User reports that I have will be automatically down-cased.) User reports that I have
indicate that this default behavior is generally what you'd indicate that this default behavior is generally what you'd
expect; however, since support for long filenames in the DJGPP expect; however, your input is most welcome.
port of GNU Make is relatively new, your input is most welcome.
In any case, if you hit a situation where you must force Make to 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 get the 8+3 DOS filenames in upper case, set FNCASE=y in the
@@ -283,8 +287,8 @@ Bug reports:
reported first on the comp.os.msdos.djgpp news group (if you cannot reported first on the comp.os.msdos.djgpp news group (if you cannot
post to Usenet groups, write to the DJGPP mailing list, post to Usenet groups, write to the DJGPP mailing list,
<djgpp@delorie.com>, which is an email gateway into the above news <djgpp@delorie.com>, which is an email gateway into the above news
group). For other bugs, please follow the the procedure explained group). For other bugs, please follow the procedure explained in
in the "Bugs" chapter of the Info docs. If you don't have an Info 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 reader, look up that chapter in the `make.i1' file with any text
browser/editor. browser/editor.

View File

@@ -46,6 +46,35 @@ GNU make and sh.exe:
freely available. It may be available someday, but I am not in control freely available. It may be available someday, but I am not in control
of this decision nor do I influence it. Sorry! 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): GNU make handling of drive letters in pathnames (PATH, vpath, VPATH):
There is a caveat that should be noted with respect to handling There is a caveat that should be noted with respect to handling
@@ -127,6 +156,38 @@ Pathnames and white space:
and you are free to take a crack at making this work. The code 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. 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: SAMBA/NTFS/VFAT:
I have not had any success building the debug version of this I have not had any success building the debug version of this

73
README.customs Normal file
View 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.

View File

@@ -1,19 +1,48 @@
This directory contains the %VERSION% release of GNU Make. This directory contains the %VERSION% release of GNU Make.
All bugs reported for previous releases have been fixed.
Some bugs surely remain. See the file NEWS for the user-visible changes from previous releases.
In addition, there have been bugs fixed.
For general building and installation instructions, see the file INSTALL. 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, 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 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 `configure' as described in INSTALL. Then, instead of typing `make' to
build the program, type `sh build.sh'. This should compile the program 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 in the current directory. Then you will have a Make program that you can
use for `make install', or whatever else. use for `./make install', or whatever else.
Some systems' Make programs are broken and cannot process the Makefile for 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.
GNU make is fully documented in the GNU Make manual, which is contained
in this distribution as the file make.texinfo. You can also find
on-line and preformatted (PostScript and DVI) versions at the FSF's web
site. There is information there about ordering hardcopy documentation.
http://www.gnu.org/
http://www.gnu.org/doc/doc.html
http://www.gnu.org/manual/manual.html
You can also find the latest versions of GNU Make from there.
Please send GNU make bug reports to bug-make@gnu.org. Please see the
section of the manual entitles `Problems and Bugs' for information on
submitting bug reports.
If you need help using GNU make, try these forums:
help-make@gnu.org
help-utils@gnu.org
news:gnu.utils.help
news:gnu.utils.bug
Also:
- 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.W32 for details about GNU Make on Windows NT or 95.
- See README.Amiga for details about GNU Make on AmigaDOS. - See README.Amiga for details about GNU Make on AmigaDOS.
@@ -35,9 +64,5 @@ 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 properly on your system. (You must run `configure' beforehand, but you
need not build Make itself to run this test.) 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. GNU Make is free software. See the file COPYING for copying conditions.

View File

@@ -16,16 +16,17 @@
# #
# 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, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
# #
# Makefile for GNU Make # Makefile for GNU Make
# #
# Ultrix 2.2 make doesn't expand the value of VPATH. # Ultrix 2.2 make doesn't expand the value of VPATH.
VPATH = /make-3.74/ VPATH = /make-%VERSION%/
# This must repeat the value, because configure will remove `VPATH = .'. # This must repeat the value, because configure will remove `VPATH = .'.
srcdir = /make-3.74/ srcdir = /make-%VERSION%/
CC = sc CC = sc
RM = delete RM = delete
@@ -192,7 +193,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 +211,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

View File

@@ -10,6 +10,13 @@
/* Define this if the SCCS `get' command understands the `-G<file>' option. */ /* Define this if the SCCS `get' command understands the `-G<file>' option. */
#undef SCCS_GET_MINUS_G #undef SCCS_GET_MINUS_G
/* Define this to enable job server support in GNU make. */
#undef MAKE_JOBSERVER
/* Define to be the nanoseconds member of struct stat's st_mtim,
if it exists. */
#undef ST_MTIM_NSEC
/* Define this if the C library defines the variable `sys_siglist'. */ /* Define this if the C library defines the variable `sys_siglist'. */
#undef HAVE_SYS_SIGLIST #undef HAVE_SYS_SIGLIST
@@ -18,3 +25,18 @@
/* Define this if you have the `union wait' type in <sys/wait.h>. */ /* Define this if you have the `union wait' type in <sys/wait.h>. */
#undef HAVE_UNION_WAIT #undef HAVE_UNION_WAIT
/* Define to `unsigned long' or `unsigned long long'
if <inttypes.h> doesn't define. */
#undef uintmax_t
/* These are for AC_FUNC_SELECT */
/* Define if the system doesn't provide fd_set. */
#undef fd_set
/* Define the type of the first arg to select(). */
#undef fd_set_size_t
/* Define this if select() args need to be cast away from fd_set (HP-UX). */
#undef SELECT_FD_SET_CAST

299
acinclude.m4 Normal file
View File

@@ -0,0 +1,299 @@
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 <eggert@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
])
dnl ---------------------------------------------------------------------------
dnl From Paul Eggert <eggert@twinsun.com>
dnl Define HAVE_INTTYPES_H if <inttypes.h> exists,
dnl doesn't clash with <sys/types.h>, and declares uintmax_t.
AC_DEFUN(jm_AC_HEADER_INTTYPES_H,
[
if test x = y; then
dnl This code is deliberately never run via ./configure.
dnl FIXME: this is a gross hack to make autoheader put an entry
dnl for `HAVE_INTTYPES_H' in config.h.in.
AC_CHECK_FUNCS(INTTYPES_H)
fi
AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
[AC_TRY_COMPILE(
[#include <sys/types.h>
#include <inttypes.h>],
[uintmax_t i = (uintmax_t) -1;],
jm_ac_cv_header_inttypes_h=yes,
jm_ac_cv_header_inttypes_h=no)])
if test $jm_ac_cv_header_inttypes_h = yes; then
ac_kludge=HAVE_INTTYPES_H
AC_DEFINE_UNQUOTED($ac_kludge)
fi
])
dnl ---------------------------------------------------------------------------
dnl From Paul Eggert <eggert@twinsun.com>
AC_DEFUN(AC_STRUCT_ST_MTIM_NSEC,
[AC_CACHE_CHECK([for nanoseconds member of struct stat.st_mtim],
ac_cv_struct_st_mtim_nsec,
[ac_save_CPPFLAGS="$CPPFLAGS"
ac_cv_struct_st_mtim_nsec=no
# tv_nsec -- the usual case
# _tv_nsec -- Solaris 2.6, if
# (defined _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED == 1
# && !defined __EXTENSIONS__)
# st__tim.tv_nsec -- UnixWare 2.1.2
for ac_val in tv_nsec _tv_nsec st__tim.tv_nsec; do
CPPFLAGS="$ac_save_CPPFLAGS -DST_MTIM_NSEC=$ac_val"
AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/stat.h>], [struct stat s; s.st_mtim.ST_MTIM_NSEC;],
[ac_cv_struct_st_mtim_nsec=$ac_val; break])
done
CPPFLAGS="$ac_save_CPPFLAGS"])
if test $ac_cv_struct_st_mtim_nsec != no; then
AC_DEFINE_UNQUOTED(ST_MTIM_NSEC, $ac_cv_struct_st_mtim_nsec)
fi
]
)
dnl ---------------------------------------------------------------------------
dnl From Paul Eggert <eggert@twinsun.com>
dnl Define uintmax_t to `unsigned long' or `unsigned long long'
dnl if <inttypes.h> does not exist.
AC_DEFUN(jm_AC_TYPE_UINTMAX_T,
[
AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
if test $jm_ac_cv_header_inttypes_h = no; then
AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
[AC_TRY_COMPILE([],
[unsigned long long i = (unsigned long long) -1;],
ac_cv_type_unsigned_long_long=yes,
ac_cv_type_unsigned_long_long=no)])
if test $ac_cv_type_unsigned_long_long = yes; then
AC_DEFINE(uintmax_t, unsigned long long)
else
AC_DEFINE(uintmax_t, unsigned long)
fi
fi
])
dnl ---------------------------------------------------------------------------
dnl From Steve Robbins <steve@nyongwa.montreal.qc.ca>
dnl From a proposed change made on the autoconf list on 2 Feb 1999
dnl http://sourceware.cygnus.com/ml/autoconf/1999-02/msg00001.html
dnl Patch for AIX 3.2 by Lars Hecking <lhecking@nmrc.ucc.ie> on 17 May 1999
AC_DEFUN(AC_FUNC_SELECT,
[AC_CHECK_FUNCS(select)
if test "$ac_cv_func_select" = yes; then
AC_CHECK_HEADERS(unistd.h sys/types.h sys/time.h sys/select.h sys/socket.h)
AC_MSG_CHECKING([argument types of select()])
AC_CACHE_VAL(ac_cv_type_fd_set_size_t,dnl
[AC_CACHE_VAL(ac_cv_type_fd_set,dnl
[for ac_cv_type_fd_set in 'fd_set' 'int' 'void'; do
for ac_cv_type_fd_set_size_t in 'int' 'size_t' 'unsigned long' 'unsigned'; do
for ac_type_timeval in 'struct timeval' 'const struct timeval'; do
AC_TRY_COMPILE(dnl
[#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif],
[#ifdef __STDC__
extern select ($ac_cv_type_fd_set_size_t,
$ac_cv_type_fd_set *, $ac_cv_type_fd_set *, $ac_cv_type_fd_set *,
$ac_type_timeval *);
#else
extern select ();
$ac_cv_type_fd_set_size_t s;
$ac_cv_type_fd_set *p;
$ac_type_timeval *t;
#endif],
[ac_found=yes ; break 3],ac_found=no)
done
done
done
])dnl AC_CACHE_VAL
])dnl AC_CACHE_VAL
if test "$ac_found" = no; then
AC_MSG_ERROR([can't determine argument types])
fi
AC_MSG_RESULT([select($ac_cv_type_fd_set_size_t,$ac_cv_type_fd_set *,...)])
AC_DEFINE_UNQUOTED(fd_set_size_t, $ac_cv_type_fd_set_size_t)
ac_cast=
if test "$ac_cv_type_fd_set" != fd_set; then
# Arguments 2-4 are not fd_set. Some weirdo systems use fd_set type for
# FD_SET macros, but insist that you cast the argument to select. I don't
# understand why that might be, but it means we cannot define fd_set.
AC_EGREP_CPP(dnl
changequote(<<,>>)dnl
<<(^|[^a-zA-Z_0-9])fd_set[^a-zA-Z_0-9]>>dnl
changequote([,]),dnl
[#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif],dnl
# We found fd_set type in a header, need special cast
ac_cast="($ac_cv_type_fd_set *)",dnl
# No fd_set type; it is safe to define it
AC_DEFINE_UNQUOTED(fd_set,$ac_cv_type_fd_set))
fi
AC_DEFINE_UNQUOTED(SELECT_FD_SET_CAST,$ac_cast)
fi
])

View File

@@ -14,7 +14,8 @@ 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, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA. */
#include "make.h" #include "make.h"
#include "variable.h" #include "variable.h"
@@ -45,7 +46,7 @@ char ** argv;
buffer = AllocMem (len, MEMF_ANY); buffer = AllocMem (len, MEMF_ANY);
if (!buffer) if (!buffer)
fatal ("MyExecute: Cannot allocate space for calling a command"); fatal (NILF, "MyExecute: Cannot allocate space for calling a command");
ptr = buffer; ptr = buffer;

View File

@@ -14,7 +14,8 @@ 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, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA. */
extern int MyExecute PARAMS ((char ** argv)); extern int MyExecute PARAMS ((char ** argv));
extern char * wildcard_expansion PARAMS ((char * wc, char * o)); extern char * wildcard_expansion PARAMS ((char * wc, char * o));

28
ar.c
View File

@@ -14,7 +14,8 @@ 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, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "make.h" #include "make.h"
@@ -46,7 +47,7 @@ ar_name (name)
return 0; return 0;
if (p[1] == '(' && end[-1] == ')') if (p[1] == '(' && end[-1] == ')')
fatal ("attempt to use unsupported feature: `%s'", name); fatal (NILF, _("attempt to use unsupported feature: `%s'"), name);
return 1; return 1;
} }
@@ -137,7 +138,7 @@ int
ar_touch (name) ar_touch (name)
char *name; char *name;
{ {
error ("touch archive member is not available on VMS"); error (NILF, _("touch archive member is not available on VMS"));
return -1; return -1;
} }
#else #else
@@ -169,22 +170,24 @@ ar_touch (name)
switch (ar_member_touch (arname, memname)) switch (ar_member_touch (arname, memname))
{ {
case -1: case -1:
error ("touch: Archive `%s' does not exist", arname); error (NILF, _("touch: Archive `%s' does not exist"), arname);
break; break;
case -2: case -2:
error ("touch: `%s' is not a valid archive", arname); error (NILF, _("touch: `%s' is not a valid archive"), arname);
break; break;
case -3: case -3:
perror_with_name ("touch: ", arname); perror_with_name ("touch: ", arname);
break; break;
case 1: case 1:
error ("touch: Member `%s' does not exist in `%s'", memname, arname); error (NILF,
_("touch: Member `%s' does not exist in `%s'"), memname, arname);
break; break;
case 0: case 0:
val = 0; val = 0;
break; break;
default: default:
error ("touch: Bad return code from ar_member_touch on `%s'", name); error (NILF,
_("touch: Bad return code from ar_member_touch on `%s'"), name);
} }
if (!arname_used) if (!arname_used)
@@ -233,15 +236,6 @@ ar_glob_match (desc, mem, truncated,
return 0L; return 0L;
} }
/* Alphabetic sorting function for `qsort'. */
static int
ar_glob_alphacompare (a, b)
char **a, **b;
{
return strcmp (*a, *b);
}
/* Return nonzero if PATTERN contains any metacharacters. /* Return nonzero if PATTERN contains any metacharacters.
Metacharacters can be quoted with backslashes if QUOTE is nonzero. */ Metacharacters can be quoted with backslashes if QUOTE is nonzero. */
static int static int
@@ -316,7 +310,7 @@ ar_glob (arname, member_pattern, size)
names[i++] = n->name; names[i++] = n->name;
/* Sort them alphabetically. */ /* Sort them alphabetically. */
qsort ((char *) names, i, sizeof (*names), ar_glob_alphacompare); qsort ((char *) names, i, sizeof (*names), alpha_compare);
/* Put them back into the chain in the sorted order. */ /* Put them back into the chain in the sorted order. */
i = 0; i = 0;

270
arscan.c
View File

@@ -13,7 +13,8 @@ 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
USA. */
#include "make.h" #include "make.h"
@@ -69,7 +70,7 @@ VMS_get_member_info (module, rfa)
&bufdesc.dsc$w_length, 0); &bufdesc.dsc$w_length, 0);
if (! status) if (! status)
{ {
error ("lbr$set_module failed to extract module info, status = %d", error (NILF, _("lbr$set_module failed to extract module info, status = %d"),
status); status);
lbr$close (&VMS_lib_idx); lbr$close (&VMS_lib_idx);
@@ -151,7 +152,7 @@ ar_scan (archive, function, arg)
if (! status) if (! status)
{ {
error ("lbr$ini_control failed with status = %d",status); error (NILF, _("lbr$ini_control failed with status = %d"),status);
return -2; return -2;
} }
@@ -162,7 +163,7 @@ ar_scan (archive, function, arg)
if (! status) if (! status)
{ {
error ("unable to open library `%s' to lookup member `%s'", error (NILF, _("unable to open library `%s' to lookup member `%s'"),
archive, (char *)arg); archive, (char *)arg);
return -1; return -1;
} }
@@ -177,6 +178,7 @@ ar_scan (archive, function, arg)
VMS_function = function; VMS_function = function;
VMS_member_date = (time_t) -1;
lbr$get_index (&VMS_lib_idx, &index, VMS_get_member_info, 0); lbr$get_index (&VMS_lib_idx, &index, VMS_get_member_info, 0);
/* Undo the damage. */ /* Undo the damage. */
@@ -212,11 +214,46 @@ ar_scan (archive, function, arg)
#endif #endif
#endif #endif
#include <ar.h> /* On AIX, define these symbols to be sure to get both archive formats.
AIX 4.3 introduced the "big" archive format to support 64-bit object
files, so on AIX 4.3 systems we need to support both the "normal" and
"big" archive formats. An archive's format is indicated in the
"fl_magic" field of the "FL_HDR" structure. For a normal archive,
this field will be the string defined by the AIAMAG symbol. For a
"big" archive, it will be the string defined by the AIAMAGBIG symbol
(at least on AIX it works this way).
Note: we'll define these symbols regardless of which AIX version
we're compiling on, but this is okay since we'll use the new symbols
only if they're present. */
#ifdef _AIX
# define __AR_SMALL__
# define __AR_BIG__
#endif
#ifndef WINDOWS32
# include <ar.h>
#else
/* These should allow us to read Windows (VC++) libraries (according to Frank
* Libbrecht <frankl@abzx.belgium.hp.com>)
*/
# include <windows.h>
# include <windef.h>
# include <io.h>
# define ARMAG IMAGE_ARCHIVE_START
# define SARMAG IMAGE_ARCHIVE_START_SIZE
# define ar_hdr _IMAGE_ARCHIVE_MEMBER_HEADER
# define ar_name Name
# define ar_mode Mode
# define ar_size Size
# define ar_date Date
# define ar_uid UserID
# define ar_gid GroupID
#endif
/* Cray's <ar.h> apparently defines this. */ /* Cray's <ar.h> apparently defines this. */
#ifndef AR_HDR_SIZE #ifndef AR_HDR_SIZE
#define AR_HDR_SIZE (sizeof (struct ar_hdr)) # define AR_HDR_SIZE (sizeof (struct ar_hdr))
#endif #endif
/* Takes three arguments ARCHIVE, FUNCTION and ARG. /* Takes three arguments ARCHIVE, FUNCTION and ARG.
@@ -254,6 +291,10 @@ ar_scan (archive, function, arg)
{ {
#ifdef AIAMAG #ifdef AIAMAG
FL_HDR fl_header; FL_HDR fl_header;
#ifdef AIAMAGBIG
int big_archive = 0;
FL_HDR_BIG fl_header_big;
#endif
#else #else
int long_name = 0; int long_name = 0;
#endif #endif
@@ -275,11 +316,42 @@ ar_scan (archive, function, arg)
#ifdef AIAMAG #ifdef AIAMAG
{ {
register int nread = read (desc, (char *) &fl_header, FL_HSZ); register int nread = read (desc, (char *) &fl_header, FL_HSZ);
if (nread != FL_HSZ || bcmp (fl_header.fl_magic, AIAMAG, SAIAMAG))
if (nread != FL_HSZ)
{ {
(void) close (desc); (void) close (desc);
return -2; return -2;
} }
#ifdef AIAMAGBIG
/* If this is a "big" archive, then set the flag and
re-read the header into the "big" structure. */
if (!bcmp (fl_header.fl_magic, AIAMAGBIG, SAIAMAG))
{
big_archive = 1;
/* seek back to beginning of archive */
if (lseek (desc, 0, 0) < 0)
{
(void) close (desc);
return -2;
}
/* re-read the header into the "big" structure */
nread = read (desc, (char *) &fl_header_big, FL_HSZ_BIG);
if (nread != FL_HSZ_BIG)
{
(void) close (desc);
return -2;
}
}
else
#endif
/* Check to make sure this is a "normal" archive. */
if (bcmp (fl_header.fl_magic, AIAMAG, SAIAMAG))
{
(void) close (desc);
return -2;
}
} }
#else #else
{ {
@@ -307,8 +379,18 @@ ar_scan (archive, function, arg)
long int member_offset; long int member_offset;
long int last_member_offset; long int last_member_offset;
sscanf (fl_header.fl_fstmoff, "%12ld", &member_offset); #ifdef AIAMAGBIG
sscanf (fl_header.fl_lstmoff, "%12ld", &last_member_offset); if ( big_archive )
{
sscanf (fl_header_big.fl_fstmoff, "%20ld", &member_offset);
sscanf (fl_header_big.fl_lstmoff, "%20ld", &last_member_offset);
}
else
#endif
{
sscanf (fl_header.fl_fstmoff, "%12ld", &member_offset);
sscanf (fl_header.fl_lstmoff, "%12ld", &last_member_offset);
}
if (member_offset == 0) if (member_offset == 0)
{ {
@@ -329,6 +411,9 @@ ar_scan (archive, function, arg)
{ {
register int nread; register int nread;
struct ar_hdr member_header; struct ar_hdr member_header;
#ifdef AIAMAGBIG
struct ar_hdr_big member_header_big;
#endif
#ifdef AIAMAG #ifdef AIAMAG
char name[256]; char name[256];
int name_len; int name_len;
@@ -351,34 +436,73 @@ ar_scan (archive, function, arg)
} }
#ifdef AIAMAG #ifdef AIAMAG
#define AR_MEMHDR (AR_HDR_SIZE - sizeof (member_header._ar_name)) #define AR_MEMHDR_SZ(x) (sizeof(x) - sizeof (x._ar_name))
nread = read (desc, (char *) &member_header, AR_MEMHDR);
if (nread != AR_MEMHDR) #ifdef AIAMAGBIG
if (big_archive)
{ {
(void) close (desc); nread = read (desc, (char *) &member_header_big,
return -2; AR_MEMHDR_SZ(member_header_big) );
if (nread != AR_MEMHDR_SZ(member_header_big))
{
(void) close (desc);
return -2;
}
sscanf (member_header_big.ar_namlen, "%4d", &name_len);
nread = read (desc, name, name_len);
if (nread != name_len)
{
(void) close (desc);
return -2;
}
name[name_len] = 0;
sscanf (member_header_big.ar_date, "%12ld", &dateval);
sscanf (member_header_big.ar_uid, "%12d", &uidval);
sscanf (member_header_big.ar_gid, "%12d", &gidval);
sscanf (member_header_big.ar_mode, "%12o", &eltmode);
sscanf (member_header_big.ar_size, "%20ld", &eltsize);
data_offset = (member_offset + AR_MEMHDR_SZ(member_header_big)
+ name_len + 2);
} }
else
sscanf (member_header.ar_namlen, "%4d", &name_len); #endif
nread = read (desc, name, name_len);
if (nread != name_len)
{ {
(void) close (desc); nread = read (desc, (char *) &member_header,
return -2; AR_MEMHDR_SZ(member_header) );
if (nread != AR_MEMHDR_SZ(member_header))
{
(void) close (desc);
return -2;
}
sscanf (member_header.ar_namlen, "%4d", &name_len);
nread = read (desc, name, name_len);
if (nread != name_len)
{
(void) close (desc);
return -2;
}
name[name_len] = 0;
sscanf (member_header.ar_date, "%12ld", &dateval);
sscanf (member_header.ar_uid, "%12d", &uidval);
sscanf (member_header.ar_gid, "%12d", &gidval);
sscanf (member_header.ar_mode, "%12o", &eltmode);
sscanf (member_header.ar_size, "%12ld", &eltsize);
data_offset = (member_offset + AR_MEMHDR_SZ(member_header)
+ name_len + 2);
} }
data_offset += data_offset % 2;
name[name_len] = 0;
sscanf (member_header.ar_date, "%12ld", &dateval);
sscanf (member_header.ar_uid, "%12d", &uidval);
sscanf (member_header.ar_gid, "%12d", &gidval);
sscanf (member_header.ar_mode, "%12o", &eltmode);
sscanf (member_header.ar_size, "%12ld", &eltsize);
if ((data_offset = member_offset + AR_MEMHDR + name_len + 2) % 2)
++data_offset;
fnval = fnval =
(*function) (desc, name, 0, (*function) (desc, name, 0,
@@ -393,8 +517,20 @@ ar_scan (archive, function, arg)
break; break;
if (nread != AR_HDR_SIZE if (nread != AR_HDR_SIZE
#ifdef ARFMAG #if defined(ARFMAG) || defined(ARFZMAG)
|| bcmp (member_header.ar_fmag, ARFMAG, 2) || (
# ifdef ARFMAG
bcmp (member_header.ar_fmag, ARFMAG, 2)
# else
1
# endif
&&
# ifdef ARFZMAG
bcmp (member_header.ar_fmag, ARFZMAG, 2)
# else
1
# endif
)
#endif #endif
) )
{ {
@@ -492,7 +628,12 @@ ar_scan (archive, function, arg)
/* End of the chain. */ /* End of the chain. */
break; break;
sscanf (member_header.ar_nxtmem, "%12ld", &member_offset); #ifdef AIAMAGBIG
if (big_archive)
sscanf (member_header_big.ar_nxtmem, "%20ld", &member_offset);
else
#endif
sscanf (member_header.ar_nxtmem, "%12ld", &member_offset);
if (lseek (desc, member_offset, 0) != member_offset) if (lseek (desc, member_offset, 0) != member_offset)
{ {
@@ -561,37 +702,6 @@ ar_name_equal (name, mem, truncated)
if (p != 0) if (p != 0)
name = p + 1; name = p + 1;
/* We no longer use this kludge, since we
now support long archive member names. */
#if 0 && !defined (AIAMAG) && !defined (APOLLO)
{
/* `reallylongname.o' matches `reallylongnam.o'.
If member names have a trailing slash, that's `reallylongna.o'. */
struct ar_hdr h;
unsigned int max = sizeof (h.ar_name);
unsigned int namelen, memlen;
if (strncmp (name, mem, max - 3))
return 0;
namelen = strlen (name);
memlen = strlen (mem);
if (namelen > memlen && memlen >= max - 1
&& name[namelen - 2] == '.' && name[namelen - 1] == 'o'
&& mem[memlen - 2] == '.' && mem[memlen - 1] == 'o')
return 1;
if (namelen != memlen)
return 0;
return (namelen < max - 3 || !strcmp (name + max - 3, mem + max - 3));
}
#else /* AIX or APOLLO. */
#ifndef VMS #ifndef VMS
if (truncated) if (truncated)
{ {
@@ -600,21 +710,16 @@ 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 strneq (name, mem, sizeof(hdr.ar_name) - 1);
#else #else
2 return strneq (name, mem, sizeof(hdr.ar_name) - 2);
#endif /* !__hpux && !cray */ #endif /* !__hpux && !cray */
); #endif /* !AIAMAG */
#endif
} }
#endif /* !VMS */ #endif /* !VMS */
return !strcmp (name, mem); return !strcmp (name, mem);
#endif
} }
#ifndef VMS #ifndef VMS
@@ -670,12 +775,9 @@ ar_member_touch (arname, memname)
if (AR_HDR_SIZE != write (fd, (char *) &ar_hdr, AR_HDR_SIZE)) if (AR_HDR_SIZE != write (fd, (char *) &ar_hdr, AR_HDR_SIZE))
goto lose; goto lose;
/* The file's mtime is the time we we want. */ /* The file's mtime is the time we we want. */
#ifdef EINTR while (fstat (fd, &statbuf) < 0 && EINTR_SET)
while (fstat (fd, &statbuf) < 0 && errno == EINTR); ;
#else #if defined(ARFMAG) || defined(ARFZMAG) || defined(AIAMAG) || defined(WINDOWS32)
fstat (fd, &statbuf);
#endif
#if defined(ARFMAG) || defined(AIAMAG)
/* Advance member's time to that time */ /* Advance member's time to that time */
for (i = 0; i < sizeof ar_hdr.ar_date; i++) for (i = 0; i < sizeof ar_hdr.ar_date; i++)
ar_hdr.ar_date[i] = ' '; ar_hdr.ar_date[i] = ' ';
@@ -715,11 +817,11 @@ describe_member (desc, name, truncated,
{ {
extern char *ctime (); extern char *ctime ();
printf ("Member `%s'%s: %ld bytes at %ld (%ld).\n", printf (_("Member `%s'%s: %ld bytes at %ld (%ld).\n"),
name, truncated ? " (name might be truncated)" : "", name, truncated ? _(" (name might be truncated)") : "",
size, hdrpos, datapos); size, hdrpos, datapos);
printf (" Date %s", ctime (&date)); printf (_(" Date %s"), ctime (&date));
printf (" uid = %d, gid = %d, mode = 0%o.\n", uid, gid, mode); printf (_(" uid = %d, gid = %d, mode = 0%o.\n"), uid, gid, mode);
return 0; return 0;
} }

View File

@@ -17,7 +17,8 @@
# #
# 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, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
# See Makefile.in for comments describing these variables. # See Makefile.in for comments describing these variables.
@@ -31,6 +32,7 @@ ALLOCA='@ALLOCA@'
LOADLIBES='@LIBS@' LOADLIBES='@LIBS@'
extras='@LIBOBJS@' extras='@LIBOBJS@'
REMOTE='@REMOTE@' REMOTE='@REMOTE@'
GLOBLIB='@GLOBLIB@'
# Common prefix for machine-independent installed files. # Common prefix for machine-independent installed files.
prefix='@prefix@' prefix='@prefix@'
@@ -47,11 +49,15 @@ set -e
# These are all the objects we need to link together. # These are all the objects we need to link together.
objs="%objs% remote-${REMOTE}.o ${extras} ${ALLOCA}" objs="%objs% remote-${REMOTE}.o ${extras} ${ALLOCA}"
if [ x"$GLOBLIB" != x ]; then
objs="$objs %globobjs%"
fi
# Compile the source files into those objects. # Compile the source files into those objects.
for file in `echo ${objs} | sed 's/\.o/.c/g'`; do for file in `echo ${objs} | sed 's/\.o/.c/g'`; do
echo compiling ${file}... echo compiling ${file}...
$CC $defines $CPPFLAGS $CFLAGS \ $CC $defines $CPPFLAGS $CFLAGS \
-c -I. -I${srcdir} -I${srcdir}/glob ${srcdir}/$file -c -I. -I${srcdir} ${srcdir}/$file
done done
# The object files were actually all put in the current directory. # The object files were actually all put in the current directory.

View File

@@ -10,59 +10,59 @@ echo off
echo "Creating GNU make for Windows 95/NT" echo "Creating GNU make for Windows 95/NT"
echo on echo on
if not exist .\WinDebug\nul mkdir .\WinDebug if not exist .\WinDebug\nul mkdir .\WinDebug
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 TIVOLI /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c variable.c
echo WinDebug\variable.obj >>link.dbg echo WinDebug\variable.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 WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c rule.c
echo WinDebug\rule.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 remote-stub.c 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 /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c remote-stub.c
echo WinDebug\remote-stub.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 commands.c 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 /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c commands.c
echo WinDebug\commands.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 file.c 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 /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c file.c
echo WinDebug\file.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 getloadavg.c 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 /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c getloadavg.c
echo WinDebug\getloadavg.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 default.c 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 /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c default.c
echo WinDebug\default.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 signame.c 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 /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c signame.c
echo WinDebug\signame.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 expand.c 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 /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c expand.c
echo WinDebug\expand.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 dir.c 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 /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c dir.c
echo WinDebug\dir.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 main.c 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 /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c main.c
echo WinDebug\main.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 getopt1.c 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 /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c getopt1.c
echo WinDebug\getopt1.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 job.c 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 /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c job.c
echo WinDebug\job.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 read.c 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 /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c read.c
echo WinDebug\read.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 version.c 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 /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c version.c
echo WinDebug\version.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 getopt.c 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 /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c getopt.c
echo WinDebug\getopt.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 arscan.c 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 /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c arscan.c
echo WinDebug\arscan.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 remake.c 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 /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c remake.c
echo WinDebug\remake.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 misc.c 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 /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c misc.c
echo WinDebug\misc.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 ar.c 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 /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c ar.c
echo WinDebug\ar.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 function.c 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 /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c function.c
echo WinDebug\function.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 vpath.c 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 /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c vpath.c
echo WinDebug\vpath.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 implicit.c 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 /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c implicit.c
echo WinDebug\implicit.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 .\w32\compat\dirent.c 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 /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c .\w32\compat\dirent.c
echo WinDebug\dirent.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 .\glob\glob.c 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 /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c .\glob\glob.c
echo WinDebug\glob.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\fnmatch.c 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 /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c .\glob\fnmatch.c
echo WinDebug\fnmatch.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 .\w32\pathstuff.c 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 /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c .\w32\pathstuff.c
echo WinDebug\pathstuff.obj >>link.dbg echo WinDebug\pathstuff.obj >>link.dbg
echo off echo off
echo "Linking WinDebug/%make%.exe" echo "Linking WinDebug/%make%.exe"
@@ -73,59 +73,59 @@ if not exist .\WinDebug/%make%.exe echo "WinDebug build failed"
if exist .\WinDebug/%make%.exe echo "WinDebug build succeeded!" if exist .\WinDebug/%make%.exe echo "WinDebug build succeeded!"
if not exist .\WinRel\nul mkdir .\WinRel if not exist .\WinRel\nul mkdir .\WinRel
echo on echo on
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 WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D TIVOLI /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c variable.c
echo WinRel\variable.obj >>link.rel 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 /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 WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c rule.c
echo WinRel\rule.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 remote-stub.c 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 /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c remote-stub.c
echo WinRel\remote-stub.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 commands.c 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 /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c commands.c
echo WinRel\commands.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 file.c 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 /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c file.c
echo WinRel\file.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 getloadavg.c 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 /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c getloadavg.c
echo WinRel\getloadavg.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 default.c 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 /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c default.c
echo WinRel\default.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 signame.c 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 /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c signame.c
echo WinRel\signame.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 expand.c 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 /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c expand.c
echo WinRel\expand.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 dir.c 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 /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c dir.c
echo WinRel\dir.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 main.c 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 /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c main.c
echo WinRel\main.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 getopt1.c 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 /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c getopt1.c
echo WinRel\getopt1.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 job.c 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 /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c job.c
echo WinRel\job.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 read.c 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 /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c read.c
echo WinRel\read.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 version.c 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 /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c version.c
echo WinRel\version.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 getopt.c 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 /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c getopt.c
echo WinRel\getopt.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 arscan.c 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 /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c arscan.c
echo WinRel\arscan.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 remake.c 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 /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c remake.c
echo WinRel\remake.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 misc.c 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 /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c misc.c
echo WinRel\misc.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 ar.c 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 /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c ar.c
echo WinRel\ar.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 function.c 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 /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c function.c
echo WinRel\function.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 vpath.c 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 /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c vpath.c
echo WinRel\vpath.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 implicit.c 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 /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c implicit.c
echo WinRel\implicit.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 .\w32\compat\dirent.c 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 /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c .\w32\compat\dirent.c
echo WinRel\dirent.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 .\glob\glob.c 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 /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c .\glob\glob.c
echo WinRel\glob.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\fnmatch.c 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 /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c .\glob\fnmatch.c
echo WinRel\fnmatch.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 .\w32\pathstuff.c 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 /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c .\w32\pathstuff.c
echo WinRel\pathstuff.obj >>link.rel echo WinRel\pathstuff.obj >>link.rel
echo off echo off
echo "Linking WinRel/%make%.exe" echo "Linking WinRel/%make%.exe"

View File

@@ -14,7 +14,8 @@ 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, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "make.h" #include "make.h"
#include "dep.h" #include "dep.h"
@@ -87,7 +88,7 @@ set_file_variables (file)
for (d = enter_file (".SUFFIXES")->deps; d != 0; d = d->next) for (d = enter_file (".SUFFIXES")->deps; d != 0; d = d->next)
{ {
unsigned int slen = strlen (dep_name (d)); unsigned int slen = strlen (dep_name (d));
if (len > slen && !strncmp (dep_name (d), name + (len - slen), slen)) if (len > slen && strneq (dep_name (d), name + (len - slen), slen))
{ {
file->stem = savestring (name, len - slen); file->stem = savestring (name, len - slen);
break; break;
@@ -343,6 +344,7 @@ execute_file_commands (file)
/* We are all out of commands. /* We are all out of commands.
If we have gotten this far, all the previous commands If we have gotten this far, all the previous commands
have run successfully, so we have winning update status. */ have run successfully, so we have winning update status. */
set_command_state (file, cs_running);
file->update_status = 0; file->update_status = 0;
notice_finished_file (file); notice_finished_file (file);
return; return;
@@ -379,12 +381,12 @@ fatal_error_signal (sig)
return; return;
} }
remove_intermediates (1); remove_intermediates (1);
exit (1); exit (EXIT_FAILURE);
#else /* not __MSDOS__ */ #else /* not __MSDOS__ */
#ifdef _AMIGA #ifdef _AMIGA
remove_intermediates (1); remove_intermediates (1);
if (sig == SIGINT) if (sig == SIGINT)
fputs ("*** Break.\n", stderr); fputs (_("*** Break.\n"), stderr);
exit (10); exit (10);
#else /* not Amiga */ #else /* not Amiga */
@@ -473,13 +475,13 @@ delete_target (file, on_behalf_of)
#ifndef NO_ARCHIVES #ifndef NO_ARCHIVES
if (ar_name (file->name)) if (ar_name (file->name))
{ {
if (ar_member_date (file->name) != file->last_mtime) if (ar_member_date (file->name) != FILE_TIMESTAMP_S (file->last_mtime))
{ {
if (on_behalf_of) if (on_behalf_of)
error ("*** [%s] Archive member `%s' may be bogus; not deleted", error (NILF, _("*** [%s] Archive member `%s' may be bogus; not deleted"),
on_behalf_of, file->name); on_behalf_of, file->name);
else else
error ("*** Archive member `%s' may be bogus; not deleted", error (NILF, _("*** Archive member `%s' may be bogus; not deleted"),
file->name); file->name);
} }
return; return;
@@ -488,12 +490,12 @@ delete_target (file, on_behalf_of)
if (stat (file->name, &st) == 0 if (stat (file->name, &st) == 0
&& S_ISREG (st.st_mode) && S_ISREG (st.st_mode)
&& (time_t) st.st_mtime != file->last_mtime) && FILE_TIMESTAMP_STAT_MODTIME (st) != file->last_mtime)
{ {
if (on_behalf_of) if (on_behalf_of)
error ("*** [%s] Deleting file `%s'", on_behalf_of, file->name); error (NILF, _("*** [%s] Deleting file `%s'"), on_behalf_of, file->name);
else else
error ("*** Deleting file `%s'", file->name); error (NILF, _("*** Deleting file `%s'"), file->name);
if (unlink (file->name) < 0 if (unlink (file->name) < 0
&& errno != ENOENT) /* It disappeared; so what. */ && errno != ENOENT) /* It disappeared; so what. */
perror_with_name ("unlink: ", file->name); perror_with_name ("unlink: ", file->name);
@@ -531,12 +533,13 @@ print_commands (cmds)
{ {
register char *s; register char *s;
fputs ("# commands to execute", stdout); fputs (_("# commands to execute"), stdout);
if (cmds->filename == 0) if (cmds->fileinfo.filenm == 0)
puts (" (built-in):"); puts (_(" (built-in):"));
else else
printf (" (from `%s', line %u):\n", cmds->filename, cmds->lineno); printf (_(" (from `%s', line %lu):\n"),
cmds->fileinfo.filenm, cmds->fileinfo.lineno);
s = cmds->commands; s = cmds->commands;
while (*s != '\0') while (*s != '\0')

View File

@@ -14,15 +14,15 @@ 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, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* Structure that gives the commands to make a file /* Structure that gives the commands to make a file
and information about where these commands came from. */ and information about where these commands came from. */
struct commands struct commands
{ {
char *filename; /* File that contains commands. */ struct floc fileinfo; /* Where commands were defined. */
unsigned int lineno; /* Line number in file. */
char *commands; /* Commands text. */ char *commands; /* Commands text. */
unsigned int ncommand_lines;/* Number of command lines. */ unsigned int ncommand_lines;/* Number of command lines. */
char **command_lines; /* Commands chopped up into lines. */ char **command_lines; /* Commands chopped up into lines. */

View File

@@ -4,121 +4,123 @@
System headers sometimes define this. System headers sometimes define this.
We just want to avoid a redefinition error message. */ We just want to avoid a redefinition error message. */
#ifndef _ALL_SOURCE #ifndef _ALL_SOURCE
#undef _ALL_SOURCE /* #undef _ALL_SOURCE */
#endif #endif
/* Define if using alloca.c. */ /* Define if using alloca.c. */
#define C_ALLOCA #define C_ALLOCA
/* Define if the closedir function returns void instead of int. */
/* #undef CLOSEDIR_VOID */
/* Define to empty if the keyword does not work. */ /* Define to empty if the keyword does not work. */
#undef const /* #undef const */
/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems. /* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
This function is required for alloca.c support on those systems. */ This function is required for alloca.c support on those systems. */
#undef CRAY_STACKSEG_END /* #undef CRAY_STACKSEG_END */
/* Define for DGUX with <sys/dg_sys_info.h>. */ /* Define for DGUX with <sys/dg_sys_info.h>. */
#undef DGUX /* #undef DGUX */
/* Define if the `getloadavg' function needs to be run setuid or setgid. */ /* Define if the `getloadavg' function needs to be run setuid or setgid. */
#undef GETLOADAVG_PRIVILEGED /* #undef GETLOADAVG_PRIVILEGED */
/* Define to `int' if <sys/types.h> doesn't define. */ /* Define to `int' if <sys/types.h> doesn't define. */
#define gid_t int #define gid_t int
/* 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 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 */
/* Define if your system has a working fnmatch function. */
/* #undef HAVE_FNMATCH */
/* Define if your system has its own `getloadavg' function. */ /* Define if your system has its own `getloadavg' function. */
#undef HAVE_GETLOADAVG /* #undef HAVE_GETLOADAVG */
/* Define if you have the getmntent function. */ /* Define if you have the getmntent function. */
#undef HAVE_GETMNTENT /* #undef HAVE_GETMNTENT */
/* Define if the `long double' type works. */ /* Define if the `long double' type works. */
#undef HAVE_LONG_DOUBLE /* #undef HAVE_LONG_DOUBLE */
/* Define if you support file names longer than 14 characters. */ /* Define if you support file names longer than 14 characters. */
#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 */
/* Define if system calls automatically restart after interruption /* Define if system calls automatically restart after interruption
by a signal. */ by a signal. */
#undef HAVE_RESTARTABLE_SYSCALLS /* #undef HAVE_RESTARTABLE_SYSCALLS */
/* Define if your struct stat has st_blksize. */ /* Define if your struct stat has st_blksize. */
#undef HAVE_ST_BLKSIZE /* #undef HAVE_ST_BLKSIZE */
/* Define if your struct stat has st_blocks. */ /* Define if your struct stat has st_blocks. */
#undef HAVE_ST_BLOCKS /* #undef HAVE_ST_BLOCKS */
/* Define if you have the strcoll function and it is properly defined. */ /* Define if you have the strcoll function and it is properly defined. */
#define HAVE_STRCOLL #define HAVE_STRCOLL 1
/* Define if your struct stat has st_rdev. */ /* Define if your struct stat has 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. */
#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 */
/* Define if your struct tm has tm_zone. */ /* Define if your struct tm has tm_zone. */
#undef HAVE_TM_ZONE /* #undef HAVE_TM_ZONE */
/* 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. */
#define HAVE_TZNAME #define HAVE_TZNAME 1
/* #define tzname __tzname */
/* Define if you have <unistd.h>. */ /* Define if you have <unistd.h>. */
#define HAVE_UNISTD_H #define HAVE_UNISTD_H 1
/* 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 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. */
#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 */
/* Define if on MINIX. */ /* Define if on MINIX. */
#undef _MINIX /* #undef _MINIX */
/* Define if your struct nlist has an n_un member. */ /* Define if your struct nlist has an n_un member. */
#undef NLIST_NAME_UNION /* #undef NLIST_NAME_UNION */
/* Define if you have <nlist.h>. */ /* Define if you have <nlist.h>. */
#undef NLIST_STRUCT /* #undef NLIST_STRUCT */
/* Define if your C compiler doesn't accept -c and -o together. */ /* Define if your C compiler doesn't accept -c and -o together. */
#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 #define pid_t int
/* 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. */
#undef _POSIX_1_SOURCE /* #undef _POSIX_1_SOURCE */
/* 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 as the return type of signal handlers (int or void). */ /* Define as the return type of signal handlers (int or void). */
#define RETSIGTYPE void #define RETSIGTYPE void
@@ -126,7 +128,7 @@
/* Define if the setvbuf function takes the buffering type as its second /* Define if the setvbuf function takes the buffering type as its second
argument and the buffer pointer as the third, as on System V argument and the buffer pointer as the third, as on System V
before release 3. */ before release 3. */
#undef SETVBUF_REVERSED /* #undef SETVBUF_REVERSED */
/* If using the C implementation of alloca, define if you know the /* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be direction of stack growth for your system; otherwise it will be
@@ -138,29 +140,29 @@
#define STACK_DIRECTION -1 #define STACK_DIRECTION -1
/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */ /* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
#undef STAT_MACROS_BROKEN /* #undef STAT_MACROS_BROKEN */
/* Define if you have the ANSI C header files. */ /* Define if you have the ANSI C header files. */
#define STDC_HEADERS #define STDC_HEADERS
/* Define on System V Release 4. */ /* Define on System V Release 4. */
#undef SVR4 /* #undef SVR4 */
/* Define if `sys_siglist' is declared by <signal.h>. */ /* Define if `sys_siglist' is declared by <signal.h>. */
#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 #define uid_t int
/* Define for Encore UMAX. */ /* Define for Encore UMAX. */
#undef UMAX /* #undef UMAX */
/* Define for Encore UMAX 4.3 that has <inq_status/cpustats.h> /* Define for Encore UMAX 4.3 that has <inq_status/cpustats.h>
instead of <sys/cpustats.h>. */ instead of <sys/cpustats.h>. */
#undef UMAX4_3 /* #undef UMAX4_3 */
/* 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) */ /* Name of this package (needed by automake) */
#define PACKAGE "%PACKAGE%" #define PACKAGE "%PACKAGE%"
@@ -172,109 +174,137 @@
#define SCCS_GET "get" #define SCCS_GET "get"
/* Define this if the SCCS `get' command understands the `-G<file>' option. */ /* Define this if the SCCS `get' command understands the `-G<file>' option. */
#undef SCCS_GET_MINUS_G /* #undef SCCS_GET_MINUS_G */
/* Define this to enable job server support in GNU make. */
/* #undef MAKE_JOBSERVER */
/* Define to be the nanoseconds member of struct stat's st_mtim,
if it exists. */
/* #undef ST_MTIM_NSEC */
/* Define this if the C library defines the variable `sys_siglist'. */ /* Define this if the C library defines the variable `sys_siglist'. */
#undef HAVE_SYS_SIGLIST /* #undef HAVE_SYS_SIGLIST */
/* Define this if the C library defines the variable `_sys_siglist'. */ /* Define this if the C library defines the variable `_sys_siglist'. */
#undef HAVE__SYS_SIGLIST /* #undef HAVE__SYS_SIGLIST */
/* Define this if you have the `union wait' type in <sys/wait.h>. */ /* Define this if you have the `union wait' type in <sys/wait.h>. */
#undef HAVE_UNION_WAIT /* #undef HAVE_UNION_WAIT */
/* Define this if the POSIX.1 call `sysconf (_SC_OPEN_MAX)' works properly. */
#undef HAVE_SYSCONF_OPEN_MAX
/* Define if you have the dup2 function. */ /* Define if you have the dup2 function. */
#undef HAVE_DUP2 /* #undef HAVE_DUP2 */
/* Define if you have the getcwd function. */ /* Define if you have the getcwd function. */
#define HAVE_GETCWD #define HAVE_GETCWD 1
/* Define if you have the getdtablesize function. */
#undef HAVE_GETDTABLESIZE
/* 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 gethostbyname function. */
/* #undef HAVE_GETHOSTBYNAME */
/* Define if you have the gethostname function. */
/* #undef HAVE_GETHOSTNAME */
/* Define if you have the memmove function. */
#define HAVE_MEMMOVE 1
/* Define if you have the mktemp function. */ /* Define if you have the mktemp function. */
#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 */
/* Define if you have the pstat_getdynamic function. */
/* #undef HAVE_PSTAT_GETDYNAMIC */
/* Define if you have the setegid function. */ /* Define if you have the setegid function. */
#undef HAVE_SETEGID /* #undef HAVE_SETEGID */
/* Define if you have the seteuid function. */ /* Define if you have the seteuid function. */
#undef HAVE_SETEUID /* #undef HAVE_SETEUID */
/* Define if you have the setlinebuf function. */ /* Define if you have the setlinebuf function. */
#undef HAVE_SETLINEBUF /* #undef HAVE_SETLINEBUF */
/* Define if you have the setregid function. */ /* Define if you have the setregid function. */
#undef HAVE_SETREGID /* #undef HAVE_SETREGID */
/* Define if you have the setreuid function. */ /* Define if you have the setreuid function. */
#undef HAVE_SETREUID /* #undef HAVE_SETREUID */
/* Define if you have the sigsetmask function. */ /* Define if you have the sigsetmask function. */
#undef HAVE_SIGSETMASK /* #undef HAVE_SIGSETMASK */
/* Define if you have the socket function. */
/* #undef HAVE_SOCKET */
/* Define if you have the strcasecmp function. */
/* #undef HAVE_STRCASECMP */
/* Define if you have the strerror function. */ /* Define if you have the strerror function. */
#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 */
/* Define if you have the wait3 function. */ /* Define if you have the wait3 function. */
#undef HAVE_WAIT3 /* #undef HAVE_WAIT3 */
/* Define if you have the waitpid function. */ /* Define if you have the waitpid function. */
#undef HAVE_WAITPID /* #undef HAVE_WAITPID */
/* Define if you have the <dirent.h> header file. */ /* Define if you have the <dirent.h> header file. */
#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. */
#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. */
#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 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 <stdlib.h> header file. */
/* #undef HAVE_STDLIB_H */
/* Define if you have the <string.h> header file. */ /* Define if you have the <string.h> header file. */
#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. */
#define HAVE_SYS_DIR_H #define HAVE_SYS_DIR_H 1
/* Define if you have the <sys/ndir.h> header file. */ /* Define if you have the <sys/ndir.h> header file. */
#undef HAVE_SYS_NDIR_H /* #undef HAVE_SYS_NDIR_H */
/* Define if you have the <sys/param.h> header file. */ /* Define if you have the <sys/param.h> header file. */
#undef HAVE_SYS_PARAM_H /* #undef HAVE_SYS_PARAM_H */
/* 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 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 */
/* Define if you have the <unistd.h> header file. */ /* Define if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H #define HAVE_UNISTD_H 1
/* Define if you have the dgc library (-ldgc). */ /* Define if you have the dgc library (-ldgc). */
#undef HAVE_LIBDGC /* #undef HAVE_LIBDGC */
/* Define if you have the kstat library (-lkstat). */
/* #undef HAVE_LIBKSTAT */
/* 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

View File

@@ -12,6 +12,9 @@
/* Define if using alloca.c. */ /* Define if using alloca.c. */
/* #undef C_ALLOCA */ /* #undef C_ALLOCA */
/* Define if the closedir function returns void instead of int. */
/* #undef CLOSEDIR_VOID */
/* Define to empty if the keyword does not work. */ /* Define to empty if the keyword does not work. */
/* #undef const */ /* #undef const */
@@ -23,7 +26,7 @@
/* #undef DGUX */ /* #undef DGUX */
/* Define if the `getloadavg' function needs to be run setuid or setgid. */ /* Define if the `getloadavg' function needs to be run setuid or setgid. */
/* #undef GETLOADAVG_PRIVILEGED 1 */ /* #undef GETLOADAVG_PRIVILEGED */
/* Define to `int' if <sys/types.h> doesn't define. */ /* Define to `int' if <sys/types.h> doesn't define. */
/* #undef gid_t */ /* #undef gid_t */
@@ -32,14 +35,14 @@
#define HAVE_ALLOCA 1 #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 1 */ /* #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 */
/* Define if your system has a working fnmatch function. */
/* #undef HAVE_FNMATCH */
/* Define if your system has its own `getloadavg' function. */ /* Define if your system has its own `getloadavg' function. */
/* #undef HAVE_GETLOADAVG */ /* #undef HAVE_GETLOADAVG */
@@ -66,16 +69,16 @@
/* #undef HAVE_ST_BLOCKS */ /* #undef HAVE_ST_BLOCKS */
/* 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 1 */ /* #undef HAVE_STRCOLL */
/* 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 if you have the strftime function. */ /* Define if you have the strftime function. */
/* #undef HAVE_STRFTIME */ /* #undef HAVE_STRFTIME */
/* 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 1 */ /* #undef HAVE_SYS_WAIT_H */
/* Define if your struct tm has tm_zone. */ /* Define if your struct tm has tm_zone. */
/* #undef HAVE_TM_ZONE */ /* #undef HAVE_TM_ZONE */
@@ -93,13 +96,13 @@
/* #undef HAVE_UTIME_NULL */ /* #undef HAVE_UTIME_NULL */
/* Define if you have <vfork.h>. */ /* Define if you have <vfork.h>. */
/* #undef HAVE_VFORK_H 1 */ /* #undef HAVE_VFORK_H */
/* Define if you have the vprintf function. */ /* Define if you have the vprintf function. */
#define HAVE_VPRINTF 1 #define HAVE_VPRINTF 1
/* Define if you have the wait3 system call. */ /* Define if you have the wait3 system call. */
/* #undef HAVE_WAIT3 1 */ /* #undef HAVE_WAIT3 */
/* Define if on MINIX. */ /* Define if on MINIX. */
/* #undef _MINIX */ /* #undef _MINIX */
@@ -108,7 +111,7 @@
/* #undef NLIST_NAME_UNION */ /* #undef NLIST_NAME_UNION */
/* Define if you have <nlist.h>. */ /* Define if you have <nlist.h>. */
/* #undef NLIST_STRUCT 1 */ /* #undef NLIST_STRUCT */
/* Define if your C compiler doesn't accept -c and -o together. */ /* Define if your C compiler doesn't accept -c and -o together. */
/* #undef NO_MINUS_C_MINUS_O */ /* #undef NO_MINUS_C_MINUS_O */
@@ -120,8 +123,12 @@
with this defined. */ with this defined. */
/* #undef _POSIX_1_SOURCE */ /* #undef _POSIX_1_SOURCE */
#include <sys/types.h>
#include <ctype.h>
#include <signal.h>
/* 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 */ #define _POSIX_C_SOURCE 1
/* Define as the return type of signal handlers (int or void). */ /* Define as the return type of signal handlers (int or void). */
#define RETSIGTYPE void #define RETSIGTYPE void
@@ -129,7 +136,7 @@
/* Define if the setvbuf function takes the buffering type as its second /* Define if the setvbuf function takes the buffering type as its second
argument and the buffer pointer as the third, as on System V argument and the buffer pointer as the third, as on System V
before release 3. */ before release 3. */
/* #undef SETVBUF_REVERSED 1 */ /* #undef SETVBUF_REVERSED */
/* If using the C implementation of alloca, define if you know the /* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be direction of stack growth for your system; otherwise it will be
@@ -162,23 +169,30 @@
instead of <sys/cpustats.h>. */ instead of <sys/cpustats.h>. */
/* #undef UMAX4_3 */ /* #undef UMAX4_3 */
/* Define vfork as fork if vfork does not work. */
/* #undef vfork */
/* Name of this package (needed by automake) */ /* Name of this package (needed by automake) */
#define PACKAGE "%PACKAGE%" #define PACKAGE "%PACKAGE%"
/* Version of this package (needed by automake) */ /* Version of this package (needed by automake) */
#define VERSION "%VERSION%" #define VERSION "%VERSION%"
/* Define vfork as fork if vfork does not work. */
/* #undef vfork */
/* Define to the name of the SCCS `get' command. */ /* Define to the name of the SCCS `get' command. */
/* #undef SCCS_GET "/usr/sccs/get" */ /* #undef SCCS_GET */
/* Define this if the SCCS `get' command understands the `-G<file>' option. */ /* Define this if the SCCS `get' command understands the `-G<file>' option. */
/* #undef SCCS_GET_MINUS_G 1 */ /* #undef SCCS_GET_MINUS_G */
/* Define this to enable job server support in GNU make. */
/* #undef MAKE_JOBSERVER */
/* Define to be the nanoseconds member of struct stat's st_mtim,
if it exists. */
/* #undef ST_MTIM_NSEC */
/* Define this if the C library defines the variable `sys_siglist'. */ /* Define this if the C library defines the variable `sys_siglist'. */
/* #undefine HAVE_SYS_SIGLIST 1 */ /* #undefine HAVE_SYS_SIGLIST */
/* Define this if the C library defines the variable `_sys_siglist'. */ /* Define this if the C library defines the variable `_sys_siglist'. */
/* #undef HAVE__SYS_SIGLIST */ /* #undef HAVE__SYS_SIGLIST */
@@ -186,45 +200,60 @@
/* Define this if you have the `union wait' type in <sys/wait.h>. */ /* Define this if you have the `union wait' type in <sys/wait.h>. */
/* #undef HAVE_UNION_WAIT */ /* #undef HAVE_UNION_WAIT */
/* Define this if the POSIX.1 call `sysconf (_SC_OPEN_MAX)' works properly. */
/* #undef HAVE_SYSCONF_OPEN_MAX */
/* Define if you have the dup2 function. */ /* Define if you have the dup2 function. */
#define HAVE_DUP2 1 #define HAVE_DUP2 1
/* Define if you have the getcwd function. */ /* Define if you have the getcwd function. */
#define HAVE_GETCWD 1 #define HAVE_GETCWD 1
/* Define if you have the getdtablesize function. */
/* #undef HAVE_GETDTABLESIZE 1 */
/* Define if you have the getgroups function. */ /* Define if you have the getgroups function. */
/* #undef HAVE_GETGROUPS 1 */ /* #undef HAVE_GETGROUPS */
/* Define if you have the gethostbyname function. */
/* #undef HAVE_GETHOSTBYNAME */
/* Define if you have the gethostname function. */
/* #undef HAVE_GETHOSTNAME */
/* Define if you have the getloadavg function. */
/* #undef HAVE_GETLOADAVG */
/* Define if you have the memmove function. */
#define HAVE_MEMMOVE 1
/* Define if you have the mktemp function. */ /* Define if you have the mktemp function. */
#define HAVE_MKTEMP 1 #define HAVE_MKTEMP 1
/* Define if you have the psignal function. */ /* Define if you have the psignal function. */
/* #undef HAVE_PSIGNAL 1 */ /* #undef HAVE_PSIGNAL */
/* Define if you have the pstat_getdynamic function. */
/* #undef HAVE_PSTAT_GETDYNAMIC */
/* Define if you have the setegid function. */ /* Define if you have the setegid function. */
/* #undef HAVE_SETEGID 1 */ /* #undef HAVE_SETEGID */
/* Define if you have the seteuid function. */ /* Define if you have the seteuid function. */
/* #undef HAVE_SETEUID 1 */ /* #undef HAVE_SETEUID */
/* Define if you have the setlinebuf function. */ /* Define if you have the setlinebuf function. */
/* #undef HAVE_SETLINEBUF 1 */ /* #undef HAVE_SETLINEBUF */
/* Define if you have the setregid function. */ /* Define if you have the setregid function. */
/* #undefine HAVE_SETREGID 1 */ /* #undefine HAVE_SETREGID */
/* Define if you have the setreuid function. */ /* Define if you have the setreuid function. */
/* #define HAVE_SETREUID 1 */ /* #define HAVE_SETREUID */
/* Define if you have the sigsetmask function. */ /* Define if you have the sigsetmask function. */
#define HAVE_SIGSETMASK 1 #define HAVE_SIGSETMASK 1
/* Define if you have the socket function. */
/* #undef HAVE_SOCKET */
/* Define if you have the strcasecmp function. */
/* #undef HAVE_STRCASECMP */
/* Define if you have the strerror function. */ /* Define if you have the strerror function. */
#define HAVE_STRERROR 1 #define HAVE_STRERROR 1
@@ -232,13 +261,13 @@
/* #undef HAVE_STRSIGNAL */ /* #undef HAVE_STRSIGNAL */
/* Define if you have the wait3 function. */ /* Define if you have the wait3 function. */
/* #define HAVE_WAIT3 1 */ /* #undef HAVE_WAIT3 */
/* Define if you have the waitpid function. */ /* Define if you have the waitpid function. */
/* #undef HAVE_WAITPID 1 */ /* #undef HAVE_WAITPID */
/* Define if you have the <dirent.h> header file. */ /* Define if you have the <dirent.h> header file. */
/* #unddef HAVE_DIRENT_H 1 */ /* #undef HAVE_DIRENT_H */
/* Define if you have the <fcntl.h> header file. */ /* Define if you have the <fcntl.h> header file. */
#ifdef __DECC #ifdef __DECC
@@ -252,17 +281,17 @@
/* #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 1 */ /* #undef HAVE_MEMORY_H */
/* 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 <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define if you have the <string.h> header file. */ /* Define if you have the <string.h> header file. */
#define HAVE_STRING_H 1 #define HAVE_STRING_H 1
/* Define if you have the <pwd.h> header file. */
/* #undef HAVE_PWD_H */
/* 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 */
@@ -270,27 +299,40 @@
/* #undef HAVE_SYS_NDIR_H */ /* #undef HAVE_SYS_NDIR_H */
/* Define if you have the <sys/param.h> header file. */ /* Define if you have the <sys/param.h> header file. */
/* #undef HAVE_SYS_PARAM_H 1 */ /* #undef HAVE_SYS_PARAM_H */
/* Define if you have the <sys/timeb.h> header file. */ /* Define if you have the <sys/timeb.h> header file. */
#define HAVE_SYS_TIMEB_H 1 #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 1 */ /* #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). */ /* Define if you have the dgc library (-ldgc). */
/* #undef HAVE_LIBDGC */ /* #undef HAVE_LIBDGC */
/* Define if you have the kstat library (-lkstat). */
/* #undef HAVE_LIBKSTAT */
/* Define if you have the sun library (-lsun). */ /* Define if you have the sun library (-lsun). */
/* #undef HAVE_LIBSUN */ /* #undef HAVE_LIBSUN */
/* VMS specific */ /* VMS specific */
#define HAVE_VMSDIR_H 1 #define HAVE_VMSDIR_H 1
#define HAVE_STDLIB_H 1
#define INCLUDEDIR "sys$sysroot:[syslib]" #define INCLUDEDIR "sys$sysroot:[syslib]"
#define LIBDIR "sys$sysroot:[syslib]" #define LIBDIR "sys$sysroot:[syslib]"
/* Avoid broken RTL functions on OpenVMS */
#include <unixlib.h>
#define getopt gnu_getopt
#define optarg gnu_optarg
#define optopt gnu_optopt
#define optind gnu_optind
#define opterr gnu_opterr
#if defined (__cplusplus) || (defined (__STDC__) && __STDC__) #if defined (__cplusplus) || (defined (__STDC__) && __STDC__)
#undef PARAMS #undef PARAMS
#define PARAMS(protos) protos #define PARAMS(protos) protos

View File

@@ -4,24 +4,27 @@
System headers sometimes define this. System headers sometimes define this.
We just want to avoid a redefinition error message. */ We just want to avoid a redefinition error message. */
#ifndef _ALL_SOURCE #ifndef _ALL_SOURCE
#undef _ALL_SOURCE /* #undef _ALL_SOURCE */
#endif #endif
/* Define if using alloca.c. */ /* Define if using alloca.c. */
#undef C_ALLOCA /* #undef C_ALLOCA */
/* Define if the closedir function returns void instead of int. */
/* #undef CLOSEDIR_VOID */
/* Define to empty if the keyword does not work. */ /* Define to empty if the keyword does not work. */
#undef const /* #undef const */
/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems. /* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
This function is required for alloca.c support on those systems. */ This function is required for alloca.c support on those systems. */
#undef CRAY_STACKSEG_END /* #undef CRAY_STACKSEG_END */
/* Define for DGUX with <sys/dg_sys_info.h>. */ /* Define for DGUX with <sys/dg_sys_info.h>. */
#undef DGUX /* #undef DGUX */
/* Define if the `getloadavg' function needs to be run setuid or setgid. */ /* Define if the `getloadavg' function needs to be run setuid or setgid. */
#undef GETLOADAVG_PRIVILEGED /* #undef GETLOADAVG_PRIVILEGED */
/* Define to `int' if <sys/types.h> doesn't define. */ /* Define to `int' if <sys/types.h> doesn't define. */
#undef gid_t #undef gid_t
@@ -29,95 +32,94 @@
/* 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 */
/* Define if your system has a working fnmatch function. */
/* #undef HAVE_FNMATCH */
/* Define if your system has its own `getloadavg' function. */ /* Define if your system has its own `getloadavg' function. */
#undef HAVE_GETLOADAVG /* #undef HAVE_GETLOADAVG */
/* Define if you have the getmntent function. */ /* Define if you have the getmntent function. */
#undef HAVE_GETMNTENT /* #undef HAVE_GETMNTENT */
/* Define if the `long double' type works. */ /* Define if the `long double' type works. */
#undef HAVE_LONG_DOUBLE /* #undef HAVE_LONG_DOUBLE */
/* 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 */
/* Define if system calls automatically restart after interruption /* Define if system calls automatically restart after interruption
by a signal. */ by a signal. */
#undef HAVE_RESTARTABLE_SYSCALLS /* #undef HAVE_RESTARTABLE_SYSCALLS */
/* Define if your struct stat has st_blksize. */ /* Define if your struct stat has st_blksize. */
#undef HAVE_ST_BLKSIZE /* #undef HAVE_ST_BLKSIZE */
/* Define if your struct stat has st_blocks. */ /* Define if your struct stat has st_blocks. */
#undef HAVE_ST_BLOCKS /* #undef HAVE_ST_BLOCKS */
/* 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 */
/* Define if your struct tm has tm_zone. */ /* Define if your struct tm has tm_zone. */
#undef HAVE_TM_ZONE /* #undef HAVE_TM_ZONE */
/* 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 */
/* Define if on MINIX. */ /* Define if on MINIX. */
#undef _MINIX /* #undef _MINIX */
/* Define if your struct nlist has an n_un member. */ /* Define if your struct nlist has an n_un member. */
#undef NLIST_NAME_UNION /* #undef NLIST_NAME_UNION */
/* Define if you have <nlist.h>. */ /* Define if you have <nlist.h>. */
#undef NLIST_STRUCT /* #undef NLIST_STRUCT */
/* Define if your C compiler doesn't accept -c and -o together. */ /* Define if your C compiler doesn't accept -c and -o together. */
#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. */
#undef pid_t #undef pid_t
@@ -125,11 +127,11 @@
/* 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. */
#undef _POSIX_1_SOURCE /* #undef _POSIX_1_SOURCE */
/* 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
@@ -138,7 +140,7 @@
/* Define if the setvbuf function takes the buffering type as its second /* Define if the setvbuf function takes the buffering type as its second
argument and the buffer pointer as the third, as on System V argument and the buffer pointer as the third, as on System V
before release 3. */ before release 3. */
#undef SETVBUF_REVERSED /* #undef SETVBUF_REVERSED */
/* If using the C implementation of alloca, define if you know the /* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be direction of stack growth for your system; otherwise it will be
@@ -147,34 +149,34 @@
STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown STACK_DIRECTION = 0 => direction of growth unknown
*/ */
#undef STACK_DIRECTION /* #undef STACK_DIRECTION */
/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */ /* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
#undef STAT_MACROS_BROKEN /* #undef STAT_MACROS_BROKEN */
/* 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 */
/* Define if `sys_siglist' is declared by <signal.h>. */ /* Define if `sys_siglist' is declared by <signal.h>. */
#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. */
#undef uid_t #undef uid_t
#define uid_t int #define uid_t int
/* Define for Encore UMAX. */ /* Define for Encore UMAX. */
#undef UMAX /* #undef UMAX */
/* Define for Encore UMAX 4.3 that has <inq_status/cpustats.h> /* Define for Encore UMAX 4.3 that has <inq_status/cpustats.h>
instead of <sys/cpustats.h>. */ instead of <sys/cpustats.h>. */
#undef UMAX4_3 /* #undef UMAX4_3 */
/* 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) */ /* Name of this package (needed by automake) */
#define PACKAGE "%PACKAGE%" #define PACKAGE "%PACKAGE%"
@@ -187,113 +189,164 @@
#define SCCS_GET "echo no sccs get" #define SCCS_GET "echo no sccs get"
/* Define this if the SCCS `get' command understands the `-G<file>' option. */ /* Define this if the SCCS `get' command understands the `-G<file>' option. */
#undef SCCS_GET_MINUS_G /* #undef SCCS_GET_MINUS_G */
/* Define this to enable job server support in GNU make. */
/* #undef MAKE_JOBSERVER */
/* Define to be the nanoseconds member of struct stat's st_mtim,
if it exists. */
/* #undef ST_MTIM_NSEC */
/* Define this if the C library defines the variable `sys_siglist'. */ /* Define this if the C library defines the variable `sys_siglist'. */
#undef HAVE_SYS_SIGLIST /* #undef HAVE_SYS_SIGLIST */
/* Define this if the C library defines the variable `_sys_siglist'. */ /* Define this if the C library defines the variable `_sys_siglist'. */
#undef HAVE__SYS_SIGLIST /* #undef HAVE__SYS_SIGLIST */
/* Define this if you have the `union wait' type in <sys/wait.h>. */ /* Define this if you have the `union wait' type in <sys/wait.h>. */
#undef HAVE_UNION_WAIT /* #undef HAVE_UNION_WAIT */
/* Define 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 gethostbyname function. */
/* #undef HAVE_GETHOSTBYNAME */
/* Define if you have the gethostname function. */
/* #undef HAVE_GETHOSTNAME */
/* Define if you have the getloadavg function. */
/* #undef HAVE_GETLOADAVG */
/* Define if you have the memmove function. */
#undef HAVE_MEMMOVE
#define HAVE_MEMMOVE 1
/* 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 */
/* Define if you have the pstat_getdynamic function. */
/* #undef HAVE_PSTAT_GETDYNAMIC */
/* Define if you have the setegid function. */ /* Define if you have the setegid function. */
#undef HAVE_SETEGID /* #undef HAVE_SETEGID */
/* Define if you have the seteuid function. */ /* Define if you have the seteuid function. */
#undef HAVE_SETEUID /* #undef HAVE_SETEUID */
/* Define if you have the setlinebuf function. */ /* Define if you have the setlinebuf function. */
#undef HAVE_SETLINEBUF /* #undef HAVE_SETLINEBUF */
/* Define if you have the setregid function. */ /* Define if you have the setregid function. */
#undef HAVE_SETREGID /* #undef HAVE_SETREGID */
/* Define if you have the setreuid function. */ /* Define if you have the setreuid function. */
#undef HAVE_SETREUID /* #undef HAVE_SETREUID */
/* Define if you have the sigsetmask function. */ /* Define if you have the sigsetmask function. */
#undef HAVE_SIGSETMASK /* #undef HAVE_SIGSETMASK */
/* Define if you have the socket function. */
/* #undef HAVE_SOCKET */
/* Define if you have the strcasecmp function. */
/* #undef HAVE_STRCASECMP */
/* 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 */
/* Define if you have the wait3 function. */ /* Define if you have the wait3 function. */
#undef HAVE_WAIT3 /* #undef HAVE_WAIT3 */
/* Define if you have the waitpid function. */ /* Define if you have the waitpid function. */
#undef HAVE_WAITPID /* #undef HAVE_WAITPID */
/* 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 */
/* Define if you have the <sys/ndir.h> header file. */ /* Define if you have the <sys/ndir.h> header file. */
#undef HAVE_SYS_NDIR_H /* #undef HAVE_SYS_NDIR_H */
/* Define if you have the <sys/param.h> header file. */ /* Define if you have the <sys/param.h> header file. */
#undef HAVE_SYS_PARAM_H /* #undef HAVE_SYS_PARAM_H */
/* 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 */
/* Define if you have the <unistd.h> header file. */ /* Define if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H /* #undef HAVE_UNISTD_H */
/* Define if you have the dgc library (-ldgc). */ /* Define if you have the dgc library (-ldgc). */
#undef HAVE_LIBDGC /* #undef HAVE_LIBDGC */
/* Define if you have the kstat library (-lkstat). */
/* #undef HAVE_LIBKSTAT */
/* 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

View File

@@ -1,4 +1,3 @@
/* Generated automatically from configure.in by autoheader. DO NOT EDIT! */
/* Many things are defined already by a system header. */ /* Many things are defined already by a system header. */
#include <sys/config.h> #include <sys/config.h>
@@ -9,8 +8,20 @@
/* Version of this package (needed by automake) */ /* Version of this package (needed by automake) */
#define VERSION "%VERSION%" #define VERSION "%VERSION%"
#if __DJGPP__ > 2 || __DJGPP_MINOR__ > 1
/* Define if `sys_siglist' is declared by <signal.h>. */
# define SYS_SIGLIST_DECLARED 1
/* Define this if the C library defines the variable `_sys_siglist'. */
# define HAVE_SYS_SIGLIST 1
#else
/* Define NSIG. */ /* Define NSIG. */
#define NSIG SIGMAX # define NSIG SIGMAX
#endif
/* Define if you have sigsetmask. */ /* Define if you have sigsetmask. */
#define HAVE_SIGSETMASK 1 #define HAVE_SIGSETMASK 1
@@ -22,3 +33,17 @@
#define HAVE_MEMMOVE 1 #define HAVE_MEMMOVE 1
#define SCCS_GET "get" #define SCCS_GET "get"
/* Define to `unsigned long' or `unsigned long long'
if <inttypes.h> doesn't define. */
#define uintmax_t unsigned long long
/* Define the type of the first arg to select(). */
#define fd_set_size_t int
/* Define if you have the select function. */
#define HAVE_SELECT 1
/* Define if you have the vprintf library function. */
#undef HAVE_VPRINTF
#define HAVE_VPRINTF 1

View File

@@ -1,35 +1,42 @@
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.12)dnl dnl Minimum Autoconf version required. AC_PREREQ(2.13)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.
AM_INIT_AUTOMAKE(make, 3.76) AM_INIT_AUTOMAKE(make, 3.77.94)
AM_CONFIG_HEADER(config.h) AM_CONFIG_HEADER(config.h)
AC_CONFIG_SUBDIRS(glob)
AM_CONDITIONAL(MAINT_MAKEFILE, test -r $srcdir/maintMakefile)
dnl Regular configure stuff 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_CHECK_PROG(AR, ar, ar, ar)
AC_PROG_RANLIB
AC_PROG_CPP dnl Later checks need this. AC_PROG_CPP dnl Later checks need this.
AC_ARG_PROGRAM
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.
AC_TYPE_PID_T AC_TYPE_PID_T
AC_TYPE_SIGNAL AC_TYPE_SIGNAL
AC_CHECK_HEADERS(unistd.h limits.h sys/param.h fcntl.h string.h memory.h \ AC_CHECK_HEADERS(stdlib.h unistd.h limits.h sys/param.h fcntl.h string.h \
sys/timeb.h) memory.h sys/timeb.h)
AC_PROG_CC_C_O AC_PROG_CC_C_O
AC_C_CONST dnl getopt needs this. AC_C_CONST dnl getopt needs this.
AC_HEADER_STAT AC_HEADER_STAT
AC_STRUCT_ST_MTIM_NSEC
jm_AC_TYPE_UINTMAX_T
AC_SUBST(LIBOBJS) AC_SUBST(LIBOBJS)
AC_DEFUN(AC_CHECK_SYMBOL, [dnl AC_DEFUN(AC_CHECK_SYMBOL, [dnl
@@ -45,19 +52,27 @@ 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(memmove psignal mktemp pstat_getdynamic \ # clock_gettime is in -lposix4 in Solaris 2.6.
dup2 getcwd sigsetmask getgroups setlinebuf \ AC_CHECK_LIB(posix4, clock_gettime)
seteuid setegid setreuid setregid strerror strsignal)
AC_CHECK_FUNCS(memmove strdup psignal mktemp pstat_getdynamic \
clock_gettime dup2 getcwd sigsetmask sigaction getgroups \
setlinebuf seteuid setegid setreuid setregid pipe \
strerror strsignal)
AC_CHECK_SYMBOL(sys_siglist) AC_CHECK_SYMBOL(sys_siglist)
AC_FUNC_ALLOCA AC_FUNC_ALLOCA
AC_FUNC_VFORK AC_FUNC_VFORK
AC_FUNC_VPRINTF
AC_FUNC_STRCOLL
AC_FUNC_CLOSEDIR_VOID
AC_FUNC_SETVBUF_REVERSED AC_FUNC_SETVBUF_REVERSED
AC_FUNC_GETLOADAVG AC_FUNC_GETLOADAVG
AC_FUNC_SELECT
AC_CHECK_LIB(kstat, kstat_open) AC_CHECK_LIB(kstat, kstat_open)
AC_FUNC_STRCOLL
# Check out the wait reality. # Check out the wait reality.
AC_CHECK_HEADERS(sys/wait.h) AC_CHECK_FUNCS(waitpid wait3) AC_CHECK_HEADERS(sys/wait.h)
AC_CHECK_FUNCS(waitpid wait3)
AC_MSG_CHECKING(for union wait) AC_MSG_CHECKING(for union wait)
AC_CACHE_VAL(make_cv_union_wait, [dnl AC_CACHE_VAL(make_cv_union_wait, [dnl
AC_TRY_LINK([#include <sys/types.h> AC_TRY_LINK([#include <sys/types.h>
@@ -91,33 +106,158 @@ 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 dnl See if we can handle the job server feature, and if the user wants it.
AC_ARG_ENABLE(job-server,
[ --disable-job-server Disallow recursive make communication during -jN],
[make_cv_job_server="$enableval" user_job_server="$enableval"],
[make_cv_job_server="yes"])
has_wait_nohang=yes
case "$ac_cv_func_waitpid/$ac_cv_func_wait3" in
no/no) has_wait_nohang=no ;;
esac
case "$ac_cv_func_pipe/$ac_cv_func_sigaction/$has_wait_nohang/$make_cv_job_server" in
yes/yes/yes/yes) AC_DEFINE(MAKE_JOBSERVER) ;;
esac
dnl Allow building with dmalloc
AC_ARG_ENABLE(dmalloc,
[ --enable-dmalloc Enable support for the dmalloc debugging library],
[make_cv_dmalloc="$enableval"],
[make_cv_dmalloc="no"])
case "$make_cv_dmalloc" in
yes) AC_CHECK_HEADERS(dmalloc.h)
AC_CHECK_LIB(dmalloc, dmalloc_shutdown)
CPPFLAGS="$CPPFLAGS -DDMALLOC_FUNC_CHECK" ;;
esac
AC_CACHE_CHECK(for location of SCCS get command, make_cv_path_sccs_get, [
if test -f /usr/sccs/get; then if test -f /usr/sccs/get; then
SCCS_GET=/usr/sccs/get make_cv_path_sccs_get=/usr/sccs/get
AC_DEFINE(SCCS_GET, "/usr/sccs/get")
else else
SCCS_GET=get make_cv_path_sccs_get=get
AC_DEFINE(SCCS_GET, "get") fi])
fi AC_DEFINE_UNQUOTED(SCCS_GET,["$make_cv_path_sccs_get"])
ac_clean_files="$ac_clean_files s.conftest conftoast" # Remove these later. ac_clean_files="$ac_clean_files s.conftest conftoast" # Remove these later.
if ( /usr/sccs/admin -n s.conftest || admin -n s.conftest ) >/dev/null 2>&1 && if ( /usr/sccs/admin -n s.conftest || admin -n s.conftest ) >/dev/null 2>&1 &&
test -f s.conftest; then test -f s.conftest; then
# We successfully created an SCCS file. # We successfully created an SCCS file.
echo checking if SCCS get command understands -G AC_CACHE_CHECK(if SCCS get command understands -G, make_cv_sys_get_minus_G, [
if $SCCS_GET -Gconftoast s.conftest >/dev/null 2>&1 && if $make_cv_path_sccs_get -Gconftoast s.conftest >/dev/null 2>&1 &&
test -f conftoast; then test -f conftoast; then
AC_DEFINE(SCCS_GET_MINUS_G) make_cv_sys_get_minus_G=yes
fi else
make_cv_sys_get_minus_G=no
fi])
case "$make_cv_sys_get_minus_G" in
yes) AC_DEFINE(SCCS_GET_MINUS_G);;
esac
fi fi
rm -f s.conftest conftoast rm -f s.conftest conftoast
AC_OUTPUT(Makefile build.sh, [ AC_MSG_CHECKING(if system libc has GNU glob)
# Makefile uses this timestamp file to know when to remake Makefile, AC_CACHE_VAL(make_cv_sys_gnu_glob, [
# build.sh, and glob/Makefile. AC_TRY_CPP([
touch stamp-config]) #include <features.h>
#include <glob.h>
#include <fnmatch.h>
#define GLOB_INTERFACE_VERSION 1
#if defined _LIBC || !defined __GNU_LIBRARY__ || __GNU_LIBRARY__ <= 1
# error no gnu glob
#else
# include <gnu-versions.h>
# if _GNU_GLOB_INTERFACE_VERSION != GLOB_INTERFACE_VERSION
# error no gnu glob
# endif
#endif
], make_cv_sys_gnu_glob=yes, make_cv_sys_gnu_glob=no)])
case "$make_cv_sys_gnu_glob" in
yes) AC_MSG_RESULT(yes) ;;
no) AC_MSG_RESULT([no; using local copy])
CPPFLAGS="$CPPFLAGS -I$srcdir/glob"
AC_SUBST(GLOBLIB) GLOBLIB=glob/libglob.a
;;
esac
MAINT_MAKEFILE=/dev/null
if test -r $srcdir/maintMakefile; then
MAINT_MAKEFILE="$srcdir/maintMakefile"
fi
AC_SUBST_FILE(MAINT_MAKEFILE)
AC_OUTPUT(build.sh Makefile glob/Makefile)
dnl If we don't yet have build.sh.in, build.sh is a bogus 0-length file
dnl so remove it.
test -f build.sh.in || rm -f build.sh
case "$make_badcust" in
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
case "$has_wait_nohang" in
no) echo
echo "WARNING: Your system has neither waitpid() nor wait3()."
echo " Without one of these, signal handling is unreliable."
echo " You should be aware that running GNU make with -j"
echo " could result in erratic behavior."
echo ;;
esac
case "$make_cv_job_server/$user_job_server" in
no/yes) echo
echo "WARNING: Make job server requires a POSIX-ish system that"
echo " supports the pipe(), sigaction(), and either"
echo " waitpid() or wait3() functions. Your system doesn't"
echo " appear to provide one or more of those."
echo " Disabling job server support."
echo ;;
esac
dnl Local Variables: dnl Local Variables:
dnl comment-start: "dnl " dnl comment-start: "dnl "

View File

@@ -14,7 +14,8 @@ 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, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "make.h" #include "make.h"
#include "rule.h" #include "rule.h"
@@ -41,7 +42,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 +92,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 +159,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",
@@ -178,19 +183,21 @@ static char *default_suffix_rules[] =
".S.o", ".S.o",
"$(COMPILE.S) -o $@ $<", "$(COMPILE.S) -o $@ $<",
".c.o", ".c.o",
"$(COMPILE.c) $< $(OUTPUT_OPTION)", "$(COMPILE.c) $(OUTPUT_OPTION) $<",
".cc.o", ".cc.o",
"$(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",
"$(COMPILE.p) $< $(OUTPUT_OPTION)", "$(COMPILE.p) $(OUTPUT_OPTION) $<",
".F.o", ".F.o",
"$(COMPILE.F) $< $(OUTPUT_OPTION)", "$(COMPILE.F) $(OUTPUT_OPTION) $<",
".r.o", ".r.o",
"$(COMPILE.r) $< $(OUTPUT_OPTION)", "$(COMPILE.r) $(OUTPUT_OPTION) $<",
".mod.o", ".mod.o",
"$(COMPILE.mod) -o $@ $<", "$(COMPILE.mod) -o $@ $<",
@@ -215,9 +222,9 @@ static char *default_suffix_rules[] =
"@$(RM) $@ \n $(LEX.l) $< > $@", "@$(RM) $@ \n $(LEX.l) $< > $@",
".F.f", ".F.f",
"$(PREPROCESS.F) $< $(OUTPUT_OPTION)", "$(PREPROCESS.F) $(OUTPUT_OPTION) $<",
".r.f", ".r.f",
"$(PREPROCESS.r) $< $(OUTPUT_OPTION)", "$(PREPROCESS.r) $(OUTPUT_OPTION) $<",
/* This might actually make lex.yy.c if there's no %R% /* This might actually make lex.yy.c if there's no %R%
directive in $*.l, but in that case why were you directive in $*.l, but in that case why were you
@@ -386,8 +393,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",
@@ -417,6 +426,16 @@ static char *default_variables[] =
"SCCS_OUTPUT_OPTION", "-G$@", "SCCS_OUTPUT_OPTION", "-G$@",
#endif #endif
#ifdef _AMIGA
".LIBPATTERNS", "%.lib",
#else
#ifdef __MSDOS__
".LIBPATTERNS", "lib%.a $(DJDIR)/lib/lib%.a",
#else
".LIBPATTERNS", "lib%.so lib%.a",
#endif
#endif
#endif /* !VMS */ #endif /* !VMS */
0, 0 0, 0
}; };
@@ -460,7 +479,7 @@ install_default_suffix_rules ()
if (f->cmds == 0) if (f->cmds == 0)
{ {
f->cmds = (struct commands *) xmalloc (sizeof (struct commands)); f->cmds = (struct commands *) xmalloc (sizeof (struct commands));
f->cmds->filename = 0; f->cmds->fileinfo.filenm = 0;
f->cmds->commands = s[1]; f->cmds->commands = s[1];
f->cmds->command_lines = 0; f->cmds->command_lines = 0;
} }
@@ -490,6 +509,9 @@ define_default_variables ()
{ {
register char **s; register char **s;
if (no_builtin_variables_flag)
return;
for (s = default_variables; *s != 0; s += 2) for (s = default_variables; *s != 0; s += 2)
(void) define_variable (s[0], strlen (s[0]), s[1], o_default, 1); (void) define_variable (s[0], strlen (s[0]), s[1], o_default, 1);
} }

25
dep.h
View File

@@ -14,7 +14,18 @@ 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, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* Flag bits for the second argument to `read_makefile'.
These flags are saved in the `changed' field of each
`struct dep' in the chain returned by `read_all_makefiles'. */
#define RM_NO_DEFAULT_GOAL (1 << 0) /* Do not set default goal. */
#define RM_INCLUDED (1 << 1) /* Search makefile search path. */
#define RM_DONTCARE (1 << 2) /* No error if it doesn't exist. */
#define RM_NO_TILDE (1 << 3) /* Don't expand ~ in file name. */
#define RM_NOFLAG 0
/* Structure representing one dependency of a file. /* Structure representing one dependency of a file.
Each struct file's `deps' points to a chain of these, Each struct file's `deps' points to a chain of these,
@@ -59,13 +70,7 @@ extern struct nameseq *ar_glob PARAMS ((char *arname, char *member_pattern, unsi
extern char *dep_name (); extern char *dep_name ();
#endif #endif
extern struct dep *copy_dep_chain PARAMS ((struct dep *d));
extern struct dep *read_all_makefiles PARAMS ((char **makefiles)); extern struct dep *read_all_makefiles PARAMS ((char **makefiles));
extern int update_goal_chain PARAMS ((struct dep *goals, int makefiles));
/* Flag bits for the second argument to `read_makefile'. extern void uniquize_deps PARAMS ((struct dep *));
These flags are saved in the `changed' field of each
`struct dep' in the chain returned by `read_all_makefiles'. */
#define RM_NO_DEFAULT_GOAL (1 << 0) /* Do not set default goal. */
#define RM_INCLUDED (1 << 1) /* Search makefile search path. */
#define RM_DONTCARE (1 << 2) /* No error if it doesn't exist. */
#define RM_NO_TILDE (1 << 3) /* Don't expand ~ in file name. */
#define RM_NOFLAG 0

132
dir.c
View File

@@ -14,7 +14,8 @@ 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, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "make.h" #include "make.h"
@@ -111,19 +112,25 @@ dosify (filename)
#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)
@@ -134,9 +141,9 @@ amigafy (filename)
*df = 0; *df = 0;
return amiga_filename; return new_filename;
} }
#endif /* _AMIGA */ #endif /* HAVE_CASE_INSENSITIVE_FS */
#ifdef VMS #ifdef VMS
@@ -325,6 +332,13 @@ find_directory (name)
#ifdef VMS #ifdef VMS
if (vmsstat_dir (name, &st) < 0) if (vmsstat_dir (name, &st) < 0)
#else #else
#ifdef WINDOWS32
/* Remove any trailing '\'. Windows32 stat fails even on valid
directories if they end in '\'. */
if (p[-1] == '\\')
p[-1] = '\0';
#endif
if (stat (name, &st) < 0) if (stat (name, &st) < 0)
#endif #endif
{ {
@@ -355,7 +369,7 @@ find_directory (name)
for (dc = directories_contents[hash]; dc != 0; dc = dc->next) for (dc = directories_contents[hash]; dc != 0; dc = dc->next)
#ifdef WINDOWS32 #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
@@ -378,7 +392,7 @@ 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 WINDOWS32 #ifdef WINDOWS32
dc->path_key = strdup(w32_path); dc->path_key = xstrdup(w32_path);
dc->mtime = st.st_mtime; dc->mtime = st.st_mtime;
/* /*
@@ -468,8 +482,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
@@ -613,6 +627,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))
@@ -632,8 +647,9 @@ file_exists_p (name)
char *bslash = rindex(name, '\\'); char *bslash = rindex(name, '\\');
if (!dirend || bslash > dirend) if (!dirend || bslash > dirend)
dirend = bslash; dirend = bslash;
/* The case of "d:file" is unhandled. But I don't think /* The case of "d:file". */
such names can happen here. */ if (!dirend && name[0] && name[1] == ':')
dirend = name + 1;
} }
#endif /* WINDOWS32 || __MSDOS__ */ #endif /* WINDOWS32 || __MSDOS__ */
if (dirend == 0) if (dirend == 0)
@@ -644,15 +660,22 @@ file_exists_p (name)
#endif /* AMIGA */ #endif /* AMIGA */
#endif /* VMS */ #endif /* VMS */
slash = dirend;
if (dirend == name) if (dirend == name)
dirname = "/"; dirname = "/";
else 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); dirname = (char *) alloca (dirend - name + 1);
bcopy (name, dirname, dirend - name); bcopy (name, dirname, dirend - name);
dirname[dirend - name] = '\0'; dirname[dirend - name] = '\0';
} }
return dir_file_exists_p (dirname, dirend + 1); return dir_file_exists_p (dirname, slash + 1);
} }
/* Mark FILENAME as `impossible' for `file_impossible_p'. /* Mark FILENAME as `impossible' for `file_impossible_p'.
@@ -682,8 +705,9 @@ file_impossible (filename)
char *bslash = rindex(p, '\\'); char *bslash = rindex(p, '\\');
if (!dirend || bslash > dirend) if (!dirend || bslash > dirend)
dirend = bslash; dirend = bslash;
/* The case of "d:file" is unhandled. But I don't think /* The case of "d:file". */
such names can happen here. */ if (!dirend && p[0] && p[1] == ':')
dirend = p + 1;
} }
#endif /* WINDOWS32 or __MSDOS__ */ #endif /* WINDOWS32 or __MSDOS__ */
if (dirend == 0) if (dirend == 0)
@@ -696,16 +720,23 @@ file_impossible (filename)
else else
{ {
char *dirname; char *dirname;
char *slash = dirend;
if (dirend == p) if (dirend == p)
dirname = "/"; dirname = "/";
else 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); dirname = (char *) alloca (dirend - p + 1);
bcopy (p, dirname, dirend - p); bcopy (p, dirname, dirend - p);
dirname[dirend - p] = '\0'; 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)
@@ -748,7 +779,7 @@ file_impossible (filename)
new = (struct dirfile *) xmalloc (sizeof (struct dirfile)); new = (struct dirfile *) xmalloc (sizeof (struct dirfile));
new->next = dir->contents->files[hash]; new->next = dir->contents->files[hash];
dir->contents->files[hash] = new; dir->contents->files[hash] = new;
new->name = savestring (filename, strlen (filename)); new->name = xstrdup (filename);
new->impossible = 1; new->impossible = 1;
} }
@@ -776,8 +807,9 @@ file_impossible_p (filename)
char *bslash = rindex(filename, '\\'); char *bslash = rindex(filename, '\\');
if (!dirend || bslash > dirend) if (!dirend || bslash > dirend)
dirend = bslash; dirend = bslash;
/* The case of "d:file" is unhandled. But I don't think /* The case of "d:file". */
such names can happen here. */ if (!dirend && filename[0] && filename[1] == ':')
dirend = filename + 1;
} }
#endif /* WINDOWS32 || __MSDOS__ */ #endif /* WINDOWS32 || __MSDOS__ */
if (dirend == 0) if (dirend == 0)
@@ -790,16 +822,23 @@ file_impossible_p (filename)
else else
{ {
char *dirname; char *dirname;
char *slash = dirend;
if (dirend == filename) if (dirend == filename)
dirname = "/"; dirname = "/";
else 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); dirname = (char *) alloca (dirend - filename + 1);
bcopy (p, dirname, dirend - p); bcopy (p, dirname, dirend - p);
dirname[dirend - p] = '\0'; 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)
@@ -809,8 +848,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);
@@ -845,7 +884,7 @@ print_dir_data_base ()
register unsigned int i, dirs, files, impossible; register unsigned int i, dirs, files, impossible;
register struct directory *dir; register struct directory *dir;
puts ("\n# Directories\n"); puts (_("\n# Directories\n"));
dirs = files = impossible = 0; dirs = files = impossible = 0;
for (i = 0; i < DIRECTORY_BUCKETS; ++i) for (i = 0; i < DIRECTORY_BUCKETS; ++i)
@@ -853,19 +892,19 @@ print_dir_data_base ()
{ {
++dirs; ++dirs;
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 WINDOWS32 #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 /* WINDOWS32 */ #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,
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 %ld, inode %ld): could not be opened.\n", printf (_("# %s (device %ld, inode %ld): could not be opened.\n"),
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
@@ -882,33 +921,34 @@ print_dir_data_base ()
else else
++f; ++f;
#ifdef WINDOWS32 #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 /* WINDOWS32 */ #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 /* WINDOWS32 */ #endif /* WINDOWS32 */
if (f == 0) if (f == 0)
fputs ("No", stdout); fputs (_("No"), stdout);
else else
printf ("%u", f); printf ("%u", f);
fputs (" files, ", stdout); fputs (_(" files, "), stdout);
if (im == 0) if (im == 0)
fputs ("no", stdout); fputs (_("no"), stdout);
else else
printf ("%u", im); printf ("%u", im);
fputs (" impossibilities", stdout); fputs (_(" impossibilities"), stdout);
if (dir->contents->dirstream == 0) if (dir->contents->dirstream == 0)
puts ("."); puts (".");
else else
puts (" so far."); puts (_(" so far."));
files += f; files += f;
impossible += im; impossible += im;
} }
@@ -916,15 +956,15 @@ print_dir_data_base ()
fputs ("\n# ", stdout); fputs ("\n# ", stdout);
if (files == 0) if (files == 0)
fputs ("No", stdout); fputs (_("No"), stdout);
else else
printf ("%u", files); printf ("%u", files);
fputs (" files, ", stdout); fputs (_(" files, "), stdout);
if (impossible == 0) if (impossible == 0)
fputs ("no", stdout); fputs (_("no"), stdout);
else else
printf ("%u", impossible); printf ("%u", impossible);
printf (" impossibilities in %u directories.\n", dirs); printf (_(" impossibilities in %u directories.\n"), dirs);
} }
/* Hooks for globbing. */ /* Hooks for globbing. */
@@ -1016,16 +1056,26 @@ 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;
{ {
#ifndef VMS
extern int stat (); extern int stat ();
#endif
/* 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. */

View File

@@ -1,42 +1,42 @@
@echo Building Make for MSDOS @echo Building Make for MSDOS
@rem Echo ON so they will see what is going on.
@echo on @rem Echo ON so they will see what is going 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 @echo on
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 commands.c -o commands.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 -O2 -g job.c -o job.o
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g read.c -o read.o
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g remake.c -o remake.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 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 file.c -o file.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 misc.c -o misc.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 main.c -o main.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 -DINCLUDEDIR=\"c:/djgpp/include\" -O2 -g read.c -o read.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 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 signame.c -o signame.o
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g remote-stub.c -o remote-stub.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 getopt.c -o getopt.o
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g getopt1.c -o getopt1.o gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g implicit.c -o implicit.o
@cd glob
@if exist libglob.a del libglob.a gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g default.c -o default.o
gcc -I. -c -DHAVE_CONFIG_H -I.. -O2 -g glob.c -o glob.o
gcc -I. -c -DHAVE_CONFIG_H -I.. -O2 -g fnmatch.c -o fnmatch.o gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g variable.c -o variable.o
ar rv libglob.a glob.o fnmatch.o
@echo off gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g expand.c -o expand.o
cd ..
echo commands.o > respf.$$$ gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g function.c -o function.o
for %%f in (job dir file misc main read remake rule implicit default variable) do echo %%f.o >> respf.$$$
for %%f in (expand function vpath version ar arscan signame remote-stub getopt getopt1) do echo %%f.o >> respf.$$$ gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g vpath.c -o vpath.o
echo glob/libglob.a >> respf.$$$
@echo Linking... gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g version.c -o version.o
@echo on
gcc -o make.new @respf.$$$ gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g ar.c -o ar.o
@if exist make.exe echo Make.exe is now built!
@if not exist make.exe echo Make.exe build failed... gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g arscan.c -o arscan.o
@if exist make.exe del respf.$$$

134
expand.c
View File

@@ -14,22 +14,32 @@ 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, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "make.h" #include "make.h"
#include "filedef.h" #include "filedef.h"
#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 +55,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
@@ -86,17 +96,10 @@ recursively_expand (v)
char *value; char *value;
if (v->expanding) if (v->expanding)
{ /* Expanding V causes infinite recursion. Lose. */
/* Expanding V causes infinite recursion. Lose. */ fatal (reading_file,
if (reading_filename == 0) _("Recursive variable `%s' references itself (eventually)"),
fatal ("Recursive variable `%s' references itself (eventually)", v->name);
v->name);
else
makefile_fatal
(reading_filename, *reading_lineno_ptr,
"Recursive variable `%s' references itself (eventually)",
v->name);
}
v->expanding = 1; v->expanding = 1;
value = allocated_variable_expand (v->value); value = allocated_variable_expand (v->value);
@@ -116,14 +119,8 @@ warn_undefined (name, length)
unsigned int length; unsigned int length;
{ {
if (warn_undefined_variables_flag) if (warn_undefined_variables_flag)
{ error (reading_file,
static const char warnmsg[] = "warning: undefined variable `%.*s'"; _("warning: undefined variable `%.*s'"), (int)length, name);
if (reading_filename != 0)
makefile_error (reading_filename, *reading_lineno_ptr,
warnmsg, length, name);
else
error (warnmsg, length, name);
}
} }
/* Expand a simple reference to variable NAME, which is LENGTH chars long. */ /* Expand a simple reference to variable NAME, which is LENGTH chars long. */
@@ -153,20 +150,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)
{ {
@@ -216,14 +231,8 @@ variable_expand (line)
end = index (beg, closeparen); end = index (beg, closeparen);
if (end == 0) if (end == 0)
{ /* Unterminated variable reference. */
/* Unterminated variable reference. */ fatal (reading_file, _("unterminated variable reference"));
if (reading_filename != 0)
makefile_fatal (reading_filename, *reading_lineno_ptr,
"unterminated variable reference");
else
fatal ("unterminated variable reference");
}
p1 = lindex (beg, end, '$'); p1 = lindex (beg, end, '$');
if (p1 != 0) if (p1 != 0)
{ {
@@ -316,7 +325,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 +375,7 @@ variable_expand (line)
} }
break; break;
} }
if (*p == '\0') if (*p == '\0')
break; break;
@@ -374,8 +383,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, (long)-1);
} }
/* Expand an argument for an expansion function. /* Expand an argument for an expansion function.
@@ -405,25 +429,39 @@ 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);
save = current_variable_set_list; save = current_variable_set_list;
current_variable_set_list = file->variables; current_variable_set_list = file->variables;
reading_filename = file->cmds->filename; if (file->cmds && file->cmds->fileinfo.filenm)
reading_lineno_ptr = &file->cmds->lineno; reading_file = &file->cmds->fileinfo;
else
reading_file = 0;
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_file = 0;
reading_lineno_ptr = 0; file->variables->next = fnext;
return result; return result;
} }

179
file.c
View File

@@ -14,7 +14,10 @@ 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, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include <assert.h>
#include "make.h" #include "make.h"
#include "dep.h" #include "dep.h"
@@ -22,7 +25,6 @@ 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 <assert.h>
/* Hash table of files the makefile knows how to make. */ /* Hash table of files the makefile knows how to make. */
@@ -36,6 +38,9 @@ static struct file *files[FILE_BUCKETS];
unsigned int num_intermediates = 0; unsigned int num_intermediates = 0;
/* Current value for pruning the scan of the goal chain (toggle 0/1). */
unsigned int considered = 0;
/* Access the hash table of all file records. /* Access the hash table of all file records.
lookup_file given a name, return the struct file * for that name, lookup_file given a name, return the struct file * for that name,
@@ -49,6 +54,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 +65,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
@@ -89,9 +103,15 @@ lookup_file (name)
{ {
if (strieq (f->hname, name)) if (strieq (f->hname, name))
{ {
#ifdef VMS
free (lname);
#endif
return f; return f;
} }
} }
#ifdef VMS
free (lname);
#endif
return 0; return 0;
} }
@@ -279,24 +299,24 @@ file_hash_enter (file, name, oldhash, oldname)
/* We have two sets of commands. We will go with the /* We have two sets of commands. We will go with the
one given in the rule explicitly mentioning this name, one given in the rule explicitly mentioning this name,
but give a message to let the user know what's going on. */ but give a message to let the user know what's going on. */
if (oldfile->cmds->filename != 0) if (oldfile->cmds->fileinfo.filenm != 0)
makefile_error (file->cmds->filename, file->cmds->lineno, error (&file->cmds->fileinfo,
"Commands were specified for \ _("Commands were specified for \
file `%s' at %s:%u,", file `%s' at %s:%lu,"),
oldname, oldfile->cmds->filename, oldname, oldfile->cmds->fileinfo.filenm,
oldfile->cmds->lineno); oldfile->cmds->fileinfo.lineno);
else else
makefile_error (file->cmds->filename, file->cmds->lineno, error (&file->cmds->fileinfo,
"Commands for file `%s' were found by \ _("Commands for file `%s' were found by \
implicit rule search,", implicit rule search,"),
oldname); oldname);
makefile_error (file->cmds->filename, file->cmds->lineno, error (&file->cmds->fileinfo,
"but `%s' is now considered the same file \ _("but `%s' is now considered the same file \
as `%s'.", as `%s'."),
oldname, name); oldname, name);
makefile_error (file->cmds->filename, file->cmds->lineno, error (&file->cmds->fileinfo,
"Commands for `%s' will be ignored \ _("Commands for `%s' will be ignored \
in favor of those for `%s'.", in favor of those for `%s'."),
name, oldname); name, oldname);
} }
} }
@@ -316,12 +336,12 @@ in favor of those for `%s'.",
merge_variable_set_lists (&oldfile->variables, file->variables); merge_variable_set_lists (&oldfile->variables, file->variables);
if (oldfile->double_colon && file->is_target && !file->double_colon) if (oldfile->double_colon && file->is_target && !file->double_colon)
fatal ("can't rename single-colon `%s' to double-colon `%s'", fatal (NILF, _("can't rename single-colon `%s' to double-colon `%s'"),
oldname, name); oldname, name);
if (!oldfile->double_colon && file->double_colon) if (!oldfile->double_colon && file->double_colon)
{ {
if (oldfile->is_target) if (oldfile->is_target)
fatal ("can't rename double-colon `%s' to single-colon `%s'", fatal (NILF, _("can't rename double-colon `%s' to single-colon `%s'"),
oldname, name); oldname, name);
else else
oldfile->double_colon = file->double_colon; oldfile->double_colon = file->double_colon;
@@ -331,6 +351,8 @@ in favor of those for `%s'.",
/* %%% Kludge so -W wins on a file that gets vpathized. */ /* %%% Kludge so -W wins on a file that gets vpathized. */
oldfile->last_mtime = file->last_mtime; oldfile->last_mtime = file->last_mtime;
oldfile->mtime_before_update = file->mtime_before_update;
#define MERGE(field) oldfile->field |= file->field #define MERGE(field) oldfile->field |= file->field
MERGE (precious); MERGE (precious);
MERGE (tried_implicit); MERGE (tried_implicit);
@@ -374,9 +396,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);
@@ -386,7 +408,7 @@ remove_intermediates (sig)
if (!f->dontcare) if (!f->dontcare)
{ {
if (sig) if (sig)
error ("*** Deleting intermediate file `%s'", f->name); error (NILF, _("*** Deleting intermediate file `%s'"), f->name);
else if (!silent_flag) else if (!silent_flag)
{ {
if (! doneany) if (! doneany)
@@ -450,7 +472,8 @@ snap_deps ()
{ {
/* Mark this file as phony and nonexistent. */ /* Mark this file as phony and nonexistent. */
f2->phony = 1; f2->phony = 1;
f2->last_mtime = (time_t) -1; f2->last_mtime = (FILE_TIMESTAMP) -1;
f2->mtime_before_update = (FILE_TIMESTAMP) -1;
} }
for (f = lookup_file (".INTERMEDIATE"); f != 0; f = f->prev) for (f = lookup_file (".INTERMEDIATE"); f != 0; f = f->prev)
@@ -534,6 +557,51 @@ set_command_state (file, state)
d->file->command_state = state; d->file->command_state = state;
} }
/* Get and print file timestamps. */
FILE_TIMESTAMP
file_timestamp_now ()
{
#if HAVE_CLOCK_GETTIME && defined CLOCK_REALTIME
struct timespec timespec;
if (clock_gettime (CLOCK_REALTIME, &timespec) == 0)
return FILE_TIMESTAMP_FROM_S_AND_NS (timespec.tv_sec, timespec.tv_nsec);
#endif
return FILE_TIMESTAMP_FROM_S_AND_NS (time ((time_t *) 0), 0);
}
void
file_timestamp_sprintf (p, ts)
char *p;
FILE_TIMESTAMP ts;
{
time_t t = FILE_TIMESTAMP_S (ts);
struct tm *tm = localtime (&t);
if (tm)
sprintf (p, "%04d-%02d-%02d %02d:%02d:%02d",
tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday,
tm->tm_hour, tm->tm_min, tm->tm_sec);
else if (t < 0)
sprintf (p, "%ld", (long) t);
else
sprintf (p, "%lu", (unsigned long) t);
p += strlen (p);
/* Append nanoseconds as a fraction, but remove trailing zeros.
We don't know the actual timestamp resolution, since clock_getres
applies only to local times, whereas this timestamp might come
from a remote filesystem. So removing trailing zeros is the
best guess that we can do. */
sprintf (p, ".%09ld", (long) FILE_TIMESTAMP_NS (ts));
p += strlen (p) - 1;
while (*p == '0')
p--;
p += *p != '.';
*p = '\0';
}
/* Print the data base of files. */ /* Print the data base of files. */
static void static void
@@ -544,7 +612,7 @@ print_file (f)
putchar ('\n'); putchar ('\n');
if (!f->is_target) if (!f->is_target)
puts ("# Not a target:"); puts (_("# Not a target:"));
printf ("%s:%s", f->name, f->double_colon ? ":" : ""); printf ("%s:%s", f->name, f->double_colon ? ":" : "");
for (d = f->deps; d != 0; d = d->next) for (d = f->deps; d != 0; d = d->next)
@@ -552,42 +620,45 @@ print_file (f)
putchar ('\n'); putchar ('\n');
if (f->precious) if (f->precious)
puts ("# Precious file (dependency of .PRECIOUS)."); puts (_("# Precious file (prerequisite of .PRECIOUS)."));
if (f->phony) if (f->phony)
puts ("# Phony target (dependency of .PHONY)."); puts (_("# Phony target (prerequisite of .PHONY)."));
if (f->cmd_target) if (f->cmd_target)
puts ("# Command-line target."); puts (_("# Command-line target."));
if (f->dontcare) if (f->dontcare)
puts ("# A default or MAKEFILES makefile."); puts (_("# A default or MAKEFILES makefile."));
printf ("# Implicit rule search has%s been done.\n", printf (_("# Implicit rule search has%s been done.\n"),
f->tried_implicit ? "" : " not"); f->tried_implicit ? "" : _(" not"));
if (f->stem != 0) if (f->stem != 0)
printf ("# Implicit/static pattern stem: `%s'\n", f->stem); printf (_("# Implicit/static pattern stem: `%s'\n"), f->stem);
if (f->intermediate) if (f->intermediate)
puts ("# File is an intermediate dependency."); puts (_("# File is an intermediate prerequisite."));
if (f->also_make != 0) if (f->also_make != 0)
{ {
fputs ("# Also makes:", stdout); fputs (_("# Also makes:"), stdout);
for (d = f->also_make; d != 0; d = d->next) for (d = f->also_make; d != 0; d = d->next)
printf (" %s", dep_name (d)); printf (" %s", dep_name (d));
putchar ('\n'); putchar ('\n');
} }
if (f->last_mtime == (time_t) 0) if (f->last_mtime == 0)
puts ("# Modification time never checked."); puts (_("# Modification time never checked."));
else if (f->last_mtime == (time_t) -1) else if (f->last_mtime == (FILE_TIMESTAMP) -1)
puts ("# File does not exist."); puts (_("# File does not exist."));
else else
printf ("# Last modified %.24s (%ld)\n", {
ctime (&f->last_mtime), (long int) f->last_mtime); char buf[FILE_TIMESTAMP_PRINT_LEN_BOUND + 1];
printf ("# File has%s been updated.\n", file_timestamp_sprintf (buf, f->last_mtime);
f->updated ? "" : " not"); printf (_("# Last modified %s\n"), buf);
}
printf (_("# File has%s been updated.\n"),
f->updated ? "" : _(" not"));
switch (f->command_state) switch (f->command_state)
{ {
case cs_running: case cs_running:
puts ("# Commands currently running (THIS IS A BUG)."); puts (_("# Commands currently running (THIS IS A BUG)."));
break; break;
case cs_deps_running: case cs_deps_running:
puts ("# Dependencies commands running (THIS IS A BUG)."); puts (_("# Dependencies commands running (THIS IS A BUG)."));
break; break;
case cs_not_started: case cs_not_started:
case cs_finished: case cs_finished:
@@ -596,24 +667,24 @@ print_file (f)
case -1: case -1:
break; break;
case 0: case 0:
puts ("# Successfully updated."); puts (_("# Successfully updated."));
break; break;
case 1: case 1:
assert (question_flag); assert (question_flag);
puts ("# Needs to be updated (-q is set)."); puts (_("# Needs to be updated (-q is set)."));
break; break;
case 2: case 2:
puts ("# Failed to be updated."); puts (_("# Failed to be updated."));
break; break;
default: default:
puts ("# Invalid value in `update_status' member!"); puts (_("# Invalid value in `update_status' member!"));
fflush (stdout); fflush (stdout);
fflush (stderr); fflush (stderr);
abort (); abort ();
} }
break; break;
default: default:
puts ("# Invalid value in `command_state' member!"); puts (_("# Invalid value in `command_state' member!"));
fflush (stdout); fflush (stdout);
fflush (stderr); fflush (stderr);
abort (); abort ();
@@ -632,7 +703,7 @@ print_file_data_base ()
register unsigned int i, nfiles, per_bucket; register unsigned int i, nfiles, per_bucket;
register struct file *file; register struct file *file;
puts ("\n# Files"); puts (_("\n# Files"));
per_bucket = nfiles = 0; per_bucket = nfiles = 0;
for (i = 0; i < FILE_BUCKETS; ++i) for (i = 0; i < FILE_BUCKETS; ++i)
@@ -655,13 +726,13 @@ print_file_data_base ()
} }
if (nfiles == 0) if (nfiles == 0)
puts ("\n# No files."); puts (_("\n# No files."));
else else
{ {
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
} }
} }

View File

@@ -14,7 +14,9 @@ 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, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* Structure that represents the info on one file /* Structure that represents the info on one file
that the makefile says how to make. that the makefile says how to make.
@@ -32,7 +34,9 @@ struct file
char *stem; /* Implicit stem, if an implicit char *stem; /* Implicit stem, if an implicit
rule has been used */ rule has been used */
struct dep *also_make; /* Targets that are made by making this. */ struct dep *also_make; /* Targets that are made by making this. */
time_t last_mtime; /* File's modtime, if already known. */ FILE_TIMESTAMP last_mtime; /* File's modtime, if already known. */
FILE_TIMESTAMP mtime_before_update; /* File's modtime before any updating
has been performed. */
struct file *prev; /* Previous entry for same file name; struct file *prev; /* Previous entry for same file name;
used when there are multiple double-colon used when there are multiple double-colon
entries for the same file. */ entries for the same file. */
@@ -52,6 +56,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. */
@@ -79,22 +87,83 @@ 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 ignore_vpath:1;/* Nonzero if we threw out VPATH name */ unsigned int mfile_status:1;/* Nonzero if update_status was obtained
while remaking a makefile. */
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. */
unsigned int considered:1; /* equal to `considered' if file has been
considered on current scan of goal chain */
}; };
/* Number of intermediate files entered. */ /* Number of intermediate files entered. */
extern unsigned int num_intermediates; extern unsigned int num_intermediates;
/* Current value for pruning the scan of the goal chain (toggle 0/1). */
extern unsigned int considered;
extern struct file *default_goal_file, *suffix_file, *default_file; extern struct file *default_goal_file, *suffix_file, *default_file;
extern struct file *lookup_file (), *enter_file (); extern struct file *lookup_file PARAMS ((char *name));
extern void remove_intermediates (), snap_deps (); extern struct file *enter_file PARAMS ((char *name));
extern void rename_file (), rehash_file (), file_hash_enter (); extern void remove_intermediates PARAMS ((int sig));
extern void set_command_state (); extern void snap_deps PARAMS ((void));
extern void rename_file PARAMS ((struct file *file, char *name));
extern void rehash_file PARAMS ((struct file *file, char *name));
extern void file_hash_enter PARAMS ((struct file *file, char *name,
unsigned int oldhash, char *oldname));
extern void set_command_state PARAMS ((struct file *file, int state));
extern void notice_finished_file PARAMS ((struct file *file));
#if ST_MTIM_NSEC
# define FILE_TIMESTAMP_STAT_MODTIME(st) \
FILE_TIMESTAMP_FROM_S_AND_NS ((st).st_mtim.tv_sec, \
(st).st_mtim.ST_MTIM_NSEC)
# define FILE_TIMESTAMPS_PER_S \
MIN ((FILE_TIMESTAMP) 1000000000, \
(INTEGER_TYPE_MAXIMUM (FILE_TIMESTAMP) \
/ INTEGER_TYPE_MAXIMUM (time_t)))
#else
# define FILE_TIMESTAMP_STAT_MODTIME(st) ((st).st_mtime)
# define FILE_TIMESTAMPS_PER_S 1
#endif
#define FILE_TIMESTAMP_FROM_S_AND_NS(s, ns) \
((s) * FILE_TIMESTAMPS_PER_S \
+ (ns) * FILE_TIMESTAMPS_PER_S / 1000000000)
#define FILE_TIMESTAMP_DIV(a, b) ((a)/(b) - ((a)%(b) < 0))
#define FILE_TIMESTAMP_MOD(a, b) ((a)%(b) + ((a)%(b) < 0) * (b))
#define FILE_TIMESTAMP_S(ts) FILE_TIMESTAMP_DIV ((ts), FILE_TIMESTAMPS_PER_S)
#define FILE_TIMESTAMP_NS(ts) \
(((FILE_TIMESTAMP_MOD ((ts), FILE_TIMESTAMPS_PER_S) * 1000000000) \
+ (FILE_TIMESTAMPS_PER_S - 1)) \
/ FILE_TIMESTAMPS_PER_S)
/* Upper bound on length of string "YYYY-MM-DD HH:MM:SS.NNNNNNNNN"
representing a file timestamp. The upper bound is not necessarily 19,
since the year might be less than -999 or greater than 9999.
Subtract one for the sign bit if in case file timestamps can be negative;
subtract FLOOR_LOG2_SECONDS_PER_YEAR to yield an upper bound on how many
file timestamp bits might affect the year;
302 / 1000 is log10 (2) rounded up;
add one for integer division truncation;
add one more for a minus sign if file timestamps can be negative;
add 4 to allow for any 4-digit epoch year (e.g. 1970);
add 25 to allow for "-MM-DD HH:MM:SS.NNNNNNNNN". */
#define FLOOR_LOG2_SECONDS_PER_YEAR 24
#define FILE_TIMESTAMP_PRINT_LEN_BOUND \
(((sizeof (FILE_TIMESTAMP) * CHAR_BIT - 1 - FLOOR_LOG2_SECONDS_PER_YEAR) \
* 302 / 1000) \
+ 1 + 1 + 4 + 25)
extern FILE_TIMESTAMP file_timestamp_now PARAMS ((void));
extern void file_timestamp_sprintf PARAMS ((char *p, FILE_TIMESTAMP ts));
/* Return the mtime of file F (a struct file *), caching it. /* Return the mtime of file F (a struct file *), caching it.
The value is -1 if the file does not exist. */ The value is -1 if the file does not exist. */
#define file_mtime(f) file_mtime_1 ((f), 1) #define file_mtime(f) file_mtime_1 ((f), 1)
@@ -103,9 +172,9 @@ extern void set_command_state ();
we don't find it. we don't find it.
The value is -1 if the file does not exist. */ The value is -1 if the file does not exist. */
#define file_mtime_no_search(f) file_mtime_1 ((f), 0) #define file_mtime_no_search(f) file_mtime_1 ((f), 0)
extern time_t f_mtime (); extern FILE_TIMESTAMP f_mtime PARAMS ((struct file *file, int search));
#define file_mtime_1(f, v) \ #define file_mtime_1(f, v) \
((f)->last_mtime != (time_t) 0 ? (f)->last_mtime : f_mtime ((f), v)) ((f)->last_mtime ? (f)->last_mtime : f_mtime ((f), v))
/* Modtime value to use for `infinitely new'. We used to get the current time /* Modtime value to use for `infinitely new'. We used to get the current time
from the system and use that whenever we wanted `new'. But that causes from the system and use that whenever we wanted `new'. But that causes
@@ -114,12 +183,13 @@ 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.
If time_t is unsigned, its maximum value is the same as "(time_t) -1", If FILE_TIMESTAMP is unsigned, its maximum value is the same as
so use one less than that, because -1 is used for non-existing files. */ ((FILE_TIMESTAMP) -1), so use one less than that, because -1 is
used for non-existing files. */
#define NEW_MTIME \ #define NEW_MTIME \
(INTEGER_TYPE_SIGNED (time_t) \ (INTEGER_TYPE_SIGNED (FILE_TIMESTAMP) \
? INTEGER_TYPE_MAXIMUM (time_t) \ ? INTEGER_TYPE_MAXIMUM (FILE_TIMESTAMP) \
: (INTEGER_TYPE_MAXIMUM (time_t) - 1)) : (INTEGER_TYPE_MAXIMUM (FILE_TIMESTAMP) - 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. */

2884
function.c

File diff suppressed because it is too large Load Diff

View File

@@ -35,6 +35,7 @@
LOAD_AVE_TYPE Type of the load average array in the kernel. LOAD_AVE_TYPE Type of the load average array in the kernel.
Must be defined unless one of Must be defined unless one of
apollo, DGUX, NeXT, or UMAX is defined; apollo, DGUX, NeXT, or UMAX is defined;
or we have libkstat;
otherwise, no load average is available. otherwise, no load average is available.
NLIST_STRUCT Include nlist.h, not a.out.h, and NLIST_STRUCT Include nlist.h, not a.out.h, and
the nlist n_name element is a pointer, the nlist n_name element is a pointer,
@@ -131,6 +132,12 @@ extern int errno;
# undef FSCALE # undef FSCALE
# endif # endif
/* Same issues as for NeXT apply to the HURD-based GNU system. */
# ifdef __GNU__
# undef BSD
# undef FSCALE
# endif /* __GNU__ */
/* Set values that are different from the defaults, which are /* Set values that are different from the defaults, which are
set a little farther down with #ifndef. */ set a little farther down with #ifndef. */
@@ -500,6 +507,7 @@ extern int errno;
# include <sys/file.h> # include <sys/file.h>
# endif # endif
/* Avoid static vars inside a function since in HPUX they dump as pure. */ /* Avoid static vars inside a function since in HPUX they dump as pure. */
# ifdef NeXT # ifdef NeXT
@@ -516,7 +524,7 @@ static unsigned int samples;
static struct dg_sys_info_load_info load_info; /* what-a-mouthful! */ static struct dg_sys_info_load_info load_info; /* what-a-mouthful! */
# endif /* DGUX */ # endif /* DGUX */
# ifdef LOAD_AVE_TYPE #if !defined(HAVE_LIBKSTAT) && defined(LOAD_AVE_TYPE)
/* File descriptor open to /dev/kmem or VMS load ave driver. */ /* File descriptor open to /dev/kmem or VMS load ave driver. */
static int channel; static int channel;
/* Nonzero iff channel is valid. */ /* Nonzero iff channel is valid. */
@@ -524,15 +532,15 @@ static int getloadavg_initialized;
/* Offset in kmem to seek to read load average, or 0 means invalid. */ /* Offset in kmem to seek to read load average, or 0 means invalid. */
static long offset; static long offset;
# if !defined(VMS) && !defined(sgi) && !defined(__linux__) #if !defined(VMS) && !defined(sgi) && !defined(__linux__)
static struct nlist nl[2]; static struct nlist nl[2];
# endif /* Not VMS or sgi */ #endif /* Not VMS or sgi */
# ifdef SUNOS_5 #ifdef SUNOS_5
static kvm_t *kd; static kvm_t *kd;
# endif /* SUNOS_5 */ #endif /* SUNOS_5 */
# endif /* LOAD_AVE_TYPE */ #endif /* LOAD_AVE_TYPE && !HAVE_LIBKSTAT */
/* Put the 1 minute, 5 minute and 15 minute load averages /* Put the 1 minute, 5 minute and 15 minute load averages
into the first NELEM elements of LOADAVG. into the first NELEM elements of LOADAVG.
@@ -958,7 +966,7 @@ getloadavg (loadavg, nelem)
{ {
/* Set the channel to close on exec, so it does not /* Set the channel to close on exec, so it does not
litter any child's descriptor table. */ litter any child's descriptor table. */
# ifdef FD_SETFD # ifdef F_SETFD
# ifndef FD_CLOEXEC # ifndef FD_CLOEXEC
# define FD_CLOEXEC 1 # define FD_CLOEXEC 1
# endif # endif
@@ -1030,7 +1038,7 @@ getloadavg (loadavg, nelem)
#endif /* ! HAVE_GETLOADAVG */ #endif /* ! HAVE_GETLOADAVG */
#ifdef TEST #ifdef TEST
void int
main (argc, argv) main (argc, argv)
int argc; int argc;
char **argv; char **argv;

103
getopt.c
View File

@@ -1,13 +1,13 @@
/* Getopt for GNU. /* Getopt for GNU.
NOTE: getopt is now part of the C library, so if you don't know what NOTE: getopt is now part of the C library, so if you don't know what
"Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu "Keep this file name-space clean" means, talk to drepper@gnu.org
before changing it! before changing it!
Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97 Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98
Free Software Foundation, Inc. Free Software Foundation, Inc.
NOTE: The canonical source of this file is maintained with the GNU C Library. 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. Bugs can be reported to bug-glibc@gnu.org.
This program is free software; you can redistribute it and/or modify it 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 under the terms of the GNU General Public License as published by the
@@ -27,19 +27,19 @@
/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>. /* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
Ditto for AIX 3.2 and <stdlib.h>. */ Ditto for AIX 3.2 and <stdlib.h>. */
#ifndef _NO_PROTO #ifndef _NO_PROTO
#define _NO_PROTO # define _NO_PROTO
#endif #endif
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include <config.h> # include <config.h>
#endif #endif
#if !defined (__STDC__) || !__STDC__ #if !defined __STDC__ || !__STDC__
/* This is a separate conditional since some stdc systems /* This is a separate conditional since some stdc systems
reject `defined (const)'. */ reject `defined (const)'. */
#ifndef const # ifndef const
#define const # define const
#endif # endif
#endif #endif
#include <stdio.h> #include <stdio.h>
@@ -53,11 +53,11 @@
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. */
#define GETOPT_INTERFACE_VERSION 2 #define GETOPT_INTERFACE_VERSION 2
#if !defined (_LIBC) && defined (__GLIBC__) && __GLIBC__ >= 2 #if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2
#include <gnu-versions.h> # include <gnu-versions.h>
#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION # if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
#define ELIDE_CODE # define ELIDE_CODE
#endif # endif
#endif #endif
#ifndef ELIDE_CODE #ifndef ELIDE_CODE
@@ -68,32 +68,26 @@
#ifdef __GNU_LIBRARY__ #ifdef __GNU_LIBRARY__
/* Don't include stdlib.h for non-GNU C libraries because some of them /* Don't include stdlib.h for non-GNU C libraries because some of them
contain conflicting prototypes for getopt. */ contain conflicting prototypes for getopt. */
#include <stdlib.h> # include <stdlib.h>
#include <unistd.h> # include <unistd.h>
#endif /* GNU C library. */ #endif /* GNU C library. */
#ifdef VMS #ifdef VMS
#include <unixlib.h> # include <unixlib.h>
#if HAVE_STRING_H - 0 # if HAVE_STRING_H - 0
#include <string.h> # include <string.h>
#endif # endif
#endif
#if defined (WINDOWS32) && !defined (__CYGWIN32__)
/* It's not Unix, really. See? Capital letters. */
#include <windows.h>
#define getpid() GetCurrentProcessId()
#endif #endif
#ifndef _ #ifndef _
/* This is for other GNU distributions with internationalized messages. /* This is for other GNU distributions with internationalized messages.
When compiling libc, the _ macro is predefined. */ When compiling libc, the _ macro is predefined. */
#ifdef HAVE_LIBINTL_H # ifdef HAVE_LIBINTL_H
# include <libintl.h> # include <libintl.h>
# define _(msgid) gettext (msgid) # define _(msgid) gettext (msgid)
#else # else
# define _(msgid) (msgid) # define _(msgid) (msgid)
#endif # endif
#endif #endif
/* This version of `getopt' appears to the caller like standard Unix `getopt' /* This version of `getopt' appears to the caller like standard Unix `getopt'
@@ -203,14 +197,22 @@ static char *posixly_correct;
because there are many ways it can cause trouble. because there are many ways it can cause trouble.
On some systems, it contains special magic macros that don't work On some systems, it contains special magic macros that don't work
in GCC. */ in GCC. */
#include <string.h> # include <string.h>
#define my_index strchr # define my_index strchr
#else #else
# if HAVE_STRING_H
# include <string.h>
# else
# include <strings.h>
# endif
/* Avoid depending on library functions or files /* Avoid depending on library functions or files
whose names are inconsistent. */ whose names are inconsistent. */
char *getenv (); #ifndef getenv
extern char *getenv ();
#endif
static char * static char *
my_index (str, chr) my_index (str, chr)
@@ -231,11 +233,11 @@ my_index (str, chr)
#ifdef __GNUC__ #ifdef __GNUC__
/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h. /* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h.
That was relevant to code that was here before. */ That was relevant to code that was here before. */
#if !defined (__STDC__) || !__STDC__ # if (!defined __STDC__ || !__STDC__) && !defined strlen
/* gcc with -traditional declares the built-in strlen to return int, /* gcc with -traditional declares the built-in strlen to return int,
and has done so at least since version 2.4.5. -- rms. */ and has done so at least since version 2.4.5. -- rms. */
extern int strlen (const char *); extern int strlen (const char *);
#endif /* not __STDC__ */ # endif /* not __STDC__ */
#endif /* __GNUC__ */ #endif /* __GNUC__ */
#endif /* not __GNU_LIBRARY__ */ #endif /* not __GNU_LIBRARY__ */
@@ -262,8 +264,6 @@ static int nonoption_flags_len;
static int original_argc; static int original_argc;
static char *const *original_argv; static char *const *original_argv;
extern pid_t __libc_pid;
/* Make sure the environment variable bash 2.0 puts in the environment /* Make sure the environment variable bash 2.0 puts in the environment
is valid for the getopt call we must make sure that the ARGV passed is valid for the getopt call we must make sure that the ARGV passed
to getopt is that one passed to the process. */ to getopt is that one passed to the process. */
@@ -300,7 +300,7 @@ text_set_element (__libc_subinit, store_args_and_env);
`first_nonopt' and `last_nonopt' are relocated so that they describe `first_nonopt' and `last_nonopt' are relocated so that they describe
the new indices of the non-options in ARGV after they are moved. */ the new indices of the non-options in ARGV after they are moved. */
#if defined (__STDC__) && __STDC__ #if defined __STDC__ && __STDC__
static void exchange (char **); static void exchange (char **);
#endif #endif
@@ -331,9 +331,9 @@ exchange (argv)
nonoption_flags_len = nonoption_flags_max_len = 0; nonoption_flags_len = nonoption_flags_max_len = 0;
else else
{ {
memcpy (new_str, __getopt_nonoption_flags, nonoption_flags_max_len); memset (__mempcpy (new_str, __getopt_nonoption_flags,
memset (&new_str[nonoption_flags_max_len], '\0', nonoption_flags_max_len),
top + 1 - nonoption_flags_max_len); '\0', top + 1 - nonoption_flags_max_len);
nonoption_flags_max_len = top + 1; nonoption_flags_max_len = top + 1;
__getopt_nonoption_flags = new_str; __getopt_nonoption_flags = new_str;
} }
@@ -386,7 +386,7 @@ exchange (argv)
/* Initialize the internal data when the first call is made. */ /* Initialize the internal data when the first call is made. */
#if defined (__STDC__) && __STDC__ #if defined __STDC__ && __STDC__
static const char *_getopt_initialize (int, char *const *, const char *); static const char *_getopt_initialize (int, char *const *, const char *);
#endif #endif
static const char * static const char *
@@ -442,11 +442,8 @@ _getopt_initialize (argc, argv, optstring)
if (__getopt_nonoption_flags == NULL) if (__getopt_nonoption_flags == NULL)
nonoption_flags_max_len = -1; nonoption_flags_max_len = -1;
else else
{ memset (__mempcpy (__getopt_nonoption_flags, orig_str, len),
memcpy (__getopt_nonoption_flags, orig_str, len); '\0', nonoption_flags_max_len - len);
memset (&__getopt_nonoption_flags[len], '\0',
nonoption_flags_max_len - len);
}
} }
} }
nonoption_flags_len = nonoption_flags_max_len; nonoption_flags_len = nonoption_flags_max_len;
@@ -538,11 +535,11 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
from the shell indicating it is not an option. The later information from the shell indicating it is not an option. The later information
is only used when the used in the GNU libc. */ is only used when the used in the GNU libc. */
#ifdef _LIBC #ifdef _LIBC
#define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \ # define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \
|| (optind < nonoption_flags_len \ || (optind < nonoption_flags_len \
&& __getopt_nonoption_flags[optind] == '1')) && __getopt_nonoption_flags[optind] == '1'))
#else #else
#define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0') # define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0')
#endif #endif
if (nextchar == NULL || *nextchar == '\0') if (nextchar == NULL || *nextchar == '\0')

View File

@@ -1,5 +1,6 @@
/* getopt_long and getopt_long_only entry points for GNU getopt. /* getopt_long and getopt_long_only entry points for GNU getopt.
Copyright (C) 1987,88,89,90,91,92,93,94,96,97 Free Software Foundation, Inc. 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. 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. Bugs can be reported to bug-glibc@prep.ai.mit.edu.
@@ -25,7 +26,7 @@
#include "getopt.h" #include "getopt.h"
#if !defined (__STDC__) || !__STDC__ #if !defined __STDC__ || !__STDC__
/* This is a separate conditional since some stdc systems /* This is a separate conditional since some stdc systems
reject `defined (const)'. */ reject `defined (const)'. */
#ifndef const #ifndef const
@@ -44,7 +45,7 @@
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. */
#define GETOPT_INTERFACE_VERSION 2 #define GETOPT_INTERFACE_VERSION 2
#if !defined (_LIBC) && defined (__GLIBC__) && __GLIBC__ >= 2 #if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2
#include <gnu-versions.h> #include <gnu-versions.h>
#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION #if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
#define ELIDE_CODE #define ELIDE_CODE

1
glob/.cvsignore Normal file
View File

@@ -0,0 +1 @@
.deps Makefile.in

View File

@@ -1,3 +1,67 @@
1999-07-21 Paul D. Smith <psmith@gnu.org>
* glob.c, glob.h, fnmatch.c, fnmatch.h: Update to latest version
from GLIBC.
* fnmatch.c (internal_fnmatch): Use K&R definition syntax, not ANSI.
(__strchrnul): This won't exist outside GLIBC, so create one.
* glob.c: Move getlogin{,_r} prototypes below glob.h to get __P()
macro.
1998-08-05 Paul D. Smith <psmith@gnu.org>
* configure.in: Remove; configuration for glob is handled by the
make configure.in.
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> Tue Aug 12 10:52:34 1997 Paul D. Smith <psmith@baynetworks.com>
* configure.in: Require autoconf 2.12. * configure.in: Require autoconf 2.12.

View File

@@ -1,6 +1,6 @@
# -*-Makefile-*-, or close enough # -*-Makefile-*-, or close enough
AUTOMAKE_OPTIONS = 1.2 foreign AUTOMAKE_OPTIONS = 1.4 foreign
noinst_LIBRARIES = libglob.a noinst_LIBRARIES = libglob.a

View File

@@ -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/

View File

@@ -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/

View File

@@ -1,22 +0,0 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT(fnmatch.c) dnl A distinctive file to look for in srcdir.
AC_PREREQ(2.12) dnl Minimum Autoconf version required.
AM_INIT_AUTOMAKE(glob, 0.0, nodefs)
AC_PROG_CC
AC_CHECK_PROG(AR, ar, ar, ar)
AC_PROG_RANLIB
AC_PROG_CPP dnl Later checks need this.
dnl These two want to come early.
AC_AIX
AC_MINIX
AC_ISC_POSIX
AC_CONST
AC_HEADER_STDC
AC_CHECK_HEADERS(memory.h unistd.h string.h)
AC_HEADER_DIRENT
AC_FUNC_CLOSEDIR_VOID
AC_FUNC_ALLOCA
AC_FUNC_STRCOLL
AC_OUTPUT(Makefile)

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 1991, 1992, 1993, 1996, 1997 Free Software Foundation, Inc. /* Copyright (C) 1991, 92, 93, 96, 97, 98, 99 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
@@ -29,6 +29,23 @@
#include <fnmatch.h> #include <fnmatch.h>
#include <ctype.h> #include <ctype.h>
#if HAVE_STRING_H || defined _LIBC
# 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
@@ -47,26 +64,105 @@
# define ISASCII(c) isascii(c) # define ISASCII(c) isascii(c)
# endif # endif
# define ISUPPER(c) (ISASCII (c) && isupper (c)) #ifdef isblank
# define ISBLANK(c) (ISASCII (c) && isblank (c))
#else
# define ISBLANK(c) ((c) == ' ' || (c) == '\t')
#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 # ifndef errno
extern int errno; extern int errno;
# endif # endif
/* This function doesn't exist on most systems. */
# if !defined HAVE___STRCHRNUL && !defined _LIBC
static char *
__strchrnul (s, c)
register const char *s;
int c;
{
c = (unsigned char)c;
while (*s && *s != c)
++s;
return (char *)s;
}
# 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. */
int static int
fnmatch (pattern, string, flags) #ifdef _LIBC
internal_function
#endif
internal_fnmatch (pattern, string, no_leading_period, flags)
const char *pattern; const char *pattern;
const char *string; const char *string;
int no_leading_period;
int flags; int flags;
{ {
register const char *p = pattern, *n = string; register const char *p = pattern, *n = string;
register char c; register unsigned char c;
/* Note that this evaluates 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')
{ {
@@ -77,10 +173,11 @@ fnmatch (pattern, string, flags)
case '?': case '?':
if (*n == '\0') if (*n == '\0')
return FNM_NOMATCH; return FNM_NOMATCH;
else if ((flags & FNM_FILE_NAME) && *n == '/') else if (*n == '/' && (flags & FNM_FILE_NAME))
return FNM_NOMATCH; return FNM_NOMATCH;
else if ((flags & FNM_PERIOD) && *n == '.' && else if (*n == '.' && no_leading_period
(n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/'))) && (n == string
|| (n[-1] == '/' && (flags & FNM_FILE_NAME))))
return FNM_NOMATCH; return FNM_NOMATCH;
break; break;
@@ -93,18 +190,19 @@ fnmatch (pattern, string, flags)
return FNM_NOMATCH; return FNM_NOMATCH;
c = FOLD (c); c = FOLD (c);
} }
if (FOLD (*n) != c) if (FOLD ((unsigned char) *n) != c)
return FNM_NOMATCH; return FNM_NOMATCH;
break; break;
case '*': case '*':
if ((flags & FNM_PERIOD) && *n == '.' && if (*n == '.' && no_leading_period
(n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/'))) && (n == string
|| (n[-1] == '/' && (flags & FNM_FILE_NAME))))
return FNM_NOMATCH; return FNM_NOMATCH;
for (c = *p++; c == '?' || c == '*'; c = *p++) for (c = *p++; c == '?' || c == '*'; c = *p++)
{ {
if ((flags & FNM_FILE_NAME) && *n == '/') if (*n == '/' && (flags & FNM_FILE_NAME))
/* A slash does not match a wildcard under FNM_FILE_NAME. */ /* A slash does not match a wildcard under FNM_FILE_NAME. */
return FNM_NOMATCH; return FNM_NOMATCH;
else if (c == '?') else if (c == '?')
@@ -122,82 +220,204 @@ fnmatch (pattern, string, flags)
} }
if (c == '\0') if (c == '\0')
return 0; /* The wildcard(s) is/are the last element of the pattern.
If the name is a file name and contains another slash
this does mean it cannot match. */
return ((flags & FNM_FILE_NAME) && strchr (n, '/') != NULL
? FNM_NOMATCH : 0);
else
{
const char *endp;
{ endp = __strchrnul (n, (flags & FNM_FILE_NAME) ? '/' : '\0');
char c1 = (!(flags & FNM_NOESCAPE) && c == '\\') ? *p : c;
c1 = FOLD (c1); if (c == '[')
for (--p; *n != '\0'; ++n) {
if ((c == '[' || FOLD (*n) == c1) && int flags2 = ((flags & FNM_FILE_NAME)
fnmatch (p, n, flags & ~FNM_PERIOD) == 0) ? flags : (flags & ~FNM_PERIOD));
return 0;
return FNM_NOMATCH; for (--p; n < endp; ++n)
} if (internal_fnmatch (p, n,
(no_leading_period
&& (n == string
|| (n[-1] == '/'
&& (flags
& FNM_FILE_NAME)))),
flags2)
== 0)
return 0;
}
else if (c == '/' && (flags & FNM_FILE_NAME))
{
while (*n != '\0' && *n != '/')
++n;
if (*n == '/'
&& (internal_fnmatch (p, n + 1, flags & FNM_PERIOD,
flags) == 0))
return 0;
}
else
{
int flags2 = ((flags & FNM_FILE_NAME)
? flags : (flags & ~FNM_PERIOD));
if (c == '\\' && !(flags & FNM_NOESCAPE))
c = *p;
c = FOLD (c);
for (--p; n < endp; ++n)
if (FOLD ((unsigned char) *n) == c
&& (internal_fnmatch (p, n,
(no_leading_period
&& (n == string
|| (n[-1] == '/'
&& (flags
& FNM_FILE_NAME)))),
flags2) == 0))
return 0;
}
}
/* If we come here no match is possible with the wildcard. */
return FNM_NOMATCH;
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 == '.' && no_leading_period && (n == string
(n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/'))) || (n[-1] == '/'
&& (flags
& FNM_FILE_NAME))))
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; unsigned char fn = FOLD ((unsigned char) *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 ((unsigned char) *p);
++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
const char *startp = p;
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;
}
if (c < 'a' || c >= 'z')
{
/* This cannot possibly be a character class name.
Match it as a normal range. */
p = startp;
c = '[';
goto normal_bracket;
}
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 ((unsigned char) *n), wt))
goto matched;
# else
if ((STREQ (str, "alnum") && ISALNUM ((unsigned char) *n))
|| (STREQ (str, "alpha") && ISALPHA ((unsigned char) *n))
|| (STREQ (str, "blank") && ISBLANK ((unsigned char) *n))
|| (STREQ (str, "cntrl") && ISCNTRL ((unsigned char) *n))
|| (STREQ (str, "digit") && ISDIGIT ((unsigned char) *n))
|| (STREQ (str, "graph") && ISGRAPH ((unsigned char) *n))
|| (STREQ (str, "lower") && ISLOWER ((unsigned char) *n))
|| (STREQ (str, "print") && ISPRINT ((unsigned char) *n))
|| (STREQ (str, "punct") && ISPUNCT ((unsigned char) *n))
|| (STREQ (str, "space") && ISSPACE ((unsigned char) *n))
|| (STREQ (str, "upper") && ISUPPER ((unsigned char) *n))
|| (STREQ (str, "xdigit") && ISXDIGIT ((unsigned char) *n)))
goto matched;
# endif
}
else if (c == '\0')
/* [ (unterminated) loses. */ /* [ (unterminated) loses. */
return FNM_NOMATCH; return FNM_NOMATCH;
else
c = *p++;
c = FOLD (c);
if ((flags & FNM_FILE_NAME) && c == '/')
/* [/] can never match. */
return FNM_NOMATCH;
if (c == '-' && *p != ']')
{ {
cend = *p++; normal_bracket:
if (!(flags & FNM_NOESCAPE) && cend == '\\') if (FOLD (c) == fn)
cend = *p++; goto matched;
if (cend == '\0')
return FNM_NOMATCH;
cend = FOLD (cend);
cold = c;
c = *p++; c = *p++;
}
if (FOLD (*n) >= cstart && FOLD (*n) <= cend) if (c == '-' && *p != ']')
goto matched; {
/* It is a range. */
unsigned char cend = *p++;
if (!(flags & FNM_NOESCAPE) && cend == '\\')
cend = *p++;
if (cend == '\0')
return FNM_NOMATCH;
if (cold <= fn && fn <= FOLD (cend))
goto matched;
c = *p++;
}
}
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 != ']')
{ {
@@ -213,6 +433,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;
@@ -220,7 +449,7 @@ fnmatch (pattern, string, flags)
break; break;
default: default:
if (c != FOLD (*n)) if (c != FOLD ((unsigned char) *n))
return FNM_NOMATCH; return FNM_NOMATCH;
} }
@@ -239,4 +468,14 @@ fnmatch (pattern, string, flags)
# undef FOLD # undef FOLD
} }
int
fnmatch (pattern, string, flags)
const char *pattern;
const char *string;
int flags;
{
return internal_fnmatch (pattern, string, flags & FNM_PERIOD, flags);
}
#endif /* _LIBC or not __GNU_LIBRARY__. */ #endif /* _LIBC or not __GNU_LIBRARY__. */

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 1991, 1992, 1993, 1996, 1997 Free Software Foundation, Inc. /* Copyright (C) 1991, 92, 93, 96, 97, 98, 99 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@@ -23,18 +23,26 @@
extern "C" { extern "C" {
#endif #endif
#if (defined (__cplusplus) || (defined (__STDC__) && __STDC__) \ #if defined __cplusplus || (defined __STDC__ && __STDC__) || defined WINDOWS32
|| defined (WINDOWS32)) # if !defined __GLIBC__ || !defined __P
#undef __P # undef __P
#define __P(protos) protos # define __P(protos) protos
# endif
#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>. */
@@ -47,18 +55,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
/* Match STRING against the filename pattern PATTERN, /* 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. */
#ifdef _XOPEN_SOURCE
# define FNM_NOSYS (-1)
#endif
/* Match NAME 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 *__name,
int __flags)); int __flags));
#ifdef __cplusplus #ifdef __cplusplus

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 1991, 1992, 1995, 1996, 1997 Free Software Foundation, Inc. /* Copyright (C) 1991, 92, 95, 96, 97, 98 Free Software Foundation, Inc.
The GNU C 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
@@ -19,28 +19,47 @@
#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
|| defined WINDOWS32) # if !defined __GLIBC__ || !defined __P
# undef __P # undef __P
# define __P(protos) protos # undef __PMT
# define __ptr_t void * # define __P(protos) protos
# if !defined __GNUC__ || __GNUC__ < 2 # define __PMT(protos) protos
# undef __const # if !defined __GNUC__ || __GNUC__ < 2
# define __const const # undef __const
# define __const const
# endif
# endif # endif
# define __ptr_t void *
#else /* Not C++ or ANSI C. */ #else /* Not C++ or ANSI C. */
# undef __P # undef __P
# undef __PMT
# define __P(protos) () # define __P(protos) ()
# define __PMT(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. */
/* We need `size_t' for the following definitions. */
#ifndef __size_t
# if defined __GNUC__ && __GNUC__ >= 2
typedef __SIZE_TYPE__ __size_t;
# else
/* This is a guess. */
typedef unsigned long int __size_t;
# endif
#else
/* The GNU CC stddef.h version defines __size_t as empty. We need a real
definition. */
# undef __size_t
# define __size_t size_t
#endif
/* Bits set in the FLAGS argument to `glob'. */ /* Bits set in the FLAGS argument to `glob'. */
#define GLOB_ERR (1 << 0)/* Return on read errors. */ #define GLOB_ERR (1 << 0)/* Return on read errors. */
#define GLOB_MARK (1 << 1)/* Append a slash to each name. */ #define GLOB_MARK (1 << 1)/* Append a slash to each name. */
@@ -57,11 +76,14 @@ extern "C"
# define GLOB_ALTDIRFUNC (1 << 9)/* Use gl_opendir et al functions. */ # define GLOB_ALTDIRFUNC (1 << 9)/* Use gl_opendir et al functions. */
# define GLOB_BRACE (1 << 10)/* Expand "{a,b}" to "a" "b". */ # 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_NOMAGIC (1 << 11)/* If no magic chars, return the pattern. */
# define GLOB_TILDE (1 <<12)/* Expand ~user and ~ to home directories. */ # define GLOB_TILDE (1 << 12)/* Expand ~user and ~ to home directories. */
# define GLOB_ONLYDIR (1 << 13)/* Match only directories. */
# define GLOB_TILDE_CHECK (1 << 14)/* Like GLOB_TILDE but return an error
if the user name is not available. */
# define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \ # 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|GLOB_TILDE_CHECK)
#else #else
# define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \ # define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \ GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \
@@ -72,7 +94,7 @@ extern "C"
#define GLOB_NOSPACE 1 /* Ran out of memory. */ #define GLOB_NOSPACE 1 /* Ran out of memory. */
#define GLOB_ABORTED 2 /* Read error. */ #define GLOB_ABORTED 2 /* Read error. */
#define GLOB_NOMATCH 3 /* No matches found. */ #define GLOB_NOMATCH 3 /* No matches found. */
#define GLOB_NOSYS 4 /* Not implemented. */
#ifdef _GNU_SOURCE #ifdef _GNU_SOURCE
/* Previous versions of this file defined GLOB_ABEND instead of /* Previous versions of this file defined GLOB_ABEND instead of
GLOB_ABORTED. Provide a compatibility definition here. */ GLOB_ABORTED. Provide a compatibility definition here. */
@@ -85,20 +107,39 @@ struct stat;
#endif #endif
typedef struct typedef struct
{ {
int gl_pathc; /* Count of paths matched by the pattern. */ __size_t gl_pathc; /* Count of paths matched by the pattern. */
char **gl_pathv; /* List of matched pathnames. */ char **gl_pathv; /* List of matched pathnames. */
int gl_offs; /* Slots to reserve in `gl_pathv'. */ __size_t gl_offs; /* Slots to reserve in `gl_pathv'. */
int gl_flags; /* Set to FLAGS, maybe | GLOB_MAGCHAR. */ int gl_flags; /* Set to FLAGS, maybe | GLOB_MAGCHAR. */
/* If the GLOB_ALTDIRFUNC flag is set, the following functions /* If the GLOB_ALTDIRFUNC flag is set, the following functions
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) __PMT ((void *));
struct dirent *(*gl_readdir) __P ((void *)); struct dirent *(*gl_readdir) __PMT ((void *));
__ptr_t (*gl_opendir) __P ((__const char *)); __ptr_t (*gl_opendir) __PMT ((__const char *));
int (*gl_lstat) __P ((__const char *, struct stat *)); int (*gl_lstat) __PMT ((__const char *, struct stat *));
int (*gl_stat) __P ((__const char *, struct stat *)); int (*gl_stat) __PMT ((__const char *, struct stat *));
} glob_t; } glob_t;
#ifdef _LARGEFILE64_SOURCE
struct stat64;
typedef struct
{
__size_t gl_pathc;
char **gl_pathv;
__size_t gl_offs;
int gl_flags;
/* If the GLOB_ALTDIRFUNC flag is set, the following functions
are used instead of the normal file access functions. */
void (*gl_closedir) __PMT ((void *));
struct dirent64 *(*gl_readdir) __PMT ((void *));
__ptr_t (*gl_opendir) __PMT ((__const char *));
int (*gl_lstat) __PMT ((__const char *, struct stat64 *));
int (*gl_stat) __PMT ((__const char *, struct stat64 *));
} glob64_t;
#endif
/* Do glob searching for PATTERN, placing results in PGLOB. /* Do glob searching for PATTERN, placing results in PGLOB.
The bits defined above may be set in FLAGS. The bits defined above may be set in FLAGS.
If a directory cannot be opened or read and ERRFUNC is not nil, If a directory cannot be opened or read and ERRFUNC is not nil,
@@ -107,12 +148,33 @@ 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. */
#if _FILE_OFFSET_BITS != 64
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) (__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));
#else
# if __GNUC__ >= 2
extern int glob __P ((__const char *__pattern, int __flags,
int (*__errfunc) (__const char *, int),
glob_t *__pglob)) __asm__ ("glob64");
extern void globfree __P ((glob_t *__pglob)) __asm__ ("globfree64");
# else
# define glob glob64
# define globfree globfree64
# endif
#endif
#ifdef _LARGEFILE64_SOURCE
extern int glob64 __P ((__const char *__pattern, int __flags,
int (*__errfunc) (__const char *, int),
glob64_t *__pglob));
extern void globfree64 __P ((glob64_t *__pglob));
#endif
#ifdef _GNU_SOURCE #ifdef _GNU_SOURCE
@@ -121,7 +183,6 @@ extern void globfree __P ((glob_t *__pglob));
This function is not part of the interface specified by POSIX.2 This function is not part of the interface specified by POSIX.2
but several programs want to use it. */ 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)); extern int glob_pattern_p __P ((__const char *__pattern, int __quote));
#endif #endif

View File

@@ -14,7 +14,8 @@ 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, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "make.h" #include "make.h"
#include "rule.h" #include "rule.h"
@@ -35,7 +36,7 @@ try_implicit_rule (file, depth)
struct file *file; struct file *file;
unsigned int depth; unsigned int depth;
{ {
DEBUGPR ("Looking for an implicit rule for `%s'.\n"); DEBUGPR (_("Looking for an implicit rule for `%s'.\n"));
/* The order of these searches was previously reversed. My logic now is /* The order of these searches was previously reversed. My logic now is
that since the non-archive search uses more information in the target that since the non-archive search uses more information in the target
@@ -50,7 +51,7 @@ try_implicit_rule (file, depth)
archive member name to search for implicit rules. */ archive member name to search for implicit rules. */
if (ar_name (file->name)) if (ar_name (file->name))
{ {
DEBUGPR ("Looking for archive-member implicit rule for `%s'.\n"); DEBUGPR (_("Looking for archive-member implicit rule for `%s'.\n"));
if (pattern_search (file, 1, depth, 0)) if (pattern_search (file, 1, depth, 0))
return 1; return 1;
} }
@@ -111,14 +112,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
@@ -148,7 +149,7 @@ pattern_search (file, archive, depth, recursions)
that is not just `%'. */ that is not just `%'. */
int specific_rule_matched = 0; int specific_rule_matched = 0;
register unsigned int i; register unsigned int i = 0; /* uninit checks OK */
register struct rule *rule; register struct rule *rule;
register struct dep *dep; register struct dep *dep;
@@ -198,7 +199,7 @@ pattern_search (file, archive, depth, recursions)
don't use it here. */ don't use it here. */
if (rule->in_use) if (rule->in_use)
{ {
DEBUGP2 ("Avoiding implicit rule recursion.%s%s\n", "", ""); DEBUGP2 (_("Avoiding implicit rule recursion.%s%s\n"), "", "");
continue; continue;
} }
@@ -246,11 +247,11 @@ pattern_search (file, archive, depth, recursions)
if (check_lastslash) if (check_lastslash)
{ {
if (stem > (lastslash + 1) if (stem > (lastslash + 1)
&& strncmp (target, lastslash + 1, stem - lastslash - 1)) && !strneq (target, lastslash + 1, stem - lastslash - 1))
continue; continue;
} }
else if (stem > filename else if (stem > filename
&& strncmp (target, filename, stem - filename)) && !strneq (target, filename, stem - filename))
continue; continue;
/* Check that the rule pattern matches the text after the stem. /* Check that the rule pattern matches the text after the stem.
@@ -334,7 +335,7 @@ pattern_search (file, archive, depth, recursions)
stemlen -= (lastslash - filename) + 1; stemlen -= (lastslash - filename) + 1;
} }
DEBUGP2 ("Trying pattern rule with stem `%.*s'.\n", DEBUGP2 (_("Trying pattern rule with stem `%.*s'.\n"),
(int) stemlen, stem); (int) stemlen, stem);
/* Try each dependency; see if it "exists". */ /* Try each dependency; see if it "exists". */
@@ -342,6 +343,8 @@ pattern_search (file, archive, depth, recursions)
deps_found = 0; deps_found = 0;
for (dep = rule->deps; dep != 0; dep = dep->next) for (dep = rule->deps; dep != 0; dep = dep->next)
{ {
struct file *fp;
/* If the dependency name has a %, substitute the stem. */ /* If the dependency name has a %, substitute the stem. */
p = index (dep_name (dep), '%'); p = index (dep_name (dep), '%');
if (p != 0) if (p != 0)
@@ -373,16 +376,16 @@ pattern_search (file, archive, depth, recursions)
"impossible", then the rule fails and don't "impossible", then the rule fails and don't
bother trying it on the second pass either bother trying it on the second pass either
since we know that will fail too. */ since we know that will fail too. */
DEBUGP2 ("Rejecting impossible %s dependency `%s'.\n", DEBUGP2 (_("Rejecting impossible %s prerequisite `%s'.\n"),
p == depname ? "implicit" : "rule", p); p == depname ? _("implicit") : _("rule"), p);
tryrules[i] = 0; tryrules[i] = 0;
break; break;
} }
intermediate_files[deps_found] = 0; intermediate_files[deps_found] = 0;
DEBUGP2 ("Trying %s dependency `%s'.\n", DEBUGP2 (_("Trying %s prerequisite `%s'.\n"),
p == depname ? "implicit" : "rule", p); p == depname ? _("implicit") : _("rule"), p);
/* The DEP->changed flag says that this dependency resides in a /* The DEP->changed flag says that this dependency resides in a
nonexistent directory. So we normally can skip looking for nonexistent directory. So we normally can skip looking for
@@ -390,20 +393,24 @@ pattern_search (file, archive, depth, recursions)
dependency file we are actually looking for is in a different dependency file we are actually looking for is in a different
directory (the one gotten by prepending FILENAME's directory), directory (the one gotten by prepending FILENAME's directory),
so it might actually exist. */ so it might actually exist. */
/* If we find a file but the intermediate flag is set, then it
was put here by a .INTERMEDIATE: rule so ignore it. */
if ((!dep->changed || check_lastslash) if ((!dep->changed || check_lastslash)
&& (lookup_file (p) != 0 || file_exists_p (p))) && (((fp = lookup_file (p)) != 0 && !fp->intermediate)
|| file_exists_p (p)))
{ {
found_files[deps_found++] = savestring (p, strlen (p)); found_files[deps_found++] = xstrdup (p);
continue; continue;
} }
/* 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". */
vp = p; vp = p;
if (vpath_search (&vp, (time_t *) 0)) if (vpath_search (&vp, (FILE_TIMESTAMP *) 0))
{ {
DEBUGP2 ("Found dependency `%s' as VPATH `%s'\n", p, vp); DEBUGP2 (_("Found prerequisite `%s' as VPATH `%s'\n"),
strcpy(vp, p); p, vp);
strcpy (vp, p);
found_files[deps_found++] = vp; found_files[deps_found++] = vp;
continue; continue;
} }
@@ -418,15 +425,15 @@ pattern_search (file, archive, depth, recursions)
intermediate_file intermediate_file
= (struct file *) alloca (sizeof (struct file)); = (struct file *) alloca (sizeof (struct file));
DEBUGP2 ("Looking for a rule with %s file `%s'.\n", DEBUGP2 (_("Looking for a rule with %s file `%s'.\n"),
"intermediate", p); _("intermediate"), p);
bzero ((char *) intermediate_file, sizeof (struct file)); bzero ((char *) intermediate_file, sizeof (struct file));
intermediate_file->name = p; intermediate_file->name = p;
if (pattern_search (intermediate_file, 0, depth + 1, if (pattern_search (intermediate_file, 0, depth + 1,
recursions + 1)) recursions + 1))
{ {
p = savestring (p, strlen (p)); p = xstrdup (p);
intermediate_patterns[deps_found] intermediate_patterns[deps_found]
= intermediate_file->name; = intermediate_file->name;
intermediate_file->name = p; intermediate_file->name = p;
@@ -435,7 +442,7 @@ pattern_search (file, archive, depth, recursions)
/* Allocate an extra copy to go in FOUND_FILES, /* Allocate an extra copy to go in FOUND_FILES,
because every elt of FOUND_FILES is consumed because every elt of FOUND_FILES is consumed
or freed later. */ or freed later. */
found_files[deps_found] = savestring (p, strlen (p)); found_files[deps_found] = xstrdup (p);
++deps_found; ++deps_found;
continue; continue;
} }
@@ -518,6 +525,7 @@ pattern_search (file, archive, depth, recursions)
f->deps = imf->deps; f->deps = imf->deps;
f->cmds = imf->cmds; f->cmds = imf->cmds;
f->stem = imf->stem; f->stem = imf->stem;
f->also_make = imf->also_make;
imf = lookup_file (intermediate_patterns[deps_found]); imf = lookup_file (intermediate_patterns[deps_found]);
if (imf != 0 && imf->precious) if (imf != 0 && imf->precious)
f->precious = 1; f->precious = 1;
@@ -526,6 +534,9 @@ pattern_search (file, archive, depth, recursions)
for (dep = f->deps; dep != 0; dep = dep->next) for (dep = f->deps; dep != 0; dep = dep->next)
{ {
dep->file = enter_file (dep->name); dep->file = enter_file (dep->name);
/* enter_file uses dep->name _if_ we created a new file. */
if (dep->name != dep->file->name)
free (dep->name);
dep->name = 0; dep->name = 0;
dep->file->tried_implicit |= dep->changed; dep->file->tried_implicit |= dep->changed;
} }
@@ -585,10 +596,9 @@ pattern_search (file, archive, depth, recursions)
file->cmds = rule->cmds; file->cmds = rule->cmds;
/* Put the targets other than the one that /* If this rule builds other targets, too, put the others into FILE's
matched into FILE's `also_make' member. */ `also_make' member. */
/* If there was only one target, there is nothing to do. */
if (rule->targets[1] != 0) if (rule->targets[1] != 0)
for (i = 0; rule->targets[i] != 0; ++i) for (i = 0; rule->targets[i] != 0; ++i)
if (i != matches[foundrule]) if (i != matches[foundrule])

972
job.c

File diff suppressed because it is too large Load Diff

8
job.h
View File

@@ -1,5 +1,5 @@
/* Definitions for managing subprocesses in GNU Make. /* Definitions for managing subprocesses in GNU Make.
Copyright (C) 1992, 1993, 1996 Free Software Foundation, Inc. Copyright (C) 1992, 1993, 1996, 1999 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
@@ -14,7 +14,8 @@ 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, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#ifndef SEEN_JOB_H #ifndef SEEN_JOB_H
#define SEEN_JOB_H #define SEEN_JOB_H
@@ -38,6 +39,7 @@ struct child
int efn; /* Completion event flag number */ int efn; /* Completion event flag number */
int cstatus; /* Completion status */ int cstatus; /* Completion status */
#endif #endif
char *sh_batch_file; /* Script file for shell commands */
unsigned int remote:1; /* Nonzero if executing remotely. */ unsigned int remote:1; /* Nonzero if executing remotely. */
unsigned int noerror:1; /* Nonzero if commands contained a `-'. */ unsigned int noerror:1; /* Nonzero if commands contained a `-'. */
@@ -52,7 +54,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

1040
main.c

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,6 @@
# Maintainer-only makefile segment. This contains things that are relevant # 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. # only if you have the full copy of the GNU make sources from the CVS
# tree, not a dist copy.
# #
# Find the glob source files... this might be dangerous, but we're maintainers! # Find the glob source files... this might be dangerous, but we're maintainers!
@@ -7,45 +8,70 @@
globsrc := $(wildcard glob/*.c) globsrc := $(wildcard glob/*.c)
globhdr := $(wildcard glob/*.h) globhdr := $(wildcard glob/*.h)
TEMPLATES = README config.ami configh.dos config.h.W32 config.h-vms TEMPLATES = README README.DOS config.ami configh.dos config.h.W32 config.h-vms
MTEMPLATES = Makefile.DOS SMakefile
# We need this to ensure that README and build.sh.in are created on time to
# avoid errors by automake.
#
#Makefile.in: README build.sh.in
# General rule for turning a .template into a regular file. # General rule for turning a .template into a regular file.
# #
$(TEMPLATES) : % : %.template configure.in $(TEMPLATES) : % : %.template Makefile
rm -f $@ rm -f $@
sed -e 's@%VERSION%@$(VERSION)@' \ sed -e 's@%VERSION%@$(VERSION)@g' \
-e 's@%PACKAGE%@$(PACKAGE)@' \ -e 's@%PACKAGE%@$(PACKAGE)@g' \
$< > $@ $< > $@
chmod a-w $@ chmod a-w $@
# Construct Makefile.DOS # Construct Makefiles by adding on dependencies, etc.
# #
Makefile.DOS: Makefile.DOS.template Makefile.am configure.in $(MTEMPLATES) : % : %.template .dep_segment Makefile
rm -f $@ rm -f $@
sed -e 's@%VERSION%@$(VERSION)@' \ sed -e 's@%VERSION%@$(VERSION)@g' \
-e 's@%PROGRAMS%@$(bin_PROGRAMS)@' \ -e 's@%PROGRAMS%@$(bin_PROGRAMS)@g' \
-e 's@%SOURCES%@$(filter-out remote-%,$(make_SOURCES)) remote-$$(REMOTE).c@' \ -e 's@%SOURCES%@$(filter-out remote-%,$(make_SOURCES)) remote-$$(REMOTE).c@g' \
-e 's@%OBJECTS%@$(filter-out remote-%,$(make_OBJECTS)) remote-$$(REMOTE).o@' \ -e 's@%OBJECTS%@$(filter-out remote-%,$(make_OBJECTS)) remote-$$(REMOTE).o@g' \
-e 's@%GLOB_SOURCES%@$(globsrc) $(globhdr)@' \ -e 's@%GLOB_SOURCES%@$(globsrc) $(globhdr)@g' \
-e 's@%GLOB_OBJECTS%@$(globsrc:glob/%.c=%.o)@' \ -e 's@%GLOB_OBJECTS%@$(globsrc:glob/%.c=%.o)@g' \
$< > $@ $< > $@
echo >>$@; echo '# --------------- DEPENDENCIES' >>$@; echo '#' >>$@; \
cat $(word 2,$^) >>$@
chmod a-w $@
NMakefile: NMakefile.template .dep_segment Makefile
rm -f $@
cp $< $@
echo >>$@; echo '# --------------- DEPENDENCIES' >>$@; echo '#' >>$@; \
sed 's/^\([^ ]*\)\.o:/$$(OUTDIR)\/\1.obj:/' $(word 2,$^) >>$@
chmod a-w $@ chmod a-w $@
# Construct build.sh.in # Construct build.sh.in
# #
build.sh.in: build.template Makefile.am build.sh.in: build.template Makefile
rm -f $@ rm -f $@
sed -e 's@%objs%@$(filter-out remote-%, $(make_OBJECTS)\ sed -e 's@%objs%@$(filter-out remote-%, $(make_OBJECTS)@g' \
$(patsubst %.c,%.o,$(globsrc)))@' \ -e 's@%globobjs%@$(patsubst %.c,%.o,$(globsrc)))@g' \
$< > $@ $< > $@
chmod a-w+x $@ 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 # We clean everything here. The GNU standards for makefile conventions say
# you shouldn't remove configure, etc., but this makefile is only available # you shouldn't remove configure, etc., but this makefile is only available
# in a full development distribution, so they'll only be removed then. # in a full development distribution, so they'll only be removed then.
# #
MAINTAINERCLEANFILES = $(TEMPLATES) Makefile.DOS build.sh.in \ # And _I_ want them to be removed ;)
configure Makefile.in stamp-h.in #
maintFILES = configure aclocal.m4 config.h.in Makefile.in stamp-h.in
MAINTAINERCLEANFILES = $(maintFILES) $(TEMPLATES) $(MTEMPLATES) NMakefile \
missing build.sh.in .dep_segment
# Put the alpha distribution files up for anonymous FTP. # Put the alpha distribution files up for anonymous FTP.
# #
@@ -56,3 +82,9 @@ TARFILE := $(distdir).tar.gz
alpha: $(ALPHA) $(TARFILE) alpha: $(ALPHA) $(TARFILE)
@rm -f $(ALPHA)/$(TARFILE) @rm -f $(ALPHA)/$(TARFILE)
cp -p $(TARFILE) $(ALPHA) 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 $@ $<

View File

@@ -21,6 +21,8 @@ chapter
@end ifclear @end ifclear
@end iftex @end iftex
describes conventions for writing the Makefiles for GNU programs. describes conventions for writing the Makefiles for GNU programs.
Using Automake will help you write a Makefile that follows these
conventions.
@menu @menu
* Makefile Basics:: General Conventions for Makefiles * Makefile Basics:: General Conventions for Makefiles
@@ -209,11 +211,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}.
@@ -256,6 +259,18 @@ $(INSTALL_PROGRAM) foo $(bindir)/foo
$(INSTALL_DATA) libfoo.a $(libdir)/libfoo.a $(INSTALL_DATA) libfoo.a $(libdir)/libfoo.a
@end example @end example
Optionally, you may prepend the value of @code{DESTDIR} to the target
filename. Doing this allows the installer to create a snapshot of the
installation to be copied onto the real target filesystem later. Do not
set the value of @code{DESTDIR} in your Makefile, and do not include it
in any installed files. With support for @code{DESTDIR}, the above
examples become:
@example
$(INSTALL_PROGRAM) foo $(DESTDIR)$(bindir)/foo
$(INSTALL_DATA) libfoo.a $(DESTDIR)$(libdir)/libfoo.a
@end example
@noindent @noindent
Always use a file name, not a directory name, as the second argument of Always use a file name, not a directory name, as the second argument of
the installation commands. Use a separate command for each file to be the installation commands. Use a separate command for each file to be
@@ -282,6 +297,10 @@ When building the complete GNU system, the prefix will be empty and
@file{/usr} will be a symbolic link to @file{/}. @file{/usr} will be a symbolic link to @file{/}.
(If you are using Autoconf, write it as @samp{@@prefix@@}.) (If you are using Autoconf, write it as @samp{@@prefix@@}.)
Running @samp{make install} with a different value of @code{prefix}
from the one used to build the program should @var{not} recompile
the program.
@item exec_prefix @item exec_prefix
A prefix used in constructing the default values of some of the A prefix used in constructing the default values of some of the
variables listed below. The default value of @code{exec_prefix} should variables listed below. The default value of @code{exec_prefix} should
@@ -291,6 +310,10 @@ be @code{$(prefix)}.
Generally, @code{$(exec_prefix)} is used for directories that contain Generally, @code{$(exec_prefix)} is used for directories that contain
machine-specific files (such as executables and subroutine libraries), machine-specific files (such as executables and subroutine libraries),
while @code{$(prefix)} is used directly for other directories. while @code{$(prefix)} is used directly for other directories.
Running @samp{make install} with a different value of @code{exec_prefix}
from the one used to build the program should @var{not} recompile the
program.
@end table @end table
Executable programs are installed in one of the following directories. Executable programs are installed in one of the following directories.
@@ -567,12 +590,12 @@ Here is a sample rule to install an Info file:
@comment This example has been carefully formatted for the Make manual. @comment This example has been carefully formatted for the Make manual.
@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 $(DESTDIR)$(infodir)/foo.info: foo.info
$(POST_INSTALL) $(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; \
$(INSTALL_DATA) $$d/foo.info $@@; \ $(INSTALL_DATA) $$d/foo.info $(DESTDIR)$@@; \
# Run install-info only if it exists. # Run install-info only if it exists.
# Use `if' instead of just prepending `-' to the # Use `if' instead of just prepending `-' to the
# line so we notice real errors from install-info. # line so we notice real errors from install-info.
@@ -580,8 +603,8 @@ $(infodir)/foo.info: foo.info
# fail gracefully when there is an unknown command. # fail gracefully when there is an unknown command.
if $(SHELL) -c 'install-info --version' \ if $(SHELL) -c 'install-info --version' \
>/dev/null 2>&1; then \ >/dev/null 2>&1; then \
install-info --dir-file=$(infodir)/dir \ install-info --dir-file=$(DESTDIR)$(infodir)/dir \
$(infodir)/foo.info; \ $(DESTDIR)$(infodir)/foo.info; \
else true; fi else true; fi
@end smallexample @end smallexample

23
make.1
View File

@@ -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 page 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
@@ -258,11 +257,6 @@ 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.
After this information is printed, processing continues normally.
To get this information without doing anything else, use
.B make
.B \-v
.BI \-f /dev/null.
.TP 0.5i .TP 0.5i
.B \-w .B \-w
Print a message containing the working directory Print a message containing the working directory
@@ -288,12 +282,7 @@ command on the given file before running
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" .

555
make.h
View File

@@ -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,97 Free Software Foundation, Inc. Copyright (C) 1988,89,90,91,92,93,94,95,96,97,99 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
@@ -14,7 +14,8 @@ 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, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* AIX requires this to be the first thing in the file. */ /* AIX requires this to be the first thing in the file. */
#if defined (_AIX) && !defined (__GNUC__) #if defined (_AIX) && !defined (__GNUC__)
@@ -25,27 +26,39 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h
(which it would do because make.h was found in $srcdir). */ (which it would do because make.h was found in $srcdir). */
#include <config.h> #include <config.h>
#undef HAVE_CONFIG_H #undef HAVE_CONFIG_H
#define HAVE_CONFIG_H #define HAVE_CONFIG_H 1
/* Use prototypes if available. */ /* Use prototypes if available. */
#if defined (__cplusplus) || (defined (__STDC__) && __STDC__) #if defined (__cplusplus) || (defined (__STDC__) && __STDC__)
#undef PARAMS # undef PARAMS
#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. */
#ifdef CRAY /* For now, set gettext macro to a no-op. */
#undef _
#undef N_
#define _(s) s
#define N_(s) s
#ifdef CRAY
/* This must happen before #include <signal.h> so /* This must happen before #include <signal.h> so
that the declaration therein is changed. */ that the declaration therein is changed. */
#define signal bsdsignal # define signal bsdsignal
#endif #endif
#define _GNU_SOURCE /* If we're compiling for the dmalloc debugger, turn off string inlining. */
#if defined(HAVE_DMALLOC_H) && defined(__GNUC__)
# define __NO_STRING_INLINES
#endif
#define _GNU_SOURCE 1
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <signal.h> #include <signal.h>
@@ -55,90 +68,98 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
/* SCO 3.2 "devsys 4.2" has a prototype for `ftime' in <time.h> that bombs /* SCO 3.2 "devsys 4.2" has a prototype for `ftime' in <time.h> that bombs
unless <sys/timeb.h> has been included first. Does every system have a unless <sys/timeb.h> has been included first. Does every system have a
<sys/timeb.h>? If any does not, configure should check for it. */ <sys/timeb.h>? If any does not, configure should check for it. */
#include <sys/timeb.h> # include <sys/timeb.h>
#endif #endif
#include <time.h> #include <time.h>
#include <errno.h> #include <errno.h>
#ifndef errno #ifndef errno
extern int errno; extern int errno;
#endif #endif
#ifndef isblank /* A shortcut for EINTR checking. Note you should never negate this! That
#define isblank(c) ((c) == ' ' || (c) == '\t') very likely doesn't mean what you want if EINTR is not available. */
#ifdef EINTR
# define EINTR_SET (errno == EINTR)
#else
# define EINTR_SET (0)
#endif #endif
#ifdef HAVE_UNISTD_H #ifndef isblank
#include <unistd.h> # define isblank(c) ((c) == ' ' || (c) == '\t')
#endif
#ifdef HAVE_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) && !defined (VMS) # if defined (_POSIX_VERSION) && !defined (ultrix) && !defined (VMS)
#define POSIX # define POSIX 1
#endif # endif
#endif #endif
/* Some systems define _POSIX_VERSION but are not really POSIX.1. */ /* Some systems define _POSIX_VERSION but are not really POSIX.1. */
#if (defined (butterfly) || defined (__arm) || (defined (__mips) && defined (_SYSTYPE_SVR3)) || (defined (sequent) && defined (i386))) #if (defined (butterfly) || defined (__arm) || (defined (__mips) && defined (_SYSTYPE_SVR3)) || (defined (sequent) && defined (i386)))
#undef POSIX # undef POSIX
#endif #endif
#if !defined (POSIX) && defined (_AIX) && defined (_POSIX_SOURCE) #if !defined (POSIX) && defined (_AIX) && defined (_POSIX_SOURCE)
#define POSIX # define POSIX 1
#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
#include "signame.h" #if !defined (HAVE_SYS_SIGLIST) || !defined (HAVE_STRSIGNAL)
# include "signame.h"
#endif #endif
/* Some systems do not define NSIG in <signal.h>. */ /* Some systems do not define NSIG in <signal.h>. */
#ifndef NSIG #ifndef NSIG
#ifdef _NSIG # ifdef _NSIG
#define NSIG _NSIG # define NSIG _NSIG
#else # else
#define NSIG 32 # define NSIG 32
#endif # endif
#endif #endif
#ifndef RETSIGTYPE #ifndef RETSIGTYPE
#define RETSIGTYPE void # define RETSIGTYPE void
#endif #endif
#ifndef sigmask #ifndef sigmask
#define sigmask(sig) (1 << ((sig) - 1)) # define sigmask(sig) (1 << ((sig) - 1))
#endif #endif
#ifdef HAVE_LIMITS_H #ifdef HAVE_LIMITS_H
#include <limits.h> # include <limits.h>
#endif #endif
#ifdef HAVE_SYS_PARAM_H #ifdef HAVE_SYS_PARAM_H
#include <sys/param.h> # include <sys/param.h>
#endif #endif
#ifndef PATH_MAX #ifndef PATH_MAX
#ifndef POSIX # ifndef POSIX
#define PATH_MAX MAXPATHLEN # define PATH_MAX MAXPATHLEN
#endif /* Not POSIX. */ # endif
#endif /* No PATH_MAX. */ #endif
#ifndef MAXPATHLEN #ifndef MAXPATHLEN
#define MAXPATHLEN 1024 # define MAXPATHLEN 1024
#endif /* No MAXPATHLEN. */ #endif
#ifdef PATH_MAX #ifdef PATH_MAX
#define GET_PATH_MAX PATH_MAX # define GET_PATH_MAX PATH_MAX
#define PATH_VAR(var) char var[PATH_MAX] # define PATH_VAR(var) char var[PATH_MAX]
#else #else
#define NEED_GET_PATH_MAX # define NEED_GET_PATH_MAX 1
# define GET_PATH_MAX (get_path_max ())
# define PATH_VAR(var) char *var = (char *) alloca (GET_PATH_MAX)
extern unsigned int get_path_max PARAMS ((void)); extern unsigned int get_path_max PARAMS ((void));
#define GET_PATH_MAX (get_path_max ())
#define PATH_VAR(var) char *var = (char *) alloca (GET_PATH_MAX)
#endif #endif
#ifndef CHAR_BIT #ifndef CHAR_BIT
#define CHAR_BIT 8 # define CHAR_BIT 8
#endif #endif
/* Nonzero if the integer type T is signed. */ /* Nonzero if the integer type T is signed. */
@@ -150,233 +171,285 @@ extern unsigned int get_path_max PARAMS ((void));
(! INTEGER_TYPE_SIGNED (t) ? (t) 0 : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)) (! INTEGER_TYPE_SIGNED (t) ? (t) 0 : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))
#define INTEGER_TYPE_MAXIMUM(t) (~ (t) 0 - INTEGER_TYPE_MINIMUM (t)) #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
#endif # endif
#ifdef S_ISDIR # ifdef S_ISDIR
#undef S_ISDIR # undef S_ISDIR
#endif # endif
#endif /* STAT_MACROS_BROKEN. */ #endif /* STAT_MACROS_BROKEN. */
#ifndef S_ISREG #ifndef S_ISREG
#define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG) # define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG)
#endif #endif
#ifndef S_ISDIR #ifndef S_ISDIR
#define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR) # define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
#endif #endif
#ifdef VMS #ifdef VMS
#include <stdio.h> # include <stdio.h>
#include <types.h> # include <types.h>
#include <unixlib.h> # include <unixlib.h>
#include <unixio.h> # include <unixio.h>
#include <errno.h> # include <errno.h>
#include <perror.h> # include <perror.h>
#endif #endif
#if (defined (STDC_HEADERS) || defined (__GNU_LIBRARY__) || defined(VMS)) #ifndef __attribute__
#include <stdlib.h> /* This feature is available in gcc versions 2.5 and later. */
#include <string.h> # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
#define ANSI_STRING # define __attribute__(x)
#else /* No standard headers. */ # endif
/* The __-protected variants of `format' and `printf' attributes
#ifdef HAVE_STRING_H are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
#include <string.h> # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
#define ANSI_STRING # define __format__ format
#else # define __printf__ printf
#include <strings.h> # endif
#endif
#ifdef HAVE_MEMORY_H
#include <memory.h>
#endif #endif
#if defined (STDC_HEADERS) || defined (__GNU_LIBRARY__)
# include <stdlib.h>
# include <string.h>
# define ANSI_STRING 1
#else /* No standard headers. */
# ifdef HAVE_STRING_H
# include <string.h>
# define ANSI_STRING 1
# else
# include <strings.h>
# endif
# ifdef HAVE_MEMORY_H
# include <memory.h>
# endif
# ifdef HAVE_STDLIB_H
# include <stdlib.h>
# else
extern char *malloc PARAMS ((int)); extern char *malloc PARAMS ((int));
extern char *realloc PARAMS ((char *, int)); extern char *realloc PARAMS ((char *, int));
extern void free PARAMS ((char *)); extern void free PARAMS ((char *));
extern void abort PARAMS ((void)); extern void abort PARAMS ((void)) __attribute__ ((noreturn));
extern void exit PARAMS ((int)); extern void exit PARAMS ((int)) __attribute__ ((noreturn));
# endif /* HAVE_STDLIB_H. */
#endif /* Standard headers. */ #endif /* Standard headers. */
#ifdef ANSI_STRING #if ST_MTIM_NSEC
# if HAVE_INTTYPES_H
#ifndef index # include <inttypes.h>
#define index(s, c) strchr((s), (c)) # endif
#endif # define FILE_TIMESTAMP uintmax_t
#ifndef rindex #else
#define rindex(s, c) strrchr((s), (c)) # define FILE_TIMESTAMP time_t
#endif #endif
#ifndef bcmp #ifdef ANSI_STRING
#define bcmp(s1, s2, n) memcmp ((s1), (s2), (n))
#endif
#ifndef bzero
#define bzero(s, n) memset ((s), 0, (n))
#endif
#if defined(HAVE_MEMMOVE) && !defined(bcopy)
#define bcopy(s, d, n) memmove ((d), (s), (n))
#endif
#else /* Not ANSI_STRING. */ # ifndef index
# define index(s, c) strchr((s), (c))
# endif
# ifndef rindex
# define rindex(s, c) strrchr((s), (c))
# endif
#ifndef bcmp # ifndef bcmp
extern int bcmp (); # define bcmp(s1, s2, n) memcmp ((s1), (s2), (n))
#endif # endif
#ifndef bzero # ifndef bzero
extern void bzero (); # define bzero(s, n) memset ((s), 0, (n))
#endif # endif
#ifndef bcopy # if defined(HAVE_MEMMOVE) && !defined(bcopy)
extern void bcopy (); # define bcopy(s, d, n) memmove ((d), (s), (n))
#endif # endif
#endif /* ANSI_STRING. */ #else /* Not ANSI_STRING. */
#undef ANSI_STRING
# ifndef bcmp
extern int bcmp PARAMS ((const char *, const char *, int));
# endif
# ifndef bzero
extern void bzero PARAMS ((char *, int));
#endif
# ifndef bcopy
extern void bcopy PARAMS ((const char *b1, char *b2, int));
# endif
#endif /* ANSI_STRING. */
#undef ANSI_STRING
/* SCO Xenix has a buggy macro definition in <string.h>. */ /* SCO Xenix has a buggy macro definition in <string.h>. */
#undef strerror #undef strerror
#if !defined(ANSI_STRING) && !defined(__DECC) #if !defined(ANSI_STRING) && !defined(__DECC)
extern char *strerror PARAMS ((int errnum)); extern char *strerror PARAMS ((int errnum));
#endif #endif
#ifdef __GNUC__
#ifdef __GNUC__ # undef alloca
#undef alloca # define alloca(n) __builtin_alloca (n)
#define alloca(n) __builtin_alloca (n) #else /* Not GCC. */
#else /* Not GCC. */ # ifdef HAVE_ALLOCA_H
#ifdef HAVE_ALLOCA_H # include <alloca.h>
#include <alloca.h> # else /* Not HAVE_ALLOCA_H. */
#else /* Not HAVE_ALLOCA_H. */ # ifndef _AIX
#ifndef _AIX
extern char *alloca (); extern char *alloca ();
#endif /* Not AIX. */ # endif /* Not AIX. */
#endif /* HAVE_ALLOCA_H. */ # endif /* HAVE_ALLOCA_H. */
#endif /* GCC. */ #endif /* GCC. */
#ifndef iAPX286 /* ISDIGIT offers the following features:
#define streq(a, b) \ - Its arg may be any int or unsigned int; it need not be an unsigned char.
((a) == (b) || \ - It's guaranteed to evaluate its argument exactly once.
(*(a) == *(b) && (*(a) == '\0' || !strcmp ((a) + 1, (b) + 1)))) NOTE! Make relies on this behavior, don't change it!
#ifdef _AMIGA - It's typically faster.
#define strieq(a, b) \ Posix 1003.2-1992 section 2.5.2.1 page 50 lines 1556-1558 says that
((a) == (b) || \ only '0' through '9' are digits. Prefer ISDIGIT to isdigit() unless
(tolower(*(a)) == tolower(*(b)) && (*(a) == '\0' || !strcmpi ((a) + 1, (b) + 1)))) it's important to use the locale's definition of `digit' even when the
#else host does not conform to Posix. */
#define strieq(a, b) \ #define ISDIGIT(c) ((unsigned) (c) - '0' <= 9)
((a) == (b) || \
(*(a) == *(b) && (*(a) == '\0' || !strcmp ((a) + 1, (b) + 1)))) #ifndef iAPX286
#endif # define streq(a, b) \
((a) == (b) || \
(*(a) == *(b) && (*(a) == '\0' || !strcmp ((a) + 1, (b) + 1))))
# ifdef HAVE_CASE_INSENSITIVE_FS
/* This is only used on Windows/DOS platforms, so we assume strcmpi(). */
# define strieq(a, b) \
((a) == (b) || \
(tolower(*(a)) == tolower(*(b)) && (*(a) == '\0' || !strcmpi ((a) + 1, (b) + 1))))
# else
# define strieq(a, b) streq(a, b)
# endif
#else #else
/* Buggy compiler can't handle this. */ /* Buggy compiler can't handle this. */
#define streq(a, b) (strcmp ((a), (b)) == 0) # define streq(a, b) (strcmp ((a), (b)) == 0)
#define strieq(a, b) (strcmp ((a), (b)) == 0) # define strieq(a, b) (strcmp ((a), (b)) == 0)
#endif #endif
#define strneq(a, b, l) (strncmp ((a), (b), (l)) == 0)
/* 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
#define HASHI(var, c) HASH(var,c) # define HASHI(var, c) HASH(var,c)
#endif #endif
#if defined(__GNUC__) || defined(ENUM_BITFIELDS) #if defined(__GNUC__) || defined(ENUM_BITFIELDS)
#define ENUM_BITFIELD(bits) :bits # define ENUM_BITFIELD(bits) :bits
#else #else
#define ENUM_BITFIELD(bits) # define ENUM_BITFIELD(bits)
#endif #endif
#if defined(__MSDOS__) || defined(WINDOWS32) #if defined(__MSDOS__) || defined(WINDOWS32)
#define PATH_SEPARATOR_CHAR ';' # define PATH_SEPARATOR_CHAR ';'
#else #else
#if defined(VMS) # if defined(VMS)
#define PATH_SEPARATOR_CHAR ',' # define PATH_SEPARATOR_CHAR ','
#else # else
#define PATH_SEPARATOR_CHAR ':' # define PATH_SEPARATOR_CHAR ':'
#endif # endif
#endif #endif
#ifdef WINDOWS32 #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)
#define kill(pid,sig) w32_kill(pid,sig) # define kill(pid,sig) w32_kill(pid,sig)
extern void sync_Path_environment(void); 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(char *s, char stopchar);
#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 */
struct floc
{
char *filenm;
unsigned long lineno;
};
#define NILF ((struct floc *)0)
extern void die (); /* Fancy processing for variadic functions in both ANSI and pre-ANSI
compilers. */
#if defined __STDC__ && __STDC__
extern void message (int prefix, const char *fmt, ...)
__attribute__ ((__format__ (__printf__, 2, 3)));
extern void error (const struct floc *flocp, const char *fmt, ...)
__attribute__ ((__format__ (__printf__, 2, 3)));
extern void fatal (const struct floc *flocp, const char *fmt, ...)
__attribute__ ((noreturn, __format__ (__printf__, 2, 3)));
#else
extern void message (); extern void message ();
extern void fatal ();
extern void error (); extern void error ();
extern void log_working_directory (); extern void fatal ();
extern void makefile_error ();
extern void makefile_fatal ();
extern void pfatal_with_name ();
extern void perror_with_name ();
extern char *savestring ();
extern char *concat ();
extern char *xmalloc ();
extern char *xrealloc ();
extern char *find_next_token ();
extern char *next_token ();
extern char *end_of_token ();
extern void collapse_continuations ();
extern void remove_comments ();
extern char *sindex ();
extern char *lindex ();
extern int alpha_compare ();
extern void print_spaces ();
extern struct dep *copy_dep_chain ();
extern char *find_char_unquote ();
extern char *find_percent ();
#ifndef NO_ARCHIVES
extern int ar_name ();
extern void ar_parse_name ();
extern int ar_touch ();
extern time_t ar_member_date ();
#endif #endif
extern void dir_load (); extern void die PARAMS ((int)) __attribute__ ((noreturn));
extern int dir_file_exists_p (); extern void log_working_directory PARAMS ((int));
extern int file_exists_p (); extern void pfatal_with_name PARAMS ((char *)) __attribute__ ((noreturn));
extern int file_impossible_p (); extern void perror_with_name PARAMS ((char *, char *));
extern void file_impossible (); extern char *savestring PARAMS ((const char *, unsigned int));
extern char *dir_name (); extern char *concat PARAMS ((char *, char *, char *));
extern char *xmalloc PARAMS ((unsigned int));
extern char *xrealloc PARAMS ((char *, unsigned int));
extern char *xstrdup PARAMS ((const char *));
extern char *find_next_token PARAMS ((char **, unsigned int *));
extern char *next_token PARAMS ((char *));
extern char *end_of_token PARAMS ((char *));
extern void collapse_continuations PARAMS ((char *));
extern void remove_comments PARAMS((char *));
extern char *sindex PARAMS ((const char *, unsigned int, \
const char *, unsigned int));
extern char *lindex PARAMS ((const char *, const char *, int));
extern int alpha_compare PARAMS ((const void *, const void *));
extern void print_spaces PARAMS ((unsigned int));
extern char *find_char_unquote PARAMS ((char *, char *, int));
extern char *find_percent PARAMS ((char *));
extern void define_default_variables (); #ifndef NO_ARCHIVES
extern void set_default_suffixes (); extern int ar_name PARAMS ((char *));
extern void install_default_suffix_rules (); extern void ar_parse_name PARAMS ((char *, char **, char **));
extern void install_default_implicit_rules (); extern int ar_touch PARAMS ((char *));
extern void count_implicit_rule_limits (); extern time_t ar_member_date PARAMS ((char *));
extern void convert_to_pattern (); #endif
extern void create_pattern_rule ();
extern void build_vpath_lists (); extern int dir_file_exists_p PARAMS ((char *, char *));
extern void construct_vpath_list (); extern int file_exists_p PARAMS ((char *));
extern int vpath_search (); extern int file_impossible_p PARAMS ((char *));
extern int gpath_search (); extern void file_impossible PARAMS ((char *));
extern char *dir_name PARAMS ((char *));
extern void construct_include_path (); extern void define_default_variables PARAMS ((void));
extern void uniquize_deps (); extern void set_default_suffixes PARAMS ((void));
extern void install_default_suffix_rules PARAMS ((void));
extern void install_default_implicit_rules PARAMS ((void));
extern int update_goal_chain (); extern void build_vpath_lists PARAMS ((void));
extern void notice_finished_file (); extern void construct_vpath_list PARAMS ((char *pattern, char *dirpath));
extern int vpath_search PARAMS ((char **file, FILE_TIMESTAMP *mtime_ptr));
extern int gpath_search PARAMS ((char *file, int len));
extern void user_access (); extern void construct_include_path PARAMS ((char **arg_dirs));
extern void make_access ();
extern void child_access ();
#ifdef HAVE_VFORK_H extern void user_access PARAMS ((void));
#include <vfork.h> extern void make_access PARAMS ((void));
extern void child_access PARAMS ((void));
#ifdef HAVE_VFORK_H
# include <vfork.h>
#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,
@@ -385,35 +458,39 @@ extern void child_access ();
#if !defined (__GNU_LIBRARY__) && !defined (POSIX) && !defined (_POSIX_VERSION) && !defined(WINDOWS32) #if !defined (__GNU_LIBRARY__) && !defined (POSIX) && !defined (_POSIX_VERSION) && !defined(WINDOWS32)
extern long int atol (); extern long int atol ();
#ifndef VMS # ifndef VMS
extern long int lseek (); extern long int lseek ();
#endif # endif
#endif /* Not GNU C library or POSIX. */ #endif /* Not GNU C library or POSIX. */
#ifdef HAVE_GETCWD #ifdef HAVE_GETCWD
extern char *getcwd (); extern char *getcwd ();
#ifdef VMS # ifdef VMS
extern char *getwd PARAMS ((char *)); extern char *getwd PARAMS ((char *));
#endif # endif
#else #else
extern char *getwd (); extern char *getwd ();
#define getcwd(buf, len) getwd (buf) # define getcwd(buf, len) getwd (buf)
#endif #endif
extern const struct floc *reading_file;
extern char **environ; extern char **environ;
extern char *reading_filename;
extern unsigned int *reading_lineno_ptr;
extern int just_print_flag, silent_flag, ignore_errors_flag, keep_going_flag; extern int just_print_flag, silent_flag, ignore_errors_flag, keep_going_flag;
extern int debug_flag, print_data_base_flag, question_flag, touch_flag; 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, no_builtin_variables_flag;
extern int print_directory_flag, warn_undefined_variables_flag; extern int print_version_flag, print_directory_flag;
extern int posix_pedantic; extern int warn_undefined_variables_flag, posix_pedantic;
extern int clock_skew_detected; 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;
extern int job_fds[2];
extern int job_rfd;
#ifndef NO_FLOAT #ifndef NO_FLOAT
extern double max_load_average; extern double max_load_average;
#else #else
@@ -430,9 +507,16 @@ extern unsigned int commands_started;
extern int handling_fatal_signal; extern int handling_fatal_signal;
#ifndef MIN
#define MIN(_a,_b) ((_a)<(_b)?(_a):(_b))
#endif
#ifndef MAX
#define MAX(_a,_b) ((_a)>(_b)?(_a):(_b))
#endif
#define DEBUGPR(msg) \ #define DEBUGPR(msg) \
do if (debug_flag) { print_spaces (depth); printf (msg, file->name); \ do if (debug_flag) { print_spaces (depth); printf (msg, file->name); \
fflush (stdout); } while (0) fflush (stdout); } while (0)
#ifdef VMS #ifdef VMS
# ifndef EXIT_FAILURE # ifndef EXIT_FAILURE
@@ -456,3 +540,8 @@ extern int handling_fatal_signal;
# endif # endif
#endif #endif
/* Set up heap debugging library dmalloc. */
#ifdef HAVE_DMALLOC_H
#include <dmalloc.h>
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -3,11 +3,49 @@ $! Makefile.com - builds GNU Make for VMS
$! $!
$! 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
$! P2 = DEBUG will build an image with debug information
$! $!
$ def/nolog sys sys$library: $! In case of problems with the install you might contact me at
$ 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 getopt getopt1" $! zinser@decus.decus.de (preferred) or martin_zinser@exchange.de
$!
$! 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
$!
$! Should we build a debug image
$!
$ if (p2.eqs."DEBUG")
$ then
$ ccopt = ccopt + "/noopt/debug"
$ lopt = "/debug"
$ else
$ lopt = ""
$ 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 +54,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,ar,arscan,commands,default,dir,expand,file,function,- $ link/exe=make make.opt/opt'lopt
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,ar,arscan,commands,default,dir,expand,file,function,- $ link/exe=make make.opt/opt,sys$library:vaxcrtl/lib'lopt
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") '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

View File

@@ -16,7 +16,8 @@
# #
# 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, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
CC = cc/warn CC = cc/warn
CP = copy CP = copy

245
misc.c
View File

@@ -14,23 +14,59 @@ 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, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "make.h" #include "make.h"
#include "dep.h" #include "dep.h"
/* Variadic functions. We go through contortions to allow proper function
prototypes for both ANSI and pre-ANSI C compilers, and also for those
which support stdarg.h vs. varargs.h, and finally those which have
vfprintf(), etc. and those who have _doprnt... or nothing.
This fancy stuff all came from GNU fileutils, except for the VA_PRINTF and
VA_END macros used here since we have multiple print functions. */
#if HAVE_VPRINTF || HAVE_DOPRNT
# define HAVE_STDVARARGS 1
# if __STDC__
# include <stdarg.h>
# define VA_START(args, lastarg) va_start(args, lastarg)
# else
# include <varargs.h>
# define VA_START(args, lastarg) va_start(args)
# endif
# if HAVE_VPRINTF
# define VA_PRINTF(fp, lastarg, args) vfprintf((fp), (lastarg), (args))
# else
# define VA_PRINTF(fp, lastarg, args) _doprnt((lastarg), (args), (fp))
# endif
# define VA_END(args) va_end(args)
#else
/* # undef HAVE_STDVARARGS */
# define va_alist a1, a2, a3, a4, a5, a6, a7, a8
# define va_dcl char *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8;
# define VA_START(args, lastarg)
# define VA_END(args)
#endif
/* Compare strings *S1 and *S2. /* Compare strings *S1 and *S2.
Return negative if the first is less, positive if it is greater, Return negative if the first is less, positive if it is greater,
zero if they are equal. */ zero if they are equal. */
int int
alpha_compare (s1, s2) alpha_compare (v1, v2)
char **s1, **s2; const void *v1, *v2;
{ {
if (**s1 != **s2) const char *s1 = *((char **)v1);
return **s1 - **s2; const char *s2 = *((char **)v2);
return strcmp (*s1, *s2);
if (*s1 != *s2)
return *s1 - *s2;
return strcmp (s1, s2);
} }
/* Discard each backslash-newline combination from LINE. /* Discard each backslash-newline combination from LINE.
@@ -173,13 +209,22 @@ concat (s1, s2, s3)
/* Print a message on stdout. */ /* Print a message on stdout. */
void void
message (prefix, s1, s2, s3, s4, s5, s6) #if __STDC__ && HAVE_STDVARARGS
message (int prefix, const char *fmt, ...)
#else
message (prefix, fmt, va_alist)
int prefix; int prefix;
char *s1, *s2, *s3, *s4, *s5, *s6; const char *fmt;
va_dcl
#endif
{ {
#if HAVE_STDVARARGS
va_list args;
#endif
log_working_directory (1); log_working_directory (1);
if (s1 != 0) if (fmt != 0)
{ {
if (prefix) if (prefix)
{ {
@@ -188,76 +233,78 @@ message (prefix, s1, s2, s3, s4, s5, s6)
else else
printf ("%s[%u]: ", program, makelevel); printf ("%s[%u]: ", program, makelevel);
} }
printf (s1, s2, s3, s4, s5, s6); VA_START (args, fmt);
VA_PRINTF (stdout, fmt, args);
VA_END (args);
putchar ('\n'); putchar ('\n');
} }
fflush (stdout); fflush (stdout);
} }
/* Print an error message and exit. */ /* Print an error message. */
/* VARARGS1 */
void
fatal (s1, s2, s3, s4, s5, s6)
char *s1, *s2, *s3, *s4, *s5, *s6;
{
log_working_directory (1);
if (makelevel == 0)
fprintf (stderr, "%s: *** ", program);
else
fprintf (stderr, "%s[%u]: *** ", program, makelevel);
fprintf (stderr, s1, s2, s3, s4, s5, s6);
fputs (". Stop.\n", stderr);
die (2);
}
/* Print error message. `s1' is printf control string, `s2' is arg for it. */
/* VARARGS1 */
void void
error (s1, s2, s3, s4, s5, s6) #if __STDC__ && HAVE_STDVARARGS
char *s1, *s2, *s3, *s4, *s5, *s6; error (const struct floc *flocp, const char *fmt, ...)
#else
error (flocp, fmt, va_alist)
const struct floc *flocp;
const char *fmt;
va_dcl
#endif
{ {
#if HAVE_STDVARARGS
va_list args;
#endif
log_working_directory (1); log_working_directory (1);
if (makelevel == 0) if (flocp && flocp->filenm)
fprintf (stderr, "%s:%lu: ", flocp->filenm, flocp->lineno);
else if (makelevel == 0)
fprintf (stderr, "%s: ", program); fprintf (stderr, "%s: ", program);
else else
fprintf (stderr, "%s[%u]: ", program, makelevel); fprintf (stderr, "%s[%u]: ", program, makelevel);
fprintf (stderr, s1, s2, s3, s4, s5, s6);
VA_START(args, fmt);
VA_PRINTF (stderr, fmt, args);
VA_END (args);
putc ('\n', stderr); putc ('\n', stderr);
fflush (stderr); fflush (stderr);
} }
void /* Print an error message and exit. */
makefile_error (file, lineno, s1, s2, s3, s4, s5, s6)
char *file;
unsigned int lineno;
char *s1, *s2, *s3, *s4, *s5, *s6;
{
log_working_directory (1);
fprintf (stderr, "%s:%u: ", file, lineno);
fprintf (stderr, s1, s2, s3, s4, s5, s6);
putc ('\n', stderr);
fflush (stderr);
}
void void
makefile_fatal (file, lineno, s1, s2, s3, s4, s5, s6) #if __STDC__ && HAVE_STDVARARGS
char *file; fatal (const struct floc *flocp, const char *fmt, ...)
unsigned int lineno; #else
char *s1, *s2, *s3, *s4, *s5, *s6; fatal (flocp, fmt, va_alist)
const struct floc *flocp;
const char *fmt;
va_dcl
#endif
{ {
#if HAVE_STDVARARGS
va_list args;
#endif
log_working_directory (1); log_working_directory (1);
fprintf (stderr, "%s:%u: *** ", file, lineno); if (flocp && flocp->filenm)
fprintf (stderr, s1, s2, s3, s4, s5, s6); fprintf (stderr, "%s:%lu: *** ", flocp->filenm, flocp->lineno);
fputs (". Stop.\n", stderr); else if (makelevel == 0)
fprintf (stderr, "%s: *** ", program);
else
fprintf (stderr, "%s[%u]: *** ", program, makelevel);
VA_START(args, fmt);
VA_PRINTF (stderr, fmt, args);
VA_END (args);
fputs (_(". Stop.\n"), stderr);
die (2); die (2);
} }
@@ -279,7 +326,7 @@ strerror (errnum)
if (errno < sys_nerr) if (errno < sys_nerr)
return sys_errlist[errnum]; return sys_errlist[errnum];
sprintf (buf, "Unknown error %d", errnum); sprintf (buf, _("Unknown error %d"), errnum);
return buf; return buf;
} }
#endif #endif
@@ -290,7 +337,7 @@ void
perror_with_name (str, name) perror_with_name (str, name)
char *str, *name; char *str, *name;
{ {
error ("%s%s: %s", str, name, strerror (errno)); error (NILF, "%s%s: %s", str, name, strerror (errno));
} }
/* Print an error message from errno and exit. */ /* Print an error message from errno and exit. */
@@ -299,15 +346,19 @@ void
pfatal_with_name (name) pfatal_with_name (name)
char *name; char *name;
{ {
fatal ("%s: %s", name, strerror (errno)); fatal (NILF, "%s: %s", name, strerror (errno));
/* NOTREACHED */ /* NOTREACHED */
} }
/* Like malloc but get fatal error if memory is exhausted. */ /* Like malloc but get fatal error if memory is exhausted. */
/* Don't bother if we're using dmalloc; it provides these for us. */
#ifndef HAVE_DMALLOC_H
#undef xmalloc #undef xmalloc
#undef xrealloc #undef xrealloc
#undef xstrdup
char * char *
xmalloc (size) xmalloc (size)
@@ -315,7 +366,7 @@ xmalloc (size)
{ {
char *result = (char *) malloc (size); char *result = (char *) malloc (size);
if (result == 0) if (result == 0)
fatal ("virtual memory exhausted"); fatal (NILF, _("virtual memory exhausted"));
return result; return result;
} }
@@ -325,15 +376,43 @@ xrealloc (ptr, size)
char *ptr; char *ptr;
unsigned int size; unsigned int size;
{ {
char *result = (char *) realloc (ptr, size); char *result;
/* Some older implementations of realloc() don't conform to ANSI. */
result = ptr ? realloc (ptr, size) : malloc (size);
if (result == 0) if (result == 0)
fatal ("virtual memory exhausted"); fatal (NILF, _("virtual memory exhausted"));
return result; return result;
} }
char *
xstrdup (ptr)
const char *ptr;
{
char *result;
#ifdef HAVE_STRDUP
result = strdup (ptr);
#else
result = (char *) malloc (strlen (ptr) + 1);
#endif
if (result == 0)
fatal (NILF, _("virtual memory exhausted"));
#ifdef HAVE_STRDUP
return result;
#else
return strcpy(result, ptr);
#endif
}
#endif /* HAVE_DMALLOC_H */
char * char *
savestring (str, length) savestring (str, length)
char *str; const char *str;
unsigned int length; unsigned int length;
{ {
register char *out = (char *) xmalloc (length + 1); register char *out = (char *) xmalloc (length + 1);
@@ -349,21 +428,28 @@ savestring (str, length)
char * char *
sindex (big, blen, small, slen) sindex (big, blen, small, slen)
char *big; const char *big;
unsigned int blen; unsigned int blen;
char *small; const char *small;
unsigned int slen; unsigned int slen;
{ {
register unsigned int b; if (!blen)
if (blen < 1)
blen = strlen (big); blen = strlen (big);
if (slen < 1) if (!slen)
slen = strlen (small); slen = strlen (small);
for (b = 0; b < blen; ++b) if (slen && blen >= slen)
if (big[b] == *small && !strncmp (&big[b + 1], small + 1, slen - 1)) {
return (&big[b]); register unsigned int b;
/* Quit when there's not enough room left for the small string. */
--slen;
blen -= slen;
for (b = 0; b < blen; ++b, ++big)
if (*big == *small && strneq (big + 1, small + 1, slen))
return (char *)big;
}
return 0; return 0;
} }
@@ -376,12 +462,12 @@ sindex (big, blen, small, slen)
char * char *
lindex (s, limit, c) lindex (s, limit, c)
register char *s, *limit; register const char *s, *limit;
int c; int c;
{ {
while (s < limit) while (s < limit)
if (*s++ == c) if (*s++ == c)
return s - 1; return (char *)(s - 1);
return 0; return 0;
} }
@@ -470,14 +556,14 @@ 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)
{ {
c = (struct dep *) xmalloc (sizeof (struct dep)); c = (struct dep *) xmalloc (sizeof (struct dep));
bcopy ((char *) d, (char *) c, sizeof (struct dep)); bcopy ((char *) d, (char *) c, sizeof (struct dep));
if (c->name != 0) if (c->name != 0)
c->name = savestring (c->name, strlen (c->name)); c->name = xstrdup (c->name);
c->next = 0; c->next = 0;
if (firstnew == 0) if (firstnew == 0)
firstnew = lastnew = c; firstnew = lastnew = c;
@@ -564,8 +650,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);
} }
@@ -584,7 +671,7 @@ init_access ()
if (user_uid == -1 || user_gid == -1 || make_uid == -1 || make_gid == -1) if (user_uid == -1 || user_gid == -1 || make_uid == -1 || make_gid == -1)
pfatal_with_name ("get{e}[gu]id"); pfatal_with_name ("get{e}[gu]id");
log_access ("Initialized"); log_access (_("Initialized"));
current_access = make; current_access = make;
#endif #endif

929
read.c

File diff suppressed because it is too large Load Diff

View File

@@ -47,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.

468
remake.c
View File

@@ -14,13 +14,16 @@ 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, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "make.h" #include "make.h"
#include "filedef.h" #include "filedef.h"
#include "job.h" #include "job.h"
#include "commands.h" #include "commands.h"
#include "dep.h" #include "dep.h"
#include "variable.h"
#include <assert.h> #include <assert.h>
#ifdef HAVE_FCNTL_H #ifdef HAVE_FCNTL_H
@@ -29,10 +32,6 @@ 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
@@ -48,13 +47,11 @@ unsigned int commands_started = 0;
static int update_file PARAMS ((struct file *file, unsigned int depth)); static int update_file PARAMS ((struct file *file, unsigned int depth));
static int update_file_1 PARAMS ((struct file *file, unsigned int depth)); static int update_file_1 PARAMS ((struct file *file, unsigned int depth));
static int check_dep PARAMS ((struct file *file, unsigned int depth, time_t this_mtime, int *must_make_ptr)); static int check_dep PARAMS ((struct file *file, unsigned int depth, FILE_TIMESTAMP this_mtime, int *must_make_ptr));
static int touch_file PARAMS ((struct file *file)); static int touch_file PARAMS ((struct file *file));
static void remake_file PARAMS ((struct file *file)); static void remake_file PARAMS ((struct file *file));
static time_t name_mtime PARAMS ((char *name)); static FILE_TIMESTAMP name_mtime PARAMS ((char *name));
static int library_search PARAMS ((char **lib, time_t *mtime_ptr)); static int library_search PARAMS ((char **lib, FILE_TIMESTAMP *mtime_ptr));
extern time_t f_mtime PARAMS ((struct file *file, int search));
/* 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
@@ -64,6 +61,9 @@ extern time_t f_mtime PARAMS ((struct file *file, int search));
should only make one goal at a time and return as soon as one goal whose should only make one goal at a time and return as soon as one goal whose
`changed' member is nonzero is successfully made. */ `changed' member is nonzero is successfully made. */
/* We need to know this "lower down" for correct error handling. */
static int updating_makefiles = 0;
int int
update_goal_chain (goals, makefiles) update_goal_chain (goals, makefiles)
register struct dep *goals; register struct dep *goals;
@@ -73,6 +73,8 @@ update_goal_chain (goals, makefiles)
unsigned int j = job_slots; unsigned int j = job_slots;
int status = -1; int status = -1;
updating_makefiles = makefiles;
#define MTIME(file) (makefiles ? file_mtime_no_search (file) \ #define MTIME(file) (makefiles ? file_mtime_no_search (file) \
: file_mtime (file)) : file_mtime (file))
@@ -91,9 +93,17 @@ 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
/* All files start with the considered bit 0, so the global value is 1. */
considered = 1;
/* Update all the goals until they are all finished. */ /* Update all the goals until they are all finished. */
@@ -114,8 +124,8 @@ update_goal_chain (goals, makefiles)
while (g != 0) while (g != 0)
{ {
/* 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;
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;
@@ -123,7 +133,6 @@ update_goal_chain (goals, makefiles)
{ {
unsigned int ocommands_started; unsigned int ocommands_started;
int x; int x;
time_t mtime = MTIME (file);
check_renamed (file); check_renamed (file);
if (makefiles) if (makefiles)
{ {
@@ -170,7 +179,8 @@ update_goal_chain (goals, makefiles)
stop = (!keep_going_flag && !question_flag stop = (!keep_going_flag && !question_flag
&& !makefiles); && !makefiles);
} }
else if (MTIME (file) != mtime) else if (file->updated && g->changed &&
file->last_mtime != file->mtime_before_update)
{ {
/* Updating was done. If this is a makefile and /* Updating was done. If this is a makefile and
just_print_flag or question_flag is set just_print_flag or question_flag is set
@@ -212,8 +222,8 @@ update_goal_chain (goals, makefiles)
/* Never give a message under -s or -q. */ /* Never give a message under -s or -q. */
&& !silent_flag && !question_flag) && !silent_flag && !question_flag)
message (1, ((file->phony || file->cmds == 0) message (1, ((file->phony || file->cmds == 0)
? "Nothing to be done for `%s'." ? _("Nothing to be done for `%s'.")
: "`%s' is up to date."), : _("`%s' is up to date.")),
file->name); file->name);
/* This goal is finished. Remove it from the chain. */ /* This goal is finished. Remove it from the chain. */
@@ -236,6 +246,11 @@ update_goal_chain (goals, makefiles)
g = g->next; g = g->next;
} }
} }
/* If we reached the end of the dependency graph toggle the considered
flag for the next pass. */
if (g == 0)
considered = !considered;
} }
if (makefiles) if (makefiles)
@@ -248,6 +263,39 @@ 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 the previous attempt was made while we were creating
makefiles, but we aren't anymore, print an error now. */
if (!file->dontcare
|| (file->mfile_status && !updating_makefiles))
{
if (file->parent == 0)
error (NILF, msg_noparent, "*** ", file->name, ".");
else
error (NILF, msg_parent, "*** ",
file->name, file->parent->name, ".");
}
file->update_status = 2;
file->mfile_status = updating_makefiles;
}
else if (file->parent == 0)
fatal (NILF, msg_noparent, "", file->name, "");
else
fatal (NILF, 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.
@@ -270,6 +318,17 @@ update_file (file, depth)
for (f = file->double_colon ? file->double_colon : file; f != 0; f = f->prev) for (f = file->double_colon ? file->double_colon : file; f != 0; f = f->prev)
{ {
/* Prune the dependency graph: if we've already been here on _this_
pass through the dependency graph, we don't have to go any further.
We won't reap_children until we start the next pass, so no state
change is possible below here until then. */
if (f->considered == considered)
{
DEBUGPR (_("Pruning file `%s'.\n"));
continue;
}
f->considered = considered;
status |= update_file_1 (f, depth); status |= update_file_1 (f, depth);
check_renamed (f); check_renamed (f);
@@ -304,23 +363,24 @@ update_file_1 (file, depth)
struct file *file; struct file *file;
unsigned int depth; unsigned int depth;
{ {
register time_t this_mtime; register FILE_TIMESTAMP this_mtime;
int noexist, must_make, deps_changed; int noexist, must_make, deps_changed;
int dep_status = 0; int dep_status = 0;
register struct dep *d, *lastd; register struct dep *d, *lastd;
int running = 0; int running = 0;
DEBUGPR ("Considering target file `%s'.\n"); DEBUGPR (_("Considering target file `%s'.\n"));
if (file->updated) if (file->updated)
{ {
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"));
no_rule_error(file);
return file->update_status; return file->update_status;
} }
DEBUGPR ("File `%s' was considered already.\n"); DEBUGPR (_("File `%s' was considered already.\n"));
return 0; return 0;
} }
@@ -330,10 +390,10 @@ update_file_1 (file, depth)
case cs_deps_running: case cs_deps_running:
break; break;
case cs_running: case cs_running:
DEBUGPR ("Still updating file `%s'.\n"); DEBUGPR (_("Still updating file `%s'.\n"));
return 0; return 0;
case cs_finished: case cs_finished:
DEBUGPR ("Finished updating file `%s'.\n"); DEBUGPR (_("Finished updating file `%s'.\n"));
return file->update_status; return file->update_status;
default: default:
abort (); abort ();
@@ -352,9 +412,9 @@ update_file_1 (file, depth)
this_mtime = file_mtime (file); this_mtime = file_mtime (file);
check_renamed (file); check_renamed (file);
noexist = this_mtime == (time_t) -1; noexist = this_mtime == (FILE_TIMESTAMP) -1;
if (noexist) if (noexist)
DEBUGPR ("File `%s' does not exist.\n"); DEBUGPR (_("File `%s' does not exist.\n"));
must_make = noexist; must_make = noexist;
@@ -364,15 +424,15 @@ update_file_1 (file, depth)
if (!file->phony && file->cmds == 0 && !file->tried_implicit) if (!file->phony && file->cmds == 0 && !file->tried_implicit)
{ {
if (try_implicit_rule (file, depth)) if (try_implicit_rule (file, depth))
DEBUGPR ("Found an implicit rule for `%s'.\n"); DEBUGPR (_("Found an implicit rule for `%s'.\n"));
else else
DEBUGPR ("No implicit rule found for `%s'.\n"); DEBUGPR (_("No implicit rule found for `%s'.\n"));
file->tried_implicit = 1; file->tried_implicit = 1;
} }
if (file->cmds == 0 && !file->is_target if (file->cmds == 0 && !file->is_target
&& default_file != 0 && default_file->cmds != 0) && default_file != 0 && default_file->cmds != 0)
{ {
DEBUGPR ("Using default commands for `%s'.\n"); DEBUGPR (_("Using default commands for `%s'.\n"));
file->cmds = default_file->cmds; file->cmds = default_file->cmds;
} }
@@ -383,7 +443,7 @@ update_file_1 (file, depth)
d = file->deps; d = file->deps;
while (d != 0) while (d != 0)
{ {
time_t mtime; FILE_TIMESTAMP mtime;
check_renamed (d->file); check_renamed (d->file);
@@ -392,20 +452,16 @@ update_file_1 (file, depth)
if (d->file->updating) if (d->file->updating)
{ {
error ("Circular %s <- %s dependency dropped.", error (NILF, _("Circular %s <- %s prerequisite 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;
} }
@@ -444,7 +500,7 @@ update_file_1 (file, depth)
for (d = file->deps; d != 0; d = d->next) for (d = file->deps; d != 0; d = d->next)
if (d->file->intermediate) if (d->file->intermediate)
{ {
time_t mtime = file_mtime (d->file); FILE_TIMESTAMP mtime = file_mtime (d->file);
check_renamed (d->file); check_renamed (d->file);
d->file->parent = file; d->file->parent = file;
dep_status |= update_file (d->file, depth); dep_status |= update_file (d->file, depth);
@@ -474,13 +530,13 @@ update_file_1 (file, depth)
file->updating = 0; file->updating = 0;
DEBUGPR ("Finished dependencies of target file `%s'.\n"); DEBUGPR (_("Finished prerequisites of target file `%s'.\n"));
if (running) if (running)
{ {
set_command_state (file, cs_deps_running); set_command_state (file, cs_deps_running);
--depth; --depth;
DEBUGPR ("The dependencies of `%s' are being made.\n"); DEBUGPR (_("The prerequisites of `%s' are being made.\n"));
return 0; return 0;
} }
@@ -493,11 +549,11 @@ update_file_1 (file, depth)
depth--; depth--;
DEBUGPR ("Giving up on target file `%s'.\n"); DEBUGPR (_("Giving up on target file `%s'.\n"));
if (depth == 0 && keep_going_flag if (depth == 0 && keep_going_flag
&& !just_print_flag && !question_flag) && !just_print_flag && !question_flag)
error ("Target `%s' not remade because of errors.", file->name); error (NILF, _("Target `%s' not remade because of errors."), file->name);
return dep_status; return dep_status;
} }
@@ -519,13 +575,13 @@ update_file_1 (file, depth)
deps_changed = 0; deps_changed = 0;
for (d = file->deps; d != 0; d = d->next) for (d = file->deps; d != 0; d = d->next)
{ {
time_t d_mtime = file_mtime (d->file); FILE_TIMESTAMP d_mtime = file_mtime (d->file);
check_renamed (d->file); check_renamed (d->file);
#if 1 /* %%% In version 4, remove this code completely to #if 1 /* %%% In version 4, remove this code completely to
implement not remaking deps if their deps are newer implement not remaking deps if their deps are newer
than their parents. */ than their parents. */
if (d_mtime == (time_t) -1 && !d->file->intermediate) if (d_mtime == (FILE_TIMESTAMP) -1 && !d->file->intermediate)
/* We must remake if this dep does not /* We must remake if this dep does not
exist and is not intermediate. */ exist and is not intermediate. */
must_make = 1; must_make = 1;
@@ -541,11 +597,11 @@ update_file_1 (file, depth)
if (debug_flag && !noexist) if (debug_flag && !noexist)
{ {
print_spaces (depth); print_spaces (depth);
if (d_mtime == (time_t) -1) if (d_mtime == (FILE_TIMESTAMP) -1)
printf ("Dependency `%s' does not exist.\n", dep_name (d)); printf (_("Prerequisite `%s' does not exist.\n"), dep_name (d));
else else
printf ("Dependency `%s' is %s than dependent `%s'.\n", printf (_("Prerequisite `%s' is %s than target `%s'.\n"),
dep_name (d), d->changed ? "newer" : "older", file->name); dep_name (d), d->changed ? _("newer") : _("older"), file->name);
fflush (stdout); fflush (stdout);
} }
} }
@@ -556,12 +612,12 @@ update_file_1 (file, depth)
if (file->double_colon && file->deps == 0) if (file->double_colon && file->deps == 0)
{ {
must_make = 1; must_make = 1;
DEBUGPR ("Target `%s' is double-colon and has no dependencies.\n"); DEBUGPR (_("Target `%s' is double-colon and has no prerequisites.\n"));
} }
else if (!noexist && file->is_target && !deps_changed && file->cmds == 0) else if (!noexist && file->is_target && !deps_changed && file->cmds == 0)
{ {
must_make = 0; must_make = 0;
DEBUGPR ("No commands for `%s' and no dependencies actually changed.\n"); DEBUGPR (_("No commands for `%s' and no prerequisites actually changed.\n"));
} }
if (!must_make) if (!must_make)
@@ -569,9 +625,9 @@ update_file_1 (file, depth)
if (debug_flag) if (debug_flag)
{ {
print_spaces(depth); print_spaces(depth);
printf("No need to remake target `%s'", file->name); printf(_("No need to remake target `%s'"), file->name);
if (!streq(file->name, file->hname)) if (!streq(file->name, file->hname))
printf("; using VPATH name `%s'", file->hname); printf(_("; using VPATH name `%s'"), file->hname);
printf(".\n"); printf(".\n");
fflush(stdout); fflush(stdout);
} }
@@ -591,16 +647,16 @@ update_file_1 (file, depth)
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 /* It needs to be remade. If it's VPATH and not reset via GPATH, toss the
VPATH */ VPATH. */
if (!streq(file->name, file->hname)) if (!streq(file->name, file->hname))
{ {
if (debug_flag) if (debug_flag)
{ {
print_spaces (depth); print_spaces (depth);
printf(" Ignoring VPATH name `%s'.\n", file->hname); printf(_(" Ignoring VPATH name `%s'.\n"), file->hname);
fflush(stdout); fflush(stdout);
} }
file->ignore_vpath = 1; file->ignore_vpath = 1;
@@ -611,20 +667,20 @@ update_file_1 (file, depth)
if (file->command_state != cs_finished) if (file->command_state != cs_finished)
{ {
DEBUGPR ("Commands of `%s' are being run.\n"); DEBUGPR (_("Commands of `%s' are being run.\n"));
return 0; return 0;
} }
switch (file->update_status) switch (file->update_status)
{ {
case 2: case 2:
DEBUGPR ("Failed to remake target file `%s'.\n"); DEBUGPR (_("Failed to remake target file `%s'.\n"));
break; break;
case 0: case 0:
DEBUGPR ("Successfully remade target file `%s'.\n"); DEBUGPR (_("Successfully remade target file `%s'.\n"));
break; break;
case 1: case 1:
DEBUGPR ("Target file `%s' needs remade under -q.\n"); DEBUGPR (_("Target file `%s' needs remade under -q.\n"));
break; break;
default: default:
assert (file->update_status >= 0 && file->update_status <= 2); assert (file->update_status >= 0 && file->update_status <= 2);
@@ -684,6 +740,9 @@ notice_finished_file (file)
{ {
struct file *f; struct file *f;
assert(file->mtime_before_update == 0);
file->mtime_before_update = file->last_mtime;
if (just_print_flag || question_flag if (just_print_flag || question_flag
|| (file->is_target && file->cmds == 0)) || (file->is_target && file->cmds == 0))
file->last_mtime = NEW_MTIME; file->last_mtime = NEW_MTIME;
@@ -731,7 +790,7 @@ static int
check_dep (file, depth, this_mtime, must_make_ptr) check_dep (file, depth, this_mtime, must_make_ptr)
struct file *file; struct file *file;
unsigned int depth; unsigned int depth;
time_t this_mtime; FILE_TIMESTAMP this_mtime;
int *must_make_ptr; int *must_make_ptr;
{ {
register struct dep *d; register struct dep *d;
@@ -744,32 +803,31 @@ check_dep (file, depth, this_mtime, must_make_ptr)
/* If this is a non-intermediate file, update it and record /* If this is a non-intermediate file, update it and record
whether it is newer than THIS_MTIME. */ whether it is newer than THIS_MTIME. */
{ {
time_t mtime; FILE_TIMESTAMP mtime;
dep_status = update_file (file, depth); dep_status = update_file (file, depth);
check_renamed (file); check_renamed (file);
mtime = file_mtime (file); mtime = file_mtime (file);
check_renamed (file); check_renamed (file);
if (mtime == (time_t) -1 || mtime > this_mtime) if (mtime == (FILE_TIMESTAMP) -1 || mtime > this_mtime)
*must_make_ptr = 1; *must_make_ptr = 1;
} }
else else
{ {
/* FILE is an intermediate file. */ /* FILE is an intermediate file. */
time_t mtime; FILE_TIMESTAMP mtime;
if (!file->phony && file->cmds == 0 && !file->tried_implicit if (!file->phony && file->cmds == 0 && !file->tried_implicit)
&& file->secondary)
{ {
if (try_implicit_rule (file, depth)) if (try_implicit_rule (file, depth))
DEBUGPR ("Found an implicit rule for `%s'.\n"); DEBUGPR (_("Found an implicit rule for `%s'.\n"));
else else
DEBUGPR ("No implicit rule found for `%s'.\n"); DEBUGPR (_("No implicit rule found for `%s'.\n"));
file->tried_implicit = 1; file->tried_implicit = 1;
} }
if (file->cmds == 0 && !file->is_target && file->secondary if (file->cmds == 0 && !file->is_target
&& default_file != 0 && default_file->cmds != 0) && default_file != 0 && default_file->cmds != 0)
{ {
DEBUGPR ("Using default commands for `%s'.\n"); DEBUGPR (_("Using default commands for `%s'.\n"));
file->cmds = default_file->cmds; file->cmds = default_file->cmds;
} }
@@ -778,7 +836,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 != (time_t) -1 && mtime > this_mtime) if (mtime != (FILE_TIMESTAMP) -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
@@ -793,7 +851,7 @@ check_dep (file, depth, this_mtime, must_make_ptr)
{ {
if (d->file->updating) if (d->file->updating)
{ {
error ("Circular %s <- %s dependency dropped.", error (NILF, _("Circular %s <- %s prerequisite dropped."),
file->name, d->file->name); file->name, d->file->name);
if (lastd == 0) if (lastd == 0)
{ {
@@ -818,7 +876,7 @@ check_dep (file, depth, this_mtime, must_make_ptr)
if (d->file->command_state == cs_running if (d->file->command_state == cs_running
|| d->file->command_state == cs_deps_running) || d->file->command_state == cs_deps_running)
/* Record that some of FILE's dependencies are still being made. /* Record that some of FILE's deps are still being made.
This tells the upper levels to wait on processing it until This tells the upper levels to wait on processing it until
the commands are finished. */ the commands are finished. */
set_command_state (file, cs_deps_running); set_command_state (file, cs_deps_running);
@@ -860,13 +918,10 @@ touch_file (file)
char buf; char buf;
int status; int status;
#ifdef EINTR
do do
#endif
status = fstat (fd, &statbuf); status = fstat (fd, &statbuf);
#ifdef EINTR while (status < 0 && EINTR_SET);
while (status < 0 && errno == EINTR);
#endif
if (status < 0) if (status < 0)
TOUCH_ERROR ("touch: fstat: "); TOUCH_ERROR ("touch: fstat: ");
/* Rewrite character 0 same as it already is. */ /* Rewrite character 0 same as it already is. */
@@ -910,32 +965,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
{ {
@@ -963,12 +993,12 @@ remake_file (file)
the library's actual name (/lib/libLIBNAME.a, etc.) is substituted into the library's actual name (/lib/libLIBNAME.a, etc.) is substituted into
FILE. */ FILE. */
time_t FILE_TIMESTAMP
f_mtime (file, search) f_mtime (file, search)
register struct file *file; register struct file *file;
int search; int search;
{ {
time_t mtime; FILE_TIMESTAMP mtime;
/* File's mtime is not known; must get it from the system. */ /* File's mtime is not known; must get it from the system. */
@@ -994,11 +1024,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)
@@ -1007,36 +1038,44 @@ 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)
free (arname); free (arname);
free (memname); free (memname);
if (mtime == (time_t) -1) if (mtime == (FILE_TIMESTAMP) -1)
/* 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 (FILE_TIMESTAMP) -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 && !file->ignore_vpath) if (mtime == (FILE_TIMESTAMP) -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;
@@ -1074,33 +1113,40 @@ f_mtime (file, search)
We only need to do this once, for now. */ We only need to do this once, for now. */
static time_t now = 0; static FILE_TIMESTAMP now = 0;
if (!clock_skew_detected if (!clock_skew_detected
&& mtime != (time_t)-1 && mtime > now && mtime != (FILE_TIMESTAMP)-1 && mtime > now
&& !file->updated) && !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. */
extern time_t time (); now = file_timestamp_now ();
time (&now);
#ifdef WINDOWS32 #ifdef WINDOWS32
/* /*
* FAT filesystems round time to nearest even second(!). Just * FAT filesystems round time to nearest even second(!). Just
* allow for any file (NTFS or FAT) to perhaps suffer from this * allow for any file (NTFS or FAT) to perhaps suffer from this
* braindamage. * braindamage.
*
* Apparently, this doesn't happen with the MS-DOS/DJGPP port,
* although MS-DOS and MS-Windows 3.X/9X also use FAT filesystems.
*/ */
if (mtime > now && (((mtime % 2) == 0) && ((mtime-1) > now))) if (mtime > now && (((mtime % 2) == 0) && ((mtime-1) > now)))
#else
#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 #else
if (mtime > now) if (mtime > now)
#endif
#endif #endif
{ {
error("*** Warning: File `%s' has modification time in the future", char mtimebuf[FILE_TIMESTAMP_PRINT_LEN_BOUND + 1];
file->name); char nowbuf[FILE_TIMESTAMP_PRINT_LEN_BOUND + 1];
file_timestamp_sprintf (mtimebuf, mtime);
file_timestamp_sprintf (nowbuf, now);
error (NILF, _("*** Warning: File `%s' has modification time in the future (%s > %s)"),
file->name, mtimebuf, nowbuf);
clock_skew_detected = 1; clock_skew_detected = 1;
} }
} }
@@ -1109,11 +1155,22 @@ f_mtime (file, search)
/* Store the mtime into all the entries for this file. */ /* Store the mtime into all the entries for this file. */
if (file->double_colon) if (file->double_colon)
file = file->double_colon; file = file->double_colon;
do do
{ {
/* If this file is not implicit but it is intermediate then it was
made so by the .INTERMEDIATE target. If this file has never
been built by us but was found now, it existed before make
started. So, turn off the intermediate bit so make doesn't
delete it, since it didn't create it. */
if (mtime != (FILE_TIMESTAMP)-1 && file->command_state == cs_not_started
&& !file->tried_implicit && file->intermediate)
file->intermediate = 0;
file->last_mtime = mtime; file->last_mtime = mtime;
file = file->prev; file = file->prev;
} while (file != 0); }
while (file != 0);
return mtime; return mtime;
} }
@@ -1121,16 +1178,16 @@ f_mtime (file, search)
/* Return the mtime of the file or archive-member reference NAME. */ /* Return the mtime of the file or archive-member reference NAME. */
static time_t static FILE_TIMESTAMP
name_mtime (name) name_mtime (name)
register char *name; register char *name;
{ {
struct stat st; struct stat st;
if (stat (name, &st) < 0) if (stat (name, &st) < 0)
return (time_t) -1; return (FILE_TIMESTAMP) -1;
return (time_t) st.st_mtime; return FILE_TIMESTAMP_STAT_MODTIME (st);
} }
@@ -1141,7 +1198,7 @@ name_mtime (name)
static int static int
library_search (lib, mtime_ptr) library_search (lib, mtime_ptr)
char **lib; char **lib;
time_t *mtime_ptr; FILE_TIMESTAMP *mtime_ptr;
{ {
static char *dirs[] = static char *dirs[] =
{ {
@@ -1160,82 +1217,111 @@ library_search (lib, mtime_ptr)
0 0
}; };
char *libname = &(*lib)[2]; /* Name without the `-l'. */ static char *libpatterns = NULL;
time_t mtime;
char *libname = &(*lib)[2]; /* Name without the `-l'. */
FILE_TIMESTAMP mtime;
/* Loop variables for the libpatterns value. */
char *p, *p2;
int len;
/* Buffer to construct possible names in. */
char *buf = xmalloc (sizeof (LIBDIR) + 8 + strlen (libname) + 4 + 2 + 1);
char *file, **dp; char *file, **dp;
/* Look first for `libNAME.a' in the current directory. */ /* If we don't have libpatterns, get it. */
if (!libpatterns)
#ifndef _AMIGA
sprintf (buf, "lib%s.a", libname);
#else
sprintf (buf, "%s.lib", libname);
#endif
mtime = name_mtime (buf);
if (mtime != (time_t) -1)
{ {
*lib = buf; int save = warn_undefined_variables_flag;
if (mtime_ptr != 0) warn_undefined_variables_flag = 0;
*mtime_ptr = mtime;
return 1; libpatterns = xstrdup (variable_expand ("$(strip $(.LIBPATTERNS))"));
warn_undefined_variables_flag = save;
} }
/* Now try VPATH search on that. */ /* Loop through all the patterns in .LIBPATTERNS, and search on each one. */
p2 = libpatterns;
file = buf; while ((p = find_next_token (&p2, &len)) != 0)
if (vpath_search (&file, mtime_ptr))
{ {
free (buf); static char *buf = NULL;
*lib = file; static int buflen = 0;
return 1; static int libdir_maxlen = -1;
} char *libbuf = variable_expand ("");
/* Now try the standard set of directories. */ /* Expand the pattern using LIBNAME as a replacement. */
#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); char c = p[len];
char *p3, *p4;
if (djdir_len > sizeof(LIBDIR) + 8 + strlen(libname) + 4 + 2) p[len] = '\0';
buf = (char *) xrealloc (djdir_len + 1); p3 = find_percent (p);
sprintf (buf, "%s/lib/lib%s.a", djdir->value, libname); if (!p3)
mtime = name_mtime (buf);
if (mtime != (time_t) -1)
{ {
*lib = buf; /* Give a warning if there is no pattern, then remove the
if (mtime_ptr != 0) pattern so it's ignored next time. */
*mtime_ptr = mtime; error (NILF, _(".LIBPATTERNS element `%s' is not a pattern"), p);
return 1; for (; len; --len, ++p)
*p = ' ';
*p = c;
continue;
} }
p4 = variable_buffer_output (libbuf, p, p3-p);
p4 = variable_buffer_output (p4, libname, strlen (libname));
p4 = variable_buffer_output (p4, p3+1, len - (p3-p));
p[len] = c;
} }
}
#endif
for (dp = dirs; *dp != 0; ++dp) /* Look first for `libNAME.a' in the current directory. */
{ mtime = name_mtime (libbuf);
#ifndef _AMIGA if (mtime != (FILE_TIMESTAMP) -1)
sprintf (buf, "%s/lib%s.a", *dp, libname);
#else
sprintf (buf, "%s/%s.lib", *dp, libname);
#endif
mtime = name_mtime (buf);
if (mtime != (time_t) -1)
{ {
*lib = buf; *lib = xstrdup (libbuf);
if (mtime_ptr != 0) if (mtime_ptr != 0)
*mtime_ptr = mtime; *mtime_ptr = mtime;
return 1; return 1;
} }
/* Now try VPATH search on that. */
file = libbuf;
if (vpath_search (&file, mtime_ptr))
{
*lib = file;
return 1;
}
/* Now try the standard set of directories. */
if (!buflen)
{
for (dp = dirs; *dp != 0; ++dp)
{
int l = strlen (*dp);
if (l > libdir_maxlen)
libdir_maxlen = l;
}
buflen = strlen (libbuf);
buf = xmalloc(libdir_maxlen + buflen + 2);
}
else if (buflen < strlen (libbuf))
{
buflen = strlen (libbuf);
buf = xrealloc (buf, libdir_maxlen + buflen + 2);
}
for (dp = dirs; *dp != 0; ++dp)
{
sprintf (buf, "%s/%s", *dp, libbuf);
mtime = name_mtime (buf);
if (mtime != (FILE_TIMESTAMP) -1)
{
*lib = xstrdup (buf);
if (mtime_ptr != 0)
*mtime_ptr = mtime;
return 1;
}
}
} }
free (buf);
return 0; return 0;
} }

View File

@@ -18,18 +18,19 @@ 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, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, 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 +43,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 +110,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 +145,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;
@@ -126,7 +158,7 @@ start_remote_job (argv, envp, stdin_fd, is_remote, id_ptr, used_stdin)
retsock = Rpc_UdpCreate (True, 0); retsock = Rpc_UdpCreate (True, 0);
if (retsock < 0) if (retsock < 0)
{ {
error ("exporting: Couldn't create return socket."); error (NILF, "exporting: Couldn't create return socket.");
return 1; return 1;
} }
@@ -150,8 +182,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 +196,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 (NILF, "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 (NILF, "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 (NILF, "*** 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 +262,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;
} }

View File

@@ -14,7 +14,8 @@ 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, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "make.h" #include "make.h"
#include "filedef.h" #include "filedef.h"
@@ -41,7 +42,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;
} }

189
rule.c
View File

@@ -1,5 +1,5 @@
/* Pattern and suffix rule internals for GNU Make. /* Pattern and suffix rule internals for GNU Make.
Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993 Free Software Foundation, Inc. Copyright (C) 1988,89,90,91,92,93, 1998 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
@@ -14,7 +14,8 @@ 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, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "make.h" #include "make.h"
#include "dep.h" #include "dep.h"
@@ -50,6 +51,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 +95,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 +166,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);
} }
@@ -325,27 +334,29 @@ new_pattern_rule (rule, override)
if (!streq (dep_name (d), dep_name (d2))) if (!streq (dep_name (d), dep_name (d2)))
break; break;
if (d == 0 && d2 == 0) if (d == 0 && d2 == 0)
/* All the dependencies matched. */ {
if (override) /* All the dependencies matched. */
{ if (override)
/* Remove the old rule. */ {
freerule (r, lastrule); /* Remove the old rule. */
/* Install the new one. */ freerule (r, lastrule);
if (pattern_rules == 0) /* Install the new one. */
pattern_rules = rule; if (pattern_rules == 0)
else pattern_rules = rule;
last_pattern_rule->next = rule; else
last_pattern_rule = rule; last_pattern_rule->next = rule;
last_pattern_rule = rule;
/* We got one. Stop looking. */
goto matched; /* We got one. Stop looking. */
} goto matched;
else }
{ else
/* The old rule stays intact. Destroy the new one. */ {
freerule (rule, (struct rule *) 0); /* The old rule stays intact. Destroy the new one. */
return 0; freerule (rule, (struct rule *) 0);
} return 0;
}
}
} }
} }
@@ -408,11 +419,11 @@ install_pattern_rule (p, terminal)
{ {
r->terminal = terminal; r->terminal = terminal;
r->cmds = (struct commands *) xmalloc (sizeof (struct commands)); r->cmds = (struct commands *) xmalloc (sizeof (struct commands));
r->cmds->filename = 0; r->cmds->fileinfo.filenm = 0;
r->cmds->lineno = 0; r->cmds->fileinfo.lineno = 0;
/* These will all be string literals, but we malloc space for them /* These will all be string literals, but we malloc space for them
anyway because somebody might want to free them later. */ anyway because somebody might want to free them later. */
r->cmds->commands = savestring (p->commands, strlen (p->commands)); r->cmds->commands = xstrdup (p->commands);
r->cmds->command_lines = 0; r->cmds->command_lines = 0;
} }
} }
@@ -428,10 +439,23 @@ freerule (rule, lastrule)
{ {
struct rule *next = rule->next; struct rule *next = rule->next;
register unsigned int i; register unsigned int i;
register struct dep *dep;
for (i = 0; rule->targets[i] != 0; ++i) for (i = 0; rule->targets[i] != 0; ++i)
free (rule->targets[i]); free (rule->targets[i]);
dep = rule->deps;
while (dep)
{
struct dep *t;
t = dep->next;
/* We might leak dep->name here, but I'm not sure how to fix this: I
think that pointer might be shared (e.g., in the file hash?) */
free ((char *) dep);
dep = t;
}
free ((char *) rule->targets); free ((char *) rule->targets);
free ((char *) rule->suffixes); free ((char *) rule->suffixes);
free ((char *) rule->lens); free ((char *) rule->lens);
@@ -519,6 +543,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 && !strneq (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. */
@@ -568,10 +664,10 @@ print_rule_data_base ()
} }
if (rules == 0) if (rules == 0)
puts ("\n# No implicit rules."); puts (_("\n# No implicit rules."));
else else
{ {
printf ("\n# %u implicit rules, %u", rules, terminal); printf (_("\n# %u implicit rules, %u"), rules, terminal);
#ifndef NO_FLOAT #ifndef NO_FLOAT
printf (" (%.1f%%)", (double) terminal / (double) rules * 100.0); printf (" (%.1f%%)", (double) terminal / (double) rules * 100.0);
#else #else
@@ -580,10 +676,37 @@ print_rule_data_base ()
printf (" (%d.%d%%)", f/10, f%10); printf (" (%d.%d%%)", f/10, f%10);
} }
#endif #endif
puts (" terminal."); puts (_(" terminal."));
} }
if (num_pattern_rules != rules) if (num_pattern_rules != rules)
fatal ("BUG: num_pattern_rules wrong! %u != %u", {
num_pattern_rules, rules); /* This can happen if a fatal error was detected while reading the
makefiles and thus count_implicit_rule_limits wasn't called yet. */
if (num_pattern_rules != 0)
fatal (NILF, _("BUG: num_pattern_rules wrong! %u != %u"),
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);
}
}
} }

21
rule.h
View File

@@ -14,7 +14,8 @@ 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, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* Structure used for pattern rules. */ /* Structure used for pattern rules. */
@@ -30,6 +31,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 +61,12 @@ 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));
extern void count_implicit_rule_limits PARAMS ((void));
extern void convert_to_pattern PARAMS ((void));
extern void create_pattern_rule PARAMS ((char **targets,
char **target_percents, int terminal,
struct dep *deps,
struct commands *commands,
int override));

108
signame.c
View File

@@ -17,9 +17,7 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */ Boston, MA 02111-1307, USA. */
#ifdef HAVE_CONFIG_H #include "make.h"
#include <config.h>
#endif
#include <stdio.h> #include <stdio.h>
#include <sys/types.h> /* Some systems need this for <signal.h>. */ #include <sys/types.h> /* Some systems need this for <signal.h>. */
@@ -56,7 +54,7 @@
/* There is too much variation in Sys V signal numbers and names, so /* There is too much variation in Sys V signal numbers and names, so
we must initialize them at runtime. */ we must initialize them at runtime. */
static const char undoc[] = "unknown signal"; static const char *undoc;
const char *sys_siglist[NSIG]; const char *sys_siglist[NSIG];
@@ -70,12 +68,14 @@ extern char *sys_siglist[];
/* Table of abbreviations for signals. Note: A given number can /* Table of abbreviations for signals. Note: A given number can
appear more than once with different abbreviations. */ appear more than once with different abbreviations. */
#define SIG_TABLE_SIZE (NSIG*2)
typedef struct typedef struct
{ {
int number; int number;
const char *abbrev; const char *abbrev;
} num_abbrev; } num_abbrev;
static num_abbrev sig_table[NSIG*2]; static num_abbrev sig_table[SIG_TABLE_SIZE];
/* Number of elements of sig_table used. */ /* Number of elements of sig_table used. */
static int sig_table_nelts = 0; static int sig_table_nelts = 0;
@@ -88,10 +88,18 @@ init_sig (number, abbrev, name)
const char *name; const char *name;
{ {
#ifndef HAVE_SYS_SIGLIST #ifndef HAVE_SYS_SIGLIST
sys_siglist[number] = name; /* If this value is ever greater than NSIG it seems like it'd be a bug in
the system headers, but... better safe than sorry. We know, for
example, that this isn't always true on VMS. */
if (number >= 0 && number < NSIG)
sys_siglist[number] = name;
#endif #endif
sig_table[sig_table_nelts].number = number; if (sig_table_nelts < SIG_TABLE_SIZE)
sig_table[sig_table_nelts++].abbrev = abbrev; {
sig_table[sig_table_nelts].number = number;
sig_table[sig_table_nelts++].abbrev = abbrev;
}
} }
void void
@@ -99,6 +107,10 @@ signame_init ()
{ {
#ifndef HAVE_SYS_SIGLIST #ifndef HAVE_SYS_SIGLIST
int i; int i;
char *u = _("unknown signal");
undoc = xstrdup(u);
/* Initialize signal names. */ /* Initialize signal names. */
for (i = 0; i < NSIG; i++) for (i = 0; i < NSIG; i++)
sys_siglist[i] = undoc; sys_siglist[i] = undoc;
@@ -106,135 +118,135 @@ signame_init ()
/* Initialize signal names. */ /* Initialize signal names. */
#if defined (SIGHUP) #if defined (SIGHUP)
init_sig (SIGHUP, "HUP", "Hangup"); init_sig (SIGHUP, "HUP", _("Hangup"));
#endif #endif
#if defined (SIGINT) #if defined (SIGINT)
init_sig (SIGINT, "INT", "Interrupt"); init_sig (SIGINT, "INT", _("Interrupt"));
#endif #endif
#if defined (SIGQUIT) #if defined (SIGQUIT)
init_sig (SIGQUIT, "QUIT", "Quit"); init_sig (SIGQUIT, "QUIT", _("Quit"));
#endif #endif
#if defined (SIGILL) #if defined (SIGILL)
init_sig (SIGILL, "ILL", "Illegal Instruction"); init_sig (SIGILL, "ILL", _("Illegal Instruction"));
#endif #endif
#if defined (SIGTRAP) #if defined (SIGTRAP)
init_sig (SIGTRAP, "TRAP", "Trace/breakpoint trap"); init_sig (SIGTRAP, "TRAP", _("Trace/breakpoint trap"));
#endif #endif
/* If SIGIOT == SIGABRT, we want to print it as SIGABRT because /* If SIGIOT == SIGABRT, we want to print it as SIGABRT because
SIGABRT is in ANSI and POSIX.1 and SIGIOT isn't. */ SIGABRT is in ANSI and POSIX.1 and SIGIOT isn't. */
#if defined (SIGABRT) #if defined (SIGABRT)
init_sig (SIGABRT, "ABRT", "Aborted"); init_sig (SIGABRT, "ABRT", _("Aborted"));
#endif #endif
#if defined (SIGIOT) #if defined (SIGIOT)
init_sig (SIGIOT, "IOT", "IOT trap"); init_sig (SIGIOT, "IOT", _("IOT trap"));
#endif #endif
#if defined (SIGEMT) #if defined (SIGEMT)
init_sig (SIGEMT, "EMT", "EMT trap"); init_sig (SIGEMT, "EMT", _("EMT trap"));
#endif #endif
#if defined (SIGFPE) #if defined (SIGFPE)
init_sig (SIGFPE, "FPE", "Floating point exception"); init_sig (SIGFPE, "FPE", _("Floating point exception"));
#endif #endif
#if defined (SIGKILL) #if defined (SIGKILL)
init_sig (SIGKILL, "KILL", "Killed"); init_sig (SIGKILL, "KILL", _("Killed"));
#endif #endif
#if defined (SIGBUS) #if defined (SIGBUS)
init_sig (SIGBUS, "BUS", "Bus error"); init_sig (SIGBUS, "BUS", _("Bus error"));
#endif #endif
#if defined (SIGSEGV) #if defined (SIGSEGV)
init_sig (SIGSEGV, "SEGV", "Segmentation fault"); init_sig (SIGSEGV, "SEGV", _("Segmentation fault"));
#endif #endif
#if defined (SIGSYS) #if defined (SIGSYS)
init_sig (SIGSYS, "SYS", "Bad system call"); init_sig (SIGSYS, "SYS", _("Bad system call"));
#endif #endif
#if defined (SIGPIPE) #if defined (SIGPIPE)
init_sig (SIGPIPE, "PIPE", "Broken pipe"); init_sig (SIGPIPE, "PIPE", _("Broken pipe"));
#endif #endif
#if defined (SIGALRM) #if defined (SIGALRM)
init_sig (SIGALRM, "ALRM", "Alarm clock"); init_sig (SIGALRM, "ALRM", _("Alarm clock"));
#endif #endif
#if defined (SIGTERM) #if defined (SIGTERM)
init_sig (SIGTERM, "TERM", "Terminated"); init_sig (SIGTERM, "TERM", _("Terminated"));
#endif #endif
#if defined (SIGUSR1) #if defined (SIGUSR1)
init_sig (SIGUSR1, "USR1", "User defined signal 1"); init_sig (SIGUSR1, "USR1", _("User defined signal 1"));
#endif #endif
#if defined (SIGUSR2) #if defined (SIGUSR2)
init_sig (SIGUSR2, "USR2", "User defined signal 2"); init_sig (SIGUSR2, "USR2", _("User defined signal 2"));
#endif #endif
/* If SIGCLD == SIGCHLD, we want to print it as SIGCHLD because that /* If SIGCLD == SIGCHLD, we want to print it as SIGCHLD because that
is what is in POSIX.1. */ is what is in POSIX.1. */
#if defined (SIGCHLD) #if defined (SIGCHLD)
init_sig (SIGCHLD, "CHLD", "Child exited"); init_sig (SIGCHLD, "CHLD", _("Child exited"));
#endif #endif
#if defined (SIGCLD) #if defined (SIGCLD)
init_sig (SIGCLD, "CLD", "Child exited"); init_sig (SIGCLD, "CLD", _("Child exited"));
#endif #endif
#if defined (SIGPWR) #if defined (SIGPWR)
init_sig (SIGPWR, "PWR", "Power failure"); init_sig (SIGPWR, "PWR", _("Power failure"));
#endif #endif
#if defined (SIGTSTP) #if defined (SIGTSTP)
init_sig (SIGTSTP, "TSTP", "Stopped"); init_sig (SIGTSTP, "TSTP", _("Stopped"));
#endif #endif
#if defined (SIGTTIN) #if defined (SIGTTIN)
init_sig (SIGTTIN, "TTIN", "Stopped (tty input)"); init_sig (SIGTTIN, "TTIN", _("Stopped (tty input)"));
#endif #endif
#if defined (SIGTTOU) #if defined (SIGTTOU)
init_sig (SIGTTOU, "TTOU", "Stopped (tty output)"); init_sig (SIGTTOU, "TTOU", _("Stopped (tty output)"));
#endif #endif
#if defined (SIGSTOP) #if defined (SIGSTOP)
init_sig (SIGSTOP, "STOP", "Stopped (signal)"); init_sig (SIGSTOP, "STOP", _("Stopped (signal)"));
#endif #endif
#if defined (SIGXCPU) #if defined (SIGXCPU)
init_sig (SIGXCPU, "XCPU", "CPU time limit exceeded"); init_sig (SIGXCPU, "XCPU", _("CPU time limit exceeded"));
#endif #endif
#if defined (SIGXFSZ) #if defined (SIGXFSZ)
init_sig (SIGXFSZ, "XFSZ", "File size limit exceeded"); init_sig (SIGXFSZ, "XFSZ", _("File size limit exceeded"));
#endif #endif
#if defined (SIGVTALRM) #if defined (SIGVTALRM)
init_sig (SIGVTALRM, "VTALRM", "Virtual timer expired"); init_sig (SIGVTALRM, "VTALRM", _("Virtual timer expired"));
#endif #endif
#if defined (SIGPROF) #if defined (SIGPROF)
init_sig (SIGPROF, "PROF", "Profiling timer expired"); init_sig (SIGPROF, "PROF", _("Profiling timer expired"));
#endif #endif
#if defined (SIGWINCH) #if defined (SIGWINCH)
/* "Window size changed" might be more accurate, but even if that /* "Window size changed" might be more accurate, but even if that
is all that it means now, perhaps in the future it will be is all that it means now, perhaps in the future it will be
extended to cover other kinds of window changes. */ extended to cover other kinds of window changes. */
init_sig (SIGWINCH, "WINCH", "Window changed"); init_sig (SIGWINCH, "WINCH", _("Window changed"));
#endif #endif
#if defined (SIGCONT) #if defined (SIGCONT)
init_sig (SIGCONT, "CONT", "Continued"); init_sig (SIGCONT, "CONT", _("Continued"));
#endif #endif
#if defined (SIGURG) #if defined (SIGURG)
init_sig (SIGURG, "URG", "Urgent I/O condition"); init_sig (SIGURG, "URG", _("Urgent I/O condition"));
#endif #endif
#if defined (SIGIO) #if defined (SIGIO)
/* "I/O pending" has also been suggested. A disadvantage is /* "I/O pending" has also been suggested. A disadvantage is
that signal only happens when the process has that signal only happens when the process has
asked for it, not everytime I/O is pending. Another disadvantage asked for it, not everytime I/O is pending. Another disadvantage
is the confusion from giving it a different name than under Unix. */ is the confusion from giving it a different name than under Unix. */
init_sig (SIGIO, "IO", "I/O possible"); init_sig (SIGIO, "IO", _("I/O possible"));
#endif #endif
#if defined (SIGWIND) #if defined (SIGWIND)
init_sig (SIGWIND, "WIND", "SIGWIND"); init_sig (SIGWIND, "WIND", _("SIGWIND"));
#endif #endif
#if defined (SIGPHONE) #if defined (SIGPHONE)
init_sig (SIGPHONE, "PHONE", "SIGPHONE"); init_sig (SIGPHONE, "PHONE", _("SIGPHONE"));
#endif #endif
#if defined (SIGPOLL) #if defined (SIGPOLL)
init_sig (SIGPOLL, "POLL", "I/O possible"); init_sig (SIGPOLL, "POLL", _("I/O possible"));
#endif #endif
#if defined (SIGLOST) #if defined (SIGLOST)
init_sig (SIGLOST, "LOST", "Resource lost"); init_sig (SIGLOST, "LOST", _("Resource lost"));
#endif #endif
#if defined (SIGDANGER) #if defined (SIGDANGER)
init_sig (SIGDANGER, "DANGER", "Danger signal"); init_sig (SIGDANGER, "DANGER", _("Danger signal"));
#endif #endif
#if defined (SIGINFO) #if defined (SIGINFO)
init_sig (SIGINFO, "INFO", "Information request"); init_sig (SIGINFO, "INFO", _("Information request"));
#endif #endif
#if defined (SIGNOFP) #if defined (SIGNOFP)
init_sig (SIGNOFP, "NOFP", "Floating point co-processor not available"); init_sig (SIGNOFP, "NOFP", _("Floating point co-processor not available"));
#endif #endif
} }

View File

@@ -1,3 +1,6 @@
cd w32\subproc cd w32\subproc
nmake /f %1 set MAKE=%2
set MAKEFILE=%1
if x%2 == x set MAKE=nmake
%MAKE% /f %MAKEFILE%
cd ..\.. cd ..\..

File diff suppressed because it is too large Load Diff

View File

@@ -14,7 +14,8 @@ 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, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "make.h" #include "make.h"
#include "dep.h" #include "dep.h"
@@ -44,10 +45,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 +57,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;
@@ -78,7 +77,7 @@ define_variable_in_set (name, length, value, origin, recursive, set)
for (v = set->table[hashval]; v != 0; v = v->next) for (v = set->table[hashval]; v != 0; v = v->next)
if (*v->name == *name if (*v->name == *name
&& !strncmp (v->name + 1, name + 1, length - 1) && strneq (v->name + 1, name + 1, length - 1)
&& v->name[length] == '\0') && v->name[length] == '\0')
break; break;
@@ -99,7 +98,7 @@ define_variable_in_set (name, length, value, origin, recursive, set)
{ {
if (v->value != 0) if (v->value != 0)
free (v->value); free (v->value);
v->value = savestring (value, strlen (value)); v->value = xstrdup (value);
v->origin = origin; v->origin = origin;
v->recursive = recursive; v->recursive = recursive;
} }
@@ -110,10 +109,11 @@ define_variable_in_set (name, length, value, origin, recursive, set)
v = (struct variable *) xmalloc (sizeof (struct variable)); v = (struct variable *) xmalloc (sizeof (struct variable));
v->name = savestring (name, length); v->name = savestring (name, length);
v->value = savestring (value, strlen (value)); v->value = xstrdup (value);
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;
@@ -176,7 +176,7 @@ lookup_variable (name, length)
for (v = set->table[hashval]; v != 0; v = v->next) for (v = set->table[hashval]; v != 0; v = v->next)
if (*v->name == *name if (*v->name == *name
&& !strncmp (v->name + 1, name + 1, length - 1) && strneq (v->name + 1, name + 1, length - 1)
&& v->name[length] == 0) && v->name[length] == 0)
return v; return v;
} }
@@ -184,6 +184,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
&& strneq (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. */
@@ -238,6 +266,8 @@ pop_variable_scope ()
next = v->next; next = v->next;
free (v->name); free (v->name);
if (v->value)
free (v->value);
free ((char *) v); free ((char *) v);
} }
} }
@@ -245,10 +275,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 +291,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. */
@@ -409,7 +446,7 @@ define_automatic_variables ()
{ {
free (v->value); free (v->value);
v->origin = o_file; v->origin = o_file;
v->value = savestring (default_shell, strlen (default_shell)); v->value = xstrdup (default_shell);
} }
#endif #endif
@@ -506,6 +543,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:
@@ -524,15 +574,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)
@@ -540,9 +591,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;
@@ -565,6 +629,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. */
@@ -607,19 +672,15 @@ 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 (flocp, line, origin)
char *filename; const struct floc *flocp;
unsigned int lineno;
char *line; char *line;
enum variable_origin origin; enum variable_origin origin;
{ {
@@ -627,8 +688,9 @@ 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,
char *name, *expanded_name, *value; f_simple, f_recursive, f_append, f_conditional } flavor = f_bogus;
char *name, *expanded_name, *value, *alloc_value=NULL;
struct variable *v; struct variable *v;
while (1) while (1)
@@ -639,14 +701,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
@@ -655,9 +717,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
@@ -700,31 +768,39 @@ 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')
{ fatal (flocp, _("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. */ We have to allocate memory since otherwise it'll clobber the
value = variable_expand (p); variable buffer, and we may still need that if we're looking at a
target-specific variable. */
value = alloc_value = allocated_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;
}
flavor = f_recursive;
/* 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));
@@ -733,7 +809,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
{ {
@@ -744,12 +820,14 @@ 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
when it was set; and from the expanded new value. */ when it was set; and from the expanded new value. Allocate
p = variable_expand (p); memory for the expansion as we may still need the rest of the
buffer if we're looking at a target-specific variable. */
p = alloc_value = allocated_variable_expand (p);
oldlen = strlen (v->value); oldlen = strlen (v->value);
newlen = strlen (p); newlen = strlen (p);
@@ -774,7 +852,7 @@ try_variable_definition (filename, lineno, line, origin)
you have bash.exe installed as d:/unix/bash.exe, and d:/unix is on 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 your $PATH, then SHELL=/usr/local/bin/bash will have the effect of
defining SHELL to be "d:/unix/bash.exe". */ defining SHELL to be "d:/unix/bash.exe". */
if (origin == o_file if ((origin == o_file || origin == o_override)
&& strcmp (expanded_name, "SHELL") == 0) && strcmp (expanded_name, "SHELL") == 0)
{ {
char shellpath[PATH_MAX]; char shellpath[PATH_MAX];
@@ -791,7 +869,7 @@ try_variable_definition (filename, lineno, line, origin)
*p = '/'; *p = '/';
} }
v = define_variable (expanded_name, strlen (expanded_name), v = define_variable (expanded_name, strlen (expanded_name),
shellpath, origin, flavor == recursive); shellpath, origin, flavor == f_recursive);
} }
else else
{ {
@@ -831,7 +909,7 @@ try_variable_definition (filename, lineno, line, origin)
*p = '/'; *p = '/';
} }
v = define_variable (expanded_name, strlen (expanded_name), v = define_variable (expanded_name, strlen (expanded_name),
shellpath, origin, flavor == recursive); shellpath, origin, flavor == f_recursive);
} }
else else
v = lookup_variable (expanded_name, strlen (expanded_name)); v = lookup_variable (expanded_name, strlen (expanded_name));
@@ -841,10 +919,29 @@ try_variable_definition (filename, lineno, line, origin)
} }
else else
#endif /* __MSDOS__ */ #endif /* __MSDOS__ */
#ifdef WINDOWS32
if ((origin == o_file || origin == o_override)
&& 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);
if (alloc_value)
free (alloc_value);
free (expanded_name); free (expanded_name);
return v; return v;
@@ -857,7 +954,7 @@ print_variable (v, prefix)
register struct variable *v; register struct variable *v;
char *prefix; char *prefix;
{ {
char *origin; const char *origin;
switch (v->origin) switch (v->origin)
{ {
@@ -885,7 +982,6 @@ print_variable (v, prefix)
case o_invalid: case o_invalid:
default: default:
abort (); abort ();
break;
} }
printf ("# %s\n", origin); printf ("# %s\n", origin);
@@ -923,7 +1019,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;
@@ -948,21 +1044,21 @@ print_variable_set (set, prefix)
} }
if (nvariables == 0) if (nvariables == 0)
puts ("# No variables."); puts (_("# No variables."));
else else
{ {
printf ("# %u variables in %u hash buckets.\n", printf (_("# %u variables in %u hash buckets.\n"),
nvariables, set->buckets); nvariables, set->buckets);
#ifndef NO_FLOAT #ifndef NO_FLOAT
printf ("# average of %.1f variables per bucket, \ printf (_("# average of %.1f variables per bucket, \
max %u in one bucket.\n", max %u in one bucket.\n"),
(double) nvariables / (double) set->buckets, (double) nvariables / (double) set->buckets,
per_bucket); per_bucket);
#else #else
{ {
int f = (nvariables * 1000 + 5) / set->buckets; int f = (nvariables * 1000 + 5) / set->buckets;
printf ("# average of %d.%d variables per bucket, \ printf (_("# average of %d.%d variables per bucket, \
max %u in one bucket.\n", max %u in one bucket.\n"),
f/10, f%10, f/10, f%10,
per_bucket); per_bucket);
} }
@@ -976,7 +1072,7 @@ max %u in one bucket.\n",
void void
print_variable_data_base () print_variable_data_base ()
{ {
puts ("\n# Variables\n"); puts (_("\n# Variables\n"));
print_variable_set (&global_variable_set, ""); print_variable_set (&global_variable_set, "");
} }

View File

@@ -14,7 +14,8 @@ 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, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* Codes in a variable definition saying where the definition came from. /* Codes in a variable definition saying where the definition came from.
Increasing numeric values signify less-overridable definitions. */ Increasing numeric values signify less-overridable definitions. */
@@ -43,7 +44,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 +70,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 +95,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 ((const struct floc *flocp, 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));

View File

@@ -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,43 @@ 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); sys$dassgn (DevChan);
if (!(status & 1)) if (!(status & 1))
return -1; return -1;
@@ -206,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 */

159
vmsify.c
View File

@@ -403,7 +403,7 @@ vmsify (name, type)
{ {
if (*(s2-1) == '.') /* ends in '.]' */ if (*(s2-1) == '.') /* ends in '.]' */
{ {
if (strncmp (fptr, "000000", 6) != 0) if (!strneq (fptr, "000000", 6))
rooted = 0; rooted = 0;
} }
else else
@@ -661,7 +661,7 @@ vmsify (name, type)
nstate = N_OPEN; nstate = N_OPEN;
break; break;
} }
} }
} }
} }
else else
@@ -727,48 +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)
{ {
nstate = N_OPEN; state = 9;
while (s > vptr)
{
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;
@@ -782,40 +755,92 @@ 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;
} }
} }
while (state > 0); while (state > 0);
} }

29
vpath.c
View File

@@ -14,7 +14,8 @@ 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, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "make.h" #include "make.h"
#include "filedef.h" #include "filedef.h"
@@ -48,7 +49,7 @@ static struct vpath *general_vpath;
static struct vpath *gpaths; 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, FILE_TIMESTAMP *mtime_ptr));
/* Reverse the chain of selective VPATH lists so they /* Reverse the chain of selective VPATH lists so they
will be searched in the order given in the makefiles will be searched in the order given in the makefiles
@@ -164,11 +165,11 @@ 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)
{ {
pattern = savestring (pattern, strlen (pattern)); pattern = xstrdup (pattern);
percent = find_percent (pattern); percent = find_percent (pattern);
} }
@@ -323,7 +324,7 @@ gpath_search (file, len)
if (gpaths && (len <= gpaths->maxlen)) if (gpaths && (len <= gpaths->maxlen))
for (gp = gpaths->searchpath; *gp != NULL; ++gp) for (gp = gpaths->searchpath; *gp != NULL; ++gp)
if (!strncmp(*gp, file, len) && (*gp)[len] == '\0') if (strneq (*gp, file, len) && (*gp)[len] == '\0')
return 1; return 1;
return 0; return 0;
@@ -338,7 +339,7 @@ gpath_search (file, len)
int int
vpath_search (file, mtime_ptr) vpath_search (file, mtime_ptr)
char **file; char **file;
time_t *mtime_ptr; FILE_TIMESTAMP *mtime_ptr;
{ {
register struct vpath *v; register struct vpath *v;
@@ -376,7 +377,7 @@ static int
selective_vpath_search (path, file, mtime_ptr) selective_vpath_search (path, file, mtime_ptr)
struct vpath *path; struct vpath *path;
char **file; char **file;
time_t *mtime_ptr; FILE_TIMESTAMP *mtime_ptr;
{ {
int not_target; int not_target;
char *name, *n; char *name, *n;
@@ -524,7 +525,9 @@ selective_vpath_search (path, file, mtime_ptr)
/* Store the modtime into *MTIME_PTR for the caller. /* Store the modtime into *MTIME_PTR for the caller.
If we have had no need to stat the file here, If we have had no need to stat the file here,
we record a zero modtime to indicate this. */ we record a zero modtime to indicate this. */
*mtime_ptr = exists_in_cache ? st.st_mtime : (time_t) 0; *mtime_ptr = (exists_in_cache
? FILE_TIMESTAMP_STAT_MODTIME (st)
: (FILE_TIMESTAMP) 0);
free (name); free (name);
return 1; return 1;
@@ -546,7 +549,7 @@ print_vpath_data_base ()
register unsigned int nvpaths; register unsigned int nvpaths;
register struct vpath *v; register struct vpath *v;
puts ("\n# VPATH Search Paths\n"); puts (_("\n# VPATH Search Paths\n"));
nvpaths = 0; nvpaths = 0;
for (v = vpaths; v != 0; v = v->next) for (v = vpaths; v != 0; v = v->next)
@@ -563,18 +566,18 @@ print_vpath_data_base ()
} }
if (vpaths == 0) if (vpaths == 0)
puts ("# No `vpath' search paths."); puts (_("# No `vpath' search paths."));
else else
printf ("\n# %u `vpath' search paths.\n", nvpaths); printf (_("\n# %u `vpath' search paths.\n"), nvpaths);
if (general_vpath == 0) if (general_vpath == 0)
puts ("\n# No general (`VPATH' variable) search path."); puts (_("\n# No general (`VPATH' variable) search path."));
else else
{ {
register char **path = general_vpath->searchpath; register char **path = general_vpath->searchpath;
register unsigned int i; register unsigned int i;
fputs ("\n# General (`VPATH' variable) search path:\n# ", stdout); fputs (_("\n# General (`VPATH' variable) search path:\n# "), stdout);
for (i = 0; path[i] != 0; ++i) for (i = 0; path[i] != 0; ++i)
printf ("%s%c", path[i], printf ("%s%c", path[i],

View File

@@ -1,59 +1,60 @@
# 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.bat' instead. # `build.bat' instead.
# #
# Copyright (C) 1988,89,91,92,93,94,95,96,97 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
# 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.
# #
# 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.
# #
# NMakefile for GNU Make (subproc library) # NMakefile for GNU Make (subproc library)
# #
LIB = lib LIB = lib
CC = cl CC = cl
OUTDIR=. OUTDIR=.
MAKEFILE=NMakefile MAKEFILE=NMakefile
CFLAGS_any = /nologo /MT /W3 /GX /Z7 /YX /D WIN32 /D WINDOWS32 /D _WINDOWS -I. -I../include CFLAGS_any = /nologo /MT /W3 /GX /Z7 /YX /D WIN32 /D WINDOWS32 /D _WINDOWS -I. -I../include -I../../
CFLAGS_debug = $(CFLAGS_any) /Od /D _DEBUG /FR.\WinDebug\ /Fp.\WinDebug\subproc.pch /Fo.\WinDebug/ CFLAGS_debug = $(CFLAGS_any) /Od /D _DEBUG /FR.\WinDebug\ /Fp.\WinDebug\subproc.pch /Fo.\WinDebug/
CFLAGS_release = $(CFLAGS_any) /O2 /FR.\WinRel\ /Fp.\WinRel\subproc.pch /Fo.\WinRel/ CFLAGS_release = $(CFLAGS_any) /O2 /FR.\WinRel\ /Fp.\WinRel\subproc.pch /Fo.\WinRel/
all: Release Debug all: Release Debug
Release: Release:
$(MAKE) /f $(MAKEFILE) OUTDIR=WinRel CFLAGS="$(CFLAGS_release)" WinRel/subproc.lib $(MAKE) /f $(MAKEFILE) OUTDIR=WinRel CFLAGS="$(CFLAGS_release)" WinRel/subproc.lib
Debug: Debug:
$(MAKE) /f $(MAKEFILE) OUTDIR=WinDebug CFLAGS="$(CFLAGS_debug)" WinDebug/subproc.lib $(MAKE) /f $(MAKEFILE) OUTDIR=WinDebug CFLAGS="$(CFLAGS_debug)" WinDebug/subproc.lib
clean: clean:
rmdir /s /q WinRel WinDebug rmdir /s /q WinRel WinDebug
erase *.pdb
$(OUTDIR):
if not exist .\$@\nul mkdir .\$@ $(OUTDIR):
if not exist .\$@\nul mkdir .\$@
OBJS = $(OUTDIR)/misc.obj $(OUTDIR)/w32err.obj $(OUTDIR)/sub_proc.obj
OBJS = $(OUTDIR)/misc.obj $(OUTDIR)/w32err.obj $(OUTDIR)/sub_proc.obj
$(OUTDIR)/subproc.lib: $(OUTDIR) $(OBJS)
$(LIB) -out:$@ @<< $(OUTDIR)/subproc.lib: $(OUTDIR) $(OBJS)
$(OBJS) $(LIB) -out:$@ @<<
<< $(OBJS)
<<
.c{$(OUTDIR)}.obj:
$(CC) $(CFLAGS) /c $< .c{$(OUTDIR)}.obj:
$(CC) $(CFLAGS) /c $<
$(OUTDIR)/misc.obj: misc.c proc.h
$(OUTDIR)/sub_proc.obj: sub_proc.c ../include/sub_proc.h ../include/w32err.h proc.h $(OUTDIR)/misc.obj: misc.c proc.h
$(OUTDIR)/w32err.obj: w32err.c ../include/w32err.h $(OUTDIR)/sub_proc.obj: sub_proc.c ../include/sub_proc.h ../include/w32err.h proc.h
$(OUTDIR)/w32err.obj: w32err.c ../include/w32err.h

View File

@@ -1,10 +1,10 @@
if not exist .\WinDebug\nul mkdir .\WinDebug if not exist .\WinDebug\nul mkdir .\WinDebug
cl.exe /nologo /MT /W3 /GX /Z7 /YX /Od /I .. /I . /I ../include /D WIN32 /D WINDOWS32 /D _DEBUG /D _WINDOWS /FR.\WinDebug/ /Fp.\WinDebug/subproc.pch /Fo.\WinDebug/ /c misc.c cl.exe /nologo /MT /W3 /GX /Z7 /YX /Od /I .. /I . /I ../include /D WIN32 /D WINDOWS32 /D _DEBUG /D _WINDOWS /FR.\WinDebug/ /Fp.\WinDebug/subproc.pch /Fo.\WinDebug/ /c misc.c
cl.exe /nologo /MT /W3 /GX /Z7 /YX /Od /I .. /I . /I ../include /D WIN32 /D WINDOWS32 /D _DEBUG /D _WINDOWS /FR.\WinDebug/ /Fp.\WinDebug/subproc.pch /Fo.\WinDebug/ /c sub_proc.c cl.exe /nologo /MT /W3 /GX /Z7 /YX /Od /I .. /I . /I ../include /I ../.. /D WIN32 /D WINDOWS32 /D _DEBUG /D _WINDOWS /FR.\WinDebug/ /Fp.\WinDebug/subproc.pch /Fo.\WinDebug/ /c sub_proc.c
cl.exe /nologo /MT /W3 /GX /Z7 /YX /Od /I .. /I . /I ../include /D WIN32 /D WINDOWS32 /D _DEBUG /D _WINDOWS /FR.\WinDebug/ /Fp.\WinDebug/subproc.pch /Fo.\WinDebug/ /c w32err.c cl.exe /nologo /MT /W3 /GX /Z7 /YX /Od /I .. /I . /I ../include /D WIN32 /D WINDOWS32 /D _DEBUG /D _WINDOWS /FR.\WinDebug/ /Fp.\WinDebug/subproc.pch /Fo.\WinDebug/ /c w32err.c
lib.exe /NOLOGO /OUT:.\WinDebug\subproc.lib .\WinDebug/misc.obj .\WinDebug/sub_proc.obj .\WinDebug/w32err.obj lib.exe /NOLOGO /OUT:.\WinDebug\subproc.lib .\WinDebug/misc.obj .\WinDebug/sub_proc.obj .\WinDebug/w32err.obj
if not exist .\WinRel\nul mkdir .\WinRel if not exist .\WinRel\nul mkdir .\WinRel
cl.exe /nologo /MT /W3 /GX /YX /O2 /I ../include /D WIN32 /D WINDOWS32 /D NDEBUG /D _WINDOWS /FR.\WinRel/ /Fp.\WinRel/subproc.pch /Fo.\WinRel/ /c misc.c cl.exe /nologo /MT /W3 /GX /YX /O2 /I ../include /D WIN32 /D WINDOWS32 /D NDEBUG /D _WINDOWS /FR.\WinRel/ /Fp.\WinRel/subproc.pch /Fo.\WinRel/ /c misc.c
cl.exe /nologo /MT /W3 /GX /YX /O2 /I ../include /D WIN32 /D WINDOWS32 /D NDEBUG /D _WINDOWS /FR.\WinRel/ /Fp.\WinRel/subproc.pch /Fo.\WinRel/ /c sub_proc.c cl.exe /nologo /MT /W3 /GX /YX /O2 /I ../include /I ../.. /D WIN32 /D WINDOWS32 /D NDEBUG /D _WINDOWS /FR.\WinRel/ /Fp.\WinRel/subproc.pch /Fo.\WinRel/ /c sub_proc.c
cl.exe /nologo /MT /W3 /GX /YX /O2 /I ../include /D WIN32 /D WINDOWS32 /D NDEBUG /D _WINDOWS /FR.\WinRel/ /Fp.\WinRel/subproc.pch /Fo.\WinRel/ /c w32err.c cl.exe /nologo /MT /W3 /GX /YX /O2 /I ../include /D WIN32 /D WINDOWS32 /D NDEBUG /D _WINDOWS /FR.\WinRel/ /Fp.\WinRel/subproc.pch /Fo.\WinRel/ /c w32err.c
lib.exe /NOLOGO /OUT:.\WinRel\subproc.lib .\WinRel/misc.obj .\WinRel/sub_proc.obj .\WinRel/w32err.obj lib.exe /NOLOGO /OUT:.\WinRel\subproc.lib .\WinRel/misc.obj .\WinRel/sub_proc.obj .\WinRel/w32err.obj

File diff suppressed because it is too large Load Diff