mirror of
https://github.com/mirror/make.git
synced 2026-08-20 00:43:29 +08:00
Compare commits
56 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f9c91ec34d | ||
|
|
f3a974bf32 | ||
|
|
c67266ceac | ||
|
|
4145bcbcda | ||
|
|
c637af71d9 | ||
|
|
a81013175c | ||
|
|
75f879f37f | ||
|
|
e68a27ec7b | ||
|
|
17f2dda0ac | ||
|
|
90f23f1ea6 | ||
|
|
9b0a3d91ea | ||
|
|
95a09e94f7 | ||
|
|
de2a8fc730 | ||
|
|
447c76f601 | ||
|
|
24aec1878b | ||
|
|
2fd5b943d1 | ||
|
|
74fca88bf3 | ||
|
|
5577cdc261 | ||
|
|
b7b83d6398 | ||
|
|
af44f16799 | ||
|
|
1a35bfb45b | ||
|
|
4d5c556f00 | ||
|
|
ce3413f883 | ||
|
|
217ca5d910 | ||
|
|
ebb733c0f9 | ||
|
|
3e26bde6db | ||
|
|
c71200d022 | ||
|
|
281951154b | ||
|
|
829f4fd04b | ||
|
|
f26e413b12 | ||
|
|
dbb8f3e30b | ||
|
|
c828aeaa98 | ||
|
|
3c83c469e4 | ||
|
|
a63f51340b | ||
|
|
45e04a5860 | ||
|
|
6ec7d1881c | ||
|
|
c800367385 | ||
|
|
0d366b6682 | ||
|
|
4121dea6a5 | ||
|
|
b88c1d3a3d | ||
|
|
373dbb43da | ||
|
|
5e9a3e34ac | ||
|
|
860a30ae1e | ||
|
|
e49b2f15c9 | ||
|
|
10fee1c03c | ||
|
|
82f0c5495a | ||
|
|
bf7cc546dd | ||
|
|
27255c5b51 | ||
|
|
b134da5505 | ||
|
|
d0b03e9355 | ||
|
|
5dc4b92b60 | ||
|
|
b3fa4b3c7e | ||
|
|
6fa76a7d15 | ||
|
|
4ff6c62456 | ||
|
|
cbb9e38d10 | ||
|
|
9e79637ec3 |
13
.cvsignore
13
.cvsignore
@@ -11,9 +11,14 @@ makebook*
|
||||
*.dep *.dvi *.toc *.aux *.log
|
||||
*.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
|
||||
README README.DOS README.W32
|
||||
aclocal.m4 config.h.in config.h config.status config.cache configure
|
||||
Makefile.in Makefile
|
||||
build.sh.in build.sh
|
||||
SMakefile NMakefile Makefile.DOS
|
||||
config.ami configh.dos config.h.W32 config.h-vms
|
||||
|
||||
loadavg loadavg.c make
|
||||
|
||||
.deps .dep_segment
|
||||
|
||||
@@ -22,3 +27,5 @@ sun4 i386 i386-netbsd hp300-netbsd hp300 rs6000 sun3 news800 amiga
|
||||
hp700 hp834 mips sol2 i486-linux
|
||||
|
||||
customs
|
||||
|
||||
install-sh mkinstalldirs
|
||||
|
||||
226
ABOUT-NLS
Normal file
226
ABOUT-NLS
Normal file
@@ -0,0 +1,226 @@
|
||||
Notes on the Free Translation Project
|
||||
*************************************
|
||||
|
||||
Free software is going international! The Free Translation Project
|
||||
is a way to get maintainers of free software, translators, and users all
|
||||
together, so that will gradually become able to speak many languages.
|
||||
A few packages already provide translations for their messages.
|
||||
|
||||
If you found this `ABOUT-NLS' file inside a distribution, you may
|
||||
assume that the distributed package does use GNU `gettext' internally,
|
||||
itself available at your nearest GNU archive site. But you do *not*
|
||||
need to install GNU `gettext' prior to configuring, installing or using
|
||||
this package with messages translated.
|
||||
|
||||
Installers will find here some useful hints. These notes also
|
||||
explain how users should proceed for getting the programs to use the
|
||||
available translations. They tell how people wanting to contribute and
|
||||
work at translations should contact the appropriate team.
|
||||
|
||||
When reporting bugs in the `intl/' directory or bugs which may be
|
||||
related to internationalization, you should tell about the version of
|
||||
`gettext' which is used. The information can be found in the
|
||||
`intl/VERSION' file, in internationalized packages.
|
||||
|
||||
One advise in advance
|
||||
=====================
|
||||
|
||||
If you want to exploit the full power of internationalization, you
|
||||
should configure it using
|
||||
|
||||
./configure --with-included-gettext
|
||||
|
||||
to force usage of internationalizing routines provided within this
|
||||
package, despite the existence of internationalizing capabilities in the
|
||||
operating system where this package is being installed. So far, only
|
||||
the `gettext' implementation in the GNU C library version 2 provides as
|
||||
many features (such as locale alias or message inheritance) as the
|
||||
implementation here. It is also not possible to offer this additional
|
||||
functionality on top of a `catgets' implementation. Future versions of
|
||||
GNU `gettext' will very likely convey even more functionality. So it
|
||||
might be a good idea to change to GNU `gettext' as soon as possible.
|
||||
|
||||
So you need not provide this option if you are using GNU libc 2 or
|
||||
you have installed a recent copy of the GNU gettext package with the
|
||||
included `libintl'.
|
||||
|
||||
INSTALL Matters
|
||||
===============
|
||||
|
||||
Some packages are "localizable" when properly installed; the
|
||||
programs they contain can be made to speak your own native language.
|
||||
Most such packages use GNU `gettext'. Other packages have their own
|
||||
ways to internationalization, predating GNU `gettext'.
|
||||
|
||||
By default, this package will be installed to allow translation of
|
||||
messages. It will automatically detect whether the system provides
|
||||
usable `catgets' (if using this is selected by the installer) or
|
||||
`gettext' functions. If neither is available, the GNU `gettext' own
|
||||
library will be used. This library is wholly contained within this
|
||||
package, usually in the `intl/' subdirectory, so prior installation of
|
||||
the GNU `gettext' package is *not* required. Installers may use
|
||||
special options at configuration time for changing the default
|
||||
behaviour. The commands:
|
||||
|
||||
./configure --with-included-gettext
|
||||
./configure --with-catgets
|
||||
./configure --disable-nls
|
||||
|
||||
will respectively bypass any pre-existing `catgets' or `gettext' to use
|
||||
the internationalizing routines provided within this package, enable
|
||||
the use of the `catgets' functions (if found on the locale system), or
|
||||
else, *totally* disable translation of messages.
|
||||
|
||||
When you already have GNU `gettext' installed on your system and run
|
||||
configure without an option for your new package, `configure' will
|
||||
probably detect the previously built and installed `libintl.a' file and
|
||||
will decide to use this. This might be not what is desirable. You
|
||||
should use the more recent version of the GNU `gettext' library. I.e.
|
||||
if the file `intl/VERSION' shows that the library which comes with this
|
||||
package is more recent, you should use
|
||||
|
||||
./configure --with-included-gettext
|
||||
|
||||
to prevent auto-detection.
|
||||
|
||||
By default the configuration process will not test for the `catgets'
|
||||
function and therefore they will not be used. The reasons are already
|
||||
given above: the emulation on top of `catgets' cannot provide all the
|
||||
extensions provided by the GNU `gettext' library. If you nevertheless
|
||||
want to use the `catgets' functions use
|
||||
|
||||
./configure --with-catgets
|
||||
|
||||
to enable the test for `catgets' (this causes no harm if `catgets' is
|
||||
not available on your system). If you really select this option we
|
||||
would like to hear about the reasons because we cannot think of any
|
||||
good one ourself.
|
||||
|
||||
Internationalized packages have usually many `po/LL.po' files, where
|
||||
LL gives an ISO 639 two-letter code identifying the language. Unless
|
||||
translations have been forbidden at `configure' time by using the
|
||||
`--disable-nls' switch, all available translations are installed
|
||||
together with the package. However, the environment variable `LINGUAS'
|
||||
may be set, prior to configuration, to limit the installed set.
|
||||
`LINGUAS' should then contain a space separated list of two-letter
|
||||
codes, stating which languages are allowed.
|
||||
|
||||
Using This Package
|
||||
==================
|
||||
|
||||
As a user, if your language has been installed for this package, you
|
||||
only have to set the `LANG' environment variable to the appropriate
|
||||
ISO 639 `LL' two-letter code prior to using the programs in the
|
||||
package. For example, let's suppose that you speak German. At the
|
||||
shell prompt, merely execute `setenv LANG de' (in `csh'),
|
||||
`export LANG; LANG=de' (in `sh') or `export LANG=de' (in `bash'). This
|
||||
can be done from your `.login' or `.profile' file, once and for all.
|
||||
|
||||
An operating system might already offer message localization for
|
||||
many of its programs, while other programs have been installed locally
|
||||
with the full capabilities of GNU `gettext'. Just using `gettext'
|
||||
extended syntax for `LANG' would break proper localization of already
|
||||
available operating system programs. In this case, users should set
|
||||
both `LANGUAGE' and `LANG' variables in their environment, as programs
|
||||
using GNU `gettext' give preference to `LANGUAGE'. For example, some
|
||||
Swedish users would rather read translations in German than English for
|
||||
when Swedish is not available. This is easily accomplished by setting
|
||||
`LANGUAGE' to `sv:de' while leaving `LANG' to `sv'.
|
||||
|
||||
Translating Teams
|
||||
=================
|
||||
|
||||
For the Free Translation Project to be a success, we need interested
|
||||
people who like their own language and write it well, and who are also
|
||||
able to synergize with other translators speaking the same language.
|
||||
Each translation team has its own mailing list, courtesy of Linux
|
||||
International. You may reach your translation team at the address
|
||||
`LL@li.org', replacing LL by the two-letter ISO 639 code for your
|
||||
language. Language codes are *not* the same as the country codes given
|
||||
in ISO 3166. The following translation teams exist, as of December
|
||||
1997:
|
||||
|
||||
Chinese `zh', Czech `cs', Danish `da', Dutch `nl', English `en',
|
||||
Esperanto `eo', Finnish `fi', French `fr', German `de', Hungarian
|
||||
`hu', Irish `ga', Italian `it', Indonesian `id', Japanese `ja',
|
||||
Korean `ko', Latin `la', Norwegian `no', Persian `fa', Polish
|
||||
`pl', Portuguese `pt', Russian `ru', Slovenian `sl', Spanish `es',
|
||||
Swedish `sv', and Turkish `tr'.
|
||||
|
||||
For example, you may reach the Chinese translation team by writing to
|
||||
`zh@li.org'.
|
||||
|
||||
If you'd like to volunteer to *work* at translating messages, you
|
||||
should become a member of the translating team for your own language.
|
||||
The subscribing address is *not* the same as the list itself, it has
|
||||
`-request' appended. For example, speakers of Swedish can send a
|
||||
message to `sv-request@li.org', having this message body:
|
||||
|
||||
subscribe
|
||||
|
||||
Keep in mind that team members are expected to participate
|
||||
*actively* in translations, or at solving translational difficulties,
|
||||
rather than merely lurking around. If your team does not exist yet and
|
||||
you want to start one, or if you are unsure about what to do or how to
|
||||
get started, please write to `translation@iro.umontreal.ca' to reach the
|
||||
coordinator for all translator teams.
|
||||
|
||||
The English team is special. It works at improving and uniformizing
|
||||
the terminology in use. Proven linguistic skill are praised more than
|
||||
programming skill, here.
|
||||
|
||||
Available Packages
|
||||
==================
|
||||
|
||||
Languages are not equally supported in all packages. The following
|
||||
matrix shows the current state of internationalization, as of December
|
||||
1997. The matrix shows, in regard of each package, for which languages
|
||||
PO files have been submitted to translation coordination.
|
||||
|
||||
Ready PO files cs da de en es fi fr it ja ko nl no pl pt ru sl sv
|
||||
.----------------------------------------------------.
|
||||
bash | [] [] [] | 3
|
||||
bison | [] [] [] | 3
|
||||
clisp | [] [] [] [] | 4
|
||||
cpio | [] [] [] [] [] [] | 6
|
||||
diffutils | [] [] [] [] [] | 5
|
||||
enscript | [] [] [] [] [] [] | 6
|
||||
fileutils | [] [] [] [] [] [] [] [] [] [] | 10
|
||||
findutils | [] [] [] [] [] [] [] [] [] | 9
|
||||
flex | [] [] [] [] | 4
|
||||
gcal | [] [] [] [] [] | 5
|
||||
gettext | [] [] [] [] [] [] [] [] [] [] [] | 12
|
||||
grep | [] [] [] [] [] [] [] [] [] [] | 10
|
||||
hello | [] [] [] [] [] [] [] [] [] [] [] | 11
|
||||
id-utils | [] [] [] | 3
|
||||
indent | [] [] [] [] [] | 5
|
||||
libc | [] [] [] [] [] [] [] | 7
|
||||
m4 | [] [] [] [] [] [] | 6
|
||||
make | [] [] [] [] [] [] | 6
|
||||
music | [] [] | 2
|
||||
ptx | [] [] [] [] [] [] [] [] | 8
|
||||
recode | [] [] [] [] [] [] [] [] [] | 9
|
||||
sh-utils | [] [] [] [] [] [] [] [] | 8
|
||||
sharutils | [] [] [] [] [] [] | 6
|
||||
tar | [] [] [] [] [] [] [] [] [] [] [] | 11
|
||||
texinfo | [] [] [] | 3
|
||||
textutils | [] [] [] [] [] [] [] [] [] | 9
|
||||
wdiff | [] [] [] [] [] [] [] [] | 8
|
||||
`----------------------------------------------------'
|
||||
17 languages cs da de en es fi fr it ja ko nl no pl pt ru sl sv
|
||||
27 packages 6 4 25 1 18 1 26 2 1 12 20 9 19 7 4 7 17 179
|
||||
|
||||
Some counters in the preceding matrix are higher than the number of
|
||||
visible blocks let us expect. This is because a few extra PO files are
|
||||
used for implementing regional variants of languages, or language
|
||||
dialects.
|
||||
|
||||
For a PO file in the matrix above to be effective, the package to
|
||||
which it applies should also have been internationalized and
|
||||
distributed as such by its maintainer. There might be an observable
|
||||
lag between the mere existence a PO file and its wide availability in a
|
||||
distribution.
|
||||
|
||||
If December 1997 seems to be old, you may fetch a more recent copy
|
||||
of this `ABOUT-NLS' file on most GNU archive sites.
|
||||
|
||||
887
ChangeLog
887
ChangeLog
@@ -1,3 +1,880 @@
|
||||
2000-04-04 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* Version 3.79 released.
|
||||
|
||||
* make.texinfo: Update documentation with new features for 3.79.
|
||||
|
||||
* function.c (func_wordlist): Don't re-order arguments to
|
||||
wordlist.
|
||||
|
||||
2000-04-03 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* remake.c (f_mtime): Archive member timestamps are stored as
|
||||
time_t, without nanoseconds. But, f_mtime() wants to return
|
||||
nanosecond info on those systems that support it. So, convert the
|
||||
return value of ar_member_date() into a FILE_TIMESTAMP, using 0 as
|
||||
the nanoseconds.
|
||||
|
||||
2000-03-28 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* Version 3.78.92 released.
|
||||
|
||||
* build.template: Updates for gettext support; some bugs fixed.
|
||||
|
||||
2000-03-27 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* config.guess, config.sub: Updated from config CVS archive at
|
||||
:pserver:anoncvs@subversions.gnu.org:/home/cvs as of today.
|
||||
|
||||
* read.c (record_files): Check if expanding a static pattern
|
||||
rule's prerequisite pattern leaves an empty string as the
|
||||
prerequisite, and issue an error if so. Fixes PR/1670.
|
||||
(read_makefile): Store the starting linenumber for a rule in
|
||||
TGTS_STARTED.
|
||||
(record_waiting_files): Use the TGTS_STARTED value for the file
|
||||
location passed to record_file() instead of the current
|
||||
linenumber, so error messages list the line where the target was
|
||||
defined instead of the line after the end of the rule definition.
|
||||
|
||||
* remake.c (start_updating, finish_updating, is_updating): Fix
|
||||
PR/1671; circular dependencies in double-colon rules are not
|
||||
diagnosed. These macros set the updating flag in the root
|
||||
double-colon file instead of the current one, if it's part of a
|
||||
double-colon list. This solution provided by Tim Magill
|
||||
<magill@gate.net>; I just changed the macro names :).
|
||||
(update_file_1): Call them.
|
||||
(check_dep): Call them.
|
||||
|
||||
The change to not automatically evaluate the $(call ...)
|
||||
function's arguments breaks recursive use of call. Although using
|
||||
$(if ...) and $(foreach ...) in $(call ...) macros is important,
|
||||
the error conditions generated are simply to obscure for me to
|
||||
feel comfortable with. If a method is devised to get both
|
||||
working, we'll revisit. For now, remove this change.
|
||||
|
||||
* function.c (function_table): Turn on the expand bit for func_call.
|
||||
(func_call): Don't expand arguments for builtin functions; that
|
||||
will have already been done.
|
||||
|
||||
2000-03-26 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* file.c (remove_intermediates): Never remove targets explicitly
|
||||
requested on the command-line by checking the cmd_target flag.
|
||||
Fixed PR/1669.
|
||||
|
||||
2000-03-23 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* filedef.h (FILE_TIMESTAMP_STAT_MODTIME): Use st_mtime instead of
|
||||
st_mtim.tv_sec; the latter doesn't work on Unixware.
|
||||
|
||||
2000-03-18 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* file.c (file_hash_enter): If we're trying to change a file into
|
||||
itself, just return. We used to assert this wasn't true, but
|
||||
someone came up with a weird case involving archives. After
|
||||
playing with it for a while I decided it was OK to ignore it.
|
||||
|
||||
* default.c: Define COFLAGS to empty to avoid spurious warnings.
|
||||
|
||||
* filedef.h: Change #if ST_MTIM_NSEC to #ifdef; this is a macro
|
||||
containing the name of the nsec field, not true/false.
|
||||
* make.h: Ditto.
|
||||
Reported by Marco Franzen <Marco.Franzen@Thyron.com>.
|
||||
|
||||
2000-03-08 Tim Magill <magill@gate.net>
|
||||
|
||||
* remake.c (update_file): Return the exit status of the pruned
|
||||
file when pruning, not just 0. Fixes PR/1634.
|
||||
|
||||
2000-02-24 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* configure.in: Close a minor potential security hole; if you're
|
||||
reading makefiles from stdin (who does that?) you could run into a
|
||||
race condition with the temp file using mktemp() or tmpnam(). Add
|
||||
a check for mkstemp() and fdopen().
|
||||
* main.c (open_tmpfile): New function to open a temporary file.
|
||||
If we have mkstemp() (and fdopen()), use that. If not use
|
||||
mktemp() or tmpnam(). If we have fdopen(), use open() to open the
|
||||
file O_CREAT|O_EXCL. If not, fall back to normal fopen() (insecure).
|
||||
(main): Call it.
|
||||
* job.c (child_execute_job) [VMS]: Call it.
|
||||
|
||||
* variable.c (lookup_variable): If we find a variable which is
|
||||
being expanded, then note it but keep looking through the rest of
|
||||
the set list to see if we can find one that isn't. If we do,
|
||||
return that. If we don't, return the original. Fix for PR/1610.
|
||||
|
||||
While implementing this I realized that it also solves PR/1380 in
|
||||
a much more elegant way. I don't know what I was smoking before.
|
||||
So, remove the hackage surrounding the original fix for that (see
|
||||
below). Change this function back to lookup_variable and remove
|
||||
the extra setlist argument.
|
||||
* variable.h (recursively_expand_setlist): Remove the macro,
|
||||
rename the prototype, and remove the extra setlist argument.
|
||||
(lookup_variable): Ditto.
|
||||
* expand.c (recursively_expand): Rename and remove the extra
|
||||
setlist argument.
|
||||
(reference_variable): Use lookup_variable() again.
|
||||
(allocated_variable_append): Remove the extra setlist argument.
|
||||
|
||||
2000-02-21 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* README.template: A few updates.
|
||||
|
||||
* i18n/de.po: New version from the German translation team.
|
||||
|
||||
2000-02-09 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* Version 3.78.91 released.
|
||||
|
||||
2000-02-07 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* read.c (read_makefile): Reset *p2 to ':', not *colonp. If any
|
||||
filenames contained backslashes the resulting output (without
|
||||
backslashes) will be shorter, so setting *colonp doesn't change
|
||||
the right character. Fix for PR/1586.
|
||||
|
||||
For += target-specific variables we need to remember which
|
||||
variable set we found the variable in, so we can start looking
|
||||
from there in the next iteration (otherwise we might see it again
|
||||
in recursively_expand and fail!). This is turning into a hack; if
|
||||
it gets any worse we'll have to rethink this entire algorithm...
|
||||
implementing expansion of these references separately from the
|
||||
"normal" expansion, say, instead of using the same codepath.
|
||||
Actually, it's already "worse enough" :-/.
|
||||
Fix for PR/1380.
|
||||
|
||||
* variable.h (recursively_expand_setlist): Rename
|
||||
recursively_expand to add a struct variable_set_list argument, and
|
||||
make a macro for recursively_expand.
|
||||
(lookup_variable_setlist): Rename lookup_variable to add a struct
|
||||
variable_set_list argument, and make a macro for lookup_variable.
|
||||
|
||||
* expand.c (recursively_expand_setlist): Take an extra struct
|
||||
variable_set_list argument and pass it to allocated_variable_append().
|
||||
(reference_variable): Use lookup_variable_setlist() and pass the
|
||||
returned variable_set_list to recursively_expand_setlist.
|
||||
(allocated_variable_append): Take an extra setlist argument and
|
||||
use this as the starting place when searching for the appended
|
||||
expansion. If it's null, use current_variable_set_list as before.
|
||||
|
||||
* variable.c (lookup_variable_setlist): If the LISTP argument is
|
||||
not nil, set it to the list containing the variable we found.
|
||||
|
||||
2000-02-04 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* variable.c (print_variable): Write out filename/linenumber
|
||||
information for the variable definition if present.
|
||||
(define_variable_in_set): Store filename information if provided.
|
||||
(define_variable, define_variable_for_file): Removed.
|
||||
(try_variable_definition): Use define_variable_loc() to keep
|
||||
variable definition location information.
|
||||
* read.c (read_makefile): Keep variable definition location info.
|
||||
(do_define): Ditto.
|
||||
(record_target_var): Ditto.
|
||||
* variable.h (define_variable_in_set): New fileinfo argument.
|
||||
(define_variable, define_variable_loc, define_variable_for_file):
|
||||
Declare new macros.
|
||||
|
||||
Fix PR/1407:
|
||||
|
||||
* filedef.h (struct file): Rename patvar to pat_variables and make
|
||||
it just a variable_set_list; we need our own copy of the pattern
|
||||
variable's variable set list here to avoid overwriting the global
|
||||
one.
|
||||
* variable.c (initialize_file_variables): Move the instantiation
|
||||
of the pat_variables pointer here. Only do the search after we're
|
||||
done reading the makefiles so we don't search too early. If
|
||||
there's a pat_variables value, set up the variables next ptr.
|
||||
* expand.c (variable_expand_for_file): Remove the setup of the
|
||||
pat_variables info; it's done earlier now to ensure the parent's
|
||||
pattern variables are set up correctly as well.
|
||||
|
||||
2000-02-03 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* job.c (sh_chars_dos) [WINDOWS32]: Add "&" as a shell
|
||||
metacharacter for the W32 DOS shell.
|
||||
Reported by Warren Jones <wjones@tc.fluke.com>.
|
||||
|
||||
2000-02-02 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
Fixes for the OpenVMS port from Hartmut Becker <becker@rto.dec.com>
|
||||
|
||||
* config.h-vms [VMS]: Define LOCALEDIR to something; needed for
|
||||
the expansion of bindtextdomain() even though it's a no-op.
|
||||
* vmsfunctions.c (strcmpi): Remove duplicate definition of strcmpi().
|
||||
(readdir): Use DB() instead of testing debug_flag.
|
||||
* dir.c (file_impossible) [VMS]: Search "p" not "name".
|
||||
* job.c [VMS]: Switch from debug_flag to the new DB macro. Add
|
||||
some i18n _() macros (even though VMS doesn't yet support it).
|
||||
|
||||
* function.c (patsubst_expand): Change "len" to not be unsigned to
|
||||
avoid type mismatches.
|
||||
|
||||
* main.c (main): Declare signame_init() if we're going to call it.
|
||||
|
||||
2000-01-29 Eli Zaretskii <eliz@is.elta.co.il>
|
||||
|
||||
* Makefile.DOS.template: Track changes in Makefile.in
|
||||
(install-recursive, uninstall-recursive): Add missing targets.
|
||||
(DESTDIR): Define.
|
||||
(install-binPROGRAMS, uninstall-binPROGRAMS): Use $(DESTDIR).
|
||||
|
||||
* default.c (default_variables) [__MSDOS__]: Define CXX to gpp.
|
||||
|
||||
2000-01-27 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* gettext.c: Some warning cleanups, and a fix for systems which
|
||||
don't define HAVE_ALLOCA (the workaround code was included
|
||||
twice).
|
||||
|
||||
2000-01-26 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* Version 3.78.90 released.
|
||||
|
||||
2000-01-25 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
Change gettext support to use the simplified version in libit 0.7.
|
||||
|
||||
* getopt.c, make.h: Use gettext.h instead of libintl.h.
|
||||
* ABOUT-NLS, gettext.h, gettext.c: New files from libit 0.7.
|
||||
Modified to remove some static declarations which aren't defined.
|
||||
* acconfig.h: Use new gettext #defines.
|
||||
* acinclude.m4: Add fp_WITH_GETTEXT; remove AM_GNU_GETTEXT.
|
||||
* configure.in: Call fp_WITH_GETTEXT instead.
|
||||
* Makefile.am: New gettext stuff. Also force inclusion of glob
|
||||
files for systems which have LIBC glob.
|
||||
|
||||
* i18n/Makefile.am, i18n/.cvsignore: New dir for translation files.
|
||||
* i18n/de.po, i18n/es.po, i18n/fr.po, i18n/ko.po, i18n/nl.po:
|
||||
* i18n/pl.po, i18n/ru.po: Import translations already done for
|
||||
earlier versions of GNU make. Thanks for that work!!
|
||||
|
||||
* po/Makefile.in.in, po/POTFILES.in: Removed.
|
||||
|
||||
2000-01-23 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* main.c (decode_debug_flags): If debug_flag is set, enable all
|
||||
debugging levels.
|
||||
(debug_flag): Resurrect this flag variable.
|
||||
(switches): Make -d give the old behavior of turning on all
|
||||
debugging. Change --debug alone to emit basic debugging and take
|
||||
optional arguments to expand debugging.
|
||||
* NEWS: Document the new debugging options.
|
||||
|
||||
* remake.c (no_rule_error): Remove this function. This tries to
|
||||
fix a real problem--see the description with the introduction of
|
||||
this function below. However, the cure is worse than the disease
|
||||
and this approach won't work.
|
||||
(remake_file): Put the code from no_rule_error back here.
|
||||
(update_file_1): Remove call to no_rule_error.
|
||||
|
||||
* filedef.h (struct file): Remove mfile_status field.
|
||||
|
||||
2000-01-22 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
Integrate GNU gettext support.
|
||||
|
||||
* configure.in: Add AM_GNU_GETTEXT.
|
||||
* Makefile.am: Add options for setting LOCALEDIR, -Iintl, etc.
|
||||
* acinclude.m4: Add gettext autoconf macros.
|
||||
* acconfig.h: Add new gettext #defines.
|
||||
* make.h: Include libintl.h. Make sure _() and N_() macros are
|
||||
declared. Make gettext() an empty macro is NLS is disabled.
|
||||
* main.c (struct command_switch switches[]): Can't initialize
|
||||
static data with _() (gettext calls), so use N_() there then use
|
||||
gettext() directly when printing the strings.
|
||||
* remake.c (no_rule_error): The string constants can't be static
|
||||
when initializing _() macros.
|
||||
* file.c (print_file): Reformat a few strings to work better for
|
||||
translation.
|
||||
* po/POTFILES.in, po/Makefile.in.in: New files. Take
|
||||
Makefile.in.in from the latest GNU tar distribution, as that
|
||||
version works better than the one that comes with gettext.
|
||||
* NEWS: Mention i18n ability.
|
||||
|
||||
2000-01-21 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
Installed patches for the VMS port.
|
||||
Patches provided by: Hartmut Becker <Hartmut.Becker@compaq.com>
|
||||
|
||||
* readme.vms, arscan.c, config.h-vms, default.c, dir.c, file.c:
|
||||
* implicit.c, job.c, make.h, makefile.com, makefile.vms, rule.c:
|
||||
* variable.c, vmsdir.h, vmsfunctions.c, vmsify.c, glob/glob.c:
|
||||
* glob/glob.h: Installed patches. See readme.vms for details.
|
||||
|
||||
2000-01-14 Andreas Schwab <schwab@suse.de>
|
||||
|
||||
* dir.c (read_dirstream): Initialize d_type if it exists.
|
||||
|
||||
2000-01-11 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
Resolve PR/xxxx: don't automatically evaluate the $(call ...)
|
||||
function's arguments. While we're here, clean up argument passing
|
||||
protocol to always use simple nul-terminated strings, instead of
|
||||
sometimes using offset pointers to mark the end of arguments.
|
||||
This change also fixes PR/1517.
|
||||
Reported by Damien GIBOU <damien.gibou@st.com>.
|
||||
|
||||
* function.c (struct function_table_entry): Remove the negative
|
||||
required_args hack; put in explicit min and max # of arguments.
|
||||
(function_table): Add in the max value. Turn off the expand bit
|
||||
for func_call.
|
||||
(expand_builtin_function): Test against minimum_args instead of
|
||||
the obsolete required_args.
|
||||
(handle_function): Rewrite this. We don't try to be fancy and
|
||||
pass one style of arguments to expanded functions and another
|
||||
style to non-expanded functions: pass pointers to nul-terminated
|
||||
strings to all functions.
|
||||
(func_call): Rewrite this. If we are invoking a builtin function
|
||||
and it's supposed to have its arguments expanded, do that (since
|
||||
it's not done by handle_function for $(call ...) anymore). For
|
||||
non-builtins, just add the variables as before but mark them as
|
||||
recursive so they'll be expanded later, as needed.
|
||||
(func_if): All arguments are vanilla nul-terminated strings:
|
||||
remove trickery with "argv[1]-1".
|
||||
(func_foreach): Ditto.
|
||||
|
||||
* expand.c (expand_argument): If the second arg is NULL, expand
|
||||
the entire first argument.
|
||||
|
||||
* job.c (new_job): Zero the child struct. This change was just
|
||||
made to keep some heap checking software happy, not because there
|
||||
was an actual bug (the important memory was being cleared properly).
|
||||
|
||||
1999-12-15 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* variable.c (print_variable): Print the variable with += if the
|
||||
append flag is set.
|
||||
|
||||
* implicit.c (pattern_search): Remove the extra check of the
|
||||
implicit flag added on 8/24/1998. This causes problems and the
|
||||
reason for the change was better resolved by the change made to
|
||||
check_deps() on 1998-08-26. This fixes PR/1423.
|
||||
|
||||
1999-12-08 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* dir.c (dir_setup_glob): On 64 bit ReliantUNIX (5.44 and above)
|
||||
in LFS mode, stat() is actually a macro for stat64(). Assignment
|
||||
doesn't work in that case. So, stat is a macro, make a local
|
||||
wrapper function to invoke it.
|
||||
(local_stat): Wrapper function, if needed.
|
||||
Reported by Andrej Borsenkow <Andrej.Borsenkow@mow.siemens.ru>.
|
||||
|
||||
1999-12-02 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* remake.c (update_file): Move the considered test outside the
|
||||
double-colon loop, _but_ make sure we test the double_colon target
|
||||
not the "current" target. If we stop early because one
|
||||
double-colon target is running, mark all the rest considered and
|
||||
try to start their prerequisites (so they're marked considered).
|
||||
Fix for PR/1476 suggested by Tim Magill <tim.magill@telops.gte.com>.
|
||||
|
||||
1999-11-22 Rob Tulloh <rob_tulloh@dev.tivoli.com>
|
||||
|
||||
* function.c (windows32_openpipe, func_shell): Correct Windows32
|
||||
problem where $(shell nosuchfile) would incorrectly exit make. The
|
||||
fix is to print the error and let make continue.
|
||||
Reported by David Masterson <David.Masterson@kla-tencor.com>.
|
||||
|
||||
* w32/subproc/misc.c (arr2envblk): Memory leak fix.
|
||||
|
||||
1999-11-21 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
Rework GNU make debugging to provide different levels of output.
|
||||
|
||||
* NEWS: mention it.
|
||||
* debug.h: New file. Define various debugging levels and macros.
|
||||
* function.c, implicit.c, job.c, main.c, misc.c, read.c, remake.c
|
||||
* remote-cstms.c, vmsfunctions.c: Replace all code depending on
|
||||
debug_flag with invocations of debugging macros.
|
||||
* make.h: Remove debug_flag and DEBUGPR, add db_level.
|
||||
|
||||
1999-11-18 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* acinclude.m4 (AC_SYS_LARGEFILE_FLAGS): Work around a problem
|
||||
with the QNX 4.25 shell, which doesn't propagate exit status of
|
||||
failed commands inside shell assignments.
|
||||
|
||||
1999-11-17 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* function.c (func_if): Find the end of the arg list by testing
|
||||
the next item for NULL; any other test is not correct.
|
||||
Reported by Graham Reed <grahamr@algorithmics.com> (PR/1429).
|
||||
|
||||
Fix += when used in a target-specific variable context.
|
||||
|
||||
* variable.h: New bitfield APPEND set if we have a +=
|
||||
target-specific variable.
|
||||
|
||||
* variable.c (try_variable_definition): Add an argument to specify
|
||||
if we're trying a target-specific variable. If we are and it's an
|
||||
append style, don't append it, record it as normal recursive, but
|
||||
set the APPEND flag so it'll be expanded later.
|
||||
* main.c (handle_non_switch_argument): Use new
|
||||
try_variable_definition() signature.
|
||||
* read.c (read_makefile,record_target_var): Ditto.
|
||||
|
||||
* expand.c (allocated_variable_append): New function: like
|
||||
allocated_variable_expand(), but we expand the same variable name
|
||||
in the context of the ``next'' variable set, then we append this
|
||||
expanded value.
|
||||
(recursively_expand): Invoke it, if the APPEND bit is set.
|
||||
|
||||
1999-11-10 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* file.c (snap_deps): If the .NOTPARALLEL target is defined, turn
|
||||
off parallel builds for this make only (still allow submakes to be
|
||||
run in parallel).
|
||||
* main.c: New variable, ``not_parallel''.
|
||||
* make.h: Add an extern for it.
|
||||
* job.c (new_job): Test NOT_PARALLEL as well as JOB_SLOTS.
|
||||
* NEWS: Add info on .NOTPARALLEL.
|
||||
* make.texinfo (Special Targets): Document it.
|
||||
|
||||
* configure.in (GLOBDIR): Set to "glob" if we need to build the
|
||||
glob library.
|
||||
* Makefile.am (SUBDIRS): Use the GLOBDIR variable instead of
|
||||
"glob" so we don't try to build glob if we don't need to (if we
|
||||
have GLIBC glob). Reported by Lars Hecking <lhecking@nmrc.ucc.ie>.
|
||||
|
||||
* main.c (main): Don't put "***" in the clock skew warning
|
||||
message. Reported by karl@gnu.org.
|
||||
|
||||
* make.h: Remove unneeded signal setup.
|
||||
|
||||
* signame.c: Remove extraneous #includes; some versions of Ultrix
|
||||
don't protect against multiple inclusions and it causes compile
|
||||
errors. Reported by Simon Burge <simonb@thistledown.com.au>.
|
||||
|
||||
1999-10-15 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* main.c (quote_for_env): Rename from quote_as_word().
|
||||
|
||||
* make.h, *.c: Prefer strchr() and strrchr() in the code
|
||||
rather than index() and rindex(). Define strchr/strrchr in terms
|
||||
of index/rindex if the former aren't supported.
|
||||
|
||||
* default.c (CHECKOUT,v): Replace the fancy, complicated
|
||||
patsubst/filter expression with a simple $(if ...) expression.
|
||||
|
||||
* main.c (print_usage): Add the bug reporting mailing address to
|
||||
the --help output, as per the GNU coding standards.
|
||||
Reported by Paul Eggert <eggert@twinsun.com>.
|
||||
|
||||
* README.customs: Installed information on running Customs-ized
|
||||
GNU make and setuid root, collected by Ted Stern <stern@tera.com>.
|
||||
|
||||
* read.c (read_all_makefiles): PR/1394: Mark the end of the next
|
||||
token in the MAKEFILES value string _before_ we dup it.
|
||||
|
||||
1999-10-13 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* configure.in (make_cv_sys_gnu_glob): We used to add the -Iglob
|
||||
flag to CPPFLAGS, but that loses if the user specifies his own
|
||||
CPPFLAGS; this one gets added _after_ his and if he happens to
|
||||
have an old or broken glob.h--boom. Instead, put it in GLOBINC
|
||||
and SUBST it.
|
||||
|
||||
* Makefile.am (INCLUDES): Add @GLOBINC@ to the INCLUDES macro;
|
||||
these things get on the compile line well before the user's
|
||||
CPPFLAGS.
|
||||
|
||||
1999-10-12 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* remake.c (notice_finished_file): If we get here and -n is set,
|
||||
see if all the command lines are marked recursive. If so, then we
|
||||
ran every command there is, so check the mtime on this file just
|
||||
like we would normally. If not, we assume the command we didn't
|
||||
run would updates the target and set mtime of the target to "very new".
|
||||
|
||||
* job.c (start_job_command): Update lines_flags in the file's cmds
|
||||
structure with any per-line tokens we found (`@', `-', `+').
|
||||
|
||||
1999-10-08 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* variable.c (initialize_file_variables): Always recurse to
|
||||
initialize the parent's file variables: the parent might not have
|
||||
any rules to run so it might not have been initialized before
|
||||
this--we need this to set up the chain properly for
|
||||
target-specific variables.
|
||||
|
||||
1999-09-29 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* main.c (quote_as_word): Always quote for decode_env_switches
|
||||
instead of for the shell, so that arguments with strange
|
||||
characters are are passed to submakes correctly. Remove
|
||||
double_dollars arg; we always double dollars now. All callers
|
||||
changed.
|
||||
(decode_env_switches): Don't run off the end of an environment
|
||||
variable whose contents ends in a unescaped backslash.
|
||||
|
||||
1999-09-23 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* commands.c, function.c, job.c, read.c: Cast arguments to
|
||||
ctype.h functions/macros to _unsigned_ char for portability.
|
||||
|
||||
* remake.c, function.c: Compiler warning fixes: the second
|
||||
argument to find_next_token() should be an _unsigned_ int*.
|
||||
Reported by Han-Wen Nienhuys <hanwen@cs.uu.nl>.
|
||||
|
||||
1999-09-23 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* Version 3.78.1 released.
|
||||
|
||||
* make.texinfo: Update version/date stamp.
|
||||
|
||||
* main.c (main): Argh. For some reason we were closing _all_ the
|
||||
jobserver pipes before we re-exec'd due to changed makefiles.
|
||||
This means that any re-exec got a "jobserver unavailable" error :-/.
|
||||
I can't believe we didn't notice this before.
|
||||
|
||||
1999-09-22 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* Version 3.78 released.
|
||||
|
||||
* main.c (main): Only fail on multiple --jobserver-fds options if
|
||||
they aren't all the same. Some makefiles use things like
|
||||
$(MAKE) $(MFLAGS) which will cause multiple, identical copies of
|
||||
--jobserver-fds to show up.
|
||||
|
||||
1999-09-16 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* main.c (define_makeflags): Zero out FLAGSTRING to avoid
|
||||
uninitialized memory reads when checking *p != '-' in the loop.
|
||||
|
||||
1999-09-15 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* Version 3.77.97 released.
|
||||
|
||||
* configure.in (MAKE_HOST): AC_SUBST this so it will go into the
|
||||
makefile.
|
||||
* Makefile.am (check-local): Print a success banner if the check
|
||||
succeeds.
|
||||
(check-regression): A bit of fine-tuning.
|
||||
|
||||
1999-09-15 Eli Zaretskii <eliz@is.elta.co.il>
|
||||
|
||||
* README.DOS.template: Document requirements for the test suite.
|
||||
* Makefile.DOS.template: Updates to allow the test suite to run
|
||||
from "make check".
|
||||
|
||||
* main.c (main): Handle it if argv[0] isn't an absolute path.
|
||||
|
||||
1999-09-13 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* Version 3.77.96 released.
|
||||
|
||||
* Makefile.am (loadavg): Use CPPFLAGS, etc. to make sure we get
|
||||
all the right #defines to compile.
|
||||
(check-regression): Look for the regression test suite in the make
|
||||
package itself. If we're building remotely, use symlinks to make
|
||||
a local copy.
|
||||
(dist-hook): Put the test suite into the tar file.
|
||||
|
||||
* configure.in: Look for perl for the test suite.
|
||||
|
||||
1999-09-10 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* acinclude.m4 (AC_SYS_LARGEFILE_FLAGS): If on HP-UX 10.20 or
|
||||
later, and using GCC, define __STDC_EXT__; this works around a
|
||||
bug in GCC 2.95.1.
|
||||
|
||||
1999-09-08 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* main.c (print_version): Ugh. GLIBC's configure tries to check
|
||||
make version strings and is too aggressive with their matching
|
||||
expressions. I've struck a deal with them to leave the version
|
||||
output as-is for 3.78, and they'll change their configure checks
|
||||
so that I can change this back in the future.
|
||||
|
||||
1999-09-07 Eli Zaretskii <eliz@is.elta.co.il>
|
||||
|
||||
* job.c (construct_command_argv_internal) [__MSDOS__]: Add "echo"
|
||||
and "unset" to the list of builtin shell commands.
|
||||
|
||||
* configh.DOS.template (MAKE_HOST): Define to "i386-pc-msdosdjgpp"
|
||||
which is the canonical name of the DJGPP host.
|
||||
|
||||
1999-09-05 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* Version 3.77.95 released.
|
||||
|
||||
* make.texinfo (Make Errors): Document some new jobserver error
|
||||
messages.
|
||||
|
||||
1999-09-04 Eli Zaretskii <eliz@is.elta.co.il>
|
||||
|
||||
* make.texinfo (Make Errors): Document the hint about 8 spaces
|
||||
instead of a TAB.
|
||||
(Call Function, Quick Reference): Use @code{$(1)}, not @var.
|
||||
|
||||
* main.c (main) [__MSDOS__]: Say "on this platform" instead of "on
|
||||
MS-DOS", since the MSDOS version could run on Windows.
|
||||
|
||||
1999-09-03 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* remake.c (notice_finished_file): Always set mtime_before_update
|
||||
if it's not been set, not just if we ran some rules. Otherwise we
|
||||
may have a situation where a target's prerequisite was rebuilt but
|
||||
not changed, so this target's rules weren't run, then
|
||||
update_goal_chain() sees mtime_before_update != last_mtime and
|
||||
thinks that the top-level target changed when it really didn't.
|
||||
This can cause an infinite loop when remaking makefiles.
|
||||
(update_goal_chain): If we get back to the top and we don't know
|
||||
what the goal's last_mtime was, find it now. We need to know so
|
||||
we can compare it to mtime_before_update later (this is only
|
||||
crucial when remaking makefiles--should we only do it then?)
|
||||
|
||||
1999-09-02 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* read.c (read_makefile): If "override" appears as the first
|
||||
prerequisite, look further to ensure this is really a
|
||||
target-specific variable definition, and not just some
|
||||
prerequisite named "override".
|
||||
|
||||
1999-09-01 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* function.c (IS_PATHSEP) [WINDOWS32]: Allow backslash separators
|
||||
for W32 platforms.
|
||||
* read.c (record_files) [WINDOWS32]: Allow backslash separators
|
||||
for W32 platforms.
|
||||
* implicit.c (pattern_search) [WINDOWS32]: Allow backslash
|
||||
separators for W32 platforms.
|
||||
|
||||
* configure.in (MAKE_HOST): Define it to be the canonical build
|
||||
host info, now that we need AC_CANONICAL_HOST anyway (for large
|
||||
file support).
|
||||
* version.c (make_host): Define a variable to MAKE_HOST so we're
|
||||
sure to get it from the local config.h.
|
||||
* main.c (print_version): Use it in the version information.
|
||||
* config.ami.template: Add MAKE_HOST.
|
||||
* configh.dos.template: Ditto.
|
||||
* config.h.W32.template: Ditto.
|
||||
* config.h-vms.template: Ditto.
|
||||
|
||||
* main.c (main): Close the jobserver file descriptors if we need
|
||||
to re-exec ourselves.
|
||||
Also print more reasonable error if users force -jN for submakes.
|
||||
This may be common for a while until people use the jobserver
|
||||
feature. If it happens, we ignore the existing jobserver stuff
|
||||
and use whatever they specified on the commandline.
|
||||
(define_makeflags): Fixed a long-standing bug: if a long name
|
||||
only option comes immediately after a single letter option with no
|
||||
argument, then the option string is constructed incorrectly. For
|
||||
example, with -w and --jobserver-fds you get "-w-jobserver-fds..."
|
||||
instead of "-w --jobserver-fds..."; add in an extra " -".
|
||||
|
||||
* make.texinfo (Phony Targets): Add another example of using
|
||||
.PHONY with subdirectories/recursive make.
|
||||
|
||||
1999-08-30 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* README.W32.template: Renamed from README.W32 so it's
|
||||
autogenerated during the dist. A few minor modifications.
|
||||
|
||||
* configure.in: Check for kstat_open before AC_FUNC_GETLOADAVG
|
||||
since the latter needs to know whether the former exists to give
|
||||
an accurate result.
|
||||
|
||||
1999-08-26 Rob Tulloh <rob_tulloh@dev.tivoli.com>
|
||||
|
||||
* NMakefile [WINDOWS32]: Now more robust. If you change a file
|
||||
under w32/subproc, the make.exe will be relinked. Also added some
|
||||
tests to make sure erase commands won't fail when executed in a
|
||||
pristine build environment.
|
||||
|
||||
* w32/subproc/sub_proc.c [WINDOWS32]: Added support for
|
||||
HAVE_CYGWIN_SHELL. If you are using the Cygwin B20.1 release, it
|
||||
is now possible to have have native support for this shell without
|
||||
having to rely on klutzy BATCH_MODE_ONLY_SHELL.
|
||||
|
||||
* config.h.W32 [WINDOWS32]: Added HAVE_CYGWIN_SHELL macro which
|
||||
users can define if they want to build make to use this shell.
|
||||
|
||||
* README.W32 [WINDOWS32]: Added informaton about
|
||||
HAVE_CYGWIN_SHELL. Cleaned up text a bit to make it more current.
|
||||
|
||||
1999-08-26 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
Support large files in AIX, HP-UX, and IRIX.
|
||||
|
||||
* acinclude.m4 (AC_LFS): Remove. Superseded by AC_SYS_LARGEFILE.
|
||||
(AC_SYS_LARGEFILE_FLAGS, AC_SYS_LARGEFILE_SPACE_APPEND,
|
||||
AC_SYS_LARGEFILE_MACRO_VALUE, AC_SYS_LARGEFILE): New macros.
|
||||
(jm_AC_TYPE_UINTMAX_T): Check for busted compilers that can't
|
||||
shift or divide unsigned long long.
|
||||
(AM_PROG_CC_STDC): New macro; a temporary workaround of a bug in
|
||||
automake 1.4.
|
||||
|
||||
* configure.in (AC_CANONICAL_HOST): Add; required by new
|
||||
AC_SYS_LARGEFILE.
|
||||
(AC_SYS_LARGEFILE): Renamed from AC_LFS.
|
||||
(AM_PROG_CC_STDC): Add.
|
||||
|
||||
* config.guess, config.sub: New files, needed for AC_CANONICAL_HOST.
|
||||
|
||||
1999-08-25 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* make.h (CHAR_MAX): New macro.
|
||||
* main.c (struct command_switch): c is now int,
|
||||
so that it can store values greater than CHAR_MAX.
|
||||
(switches): Replace small numbers N with CHAR_MAX+N-1,
|
||||
to avoid problems with non-ASCII character sets.
|
||||
(short_option): New macro.
|
||||
(init_switches, print_usage, define_makeflags): Use it instead of
|
||||
isalnum.
|
||||
|
||||
1999-08-25 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* Version 3.77.94 released.
|
||||
|
||||
* main.c (main) [__MSDOS__]: If the user uses -j, warn that it's
|
||||
not supported and reset it.
|
||||
|
||||
* make.h (ISDIGIT): Obtained this from the textutils distribution.
|
||||
* main.c (decode_switches): Use it.
|
||||
* function.c (is_numeric): Use it.
|
||||
|
||||
* main.c (struct command_switch): Store the switch char in an
|
||||
unsigned char to shut up GCC about using it with ctype.h macros.
|
||||
Besides, it _is_ always unsigned.
|
||||
|
||||
1999-08-24 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* make.texinfo: Change "dependency" to "prerequisite" and
|
||||
"dependencies" to "prerequisites". Various other cleanups related
|
||||
to the terminology change.
|
||||
* file.c: Change debugging and error messages to use
|
||||
"prerequisite" instead of "dependency".
|
||||
* implicit.c: Ditto.
|
||||
* remake.c: Ditto.
|
||||
* NEWS: Document it.
|
||||
|
||||
1999-08-23 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* remake.c (update_file): Move the considered check into the
|
||||
double-colon rule loop, so we consider double-colon rules
|
||||
individually (otherwise after the first is pruned, the rest won't
|
||||
get run).
|
||||
|
||||
* README.template: Minor changes.
|
||||
|
||||
Remove the debugging features of the jobserver, so it no longer
|
||||
writes distinct tokens to the pipe. Thus, we don't need to store
|
||||
the token we get. A side effect of this is to remove a potential
|
||||
"unavailable token" situation: make-1 invokes make-2 with its
|
||||
special token and make-3 with a normal token; make-2 completes.
|
||||
Now we're waiting for make-3 but using 2 tokens; our special token
|
||||
is idle. In the new version we don't have special tokens per se,
|
||||
we merely decide if we already have a child or not. If we don't,
|
||||
we don't need a token. If we do, we have to get one to run the
|
||||
next child. Similar for putting tokens back: if we're cleaning up
|
||||
the last child, we don't put a token back. Otherwise, we do.
|
||||
|
||||
* main.c: Add a new, internal flag --jobserver-fds instead of
|
||||
overloading the meaning of -j. Remove job_slots_str and add the
|
||||
stringlist jobserver_fds.
|
||||
(struct command_switch): We don't need the int_string type.
|
||||
(switches[]): Add a new option for --jobserver-fds and remove
|
||||
conditions around -j. Make the description for the former 0 so it
|
||||
doesn't print during "make --help".
|
||||
(main): Rework jobserver parsing. If we got --jobserver-fds
|
||||
make sure it's valid. We only get one and job_slots must be 0.
|
||||
If we're the toplevel make (-jN without --jobserver-fds) create
|
||||
the pipe and write generic tokens.
|
||||
Create the stringlist struct for the submakes.
|
||||
Clean up the stringlist where necessary.
|
||||
(init_switches): Remove int_string handling.
|
||||
(print_usage): Don't print internal flags (description ptr is 0).
|
||||
(decode_switches): Remove int_string handling.
|
||||
(define_makeflags): Remove int_string handling.
|
||||
|
||||
* job.c: Remove my_job_token flag and all references to the
|
||||
child->job_token field.
|
||||
(free_job_token): Remove this and merge it into free_child().
|
||||
(reap_children): Rework the "reaped a child" logic slightly.
|
||||
Don't call defunct free_job_token anymore. Always call
|
||||
free_child, even if we're dying.
|
||||
(free_child): If we're not freeing the only child, put a token
|
||||
back in the pipe. Then, if we're dying, don't bother to free.
|
||||
(new_job): If we are using the jobserver, loop checking to see if
|
||||
a) there are no children or b) we get a token from the pipe.
|
||||
|
||||
* job.h (struct child): Remove the job_token field.
|
||||
|
||||
1999-08-20 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* variable.c (try_variable_definition): Allocate for variable
|
||||
expansion in f_append with a simple variable: if we're looking at
|
||||
target-specific variables we don't want to trash the buffer.
|
||||
Noticed by Reiner Beninga <Reiner.Beninga@mchp.siemens.de>.
|
||||
|
||||
1999-08-16 Eli Zaretskii <eliz@is.elta.co.il>
|
||||
|
||||
* main.c (main) [__MSDOS__]: Mirror any backslashes in argv[0], to
|
||||
avoid problems in shell commands that use backslashes as escape
|
||||
characters.
|
||||
|
||||
1999-08-16 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* Version 3.77.93 released.
|
||||
|
||||
1999-08-13 Paul D. Smith <psmith@gnu.org
|
||||
|
||||
* function.c (func_if): New function $(if ...) based on the
|
||||
original by Han-Wen but reworked quite a bit.
|
||||
(function_table): Add it.
|
||||
* NEWS: Introduce it.
|
||||
* make.texinfo (If Function): Document it.
|
||||
|
||||
* job.c (free_job_token): Check for EINTR when writing tokens to
|
||||
the jobserver pipe.
|
||||
|
||||
1999-08-12 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
Another jobserver algorithm change. We conveniently forgot that
|
||||
the blocking bit is shared by all users of the pipe, it's not a
|
||||
per-process setting. Since we have many make processes all
|
||||
sharing the pipe we can't use the blocking bit as a signal handler
|
||||
flag. Instead, we'll dup the pipe's read FD and have the SIGCHLD
|
||||
handler close the dup'd FD. This will cause the read() to fail
|
||||
with EBADF the next time we invoke it, so we know we need to reap
|
||||
children. We then re-dup and reap.
|
||||
|
||||
* main.c (main): Define the job_rfd variable to hold the dup'd FD.
|
||||
Actually dup the read side of the pipe. Don't bother setting the
|
||||
blocking bit on the file descriptor.
|
||||
* make.h: Declare the job_rfd variable.
|
||||
* job.c (child_handler): If the dup'd jobserver pipe is open,
|
||||
close it and assign -1 to job_rfd to notify the main program that
|
||||
we got a SIGCHLD.
|
||||
(start_job_command): Close the dup'd FD before exec'ing children.
|
||||
Since we open and close this thing so often it doesn't seem
|
||||
worth it to use the close-on-exec bit.
|
||||
(new_job): Remove code for testing/setting the blocking bit.
|
||||
Instead of EAGAIN, test for EBADF. If the dup'd FD has been
|
||||
closed, re-dup it before we reap children.
|
||||
|
||||
* function.c (func_shell): Be a little more accurate about the
|
||||
length of the error string to allocate.
|
||||
|
||||
* expand.c (variable_expand_for_file): If there's no filenm info
|
||||
(say, from a builtin command) then reset reading_file to 0.
|
||||
|
||||
1999-08-09 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* maintMakefile: Use g in sed (s///g) to replace >1 variable per
|
||||
line.
|
||||
|
||||
* Makefile.DOS.template [__MSDOS__]: Fix mostlyclean-aminfo to
|
||||
remove the right files.
|
||||
|
||||
1999-08-01 Eli Zaretskii <eliz@is.elta.co.il>
|
||||
|
||||
* function.c (msdos_openpipe) [__MSDOS__]: *Really* return a FILE
|
||||
ptr.
|
||||
|
||||
1999-08-01 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
New jobserver algorithm to avoid a possible hole where we could
|
||||
@@ -418,9 +1295,9 @@
|
||||
a bit saying whether we've seen this target in this pass or not.
|
||||
(update_goal_chain): Initially set the global considered toggle to
|
||||
1, since all targets initialize their boolean to 0. At the end of
|
||||
each pass, toggle the global considered variable. * filedef.h
|
||||
(struct file): Per-file considered toggle bit. * file.c: New
|
||||
global toggle variable considered.
|
||||
each pass, toggle the global considered variable.
|
||||
* filedef.h (struct file): Per-file considered toggle bit.
|
||||
* file.c: New global toggle variable considered.
|
||||
|
||||
1999-04-05 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
@@ -573,7 +1450,7 @@
|
||||
|
||||
* arscan.c: Modified to support AIX 4.3 big archives. The changes
|
||||
are based on information provided by Phil Adams
|
||||
<padams@austin.ibm.com>; thanks!
|
||||
<padams@austin.ibm.com>.
|
||||
|
||||
1999-02-19 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
@@ -754,7 +1631,7 @@
|
||||
|
||||
* configure.in (AC_FUNC_VPRINTF): Check for vprintf()/_doprnt().
|
||||
|
||||
* misc.c(message, error, fatal): Add preprocessor stuff to enable
|
||||
* misc.c (message, error, fatal): Add preprocessor stuff to enable
|
||||
creation of variable-argument functions with appropriate
|
||||
prototypes, that works with ANSI, pre-ANSI, varargs.h, stdarg.h,
|
||||
v*printf(), _doprnt(), or none of the above. Culled from GNU
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
# This Makefile.DOS is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy, distribute and modify it.
|
||||
|
||||
# -*-Makefile-*-, or close enough
|
||||
|
||||
|
||||
SHELL = /bin/sh
|
||||
|
||||
@@ -14,7 +12,7 @@ srcdir = .
|
||||
VPATH = $(srcdir)
|
||||
# $DJDIR is defined automatically by DJGPP to point
|
||||
# to the root of the DJGPP installation tree.
|
||||
prefix = ${DJDIR}
|
||||
prefix = /dev/env/DJDIR
|
||||
exec_prefix = ${prefix}
|
||||
|
||||
bindir = ${exec_prefix}/bin
|
||||
@@ -26,9 +24,12 @@ mandir = ${prefix}/info
|
||||
includedir = ${prefix}/include
|
||||
oldincludedir = c:/djgpp/include
|
||||
|
||||
DESTDIR =
|
||||
|
||||
pkgdatadir = $(datadir)/make
|
||||
pkglibdir = $(libdir)/make
|
||||
pkgincludedir = $(includedir)/make
|
||||
localedir = $(prefix)/share/locale
|
||||
|
||||
INSTALL = ${bindir}/ginstall -c
|
||||
INSTALL_PROGRAM = ${bindir}/ginstall -c
|
||||
@@ -53,6 +54,7 @@ CPP = gcc -E
|
||||
LIBOBJS =
|
||||
MAKEINFO = ${bindir}/makeinfo
|
||||
PACKAGE = make
|
||||
PERL = perl
|
||||
RANLIB = ranlib
|
||||
REMOTE = stub
|
||||
VERSION = %VERSION%
|
||||
@@ -69,11 +71,11 @@ make_LDADD = glob/libglob.a
|
||||
info_TEXINFOS = make.texinfo
|
||||
man_MANS = make.1
|
||||
|
||||
INCLUDES = -I$(srcdir)/glob -DLIBDIR=\"c:/djgpp/lib\" -DINCLUDEDIR=\"c:/djgpp/include\"
|
||||
INCLUDES = -I$(srcdir)/glob -DLIBDIR=\"c:/djgpp/lib\" -DINCLUDEDIR=\"c:/djgpp/include\" -DLOCALEDIR=\"$(localedir)\"
|
||||
|
||||
BUILT_SOURCES = README build.sh.in
|
||||
BUILT_SOURCES = README build.sh-in
|
||||
|
||||
EXTRA_DIST = $(BUILT_SOURCES) $(man_MANS) README.customs remote-cstms.c make-stds.texi texinfo.tex SCOPTIONS SMakefile Makefile.ami README.Amiga config.ami amiga.c amiga.h NMakefile README.DOS configh.dos configure.bat makefile.com README.W32 build_w32.bat config.h.W32 subproc.bat make.lnk config.h-vms makefile.vms readme.vms vmsdir.h vmsfunctions.c vmsify.c
|
||||
EXTRA_DIST = $(BUILT_SOURCES) $(man_MANS) README.customs remote-cstms.c make-stds.texi texinfo.tex SCOPTIONS SMakefile Makefile.ami README.Amiga config.ami amiga.c amiga.h NMakefile README.DOS configh.dos configure.bat makefile.com README.W32 build_w32.bat config.h-W32 subproc.bat make.lnk config.h-vms makefile.vms readme.vms vmsdir.h vmsfunctions.c vmsify.c
|
||||
|
||||
SUBDIRS = glob
|
||||
mkinstalldirs = ${bindir}/gmkdir -p
|
||||
@@ -81,6 +83,8 @@ CONFIG_HEADER = config.h
|
||||
CONFIG_CLEAN_FILES = build.sh
|
||||
PROGRAMS = $(bin_PROGRAMS)
|
||||
|
||||
MAKE_HOST = i386-pc-msdosdjgpp
|
||||
|
||||
|
||||
DEFS = -I. -I$(srcdir) -I.
|
||||
CPPFLAGS = -DHAVE_CONFIG_H
|
||||
@@ -104,7 +108,7 @@ 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 ABOUT-NLS 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 gettext.c install-sh missing mkinstalldirs stamp-h.in texinfo.tex
|
||||
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
@@ -141,11 +145,11 @@ maintainer-clean-binPROGRAMS:
|
||||
install-binPROGRAMS: $(bin_PROGRAMS)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(DESTDIR)$(bindir)
|
||||
@list='$(bin_PROGRAMS)'; for p in $$list; do if test -f $$p; then echo " $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p | sed '$(transform)'`"; $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p | sed '$(transform)'`; else :; fi; done
|
||||
@list='$(bin_PROGRAMS)'; for p in $$list; do if test -f $$p; then echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p | sed '$(transform)'`"; $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p | sed '$(transform)'`; else :; fi; done
|
||||
|
||||
uninstall-binPROGRAMS:
|
||||
$(NORMAL_UNINSTALL)
|
||||
list='$(bin_PROGRAMS)'; for p in $$list; do rm -f $(bindir)/`echo $$p|sed '$(transform)'`.exe; done
|
||||
list='$(bin_PROGRAMS)'; for p in $$list; do rm -f $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`.exe; done
|
||||
|
||||
.c.o:
|
||||
$(COMPILE) -c $<
|
||||
@@ -224,7 +228,9 @@ dist-info: $(INFO_DEPS)
|
||||
for base in $(INFO_DEPS); do d=$(srcdir); for file in `cd $$d && eval echo $$base*`; do test -f $(distdir)/$$file || ln $$d/$$file $(distdir)/$$file 2> /dev/null || cp -p $$d/$$file $(distdir)/$$file; done; done
|
||||
|
||||
mostlyclean-aminfo:
|
||||
cd $(srcdir) && for i in $(INFO_DEPS) make.i; do rm -f `eval echo $$i*`; done
|
||||
-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:
|
||||
|
||||
@@ -293,7 +299,8 @@ libglob.a: $(libglob_a_OBJECTS)
|
||||
$(AR) cru libglob.a $(libglob_a_OBJECTS) $(libglob_a_LIBADD)
|
||||
$(RANLIB) libglob.a
|
||||
|
||||
mostlyclean-recursive clean-recursive distclean-recursive maintainer-clean-recursive:
|
||||
mostlyclean-recursive clean-recursive distclean-recursive \
|
||||
maintainer-clean-recursive check-recursive:
|
||||
ifeq ($(words $(SUBDIRS)), 1)
|
||||
@echo Making $(shell echo $@ | sed s/-recursive//) in $(SUBDIRS)
|
||||
$(MAKE) -C $(SUBDIRS) -f ../Makefile $(shell echo $@ | sed s/-recursive//)-am
|
||||
@@ -362,8 +369,8 @@ distdir: $(DISTFILES)
|
||||
|
||||
info: $(INFO_DEPS) info-recursive
|
||||
dvi: $(DVIS) dvi-recursive
|
||||
check: all-am
|
||||
$(MAKE) check-recursive check-local
|
||||
check: all-am check-recursive check-local
|
||||
@:
|
||||
installcheck: installcheck-recursive
|
||||
all-recursive-am: config.h
|
||||
$(MAKE) all-recursive
|
||||
@@ -382,6 +389,9 @@ install-exec: install-exec-recursive install-exec-am
|
||||
install-data: install-data-recursive install-data-am
|
||||
@$(NORMAL_INSTALL)
|
||||
|
||||
install-recursive uninstall-recursive:
|
||||
@:
|
||||
|
||||
install: install-recursive install-exec-am install-data-am
|
||||
@:
|
||||
|
||||
@@ -437,7 +447,7 @@ maintainer-clean-compile install-info-am uninstall-info \
|
||||
mostlyclean-aminfo distclean-aminfo clean-aminfo \
|
||||
maintainer-clean-aminfo install-data-recursive uninstall-data-recursive \
|
||||
install-exec-recursive uninstall-exec-recursive installdirs-recursive \
|
||||
uninstalldirs-recursive all-recursive check-recursive \
|
||||
uninstalldirs-recursive all-recursive check-recursive check-am \
|
||||
installcheck-recursive info-recursive dvi-recursive \
|
||||
mostlyclean-recursive distclean-recursive clean-recursive \
|
||||
maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
|
||||
@@ -462,8 +472,27 @@ dist-hook:
|
||||
|
||||
# --------------- Local CHECK Section
|
||||
|
||||
check-local: check-loadavg check-regression
|
||||
.PHONY: check-loadavg check-regression
|
||||
# Note: check-loadavg is NOT a prerequisite of check-local, since
|
||||
# there's no uptime utility, and the test it does doesn't make sense
|
||||
# on MSDOS anyway.
|
||||
check-local: check-shell check-regression
|
||||
@banner=" Regression PASSED: GNU Make $(VERSION) ($(MAKE_HOST)) built with $(CC) "; \
|
||||
dashes=`echo "$$banner" | sed s/./=/g`; \
|
||||
echo; \
|
||||
echo "$$dashes"; \
|
||||
echo "$$banner"; \
|
||||
echo "$$dashes"; \
|
||||
echo
|
||||
|
||||
.PHONY: check-loadavg check-shell check-regression
|
||||
|
||||
# > check-shell
|
||||
#
|
||||
# check-shell is designed to fail if they don't have a Unixy shell
|
||||
# installed. The test suite requires such a shell.
|
||||
check-shell:
|
||||
@echo If Make says Error -1, you do not have Unix-style shell installed
|
||||
@foo=bar.exe :
|
||||
|
||||
# > check-loadavg
|
||||
#
|
||||
@@ -488,23 +517,22 @@ check-loadavg: loadavg
|
||||
# parents.
|
||||
#
|
||||
check-regression:
|
||||
here=`pwd`; testdir=""; \
|
||||
case "$(MAKE_TEST)" in "") \
|
||||
for d1 in $$here $(srcdir); do \
|
||||
for d2 in ../.. .. .; do \
|
||||
all=`echo $$d1/$$d2/make-test-[0-9]*/run_make_tests`; \
|
||||
case "$$all" in \
|
||||
"$$d1/$$d2/make-test-[0-9]*/run_make_tests") : ;; \
|
||||
*) try=`for x in $$all; do echo $$x; done | sort | tail -1`;\
|
||||
testdir=`dirname $$try` ;; esac; \
|
||||
done; done ;; \
|
||||
*) testdir="$(MAKE_TEST)" ;; \
|
||||
esac; \
|
||||
case "$$testdir" in \
|
||||
"") echo "Couldn't find make-test-* test suite."; exit 0;; \
|
||||
esac; \
|
||||
echo "cd $$testdir && ./run_make_tests -make_path $$here/make"; \
|
||||
cd $$testdir && ./run_make_tests -make_path $$here/make
|
||||
@if test -f "$(srcdir)/tests/run_make_tests"; then \
|
||||
if $(PERL) -v >/dev/null 2>&1; then \
|
||||
case `cd $(srcdir); pwd` in `pwd`) : ;; \
|
||||
*) test -d tests || mkdir tests; \
|
||||
for f in run_make_tests run_make_tests.pl test_driver.pl scripts; do \
|
||||
rm -rf tests/$$f; cp -pr $(srcdir)/tests/$$f tests; \
|
||||
done ;; \
|
||||
esac; \
|
||||
echo "cd tests && $(PERL) ./run_make_tests.pl -make ../make.exe $(MAKETESTFLAGS)"; \
|
||||
cd tests && $(PERL) ./run_make_tests.pl -make ../make.exe $(MAKETESTFLAGS); \
|
||||
else \
|
||||
echo "Can't find a working Perl ($(PERL)); the test suite requires Perl."; \
|
||||
fi; \
|
||||
else \
|
||||
echo "Can't find the GNU Make test suite ($(srcdir)/tests)."; \
|
||||
fi
|
||||
|
||||
# --------------- Maintainer's Section
|
||||
|
||||
|
||||
114
Makefile.am
114
Makefile.am
@@ -2,34 +2,61 @@
|
||||
|
||||
AUTOMAKE_OPTIONS = 1.4
|
||||
|
||||
SUBDIRS = $(GLOBDIR) i18n
|
||||
|
||||
bin_PROGRAMS = make
|
||||
|
||||
make_SOURCES = main.c commands.c job.c dir.c file.c misc.c read.c remake.c \
|
||||
rule.c implicit.c default.c variable.c expand.c function.c \
|
||||
vpath.c version.c ar.c arscan.c remote-$(REMOTE).c \
|
||||
commands.h dep.h filedef.h job.h make.h rule.h variable.h \
|
||||
signame.c signame.h \
|
||||
getopt.c getopt1.c getopt.h
|
||||
make_LDADD = @LIBOBJS@ @ALLOCA@ @GLOBLIB@
|
||||
# These source files also have gettext references
|
||||
SRCS = ar.c arscan.c commands.c dir.c expand.c file.c function.c \
|
||||
getopt.c implicit.c job.c main.c misc.c read.c remake.c \
|
||||
rule.c signame.c variable.c vpath.c
|
||||
|
||||
make_SOURCES = $(SRCS) default.c remote-$(REMOTE).c version.c \
|
||||
getopt1.c
|
||||
|
||||
noinst_HEADERS = commands.h dep.h filedef.h job.h make.h rule.h variable.h \
|
||||
debug.h signame.h getopt.h gettext.h
|
||||
|
||||
make_LDADD = $(LIBOBJS) @ALLOCA@ $(GLOBLIB)
|
||||
|
||||
info_TEXINFOS = make.texinfo
|
||||
man_MANS = make.1
|
||||
info_TEXINFOS = make.texinfo
|
||||
|
||||
INCLUDES = -DLIBDIR=\"$(libdir)\" -DINCLUDEDIR=\"$(includedir)\"
|
||||
DEFS = -DALIASPATH=\"$(aliaspath)\" -DLOCALEDIR=\"$(localedir)\" -DLIBDIR=\"$(libdir)\" -DINCLUDEDIR=\"$(includedir)\" @DEFS@
|
||||
|
||||
INCLUDES = -I. -I$(srcdir) $(GLOBINC)
|
||||
|
||||
EXTRA_DIST = README build.sh.in $(man_MANS) README.customs remote-cstms.c\
|
||||
make-stds.texi texinfo.tex SCOPTIONS SMakefile\
|
||||
make-stds.texi SCOPTIONS SMakefile\
|
||||
README.Amiga Makefile.ami config.ami make.lnk amiga.c amiga.h\
|
||||
README.DOS Makefile.DOS configure.bat dosbuild.bat configh.dos\
|
||||
README.W32 NMakefile config.h.W32 build_w32.bat subproc.bat\
|
||||
readme.vms makefile.vms makefile.com config.h-vms vmsdir.h\
|
||||
vmsfunctions.c vmsify.c
|
||||
|
||||
SUBDIRS = glob
|
||||
vmsfunctions.c vmsify.c\
|
||||
gettext.c\
|
||||
glob/COPYING.LIB glob/ChangeLog glob/Makefile.am\
|
||||
glob/Makefile.ami glob/Makefile.in glob/SCOPTIONS\
|
||||
glob/SMakefile glob/configure.bat glob/fnmatch.c\
|
||||
glob/fnmatch.h glob/glob.c glob/glob.h
|
||||
|
||||
MOSTLYCLEANFILES = loadavg.c
|
||||
CLEANFILES = loadavg
|
||||
|
||||
MAKE_HOST = @MAKE_HOST@
|
||||
|
||||
|
||||
# --------------- Internationalization Section
|
||||
|
||||
POTFILES = $(SRCS) remote-cstms.c vmsfunctions.c
|
||||
|
||||
localedir = $(prefix)/share/locale
|
||||
aliaspath = $(localedir):.
|
||||
|
||||
all-local: $(srcdir)/stamp-pot
|
||||
|
||||
$(srcdir)/stamp-pot: $(POTFILES)
|
||||
@echo "$(POTFILES)" > $@
|
||||
|
||||
|
||||
# --------------- Local INSTALL Section
|
||||
|
||||
@@ -62,25 +89,33 @@ install-exec-local:
|
||||
|
||||
# --------------- Local DIST Section
|
||||
|
||||
# Install the w32 subdirectory
|
||||
# Install the w32 and tests subdirectories
|
||||
#
|
||||
dist-hook:
|
||||
(cd $(srcdir); \
|
||||
w32=`find w32 -follow \( -name CVS -prune \) -o \( -name \*.orig -o -name \*.rej -o -name \*~ -prune \) -o -type f -print`; \
|
||||
tar chf - $$w32) \
|
||||
sub=`find w32 tests -follow \( -name CVS -prune -o -name work -prune \) -o \( -name \*.orig -o -name \*.rej -o -name \*~ -prune \) -o -type f -print`; \
|
||||
tar chf - $$sub) \
|
||||
| (cd $(distdir); tar xfBp -)
|
||||
|
||||
|
||||
# --------------- Local CHECK Section
|
||||
|
||||
check-local: check-loadavg check-regression
|
||||
check-local: check-regression check-loadavg
|
||||
@banner=" Regression PASSED: GNU Make $(VERSION) ($(MAKE_HOST)) built with $(CC) "; \
|
||||
dashes=`echo "$$banner" | sed s/./=/g`; \
|
||||
echo; \
|
||||
echo "$$dashes"; \
|
||||
echo "$$banner"; \
|
||||
echo "$$dashes"; \
|
||||
echo
|
||||
|
||||
.PHONY: check-loadavg check-regression
|
||||
|
||||
# > check-loadavg
|
||||
#
|
||||
loadavg: loadavg.c config.h
|
||||
@rm -f loadavg
|
||||
$(LINK) -I. -I$(srcdir) -DHAVE_CONFIG_H -DTEST $(make_LDFLAGS) loadavg.c $(LIBS)
|
||||
$(LINK) -DTEST $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(make_LDFLAGS) loadavg.c $(LIBS)
|
||||
|
||||
# We copy getloadavg.c into a different file rather than compiling it
|
||||
# directly because some compilers clobber getloadavg.o in the process.
|
||||
@@ -97,30 +132,31 @@ check-loadavg: loadavg
|
||||
|
||||
# > check-regression
|
||||
#
|
||||
# Look for the make test suite, and run it if found. Look in MAKE_TEST if
|
||||
# specified, or else in the srcdir or the distdir, their parents, and _their_
|
||||
# parents.
|
||||
# Look for the make test suite, and run it if found and we can find perl.
|
||||
# If we're building outside the tree, we use symlinks to make a local copy of
|
||||
# the test suite. Unfortunately the test suite itself isn't localizable yet.
|
||||
#
|
||||
MAKETESTFLAGS =
|
||||
|
||||
check-regression: all
|
||||
@here=`pwd`; testdir=""; \
|
||||
case "$(MAKE_TEST)" in "") \
|
||||
for d1 in $$here $(srcdir); do \
|
||||
for d2 in ../.. .. .; do \
|
||||
all=`echo $$d1/$$d2/make-test-[0-9]*/run_make_tests`; \
|
||||
case "$$all" in \
|
||||
"$$d1/$$d2/make-test-[0-9]*/run_make_tests") : ;; \
|
||||
*) try=`for x in $$all; do echo $$x; done | sort | tail -1`;\
|
||||
testdir=`dirname $$try` ;; esac; \
|
||||
done; done ;; \
|
||||
*) testdir="$(MAKE_TEST)" ;; \
|
||||
esac; \
|
||||
case "$$testdir" in \
|
||||
"") echo "Couldn't find make-test-* regression test suite."; exit 0;; \
|
||||
esac; \
|
||||
echo "cd $$testdir && ./run_make_tests -make $$here/make $(MAKETESTFLAGS)"; \
|
||||
cd $$testdir && ./run_make_tests -make $$here/make $(MAKETESTFLAGS)
|
||||
check-regression:
|
||||
@if test -f "$(srcdir)/tests/run_make_tests"; then \
|
||||
if $(PERL) -v >/dev/null 2>&1; then \
|
||||
case `cd $(srcdir); pwd` in `pwd`) : ;; \
|
||||
*) test -d tests || mkdir tests; \
|
||||
rm -f srctests; \
|
||||
if ln -s "$(srcdir)/tests" srctests; then \
|
||||
for f in run_make_tests run_make_tests.pl test_driver.pl scripts; do \
|
||||
rm -f tests/$$f; ln -s ../srctests/$$f tests; \
|
||||
done; fi ;; \
|
||||
esac; \
|
||||
echo "cd tests && $(PERL) ./run_make_tests.pl -make ../make $(MAKETESTFLAGS)"; \
|
||||
cd tests && $(PERL) ./run_make_tests.pl -make ../make $(MAKETESTFLAGS); \
|
||||
else \
|
||||
echo "Can't find a working Perl ($(PERL)); the test suite requires Perl."; \
|
||||
fi; \
|
||||
else \
|
||||
echo "Can't find the GNU Make test suite ($(srcdir)/tests)."; \
|
||||
fi
|
||||
|
||||
|
||||
# --------------- Local CLEAN section
|
||||
|
||||
80
NEWS
80
NEWS
@@ -1,28 +1,77 @@
|
||||
GNU make NEWS -*-indented-text-*-
|
||||
History of user-visible changes.
|
||||
21 Jul 1999
|
||||
27 Mar 2000
|
||||
|
||||
Copyright (C) 1992,93,94,95,96,97,98,1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 1992,93,94,95,96,97,98,99,2000 Free Software Foundation, Inc.
|
||||
See the end for copying conditions.
|
||||
|
||||
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.
|
||||
Please send GNU make bug reports to <bug-make@gnu.org>.
|
||||
See the README file and the GNU make manual for details on sending bug
|
||||
reports.
|
||||
|
||||
Version 3.79
|
||||
|
||||
* GNU make optionally supports internationalization and locales via the
|
||||
GNU gettext (or local gettext if suitable) package. See the ABOUT-NLS
|
||||
file for more information on configuring GNU make for NLS.
|
||||
|
||||
* Previously, GNU make quoted variables such as MAKEFLAGS and
|
||||
MAKEOVERRIDES for proper parsing by the shell. This allowed them to
|
||||
be used within make build scripts. However, using them there is not
|
||||
proper behavior: they are meant to be passed to subshells via the
|
||||
environment. Unfortunately the values were not quoted properly to be
|
||||
passed through the environment. This meant that make didn't properly
|
||||
pass some types of command line values to submakes.
|
||||
|
||||
With this version we change that behavior: now these variables are
|
||||
quoted properly for passing through the environment, which is the
|
||||
correct way to do it. If you previously used these variables
|
||||
explicitly within a make rule you may need to re-examine your use for
|
||||
correctness given this change.
|
||||
|
||||
* A new psuedo-target .NOTPARALLEL is available. If defined, the
|
||||
current makefile is run serially regardless of the value of -j.
|
||||
However, submakes are still eligible for parallel execution.
|
||||
|
||||
* The --debug option has changed: it now allows optional flags
|
||||
controlling the amount and type of debugging output. By default only
|
||||
a minimal amount information is generated, displaying the names of
|
||||
"normal" targets (not makefiles) that were deemed out of date and in
|
||||
need of being rebuilt.
|
||||
|
||||
Note that the -d option behaves as before: it takes no arguments and
|
||||
all debugging information is generated.
|
||||
|
||||
* The `-p' (print database) output now includes filename and linenumber
|
||||
information for variable definitions, to help debugging.
|
||||
|
||||
* The wordlist function no longer reverses its arguments if the "start"
|
||||
value is greater than the "end" value. If that's true, nothing is
|
||||
returned.
|
||||
|
||||
* Hartmut Becker provided many updates for the VMS port of GNU make.
|
||||
See the readme.vms file for more details.
|
||||
|
||||
Version 3.78
|
||||
|
||||
* Two new functions, $(error ...) and $(warning ...) are provided. The
|
||||
* 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 provided. This allows users to create
|
||||
* A new function $(call ...) is available. This allows users to create
|
||||
their own parameterized macros and invoke them later. Original
|
||||
implementation of this feature was provided by Han-Wen Nienhuys
|
||||
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.
|
||||
|
||||
@@ -42,6 +91,25 @@ Version 3.78
|
||||
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.
|
||||
|
||||
* GNU make supports the "big archive" library format introduced in AIX 4.3.
|
||||
|
||||
* GNU make supports large files on AIX, HP-UX, and IRIX. These changes
|
||||
were provided by Paul Eggert <eggert@twinsun.com>. (Large file
|
||||
support for Solaris and Linux was introduced in 3.77, but the
|
||||
configuration had issues: these have also been resolved).
|
||||
|
||||
* The Windows 95/98/NT (W32) version of GNU make now has native support
|
||||
for the Cygnus Cygwin release B20.1 shell (bash).
|
||||
|
||||
* The GNU make regression test suite, long available separately "under
|
||||
the table", has been integrated into the release. You can invoke it
|
||||
by running "make check" in the distribution. Note that it requires
|
||||
Perl (either Perl 4 or Perl 5) to run.
|
||||
|
||||
Version 3.77
|
||||
|
||||
|
||||
@@ -50,8 +50,10 @@ all: config.h subproc Release Debug
|
||||
#
|
||||
subproc: w32/subproc/WinDebug/subproc.lib w32/subproc/WinRel/subproc.lib
|
||||
|
||||
w32/subproc/WinDebug/subproc.lib w32/subproc/WinRel/subproc.lib:
|
||||
w32/subproc/WinDebug/subproc.lib w32/subproc/WinRel/subproc.lib: w32/subproc/misc.c w32/subproc/sub_proc.c w32/subproc/w32err.c
|
||||
subproc.bat $(SUBPROC_MAKEFILE) $(MAKE)
|
||||
if exist WinDebug\make.exe erase WinDebug\make.exe
|
||||
if exist WinRel\make.exe erase WinRel\make.exe
|
||||
|
||||
config.h: config.h.W32
|
||||
copy $? $@
|
||||
@@ -62,9 +64,11 @@ Debug:
|
||||
$(MAKE) /f $(MAKEFILE) LDFLAGS="$(LDFLAGS_debug)" CFLAGS="$(CFLAGS_debug)" OUTDIR=WinDebug WinDebug/make.exe
|
||||
|
||||
clean:
|
||||
rmdir /s /q WinDebug WinRel
|
||||
rmdir /s /q w32\subproc\WinDebug w32\subproc\WinRel
|
||||
erase config.h
|
||||
if exist WinDebug\nul rmdir /s /q WinDebug
|
||||
if exist WinRel\nul rmdir /s /q WinRel
|
||||
if exist w32\subproc\WinDebug\nul rmdir /s /q w32\subproc\WinDebug
|
||||
if exist w32\subproc\WinRel\nul rmdir /s /q w32\subproc\WinRel
|
||||
if exist config.h erase config.h
|
||||
erase *.pdb
|
||||
|
||||
$(OUTDIR):
|
||||
|
||||
@@ -30,6 +30,9 @@ New (since 3.74) DOS-specific features:
|
||||
targets like "install:" and "clean:" still need additional
|
||||
programs, though, see below.)
|
||||
|
||||
10. Beginning with v3.78, the test suite works in the DJGPP
|
||||
environment (requires Perl and auxiliary tools; see below).
|
||||
|
||||
|
||||
To build:
|
||||
|
||||
@@ -100,6 +103,9 @@ To build:
|
||||
7. The `clean' targets also require Unix-style shell, and GNU Sed
|
||||
and `rm' programs (the latter from Fileutils).
|
||||
|
||||
8. To run the test suite, type "make check". This requires a Unix
|
||||
shell (I used the DJGPP port of Bash 2.03), Perl, Sed, Fileutils
|
||||
and Sh-utils.
|
||||
|
||||
|
||||
Notes:
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
Port of GNU make to Windows NT and Windows 95
|
||||
Builds natively with MSVC 2.x or MSVC 4.x compilers.
|
||||
Should also build fine with MSVC 5.x and 6.x (though not confirmed).
|
||||
|
||||
To build with nmake on Windows NT or Windows 95:
|
||||
This Windows 32-bit port of GNU make is maintained primarily by Rob
|
||||
Tulloh, who is also the author of this README.
|
||||
|
||||
To build with nmake on Windows NT, Windows 95, or Windows 98:
|
||||
|
||||
1. Make sure cl.exe is in your %Path%. Example:
|
||||
|
||||
@@ -18,6 +22,15 @@ To build with nmake on Windows NT or Windows 95:
|
||||
4. nmake /f NMakefile
|
||||
|
||||
|
||||
A short cut to steps 1, 2, and 3 is to run VCVARS32.bat before
|
||||
invoking namke. For example:
|
||||
|
||||
c:
|
||||
cd \msdev\bin
|
||||
VCVARS32.bat
|
||||
cd \path\to\make-%VERSION%
|
||||
nmake /f NMakefile
|
||||
|
||||
There is a bat file (build_w32.bat) for folks who have fear of nmake.
|
||||
|
||||
Outputs:
|
||||
@@ -28,47 +41,58 @@ Outputs:
|
||||
|
||||
-- Notes/Caveats --
|
||||
|
||||
GNU make on Windows 32-bit platforms:
|
||||
|
||||
This version of make is ported natively to Windows32 platforms
|
||||
(Windows NT 3.51, Windows NT 4.0, Windows 95, and Windows 98). It
|
||||
does not rely on any 3rd party software or add-on packages for
|
||||
building. The only thing needed is a version of Visual C++,
|
||||
which is the predominant compiler used on Windows32 platforms.
|
||||
|
||||
Do not confuse this port of GNU make with other Windows32 projects
|
||||
which provide a GNU make binary. These are separate projects
|
||||
and are not connected to this port effort.
|
||||
|
||||
GNU make and sh.exe:
|
||||
|
||||
This port prefers you have a working sh.exe somewhere on your
|
||||
system. If you don't have sh.exe, port falls back to
|
||||
system. If you don't have sh.exe, the port falls back to
|
||||
MSDOS mode for launching programs (via a batch file).
|
||||
The MSDOS mode style execution has not been tested too
|
||||
carefully though (I use GNU bash as sh.exe).
|
||||
The MSDOS mode style execution has not been tested that
|
||||
carefully though (The author uses GNU bash as sh.exe).
|
||||
|
||||
There are very few true ports of Bourne shell for NT right now.
|
||||
There is a version of GNU bash available from Cygnus gnu-win32
|
||||
porting effort. Other possibilities are to get the MKS version
|
||||
of sh.exe or to build your own with a package like
|
||||
NutCracker (DataFocus) or Portage (Consensys).
|
||||
There is a version of GNU bash available from Cygnus "Cygwin"
|
||||
porting effort (http://sourceware.cygnus.com/cygwin).
|
||||
Other possibilities are the MKS version of sh.exe, or building
|
||||
your own with a package like NutCracker (DataFocus) or Portage
|
||||
(Consensys).
|
||||
|
||||
Tivoli uses a homegrown port of GNU bash which is not (yet)
|
||||
freely available. It may be available someday, but I am not in control
|
||||
of this decision nor do I influence it. Sorry!
|
||||
GNU make and brain-dead shells (BATCH_MODE_ONLY_SHELL):
|
||||
|
||||
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.
|
||||
Some versions of Bourne shell does not behave well when invoked
|
||||
as 'sh -c' from CreateProcess(). The main problem is they seem
|
||||
to have a hard time handling quoted strings correctly. This can
|
||||
be circumvented by writing commands to be executed to a batch
|
||||
file and then executing the command by calling 'sh file'.
|
||||
|
||||
To work around this difficulty, this version of make supports
|
||||
a new batch mode. When BATCH_MODE_ONLY_SHELL is defined at compile
|
||||
a 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
|
||||
A native Windows32 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 Cygnus GNU Windows32 tools:
|
||||
|
||||
GNU make and MKS shell
|
||||
Good news! Make now has native support for Cygwin sh. To enable,
|
||||
define the HAVE_CYGWIN_SHELL in config.h and rebuild make
|
||||
from scratch. This version of make tested with B20.1 of Cygwin.
|
||||
Do not define BATCH_MODE_ONLY_SHELL if you use HAVE_CYGWIN_SHELL.
|
||||
|
||||
GNU make and the 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
|
||||
@@ -101,9 +125,6 @@ GNU make handling of drive letters in pathnames (PATH, vpath, VPATH):
|
||||
/some/path/x:/some/path/y
|
||||
x:/some/path/x:x:/some/path/y
|
||||
|
||||
These caveats affect Windows systems only (Windows NT and
|
||||
Windows 95) and can be ignored for other platforms.
|
||||
|
||||
Please note that you are free to mix colon and semi-colon in the
|
||||
specification of paths. Make is able to figure out the intended
|
||||
result and convert the paths internally to the format needed
|
||||
@@ -118,25 +139,27 @@ GNU make handling of drive letters in pathnames (PATH, vpath, VPATH):
|
||||
GNU make test suite:
|
||||
|
||||
I verified all functionality with a slightly modified version
|
||||
of make-test-0.4.5 (modifications to get test suite to run
|
||||
of make-test-%VERSION% (modifications to get test suite to run
|
||||
on Windows NT). All tests pass in an environment that includes
|
||||
sh.exe. Tested on both Windows NT and Windows 95.
|
||||
sh.exe. Tests were performed on both Windows NT and Windows 95.
|
||||
|
||||
Building GNU make on Windows NT and Windows 95 with Microsoft Visual C
|
||||
Building GNU make on Windows NT and Windows 95/98 with Microsoft Visual C:
|
||||
|
||||
I did not provide a Visual C project file with this port as
|
||||
the project file would not be considered freely distributable
|
||||
(or so I think). It is easy enough to create one though if
|
||||
(or so I think). It is easy enough to create one, though, if
|
||||
you know how to use Visual C.
|
||||
|
||||
I build the program statically to avoid problems locating DLL's
|
||||
on machines that may not have MSVC runtime installed. If you
|
||||
prefer, you can change make to build with shared libraries by
|
||||
changing /MT to /MD in the NMakefile (or build_w32.bat).
|
||||
changing /MT to /MD in the NMakefile (or in build_w32.bat).
|
||||
|
||||
Program has not been built under non-Intel architectures (yet).
|
||||
The program has not been built for non-Intel architectures (yet).
|
||||
|
||||
I have not tried to build with any other compilers than MSVC.
|
||||
I have not tried to build with any other compilers than MSVC. I
|
||||
have heard that this is possible though so don't be afraid to
|
||||
notify me of your successes!
|
||||
|
||||
Pathnames and white space:
|
||||
|
||||
@@ -206,17 +229,13 @@ SAMBA/NTFS/VFAT:
|
||||
under VFAT. VFAT users may wish to be aware that this port
|
||||
of make does respect case sensitivity.
|
||||
|
||||
Version 3.76 contains some preliminary support for FAT. Make
|
||||
now tries to work around some difficulties with stat'ing of
|
||||
FAT:
|
||||
|
||||
Version 3.76 added support for FAT filesystems. Make
|
||||
works around some difficulties with stat'ing of
|
||||
files and caching of filenames and directories internally.
|
||||
There is still a known problem with filenames sometimes being
|
||||
found to have modification dates in the future which cause make
|
||||
to complain about the file and exit (remake.c).
|
||||
|
||||
Bug reports:
|
||||
|
||||
Please submit bugs via the normal bug reporting mechanism
|
||||
which is described in one of the Texinfo files. If you don't
|
||||
have Texinfo for Windows NT or Windows 95, these files are simple
|
||||
text files and can be read with a text editor.
|
||||
|
||||
Please submit bugs via the normal bug reporting mechanism which
|
||||
is described in the GNU make manual and the base README.
|
||||
@@ -56,6 +56,28 @@ See the documentation for Customs for information on starting and
|
||||
configuring Customs.
|
||||
|
||||
|
||||
INVOKING CUSTOMS-IZED GNU MAKE
|
||||
-----------------------------
|
||||
|
||||
One thing you should be aware of is that the default build environment
|
||||
for Customs requires root permissions. Practically, this means that GNU
|
||||
make must be installed setuid root to use Customs.
|
||||
|
||||
If you don't want to do this, you can build Customs such that root
|
||||
permissions are not necessary. Andreas Stolcke <stolcke@speech.sri.com>
|
||||
writes:
|
||||
|
||||
> pmake, gnumake or any other customs client program is not required to
|
||||
> be suid root if customs was compiled WITHOUT the USE_RESERVED_PORTS
|
||||
> option in customs/config.h. Make sure the "customs" service in
|
||||
> /etc/services is defined accordingly (port 8231 instead of 1001).
|
||||
|
||||
> Not using USE_RESERVED_PORTS means that a user with programming
|
||||
> skills could impersonate another user by writing a fake customs
|
||||
> client that pretends to be someone other than himself. See the
|
||||
> discussion in etc/SECURITY.
|
||||
|
||||
|
||||
PROBLEMS
|
||||
--------
|
||||
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
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.
|
||||
|
||||
Please check the system-specific notes below for any caveats related to
|
||||
your operating system.
|
||||
|
||||
For general building and installation instructions, see the file INSTALL.
|
||||
|
||||
@@ -15,6 +19,13 @@ Some systems' Make programs are broken and cannot process the Makefile for
|
||||
GNU Make. If you get errors from your system's Make when building GNU
|
||||
Make, try using `build.sh' instead.
|
||||
|
||||
|
||||
GNU Make is free software. See the file COPYING for copying conditions.
|
||||
|
||||
|
||||
Documentation
|
||||
-------------
|
||||
|
||||
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
|
||||
@@ -24,9 +35,23 @@ site. There is information there about ordering hardcopy documentation.
|
||||
http://www.gnu.org/doc/doc.html
|
||||
http://www.gnu.org/manual/manual.html
|
||||
|
||||
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.
|
||||
You can also find the latest versions of GNU Make from there.
|
||||
|
||||
|
||||
Bug Reporting
|
||||
-------------
|
||||
|
||||
You can send GNU make bug reports to <bug-make@gnu.org>. Please see the
|
||||
section of the GNU make manual entitled `Problems and Bugs' for
|
||||
information on submitting useful and complete bug reports.
|
||||
|
||||
You can also use the FSF's online bug tracking system to submit new
|
||||
problem reports or search for existing ones. A web interface is
|
||||
available here:
|
||||
|
||||
http://www-gnats.gnu.org:8080/cgi-bin/wwwgnats.pl
|
||||
|
||||
Use the Category "make".
|
||||
|
||||
If you need help using GNU make, try these forums:
|
||||
|
||||
@@ -35,15 +60,36 @@ If you need help using GNU make, try these forums:
|
||||
news:gnu.utils.help
|
||||
news:gnu.utils.bug
|
||||
|
||||
Also:
|
||||
|
||||
CVS Access
|
||||
----------
|
||||
|
||||
The GNU make source repository is available via anonymous CVS from the
|
||||
GNU Subversions CVS server; look here for details:
|
||||
|
||||
http://www.gnu.org/software/devel.html
|
||||
|
||||
Please note: you won't be able to build GNU make from CVS without
|
||||
installing appropriate maintainer's tools, such as automake, autoconf,
|
||||
GNU make, and GCC. There are no instructions on this included with the
|
||||
tree, so you must be familiar with the installation and use of these
|
||||
tools. We make no guarantees about the contents or quality of the
|
||||
latest code in the CVS repository: it is not unheard of for code that is
|
||||
known to be broken to be checked in. Use at your own risk.
|
||||
|
||||
|
||||
Ports
|
||||
-----
|
||||
|
||||
- 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.vms for details about GNU Make on OpenVMS.
|
||||
|
||||
- See README.Amiga for details about GNU Make on AmigaDOS.
|
||||
|
||||
- See README.W32 for details about GNU Make on Windows NT, 95, or 98.
|
||||
|
||||
- See README.DOS for compilation instructions on MS-DOS and MS-Windows
|
||||
using DJGPP tools.
|
||||
|
||||
@@ -51,6 +97,15 @@ Also:
|
||||
of DJGPP; see the WWW page http://www.delorie.com/djgpp/ for more
|
||||
information.
|
||||
|
||||
Please note there are two _separate_ ports of GNU make for Microsoft
|
||||
systems: a native Windows tool built with (for example) MSVC or Cygwin,
|
||||
and a DOS-based tool built with DJGPP. Please be sure you are looking
|
||||
at the right README!
|
||||
|
||||
|
||||
System-specific Notes
|
||||
---------------------
|
||||
|
||||
It has been reported that the XLC 1.2 compiler on AIX 3.2 is buggy such
|
||||
that if you compile make with `cc -O' on AIX 3.2, it will not work correctly.
|
||||
It is said that using `cc' without `-O' does work.
|
||||
@@ -61,9 +116,8 @@ debug this code, you can do `make check-loadavg' to see if it works
|
||||
properly on your system. (You must run `configure' beforehand, but you
|
||||
need not build Make itself to run this test.)
|
||||
|
||||
See the file NEWS for what has changed since previous releases.
|
||||
|
||||
GNU Make is fully documented in make.texinfo. See the section entitled
|
||||
`Problems and Bugs' for information on submitting bug reports.
|
||||
|
||||
GNU Make is free software. See the file COPYING for copying conditions.
|
||||
Another potential source of porting problems is the support for large
|
||||
files (LFS) in configure for those operating systems that provide it.
|
||||
Please report any bugs that you find in this area. If you run into
|
||||
difficulties, then as a workaround you should be able to disable LFS by
|
||||
adding the `--disable-largefile' option to the `configure' script.
|
||||
|
||||
118
TODO.private
118
TODO.private
@@ -14,38 +14,106 @@ However, if you see something here you really, really want, speak up.
|
||||
All other things being equal, I will tend to implement things that seem
|
||||
to maximize user satisfaction.
|
||||
|
||||
Also, this list doesn't include things which I'm pretty sure would
|
||||
require serious, fundamental change to GNU make; those things belong on
|
||||
the mythical "Make 4.0" list. I admit, that line can be somewhat fuzzy :)
|
||||
If you want to implement some of them yourself, barring the ones I've
|
||||
marked below, have at it! Please contact me first to let me know you're
|
||||
working on it, and give me some info about the design--and, critically,
|
||||
information about any user-visible syntax change, etc.
|
||||
|
||||
|
||||
* Per-target variable definitions (a la SunOS make's ":=" feature, but
|
||||
note the syntax here will definitely be different!)
|
||||
The Top Item
|
||||
------------
|
||||
|
||||
* Multi-token pattern rule matching (allow %1/%2.c : %1/obj/%2.o, etc.)
|
||||
If you know perl (or want to learn DejaGNU or similar), the number one
|
||||
priority on my list of things I don't have time to do right now is
|
||||
fixing up the GNU make test suite. Most importantly it needs to be made
|
||||
"parallelizable", so more than one regression can run at the same time
|
||||
(essentially, make the "work" directory local). Also, the CWD during
|
||||
the test should be in the work directory; right now sometimes tests leak
|
||||
files into the main directory which causes subsequent tests to fail
|
||||
(some tests may need to be tweaked). Beyond that, any cleanup done to
|
||||
make writing, reading, or handling tests simpler would be great! Please
|
||||
feel free to make whatever changes you like to the current tests, given
|
||||
some high-level goals, and that you'll port the current tests to
|
||||
whatever you do :).
|
||||
|
||||
* More robust clock skew detection algorithm.
|
||||
|
||||
* Provide MAKETARGETS and MAKEVARIABLES variables, containing the
|
||||
The Rest of the List
|
||||
--------------------
|
||||
|
||||
1) Allow variables/functions to expand to other make rules which are
|
||||
then interpreted, with newlines handled correctly. This is a
|
||||
biggee, and is on my plate. I already have partially-working code.
|
||||
|
||||
2) Option to check more than timestamps to determine if targets have
|
||||
changed. This is also a very big one. It's _close_ to my plate :),
|
||||
and I have very definite ideas about how I want it done. Please
|
||||
pick something else unless you must have this feature. If you try
|
||||
it, please work _extremely_ closely with me on it.
|
||||
|
||||
2a) Possibly a special case of this is the .KEEP_STATE feature of Sun's
|
||||
make. Some great folks at W U. in Canada did an implementation of
|
||||
this for a class project. Their approach is reasonable and
|
||||
workable, but doesn't really fit into my ideas for #2. Maybe
|
||||
that's OK. I have paperwork for their work so if you want to do
|
||||
this one talk to me to get what they've already done.
|
||||
|
||||
[K R Praveen <praveen@cair.res.in>]
|
||||
|
||||
3) Currently you can use "%.foo %.bar : %.baz" to mean that one
|
||||
invocation of the rule builds both targets. GNU make needs a way to
|
||||
do that for explicit rules, too. I heard a rumor that some versions
|
||||
of make all you to say "a.foo + a.bar : a.baz" to do this (i.e., a
|
||||
"+" means one invocation builds both). Don't know if this is the
|
||||
best syntax or not... what if you say "a.foo + a.bar a.bam : a.baz";
|
||||
what does that mean?
|
||||
|
||||
4) Multi-token pattern rule matching (allow %1/%2.c : %1/obj/%2.o,
|
||||
etc., or something like that). I have an implementation of this
|
||||
already, it just needs some refinement... maybe. Additionally I
|
||||
think it only works for static pattern rules; it might need to be
|
||||
fixed up to work with normal pattern rules, too.
|
||||
|
||||
5) More robust clock skew detection algorithm: less false hits. I have
|
||||
some notes on this from various discussions.
|
||||
|
||||
6) Provide MAKETARGETS and MAKEVARIABLES variables, containing the
|
||||
names of the targets and variables defined in the makefile.
|
||||
|
||||
* If the user asks for parallelization, rebuild any "include"'d files
|
||||
in parallel as well (helps esp. when there are many .d files to be
|
||||
built).
|
||||
Actually, I now think a $(targets ...) function, at least, would be
|
||||
better than a MAKETARGETS variable. The argument would be types of
|
||||
targets to list: "phony" is the most useful one. I suppose
|
||||
"default" might also be useful. Maybe some others; check the
|
||||
bitfields to see what might be handy. This one is pretty easy.
|
||||
|
||||
* Allow variables/functions to expand to other make rules which are
|
||||
then interpreted, with newlines handled correctly.
|
||||
|
||||
* More intelligent submake handling when doing parallel makes:
|
||||
currently each submake gets a "-j 1" option. It would be good if
|
||||
make was smart enough to give some/all its slots to the submake
|
||||
(esp. if there is no other rule that can be run by the parent in
|
||||
parallel, a common situation). Doing this perfectly might be too
|
||||
hard, but something less than perfect is certainly possible.
|
||||
|
||||
* Option to check more than timestamps to determine if targets have
|
||||
changed (MD5 checksumming?)
|
||||
|
||||
* Some sort of operating-system independent way of handling paths
|
||||
7) Some sort of operating-system independent way of handling paths
|
||||
would be outstanding, so makefiles can be written for UNIX, VMS,
|
||||
DOS, MS-Windows, Amiga, etc. with a minimum of specialization.
|
||||
|
||||
Or, perhaps related/instead of, some sort of meta-quoting syntax so
|
||||
make can deal with filenames containing spaces, colons, etc. I
|
||||
dunno, maybe something like $[...]? This may well not be worth
|
||||
doing until #1 is done.
|
||||
|
||||
9) Right now the .PRECIOUS, .INTERMEDIATE, and .SECONDARY
|
||||
psuedo-targets have different capabilities. For example, .PRECIOUS
|
||||
can take a "%", the others can't. Etc. These should all work the
|
||||
same, insofar as that makes sense.
|
||||
|
||||
10) A syntax that specifies a build order _without_ implying a
|
||||
dependency relationship. That is, a way to say "A must be built
|
||||
before B" that doesn't force B to be built when A changes. This is
|
||||
very important for parallel builds: sometimes you need some stuff
|
||||
done first but you don't want to rebuild everything because of it.
|
||||
|
||||
11) Improved debugging/logging/etc. capabilities. This area is in
|
||||
desparate need of work; the current -d, -s, etc. options are simply
|
||||
insufficient. We need different levels of output: some that are
|
||||
much less verbose. E.g., maybe just print one line about why make
|
||||
decides to rebuild each target. Also, we could use something like
|
||||
the -E option for preprocessors; this would print out makefiles
|
||||
after resolving all includes, immediate variable reverences, etc.
|
||||
Also, a way to turn on and off obeying the "@" token for scripts
|
||||
that's independent of -n (so we could have them in effect for -n,
|
||||
and have them not in effect without -n).
|
||||
|
||||
Maybe other things. Contact me about the user interface.
|
||||
|
||||
18
acconfig.h
18
acconfig.h
@@ -4,6 +4,24 @@
|
||||
/* Version of this package (needed by automake) */
|
||||
#undef VERSION
|
||||
|
||||
/* Define to 1 if NLS is requested. */
|
||||
#undef ENABLE_NLS
|
||||
|
||||
/* Define as 1 if you have dcgettext. */
|
||||
#undef HAVE_DCGETTEXT
|
||||
|
||||
/* Define as 1 if you have gettext and don't want to use GNU gettext. */
|
||||
#undef HAVE_GETTEXT
|
||||
|
||||
/* Define if your locale.h file contains LC_MESSAGES. */
|
||||
#undef HAVE_LC_MESSAGES
|
||||
|
||||
/* Define to the installation directory for locales. */
|
||||
#undef LOCALEDIR
|
||||
|
||||
/* Define as 1 if you have the stpcpy function. */
|
||||
#undef HAVE_STPCPY
|
||||
|
||||
/* Define to the name of the SCCS `get' command. */
|
||||
#undef SCCS_GET
|
||||
|
||||
|
||||
357
acinclude.m4
357
acinclude.m4
@@ -85,50 +85,137 @@ changequote([,])dnl
|
||||
])dnl
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl Got this from the GNU fileutils 3.16r distribution
|
||||
dnl Got this from the GNU tar 1.13.11 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 By default, many hosts won't let programs access large files;
|
||||
dnl one must use special compiler options to get large-file access to work.
|
||||
dnl For more 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 Written by Paul Eggert <eggert@twinsun.com>.
|
||||
|
||||
dnl Internal subroutine of AC_SYS_LARGEFILE.
|
||||
dnl AC_SYS_LARGEFILE_FLAGS(FLAGSNAME)
|
||||
AC_DEFUN(AC_SYS_LARGEFILE_FLAGS,
|
||||
[AC_CACHE_CHECK([for $1 value to request large file support],
|
||||
ac_cv_sys_largefile_$1,
|
||||
[if ($GETCONF LFS_$1) >conftest.1 2>conftest.2 && test ! -s conftest.2
|
||||
then
|
||||
ac_cv_sys_largefile_$1=`cat conftest.1`
|
||||
else
|
||||
ac_cv_sys_largefile_$1=no
|
||||
ifelse($1, CFLAGS,
|
||||
[case "$host_os" in
|
||||
# HP-UX 10.20 requires -D__STDC_EXT__ with gcc 2.95.1.
|
||||
changequote(, )dnl
|
||||
hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*)
|
||||
changequote([, ])dnl
|
||||
if test "$GCC" = yes; then
|
||||
ac_cv_sys_largefile_CFLAGS=-D__STDC_EXT__
|
||||
fi
|
||||
;;
|
||||
# IRIX 6.2 and later require cc -n32.
|
||||
changequote(, )dnl
|
||||
irix6.[2-9]* | irix6.1[0-9]* | irix[7-9].* | irix[1-9][0-9]*)
|
||||
changequote([, ])dnl
|
||||
if test "$GCC" != yes; then
|
||||
ac_cv_sys_largefile_CFLAGS=-n32
|
||||
fi
|
||||
esac
|
||||
if test "$ac_cv_sys_largefile_CFLAGS" != no; then
|
||||
ac_save_CC="$CC"
|
||||
CC="$CC $ac_cv_sys_largefile_CFLAGS"
|
||||
AC_TRY_LINK(, , , ac_cv_sys_largefile_CFLAGS=no)
|
||||
CC="$ac_save_CC"
|
||||
fi])
|
||||
fi
|
||||
rm -f conftest*])])
|
||||
|
||||
dnl Internal subroutine of AC_SYS_LARGEFILE.
|
||||
dnl AC_SYS_LARGEFILE_SPACE_APPEND(VAR, VAL)
|
||||
AC_DEFUN(AC_SYS_LARGEFILE_SPACE_APPEND,
|
||||
[case $2 in
|
||||
no) ;;
|
||||
?*)
|
||||
case "[$]$1" in
|
||||
'') $1=$2 ;;
|
||||
*) $1=[$]$1' '$2 ;;
|
||||
esac ;;
|
||||
esac])
|
||||
|
||||
dnl Internal subroutine of AC_SYS_LARGEFILE.
|
||||
dnl AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, CACHE-VAR, COMMENT, CODE-TO-SET-DEFAULT)
|
||||
AC_DEFUN(AC_SYS_LARGEFILE_MACRO_VALUE,
|
||||
[AC_CACHE_CHECK([for $1], $2,
|
||||
[$2=no
|
||||
changequote(, )dnl
|
||||
$4
|
||||
for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do
|
||||
case "$ac_flag" in
|
||||
-D$1)
|
||||
$2=1 ;;
|
||||
-D$1=*)
|
||||
$2=`expr " $ac_flag" : '[^=]*=\(.*\)'` ;;
|
||||
esac
|
||||
done
|
||||
changequote([, ])dnl
|
||||
])
|
||||
if test "[$]$2" != no; then
|
||||
AC_DEFINE_UNQUOTED([$1], [$]$2, [$3])
|
||||
fi])
|
||||
|
||||
AC_DEFUN(AC_SYS_LARGEFILE,
|
||||
[AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
AC_ARG_ENABLE(largefile,
|
||||
[ --disable-largefile omit support for large files])
|
||||
if test "$enable_largefile" != no; then
|
||||
AC_CHECK_TOOL(GETCONF, getconf)
|
||||
AC_SYS_LARGEFILE_FLAGS(CFLAGS)
|
||||
AC_SYS_LARGEFILE_FLAGS(LDFLAGS)
|
||||
AC_SYS_LARGEFILE_FLAGS(LIBS)
|
||||
|
||||
for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do
|
||||
case "$ac_flag" in
|
||||
no) ;;
|
||||
-D_FILE_OFFSET_BITS=*) ;;
|
||||
-D_LARGEFILE_SOURCE | -D_LARGEFILE_SOURCE=*) ;;
|
||||
-D_LARGE_FILES | -D_LARGE_FILES=*) ;;
|
||||
-D?* | -I?*)
|
||||
AC_SYS_LARGEFILE_SPACE_APPEND(CPPFLAGS, "$ac_flag") ;;
|
||||
*)
|
||||
AC_SYS_LARGEFILE_SPACE_APPEND(CFLAGS, "$ac_flag") ;;
|
||||
esac
|
||||
done
|
||||
AC_SYS_LARGEFILE_SPACE_APPEND(LDFLAGS, "$ac_cv_sys_largefile_LDFLAGS")
|
||||
AC_SYS_LARGEFILE_SPACE_APPEND(LIBS, "$ac_cv_sys_largefile_LIBS")
|
||||
AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS,
|
||||
ac_cv_sys_file_offset_bits,
|
||||
[Number of bits in a file offset, on hosts where this is settable.],
|
||||
[case "$host_os" in
|
||||
# HP-UX 10.20 and later
|
||||
hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*)
|
||||
ac_cv_sys_file_offset_bits=64 ;;
|
||||
esac])
|
||||
AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE,
|
||||
ac_cv_sys_largefile_source,
|
||||
[Define to make fseeko etc. visible, on some hosts.],
|
||||
[case "$host_os" in
|
||||
# HP-UX 10.20 and later
|
||||
hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*)
|
||||
ac_cv_sys_largefile_source=1 ;;
|
||||
esac])
|
||||
AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES,
|
||||
ac_cv_sys_large_files,
|
||||
[Define for large files, on AIX-style hosts.],
|
||||
[case "$host_os" in
|
||||
# AIX 4.2 and later
|
||||
aix4.[2-9]* | aix4.1[0-9]* | aix[5-9].* | aix[1-9][0-9]*)
|
||||
ac_cv_sys_large_files=1 ;;
|
||||
esac])
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
@@ -197,8 +284,9 @@ 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_TRY_LINK([unsigned long long ull = 1; int i = 63;],
|
||||
[unsigned long long ullmax = (unsigned long long) -1;
|
||||
return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
|
||||
ac_cv_type_unsigned_long_long=yes,
|
||||
ac_cv_type_unsigned_long_long=no)])
|
||||
if test $ac_cv_type_unsigned_long_long = yes; then
|
||||
@@ -297,3 +385,190 @@ changequote([,]),dnl
|
||||
AC_DEFINE_UNQUOTED(SELECT_FD_SET_CAST,$ac_cast)
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
# The following is taken from automake 1.4,
|
||||
# except that it prefers the compiler option -Ae to "-Aa -D_HPUX_SOURCE"
|
||||
# because only the former supports 64-bit integral types on HP-UX 10.20.
|
||||
|
||||
## ----------------------------------------- ##
|
||||
## ANSIfy the C compiler whenever possible. ##
|
||||
## From Franc,ois Pinard ##
|
||||
## ----------------------------------------- ##
|
||||
|
||||
# serial 2
|
||||
|
||||
# @defmac AC_PROG_CC_STDC
|
||||
# @maindex PROG_CC_STDC
|
||||
# @ovindex CC
|
||||
# If the C compiler in not in ANSI C mode by default, try to add an option
|
||||
# to output variable @code{CC} to make it so. This macro tries various
|
||||
# options that select ANSI C on some system or another. It considers the
|
||||
# compiler to be in ANSI C mode if it handles function prototypes correctly.
|
||||
#
|
||||
# If you use this macro, you should check after calling it whether the C
|
||||
# compiler has been set to accept ANSI C; if not, the shell variable
|
||||
# @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
|
||||
# code in ANSI C, you can make an un-ANSIfied copy of it by using the
|
||||
# program @code{ansi2knr}, which comes with Ghostscript.
|
||||
# @end defmac
|
||||
|
||||
AC_DEFUN(AM_PROG_CC_STDC,
|
||||
[AC_REQUIRE([AC_PROG_CC])
|
||||
AC_BEFORE([$0], [AC_C_INLINE])
|
||||
AC_BEFORE([$0], [AC_C_CONST])
|
||||
dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
|
||||
dnl a magic option to avoid problems with ANSI preprocessor commands
|
||||
dnl like #elif.
|
||||
dnl FIXME: can't do this because then AC_AIX won't work due to a
|
||||
dnl circular dependency.
|
||||
dnl AC_BEFORE([$0], [AC_PROG_CPP])
|
||||
AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
|
||||
AC_CACHE_VAL(am_cv_prog_cc_stdc,
|
||||
[am_cv_prog_cc_stdc=no
|
||||
ac_save_CC="$CC"
|
||||
# Don't try gcc -ansi; that turns off useful extensions and
|
||||
# breaks some systems' header files.
|
||||
# AIX -qlanglvl=ansi
|
||||
# Ultrix and OSF/1 -std1
|
||||
# HP-UX -Aa -D_HPUX_SOURCE
|
||||
# SVR4 -Xc -D__EXTENSIONS__
|
||||
for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
|
||||
do
|
||||
CC="$ac_save_CC $ac_arg"
|
||||
AC_TRY_COMPILE(
|
||||
[#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
|
||||
struct buf { int x; };
|
||||
FILE * (*rcsopen) (struct buf *, struct stat *, int);
|
||||
static char *e (p, i)
|
||||
char **p;
|
||||
int i;
|
||||
{
|
||||
return p[i];
|
||||
}
|
||||
static char *f (char * (*g) (char **, int), char **p, ...)
|
||||
{
|
||||
char *s;
|
||||
va_list v;
|
||||
va_start (v,p);
|
||||
s = g (p, va_arg (v,int));
|
||||
va_end (v);
|
||||
return s;
|
||||
}
|
||||
int test (int i, double x);
|
||||
struct s1 {int (*f) (int a);};
|
||||
struct s2 {int (*f) (double a);};
|
||||
int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
|
||||
int argc;
|
||||
char **argv;
|
||||
], [
|
||||
return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
|
||||
],
|
||||
[am_cv_prog_cc_stdc="$ac_arg"; break])
|
||||
done
|
||||
CC="$ac_save_CC"
|
||||
])
|
||||
if test -z "$am_cv_prog_cc_stdc"; then
|
||||
AC_MSG_RESULT([none needed])
|
||||
else
|
||||
AC_MSG_RESULT($am_cv_prog_cc_stdc)
|
||||
fi
|
||||
case "x$am_cv_prog_cc_stdc" in
|
||||
x|xno) ;;
|
||||
*) CC="$CC $am_cv_prog_cc_stdc" ;;
|
||||
esac
|
||||
])
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl Enable internationalization support for GNU make.
|
||||
dnl Obtained from the libit 0.7 distribution
|
||||
dnl
|
||||
AC_DEFUN(fp_WITH_GETTEXT, [
|
||||
|
||||
AC_MSG_CHECKING(whether NLS is wanted)
|
||||
AC_ARG_ENABLE(nls,
|
||||
[ --disable-nls disallow Native Language Support],
|
||||
enable_nls=$enableval, enable_nls=yes)
|
||||
AC_MSG_RESULT($enable_nls)
|
||||
use_nls=$enable_nls
|
||||
AM_CONDITIONAL(USE_NLS, test $use_nls = yes)
|
||||
|
||||
if test $enable_nls = yes; then
|
||||
AC_DEFINE(ENABLE_NLS)
|
||||
|
||||
AC_ARG_WITH(catgets,
|
||||
[ --with-catgets say that catgets is not supported],
|
||||
[AC_MSG_WARN([catgets not supported, --with-catgets ignored])])
|
||||
|
||||
AC_CHECK_FUNCS(gettext)
|
||||
AC_CHECK_LIB(intl, gettext, :)
|
||||
if test $ac_cv_lib_intl_gettext$ac_cv_func_gettext != nono; then
|
||||
AC_MSG_CHECKING(whether the included gettext is preferred)
|
||||
AC_ARG_WITH(included-gettext,
|
||||
[ --without-included-gettext avoid our provided version of gettext],
|
||||
with_included_gettext=$withval, with_included_gettext=yes)
|
||||
AC_MSG_RESULT($with_included_gettext)
|
||||
if test $with_included_gettext$ac_cv_func_gettext = nono; then
|
||||
LIBS="$LIBS -lintl"
|
||||
fi
|
||||
else
|
||||
with_included_gettext=yes
|
||||
fi
|
||||
if test $with_included_gettext = yes; then
|
||||
LIBOBJS="$LIBOBJS gettext.o"
|
||||
AC_DEFINE(HAVE_GETTEXT)
|
||||
AC_DEFINE(HAVE_DCGETTEXT)
|
||||
else
|
||||
AC_CHECK_HEADERS(libintl.h)
|
||||
AC_CHECK_FUNCS(dcgettext gettext)
|
||||
fi
|
||||
|
||||
AC_CHECK_HEADERS(locale.h)
|
||||
AC_CHECK_FUNCS(getcwd setlocale stpcpy)
|
||||
AM_LC_MESSAGES
|
||||
|
||||
if test -z "$ALL_LINGUAS"; then
|
||||
AC_MSG_WARN(This package does not install translations yet.)
|
||||
else
|
||||
ac_items="$ALL_LINGUAS"
|
||||
for ac_item in $ac_items; do
|
||||
ALL_POFILES="$ALL_POFILES $ac_item.po"
|
||||
ALL_MOFILES="$ALL_MOFILES $ac_item.mo"
|
||||
done
|
||||
fi
|
||||
AC_SUBST(ALL_LINGUAS)
|
||||
AC_SUBST(ALL_POFILES)
|
||||
AC_SUBST(ALL_MOFILES)
|
||||
|
||||
AC_MSG_CHECKING(which translations to install)
|
||||
if test -z "$LINGUAS"; then
|
||||
ac_print="$ALL_LINGUAS"
|
||||
MOFILES="$ALL_MOFILES"
|
||||
else
|
||||
ac_items="$LINGUAS"
|
||||
for ac_item in $ac_items; do
|
||||
case "$ALL_LINGUAS" in
|
||||
*$ac_item*)
|
||||
ac_print="$ac_print $ac_item"
|
||||
MOFILES="$MOFILES $ac_item.mo"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
AC_SUBST(MOFILES)
|
||||
if test -z "$ac_print"; then
|
||||
AC_MSG_RESULT(none)
|
||||
else
|
||||
AC_MSG_RESULT($ac_print)
|
||||
fi
|
||||
|
||||
if test "x$prefix" = xNONE; then
|
||||
AC_DEFINE_UNQUOTED(LOCALEDIR, "$ac_default_prefix/share/locale")
|
||||
else
|
||||
AC_DEFINE_UNQUOTED(LOCALEDIR, "$prefix/share/locale")
|
||||
fi
|
||||
fi])
|
||||
|
||||
4
ar.c
4
ar.c
@@ -41,7 +41,7 @@ int
|
||||
ar_name (name)
|
||||
char *name;
|
||||
{
|
||||
char *p = index (name, '('), *end = name + strlen (name) - 1;
|
||||
char *p = strchr (name, '('), *end = name + strlen (name) - 1;
|
||||
|
||||
if (p == 0 || p == name || *end != ')')
|
||||
return 0;
|
||||
@@ -61,7 +61,7 @@ void
|
||||
ar_parse_name (name, arname_p, memname_p)
|
||||
char *name, **arname_p, **memname_p;
|
||||
{
|
||||
char *p = index (name, '('), *end = name + strlen (name) - 1;
|
||||
char *p = strchr (name, '('), *end = name + strlen (name) - 1;
|
||||
|
||||
if (arname_p != 0)
|
||||
*arname_p = savestring (name, p - name);
|
||||
|
||||
10
arscan.c
10
arscan.c
@@ -37,8 +37,6 @@ USA. */
|
||||
#include <lbr$routines.h>
|
||||
#endif
|
||||
|
||||
#define uppercasify(str) {char *str1; for (str1 = str; *str1; str1++) *str1 = _toupper(*str1);}
|
||||
|
||||
static void *VMS_lib_idx;
|
||||
|
||||
static char *VMS_saved_memname;
|
||||
@@ -80,10 +78,12 @@ VMS_get_member_info (module, rfa)
|
||||
|
||||
mhd = (struct mhddef *) filename;
|
||||
|
||||
#ifdef __DECC
|
||||
val = decc$fix_time (&mhd->mhd$l_datim);
|
||||
#endif
|
||||
|
||||
for (i = 0; i < module->dsc$w_length; i++)
|
||||
filename[i] = _tolower (module->dsc$a_pointer[i]);
|
||||
filename[i] = _tolower ((unsigned char)module->dsc$a_pointer[i]);
|
||||
|
||||
filename[i] = '\0';
|
||||
|
||||
@@ -172,7 +172,7 @@ ar_scan (archive, function, arg)
|
||||
|
||||
/* For comparison, delete .obj from arg name. */
|
||||
|
||||
p = rindex (VMS_saved_memname, '.');
|
||||
p = strrchr (VMS_saved_memname, '.');
|
||||
if (p)
|
||||
*p = '\0';
|
||||
|
||||
@@ -698,7 +698,7 @@ ar_name_equal (name, mem, truncated)
|
||||
{
|
||||
char *p;
|
||||
|
||||
p = rindex (name, '/');
|
||||
p = strrchr (name, '/');
|
||||
if (p != 0)
|
||||
name = p + 1;
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@ CC='@CC@'
|
||||
CFLAGS='@CFLAGS@'
|
||||
CPPFLAGS='@CPPFLAGS@'
|
||||
LDFLAGS='@LDFLAGS@'
|
||||
defines='@DEFS@ -DLIBDIR="${libdir}" -DINCLUDEDIR="${includedir}"'
|
||||
ALLOCA='@ALLOCA@'
|
||||
LOADLIBES='@LIBS@'
|
||||
extras='@LIBOBJS@'
|
||||
@@ -37,12 +36,17 @@ GLOBLIB='@GLOBLIB@'
|
||||
# Common prefix for machine-independent installed files.
|
||||
prefix='@prefix@'
|
||||
# Common prefix for machine-dependent installed files.
|
||||
exec_prefix='@exec_prefix@'
|
||||
exec_prefix=`eval echo @exec_prefix@`
|
||||
# Directory to find libraries in for `-lXXX'.
|
||||
libdir=${exec_prefix}/lib
|
||||
# Directory to search by default for included makefiles.
|
||||
includedir=${prefix}/include
|
||||
|
||||
localedir=${prefix}/share/locale
|
||||
aliaspath=${localedir}:.
|
||||
|
||||
defines="-DALIASPATH=\"${aliaspath}\" -DLOCALEDIR=\"${localedir}\" -DLIBDIR=\"${libdir}\" -DINCLUDEDIR=\"${includedir}\""' @DEFS@'
|
||||
|
||||
# Exit as soon as any command fails.
|
||||
set -e
|
||||
|
||||
@@ -51,13 +55,14 @@ objs="%objs% remote-${REMOTE}.o ${extras} ${ALLOCA}"
|
||||
|
||||
if [ x"$GLOBLIB" != x ]; then
|
||||
objs="$objs %globobjs%"
|
||||
globinc=-I${srcdir}/glob
|
||||
fi
|
||||
|
||||
# Compile the source files into those objects.
|
||||
for file in `echo ${objs} | sed 's/\.o/.c/g'`; do
|
||||
echo compiling ${file}...
|
||||
$CC $defines $CPPFLAGS $CFLAGS \
|
||||
-c -I. -I${srcdir} ${srcdir}/$file
|
||||
-c -I. -I${srcdir} ${globinc} ${srcdir}/$file
|
||||
done
|
||||
|
||||
# The object files were actually all put in the current directory.
|
||||
|
||||
182
commands.c
182
commands.c
@@ -46,7 +46,7 @@ set_file_variables (file)
|
||||
if (ar_name (file->name))
|
||||
{
|
||||
unsigned int len;
|
||||
p = index (file->name, '(');
|
||||
p = strchr (file->name, '(');
|
||||
at = (char *) alloca (p - file->name + 1);
|
||||
bcopy (file->name, at, p - file->name);
|
||||
at[p - file->name] = '\0';
|
||||
@@ -75,7 +75,7 @@ set_file_variables (file)
|
||||
#ifndef NO_ARCHIVES
|
||||
if (ar_name (file->name))
|
||||
{
|
||||
name = index (file->name, '(') + 1;
|
||||
name = strchr (file->name, '(') + 1;
|
||||
len = strlen (name) - 1;
|
||||
}
|
||||
else
|
||||
@@ -108,7 +108,7 @@ set_file_variables (file)
|
||||
less = at;
|
||||
|
||||
#define DEFINE_VARIABLE(name, len, value) \
|
||||
(void) define_variable_for_file (name, len, value, o_automatic, 0, file)
|
||||
(void) define_variable_for_file (name,len,value,o_automatic,0,file)
|
||||
|
||||
/* Define the variables. */
|
||||
|
||||
@@ -146,7 +146,7 @@ set_file_variables (file)
|
||||
#ifndef NO_ARCHIVES
|
||||
if (ar_name (c))
|
||||
{
|
||||
c = index (c, '(') + 1;
|
||||
c = strchr (c, '(') + 1;
|
||||
len = strlen (c) - 1;
|
||||
}
|
||||
else
|
||||
@@ -188,7 +188,7 @@ set_file_variables (file)
|
||||
#ifndef NO_ARCHIVES
|
||||
if (ar_name (c))
|
||||
{
|
||||
c = index (c, '(') + 1;
|
||||
c = strchr (c, '(') + 1;
|
||||
len = strlen (c) - 1;
|
||||
}
|
||||
else
|
||||
@@ -233,93 +233,97 @@ void
|
||||
chop_commands (cmds)
|
||||
register struct commands *cmds;
|
||||
{
|
||||
if (cmds != 0 && cmds->command_lines == 0)
|
||||
{
|
||||
/* Chop CMDS->commands up into lines in CMDS->command_lines.
|
||||
register char *p;
|
||||
unsigned int nlines, idx;
|
||||
char **lines;
|
||||
|
||||
/* If we don't have any commands,
|
||||
or we already parsed them, never mind. */
|
||||
|
||||
if (!cmds || cmds->command_lines != 0)
|
||||
return;
|
||||
|
||||
/* Chop CMDS->commands up into lines in CMDS->command_lines.
|
||||
Also set the corresponding CMDS->lines_flags elements,
|
||||
and the CMDS->any_recurse flag. */
|
||||
register char *p;
|
||||
unsigned int nlines, idx;
|
||||
char **lines;
|
||||
|
||||
nlines = 5;
|
||||
lines = (char **) xmalloc (5 * sizeof (char *));
|
||||
idx = 0;
|
||||
p = cmds->commands;
|
||||
while (*p != '\0')
|
||||
{
|
||||
char *end = p;
|
||||
find_end:;
|
||||
end = index (end, '\n');
|
||||
if (end == 0)
|
||||
end = p + strlen (p);
|
||||
else if (end > p && end[-1] == '\\')
|
||||
{
|
||||
int backslash = 1;
|
||||
register char *b;
|
||||
for (b = end - 2; b >= p && *b == '\\'; --b)
|
||||
backslash = !backslash;
|
||||
if (backslash)
|
||||
{
|
||||
++end;
|
||||
goto find_end;
|
||||
}
|
||||
}
|
||||
nlines = 5;
|
||||
lines = (char **) xmalloc (5 * sizeof (char *));
|
||||
idx = 0;
|
||||
p = cmds->commands;
|
||||
while (*p != '\0')
|
||||
{
|
||||
char *end = p;
|
||||
find_end:;
|
||||
end = strchr (end, '\n');
|
||||
if (end == 0)
|
||||
end = p + strlen (p);
|
||||
else if (end > p && end[-1] == '\\')
|
||||
{
|
||||
int backslash = 1;
|
||||
register char *b;
|
||||
for (b = end - 2; b >= p && *b == '\\'; --b)
|
||||
backslash = !backslash;
|
||||
if (backslash)
|
||||
{
|
||||
++end;
|
||||
goto find_end;
|
||||
}
|
||||
}
|
||||
|
||||
if (idx == nlines)
|
||||
{
|
||||
nlines += 2;
|
||||
lines = (char **) xrealloc ((char *) lines,
|
||||
nlines * sizeof (char *));
|
||||
}
|
||||
lines[idx++] = savestring (p, end - p);
|
||||
p = end;
|
||||
if (*p != '\0')
|
||||
++p;
|
||||
}
|
||||
if (idx == nlines)
|
||||
{
|
||||
nlines += 2;
|
||||
lines = (char **) xrealloc ((char *) lines,
|
||||
nlines * sizeof (char *));
|
||||
}
|
||||
lines[idx++] = savestring (p, end - p);
|
||||
p = end;
|
||||
if (*p != '\0')
|
||||
++p;
|
||||
}
|
||||
|
||||
if (idx != nlines)
|
||||
{
|
||||
nlines = idx;
|
||||
lines = (char **) xrealloc ((char *) lines,
|
||||
nlines * sizeof (char *));
|
||||
}
|
||||
if (idx != nlines)
|
||||
{
|
||||
nlines = idx;
|
||||
lines = (char **) xrealloc ((char *) lines,
|
||||
nlines * sizeof (char *));
|
||||
}
|
||||
|
||||
cmds->ncommand_lines = nlines;
|
||||
cmds->command_lines = lines;
|
||||
cmds->ncommand_lines = nlines;
|
||||
cmds->command_lines = lines;
|
||||
|
||||
cmds->any_recurse = 0;
|
||||
cmds->lines_flags = (char *) xmalloc (nlines);
|
||||
for (idx = 0; idx < nlines; ++idx)
|
||||
{
|
||||
int flags = 0;
|
||||
cmds->any_recurse = 0;
|
||||
cmds->lines_flags = (char *) xmalloc (nlines);
|
||||
for (idx = 0; idx < nlines; ++idx)
|
||||
{
|
||||
int flags = 0;
|
||||
|
||||
for (p = lines[idx];
|
||||
isblank (*p) || *p == '-' || *p == '@' || *p == '+';
|
||||
++p)
|
||||
switch (*p)
|
||||
{
|
||||
case '+':
|
||||
flags |= COMMANDS_RECURSE;
|
||||
break;
|
||||
case '@':
|
||||
flags |= COMMANDS_SILENT;
|
||||
break;
|
||||
case '-':
|
||||
flags |= COMMANDS_NOERROR;
|
||||
break;
|
||||
}
|
||||
if (!(flags & COMMANDS_RECURSE))
|
||||
{
|
||||
unsigned int len = strlen (p);
|
||||
if (sindex (p, len, "$(MAKE)", 7) != 0
|
||||
|| sindex (p, len, "${MAKE}", 7) != 0)
|
||||
flags |= COMMANDS_RECURSE;
|
||||
}
|
||||
for (p = lines[idx];
|
||||
isblank (*p) || *p == '-' || *p == '@' || *p == '+';
|
||||
++p)
|
||||
switch (*p)
|
||||
{
|
||||
case '+':
|
||||
flags |= COMMANDS_RECURSE;
|
||||
break;
|
||||
case '@':
|
||||
flags |= COMMANDS_SILENT;
|
||||
break;
|
||||
case '-':
|
||||
flags |= COMMANDS_NOERROR;
|
||||
break;
|
||||
}
|
||||
if (!(flags & COMMANDS_RECURSE))
|
||||
{
|
||||
unsigned int len = strlen (p);
|
||||
if (sindex (p, len, "$(MAKE)", 7) != 0
|
||||
|| sindex (p, len, "${MAKE}", 7) != 0)
|
||||
flags |= COMMANDS_RECURSE;
|
||||
}
|
||||
|
||||
cmds->lines_flags[idx] = flags;
|
||||
cmds->any_recurse |= flags & COMMANDS_RECURSE;
|
||||
}
|
||||
cmds->lines_flags[idx] = flags;
|
||||
cmds->any_recurse |= flags & COMMANDS_RECURSE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -337,13 +341,11 @@ execute_file_commands (file)
|
||||
the commands are nothing but whitespace. */
|
||||
|
||||
for (p = file->cmds->commands; *p != '\0'; ++p)
|
||||
if (!isspace (*p) && *p != '-' && *p != '@')
|
||||
if (!isspace ((unsigned char)*p) && *p != '-' && *p != '@')
|
||||
break;
|
||||
if (*p == '\0')
|
||||
{
|
||||
/* We are all out of commands.
|
||||
If we have gotten this far, all the previous commands
|
||||
have run successfully, so we have winning update status. */
|
||||
/* If there are no commands, assume everything worked. */
|
||||
set_command_state (file, cs_running);
|
||||
file->update_status = 0;
|
||||
notice_finished_file (file);
|
||||
@@ -352,7 +354,7 @@ execute_file_commands (file)
|
||||
|
||||
/* First set the automatic variables according to this file. */
|
||||
|
||||
initialize_file_variables (file);
|
||||
initialize_file_variables (file, 0);
|
||||
|
||||
set_file_variables (file);
|
||||
|
||||
@@ -546,10 +548,10 @@ print_commands (cmds)
|
||||
{
|
||||
char *end;
|
||||
|
||||
while (isspace (*s))
|
||||
while (isspace ((unsigned char)*s))
|
||||
++s;
|
||||
|
||||
end = index (s, '\n');
|
||||
end = strchr (s, '\n');
|
||||
if (end == 0)
|
||||
end = s + strlen (s);
|
||||
|
||||
|
||||
@@ -308,3 +308,6 @@
|
||||
|
||||
/* Define for Case Insensitve behavior */
|
||||
#define HAVE_CASE_INSENSITIVE_FS
|
||||
|
||||
/* Build host information. */
|
||||
#define MAKE_HOST "Amiga"
|
||||
|
||||
1180
config.guess
vendored
Normal file
1180
config.guess
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
||||
/* config.h-vms. Generated by hand by Klaus Kämpf <kkaempf@progis.de> */
|
||||
/* config.h-vms. Generated by hand by Klaus Kämpf <kkaempf@rmi.de> */
|
||||
/* config.h. Generated automatically by configure. */
|
||||
/* config.h.in. Generated automatically from configure.in by autoheader. */
|
||||
|
||||
@@ -11,6 +11,28 @@
|
||||
|
||||
/* Define if using alloca.c. */
|
||||
/* #undef C_ALLOCA */
|
||||
/* maybe this should be placed into make.h */
|
||||
#if defined(__VAX) && defined(__DECC)
|
||||
#define alloca(n) __ALLOCA(n)
|
||||
#endif
|
||||
|
||||
/* Define to 1 if NLS is requested. */
|
||||
/* #undef ENABLE_NLS */
|
||||
|
||||
/* Define as 1 if you have dcgettext. */
|
||||
/* #undef HAVE_DCGETTEXT */
|
||||
|
||||
/* Define as 1 if you have gettext and don't want to use GNU gettext. */
|
||||
/* #undef HAVE_GETTEXT */
|
||||
|
||||
/* Define if your locale.h file contains LC_MESSAGES. */
|
||||
/* #undef HAVE_LC_MESSAGES */
|
||||
|
||||
/* Define to the installation directory for locales. */
|
||||
#define LOCALEDIR ""
|
||||
|
||||
/* Define as 1 if you have the stpcpy function. */
|
||||
/* #undef HAVE_STPCPY */
|
||||
|
||||
/* Define if the closedir function returns void instead of int. */
|
||||
/* #undef CLOSEDIR_VOID */
|
||||
@@ -117,18 +139,17 @@
|
||||
/* #undef NO_MINUS_C_MINUS_O */
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
/* #undef pid_t */
|
||||
/* I assume types.h is available for all 5.0 cc/cxx compilers */
|
||||
#if __DECC_VER < 50090000
|
||||
#define pid_t int
|
||||
#endif
|
||||
|
||||
/* Define if the system does not provide POSIX.1 features except
|
||||
with this defined. */
|
||||
/* #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 _POSIX_C_SOURCE 1
|
||||
/* #undef _POSIX_SOURCE */
|
||||
|
||||
/* Define as the return type of signal handlers (int or void). */
|
||||
#define RETSIGTYPE void
|
||||
@@ -160,7 +181,9 @@
|
||||
/* #undef SYS_SIGLIST_DECLARED */
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
/* #undef uid_t */
|
||||
#if __DECC_VER < 50090000
|
||||
#define uid_t int
|
||||
#endif
|
||||
|
||||
/* Define for Encore UMAX. */
|
||||
/* #undef UMAX */
|
||||
@@ -267,7 +290,7 @@
|
||||
/* #undef HAVE_WAITPID */
|
||||
|
||||
/* Define if you have the <dirent.h> header file. */
|
||||
/* #undef HAVE_DIRENT_H */
|
||||
#define HAVE_DIRENT_H 1
|
||||
|
||||
/* Define if you have the <fcntl.h> header file. */
|
||||
#ifdef __DECC
|
||||
@@ -302,36 +325,64 @@
|
||||
/* #undef HAVE_SYS_PARAM_H */
|
||||
|
||||
/* Define if you have the <sys/timeb.h> header file. */
|
||||
#ifndef __GNUC__
|
||||
#define HAVE_SYS_TIMEB_H 1
|
||||
#endif
|
||||
|
||||
/* Define if you have the <sys/wait.h> header file. */
|
||||
/* #undef HAVE_SYS_WAIT_H */
|
||||
|
||||
/* Define if you have the <unistd.h> header file. */
|
||||
/* #undef HAVE_UNISTD_H */
|
||||
|
||||
/* Define if you have the dgc library (-ldgc). */
|
||||
/* #undef HAVE_LIBDGC */
|
||||
|
||||
/* Define if you have the kstat library (-lkstat). */
|
||||
/* #undef HAVE_LIBKSTAT */
|
||||
/* #undef HAVE_LIBKSTAT *
|
||||
|
||||
/* Define if you have the sun library (-lsun). */
|
||||
/* #undef HAVE_LIBSUN */
|
||||
|
||||
/* VMS specific */
|
||||
/* Define for case insensitve filenames */
|
||||
#define HAVE_CASE_INSENSITIVE_FS 1
|
||||
|
||||
#define HAVE_VMSDIR_H 1
|
||||
/* VMS specific, define it if you want to use case sensitve targets */
|
||||
/* #undef WANT_CASE_SENSITIVE_TARGETS */
|
||||
|
||||
/* VMS specific, V7.0 has opendir() and friends, so it's undefined */
|
||||
/* If you want to use non-VMS code for opendir() etc. on V7.0 and greater
|
||||
define the first or both macros AND change the compile command to get the
|
||||
non-VMS versions linked: (prefix=(all,except=(opendir,... */
|
||||
/* #undef HAVE_VMSDIR_H */
|
||||
/* #undef _DIRENT_HAVE_D_NAMLEN */
|
||||
|
||||
/* On older systems without 7.0 backport of CRTL the first one is defined */
|
||||
#ifdef __CRTL_VER
|
||||
# if __CRTL_VER < 70000000
|
||||
# define HAVE_VMSDIR_H 1
|
||||
# endif
|
||||
#else
|
||||
# if __VMS_VER < 70000000
|
||||
# define HAVE_VMSDIR_H 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_VMSDIR_H) && defined(HAVE_DIRENT_H)
|
||||
#undef HAVE_DIRENT_H
|
||||
#endif
|
||||
|
||||
#define HAVE_STDLIB_H 1
|
||||
#define INCLUDEDIR "sys$sysroot:[syslib]"
|
||||
#define LIBDIR "sys$sysroot:[syslib]"
|
||||
|
||||
/* Avoid broken RTL functions on OpenVMS */
|
||||
#include <unixlib.h>
|
||||
/* Don't use RTL functions of OpenVMS */
|
||||
#ifdef __DECC
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#define getopt gnu_getopt
|
||||
#define optarg gnu_optarg
|
||||
#define optopt gnu_optopt
|
||||
#define optind gnu_optind
|
||||
#define opterr gnu_opterr
|
||||
#endif
|
||||
|
||||
#if defined (__cplusplus) || (defined (__STDC__) && __STDC__)
|
||||
#undef PARAMS
|
||||
@@ -341,3 +392,5 @@
|
||||
#define PARAMS(protos) ()
|
||||
#endif /* C++ or ANSI C. */
|
||||
|
||||
/* Build host information. */
|
||||
#define MAKE_HOST "VMS"
|
||||
|
||||
@@ -332,21 +332,43 @@
|
||||
/* Define if you have the sun library (-lsun). */
|
||||
/* #undef HAVE_LIBSUN */
|
||||
|
||||
/* Build host information. */
|
||||
#define MAKE_HOST "Windows32"
|
||||
|
||||
/*
|
||||
* 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.
|
||||
* If you have a shell that does not grok 'sh -c quoted-command-line'
|
||||
* correctly, you need this setting. Please see below for specific
|
||||
* shell support.
|
||||
*/
|
||||
#undef BATCH_MODE_ONLY_SHELL
|
||||
#define BATCH_MODE_ONLY_SHELL 1
|
||||
|
||||
/*
|
||||
Define if you have the MKS tool set or shell. Do NOT define
|
||||
BATCH_MODE_ONLY_SHELL if you define HAVE_MKS_SHELL
|
||||
* Define if you have the Cygnus "Cygwin" GNU Windows32 tool set.
|
||||
* Do NOT define BATCH_MODE_ONLY_SHELL if you define HAVE_CYGWIN_SHELL
|
||||
*/
|
||||
#undef HAVE_CYGWIN_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 */
|
||||
/*
|
||||
* Enforce the mutual exclusivity restriction.
|
||||
*/
|
||||
#ifdef HAVE_MKS_SHELL
|
||||
#undef BATCH_MODE_ONLY_SHELL
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CYGWIN_SHELL
|
||||
#undef BATCH_MODE_ONLY_SHELL
|
||||
#endif
|
||||
|
||||
/* Define if you prefer Case Insensitive behavior */
|
||||
#undef HAVE_CASE_INSENSITIVE_FS
|
||||
|
||||
1264
config.sub
vendored
Normal file
1264
config.sub
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@@ -47,3 +47,6 @@
|
||||
/* Define if you have the vprintf library function. */
|
||||
#undef HAVE_VPRINTF
|
||||
#define HAVE_VPRINTF 1
|
||||
|
||||
/* Build host information. */
|
||||
#define MAKE_HOST "i386-pc-msdosdjgpp"
|
||||
|
||||
36
configure.in
36
configure.in
@@ -3,11 +3,12 @@ AC_REVISION([$Id$])
|
||||
AC_PREREQ(2.13)dnl dnl Minimum Autoconf version required.
|
||||
AC_INIT(vpath.c)dnl dnl A distinctive file to look for in srcdir.
|
||||
|
||||
AM_INIT_AUTOMAKE(make, 3.77.92)
|
||||
AM_INIT_AUTOMAKE(make, 3.79)
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
|
||||
dnl Regular configure stuff
|
||||
|
||||
AC_CANONICAL_HOST
|
||||
AC_PROG_MAKE_SET
|
||||
AC_PROG_CC
|
||||
AC_PROG_INSTALL
|
||||
@@ -18,10 +19,12 @@ AC_AIX
|
||||
AC_ISC_POSIX
|
||||
AC_MINIX
|
||||
|
||||
AC_CHECK_PROG(PERL, perl, perl, perl) dnl Needed for the test suite (only)
|
||||
|
||||
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_SYS_LARGEFILE
|
||||
|
||||
AC_HEADER_STDC
|
||||
AC_HEADER_DIRENT
|
||||
@@ -31,7 +34,9 @@ AC_TYPE_SIGNAL
|
||||
AC_CHECK_HEADERS(stdlib.h unistd.h limits.h sys/param.h fcntl.h string.h \
|
||||
memory.h sys/timeb.h)
|
||||
AC_PROG_CC_C_O
|
||||
AM_PROG_CC_STDC
|
||||
AC_C_CONST dnl getopt needs this.
|
||||
AC_C_INLINE dnl gettext needs this.
|
||||
AC_HEADER_STAT
|
||||
|
||||
AC_STRUCT_ST_MTIM_NSEC
|
||||
@@ -55,7 +60,7 @@ AC_MSG_RESULT($ac_cv_check_symbol_$1)])dnl
|
||||
# clock_gettime is in -lposix4 in Solaris 2.6.
|
||||
AC_CHECK_LIB(posix4, clock_gettime)
|
||||
|
||||
AC_CHECK_FUNCS(memmove strdup psignal mktemp pstat_getdynamic \
|
||||
AC_CHECK_FUNCS(memmove strchr memcpy strdup psignal mkstemp mktemp fdopen \
|
||||
clock_gettime dup2 getcwd sigsetmask sigaction getgroups \
|
||||
setlinebuf seteuid setegid setreuid setregid pipe \
|
||||
strerror strsignal)
|
||||
@@ -66,9 +71,11 @@ AC_FUNC_VPRINTF
|
||||
AC_FUNC_STRCOLL
|
||||
AC_FUNC_CLOSEDIR_VOID
|
||||
AC_FUNC_SETVBUF_REVERSED
|
||||
AC_FUNC_GETLOADAVG
|
||||
AC_FUNC_SELECT
|
||||
AC_CHECK_LIB(kstat, kstat_open)
|
||||
|
||||
AC_CHECK_LIB(kstat, kstat_open) dnl _Must_ come before AC_FUNC_GETLOADAVG.
|
||||
AC_CHECK_FUNCS(pstat_getdynamic) dnl Supposedly in AC_FUNC_GETLOADAVG, but...?
|
||||
AC_FUNC_GETLOADAVG
|
||||
|
||||
# Check out the wait reality.
|
||||
AC_CHECK_HEADERS(sys/wait.h)
|
||||
@@ -101,6 +108,11 @@ AC_MSG_RESULT($make_cv_union_wait)
|
||||
|
||||
AC_DECL_SYS_SIGLIST
|
||||
|
||||
dnl Handle internationalization
|
||||
|
||||
ALL_LINGUAS="de es fr ko nl pl ru"
|
||||
fp_WITH_GETTEXT
|
||||
|
||||
# The presence of the following is not meant to imply
|
||||
# that make necessarily works on those systems.
|
||||
AC_CHECK_LIB(sun, getpwnam)
|
||||
@@ -200,24 +212,28 @@ AC_CACHE_VAL(make_cv_sys_gnu_glob, [
|
||||
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(GLOBDIR) GLOBDIR=glob
|
||||
AC_SUBST(GLOBINC) GLOBINC='-I$(srcdir)/glob'
|
||||
AC_SUBST(GLOBLIB) GLOBLIB=glob/libglob.a
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_DEFINE_UNQUOTED(MAKE_HOST,"$host",[Build host information.])
|
||||
MAKE_HOST="$host"
|
||||
AC_SUBST(MAKE_HOST)
|
||||
|
||||
MAINT_MAKEFILE=/dev/null
|
||||
if test -r $srcdir/maintMakefile; then
|
||||
if test -r "$srcdir/maintMakefile"; then
|
||||
MAINT_MAKEFILE="$srcdir/maintMakefile"
|
||||
fi
|
||||
AC_SUBST_FILE(MAINT_MAKEFILE)
|
||||
|
||||
AC_OUTPUT(build.sh Makefile glob/Makefile)
|
||||
AC_OUTPUT(build.sh Makefile glob/Makefile i18n/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
|
||||
dnl Can't do this because then remote builds with build.sh don't work.
|
||||
dnl test -f build.sh.in || rm -f build.sh
|
||||
|
||||
|
||||
case "$make_badcust" in
|
||||
|
||||
41
debug.h
Normal file
41
debug.h
Normal file
@@ -0,0 +1,41 @@
|
||||
/* Debugging macros and interface.
|
||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU Make is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU Make; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
|
||||
#define DB_NONE (0x000)
|
||||
#define DB_BASIC (0x001)
|
||||
#define DB_VERBOSE (0x002)
|
||||
#define DB_JOBS (0x004)
|
||||
#define DB_IMPLICIT (0x008)
|
||||
#define DB_MAKEFILES (0x100)
|
||||
|
||||
#define DB_ALL (0xfff)
|
||||
|
||||
extern int db_level;
|
||||
|
||||
#define ISDB(_l) ((_l)&db_level)
|
||||
|
||||
#define DBS(_l,_x) do{ if(ISDB(_l)) {print_spaces (depth); \
|
||||
printf _x; fflush (stdout);} }while(0)
|
||||
|
||||
#define DBF(_l,_x) do{ if(ISDB(_l)) {print_spaces (depth); \
|
||||
printf (_x, file->name); \
|
||||
fflush (stdout);} }while(0)
|
||||
|
||||
#define DB(_l,_x) do{ if(ISDB(_l)) {printf _x; fflush (stdout);} }while(0)
|
||||
94
default.c
94
default.c
@@ -38,8 +38,8 @@ Boston, MA 02111-1307, USA. */
|
||||
|
||||
static char default_suffixes[]
|
||||
#ifdef VMS
|
||||
= ".exe .olb .ln .obj .c .cc .pas .p .for .f .r .y .l .mar \
|
||||
.mod .sym .def .h .info .dvi .tex .texinfo .texi .txinfo \
|
||||
= ".exe .olb .ln .obj .c .cxx .cc .pas .p .for .f .r .y .l .mar \
|
||||
.s .ss .i .ii .mod .sym .def .h .info .dvi .tex .texinfo .texi .txinfo \
|
||||
.w .ch .cweb .web .com .sh .elc .el";
|
||||
#else
|
||||
= ".out .a .ln .o .c .cc .C .cpp .p .f .F .r .y .l .s .S \
|
||||
@@ -108,13 +108,21 @@ static char *default_suffix_rules[] =
|
||||
{
|
||||
#ifdef VMS
|
||||
".obj.exe",
|
||||
"$(LINK.obj) $^ $(LOADLIBES) $(LDLIBS) /exe=$@",
|
||||
"$(LINK.obj) $^ $(LOADLIBES) $(LDLIBS) $(CRT0) /exe=$@",
|
||||
".mar.exe",
|
||||
"$(LINK.mar) $^ $(LOADLIBES) $(LDLIBS) /exe=$@",
|
||||
"$(COMPILE.mar) $^ \n $(LINK.obj) $(subst .mar,.obj,$^) $(LOADLIBES) $(LDLIBS) $(CRT0) /exe=$@",
|
||||
".s.exe",
|
||||
"$(COMPILE.s) $^ \n $(LINK.obj) $(subst .s,.obj,$^) $(LOADLIBES) $(LDLIBS) $(CRT0) /exe=$@",
|
||||
".c.exe",
|
||||
"$(COMPILE.c) $^ \n $(LINK.obj) $(subst .c,.obj,$^) $(LOADLIBES) $(LDLIBS) /exe=$@",
|
||||
"$(COMPILE.c) $^ \n $(LINK.obj) $(subst .c,.obj,$^) $(LOADLIBES) $(LDLIBS) $(CRT0) /exe=$@",
|
||||
".cc.exe",
|
||||
"$(COMPILE.cc) $^ \n $(LINK.obj) $(subst .cc,.obj,$^) $(LOADLIBES) $(LDLIBS) /exe=$@",
|
||||
#ifdef GCC_IS_NATIVE
|
||||
"$(COMPILE.cc) $^ \n $(LINK.obj) $(CXXSTARTUP),sys$$disk:[]$(subst .cc,.obj,$^) $(LOADLIBES) $(LXLIBS) $(LDLIBS) $(CXXRT0) /exe=$@",
|
||||
#else
|
||||
"$(COMPILE.cc) $^ \n $(CXXLINK.obj) $(subst .cc,.obj,$^) $(LOADLIBES) $(LXLIBS) $(LDLIBS) $(CXXRT0) /exe=$@",
|
||||
".cxx.exe",
|
||||
"$(COMPILE.cxx) $^ \n $(CXXLINK.obj) $(subst .cxx,.obj,$^) $(LOADLIBES) $(LXLIBS) $(LDLIBS) $(CXXRT0) /exe=$@",
|
||||
#endif
|
||||
".for.exe",
|
||||
"$(COMPILE.for) $^ \n $(LINK.obj) $(subst .for,.obj,$^) $(LOADLIBES) $(LDLIBS) /exe=$@",
|
||||
".pas.exe",
|
||||
@@ -125,8 +133,24 @@ static char *default_suffix_rules[] =
|
||||
|
||||
".mar.obj",
|
||||
"$(COMPILE.mar) /obj=$@ $<",
|
||||
".s.obj",
|
||||
"$(COMPILE.s) /obj=$@ $<",
|
||||
".ss.obj",
|
||||
"$(COMPILE.s) /obj=$@ $<",
|
||||
".c.i",
|
||||
"$(COMPILE.c)/prep /list=$@ $<",
|
||||
".c.s",
|
||||
"$(COMPILE.c)/noobj/machine /list=$@ $<",
|
||||
".i.s",
|
||||
"$(COMPILE.c)/noprep/noobj/machine /list=$@ $<",
|
||||
".c.obj",
|
||||
"$(COMPILE.c) /obj=$@ $<",
|
||||
".cc.ii",
|
||||
"$(COMPILE.cc)/prep /list=$@ $<",
|
||||
".cc.ss",
|
||||
"$(COMPILE.cc)/noobj/machine /list=$@ $<",
|
||||
".ii.ss",
|
||||
"$(COMPILE.cc)/noprep/noobj/machine /list=$@ $<",
|
||||
".cc.obj",
|
||||
"$(COMPILE.cc) /obj=$@ $<",
|
||||
".for.obj",
|
||||
@@ -276,12 +300,31 @@ static char *default_suffix_rules[] =
|
||||
static char *default_variables[] =
|
||||
{
|
||||
#ifdef VMS
|
||||
#ifdef __ALPHA
|
||||
"ARCH", "ALPHA",
|
||||
#else
|
||||
"ARCH", "VAX",
|
||||
#endif
|
||||
"AR", "library/obj",
|
||||
"ARFLAGS", "/replace",
|
||||
"AS", "macro",
|
||||
"MACRO", "macro",
|
||||
#ifdef GCC_IS_NATIVE
|
||||
"CC", "gcc",
|
||||
#else
|
||||
"CC", "cc",
|
||||
#endif
|
||||
"CD", "builtin_cd",
|
||||
"MAKE", "make",
|
||||
"ECHO", "write sys$$output \"",
|
||||
#ifdef GCC_IS_NATIVE
|
||||
"C++", "gcc/plus",
|
||||
"CXX", "gcc/plus",
|
||||
#else
|
||||
"C++", "cxx",
|
||||
"CXX", "cxx",
|
||||
"CXXLD", "cxxlink",
|
||||
#endif
|
||||
"CO", "co",
|
||||
"CPP", "$(CC) /preprocess_only",
|
||||
"FC", "fortran",
|
||||
@@ -292,21 +335,43 @@ static char *default_variables[] =
|
||||
"LD", "link",
|
||||
"LEX", "lex",
|
||||
"PC", "pascal",
|
||||
"YACC", "yacc", /* Or "bison -y" */
|
||||
"YACC", "bison/yacc",
|
||||
"YFLAGS", "/Define/Verbose",
|
||||
"BISON", "bison",
|
||||
"MAKEINFO", "makeinfo",
|
||||
"TEX", "tex",
|
||||
"TEXINDEX", "texindex",
|
||||
|
||||
"RM", "delete/nolog",
|
||||
|
||||
"CSTARTUP", "",
|
||||
#ifdef GCC_IS_NATIVE
|
||||
"CRT0", ",sys$$library:vaxcrtl.olb/lib,gnu_cc_library:crt0.obj",
|
||||
"CXXSTARTUP", "gnu_cc_library:crtbegin.obj",
|
||||
"CXXRT0", ",sys$$library:vaxcrtl.olb/lib,gnu_cc_library:crtend.obj,gnu_cc_library:gxx_main.obj",
|
||||
"LXLIBS", ",gnu_cc_library:libstdcxx.olb/lib,gnu_cc_library:libgccplus.olb/lib",
|
||||
"LDLIBS", ",gnu_cc_library:libgcc.olb/lib",
|
||||
#else
|
||||
"CRT0", "",
|
||||
"CXXSTARTUP", "",
|
||||
"CXXRT0", "",
|
||||
"LXLIBS", "",
|
||||
"LDLIBS", "",
|
||||
#endif
|
||||
|
||||
"LINK.obj", "$(LD) $(LDFLAGS)",
|
||||
#ifndef GCC_IS_NATIVE
|
||||
"CXXLINK.obj", "$(CXXLD) $(LDFLAGS)",
|
||||
"COMPILE.cxx", "$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
|
||||
#endif
|
||||
"COMPILE.c", "$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
|
||||
"COMPILE.cc", "$(C++) $(C++FLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c",
|
||||
"COMPILE.cc", "$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
|
||||
"YACC.y", "$(YACC) $(YFLAGS)",
|
||||
"LEX.l", "$(LEX) $(LFLAGS)",
|
||||
"COMPILE.for", "$(FC) $(FFLAGS) $(TARGET_ARCH)",
|
||||
"COMPILE.pas", "$(PC) $(PFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
|
||||
"COMPILE.mar", "$(AS) $(ASFLAGS) $(TARGET_MACH)",
|
||||
"COMPILE.mar", "$(MACRO) $(MACROFLAGS)",
|
||||
"COMPILE.s", "$(AS) $(ASFLAGS) $(TARGET_MACH)",
|
||||
"LINT.c", "$(LINT) $(LINTFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
|
||||
|
||||
"MV", "rename/new_version",
|
||||
@@ -319,7 +384,11 @@ static char *default_variables[] =
|
||||
"AS", "as",
|
||||
#ifdef GCC_IS_NATIVE
|
||||
"CC", "gcc",
|
||||
# ifdef __MSDOS__
|
||||
"CXX", "gpp", /* g++ is an invalid name on MSDOS */
|
||||
# else
|
||||
"CXX", "gcc",
|
||||
# endif /* __MSDOS__ */
|
||||
#else
|
||||
"CC", "cc",
|
||||
"CXX", "g++",
|
||||
@@ -327,11 +396,10 @@ static char *default_variables[] =
|
||||
|
||||
/* This expands to $(CO) $(COFLAGS) $< $@ if $@ does not exist,
|
||||
and to the empty string if $@ does exist. */
|
||||
"CHECKOUT,v",
|
||||
"+$(patsubst $@-noexist,$(CO) $(COFLAGS) $< $@,\
|
||||
$(filter-out $@,$(firstword $(wildcard $@) $@-noexist)))",
|
||||
|
||||
"CHECKOUT,v", "+$(if $(wildcard $@),,$(CO) $(COFLAGS) $< $@)",
|
||||
"CO", "co",
|
||||
"COFLAGS", "",
|
||||
|
||||
"CPP", "$(CC) -E",
|
||||
#ifdef CRAY
|
||||
"CF77PPFLAGS", "-P",
|
||||
|
||||
126
dir.c
126
dir.c
@@ -22,6 +22,9 @@ Boston, MA 02111-1307, USA. */
|
||||
#ifdef HAVE_DIRENT_H
|
||||
# include <dirent.h>
|
||||
# define NAMLEN(dirent) strlen((dirent)->d_name)
|
||||
# ifdef VMS
|
||||
extern char *vmsify PARAMS ((char *name, int type));
|
||||
# endif
|
||||
#else
|
||||
# define dirent direct
|
||||
# define NAMLEN(dirent) (dirent)->d_namlen
|
||||
@@ -41,18 +44,18 @@ Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* In GNU systems, <dirent.h> defines this macro for us. */
|
||||
#ifdef _D_NAMLEN
|
||||
#undef NAMLEN
|
||||
#define NAMLEN(d) _D_NAMLEN(d)
|
||||
# undef NAMLEN
|
||||
# define NAMLEN(d) _D_NAMLEN(d)
|
||||
#endif
|
||||
|
||||
#if (defined (POSIX) || defined (WINDOWS32)) && !defined (__GNU_LIBRARY__)
|
||||
#if (defined (POSIX) || defined (VMS) || defined (WINDOWS32)) && !defined (__GNU_LIBRARY__)
|
||||
/* Posix does not require that the d_ino field be present, and some
|
||||
systems do not provide it. */
|
||||
#define REAL_DIR_ENTRY(dp) 1
|
||||
#define FAKE_DIR_ENTRY(dp)
|
||||
# define REAL_DIR_ENTRY(dp) 1
|
||||
# define FAKE_DIR_ENTRY(dp)
|
||||
#else
|
||||
#define REAL_DIR_ENTRY(dp) (dp->d_ino != 0)
|
||||
#define FAKE_DIR_ENTRY(dp) (dp->d_ino = 1)
|
||||
# define REAL_DIR_ENTRY(dp) (dp->d_ino != 0)
|
||||
# define FAKE_DIR_ENTRY(dp) (dp->d_ino = 1)
|
||||
#endif /* POSIX */
|
||||
|
||||
#ifdef __MSDOS__
|
||||
@@ -84,7 +87,7 @@ dosify (filename)
|
||||
|
||||
/* First, transform the name part. */
|
||||
for (i = 0; *filename != '\0' && i < 8 && *filename != '.'; ++i)
|
||||
*df++ = tolower (*filename++);
|
||||
*df++ = tolower ((unsigned char)*filename++);
|
||||
|
||||
/* Now skip to the next dot. */
|
||||
while (*filename != '\0' && *filename != '.')
|
||||
@@ -93,7 +96,7 @@ dosify (filename)
|
||||
{
|
||||
*df++ = *filename++;
|
||||
for (i = 0; *filename != '\0' && i < 3 && *filename != '.'; ++i)
|
||||
*df++ = tolower (*filename++);
|
||||
*df++ = tolower ((unsigned char)*filename++);
|
||||
}
|
||||
|
||||
/* Look for more dots. */
|
||||
@@ -135,7 +138,7 @@ downcase (filename)
|
||||
/* First, transform the name part. */
|
||||
for (i = 0; *filename != '\0'; ++i)
|
||||
{
|
||||
*df++ = tolower (*filename);
|
||||
*df++ = tolower ((unsigned char)*filename);
|
||||
++filename;
|
||||
}
|
||||
|
||||
@@ -156,7 +159,8 @@ vms_hash (name)
|
||||
|
||||
while (*name)
|
||||
{
|
||||
h = (h << 4) + *name++;
|
||||
h = (h << 4) + (isupper (*name) ? tolower (*name) : *name);
|
||||
name++;
|
||||
g = h & 0xf0000000;
|
||||
if (g)
|
||||
{
|
||||
@@ -333,12 +337,12 @@ find_directory (name)
|
||||
if (vmsstat_dir (name, &st) < 0)
|
||||
#else
|
||||
|
||||
#ifdef WINDOWS32
|
||||
# ifdef WINDOWS32
|
||||
/* Remove any trailing '\'. Windows32 stat fails even on valid
|
||||
directories if they end in '\'. */
|
||||
if (p[-1] == '\\')
|
||||
p[-1] = '\0';
|
||||
#endif
|
||||
# endif
|
||||
if (stat (name, &st) < 0)
|
||||
#endif
|
||||
{
|
||||
@@ -356,14 +360,14 @@ find_directory (name)
|
||||
w32_path = w32ify(name, 1);
|
||||
hash = ((unsigned int) st.st_dev << 16) | (unsigned int) st.st_ctime;
|
||||
#else
|
||||
#ifdef VMS
|
||||
hash = ((unsigned int) st.st_dev << 16)
|
||||
| ((unsigned int) st.st_ino[0]
|
||||
+ (unsigned int) st.st_ino[1]
|
||||
+ (unsigned int) st.st_ino[2]);
|
||||
#else
|
||||
# ifdef VMS
|
||||
hash = (((unsigned int) st.st_dev << 16)
|
||||
| ((unsigned int) st.st_ino[0]
|
||||
+ (unsigned int) st.st_ino[1]
|
||||
+ (unsigned int) st.st_ino[2]));
|
||||
# else
|
||||
hash = ((unsigned int) st.st_dev << 16) | (unsigned int) st.st_ino;
|
||||
#endif
|
||||
# endif
|
||||
#endif
|
||||
hash %= DIRECTORY_BUCKETS;
|
||||
|
||||
@@ -372,13 +376,14 @@ find_directory (name)
|
||||
if (strieq(dc->path_key, w32_path))
|
||||
#else
|
||||
if (dc->dev == st.st_dev
|
||||
#ifdef VMS
|
||||
# ifdef VMS
|
||||
&& dc->ino[0] == st.st_ino[0]
|
||||
&& dc->ino[1] == st.st_ino[1]
|
||||
&& dc->ino[2] == st.st_ino[2])
|
||||
#else
|
||||
&& dc->ino == st.st_ino)
|
||||
#endif
|
||||
&& dc->ino[2] == st.st_ino[2]
|
||||
# else
|
||||
&& dc->ino == st.st_ino
|
||||
# endif
|
||||
)
|
||||
#endif /* WINDOWS32 */
|
||||
break;
|
||||
|
||||
@@ -413,24 +418,22 @@ find_directory (name)
|
||||
else
|
||||
dc->fs_flags = FS_UNKNOWN;
|
||||
#else
|
||||
#ifdef VMS
|
||||
# ifdef VMS
|
||||
dc->ino[0] = st.st_ino[0];
|
||||
dc->ino[1] = st.st_ino[1];
|
||||
dc->ino[2] = st.st_ino[2];
|
||||
#else
|
||||
# else
|
||||
dc->ino = st.st_ino;
|
||||
#endif
|
||||
# endif
|
||||
#endif /* WINDOWS32 */
|
||||
dc->next = directories_contents[hash];
|
||||
directories_contents[hash] = dc;
|
||||
|
||||
dc->dirstream = opendir (name);
|
||||
if (dc->dirstream == 0)
|
||||
{
|
||||
/* Couldn't open the directory. Mark this by
|
||||
setting the `files' member to a nil pointer. */
|
||||
dc->files = 0;
|
||||
}
|
||||
/* Couldn't open the directory. Mark this by
|
||||
setting the `files' member to a nil pointer. */
|
||||
dc->files = 0;
|
||||
else
|
||||
{
|
||||
/* Allocate an array of buckets for files and zero it. */
|
||||
@@ -553,6 +556,14 @@ dir_contents_file_exists_p (dir, filename)
|
||||
unsigned int len;
|
||||
register unsigned int i;
|
||||
|
||||
#if defined(VMS) && defined(HAVE_DIRENT_H)
|
||||
/* In VMS we get file versions too, which have to be stripped off */
|
||||
{
|
||||
char *p = strrchr (d->d_name, ';');
|
||||
if (p)
|
||||
*p = '\0';
|
||||
}
|
||||
#endif
|
||||
if (!REAL_DIR_ENTRY (d))
|
||||
continue;
|
||||
|
||||
@@ -635,16 +646,18 @@ file_exists_p (name)
|
||||
#endif
|
||||
|
||||
#ifdef VMS
|
||||
dirend = rindex (name, ']');
|
||||
dirend = strrchr (name, ']');
|
||||
if (dirend == 0)
|
||||
dirend = strrchr (name, ':');
|
||||
dirend++;
|
||||
if (dirend == (char *)1)
|
||||
return dir_file_exists_p ("[]", name);
|
||||
#else /* !VMS */
|
||||
dirend = rindex (name, '/');
|
||||
dirend = strrchr (name, '/');
|
||||
#if defined (WINDOWS32) || defined (__MSDOS__)
|
||||
/* Forward and backslashes might be mixed. We need the rightmost one. */
|
||||
{
|
||||
char *bslash = rindex(name, '\\');
|
||||
char *bslash = strrchr(name, '\\');
|
||||
if (!dirend || bslash > dirend)
|
||||
dirend = bslash;
|
||||
/* The case of "d:file". */
|
||||
@@ -693,16 +706,18 @@ file_impossible (filename)
|
||||
register struct dirfile *new;
|
||||
|
||||
#ifdef VMS
|
||||
dirend = rindex (p, ']');
|
||||
dirend = strrchr (p, ']');
|
||||
if (dirend == 0)
|
||||
dirend = strrchr (p, ':');
|
||||
dirend++;
|
||||
if (dirend == (char *)1)
|
||||
dir = find_directory ("[]");
|
||||
#else
|
||||
dirend = rindex (p, '/');
|
||||
dirend = strrchr (p, '/');
|
||||
#if defined (WINDOWS32) || defined (__MSDOS__)
|
||||
/* Forward and backslashes might be mixed. We need the rightmost one. */
|
||||
{
|
||||
char *bslash = rindex(p, '\\');
|
||||
char *bslash = strrchr(p, '\\');
|
||||
if (!dirend || bslash > dirend)
|
||||
dirend = bslash;
|
||||
/* The case of "d:file". */
|
||||
@@ -796,15 +811,15 @@ file_impossible_p (filename)
|
||||
register struct dirfile *next;
|
||||
|
||||
#ifdef VMS
|
||||
dirend = rindex (filename, ']');
|
||||
dirend = strrchr (filename, ']');
|
||||
if (dirend == 0)
|
||||
dir = find_directory ("[]")->contents;
|
||||
#else
|
||||
dirend = rindex (filename, '/');
|
||||
dirend = strrchr (filename, '/');
|
||||
#if defined (WINDOWS32) || defined (__MSDOS__)
|
||||
/* Forward and backslashes might be mixed. We need the rightmost one. */
|
||||
{
|
||||
char *bslash = rindex(filename, '\\');
|
||||
char *bslash = strrchr(filename, '\\');
|
||||
if (!dirend || bslash > dirend)
|
||||
dirend = bslash;
|
||||
/* The case of "d:file". */
|
||||
@@ -1043,6 +1058,9 @@ read_dirstream (stream)
|
||||
FAKE_DIR_ENTRY (d);
|
||||
#ifdef _DIRENT_HAVE_D_NAMLEN
|
||||
d->d_namlen = len - 1;
|
||||
#endif
|
||||
#ifdef _DIRENT_HAVE_D_TYPE
|
||||
d->d_type = DT_UNKNOWN;
|
||||
#endif
|
||||
memcpy (d->d_name, df->name, len);
|
||||
return d;
|
||||
@@ -1064,19 +1082,33 @@ ansi_free(p)
|
||||
free(p);
|
||||
}
|
||||
|
||||
/* On 64 bit ReliantUNIX (5.44 and above) in LFS mode, stat() is actually a
|
||||
* macro for stat64(). If stat is a macro, make a local wrapper function to
|
||||
* invoke it.
|
||||
*/
|
||||
#ifndef stat
|
||||
# ifndef VMS
|
||||
extern int stat ();
|
||||
# endif
|
||||
# define local_stat stat
|
||||
#else
|
||||
static int local_stat (path, buf)
|
||||
char *path;
|
||||
struct stat *buf;
|
||||
{
|
||||
return stat (path, buf);
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
dir_setup_glob (gl)
|
||||
glob_t *gl;
|
||||
{
|
||||
#ifndef VMS
|
||||
extern int stat ();
|
||||
#endif
|
||||
|
||||
/* Bogus sunos4 compiler complains (!) about & before functions. */
|
||||
gl->gl_opendir = open_dirstream;
|
||||
gl->gl_readdir = read_dirstream;
|
||||
gl->gl_closedir = ansi_free;
|
||||
gl->gl_stat = stat;
|
||||
gl->gl_stat = local_stat;
|
||||
/* We don't bother setting gl_lstat, since glob never calls it.
|
||||
The slot is only there for compatibility with 4.4 BSD. */
|
||||
}
|
||||
|
||||
108
expand.c
108
expand.c
@@ -17,6 +17,8 @@ along with GNU Make; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include "make.h"
|
||||
#include "filedef.h"
|
||||
#include "job.h"
|
||||
@@ -89,6 +91,8 @@ initialize_variable_output ()
|
||||
|
||||
/* Recursively expand V. The returned string is malloc'd. */
|
||||
|
||||
static char *allocated_variable_append PARAMS ((struct variable *v));
|
||||
|
||||
char *
|
||||
recursively_expand (v)
|
||||
register struct variable *v;
|
||||
@@ -102,7 +106,10 @@ recursively_expand (v)
|
||||
v->name);
|
||||
|
||||
v->expanding = 1;
|
||||
value = allocated_variable_expand (v->value);
|
||||
if (v->append)
|
||||
value = allocated_variable_append (v);
|
||||
else
|
||||
value = allocated_variable_expand (v->value);
|
||||
v->expanding = 0;
|
||||
|
||||
return value;
|
||||
@@ -134,18 +141,23 @@ reference_variable (o, name, length)
|
||||
char *name;
|
||||
unsigned int length;
|
||||
{
|
||||
register struct variable *v = lookup_variable (name, length);
|
||||
register struct variable *v;
|
||||
char *value;
|
||||
|
||||
v = lookup_variable (name, length);
|
||||
|
||||
if (v == 0)
|
||||
warn_undefined (name, length);
|
||||
|
||||
if (v != 0 && *v->value != '\0')
|
||||
{
|
||||
char *value = (v->recursive ? recursively_expand (v) : v->value);
|
||||
o = variable_buffer_output (o, value, strlen (value));
|
||||
if (v->recursive)
|
||||
free (value);
|
||||
}
|
||||
if (v == 0 || *v->value == '\0')
|
||||
return o;
|
||||
|
||||
value = (v->recursive ? recursively_expand (v) : v->value);
|
||||
|
||||
o = variable_buffer_output (o, value, strlen (value));
|
||||
|
||||
if (v->recursive)
|
||||
free (value);
|
||||
|
||||
return o;
|
||||
}
|
||||
@@ -189,7 +201,7 @@ variable_expand_string (line, string, length)
|
||||
variable output buffer, and skip them. Uninteresting chars end
|
||||
at the next $ or the end of the input. */
|
||||
|
||||
p1 = index (p, '$');
|
||||
p1 = strchr (p, '$');
|
||||
|
||||
o = variable_buffer_output (o, p, p1 != 0 ? p1 - p : strlen (p) + 1);
|
||||
|
||||
@@ -229,7 +241,7 @@ variable_expand_string (line, string, length)
|
||||
/* Is there a variable reference inside the parens or braces?
|
||||
If so, expand it before expanding the entire reference. */
|
||||
|
||||
end = index (beg, closeparen);
|
||||
end = strchr (beg, closeparen);
|
||||
if (end == 0)
|
||||
/* Unterminated variable reference. */
|
||||
fatal (reading_file, _("unterminated variable reference"));
|
||||
@@ -253,7 +265,7 @@ variable_expand_string (line, string, length)
|
||||
{
|
||||
beg = expand_argument (beg, p); /* Expand the name. */
|
||||
free_beg = 1; /* Remember to free BEG when finished. */
|
||||
end = index (beg, '\0');
|
||||
end = strchr (beg, '\0');
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -273,7 +285,7 @@ variable_expand_string (line, string, length)
|
||||
char *subst_beg, *subst_end, *replace_beg, *replace_end;
|
||||
|
||||
subst_beg = colon + 1;
|
||||
subst_end = index (subst_beg, '=');
|
||||
subst_end = strchr (subst_beg, '=');
|
||||
if (subst_end == 0)
|
||||
/* There is no = in sight. Punt on the substitution
|
||||
reference and treat this as a variable name containing
|
||||
@@ -414,7 +426,7 @@ expand_argument (str, end)
|
||||
{
|
||||
char *tmp;
|
||||
|
||||
if (*end == '\0')
|
||||
if (!end || *end == '\0')
|
||||
tmp = str;
|
||||
else
|
||||
{
|
||||
@@ -435,34 +447,72 @@ variable_expand_for_file (line, file)
|
||||
register struct file *file;
|
||||
{
|
||||
char *result;
|
||||
struct variable_set_list *save, *fnext;
|
||||
struct variable_set_list *save;
|
||||
|
||||
if (file == 0)
|
||||
return variable_expand (line);
|
||||
|
||||
save = current_variable_set_list;
|
||||
current_variable_set_list = file->variables;
|
||||
reading_file = &file->cmds->fileinfo;
|
||||
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;
|
||||
}
|
||||
if (file->cmds && file->cmds->fileinfo.filenm)
|
||||
reading_file = &file->cmds->fileinfo;
|
||||
else
|
||||
reading_file = 0;
|
||||
result = variable_expand (line);
|
||||
current_variable_set_list = save;
|
||||
reading_file = 0;
|
||||
file->variables->next = fnext;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/* Like allocated_variable_expand, but we first expand this variable in the
|
||||
context of the next variable set, then we append the expanded value. */
|
||||
|
||||
static char *
|
||||
allocated_variable_append (v)
|
||||
struct variable *v;
|
||||
{
|
||||
struct variable_set_list *save;
|
||||
int len = strlen (v->name);
|
||||
char *var = alloca (len + 4);
|
||||
char *value;
|
||||
|
||||
char *obuf = variable_buffer;
|
||||
unsigned int olen = variable_buffer_length;
|
||||
|
||||
variable_buffer = 0;
|
||||
|
||||
assert(current_variable_set_list->next != 0);
|
||||
save = current_variable_set_list;
|
||||
current_variable_set_list = current_variable_set_list->next;
|
||||
|
||||
var[0] = '$';
|
||||
var[1] = '(';
|
||||
strcpy (&var[2], v->name);
|
||||
var[len+2] = ')';
|
||||
var[len+3] = '\0';
|
||||
|
||||
value = variable_expand_for_file (var, 0);
|
||||
|
||||
current_variable_set_list = save;
|
||||
|
||||
value += strlen (value);
|
||||
value = variable_buffer_output (value, " ", 1);
|
||||
value = variable_expand_string (value, v->value, (long)-1);
|
||||
|
||||
value = variable_buffer;
|
||||
|
||||
#if 0
|
||||
/* Waste a little memory and save time. */
|
||||
value = xrealloc (value, strlen (value))
|
||||
#endif
|
||||
|
||||
variable_buffer = obuf;
|
||||
variable_buffer_length = olen;
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
/* Like variable_expand_for_file, but the returned string is malloc'd.
|
||||
This function is called a lot. It wants to be efficient. */
|
||||
|
||||
|
||||
54
file.c
54
file.c
@@ -54,22 +54,23 @@ lookup_file (name)
|
||||
register struct file *f;
|
||||
register char *n;
|
||||
register unsigned int hashval;
|
||||
#ifdef VMS
|
||||
#if defined(VMS) && !defined(WANT_CASE_SENSITIVE_TARGETS)
|
||||
register char *lname, *ln;
|
||||
#endif
|
||||
|
||||
if (*name == '\0')
|
||||
abort ();
|
||||
assert (*name != '\0');
|
||||
|
||||
/* This is also done in parse_file_seq, so this is redundant
|
||||
for names read from makefiles. It is here for names passed
|
||||
on the command line. */
|
||||
#ifdef VMS
|
||||
# ifndef WANT_CASE_SENSITIVE_TARGETS
|
||||
lname = (char *)malloc(strlen(name) + 1);
|
||||
for (n=name, ln=lname; *n != '\0'; ++n, ++ln)
|
||||
*ln = isupper(*n) ? tolower(*n) : *n;
|
||||
*ln = isupper((unsigned char)*n) ? tolower((unsigned char)*n) : *n;
|
||||
*ln = '\0';
|
||||
name = lname;
|
||||
# endif
|
||||
|
||||
while (name[0] == '[' && name[1] == ']' && name[2] != '\0')
|
||||
name += 2;
|
||||
@@ -103,13 +104,13 @@ lookup_file (name)
|
||||
{
|
||||
if (strieq (f->hname, name))
|
||||
{
|
||||
#ifdef VMS
|
||||
#if defined(VMS) && !defined(WANT_CASE_SENSITIVE_TARGETS)
|
||||
free (lname);
|
||||
#endif
|
||||
return f;
|
||||
}
|
||||
}
|
||||
#ifdef VMS
|
||||
#if defined(VMS) && !defined(WANT_CASE_SENSITIVE_TARGETS)
|
||||
free (lname);
|
||||
#endif
|
||||
return 0;
|
||||
@@ -122,23 +123,24 @@ enter_file (name)
|
||||
register struct file *f, *new;
|
||||
register char *n;
|
||||
register unsigned int hashval;
|
||||
#ifdef VMS
|
||||
#if defined(VMS) && !defined(WANT_CASE_SENSITIVE_TARGETS)
|
||||
char *lname, *ln;
|
||||
#endif
|
||||
|
||||
if (*name == '\0')
|
||||
abort ();
|
||||
assert (*name != '\0');
|
||||
|
||||
#ifdef VMS
|
||||
#if defined(VMS) && !defined(WANT_CASE_SENSITIVE_TARGETS)
|
||||
lname = (char *)malloc (strlen (name) + 1);
|
||||
for (n = name, ln = lname; *n != '\0'; ++n, ++ln)
|
||||
{
|
||||
if (isupper(*n))
|
||||
*ln = tolower(*n);
|
||||
if (isupper((unsigned char)*n))
|
||||
*ln = tolower((unsigned char)*n);
|
||||
else
|
||||
*ln = *n;
|
||||
}
|
||||
*ln = 0;
|
||||
/* Creates a possible leak, old value of name is unreachable, but I
|
||||
currently don't know how to fix it. */
|
||||
name = lname;
|
||||
#endif
|
||||
|
||||
@@ -153,7 +155,7 @@ enter_file (name)
|
||||
|
||||
if (f != 0 && !f->double_colon)
|
||||
{
|
||||
#ifdef VMS
|
||||
#if defined(VMS) && !defined(WANT_CASE_SENSITIVE_TARGETS)
|
||||
free(lname);
|
||||
#endif
|
||||
return f;
|
||||
@@ -248,8 +250,9 @@ file_hash_enter (file, name, oldhash, oldname)
|
||||
if (strieq (oldfile->hname, name))
|
||||
break;
|
||||
|
||||
/* If the old file is the same as the new file, something's wrong. */
|
||||
assert (oldfile != file);
|
||||
/* If the old file is the same as the new file, never mind. */
|
||||
if (oldfile == file)
|
||||
return;
|
||||
|
||||
if (oldhash != 0 && (newbucket != oldbucket || oldfile != 0))
|
||||
{
|
||||
@@ -390,7 +393,7 @@ remove_intermediates (sig)
|
||||
for (i = 0; i < FILE_BUCKETS; ++i)
|
||||
for (f = files[i]; f != 0; f = f->next)
|
||||
if (f->intermediate && (f->dontcare || !f->precious)
|
||||
&& !f->secondary)
|
||||
&& !f->secondary && !f->cmd_target)
|
||||
{
|
||||
int status;
|
||||
if (f->update_status == -1)
|
||||
@@ -540,6 +543,10 @@ snap_deps ()
|
||||
f = lookup_file (".POSIX");
|
||||
if (f != 0 && f->is_target)
|
||||
posix_pedantic = 1;
|
||||
|
||||
f = lookup_file (".NOTPARALLEL");
|
||||
if (f != 0 && f->is_target)
|
||||
not_parallel = 1;
|
||||
}
|
||||
|
||||
/* Set the `command_state' member of FILE and all its `also_make's. */
|
||||
@@ -620,19 +627,20 @@ print_file (f)
|
||||
putchar ('\n');
|
||||
|
||||
if (f->precious)
|
||||
puts (_("# Precious file (dependency of .PRECIOUS)."));
|
||||
puts (_("# Precious file (prerequisite of .PRECIOUS)."));
|
||||
if (f->phony)
|
||||
puts (_("# Phony target (dependency of .PHONY)."));
|
||||
puts (_("# Phony target (prerequisite of .PHONY)."));
|
||||
if (f->cmd_target)
|
||||
puts (_("# Command-line target."));
|
||||
if (f->dontcare)
|
||||
puts (_("# A default or MAKEFILES makefile."));
|
||||
printf (_("# Implicit rule search has%s been done.\n"),
|
||||
f->tried_implicit ? "" : _(" not"));
|
||||
puts (f->tried_implicit
|
||||
? _("# Implicit rule search has been done.")
|
||||
: _("# Implicit rule search has not been done."));
|
||||
if (f->stem != 0)
|
||||
printf (_("# Implicit/static pattern stem: `%s'\n"), f->stem);
|
||||
if (f->intermediate)
|
||||
puts (_("# File is an intermediate dependency."));
|
||||
puts (_("# File is an intermediate prerequisite."));
|
||||
if (f->also_make != 0)
|
||||
{
|
||||
fputs (_("# Also makes:"), stdout);
|
||||
@@ -650,8 +658,8 @@ print_file (f)
|
||||
file_timestamp_sprintf (buf, f->last_mtime);
|
||||
printf (_("# Last modified %s\n"), buf);
|
||||
}
|
||||
printf (_("# File has%s been updated.\n"),
|
||||
f->updated ? "" : _(" not"));
|
||||
puts (f->updated
|
||||
? _("# File has been updated.") : _("# File has not been updated."));
|
||||
switch (f->command_state)
|
||||
{
|
||||
case cs_running:
|
||||
|
||||
14
filedef.h
14
filedef.h
@@ -48,6 +48,10 @@ struct file
|
||||
/* List of variable sets used for this file. */
|
||||
struct variable_set_list *variables;
|
||||
|
||||
/* Pattern-specific variable reference for this target, or null if there
|
||||
isn't one. Also see the pat_searched flag, below. */
|
||||
struct variable_set_list *pat_variables;
|
||||
|
||||
/* Immediate dependent that caused this target to be remade,
|
||||
or nil if there isn't one. */
|
||||
struct file *parent;
|
||||
@@ -56,10 +60,6 @@ struct file
|
||||
the same file. Otherwise this is null. */
|
||||
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,
|
||||
or -1 if none has been made. */
|
||||
|
||||
@@ -87,8 +87,6 @@ struct file
|
||||
unsigned int secondary:1;
|
||||
unsigned int dontcare:1; /* Nonzero if no complaint is to be made if
|
||||
this target cannot be remade. */
|
||||
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. */
|
||||
@@ -119,9 +117,9 @@ extern void set_command_state PARAMS ((struct file *file, int state));
|
||||
extern void notice_finished_file PARAMS ((struct file *file));
|
||||
|
||||
|
||||
#if ST_MTIM_NSEC
|
||||
#ifdef ST_MTIM_NSEC
|
||||
# define FILE_TIMESTAMP_STAT_MODTIME(st) \
|
||||
FILE_TIMESTAMP_FROM_S_AND_NS ((st).st_mtim.tv_sec, \
|
||||
FILE_TIMESTAMP_FROM_S_AND_NS ((st).st_mtime, \
|
||||
(st).st_mtim.ST_MTIM_NSEC)
|
||||
# define FILE_TIMESTAMPS_PER_S \
|
||||
MIN ((FILE_TIMESTAMP) 1000000000, \
|
||||
|
||||
553
function.c
553
function.c
@@ -1,5 +1,5 @@
|
||||
/* Builtin function expansion for GNU Make.
|
||||
Copyright (C) 1988,89,91,92,93,94,95,96,97 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988,1989,1991-1997,1999 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify
|
||||
@@ -23,6 +23,7 @@ Boston, MA 02111-1307, USA. */
|
||||
#include "dep.h"
|
||||
#include "job.h"
|
||||
#include "commands.h"
|
||||
#include "debug.h"
|
||||
|
||||
#ifdef _AMIGA
|
||||
#include "amiga.h"
|
||||
@@ -32,10 +33,11 @@ Boston, MA 02111-1307, USA. */
|
||||
struct function_table_entry
|
||||
{
|
||||
const char *name;
|
||||
int len;
|
||||
int required_args;
|
||||
int expand_args;
|
||||
char *(*func_ptr) PARAMS((char *output, char **argv, const char*funcname));
|
||||
unsigned char len;
|
||||
unsigned char minimum_args;
|
||||
unsigned char maximum_args;
|
||||
char expand_args;
|
||||
char *(*func_ptr) PARAMS ((char *output, char **argv, const char *fname));
|
||||
};
|
||||
|
||||
|
||||
@@ -126,7 +128,7 @@ patsubst_expand (o, text, pattern, replace, pattern_percent, replace_percent)
|
||||
unsigned int pattern_prepercent_len, pattern_postpercent_len;
|
||||
unsigned int replace_prepercent_len, replace_postpercent_len = 0;
|
||||
char *t;
|
||||
unsigned int len;
|
||||
int len;
|
||||
int doneany = 0;
|
||||
|
||||
/* We call find_percent on REPLACE before checking PATTERN so that REPLACE
|
||||
@@ -229,7 +231,7 @@ lookup_function (table, s)
|
||||
const struct function_table_entry *table;
|
||||
const char *s;
|
||||
{
|
||||
int len = strlen(s);
|
||||
int len = strlen (s);
|
||||
|
||||
for (; table->name != NULL; ++table)
|
||||
if (table->len <= len
|
||||
@@ -384,7 +386,7 @@ func_patsubst (o, argv, funcname)
|
||||
|
||||
|
||||
static char *
|
||||
func_join(o, argv, funcname)
|
||||
func_join (o, argv, funcname)
|
||||
char *o;
|
||||
char **argv;
|
||||
const char *funcname;
|
||||
@@ -427,7 +429,7 @@ func_join(o, argv, funcname)
|
||||
|
||||
|
||||
static char *
|
||||
func_origin(o, argv, funcname)
|
||||
func_origin (o, argv, funcname)
|
||||
char *o;
|
||||
char **argv;
|
||||
const char *funcname;
|
||||
@@ -472,7 +474,7 @@ func_origin(o, argv, funcname)
|
||||
#ifdef VMS
|
||||
#define IS_PATHSEP(c) ((c) == ']')
|
||||
#else
|
||||
#ifdef __MSDOS__
|
||||
#if defined(__MSDOS__) || defined(WINDOWS32)
|
||||
#define IS_PATHSEP(c) ((c) == '/' || (c) == '\\')
|
||||
#else
|
||||
#define IS_PATHSEP(c) ((c) == '/')
|
||||
@@ -481,7 +483,7 @@ func_origin(o, argv, funcname)
|
||||
|
||||
|
||||
static char *
|
||||
func_notdir_suffix(o, argv, funcname)
|
||||
func_notdir_suffix (o, argv, funcname)
|
||||
char *o;
|
||||
char **argv;
|
||||
const char *funcname;
|
||||
@@ -490,9 +492,9 @@ func_notdir_suffix(o, argv, funcname)
|
||||
char *list_iterator = argv[0];
|
||||
char *p2 =0;
|
||||
int doneany =0;
|
||||
int len=0;
|
||||
unsigned int len=0;
|
||||
|
||||
int is_suffix = streq(funcname, "suffix");
|
||||
int is_suffix = streq (funcname, "suffix");
|
||||
int is_notdir = !is_suffix;
|
||||
while ((p2 = find_next_token (&list_iterator, &len)) != 0)
|
||||
{
|
||||
@@ -516,7 +518,7 @@ func_notdir_suffix(o, argv, funcname)
|
||||
}
|
||||
#if defined(WINDOWS32) || defined(__MSDOS__)
|
||||
/* Handle the case of "d:foo/bar". */
|
||||
else if (streq(funcname, "notdir") && p2[0] && p2[1] == ':')
|
||||
else if (streq (funcname, "notdir") && p2[0] && p2[1] == ':')
|
||||
{
|
||||
p = p2 + 2;
|
||||
o = variable_buffer_output (o, p, len - (p - p2));
|
||||
@@ -542,7 +544,7 @@ func_notdir_suffix(o, argv, funcname)
|
||||
|
||||
|
||||
static char *
|
||||
func_basename_dir(o, argv, funcname)
|
||||
func_basename_dir (o, argv, funcname)
|
||||
char *o;
|
||||
char **argv;
|
||||
const char *funcname;
|
||||
@@ -551,9 +553,9 @@ func_basename_dir(o, argv, funcname)
|
||||
char *p3 = argv[0];
|
||||
char *p2=0;
|
||||
int doneany=0;
|
||||
int len=0;
|
||||
unsigned int len=0;
|
||||
char *p=0;
|
||||
int is_basename= streq(funcname, "basename");
|
||||
int is_basename= streq (funcname, "basename");
|
||||
int is_dir= !is_basename;
|
||||
|
||||
while ((p2 = find_next_token (&p3, &len)) != 0)
|
||||
@@ -561,7 +563,7 @@ func_basename_dir(o, argv, funcname)
|
||||
p = p2 + len;
|
||||
while (p >= p2 && (!is_basename || *p != '.'))
|
||||
{
|
||||
if (IS_PATHSEP(*p))
|
||||
if (IS_PATHSEP (*p))
|
||||
break;
|
||||
--p;
|
||||
}
|
||||
@@ -601,7 +603,7 @@ func_basename_dir(o, argv, funcname)
|
||||
}
|
||||
|
||||
static char *
|
||||
func_addsuffix_addprefix(o, argv, funcname)
|
||||
func_addsuffix_addprefix (o, argv, funcname)
|
||||
char *o;
|
||||
char **argv;
|
||||
const char *funcname;
|
||||
@@ -611,9 +613,9 @@ func_addsuffix_addprefix(o, argv, funcname)
|
||||
int is_addprefix = streq (funcname, "addprefix");
|
||||
int is_addsuffix = !is_addprefix;
|
||||
|
||||
int doneany =0;
|
||||
char *p=0;
|
||||
int len =0;
|
||||
int doneany = 0;
|
||||
char *p;
|
||||
unsigned int len;
|
||||
|
||||
while ((p = find_next_token (&list_iterator, &len)) != 0)
|
||||
{
|
||||
@@ -634,7 +636,7 @@ func_addsuffix_addprefix(o, argv, funcname)
|
||||
}
|
||||
|
||||
static char *
|
||||
func_subst(o, argv, funcname)
|
||||
func_subst (o, argv, funcname)
|
||||
char *o;
|
||||
char **argv;
|
||||
const char *funcname;
|
||||
@@ -647,13 +649,13 @@ func_subst(o, argv, funcname)
|
||||
|
||||
|
||||
static char *
|
||||
func_firstword(o, argv, funcname)
|
||||
func_firstword (o, argv, funcname)
|
||||
char *o;
|
||||
char **argv;
|
||||
const char *funcname;
|
||||
{
|
||||
int i=0;
|
||||
char *words = argv[0];
|
||||
unsigned int i;
|
||||
char *words = argv[0]; /* Use a temp variable for find_next_token */
|
||||
char *p = find_next_token (&words, &i);
|
||||
|
||||
if (p != 0)
|
||||
@@ -664,7 +666,7 @@ func_firstword(o, argv, funcname)
|
||||
|
||||
|
||||
static char *
|
||||
func_words(o, argv, funcname)
|
||||
func_words (o, argv, funcname)
|
||||
char *o;
|
||||
char **argv;
|
||||
const char *funcname;
|
||||
@@ -688,9 +690,9 @@ strip_whitespace (begpp, endpp)
|
||||
char **begpp;
|
||||
char **endpp;
|
||||
{
|
||||
while (isspace (**begpp) && *begpp <= *endpp)
|
||||
while (isspace ((unsigned char)**begpp) && *begpp <= *endpp)
|
||||
(*begpp) ++;
|
||||
while (isspace (**endpp) && *endpp >= *begpp)
|
||||
while (isspace ((unsigned char)**endpp) && *endpp >= *begpp)
|
||||
(*endpp) --;
|
||||
return *begpp;
|
||||
}
|
||||
@@ -699,16 +701,13 @@ int
|
||||
is_numeric (p)
|
||||
char *p;
|
||||
{
|
||||
char *end = p + strlen (p) -1;
|
||||
char *end = p + strlen (p) - 1;
|
||||
char *beg = p;
|
||||
strip_whitespace (&p, &end);
|
||||
while (p <= end)
|
||||
{
|
||||
if (!isdigit (*p))
|
||||
return 0;
|
||||
|
||||
p++;
|
||||
}
|
||||
while (p <= end)
|
||||
if (!ISDIGIT (*(p++))) /* ISDIGIT only evals its arg once: see make.h. */
|
||||
return 0;
|
||||
|
||||
return (end - beg >= 0);
|
||||
}
|
||||
@@ -725,7 +724,7 @@ check_numeric (s, message)
|
||||
|
||||
|
||||
static char *
|
||||
func_word(o, argv, funcname)
|
||||
func_word (o, argv, funcname)
|
||||
char *o;
|
||||
char **argv;
|
||||
const char *funcname;
|
||||
@@ -759,45 +758,42 @@ func_wordlist (o, argv, funcname)
|
||||
char **argv;
|
||||
const char *funcname;
|
||||
{
|
||||
int i=0;
|
||||
int j=0;
|
||||
int start, count;
|
||||
|
||||
/* Check the first argument. */
|
||||
/* Check the arguments. */
|
||||
check_numeric (argv[0],
|
||||
_("non-numeric first argument to `wordlist' function"));
|
||||
i =atoi(argv[0]);
|
||||
check_numeric (argv[1],
|
||||
_("non-numeric second argument to `wordlist' function"));
|
||||
|
||||
j = atoi(argv[1]);
|
||||
start = atoi (argv[0]);
|
||||
count = atoi (argv[1]) - start + 1;
|
||||
|
||||
if (count > 0)
|
||||
{
|
||||
char *p;
|
||||
char *end_p = argv[2];
|
||||
|
||||
{
|
||||
char *p;
|
||||
char *end_p = argv[2];
|
||||
/* Find the beginning of the "start"th word. */
|
||||
while (((p = find_next_token (&end_p, 0)) != 0) && --start)
|
||||
;
|
||||
|
||||
int start = (i < j) ? i : j;
|
||||
int count = j -i ;
|
||||
if (count < 0)
|
||||
count = - count;
|
||||
count ++;
|
||||
if (p)
|
||||
{
|
||||
/* Find the end of the "count"th word from start. */
|
||||
while (--count && (find_next_token (&end_p, 0) != 0))
|
||||
;
|
||||
|
||||
/* Return the stuff in the middle. */
|
||||
o = variable_buffer_output (o, p, end_p - p);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
while (((p = find_next_token (&end_p, 0)) != 0) && --start)
|
||||
{}
|
||||
if (p)
|
||||
{
|
||||
while (--count && (find_next_token (&end_p, 0) != 0))
|
||||
{}
|
||||
o = variable_buffer_output (o, p, end_p - p);
|
||||
}
|
||||
}
|
||||
return o;
|
||||
}
|
||||
|
||||
static char*
|
||||
func_findstring(o, argv, funcname)
|
||||
func_findstring (o, argv, funcname)
|
||||
char *o;
|
||||
char **argv;
|
||||
const char *funcname;
|
||||
@@ -817,15 +813,15 @@ func_foreach (o, argv, funcname)
|
||||
const char *funcname;
|
||||
{
|
||||
/* expand only the first two. */
|
||||
char *varname = expand_argument (argv[0], argv[1] -1);
|
||||
char *list = expand_argument (argv[1], argv[2] -1);
|
||||
char *body = savestring (argv[2], argv[3] - argv[2] -1 );
|
||||
char *varname = expand_argument (argv[0], NULL);
|
||||
char *list = expand_argument (argv[1], NULL);
|
||||
char *body = argv[2];
|
||||
|
||||
int len =0;
|
||||
int doneany = 0;
|
||||
char *list_iterator = list;
|
||||
char *p;
|
||||
register struct variable *var=0;
|
||||
int doneany =0;
|
||||
unsigned int len;
|
||||
register struct variable *var;
|
||||
|
||||
push_new_variable_scope ();
|
||||
var = define_variable (varname, strlen (varname), "", o_automatic, 0);
|
||||
@@ -859,7 +855,6 @@ func_foreach (o, argv, funcname)
|
||||
pop_variable_scope ();
|
||||
free (varname);
|
||||
free (list);
|
||||
free (body);
|
||||
|
||||
return o;
|
||||
}
|
||||
@@ -877,21 +872,20 @@ func_filter_filterout (o, argv, funcname)
|
||||
char **argv;
|
||||
const char *funcname;
|
||||
{
|
||||
struct a_word *wordhead =0;
|
||||
struct a_word *wordtail =0;
|
||||
struct a_word *wordhead = 0;
|
||||
struct a_word *wordtail = 0;
|
||||
|
||||
int is_filter = streq (funcname, "filter");
|
||||
char *patterns = argv[0];
|
||||
|
||||
char *word_iterator = argv[1];
|
||||
|
||||
char *p;
|
||||
int len;
|
||||
char *word_iterator = argv[1];
|
||||
unsigned int len;
|
||||
|
||||
/* Chop ARGV[1] up into words and then run each pattern through. */
|
||||
while ((p = find_next_token (&word_iterator, &len)) != 0)
|
||||
{
|
||||
struct a_word *w = (struct a_word *)alloca(sizeof(struct a_word));
|
||||
struct a_word *w = (struct a_word *)alloca (sizeof (struct a_word));
|
||||
if (wordhead == 0)
|
||||
wordhead = w;
|
||||
else
|
||||
@@ -907,13 +901,12 @@ func_filter_filterout (o, argv, funcname)
|
||||
|
||||
if (wordhead != 0)
|
||||
{
|
||||
struct a_word *wp =0;
|
||||
char *pat_iterator = patterns;
|
||||
int doneany = 0;
|
||||
struct a_word *wp;
|
||||
|
||||
wordtail->next = 0;
|
||||
|
||||
|
||||
/* Run each pattern through the words, killing words. */
|
||||
while ((p = find_next_token (&pat_iterator, &len)) != 0)
|
||||
{
|
||||
@@ -948,7 +941,7 @@ func_filter_filterout (o, argv, funcname)
|
||||
|
||||
|
||||
static char *
|
||||
func_strip(o, argv, funcname)
|
||||
func_strip (o, argv, funcname)
|
||||
char *o;
|
||||
char **argv;
|
||||
const char *funcname;
|
||||
@@ -961,10 +954,10 @@ func_strip(o, argv, funcname)
|
||||
int i=0;
|
||||
char *word_start=0;
|
||||
|
||||
while (isspace(*p))
|
||||
while (isspace ((unsigned char)*p))
|
||||
++p;
|
||||
word_start = p;
|
||||
for (i=0; *p != '\0' && !isspace(*p); ++p, ++i)
|
||||
for (i=0; *p != '\0' && !isspace ((unsigned char)*p); ++p, ++i)
|
||||
{}
|
||||
if (!i)
|
||||
break;
|
||||
@@ -996,18 +989,18 @@ func_error (o, argv, funcname)
|
||||
another special case where function arguments aren't broken up,
|
||||
just create a format string that puts them back together. */
|
||||
for (len=0, argvp=argv; *argvp != 0; ++argvp)
|
||||
len += strlen(*argvp) + 2;
|
||||
len += strlen (*argvp) + 2;
|
||||
|
||||
p = msg = alloca (len + 1);
|
||||
|
||||
for (argvp=argv; argvp[1] != 0; ++argvp)
|
||||
{
|
||||
strcpy(p, *argvp);
|
||||
p += strlen(*argvp);
|
||||
strcpy (p, *argvp);
|
||||
p += strlen (*argvp);
|
||||
*(p++) = ',';
|
||||
*(p++) = ' ';
|
||||
}
|
||||
strcpy(p, *argvp);
|
||||
strcpy (p, *argvp);
|
||||
|
||||
if (*funcname == 'e')
|
||||
fatal (reading_file, "%s", msg);
|
||||
@@ -1034,15 +1027,15 @@ func_sort (o, argv, funcname)
|
||||
|
||||
/* Chop ARGV[0] into words and put them in WORDS. */
|
||||
char *t = argv[0];
|
||||
char *p=0;
|
||||
int len;
|
||||
char *p;
|
||||
unsigned int len;
|
||||
int i;
|
||||
|
||||
while ((p = find_next_token (&t, &len)) != 0)
|
||||
{
|
||||
if (wordi >= nwords - 1)
|
||||
{
|
||||
nwords = 2* nwords + 5;
|
||||
nwords = (2 * nwords) + 5;
|
||||
words = (char **) xrealloc ((char *) words,
|
||||
nwords * sizeof (char *));
|
||||
}
|
||||
@@ -1075,8 +1068,64 @@ func_sort (o, argv, funcname)
|
||||
return o;
|
||||
}
|
||||
|
||||
/*
|
||||
$(if condition,true-part[,false-part])
|
||||
|
||||
CONDITION is false iff it evaluates to an empty string. White
|
||||
space before and after condition are stripped before evaluation.
|
||||
|
||||
If CONDITION is true, then TRUE-PART is evaluated, otherwise FALSE-PART is
|
||||
evaluated (if it exists). Because only one of the two PARTs is evaluated,
|
||||
you can use $(if ...) to create side-effects (with $(shell ...), for
|
||||
example).
|
||||
*/
|
||||
|
||||
static char *
|
||||
func_wildcard(o, argv, funcname)
|
||||
func_if (o, argv, funcname)
|
||||
char *o;
|
||||
char **argv;
|
||||
const char *funcname;
|
||||
{
|
||||
char *begp = argv[0];
|
||||
char *endp = begp + strlen (argv[0]);
|
||||
int result = 0;
|
||||
|
||||
/* Find the result of the condition: if we have a value, and it's not
|
||||
empty, the condition is true. If we don't have a value, or it's the
|
||||
empty string, then it's false. */
|
||||
|
||||
strip_whitespace (&begp, &endp);
|
||||
|
||||
if (begp < endp)
|
||||
{
|
||||
char *expansion = expand_argument (begp, NULL);
|
||||
|
||||
result = strlen (expansion);
|
||||
free (expansion);
|
||||
}
|
||||
|
||||
/* If the result is true (1) we want to eval the first argument, and if
|
||||
it's false (0) we want to eval the second. If the argument doesn't
|
||||
exist we do nothing, otherwise expand it and add to the buffer. */
|
||||
|
||||
argv += 1 + !result;
|
||||
|
||||
if (argv[0])
|
||||
{
|
||||
char *expansion;
|
||||
|
||||
expansion = expand_argument (argv[0], NULL);
|
||||
|
||||
o = variable_buffer_output (o, expansion, strlen (expansion));
|
||||
|
||||
free (expansion);
|
||||
}
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
static char *
|
||||
func_wildcard (o, argv, funcname)
|
||||
char *o;
|
||||
char **argv;
|
||||
const char *funcname;
|
||||
@@ -1145,11 +1194,11 @@ windows32_openpipe (int *pipedes, int *pid_p, char **command_argv, char **envp)
|
||||
HANDLE hProcess;
|
||||
|
||||
|
||||
saAttr.nLength = sizeof(SECURITY_ATTRIBUTES);
|
||||
saAttr.nLength = sizeof (SECURITY_ATTRIBUTES);
|
||||
saAttr.bInheritHandle = TRUE;
|
||||
saAttr.lpSecurityDescriptor = NULL;
|
||||
|
||||
if (DuplicateHandle(GetCurrentProcess(),
|
||||
if (DuplicateHandle (GetCurrentProcess(),
|
||||
GetStdHandle(STD_INPUT_HANDLE),
|
||||
GetCurrentProcess(),
|
||||
&hIn,
|
||||
@@ -1174,36 +1223,48 @@ windows32_openpipe (int *pipedes, int *pid_p, char **command_argv, char **envp)
|
||||
if (!CreatePipe(&hChildOutRd, &hChildOutWr, &saAttr, 0))
|
||||
fatal (NILF, _("CreatePipe() failed (e=%d)\n"), GetLastError());
|
||||
|
||||
|
||||
|
||||
hProcess = process_init_fd(hIn, hChildOutWr, hErr);
|
||||
|
||||
if (!hProcess)
|
||||
fatal (NILF, _("windows32_openpipe (): process_init_fd() failed\n"));
|
||||
|
||||
else
|
||||
process_register(hProcess);
|
||||
|
||||
/* make sure that CreateProcess() has Path it needs */
|
||||
sync_Path_environment();
|
||||
|
||||
if (!process_begin(hProcess, command_argv, envp, command_argv[0], NULL))
|
||||
if (!process_begin(hProcess, command_argv, envp, command_argv[0], NULL)) {
|
||||
/* register process for wait */
|
||||
process_register(hProcess);
|
||||
|
||||
/* set the pid for returning to caller */
|
||||
*pid_p = (int) hProcess;
|
||||
else
|
||||
fatal (NILF, _("windows32_openpipe (): unable to launch process (e=%d)\n"),
|
||||
process_last_err(hProcess));
|
||||
|
||||
/* set up to read data from child */
|
||||
pipedes[0] = _open_osfhandle((long) hChildOutRd, O_RDONLY);
|
||||
|
||||
/* this will be closed almost right away */
|
||||
pipedes[1] = _open_osfhandle((long) hChildOutWr, O_APPEND);
|
||||
} else {
|
||||
/* reap/cleanup the failed process */
|
||||
process_cleanup(hProcess);
|
||||
|
||||
/* close handles which were duplicated, they weren't used */
|
||||
CloseHandle(hIn);
|
||||
CloseHandle(hErr);
|
||||
|
||||
/* close pipe handles, they won't be used */
|
||||
CloseHandle(hChildOutRd);
|
||||
CloseHandle(hChildOutWr);
|
||||
|
||||
/* set status for return */
|
||||
pipedes[0] = pipedes[1] = -1;
|
||||
*pid_p = -1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __MSDOS__
|
||||
int
|
||||
FILE *
|
||||
msdos_openpipe (int* pipedes, int *pidp, char *text)
|
||||
{
|
||||
FILE *fpipe=0;
|
||||
@@ -1307,7 +1368,7 @@ func_shell (o, argv, funcname)
|
||||
/* For error messages. */
|
||||
if (reading_file != 0)
|
||||
{
|
||||
error_prefix = (char *) alloca (strlen(reading_file->filenm)+100);
|
||||
error_prefix = (char *) alloca (strlen (reading_file->filenm)+11+4);
|
||||
sprintf (error_prefix,
|
||||
"%s:%lu: ", reading_file->filenm, reading_file->lineno);
|
||||
}
|
||||
@@ -1316,6 +1377,13 @@ func_shell (o, argv, funcname)
|
||||
|
||||
#ifdef WINDOWS32
|
||||
windows32_openpipe (pipedes, &pid, command_argv, envp);
|
||||
|
||||
if (pipedes[0] < 0) {
|
||||
/* open of the pipe failed, mark as failed execution */
|
||||
shell_function_completed = -1;
|
||||
|
||||
return o;
|
||||
} else
|
||||
#else /* WINDOWS32 */
|
||||
|
||||
# ifdef __MSDOS__
|
||||
@@ -1397,10 +1465,10 @@ func_shell (o, argv, funcname)
|
||||
reap_children (1, 0);
|
||||
|
||||
if (batch_filename) {
|
||||
if (debug_flag)
|
||||
printf(_("Cleaning up temporary batch file %s\n"), batch_filename);
|
||||
remove(batch_filename);
|
||||
free(batch_filename);
|
||||
DB (DB_VERBOSE, (_("Cleaning up temporary batch file %s\n"),
|
||||
batch_filename));
|
||||
remove (batch_filename);
|
||||
free (batch_filename);
|
||||
}
|
||||
shell_function_pid = 0;
|
||||
|
||||
@@ -1465,7 +1533,10 @@ func_shell (char *o, char **argv, const char *funcname)
|
||||
if (command_argv == 0)
|
||||
return o;
|
||||
|
||||
|
||||
/* Note the mktemp() is a security hole, but this only runs on Amiga.
|
||||
Ideally we would use main.c:open_tmpfile(), but this uses a special
|
||||
Open(), not fopen(), and I'm not familiar enough with the code to mess
|
||||
with it. */
|
||||
strcpy (tmp_output, "t:MakeshXXXXXXXX");
|
||||
mktemp (tmp_output);
|
||||
child_stdout = Open (tmp_output, MODE_NEWFILE);
|
||||
@@ -1540,64 +1611,16 @@ func_not (char* o, char **argv, char *funcname)
|
||||
{
|
||||
char * s = argv[0];
|
||||
int result = 0;
|
||||
while (isspace (*s))
|
||||
while (isspace ((unsigned char)*s))
|
||||
s++;
|
||||
result = ! (*s);
|
||||
o = variable_buffer_output (o, result ? "1" : "", result);
|
||||
return o;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
This is an experimental conditional function.
|
||||
|
||||
Syntax:
|
||||
|
||||
$(if condition, true-part, false-part)
|
||||
|
||||
This is fully not consistent with make's syntax, but more in line
|
||||
with `normal' programming languages.
|
||||
|
||||
Semantics:
|
||||
|
||||
- CONDITION is false iff it evaluates to an empty string. White
|
||||
space before and after condition are stripped before evaluation.
|
||||
|
||||
- If CONDITION is true, then TRUE-PART is evaluated, otherwise
|
||||
FALSE-PART is evaluated. Because only one of the two PARTs is
|
||||
evaluated, you can use $(if ) to create side-effects with the
|
||||
$(shell ) function
|
||||
|
||||
*/
|
||||
static char *
|
||||
func_if (char* o, char **argv, char *funcname)
|
||||
{
|
||||
char *begp = argv[0];
|
||||
char *endp = argv[1]-2;
|
||||
char *expansion =0;
|
||||
int result = 0;
|
||||
|
||||
strip_whitespace (&begp, &endp);
|
||||
if(begp <= endp)
|
||||
expansion = expand_argument (begp, endp + 1);
|
||||
|
||||
result = expansion
|
||||
? strlen (expansion)
|
||||
: 0;
|
||||
|
||||
result = !result;
|
||||
free (expansion);
|
||||
|
||||
expansion = expand_argument (argv[1 + result], argv[2+result] -1);
|
||||
o = variable_buffer_output (o, expansion, strlen (expansion));
|
||||
|
||||
return o;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#define STRING_SIZE_TUPLE(_s) (_s), (sizeof(_s)-1)
|
||||
#define STRING_SIZE_TUPLE(_s) (_s), (sizeof (_s)-1)
|
||||
|
||||
/* Lookup table for builtin functions.
|
||||
|
||||
@@ -1605,50 +1628,47 @@ func_if (char* o, char **argv, char *funcname)
|
||||
some efficiency by moving most often used functions to the start of the
|
||||
table.
|
||||
|
||||
If REQUIRED_ARGS is positive, the function takes exactly that many
|
||||
arguments. All subsequent text is included with the last argument. So,
|
||||
since $(sort a,b,c) takes only one argument, it will be the full string
|
||||
"a,b,c". If the value is negative, it's the minimum number of arguments.
|
||||
A function can have more, but if it has less an error is generated.
|
||||
If MAXIMUM_ARGS is 0, that means there is no maximum and all
|
||||
comma-separated values are treated as arguments.
|
||||
|
||||
EXPAND_ARGS means that all arguments should be expanded before invocation.
|
||||
Functions that do namespace tricks (foreach) don't automatically expand. */
|
||||
|
||||
static char *func_call PARAMS((char *o, char **argv, const char *funcname));
|
||||
static char *func_call PARAMS ((char *o, char **argv, const char *funcname));
|
||||
|
||||
|
||||
static struct function_table_entry function_table[] =
|
||||
{
|
||||
/* Name/size */ /* ARG EXP? Function */
|
||||
{ STRING_SIZE_TUPLE("addprefix"), 2, 1, func_addsuffix_addprefix},
|
||||
{ STRING_SIZE_TUPLE("addsuffix"), 2, 1, func_addsuffix_addprefix},
|
||||
{ STRING_SIZE_TUPLE("basename"), 1, 1, func_basename_dir},
|
||||
{ STRING_SIZE_TUPLE("dir"), 1, 1, func_basename_dir},
|
||||
{ STRING_SIZE_TUPLE("notdir"), 1, 1, func_notdir_suffix},
|
||||
{ STRING_SIZE_TUPLE("subst"), 3, 1, func_subst},
|
||||
{ STRING_SIZE_TUPLE("suffix"), 1, 1, func_notdir_suffix},
|
||||
{ STRING_SIZE_TUPLE("filter"), 2, 1, func_filter_filterout},
|
||||
{ STRING_SIZE_TUPLE("filter-out"), 2, 1, func_filter_filterout},
|
||||
{ STRING_SIZE_TUPLE("findstring"), 2, 1, func_findstring},
|
||||
{ STRING_SIZE_TUPLE("firstword"), 1, 1, func_firstword},
|
||||
{ STRING_SIZE_TUPLE("join"), 2, 1, func_join},
|
||||
{ STRING_SIZE_TUPLE("patsubst"), 3, 1, func_patsubst},
|
||||
{ STRING_SIZE_TUPLE("shell"), 1, 1, func_shell},
|
||||
{ STRING_SIZE_TUPLE("sort"), 1, 1, func_sort},
|
||||
{ STRING_SIZE_TUPLE("strip"), 1, 1, func_strip},
|
||||
{ STRING_SIZE_TUPLE("wildcard"), 1, 1, func_wildcard},
|
||||
{ STRING_SIZE_TUPLE("word"), 2, 1, func_word},
|
||||
{ STRING_SIZE_TUPLE("wordlist"), 3, 1, func_wordlist},
|
||||
{ STRING_SIZE_TUPLE("words"), 1, 1, func_words},
|
||||
{ STRING_SIZE_TUPLE("origin"), 1, 1, func_origin},
|
||||
{ STRING_SIZE_TUPLE("foreach"), 3, 0, func_foreach},
|
||||
{ STRING_SIZE_TUPLE("call"), -1, 1, func_call},
|
||||
{ STRING_SIZE_TUPLE("error"), 1, 1, func_error},
|
||||
{ STRING_SIZE_TUPLE("warning"), 1, 1, func_error},
|
||||
/* Name/size */ /* MIN MAX EXP? Function */
|
||||
{ STRING_SIZE_TUPLE("addprefix"), 2, 2, 1, func_addsuffix_addprefix},
|
||||
{ STRING_SIZE_TUPLE("addsuffix"), 2, 2, 1, func_addsuffix_addprefix},
|
||||
{ STRING_SIZE_TUPLE("basename"), 1, 1, 1, func_basename_dir},
|
||||
{ STRING_SIZE_TUPLE("dir"), 1, 1, 1, func_basename_dir},
|
||||
{ STRING_SIZE_TUPLE("notdir"), 1, 1, 1, func_notdir_suffix},
|
||||
{ STRING_SIZE_TUPLE("subst"), 3, 3, 1, func_subst},
|
||||
{ STRING_SIZE_TUPLE("suffix"), 1, 1, 1, func_notdir_suffix},
|
||||
{ STRING_SIZE_TUPLE("filter"), 2, 2, 1, func_filter_filterout},
|
||||
{ STRING_SIZE_TUPLE("filter-out"), 2, 2, 1, func_filter_filterout},
|
||||
{ STRING_SIZE_TUPLE("findstring"), 2, 2, 1, func_findstring},
|
||||
{ STRING_SIZE_TUPLE("firstword"), 1, 1, 1, func_firstword},
|
||||
{ STRING_SIZE_TUPLE("join"), 2, 2, 1, func_join},
|
||||
{ STRING_SIZE_TUPLE("patsubst"), 3, 3, 1, func_patsubst},
|
||||
{ STRING_SIZE_TUPLE("shell"), 1, 1, 1, func_shell},
|
||||
{ STRING_SIZE_TUPLE("sort"), 1, 1, 1, func_sort},
|
||||
{ STRING_SIZE_TUPLE("strip"), 1, 1, 1, func_strip},
|
||||
{ STRING_SIZE_TUPLE("wildcard"), 1, 1, 1, func_wildcard},
|
||||
{ STRING_SIZE_TUPLE("word"), 2, 2, 1, func_word},
|
||||
{ STRING_SIZE_TUPLE("wordlist"), 3, 3, 1, func_wordlist},
|
||||
{ STRING_SIZE_TUPLE("words"), 1, 1, 1, func_words},
|
||||
{ STRING_SIZE_TUPLE("origin"), 1, 1, 1, func_origin},
|
||||
{ STRING_SIZE_TUPLE("foreach"), 3, 3, 0, func_foreach},
|
||||
{ STRING_SIZE_TUPLE("call"), 1, 0, 1, func_call},
|
||||
{ STRING_SIZE_TUPLE("error"), 1, 1, 1, func_error},
|
||||
{ STRING_SIZE_TUPLE("warning"), 1, 1, 1, func_error},
|
||||
{ STRING_SIZE_TUPLE("if"), 2, 3, 0, func_if},
|
||||
#ifdef EXPERIMENTAL
|
||||
{ STRING_SIZE_TUPLE("eq"), 2, 1, func_eq},
|
||||
{ STRING_SIZE_TUPLE("if"), 3, 0, func_if},
|
||||
{ STRING_SIZE_TUPLE("not"), 1, 1, func_not},
|
||||
{ STRING_SIZE_TUPLE("eq"), 2, 2, 1, func_eq},
|
||||
{ STRING_SIZE_TUPLE("not"), 1, 1, 1, func_not},
|
||||
#endif
|
||||
{ 0 }
|
||||
};
|
||||
@@ -1663,11 +1683,7 @@ expand_builtin_function (o, argc, argv, entry_p)
|
||||
char **argv;
|
||||
struct function_table_entry *entry_p;
|
||||
{
|
||||
int min = (entry_p->required_args > 0
|
||||
? entry_p->required_args
|
||||
: -entry_p->required_args);
|
||||
|
||||
if (argc < min)
|
||||
if (argc < entry_p->minimum_args)
|
||||
fatal (reading_file,
|
||||
_("Insufficient number of arguments (%d) to function `%s'"),
|
||||
argc, entry_p->name);
|
||||
@@ -1692,39 +1708,36 @@ handle_function (op, stringp)
|
||||
const struct function_table_entry *entry_p;
|
||||
char openparen = (*stringp)[0];
|
||||
char closeparen = openparen == '(' ? ')' : '}';
|
||||
char *beg = *stringp + 1;
|
||||
char *endref;
|
||||
char *beg;
|
||||
char *end;
|
||||
int count = 0;
|
||||
char *argbeg;
|
||||
register char *p;
|
||||
char **argv, **argvp;
|
||||
int nargs;
|
||||
|
||||
beg = *stringp + 1;
|
||||
|
||||
entry_p = lookup_function (function_table, beg);
|
||||
|
||||
if (!entry_p)
|
||||
return 0;
|
||||
|
||||
/* We have found a call to a builtin function. Find the end of the
|
||||
arguments, and do the function. */
|
||||
/* We found a builtin function. Find the beginning of its arguments (skip
|
||||
whitespace after the name). */
|
||||
|
||||
endref = beg + entry_p->len;
|
||||
|
||||
/* Space after function name isn't part of the args. */
|
||||
p = next_token (endref);
|
||||
argbeg = p;
|
||||
beg = next_token (beg + entry_p->len);
|
||||
|
||||
/* Find the end of the function invocation, counting nested use of
|
||||
whichever kind of parens we use. Since we're looking, count commas
|
||||
to get a rough estimate of how many arguments we might have. The
|
||||
count might be high, but it'll never be low. */
|
||||
|
||||
for (nargs=1; *p != '\0'; ++p)
|
||||
if (*p == ',')
|
||||
for (nargs=1, end=beg; *end != '\0'; ++end)
|
||||
if (*end == ',')
|
||||
++nargs;
|
||||
else if (*p == openparen)
|
||||
else if (*end == openparen)
|
||||
++count;
|
||||
else if (*p == closeparen && --count < 0)
|
||||
else if (*end == closeparen && --count < 0)
|
||||
break;
|
||||
|
||||
if (count >= 0)
|
||||
@@ -1732,47 +1745,63 @@ handle_function (op, stringp)
|
||||
_("unterminated call to function `%s': missing `%c'"),
|
||||
entry_p->name, closeparen);
|
||||
|
||||
*stringp = end;
|
||||
|
||||
/* Get some memory to store the arg pointers. */
|
||||
argvp = argv = (char **) alloca (sizeof(char *) * (nargs + 2));
|
||||
argvp = argv = (char **) alloca (sizeof (char *) * (nargs + 2));
|
||||
|
||||
/* Chop the string into arguments, then store the end pointer and a nul.
|
||||
If REQUIRED_ARGS is positive, as soon as we hit that many assume the
|
||||
rest of the string is part of the last argument. */
|
||||
*argvp = argbeg;
|
||||
nargs = 1;
|
||||
while (entry_p->required_args < 0 || nargs < entry_p->required_args)
|
||||
/* Chop the string into arguments, then a nul. As soon as we hit
|
||||
MAXIMUM_ARGS (if it's >0) assume the rest of the string is part of the
|
||||
last argument.
|
||||
|
||||
If we're expanding, store pointers to the expansion of each one. If
|
||||
not, make a duplicate of the string and point into that, nul-terminating
|
||||
each argument. */
|
||||
|
||||
if (!entry_p->expand_args)
|
||||
{
|
||||
char *next = find_next_argument (openparen, closeparen, *argvp, p);
|
||||
int len = end - beg;
|
||||
|
||||
if (!next)
|
||||
break;
|
||||
p = xmalloc (len+1);
|
||||
memcpy (p, beg, len);
|
||||
p[len] = '\0';
|
||||
beg = p;
|
||||
end = beg + len;
|
||||
}
|
||||
|
||||
p = beg;
|
||||
nargs = 0;
|
||||
for (p=beg, nargs=0; p < end; ++argvp)
|
||||
{
|
||||
char *next;
|
||||
|
||||
*(++argvp) = next+1;
|
||||
++nargs;
|
||||
|
||||
if (nargs == entry_p->maximum_args
|
||||
|| (! (next = find_next_argument (openparen, closeparen, p, end))))
|
||||
next = end;
|
||||
|
||||
if (entry_p->expand_args)
|
||||
*argvp = expand_argument (p, next);
|
||||
else
|
||||
{
|
||||
*argvp = p;
|
||||
*next = '\0';
|
||||
}
|
||||
|
||||
p = next + 1;
|
||||
}
|
||||
|
||||
*(++argvp) = p+1;
|
||||
*(++argvp) = 0;
|
||||
|
||||
/* If we should expand, do it. */
|
||||
if (entry_p->expand_args)
|
||||
{
|
||||
for (argvp=argv; argvp[1] != 0; ++argvp)
|
||||
*argvp = expand_argument (*argvp, argvp[1]-1);
|
||||
|
||||
/* end pointer doesn't make sense for expanded stuff. */
|
||||
*argvp = 0;
|
||||
}
|
||||
*argvp = NULL;
|
||||
|
||||
/* Finally! Run the function... */
|
||||
*op = expand_builtin_function (*op, nargs, argv, entry_p);
|
||||
|
||||
/* If we allocated memory for the expanded args, free it again. */
|
||||
/* Free memory. */
|
||||
if (entry_p->expand_args)
|
||||
for (argvp=argv; *argvp != 0; ++argvp)
|
||||
free (*argvp);
|
||||
|
||||
*stringp = p;
|
||||
else
|
||||
free (beg);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -1789,26 +1818,26 @@ func_call (o, argv, funcname)
|
||||
const char *funcname;
|
||||
{
|
||||
char *fname;
|
||||
char *cp;
|
||||
int flen;
|
||||
char *body;
|
||||
int i;
|
||||
const struct function_table_entry *entry_p;
|
||||
|
||||
/* Calling nothing is a no-op. */
|
||||
if (*argv[0] == '\0')
|
||||
return o;
|
||||
|
||||
/* There is no way to define a variable with a space in the name, so strip
|
||||
trailing whitespace as a favor to the user. */
|
||||
|
||||
flen = strlen (argv[0]);
|
||||
fname = argv[0] + flen - 1;
|
||||
while (isspace (*fname))
|
||||
--fname;
|
||||
fname[1] = '\0';
|
||||
|
||||
flen = fname - argv[0] + 1;
|
||||
leading and trailing whitespace as a favor to the user. */
|
||||
fname = argv[0];
|
||||
while (*fname != '\0' && isspace ((unsigned char)*fname))
|
||||
++fname;
|
||||
|
||||
cp = fname + strlen (fname) - 1;
|
||||
while (cp > fname && isspace ((unsigned char)*cp))
|
||||
--cp;
|
||||
cp[1] = '\0';
|
||||
|
||||
/* Calling nothing is a no-op */
|
||||
if (*fname == '\0')
|
||||
return o;
|
||||
|
||||
/* Are we invoking a builtin function? */
|
||||
|
||||
@@ -1816,20 +1845,24 @@ func_call (o, argv, funcname)
|
||||
|
||||
if (entry_p)
|
||||
{
|
||||
/* How many arguments do we have? */
|
||||
for (i=0; argv[i+1]; ++i)
|
||||
;
|
||||
;
|
||||
|
||||
return expand_builtin_function (o, i, argv + 1, entry_p);
|
||||
return expand_builtin_function (o, i, argv+1, entry_p);
|
||||
}
|
||||
|
||||
/* No, so the first argument is the name of a variable to be expanded and
|
||||
interpreted as a function. Create the variable reference. */
|
||||
/* Not a builtin, so the first argument is the name of a variable to be
|
||||
expanded and interpreted as a function. Create the variable
|
||||
reference. */
|
||||
flen = strlen (fname);
|
||||
|
||||
body = alloca (flen + 4);
|
||||
body[0]='$';
|
||||
body[1]='(';
|
||||
strcpy (body + 2, fname);
|
||||
body[flen+2]=')';
|
||||
body[flen+3]= '\0';
|
||||
body[0] = '$';
|
||||
body[1] = '(';
|
||||
memcpy (body + 2, fname, flen);
|
||||
body[flen+2] = ')';
|
||||
body[flen+3] = '\0';
|
||||
|
||||
/* Set up arguments $(1) .. $(N). $(0) is the function name. */
|
||||
|
||||
@@ -1840,7 +1873,7 @@ func_call (o, argv, funcname)
|
||||
char num[11];
|
||||
|
||||
sprintf (num, "%d", i);
|
||||
define_variable (num, strlen (num), *argv, o_automatic, 0);
|
||||
define_variable (num, strlen (num), *argv, o_automatic, 1);
|
||||
}
|
||||
|
||||
/* Expand the body in the context of the arguments, adding the result to
|
||||
@@ -1850,5 +1883,5 @@ func_call (o, argv, funcname)
|
||||
|
||||
pop_variable_scope ();
|
||||
|
||||
return o + strlen(o);
|
||||
return o + strlen (o);
|
||||
}
|
||||
|
||||
11
getopt.c
11
getopt.c
@@ -79,16 +79,11 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef _
|
||||
/* This is for other GNU distributions with internationalized messages.
|
||||
When compiling libc, the _ macro is predefined. */
|
||||
# ifdef HAVE_LIBINTL_H
|
||||
# include <libintl.h>
|
||||
# define _(msgid) gettext (msgid)
|
||||
# else
|
||||
# define _(msgid) (msgid)
|
||||
# endif
|
||||
#endif
|
||||
#include "gettext.h"
|
||||
#define _(msgid) gettext (msgid)
|
||||
|
||||
|
||||
/* This version of `getopt' appears to the caller like standard Unix `getopt'
|
||||
but it behaves differently for the user, since it allows the user
|
||||
|
||||
177
gettext.h
Normal file
177
gettext.h
Normal file
@@ -0,0 +1,177 @@
|
||||
/* Begin of libgettext.h */
|
||||
|
||||
/* Message catalogs for internationalization.
|
||||
Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* Because on some systems (e.g. Solaris) we sometimes have to include
|
||||
the systems libintl.h as well as this file we have more complex
|
||||
include protection above. But the systems header might perhaps also
|
||||
define _LIBINTL_H and therefore we have to protect the definition here. */
|
||||
|
||||
#if !defined _LIBINTL_H || !defined _LIBGETTEXT_H
|
||||
#ifndef _LIBINTL_H
|
||||
# define _LIBINTL_H 1
|
||||
#endif
|
||||
#define _LIBGETTEXT_H 1
|
||||
|
||||
/* We define an additional symbol to signal that we use the GNU
|
||||
implementation of gettext. */
|
||||
#define __USE_GNU_GETTEXT 1
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#if HAVE_LOCALE_H
|
||||
# include <locale.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef PARAMS
|
||||
# if __STDC__ || defined __cplusplus
|
||||
# define PARAMS(args) args
|
||||
# else
|
||||
# define PARAMS(args) ()
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef NULL
|
||||
# if !defined __cplusplus || defined __GNUC__
|
||||
# define NULL ((void *) 0)
|
||||
# else
|
||||
# define NULL (0)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !HAVE_LC_MESSAGES
|
||||
/* This value determines the behaviour of the gettext() and dgettext()
|
||||
function. But some system does not have this defined. Define it
|
||||
to a default value. */
|
||||
# define LC_MESSAGES (-1)
|
||||
#endif
|
||||
|
||||
/* Declarations for gettext-using-catgets interface. Derived from
|
||||
Jim Meyering's libintl.h. */
|
||||
struct _msg_ent
|
||||
{
|
||||
const char *_msg;
|
||||
int _msg_number;
|
||||
};
|
||||
|
||||
#if HAVE_CATGETS
|
||||
/* These two variables are defined in the automatically by po-to-tbl.sed
|
||||
generated file `cat-id-tbl.c'. */
|
||||
extern const struct _msg_ent _msg_tbl[];
|
||||
extern int _msg_tbl_length;
|
||||
#endif
|
||||
|
||||
/* For automatical extraction of messages sometimes no real
|
||||
translation is needed. Instead the string itself is the result. */
|
||||
#define gettext_noop(Str) (Str)
|
||||
|
||||
/* Look up MSGID in the current default message catalog for the current
|
||||
LC_MESSAGES locale. If not found, returns MSGID itself (the default
|
||||
text). */
|
||||
extern char *gettext PARAMS ((const char *__msgid));
|
||||
/* static char *gettext__ PARAMS ((const char *__msgid)); */
|
||||
|
||||
/* Look up MSGID in the DOMAINNAME message catalog for the current
|
||||
LC_MESSAGES locale. */
|
||||
extern char *dgettext PARAMS ((const char *__domainname, const char *__msgid));
|
||||
/* static char *dgettext__ PARAMS ((const char *__domainname,
|
||||
const char *__msgid)); */
|
||||
|
||||
/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
|
||||
locale. */
|
||||
extern char *dcgettext PARAMS ((const char *__domainname, const char *__msgid,
|
||||
int __category));
|
||||
extern char *dcgettext__ PARAMS ((const char *__domainname,
|
||||
const char *__msgid, int __category));
|
||||
|
||||
/* Set the current default message catalog to DOMAINNAME.
|
||||
If DOMAINNAME is null, return the current default.
|
||||
If DOMAINNAME is "", reset to the default of "messages". */
|
||||
extern char *textdomain PARAMS ((const char *__domainname));
|
||||
/* static char *textdomain__ PARAMS ((const char *__domainname)); */
|
||||
|
||||
/* Specify that the DOMAINNAME message catalog will be found
|
||||
in DIRNAME rather than in the system locale data base. */
|
||||
extern char *bindtextdomain PARAMS ((const char *__domainname,
|
||||
const char *__dirname));
|
||||
/* static char *bindtextdomain__ PARAMS ((const char *__domainname,
|
||||
const char *__dirname)); */
|
||||
|
||||
#if ENABLE_NLS
|
||||
|
||||
/* Solaris 2.3 has the gettext function but dcgettext is missing.
|
||||
So we omit this optimization for Solaris 2.3. BTW, Solaris 2.4
|
||||
has dcgettext. */
|
||||
# if !HAVE_CATGETS && (!HAVE_GETTEXT || HAVE_DCGETTEXT)
|
||||
|
||||
# define gettext(Msgid) \
|
||||
dgettext (NULL, Msgid)
|
||||
|
||||
# define dgettext(Domainname, Msgid) \
|
||||
dcgettext (Domainname, Msgid, LC_MESSAGES)
|
||||
|
||||
# if defined __GNUC__ && __GNUC__ == 2 && __GNUC_MINOR__ >= 7
|
||||
/* This global variable is defined in loadmsgcat.c. We need a sign,
|
||||
whether a new catalog was loaded, which can be associated with all
|
||||
translations. */
|
||||
extern int _nl_msg_cat_cntr;
|
||||
|
||||
# define dcgettext(Domainname, Msgid, Category) \
|
||||
(__extension__ \
|
||||
({ \
|
||||
char *__result; \
|
||||
if (__builtin_constant_p (Msgid)) \
|
||||
{ \
|
||||
static char *__translation__; \
|
||||
static int __catalog_counter__; \
|
||||
if (! __translation__ || __catalog_counter__ != _nl_msg_cat_cntr) \
|
||||
{ \
|
||||
__translation__ = \
|
||||
dcgettext__ (Domainname, Msgid, Category); \
|
||||
__catalog_counter__ = _nl_msg_cat_cntr; \
|
||||
} \
|
||||
__result = __translation__; \
|
||||
} \
|
||||
else \
|
||||
__result = dcgettext__ (Domainname, Msgid, Category); \
|
||||
__result; \
|
||||
}))
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#else
|
||||
|
||||
# define gettext(Msgid) (Msgid)
|
||||
# define dgettext(Domainname, Msgid) (Msgid)
|
||||
# define dcgettext(Domainname, Msgid, Category) (Msgid)
|
||||
# define textdomain(Domainname) ((char *) Domainname)
|
||||
# define bindtextdomain(Domainname, Dirname) ((char *) Dirname)
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/* End of libgettext.h */
|
||||
@@ -1,3 +1,25 @@
|
||||
1999-09-12 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* fnmatch.c: Last GLIBC version wouldn't compile outside of GLIBC
|
||||
(undefined reference to internal_function). Update to the latest
|
||||
version
|
||||
|
||||
1999-09-11 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* glob.h (glob): If #defining to glob64, do this before
|
||||
declaring it, so that all declarations and uses match, and
|
||||
do not declare glob64, to avoid a declaration clash.
|
||||
(globfree): Likewise with globfree64.
|
||||
|
||||
1999-09-08 Eli Zaretskii <eliz@is.elta.co.il>
|
||||
|
||||
* glob.c (prefix_array) [__MSDOS__,WINDOWS32]: Keep the trailing
|
||||
slash unless DIRNAME is just "x:/".
|
||||
|
||||
1999-09-06 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* fnmatch.c: Update to latest version from GLIBC.
|
||||
|
||||
1999-07-21 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* glob.c, glob.h, fnmatch.c, fnmatch.h: Update to latest version
|
||||
|
||||
@@ -64,27 +64,27 @@
|
||||
# define ISASCII(c) isascii(c)
|
||||
# endif
|
||||
|
||||
#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
|
||||
# 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 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))
|
||||
|
||||
@@ -132,22 +132,29 @@ extern int errno;
|
||||
# if !defined HAVE___STRCHRNUL && !defined _LIBC
|
||||
static char *
|
||||
__strchrnul (s, c)
|
||||
register const char *s;
|
||||
const char *s;
|
||||
int c;
|
||||
{
|
||||
c = (unsigned char)c;
|
||||
while (*s && *s != c)
|
||||
++s;
|
||||
return (char *)s;
|
||||
char *result = strchr (s, c);
|
||||
if (result == NULL)
|
||||
result = strchr (s, '\0');
|
||||
return result;
|
||||
}
|
||||
# endif
|
||||
|
||||
# ifndef internal_function
|
||||
/* Inside GNU libc we mark some function in a special way. In other
|
||||
environments simply ignore the marking. */
|
||||
# define internal_function
|
||||
# endif
|
||||
|
||||
/* Match STRING against the filename pattern PATTERN, returning zero if
|
||||
it matches, nonzero if not. */
|
||||
static int internal_fnmatch __P ((const char *pattern, const char *string,
|
||||
int no_leading_period, int flags))
|
||||
internal_function;
|
||||
static int
|
||||
#ifdef _LIBC
|
||||
internal_function
|
||||
#endif
|
||||
internal_fnmatch (pattern, string, no_leading_period, flags)
|
||||
const char *pattern;
|
||||
const char *string;
|
||||
|
||||
29
glob/glob.c
29
glob/glob.c
@@ -299,6 +299,12 @@ static int glob_in_dir __P ((const char *pattern, const char *directory,
|
||||
static int prefix_array __P ((const char *prefix, char **array, size_t n));
|
||||
static int collated_compare __P ((const __ptr_t, const __ptr_t));
|
||||
|
||||
#ifdef VMS
|
||||
/* these compilers like prototypes */
|
||||
#if !defined _LIBC || !defined NO_GLOB_PATTERN_P
|
||||
int __glob_pattern_p (const char *pattern, int quote);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Find the end of the sub-pattern in a brace expression. We define
|
||||
this as an inline function if the compiler permits. */
|
||||
@@ -609,7 +615,12 @@ glob (pattern, flags, errfunc, pglob)
|
||||
if (dirname[1] == '\0' || dirname[1] == '/')
|
||||
{
|
||||
/* Look up home directory. */
|
||||
const char *home_dir = getenv ("HOME");
|
||||
#ifdef VMS
|
||||
/* This isn't obvious, RTLs of DECC and VAXC know about "HOME" */
|
||||
const char *home_dir = getenv ("SYS$LOGIN");
|
||||
#else
|
||||
const char *home_dir = getenv ("HOME");
|
||||
#endif
|
||||
# ifdef _AMIGA
|
||||
if (home_dir == NULL || home_dir[0] == '\0')
|
||||
home_dir = "SYS:";
|
||||
@@ -618,6 +629,11 @@ glob (pattern, flags, errfunc, pglob)
|
||||
if (home_dir == NULL || home_dir[0] == '\0')
|
||||
home_dir = "c:/users/default"; /* poor default */
|
||||
# else
|
||||
# ifdef VMS
|
||||
/* Again, this isn't obvious, if "HOME" isn't known "SYS$LOGIN" should be set */
|
||||
if (home_dir == NULL || home_dir[0] == '\0')
|
||||
home_dir = "SYS$DISK:[]";
|
||||
# else
|
||||
if (home_dir == NULL || home_dir[0] == '\0')
|
||||
{
|
||||
int success;
|
||||
@@ -676,6 +692,7 @@ glob (pattern, flags, errfunc, pglob)
|
||||
else
|
||||
home_dir = "~"; /* No luck. */
|
||||
}
|
||||
# endif /* VMS */
|
||||
# endif /* WINDOWS32 */
|
||||
# endif
|
||||
/* Now construct the full directory. */
|
||||
@@ -696,7 +713,7 @@ glob (pattern, flags, errfunc, pglob)
|
||||
dirname = newp;
|
||||
}
|
||||
}
|
||||
# if !defined _AMIGA && !defined WINDOWS32
|
||||
# if !defined _AMIGA && !defined WINDOWS32 && !defined VMS
|
||||
else
|
||||
{
|
||||
char *end_name = strchr (dirname, '/');
|
||||
@@ -776,7 +793,7 @@ glob (pattern, flags, errfunc, pglob)
|
||||
home directory. */
|
||||
return GLOB_NOMATCH;
|
||||
}
|
||||
# endif /* Not Amiga && not WINDOWS32. */
|
||||
# endif /* Not Amiga && not WINDOWS32 && not VMS. */
|
||||
}
|
||||
#endif /* Not VMS. */
|
||||
|
||||
@@ -1105,7 +1122,7 @@ prefix_array (dirname, array, n)
|
||||
#if defined __MSDOS__ || defined WINDOWS32
|
||||
else if (dirlen > 1)
|
||||
{
|
||||
if (dirname[dirlen - 1] == '/')
|
||||
if (dirname[dirlen - 1] == '/' && dirname[dirlen - 2] == ':')
|
||||
/* DIRNAME is "d:/". Don't prepend the slash from DIRNAME. */
|
||||
--dirlen;
|
||||
else if (dirname[dirlen - 1] == ':')
|
||||
@@ -1213,6 +1230,10 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
|
||||
int meta;
|
||||
int save;
|
||||
|
||||
#ifdef VMS
|
||||
if (*directory == 0)
|
||||
directory = "[]";
|
||||
#endif
|
||||
meta = __glob_pattern_p (pattern, !(flags & GLOB_NOESCAPE));
|
||||
if (meta == 0)
|
||||
{
|
||||
|
||||
40
glob/glob.h
40
glob/glob.h
@@ -51,7 +51,15 @@ extern "C" {
|
||||
typedef __SIZE_TYPE__ __size_t;
|
||||
# else
|
||||
/* This is a guess. */
|
||||
/*hb
|
||||
* Conflicts with DECCs aready defined type __size_t.
|
||||
* Defining an own type with a name beginning with '__' is no good.
|
||||
* Anyway if DECC is used and __SIZE_T is defined then __size_t is
|
||||
* already defined (and I hope it's exactly the one we need here).
|
||||
*/
|
||||
#if !(defined __DECC && defined __SIZE_T)
|
||||
typedef unsigned long int __size_t;
|
||||
#endif
|
||||
# endif
|
||||
#else
|
||||
/* The GNU CC stddef.h version defines __size_t as empty. We need a real
|
||||
@@ -118,7 +126,11 @@ typedef struct
|
||||
struct dirent *(*gl_readdir) __PMT ((void *));
|
||||
__ptr_t (*gl_opendir) __PMT ((__const char *));
|
||||
int (*gl_lstat) __PMT ((__const char *, struct stat *));
|
||||
#if defined(VMS) && defined(__DECC) && !defined(_POSIX_C_SOURCE)
|
||||
int (*gl_stat) __PMT ((__const char *, struct stat *, ...));
|
||||
#else
|
||||
int (*gl_stat) __PMT ((__const char *, struct stat *));
|
||||
#endif
|
||||
} glob_t;
|
||||
|
||||
#ifdef _LARGEFILE64_SOURCE
|
||||
@@ -140,6 +152,19 @@ typedef struct
|
||||
} glob64_t;
|
||||
#endif
|
||||
|
||||
#if _FILE_OFFSET_BITS == 64 && __GNUC__ < 2
|
||||
# define glob glob64
|
||||
# define globfree globfree64
|
||||
#else
|
||||
# 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
|
||||
#endif
|
||||
|
||||
/* Do glob searching for PATTERN, placing results in PGLOB.
|
||||
The bits defined above may be set in FLAGS.
|
||||
If a directory cannot be opened or read and ERRFUNC is not nil,
|
||||
@@ -148,7 +173,7 @@ typedef struct
|
||||
`glob' returns GLOB_ABEND; if it returns zero, the error is ignored.
|
||||
If memory cannot be allocated for PGLOB, GLOB_NOSPACE is returned.
|
||||
Otherwise, `glob' returns zero. */
|
||||
#if _FILE_OFFSET_BITS != 64
|
||||
#if _FILE_OFFSET_BITS != 64 || __GNUC__ < 2
|
||||
extern int glob __P ((__const char *__pattern, int __flags,
|
||||
int (*__errfunc) (__const char *, int),
|
||||
glob_t *__pglob));
|
||||
@@ -156,24 +181,11 @@ extern int glob __P ((__const char *__pattern, int __flags,
|
||||
/* Free storage allocated in PGLOB by a previous `glob' call. */
|
||||
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
|
||||
|
||||
|
||||
|
||||
3
i18n/.cvsignore
Normal file
3
i18n/.cvsignore
Normal file
@@ -0,0 +1,3 @@
|
||||
*.mo *.pot
|
||||
|
||||
Makefile.in Makefile
|
||||
75
i18n/Makefile.am
Normal file
75
i18n/Makefile.am
Normal file
@@ -0,0 +1,75 @@
|
||||
# Makefile for PO directories.
|
||||
# François Pinard <pinard@iro.umontreal.ca>, 1998.
|
||||
|
||||
AUTOMAKE_OPTIONS = gnits
|
||||
|
||||
localedir = $(prefix)/share/locale
|
||||
|
||||
ALL_POFILES = @ALL_POFILES@
|
||||
ALL_MOFILES = @ALL_MOFILES@
|
||||
MOFILES = @MOFILES@
|
||||
|
||||
EXTRA_DIST = $(PACKAGE).pot $(ALL_POFILES) $(ALL_MOFILES)
|
||||
|
||||
MSGFMT = msgfmt
|
||||
MSGMERGE = msgmerge
|
||||
XGETTEXT = xgettext
|
||||
|
||||
SUFFIXES = .po .pox .mo
|
||||
|
||||
.po.pox:
|
||||
$(MAKE) $(PACKAGE).pot
|
||||
$(MSGMERGE) $< $(srcdir)/$(PACKAGE).pot -o $*.pox
|
||||
|
||||
.po.mo:
|
||||
file=$(srcdir)/`echo $* | sed 's,.*/,,'`.mo \
|
||||
&& rm -f $$file && $(MSGFMT) -o $$file $<
|
||||
|
||||
all: $(ALL_MOFILES)
|
||||
|
||||
install-data-local: $(MOFILES)
|
||||
if USE_NLS
|
||||
files='$(MOFILES)'; \
|
||||
for file in $$files; do \
|
||||
base=`basename $$file`; \
|
||||
langdir=$(DESTDIR)$(localedir)/`echo $$base | sed 's/\.mo$$//'`/LC_MESSAGES; \
|
||||
$(mkinstalldirs) $$langdir; \
|
||||
echo " $(INSTALL_DATA) $(srcdir)/$$file $$langdir/$(PACKAGE).mo"; \
|
||||
$(INSTALL_DATA) $(srcdir)/$$file $$langdir/$(PACKAGE).mo; \
|
||||
done
|
||||
endif
|
||||
|
||||
uninstall-local:
|
||||
if USE_NLS
|
||||
files='$(MOFILES)'; \
|
||||
for file in $$files; do \
|
||||
base=`basename $$file`; \
|
||||
langdir=$(DESTDIR)$(localedir)/`echo $$base | sed 's/\.mo$$//'`/LC_MESSAGES; \
|
||||
rm -f $$langdir/$(PACKAGE).mo; \
|
||||
done
|
||||
endif
|
||||
|
||||
MAINTAINER_CLEAN = $(PACKAGE).pot $(MOFILES)
|
||||
|
||||
$(srcdir)/$(PACKAGE).pot: $(top_srcdir)/stamp-pot
|
||||
$(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \
|
||||
--add-comments --keyword=_ --keyword=N_ `cat $(top_srcdir)/stamp-pot`
|
||||
test ! -f $(PACKAGE).po || ( rm -f $@ && mv $(PACKAGE).po $@ )
|
||||
|
||||
update-po: Makefile
|
||||
$(MAKE) $(PACKAGE).pot
|
||||
files='$(ALL_MOFILES)'; \
|
||||
for file in $$files; do \
|
||||
base=`basename $$file`; \
|
||||
lang=`echo $$base | sed 's/\.mo$$//'`; \
|
||||
mv $(srcdir)/$$lang.po $(srcdir)/$$lang.old.po; \
|
||||
echo "$$lang:"; \
|
||||
cd $(srcdir) \
|
||||
&& if $(MSGMERGE) $$lang.old.po $(PACKAGE).pot -o $$lang.po; then \
|
||||
rm -f $$lang.old.po; \
|
||||
else \
|
||||
echo "msgmerge for $$file failed!"; \
|
||||
rm -f $$lang.po; \
|
||||
mv $$lang.old.po $$lang.po; \
|
||||
fi; \
|
||||
done
|
||||
1831
i18n/de.po
Normal file
1831
i18n/de.po
Normal file
File diff suppressed because it is too large
Load Diff
1932
i18n/es.po
Normal file
1932
i18n/es.po
Normal file
File diff suppressed because it is too large
Load Diff
1445
i18n/fr.po
Normal file
1445
i18n/fr.po
Normal file
File diff suppressed because it is too large
Load Diff
1445
i18n/ko.po
Normal file
1445
i18n/ko.po
Normal file
File diff suppressed because it is too large
Load Diff
1441
i18n/nl.po
Normal file
1441
i18n/nl.po
Normal file
File diff suppressed because it is too large
Load Diff
1467
i18n/pl.po
Normal file
1467
i18n/pl.po
Normal file
File diff suppressed because it is too large
Load Diff
1424
i18n/ru.po
Normal file
1424
i18n/ru.po
Normal file
File diff suppressed because it is too large
Load Diff
67
implicit.c
67
implicit.c
@@ -21,6 +21,7 @@ Boston, MA 02111-1307, USA. */
|
||||
#include "rule.h"
|
||||
#include "dep.h"
|
||||
#include "filedef.h"
|
||||
#include "debug.h"
|
||||
|
||||
static int pattern_search PARAMS ((struct file *file, int archive, unsigned int depth,
|
||||
unsigned int recursions));
|
||||
@@ -36,7 +37,7 @@ try_implicit_rule (file, depth)
|
||||
struct file *file;
|
||||
unsigned int depth;
|
||||
{
|
||||
DEBUGPR (_("Looking for an implicit rule for `%s'.\n"));
|
||||
DBF (DB_IMPLICIT, _("Looking for an implicit rule for `%s'.\n"));
|
||||
|
||||
/* The order of these searches was previously reversed. My logic now is
|
||||
that since the non-archive search uses more information in the target
|
||||
@@ -51,7 +52,8 @@ try_implicit_rule (file, depth)
|
||||
archive member name to search for implicit rules. */
|
||||
if (ar_name (file->name))
|
||||
{
|
||||
DEBUGPR (_("Looking for archive-member implicit rule for `%s'.\n"));
|
||||
DBF (DB_IMPLICIT,
|
||||
_("Looking for archive-member implicit rule for `%s'.\n"));
|
||||
if (pattern_search (file, 1, depth, 0))
|
||||
return 1;
|
||||
}
|
||||
@@ -60,11 +62,6 @@ try_implicit_rule (file, depth)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define DEBUGP2(msg, a1, a2) \
|
||||
do { \
|
||||
if (debug_flag) \
|
||||
{ print_spaces (depth); printf (msg, a1, a2); fflush (stdout); } \
|
||||
} while (0)
|
||||
|
||||
/* Search the pattern rules for a rule with an existing dependency to make
|
||||
FILE. If a rule is found, the appropriate commands and deps are put in FILE
|
||||
@@ -88,7 +85,7 @@ pattern_search (file, archive, depth, recursions)
|
||||
unsigned int recursions;
|
||||
{
|
||||
/* Filename we are searching for a rule for. */
|
||||
char *filename = archive ? index (file->name, '(') : file->name;
|
||||
char *filename = archive ? strchr (file->name, '(') : file->name;
|
||||
|
||||
/* Length of FILENAME. */
|
||||
unsigned int namelen = strlen (filename);
|
||||
@@ -165,14 +162,16 @@ pattern_search (file, archive, depth, recursions)
|
||||
but not counting any slash at the end. (foo/bar/ counts as
|
||||
bar/ in directory foo/, not empty in directory foo/bar/.) */
|
||||
#ifdef VMS
|
||||
lastslash = rindex (filename, ']');
|
||||
lastslash = strrchr (filename, ']');
|
||||
if (lastslash == 0)
|
||||
lastslash = strrchr (filename, ':');
|
||||
#else
|
||||
lastslash = rindex (filename, '/');
|
||||
#ifdef __MSDOS__
|
||||
lastslash = strrchr (filename, '/');
|
||||
#if defined(__MSDOS__) || defined(WINDOWS32)
|
||||
/* Handle backslashes (possibly mixed with forward slashes)
|
||||
and the case of "d:file". */
|
||||
{
|
||||
char *bslash = rindex (filename, '\\');
|
||||
char *bslash = strrchr (filename, '\\');
|
||||
if (lastslash == 0 || bslash > lastslash)
|
||||
lastslash = bslash;
|
||||
if (lastslash == 0 && filename[0] && filename[1] == ':')
|
||||
@@ -199,7 +198,7 @@ pattern_search (file, archive, depth, recursions)
|
||||
don't use it here. */
|
||||
if (rule->in_use)
|
||||
{
|
||||
DEBUGP2 (_("Avoiding implicit rule recursion.%s%s\n"), "", "");
|
||||
DBS (DB_IMPLICIT, (_("Avoiding implicit rule recursion.\n")));
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -228,9 +227,11 @@ pattern_search (file, archive, depth, recursions)
|
||||
prefix and the target pattern does not contain a slash. */
|
||||
|
||||
#ifdef VMS
|
||||
check_lastslash = lastslash != 0 && index (target, ']') == 0;
|
||||
check_lastslash = lastslash != 0
|
||||
&& ((strchr (target, ']') == 0)
|
||||
&& (strchr (target, ':') == 0));
|
||||
#else
|
||||
check_lastslash = lastslash != 0 && index (target, '/') == 0;
|
||||
check_lastslash = lastslash != 0 && strchr (target, '/') == 0;
|
||||
#endif
|
||||
if (check_lastslash)
|
||||
{
|
||||
@@ -335,18 +336,16 @@ pattern_search (file, archive, depth, recursions)
|
||||
stemlen -= (lastslash - filename) + 1;
|
||||
}
|
||||
|
||||
DEBUGP2 (_("Trying pattern rule with stem `%.*s'.\n"),
|
||||
(int) stemlen, stem);
|
||||
DBS (DB_IMPLICIT, (_("Trying pattern rule with stem `%.*s'.\n"),
|
||||
(int) stemlen, stem));
|
||||
|
||||
/* Try each dependency; see if it "exists". */
|
||||
|
||||
deps_found = 0;
|
||||
for (dep = rule->deps; dep != 0; dep = dep->next)
|
||||
{
|
||||
struct file *fp;
|
||||
|
||||
/* If the dependency name has a %, substitute the stem. */
|
||||
p = index (dep_name (dep), '%');
|
||||
p = strchr (dep_name (dep), '%');
|
||||
if (p != 0)
|
||||
{
|
||||
register unsigned int i;
|
||||
@@ -376,16 +375,21 @@ pattern_search (file, archive, depth, recursions)
|
||||
"impossible", then the rule fails and don't
|
||||
bother trying it on the second pass either
|
||||
since we know that will fail too. */
|
||||
DEBUGP2 (_("Rejecting impossible %s dependency `%s'.\n"),
|
||||
p == depname ? _("implicit") : _("rule"), p);
|
||||
DBS (DB_IMPLICIT,
|
||||
(p == depname
|
||||
? _("Rejecting impossible implicit prerequisite `%s'.\n")
|
||||
: _("Rejecting impossible rule prerequisite `%s'.\n"),
|
||||
p));
|
||||
tryrules[i] = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
intermediate_files[deps_found] = 0;
|
||||
|
||||
DEBUGP2 (_("Trying %s dependency `%s'.\n"),
|
||||
p == depname ? _("implicit") : _("rule"), p);
|
||||
DBS (DB_IMPLICIT,
|
||||
(p == depname
|
||||
? _("Trying implicit prerequisite `%s'.\n")
|
||||
: _("Trying rule prerequisite `%s'.\n"), p));
|
||||
|
||||
/* The DEP->changed flag says that this dependency resides in a
|
||||
nonexistent directory. So we normally can skip looking for
|
||||
@@ -393,12 +397,9 @@ pattern_search (file, archive, depth, recursions)
|
||||
dependency file we are actually looking for is in a different
|
||||
directory (the one gotten by prepending FILENAME's directory),
|
||||
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)
|
||||
&& (((fp = lookup_file (p)) != 0 && !fp->intermediate)
|
||||
|| file_exists_p (p)))
|
||||
&& (lookup_file (p) != 0 || file_exists_p (p)))
|
||||
{
|
||||
found_files[deps_found++] = xstrdup (p);
|
||||
continue;
|
||||
@@ -408,8 +409,9 @@ pattern_search (file, archive, depth, recursions)
|
||||
vp = p;
|
||||
if (vpath_search (&vp, (FILE_TIMESTAMP *) 0))
|
||||
{
|
||||
DEBUGP2 (_("Found dependency `%s' as VPATH `%s'\n"), p, vp);
|
||||
strcpy(vp, p);
|
||||
DBS (DB_IMPLICIT,
|
||||
(_("Found prerequisite `%s' as VPATH `%s'\n"), p, vp));
|
||||
strcpy (vp, p);
|
||||
found_files[deps_found++] = vp;
|
||||
continue;
|
||||
}
|
||||
@@ -424,8 +426,9 @@ pattern_search (file, archive, depth, recursions)
|
||||
intermediate_file
|
||||
= (struct file *) alloca (sizeof (struct file));
|
||||
|
||||
DEBUGP2 (_("Looking for a rule with %s file `%s'.\n"),
|
||||
_("intermediate"), p);
|
||||
DBS (DB_IMPLICIT,
|
||||
(_("Looking for a rule with intermediate file `%s'.\n"),
|
||||
p));
|
||||
|
||||
bzero ((char *) intermediate_file, sizeof (struct file));
|
||||
intermediate_file->name = p;
|
||||
|
||||
1
job.h
1
job.h
@@ -46,7 +46,6 @@ struct child
|
||||
|
||||
unsigned int good_stdin:1; /* Nonzero if this child has a good stdin. */
|
||||
unsigned int deleted:1; /* Nonzero if targets have been deleted. */
|
||||
char job_token; /* The token read from the job pipe. */
|
||||
};
|
||||
|
||||
extern struct child *children;
|
||||
|
||||
@@ -8,7 +8,8 @@
|
||||
globsrc := $(wildcard glob/*.c)
|
||||
globhdr := $(wildcard glob/*.h)
|
||||
|
||||
TEMPLATES = README README.DOS config.ami configh.dos config.h.W32 config.h-vms
|
||||
TEMPLATES = README README.DOS README.W32 \
|
||||
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
|
||||
@@ -18,29 +19,29 @@ MTEMPLATES = Makefile.DOS SMakefile
|
||||
|
||||
# General rule for turning a .template into a regular file.
|
||||
#
|
||||
$(TEMPLATES) : % : %.template configure.in
|
||||
$(TEMPLATES) : % : %.template Makefile
|
||||
rm -f $@
|
||||
sed -e 's@%VERSION%@$(VERSION)@' \
|
||||
-e 's@%PACKAGE%@$(PACKAGE)@' \
|
||||
sed -e 's@%VERSION%@$(VERSION)@g' \
|
||||
-e 's@%PACKAGE%@$(PACKAGE)@g' \
|
||||
$< > $@
|
||||
chmod a-w $@
|
||||
|
||||
# Construct Makefiles by adding on dependencies, etc.
|
||||
#
|
||||
$(MTEMPLATES) : % : %.template .dep_segment Makefile.am maintMakefile
|
||||
$(MTEMPLATES) : % : %.template .dep_segment Makefile
|
||||
rm -f $@
|
||||
sed -e 's@%VERSION%@$(VERSION)@' \
|
||||
-e 's@%PROGRAMS%@$(bin_PROGRAMS)@' \
|
||||
-e 's@%SOURCES%@$(filter-out remote-%,$(make_SOURCES)) remote-$$(REMOTE).c@' \
|
||||
-e 's@%OBJECTS%@$(filter-out remote-%,$(make_OBJECTS)) remote-$$(REMOTE).o@' \
|
||||
-e 's@%GLOB_SOURCES%@$(globsrc) $(globhdr)@' \
|
||||
-e 's@%GLOB_OBJECTS%@$(globsrc:glob/%.c=%.o)@' \
|
||||
sed -e 's@%VERSION%@$(VERSION)@g' \
|
||||
-e 's@%PROGRAMS%@$(bin_PROGRAMS)@g' \
|
||||
-e 's@%SOURCES%@$(filter-out remote-%,$(make_SOURCES)) remote-$$(REMOTE).c@g' \
|
||||
-e 's@%OBJECTS%@$(filter-out remote-%,$(make_OBJECTS)) remote-$$(REMOTE).o@g' \
|
||||
-e 's@%GLOB_SOURCES%@$(globsrc) $(globhdr)@g' \
|
||||
-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.am maintMakefile
|
||||
NMakefile: NMakefile.template .dep_segment Makefile
|
||||
rm -f $@
|
||||
cp $< $@
|
||||
echo >>$@; echo '# --------------- DEPENDENCIES' >>$@; echo '#' >>$@; \
|
||||
@@ -49,10 +50,10 @@ NMakefile: NMakefile.template .dep_segment Makefile.am maintMakefile
|
||||
|
||||
# Construct build.sh.in
|
||||
#
|
||||
build.sh.in: build.template Makefile.am maintMakefile
|
||||
build.sh.in: build.template Makefile
|
||||
rm -f $@
|
||||
sed -e 's@%objs%@$(filter-out remote-%, $(make_OBJECTS)@' \
|
||||
-e 's@%globobjs%@$(patsubst %.c,%.o,$(globsrc)))@' \
|
||||
sed -e 's@%objs%@$(filter-out remote-%,$(make_OBJECTS)@g' \
|
||||
-e 's@%globobjs%@$(patsubst %.c,%.o,$(globsrc)))@g' \
|
||||
$< > $@
|
||||
chmod a-w+x $@
|
||||
|
||||
|
||||
105
make.h
105
make.h
@@ -40,11 +40,13 @@ Boston, MA 02111-1307, USA. */
|
||||
#endif /* C++ or ANSI C. */
|
||||
|
||||
|
||||
/* For now, set gettext macro to a no-op. */
|
||||
#undef _
|
||||
#undef N_
|
||||
#define _(s) s
|
||||
#define N_(s) s
|
||||
#include "gettext.h"
|
||||
#define _(Text) gettext (Text)
|
||||
#define N_(Text) gettext_noop (Text)
|
||||
|
||||
#if !HAVE_SETLOCALE
|
||||
# define setlocale(Category, Locale) /* empty */
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef CRAY
|
||||
@@ -77,8 +79,8 @@ Boston, MA 02111-1307, USA. */
|
||||
extern int errno;
|
||||
#endif
|
||||
|
||||
/* A shortcut for EINTR checking. Note you should never negate this! That
|
||||
very likely doesn't mean what you want if EINTR is not available. */
|
||||
/* A shortcut for EINTR checking. Note you should be careful when negating
|
||||
this! That might not mean what you want if EINTR is not available. */
|
||||
#ifdef EINTR
|
||||
# define EINTR_SET (errno == EINTR)
|
||||
#else
|
||||
@@ -107,23 +109,6 @@ extern int errno;
|
||||
# define POSIX 1
|
||||
#endif
|
||||
|
||||
#if defined (HAVE_SYS_SIGLIST) && !defined (SYS_SIGLIST_DECLARED)
|
||||
extern char *sys_siglist[];
|
||||
#endif
|
||||
|
||||
#if !defined (HAVE_SYS_SIGLIST) || !defined (HAVE_STRSIGNAL)
|
||||
# include "signame.h"
|
||||
#endif
|
||||
|
||||
/* Some systems do not define NSIG in <signal.h>. */
|
||||
#ifndef NSIG
|
||||
# ifdef _NSIG
|
||||
# define NSIG _NSIG
|
||||
# else
|
||||
# define NSIG 32
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef RETSIGTYPE
|
||||
# define RETSIGTYPE void
|
||||
#endif
|
||||
@@ -171,6 +156,10 @@ extern unsigned int get_path_max PARAMS ((void));
|
||||
(! INTEGER_TYPE_SIGNED (t) ? (t) 0 : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))
|
||||
#define INTEGER_TYPE_MAXIMUM(t) (~ (t) 0 - INTEGER_TYPE_MINIMUM (t))
|
||||
|
||||
#ifndef CHAR_MAX
|
||||
# define CHAR_MAX INTEGER_TYPE_MAXIMUM (char)
|
||||
#endif
|
||||
|
||||
#ifdef STAT_MACROS_BROKEN
|
||||
# ifdef S_ISREG
|
||||
# undef S_ISREG
|
||||
@@ -188,11 +177,9 @@ extern unsigned int get_path_max PARAMS ((void));
|
||||
#endif
|
||||
|
||||
#ifdef VMS
|
||||
# include <stdio.h>
|
||||
# include <types.h>
|
||||
# include <unixlib.h>
|
||||
# include <unixio.h>
|
||||
# include <errno.h>
|
||||
# include <perror.h>
|
||||
#endif
|
||||
|
||||
@@ -236,24 +223,8 @@ extern void exit PARAMS ((int)) __attribute__ ((noreturn));
|
||||
|
||||
#endif /* Standard headers. */
|
||||
|
||||
#if ST_MTIM_NSEC
|
||||
# if HAVE_INTTYPES_H
|
||||
# include <inttypes.h>
|
||||
# endif
|
||||
# define FILE_TIMESTAMP uintmax_t
|
||||
#else
|
||||
# define FILE_TIMESTAMP time_t
|
||||
#endif
|
||||
|
||||
#ifdef ANSI_STRING
|
||||
|
||||
# ifndef index
|
||||
# define index(s, c) strchr((s), (c))
|
||||
# endif
|
||||
# ifndef rindex
|
||||
# define rindex(s, c) strrchr((s), (c))
|
||||
# endif
|
||||
|
||||
# ifndef bcmp
|
||||
# define bcmp(s1, s2, n) memcmp ((s1), (s2), (n))
|
||||
# endif
|
||||
@@ -266,6 +237,11 @@ extern void exit PARAMS ((int)) __attribute__ ((noreturn));
|
||||
|
||||
#else /* Not ANSI_STRING. */
|
||||
|
||||
# ifndef HAVE_STRCHR
|
||||
# define strchr(s, c) index((s), (c))
|
||||
# define strrchr(s, c) rindex((s), (c))
|
||||
# endif
|
||||
|
||||
# ifndef bcmp
|
||||
extern int bcmp PARAMS ((const char *, const char *, int));
|
||||
# endif
|
||||
@@ -299,6 +275,26 @@ extern char *alloca ();
|
||||
# endif /* HAVE_ALLOCA_H. */
|
||||
#endif /* GCC. */
|
||||
|
||||
#ifdef ST_MTIM_NSEC
|
||||
# if HAVE_INTTYPES_H
|
||||
# include <inttypes.h>
|
||||
# endif
|
||||
# define FILE_TIMESTAMP uintmax_t
|
||||
#else
|
||||
# define FILE_TIMESTAMP time_t
|
||||
#endif
|
||||
|
||||
/* ISDIGIT offers the following features:
|
||||
- Its arg may be any int or unsigned int; it need not be an unsigned char.
|
||||
- It's guaranteed to evaluate its argument exactly once.
|
||||
NOTE! Make relies on this behavior, don't change it!
|
||||
- It's typically faster.
|
||||
Posix 1003.2-1992 section 2.5.2.1 page 50 lines 1556-1558 says that
|
||||
only '0' through '9' are digits. Prefer ISDIGIT to isdigit() unless
|
||||
it's important to use the locale's definition of `digit' even when the
|
||||
host does not conform to Posix. */
|
||||
#define ISDIGIT(c) ((unsigned) (c) - '0' <= 9)
|
||||
|
||||
#ifndef iAPX286
|
||||
# define streq(a, b) \
|
||||
((a) == (b) || \
|
||||
@@ -306,8 +302,9 @@ extern char *alloca ();
|
||||
# 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))))
|
||||
((a) == (b) \
|
||||
|| (tolower((unsigned char)*(a)) == tolower((unsigned char)*(b)) \
|
||||
&& (*(a) == '\0' || !strcmpi ((a) + 1, (b) + 1))))
|
||||
# else
|
||||
# define strieq(a, b) streq(a, b)
|
||||
# endif
|
||||
@@ -317,13 +314,16 @@ extern char *alloca ();
|
||||
# define strieq(a, b) (strcmp ((a), (b)) == 0)
|
||||
#endif
|
||||
#define strneq(a, b, l) (strncmp ((a), (b), (l)) == 0)
|
||||
#ifdef VMS
|
||||
extern int strcmpi (const char *,const char *);
|
||||
#endif
|
||||
|
||||
/* Add to VAR the hashing value of C, one character in a name. */
|
||||
#define HASH(var, c) \
|
||||
((var += (c)), (var = ((var) << 7) + ((var) >> 20)))
|
||||
#ifdef HAVE_CASE_INSENSITIVE_FS /* Fold filenames */
|
||||
# define HASHI(var, c) \
|
||||
((var += tolower((c))), (var = ((var) << 7) + ((var) >> 20)))
|
||||
((var += tolower((unsigned char)(c))), (var = ((var) << 7) + ((var) >> 20)))
|
||||
#else
|
||||
# define HASHI(var, c) HASH(var,c)
|
||||
#endif
|
||||
@@ -407,6 +407,7 @@ 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 FILE *open_tmpfile PARAMS ((char **, const char *));
|
||||
|
||||
#ifndef NO_ARCHIVES
|
||||
extern int ar_name PARAMS ((char *));
|
||||
@@ -454,10 +455,9 @@ extern long int lseek ();
|
||||
#endif /* Not GNU C library or POSIX. */
|
||||
|
||||
#ifdef HAVE_GETCWD
|
||||
# if !defined(VMS) && !defined(__DECC)
|
||||
extern char *getcwd ();
|
||||
# ifdef VMS
|
||||
extern char *getwd PARAMS ((char *));
|
||||
# endif
|
||||
#endif
|
||||
#else
|
||||
extern char *getwd ();
|
||||
# define getcwd(buf, len) getwd (buf)
|
||||
@@ -468,10 +468,10 @@ extern const struct floc *reading_file;
|
||||
extern char **environ;
|
||||
|
||||
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 print_data_base_flag, question_flag, touch_flag;
|
||||
extern int env_overrides, no_builtin_rules_flag, no_builtin_variables_flag;
|
||||
extern int print_version_flag, print_directory_flag;
|
||||
extern int warn_undefined_variables_flag, posix_pedantic;
|
||||
extern int warn_undefined_variables_flag, posix_pedantic, not_parallel;
|
||||
extern int clock_skew_detected;
|
||||
|
||||
/* can we run commands via 'sh -c xxx' or must we use batch files? */
|
||||
@@ -479,6 +479,7 @@ extern int batch_mode_shell;
|
||||
|
||||
extern unsigned int job_slots;
|
||||
extern int job_fds[2];
|
||||
extern int job_rfd;
|
||||
#ifndef NO_FLOAT
|
||||
extern double max_load_average;
|
||||
#else
|
||||
@@ -502,10 +503,6 @@ extern int handling_fatal_signal;
|
||||
#define MAX(_a,_b) ((_a)>(_b)?(_a):(_b))
|
||||
#endif
|
||||
|
||||
#define DEBUGPR(msg) \
|
||||
do if (debug_flag) { print_spaces (depth); printf (msg, file->name); \
|
||||
fflush (stdout); } while (0)
|
||||
|
||||
#ifdef VMS
|
||||
# ifndef EXIT_FAILURE
|
||||
# define EXIT_FAILURE 3
|
||||
|
||||
970
make.texinfo
970
make.texinfo
File diff suppressed because it is too large
Load Diff
16
makefile.com
16
makefile.com
@@ -7,6 +7,13 @@ $! P2 = DEBUG will build an image with debug information
|
||||
$!
|
||||
$! In case of problems with the install you might contact me at
|
||||
$! zinser@decus.decus.de (preferred) or martin_zinser@exchange.de
|
||||
$
|
||||
$! hb
|
||||
$! But don't ask Martin Zinser about the lines, I added/changed.
|
||||
$! In case of an error do some cleanup
|
||||
$ on error then $ goto cleanup
|
||||
$! in case somebody set up her/his own symbol for cc
|
||||
$ set symbol/scope=(nolocal,noglobal)
|
||||
$!
|
||||
$! Look for the compiler used
|
||||
$!
|
||||
@@ -57,9 +64,16 @@ $ linkit:
|
||||
$ close optf
|
||||
$ if p1 .nes. "" then goto link_using_library
|
||||
$ link/exe=make make.opt/opt'lopt
|
||||
$ exit
|
||||
$ goto cleanup
|
||||
$
|
||||
$ link_using_library:
|
||||
$ link/exe=make make.opt/opt,sys$library:vaxcrtl/lib'lopt
|
||||
$
|
||||
$ cleanup:
|
||||
$ if f$trnlnm("SYS").nes."" then $ deassign sys
|
||||
$ if f$trnlnm("OPTF").nes."" then $ close optf
|
||||
$ if f$search("make.opt").nes."" then $ del make.opt;*
|
||||
$ exit
|
||||
$!
|
||||
$ compileit : subroutine
|
||||
$ ploc = f$locate("]",p1)
|
||||
|
||||
41
makefile.vms
41
makefile.vms
@@ -2,7 +2,8 @@
|
||||
# This file is part of GNU Make.
|
||||
#
|
||||
# VMS extensions from GNU Make 3.60 imported by
|
||||
# Klaus Kämpf (kkaempf@progis.de) of proGIS Software, Aachen, Germany
|
||||
# Klaus Kämpf (kkaempf@rmi.de)
|
||||
# Modified for version 3.78.1 by Hartmut.Becker@compaq.com.
|
||||
#
|
||||
# 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
|
||||
@@ -19,7 +20,7 @@
|
||||
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
# Boston, MA 02111-1307, USA.
|
||||
|
||||
CC = cc/warn
|
||||
CC = cc
|
||||
CP = copy
|
||||
|
||||
%.obj: %.c
|
||||
@@ -28,11 +29,23 @@ CP = copy
|
||||
# Makefile for GNU Make
|
||||
#
|
||||
|
||||
CFLAGS = $(defines) /debug/noopt/include=([],[.glob])
|
||||
ifeq ($(CC),cc)
|
||||
CFLAGS = $(defines) /include=([],[.glob])/prefix=all/standard=relaxed
|
||||
else
|
||||
CFLAGS = $(defines) /include=([],[.glob])
|
||||
endif
|
||||
#LDFLAGS = /deb
|
||||
LDFLAGS =
|
||||
|
||||
ifeq ($(CC),cc)
|
||||
defines = /define=("unlink=remove","HAVE_CONFIG_H","VMS","allocated_variable_expand_for_file=alloc_var_expand_for_file")
|
||||
else
|
||||
ifeq ($(ARCH),VAX)
|
||||
defines = /define=("HAVE_CONFIG_H","GCC_IS_NATIVE","VAX")
|
||||
else
|
||||
defines = /define=("HAVE_CONFIG_H","GCC_IS_NATIVE")
|
||||
endif
|
||||
endif
|
||||
|
||||
LOAD_AVG = /define="NO_LDAV"
|
||||
|
||||
@@ -44,12 +57,17 @@ ARCHIVES_SRC = ar.c arscan.c
|
||||
# System V probably need -lPW for alloca.
|
||||
# if on vax, uncomment the following line
|
||||
#LOADLIBES = ,c.opt/opt
|
||||
LOADLIBES =,sys$$library:vaxcrtl.olb/lib
|
||||
ifeq ($(CC),cc)
|
||||
#LOADLIBES =,sys$$library:vaxcrtl.olb/lib
|
||||
CRT0 =
|
||||
else
|
||||
LOADLIBES =,gnu_cc_library:libgcc.olb/lib
|
||||
endif
|
||||
|
||||
# If your system doesn't have alloca, or the one provided is bad,
|
||||
# get it from the Emacs distribution and define these.
|
||||
ALLOCA = ,alloca.obj
|
||||
ALLOCASRC = alloca.c
|
||||
#ALLOCA = ,alloca.obj
|
||||
#ALLOCASRC = alloca.c
|
||||
|
||||
# If there are remote execution facilities defined,
|
||||
# enable them with switches here (see remote-*.c).
|
||||
@@ -86,11 +104,14 @@ doc: make.info make.dvi
|
||||
|
||||
|
||||
make.exe: $(objs)
|
||||
$(LD)$(LDFLAGS)/exe=$@ $^$(LOADLIBES)
|
||||
$(LD)$(LDFLAGS)/exe=$@ $^$(LOADLIBES)$(CRT0)
|
||||
|
||||
.PHONY: clean realclean
|
||||
clean:
|
||||
-$(RM) make.exe;,*.obj;*
|
||||
$$ purge [...]
|
||||
-$(RM) make.exe;,*.obj;
|
||||
-$(RM) *.opt;
|
||||
-$(RM) [.glob]*.obj;
|
||||
|
||||
# Automatically generated dependencies.
|
||||
commands.obj: commands.c make.h dep.h commands.h filedef.h variable.h job.h
|
||||
@@ -108,7 +129,7 @@ variable.obj: variable.c make.h commands.h variable.h dep.h filedef.h
|
||||
expand.obj: expand.c make.h commands.h filedef.h variable.h
|
||||
function.obj: function.c make.h variable.h dep.h commands.h job.h
|
||||
vpath.obj: vpath.c make.h filedef.h variable.h
|
||||
version.obj: version.c
|
||||
version.obj: version.c config.h
|
||||
arscan.obj: arscan.c
|
||||
ar.obj: ar.c make.h filedef.h
|
||||
signame.obj: signame.c
|
||||
@@ -117,6 +138,8 @@ remote-stub.obj: remote-stub.c
|
||||
[.glob]fnmatch.obj: [.glob]fnmatch.c
|
||||
getopt.obj: getopt.c
|
||||
getopt1.obj: getopt1.c
|
||||
vmsfunctions.obj: vmsfunctions.c make.h vmsdir.h
|
||||
vmsify.obj: vmsify.c make.h
|
||||
|
||||
config.h: config.h-vms
|
||||
$(CP) $< $@
|
||||
|
||||
8
misc.c
8
misc.c
@@ -19,7 +19,7 @@ Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include "make.h"
|
||||
#include "dep.h"
|
||||
|
||||
#include "debug.h"
|
||||
|
||||
/* Variadic functions. We go through contortions to allow proper function
|
||||
prototypes for both ANSI and pre-ANSI C compilers, and also for those
|
||||
@@ -81,7 +81,7 @@ collapse_continuations (line)
|
||||
register int backslash;
|
||||
register unsigned int bs_write;
|
||||
|
||||
in = index (line, '\n');
|
||||
in = strchr (line, '\n');
|
||||
if (in == 0)
|
||||
return;
|
||||
|
||||
@@ -168,7 +168,7 @@ remove_comments (line)
|
||||
*comment = '\0';
|
||||
}
|
||||
|
||||
/* Print N spaces (used by DEBUGPR for target-depth). */
|
||||
/* Print N spaces (used in debug for target-depth). */
|
||||
|
||||
void
|
||||
print_spaces (n)
|
||||
@@ -643,7 +643,7 @@ static void
|
||||
log_access (flavor)
|
||||
char *flavor;
|
||||
{
|
||||
if (! debug_flag)
|
||||
if (! ISDB (DB_JOBS))
|
||||
return;
|
||||
|
||||
/* All the other debugging messages go to stdout,
|
||||
|
||||
179
read.c
179
read.c
@@ -29,6 +29,7 @@ Boston, MA 02111-1307, USA. */
|
||||
#include "commands.h"
|
||||
#include "variable.h"
|
||||
#include "rule.h"
|
||||
#include "debug.h"
|
||||
|
||||
|
||||
#ifndef WINDOWS32
|
||||
@@ -149,8 +150,7 @@ read_all_makefiles (makefiles)
|
||||
{
|
||||
unsigned int num_makefiles = 0;
|
||||
|
||||
if (debug_flag)
|
||||
puts (_("Reading makefiles..."));
|
||||
DB (DB_BASIC, (_("Reading makefiles...\n")));
|
||||
|
||||
/* If there's a non-null variable MAKEFILES, its value is a list of
|
||||
files to read first thing. But don't let it prevent reading the
|
||||
@@ -179,8 +179,10 @@ read_all_makefiles (makefiles)
|
||||
{
|
||||
if (*p != '\0')
|
||||
*p++ = '\0';
|
||||
(void) read_makefile (name,
|
||||
RM_NO_DEFAULT_GOAL | RM_INCLUDED | RM_DONTCARE);
|
||||
name = xstrdup (name);
|
||||
if (read_makefile (name,
|
||||
RM_NO_DEFAULT_GOAL|RM_INCLUDED|RM_DONTCARE) < 2)
|
||||
free (name);
|
||||
}
|
||||
|
||||
free (value);
|
||||
@@ -269,7 +271,9 @@ read_all_makefiles (makefiles)
|
||||
|
||||
FILENAME is added to the `read_makefiles' chain.
|
||||
|
||||
Returns 1 if a file was found and read, 0 if not. */
|
||||
Returns 0 if a file was not found or not read.
|
||||
Returns 1 if FILENAME was found and read.
|
||||
Returns 2 if FILENAME was read, and we kept a reference (don't free it). */
|
||||
|
||||
static int
|
||||
read_makefile (filename, flags)
|
||||
@@ -283,12 +287,13 @@ read_makefile (filename, flags)
|
||||
unsigned int commands_len = 200;
|
||||
char *commands;
|
||||
unsigned int commands_idx = 0;
|
||||
unsigned int cmds_started;
|
||||
unsigned int cmds_started, tgts_started;
|
||||
char *p;
|
||||
char *p2;
|
||||
int len, reading_target;
|
||||
int ignoring = 0, in_ignored_define = 0;
|
||||
int no_targets = 0; /* Set when reading a rule without targets. */
|
||||
int using_filename = 0;
|
||||
struct floc fileinfo;
|
||||
char *passed_filename = filename;
|
||||
|
||||
@@ -307,10 +312,15 @@ read_makefile (filename, flags)
|
||||
do \
|
||||
{ \
|
||||
if (filenames != 0) \
|
||||
record_files (filenames, pattern, pattern_percent, deps, \
|
||||
cmds_started, commands, commands_idx, \
|
||||
two_colon, &fileinfo, \
|
||||
!(flags & RM_NO_DEFAULT_GOAL)); \
|
||||
{ \
|
||||
struct floc fi; \
|
||||
fi.filenm = fileinfo.filenm; \
|
||||
fi.lineno = tgts_started; \
|
||||
record_files (filenames, pattern, pattern_percent, deps, \
|
||||
cmds_started, commands, commands_idx, two_colon, \
|
||||
&fi, !(flags & RM_NO_DEFAULT_GOAL)); \
|
||||
using_filename |= commands_idx > 0; \
|
||||
} \
|
||||
filenames = 0; \
|
||||
commands_idx = 0; \
|
||||
if (pattern) { free(pattern); pattern = 0; } \
|
||||
@@ -320,9 +330,9 @@ read_makefile (filename, flags)
|
||||
fileinfo.lineno = 1;
|
||||
|
||||
pattern_percent = 0;
|
||||
cmds_started = fileinfo.lineno;
|
||||
cmds_started = tgts_started = fileinfo.lineno;
|
||||
|
||||
if (debug_flag)
|
||||
if (ISDB (DB_VERBOSE))
|
||||
{
|
||||
printf (_("Reading makefile `%s'"), fileinfo.filenm);
|
||||
if (flags & RM_NO_DEFAULT_GOAL)
|
||||
@@ -471,7 +481,7 @@ read_makefile (filename, flags)
|
||||
/* Compare a word, both length and contents. */
|
||||
#define word1eq(s, l) (len == l && strneq (s, p, l))
|
||||
p = collapsed;
|
||||
while (isspace (*p))
|
||||
while (isspace ((unsigned char)*p))
|
||||
++p;
|
||||
if (*p == '\0')
|
||||
/* This line is completely empty. */
|
||||
@@ -481,7 +491,7 @@ read_makefile (filename, flags)
|
||||
* ":" here since we compare tokens by length (so "export" will never
|
||||
* be equal to "export:").
|
||||
*/
|
||||
for (p2 = p+1; *p2 != '\0' && !isspace(*p2); ++p2)
|
||||
for (p2 = p+1; *p2 != '\0' && !isspace ((unsigned char)*p2); ++p2)
|
||||
{}
|
||||
len = p2 - p;
|
||||
|
||||
@@ -489,7 +499,7 @@ read_makefile (filename, flags)
|
||||
since it can't be a preprocessor token--this allows targets named
|
||||
`ifdef', `export', etc. */
|
||||
reading_target = 0;
|
||||
while (isspace (*p2))
|
||||
while (isspace ((unsigned char)*p2))
|
||||
++p2;
|
||||
if (*p2 == '\0')
|
||||
p2 = NULL;
|
||||
@@ -539,7 +549,7 @@ read_makefile (filename, flags)
|
||||
with trailing blanks stripped (comments have already been
|
||||
removed), so it could be a complex variable/function
|
||||
reference that might contain blanks. */
|
||||
p = index (p2, '\0');
|
||||
p = strchr (p2, '\0');
|
||||
while (isblank (p[-1]))
|
||||
--p;
|
||||
do_define (p2, p - p2, o_file, infile, &fileinfo);
|
||||
@@ -566,14 +576,14 @@ read_makefile (filename, flags)
|
||||
with trailing blanks stripped (comments have already been
|
||||
removed), so it could be a complex variable/function
|
||||
reference that might contain blanks. */
|
||||
p = index (p2, '\0');
|
||||
p = strchr (p2, '\0');
|
||||
while (isblank (p[-1]))
|
||||
--p;
|
||||
do_define (p2, p - p2, o_override, infile, &fileinfo);
|
||||
}
|
||||
}
|
||||
else if (!ignoring
|
||||
&& !try_variable_definition (&fileinfo, p2, o_override))
|
||||
&& !try_variable_definition (&fileinfo, p2, o_override, 0))
|
||||
error (&fileinfo, _("invalid `override' directive"));
|
||||
|
||||
continue;
|
||||
@@ -591,7 +601,7 @@ read_makefile (filename, flags)
|
||||
p2 = next_token (p + 6);
|
||||
if (*p2 == '\0')
|
||||
export_all_variables = 1;
|
||||
v = try_variable_definition (&fileinfo, p2, o_file);
|
||||
v = try_variable_definition (&fileinfo, p2, o_file, 0);
|
||||
if (v != 0)
|
||||
v->export = v_export;
|
||||
else
|
||||
@@ -602,7 +612,7 @@ read_makefile (filename, flags)
|
||||
{
|
||||
v = lookup_variable (p, len);
|
||||
if (v == 0)
|
||||
v = define_variable (p, len, "", o_file, 0);
|
||||
v = define_variable_loc (p, len, "", o_file, 0, &fileinfo);
|
||||
v->export = v_export;
|
||||
}
|
||||
}
|
||||
@@ -619,7 +629,7 @@ read_makefile (filename, flags)
|
||||
{
|
||||
v = lookup_variable (p, len);
|
||||
if (v == 0)
|
||||
v = define_variable (p, len, "", o_file, 0);
|
||||
v = define_variable_loc (p, len, "", o_file, 0, &fileinfo);
|
||||
v->export = v_noexport;
|
||||
}
|
||||
}
|
||||
@@ -685,14 +695,18 @@ read_makefile (filename, flags)
|
||||
{
|
||||
struct nameseq *next = files->next;
|
||||
char *name = files->name;
|
||||
int r;
|
||||
|
||||
free ((char *)files);
|
||||
files = next;
|
||||
|
||||
if (! read_makefile (name, (RM_INCLUDED | RM_NO_TILDE
|
||||
| (noerror ? RM_DONTCARE : 0)))
|
||||
&& ! noerror)
|
||||
r = read_makefile (name, (RM_INCLUDED | RM_NO_TILDE
|
||||
| (noerror ? RM_DONTCARE : 0)));
|
||||
if (!r && !noerror)
|
||||
error (&fileinfo, "%s: %s", name, strerror (errno));
|
||||
free(name);
|
||||
|
||||
if (r < 2)
|
||||
free (name);
|
||||
}
|
||||
|
||||
/* Free any space allocated by conditional_line. */
|
||||
@@ -706,7 +720,7 @@ read_makefile (filename, flags)
|
||||
reading_file = &fileinfo;
|
||||
}
|
||||
#undef word1eq
|
||||
else if (try_variable_definition (&fileinfo, p, o_file))
|
||||
else if (try_variable_definition (&fileinfo, p, o_file, 0))
|
||||
/* This line has been dealt with. */
|
||||
;
|
||||
else if (lb.buffer[0] == '\t')
|
||||
@@ -744,6 +758,7 @@ read_makefile (filename, flags)
|
||||
/* Record the previous rule. */
|
||||
|
||||
record_waiting_files ();
|
||||
tgts_started = fileinfo.lineno;
|
||||
|
||||
/* Search the line for an unquoted ; that is not after an
|
||||
unquoted #. */
|
||||
@@ -826,8 +841,8 @@ read_makefile (filename, flags)
|
||||
are whitespace and a left paren. If others are possible,
|
||||
they should be added to the string in the call to index. */
|
||||
while (colonp && (colonp[1] == '/' || colonp[1] == '\\') &&
|
||||
colonp > p2 && isalpha(colonp[-1]) &&
|
||||
(colonp == p2 + 1 || index(" \t(", colonp[-2]) != 0))
|
||||
colonp > p2 && isalpha ((unsigned char)colonp[-1]) &&
|
||||
(colonp == p2 + 1 || strchr (" \t(", colonp[-2]) != 0))
|
||||
colonp = find_char_unquote(colonp + 1, ":", 0);
|
||||
#endif
|
||||
if (colonp != 0)
|
||||
@@ -868,7 +883,7 @@ read_makefile (filename, flags)
|
||||
sizeof (struct nameseq),
|
||||
1),
|
||||
sizeof (struct nameseq));
|
||||
*colonp = ':';
|
||||
*p2 = ':';
|
||||
|
||||
if (!filenames)
|
||||
{
|
||||
@@ -878,7 +893,7 @@ read_makefile (filename, flags)
|
||||
continue;
|
||||
}
|
||||
/* This should never be possible; we handled it above. */
|
||||
assert(*p2 != '\0');
|
||||
assert (*p2 != '\0');
|
||||
++p2;
|
||||
|
||||
/* Is this a one-colon or two-colon entry? */
|
||||
@@ -893,25 +908,31 @@ read_makefile (filename, flags)
|
||||
if (*lb_next != '\0')
|
||||
{
|
||||
unsigned int l = p2 - variable_buffer;
|
||||
plen = strlen(p2);
|
||||
(void)variable_buffer_output(p2+plen,
|
||||
lb_next, strlen(lb_next)+1);
|
||||
plen = strlen (p2);
|
||||
(void) variable_buffer_output (p2+plen,
|
||||
lb_next, strlen (lb_next)+1);
|
||||
p2 = variable_buffer + l;
|
||||
}
|
||||
wtype = get_next_mword(p2, NULL, &p, &len);
|
||||
|
||||
/* See if it's an "override" keyword; if so see if what comes after
|
||||
it looks like a variable definition. */
|
||||
|
||||
wtype = get_next_mword (p2, NULL, &p, &len);
|
||||
|
||||
v_origin = o_file;
|
||||
if (wtype == w_static && (len == (sizeof("override")-1)
|
||||
&& strneq(p, "override", len)))
|
||||
if (wtype == w_static && (len == (sizeof ("override")-1)
|
||||
&& strneq (p, "override", len)))
|
||||
{
|
||||
v_origin = o_override;
|
||||
(void)get_next_mword(p+len, NULL, &p, &len);
|
||||
wtype = get_next_mword (p+len, NULL, &p, &len);
|
||||
}
|
||||
else if (wtype != w_eol)
|
||||
wtype = get_next_mword(p+len, NULL, NULL, NULL);
|
||||
|
||||
if (wtype == w_varassign || v_origin == o_override)
|
||||
if (wtype != w_eol)
|
||||
wtype = get_next_mword (p+len, NULL, NULL, NULL);
|
||||
|
||||
if (wtype == w_varassign)
|
||||
{
|
||||
record_target_var(filenames, p, two_colon, v_origin, &fileinfo);
|
||||
record_target_var (filenames, p, two_colon, v_origin, &fileinfo);
|
||||
filenames = 0;
|
||||
continue;
|
||||
}
|
||||
@@ -927,7 +948,7 @@ read_makefile (filename, flags)
|
||||
if (*lb_next != '\0')
|
||||
{
|
||||
unsigned int l = p2 - variable_buffer;
|
||||
(void)variable_expand_string(p2 + plen, lb_next, (long)-1);
|
||||
(void) variable_expand_string (p2 + plen, lb_next, (long)-1);
|
||||
p2 = variable_buffer + l;
|
||||
|
||||
/* Look for a semicolon in the expanded line. */
|
||||
@@ -940,7 +961,7 @@ read_makefile (filename, flags)
|
||||
}
|
||||
|
||||
/* Is this a static pattern rule: `target: %targ: %dep; ...'? */
|
||||
p = index (p2, ':');
|
||||
p = strchr (p2, ':');
|
||||
while (p != 0 && p[-1] == '\\')
|
||||
{
|
||||
register char *q = &p[-1];
|
||||
@@ -948,7 +969,7 @@ read_makefile (filename, flags)
|
||||
while (*q-- == '\\')
|
||||
backslash = !backslash;
|
||||
if (backslash)
|
||||
p = index (p + 1, ':');
|
||||
p = strchr (p + 1, ':');
|
||||
else
|
||||
break;
|
||||
}
|
||||
@@ -965,7 +986,8 @@ read_makefile (filename, flags)
|
||||
The rule is that it's only a target, if there are TWO :'s
|
||||
OR a space around the :.
|
||||
*/
|
||||
if (p && !(isspace(p[1]) || !p[1] || isspace(p[-1])))
|
||||
if (p && !(isspace ((unsigned char)p[1]) || !p[1]
|
||||
|| isspace ((unsigned char)p[-1])))
|
||||
p = 0;
|
||||
#endif
|
||||
#if defined (WINDOWS32) || defined (__MSDOS__)
|
||||
@@ -973,9 +995,9 @@ read_makefile (filename, flags)
|
||||
check_again = 0;
|
||||
/* For MSDOS and WINDOWS32, skip a "C:\..." or a "C:/..." */
|
||||
if (p != 0 && (p[1] == '\\' || p[1] == '/') &&
|
||||
isalpha(p[-1]) &&
|
||||
(p == p2 + 1 || index(" \t:(", p[-2]) != 0)) {
|
||||
p = index(p + 1, ':');
|
||||
isalpha ((unsigned char)p[-1]) &&
|
||||
(p == p2 + 1 || strchr (" \t:(", p[-2]) != 0)) {
|
||||
p = strchr (p + 1, ':');
|
||||
check_again = 1;
|
||||
}
|
||||
} while (check_again);
|
||||
@@ -1044,7 +1066,7 @@ read_makefile (filename, flags)
|
||||
|
||||
reading_file = 0;
|
||||
|
||||
return 1;
|
||||
return 1+using_filename;
|
||||
}
|
||||
|
||||
/* Execute a `define' directive.
|
||||
@@ -1098,7 +1120,8 @@ do_define (name, namelen, origin, infile, flocp)
|
||||
definition[0] = '\0';
|
||||
else
|
||||
definition[idx - 1] = '\0';
|
||||
(void) define_variable (var, strlen (var), definition, origin, 1);
|
||||
(void) define_variable_loc (var, strlen (var), definition, origin,
|
||||
1, flocp);
|
||||
free (definition);
|
||||
freebuffer (&lb);
|
||||
return;
|
||||
@@ -1404,6 +1427,9 @@ record_target_var (filenames, defn, two_colon, origin, flocp)
|
||||
|
||||
global = current_variable_set_list;
|
||||
|
||||
/* If the variable is an append version, store that but treat it as a
|
||||
normal recursive variable. */
|
||||
|
||||
for (; filenames != 0; filenames = nextf)
|
||||
{
|
||||
struct variable *v;
|
||||
@@ -1433,14 +1459,14 @@ record_target_var (filenames, defn, two_colon, origin, flocp)
|
||||
|
||||
/* Get a file reference for this file, and initialize it. */
|
||||
f = enter_file (name);
|
||||
initialize_file_variables (f);
|
||||
initialize_file_variables (f, 1);
|
||||
vlist = f->variables;
|
||||
fname = f->name;
|
||||
}
|
||||
|
||||
/* Make the new variable context current and define the variable. */
|
||||
current_variable_set_list = vlist;
|
||||
v = try_variable_definition (flocp, defn, origin);
|
||||
v = try_variable_definition (flocp, defn, origin, 1);
|
||||
if (!v)
|
||||
error (flocp, _("Malformed per-target variable definition"));
|
||||
v->per_target = 1;
|
||||
@@ -1456,7 +1482,7 @@ record_target_var (filenames, defn, two_colon, origin, flocp)
|
||||
gv = lookup_variable (v->name, len);
|
||||
if (gv && (gv->origin == o_env_override || gv->origin == o_command))
|
||||
define_variable_in_set (v->name, len, gv->value, gv->origin,
|
||||
gv->recursive, vlist->set);
|
||||
gv->recursive, vlist->set, flocp);
|
||||
}
|
||||
|
||||
/* Free name if not needed further. */
|
||||
@@ -1518,7 +1544,7 @@ record_files (filenames, pattern, pattern_percent, deps, cmds_started,
|
||||
char *implicit_percent;
|
||||
|
||||
nextf = filenames->next;
|
||||
free ((char *) filenames);
|
||||
free (filenames);
|
||||
|
||||
implicit_percent = find_percent (name);
|
||||
implicit |= implicit_percent != 0;
|
||||
@@ -1586,6 +1612,12 @@ record_files (filenames, pattern, pattern_percent, deps, cmds_started,
|
||||
continue;
|
||||
o = patsubst_expand (buffer, name, pattern, d->name,
|
||||
pattern_percent, percent);
|
||||
/* If the name expanded to the empty string, that's
|
||||
illegal. */
|
||||
if (o == buffer)
|
||||
fatal (flocp,
|
||||
_("target `%s' leaves prerequisite pattern empty"),
|
||||
name);
|
||||
free (d->name);
|
||||
d->name = savestring (buffer, o - buffer);
|
||||
}
|
||||
@@ -1605,7 +1637,8 @@ record_files (filenames, pattern, pattern_percent, deps, cmds_started,
|
||||
/* If CMDS == F->CMDS, this target was listed in this rule
|
||||
more than once. Just give a warning since this is harmless. */
|
||||
if (cmds != 0 && cmds == f->cmds)
|
||||
error (flocp, _("target `%s' given more than once in the same rule."),
|
||||
error (flocp,
|
||||
_("target `%s' given more than once in the same rule."),
|
||||
f->name);
|
||||
|
||||
/* Check for two single-colon entries both with commands.
|
||||
@@ -1614,7 +1647,8 @@ record_files (filenames, pattern, pattern_percent, deps, cmds_started,
|
||||
else if (cmds != 0 && f->cmds != 0 && f->is_target)
|
||||
{
|
||||
error (&cmds->fileinfo,
|
||||
_("warning: overriding commands for target `%s'"), f->name);
|
||||
_("warning: overriding commands for target `%s'"),
|
||||
f->name);
|
||||
error (&f->cmds->fileinfo,
|
||||
_("warning: ignoring old commands for target `%s'"),
|
||||
f->name);
|
||||
@@ -1724,9 +1758,9 @@ record_files (filenames, pattern, pattern_percent, deps, cmds_started,
|
||||
/* See if this is first target seen whose name does
|
||||
not start with a `.', unless it contains a slash. */
|
||||
if (default_goal_file == 0 && set_default
|
||||
&& (*name != '.' || index (name, '/') != 0
|
||||
#ifdef __MSDOS__
|
||||
|| index (name, '\\') != 0
|
||||
&& (*name != '.' || strchr (name, '/') != 0
|
||||
#if defined(__MSDOS__) || defined(WINDOWS32)
|
||||
|| strchr (name, '\\') != 0
|
||||
#endif
|
||||
))
|
||||
{
|
||||
@@ -1789,7 +1823,7 @@ find_char_unquote (string, stopchars, blank)
|
||||
|
||||
while (1)
|
||||
{
|
||||
while (*p != '\0' && index (stopchars, *p) == 0
|
||||
while (*p != '\0' && strchr (stopchars, *p) == 0
|
||||
&& (!blank || !isblank (*p)))
|
||||
++p;
|
||||
if (*p == '\0')
|
||||
@@ -1888,8 +1922,9 @@ parse_file_seq (stringp, stopchar, size, strip)
|
||||
*p =' ';
|
||||
#endif
|
||||
#ifdef _AMIGA
|
||||
if (stopchar == ':' && p && *p == ':' &&
|
||||
!(isspace(p[1]) || !p[1] || isspace(p[-1])))
|
||||
if (stopchar == ':' && p && *p == ':'
|
||||
&& !(isspace ((unsigned char)p[1]) || !p[1]
|
||||
|| isspace ((unsigned char)p[-1])))
|
||||
{
|
||||
p = find_char_unquote (p+1, stopchars, 1);
|
||||
}
|
||||
@@ -1900,8 +1935,8 @@ parse_file_seq (stringp, stopchar, size, strip)
|
||||
Note that tokens separated by spaces should be treated as separate
|
||||
tokens since make doesn't allow path names with spaces */
|
||||
if (stopchar == ':')
|
||||
while (p != 0 && !isspace(*p) &&
|
||||
(p[1] == '\\' || p[1] == '/') && isalpha (p[-1]))
|
||||
while (p != 0 && !isspace ((unsigned char)*p) &&
|
||||
(p[1] == '\\' || p[1] == '/') && isalpha ((unsigned char)p[-1]))
|
||||
p = find_char_unquote (p + 1, stopchars, 1);
|
||||
#endif
|
||||
if (p == 0)
|
||||
@@ -1983,14 +2018,14 @@ parse_file_seq (stringp, stopchar, size, strip)
|
||||
while (new1 != 0)
|
||||
if (new1->name[0] != '(' /* Don't catch "(%)" and suchlike. */
|
||||
&& new1->name[strlen (new1->name) - 1] == ')'
|
||||
&& index (new1->name, '(') == 0)
|
||||
&& strchr (new1->name, '(') == 0)
|
||||
{
|
||||
/* NEW1 ends with a `)' but does not contain a `('.
|
||||
Look back for an elt with an opening `(' but no closing `)'. */
|
||||
|
||||
struct nameseq *n = new1->next, *lastn = new1;
|
||||
char *paren = 0;
|
||||
while (n != 0 && (paren = index (n->name, '(')) == 0)
|
||||
while (n != 0 && (paren = strchr (n->name, '(')) == 0)
|
||||
{
|
||||
lastn = n;
|
||||
n = n->next;
|
||||
@@ -2271,7 +2306,7 @@ get_next_mword (buffer, delim, startp, length)
|
||||
}
|
||||
|
||||
default:
|
||||
if (delim && index(delim, c))
|
||||
if (delim && strchr (delim, c))
|
||||
wtype = w_static;
|
||||
break;
|
||||
}
|
||||
@@ -2308,9 +2343,9 @@ get_next_mword (buffer, delim, startp, length)
|
||||
/* A word CAN include a colon in its drive spec. The drive
|
||||
spec is allowed either at the beginning of a word, or as part
|
||||
of the archive member name, like in "libfoo.a(d:/foo/bar.o)". */
|
||||
if (!(p - beg >= 2 &&
|
||||
(*p == '/' || *p == '\\') && isalpha (p[-2]) &&
|
||||
(p - beg == 2 || p[-3] == '(')))
|
||||
if (!(p - beg >= 2
|
||||
&& (*p == '/' || *p == '\\') && isalpha ((unsigned char)p[-2])
|
||||
&& (p - beg == 2 || p[-3] == '(')))
|
||||
#endif
|
||||
goto done_word;
|
||||
|
||||
@@ -2362,7 +2397,7 @@ get_next_mword (buffer, delim, startp, length)
|
||||
break;
|
||||
|
||||
default:
|
||||
if (delim && index(delim, c))
|
||||
if (delim && strchr (delim, c))
|
||||
goto done_word;
|
||||
break;
|
||||
}
|
||||
@@ -2533,7 +2568,7 @@ tilde_expand (name)
|
||||
else
|
||||
{
|
||||
struct passwd *pwent;
|
||||
char *userend = index (name + 1, '/');
|
||||
char *userend = strchr (name + 1, '/');
|
||||
if (userend != 0)
|
||||
*userend = '\0';
|
||||
pwent = getpwnam (name + 1);
|
||||
|
||||
151
readme.vms
151
readme.vms
@@ -1,9 +1,126 @@
|
||||
This is the VMS port of GNU Make done by Hartmut.Becker@compaq.com.
|
||||
|
||||
It is based on the specific version 3.77k and on 3.78.1. 3.77k was done
|
||||
by Klaus Kämpf <kkaempf@rmi.de>, the code was based on the VMS port of
|
||||
GNU Make 3.60 by Mike Moretti.
|
||||
|
||||
It was ported on OpenVMS/Alpha V7.1, DECC V5.7-006. It was re-build and
|
||||
tested on OpenVMS/Alpha V7.2, OpenVMS/VAX 7.1 and 5.5-2. Different
|
||||
versions of DECC were used. VAXC was tried: it fails; but it doesn't
|
||||
seem worth to get it working. There are still some PTRMISMATCH warnings
|
||||
during the compile. Although perl is working on VMS the test scripts
|
||||
don't work. The function $shell is still missing.
|
||||
|
||||
There is a known bug in some of the VMS CRTLs. It is in the shipped
|
||||
versions of VMS V7.2 and V7.2-1 and in the currently (October 1999)
|
||||
available ECOs for VMS V7.1 and newer versions. It is fixed in versions
|
||||
shipped with newer VMS versions and all ECO kits after October 1999. It
|
||||
only shows up during the daylight saving time period (DST): stat()
|
||||
returns a modification time 1 hour ahead. This results in GNU make
|
||||
warning messages. For a just created source you will see:
|
||||
|
||||
$ gmake x.exe
|
||||
gmake.exe;1: *** Warning: File `x.c' has modification time in the future (940582863 > 940579269)
|
||||
cc /obj=x.obj x.c
|
||||
link x.obj /exe=x.exe
|
||||
gmake.exe;1: *** Warning: Clock skew detected. Your build may be incomplete.
|
||||
|
||||
|
||||
New in 3.78.1:
|
||||
|
||||
Fix a problem with automatically remaking makefiles. GNU make uses an
|
||||
execve to restart itself after a successful remake of the makefile. On
|
||||
UNIX systems execve replaces the running program with a new one and
|
||||
resets all signal handling to the default. On VMS execve creates a child
|
||||
process, signal and exit handlers of the parent are still active, and,
|
||||
unfortunately, corrupt the exit code from the child. Fix in job.c:
|
||||
ignore SIGCHLD.
|
||||
|
||||
Added some switches to reflect latest features of DECC. Modifications in
|
||||
makefile.vms.
|
||||
|
||||
Set some definitions to reflect latest features of DECC. Modifications in
|
||||
config.h-vms (which is copied to config.h).
|
||||
|
||||
Added extern strcmpi declaration to avoid 'implicitly declared' messages.
|
||||
Modification in make.h.
|
||||
|
||||
Default rule for C++, conditionals for gcc (GCC_IS_NATIVE) or DEC/Digital/
|
||||
Compaq c/c++ compilers. Modifications in default.c.
|
||||
|
||||
Usage of opendir() and friends, suppress file version. Modifications in dir.c.
|
||||
|
||||
Added VMS specific code to handle ctrl+c and ctrl+y to abort make.
|
||||
Modifications in job.c.
|
||||
|
||||
Added support to have case sensitive targets and dependencies but to
|
||||
still use case blind file names. This is especially useful for Java
|
||||
makefiles on VMS:
|
||||
|
||||
.SUFFIXES :
|
||||
.SUFFIXES : .class .java
|
||||
.java.class :
|
||||
javac "$<
|
||||
HelloWorld.class : HelloWorld.java
|
||||
|
||||
A new macro WANT_CASE_SENSITIVE_TARGETS in config.h-vms was introduced.
|
||||
It needs to be enabled to get this feature; default is disabled. The
|
||||
macro HAVE_CASE_INSENSITIVE_FS must not be touched: it is still enabled.
|
||||
Modifications in file.c and config.h-vms.
|
||||
|
||||
Bootstrap make to start building make is still makefile.com, but make
|
||||
needs to be re-made with a make to make a correct version: ignore all
|
||||
possible warnings, delete all objects, rename make.exe to a different
|
||||
name and run it.
|
||||
|
||||
Made some minor modifications to the bootstrap build makefile.com.
|
||||
|
||||
This is the VMS port of GNU Make.
|
||||
|
||||
It is based on the VMS port of GNU Make 3.60 by Mike Moretti.
|
||||
|
||||
This port was done by Klaus Kämpf <kkaempf@progis.de> of
|
||||
proGIS Software, Aachen, Germany.
|
||||
This port was done by Klaus Kämpf <kkaempf@rmi.de>
|
||||
|
||||
There is first-level support available from proGIS Software, Germany.
|
||||
Visit their web-site at http://www.progis.de to get information
|
||||
about other vms software and forthcoming updates to gnu make.
|
||||
|
||||
New for 3.77:
|
||||
|
||||
/bin/sh style I/O redirection is supported. You can now write lines like
|
||||
mcr sys$disk:[]program.exe < input.txt > output.txt &> error.txt
|
||||
|
||||
Makefile variables are looked up in the current environment. You can set
|
||||
symbols or logicals in DCL and evaluate them in the Makefile via
|
||||
$(<name-of-symbol-or-logical>). Variables defined in the Makefile
|
||||
override VMS symbols/logicals !
|
||||
|
||||
Functions for file names are working now. See the GNU Make manual for
|
||||
$(dir ...) and $(wildcard ...). Unix-style and VMS-style names are
|
||||
supported as arguments.
|
||||
|
||||
The default rules are set up for GNU C. Building an executable from a
|
||||
single source file is as easy as 'make file.exe'.
|
||||
|
||||
The variable $(ARCH) is predefined as ALPHA or VAX resp. Makefiles for
|
||||
different VMS systems can now be written by checking $(ARCH) as in
|
||||
ifeq ($(ARCH),ALPHA)
|
||||
$(ECHO) "On the Alpha"
|
||||
else
|
||||
$(ECHO) "On the VAX"
|
||||
endif
|
||||
|
||||
Command lines of excessive length are correctly broken and written to a
|
||||
batch file in sys$scratch for later execution. There's no limit to the
|
||||
lengths of commands (and no need for .opt files :-) any more.
|
||||
|
||||
Empty commands are handled correctly and don't end in a new DCL process.
|
||||
|
||||
|
||||
New for 3.76:
|
||||
|
||||
John W. Eaton has updated the VMS port to support libraries and VPATH.
|
||||
|
||||
|
||||
To build Make, simply type @makefile. This should compile all the
|
||||
necessary files and link Make. There is also a file called
|
||||
@@ -12,6 +129,16 @@ Make with this makefile to rebuild.
|
||||
|
||||
Here are some notes about GNU Make for VMS:
|
||||
|
||||
The cd command is supported if it's called as $(CD). This invokes
|
||||
the 'builtin_cd' command which changes the directory.
|
||||
Calling 'set def' doesn't do the trick, since a sub-shell is
|
||||
spawned for this command, the directory is changed *in this sub-shell*
|
||||
and the sub-shell ends.
|
||||
|
||||
Libraries are not supported. They were in GNU Make 3.60 but somehow I
|
||||
didn't care porting the code. If there is enough interest, I'll do it at
|
||||
some later time.
|
||||
|
||||
The variable $^ separates files with commas instead of spaces (It's the
|
||||
natural thing to do for VMS).
|
||||
|
||||
@@ -26,8 +153,8 @@ The default include directory for including other makefiles is
|
||||
SYS$SYSROOT:[SYSLIB] (I don't remember why I didn't just use
|
||||
SYS$LIBRARY: instead; maybe it wouldn't work that way).
|
||||
|
||||
The default makefiles make looks for are: makefile.vms, gnumakefile, makefile.,
|
||||
and gnumakefile. .
|
||||
The default makefiles make looks for are: makefile.vms, gnumakefile,
|
||||
makefile., and gnumakefile. .
|
||||
|
||||
The stat() function and handling of time stamps in VMS is broken, so I
|
||||
replaced it with a hack in vmsfunctions.c. I will provide a full rewrite
|
||||
@@ -37,9 +164,9 @@ less than what vms provides. This might be a problem on the faster Alphas.
|
||||
You can use a : in a filename only if you preceed it with a backslash ('\').
|
||||
E.g.- hobbes\:[bogas.files]
|
||||
|
||||
Make ignores success, informational, or warning errors (-S-, -I-, or -W-).
|
||||
But it will stop on -E- and -F- errors. (unless you do something to override
|
||||
this in your makefile, or whatever).
|
||||
Make ignores success, informational, or warning errors (-S-, -I-, or
|
||||
-W-). But it will stop on -E- and -F- errors. (unless you do something
|
||||
to override this in your makefile, or whatever).
|
||||
|
||||
Remote stuff isn't implemented yet.
|
||||
|
||||
@@ -47,18 +174,10 @@ Multiple line DCL commands, such as "if" statements, must be put inside
|
||||
command files. You can run a command file by using \@.
|
||||
|
||||
|
||||
Change history:
|
||||
VMS changes made for 3.74.3
|
||||
|
||||
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.
|
||||
|
||||
Long command lines are now converted to command files.
|
||||
|
||||
Comma (',') as a separator is now allowed. See makefile.vms for an example.
|
||||
|
||||
|
||||
377
remake.c
377
remake.c
@@ -1,5 +1,5 @@
|
||||
/* Basic dependency engine 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.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify
|
||||
@@ -23,6 +23,7 @@ Boston, MA 02111-1307, USA. */
|
||||
#include "commands.h"
|
||||
#include "dep.h"
|
||||
#include "variable.h"
|
||||
#include "debug.h"
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
@@ -42,6 +43,18 @@ Boston, MA 02111-1307, USA. */
|
||||
extern int try_implicit_rule PARAMS ((struct file *file, unsigned int depth));
|
||||
|
||||
|
||||
/* The test for circular dependencies is based on the 'updating' bit in
|
||||
`struct file'. However, double colon targets have seperate `struct
|
||||
file's; make sure we always use the base of the double colon chain. */
|
||||
|
||||
#define start_updating(_f) (((_f)->double_colon ? (_f)->double_colon : (_f))\
|
||||
->updating = 1)
|
||||
#define finish_updating(_f) (((_f)->double_colon ? (_f)->double_colon : (_f))\
|
||||
->updating = 0)
|
||||
#define is_updating(_f) (((_f)->double_colon ? (_f)->double_colon : (_f))\
|
||||
->updating)
|
||||
|
||||
|
||||
/* Incremented when a command is started (under -n, when one would be). */
|
||||
unsigned int commands_started = 0;
|
||||
|
||||
@@ -61,9 +74,6 @@ static int library_search PARAMS ((char **lib, FILE_TIMESTAMP *mtime_ptr));
|
||||
should only make one goal at a time and return as soon as one goal whose
|
||||
`changed' member is nonzero is successfully made. */
|
||||
|
||||
/* We need to know this "lower down" for correct error handling. */
|
||||
static int updating_makefiles = 0;
|
||||
|
||||
int
|
||||
update_goal_chain (goals, makefiles)
|
||||
register struct dep *goals;
|
||||
@@ -73,8 +83,6 @@ update_goal_chain (goals, makefiles)
|
||||
unsigned int j = job_slots;
|
||||
int status = -1;
|
||||
|
||||
updating_makefiles = makefiles;
|
||||
|
||||
#define MTIME(file) (makefiles ? file_mtime_no_search (file) \
|
||||
: file_mtime (file))
|
||||
|
||||
@@ -93,15 +101,6 @@ update_goal_chain (goals, makefiles)
|
||||
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)
|
||||
job_slots = 1;
|
||||
#endif
|
||||
|
||||
/* All files start with the considered bit 0, so the global value is 1. */
|
||||
considered = 1;
|
||||
|
||||
@@ -159,44 +158,47 @@ update_goal_chain (goals, makefiles)
|
||||
decide when to give an "up to date" diagnostic. */
|
||||
g->changed += commands_started - ocommands_started;
|
||||
|
||||
stop = 0;
|
||||
if (x != 0 || file->updated)
|
||||
{
|
||||
/* If STATUS was not already 1, set it to 1 if
|
||||
updating failed, or to 0 if updating succeeded.
|
||||
Leave STATUS as it is if no updating was done. */
|
||||
/* If we updated a file and STATUS was not already 1, set it to
|
||||
1 if updating failed, or to 0 if updating succeeded. Leave
|
||||
STATUS as it is if no updating was done. */
|
||||
|
||||
if (status < 1)
|
||||
{
|
||||
if (file->update_status != 0)
|
||||
{
|
||||
/* Updating failed, or -q triggered.
|
||||
The STATUS value tells our caller which. */
|
||||
status = file->update_status;
|
||||
/* If -q just triggered, stop immediately.
|
||||
It doesn't matter how much more we run,
|
||||
since we already know the answer to return. */
|
||||
stop = (!keep_going_flag && !question_flag
|
||||
&& !makefiles);
|
||||
}
|
||||
else if (file->updated && g->changed &&
|
||||
file->last_mtime != file->mtime_before_update)
|
||||
{
|
||||
/* Updating was done. If this is a makefile and
|
||||
just_print_flag or question_flag is set
|
||||
(meaning -n or -q was given and this file was
|
||||
specified as a command-line target), don't
|
||||
change STATUS. If STATUS is changed, we will
|
||||
get re-exec'd, and fall into an infinite loop. */
|
||||
if (!makefiles
|
||||
|| (!just_print_flag && !question_flag))
|
||||
status = 0;
|
||||
if (makefiles && file->dontcare)
|
||||
/* This is a default makefile. Stop remaking. */
|
||||
stop = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
stop = 0;
|
||||
if ((x != 0 || file->updated) && status < 1)
|
||||
{
|
||||
if (file->update_status != 0)
|
||||
{
|
||||
/* Updating failed, or -q triggered. The STATUS value
|
||||
tells our caller which. */
|
||||
status = file->update_status;
|
||||
/* If -q just triggered, stop immediately. It doesn't
|
||||
matter how much more we run, since we already know
|
||||
the answer to return. */
|
||||
stop = (!keep_going_flag && !question_flag
|
||||
&& !makefiles);
|
||||
}
|
||||
else
|
||||
{
|
||||
FILE_TIMESTAMP mtime = MTIME (file);
|
||||
check_renamed (file);
|
||||
|
||||
if (file->updated && g->changed &&
|
||||
mtime != file->mtime_before_update)
|
||||
{
|
||||
/* Updating was done. If this is a makefile and
|
||||
just_print_flag or question_flag is set (meaning
|
||||
-n or -q was given and this file was specified
|
||||
as a command-line target), don't change STATUS.
|
||||
If STATUS is changed, we will get re-exec'd, and
|
||||
enter an infinite loop. */
|
||||
if (!makefiles
|
||||
|| (!just_print_flag && !question_flag))
|
||||
status = 0;
|
||||
if (makefiles && file->dontcare)
|
||||
/* This is a default makefile; stop remaking. */
|
||||
stop = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Keep track if any double-colon entry is not finished.
|
||||
When they are all finished, the goal is finished. */
|
||||
@@ -263,39 +265,6 @@ update_goal_chain (goals, makefiles)
|
||||
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.
|
||||
Return 0 if successful, 1 if unsuccessful;
|
||||
but with some flag settings, just call `exit' if unsuccessful.
|
||||
@@ -316,41 +285,50 @@ update_file (file, depth)
|
||||
register int status = 0;
|
||||
register struct file *f;
|
||||
|
||||
/* 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 (file->considered == considered)
|
||||
{
|
||||
DEBUGPR (_("Pruning file `%s'.\n"));
|
||||
return 0;
|
||||
}
|
||||
file->considered = considered;
|
||||
f = file->double_colon ? file->double_colon : file;
|
||||
|
||||
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)
|
||||
{
|
||||
DBF (DB_VERBOSE, _("Pruning file `%s'.\n"));
|
||||
return f->command_state == cs_finished ? f->update_status : 0;
|
||||
}
|
||||
|
||||
/* This loop runs until we start commands for a double colon rule, or until
|
||||
the chain is exhausted. */
|
||||
for (; f != 0; f = f->prev)
|
||||
{
|
||||
f->considered = considered;
|
||||
|
||||
status |= update_file_1 (f, depth);
|
||||
check_renamed (f);
|
||||
|
||||
if (status != 0 && !keep_going_flag)
|
||||
return status;
|
||||
break;
|
||||
|
||||
switch (f->command_state)
|
||||
{
|
||||
case cs_finished:
|
||||
/* The file is done being remade. */
|
||||
break;
|
||||
|
||||
case cs_running:
|
||||
case cs_deps_running:
|
||||
if (f->command_state == cs_running
|
||||
|| f->command_state == cs_deps_running)
|
||||
{
|
||||
/* Don't run the other :: rules for this
|
||||
file until this rule is finished. */
|
||||
return 0;
|
||||
status = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
default:
|
||||
assert (f->command_state == cs_running);
|
||||
break;
|
||||
}
|
||||
/* Process the remaining rules in the double colon chain so they're marked
|
||||
considered. Start their prerequisites, too. */
|
||||
for (; f != 0 ; f = f->prev)
|
||||
{
|
||||
struct dep *d;
|
||||
|
||||
f->considered = considered;
|
||||
|
||||
for (d = f->deps; d != 0; d = d->next)
|
||||
status |= update_file (d->file, depth + 1);
|
||||
}
|
||||
|
||||
return status;
|
||||
@@ -369,18 +347,18 @@ update_file_1 (file, depth)
|
||||
register struct dep *d, *lastd;
|
||||
int running = 0;
|
||||
|
||||
DEBUGPR (_("Considering target file `%s'.\n"));
|
||||
DBF (DB_VERBOSE, _("Considering target file `%s'.\n"));
|
||||
|
||||
if (file->updated)
|
||||
{
|
||||
if (file->update_status > 0)
|
||||
{
|
||||
DEBUGPR (_("Recently tried and failed to update file `%s'.\n"));
|
||||
no_rule_error(file);
|
||||
DBF (DB_VERBOSE,
|
||||
_("Recently tried and failed to update file `%s'.\n"));
|
||||
return file->update_status;
|
||||
}
|
||||
|
||||
DEBUGPR (_("File `%s' was considered already.\n"));
|
||||
DBF (DB_VERBOSE, _("File `%s' was considered already.\n"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -390,10 +368,10 @@ update_file_1 (file, depth)
|
||||
case cs_deps_running:
|
||||
break;
|
||||
case cs_running:
|
||||
DEBUGPR (_("Still updating file `%s'.\n"));
|
||||
DBF (DB_VERBOSE, _("Still updating file `%s'.\n"));
|
||||
return 0;
|
||||
case cs_finished:
|
||||
DEBUGPR (_("Finished updating file `%s'.\n"));
|
||||
DBF (DB_VERBOSE, _("Finished updating file `%s'.\n"));
|
||||
return file->update_status;
|
||||
default:
|
||||
abort ();
|
||||
@@ -402,7 +380,7 @@ update_file_1 (file, depth)
|
||||
++depth;
|
||||
|
||||
/* Notice recursive update of the same file. */
|
||||
file->updating = 1;
|
||||
start_updating (file);
|
||||
|
||||
/* Looking at the file's modtime beforehand allows the possibility
|
||||
that its name may be changed by a VPATH search, and thus it may
|
||||
@@ -414,7 +392,7 @@ update_file_1 (file, depth)
|
||||
check_renamed (file);
|
||||
noexist = this_mtime == (FILE_TIMESTAMP) -1;
|
||||
if (noexist)
|
||||
DEBUGPR (_("File `%s' does not exist.\n"));
|
||||
DBF (DB_BASIC, _("File `%s' does not exist.\n"));
|
||||
|
||||
must_make = noexist;
|
||||
|
||||
@@ -424,15 +402,15 @@ update_file_1 (file, depth)
|
||||
if (!file->phony && file->cmds == 0 && !file->tried_implicit)
|
||||
{
|
||||
if (try_implicit_rule (file, depth))
|
||||
DEBUGPR (_("Found an implicit rule for `%s'.\n"));
|
||||
DBF (DB_IMPLICIT, _("Found an implicit rule for `%s'.\n"));
|
||||
else
|
||||
DEBUGPR (_("No implicit rule found for `%s'.\n"));
|
||||
DBF (DB_IMPLICIT, _("No implicit rule found for `%s'.\n"));
|
||||
file->tried_implicit = 1;
|
||||
}
|
||||
if (file->cmds == 0 && !file->is_target
|
||||
&& default_file != 0 && default_file->cmds != 0)
|
||||
{
|
||||
DEBUGPR (_("Using default commands for `%s'.\n"));
|
||||
DBF (DB_IMPLICIT, _("Using default commands for `%s'.\n"));
|
||||
file->cmds = default_file->cmds;
|
||||
}
|
||||
|
||||
@@ -450,7 +428,7 @@ update_file_1 (file, depth)
|
||||
mtime = file_mtime (d->file);
|
||||
check_renamed (d->file);
|
||||
|
||||
if (d->file->updating)
|
||||
if (is_updating (d->file))
|
||||
{
|
||||
error (NILF, _("Circular %s <- %s dependency dropped."),
|
||||
file->name, d->file->name);
|
||||
@@ -528,15 +506,15 @@ update_file_1 (file, depth)
|
||||
}
|
||||
}
|
||||
|
||||
file->updating = 0;
|
||||
finish_updating (file);
|
||||
|
||||
DEBUGPR (_("Finished dependencies of target file `%s'.\n"));
|
||||
DBF (DB_VERBOSE, _("Finished prerequisites of target file `%s'.\n"));
|
||||
|
||||
if (running)
|
||||
{
|
||||
set_command_state (file, cs_deps_running);
|
||||
--depth;
|
||||
DEBUGPR (_("The dependencies of `%s' are being made.\n"));
|
||||
DBF (DB_VERBOSE, _("The prerequisites of `%s' are being made.\n"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -549,11 +527,12 @@ update_file_1 (file, depth)
|
||||
|
||||
depth--;
|
||||
|
||||
DEBUGPR (_("Giving up on target file `%s'.\n"));
|
||||
DBF (DB_VERBOSE, _("Giving up on target file `%s'.\n"));
|
||||
|
||||
if (depth == 0 && keep_going_flag
|
||||
&& !just_print_flag && !question_flag)
|
||||
error (NILF, _("Target `%s' not remade because of errors."), file->name);
|
||||
error (NILF,
|
||||
_("Target `%s' not remade because of errors."), file->name);
|
||||
|
||||
return dep_status;
|
||||
}
|
||||
@@ -594,15 +573,29 @@ update_file_1 (file, depth)
|
||||
or its dependent, FILE, is older or does not exist. */
|
||||
d->changed |= noexist || d_mtime > this_mtime;
|
||||
|
||||
if (debug_flag && !noexist)
|
||||
if (!noexist && ISDB (DB_BASIC|DB_VERBOSE))
|
||||
{
|
||||
print_spaces (depth);
|
||||
const char *fmt = 0;
|
||||
|
||||
if (d_mtime == (FILE_TIMESTAMP) -1)
|
||||
printf (_("Dependency `%s' does not exist.\n"), dep_name (d));
|
||||
else
|
||||
printf (_("Dependency `%s' is %s than dependent `%s'.\n"),
|
||||
dep_name (d), d->changed ? _("newer") : _("older"), file->name);
|
||||
fflush (stdout);
|
||||
{
|
||||
if (ISDB (DB_BASIC))
|
||||
fmt = _("Prerequisite `%s' of target `%s' does not exist.\n");
|
||||
}
|
||||
else if (d->changed)
|
||||
{
|
||||
if (ISDB (DB_BASIC))
|
||||
fmt = _("Prerequisite `%s' is newer than target `%s'.\n");
|
||||
}
|
||||
else if (ISDB (DB_VERBOSE))
|
||||
fmt = _("Prerequisite `%s' is older than target `%s'.\n");
|
||||
|
||||
if (fmt)
|
||||
{
|
||||
print_spaces (depth);
|
||||
printf (fmt, dep_name (d), file->name);
|
||||
fflush (stdout);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -612,24 +605,26 @@ update_file_1 (file, depth)
|
||||
if (file->double_colon && file->deps == 0)
|
||||
{
|
||||
must_make = 1;
|
||||
DEBUGPR (_("Target `%s' is double-colon and has no dependencies.\n"));
|
||||
DBF (DB_BASIC,
|
||||
_("Target `%s' is double-colon and has no prerequisites.\n"));
|
||||
}
|
||||
else if (!noexist && file->is_target && !deps_changed && file->cmds == 0)
|
||||
{
|
||||
must_make = 0;
|
||||
DEBUGPR (_("No commands for `%s' and no dependencies actually changed.\n"));
|
||||
DBF (DB_VERBOSE,
|
||||
_("No commands for `%s' and no prerequisites actually changed.\n"));
|
||||
}
|
||||
|
||||
if (!must_make)
|
||||
{
|
||||
if (debug_flag)
|
||||
if (ISDB (DB_VERBOSE))
|
||||
{
|
||||
print_spaces(depth);
|
||||
printf(_("No need to remake target `%s'"), file->name);
|
||||
if (!streq(file->name, file->hname))
|
||||
printf(_("; using VPATH name `%s'"), file->hname);
|
||||
printf(".\n");
|
||||
fflush(stdout);
|
||||
print_spaces (depth);
|
||||
printf (_("No need to remake target `%s'"), file->name);
|
||||
if (!streq (file->name, file->hname))
|
||||
printf (_("; using VPATH name `%s'"), file->hname);
|
||||
puts (".");
|
||||
fflush (stdout);
|
||||
}
|
||||
|
||||
notice_finished_file (file);
|
||||
@@ -647,18 +642,13 @@ update_file_1 (file, depth)
|
||||
return 0;
|
||||
}
|
||||
|
||||
DEBUGPR (_("Must remake target `%s'.\n"));
|
||||
DBF (DB_BASIC, _("Must remake target `%s'.\n"));
|
||||
|
||||
/* It needs to be remade. If it's VPATH and not reset via GPATH, toss the
|
||||
VPATH. */
|
||||
if (!streq(file->name, file->hname))
|
||||
{
|
||||
if (debug_flag)
|
||||
{
|
||||
print_spaces (depth);
|
||||
printf(_(" Ignoring VPATH name `%s'.\n"), file->hname);
|
||||
fflush(stdout);
|
||||
}
|
||||
DB (DB_BASIC, (_(" Ignoring VPATH name `%s'.\n"), file->hname));
|
||||
file->ignore_vpath = 1;
|
||||
}
|
||||
|
||||
@@ -667,20 +657,20 @@ update_file_1 (file, depth)
|
||||
|
||||
if (file->command_state != cs_finished)
|
||||
{
|
||||
DEBUGPR (_("Commands of `%s' are being run.\n"));
|
||||
DBF (DB_VERBOSE, _("Commands of `%s' are being run.\n"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
switch (file->update_status)
|
||||
{
|
||||
case 2:
|
||||
DEBUGPR (_("Failed to remake target file `%s'.\n"));
|
||||
DBF (DB_BASIC, _("Failed to remake target file `%s'.\n"));
|
||||
break;
|
||||
case 0:
|
||||
DEBUGPR (_("Successfully remade target file `%s'.\n"));
|
||||
DBF (DB_BASIC, _("Successfully remade target file `%s'.\n"));
|
||||
break;
|
||||
case 1:
|
||||
DEBUGPR (_("Target file `%s' needs remade under -q.\n"));
|
||||
DBF (DB_BASIC, _("Target file `%s' needs remade under -q.\n"));
|
||||
break;
|
||||
default:
|
||||
assert (file->update_status >= 0 && file->update_status <= 2);
|
||||
@@ -736,18 +726,31 @@ notice_finished_file (file)
|
||||
}
|
||||
}
|
||||
|
||||
if (file->mtime_before_update == 0)
|
||||
file->mtime_before_update = file->last_mtime;
|
||||
|
||||
if (ran && !file->phony)
|
||||
{
|
||||
struct file *f;
|
||||
int i = 0;
|
||||
|
||||
assert(file->mtime_before_update == 0);
|
||||
file->mtime_before_update = file->last_mtime;
|
||||
/* If -n or -q and all the commands are recursive, we ran them so
|
||||
really check the target's mtime again. Otherwise, assume the target
|
||||
would have been updated. */
|
||||
|
||||
if (just_print_flag || question_flag
|
||||
|| (file->is_target && file->cmds == 0))
|
||||
file->last_mtime = NEW_MTIME;
|
||||
else
|
||||
file->last_mtime = 0;
|
||||
if (question_flag || just_print_flag)
|
||||
{
|
||||
for (i = file->cmds->ncommand_lines; i > 0; --i)
|
||||
if (! (file->cmds->lines_flags[i-1] & COMMANDS_RECURSE))
|
||||
break;
|
||||
}
|
||||
|
||||
/* If there were no commands at all, it's always new. */
|
||||
|
||||
else if (file->is_target && file->cmds == 0)
|
||||
i = 1;
|
||||
|
||||
file->last_mtime = i == 0 ? 0 : NEW_MTIME;
|
||||
|
||||
/* Propagate the change of modification time to all the double-colon
|
||||
entries for this file. */
|
||||
@@ -797,7 +800,7 @@ check_dep (file, depth, this_mtime, must_make_ptr)
|
||||
int dep_status = 0;
|
||||
|
||||
++depth;
|
||||
file->updating = 1;
|
||||
start_updating (file);
|
||||
|
||||
if (!file->intermediate)
|
||||
/* If this is a non-intermediate file, update it and record
|
||||
@@ -819,15 +822,15 @@ check_dep (file, depth, this_mtime, must_make_ptr)
|
||||
if (!file->phony && file->cmds == 0 && !file->tried_implicit)
|
||||
{
|
||||
if (try_implicit_rule (file, depth))
|
||||
DEBUGPR (_("Found an implicit rule for `%s'.\n"));
|
||||
DBF (DB_IMPLICIT, _("Found an implicit rule for `%s'.\n"));
|
||||
else
|
||||
DEBUGPR (_("No implicit rule found for `%s'.\n"));
|
||||
DBF (DB_IMPLICIT, _("No implicit rule found for `%s'.\n"));
|
||||
file->tried_implicit = 1;
|
||||
}
|
||||
if (file->cmds == 0 && !file->is_target
|
||||
&& default_file != 0 && default_file->cmds != 0)
|
||||
{
|
||||
DEBUGPR (_("Using default commands for `%s'.\n"));
|
||||
DBF (DB_IMPLICIT, _("Using default commands for `%s'.\n"));
|
||||
file->cmds = default_file->cmds;
|
||||
}
|
||||
|
||||
@@ -849,7 +852,7 @@ check_dep (file, depth, this_mtime, must_make_ptr)
|
||||
d = file->deps;
|
||||
while (d != 0)
|
||||
{
|
||||
if (d->file->updating)
|
||||
if (is_updating (d->file))
|
||||
{
|
||||
error (NILF, _("Circular %s <- %s dependency dropped."),
|
||||
file->name, d->file->name);
|
||||
@@ -869,7 +872,8 @@ check_dep (file, depth, this_mtime, must_make_ptr)
|
||||
}
|
||||
|
||||
d->file->parent = file;
|
||||
dep_status |= check_dep (d->file, depth, this_mtime, must_make_ptr);
|
||||
dep_status |= check_dep (d->file, depth, this_mtime,
|
||||
must_make_ptr);
|
||||
check_renamed (d->file);
|
||||
if (dep_status != 0 && !keep_going_flag)
|
||||
break;
|
||||
@@ -887,7 +891,7 @@ check_dep (file, depth, this_mtime, must_make_ptr)
|
||||
}
|
||||
}
|
||||
|
||||
file->updating = 0;
|
||||
finish_updating (file);
|
||||
return dep_status;
|
||||
}
|
||||
|
||||
@@ -965,20 +969,45 @@ remake_file (file)
|
||||
Pretend it was successfully remade. */
|
||||
file->update_status = 0;
|
||||
else
|
||||
no_rule_error(file);
|
||||
{
|
||||
const char *msg_noparent
|
||||
= _("%sNo rule to make target `%s'%s");
|
||||
const char *msg_parent
|
||||
= _("%sNo rule to make target `%s', needed by `%s'%s");
|
||||
|
||||
/* This is a dependency file we cannot remake. Fail. */
|
||||
if (!keep_going_flag && !file->dontcare)
|
||||
{
|
||||
if (file->parent == 0)
|
||||
fatal (NILF, msg_noparent, "", file->name, "");
|
||||
|
||||
fatal (NILF, msg_parent, "", file->name, file->parent->name, "");
|
||||
}
|
||||
|
||||
if (!file->dontcare)
|
||||
{
|
||||
if (file->parent == 0)
|
||||
error (NILF, msg_noparent, "*** ", file->name, ".");
|
||||
else
|
||||
error (NILF, msg_parent, "*** ",
|
||||
file->name, file->parent->name, ".");
|
||||
}
|
||||
file->update_status = 2;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
chop_commands (file->cmds);
|
||||
|
||||
/* The normal case: start some commands. */
|
||||
if (!touch_flag || file->cmds->any_recurse)
|
||||
{
|
||||
execute_file_commands (file);
|
||||
return;
|
||||
}
|
||||
else
|
||||
/* This tells notice_finished_file it is ok to touch the file. */
|
||||
file->update_status = 0;
|
||||
|
||||
/* This tells notice_finished_file it is ok to touch the file. */
|
||||
file->update_status = 0;
|
||||
}
|
||||
|
||||
/* This does the touching under -t. */
|
||||
@@ -1068,7 +1097,7 @@ f_mtime (file, search)
|
||||
/* The archive doesn't exist, so it's members don't exist either. */
|
||||
return (FILE_TIMESTAMP) -1;
|
||||
|
||||
mtime = ar_member_date (file->hname);
|
||||
mtime = FILE_TIMESTAMP_FROM_S_AND_NS (ar_member_date (file->hname), 0);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
@@ -1224,7 +1253,7 @@ library_search (lib, mtime_ptr)
|
||||
|
||||
/* Loop variables for the libpatterns value. */
|
||||
char *p, *p2;
|
||||
int len;
|
||||
unsigned int len;
|
||||
|
||||
char *file, **dp;
|
||||
|
||||
|
||||
@@ -26,6 +26,8 @@ Boston, MA 02111-1307, USA. */
|
||||
#include "filedef.h"
|
||||
#include "commands.h"
|
||||
#include "job.h"
|
||||
#include "debug.h"
|
||||
|
||||
#include <sys/time.h>
|
||||
#include <netdb.h>
|
||||
|
||||
@@ -81,7 +83,7 @@ start_remote_job_p (first_p)
|
||||
Customs requires a privileged source port be used. */
|
||||
make_access ();
|
||||
|
||||
if (debug_flag)
|
||||
if (ISDB (DB_EXTRA))
|
||||
Rpc_Debug(1);
|
||||
|
||||
/* Ping the daemon once to see if it is there. */
|
||||
@@ -122,8 +124,8 @@ start_remote_job_p (first_p)
|
||||
status = Customs_Host (EXPORT_SAME, &permit);
|
||||
if (status != RPC_SUCCESS)
|
||||
{
|
||||
if (debug_flag)
|
||||
printf ("Customs won't export: %s\n", Rpc_ErrorMessage (status));
|
||||
DB (DB_EXTRA, (_("Customs won't export: %s\n"),
|
||||
Rpc_ErrorMessage (status)));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
16
rule.c
16
rule.c
@@ -108,11 +108,15 @@ count_implicit_rule_limits ()
|
||||
unsigned int len = strlen (dep->name);
|
||||
|
||||
#ifdef VMS
|
||||
char *p = rindex (dep->name, ']');
|
||||
char *p = strrchr (dep->name, ']');
|
||||
char *p2;
|
||||
if (p == 0)
|
||||
p = strrchr (dep->name, ':');
|
||||
p2 = p != 0 ? strchr (dep->name, '%') : 0;
|
||||
#else
|
||||
char *p = rindex (dep->name, '/');
|
||||
char *p = strrchr (dep->name, '/');
|
||||
char *p2 = p != 0 ? strchr (dep->name, '%') : 0;
|
||||
#endif
|
||||
char *p2 = p != 0 ? index (dep->name, '%') : 0;
|
||||
ndeps++;
|
||||
|
||||
if (len > max_pattern_dep_length)
|
||||
@@ -140,7 +144,7 @@ count_implicit_rule_limits ()
|
||||
|
||||
dep->changed = !dir_file_exists_p (name, "");
|
||||
#ifdef VMS
|
||||
if (dep->changed && *name == ']')
|
||||
if (dep->changed && strchr (name, ':') != 0)
|
||||
#else
|
||||
if (dep->changed && *name == '/')
|
||||
#endif
|
||||
@@ -603,12 +607,12 @@ lookup_pattern_var (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
|
||||
We could test simply using 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])))
|
||||
&& (*p->suffix == '\0' || streq (&p->suffix[1], &stem[stemlen+1])))
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
19
signame.c
19
signame.c
@@ -1,5 +1,5 @@
|
||||
/* Convert between signal names and numbers.
|
||||
Copyright (C) 1990, 1992, 1993, 1995, 1996 Free Software Foundation, Inc.
|
||||
Copyright (C) 1990,92,93,95,96,99 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
@@ -17,23 +17,10 @@
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
|
||||
/* In the GNU make version, all the headers we need are provided by make.h. */
|
||||
#include "make.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h> /* Some systems need this for <signal.h>. */
|
||||
#include <signal.h>
|
||||
|
||||
#ifdef HAVE_STRING_H
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
/* Some systems declare `sys_siglist in <unistd.h>; if
|
||||
configure defined SYS_SIGLIST_DECLARED, it may expect
|
||||
to find the declaration there. */
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
|
||||
/* Some systems do not define NSIG in <signal.h>. */
|
||||
#ifndef NSIG
|
||||
|
||||
339
tests/COPYING
Normal file
339
tests/COPYING
Normal file
@@ -0,0 +1,339 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
675 Mass Ave, Cambridge, MA 02139, USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
Appendix: How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) 19yy <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) 19yy name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Library General
|
||||
Public License instead of this License.
|
||||
193
tests/ChangeLog
Normal file
193
tests/ChangeLog
Normal file
@@ -0,0 +1,193 @@
|
||||
2000-04-04 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/functions/word: wordlist doesn't swap arguments anymore.
|
||||
|
||||
2000-03-27 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/features/statipattrules: Test that static pattern rules
|
||||
whose prerequisite patterns resolve to empty strings throw an
|
||||
error (instead of dumping core). Fixes PR/1670.
|
||||
|
||||
* scripts/features/reinvoke: Make more robust by touching "b"
|
||||
first, to ensure it's not newer than "a".
|
||||
Reported by Marco Franzen <Marco.Franzen@Thyron.com>.
|
||||
* scripts/options/dash-n: Ditto.
|
||||
|
||||
* scripts/functions/call: Whoops. The fix to PR/1527 caused
|
||||
recursive invocations of $(call ...) to break. I can't come up
|
||||
with any way to get both working at the same time, so I backed out
|
||||
the fix to 1527 and added a test case for recursive calls. This
|
||||
also tests the fix for PR/1610.
|
||||
|
||||
* scripts/features/double_colon: Test that circular dependencies
|
||||
in double-colon rule sets are detected correctly (PR/1671).
|
||||
|
||||
2000-03-26 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/targets/INTERMEDIATE: Test that make doesn't remove
|
||||
.INTERMEDIATE files when given on the command line (PR/1669).
|
||||
|
||||
2000-03-08 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/options/dash-k: Add a test for error detection by
|
||||
multiple targets depending on the same prerequisite with -k.
|
||||
For PR/1634.
|
||||
|
||||
2000-02-07 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/features/escape: Add a test for backslash-escaped spaces
|
||||
in a target name (PR/1586).
|
||||
|
||||
2000-02-04 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/features/patspecific_vars: Add a test for pattern-specific
|
||||
target variables inherited from the parent target (PR/1407).
|
||||
|
||||
2000-02-02 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* run_make_tests.pl (set_more_defaults): Hard-code the LANG to C
|
||||
to make sure sorting order, etc. is predictable.
|
||||
Reported by Andreas Jaeger <aj@suse.de>.
|
||||
|
||||
* run_make_tests.pl (set_more_defaults): Set the $wtime variable
|
||||
depending on the OS. Eli Zaretskii <eliz@is.elta.co.il> reports
|
||||
this seems to need to be *4* on DOS/Windows, not just 2. Keep it
|
||||
1 for other systems.
|
||||
* scripts/features/vpathplus (touchfiles): Use the $wtime value
|
||||
instead of hardcoding 2.
|
||||
* scripts/targets/SECONDARY: Ditto.
|
||||
* scripts/targets/INTERMEDIATE: Ditto.
|
||||
|
||||
2000-01-27 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* test_driver.pl (toplevel): Don't try to run test scripts which
|
||||
are really directories.
|
||||
|
||||
2000-01-23 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/features/include: Remove a check; the fix caused more
|
||||
problems than the error, so I removed it and removed the test for
|
||||
it.
|
||||
|
||||
2000-01-11 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/functions/call: Add a test for PR/1517 and PR/1527: make
|
||||
sure $(call ...) doesn't eval its arguments and that you can
|
||||
invoke foreach from it without looping forever.
|
||||
|
||||
1999-12-15 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/targets/INTERMEDIATE: Add a test for PR/1423: make sure
|
||||
.INTERMEDIATE settings on files don't disable them as implicit
|
||||
intermediate possibilities.
|
||||
|
||||
1999-12-01 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/features/double_colon: Add a test for PR/1476: Try
|
||||
double-colon rules as non-goal targets and during parallel builds
|
||||
to make sure they're handled serially.
|
||||
|
||||
1999-11-17 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/functions/if: Add a test for PR/1429: put some text
|
||||
after an if-statement to make sure it works.
|
||||
|
||||
* scripts/features/targetvars: Add a test for PR/1380: handling +=
|
||||
in target-specific variable definitions correctly.
|
||||
|
||||
1999-10-15 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/variables/MAKEFILES: This was really broken: it didn't
|
||||
test anything at all, really. Rewrote it, plus added a test for
|
||||
PR/1394.
|
||||
|
||||
1999-10-13 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/options/dash-n: Add a test for PR/1379: "-n doesn't
|
||||
behave properly when used with recursive targets".
|
||||
|
||||
1999-10-08 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/features/targetvars: Add a check for PR/1378:
|
||||
"Target-specific vars don't inherit correctly"
|
||||
|
||||
1999-09-29 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* test_driver.pl (get_osname): Change $fancy_file_names to
|
||||
$short_filenames and reverse the logic.
|
||||
(run_each_test): Change test of non-existent $port_host to use
|
||||
$short_filenames--problem reported by Eli Zaretskii.
|
||||
|
||||
1999-09-23 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/features/parallelism: Add a check to ensure that the
|
||||
jobserver works when we re-invoke. Also cleaned up the tests a
|
||||
little, reducing the number of rules we use so the test won't need
|
||||
as many "sleep" commands.
|
||||
|
||||
1999-09-16 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/features/reinvoke: Remove invocations of "touch" in
|
||||
makefiles. See the comments on the touch function rewrite below.
|
||||
Note that UNIX touch behaves the same way if the file already
|
||||
exists: it sets the time to the _local_ time. We don't want
|
||||
this. This is probably a good tip for makefile writers in
|
||||
general, actually... where practical.
|
||||
* scripts/options/dash-l: Ditto.
|
||||
* scripts/options/dash-n: Ditto.
|
||||
|
||||
* test_driver.pl (run_each_test): In retrospect, I don't like the
|
||||
.lN/.bN/.dN postfix required by DOS. So, for non-DOS systems I
|
||||
changed it back to use .log, .base, and .diff.
|
||||
|
||||
* run_make_tests.pl (set_more_defaults): Move the check for the
|
||||
make pathname to here from set_defaults (that's too early since it
|
||||
happens before the command line processing).
|
||||
Create a new variable $port_type, calculated from $osname, to
|
||||
specify what kind of system we're running on. We should integrate
|
||||
the VOS stuff here, too.
|
||||
(valid_option): Comment out the workdir/-work stuff so people
|
||||
won't be fooled into thinking it works... someone needs to fix
|
||||
this, though!
|
||||
|
||||
* scripts/functions/origin: Use $port_type instead of $osname.
|
||||
* scripts/functions/foreach: Ditto.
|
||||
* scripts/features/default_names: Ditto.
|
||||
|
||||
1999-09-15 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* test_driver.pl (touch): Rewrite this function. Previously it
|
||||
used to use utime() to hard-set the time based on the current
|
||||
local clock, or, if the file didn't exist, it merely created it.
|
||||
This mirrors exactly what real UNIX touch does, but it fails badly
|
||||
on networked filesystems where the FS server clock is skewed from
|
||||
the local clock: normally modifying a file causes it to get a mod
|
||||
time based on the _server's_ clock. Hard-setting it based on the
|
||||
_local_ clock causes gratuitous errors and makes the tests
|
||||
unreliable except on local filesystems. The new function will
|
||||
simply modify the file, allowing the filesystem to set the mod
|
||||
time as it sees fit.
|
||||
|
||||
* scripts/features/parallelism: The second test output could
|
||||
change depending on how fast some scripts completed; use "sleep"
|
||||
to force the order we want.
|
||||
|
||||
* test_driver.pl (toplevel): A bug in Perl 5.000 to Perl 5.004
|
||||
means that "%ENV = ();" doesn't do the right thing. This worked
|
||||
in Perl 4 and was fixed in Perl 5.004_01, but use a loop to delete
|
||||
the environment rather than require specific versions.
|
||||
|
||||
* run_make_tests.pl (set_more_defaults): Don't use Perl 5 s///
|
||||
modifier "s", so the tests will run with Perl 4.
|
||||
(set_more_defaults): Set $pure_log to empty if there's no -logfile
|
||||
option in PURIFYOPTIONS.
|
||||
(setup_for_test): Don't remove any logs unless $pure_log is set.
|
||||
|
||||
1999-09-15 Eli Zaretskii <eliz@is.elta.co.il>
|
||||
|
||||
* scripts/features/reinvoke: Put the SHELL definition in the right
|
||||
test makefile.
|
||||
|
||||
1999-09-15 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
ChangeLog file for the test suite created.
|
||||
161
tests/NEWS
Normal file
161
tests/NEWS
Normal file
@@ -0,0 +1,161 @@
|
||||
Changes from 0.4.9 to 3.78 (Sep 6, 1999):
|
||||
|
||||
Lots of new tests. Renamed to follow the GNU make scheme. Also
|
||||
added some support for using Purify with make.
|
||||
|
||||
Rob Tulloh contributed some changes to get the test suite running on
|
||||
NT; I tweaked them a bit (hopefully I didn't break anything!) Note
|
||||
that NT doesn't grok the self-exec funkiness that Unix shells use,
|
||||
so instead I broke that out into a separate shell script
|
||||
"run_make_tests" that invokes perl with the (renamed) script
|
||||
run_make_tests.pl.
|
||||
|
||||
Eli Zaretski contributed changes to get the test suite running on
|
||||
DOS with DJGPP. I also meddled in these somewhat.
|
||||
|
||||
If you're on DOS or NT you should run "perl.exe run_make_tests.pl ..."
|
||||
If you're on Unix, you can continue to run "./run_make_tests ..." as
|
||||
before.
|
||||
|
||||
Changes from 0.4.8 to 0.4.9 (May 14, 1998):
|
||||
|
||||
Release by Paul D. Smith <psmith@baynetworks.com>; I'm the one to
|
||||
blame for problems in this version :).
|
||||
|
||||
Add some perl to test_driver.pl to strip out GNU make clock skew
|
||||
warning messages from the output before comparing it to the
|
||||
known-good output.
|
||||
|
||||
A new test for escaped :'s in filenames (someone on VMS found this
|
||||
didn't work anymore in 3.77): scripts/features/escape.
|
||||
|
||||
Changes from 0.4.7 to 0.4.8 (May 14, 1998):
|
||||
|
||||
Release by Paul D. Smith <psmith@baynetworks.com>; I'm the one to
|
||||
blame for problems in this version :).
|
||||
|
||||
New tests for features to be included in GNU make 3.77.
|
||||
|
||||
Changes from 0.4.6 to 0.4.7 (August 18, 1997):
|
||||
|
||||
Release by Paul D. Smith <psmith@baynetworks.com>; I'm the one to
|
||||
blame for problems in this version :).
|
||||
|
||||
Reworked some tests to make sure they all work with both perl4 and perl5.
|
||||
|
||||
Work around a bug in perl 5.004 which doesn't clean the environment
|
||||
correctly in all cases (fixed in at least 5.004_02).
|
||||
|
||||
Updated functions/strip to test for newline stripping.
|
||||
|
||||
Keep a $PURIFYOPTIONS env variable if present.
|
||||
|
||||
Changes from 0.4.5 to 0.4.6 (April 07, 1997):
|
||||
|
||||
Release by Paul D. Smith <psmith@baynetworks.com>; I'm the one to
|
||||
blame for problems in this version :).
|
||||
|
||||
Updated to work with GNU make 3.76 (and pretests).
|
||||
|
||||
Added new tests and updated existing ones. Note that the new tests
|
||||
weren't tested with perl 4, however I think they should work.
|
||||
|
||||
Ignore any tests whose filenames end in "~", so that Emacs backup
|
||||
files aren't run.
|
||||
|
||||
Changes from 0.4.4 to 0.4.5 (April 29, 1995):
|
||||
|
||||
Updated to be compatible with perl 5.001 as well as 4.036.
|
||||
|
||||
Note: the test suite still won't work on 14-char filesystems
|
||||
(sorry, Kaveh), but I will get to it.
|
||||
|
||||
Also, some tests and stuff still haven't made it in because I
|
||||
haven't had time to write the test scripts for them. But they,
|
||||
too, will get in eventually. Contributions of scripts (ie, tests
|
||||
that I can just drop in) are particularly welcome and will be
|
||||
incorporated immediately.
|
||||
|
||||
Changes from 0.4.3 to 0.4.4 (March 1995):
|
||||
|
||||
Updated for changes in make 3.72.12, and to ignore CVS directories
|
||||
(thanks go to Jim Meyering for the patches for this).
|
||||
|
||||
Fixed uname call to not make a mess on BSD/OS 2.0 (whose uname -a
|
||||
is very verbose). Let me know if this doesn't work correctly on
|
||||
your system.
|
||||
|
||||
Changed to display test name while it is running, not just when it
|
||||
finishes.
|
||||
|
||||
Note: the test suite still won't work on 14-char filesystems
|
||||
(sorry, Kaveh), but I will get to it.
|
||||
|
||||
Also, some tests and stuff still haven't made it in because I
|
||||
haven't had time to write the test scripts for them. But they,
|
||||
too, will get in eventually.
|
||||
|
||||
Changes from 0.4 to 0.4.3 (October 1994):
|
||||
|
||||
Fixed bugs (like dependencies on environment variables).
|
||||
|
||||
Caught up with changes in make.
|
||||
|
||||
The load_limit test should now silently ignore a failure due to
|
||||
make not being able to read /dev/kmem.
|
||||
|
||||
Reorganized tests into subdirs and renamed lots of things so that
|
||||
those poor souls who still have to deal with 14-char filename
|
||||
limits won't hate me any more. Thanks very much to Kaveh R. Ghazi
|
||||
<ghazi@noc.rutgers.edu> for helping me with the implementation and
|
||||
testing of these changes, and for putting up with all my whining
|
||||
about it...
|
||||
|
||||
Added a $| = 1 so that systems that don't seem to automatically
|
||||
flush their output for some reason will still print all the
|
||||
output. I'd hate for someone to miss out on the smiley that
|
||||
you're supposed to get when all the tests pass... :-)
|
||||
|
||||
Changes from 0.3 to 0.4 (August 1993):
|
||||
|
||||
Lost in the mists of time (and my hurry to get it out before I
|
||||
left my job).
|
||||
|
||||
Changes from 0.2 to 0.3 (9-30-92):
|
||||
|
||||
Several tests fixed to match the fact that MAKELEVEL > 0 or -C now
|
||||
imply -w.
|
||||
|
||||
parallel_execution test fixed to not use double colon rules any
|
||||
more since their behavior has changed.
|
||||
|
||||
errors_in_commands test fixed to handle different error messages
|
||||
and return codes from rm.
|
||||
|
||||
Several tests fixed to handle -make_path with a relative path
|
||||
and/or a name other than "make" for make.
|
||||
|
||||
dash-e-option test fixed to use $PATH instead of $USER (since the
|
||||
latter does not exist on some System V systems). This also
|
||||
removes the dependency on getlogin (which fails under certain
|
||||
weird conditions).
|
||||
|
||||
test_driver_core changed so that you can give a test name like
|
||||
scripts/errors_in_commands and it will be handled correctly (handy
|
||||
if you have a shell with filename completion).
|
||||
|
||||
Changes from 0.1 to 0.2 (5-4-92):
|
||||
|
||||
README corrected to require perl 4.019, not 4.010.
|
||||
|
||||
-make_path replaces -old.
|
||||
|
||||
errors_in_commands test updated for change in format introduced in
|
||||
make 3.62.6.
|
||||
|
||||
test_driver_core now uses a better way of figuring what OS it is
|
||||
running on (thanks to meyering@cs.utexas.edu (Jim Meyering) for
|
||||
suggesting this, as well as discovering the hard way that the old
|
||||
way (testing for /mnt) fails on his machine).
|
||||
|
||||
Some new tests were added.
|
||||
79
tests/README
Normal file
79
tests/README
Normal file
@@ -0,0 +1,79 @@
|
||||
This is release 3.78 (September 6, 1999) of the GNU make test
|
||||
suite. See the file NEWS for some of the changes since the last
|
||||
release.
|
||||
|
||||
This release is made by psmith@gnu.org to correspond to GNU make 3.78.
|
||||
It won't work correctly for versions before that. In addition to some
|
||||
infrastructure changes I've added a number of new tests.
|
||||
|
||||
Rob Tulloh has contributed changes to get the suite running on NT.
|
||||
|
||||
Eli Zaretskii and Esa A E Peuha <peuha@cc.helsinki.fi> have contributed
|
||||
changes to get the suite running on DJGPP/DOS.
|
||||
|
||||
This package has a number of problems which preclude me from
|
||||
distributing it with make as a default "make check" test suite. The
|
||||
most serious of these is that it's not parallelizable: it scribbles all
|
||||
over its installation directory and so can only test one make at a
|
||||
time. I simply don't have time to do more with this than I am so far;
|
||||
I'm very actively interested in finding someone willing to overhaul the
|
||||
test suite infrastructure. If you're interested, contact me (see below)!
|
||||
|
||||
The test suite thus far has been written by Steve McGee, Chris Arthur,
|
||||
and Paul D. Smith. It is covered by the GNU General Public License
|
||||
(Version 2), described in the file COPYING.
|
||||
|
||||
The test suite requires Perl and is known to work with Perl 4.036 and
|
||||
Perl 5.004 (available from ftp.gnu.org, and portable to many machines).
|
||||
Earlier or later versions may work; I don't know. It assumes that the
|
||||
first "diff" it finds is GNU diff, but that only matters if a test
|
||||
fails.
|
||||
|
||||
To run the test suite on a UNIX system, use "perl ./run_make_tests"
|
||||
(or just "./run_make_tests" if you have a perl on your PATH).
|
||||
|
||||
To run the test suite on Windows NT or DOS systems, use
|
||||
"perl.exe ./run_make-tests.pl".
|
||||
|
||||
By default, the test engine picks up the first executable called "make"
|
||||
that it finds in your path. You may use the -make_path option (ie,
|
||||
"perl run_make_tests -make_path /usr/local/src/make-3.78/make") if
|
||||
you want to run a particular copy. This now works correctly with
|
||||
relative paths and when make is called something other than "make" (like
|
||||
"gmake").
|
||||
|
||||
Tests cannot end with a "~" character, as the test suite will ignore any
|
||||
that do (I was tired of having it run my Emacs backup files as test :)
|
||||
|
||||
If you want to run the tests in parallel, you should use the mkshadow
|
||||
script included here to create temporary "copies" (via symbolic links)
|
||||
of the test suite, one for each parallel job. This is a pain and one
|
||||
day maybe the test suite will be rewritten so it's no longer
|
||||
necessary--volunteers welcome!
|
||||
|
||||
Also, sometimes the tests may behave strangely on networked
|
||||
filesystems. You can use mkshadow to create a copy of the test suite in
|
||||
/tmp or similar, and try again. If the error disappears, it's an issue
|
||||
with your network or file server, not GNU make (I believe).
|
||||
|
||||
The options/dash-l test will not really test anything if the copy of
|
||||
make you are using can't obtain the system load. Some systems require
|
||||
make to be setgid sys or kmem for this; if you don't want to install
|
||||
make just to test it, make it setgid to kmem or whatever group /dev/kmem
|
||||
is (ie, "chgrp kmem make;chmod g+s make" as root). In any case, the
|
||||
options/dash-l test should no longer *fail* because make can't read
|
||||
/dev/kmem.
|
||||
|
||||
A directory named "work" will be created when the tests are run which
|
||||
will contain any makefiles and "diff" files of tests that fail so that
|
||||
you may look at them afterward to see the output of make and the
|
||||
expected result.
|
||||
|
||||
There is a -help option which will give you more information about the
|
||||
other possible options for the test suite.
|
||||
|
||||
Any complaints/suggestions/bugs/etc. for the test suite itself (as
|
||||
opposed to problems in make that the suite finds) should be sent to
|
||||
psmith@gnu.org. Enjoy!
|
||||
Paul D. Smith
|
||||
Chris Arthur
|
||||
42
tests/mkshadow
Executable file
42
tests/mkshadow
Executable file
@@ -0,0 +1,42 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Simple script to make a "shadow" test directory, using symbolic links.
|
||||
# Typically you'd put the shadow in /tmp or another local disk
|
||||
#
|
||||
|
||||
case "$1" in
|
||||
"") echo 'Usage: mkshadow <destdir>'; exit 1 ;;
|
||||
esac
|
||||
|
||||
dest="$1"
|
||||
|
||||
if [ ! -d "$dest" ]; then
|
||||
echo "Destination directory \`$dest' must exist!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f run_make_tests ]; then
|
||||
echo "The current directory doesn't appear to contain the test suite!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
suite=`pwd | sed 's%^/tmp_mnt%%'`
|
||||
name=`basename "$suite"`
|
||||
|
||||
files=`echo *`
|
||||
|
||||
set -e
|
||||
|
||||
mkdir "$dest/$name"
|
||||
cd "$dest/$name"
|
||||
|
||||
ln -s "$suite" .testdir
|
||||
|
||||
for f in $files; do
|
||||
ln -s .testdir/$f .
|
||||
done
|
||||
|
||||
rm -rf work
|
||||
|
||||
echo "Shadow test suite created in \`$dest/$name'."
|
||||
exit 0
|
||||
2
tests/run_make_tests
Executable file
2
tests/run_make_tests
Executable file
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
exec perl $0.pl ${1+"$@"}
|
||||
236
tests/run_make_tests.pl
Executable file
236
tests/run_make_tests.pl
Executable file
@@ -0,0 +1,236 @@
|
||||
#!/usr/local/bin/perl
|
||||
# -*-perl-*-
|
||||
|
||||
# Test driver for the Make test suite
|
||||
|
||||
# Usage: run_make_tests [testname]
|
||||
# [-debug]
|
||||
# [-help]
|
||||
# [-verbose]
|
||||
# [-keep]
|
||||
# [-make <make prog>]
|
||||
# (and others)
|
||||
|
||||
require "test_driver.pl";
|
||||
|
||||
sub valid_option
|
||||
{
|
||||
local($option) = @_;
|
||||
if ($option =~ /^-make([-_]?path)?$/)
|
||||
{
|
||||
$make_path = shift @argv;
|
||||
if (!-f $make_path)
|
||||
{
|
||||
print "$option $make_path: Not found.\n";
|
||||
exit 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
# This doesn't work--it _should_! Someone needs to fix this badly.
|
||||
#
|
||||
# elsif ($option =~ /^-work([-_]?dir)?$/)
|
||||
# {
|
||||
# $workdir = shift @argv;
|
||||
# return 1;
|
||||
# }
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
sub run_make_with_options
|
||||
{
|
||||
local ($filename,$options,$logname,$expected_code) = @_;
|
||||
local($code);
|
||||
local($command) = $make_path;
|
||||
|
||||
$expected_code = 0 unless defined($expected_code);
|
||||
|
||||
if ($filename)
|
||||
{
|
||||
$command .= " -f $filename";
|
||||
}
|
||||
|
||||
if ($options)
|
||||
{
|
||||
$command .= " $options";
|
||||
}
|
||||
|
||||
$code = &run_command_with_output($logname,$command);
|
||||
|
||||
# Check to see if we have Purify errors. If so, keep the logfile.
|
||||
# For this to work you need to build with the Purify flag -exit-status=yes
|
||||
|
||||
if ($pure_log && -f $pure_log) {
|
||||
if ($code & 0x7000) {
|
||||
$code &= ~0x7000;
|
||||
|
||||
# If we have a purify log, save it
|
||||
$tn = $pure_testname . ($num_of_logfiles ? ".$num_of_logfiles" : "");
|
||||
print("Renaming purify log file to $tn\n") if $debug;
|
||||
rename($pure_log, "$tn")
|
||||
|| die "Can't rename $log to $tn: $!\n";
|
||||
++$purify_errors;
|
||||
}
|
||||
else {
|
||||
unlink($pure_log);
|
||||
}
|
||||
}
|
||||
|
||||
if ($code != $expected_code)
|
||||
{
|
||||
print "Error running $make_path ($code): $command\n";
|
||||
$test_passed = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ($profile & $vos)
|
||||
{
|
||||
system "add_profile $make_path";
|
||||
}
|
||||
1;
|
||||
}
|
||||
|
||||
sub print_usage
|
||||
{
|
||||
&print_standard_usage ("run_make_tests", "[-make_path make_pathname]");
|
||||
}
|
||||
|
||||
sub print_help
|
||||
{
|
||||
&print_standard_help ("-make_path",
|
||||
"\tYou may specify the pathname of the copy of make to run.");
|
||||
}
|
||||
|
||||
sub get_this_pwd {
|
||||
if ($vos) {
|
||||
$delete_command = "delete_file";
|
||||
$__pwd = `++(current_dir)`;
|
||||
}
|
||||
else {
|
||||
$delete_command = "rm";
|
||||
chop ($__pwd = `pwd`);
|
||||
}
|
||||
|
||||
return $__pwd;
|
||||
}
|
||||
|
||||
sub set_defaults
|
||||
{
|
||||
# $profile = 1;
|
||||
$testee = "GNU make";
|
||||
$make_path = "make";
|
||||
$tmpfilesuffix = "mk";
|
||||
$pwd = &get_this_pwd;
|
||||
}
|
||||
|
||||
sub set_more_defaults
|
||||
{
|
||||
local($string);
|
||||
local($index);
|
||||
|
||||
# Make sure we're in the C locale for those systems that support it,
|
||||
# so sorting, etc. is predictable.
|
||||
#
|
||||
$ENV{LANG} = 'C';
|
||||
|
||||
# find the type of the port. We do this up front to have a single
|
||||
# point of change if it needs to be tweaked.
|
||||
#
|
||||
# This is probably not specific enough.
|
||||
#
|
||||
if ($osname =~ /Windows/i) {
|
||||
$port_type = 'W32';
|
||||
}
|
||||
# Bleah, the osname is so variable on DOS. This kind of bites.
|
||||
# Well, as far as I can tell if we check for some text at the
|
||||
# beginning of the line with either no spaces or a single space, then
|
||||
# a D, then either "OS", "os", or "ev" and a space. That should
|
||||
# match and be pretty specific.
|
||||
elsif ($osname =~ /^([^ ]*|[^ ]* [^ ]*)D(OS|os|ev) /) {
|
||||
$port_type = 'DOS';
|
||||
}
|
||||
# Everything else, right now, is UNIX. Note that we should integrate
|
||||
# the VOS support into this as well and get rid of $vos; we'll do
|
||||
# that next time.
|
||||
else {
|
||||
$port_type = 'UNIX';
|
||||
}
|
||||
|
||||
# On DOS/Windows system the filesystem apparently can't track
|
||||
# timestamps with second granularity (!!). Change the sleep time
|
||||
# needed to force a file to be considered "old".
|
||||
#
|
||||
$wtime = $port_type eq 'UNIX' ? 1 : 4;
|
||||
|
||||
# Find the full pathname of Make. For DOS systems this is more
|
||||
# complicated, so we ask make itself.
|
||||
|
||||
$make_path = `sh -c 'echo "all:;\@echo \\\$(MAKE)" | $make_path -f-'`;
|
||||
chop $make_path;
|
||||
print "Make\t= `$make_path'\n" if $debug;
|
||||
|
||||
$string = `$make_path -v -f /dev/null 2> /dev/null`;
|
||||
|
||||
$string =~ /^(GNU Make [^,\n]*)/;
|
||||
$testee_version = "$1\n";
|
||||
|
||||
$string = `sh -c "$make_path -f /dev/null 2>&1"`;
|
||||
if ($string =~ /(.*): \*\*\* No targets\. Stop\./) {
|
||||
$make_name = $1;
|
||||
}
|
||||
else {
|
||||
if ($make_path =~ /$pathsep([^\n$pathsep]*)$/) {
|
||||
$make_name = $1;
|
||||
}
|
||||
else {
|
||||
$make_name = $make_path;
|
||||
}
|
||||
}
|
||||
|
||||
# prepend pwd if this is a relative path (ie, does not
|
||||
# start with a slash, but contains one). Thanks for the
|
||||
# clue, Roland.
|
||||
|
||||
if (index ($make_path, ":") != 1 && index ($make_path, "/") > 0)
|
||||
{
|
||||
$mkpath = "$pwd$pathsep$make_path";
|
||||
}
|
||||
else
|
||||
{
|
||||
$mkpath = $make_path;
|
||||
}
|
||||
|
||||
# Get Purify log info--if any.
|
||||
|
||||
$ENV{PURIFYOPTIONS} =~ /.*-logfile=([^ ]+)/;
|
||||
$pure_log = $1 || '';
|
||||
$pure_log =~ s/%v/$make_name/;
|
||||
$purify_errors = 0;
|
||||
|
||||
$string = `sh -c "$make_path -j 2 -f /dev/null 2>&1"`;
|
||||
if ($string =~ /not supported/) {
|
||||
$parallel_jobs = 0;
|
||||
}
|
||||
else {
|
||||
$parallel_jobs = 1;
|
||||
}
|
||||
}
|
||||
|
||||
sub setup_for_test
|
||||
{
|
||||
$makefile = &get_tmpfile;
|
||||
if (-f $makefile) {
|
||||
unlink $makefile;
|
||||
}
|
||||
|
||||
# Get rid of any Purify logs.
|
||||
if ($pure_log) {
|
||||
($pure_testname = $testname) =~ tr,/,_,;
|
||||
$pure_testname = "$pure_log.$pure_testname";
|
||||
system("rm -f $pure_testname*");
|
||||
print("Purify testfiles are: $pure_testname*\n") if $debug;
|
||||
}
|
||||
}
|
||||
|
||||
exit !&toplevel;
|
||||
35
tests/scripts/features/comments
Normal file
35
tests/scripts/features/comments
Normal file
@@ -0,0 +1,35 @@
|
||||
$description = "The following test creates a makefile to test comments\n"
|
||||
."and comment continuation to the next line using a \n"
|
||||
."backslash within makefiles.";
|
||||
|
||||
$details = "To test comments within a makefile, a semi-colon was placed \n"
|
||||
."after a comment was started. This should not be reported as\n"
|
||||
."an error since it is within a comment. We then continue the \n"
|
||||
."comment to the next line using a backslash. To test whether\n"
|
||||
."the comment really continued, we place an echo command with some\n"
|
||||
."text on the line which should never execute since it should be \n"
|
||||
."within a comment\n";
|
||||
|
||||
open(MAKEFILE,"> $makefile");
|
||||
|
||||
# The Contents of the MAKEFILE ...
|
||||
|
||||
print MAKEFILE <<\EOF;
|
||||
# Test comment vs semicolon parsing and line continuation
|
||||
target: # this ; is just a comment \
|
||||
@echo This is within a comment.
|
||||
@echo There should be no errors for this makefile.
|
||||
EOF
|
||||
|
||||
# END of Contents of MAKEFILE
|
||||
|
||||
close(MAKEFILE);
|
||||
|
||||
&run_make_with_options($makefile,"",&get_logfile);
|
||||
|
||||
# Create the answer to what should be produced by this Makefile
|
||||
$answer = "There should be no errors for this makefile.\n";
|
||||
|
||||
# COMPARE RESULTS
|
||||
|
||||
&compare_output($answer,&get_logfile(1))
|
||||
67
tests/scripts/features/conditionals
Normal file
67
tests/scripts/features/conditionals
Normal file
@@ -0,0 +1,67 @@
|
||||
# -*-perl-*-
|
||||
$description = "Check GNU make conditionals.";
|
||||
|
||||
$details = "Attempt various different flavors of GNU make conditionals.";
|
||||
|
||||
open(MAKEFILE,"> $makefile");
|
||||
|
||||
# The Contents of the MAKEFILE ...
|
||||
|
||||
print MAKEFILE <<'EOMAKE';
|
||||
objects = foo.obj
|
||||
arg1 = first
|
||||
arg2 = second
|
||||
arg3 = third
|
||||
arg4 = cc
|
||||
arg5 = second
|
||||
|
||||
all:
|
||||
ifeq ($(arg1),$(arg2))
|
||||
@echo arg1 equals arg2
|
||||
else
|
||||
@echo arg1 NOT equal arg2
|
||||
endif
|
||||
|
||||
ifeq '$(arg2)' "$(arg5)"
|
||||
@echo arg2 equals arg5
|
||||
else
|
||||
@echo arg2 NOT equal arg5
|
||||
endif
|
||||
|
||||
ifneq '$(arg3)' '$(arg4)'
|
||||
@echo arg3 NOT equal arg4
|
||||
else
|
||||
@echo arg3 equal arg4
|
||||
endif
|
||||
|
||||
ifndef undefined
|
||||
@echo variable is undefined
|
||||
else
|
||||
@echo variable undefined is defined
|
||||
endif
|
||||
ifdef arg4
|
||||
@echo arg4 is defined
|
||||
else
|
||||
@echo arg4 is NOT defined
|
||||
endif
|
||||
|
||||
EOMAKE
|
||||
|
||||
close(MAKEFILE);
|
||||
|
||||
&run_make_with_options($makefile,"",&get_logfile,0);
|
||||
|
||||
# Create the answer to what should be produced by this Makefile
|
||||
$answer = "arg1 NOT equal arg2
|
||||
arg2 equals arg5
|
||||
arg3 NOT equal arg4
|
||||
variable is undefined
|
||||
arg4 is defined
|
||||
";
|
||||
|
||||
# COMPARE RESULTS
|
||||
|
||||
&compare_output($answer,&get_logfile(1));
|
||||
|
||||
# This tells the test driver that the perl test script executed properly.
|
||||
1;
|
||||
65
tests/scripts/features/default_names
Normal file
65
tests/scripts/features/default_names
Normal file
@@ -0,0 +1,65 @@
|
||||
# -*-perl-*-
|
||||
|
||||
$description = "This script tests to make sure that Make looks for
|
||||
default makefiles in the correct order (GNUmakefile,makefile,Makefile)";
|
||||
|
||||
# Create a makefile called "GNUmakefile"
|
||||
$makefile = "GNUmakefile";
|
||||
|
||||
open(MAKEFILE,"> $makefile");
|
||||
|
||||
print MAKEFILE "FIRST: ; \@echo It chose GNUmakefile\n";
|
||||
|
||||
close(MAKEFILE);
|
||||
|
||||
# DOS/WIN32 platforms preserve case, but Makefile is the same file as makefile.
|
||||
# Just test what we can here (avoid Makefile versus makefile test).
|
||||
#
|
||||
if ($port_type eq 'UNIX')
|
||||
{
|
||||
# Create another makefile called "makefile"
|
||||
open(MAKEFILE,"> makefile");
|
||||
|
||||
print MAKEFILE "SECOND: ; \@echo It chose makefile\n";
|
||||
|
||||
close(MAKEFILE);
|
||||
}
|
||||
|
||||
|
||||
# Create another makefile called "Makefile"
|
||||
open(MAKEFILE,"> Makefile");
|
||||
|
||||
print MAKEFILE "THIRD: ; \@echo It chose Makefile\n";
|
||||
|
||||
close(MAKEFILE);
|
||||
|
||||
|
||||
&run_make_with_options("","",&get_logfile);
|
||||
|
||||
# Create the answer to what should be produced by this Makefile
|
||||
$answer = "It chose GNUmakefile\n";
|
||||
|
||||
# COMPARE RESULTS
|
||||
|
||||
&compare_output($answer,&get_logfile(1)) || &error("abort");
|
||||
unlink $makefile;
|
||||
|
||||
# DOS/WIN32 platforms preserve case, but Makefile is the same file as makefile.
|
||||
# Just test what we can here (avoid Makefile versus makefile test).
|
||||
#
|
||||
if ($port_type eq 'UNIX')
|
||||
{
|
||||
$answer = "It chose makefile\n";
|
||||
|
||||
&run_make_with_options("","",&get_logfile);
|
||||
|
||||
&compare_output($answer,&get_logfile(1)) || &error("abort");
|
||||
unlink "makefile";
|
||||
}
|
||||
|
||||
$answer = "It chose Makefile\n";
|
||||
|
||||
&run_make_with_options("","",&get_logfile);
|
||||
|
||||
&compare_output($answer,&get_logfile(1)) || &error("abort");
|
||||
unlink "Makefile";
|
||||
117
tests/scripts/features/double_colon
Normal file
117
tests/scripts/features/double_colon
Normal file
@@ -0,0 +1,117 @@
|
||||
# -*-perl-*-
|
||||
$description = "Test handling of double-colon rules.";
|
||||
|
||||
$details = "\
|
||||
We test these features:
|
||||
|
||||
- Multiple commands for the same (double-colon) target
|
||||
- Different prerequisites for targets: only out-of-date
|
||||
ones are rebuilt.
|
||||
- Double-colon targets that aren't the goal target.
|
||||
|
||||
Then we do the same thing for parallel builds: double-colon
|
||||
targets should always be built serially.";
|
||||
|
||||
# The Contents of the MAKEFILE ...
|
||||
|
||||
open(MAKEFILE,"> $makefile");
|
||||
|
||||
print MAKEFILE <<'EOF';
|
||||
|
||||
all: baz
|
||||
|
||||
foo:: f1.h ; @echo foo FIRST
|
||||
foo:: f2.h ; @echo foo SECOND
|
||||
|
||||
bar:: ; @echo aaa; sleep 1; echo aaa done
|
||||
bar:: ; @echo bbb
|
||||
|
||||
baz:: ; @echo aaa
|
||||
baz:: ; @echo bbb
|
||||
|
||||
biz:: ; @echo aaa
|
||||
biz:: two ; @echo bbb
|
||||
|
||||
two: ; @echo two
|
||||
|
||||
f1.h f2.h: ; @echo $@
|
||||
|
||||
d :: ; @echo ok
|
||||
d :: d ; @echo oops
|
||||
|
||||
EOF
|
||||
|
||||
close(MAKEFILE);
|
||||
|
||||
# TEST 0: A simple double-colon rule that isn't the goal target.
|
||||
|
||||
&run_make_with_options($makefile, "all", &get_logfile, 0);
|
||||
$answer = "aaa\nbbb\n";
|
||||
&compare_output($answer, &get_logfile(1));
|
||||
|
||||
# TEST 1: As above, in parallel
|
||||
|
||||
&run_make_with_options($makefile, "-j10 all", &get_logfile, 0);
|
||||
$answer = "aaa\nbbb\n";
|
||||
&compare_output($answer, &get_logfile(1));
|
||||
|
||||
# TEST 2: A simple double-colon rule that is the goal target
|
||||
|
||||
&run_make_with_options($makefile, "bar", &get_logfile, 0);
|
||||
$answer = "aaa\naaa done\nbbb\n";
|
||||
&compare_output($answer, &get_logfile(1));
|
||||
|
||||
# TEST 3: As above, in parallel
|
||||
|
||||
&run_make_with_options($makefile, "-j10 bar", &get_logfile, 0);
|
||||
$answer = "aaa\naaa done\nbbb\n";
|
||||
&compare_output($answer, &get_logfile(1));
|
||||
|
||||
# TEST 4: Each double-colon rule is supposed to be run individually
|
||||
|
||||
&touch('f2.h');
|
||||
&touch('foo');
|
||||
|
||||
&run_make_with_options($makefile, "foo", &get_logfile, 0);
|
||||
$answer = "f1.h\nfoo FIRST\n";
|
||||
&compare_output($answer, &get_logfile(1));
|
||||
|
||||
# TEST 5: Again, in parallel.
|
||||
|
||||
&run_make_with_options($makefile, "-j10 foo", &get_logfile, 0);
|
||||
$answer = "f1.h\nfoo FIRST\n";
|
||||
&compare_output($answer, &get_logfile(1));
|
||||
|
||||
# TEST 6: Each double-colon rule is supposed to be run individually
|
||||
|
||||
&touch('f1.h');
|
||||
unlink('f2.h');
|
||||
&touch('foo');
|
||||
|
||||
&run_make_with_options($makefile, "foo", &get_logfile, 0);
|
||||
$answer = "f2.h\nfoo SECOND\n";
|
||||
&compare_output($answer, &get_logfile(1));
|
||||
|
||||
# TEST 7: Again, in parallel.
|
||||
|
||||
&run_make_with_options($makefile, "-j10 foo", &get_logfile, 0);
|
||||
$answer = "f2.h\nfoo SECOND\n";
|
||||
&compare_output($answer, &get_logfile(1));
|
||||
|
||||
# TEST 8: Test circular dependency check; PR/1671
|
||||
|
||||
&run_make_with_options($makefile, "d", &get_logfile, 0);
|
||||
$answer = "ok\n$make_name: Circular d <- d dependency dropped.\noops\n";
|
||||
&compare_output($answer, &get_logfile(1));
|
||||
|
||||
# TEST 8: I don't grok why this is different than the above, but it is...
|
||||
#
|
||||
# Hmm... further testing indicates this might be timing-dependent?
|
||||
#
|
||||
#&run_make_with_options($makefile, "-j10 biz", &get_logfile, 0);
|
||||
#$answer = "aaa\ntwo\nbbb\n";
|
||||
#&compare_output($answer, &get_logfile(1));
|
||||
|
||||
unlink('foo','f1.h','f2.h');
|
||||
|
||||
1;
|
||||
90
tests/scripts/features/echoing
Normal file
90
tests/scripts/features/echoing
Normal file
@@ -0,0 +1,90 @@
|
||||
$description = "The following test creates a makefile to test command \n"
|
||||
."echoing. It tests that when a command line starts with \n"
|
||||
."a '\@', the echoing of that line is suppressed. It also \n"
|
||||
."tests the -n option which tells make to ONLY echo the \n"
|
||||
."commands and no execution happens. In this case, even \n"
|
||||
."the commands with '\@' are printed. Lastly, it tests the \n"
|
||||
."-s flag which tells make to prevent all echoing, as if \n"
|
||||
."all commands started with a '\@'.";
|
||||
|
||||
$details = "This test is similar to the 'clean' test except that a '\@' has\n"
|
||||
."been placed in front of the delete command line. Four tests \n"
|
||||
."are run here. First, make is run normally and the first echo\n"
|
||||
."command should be executed. In this case there is no '\@' so \n"
|
||||
."we should expect make to display the command AND display the \n"
|
||||
."echoed message. Secondly, make is run with the clean target, \n"
|
||||
."but since there is a '\@' at the beginning of the command, we\n"
|
||||
."expect no output; just the deletion of a file which we check \n"
|
||||
."for. Third, we give the clean target again except this time\n"
|
||||
."we give make the -n option. We now expect the command to be \n"
|
||||
."displayed but not to be executed. In this case we need only \n"
|
||||
."to check the output since an error message would be displayed\n"
|
||||
."if it actually tried to run the delete command again and the \n"
|
||||
."file didn't exist. Lastly, we run the first test again with \n"
|
||||
."the -s option and check that make did not echo the echo \n"
|
||||
."command before printing the message.";
|
||||
|
||||
$example = "EXAMPLE_FILE";
|
||||
|
||||
open(MAKEFILE,"> $makefile");
|
||||
|
||||
# The Contents of the MAKEFILE ...
|
||||
|
||||
print MAKEFILE "all: \n";
|
||||
print MAKEFILE "\techo This makefile did not clean the dir... good\n";
|
||||
print MAKEFILE "clean: \n";
|
||||
print MAKEFILE "\t\@$delete_command $example\n";
|
||||
|
||||
# END of Contents of MAKEFILE
|
||||
|
||||
close(MAKEFILE);
|
||||
|
||||
&touch($example);
|
||||
|
||||
# TEST #1
|
||||
# -------
|
||||
|
||||
&run_make_with_options($makefile,"",&get_logfile,0);
|
||||
$answer = "echo This makefile did not clean the dir... good\n"
|
||||
."This makefile did not clean the dir... good\n";
|
||||
&compare_output($answer,&get_logfile(1));
|
||||
|
||||
|
||||
# TEST #2
|
||||
# -------
|
||||
|
||||
&run_make_with_options($makefile,"clean",&get_logfile,0);
|
||||
$answer = "";
|
||||
&compare_output($answer,&get_logfile(1));
|
||||
|
||||
if (-f $example)
|
||||
{
|
||||
$test_passed = 0;
|
||||
}
|
||||
|
||||
# TEST #3
|
||||
# -------
|
||||
|
||||
&run_make_with_options($makefile,"-n clean",&get_logfile,0);
|
||||
$answer = "$delete_command $example\n";
|
||||
&compare_output($answer,&get_logfile(1));
|
||||
|
||||
|
||||
# TEST #4
|
||||
# -------
|
||||
|
||||
&run_make_with_options($makefile,"-s",&get_logfile,0);
|
||||
$answer = "This makefile did not clean the dir... good\n";
|
||||
&compare_output($answer,&get_logfile(1));
|
||||
|
||||
|
||||
1;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
93
tests/scripts/features/errors
Normal file
93
tests/scripts/features/errors
Normal file
@@ -0,0 +1,93 @@
|
||||
$description = "The following tests the -i option and the '-' in front of \n"
|
||||
."commands to test that make ignores errors in these commands\n"
|
||||
."and continues processing.";
|
||||
|
||||
$details = "This test runs two makes. The first runs on a target with a \n"
|
||||
."command that has a '-' in front of it (and a command that is \n"
|
||||
."intended to fail) and then a delete command after that is \n"
|
||||
."intended to succeed. If make ignores the failure of the first\n"
|
||||
."command as it is supposed to, then the second command should \n"
|
||||
."delete a file and this is what we check for. The second make\n"
|
||||
."that is run in this test is identical except that the make \n"
|
||||
."command is given with the -i option instead of the '-' in \n"
|
||||
."front of the command. They should run the same. ";
|
||||
|
||||
if ($vos)
|
||||
{
|
||||
$delete_command = "delete_file";
|
||||
}
|
||||
else
|
||||
{
|
||||
$delete_command = "rm";
|
||||
}
|
||||
|
||||
open(MAKEFILE,"> $makefile");
|
||||
|
||||
# The Contents of the MAKEFILE ...
|
||||
|
||||
print MAKEFILE "clean:\n"
|
||||
."\t-$delete_command cleanit\n"
|
||||
."\t$delete_command foo\n"
|
||||
."clean2: \n"
|
||||
."\t$delete_command cleanit\n"
|
||||
."\t$delete_command foo\n";
|
||||
|
||||
# END of Contents of MAKEFILE
|
||||
|
||||
close(MAKEFILE);
|
||||
|
||||
&touch("foo");
|
||||
|
||||
unlink("cleanit");
|
||||
$cleanit_error = `sh -c "$delete_command cleanit 2>&1"`;
|
||||
$delete_error_code = $? >> 8;
|
||||
|
||||
# TEST #1
|
||||
# -------
|
||||
|
||||
$answer = "$delete_command cleanit\n"
|
||||
. $cleanit_error
|
||||
."$make_name: [clean] Error $delete_error_code (ignored)\n"
|
||||
."$delete_command foo\n";
|
||||
|
||||
&run_make_with_options($makefile,"",&get_logfile);
|
||||
|
||||
# The output for this on VOS is too hard to replicate, so we only check it
|
||||
# on unix.
|
||||
if (!$vos)
|
||||
{
|
||||
&compare_output($answer,&get_logfile(1));
|
||||
}
|
||||
|
||||
# If make acted as planned, it should ignore the error from the first
|
||||
# command in the target and execute the second which deletes the file "foo"
|
||||
# This file, therefore, should not exist if the test PASSES.
|
||||
if (-f "foo")
|
||||
{
|
||||
$test_passed = 0;
|
||||
}
|
||||
|
||||
|
||||
&touch("foo");
|
||||
|
||||
# TEST #2
|
||||
# -------
|
||||
|
||||
$answer = "$delete_command cleanit\n"
|
||||
. $cleanit_error
|
||||
."$make_name: [clean2] Error $delete_error_code (ignored)\n"
|
||||
."$delete_command foo\n";
|
||||
|
||||
&run_make_with_options($makefile,"clean2 -i",&get_logfile);
|
||||
|
||||
if (!$vos)
|
||||
{
|
||||
&compare_output($answer,&get_logfile(1));
|
||||
}
|
||||
|
||||
if (-f "foo")
|
||||
{
|
||||
$test_passed = 0;
|
||||
}
|
||||
|
||||
1;
|
||||
50
tests/scripts/features/escape
Normal file
50
tests/scripts/features/escape
Normal file
@@ -0,0 +1,50 @@
|
||||
# -*-perl-*-
|
||||
$description = "Test various types of escaping in makefiles.";
|
||||
|
||||
$details = "\
|
||||
Make sure that escaping of `:' works in target names.
|
||||
Also make sure escaping of whitespace works in target names";
|
||||
|
||||
open(MAKEFILE,"> $makefile");
|
||||
|
||||
print MAKEFILE <<'EOF';
|
||||
$(path)foo : ; @echo cp $^ $@
|
||||
|
||||
foo\ bar: ; @echo 'touch "$@"'
|
||||
EOF
|
||||
|
||||
close(MAKEFILE);
|
||||
|
||||
|
||||
# TEST 1
|
||||
|
||||
&run_make_with_options($makefile, "", &get_logfile);
|
||||
$answer = "cp foo\n";
|
||||
&compare_output($answer,&get_logfile(1));
|
||||
|
||||
# TEST 2: This one should fail, since the ":" is unquoted.
|
||||
|
||||
&run_make_with_options($makefile, "path=p:", &get_logfile, 512);
|
||||
$answer = "$makefile:1: *** target pattern contains no `%'. Stop.\n";
|
||||
&compare_output($answer,&get_logfile(1));
|
||||
|
||||
# TEST 3: This one should work, since we escape the ":".
|
||||
|
||||
&run_make_with_options($makefile, "'path=p\\:'", &get_logfile, 0);
|
||||
$answer = "cp p:foo\n";
|
||||
&compare_output($answer,&get_logfile(1));
|
||||
|
||||
# TEST 4: This one should fail, since the escape char is escaped.
|
||||
|
||||
&run_make_with_options($makefile, "'path=p\\\\:'", &get_logfile, 512);
|
||||
$answer = "$makefile:1: *** target pattern contains no `%'. Stop.\n";
|
||||
&compare_output($answer,&get_logfile(1));
|
||||
|
||||
# TEST 5: This one should work
|
||||
|
||||
&run_make_with_options($makefile, "'foo bar'", &get_logfile, 0);
|
||||
$answer = "touch \"foo bar\"\n";
|
||||
&compare_output($answer,&get_logfile(1));
|
||||
|
||||
# This tells the test driver that the perl test script executed properly.
|
||||
1;
|
||||
61
tests/scripts/features/include
Normal file
61
tests/scripts/features/include
Normal file
@@ -0,0 +1,61 @@
|
||||
# -*-mode: perl; rm-trailing-spaces: nil-*-
|
||||
|
||||
$description = "Test various forms of the GNU make `include' command.";
|
||||
|
||||
$details = "Test include, -include, sinclude and various regressions involving them.
|
||||
Test extra whitespace at the end of the include, multiple -includes and
|
||||
sincludes (should not give an error) and make sure that errors are reported
|
||||
for targets that were also -included.";
|
||||
|
||||
$makefile2 = &get_tmpfile;
|
||||
|
||||
open(MAKEFILE,"> $makefile");
|
||||
|
||||
# The contents of the Makefile ...
|
||||
|
||||
print MAKEFILE <<EOF;
|
||||
\#Extra space at the end of the following file name
|
||||
include $makefile2
|
||||
all: ; \@echo There should be no errors for this makefile.
|
||||
|
||||
-include nonexistent.mk
|
||||
-include nonexistent.mk
|
||||
sinclude nonexistent.mk
|
||||
sinclude nonexistent-2.mk
|
||||
-include makeit.mk
|
||||
sinclude makeit.mk
|
||||
|
||||
error: makeit.mk
|
||||
EOF
|
||||
|
||||
close(MAKEFILE);
|
||||
|
||||
|
||||
open(MAKEFILE,"> $makefile2");
|
||||
|
||||
print MAKEFILE "ANOTHER: ; \@echo This is another included makefile\n";
|
||||
|
||||
close(MAKEFILE);
|
||||
|
||||
# Create the answer to what should be produced by this Makefile
|
||||
&run_make_with_options($makefile, "all", &get_logfile);
|
||||
$answer = "There should be no errors for this makefile.\n";
|
||||
&compare_output($answer, &get_logfile(1));
|
||||
|
||||
&run_make_with_options($makefile, "ANOTHER", &get_logfile);
|
||||
$answer = "This is another included makefile\n";
|
||||
&compare_output($answer, &get_logfile(1));
|
||||
|
||||
# Try to build the "error" target; this will fail since we don't know
|
||||
# how to create makeit.mk, but we should also get a message (even though
|
||||
# the -include suppressed it during the makefile read phase, we should
|
||||
# see one during the makefile run phase).
|
||||
|
||||
# The fix to this caused more problems than the error, so I removed it.
|
||||
# pds -- 22 Jan 2000
|
||||
|
||||
#&run_make_with_options($makefile, "error", &get_logfile, 512);
|
||||
#$answer = "$make_name: *** No rule to make target `makeit.mk', needed by `error'.\n";
|
||||
#&compare_output($answer, &get_logfile(1));
|
||||
|
||||
1;
|
||||
78
tests/scripts/features/mult_rules
Normal file
78
tests/scripts/features/mult_rules
Normal file
@@ -0,0 +1,78 @@
|
||||
$description = "\
|
||||
The following test creates a makefile to test the presence
|
||||
of multiple rules for one target. One file can be the
|
||||
target of several rules if at most one rule has commands;
|
||||
the other rules can only have dependencies.";
|
||||
|
||||
$details = "\
|
||||
The makefile created in this test contains two hardcoded rules
|
||||
for foo.o and bar.o. It then gives another multiple target rule
|
||||
with the same names as above but adding more dependencies.
|
||||
Additionally, another variable extradeps is listed as a
|
||||
dependency but is defined to be null. It can however be defined
|
||||
on the make command line as extradeps=extra.h which adds yet
|
||||
another dependency to the targets.";
|
||||
|
||||
open(MAKEFILE,"> $makefile");
|
||||
|
||||
# The Contents of the MAKEFILE ...
|
||||
|
||||
print MAKEFILE <<EOF;
|
||||
objects = foo.o bar.o
|
||||
foo.o : defs.h
|
||||
bar.o : defs.h test.h
|
||||
extradeps =
|
||||
\$(objects) : config.h \$(extradeps)
|
||||
\t\@echo EXTRA EXTRA
|
||||
EOF
|
||||
|
||||
# END of Contents of MAKEFILE
|
||||
|
||||
close(MAKEFILE);
|
||||
|
||||
&touch("defs.h","test.h","config.h");
|
||||
|
||||
if ($vos)
|
||||
{
|
||||
$error_code = 3307;
|
||||
}
|
||||
else
|
||||
{
|
||||
$error_code = 512;
|
||||
}
|
||||
|
||||
&run_make_with_options($makefile,
|
||||
"extradeps=extra.h",
|
||||
&get_logfile,
|
||||
$error_code);
|
||||
|
||||
# Create the answer to what should be produced by this Makefile
|
||||
$answer = "$make_name: *** No rule to make target `extra.h', needed by `foo.o'. Stop.\n";
|
||||
|
||||
&compare_output($answer,&get_logfile(1));
|
||||
|
||||
|
||||
# TEST #2
|
||||
# -------
|
||||
|
||||
&touch("extra.h");
|
||||
|
||||
&run_make_with_options($makefile,
|
||||
"extradeps=extra.h",
|
||||
&get_logfile,
|
||||
0);
|
||||
|
||||
# Create the answer to what should be produced by this Makefile
|
||||
$answer = "EXTRA EXTRA\n";
|
||||
|
||||
&compare_output($answer,&get_logfile(1));
|
||||
|
||||
unlink("defs.h","test.h","config.h","extra.h");
|
||||
|
||||
1;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
46
tests/scripts/features/mult_targets
Normal file
46
tests/scripts/features/mult_targets
Normal file
@@ -0,0 +1,46 @@
|
||||
$description = "The following test creates a makefile to test that a \n "
|
||||
."rule with multiple targets is equivalent to writing \n"
|
||||
."many rules, each with one target, and all identical aside\n"
|
||||
."from that.";
|
||||
|
||||
$details = "A makefile is created with one rule and two targets. Make \n"
|
||||
."is called twice, once for each target, and the output which \n"
|
||||
."contains the target name with \$@ is looked at for the changes.\n"
|
||||
."This test also tests the substitute function by replacing \n"
|
||||
."the word output with nothing in the target name giving either\n"
|
||||
."an output of \"I am little\" or \"I am big\"";
|
||||
|
||||
open(MAKEFILE,"> $makefile");
|
||||
|
||||
# The Contents of the MAKEFILE ...
|
||||
|
||||
print MAKEFILE "bigoutput littleoutput: test.h\n";
|
||||
print MAKEFILE "\t\@echo I am \$(subst output,,\$@)\n";
|
||||
|
||||
# END of Contents of MAKEFILE
|
||||
|
||||
close(MAKEFILE);
|
||||
|
||||
&touch("test.h");
|
||||
|
||||
&run_make_with_options($makefile,"bigoutput",&get_logfile);
|
||||
|
||||
|
||||
# Create the answer to what should be produced by this Makefile
|
||||
$answer = "I am big\n";
|
||||
|
||||
&compare_output($answer,&get_logfile(1));
|
||||
|
||||
&run_make_with_options($makefile,"littleoutput",&get_logfile);
|
||||
$answer = "I am little\n";
|
||||
&compare_output($answer,&get_logfile(1));
|
||||
|
||||
unlink "test.h";
|
||||
|
||||
1;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
34
tests/scripts/features/override
Normal file
34
tests/scripts/features/override
Normal file
@@ -0,0 +1,34 @@
|
||||
$description = "The following test creates a makefile to ...";
|
||||
|
||||
$details = "";
|
||||
|
||||
open(MAKEFILE,"> $makefile");
|
||||
|
||||
# The Contents of the MAKEFILE ...
|
||||
|
||||
print MAKEFILE "override define foo\n"
|
||||
."\@echo First comes the definition.\n"
|
||||
."\@echo Then comes the override.\n"
|
||||
."endef\n"
|
||||
."all: \n"
|
||||
."\t\$(foo)\n";
|
||||
|
||||
# END of Contents of MAKEFILE
|
||||
|
||||
close(MAKEFILE);
|
||||
|
||||
&run_make_with_options($makefile,"foo=Hello",&get_logfile);
|
||||
|
||||
# Create the answer to what should be produced by this Makefile
|
||||
$answer = "First comes the definition.\n"
|
||||
."Then comes the override.\n";
|
||||
|
||||
&compare_output($answer,&get_logfile(1));
|
||||
|
||||
1;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
100
tests/scripts/features/parallelism
Normal file
100
tests/scripts/features/parallelism
Normal file
@@ -0,0 +1,100 @@
|
||||
# -*-perl-*-
|
||||
|
||||
$description = "Test parallelism (-j) option.";
|
||||
|
||||
|
||||
$details = "This test creates a makefile with two double-colon default
|
||||
rules. The first rule has a series of sleep and echo commands
|
||||
intended to run in series. The second and third have just an
|
||||
echo statement. When make is called in this test, it is given
|
||||
the -j option with a value of 4. This tells make that it may
|
||||
start up to four jobs simultaneously. In this case, since the
|
||||
first command is a sleep command, the output of the second
|
||||
and third commands will appear before the first if indeed
|
||||
make is running all of these commands in parallel.";
|
||||
|
||||
if (!$parallel_jobs) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ($vos) {
|
||||
$delete_command = "delete_file -no_ask";
|
||||
$sleep_command = "sleep -seconds";
|
||||
}
|
||||
else {
|
||||
$delete_command = "rm -f";
|
||||
$sleep_command = "sleep";
|
||||
}
|
||||
|
||||
open(MAKEFILE,"> $makefile");
|
||||
|
||||
print MAKEFILE <<"EOF";
|
||||
all : def_1 def_2 def_3
|
||||
def_1 : ; \@echo ONE; $sleep_command 3 ; echo TWO
|
||||
def_2 : ; \@$sleep_command 2 ; echo THREE
|
||||
def_3 : ; \@$sleep_command 1 ; echo FOUR
|
||||
EOF
|
||||
|
||||
close(MAKEFILE);
|
||||
|
||||
&run_make_with_options($makefile, "-j 4", &get_logfile);
|
||||
$answer = "ONE\nFOUR\nTHREE\nTWO\n";
|
||||
&compare_output($answer, &get_logfile(1));
|
||||
|
||||
|
||||
# Test parallelism with included files. Here we sleep/echo while
|
||||
# building the included files, to test that they are being built in
|
||||
# parallel.
|
||||
|
||||
$makefile2 = &get_tmpfile;
|
||||
|
||||
open(MAKEFILE,"> $makefile2");
|
||||
|
||||
print MAKEFILE <<"EOF";
|
||||
all: 1 2; \@echo success
|
||||
|
||||
-include 1.inc 2.inc
|
||||
|
||||
1.inc: ; \@echo ONE.inc; $sleep_command 2; echo TWO.inc; echo "1: ; \@echo ONE; $sleep_command 2; echo TWO" > \$\@
|
||||
2.inc: ; \@$sleep_command 1; echo THREE.inc; echo "2: ; \@$sleep_command 1; echo THREE" > \$\@
|
||||
EOF
|
||||
|
||||
close(MAKEFILE);
|
||||
|
||||
&run_make_with_options("$makefile2", "-j 4", &get_logfile);
|
||||
$answer = "ONE.inc\nTHREE.inc\nTWO.inc\nONE\nTHREE\nTWO\nsuccess\n";
|
||||
&compare_output($answer, &get_logfile(1));
|
||||
|
||||
unlink('1.inc', '2.inc');
|
||||
|
||||
|
||||
# Test parallelism with included files--this time recurse first and make
|
||||
# sure the jobserver works.
|
||||
|
||||
$makefile3 = &get_tmpfile;
|
||||
|
||||
open(MAKEFILE,"> $makefile3");
|
||||
|
||||
print MAKEFILE <<"EOF";
|
||||
recurse: ; \@\$(MAKE) --no-print-directory -f $makefile3 INC=yes all
|
||||
|
||||
all: 1 2; \@echo success
|
||||
|
||||
INC = no
|
||||
ifeq (\$(INC),yes)
|
||||
-include 1.inc 2.inc
|
||||
endif
|
||||
|
||||
1.inc: ; \@echo ONE.inc; $sleep_command 2; echo TWO.inc; echo "1: ; \@echo ONE; $sleep_command 2; echo TWO" > \$\@
|
||||
2.inc: ; \@$sleep_command 1; echo THREE.inc; echo "2: ; \@$sleep_command 1; echo THREE" > \$\@
|
||||
EOF
|
||||
|
||||
close(MAKEFILE);
|
||||
|
||||
&run_make_with_options("$makefile3", "-j 4", &get_logfile);
|
||||
$answer = "ONE.inc\nTHREE.inc\nTWO.inc\nONE\nTHREE\nTWO\nsuccess\n";
|
||||
&compare_output($answer, &get_logfile(1));
|
||||
|
||||
unlink('1.inc', '2.inc');
|
||||
|
||||
1;
|
||||
49
tests/scripts/features/patspecific_vars
Normal file
49
tests/scripts/features/patspecific_vars
Normal file
@@ -0,0 +1,49 @@
|
||||
# -*-perl-*-
|
||||
$description = "Test pattern-specific variable settings.";
|
||||
|
||||
$details = "\
|
||||
Create a makefile containing various flavors of pattern-specific variable
|
||||
settings, override and non-override, and using various variable expansion
|
||||
rules, semicolon interference, etc.";
|
||||
|
||||
open(MAKEFILE,"> $makefile");
|
||||
|
||||
print MAKEFILE <<'EOF';
|
||||
all: one.x two.x three.x
|
||||
FOO = foo
|
||||
BAR = bar
|
||||
BAZ = baz
|
||||
thr% : override BAZ = three
|
||||
t%.x: BAR = four
|
||||
%.x: BAR = two
|
||||
%.x: override BAZ = three
|
||||
one.x: override FOO = one
|
||||
one.x two.x three.x: ; @echo $(FOO) $(BAR) $(BAZ)
|
||||
four.x: baz ; @echo $(FOO) $(BAR) $(BAZ)
|
||||
baz: ; @echo $(FOO) $(BAR) $(BAZ)
|
||||
EOF
|
||||
|
||||
close(MAKEFILE);
|
||||
|
||||
|
||||
# TEST #1 -- basics
|
||||
|
||||
&run_make_with_options($makefile, "", &get_logfile);
|
||||
$answer = "one two three\nfoo four baz\nfoo bar three\n";
|
||||
&compare_output($answer,&get_logfile(1));
|
||||
|
||||
|
||||
# TEST #2 -- try the override feature
|
||||
|
||||
&run_make_with_options($makefile, "BAZ=five", &get_logfile);
|
||||
$answer = "one two three\nfoo four five\nfoo bar three\n";
|
||||
&compare_output($answer,&get_logfile(1));
|
||||
|
||||
|
||||
# TEST #3 -- make sure patterns are inherited properly
|
||||
|
||||
&run_make_with_options($makefile, "four.x", &get_logfile);
|
||||
$answer = "foo two three\nfoo two three\n";
|
||||
&compare_output($answer,&get_logfile(1));
|
||||
|
||||
1;
|
||||
32
tests/scripts/features/quoting
Normal file
32
tests/scripts/features/quoting
Normal file
@@ -0,0 +1,32 @@
|
||||
# -*-perl-*-
|
||||
|
||||
$description = "The following test creates a makefile to test using \n" .
|
||||
"quotes within makefiles.";
|
||||
|
||||
open(MAKEFILE,"> $makefile");
|
||||
|
||||
# The Contents of the MAKEFILE ...
|
||||
|
||||
print MAKEFILE <<'EOM';
|
||||
SHELL = /bin/sh
|
||||
TEXFONTS = NICEFONT
|
||||
DEFINES = -DDEFAULT_TFM_PATH=\".:$(TEXFONTS)\"
|
||||
test: ; @"echo" 'DEFINES = $(DEFINES)'
|
||||
EOM
|
||||
|
||||
# END of Contents of MAKEFILE
|
||||
|
||||
close(MAKEFILE);
|
||||
|
||||
|
||||
&run_make_with_options($makefile,"",&get_logfile);
|
||||
|
||||
|
||||
# Create the answer to what should be produced by this Makefile
|
||||
$answer = 'DEFINES = -DDEFAULT_TFM_PATH=\".:NICEFONT\"' . "\n";
|
||||
|
||||
# COMPARE RESULTS
|
||||
|
||||
&compare_output($answer,&get_logfile(1));
|
||||
|
||||
1;
|
||||
61
tests/scripts/features/recursion
Normal file
61
tests/scripts/features/recursion
Normal file
@@ -0,0 +1,61 @@
|
||||
# -*-perl-*-
|
||||
$description = "The following test creates a makefile to ...\n";
|
||||
|
||||
$details = "DETAILS";
|
||||
|
||||
open(MAKEFILE,"> $makefile");
|
||||
|
||||
# The Contents of the MAKEFILE ...
|
||||
|
||||
print MAKEFILE "all: \n"
|
||||
."\t\$(MAKE) -f $makefile foo \n"
|
||||
."foo: \n"
|
||||
."\t\@echo \$(MAKE) \n"
|
||||
."\t\@echo MAKELEVEL = \$(MAKELEVEL)\n"
|
||||
."\t\$(MAKE) -f $makefile last \n"
|
||||
."last: \n"
|
||||
."\t\@echo \$(MAKE) \n"
|
||||
."\t\@echo MAKELEVEL = \$(MAKELEVEL) \n"
|
||||
."\t\@echo THE END\n";
|
||||
|
||||
# END of Contents of MAKEFILE
|
||||
|
||||
close(MAKEFILE);
|
||||
|
||||
if ($vos)
|
||||
{
|
||||
$answer = "$make_name: Entering directory \`$pwd\'\n"
|
||||
."make 'CFLAGS=-O' -f $makefile foo \n"
|
||||
."make CFLAGS=-O\n"
|
||||
."MAKELEVEL = 0\n"
|
||||
."make 'CFLAGS=-O' -f $makefile last \n"
|
||||
."make CFLAGS=-O\n"
|
||||
."MAKELEVEL = 0\n"
|
||||
."THE END\n"
|
||||
."$make_name: Leaving directory `$pwd'\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$answer = "$make_name: Entering directory `$pwd'\n"
|
||||
."$mkpath -f $makefile foo \n"
|
||||
."${make_name}[1]: Entering directory `$pwd'\n"
|
||||
."$mkpath\n"
|
||||
."MAKELEVEL = 1\n"
|
||||
."$mkpath -f $makefile last \n"
|
||||
."${make_name}[2]: Entering directory `$pwd'\n"
|
||||
."$mkpath\n"
|
||||
."MAKELEVEL = 2\n"
|
||||
."THE END\n"
|
||||
."${make_name}[2]: Leaving directory `$pwd'\n"
|
||||
."${make_name}[1]: Leaving directory `$pwd'\n"
|
||||
."$make_name: Leaving directory `$pwd'\n";
|
||||
}
|
||||
|
||||
$mkoptions = "CFLAGS=-O -w";
|
||||
$mkoptions .= " -j 2" if ($parallel_jobs);
|
||||
|
||||
&run_make_with_options($makefile,$mkoptions,&get_logfile,0);
|
||||
|
||||
&compare_output($answer,&get_logfile(1));
|
||||
|
||||
1;
|
||||
92
tests/scripts/features/reinvoke
Normal file
92
tests/scripts/features/reinvoke
Normal file
@@ -0,0 +1,92 @@
|
||||
# -*-mode: perl-*-
|
||||
|
||||
$description = "Test GNU make's auto-reinvocation feature.";
|
||||
|
||||
$details = "\
|
||||
If the makefile or one it includes can be rebuilt then it is, and make
|
||||
is reinvoked. We create a rule to rebuild the makefile from a temp
|
||||
file, then touch the temp file to make it newer than the makefile.";
|
||||
|
||||
$makefile2 = &get_tmpfile;
|
||||
$makefile_orig = &get_tmpfile;
|
||||
|
||||
open(MAKEFILE,"> $makefile");
|
||||
|
||||
print MAKEFILE <<EOM;
|
||||
|
||||
all: ; \@echo 'running rules.'
|
||||
|
||||
$makefile $makefile2: $makefile_orig
|
||||
\@echo 'rebuilding \$\@.'
|
||||
\@echo >> \$\@
|
||||
|
||||
include $makefile2
|
||||
|
||||
EOM
|
||||
|
||||
close(MAKEFILE);
|
||||
|
||||
&touch($makefile2);
|
||||
|
||||
# Sleep 2 seconds for DOS/Windows FAT volumes which have 2-second
|
||||
# granularity of file times.
|
||||
sleep(2);
|
||||
|
||||
&touch("$makefile_orig");
|
||||
|
||||
&run_make_with_options($makefile, "", &get_logfile, 0);
|
||||
|
||||
# Create the answer to what should be produced by this Makefile
|
||||
|
||||
$answer = "rebuilding $makefile2.\nrebuilding $makefile.\nrunning rules.\n";
|
||||
|
||||
&compare_output($answer,&get_logfile(1))
|
||||
&& unlink "$makefile_orig";
|
||||
|
||||
# In this test we create an included file that's out-of-date, but then
|
||||
# the rule doesn't update it. Make shouldn't re-exec.
|
||||
|
||||
$makefile3 = &get_tmpfile;
|
||||
|
||||
open(MAKEFILE, "> $makefile3");
|
||||
print MAKEFILE <<'EOM';
|
||||
SHELL = /bin/sh
|
||||
|
||||
all: ; @echo hello
|
||||
|
||||
a : b ; echo >> $@
|
||||
|
||||
b : c ; [ -f $@ ] || echo >> $@
|
||||
|
||||
c: ; echo >> $@
|
||||
|
||||
include $(F)
|
||||
EOM
|
||||
|
||||
close(MAKEFILE);
|
||||
|
||||
&touch('b');
|
||||
&touch('a');
|
||||
sleep(2);
|
||||
&touch('c');
|
||||
|
||||
# First try with the file that's not updated "once removed" from the
|
||||
# file we're including.
|
||||
|
||||
&run_make_with_options($makefile3, "F=a", &get_logfile, 0);
|
||||
|
||||
$answer = "[ -f b ] || echo >> b\nhello\n";
|
||||
&compare_output($answer,&get_logfile(1));
|
||||
|
||||
# Now try with the file we're not updating being the actual file we're
|
||||
# including: this and the previous one test different parts of the code.
|
||||
|
||||
&run_make_with_options($makefile3, "F=b", &get_logfile, 0);
|
||||
|
||||
$answer = "[ -f b ] || echo >> b\nhello\n";
|
||||
&compare_output($answer,&get_logfile(1));
|
||||
|
||||
unlink('a','b','c');
|
||||
|
||||
# This tells the test driver that the perl test script executed properly.
|
||||
1;
|
||||
72
tests/scripts/features/statipattrules
Normal file
72
tests/scripts/features/statipattrules
Normal file
@@ -0,0 +1,72 @@
|
||||
# -*-perl-*-
|
||||
$description = "Test handling of static pattern rules.";
|
||||
|
||||
$details = "\
|
||||
The makefile created in this test has three targets. The
|
||||
filter command is used to get those target names ending in
|
||||
.o and statically creates a compile command with the target
|
||||
name and the target name with .c. It also does the same thing
|
||||
for another target filtered with .elc and creates a command
|
||||
to emacs a .el file";
|
||||
|
||||
open(MAKEFILE,"> $makefile");
|
||||
print MAKEFILE <<'EOF';
|
||||
files = foo.elc bar.o lose.o
|
||||
|
||||
$(filter %.o,$(files)): %.o: %.c ; @echo CC -c $(CFLAGS) $< -o $@
|
||||
|
||||
$(filter %.elc,$(files)): %.elc: %.el ; @echo emacs $<
|
||||
EOF
|
||||
close(MAKEFILE);
|
||||
|
||||
|
||||
&touch('bar.c', 'lose.c');
|
||||
|
||||
# TEST #1
|
||||
# -------
|
||||
|
||||
&run_make_with_options($makefile, '', &get_logfile);
|
||||
$answer = "CC -c bar.c -o bar.o\n";
|
||||
&compare_output($answer, &get_logfile(1));
|
||||
|
||||
|
||||
# TEST #2
|
||||
# -------
|
||||
|
||||
&run_make_with_options($makefile, 'lose.o', &get_logfile);
|
||||
$answer = "CC -c lose.c -o lose.o\n";
|
||||
&compare_output($answer, &get_logfile(1));
|
||||
|
||||
|
||||
# TEST #3
|
||||
# -------
|
||||
&touch("foo.el");
|
||||
|
||||
&run_make_with_options($makefile, 'foo.elc', &get_logfile);
|
||||
$answer = "emacs foo.el\n";
|
||||
&compare_output($answer, &get_logfile(1));
|
||||
|
||||
|
||||
unlink('foo.el', 'bar.c', 'lose.c');
|
||||
|
||||
|
||||
# TEST #4 -- PR/1670: don't core dump on invalid static pattern rules
|
||||
# -------
|
||||
|
||||
$makefile2 = &get_tmpfile;
|
||||
open(MAKEFILE, "> $makefile2");
|
||||
print MAKEFILE "foo: foo%: % ; \@echo $@\n";
|
||||
close(MAKEFILE);
|
||||
|
||||
&run_make_with_options($makefile2, '', &get_logfile, 512);
|
||||
$answer = "$makefile2:1: *** target `foo' leaves prerequisite pattern empty. Stop.\n";
|
||||
&compare_output($answer, &get_logfile(1));
|
||||
|
||||
|
||||
1;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
154
tests/scripts/features/targetvars
Normal file
154
tests/scripts/features/targetvars
Normal file
@@ -0,0 +1,154 @@
|
||||
# -*-perl-*-
|
||||
$description = "Test target-specific variable settings.";
|
||||
|
||||
$details = "\
|
||||
Create a makefile containing various flavors of target-specific variable
|
||||
values, override and non-override, and using various variable expansion
|
||||
rules, semicolon interference, etc.";
|
||||
|
||||
open(MAKEFILE,"> $makefile");
|
||||
|
||||
print MAKEFILE <<'EOF';
|
||||
SHELL = /bin/sh
|
||||
export FOO = foo
|
||||
export BAR = bar
|
||||
one: override FOO = one
|
||||
one two: ; @echo $(FOO) $(BAR)
|
||||
two: BAR = two
|
||||
three: ; BAR=1000
|
||||
@echo $(FOO) $(BAR)
|
||||
# Some things that shouldn't be target vars
|
||||
funk : override
|
||||
funk : override adelic
|
||||
adelic override : ; echo $@
|
||||
# Test per-target recursive variables
|
||||
four:FOO=x
|
||||
four:VAR$(FOO)=ok
|
||||
four: ; @echo '$(FOO) $(VAR$(FOO)) $(VAR) $(VARx)'
|
||||
five:FOO=x
|
||||
five six : VAR$(FOO)=good
|
||||
five six: ;@echo '$(FOO) $(VAR$(FOO)) $(VAR) $(VARx) $(VARfoo)'
|
||||
# Test per-target variable inheritance
|
||||
seven: eight
|
||||
seven eight: ; @echo $@: $(FOO) $(BAR)
|
||||
seven: BAR = seven
|
||||
seven: FOO = seven
|
||||
eight: BAR = eight
|
||||
# Test the export keyword with per-target variables
|
||||
nine: ; @echo $(FOO) $(BAR) $$FOO $$BAR
|
||||
nine: FOO = wallace
|
||||
# Test = escaping
|
||||
EQ = =
|
||||
ten: one\=two
|
||||
ten: one \= two
|
||||
ten one$(EQ)two $(EQ):;@echo $@
|
||||
.PHONY: one two three four five six seven eight nine ten $(EQ) one$(EQ)two
|
||||
# Test target-specific vars with pattern/suffix rules
|
||||
QVAR = qvar
|
||||
RVAR = =
|
||||
%.q : ; @echo $(QVAR) $(RVAR)
|
||||
foo.q : RVAR += rvar
|
||||
# Target-specific vars with multiple LHS pattern rules
|
||||
%.r %.s %.t: ; @echo $(QVAR) $(RVAR) $(SVAR) $(TVAR)
|
||||
foo.r : RVAR += rvar
|
||||
foo.t : TVAR := $(QVAR)
|
||||
EOF
|
||||
|
||||
close(MAKEFILE);
|
||||
|
||||
# TEST #1
|
||||
|
||||
&run_make_with_options($makefile, "one two three", &get_logfile);
|
||||
$answer = "one bar\nfoo two\nBAR=1000\nfoo bar\n";
|
||||
&compare_output($answer,&get_logfile(1));
|
||||
|
||||
# TEST #2
|
||||
|
||||
&run_make_with_options($makefile, "one two FOO=1 BAR=2", &get_logfile);
|
||||
$answer = "one 2\n1 2\n";
|
||||
&compare_output($answer,&get_logfile(1));
|
||||
|
||||
# TEST #3
|
||||
|
||||
&run_make_with_options($makefile, "four", &get_logfile);
|
||||
$answer = "x ok ok\n";
|
||||
&compare_output($answer,&get_logfile(1));
|
||||
|
||||
# TEST #4
|
||||
|
||||
&run_make_with_options($makefile, "seven", &get_logfile);
|
||||
$answer = "eight: seven eight\nseven: seven seven\n";
|
||||
&compare_output($answer,&get_logfile(1));
|
||||
|
||||
# TEST #5
|
||||
|
||||
&run_make_with_options($makefile, "nine", &get_logfile);
|
||||
$answer = "wallace bar wallace bar\n";
|
||||
&compare_output($answer,&get_logfile(1));
|
||||
|
||||
# TEST #6
|
||||
|
||||
&run_make_with_options($makefile, "ten", &get_logfile);
|
||||
$answer = "one=two\none bar\n=\nfoo two\nten\n";
|
||||
&compare_output($answer,&get_logfile(1));
|
||||
|
||||
# TEST #6
|
||||
|
||||
&run_make_with_options($makefile, "foo.q bar.q", &get_logfile);
|
||||
$answer = "qvar = rvar\nqvar =\n";
|
||||
&compare_output($answer,&get_logfile(1));
|
||||
|
||||
# TEST #7
|
||||
|
||||
&run_make_with_options($makefile, "foo.t bar.s", &get_logfile);
|
||||
$answer = "qvar = qvar\nqvar =\n";
|
||||
&compare_output($answer,&get_logfile(1));
|
||||
|
||||
|
||||
# TEST #8
|
||||
# For PR/1378: Target-specific vars don't inherit correctly
|
||||
|
||||
$makefile2 = &get_tmpfile;
|
||||
|
||||
open(MAKEFILE,"> $makefile2");
|
||||
print MAKEFILE <<'EOF';
|
||||
foo: FOO = foo
|
||||
bar: BAR = bar
|
||||
foo: bar
|
||||
bar: baz
|
||||
baz: ; @echo $(FOO) $(BAR)
|
||||
EOF
|
||||
close(MAKEFILE);
|
||||
|
||||
&run_make_with_options("$makefile2", "", &get_logfile);
|
||||
$answer = "foo bar\n";
|
||||
&compare_output($answer, &get_logfile(1));
|
||||
|
||||
# TEST #9
|
||||
# For PR/1380: Using += assignment in target-specific variables sometimes fails
|
||||
|
||||
$makefile3 = &get_tmpfile;
|
||||
|
||||
open(MAKEFILE,"> $makefile3");
|
||||
print MAKEFILE <<'EOF';
|
||||
.PHONY: all one
|
||||
all: FOO += baz
|
||||
all: one; @echo $(FOO)
|
||||
|
||||
FOO = bar
|
||||
|
||||
one: FOO += biz
|
||||
one: ; @echo $(FOO)
|
||||
EOF
|
||||
close(MAKEFILE);
|
||||
|
||||
&run_make_with_options("$makefile3", "", &get_logfile);
|
||||
$answer = "bar baz biz\nbar baz\n";
|
||||
&compare_output($answer, &get_logfile(1));
|
||||
|
||||
&run_make_with_options("$makefile3", "one", &get_logfile);
|
||||
$answer = "bar biz\n";
|
||||
&compare_output($answer, &get_logfile(1));
|
||||
|
||||
|
||||
1;
|
||||
34
tests/scripts/features/varnesting
Normal file
34
tests/scripts/features/varnesting
Normal file
@@ -0,0 +1,34 @@
|
||||
$description = "The following test creates a makefile to ...";
|
||||
|
||||
$details = "";
|
||||
|
||||
open(MAKEFILE,"> $makefile");
|
||||
|
||||
# The Contents of the MAKEFILE ...
|
||||
|
||||
print MAKEFILE "x = variable1\n"
|
||||
."variable2 := Hello\n"
|
||||
."y = \$(subst 1,2,\$(x))\n"
|
||||
."z = y\n"
|
||||
."a := \$(\$(\$(z)))\n"
|
||||
."all: \n"
|
||||
."\t\@echo \$(a)\n";
|
||||
|
||||
# END of Contents of MAKEFILE
|
||||
|
||||
close(MAKEFILE);
|
||||
|
||||
&run_make_with_options($makefile,"",&get_logfile);
|
||||
|
||||
# Create the answer to what should be produced by this Makefile
|
||||
$answer = "Hello\n";
|
||||
|
||||
&compare_output($answer,&get_logfile(1));
|
||||
|
||||
1;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
62
tests/scripts/features/vpath
Normal file
62
tests/scripts/features/vpath
Normal file
@@ -0,0 +1,62 @@
|
||||
$description = "The following test creates a makefile to test the \n"
|
||||
."vpath directive which allows you to specify a search \n"
|
||||
."path for a particular class of filenames, those that\n"
|
||||
."match a particular pattern.";
|
||||
|
||||
$details = "This tests the vpath directive by specifying search directories\n"
|
||||
."for one class of filenames with the form: vpath pattern directories"
|
||||
."\nIn this test, we specify the working directory for all files\n"
|
||||
."that end in c or h. We also test the variables $@ (which gives\n"
|
||||
."target name) and $^ (which is a list of all dependencies \n"
|
||||
."including the directories in which they were found). It also\n"
|
||||
."uses the function firstword used to extract just the first\n"
|
||||
."dependency from the entire list.";
|
||||
|
||||
open(MAKEFILE,"> $makefile");
|
||||
|
||||
# The Contents of the MAKEFILE ...
|
||||
|
||||
print MAKEFILE "vpath %.c foo\n";
|
||||
print MAKEFILE "vpath %.c $workdir\n";
|
||||
print MAKEFILE "vpath %.h $workdir\n";
|
||||
print MAKEFILE "objects = main.o kbd.o commands.o display.o insert.o\n";
|
||||
print MAKEFILE "edit: \$(objects)\n";
|
||||
print MAKEFILE "\t\@echo cc -o \$@ \$^\n";
|
||||
print MAKEFILE "main.o : main.c defs.h\n";
|
||||
print MAKEFILE "\t\@echo cc -c \$(firstword \$^)\n";
|
||||
print MAKEFILE "kbd.o : kbd.c defs.h command.h\n";
|
||||
print MAKEFILE "\t\@echo cc -c kbd.c\n";
|
||||
print MAKEFILE "commands.o : command.c defs.h command.h\n";
|
||||
print MAKEFILE "\t\@echo cc -c commands.c\n";
|
||||
print MAKEFILE "display.o : display.c defs.h buffer.h\n";
|
||||
print MAKEFILE "\t\@echo cc -c display.c\n";
|
||||
print MAKEFILE "insert.o : insert.c defs.h buffer.h\n";
|
||||
print MAKEFILE "\t\@echo cc -c insert.c\n";
|
||||
|
||||
# END of Contents of MAKEFILE
|
||||
|
||||
close(MAKEFILE);
|
||||
|
||||
|
||||
@files_to_touch = ("$workdir${pathsep}main.c","$workdir${pathsep}defs.h",
|
||||
"$workdir${pathsep}kbd.c","$workdir${pathsep}command.h",
|
||||
"$workdir${pathsep}commands.c","$workdir${pathsep}display.c",
|
||||
"$workdir${pathsep}buffer.h","$workdir${pathsep}insert.c",
|
||||
"$workdir${pathsep}command.c");
|
||||
|
||||
&touch(@files_to_touch);
|
||||
|
||||
&run_make_with_options($makefile,"",&get_logfile);
|
||||
|
||||
# Create the answer to what should be produced by this Makefile
|
||||
$answer = "cc -c $workdir${pathsep}main.c\ncc -c kbd.c\ncc -c commands.c\n"
|
||||
."cc -c display.c\n"
|
||||
."cc -c insert.c\ncc -o edit main.o kbd.o commands.o display.o "
|
||||
."insert.o\n";
|
||||
|
||||
if (&compare_output($answer,&get_logfile(1)))
|
||||
{
|
||||
unlink @files_to_touch;
|
||||
}
|
||||
|
||||
1;
|
||||
45
tests/scripts/features/vpath2
Normal file
45
tests/scripts/features/vpath2
Normal file
@@ -0,0 +1,45 @@
|
||||
$description = "This is part 2 in a series to test the vpath directive\n"
|
||||
."It tests the three forms of the directive:\n"
|
||||
." vpath pattern directive\n"
|
||||
." vpath pattern (clears path associated with pattern)\n"
|
||||
." vpath (clears all paths specified with vpath)\n";
|
||||
|
||||
$details = "This test simply adds many search paths using various vpath\n"
|
||||
."directive forms and clears them afterwards. It has a simple\n"
|
||||
."rule to print a message at the end to confirm that the makefile\n"
|
||||
."ran with no errors.\n";
|
||||
|
||||
open(MAKEFILE,"> $makefile");
|
||||
|
||||
# The Contents of the MAKEFILE ...
|
||||
|
||||
print MAKEFILE "VPATH = $workdir:$sourcedir\n";
|
||||
print MAKEFILE "vpath %.c foo\n";
|
||||
print MAKEFILE "vpath %.c $workdir\n";
|
||||
print MAKEFILE "vpath %.c $sourcedir\n";
|
||||
print MAKEFILE "vpath %.h $workdir\n";
|
||||
print MAKEFILE "vpath %.c\n";
|
||||
print MAKEFILE "vpath\n";
|
||||
print MAKEFILE "all:\n";
|
||||
print MAKEFILE "\t\@echo ALL IS WELL\n";
|
||||
# END of Contents of MAKEFILE
|
||||
|
||||
close(MAKEFILE);
|
||||
|
||||
&run_make_with_options($makefile,"",&get_logfile);
|
||||
|
||||
# Create the answer to what should be produced by this Makefile
|
||||
$answer = "ALL IS WELL\n";
|
||||
|
||||
&compare_output($answer,&get_logfile(1));
|
||||
|
||||
1;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
64
tests/scripts/features/vpathgpath
Normal file
64
tests/scripts/features/vpathgpath
Normal file
@@ -0,0 +1,64 @@
|
||||
# -*-perl-*-
|
||||
$description = "Tests VPATH+/GPATH functionality.";
|
||||
|
||||
$details = "";
|
||||
|
||||
$VP = "$workdir$pathsep";
|
||||
|
||||
open(MAKEFILE,"> $makefile");
|
||||
|
||||
# The Contents of the MAKEFILE ...
|
||||
|
||||
print MAKEFILE "VPATH = $VP\n";
|
||||
|
||||
print MAKEFILE <<'EOMAKE';
|
||||
|
||||
GPATH = $(VPATH)
|
||||
|
||||
.SUFFIXES: .a .b .c .d
|
||||
.PHONY: general rename notarget intermediate
|
||||
|
||||
%.a:
|
||||
%.b:
|
||||
%.c:
|
||||
%.d:
|
||||
|
||||
%.a : %.b ; cat $^ > $@
|
||||
%.b : %.c ; cat $^ > $@
|
||||
%.c :: %.d ; cat $^ > $@
|
||||
|
||||
# General testing info:
|
||||
|
||||
general: foo.b
|
||||
foo.b: foo.c bar.c
|
||||
|
||||
EOMAKE
|
||||
|
||||
close(MAKEFILE);
|
||||
|
||||
@touchedfiles = ();
|
||||
|
||||
sub touchfiles {
|
||||
foreach (@_) {
|
||||
($f = $_) =~ s,VP/,$VP,g;
|
||||
&touch($f);
|
||||
push(@touchedfiles, $f);
|
||||
sleep(1);
|
||||
}
|
||||
}
|
||||
|
||||
# Run the general-case test
|
||||
|
||||
&touchfiles("VP/foo.d", "VP/bar.d", "VP/foo.c", "VP/bar.c", "foo.b", "bar.d");
|
||||
|
||||
&run_make_with_options($makefile,"general",&get_logfile());
|
||||
|
||||
push(@touchedfiles, "bar.c");
|
||||
|
||||
$answer = "$make_name: Nothing to be done for `general'.\n";
|
||||
|
||||
&compare_output($answer,&get_logfile(1));
|
||||
|
||||
unlink(@touchedfiles) unless $keep;
|
||||
|
||||
1;
|
||||
123
tests/scripts/features/vpathplus
Normal file
123
tests/scripts/features/vpathplus
Normal file
@@ -0,0 +1,123 @@
|
||||
# -*-perl-*-
|
||||
$description = "Tests the new VPATH+ functionality added in 3.76.";
|
||||
|
||||
$details = "";
|
||||
|
||||
$VP = "$workdir$pathsep";
|
||||
|
||||
open(MAKEFILE,"> $makefile");
|
||||
|
||||
# The Contents of the MAKEFILE ...
|
||||
|
||||
print MAKEFILE "VPATH = $VP\n";
|
||||
|
||||
print MAKEFILE <<'EOMAKE';
|
||||
|
||||
SHELL = /bin/sh
|
||||
|
||||
.SUFFIXES: .a .b .c .d
|
||||
.PHONY: general rename notarget intermediate
|
||||
|
||||
%.a:
|
||||
%.b:
|
||||
%.c:
|
||||
%.d:
|
||||
|
||||
%.a : %.b
|
||||
cat $^ > $@
|
||||
%.b : %.c
|
||||
cat $^ > $@ 2>/dev/null || exit 1
|
||||
%.c :: %.d
|
||||
cat $^ > $@
|
||||
|
||||
# General testing info:
|
||||
|
||||
general: foo.b
|
||||
foo.b: foo.c bar.c
|
||||
|
||||
# Rename testing info:
|
||||
|
||||
rename: $(VPATH)/foo.c foo.d
|
||||
|
||||
# Target not made testing info:
|
||||
|
||||
notarget: notarget.b
|
||||
notarget.c: notarget.d
|
||||
-@echo "not creating $@ from $^"
|
||||
|
||||
# Intermediate files:
|
||||
|
||||
intermediate: inter.a
|
||||
|
||||
EOMAKE
|
||||
|
||||
close(MAKEFILE);
|
||||
|
||||
@touchedfiles = ();
|
||||
|
||||
sub touchfiles {
|
||||
foreach (@_) {
|
||||
sleep($wtime);
|
||||
($f = $_) =~ s,VP/,$VP,g;
|
||||
&touch($f);
|
||||
push(@touchedfiles, $f);
|
||||
}
|
||||
}
|
||||
|
||||
# Run the general-case test
|
||||
|
||||
&touchfiles("VP/foo.d", "VP/bar.d", "VP/foo.c", "VP/bar.c", "foo.b", "bar.d");
|
||||
|
||||
&run_make_with_options($makefile,"general",&get_logfile);
|
||||
|
||||
push(@touchedfiles, "bar.c");
|
||||
|
||||
$answer = "cat bar.d > bar.c
|
||||
cat ${VP}foo.c bar.c > foo.b 2>/dev/null || exit 1
|
||||
";
|
||||
&compare_output($answer,&get_logfile(1));
|
||||
|
||||
# Test rules that don't make the target correctly
|
||||
|
||||
&touchfiles("VP/notarget.c", "notarget.b", "notarget.d");
|
||||
|
||||
&run_make_with_options($makefile,"notarget",&get_logfile,512);
|
||||
|
||||
$answer = "not creating notarget.c from notarget.d
|
||||
cat notarget.c > notarget.b 2>/dev/null || exit 1
|
||||
$make_name: *** [notarget.b] Error 1
|
||||
";
|
||||
|
||||
&compare_output($answer,&get_logfile(1));
|
||||
|
||||
# Test intermediate file handling (part 1)
|
||||
|
||||
&touchfiles("VP/inter.d");
|
||||
|
||||
&run_make_with_options($makefile,"intermediate",&get_logfile);
|
||||
|
||||
push(@touchedfiles, "inter.a", "inter.b");
|
||||
|
||||
$answer = "cat ${VP}inter.d > inter.c
|
||||
cat inter.c > inter.b 2>/dev/null || exit 1
|
||||
cat inter.b > inter.a
|
||||
rm inter.b inter.c
|
||||
";
|
||||
&compare_output($answer,&get_logfile(1));
|
||||
|
||||
# Test intermediate file handling (part 2)
|
||||
|
||||
&touchfiles("VP/inter.b", "VP/inter.d");
|
||||
|
||||
&run_make_with_options($makefile,"intermediate",&get_logfile);
|
||||
|
||||
$answer = "cat ${VP}inter.d > inter.c
|
||||
cat inter.c > inter.b 2>/dev/null || exit 1
|
||||
cat inter.b > inter.a
|
||||
rm inter.c
|
||||
";
|
||||
&compare_output($answer,&get_logfile(1));
|
||||
|
||||
unlink @touchedfiles unless $keep;
|
||||
|
||||
1;
|
||||
44
tests/scripts/functions/addprefix
Normal file
44
tests/scripts/functions/addprefix
Normal file
@@ -0,0 +1,44 @@
|
||||
$description = "The following test creates a makefile to test the addprefix "
|
||||
."function.";
|
||||
|
||||
$details = "";
|
||||
|
||||
# IF YOU NEED >1 MAKEFILE FOR THIS TEST, USE &get_tmpfile; TO GET
|
||||
# THE NAME OF THE MAKEFILE. THIS INSURES CONSISTENCY AND KEEPS TRACK OF
|
||||
# HOW MANY MAKEFILES EXIST FOR EASY DELETION AT THE END.
|
||||
# EXAMPLE: $makefile2 = &get_tmpfile;
|
||||
|
||||
|
||||
open(MAKEFILE,"> $makefile");
|
||||
|
||||
# The Contents of the MAKEFILE ...
|
||||
|
||||
print MAKEFILE "string := \$(addprefix src${pathsep},a.b.z.foo hacks) \n"
|
||||
."all: \n"
|
||||
."\t\@echo \$(string) \n";
|
||||
|
||||
# END of Contents of MAKEFILE
|
||||
|
||||
close(MAKEFILE);
|
||||
|
||||
&run_make_with_options($makefile,"",&get_logfile,0);
|
||||
|
||||
# Create the answer to what should be produced by this Makefile
|
||||
$answer = "src${pathsep}a.b.z.foo src${pathsep}hacks\n";
|
||||
|
||||
# COMPARE RESULTS
|
||||
|
||||
# In this call to compare output, you should use the call &get_logfile(1)
|
||||
# to send the name of the last logfile created. You may also use
|
||||
# the special call &get_logfile(1) which returns the same as &get_logfile(1).
|
||||
|
||||
&compare_output($answer,&get_logfile(1));
|
||||
|
||||
# This tells the test driver that the perl test script executed properly.
|
||||
1;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
44
tests/scripts/functions/addsuffix
Normal file
44
tests/scripts/functions/addsuffix
Normal file
@@ -0,0 +1,44 @@
|
||||
$description = "The following test creates a makefile to test the addsuffix "
|
||||
."function.";
|
||||
|
||||
$details = "";
|
||||
|
||||
# IF YOU NEED >1 MAKEFILE FOR THIS TEST, USE &get_tmpfile; TO GET
|
||||
# THE NAME OF THE MAKEFILE. THIS INSURES CONSISTENCY AND KEEPS TRACK OF
|
||||
# HOW MANY MAKEFILES EXIST FOR EASY DELETION AT THE END.
|
||||
# EXAMPLE: $makefile2 = &get_tmpfile;
|
||||
|
||||
|
||||
open(MAKEFILE,"> $makefile");
|
||||
|
||||
# The Contents of the MAKEFILE ...
|
||||
|
||||
print MAKEFILE "string := \$(addsuffix .c,src${pathsep}a.b.z.foo hacks) \n"
|
||||
."all: \n"
|
||||
."\t\@echo \$(string) \n";
|
||||
|
||||
# END of Contents of MAKEFILE
|
||||
|
||||
close(MAKEFILE);
|
||||
|
||||
&run_make_with_options($makefile,"",&get_logfile,0);
|
||||
|
||||
# Create the answer to what should be produced by this Makefile
|
||||
$answer = "src${pathsep}a.b.z.foo.c hacks.c\n";
|
||||
|
||||
# COMPARE RESULTS
|
||||
|
||||
# In this call to compare output, you should use the call &get_logfile(1)
|
||||
# to send the name of the last logfile created. You may also use
|
||||
# the special call &get_logfile(1) which returns the same as &get_logfile(1).
|
||||
|
||||
&compare_output($answer,&get_logfile(1));
|
||||
|
||||
# This tells the test driver that the perl test script executed properly.
|
||||
1;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
44
tests/scripts/functions/basename
Normal file
44
tests/scripts/functions/basename
Normal file
@@ -0,0 +1,44 @@
|
||||
$description = "The following test creates a makefile to test the suffix "
|
||||
."function.";
|
||||
|
||||
$details = "";
|
||||
|
||||
# IF YOU NEED >1 MAKEFILE FOR THIS TEST, USE &get_tmpfile; TO GET
|
||||
# THE NAME OF THE MAKEFILE. THIS INSURES CONSISTENCY AND KEEPS TRACK OF
|
||||
# HOW MANY MAKEFILES EXIST FOR EASY DELETION AT THE END.
|
||||
# EXAMPLE: $makefile2 = &get_tmpfile;
|
||||
|
||||
|
||||
open(MAKEFILE,"> $makefile");
|
||||
|
||||
# The Contents of the MAKEFILE ...
|
||||
|
||||
print MAKEFILE "string := \$(basename src${pathsep}a.b.z.foo.c src${pathsep}hacks src.bar${pathsep}a.b.z.foo.c src.bar${pathsep}hacks hacks) \n"
|
||||
."all: \n"
|
||||
."\t\@echo \$(string) \n";
|
||||
|
||||
# END of Contents of MAKEFILE
|
||||
|
||||
close(MAKEFILE);
|
||||
|
||||
&run_make_with_options($makefile,"",&get_logfile,0);
|
||||
|
||||
# Create the answer to what should be produced by this Makefile
|
||||
$answer = "src${pathsep}a.b.z.foo src${pathsep}hacks src.bar${pathsep}a.b.z.foo src.bar${pathsep}hacks hacks\n";
|
||||
|
||||
# COMPARE RESULTS
|
||||
|
||||
# In this call to compare output, you should use the call &get_logfile(1)
|
||||
# to send the name of the last logfile created. You may also use
|
||||
# the special call &get_logfile(1) which returns the same as &get_logfile(1).
|
||||
|
||||
&compare_output($answer,&get_logfile(1));
|
||||
|
||||
# This tells the test driver that the perl test script executed properly.
|
||||
1;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
60
tests/scripts/functions/call
Normal file
60
tests/scripts/functions/call
Normal file
@@ -0,0 +1,60 @@
|
||||
# -*-perl-*-
|
||||
$description = "Test the call function.\n";
|
||||
|
||||
$details = "Try various uses of call and ensure they all give the correct
|
||||
results.\n";
|
||||
|
||||
open(MAKEFILE, "> $makefile");
|
||||
|
||||
# The Contents of the MAKEFILE ...
|
||||
|
||||
print MAKEFILE <<'EOMAKE';
|
||||
# Simple, just reverse two things
|
||||
#
|
||||
reverse = $2 $1
|
||||
|
||||
# A complex `map' function, using recursive `call'.
|
||||
#
|
||||
map = $(foreach a,$2,$(call $1,$a))
|
||||
|
||||
# Test using a builtin; this is silly as it's simpler to do without call
|
||||
#
|
||||
my-notdir = $(call notdir,$(1))
|
||||
|
||||
# Test using non-expanded builtins
|
||||
#
|
||||
my-foreach = $(foreach $(1),$(2),$(3))
|
||||
my-if = $(if $(1),$(2),$(3))
|
||||
|
||||
# Test recursive invocations of call with different arguments
|
||||
#
|
||||
one = $(1) $(2) $(3)
|
||||
two = $(call one,$(1),foo,$(2))
|
||||
|
||||
|
||||
all: ; @echo '$(call reverse,bar,foo)'; \
|
||||
echo '$(call map,origin,MAKE reverse map)'; \
|
||||
echo '$(call my-notdir,a/b c/d e/f)'; \
|
||||
echo '$(call my-foreach)'; \
|
||||
echo '$(call my-foreach,a,,,)'; \
|
||||
echo '$(call my-if,a,b,c)'; \
|
||||
echo '$(call two,bar,baz)'
|
||||
|
||||
EOMAKE
|
||||
|
||||
# These won't work until/unless PR/1527 is resolved.
|
||||
# echo '$(call my-foreach,a,x y z,$(a)$(a))'; \
|
||||
# echo '$(call my-if,,$(warning don't print this),ok)'
|
||||
#
|
||||
# $answer = "xx yy zz\nok\n";
|
||||
|
||||
# END of Contents of MAKEFILE
|
||||
|
||||
close(MAKEFILE);
|
||||
|
||||
&run_make_with_options($makefile, "", &get_logfile);
|
||||
$answer = "foo bar\ndefault file file\nb d f\n\n\nb\nbar foo baz\n";
|
||||
|
||||
&compare_output($answer, &get_logfile(1));
|
||||
|
||||
1;
|
||||
44
tests/scripts/functions/dir
Normal file
44
tests/scripts/functions/dir
Normal file
@@ -0,0 +1,44 @@
|
||||
$description = "The following test creates a makefile to test the dir "
|
||||
."function.";
|
||||
|
||||
$details = "";
|
||||
|
||||
# IF YOU NEED >1 MAKEFILE FOR THIS TEST, USE &get_tmpfile; TO GET
|
||||
# THE NAME OF THE MAKEFILE. THIS INSURES CONSISTENCY AND KEEPS TRACK OF
|
||||
# HOW MANY MAKEFILES EXIST FOR EASY DELETION AT THE END.
|
||||
# EXAMPLE: $makefile2 = &get_tmpfile;
|
||||
|
||||
|
||||
open(MAKEFILE,"> $makefile");
|
||||
|
||||
# The Contents of the MAKEFILE ...
|
||||
|
||||
print MAKEFILE "string := \$(dir src${pathsep}foo.c hacks) \n"
|
||||
."all: \n"
|
||||
."\t\@echo \$(string) \n";
|
||||
|
||||
# END of Contents of MAKEFILE
|
||||
|
||||
close(MAKEFILE);
|
||||
|
||||
&run_make_with_options($makefile,"",&get_logfile,0);
|
||||
|
||||
# Create the answer to what should be produced by this Makefile
|
||||
$answer = "src${pathsep} .${pathsep}\n";
|
||||
|
||||
# COMPARE RESULTS
|
||||
|
||||
# In this call to compare output, you should use the call &get_logfile(1)
|
||||
# to send the name of the last logfile created. You may also use
|
||||
# the special call &get_logfile(1) which returns the same as &get_logfile(1).
|
||||
|
||||
&compare_output($answer,&get_logfile(1));
|
||||
|
||||
# This tells the test driver that the perl test script executed properly.
|
||||
1;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
63
tests/scripts/functions/error
Normal file
63
tests/scripts/functions/error
Normal file
@@ -0,0 +1,63 @@
|
||||
$description = "\
|
||||
The following test creates a makefile to test the error function.";
|
||||
|
||||
$details = "";
|
||||
|
||||
open(MAKEFILE,"> $makefile");
|
||||
|
||||
print MAKEFILE <<'EOF';
|
||||
ifdef ERROR1
|
||||
$(error error is $(ERROR1))
|
||||
endif
|
||||
|
||||
ifdef ERROR2
|
||||
$(error error is $(ERROR2))
|
||||
endif
|
||||
|
||||
ifdef ERROR3
|
||||
all: some; @echo $(error error is $(ERROR3))
|
||||
endif
|
||||
|
||||
ifdef ERROR4
|
||||
all: some; @echo error is $(ERROR4)
|
||||
@echo $(error error is $(ERROR4))
|
||||
endif
|
||||
|
||||
some: ; @echo Some stuff
|
||||
|
||||
EOF
|
||||
|
||||
close(MAKEFILE);
|
||||
|
||||
# Test #1
|
||||
|
||||
&run_make_with_options($makefile, "ERROR1=yes", &get_logfile, 512);
|
||||
$answer = "$makefile:2: *** error is yes. Stop.\n";
|
||||
&compare_output($answer,&get_logfile(1));
|
||||
|
||||
# Test #2
|
||||
|
||||
&run_make_with_options($makefile, "ERROR2=no", &get_logfile, 512);
|
||||
$answer = "$makefile:6: *** error is no. Stop.\n";
|
||||
&compare_output($answer,&get_logfile(1));
|
||||
|
||||
# Test #3
|
||||
|
||||
&run_make_with_options($makefile, "ERROR3=maybe", &get_logfile, 512);
|
||||
$answer = "Some stuff\n$makefile:10: *** error is maybe. Stop.\n";
|
||||
&compare_output($answer,&get_logfile(1));
|
||||
|
||||
# Test #4
|
||||
|
||||
&run_make_with_options($makefile, "ERROR4=definitely", &get_logfile, 512);
|
||||
$answer = "Some stuff\n$makefile:14: *** error is definitely. Stop.\n";
|
||||
&compare_output($answer,&get_logfile(1));
|
||||
|
||||
# This tells the test driver that the perl test script executed properly.
|
||||
1;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user