dev/gnu-make, libs/freetype2: vendor as full-fork recipes (path=source, patches baked)
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
[source]
|
||||
tar = "http://ftp.gnu.org/gnu/make/make-4.4.tar.gz"
|
||||
blake3 = "1a0e5353205e106bd9b3c0f4a5f37ee1156a1e1c8feb771d1b4842c216612cba"
|
||||
patches = [
|
||||
"redox.patch"
|
||||
]
|
||||
script = """
|
||||
autotools_recursive_regenerate
|
||||
"""
|
||||
# Vendored local fork (full-fork model): builds from the committed source/
|
||||
# tree (offline, reproducible). source/ = pristine upstream + the patches below
|
||||
# BAKED IN. .patch files kept tracked so a version bump can re-apply them via
|
||||
# sync-recipe-source.sh.
|
||||
# upstream: http://ftp.gnu.org/gnu/make/make-4.4.tar.gz
|
||||
# blake3: 1a0e5353205e106bd9b3c0f4a5f37ee1156a1e1c8feb771d1b4842c216612cba
|
||||
# patch (baked): redox.patch
|
||||
path = "source"
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
make-4.4
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,122 @@
|
||||
-----------------------------------
|
||||
|
||||
GNU Make development starting with GNU Make 3.76 by:
|
||||
Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
Additional development starting with GNU Make 4.3 by:
|
||||
Dmitry Goncharov <dgoncharov@users.sf.net>
|
||||
|
||||
Additional development starting with GNU Make 3.81 by:
|
||||
Boris Kolpackov <boris@kolpackov.net>
|
||||
|
||||
GNU Make development up to version 3.75 by:
|
||||
Roland McGrath <roland@gnu.org>
|
||||
|
||||
GNU Make User's Manual
|
||||
Written by:
|
||||
Richard M. Stallman <rms@gnu.org>
|
||||
|
||||
Edited by:
|
||||
Roland McGrath <roland@gnu.org>
|
||||
Bob Chassell <bob@gnu.org>
|
||||
Melissa Weisshaus <melissa@gnu.org>
|
||||
Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
-----------------------------------
|
||||
GNU Make porting efforts:
|
||||
|
||||
Port to VMS by:
|
||||
Klaus Kaempf <kkaempf@progis.de>
|
||||
Hartmut Becker <Hartmut.Becker@hp.com>
|
||||
Archive support/Bug fixes by:
|
||||
John W. Eaton <jwe@bevo.che.wisc.edu>
|
||||
Martin Zinser <zinser@decus.decus.de>
|
||||
|
||||
Port to Amiga by:
|
||||
Aaron Digulla <digulla@fh-konstanz.de>
|
||||
|
||||
Port to MS-Windows (native/MinGW) maintained by:
|
||||
Eli Zaretskii <eliz@gnu.org>
|
||||
|
||||
Port to MS-DOS (DJGPP), OS/2, and MS-Windows (native/MinGW) by:
|
||||
DJ Delorie <dj@delorie.com>
|
||||
Rob Tulloh <rob_tulloh@tivoli.com>
|
||||
Eli Zaretskii <eliz@gnu.org>
|
||||
Jonathan Grant <jg@jguk.org>
|
||||
Andreas Beuning <andreas.buening@nexgo.de>
|
||||
Earnie Boyd <earnie@uses.sf.net>
|
||||
Troy Runkel <Troy.Runkel@mathworks.com>
|
||||
Juan M. Guerrero <juan.guerrero@gmx.de>
|
||||
|
||||
-----------------------------------
|
||||
Other contributors:
|
||||
|
||||
Luke Allardyce <lukeallardyce@gmail.com>
|
||||
Aron Barath <baratharon@caesar.elte.hu>
|
||||
David Boyce <dsb@boyski.com>
|
||||
Kevin Buettner <kevinb@redhat.com>
|
||||
Janet Carson <janet_carson@tivoli.com>
|
||||
Howard Chu <hyc@highlandsun.com>
|
||||
Ludovic Courtès <ludo@gnu.org>
|
||||
Joe Crayne <oh.hello.joe@gmail.com>
|
||||
Jeremy Devenport <jeremy.devenport@gmail.com>
|
||||
Pete Dietl <petedietl@gmail.com>
|
||||
Martin Dorey <martin.dorey@hds.com>
|
||||
Christian Eggers <ceggers@arri.de>
|
||||
Paul Eggert <eggert@twinsun.com>
|
||||
Mike Frysinger <vapier@gentoo.org>
|
||||
Ramon Garcia Fernandez <ramon.garcia.f@gmail.com>
|
||||
Noah Goldstein <goldstein.w.n@gmail.com>
|
||||
Mike Haboustak <haboustak@gmail.com>
|
||||
Frank Heckenbach <f.heckenbach@fh-soft.de>
|
||||
Klaus Heinz <kamar@ease.rhein-main.de>
|
||||
Ben Hutchings <ben@decadent.org.uk>
|
||||
Cao jin <caoj.fnst@cn.fujitsu.com>
|
||||
Michael Joosten
|
||||
Christian Jullien <eligis@orange.fr>
|
||||
Jim Kelton <jim_kelton@tivoli.com>
|
||||
Kaz Kylheku <kaz@kylheku.com>
|
||||
David Lubbren <uhay@rz.uni-karlsruhe.de>
|
||||
Tim Magill <tim.magill@telops.gte.com>
|
||||
Markus Mauhart <qwe123@chello.at>
|
||||
Greg McGary <greg@mcgary.org>
|
||||
Thien-Thi Nguyen <ttn@gnuvola.org>
|
||||
Han-Wen Nienhuys <hanwen@cs.uu.nl>
|
||||
Enrique Olaizola <enrique_olaizola16@hotmail.com>
|
||||
Ola Olsson <ola1olsson@gmail.com>
|
||||
Jens Rehsack <sno@netbsd.org>
|
||||
Thomas Riedl <thomas.riedl@siemens.com>
|
||||
Jaak Ristioja <jaak@ristioja.ee>
|
||||
Christoph Schulz <develop@kristov.de>
|
||||
Andreas Schwab <schwab@suse.de>
|
||||
spagoveanu <spagoveanu@gmail.com>
|
||||
Carl Staelin (Princeton University)
|
||||
Ian Stewartson (Data Logic Limited)
|
||||
Tobias Stoeckmann <tobias@stoeckmann.org>
|
||||
Sergei Trofimovich <siarheit@google.com>
|
||||
Marc Ullman <marc@mathworks.com>
|
||||
Christof Warlich <cwarlich@gmx.de>
|
||||
Florian Weimer <fweimer@redhat.com>
|
||||
David A. Wheeler <dwheeler@dwheeler.com>
|
||||
Bernhard M. Wiedemann <bwiedemann@suse.de>
|
||||
Ben Wijen <ben@wijen.net>
|
||||
Jouke Witteveen <j.witteveen@gmail.com>
|
||||
|
||||
With suggestions/comments/bug reports from a cast of ... well ...
|
||||
hundreds, anyway :)
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 1997-2022 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 3 of the License, 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
|
||||
this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
@@ -0,0 +1,249 @@
|
||||
# Basic GNU -*-Makefile-*- to build GNU make
|
||||
#
|
||||
# NOTE:
|
||||
# If you have no 'make' program at all to process this makefile:
|
||||
# * On Windows, run ".\buildw32.bat" to bootstrap one.
|
||||
# * On MS-DOS, run ".\builddos.bat" to bootstrap one.
|
||||
#
|
||||
# Once you have a GNU make program created, you can use it with this makefile
|
||||
# to keep it up to date if you make changes, as:
|
||||
#
|
||||
# make.exe -f Basic.mk
|
||||
#
|
||||
# Copyright (C) 2017-2022 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 3 of the License, 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
|
||||
# this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
all:
|
||||
|
||||
src = src/
|
||||
lib = lib/
|
||||
|
||||
make_SOURCES = $(src)ar.c $(src)arscan.c $(src)commands.c $(src)default.c $(src)dir.c $(src)expand.c $(src)file.c $(src)function.c $(src)getopt.c $(src)getopt1.c $(src)guile.c $(src)hash.c $(src)implicit.c $(src)job.c $(src)load.c $(src)loadapi.c $(src)main.c $(src)misc.c $(src)output.c $(src)read.c $(src)remake.c $(src)rule.c $(src)shuffle.c $(src)signame.c $(src)strcache.c $(src)variable.c $(src)version.c $(src)vpath.c
|
||||
glob_SOURCES = $(lib)fnmatch.c $(lib)glob.c
|
||||
loadavg_SOURCES = $(lib)getloadavg.c
|
||||
alloca_SOURCES = $(lib)alloca.c
|
||||
w32_SOURCES = $(src)w32/pathstuff.c $(src)w32/w32os.c $(src)w32/compat/dirent.c $(src)w32/compat/posixfcn.c $(src)w32/subproc/misc.c $(src)w32/subproc/sub_proc.c $(src)w32/subproc/w32err.c
|
||||
vms_SOURCES = $(src)vms_exit.c $(src)vms_export_symbol.c $(src)vms_progname.c $(src)vmsfunctions.c $(src)vmsify.c
|
||||
amiga_SOURCES = $(src)amiga.c
|
||||
|
||||
remote_SOURCES = $(src)remote-stub.c
|
||||
|
||||
OUTDIR =
|
||||
SRCDIR = .
|
||||
|
||||
OBJEXT = o
|
||||
EXEEXT =
|
||||
|
||||
PREFIX = /usr/local
|
||||
INCLUDEDIR = $(PREFIX)/include
|
||||
LIBDIR = $(PREFIX)/lib
|
||||
LOCALEDIR = $(PREFIX)/share
|
||||
|
||||
PROG = $(OUTDIR)make$(EXEEXT)
|
||||
|
||||
prog_SOURCES = $(make_SOURCES) $(remote_SOURCES)
|
||||
|
||||
BUILT_SOURCES =
|
||||
|
||||
OBJECTS = $(patsubst %.c,$(OUTDIR)%.$(OBJEXT),$(prog_SOURCES))
|
||||
|
||||
OBJDIRS = $(addsuffix .,$(sort $(dir $(OBJECTS))))
|
||||
|
||||
# Use the default value of CC
|
||||
LD = $(CC)
|
||||
|
||||
# Reserved for command-line override
|
||||
CPPFLAGS =
|
||||
CFLAGS = -g -O2
|
||||
LDFLAGS =
|
||||
|
||||
extra_CPPFLAGS = -DHAVE_CONFIG_H -I$(OUTDIR)src -I$(SRCDIR)/src -I$(OUTDIR)lib -I$(SRCDIR)/lib \
|
||||
-DLIBDIR=\"$(LIBDIR)\" -DINCLUDEDIR=\"$(INCLUDEDIR)\" -DLOCALEDIR=\"$(LOCALDIR)\"
|
||||
extra_CFLAGS =
|
||||
extra_LDFLAGS = $(extra_CFLAGS) $(CFLAGS)
|
||||
|
||||
C_SOURCE = -c
|
||||
OUTPUT_OPTION = -o $@
|
||||
LINK_OUTPUT = -o $@
|
||||
|
||||
# Command lines
|
||||
|
||||
# $(call COMPILE.cmd,<src>,<tgt>)
|
||||
COMPILE.cmd = $(CC) $(extra_CFLAGS) $(CFLAGS) $(extra_CPPFLAGS) $(CPPFLAGS) $(TARGET_ARCH) $(OUTPUT_OPTION) $(C_SOURCE) $1
|
||||
|
||||
# $(call LINK.cmd,<objectlist>)
|
||||
LINK.cmd = $(LD) $(extra_LDFLAGS) $(LDFLAGS) $(TARGET_ARCH) $1 $(LDLIBS) $(LINK_OUTPUT)
|
||||
|
||||
# $(CHECK.cmd) $(CHECK.args)
|
||||
CHECK.cmd = cd $(SRCDIR)/tests && ./run_make_tests -make $(shell cd $(<D) && pwd)/$(<F)
|
||||
CHECK.args ?=
|
||||
|
||||
# $(call MKDIR.cmd,<dirlist>)
|
||||
MKDIR.cmd = mkdir -p $1
|
||||
|
||||
# $(call RM.cmd,<filelist>)
|
||||
RM.cmd = rm -f $1
|
||||
|
||||
# $(call CP.cmd,<from>,<to>)
|
||||
CP.cmd = cp $1 $2
|
||||
|
||||
CLEANSPACE = $(call RM.cmd,$(OBJECTS) $(PROG) $(BUILT_SOURCES))
|
||||
|
||||
# Load overrides for the above variables.
|
||||
include $(firstword $(wildcard $(SRCDIR)/mk/$(lastword $(subst -, ,$(MAKE_HOST)).mk)))
|
||||
|
||||
VPATH = $(SRCDIR)
|
||||
|
||||
all: $(PROG)
|
||||
|
||||
$(PROG): $(OBJECTS)
|
||||
$(call LINK.cmd,$^)
|
||||
|
||||
$(OBJECTS): $(OUTDIR)%.$(OBJEXT): %.c
|
||||
$(call COMPILE.cmd,$<)
|
||||
|
||||
$(OBJECTS): | $(OBJDIRS) $(BUILT_SOURCES)
|
||||
|
||||
$(OBJDIRS):
|
||||
$(call MKDIR.cmd,$@)
|
||||
|
||||
check:
|
||||
$(CHECK.cmd) $(CHECK.args)
|
||||
|
||||
clean:
|
||||
$(CLEANSPACE)
|
||||
|
||||
$(filter %.h,$(BUILT_SOURCES)): %.h : %.in.h
|
||||
$(call RM.cmd,$@)
|
||||
$(call CP.cmd,$<,$@)
|
||||
|
||||
.PHONY: all check clean
|
||||
|
||||
# --------------- DEPENDENCIES
|
||||
#
|
||||
|
||||
$(OBJECTS): $(SRCDIR)/src/mkconfig.h
|
||||
|
||||
# src/.deps/amiga.Po
|
||||
# dummy
|
||||
|
||||
# src/.deps/ar.Po
|
||||
# dummy
|
||||
|
||||
# src/.deps/arscan.Po
|
||||
# dummy
|
||||
|
||||
# src/.deps/commands.Po
|
||||
# dummy
|
||||
|
||||
# src/.deps/default.Po
|
||||
# dummy
|
||||
|
||||
# src/.deps/dir.Po
|
||||
# dummy
|
||||
|
||||
# src/.deps/expand.Po
|
||||
# dummy
|
||||
|
||||
# src/.deps/file.Po
|
||||
# dummy
|
||||
|
||||
# src/.deps/function.Po
|
||||
# dummy
|
||||
|
||||
# src/.deps/getopt.Po
|
||||
# dummy
|
||||
|
||||
# src/.deps/getopt1.Po
|
||||
# dummy
|
||||
|
||||
# src/.deps/guile.Po
|
||||
# dummy
|
||||
|
||||
# src/.deps/hash.Po
|
||||
# dummy
|
||||
|
||||
# src/.deps/implicit.Po
|
||||
# dummy
|
||||
|
||||
# src/.deps/job.Po
|
||||
# dummy
|
||||
|
||||
# src/.deps/load.Po
|
||||
# dummy
|
||||
|
||||
# src/.deps/loadapi.Po
|
||||
# dummy
|
||||
|
||||
# src/.deps/main.Po
|
||||
# dummy
|
||||
|
||||
# src/.deps/misc.Po
|
||||
# dummy
|
||||
|
||||
# src/.deps/output.Po
|
||||
# dummy
|
||||
|
||||
# src/.deps/posixos.Po
|
||||
# dummy
|
||||
|
||||
# src/.deps/read.Po
|
||||
# dummy
|
||||
|
||||
# src/.deps/remake.Po
|
||||
# dummy
|
||||
|
||||
# src/.deps/remote-cstms.Po
|
||||
# dummy
|
||||
|
||||
# src/.deps/remote-stub.Po
|
||||
# dummy
|
||||
|
||||
# src/.deps/rule.Po
|
||||
# dummy
|
||||
|
||||
# src/.deps/shuffle.Po
|
||||
# dummy
|
||||
|
||||
# src/.deps/signame.Po
|
||||
# dummy
|
||||
|
||||
# src/.deps/strcache.Po
|
||||
# dummy
|
||||
|
||||
# src/.deps/variable.Po
|
||||
# dummy
|
||||
|
||||
# src/.deps/version.Po
|
||||
# dummy
|
||||
|
||||
# src/.deps/vms_exit.Po
|
||||
# dummy
|
||||
|
||||
# src/.deps/vms_export_symbol.Po
|
||||
# dummy
|
||||
|
||||
# src/.deps/vms_progname.Po
|
||||
# dummy
|
||||
|
||||
# src/.deps/vmsfunctions.Po
|
||||
# dummy
|
||||
|
||||
# src/.deps/vmsify.Po
|
||||
# dummy
|
||||
|
||||
# src/.deps/vpath.Po
|
||||
# dummy
|
||||
@@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. 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
|
||||
them 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 prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. 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.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey 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;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If 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 convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU 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 that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
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.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
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.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
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
|
||||
state 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) <year> <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 3 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, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program 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, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU 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 Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<https://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,368 @@
|
||||
Installation Instructions
|
||||
*************************
|
||||
|
||||
Copyright (C) 1994-1996, 1999-2002, 2004-2017, 2020-2022 Free
|
||||
Software Foundation, Inc.
|
||||
|
||||
Copying and distribution of this file, with or without modification,
|
||||
are permitted in any medium without royalty provided the copyright
|
||||
notice and this notice are preserved. This file is offered as-is,
|
||||
without warranty of any kind.
|
||||
|
||||
Basic Installation
|
||||
==================
|
||||
|
||||
Briefly, the shell command './configure && make && make install'
|
||||
should configure, build, and install this package. The following
|
||||
more-detailed instructions are generic; see the 'README' file for
|
||||
instructions specific to this package. Some packages provide this
|
||||
'INSTALL' file but do not implement all of the features documented
|
||||
below. The lack of an optional feature in a given package is not
|
||||
necessarily a bug. More recommendations for GNU packages can be found
|
||||
in *note Makefile Conventions: (standards)Makefile Conventions.
|
||||
|
||||
The 'configure' shell script attempts to guess correct values for
|
||||
various system-dependent variables used during compilation. It uses
|
||||
those values to create a 'Makefile' in each directory of the package.
|
||||
It may also create one or more '.h' files containing system-dependent
|
||||
definitions. Finally, it creates a shell script 'config.status' that
|
||||
you can run in the future to recreate the current configuration, and a
|
||||
file 'config.log' containing compiler output (useful mainly for
|
||||
debugging 'configure').
|
||||
|
||||
It can also use an optional file (typically called 'config.cache' and
|
||||
enabled with '--cache-file=config.cache' or simply '-C') that saves the
|
||||
results of its tests to speed up reconfiguring. Caching is disabled by
|
||||
default to prevent problems with accidental use of stale cache files.
|
||||
|
||||
If you need to do unusual things to compile the package, please try
|
||||
to figure out how 'configure' could check whether to do them, and mail
|
||||
diffs or instructions to the address given in the 'README' so they can
|
||||
be considered for the next release. If you are using the cache, and at
|
||||
some point 'config.cache' contains results you don't want to keep, you
|
||||
may remove or edit it.
|
||||
|
||||
The file 'configure.ac' (or 'configure.in') is used to create
|
||||
'configure' by a program called 'autoconf'. You need 'configure.ac' if
|
||||
you want to change it or regenerate 'configure' using a newer version of
|
||||
'autoconf'.
|
||||
|
||||
The simplest way to compile this package is:
|
||||
|
||||
1. 'cd' to the directory containing the package's source code and type
|
||||
'./configure' to configure the package for your system.
|
||||
|
||||
Running 'configure' might take a while. While running, it prints
|
||||
some messages telling which features it is checking for.
|
||||
|
||||
2. Type 'make' to compile the package.
|
||||
|
||||
3. Optionally, type 'make check' to run any self-tests that come with
|
||||
the package, generally using the just-built uninstalled binaries.
|
||||
|
||||
4. Type 'make install' to install the programs and any data files and
|
||||
documentation. When installing into a prefix owned by root, it is
|
||||
recommended that the package be configured and built as a regular
|
||||
user, and only the 'make install' phase executed with root
|
||||
privileges.
|
||||
|
||||
5. Optionally, type 'make installcheck' to repeat any self-tests, but
|
||||
this time using the binaries in their final installed location.
|
||||
This target does not install anything. Running this target as a
|
||||
regular user, particularly if the prior 'make install' required
|
||||
root privileges, verifies that the installation completed
|
||||
correctly.
|
||||
|
||||
6. You can remove the program binaries and object files from the
|
||||
source code directory by typing 'make clean'. To also remove the
|
||||
files that 'configure' created (so you can compile the package for
|
||||
a different kind of computer), type 'make distclean'. There is
|
||||
also a 'make maintainer-clean' target, but that is intended mainly
|
||||
for the package's developers. If you use it, you may have to get
|
||||
all sorts of other programs in order to regenerate files that came
|
||||
with the distribution.
|
||||
|
||||
7. Often, you can also type 'make uninstall' to remove the installed
|
||||
files again. In practice, not all packages have tested that
|
||||
uninstallation works correctly, even though it is required by the
|
||||
GNU Coding Standards.
|
||||
|
||||
8. Some packages, particularly those that use Automake, provide 'make
|
||||
distcheck', which can by used by developers to test that all other
|
||||
targets like 'make install' and 'make uninstall' work correctly.
|
||||
This target is generally not run by end users.
|
||||
|
||||
Compilers and Options
|
||||
=====================
|
||||
|
||||
Some systems require unusual options for compilation or linking that
|
||||
the 'configure' script does not know about. Run './configure --help'
|
||||
for details on some of the pertinent environment variables.
|
||||
|
||||
You can give 'configure' initial values for configuration parameters
|
||||
by setting variables in the command line or in the environment. Here is
|
||||
an example:
|
||||
|
||||
./configure CC=c99 CFLAGS=-g LIBS=-lposix
|
||||
|
||||
*Note Defining Variables::, for more details.
|
||||
|
||||
Compiling For Multiple Architectures
|
||||
====================================
|
||||
|
||||
You can compile the package for more than one kind of computer at the
|
||||
same time, by placing the object files for each architecture in their
|
||||
own directory. To do this, you can use GNU 'make'. 'cd' to the
|
||||
directory where you want the object files and executables to go and run
|
||||
the 'configure' script. 'configure' automatically checks for the source
|
||||
code in the directory that 'configure' is in and in '..'. This is known
|
||||
as a "VPATH" build.
|
||||
|
||||
With a non-GNU 'make', it is safer to compile the package for one
|
||||
architecture at a time in the source code directory. After you have
|
||||
installed the package for one architecture, use 'make distclean' before
|
||||
reconfiguring for another architecture.
|
||||
|
||||
On MacOS X 10.5 and later systems, you can create libraries and
|
||||
executables that work on multiple system types--known as "fat" or
|
||||
"universal" binaries--by specifying multiple '-arch' options to the
|
||||
compiler but only a single '-arch' option to the preprocessor. Like
|
||||
this:
|
||||
|
||||
./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
|
||||
CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
|
||||
CPP="gcc -E" CXXCPP="g++ -E"
|
||||
|
||||
This is not guaranteed to produce working output in all cases, you
|
||||
may have to build one architecture at a time and combine the results
|
||||
using the 'lipo' tool if you have problems.
|
||||
|
||||
Installation Names
|
||||
==================
|
||||
|
||||
By default, 'make install' installs the package's commands under
|
||||
'/usr/local/bin', include files under '/usr/local/include', etc. You
|
||||
can specify an installation prefix other than '/usr/local' by giving
|
||||
'configure' the option '--prefix=PREFIX', where PREFIX must be an
|
||||
absolute file name.
|
||||
|
||||
You can specify separate installation prefixes for
|
||||
architecture-specific files and architecture-independent files. If you
|
||||
pass the option '--exec-prefix=PREFIX' to 'configure', the package uses
|
||||
PREFIX as the prefix for installing programs and libraries.
|
||||
Documentation and other data files still use the regular prefix.
|
||||
|
||||
In addition, if you use an unusual directory layout you can give
|
||||
options like '--bindir=DIR' to specify different values for particular
|
||||
kinds of files. Run 'configure --help' for a list of the directories
|
||||
you can set and what kinds of files go in them. In general, the default
|
||||
for these options is expressed in terms of '${prefix}', so that
|
||||
specifying just '--prefix' will affect all of the other directory
|
||||
specifications that were not explicitly provided.
|
||||
|
||||
The most portable way to affect installation locations is to pass the
|
||||
correct locations to 'configure'; however, many packages provide one or
|
||||
both of the following shortcuts of passing variable assignments to the
|
||||
'make install' command line to change installation locations without
|
||||
having to reconfigure or recompile.
|
||||
|
||||
The first method involves providing an override variable for each
|
||||
affected directory. For example, 'make install
|
||||
prefix=/alternate/directory' will choose an alternate location for all
|
||||
directory configuration variables that were expressed in terms of
|
||||
'${prefix}'. Any directories that were specified during 'configure',
|
||||
but not in terms of '${prefix}', must each be overridden at install time
|
||||
for the entire installation to be relocated. The approach of makefile
|
||||
variable overrides for each directory variable is required by the GNU
|
||||
Coding Standards, and ideally causes no recompilation. However, some
|
||||
platforms have known limitations with the semantics of shared libraries
|
||||
that end up requiring recompilation when using this method, particularly
|
||||
noticeable in packages that use GNU Libtool.
|
||||
|
||||
The second method involves providing the 'DESTDIR' variable. For
|
||||
example, 'make install DESTDIR=/alternate/directory' will prepend
|
||||
'/alternate/directory' before all installation names. The approach of
|
||||
'DESTDIR' overrides is not required by the GNU Coding Standards, and
|
||||
does not work on platforms that have drive letters. On the other hand,
|
||||
it does better at avoiding recompilation issues, and works well even
|
||||
when some directory options were not specified in terms of '${prefix}'
|
||||
at 'configure' time.
|
||||
|
||||
Optional Features
|
||||
=================
|
||||
|
||||
If the package supports it, you can cause programs to be installed
|
||||
with an extra prefix or suffix on their names by giving 'configure' the
|
||||
option '--program-prefix=PREFIX' or '--program-suffix=SUFFIX'.
|
||||
|
||||
Some packages pay attention to '--enable-FEATURE' options to
|
||||
'configure', where FEATURE indicates an optional part of the package.
|
||||
They may also pay attention to '--with-PACKAGE' options, where PACKAGE
|
||||
is something like 'gnu-as' or 'x' (for the X Window System). The
|
||||
'README' should mention any '--enable-' and '--with-' options that the
|
||||
package recognizes.
|
||||
|
||||
For packages that use the X Window System, 'configure' can usually
|
||||
find the X include and library files automatically, but if it doesn't,
|
||||
you can use the 'configure' options '--x-includes=DIR' and
|
||||
'--x-libraries=DIR' to specify their locations.
|
||||
|
||||
Some packages offer the ability to configure how verbose the
|
||||
execution of 'make' will be. For these packages, running './configure
|
||||
--enable-silent-rules' sets the default to minimal output, which can be
|
||||
overridden with 'make V=1'; while running './configure
|
||||
--disable-silent-rules' sets the default to verbose, which can be
|
||||
overridden with 'make V=0'.
|
||||
|
||||
Particular systems
|
||||
==================
|
||||
|
||||
On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC
|
||||
is not installed, it is recommended to use the following options in
|
||||
order to use an ANSI C compiler:
|
||||
|
||||
./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
|
||||
|
||||
and if that doesn't work, install pre-built binaries of GCC for HP-UX.
|
||||
|
||||
HP-UX 'make' updates targets which have the same timestamps as their
|
||||
prerequisites, which makes it generally unusable when shipped generated
|
||||
files such as 'configure' are involved. Use GNU 'make' instead.
|
||||
|
||||
On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
|
||||
parse its '<wchar.h>' header file. The option '-nodtk' can be used as a
|
||||
workaround. If GNU CC is not installed, it is therefore recommended to
|
||||
try
|
||||
|
||||
./configure CC="cc"
|
||||
|
||||
and if that doesn't work, try
|
||||
|
||||
./configure CC="cc -nodtk"
|
||||
|
||||
On Solaris, don't put '/usr/ucb' early in your 'PATH'. This
|
||||
directory contains several dysfunctional programs; working variants of
|
||||
these programs are available in '/usr/bin'. So, if you need '/usr/ucb'
|
||||
in your 'PATH', put it _after_ '/usr/bin'.
|
||||
|
||||
On Haiku, software installed for all users goes in '/boot/common',
|
||||
not '/usr/local'. It is recommended to use the following options:
|
||||
|
||||
./configure --prefix=/boot/common
|
||||
|
||||
Specifying the System Type
|
||||
==========================
|
||||
|
||||
There may be some features 'configure' cannot figure out
|
||||
automatically, but needs to determine by the type of machine the package
|
||||
will run on. Usually, assuming the package is built to be run on the
|
||||
_same_ architectures, 'configure' can figure that out, but if it prints
|
||||
a message saying it cannot guess the machine type, give it the
|
||||
'--build=TYPE' option. TYPE can either be a short name for the system
|
||||
type, such as 'sun4', or a canonical name which has the form:
|
||||
|
||||
CPU-COMPANY-SYSTEM
|
||||
|
||||
where SYSTEM can have one of these forms:
|
||||
|
||||
OS
|
||||
KERNEL-OS
|
||||
|
||||
See the file 'config.sub' for the possible values of each field. If
|
||||
'config.sub' isn't included in this package, then this package doesn't
|
||||
need to know the machine type.
|
||||
|
||||
If you are _building_ compiler tools for cross-compiling, you should
|
||||
use the option '--target=TYPE' to select the type of system they will
|
||||
produce code for.
|
||||
|
||||
If you want to _use_ a cross compiler, that generates code for a
|
||||
platform different from the build platform, you should specify the
|
||||
"host" platform (i.e., that on which the generated programs will
|
||||
eventually be run) with '--host=TYPE'.
|
||||
|
||||
Sharing Defaults
|
||||
================
|
||||
|
||||
If you want to set default values for 'configure' scripts to share,
|
||||
you can create a site shell script called 'config.site' that gives
|
||||
default values for variables like 'CC', 'cache_file', and 'prefix'.
|
||||
'configure' looks for 'PREFIX/share/config.site' if it exists, then
|
||||
'PREFIX/etc/config.site' if it exists. Or, you can set the
|
||||
'CONFIG_SITE' environment variable to the location of the site script.
|
||||
A warning: not all 'configure' scripts look for a site script.
|
||||
|
||||
Defining Variables
|
||||
==================
|
||||
|
||||
Variables not defined in a site shell script can be set in the
|
||||
environment passed to 'configure'. However, some packages may run
|
||||
configure again during the build, and the customized values of these
|
||||
variables may be lost. In order to avoid this problem, you should set
|
||||
them in the 'configure' command line, using 'VAR=value'. For example:
|
||||
|
||||
./configure CC=/usr/local2/bin/gcc
|
||||
|
||||
causes the specified 'gcc' to be used as the C compiler (unless it is
|
||||
overridden in the site shell script).
|
||||
|
||||
Unfortunately, this technique does not work for 'CONFIG_SHELL' due to an
|
||||
Autoconf limitation. Until the limitation is lifted, you can use this
|
||||
workaround:
|
||||
|
||||
CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash
|
||||
|
||||
'configure' Invocation
|
||||
======================
|
||||
|
||||
'configure' recognizes the following options to control how it
|
||||
operates.
|
||||
|
||||
'--help'
|
||||
'-h'
|
||||
Print a summary of all of the options to 'configure', and exit.
|
||||
|
||||
'--help=short'
|
||||
'--help=recursive'
|
||||
Print a summary of the options unique to this package's
|
||||
'configure', and exit. The 'short' variant lists options used only
|
||||
in the top level, while the 'recursive' variant lists options also
|
||||
present in any nested packages.
|
||||
|
||||
'--version'
|
||||
'-V'
|
||||
Print the version of Autoconf used to generate the 'configure'
|
||||
script, and exit.
|
||||
|
||||
'--cache-file=FILE'
|
||||
Enable the cache: use and save the results of the tests in FILE,
|
||||
traditionally 'config.cache'. FILE defaults to '/dev/null' to
|
||||
disable caching.
|
||||
|
||||
'--config-cache'
|
||||
'-C'
|
||||
Alias for '--cache-file=config.cache'.
|
||||
|
||||
'--quiet'
|
||||
'--silent'
|
||||
'-q'
|
||||
Do not print messages saying which checks are being made. To
|
||||
suppress all normal output, redirect it to '/dev/null' (any error
|
||||
messages will still be shown).
|
||||
|
||||
'--srcdir=DIR'
|
||||
Look for the package's source code in directory DIR. Usually
|
||||
'configure' can determine that directory automatically.
|
||||
|
||||
'--prefix=DIR'
|
||||
Use DIR as the installation prefix. *note Installation Names:: for
|
||||
more details, including other options available for fine-tuning the
|
||||
installation locations.
|
||||
|
||||
'--no-create'
|
||||
'-n'
|
||||
Run the configure checks, but stop before creating any output
|
||||
files.
|
||||
|
||||
'configure' also accepts some other, not widely useful, options. Run
|
||||
'configure --help' for more details.
|
||||
@@ -0,0 +1,221 @@
|
||||
# This is a -*-Makefile-*-, or close enough
|
||||
#
|
||||
# Copyright (C) 1997-2022 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 3 of the License, 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
|
||||
# this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
AUTOMAKE_OPTIONS = dist-lzip silent-rules std-options subdir-objects nostdinc
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
MAKE_HOST = @MAKE_HOST@
|
||||
|
||||
SUBDIRS = lib po doc
|
||||
|
||||
bin_PROGRAMS = make
|
||||
include_HEADERS = src/gnumake.h
|
||||
|
||||
man_MANS = doc/make.1
|
||||
|
||||
make_SRCS = src/ar.c src/arscan.c src/commands.c src/commands.h \
|
||||
src/debug.h src/default.c src/dep.h src/dir.c src/expand.c \
|
||||
src/file.c src/filedef.h src/function.c src/getopt.c \
|
||||
src/getopt.h src/getopt1.c src/gettext.h src/guile.c \
|
||||
src/hash.c src/hash.h src/implicit.c src/job.c src/job.h \
|
||||
src/load.c src/loadapi.c src/main.c src/makeint.h src/misc.c \
|
||||
src/os.h src/output.c src/output.h src/read.c src/remake.c \
|
||||
src/rule.c src/rule.h src/shuffle.h src/shuffle.c \
|
||||
src/signame.c src/strcache.c src/variable.c src/variable.h \
|
||||
src/version.c src/vpath.c
|
||||
|
||||
w32_SRCS = src/w32/pathstuff.c src/w32/w32os.c src/w32/compat/dirent.c \
|
||||
src/w32/compat/posixfcn.c src/w32/include/dirent.h \
|
||||
src/w32/include/dlfcn.h src/w32/include/pathstuff.h \
|
||||
src/w32/include/sub_proc.h src/w32/include/w32err.h \
|
||||
src/w32/subproc/misc.c src/w32/subproc/proc.h \
|
||||
src/w32/subproc/sub_proc.c src/w32/subproc/w32err.c
|
||||
|
||||
vms_SRCS = src/vms_exit.c src/vms_export_symbol.c src/vms_progname.c \
|
||||
src/vmsdir.h src/vmsfunctions.c src/vmsify.c
|
||||
|
||||
amiga_SRCS = src/amiga.c src/amiga.h
|
||||
|
||||
glob_SRCS = lib/fnmatch.c lib/fnmatch.h lib/glob.c lib/glob.h
|
||||
|
||||
alloca_SRCS = lib/alloca.c
|
||||
|
||||
loadavg_SRCS = lib/getloadavg.c
|
||||
|
||||
make_SOURCES = $(make_SRCS)
|
||||
EXTRA_make_SOURCES = $(amiga_SRCS) $(vms_SRCS)
|
||||
|
||||
if HAVE_GUILE
|
||||
_GUILE_CFLAGS = $(GUILE_CFLAGS)
|
||||
_GUILE_LIBS = $(GUILE_LIBS)
|
||||
else
|
||||
_GUILE_CFLAGS =
|
||||
_GUILE_LIBS =
|
||||
endif
|
||||
|
||||
make_LDADD = $(LIBOBJS) $(_GUILE_LIBS) lib/libgnu.a $(GETLOADAVG_LIBS) \
|
||||
@LIBINTL@
|
||||
|
||||
localedir = $(datadir)/locale
|
||||
|
||||
AM_CPPFLAGS = -Isrc -I$(top_srcdir)/src -Ilib -I$(top_srcdir)/lib \
|
||||
-DLIBDIR=\"$(libdir)\" -DLOCALEDIR=\"$(localedir)\"
|
||||
|
||||
# If prefix is not a standard location, look in prefix as well
|
||||
if !KNOWN_PREFIX
|
||||
AM_CPPFLAGS += -DINCLUDEDIR=\"$(includedir)\"
|
||||
endif
|
||||
|
||||
AM_CFLAGS = $(_GUILE_CFLAGS)
|
||||
|
||||
if WINDOWSENV
|
||||
make_SOURCES += $(w32_SRCS)
|
||||
AM_CPPFLAGS += -I $(top_srcdir)/src/w32/include
|
||||
else
|
||||
make_SOURCES += src/posixos.c
|
||||
endif
|
||||
|
||||
if USE_CUSTOMS
|
||||
make_SOURCES += src/remote-cstms.c
|
||||
else
|
||||
make_SOURCES += src/remote-stub.c
|
||||
endif
|
||||
|
||||
# Extra stuff to include in the distribution.
|
||||
|
||||
mk_FILES = Basic.mk mk/msdosdjgpp.mk mk/Amiga.mk mk/VMS.mk mk/Windows32.mk
|
||||
# We don't need this, since the standard automake output will do.
|
||||
#mk/Posix.mk.in
|
||||
|
||||
m4_FILES = m4/gnulib-cache.m4
|
||||
|
||||
test_FILES = tests/run_make_tests tests/run_make_tests.bat \
|
||||
tests/run_make_tests.pl tests/test_driver.pl \
|
||||
tests/config-flags.pm.in tests/config_flags_pm.com \
|
||||
tests/config-flags.pm.W32 \
|
||||
tests/mkshadow tests/thelp.pl tests/guile.supp tests/README
|
||||
# test/scripts are added via dist-hook below.
|
||||
|
||||
EXTRA_DIST = ChangeLog INSTALL README build.sh build.cfg.in $(man_MANS) \
|
||||
src/mkconfig.h README.customs README.OS2 \
|
||||
README.Amiga SCOPTIONS src/config.ami \
|
||||
README.DOS builddos.bat src/configh.dos \
|
||||
README.W32 build_w32.bat src/config.h.W32 \
|
||||
README.VMS makefile.com src/config.h-vms src/vmsjobs.c \
|
||||
vms_export_symbol_test.com \
|
||||
src/gmk-default.scm src/gmk-default.h \
|
||||
$(mk_FILES) $(m4_FILES) $(test_FILES)
|
||||
|
||||
# --------------- Generate the Guile default module content
|
||||
|
||||
src/guile.$(OBJEXT): src/gmk-default.h
|
||||
src/gmk-default.h: $(top_srcdir)/src/gmk-default.scm
|
||||
(echo 'static const char *const GUILE_module_defn = " '\\ \
|
||||
&& sed -e 's/;.*//' -e '/^[ \t]*$$/d' -e 's/"/\\"/g' -e 's/$$/ \\/' \
|
||||
$(top_srcdir)/src/gmk-default.scm \
|
||||
&& echo '";') > src/gmk-default.h
|
||||
|
||||
# --------------- Local DIST Section
|
||||
|
||||
# Install the mk and tests subdirectories
|
||||
#
|
||||
dist-hook:
|
||||
(cd $(top_srcdir); \
|
||||
sub=`find tests/scripts -follow \( -name .git -o -name .deps -o -name work -o -name .gitignore -o -name \*.orig -o -name \*.rej -o -name \*~ -o -name \*.out -o -name Makefile \) -prune -o -type f -print`; \
|
||||
$(AMTAR) chf - $$sub) \
|
||||
| (cd $(distdir); $(AMTAR) xfBp -)
|
||||
|
||||
|
||||
# --------------- Local CHECK Section
|
||||
|
||||
check-local: check-regression
|
||||
@banner=" Regression PASSED: $(PACKAGE_STRING) ($(MAKE_HOST)) built with $(CC) "; \
|
||||
dashes=`echo "$$banner" | sed s/./=/g`; \
|
||||
echo; \
|
||||
echo "$$dashes"; \
|
||||
echo "$$banner"; \
|
||||
echo "$$dashes"; \
|
||||
echo
|
||||
|
||||
# > check-regression
|
||||
#
|
||||
# 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 =
|
||||
|
||||
.PHONY: check-regression
|
||||
|
||||
GMK_OUTDIR = ..
|
||||
|
||||
testlog = test-suite.log
|
||||
testresult = tests/.test-result
|
||||
errorpre = makeerror-$(PACKAGE_VERSION)-$(host_triplet)
|
||||
|
||||
testfiles = $(testlog) $(testresult) $(errorfile)
|
||||
MOSTLYCLEANFILES = $(testfiles)
|
||||
|
||||
errordetails = config.status config.log src/config.h $(testlog) tests/work
|
||||
|
||||
# Create a 4-letter random sequence
|
||||
rand_value = c = "abcdefghijklmnopqrstuvwxyz0123456789"
|
||||
rand_char = substr(c,int(rand()*36),1)
|
||||
rand_string = $(AWK) 'BEGIN{srand(); $(rand_value); print $(rand_char) "" $(rand_char) "" $(rand_char) "" $(rand_char);}'
|
||||
|
||||
check-regression: tests/config-flags.pm
|
||||
@rm -f $(testfiles)
|
||||
@if test -f '$(top_srcdir)/tests/run_make_tests'; then \
|
||||
ulimit -n 128; \
|
||||
if $(PERL) -v >/dev/null 2>&1; then \
|
||||
case `cd '$(top_srcdir)'; pwd` in `pwd`) : ;; \
|
||||
*) test -d tests || mkdir tests; \
|
||||
rm -f srctests; \
|
||||
if ln -s '$(top_srcdir)/tests' srctests; then \
|
||||
for f in run_make_tests run_make_tests.pl test_driver.pl scripts thelp.pl; do \
|
||||
rm -f tests/$$f; ln -s ../srctests/$$f tests; \
|
||||
done; fi ;; \
|
||||
esac; \
|
||||
echo "cd tests && $(PERL) $(PERLFLAGS) ./run_make_tests.pl -srcdir $(abs_top_srcdir) -make $(GMK_OUTDIR)/make$(EXEEXT) $(MAKETESTFLAGS)"; \
|
||||
(cd tests && $(PERL) $(PERLFLAGS) ./run_make_tests.pl -srcdir '$(abs_top_srcdir)' -make '$(GMK_OUTDIR)/make$(EXEEXT)' $(MAKETESTFLAGS); echo $$? >.test-result) 2>&1 | tee $(testlog); \
|
||||
er=$$(cat $(testresult)); if test "$$er" -ne 0; then \
|
||||
dirnm="$(errorpre)-$$($(rand_string))"; fnm="$$dirnm.tar.gz"; \
|
||||
rm -rf "$$dirnm"; mkdir "$$dirnm"; \
|
||||
$(AMTAR) chf - $(errordetails) | (cd "$$dirnm"; $(AMTAR) xf -); \
|
||||
$(AMTAR) chf - "$$dirnm" | eval GZIP= gzip $(GZIP_ENV) -c >"$$fnm"; \
|
||||
echo "*** Testing FAILED! Details: $$fnm"; \
|
||||
echo '*** Please report to <$(PACKAGE_BUGREPORT)>'; echo; \
|
||||
exit $$er; \
|
||||
fi; \
|
||||
else \
|
||||
echo "Can't find a working Perl ($(PERL)); the test suite requires Perl."; \
|
||||
fi; \
|
||||
else \
|
||||
echo "Can't find the $(PACKAGE_NAME) test suite ($(top_srcdir)/tests)."; \
|
||||
fi
|
||||
|
||||
|
||||
# --------------- Maintainer's Section
|
||||
|
||||
# Tell automake that I haven't forgotten about this file and it will be
|
||||
# created before we build a distribution (see maintMakefile in the Git
|
||||
# distribution).
|
||||
|
||||
README:
|
||||
|
||||
@MAINT_MAKEFILE@
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,221 @@
|
||||
This directory contains the 4.4 release of GNU Make.
|
||||
|
||||
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.
|
||||
|
||||
If you are trying to build GNU Make from a Git clone rather than a downloaded
|
||||
source distribution, see the README.git file for instructions.
|
||||
|
||||
For source distribution building and installation instructions, see the file
|
||||
INSTALL.
|
||||
|
||||
If you need to build GNU Make and have no other 'make' program to use, you can
|
||||
use the shell script 'build.sh' instead. To do this, first run 'configure' as
|
||||
described in INSTALL. Then, instead of typing 'make' to build the program,
|
||||
type 'sh build.sh'. This will compile the program in the current directory.
|
||||
Then you will have a 'make' program that you can use for './make install', or
|
||||
whatever else.
|
||||
|
||||
Some systems' 'make' programs 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.
|
||||
GNU Make is copyright by the Free Software Foundation. Copyright notices
|
||||
condense sequential years into a range; e.g. "1987-1994" means all years
|
||||
from 1987 to 1994 inclusive.
|
||||
|
||||
Downloading
|
||||
-----------
|
||||
|
||||
GNU Make can be obtained in many different ways. See a description here:
|
||||
|
||||
https://www.gnu.org/software/software.html
|
||||
|
||||
|
||||
Documentation
|
||||
-------------
|
||||
|
||||
GNU Make is fully documented in the GNU Make manual, which is contained in
|
||||
this distribution as the file make.texi. You can also find on-line and
|
||||
preformatted (PostScript and DVI) versions at the FSF's web site. There is
|
||||
information there about ordering hardcopy documentation.
|
||||
|
||||
https://www.gnu.org/
|
||||
https://www.gnu.org/doc/doc.html
|
||||
https://www.gnu.org/manual/manual.html
|
||||
|
||||
|
||||
Development
|
||||
-----------
|
||||
|
||||
GNU Make development is hosted by Savannah, the FSF's online development
|
||||
management tool. Savannah is here:
|
||||
|
||||
https://savannah.gnu.org
|
||||
|
||||
And the GNU Make development page is here:
|
||||
|
||||
https://savannah.gnu.org/projects/make/
|
||||
|
||||
You can find most information concerning the development of GNU Make at
|
||||
this site.
|
||||
|
||||
|
||||
Regression Tests
|
||||
----------------
|
||||
|
||||
GNU Make contains a suite of regression tests. To run them use "make check"
|
||||
after building GNU Make. If they fail a tar package will be created
|
||||
containing useful information, which can be emailed (as an attachment) to
|
||||
the <bug-make@gnu.org> mailing list.
|
||||
|
||||
Please note that since these tests rely on known-good-output comparisons,
|
||||
they can show spurious failures on some systems (particularly non-POSIX systems
|
||||
such as Windows).
|
||||
|
||||
|
||||
Bug Reporting
|
||||
-------------
|
||||
|
||||
If you need help using GNU Make, try asking on <help-make@gnu.org>.
|
||||
|
||||
If you found a bug, you can send a 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 do not need to subscribe to these lists first.
|
||||
|
||||
You can also use the online bug tracking system in the Savannah GNU Make
|
||||
project to submit new problem reports or search for existing ones:
|
||||
|
||||
https://savannah.gnu.org/bugs/?group=make
|
||||
|
||||
We prefer to use the bug tracking system ONLY for bugs or enhancements,
|
||||
not for help requests: please use the mailing lists to get help.
|
||||
|
||||
|
||||
Submitting Patches
|
||||
------------------
|
||||
|
||||
If you'd like to propose a change to GNU Make, you can provide a patch with
|
||||
your changes. If you are making your changes in a Git workspace you can run
|
||||
"git format-patch" to create a patch file. If not, you can use the diff(1)
|
||||
utility to create a patch file; please use "diff -u".
|
||||
|
||||
Once you have a patch you can submit it in any of these ways:
|
||||
|
||||
* Create a bug on Savannah and add the patch as an attachment:
|
||||
https://savannah.gnu.org/bugs/?group=make&func=additem
|
||||
|
||||
* Send the patch via email to <bug-make@gnu.org>: be sure to add it as an
|
||||
attachment to avoid interference by email processors.
|
||||
|
||||
All non-trivial changes require FSF copyright paperwork to be completed
|
||||
before they can be accepted. Contact <bug-make@gnu.org> for help.
|
||||
|
||||
|
||||
Git Access
|
||||
----------
|
||||
|
||||
The GNU Make source repository is available via Git from the GNU Savannah Git
|
||||
server; look here for details:
|
||||
|
||||
https://savannah.gnu.org/git/?group=make
|
||||
|
||||
Please note: you won't be able to build GNU Make from Git without installing
|
||||
appropriate maintainer's tools, such as GNU m4, automake, autoconf, Perl, GNU
|
||||
make, and GCC.
|
||||
|
||||
See the README.git file for instructions on how to build GNU Make once these
|
||||
tools are available. We make no guarantees about the contents or quality of
|
||||
the latest code in the Git repository: it is not unheard of for code that is
|
||||
known to be broken to be checked in. Use at your own risk.
|
||||
|
||||
|
||||
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.
|
||||
|
||||
The standard /bin/sh on SunOS 4.1.3_U1 and 4.1.4 is broken and cannot be
|
||||
used to configure GNU Make. Please install a different shell such as
|
||||
bash or pdksh in order to run "configure". See this message for more
|
||||
information:
|
||||
https://mail.gnu.org/archive/html/bug-autoconf/2003-10/msg00190.html
|
||||
|
||||
One area that is often a problem in configuration and porting is the code
|
||||
to check the system's current load average. To make it easier to test and
|
||||
debug this code, you can do 'make check-loadavg' to see if it works
|
||||
properly on your system. (You must run 'configure' beforehand, but you
|
||||
need not build 'make' itself to run this test.)
|
||||
|
||||
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.
|
||||
|
||||
On systems that support micro- and nano-second timestamp values and
|
||||
where stat(2) provides this information, GNU Make will use it when
|
||||
comparing timestamps to get the most accurate possible result. However,
|
||||
note that many current implementations of tools that *set* timestamps do
|
||||
not preserve micro- or nano-second granularity. This means that "cp -p"
|
||||
and other similar tools (tar, etc.) may not exactly duplicate timestamps
|
||||
with micro- and nano-second granularity on some systems. If your build
|
||||
system contains rules that depend on proper behavior of tools like "cp
|
||||
-p", you should consider using the .LOW_RESOLUTION_TIME pseudo-target to
|
||||
force make to treat them properly. See the manual for details.
|
||||
|
||||
|
||||
Ports
|
||||
-----
|
||||
|
||||
- See README.customs for details on integrating GNU Make with the
|
||||
Customs distributed build environment from the Pmake distribution.
|
||||
|
||||
- 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.
|
||||
|
||||
A precompiled binary of the MSDOS port of GNU Make is available as part
|
||||
of DJGPP; see the WWW page https://www.delorie.com/djgpp/ for more
|
||||
information.
|
||||
|
||||
The Cygwin project maintains its own port of GNU Make. That port may have
|
||||
patches which are not present in this version. If you are using Cygwin
|
||||
you should use their version of GNU Make, and if you have questions about
|
||||
it you should start by asking on those mailing lists and forums.
|
||||
|
||||
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!
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 1988-2022 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 3 of the License, 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
|
||||
this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
@@ -0,0 +1,80 @@
|
||||
Short: Port of GNU Make with SAS/C (no ixemul.library required)
|
||||
Author: GNU, Amiga port by Aaron "Optimizer" Digulla
|
||||
Uploader: Aaron "Optimizer" Digulla (digulla@fh-konstanz.de)
|
||||
Type: dev/c
|
||||
|
||||
This is a pure Amiga port of GNU Make. It needs no extra libraries or
|
||||
anything. It has the following features (in addition to any features of
|
||||
GNU Make):
|
||||
|
||||
- Runs Amiga-Commands with SystemTags() (Execute)
|
||||
- Can run multi-line statements
|
||||
- Allows to use Device-Names in targets:
|
||||
|
||||
c:make : make.o
|
||||
|
||||
is ok. To distinguish between device-names and target : or ::, MAKE
|
||||
looks for spaces. If there are any around :, it's taken as a target
|
||||
delimiter, if there are none, it's taken as the name of a device. Note
|
||||
that "make:make.o" tries to create "make.o" on the device "make:".
|
||||
- Replaces @@ by a newline in any command line:
|
||||
|
||||
if exists make @@\
|
||||
delete make.bak quiet @@\
|
||||
rename make make.bak @@\
|
||||
endif @@\
|
||||
$(CC) Link Make.o To make
|
||||
|
||||
works. Note that the @@ must stand alone (i.e., "make@@\" is illegal).
|
||||
Also be careful that there is a space after the "\" (i.e., at the
|
||||
beginning of the next line).
|
||||
- Can be made resident to save space and time
|
||||
- Amiga specific wildcards can be used in $(wildcard ...)
|
||||
|
||||
BUGS:
|
||||
- The line
|
||||
|
||||
dummy.h : src/*.c
|
||||
|
||||
tries to make dummy.h from "src/*.c" (i.e., no wildcard-expansion takes
|
||||
place). You have to use "$(wildcard src/*.c)" instead.
|
||||
|
||||
COMPILING FROM SCRATCH
|
||||
----------------------
|
||||
|
||||
To recompile, you need SAS/C 6.51.
|
||||
|
||||
As of GNU Make 4.3, the build environment has been cleaned up and alternate
|
||||
make files (including smakefiles) have been removed. If you have an existing
|
||||
version of GNU Make available you _should_ be able to run:
|
||||
|
||||
make -f Basic.mk
|
||||
|
||||
However this is untested.
|
||||
|
||||
If you have an Amiga system and would like to collaborate on getting
|
||||
bootstrapping to work properly please contact bug-make@gnu.org.
|
||||
|
||||
INSTALLATION
|
||||
|
||||
Copy make somewhere in your search path (e.g., sc:c or sc:bin).
|
||||
If you plan to use recursive makes, install make resident:
|
||||
|
||||
Resident make Add
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 1995-2022 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 3 of the License, 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
|
||||
this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
@@ -0,0 +1,296 @@
|
||||
Port of GNU Make to 32-bit protected mode on MSDOS and MS-Windows.
|
||||
|
||||
Builds with DJGPP v2 port of GNU C/C++ compiler and utilities.
|
||||
|
||||
|
||||
New (since 3.74) DOS-specific features:
|
||||
|
||||
1. Supports long filenames when run from DOS box on Windows 9x.
|
||||
|
||||
2. Supports both stock DOS COMMAND.COM and Unix-style shells
|
||||
(details in 'Notes' below).
|
||||
|
||||
3. Supports DOS drive letters in dependencies and pattern rules.
|
||||
|
||||
4. Better support for DOS-style backslashes in pathnames (but see
|
||||
'Notes' below).
|
||||
|
||||
5. The $(shell) built-in can run arbitrary complex commands,
|
||||
including pipes and redirection, even when COMMAND.COM is your
|
||||
shell.
|
||||
|
||||
6. Can be built without floating-point code (see below).
|
||||
|
||||
7. Supports signals in child programs and restores the original
|
||||
directory if the child was interrupted.
|
||||
|
||||
8. Can be built without (a previous version of) Make.
|
||||
|
||||
9. The build process requires only standard tools. (Optional
|
||||
targets like "check:" 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 install a binary distribution:
|
||||
|
||||
Simply unzip the makNNNb.zip file (where NNN is the version number)
|
||||
preserving the directory structure (-d switch if you use PKUNZIP).
|
||||
If you are installing Make on Windows 9X or Windows 2000, use an
|
||||
unzip program that supports long filenames in zip files. After
|
||||
unzipping, make sure the directory with make.exe is on your PATH,
|
||||
and that's all you need to use Make.
|
||||
|
||||
|
||||
To build from sources:
|
||||
|
||||
1. Unzip the archive, preserving the directory structure (-d switch
|
||||
if you use PKUNZIP). If you build Make on Windows 9X or Windows
|
||||
2000, use an unzip program that supports long filenames in zip
|
||||
files.
|
||||
|
||||
If you are unpacking an official GNU source distribution, use
|
||||
either DJTAR (which is part of the DJGPP development
|
||||
environment), or the DJGPP port of GNU Tar.
|
||||
|
||||
2. If you have a working Make already, you can run:
|
||||
|
||||
make -f Basic.mk
|
||||
|
||||
3. If you don't have a working Make already you can bootstrap one
|
||||
by running:
|
||||
|
||||
.\builddos.bat
|
||||
|
||||
4. If you are building from outside of the source directory, you
|
||||
need to tell Make where the sources are, like this:
|
||||
|
||||
make -f c:/djgpp/gnu/make/Basic.mk SRCDIR=c:/djgpp/gnu/make
|
||||
|
||||
or:
|
||||
|
||||
c:/djgpp/gnu/make/builddos.bat c:/djgpp/gnu/make
|
||||
|
||||
5. 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.
|
||||
|
||||
6. To install copy make.exe to the preferred location.
|
||||
|
||||
Since GNU Make 4.3, support for customized platform installations
|
||||
has been removed. If you'd like to collaborate on reinstating
|
||||
these capabilities, contact bug-make@gnu.org.
|
||||
|
||||
|
||||
Notes:
|
||||
-----
|
||||
|
||||
1. The shell issue.
|
||||
|
||||
This is probably the most significant improvement, first
|
||||
introduced in the port of GNU Make 3.75.
|
||||
|
||||
The original behavior of GNU Make is to invoke commands
|
||||
directly, as long as they don't include characters special to
|
||||
the shell or internal shell commands, because that is faster.
|
||||
When shell features like redirection or filename wildcards are
|
||||
involved, Make calls the shell.
|
||||
|
||||
This port supports both DOS shells (the stock COMMAND.COM and its
|
||||
4DOS/NDOS replacements), and Unix-style shells (tested with the
|
||||
venerable Stewartson's 'ms_sh' 2.3 and the DJGPP port of 'bash' by
|
||||
Daisuke Aoyama <jack@st.rim.or.jp>).
|
||||
|
||||
When the $SHELL variable points to a Unix-style shell, Make
|
||||
works just like you'd expect on Unix, calling the shell for any
|
||||
command that involves characters special to the shell or
|
||||
internal shell commands. The only difference is that, since
|
||||
there is no standard way to pass command lines longer than the
|
||||
infamous DOS 126-character limit, this port of Make writes the
|
||||
command line to a temporary disk file and then invokes the shell
|
||||
on that file.
|
||||
|
||||
If $SHELL points to a DOS-style shell, however, Make will not
|
||||
call it automatically, as it does with Unix shells. Stock
|
||||
COMMAND.COM is too dumb and would unnecessarily limit the
|
||||
functionality of Make. For example, you would not be able to
|
||||
use long command lines in commands that use redirection or
|
||||
pipes. Therefore, when presented with a DOS shell, this port of
|
||||
Make will emulate most of the shell functionality, like
|
||||
redirection and pipes, and shall only call the shell when a
|
||||
batch file or a command internal to the shell is invoked. (Even
|
||||
when a command is an internal shell command, Make will first
|
||||
search the $PATH for it, so that if a Makefile calls 'mkdir',
|
||||
you can install, say, a port of GNU 'mkdir' and have it called
|
||||
in that case.)
|
||||
|
||||
The key to all this is the extended functionality of 'spawn' and
|
||||
'system' functions from the DJGPP library; this port just calls
|
||||
'system' where it would invoke the shell on Unix. The most
|
||||
important aspect of these functions is that they use a special
|
||||
mechanism to pass long (up to 16KB) command lines to DJGPP
|
||||
programs. In addition, 'system' emulates some internal
|
||||
commands, like 'cd' (so that you can now use forward slashes
|
||||
with it, and can also change the drive if the directory is on
|
||||
another drive). Another aspect worth mentioning is that you can
|
||||
call Unix shell scripts directly, provided that the shell whose
|
||||
name is mentioned on the first line of the script is installed
|
||||
anywhere along the $PATH. It is impossible to tell here
|
||||
everything about these functions; refer to the DJGPP library
|
||||
reference for more details.
|
||||
|
||||
The $(shell) built-in is implemented in this port by calling
|
||||
'popen'. Since 'popen' calls 'system', the above considerations
|
||||
are valid for $(shell) as well. In particular, you can put
|
||||
arbitrary complex commands, including pipes and redirection,
|
||||
inside $(shell), which is in many cases a valid substitute for
|
||||
the Unix-style command substitution (`command`) feature.
|
||||
|
||||
|
||||
2. "SHELL=/bin/sh" -- or is it?
|
||||
|
||||
Many Unix Makefiles include a line which sets the SHELL, for
|
||||
those versions of Make which don't have this as the default.
|
||||
Since many DOS systems don't have 'sh' installed (in fact, most
|
||||
of them don't even have a '/bin' directory), this port takes
|
||||
such directives with a grain of salt. It will only honor such a
|
||||
directive if the basename of the shell name (like 'sh' in the
|
||||
above example) can indeed be found in the directory that is
|
||||
mentioned in the SHELL= line ('/bin' in the above example), or
|
||||
in the current working directory, or anywhere on the $PATH (in
|
||||
that order). If the basename doesn't include a filename
|
||||
extension, Make will look for any known extension that indicates
|
||||
an executable file (.exe, .com, .bat, .btm, .sh, and even .sed
|
||||
and .pl). If any such file is found, then $SHELL will be
|
||||
defined to the exact pathname of that file, and that shell will
|
||||
hence be used for the rest of processing. But if the named
|
||||
shell is *not* found, the line which sets it will be effectively
|
||||
ignored, leaving the value of $SHELL as it was before. Since a
|
||||
lot of decisions that this port makes depend on the gender of
|
||||
the shell, I feel it doesn't make any sense to tailor Make's
|
||||
behavior to a shell which is nowhere to be found.
|
||||
|
||||
Note that the above special handling of "SHELL=" only happens
|
||||
for Makefiles; if you set $SHELL in the environment or on the
|
||||
Make command line, you are expected to give the complete
|
||||
pathname of the shell, including the filename extension.
|
||||
|
||||
The default value of $SHELL is computed as on Unix (see the Make
|
||||
manual for details), except that if $SHELL is not defined in the
|
||||
environment, $COMSPEC is used. Also, if an environment variable
|
||||
named $MAKESHELL is defined, it takes precedence over both
|
||||
$COMSPEC and $SHELL. Note that, unlike Unix, $SHELL in the
|
||||
environment *is* used to set the shell (since on MSDOS, it's
|
||||
unlikely that the interactive shell will not be suitable for
|
||||
Makefile processing).
|
||||
|
||||
The bottom line is that you can now write Makefiles where some
|
||||
of the targets require a real (i.e. Unix-like) shell, which will
|
||||
nevertheless work when such shell is not available (provided, of
|
||||
course, that the commands which should always work, don't
|
||||
require such a shell). More important, you can convert Unix
|
||||
Makefiles to MSDOS and leave the line which sets the shell
|
||||
intact, so that people who do have Unixy shell could use it for
|
||||
targets which aren't converted to DOS (like 'install' and
|
||||
'uninstall', for example).
|
||||
|
||||
|
||||
3. Default directories.
|
||||
|
||||
GNU Make knows about standard directories where it searches for
|
||||
library and include files mentioned in the Makefile. Since
|
||||
MSDOS machines don't have standard places for these, this port
|
||||
will search ${DJDIR}/lib and ${DJDIR}/include respectively.
|
||||
$DJDIR is defined automatically by the DJGPP startup code as the
|
||||
root of the DJGPP installation tree (unless you've tampered with
|
||||
the DJGPP.ENV file). This should provide reasonable default
|
||||
values, unless you moved parts of DJGPP to other directories.
|
||||
|
||||
|
||||
4. Letter-case in filenames.
|
||||
|
||||
If you run Make on Windows 9x, you should be aware of the
|
||||
letter-case issue. Make is internally case-sensitive, but all
|
||||
file operations are case-insensitive on Windows 9x, so
|
||||
e.g. files 'FAQ', 'faq' and 'Faq' all refer to the same file, as
|
||||
far as Windows is concerned. The underlying DJGPP C library
|
||||
functions honor the letter-case of the filenames they get from
|
||||
the OS, except that by default, they down-case 8+3 DOS filenames
|
||||
which are stored in upper case in the directory and would break
|
||||
many Makefiles otherwise. (The details of which filenames are
|
||||
converted to lower case are explained in the DJGPP libc docs,
|
||||
under the '_preserve_fncase' and '_lfn_gen_short_fname'
|
||||
functions, but as a thumb rule, any filename that is stored in
|
||||
upper case in the directory, is a valid DOS 8+3 filename and
|
||||
doesn't include characters invalid on MSDOS FAT filesystems,
|
||||
will be automatically down-cased.) User reports that I have
|
||||
indicate that this default behavior is generally what you'd
|
||||
expect; however, your input is most welcome.
|
||||
|
||||
In any case, if you hit a situation where you must force Make to
|
||||
get the 8+3 DOS filenames in upper case, set FNCASE=y in the
|
||||
environment or in the Makefile.
|
||||
|
||||
|
||||
5. DOS-style pathnames.
|
||||
|
||||
There are a lot of places throughout the program sources which
|
||||
make implicit assumptions about the pathname syntax. In
|
||||
particular, the directories are assumed to be separated by '/',
|
||||
and any pathname which doesn't begin with a '/' is assumed to be
|
||||
relative to the current directory. This port attempts to
|
||||
support DOS-style pathnames which might include the drive letter
|
||||
and use backslashes instead of forward slashes. However, this
|
||||
support is not complete; I feel that pursuing this support too
|
||||
far might break some more important features, particularly if
|
||||
you use a Unix-style shell (where a backslash is a quote
|
||||
character). I only consider support of backslashes desirable
|
||||
because some Makefiles invoke non-DJGPP programs which don't
|
||||
understand forward slashes. A notable example of such programs
|
||||
is the standard programs which come with MSDOS. Otherwise, you
|
||||
are advised to stay away from backslashes whenever possible. In
|
||||
particular, filename globbing won't work on pathnames with
|
||||
backslashes, because the GNU 'glob' library doesn't support them
|
||||
(backslash is special in filename wildcards, and I didn't want
|
||||
to break that).
|
||||
|
||||
One feature which *does* work with backslashes is the filename-
|
||||
related built-in functions such as $(dir), $(notdir), etc.
|
||||
Drive letters in pathnames are also fully supported.
|
||||
|
||||
|
||||
|
||||
Bug reports:
|
||||
-----------
|
||||
|
||||
Bugs that are clearly related to the MSDOS/DJGPP port should be
|
||||
reported first on the comp.os.msdos.djgpp news group (if you cannot
|
||||
post to Usenet groups, write to the DJGPP mailing list,
|
||||
<djgpp@delorie.com>, which is an email gateway into the above news
|
||||
group). For other bugs, please follow the procedure explained in
|
||||
the "Bugs" chapter of the Info docs. If you don't have an Info
|
||||
reader, look up that chapter in the 'make.i1' file with any text
|
||||
browser/editor.
|
||||
|
||||
|
||||
Enjoy,
|
||||
Eli Zaretskii <eliz@is.elta.co.il>
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 1996-2022 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 3 of the License, 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
|
||||
this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
@@ -0,0 +1,176 @@
|
||||
Port of GNU Make to OS/2.
|
||||
|
||||
Features of GNU Make that do not work under OS/2:
|
||||
- remote job execution
|
||||
- dynamic load balancing
|
||||
|
||||
|
||||
Special features of the OS/2 version:
|
||||
|
||||
Due to the fact that some people might want to use sh syntax in
|
||||
Makefiles while others might want to use OS/2's native shell cmd.exe,
|
||||
GNU Make supports both shell types. The following list defines the order
|
||||
that is used to determine the shell:
|
||||
|
||||
1. The shell specified by the environment variable MAKESHELL.
|
||||
2. The shell specified by the SHELL variable within a Makefile. Like
|
||||
Unix, SHELL is NOT taken from the environment.
|
||||
3. The shell specified by the COMSPEC environment variable.
|
||||
4. The shell specified by the OS2_SHELL environment variable.
|
||||
5. If none of the above is defined /bin/sh is used as default. This
|
||||
happens e.g. in the make testsuite.
|
||||
|
||||
Note: - Points 3 and 4 can be turned off at compile time by adding
|
||||
-DNO_CMD_DEFAULT to the CPPFLAGS.
|
||||
- DOS support is not tested for EMX and therefore might not work.
|
||||
- The UNIXROOT environment variable is supported to find /bin/sh
|
||||
if it is not on the current drive.
|
||||
|
||||
|
||||
COMPILATION OF GNU MAKE FOR OS/2:
|
||||
|
||||
I. ***** SPECIAL OPTIONS *****
|
||||
|
||||
- At compile time you can turn off that cmd is used as default shell
|
||||
(but only /bin/sh). Simply set CPPFLAGS="-DNO_CMD_DEFAULT" and make
|
||||
will not use cmd unless you cause it to do so by setting MAKESHELL to
|
||||
cmd or by specifying SHELL=cmd in your Makefile.
|
||||
|
||||
- At compile time you can set CPPFLAGS="-DNO_CHDIR2" to turn off that
|
||||
GNU Make prints drive letters. This is necessary if you want to run
|
||||
the testsuite.
|
||||
|
||||
|
||||
II. ***** REQUIREMENTS FOR THE COMPILATION *****
|
||||
|
||||
A standard Unix like build environment:
|
||||
|
||||
- sh compatible shell (ksh, bash, ash, but tested only with pdksh 5.2.14
|
||||
release 2)
|
||||
If you use pdksh it is recommended to update to 5.2.14 release 2. Older
|
||||
versions may not work! You can get this version at
|
||||
https://www.math.ohio-state.edu/~ilya/software/os2/pdksh-5.2.14-bin-2.zip
|
||||
- GNU file utilities (make sure that install.exe from the file utilities
|
||||
is in front of your PATH before X:\OS2\INSTALL\INSTALL.EXE. I recommend
|
||||
also to change the filename to ginstall.exe instead of install.exe
|
||||
to avoid confusion with X:\OS2\INSTALL\INSTALL.EXE)
|
||||
- GNU shell utilities
|
||||
- GNU text utilities
|
||||
- gawk
|
||||
- grep
|
||||
- sed
|
||||
- GNU Make 3.79.1 (special OS/2 patched version) or higher
|
||||
- perl 5.005 or higher
|
||||
- GNU texinfo (you can use 3.1 (gnuinfo.zip), but I recommend 4.0)
|
||||
|
||||
If you want to recreate the configuration files (developers only!)
|
||||
you need also: GNU m4 1.4, autoconf 2.59, automake 1.9.6 (or compatible)
|
||||
|
||||
|
||||
III. ***** COMPILATION AND INSTALLATION *****
|
||||
|
||||
a) ** Developers only - Everyone else should skip this section **
|
||||
To recreate the configuration files use:
|
||||
|
||||
export EMXSHELL=ksh
|
||||
aclocal -I config
|
||||
automake
|
||||
autoconf
|
||||
autoheader
|
||||
|
||||
|
||||
b) Installation into x:/usr
|
||||
|
||||
Note: Although it is possible to compile make using "./configure",
|
||||
"make", "make install" this is not recommended. In particular,
|
||||
you must ALWAYS use LDFLAGS="-Zstack 0x6000" because the default
|
||||
stack size is far to small and make will not work properly!
|
||||
|
||||
Recommended environment variables and installation options:
|
||||
|
||||
export ac_executable_extensions=".exe"
|
||||
export CPPFLAGS="-D__ST_MT_ERRNO__"
|
||||
export CFLAGS="-O2 -Zomf -Zmt"
|
||||
export LDFLAGS="-Zcrtdll -Zlinker /exepack:2 -Zlinker /pm:vio -Zstack 0x6000"
|
||||
export RANLIB="echo"
|
||||
./configure --prefix=x:/usr --infodir=x:/usr/share/info --mandir=x:/usr/share/man --without-included-gettext
|
||||
make AR=emxomfar
|
||||
make install
|
||||
|
||||
Note: If you use gcc 2.9.x I recommend to set also LIBS="-lgcc"
|
||||
|
||||
Note: You can add -DNO_CMD_DEFAULT and -DNO_CHDIR2 to CPPFLAGS.
|
||||
See section I. for details.
|
||||
|
||||
|
||||
IV. ***** NLS support *****
|
||||
|
||||
GNU Make has NLS (National Language Support), with the following
|
||||
caveats:
|
||||
|
||||
a) It will only work with GNU gettext, and
|
||||
b) GNU gettext support is not included in the GNU Make package.
|
||||
|
||||
Therefore, if you wish to enable the internationalization features of
|
||||
GNU Make you must install GNU gettext on your system before configuring
|
||||
GNU Make.
|
||||
|
||||
You can choose the languages to be installed. To install support for
|
||||
English, German and French only enter:
|
||||
|
||||
export LINGUAS="en de fr"
|
||||
|
||||
If you don't specify LINGUAS all languages are installed.
|
||||
|
||||
If you don't want NLS support (English only) use the option
|
||||
--disable-nls for the configure script. Note if GNU gettext is not
|
||||
installed then NLS will not be enabled regardless of this flag.
|
||||
|
||||
|
||||
V. ***** Running the make test suite *****
|
||||
|
||||
To run the included make test suite you have to set
|
||||
|
||||
CPPFLAGS="-D__ST_MT_ERRNO__ -DNO_CMD_DEFAULT -DNO_CHDIR2"
|
||||
|
||||
before you compile make. This is due to some restrictions of the
|
||||
testsuite itself. -DNO_CMD_DEFAULT causes make to use /bin/sh as default
|
||||
shell in every case. Normally you could simply set MAKESHELL="/bin/sh"
|
||||
to do this but the testsuite ignores the environment. -DNO_CHDIR2 causes
|
||||
make not to use drive letters for directory names (i.e. _chdir2() and
|
||||
_getcwd2() are NOT used). The testsuite interprets the whole output of
|
||||
make, especially statements like make[1]: Entering directory
|
||||
'C:/somewhere/make-3.79.1/tests' where the testsuite does not expect the
|
||||
drive letter. This would be interpreted as an error even if there is
|
||||
none.
|
||||
|
||||
To run the testsuite do the following:
|
||||
|
||||
export CPPFLAGS="-D__ST_MT_ERRNO__ -DNO_CMD_DEFAULT -DNO_CHDIR2"
|
||||
export CFLAGS="-Zomf -O2 -Zmt"
|
||||
export LDFLAGS="-Zcrtdll -s -Zlinker /exepack:2 -Zlinker /pm:vio -Zstack 0x6000"
|
||||
export RANLIB="echo"
|
||||
./configure --prefix=x:/usr --disable-nls
|
||||
make AR=emxomfar
|
||||
make check
|
||||
|
||||
All tests should work fine with the exception of one of the "INCLUDE_DIRS"
|
||||
tests which will fail if your /usr/include directory is on a drive different
|
||||
from the make source tree.
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2003-2022 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 3 of the License, 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
|
||||
this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
@@ -0,0 +1,515 @@
|
||||
Overview: -*-text-mode-*-
|
||||
---------
|
||||
|
||||
This version of GNU Make has been tested on:
|
||||
OpenVMS V8.3/V8.4 (Alpha) and V8.4 (Integrity) AND V7.3 (VAX)
|
||||
|
||||
This version of GNU Make is intended to be run from DCL to run
|
||||
make scripts with a special syntax that is described below. It
|
||||
likely will not be able to run unmodified Unix makefiles.
|
||||
|
||||
There is an older implementation of GNU Make that was ported to GNV.
|
||||
Work is now in progress to merge that port to get a single version
|
||||
of GNU Make available. When that merge is done, GNU Make will auto
|
||||
detect that it is running under a POSIX shell and then operate as close to
|
||||
GNU Make on Unix as possible.
|
||||
|
||||
The descriptions below are for running GNU Make from DCL or equivalent.
|
||||
|
||||
Recipe differences:
|
||||
-------------------
|
||||
|
||||
GNU Make for OpenVMS can not currently run native Unix make files because of
|
||||
differences in the implementation.
|
||||
|
||||
I am trying to document the current behavior in this section. This is based
|
||||
on the information in the file NEWS. and running the test suite.
|
||||
TODO: More tests are needed to validate and demonstrate the OpenVMS
|
||||
expected behavior.
|
||||
|
||||
In some cases the older behavior of GNU Make when run from DCL is not
|
||||
compatible with standard makefile behavior.
|
||||
|
||||
This behavior can be changed when running GNU Make from DCL by setting
|
||||
either DCL symbols or logical names of the format GNV$. The settings
|
||||
are enabled with a string starting with one of '1', 'T', or 'E' for "1",
|
||||
"TRUE", or "ENABLE". They are disabled with a '0', 'F', or 'D' for "1",
|
||||
"FALSE", or "DISABLE". If they are not explicitly set to one of these
|
||||
values, then they will be set to their default values.
|
||||
|
||||
The value of the setting DECC$FILENAME_UNIX_REPORT or
|
||||
DECC$FILENAME_UNIX_ONLY will now cause the $(dir x) function to return
|
||||
'./' or '[]' as appropriate.
|
||||
|
||||
The name GNV$MAKE_OLD_VMS when enabled will cause GNU Make to behave as
|
||||
much as the older method as can be done with out disabling VMS features.
|
||||
When it is disabled GNU Make have the new behavior which more closely
|
||||
matches Unix Make behavior.
|
||||
|
||||
The default is currently the old behavior when running GNU Make from DCL.
|
||||
In the future this may change. When running make from GNV Bash the new
|
||||
behavior is the default.
|
||||
|
||||
This is a global setting that sets the default behavior for several other
|
||||
options that can be individually changed. Many of the individual settings
|
||||
are to make it so that the self tests for GNU Make need less VMS specific
|
||||
modifications.
|
||||
|
||||
The name GNV$MAKE_COMMA when enabled will cause GNU Make to expect a comma
|
||||
for a path separator and use a comma for the separator for a list of files.
|
||||
When disabled, it will cause GNU Make to use a colon for a path separator
|
||||
and a space for the separator for a list of files. The default is to be
|
||||
enabled if the GNU Make is set to the older behavior.
|
||||
|
||||
The name GNV$MAKE_SHELL_SIM when enabled will cause GNU Make to try to
|
||||
simulate a POSIX shell more closely. The following behaviors occur:
|
||||
|
||||
* Single quotes are converted to double quotes and any double
|
||||
quotes inside of them are doubled. No environment variable expansion
|
||||
is simulated.
|
||||
* A exit command status will be converted to a POSIX Exit
|
||||
where 0 is success and non-zero is failure.
|
||||
* The $ character will cause environment variable expansion.
|
||||
* Environment variables can be set on the command line before a command.
|
||||
|
||||
VMS generally uses logical name search lists instead of path variables
|
||||
where the resolution is handled by VMS independent of the program. Which
|
||||
means that it is likely that nothing will notice if the default path
|
||||
specifier is changed in the future.
|
||||
|
||||
Currently the built in VMS specific macros and recipes depend on the comma
|
||||
being used as a file list separator.
|
||||
TODO: Remove this dependency as other functions in GNU Make depend on a
|
||||
space being used as a separator.
|
||||
|
||||
The format for recipes are a combination of Unix macros, a subset of
|
||||
simulated UNIX commands, some shell emulation, and OpenVMS commands.
|
||||
This makes the resulting makefiles unique to the OpenVMS port of GNU Make.
|
||||
|
||||
If you are creating a OpenVMS specific makefile from scratch, you should also
|
||||
look at MMK (Madgoat Make) available at https://github.com/endlesssoftware/mmk
|
||||
MMK uses full OpenVMS syntax and a persistent sub-process is used for the
|
||||
recipe lines, allowing multiple line rules.
|
||||
|
||||
The default makefile search order is "makefile.vms", "gnumakefile",
|
||||
"makefile". TODO: See if that lookup is case sensitive.
|
||||
|
||||
When Make is invoked from DCL, it will create a foreign command
|
||||
using the name of executable image, with any facility prefix removed,
|
||||
for the duration of the make program, so it can be used internally
|
||||
to recursively run make(). The macro MAKE_COMMAND will be set to
|
||||
this foreign command.
|
||||
|
||||
When make is launched from an exec*() command from a C program,
|
||||
the foreign command is not created. The macro MAKE_COMMAND will be
|
||||
set to the actual command passed as argv[0] to the exec*() function.
|
||||
|
||||
If the DCL symbol or logical name GNV$MAKE_USE_MCR exists, then
|
||||
the macro MAKE_COMMAND will be set to be an "MCR" command with the
|
||||
absolute path used by DCL to launch make. The foreign command
|
||||
will not be created.
|
||||
|
||||
The macro MAKE is set to be the same value as the macro MAKE_COMMAND
|
||||
on all platforms.
|
||||
|
||||
Each recipe command is normally run as a separate spawned processes,
|
||||
except for the cases documented below where a temporary DCL command
|
||||
file may be used.
|
||||
|
||||
BUG: Testing has shown that the commands in the temporary command files
|
||||
are not always created properly. This issue is still under investigation.
|
||||
|
||||
Any macros marked as exported are temporarily created as DCL symbols
|
||||
for child images to use. DCL symbol substitution is not done with these
|
||||
commands.
|
||||
Untested: Symbol substitution.
|
||||
|
||||
When a temporary DCL command file is used, DCL symbol substitution
|
||||
will work.
|
||||
|
||||
For VMS 7.3-1 and earlier, command lines are limited to 255 characters
|
||||
or 1024 characters in a command file.
|
||||
For VMS 7.3-2 and later, command lines are limited to 4059 characters
|
||||
or 8192 characters in a command file.
|
||||
|
||||
VMS limits each token of a command line to 256 characters, and limits
|
||||
a command line to 127 tokens.
|
||||
|
||||
Command lines above the limit length are written to a command file
|
||||
in sys$scratch:.
|
||||
|
||||
In order to handle Unix style extensions to VMS DCL, GNU Make has
|
||||
parsed the recipe commands and them modified them as needed. The
|
||||
parser has been re-written to resolve numerous bugs in handling
|
||||
valid VMS syntax and potential buffer overruns.
|
||||
|
||||
The new parser may need whitespace characters where DCL does not require
|
||||
it, and also may require that quotes are matched were DCL forgives if
|
||||
they are not. There is a small chance that existing VMS specific makefiles
|
||||
will be affected.
|
||||
|
||||
The '<', '>' was previously implemented using command files. Now
|
||||
GNU Make will check to see if the is already a VMS "PIPE" command and
|
||||
if it is not, will convert the command to a VMS "PIPE" command.
|
||||
|
||||
The '>>' redirection has been implemented by using a temporary command file.
|
||||
This will be described later.
|
||||
|
||||
The DCL symbol or logical name GNV$MAKE_USE_CMD_FILE when set to a
|
||||
string starting with one of '1','T', or 'E' for "1", "TRUE", or "ENABLE",
|
||||
then temporary DCL command files are always used for running commands.
|
||||
|
||||
Some recipe strings with embedded new lines will not be handled correctly
|
||||
when a command file is used.
|
||||
|
||||
GNU Make generally does text comparisons for the targets and sources. The
|
||||
make program itself can handle either Unix or OpenVMS format filenames, but
|
||||
normally does not do any conversions from one format to another.
|
||||
TODO: The OpenVMS format syntax handling is incomplete.
|
||||
TODO: ODS-5 EFS support is missing.
|
||||
BUG: The internal routines to convert filenames to and from OpenVMS format
|
||||
do not work correctly.
|
||||
|
||||
Note: In the examples below, line continuations such as a backslash may have
|
||||
been added to make the examples easier to read in this format.
|
||||
BUG: That feature does not completely work at this time.
|
||||
|
||||
Since the OpenVMS utilities generally expect OpenVMS format paths, you will
|
||||
usually have to use OpenVMS format paths for rules and targets.
|
||||
BUG: Relative OpenVMS paths may not work in targets, especially combined
|
||||
with vpaths. This is because GNU Make will just concatenate the directories
|
||||
as it does on Unix.
|
||||
|
||||
The variables $^ and $@ separate files with commas instead of spaces.
|
||||
This is controlled by the name GNV$MAKE_COMMA as documented in the
|
||||
previous section.
|
||||
|
||||
While this may seem the natural thing to do with OpenVMS, it actually
|
||||
causes problems when trying to use other make functions that expect the
|
||||
files to be separated by spaces. If you run into this, you need the
|
||||
following workaround to convert the output.
|
||||
TODO: Look at have the $^ and $@ use spaces like on Unix and have
|
||||
and easy to use function to do the conversions and have the built
|
||||
in OpenVMS specific recipes and macros use it.
|
||||
|
||||
Example:
|
||||
|
||||
comma := ,
|
||||
empty :=
|
||||
space := $(empty) $(empty)
|
||||
|
||||
foo: $(addsuffix .3,$(subs $(comma),$(space),$^)
|
||||
|
||||
|
||||
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 OpenVMS symbols/logicals.
|
||||
|
||||
OpenVMS logical and symbols names show up as "environment" using the
|
||||
origin function. when the "-e" option is specified, the origin function
|
||||
shows them as "environment override". On POSIX the test scripts indicate
|
||||
that they should show up just as "environment".
|
||||
|
||||
When GNU Make reads in a symbol or logical name into the environment, it
|
||||
converts any dollar signs found to double dollar signs for convenience in
|
||||
using DCL symbols and logical names in recipes. When GNU Make exports a
|
||||
DCL symbol for a child process, if the first dollar sign found is followed
|
||||
by second dollar sign, then all double dollar signs will be converted to
|
||||
single dollar signs.
|
||||
|
||||
The variable $(ARCH) is predefined as IA64, ALPHA or VAX respectively.
|
||||
Makefiles for different OpenVMS systems can now be written by checking
|
||||
$(ARCH). Since IA64 and ALPHA are similar, usually just a check for
|
||||
VAX or not VAX is sufficient.
|
||||
|
||||
You may have to update makefiles that assume VAX if not ALPHA.
|
||||
|
||||
ifeq ($(ARCH),VAX)
|
||||
$(ECHO) "On the VAX"
|
||||
else
|
||||
$(ECHO) "On the ALPHA or IA64"
|
||||
endif
|
||||
|
||||
Empty commands are handled correctly and don't end in a new DCL process.
|
||||
|
||||
The exit command needs to have OpenVMS exit codes. To pass a POSIX code
|
||||
back to the make script, you need to encode it by multiplying it by 8
|
||||
and then adding %x1035a002 for a failure code and %x1035a001 for a
|
||||
success. Make will interpret any POSIX code other than 0 as a failure.
|
||||
TODO: Add an option have simulate POSIX exit commands in recipes.
|
||||
|
||||
Lexical functions can be used in pipes to simulate shell file test rules.
|
||||
|
||||
Example:
|
||||
|
||||
POSIX:
|
||||
b : c ; [ -f $@ ] || echo >> $@
|
||||
|
||||
OpenVMS:
|
||||
b : c ; if f$$search("$@") then pipe open/append xx $@ ; write xx "" ; close xx
|
||||
|
||||
|
||||
You can also use pipes and turning messages off to silently test for a
|
||||
failure.
|
||||
|
||||
x = %x1035a00a
|
||||
|
||||
%.b : %.c
|
||||
<tab>pipe set mess/nofac/noiden/nosev/notext ; type $^/output=$@ || exit $(x)
|
||||
|
||||
|
||||
Runtime issues:
|
||||
|
||||
The OpenVMS C Runtime has a convention for encoding a POSIX exit status into
|
||||
to OpenVMS exit codes. These status codes will have the hex value of
|
||||
0x35a000. OpenVMS exit code may also have a hex value of %x10000000 set on
|
||||
them. This is a flag to tell DCL not to write out the exit code.
|
||||
|
||||
To convert an OpenVMS encoded POSIX exit status code to the original code
|
||||
You subtract %x35a000 and any flags from the OpenVMS code and divide it by 8.
|
||||
|
||||
WARNING: Backward-incompatibility!
|
||||
The make program exit now returns the same encoded POSIX exit code as on
|
||||
Unix. Previous versions returned the OpenVMS exit status code if that is what
|
||||
caused the recipe to fail.
|
||||
TODO: Provide a way for scripts calling make to obtain that OpenVMS status
|
||||
code.
|
||||
|
||||
Make internally has two error codes, MAKE_FAILURE and MAKE_TROUBLE. These
|
||||
will have the error "-E-" severity set on exit.
|
||||
|
||||
MAKE_TROUBLE is returned only if the option "-q" or "--question" is used and
|
||||
has a POSIX value of 1 and an OpenVMS status of %x1035a00a.
|
||||
|
||||
MAKE_FAILURE has a POSIX value of 2 and an OpenVMS status of %x1035a012.
|
||||
|
||||
Output from GNU Make may have single quotes around some values where on
|
||||
other platforms it does not. Also output that would be in double quotes
|
||||
on some platforms may show up as single quotes on VMS.
|
||||
|
||||
There may be extra blank lines in the output on VMS.
|
||||
https://savannah.gnu.org/bugs/?func=detailitem&item_id=41760
|
||||
|
||||
There may be a "Waiting for unfinished jobs..." show up in the output.
|
||||
|
||||
Error messages generated by Make or Unix utilities may slightly vary from
|
||||
POSIX platforms. Typically the case may be different.
|
||||
|
||||
When make deletes files, on POSIX platforms it writes out 'rm' and the list
|
||||
of files. On VMS, only the files are written out, one per line.
|
||||
TODO: VMS
|
||||
|
||||
There may be extra leading white space or additional or missing whitespace
|
||||
in the output of recipes.
|
||||
|
||||
GNU Make uses sys$scratch: for the tempfiles that it creates.
|
||||
|
||||
The OpenVMS CRTL library maps /tmp to sys$scratch if the TMP: logical name
|
||||
does not exist. As the CRTL may use both sys$scratch: and /tmp internally,
|
||||
if you define the TMP logical name to be different than SYS$SCRATCH:,
|
||||
you may end up with only some temporary files in TMP: and some in SYS$SCRATCH:
|
||||
|
||||
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).
|
||||
TODO: A better default may be desired.
|
||||
|
||||
If the device for a file in a recipe does not exist, on OpenVMS an error
|
||||
message of "stat: <file>: no such device or address" will be output.
|
||||
|
||||
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).
|
||||
|
||||
|
||||
Unix compatibility features:
|
||||
----------------------------
|
||||
|
||||
If the command 'echo' is seen, any single quotes on the line will be
|
||||
converted to double quotes.
|
||||
|
||||
The variable $(CD) is implemented as a built in Change Directory
|
||||
command. This invokes the 'builtin_cd' Executing a 'set default'
|
||||
recipe doesn't do the trick, since it only affects the sub-process
|
||||
spawned for that command.
|
||||
|
||||
The 'builtin_cd' is generally expected to be on its own line.
|
||||
The 'builtin_cd' either from the expansion of $(CD) or directly
|
||||
put in a recipe line will be executed before any other commands in
|
||||
that recipe line. DCL parameter substitution will not work for the
|
||||
'builtin_cd' command.
|
||||
|
||||
Putting a 'builtin_cd' in a pipeline or an IF-THEN line should not be
|
||||
done because the 'builtin_cd' is always executed
|
||||
and executed first. The directory change is persistent.
|
||||
|
||||
Unix shell style I/O redirection is supported. You can now write lines like:
|
||||
"<tab>mcr sys$disk:[]program.exe < input.txt > output.txt &> error.txt"
|
||||
|
||||
POSIX shells have ":" as a null command. These are now handled.
|
||||
https://savannah.gnu.org/bugs/index.php?41761
|
||||
|
||||
A note on appending the redirected output. A simple mechanism is
|
||||
implemented to make ">>" work in action lines. In OpenVMS there is no simple
|
||||
feature like ">>" to have DCL command or program output redirected and
|
||||
appended to a file. GNU Make for OpenVMS implements the redirection
|
||||
of ">>" by using a command procedure.
|
||||
|
||||
The current algorithm creates the output file if it does not exist and
|
||||
then uses the DCL open/append to extend it. SYS$OUTPUT is then directed
|
||||
to that file.
|
||||
|
||||
The implementation supports only one redirected append output to a file
|
||||
and that redirection is done before any other commands in that line
|
||||
are executed, so it redirects all output for that command.
|
||||
|
||||
The older implementation wrote the output to a temporary file in
|
||||
in sys$scratch: and then attempted to append the file to the existing file.
|
||||
The temporary file names looked like "CMDxxxxx.". Any time the created
|
||||
command procedure can not complete, this happens. Pressing CTRL+Y to
|
||||
abort make is one case.
|
||||
|
||||
In case of CTRL+Y the associated command procedure is left in SYS$SCRATCH:.
|
||||
The command procedures will be named gnv$make_cmd*.com.
|
||||
|
||||
The CtrlY handler now uses $delprc to delete all children. This way also
|
||||
actions with DCL commands will be stopped. As before the CtrlY handler
|
||||
then sends SIGQUIT to itself, which is handled in common code.
|
||||
|
||||
Temporary command files are now deleted in the OpenVMS child termination
|
||||
handler. That deletes them even if a CTRL+C was pressed.
|
||||
TODO: Does the previous section about >> leaving files still apply?
|
||||
|
||||
The behavior of pressing CTRL+C is not changed. It still has only an effect,
|
||||
after the current action is terminated. If that doesn't happen or takes too
|
||||
long, CTRL+Y should be used instead.
|
||||
|
||||
|
||||
Build Options:
|
||||
|
||||
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:
|
||||
|
||||
<TAB>.SUFFIXES :
|
||||
<TAB>.SUFFIXES : .class .java
|
||||
<TAB>.java.class :
|
||||
<TAB><TAB>javac "$<"
|
||||
<TAB>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.
|
||||
TODO: This should be a run-time setting based on if the process
|
||||
has been set to case sensitive.
|
||||
|
||||
|
||||
Unimplemented functionality:
|
||||
|
||||
The new feature "Loadable objects" is not yet supported. If you need it,
|
||||
please send a change request or submit a bug report.
|
||||
|
||||
The new option --output-sync (-O) is accepted but has no effect: GNU Make
|
||||
for OpenVMS does not support running multiple commands simultaneously.
|
||||
|
||||
|
||||
Self test failures and todos:
|
||||
-----------------------------
|
||||
|
||||
The test harness can not handle testing some of the VMS specific modes
|
||||
because of the features needed for to be set for the Perl to run.
|
||||
Need to find a way to set the VMS features before running make as a
|
||||
child.
|
||||
|
||||
GNU Make was not currently translating the OpenVMS encoded POSIX values
|
||||
returned to it back to the POSIX values. I have temporarily modified the
|
||||
Perl test script to compensate for it. This should be being handled
|
||||
internally to Make.
|
||||
TODO: Verify and update the Perl test script.
|
||||
|
||||
The features/parallelism test was failing. OpenVMS is executing the rules
|
||||
in sequence not in parallel as this feature was not implemented.
|
||||
GNU Make on VMS no longer claims it is implemented.
|
||||
TODO: Implement it.
|
||||
|
||||
Symlink support is not present. Symlinks are supported by OpenVMS 8.3 and
|
||||
later.
|
||||
|
||||
Error messages should be suppressed with the "-" at the beginning of a line.
|
||||
On openVMS they were showing up. TODO: Is this still an issue?
|
||||
|
||||
The internal vmsify and unixify OpenVMS to/from UNIX are not handling logical
|
||||
names correctly.
|
||||
|
||||
|
||||
Build instructions:
|
||||
-------------------
|
||||
|
||||
Don't use the HP C V7.2-001 compiler, which has an incompatible change
|
||||
how __STDC__ is defined. This results at least in compile time warnings.
|
||||
|
||||
Make a 1st version
|
||||
$ @makefile.com ! ignore any compiler and/or linker warning
|
||||
$ copy make.exe 1st-make.exe
|
||||
|
||||
Use the 1st version to generate a 2nd version as a test.
|
||||
$ mc sys$disk:[]1st-make clean ! ignore any file not found messages
|
||||
$ mc sys$disk:[]1st-make
|
||||
|
||||
Verify your 2nd version by building Make again.
|
||||
$ copy make.exe 2nd-make.exe
|
||||
$ mc sys$disk:[]2nd-make clean
|
||||
$ mc sys$disk:[]2nd-make
|
||||
|
||||
|
||||
Running the tests:
|
||||
------------------
|
||||
|
||||
Running the tests on OpenVMS requires the following software to be installed
|
||||
as most of the tests are Unix oriented.
|
||||
|
||||
* Perl 5.18 or later.
|
||||
https://sourceforge.net/projects/vmsperlkit/files/
|
||||
* GNV 2.1.3 + Updates including a minimum of:
|
||||
* Bash 4.3.30
|
||||
* ld_tools 3.0.2
|
||||
* coreutils 8.21
|
||||
https://sourceforge.net/p/gnv/wiki/InstallingGNVPackages/
|
||||
https://sourceforge.net/projects/gnv/files/
|
||||
|
||||
As the test scripts need to create some foreign commands that persist
|
||||
after the test is run, it is recommend that either you use a sub-process or
|
||||
a dedicated login to run the tests.
|
||||
|
||||
To get detailed information for running the tests:
|
||||
|
||||
$ set default [.tests]
|
||||
$ @run_make_tests help
|
||||
|
||||
Running the script with no parameters will run all the tests.
|
||||
|
||||
After the the test script has been run once in a session, assuming
|
||||
that you built make in sys$disk:[make], you can redefined the
|
||||
"bin" logical name as follows:
|
||||
|
||||
$ define bin sys$disk:[make],gnv$gnu:[bin]
|
||||
|
||||
Then you can use Perl to run the scripts.
|
||||
|
||||
$ perl run_make_tests.pl
|
||||
|
||||
|
||||
Acknowledgments:
|
||||
----------------
|
||||
|
||||
See NEWS. for details of past changes.
|
||||
|
||||
These are the currently known contributors to this port.
|
||||
|
||||
Hartmut Becker
|
||||
John Malmberg
|
||||
Michael Gehre
|
||||
John Eisenbraun
|
||||
Klaus Kaempf
|
||||
Mike Moretti
|
||||
John W. Eaton
|
||||
@@ -0,0 +1,363 @@
|
||||
This version of GNU Make has been tested on:
|
||||
Microsoft Windows 2000/XP/2003/Vista/7/8/10
|
||||
It has also been used on Windows 95/98/NT, and on OS/2.
|
||||
|
||||
It builds with the MinGW port of GCC (tested with GCC 3.4.2, 4.8.1,
|
||||
and 4.9.3).
|
||||
|
||||
It also builds with MSVC 2.x, 4.x, 5.x, 6.x, 2005, 2008, 2010, 2012,
|
||||
2013, and 2015 as well as with .NET 7.x and .NET 2003.
|
||||
|
||||
Building with Guile is supported (tested with Guile 2.0.x). To build
|
||||
with Guile, you will need, in addition to Guile itself, its dependency
|
||||
libraries and the pkg-config program. The latter is used to figure out
|
||||
which compilation and link switches and libraries need to be mentioned
|
||||
on the compiler command lines to correctly link with Guile. A Windows
|
||||
port of pkg-config can be found on ezwinports site:
|
||||
|
||||
https://sourceforge.net/projects/ezwinports/
|
||||
|
||||
The libraries on which Guile depends can vary depending on your
|
||||
version and build of Guile. At the very least, the Boehm's GC library
|
||||
will be needed, and typically also GNU MP, libffi, libunistring, and
|
||||
libtool's libltdl. Whoever built the port of Guile you have should
|
||||
also provide you with these dependencies or a URL where to download
|
||||
them. A precompiled 32-bit Windows build of Guile is available from
|
||||
the ezwinports site mentioned above.
|
||||
|
||||
The Windows port of GNU Make is maintained jointly by various people.
|
||||
It was originally made by Rob Tulloh.
|
||||
It is currently maintained by Eli Zaretskii.
|
||||
|
||||
|
||||
Do this first, regardless of the build method you choose:
|
||||
---------------------------------------------------------
|
||||
|
||||
1. If you have special requirements, edit config.h.W32 to your liking
|
||||
(especially the shell-related defines, or HAVE_CASE_INSENSITIVE_FS which
|
||||
corresponds to './configure --enable-case-insensitive-file-system'). We
|
||||
don't recommend to define HAVE_CASE_INSENSITIVE_FS, but you may wish to
|
||||
consider that if you have a lot of files whose names are in upper case,
|
||||
while Makefile rules are written for lower-case versions.
|
||||
|
||||
If you don't have special requirements no changes are needed.
|
||||
|
||||
|
||||
Building with (MinGW-)GCC using build_w32.bat
|
||||
---------------------------------------------
|
||||
|
||||
2. Open a W32 command prompt for your installed (MinGW-)GCC, setup a
|
||||
correct PATH and other environment variables for it, then execute ...
|
||||
|
||||
.\build_w32.bat gcc
|
||||
|
||||
This produces gnumake.exe in the GccRel directory.
|
||||
|
||||
If you want a version of GNU Make built with debugging enabled,
|
||||
add the --debug option. Output goes into the GccDebug directory.
|
||||
|
||||
The batch file will probe for Guile installation, and will build
|
||||
gnumake.exe with Guile if it finds it. If you have Guile
|
||||
installed, but want to build Make without Guile support, type
|
||||
|
||||
.\build_w32.bat --without-guile gcc
|
||||
|
||||
|
||||
Building with (MSVC++-)cl using build_w32.bat
|
||||
---------------------------------------------
|
||||
|
||||
2. Open a command shell, then execute ...
|
||||
|
||||
.\build_w32.bat
|
||||
|
||||
This produces a 64bit Release build of gnumake.exe in .\WinRel, using
|
||||
the compiler found on the %Path%. If no compiler is found, the batch
|
||||
file will probe your system and choose the newest MSVC version it can
|
||||
find.
|
||||
|
||||
If you want a 32bit version of GNU Make, add the --x86 option.
|
||||
|
||||
If you want a Debug build of GNU Make, add the --debug option. Output
|
||||
will go into the .\WinDebug directory.
|
||||
|
||||
The batch file will probe for Guile installation, and will build
|
||||
gnumake.exe with Guile if it finds it. If Guile is installed,
|
||||
but you prefer to build GNU Make without Guile support, add the
|
||||
--without-guile option.
|
||||
|
||||
|
||||
Building with (MinGW-)GCC using GNU Make
|
||||
----------------------------------------
|
||||
|
||||
2. If you already have a version of GNU Make available you can use it
|
||||
to build this version. Open a W32 command prompt for your installed
|
||||
(MinGW-)GCC, setup a correct PATH and other environment variables
|
||||
for it, then execute ...
|
||||
|
||||
make -f Basic.mk TOOLCHAIN=gcc
|
||||
|
||||
This produces GccRel\gnumake.exe.
|
||||
If you want a version of GNU Make built with debugging enabled,
|
||||
add the TARGET_TYPE=debug option:
|
||||
|
||||
make -f Basic.mk TOOLCHAIN=gcc TARGET_TYPE=debug
|
||||
|
||||
The makefile doesn't support Guile integration. Use build_w32.bat
|
||||
if you want to build with Guile support.
|
||||
|
||||
|
||||
Building with (MSVC++-)cl using GNU Make
|
||||
----------------------------------------
|
||||
|
||||
2. If you already have a version of GNU Make available you can use it
|
||||
to build this version. Open a W32 command prompt for your installed
|
||||
(MSVC++-)cl, setup a correct PATH and other environment variables
|
||||
for it (usually via executing vcvars32.bat or vsvars32.bat from the
|
||||
cl-installation, or using a corresponding start menu entry from the
|
||||
cl-installation), then execute ...
|
||||
|
||||
make -f Basic.mk
|
||||
|
||||
This produces an optimized WinRel/gnumake.exe.
|
||||
If you want a version of GNU Make built with debugging enabled,
|
||||
add the TARGET_TYPE=debug option:
|
||||
|
||||
make -f Basic.mk TARGET_TYPE=debug
|
||||
|
||||
The makefile doesn't support Guile integration. Use build_w32.bat
|
||||
if you want to build with Guile support.
|
||||
|
||||
|
||||
Running the test suite
|
||||
----------------------
|
||||
|
||||
3. You will need an installation of Perl. Be sure to use a relatively
|
||||
modern version: older versions will sometimes throw spurious errors.
|
||||
|
||||
To run the suite after building using GNU Make, use:
|
||||
|
||||
make -f Basic.mk check
|
||||
|
||||
Alternatively if you'd like to run tests by hand, use:
|
||||
|
||||
cd tests
|
||||
.\run_make_tests.bat -make <path-to-make>
|
||||
|
||||
I've found <path-to-make> seems to want forward-slashes in the path.
|
||||
For example if building with .\build_w32.bat non-debug, use:
|
||||
|
||||
cd tests
|
||||
.\run_make_tests.bat -make ../WinRel/gnumake.exe
|
||||
|
||||
I've tested this with the MSYS2 shell and POSIX tools installation
|
||||
that you get by installing Git for Windows.
|
||||
|
||||
|
||||
|
||||
-------------------
|
||||
-- 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 2000, Windows XP,
|
||||
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 Windows compiler. Two compilers supported
|
||||
officially are the MinGW port of GNU GCC, and the various
|
||||
versions of the Microsoft C compiler.
|
||||
|
||||
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 if you have a working sh.exe somewhere on
|
||||
your 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 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 "Cygwin"
|
||||
porting effort (https://www.cygwin.com/).
|
||||
Other possibilities are the MKS version of sh.exe, or building
|
||||
your own with a package like NutCracker (DataFocus) or Portage
|
||||
(Consensys). Also MinGW includes sh.
|
||||
|
||||
GNU Make and brain-dead shells (BATCH_MODE_ONLY_SHELL):
|
||||
|
||||
Some versions of Bourne shell do 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 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. In this mode you must have a
|
||||
working sh.exe in order to use parallel builds (-j).
|
||||
|
||||
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%). However, parallel
|
||||
builds ARE supported with Windows shells (cmd.exe and
|
||||
command.com). See the next section about some peculiarities
|
||||
of parallel builds on Windows.
|
||||
|
||||
Support for parallel builds
|
||||
|
||||
Parallel builds (-jN) are supported in this port. The number of
|
||||
concurrent processes has a hard limit of 4095.
|
||||
|
||||
GNU Make and Cygnus GNU Windows32 tools:
|
||||
|
||||
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
|
||||
build make. Do not define BATCH_MODE_ONLY_SHELL if you turn
|
||||
on HAVE_MKS_SHELL.
|
||||
|
||||
GNU Make handling of drive letters in pathnames (PATH, vpath, VPATH):
|
||||
|
||||
There is a caveat that should be noted with respect to handling
|
||||
single character pathnames on Windows systems. When colon is
|
||||
used in PATH variables, make tries to be smart about knowing when
|
||||
you are using colon as a separator versus colon as a drive
|
||||
letter. Unfortunately, something as simple as the string 'x:/'
|
||||
could be interpreted 2 ways: (x and /) or (x:/).
|
||||
|
||||
Make chooses to interpret a letter plus colon (e.g. x:/) as a
|
||||
drive letter pathname. If it is necessary to use single
|
||||
character directories in paths (VPATH, vpath, Path, PATH), the
|
||||
user must do one of two things:
|
||||
|
||||
a. Use semicolon as the separator to disambiguate colon. For
|
||||
example use 'x;/' if you want to say 'x' and '/' are
|
||||
separate components.
|
||||
|
||||
b. Qualify the directory name so that there is more than
|
||||
one character in the path(s) used. For example, none
|
||||
of these settings are ambiguous:
|
||||
|
||||
./x:./y
|
||||
/some/path/x:/some/path/y
|
||||
x:/some/path/x:x:/some/path/y
|
||||
|
||||
Please note that you are free to mix colon and semi-colon in the
|
||||
specification of paths. Make is able to figure out the intended
|
||||
result and convert the paths internally to the format needed
|
||||
when interacting with the operating system, providing the path
|
||||
is not within quotes, e.g. "x:/test/test.c".
|
||||
|
||||
You are encouraged to use colon as the separator character.
|
||||
This should ease the pain of deciding how to handle various path
|
||||
problems which exist between platforms. If colon is used on
|
||||
both Unix and Windows systems, then no ifdef'ing will be
|
||||
necessary in the makefile source.
|
||||
|
||||
Pathnames and white space:
|
||||
|
||||
Unlike Unix, Windows 95/NT systems encourage pathnames which
|
||||
contain white space (e.g. C:\Program Files\). These sorts of
|
||||
pathnames are valid on Unix too, but are never encouraged.
|
||||
There is at least one place in make (VPATH/vpath handling) where
|
||||
paths containing white space will simply not work. There may be
|
||||
others too. I chose to not try and port make in such a way so
|
||||
that these sorts of paths could be handled. I offer these
|
||||
suggestions as workarounds:
|
||||
|
||||
1. Use 8.3 notation. i.e. "x:/long~1/", which is actually
|
||||
"x:\longpathtest". Type "dir /x" to view these filenames
|
||||
within the cmd.exe shell.
|
||||
2. Rename the directory so it does not contain white space.
|
||||
|
||||
If you are unhappy with this choice, this is free software
|
||||
and you are free to take a crack at making this work. The code
|
||||
in w32/pathstuff.c and vpath.c would be the places to start.
|
||||
|
||||
Pathnames and Case insensitivity:
|
||||
|
||||
Unlike Unix, Windows 95/NT systems are case insensitive but case
|
||||
preserving. For example if you tell the file system to create a
|
||||
file named "Target", it will preserve the case. Subsequent access to
|
||||
the file with other case permutations will succeed (i.e. opening a
|
||||
file named "target" or "TARGET" will open the file "Target").
|
||||
|
||||
By default, GNU Make retains its case sensitivity when comparing
|
||||
target names and existing files or directories. It can be
|
||||
configured, however, into a case preserving and case insensitive
|
||||
mode by adding a define for HAVE_CASE_INSENSITIVE_FS to
|
||||
config.h.W32.
|
||||
|
||||
For example, the following makefile will create a file named
|
||||
Target in the directory subdir which will subsequently be used
|
||||
to satisfy the dependency of SUBDIR/DepTarget on SubDir/TARGET.
|
||||
Without HAVE_CASE_INSENSITIVE_FS configured, the dependency link
|
||||
will not be made:
|
||||
|
||||
subdir/Target:
|
||||
touch $@
|
||||
|
||||
SUBDIR/DepTarget: SubDir/TARGET
|
||||
cp $^ $@
|
||||
|
||||
Reliance on this behavior also eliminates the ability of GNU Make
|
||||
to use case in comparison of matching rules. For example, it is
|
||||
not possible to set up a C++ rule using %.C that is different
|
||||
than a C rule using %.c. GNU Make will consider these to be the
|
||||
same rule and will issue a warning.
|
||||
|
||||
SAMBA/NTFS/VFAT:
|
||||
|
||||
I have not had any success building the debug version of this
|
||||
package using SAMBA as my file server. The reason seems to be
|
||||
related to the way VC++ 4.0 changes the case name of the pdb
|
||||
filename it is passed on the command line. It seems to change
|
||||
the name always to to lower case. I contend that the VC++
|
||||
compiler should not change the casename of files that are passed
|
||||
as arguments on the command line. I don't think this was a
|
||||
problem in MSVC 2.x, but I know it is a problem in MSVC 4.x.
|
||||
|
||||
The package builds fine on VFAT and NTFS filesystems.
|
||||
|
||||
Most all of the development I have done to date has been using
|
||||
NTFS and long file names. I have not done any considerable work
|
||||
under VFAT. VFAT users may wish to be aware that this port of
|
||||
make does respect case sensitivity.
|
||||
|
||||
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.
|
||||
|
||||
Bug reports:
|
||||
|
||||
Please submit bugs via the normal bug reporting mechanism which
|
||||
is described in the GNU Make manual and the base README.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 1996-2022 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 3 of the License, 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
|
||||
this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
@@ -0,0 +1,112 @@
|
||||
-*-indented-text-*-
|
||||
|
||||
GNU Make can utilize the Customs library, distributed with Pmake, to
|
||||
provide builds distributed across multiple hosts.
|
||||
|
||||
In order to utilize this capability, you must first download and build
|
||||
the Customs library. It is contained in the Pmake distribution, which
|
||||
can be obtained at:
|
||||
|
||||
ftp://ftp.icsi.berkeley.edu/pub/ai/stolcke/software/
|
||||
|
||||
This integration was tested (superficially) with Pmake 2.1.33.
|
||||
|
||||
|
||||
BUILDING CUSTOMS
|
||||
----------------
|
||||
|
||||
First, build pmake and Customs. You need to build pmake first, because
|
||||
Customs require pmake to build. Unfortunately, this is not trivial;
|
||||
please see the pmake and Customs documentation for details. The best
|
||||
place to look for instructions is in the pmake-2.1.33/INSTALL file.
|
||||
|
||||
Note that the 2.1.33 Pmake distribution comes with a set of patches to
|
||||
GNU Make, distributed in the pmake-2.1.33/etc/gnumake/ directory. These
|
||||
patches are based on GNU Make 3.75 (there are patches for earlier
|
||||
versions of GNU Make, also). The parts of this patchfile which relate
|
||||
directly to Customs support have already been incorporated into this
|
||||
version of GNU Make, so you should _NOT_ apply the patch file.
|
||||
|
||||
However, there are a few non-Customs specific (as far as I could tell)
|
||||
changes here which are not incorporated (for example, the modification
|
||||
to try expanding -lfoo to libfoo.so). If you rely on these changes
|
||||
you'll need to re-apply them by hand.
|
||||
|
||||
Install the Customs library and header files according to the
|
||||
documentation. You should also install the man pages (contrary to
|
||||
comments in the documentation, they weren't installed automatically for
|
||||
me; I had to cd to the 'pmake-2.1.33/doc' directory and run 'pmake
|
||||
install' there directly).
|
||||
|
||||
|
||||
BUILDING GNU MAKE
|
||||
-----------------
|
||||
|
||||
Once you've installed Customs, you can build GNU Make to use it. When
|
||||
configuring GNU Make, merely use the '--with-customs=DIR' option.
|
||||
Provide the directory containing the 'lib' and 'include/customs'
|
||||
subdirectories as DIR. For example, if you installed the customs
|
||||
library in /usr/local/lib and the headers in /usr/local/include/customs,
|
||||
then you'd pass '--with-customs=/usr/local' as an option to configure.
|
||||
|
||||
Run make (or use build.sh) normally to build GNU Make as described in
|
||||
the INSTALL file.
|
||||
|
||||
See the documentation for Customs for information on starting and
|
||||
configuring Customs.
|
||||
|
||||
|
||||
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
|
||||
--------
|
||||
|
||||
SunOS 4.1.x:
|
||||
The customs/sprite.h header file #includes the <malloc.h> header
|
||||
files; this conflicts with GNU Make's configuration so you'll get a
|
||||
compile error if you use GCC (or any other ANSI-capable C compiler).
|
||||
|
||||
I commented out the #include in sprite.h:107:
|
||||
|
||||
#if defined(sun) || defined(ultrix) || defined(hpux) || defined(sgi)
|
||||
/* #include <malloc.h> */
|
||||
#else
|
||||
|
||||
YMMV.
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 1998-2022 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 3 of the License, 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
|
||||
this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
@@ -0,0 +1,13 @@
|
||||
ERRORREXX
|
||||
OPTIMIZE
|
||||
NOVERSION
|
||||
OPTIMIZERTIME
|
||||
OPTIMIZERALIAS
|
||||
DEFINE HAVE_CONFIG_H
|
||||
DEFINE INCLUDEDIR="include:"
|
||||
DEFINE LIBDIR="lib:"
|
||||
DEFINE NO_ALLOCA
|
||||
DEFINE NO_ARCHIVES
|
||||
IGNORE=161
|
||||
IGNORE=100
|
||||
STARTUP=cres
|
||||
+1747
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,604 @@
|
||||
# This file was generated by Autom4te 2.73.
|
||||
# It contains the lists of macros which have been traced.
|
||||
# It can be safely removed.
|
||||
|
||||
@request = (
|
||||
bless( [
|
||||
'0',
|
||||
1,
|
||||
[
|
||||
'/usr/share/autoconf'
|
||||
],
|
||||
[
|
||||
'/usr/share/autoconf/autoconf/autoconf.m4f',
|
||||
'/usr/share/aclocal-1.18/internal/ac-config-macro-dirs.m4',
|
||||
'/usr/share/aclocal/lt~obsolete.m4',
|
||||
'/usr/share/aclocal/pkg.m4',
|
||||
'/usr/share/aclocal-1.18/amversion.m4',
|
||||
'/usr/share/aclocal-1.18/auxdir.m4',
|
||||
'/usr/share/aclocal-1.18/cond-if.m4',
|
||||
'/usr/share/aclocal-1.18/cond.m4',
|
||||
'/usr/share/aclocal-1.18/depend.m4',
|
||||
'/usr/share/aclocal-1.18/depout.m4',
|
||||
'/usr/share/aclocal-1.18/dmalloc.m4',
|
||||
'/usr/share/aclocal-1.18/init.m4',
|
||||
'/usr/share/aclocal-1.18/install-sh.m4',
|
||||
'/usr/share/aclocal-1.18/lead-dot.m4',
|
||||
'/usr/share/aclocal-1.18/make.m4',
|
||||
'/usr/share/aclocal-1.18/missing.m4',
|
||||
'/usr/share/aclocal-1.18/options.m4',
|
||||
'/usr/share/aclocal-1.18/prog-cc-c-o.m4',
|
||||
'/usr/share/aclocal-1.18/rmf.m4',
|
||||
'/usr/share/aclocal-1.18/runlog.m4',
|
||||
'/usr/share/aclocal-1.18/sanity.m4',
|
||||
'/usr/share/aclocal-1.18/silent.m4',
|
||||
'/usr/share/aclocal-1.18/strip.m4',
|
||||
'/usr/share/aclocal-1.18/substnot.m4',
|
||||
'/usr/share/aclocal-1.18/tar.m4',
|
||||
'/usr/share/aclocal-1.18/xargsn.m4',
|
||||
'm4/00gnulib.m4',
|
||||
'm4/acinclude.m4',
|
||||
'm4/alloca.m4',
|
||||
'm4/asm-underscore.m4',
|
||||
'm4/codeset.m4',
|
||||
'm4/dospaths.m4',
|
||||
'm4/eaccess.m4',
|
||||
'm4/extensions.m4',
|
||||
'm4/extern-inline.m4',
|
||||
'm4/fcntl-o.m4',
|
||||
'm4/findprog-in.m4',
|
||||
'm4/getloadavg.m4',
|
||||
'm4/gettext.m4',
|
||||
'm4/glibc2.m4',
|
||||
'm4/glibc21.m4',
|
||||
'm4/gnulib-common.m4',
|
||||
'm4/gnulib-comp.m4',
|
||||
'm4/host-cpu-c-abi.m4',
|
||||
'm4/iconv.m4',
|
||||
'm4/intdiv0.m4',
|
||||
'm4/intl.m4',
|
||||
'm4/intlmacosx.m4',
|
||||
'm4/intmax.m4',
|
||||
'm4/inttypes-pri.m4',
|
||||
'm4/inttypes_h.m4',
|
||||
'm4/largefile.m4',
|
||||
'm4/lcmessage.m4',
|
||||
'm4/lib-ld.m4',
|
||||
'm4/lib-link.m4',
|
||||
'm4/lib-prefix.m4',
|
||||
'm4/lock.m4',
|
||||
'm4/longlong.m4',
|
||||
'm4/nls.m4',
|
||||
'm4/po.m4',
|
||||
'm4/printf-posix.m4',
|
||||
'm4/progtest.m4',
|
||||
'm4/sig_atomic_t.m4',
|
||||
'm4/size_max.m4',
|
||||
'm4/stdbool.m4',
|
||||
'm4/stdint_h.m4',
|
||||
'm4/threadlib.m4',
|
||||
'm4/uintmax_t.m4',
|
||||
'm4/visibility.m4',
|
||||
'm4/warn-on-use.m4',
|
||||
'm4/wchar_t.m4',
|
||||
'm4/wint_t.m4',
|
||||
'm4/xsize.m4',
|
||||
'm4/year2038.m4',
|
||||
'm4/zzgnulib.m4',
|
||||
'configure.ac'
|
||||
],
|
||||
{
|
||||
'AC_' => 1,
|
||||
'AC_CHECK_HEADER_STDBOOL' => 1,
|
||||
'AC_CHECK_INCLUDES_DEFAULT' => 1,
|
||||
'AC_COMPUTE_INT' => 1,
|
||||
'AC_CONFIG_MACRO_DIR' => 1,
|
||||
'AC_CONFIG_MACRO_DIR_TRACE' => 1,
|
||||
'AC_C_RESTRICT' => 1,
|
||||
'AC_DEFUN' => 1,
|
||||
'AC_DEFUN_ONCE' => 1,
|
||||
'AC_DEPLIBS_CHECK_METHOD' => 1,
|
||||
'AC_DISABLE_FAST_INSTALL' => 1,
|
||||
'AC_LIBTOOL_CONFIG' => 1,
|
||||
'AC_LIBTOOL_LANG_CXX_CONFIG' => 1,
|
||||
'AC_LIBTOOL_LANG_C_CONFIG' => 1,
|
||||
'AC_LIBTOOL_LANG_F77_CONFIG' => 1,
|
||||
'AC_LIBTOOL_LANG_GCJ_CONFIG' => 1,
|
||||
'AC_LIBTOOL_LANG_RC_CONFIG' => 1,
|
||||
'AC_LIBTOOL_LINKER_OPTION' => 1,
|
||||
'AC_LIBTOOL_OBJDIR' => 1,
|
||||
'AC_LIBTOOL_POSTDEP_PREDEP' => 1,
|
||||
'AC_LIBTOOL_PROG_CC_C_O' => 1,
|
||||
'AC_LIBTOOL_PROG_COMPILER_NO_RTTI' => 1,
|
||||
'AC_LIBTOOL_PROG_COMPILER_PIC' => 1,
|
||||
'AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH' => 1,
|
||||
'AC_LIBTOOL_PROG_LD_SHLIBS' => 1,
|
||||
'AC_LIBTOOL_SETUP' => 1,
|
||||
'AC_LIBTOOL_SYS_DYNAMIC_LINKER' => 1,
|
||||
'AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE' => 1,
|
||||
'AC_LIBTOOL_SYS_HARD_LINK_LOCKS' => 1,
|
||||
'AC_LIBTOOL_SYS_LIB_STRIP' => 1,
|
||||
'AC_LIBTOOL_SYS_OLD_ARCHIVE' => 1,
|
||||
'AC_LIB_APPENDTOVAR' => 1,
|
||||
'AC_LIB_ARG_WITH' => 1,
|
||||
'AC_LIB_FROMPACKAGE' => 1,
|
||||
'AC_LIB_HAVE_LINKFLAGS' => 1,
|
||||
'AC_LIB_LINKFLAGS' => 1,
|
||||
'AC_LIB_LINKFLAGS_BODY' => 1,
|
||||
'AC_LIB_LINKFLAGS_FROM_LIBS' => 1,
|
||||
'AC_LIB_PREFIX' => 1,
|
||||
'AC_LIB_PREPARE_MULTILIB' => 1,
|
||||
'AC_LIB_PREPARE_PREFIX' => 1,
|
||||
'AC_LIB_PROG_LD' => 1,
|
||||
'AC_LIB_PROG_LD_GNU' => 1,
|
||||
'AC_LIB_RPATH' => 1,
|
||||
'AC_LIB_WITH_FINAL_PREFIX' => 1,
|
||||
'AC_LTDL_ENABLE_INSTALL' => 1,
|
||||
'AC_LTDL_OBJDIR' => 1,
|
||||
'AC_LTDL_PREOPEN' => 1,
|
||||
'AC_PATH_MAGIC' => 1,
|
||||
'AC_PROG_EGREP' => 1,
|
||||
'AC_PROG_LD_GNU' => 1,
|
||||
'AC_PROG_LD_RELOAD_FLAG' => 1,
|
||||
'AC_STRUCT_ST_MTIM_NSEC' => 1,
|
||||
'AC_SYS_LARGEFILE' => 1,
|
||||
'AC_TYPE_LONG_LONG_INT' => 1,
|
||||
'AC_TYPE_UNSIGNED_LONG_LONG_INT' => 1,
|
||||
'AC_USE_SYSTEM_EXTENSIONS' => 1,
|
||||
'AM_AUTOMAKE_VERSION' => 1,
|
||||
'AM_AUX_DIR_EXPAND' => 1,
|
||||
'AM_CONDITIONAL' => 1,
|
||||
'AM_COND_IF' => 1,
|
||||
'AM_DEP_TRACK' => 1,
|
||||
'AM_GNU_GETTEXT' => 1,
|
||||
'AM_GNU_GETTEXT_NEED' => 1,
|
||||
'AM_GNU_GETTEXT_VERSION' => 1,
|
||||
'AM_ICONV' => 1,
|
||||
'AM_ICONV_LINK' => 1,
|
||||
'AM_ICONV_LINKFLAGS_BODY' => 1,
|
||||
'AM_INIT_AUTOMAKE' => 1,
|
||||
'AM_INTL_SUBDIR' => 1,
|
||||
'AM_LANGINFO_CODESET' => 1,
|
||||
'AM_MAKE_INCLUDE' => 1,
|
||||
'AM_MISSING_HAS_RUN' => 1,
|
||||
'AM_MISSING_PROG' => 1,
|
||||
'AM_NLS' => 1,
|
||||
'AM_OUTPUT_DEPENDENCY_COMMANDS' => 1,
|
||||
'AM_PATH_PROG_WITH_TEST' => 1,
|
||||
'AM_POSTPROCESS_PO_MAKEFILE' => 1,
|
||||
'AM_PO_SUBDIRS' => 1,
|
||||
'AM_PROG_CC_C_O' => 1,
|
||||
'AM_PROG_INSTALL_SH' => 1,
|
||||
'AM_PROG_INSTALL_STRIP' => 1,
|
||||
'AM_RUN_LOG' => 1,
|
||||
'AM_SANITY_CHECK' => 1,
|
||||
'AM_SET_CURRENT_AUTOMAKE_VERSION' => 1,
|
||||
'AM_SET_DEPDIR' => 1,
|
||||
'AM_SET_LEADING_DOT' => 1,
|
||||
'AM_SILENT_RULES' => 1,
|
||||
'AM_SUBST_NOTMAKE' => 1,
|
||||
'AM_WITH_DMALLOC' => 1,
|
||||
'AM_XGETTEXT_OPTION' => 1,
|
||||
'AM_XGETTEXT_OPTION_INIT' => 1,
|
||||
'AU_DEFUN' => 1,
|
||||
'CF_NETLIBS' => 1,
|
||||
'CF_RECHECK_FUNC' => 1,
|
||||
'CF_UPPER' => 1,
|
||||
'GL_MDA_DEFINES' => 1,
|
||||
'LTOBSOLETE_VERSION' => 1,
|
||||
'LT_AC_PROG_EGREP' => 1,
|
||||
'LT_AC_PROG_SED' => 1,
|
||||
'PKG_CHECK_EXISTS' => 1,
|
||||
'PKG_CHECK_MODULES' => 1,
|
||||
'PKG_CHECK_MODULES_STATIC' => 1,
|
||||
'PKG_CHECK_VAR' => 1,
|
||||
'PKG_HAVE_DEFINE_WITH_MODULES' => 1,
|
||||
'PKG_HAVE_WITH_MODULES' => 1,
|
||||
'PKG_INSTALLDIR' => 1,
|
||||
'PKG_NOARCH_INSTALLDIR' => 1,
|
||||
'PKG_PROG_PKG_CONFIG' => 1,
|
||||
'PKG_WITH_MODULES' => 1,
|
||||
'_AC_AM_CONFIG_HEADER_HOOK' => 1,
|
||||
'_AC_PROG_LIBTOOL' => 1,
|
||||
'_AC_TYPE_LONG_LONG_SNIPPET' => 1,
|
||||
'_AM_AUTOCONF_VERSION' => 1,
|
||||
'_AM_CONFIG_MACRO_DIRS' => 1,
|
||||
'_AM_DEPENDENCIES' => 1,
|
||||
'_AM_FILESYSTEM_TIMESTAMP_RESOLUTION' => 1,
|
||||
'_AM_IF_OPTION' => 1,
|
||||
'_AM_MANGLE_OPTION' => 1,
|
||||
'_AM_OUTPUT_DEPENDENCY_COMMANDS' => 1,
|
||||
'_AM_PROG_CC_C_O' => 1,
|
||||
'_AM_PROG_RM_F' => 1,
|
||||
'_AM_PROG_TAR' => 1,
|
||||
'_AM_PROG_XARGS_N' => 1,
|
||||
'_AM_SET_OPTION' => 1,
|
||||
'_AM_SET_OPTIONS' => 1,
|
||||
'_AM_SILENT_RULES' => 1,
|
||||
'_AM_SLEEP_FRACTIONAL_SECONDS' => 1,
|
||||
'_AM_SUBST_NOTMAKE' => 1,
|
||||
'_GL_MDA_DEFINES' => 1,
|
||||
'_LT_AC_CHECK_DLFCN' => 1,
|
||||
'_LT_AC_FILE_LTDLL_C' => 1,
|
||||
'_LT_AC_LANG_CXX' => 1,
|
||||
'_LT_AC_LANG_CXX_CONFIG' => 1,
|
||||
'_LT_AC_LANG_C_CONFIG' => 1,
|
||||
'_LT_AC_LANG_F77' => 1,
|
||||
'_LT_AC_LANG_F77_CONFIG' => 1,
|
||||
'_LT_AC_LANG_GCJ' => 1,
|
||||
'_LT_AC_LANG_GCJ_CONFIG' => 1,
|
||||
'_LT_AC_LANG_RC_CONFIG' => 1,
|
||||
'_LT_AC_LOCK' => 1,
|
||||
'_LT_AC_PROG_CXXCPP' => 1,
|
||||
'_LT_AC_PROG_ECHO_BACKSLASH' => 1,
|
||||
'_LT_AC_SHELL_INIT' => 1,
|
||||
'_LT_AC_SYS_COMPILER' => 1,
|
||||
'_LT_AC_SYS_LIBPATH_AIX' => 1,
|
||||
'_LT_AC_TAGCONFIG' => 1,
|
||||
'_LT_AC_TAGVAR' => 1,
|
||||
'_LT_AC_TRY_DLOPEN_SELF' => 1,
|
||||
'_LT_CC_BASENAME' => 1,
|
||||
'_LT_COMPILER_BOILERPLATE' => 1,
|
||||
'_LT_LINKER_BOILERPLATE' => 1,
|
||||
'_LT_PREPARE_SED_QUOTE_VARS' => 1,
|
||||
'_LT_PROG_CXX' => 1,
|
||||
'_LT_PROG_ECHO_BACKSLASH' => 1,
|
||||
'_LT_PROG_F77' => 1,
|
||||
'_LT_PROG_FC' => 1,
|
||||
'_LT_PROG_LTMAIN' => 1,
|
||||
'_LT_REQUIRED_DARWIN_CHECKS' => 1,
|
||||
'_PKG_SHORT_ERRORS_SUPPORTED' => 1,
|
||||
'_m4_warn' => 1,
|
||||
'gl_00GNULIB' => 1,
|
||||
'gl_AC_HEADER_INTTYPES_H' => 1,
|
||||
'gl_AC_HEADER_STDINT_H' => 1,
|
||||
'gl_AC_TYPE_UINTMAX_T' => 1,
|
||||
'gl_ASM_SYMBOL_PREFIX' => 1,
|
||||
'gl_ASSERT_NO_GNULIB_POSIXCHECK' => 1,
|
||||
'gl_ASSERT_NO_GNULIB_TESTS' => 1,
|
||||
'gl_BIGENDIAN' => 1,
|
||||
'gl_CACHE_VAL_SILENT' => 1,
|
||||
'gl_CC_ALLOW_WARNINGS' => 1,
|
||||
'gl_CC_GNULIB_WARNINGS' => 1,
|
||||
'gl_COMMON' => 1,
|
||||
'gl_COMMON_BODY' => 1,
|
||||
'gl_COMPILER_CLANG' => 1,
|
||||
'gl_COMPILER_PREPARE_CHECK_DECL' => 1,
|
||||
'gl_CONDITIONAL' => 1,
|
||||
'gl_CONDITIONAL_HEADER' => 1,
|
||||
'gl_CXX_ALLOW_WARNINGS' => 1,
|
||||
'gl_C_ASM' => 1,
|
||||
'gl_DISABLE_THREADS' => 1,
|
||||
'gl_EARLY' => 1,
|
||||
'gl_EXTERN_INLINE' => 1,
|
||||
'gl_FCNTL_O_FLAGS' => 1,
|
||||
'gl_FEATURES_H' => 1,
|
||||
'gl_FILE_LIST' => 1,
|
||||
'gl_FINDPROG_IN' => 1,
|
||||
'gl_FUNC_ALLOCA' => 1,
|
||||
'gl_FUNC_EACCESS' => 1,
|
||||
'gl_GETLOADAVG' => 1,
|
||||
'gl_GLIBC21' => 1,
|
||||
'gl_HOST_CPU_C_ABI' => 1,
|
||||
'gl_HOST_CPU_C_ABI_32BIT' => 1,
|
||||
'gl_INIT' => 1,
|
||||
'gl_LARGEFILE' => 1,
|
||||
'gl_LIBOBJ' => 1,
|
||||
'gl_LIBSOURCES' => 1,
|
||||
'gl_LOCK' => 1,
|
||||
'gl_MODULE_INDICATOR' => 1,
|
||||
'gl_MODULE_INDICATOR_FOR_TESTS' => 1,
|
||||
'gl_MODULE_INDICATOR_INIT_VARIABLE' => 1,
|
||||
'gl_MODULE_INDICATOR_SET_VARIABLE' => 1,
|
||||
'gl_MODULE_INDICATOR_SET_VARIABLE_AUX' => 1,
|
||||
'gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR' => 1,
|
||||
'gl_PREREQ_ALLOCA' => 1,
|
||||
'gl_PREREQ_GETLOADAVG' => 1,
|
||||
'gl_PREREQ_LOCK' => 1,
|
||||
'gl_PROG_AR_RANLIB' => 1,
|
||||
'gl_PROG_CC_C99' => 1,
|
||||
'gl_REPLACE_FUNCS' => 1,
|
||||
'gl_SET_LARGEFILE_SOURCE' => 1,
|
||||
'gl_SILENT' => 1,
|
||||
'gl_SIZE_MAX' => 1,
|
||||
'gl_STDBOOL_H' => 1,
|
||||
'gl_STDLIB_H' => 1,
|
||||
'gl_STDLIB_H_DEFAULTS' => 1,
|
||||
'gl_STDLIB_H_REQUIRE_DEFAULTS' => 1,
|
||||
'gl_STDLIB_MODULE_INDICATOR' => 1,
|
||||
'gl_THREADLIB' => 1,
|
||||
'gl_THREADLIB_BODY' => 1,
|
||||
'gl_THREADLIB_EARLY' => 1,
|
||||
'gl_THREADLIB_EARLY_BODY' => 1,
|
||||
'gl_USE_SYSTEM_EXTENSIONS' => 1,
|
||||
'gl_VISIBILITY' => 1,
|
||||
'gl_W' => 1,
|
||||
'gl_WARN_ON_USE_PREPARE' => 1,
|
||||
'gl_XSIZE' => 1,
|
||||
'gl_YEAR2038' => 1,
|
||||
'gl_YEAR2038_BODY' => 1,
|
||||
'gl_YEAR2038_EARLY' => 1,
|
||||
'gl_YEAR2038_TEST_INCLUDES' => 1,
|
||||
'gl_ZZGNULIB' => 1,
|
||||
'gltests_LIBOBJ' => 1,
|
||||
'gltests_LIBSOURCES' => 1,
|
||||
'gltests_REPLACE_FUNCS' => 1,
|
||||
'gt_GLIBC2' => 1,
|
||||
'gt_GL_ATTRIBUTE' => 1,
|
||||
'gt_INTDIV0' => 1,
|
||||
'gt_INTL_MACOSX' => 1,
|
||||
'gt_INTL_SUBDIR_CORE' => 1,
|
||||
'gt_INTTYPES_PRI' => 1,
|
||||
'gt_LC_MESSAGES' => 1,
|
||||
'gt_PRINTF_POSIX' => 1,
|
||||
'gt_TYPE_INTMAX_T' => 1,
|
||||
'gt_TYPE_SIG_ATOMIC_T' => 1,
|
||||
'gt_TYPE_WCHAR_T' => 1,
|
||||
'gt_TYPE_WINT_T' => 1,
|
||||
'include' => 1,
|
||||
'm4_include' => 1,
|
||||
'm4_pattern_allow' => 1,
|
||||
'm4_pattern_forbid' => 1,
|
||||
'pds_AC_DOS_PATHS' => 1
|
||||
}
|
||||
], 'Autom4te::Request' ),
|
||||
bless( [
|
||||
'1',
|
||||
1,
|
||||
[
|
||||
'/usr/share/autoconf',
|
||||
'/share/aclocal'
|
||||
],
|
||||
[
|
||||
'/usr/share/autoconf/autoconf/autoconf.m4f',
|
||||
'aclocal.m4',
|
||||
'configure.ac'
|
||||
],
|
||||
{
|
||||
'AC_CANONICAL_BUILD' => 1,
|
||||
'AC_CANONICAL_HOST' => 1,
|
||||
'AC_CANONICAL_SYSTEM' => 1,
|
||||
'AC_CANONICAL_TARGET' => 1,
|
||||
'AC_CONFIG_AUX_DIR' => 1,
|
||||
'AC_CONFIG_FILES' => 1,
|
||||
'AC_CONFIG_HEADERS' => 1,
|
||||
'AC_CONFIG_LIBOBJ_DIR' => 1,
|
||||
'AC_CONFIG_LINKS' => 1,
|
||||
'AC_CONFIG_MACRO_DIR' => 1,
|
||||
'AC_CONFIG_MACRO_DIR_TRACE' => 1,
|
||||
'AC_CONFIG_SUBDIRS' => 1,
|
||||
'AC_DEFINE_TRACE_LITERAL' => 1,
|
||||
'AC_FC_FREEFORM' => 1,
|
||||
'AC_FC_PP_DEFINE' => 1,
|
||||
'AC_FC_PP_SRCEXT' => 1,
|
||||
'AC_FC_SRCEXT' => 1,
|
||||
'AC_INIT' => 1,
|
||||
'AC_LIBSOURCE' => 1,
|
||||
'AC_LIB_HAVE_LINKFLAGS' => 1,
|
||||
'AC_LIB_LINKFLAGS' => 1,
|
||||
'AC_LIB_LINKFLAGS_FROM_LIBS' => 1,
|
||||
'AC_PROG_LIBTOOL' => 1,
|
||||
'AC_REQUIRE_AUX_FILE' => 1,
|
||||
'AC_SUBST' => 1,
|
||||
'AC_SUBST_TRACE' => 1,
|
||||
'AH_OUTPUT' => 1,
|
||||
'AM_AUTOMAKE_VERSION' => 1,
|
||||
'AM_CONDITIONAL' => 1,
|
||||
'AM_ENABLE_MULTILIB' => 1,
|
||||
'AM_EXTRA_RECURSIVE_TARGETS' => 1,
|
||||
'AM_GNU_GETTEXT' => 1,
|
||||
'AM_GNU_GETTEXT_INTL_SUBDIR' => 1,
|
||||
'AM_GNU_GETTEXT_REQUIRE_VERSION' => 1,
|
||||
'AM_GNU_GETTEXT_VERSION' => 1,
|
||||
'AM_ICONV' => 1,
|
||||
'AM_INIT_AUTOMAKE' => 1,
|
||||
'AM_MAINTAINER_MODE' => 1,
|
||||
'AM_MAKEFILE_INCLUDE' => 1,
|
||||
'AM_NLS' => 1,
|
||||
'AM_PATH_GUILE' => 1,
|
||||
'AM_POT_TOOLS' => 1,
|
||||
'AM_PROG_AR' => 1,
|
||||
'AM_PROG_CC_C_O' => 1,
|
||||
'AM_PROG_CXX_C_O' => 1,
|
||||
'AM_PROG_F77_C_O' => 1,
|
||||
'AM_PROG_FC_C_O' => 1,
|
||||
'AM_PROG_LIBTOOL' => 1,
|
||||
'AM_PROG_MKDIR_P' => 1,
|
||||
'AM_PROG_MOC' => 1,
|
||||
'AM_SILENT_RULES' => 1,
|
||||
'AM_XGETTEXT_OPTION' => 1,
|
||||
'GTK_DOC_CHECK' => 1,
|
||||
'GUILE_FLAGS' => 1,
|
||||
'IT_PROG_INTLTOOL' => 1,
|
||||
'LT_CONFIG_LTDL_DIR' => 1,
|
||||
'LT_INIT' => 1,
|
||||
'LT_SUPPORTED_TAG' => 1,
|
||||
'_AM_COND_ELSE' => 1,
|
||||
'_AM_COND_ENDIF' => 1,
|
||||
'_AM_COND_IF' => 1,
|
||||
'_AM_MAKEFILE_INCLUDE' => 1,
|
||||
'_AM_SUBST_NOTMAKE' => 1,
|
||||
'_LT_AC_TAGCONFIG' => 1,
|
||||
'_m4_warn' => 1,
|
||||
'include' => 1,
|
||||
'm4_include' => 1,
|
||||
'm4_pattern_allow' => 1,
|
||||
'm4_pattern_forbid' => 1,
|
||||
'm4_sinclude' => 1,
|
||||
'sinclude' => 1
|
||||
}
|
||||
], 'Autom4te::Request' ),
|
||||
bless( [
|
||||
'2',
|
||||
1,
|
||||
[
|
||||
'/usr/share/autoconf',
|
||||
'/share/aclocal'
|
||||
],
|
||||
[
|
||||
'/usr/share/autoconf/autoconf/autoconf.m4f',
|
||||
'aclocal.m4',
|
||||
'/usr/share/autoconf/autoconf/trailer.m4',
|
||||
'configure.ac'
|
||||
],
|
||||
{
|
||||
'AC_CANONICAL_BUILD' => 1,
|
||||
'AC_CANONICAL_HOST' => 1,
|
||||
'AC_CANONICAL_SYSTEM' => 1,
|
||||
'AC_CANONICAL_TARGET' => 1,
|
||||
'AC_CONFIG_AUX_DIR' => 1,
|
||||
'AC_CONFIG_FILES' => 1,
|
||||
'AC_CONFIG_HEADERS' => 1,
|
||||
'AC_CONFIG_LIBOBJ_DIR' => 1,
|
||||
'AC_CONFIG_LINKS' => 1,
|
||||
'AC_CONFIG_MACRO_DIR' => 1,
|
||||
'AC_CONFIG_MACRO_DIR_TRACE' => 1,
|
||||
'AC_CONFIG_SUBDIRS' => 1,
|
||||
'AC_DEFINE_TRACE_LITERAL' => 1,
|
||||
'AC_FC_FREEFORM' => 1,
|
||||
'AC_FC_PP_DEFINE' => 1,
|
||||
'AC_FC_PP_SRCEXT' => 1,
|
||||
'AC_FC_SRCEXT' => 1,
|
||||
'AC_INIT' => 1,
|
||||
'AC_LIBSOURCE' => 1,
|
||||
'AC_LIB_HAVE_LINKFLAGS' => 1,
|
||||
'AC_LIB_LINKFLAGS' => 1,
|
||||
'AC_LIB_LINKFLAGS_FROM_LIBS' => 1,
|
||||
'AC_PROG_LIBTOOL' => 1,
|
||||
'AC_REQUIRE_AUX_FILE' => 1,
|
||||
'AC_SUBST' => 1,
|
||||
'AC_SUBST_TRACE' => 1,
|
||||
'AH_OUTPUT' => 1,
|
||||
'AM_AUTOMAKE_VERSION' => 1,
|
||||
'AM_CONDITIONAL' => 1,
|
||||
'AM_ENABLE_MULTILIB' => 1,
|
||||
'AM_EXTRA_RECURSIVE_TARGETS' => 1,
|
||||
'AM_GNU_GETTEXT' => 1,
|
||||
'AM_GNU_GETTEXT_INTL_SUBDIR' => 1,
|
||||
'AM_GNU_GETTEXT_REQUIRE_VERSION' => 1,
|
||||
'AM_GNU_GETTEXT_VERSION' => 1,
|
||||
'AM_ICONV' => 1,
|
||||
'AM_INIT_AUTOMAKE' => 1,
|
||||
'AM_MAINTAINER_MODE' => 1,
|
||||
'AM_MAKEFILE_INCLUDE' => 1,
|
||||
'AM_NLS' => 1,
|
||||
'AM_PATH_GUILE' => 1,
|
||||
'AM_POT_TOOLS' => 1,
|
||||
'AM_PROG_AR' => 1,
|
||||
'AM_PROG_CC_C_O' => 1,
|
||||
'AM_PROG_CXX_C_O' => 1,
|
||||
'AM_PROG_F77_C_O' => 1,
|
||||
'AM_PROG_FC_C_O' => 1,
|
||||
'AM_PROG_LIBTOOL' => 1,
|
||||
'AM_PROG_MKDIR_P' => 1,
|
||||
'AM_PROG_MOC' => 1,
|
||||
'AM_SILENT_RULES' => 1,
|
||||
'AM_XGETTEXT_OPTION' => 1,
|
||||
'GTK_DOC_CHECK' => 1,
|
||||
'GUILE_FLAGS' => 1,
|
||||
'IT_PROG_INTLTOOL' => 1,
|
||||
'LT_CONFIG_LTDL_DIR' => 1,
|
||||
'LT_INIT' => 1,
|
||||
'LT_SUPPORTED_TAG' => 1,
|
||||
'_AM_COND_ELSE' => 1,
|
||||
'_AM_COND_ENDIF' => 1,
|
||||
'_AM_COND_IF' => 1,
|
||||
'_AM_MAKEFILE_INCLUDE' => 1,
|
||||
'_AM_SUBST_NOTMAKE' => 1,
|
||||
'_LT_AC_TAGCONFIG' => 1,
|
||||
'_m4_warn' => 1,
|
||||
'include' => 1,
|
||||
'm4_include' => 1,
|
||||
'm4_pattern_allow' => 1,
|
||||
'm4_pattern_forbid' => 1,
|
||||
'm4_sinclude' => 1,
|
||||
'sinclude' => 1
|
||||
}
|
||||
], 'Autom4te::Request' ),
|
||||
bless( [
|
||||
'3',
|
||||
1,
|
||||
[
|
||||
'/usr/share/autoconf'
|
||||
],
|
||||
[
|
||||
'/usr/share/autoconf/autoconf/autoconf.m4f',
|
||||
'aclocal.m4',
|
||||
'configure.ac'
|
||||
],
|
||||
{
|
||||
'AC_CANONICAL_BUILD' => 1,
|
||||
'AC_CANONICAL_HOST' => 1,
|
||||
'AC_CANONICAL_SYSTEM' => 1,
|
||||
'AC_CANONICAL_TARGET' => 1,
|
||||
'AC_CONFIG_AUX_DIR' => 1,
|
||||
'AC_CONFIG_FILES' => 1,
|
||||
'AC_CONFIG_HEADERS' => 1,
|
||||
'AC_CONFIG_LIBOBJ_DIR' => 1,
|
||||
'AC_CONFIG_LINKS' => 1,
|
||||
'AC_CONFIG_MACRO_DIR' => 1,
|
||||
'AC_CONFIG_MACRO_DIR_TRACE' => 1,
|
||||
'AC_CONFIG_SUBDIRS' => 1,
|
||||
'AC_DEFINE_TRACE_LITERAL' => 1,
|
||||
'AC_FC_FREEFORM' => 1,
|
||||
'AC_FC_PP_DEFINE' => 1,
|
||||
'AC_FC_PP_SRCEXT' => 1,
|
||||
'AC_FC_SRCEXT' => 1,
|
||||
'AC_INIT' => 1,
|
||||
'AC_LIBSOURCE' => 1,
|
||||
'AC_LIB_HAVE_LINKFLAGS' => 1,
|
||||
'AC_LIB_LINKFLAGS' => 1,
|
||||
'AC_LIB_LINKFLAGS_FROM_LIBS' => 1,
|
||||
'AC_PROG_LIBTOOL' => 1,
|
||||
'AC_REQUIRE_AUX_FILE' => 1,
|
||||
'AC_SUBST' => 1,
|
||||
'AC_SUBST_TRACE' => 1,
|
||||
'AH_OUTPUT' => 1,
|
||||
'AM_AUTOMAKE_VERSION' => 1,
|
||||
'AM_CONDITIONAL' => 1,
|
||||
'AM_ENABLE_MULTILIB' => 1,
|
||||
'AM_EXTRA_RECURSIVE_TARGETS' => 1,
|
||||
'AM_GNU_GETTEXT' => 1,
|
||||
'AM_GNU_GETTEXT_INTL_SUBDIR' => 1,
|
||||
'AM_GNU_GETTEXT_REQUIRE_VERSION' => 1,
|
||||
'AM_GNU_GETTEXT_VERSION' => 1,
|
||||
'AM_ICONV' => 1,
|
||||
'AM_INIT_AUTOMAKE' => 1,
|
||||
'AM_MAINTAINER_MODE' => 1,
|
||||
'AM_MAKEFILE_INCLUDE' => 1,
|
||||
'AM_NLS' => 1,
|
||||
'AM_PATH_GUILE' => 1,
|
||||
'AM_POT_TOOLS' => 1,
|
||||
'AM_PROG_AR' => 1,
|
||||
'AM_PROG_CC_C_O' => 1,
|
||||
'AM_PROG_CXX_C_O' => 1,
|
||||
'AM_PROG_F77_C_O' => 1,
|
||||
'AM_PROG_FC_C_O' => 1,
|
||||
'AM_PROG_LIBTOOL' => 1,
|
||||
'AM_PROG_MKDIR_P' => 1,
|
||||
'AM_PROG_MOC' => 1,
|
||||
'AM_SILENT_RULES' => 1,
|
||||
'AM_XGETTEXT_OPTION' => 1,
|
||||
'GTK_DOC_CHECK' => 1,
|
||||
'GUILE_FLAGS' => 1,
|
||||
'IT_PROG_INTLTOOL' => 1,
|
||||
'LT_CONFIG_LTDL_DIR' => 1,
|
||||
'LT_INIT' => 1,
|
||||
'LT_SUPPORTED_TAG' => 1,
|
||||
'_AM_COND_ELSE' => 1,
|
||||
'_AM_COND_ENDIF' => 1,
|
||||
'_AM_COND_IF' => 1,
|
||||
'_AM_MAKEFILE_INCLUDE' => 1,
|
||||
'_AM_SUBST_NOTMAKE' => 1,
|
||||
'_LT_AC_TAGCONFIG' => 1,
|
||||
'_m4_warn' => 1,
|
||||
'include' => 1,
|
||||
'm4_include' => 1,
|
||||
'm4_pattern_allow' => 1,
|
||||
'm4_pattern_forbid' => 1,
|
||||
'm4_sinclude' => 1,
|
||||
'sinclude' => 1
|
||||
}
|
||||
], 'Autom4te::Request' )
|
||||
);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+364
@@ -0,0 +1,364 @@
|
||||
#! /bin/sh
|
||||
# Wrapper for compilers which do not understand '-c -o'.
|
||||
|
||||
scriptversion=2025-06-18.21; # UTC
|
||||
|
||||
# Copyright (C) 1999-2025 Free Software Foundation, Inc.
|
||||
# Written by Tom Tromey <tromey@cygnus.com>.
|
||||
#
|
||||
# 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, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# This file is maintained in Automake, please report
|
||||
# bugs to <bug-automake@gnu.org> or send patches to
|
||||
# <automake-patches@gnu.org>.
|
||||
|
||||
nl='
|
||||
'
|
||||
|
||||
# We need space, tab and new line, in precisely that order. Quoting is
|
||||
# there to prevent tools from complaining about whitespace usage.
|
||||
IFS=" "" $nl"
|
||||
|
||||
file_conv=
|
||||
|
||||
# func_file_conv build_file unneeded_conversions
|
||||
# Convert a $build file to $host form and store it in $file
|
||||
# Currently only supports Windows hosts. If the determined conversion
|
||||
# type is listed in (the comma separated) UNNEEDED_CONVERSIONS, no
|
||||
# conversion will take place.
|
||||
func_file_conv ()
|
||||
{
|
||||
file=$1
|
||||
case $file in
|
||||
/ | /[!/]*) # absolute file, and not a UNC file
|
||||
if test -z "$file_conv"; then
|
||||
# lazily determine how to convert abs files
|
||||
case `uname -s` in
|
||||
MINGW*)
|
||||
if test -n "$MSYSTEM" && (cygpath --version) >/dev/null 2>&1; then
|
||||
# MSYS2 environment.
|
||||
file_conv=cygwin
|
||||
else
|
||||
# Original MinGW environment.
|
||||
file_conv=mingw
|
||||
fi
|
||||
;;
|
||||
MSYS*)
|
||||
# Old MSYS environment, or MSYS2 with 32-bit MSYS2 shell.
|
||||
file_conv=cygwin
|
||||
;;
|
||||
CYGWIN*)
|
||||
# Cygwin environment.
|
||||
file_conv=cygwin
|
||||
;;
|
||||
*)
|
||||
file_conv=wine
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
case $file_conv/,$2, in
|
||||
*,$file_conv,*)
|
||||
# This is the optimization mentioned above:
|
||||
# If UNNEEDED_CONVERSIONS contains $file_conv, don't convert.
|
||||
;;
|
||||
mingw/*)
|
||||
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
|
||||
;;
|
||||
cygwin/*)
|
||||
file=`cygpath -w "$file" || echo "$file"`
|
||||
;;
|
||||
wine/*)
|
||||
file=`winepath -w "$file" || echo "$file"`
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# func_cl_dashL linkdir
|
||||
# Make cl look for libraries in LINKDIR
|
||||
func_cl_dashL ()
|
||||
{
|
||||
func_file_conv "$1"
|
||||
if test -z "$lib_path"; then
|
||||
lib_path=$file
|
||||
else
|
||||
lib_path="$lib_path;$file"
|
||||
fi
|
||||
linker_opts="$linker_opts -LIBPATH:$file"
|
||||
}
|
||||
|
||||
# func_cl_dashl library
|
||||
# Do a library search-path lookup for cl
|
||||
func_cl_dashl ()
|
||||
{
|
||||
lib=$1
|
||||
found=no
|
||||
save_IFS=$IFS
|
||||
IFS=';'
|
||||
for dir in $lib_path $LIB
|
||||
do
|
||||
IFS=$save_IFS
|
||||
if $shared && test -f "$dir/$lib.dll.lib"; then
|
||||
found=yes
|
||||
lib=$dir/$lib.dll.lib
|
||||
break
|
||||
fi
|
||||
if test -f "$dir/$lib.lib"; then
|
||||
found=yes
|
||||
lib=$dir/$lib.lib
|
||||
break
|
||||
fi
|
||||
if test -f "$dir/lib$lib.a"; then
|
||||
found=yes
|
||||
lib=$dir/lib$lib.a
|
||||
break
|
||||
fi
|
||||
done
|
||||
IFS=$save_IFS
|
||||
|
||||
if test "$found" != yes; then
|
||||
lib=$lib.lib
|
||||
fi
|
||||
}
|
||||
|
||||
# func_cl_wrapper cl arg...
|
||||
# Adjust compile command to suit cl
|
||||
func_cl_wrapper ()
|
||||
{
|
||||
# Assume a capable shell
|
||||
lib_path=
|
||||
shared=:
|
||||
linker_opts=
|
||||
for arg
|
||||
do
|
||||
if test -n "$eat"; then
|
||||
eat=
|
||||
else
|
||||
case $1 in
|
||||
-o)
|
||||
# configure might choose to run compile as 'compile cc -o foo foo.c'.
|
||||
eat=1
|
||||
case $2 in
|
||||
*.o | *.lo | *.[oO][bB][jJ])
|
||||
func_file_conv "$2"
|
||||
set x "$@" -Fo"$file"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
func_file_conv "$2"
|
||||
set x "$@" -Fe"$file"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
-I)
|
||||
eat=1
|
||||
func_file_conv "$2" mingw
|
||||
set x "$@" -I"$file"
|
||||
shift
|
||||
;;
|
||||
-I*)
|
||||
func_file_conv "${1#-I}" mingw
|
||||
set x "$@" -I"$file"
|
||||
shift
|
||||
;;
|
||||
-l)
|
||||
eat=1
|
||||
func_cl_dashl "$2"
|
||||
set x "$@" "$lib"
|
||||
shift
|
||||
;;
|
||||
-l*)
|
||||
func_cl_dashl "${1#-l}"
|
||||
set x "$@" "$lib"
|
||||
shift
|
||||
;;
|
||||
-L)
|
||||
eat=1
|
||||
func_cl_dashL "$2"
|
||||
;;
|
||||
-L*)
|
||||
func_cl_dashL "${1#-L}"
|
||||
;;
|
||||
-static)
|
||||
shared=false
|
||||
;;
|
||||
-Wl,*)
|
||||
arg=${1#-Wl,}
|
||||
save_ifs="$IFS"; IFS=','
|
||||
for flag in $arg; do
|
||||
IFS="$save_ifs"
|
||||
linker_opts="$linker_opts $flag"
|
||||
done
|
||||
IFS="$save_ifs"
|
||||
;;
|
||||
-Xlinker)
|
||||
eat=1
|
||||
linker_opts="$linker_opts $2"
|
||||
;;
|
||||
-*)
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
|
||||
func_file_conv "$1"
|
||||
set x "$@" -Tp"$file"
|
||||
shift
|
||||
;;
|
||||
*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
|
||||
func_file_conv "$1" mingw
|
||||
set x "$@" "$file"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
shift
|
||||
done
|
||||
if test -n "$linker_opts"; then
|
||||
linker_opts="-link$linker_opts"
|
||||
fi
|
||||
exec "$@" $linker_opts
|
||||
exit 1
|
||||
}
|
||||
|
||||
eat=
|
||||
|
||||
case $1 in
|
||||
'')
|
||||
echo "$0: No command. Try '$0 --help' for more information." 1>&2
|
||||
exit 1;
|
||||
;;
|
||||
-h | --h*)
|
||||
cat <<\EOF
|
||||
Usage: compile [--help] [--version] PROGRAM [ARGS]
|
||||
|
||||
Wrapper for compilers which do not understand '-c -o'.
|
||||
Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
|
||||
arguments, and rename the output as expected.
|
||||
|
||||
If you are trying to build a whole package this is not the
|
||||
right script to run: please start by reading the file 'INSTALL'.
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>.
|
||||
GNU Automake home page: <https://www.gnu.org/software/automake/>.
|
||||
General help using GNU software: <https://www.gnu.org/gethelp/>.
|
||||
EOF
|
||||
exit $?
|
||||
;;
|
||||
-v | --v*)
|
||||
echo "compile (GNU Automake) $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
|
||||
clang-cl | *[/\\]clang-cl | clang-cl.exe | *[/\\]clang-cl.exe | \
|
||||
icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
|
||||
func_cl_wrapper "$@" # Doesn't return...
|
||||
;;
|
||||
esac
|
||||
|
||||
ofile=
|
||||
cfile=
|
||||
|
||||
for arg
|
||||
do
|
||||
if test -n "$eat"; then
|
||||
eat=
|
||||
else
|
||||
case $1 in
|
||||
-o)
|
||||
# configure might choose to run compile as 'compile cc -o foo foo.c'.
|
||||
# So we strip '-o arg' only if arg is an object.
|
||||
eat=1
|
||||
case $2 in
|
||||
*.o | *.obj)
|
||||
ofile=$2
|
||||
;;
|
||||
*)
|
||||
set x "$@" -o "$2"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*.c)
|
||||
cfile=$1
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
shift
|
||||
done
|
||||
|
||||
if test -z "$ofile" || test -z "$cfile"; then
|
||||
# If no '-o' option was seen then we might have been invoked from a
|
||||
# pattern rule where we don't need one. That is ok -- this is a
|
||||
# normal compilation that the losing compiler can handle. If no
|
||||
# '.c' file was seen then we are probably linking. That is also
|
||||
# ok.
|
||||
exec "$@"
|
||||
fi
|
||||
|
||||
# Name of file we expect compiler to create.
|
||||
cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
|
||||
|
||||
# Create the lock directory.
|
||||
# Note: use '[/\\:.-]' here to ensure that we don't use the same name
|
||||
# that we are using for the .o file. Also, base the name on the expected
|
||||
# object file name, since that is what matters with a parallel build.
|
||||
lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
|
||||
while true; do
|
||||
if mkdir "$lockdir" >/dev/null 2>&1; then
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
# FIXME: race condition here if user kills between mkdir and trap.
|
||||
trap "rmdir '$lockdir'; exit 1" 1 2 15
|
||||
|
||||
# Run the compile.
|
||||
"$@"
|
||||
ret=$?
|
||||
|
||||
if test -f "$cofile"; then
|
||||
test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
|
||||
elif test -f "${cofile}bj"; then
|
||||
test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
|
||||
fi
|
||||
|
||||
rmdir "$lockdir"
|
||||
exit $ret
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'before-save-hook 'time-stamp nil t)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%Y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC0"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
||||
+1818
File diff suppressed because it is too large
Load Diff
+1815
File diff suppressed because it is too large
Load Diff
+684
@@ -0,0 +1,684 @@
|
||||
#! /bin/sh
|
||||
# Output a system dependent set of variables, describing how to set the
|
||||
# run time search path of shared libraries in an executable.
|
||||
#
|
||||
# Copyright 1996-2014 Free Software Foundation, Inc.
|
||||
# Taken from GNU libtool, 2001
|
||||
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
|
||||
#
|
||||
# This file is free software; the Free Software Foundation gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
# modifications, as long as this notice is preserved.
|
||||
#
|
||||
# The first argument passed to this file is the canonical host specification,
|
||||
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
|
||||
# or
|
||||
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
|
||||
# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
|
||||
# should be set by the caller.
|
||||
#
|
||||
# The set of defined variables is at the end of this script.
|
||||
|
||||
# Known limitations:
|
||||
# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
|
||||
# than 256 bytes, otherwise the compiler driver will dump core. The only
|
||||
# known workaround is to choose shorter directory names for the build
|
||||
# directory and/or the installation directory.
|
||||
|
||||
# All known linkers require a '.a' archive for static linking (except MSVC,
|
||||
# which needs '.lib').
|
||||
libext=a
|
||||
shrext=.so
|
||||
|
||||
host="$1"
|
||||
host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
|
||||
host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
|
||||
host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
|
||||
|
||||
# Code taken from libtool.m4's _LT_CC_BASENAME.
|
||||
|
||||
for cc_temp in $CC""; do
|
||||
case $cc_temp in
|
||||
compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
|
||||
distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
|
||||
\-*) ;;
|
||||
*) break;;
|
||||
esac
|
||||
done
|
||||
cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
|
||||
|
||||
# Code taken from libtool.m4's _LT_COMPILER_PIC.
|
||||
|
||||
wl=
|
||||
if test "$GCC" = yes; then
|
||||
wl='-Wl,'
|
||||
else
|
||||
case "$host_os" in
|
||||
aix*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
mingw* | cygwin* | pw32* | os2* | cegcc*)
|
||||
;;
|
||||
hpux9* | hpux10* | hpux11*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
irix5* | irix6* | nonstopux*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
linux* | k*bsd*-gnu | kopensolaris*-gnu)
|
||||
case $cc_basename in
|
||||
ecc*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
icc* | ifort*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
lf95*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
nagfor*)
|
||||
wl='-Wl,-Wl,,'
|
||||
;;
|
||||
pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
ccc*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
xl* | bgxl* | bgf* | mpixl*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
como)
|
||||
wl='-lopt='
|
||||
;;
|
||||
*)
|
||||
case `$CC -V 2>&1 | sed 5q` in
|
||||
*Sun\ F* | *Sun*Fortran*)
|
||||
wl=
|
||||
;;
|
||||
*Sun\ C*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
newsos6)
|
||||
;;
|
||||
*nto* | *qnx*)
|
||||
;;
|
||||
osf3* | osf4* | osf5*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
rdos*)
|
||||
;;
|
||||
solaris*)
|
||||
case $cc_basename in
|
||||
f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
|
||||
wl='-Qoption ld '
|
||||
;;
|
||||
*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
sunos4*)
|
||||
wl='-Qoption ld '
|
||||
;;
|
||||
sysv4 | sysv4.2uw2* | sysv4.3*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
sysv4*MP*)
|
||||
;;
|
||||
sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
unicos*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
uts4*)
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Code taken from libtool.m4's _LT_LINKER_SHLIBS.
|
||||
|
||||
hardcode_libdir_flag_spec=
|
||||
hardcode_libdir_separator=
|
||||
hardcode_direct=no
|
||||
hardcode_minus_L=no
|
||||
|
||||
case "$host_os" in
|
||||
cygwin* | mingw* | pw32* | cegcc*)
|
||||
# FIXME: the MSVC++ port hasn't been tested in a loooong time
|
||||
# When not using gcc, we currently assume that we are using
|
||||
# Microsoft Visual C++.
|
||||
if test "$GCC" != yes; then
|
||||
with_gnu_ld=no
|
||||
fi
|
||||
;;
|
||||
interix*)
|
||||
# we just hope/assume this is gcc and not c89 (= MSVC++)
|
||||
with_gnu_ld=yes
|
||||
;;
|
||||
openbsd*)
|
||||
with_gnu_ld=no
|
||||
;;
|
||||
esac
|
||||
|
||||
ld_shlibs=yes
|
||||
if test "$with_gnu_ld" = yes; then
|
||||
# Set some defaults for GNU ld with shared library support. These
|
||||
# are reset later if shared libraries are not supported. Putting them
|
||||
# here allows them to be overridden if necessary.
|
||||
# Unlike libtool, we use -rpath here, not --rpath, since the documented
|
||||
# option of GNU ld is called -rpath, not --rpath.
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
case "$host_os" in
|
||||
aix[3-9]*)
|
||||
# On AIX/PPC, the GNU linker is very broken
|
||||
if test "$host_cpu" != ia64; then
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
amigaos*)
|
||||
case "$host_cpu" in
|
||||
powerpc)
|
||||
;;
|
||||
m68k)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
beos*)
|
||||
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
|
||||
:
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
cygwin* | mingw* | pw32* | cegcc*)
|
||||
# hardcode_libdir_flag_spec is actually meaningless, as there is
|
||||
# no search path for DLLs.
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
|
||||
:
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
haiku*)
|
||||
;;
|
||||
interix[3-9]*)
|
||||
hardcode_direct=no
|
||||
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
|
||||
;;
|
||||
gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
|
||||
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
|
||||
:
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
netbsd*)
|
||||
;;
|
||||
solaris*)
|
||||
if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
|
||||
ld_shlibs=no
|
||||
elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
|
||||
:
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
|
||||
case `$LD -v 2>&1` in
|
||||
*\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
|
||||
ld_shlibs=no
|
||||
;;
|
||||
*)
|
||||
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
|
||||
hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
sunos4*)
|
||||
hardcode_direct=yes
|
||||
;;
|
||||
*)
|
||||
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
|
||||
:
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
if test "$ld_shlibs" = no; then
|
||||
hardcode_libdir_flag_spec=
|
||||
fi
|
||||
else
|
||||
case "$host_os" in
|
||||
aix3*)
|
||||
# Note: this linker hardcodes the directories in LIBPATH if there
|
||||
# are no directories specified by -L.
|
||||
hardcode_minus_L=yes
|
||||
if test "$GCC" = yes; then
|
||||
# Neither direct hardcoding nor static linking is supported with a
|
||||
# broken collect2.
|
||||
hardcode_direct=unsupported
|
||||
fi
|
||||
;;
|
||||
aix[4-9]*)
|
||||
if test "$host_cpu" = ia64; then
|
||||
# On IA64, the linker does run time linking by default, so we don't
|
||||
# have to do anything special.
|
||||
aix_use_runtimelinking=no
|
||||
else
|
||||
aix_use_runtimelinking=no
|
||||
# Test if we are trying to use run time linking or normal
|
||||
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
|
||||
# need to do runtime linking.
|
||||
case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
|
||||
for ld_flag in $LDFLAGS; do
|
||||
if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
|
||||
aix_use_runtimelinking=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
hardcode_direct=yes
|
||||
hardcode_libdir_separator=':'
|
||||
if test "$GCC" = yes; then
|
||||
case $host_os in aix4.[012]|aix4.[012].*)
|
||||
collect2name=`${CC} -print-prog-name=collect2`
|
||||
if test -f "$collect2name" && \
|
||||
strings "$collect2name" | grep resolve_lib_name >/dev/null
|
||||
then
|
||||
# We have reworked collect2
|
||||
:
|
||||
else
|
||||
# We have old collect2
|
||||
hardcode_direct=unsupported
|
||||
hardcode_minus_L=yes
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_libdir_separator=
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
# Begin _LT_AC_SYS_LIBPATH_AIX.
|
||||
echo 'int main () { return 0; }' > conftest.c
|
||||
${CC} ${LDFLAGS} conftest.c -o conftest
|
||||
aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
|
||||
}'`
|
||||
if test -z "$aix_libpath"; then
|
||||
aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
|
||||
}'`
|
||||
fi
|
||||
if test -z "$aix_libpath"; then
|
||||
aix_libpath="/usr/lib:/lib"
|
||||
fi
|
||||
rm -f conftest.c conftest
|
||||
# End _LT_AC_SYS_LIBPATH_AIX.
|
||||
if test "$aix_use_runtimelinking" = yes; then
|
||||
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
|
||||
else
|
||||
if test "$host_cpu" = ia64; then
|
||||
hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
|
||||
else
|
||||
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
amigaos*)
|
||||
case "$host_cpu" in
|
||||
powerpc)
|
||||
;;
|
||||
m68k)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
bsdi[45]*)
|
||||
;;
|
||||
cygwin* | mingw* | pw32* | cegcc*)
|
||||
# When not using gcc, we currently assume that we are using
|
||||
# Microsoft Visual C++.
|
||||
# hardcode_libdir_flag_spec is actually meaningless, as there is
|
||||
# no search path for DLLs.
|
||||
hardcode_libdir_flag_spec=' '
|
||||
libext=lib
|
||||
;;
|
||||
darwin* | rhapsody*)
|
||||
hardcode_direct=no
|
||||
if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then
|
||||
:
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
dgux*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
;;
|
||||
freebsd2.[01]*)
|
||||
hardcode_direct=yes
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
freebsd* | dragonfly*)
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
hardcode_direct=yes
|
||||
;;
|
||||
hpux9*)
|
||||
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
hardcode_direct=yes
|
||||
# hardcode_minus_L: Not really in the search PATH,
|
||||
# but as the default location of the library.
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
hpux10*)
|
||||
if test "$with_gnu_ld" = no; then
|
||||
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
hardcode_direct=yes
|
||||
# hardcode_minus_L: Not really in the search PATH,
|
||||
# but as the default location of the library.
|
||||
hardcode_minus_L=yes
|
||||
fi
|
||||
;;
|
||||
hpux11*)
|
||||
if test "$with_gnu_ld" = no; then
|
||||
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
case $host_cpu in
|
||||
hppa*64*|ia64*)
|
||||
hardcode_direct=no
|
||||
;;
|
||||
*)
|
||||
hardcode_direct=yes
|
||||
# hardcode_minus_L: Not really in the search PATH,
|
||||
# but as the default location of the library.
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
;;
|
||||
irix5* | irix6* | nonstopux*)
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
;;
|
||||
netbsd*)
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
hardcode_direct=yes
|
||||
;;
|
||||
newsos6)
|
||||
hardcode_direct=yes
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
;;
|
||||
*nto* | *qnx*)
|
||||
;;
|
||||
openbsd*)
|
||||
if test -f /usr/libexec/ld.so; then
|
||||
hardcode_direct=yes
|
||||
if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
|
||||
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
|
||||
else
|
||||
case "$host_os" in
|
||||
openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
;;
|
||||
*)
|
||||
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
os2*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
osf3*)
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
;;
|
||||
osf4* | osf5*)
|
||||
if test "$GCC" = yes; then
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
else
|
||||
# Both cc and cxx compiler support -rpath directly
|
||||
hardcode_libdir_flag_spec='-rpath $libdir'
|
||||
fi
|
||||
hardcode_libdir_separator=:
|
||||
;;
|
||||
solaris*)
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
;;
|
||||
sunos4*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_direct=yes
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
sysv4)
|
||||
case $host_vendor in
|
||||
sni)
|
||||
hardcode_direct=yes # is this really true???
|
||||
;;
|
||||
siemens)
|
||||
hardcode_direct=no
|
||||
;;
|
||||
motorola)
|
||||
hardcode_direct=no #Motorola manual says yes, but my tests say they lie
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
sysv4.3*)
|
||||
;;
|
||||
sysv4*MP*)
|
||||
if test -d /usr/nec; then
|
||||
ld_shlibs=yes
|
||||
fi
|
||||
;;
|
||||
sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
|
||||
;;
|
||||
sysv5* | sco3.2v5* | sco5v6*)
|
||||
hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
|
||||
hardcode_libdir_separator=':'
|
||||
;;
|
||||
uts4*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
;;
|
||||
*)
|
||||
ld_shlibs=no
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Check dynamic linker characteristics
|
||||
# Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER.
|
||||
# Unlike libtool.m4, here we don't care about _all_ names of the library, but
|
||||
# only about the one the linker finds when passed -lNAME. This is the last
|
||||
# element of library_names_spec in libtool.m4, or possibly two of them if the
|
||||
# linker has special search rules.
|
||||
library_names_spec= # the last element of library_names_spec in libtool.m4
|
||||
libname_spec='lib$name'
|
||||
case "$host_os" in
|
||||
aix3*)
|
||||
library_names_spec='$libname.a'
|
||||
;;
|
||||
aix[4-9]*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
amigaos*)
|
||||
case "$host_cpu" in
|
||||
powerpc*)
|
||||
library_names_spec='$libname$shrext' ;;
|
||||
m68k)
|
||||
library_names_spec='$libname.a' ;;
|
||||
esac
|
||||
;;
|
||||
beos*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
bsdi[45]*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
cygwin* | mingw* | pw32* | cegcc*)
|
||||
shrext=.dll
|
||||
library_names_spec='$libname.dll.a $libname.lib'
|
||||
;;
|
||||
darwin* | rhapsody*)
|
||||
shrext=.dylib
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
dgux*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
freebsd[23].*)
|
||||
library_names_spec='$libname$shrext$versuffix'
|
||||
;;
|
||||
freebsd* | dragonfly*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
gnu*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
haiku*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
hpux9* | hpux10* | hpux11*)
|
||||
case $host_cpu in
|
||||
ia64*)
|
||||
shrext=.so
|
||||
;;
|
||||
hppa*64*)
|
||||
shrext=.sl
|
||||
;;
|
||||
*)
|
||||
shrext=.sl
|
||||
;;
|
||||
esac
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
interix[3-9]*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
irix5* | irix6* | nonstopux*)
|
||||
library_names_spec='$libname$shrext'
|
||||
case "$host_os" in
|
||||
irix5* | nonstopux*)
|
||||
libsuff= shlibsuff=
|
||||
;;
|
||||
*)
|
||||
case $LD in
|
||||
*-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
|
||||
*-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
|
||||
*-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
|
||||
*) libsuff= shlibsuff= ;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
linux*oldld* | linux*aout* | linux*coff*)
|
||||
;;
|
||||
linux* | k*bsd*-gnu | kopensolaris*-gnu)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
knetbsd*-gnu)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
netbsd*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
newsos6)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
*nto* | *qnx*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
openbsd*)
|
||||
library_names_spec='$libname$shrext$versuffix'
|
||||
;;
|
||||
os2*)
|
||||
libname_spec='$name'
|
||||
shrext=.dll
|
||||
library_names_spec='$libname.a'
|
||||
;;
|
||||
osf3* | osf4* | osf5*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
rdos*)
|
||||
;;
|
||||
solaris*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
sunos4*)
|
||||
library_names_spec='$libname$shrext$versuffix'
|
||||
;;
|
||||
sysv4 | sysv4.3*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
sysv4*MP*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
tpf*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
uts4*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
esac
|
||||
|
||||
sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
|
||||
escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
|
||||
shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
|
||||
escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
|
||||
escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
|
||||
escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
|
||||
|
||||
LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
|
||||
|
||||
# How to pass a linker flag through the compiler.
|
||||
wl="$escaped_wl"
|
||||
|
||||
# Static library suffix (normally "a").
|
||||
libext="$libext"
|
||||
|
||||
# Shared library suffix (normally "so").
|
||||
shlibext="$shlibext"
|
||||
|
||||
# Format of library name prefix.
|
||||
libname_spec="$escaped_libname_spec"
|
||||
|
||||
# Library names that the linker finds when passed -lNAME.
|
||||
library_names_spec="$escaped_library_names_spec"
|
||||
|
||||
# Flag to hardcode \$libdir into a binary during linking.
|
||||
# This must work even if \$libdir does not exist.
|
||||
hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
|
||||
|
||||
# Whether we need a single -rpath flag with a separated argument.
|
||||
hardcode_libdir_separator="$hardcode_libdir_separator"
|
||||
|
||||
# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
|
||||
# resulting binary.
|
||||
hardcode_direct="$hardcode_direct"
|
||||
|
||||
# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
|
||||
# resulting binary.
|
||||
hardcode_minus_L="$hardcode_minus_L"
|
||||
|
||||
EOF
|
||||
+2364
File diff suppressed because it is too large
Load Diff
+2354
File diff suppressed because it is too large
Load Diff
+792
@@ -0,0 +1,792 @@
|
||||
#! /bin/sh
|
||||
# depcomp - compile a program generating dependencies as side-effects
|
||||
|
||||
scriptversion=2025-06-18.21; # UTC
|
||||
|
||||
# Copyright (C) 1999-2025 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, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
|
||||
|
||||
case $1 in
|
||||
'')
|
||||
echo "$0: No command. Try '$0 --help' for more information." 1>&2
|
||||
exit 1;
|
||||
;;
|
||||
-h | --h*)
|
||||
cat <<\EOF
|
||||
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
|
||||
|
||||
Run PROGRAMS ARGS to compile a file, generating dependencies
|
||||
as side-effects.
|
||||
|
||||
Environment variables:
|
||||
depmode Dependency tracking mode.
|
||||
source Source file read by 'PROGRAMS ARGS'.
|
||||
object Object file output by 'PROGRAMS ARGS'.
|
||||
DEPDIR directory where to store dependencies.
|
||||
depfile Dependency file to output.
|
||||
tmpdepfile Temporary file to use when outputting dependencies.
|
||||
libtool Whether libtool is used (yes/no).
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>.
|
||||
GNU Automake home page: <https://www.gnu.org/software/automake/>.
|
||||
General help using GNU software: <https://www.gnu.org/gethelp/>.
|
||||
EOF
|
||||
exit $?
|
||||
;;
|
||||
-v | --v*)
|
||||
echo "depcomp (GNU Automake) $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
esac
|
||||
|
||||
# Get the directory component of the given path, and save it in the
|
||||
# global variables '$dir'. Note that this directory component will
|
||||
# be either empty or ending with a '/' character. This is deliberate.
|
||||
set_dir_from ()
|
||||
{
|
||||
case $1 in
|
||||
*/*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
|
||||
*) dir=;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Get the suffix-stripped basename of the given path, and save it the
|
||||
# global variable '$base'.
|
||||
set_base_from ()
|
||||
{
|
||||
base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
|
||||
}
|
||||
|
||||
# If no dependency file was actually created by the compiler invocation,
|
||||
# we still have to create a dummy depfile, to avoid errors with the
|
||||
# Makefile "include basename.Plo" scheme.
|
||||
make_dummy_depfile ()
|
||||
{
|
||||
echo "#dummy" > "$depfile"
|
||||
}
|
||||
|
||||
# Factor out some common post-processing of the generated depfile.
|
||||
# Requires the auxiliary global variable '$tmpdepfile' to be set.
|
||||
aix_post_process_depfile ()
|
||||
{
|
||||
# If the compiler actually managed to produce a dependency file,
|
||||
# post-process it.
|
||||
if test -f "$tmpdepfile"; then
|
||||
# Each line is of the form 'foo.o: dependency.h'.
|
||||
# Do two passes, one to just change these to
|
||||
# $object: dependency.h
|
||||
# and one to simply output
|
||||
# dependency.h:
|
||||
# which is needed to avoid the deleted-header problem.
|
||||
{ sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
|
||||
sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
|
||||
} > "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
else
|
||||
make_dummy_depfile
|
||||
fi
|
||||
}
|
||||
|
||||
# A tabulation character.
|
||||
tab=' '
|
||||
# A newline character.
|
||||
nl='
|
||||
'
|
||||
# Character ranges might be problematic outside the C locale.
|
||||
# These definitions help.
|
||||
upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
|
||||
lower=abcdefghijklmnopqrstuvwxyz
|
||||
alpha=${upper}${lower}
|
||||
|
||||
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
|
||||
echo "depcomp: Variables source, object and depmode must be set" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
|
||||
depfile=${depfile-`echo "$object" |
|
||||
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
|
||||
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
|
||||
|
||||
rm -f "$tmpdepfile"
|
||||
|
||||
# Avoid interference from the environment.
|
||||
gccflag= dashmflag=
|
||||
|
||||
# Some modes work just like other modes, but use different flags. We
|
||||
# parameterize here, but still list the modes in the big case below,
|
||||
# to make depend.m4 easier to write. Note that we *cannot* use a case
|
||||
# here, because this file can only contain one case statement.
|
||||
if test "$depmode" = hp; then
|
||||
# HP compiler uses -M and no extra arg.
|
||||
gccflag=-M
|
||||
depmode=gcc
|
||||
fi
|
||||
|
||||
if test "$depmode" = dashXmstdout; then
|
||||
# This is just like dashmstdout with a different argument.
|
||||
dashmflag=-xM
|
||||
depmode=dashmstdout
|
||||
fi
|
||||
|
||||
cygpath_u="cygpath -u -f -"
|
||||
if test "$depmode" = msvcmsys; then
|
||||
# This is just like msvisualcpp but w/o cygpath translation.
|
||||
# Just convert the backslash-escaped backslashes to single forward
|
||||
# slashes to satisfy depend.m4
|
||||
cygpath_u='sed s,\\\\,/,g'
|
||||
depmode=msvisualcpp
|
||||
fi
|
||||
|
||||
if test "$depmode" = msvc7msys; then
|
||||
# This is just like msvc7 but w/o cygpath translation.
|
||||
# Just convert the backslash-escaped backslashes to single forward
|
||||
# slashes to satisfy depend.m4
|
||||
cygpath_u='sed s,\\\\,/,g'
|
||||
depmode=msvc7
|
||||
fi
|
||||
|
||||
if test "$depmode" = xlc; then
|
||||
# IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
|
||||
gccflag=-qmakedep=gcc,-MF
|
||||
depmode=gcc
|
||||
fi
|
||||
|
||||
case "$depmode" in
|
||||
gcc3)
|
||||
## gcc 3 implements dependency tracking that does exactly what
|
||||
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
|
||||
## it if -MD -MP comes after the -MF stuff. Hmm.
|
||||
## Unfortunately, FreeBSD c89 acceptance of flags depends upon
|
||||
## the command line argument order; so add the flags where they
|
||||
## appear in depend2.am. Note that the slowdown incurred here
|
||||
## affects only configure: in makefiles, %FASTDEP% shortcuts this.
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
|
||||
*) set fnord "$@" "$arg" ;;
|
||||
esac
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
done
|
||||
"$@"
|
||||
stat=$?
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
mv "$tmpdepfile" "$depfile"
|
||||
;;
|
||||
|
||||
gcc)
|
||||
## Note that this doesn't just cater to obsolete pre-3.x GCC compilers.
|
||||
## but also to in-use compilers like IBM xlc/xlC and the HP C compiler.
|
||||
## (see the conditional assignment to $gccflag above).
|
||||
## There are various ways to get dependency output from gcc. Here's
|
||||
## why we pick this rather obscure method:
|
||||
## - Don't want to use -MD because we'd like the dependencies to end
|
||||
## up in a subdir. Having to rename by hand is ugly.
|
||||
## (We might end up doing this anyway to support other compilers.)
|
||||
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
|
||||
## -MM, not -M (despite what the docs say). Also, it might not be
|
||||
## supported by the other compilers which use the 'gcc' depmode.
|
||||
## - Using -M directly means running the compiler twice (even worse
|
||||
## than renaming).
|
||||
if test -z "$gccflag"; then
|
||||
gccflag=-MD,
|
||||
fi
|
||||
"$@" -Wp,"$gccflag$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
# The second -e expression handles DOS-style file names with drive
|
||||
# letters.
|
||||
sed -e 's/^[^:]*: / /' \
|
||||
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
|
||||
## This next piece of magic avoids the "deleted header file" problem.
|
||||
## The problem is that when a header file which appears in a .P file
|
||||
## is deleted, the dependency causes make to die (because there is
|
||||
## typically no way to rebuild the header). We avoid this by adding
|
||||
## dummy dependencies for each header file. Too bad gcc doesn't do
|
||||
## this for us directly.
|
||||
## Some versions of gcc put a space before the ':'. On the theory
|
||||
## that the space means something, we add a space to the output as
|
||||
## well. hp depmode also adds that space, but also prefixes the VPATH
|
||||
## to the object. Take care to not repeat it in the output.
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
tr ' ' "$nl" < "$tmpdepfile" \
|
||||
| sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
|
||||
| sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
hp)
|
||||
# This case exists only to let depend.m4 do its work. It works by
|
||||
# looking at the text of this script. This case will never be run,
|
||||
# since it is checked for above.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
sgi)
|
||||
if test "$libtool" = yes; then
|
||||
"$@" "-Wp,-MDupdate,$tmpdepfile"
|
||||
else
|
||||
"$@" -MDupdate "$tmpdepfile"
|
||||
fi
|
||||
stat=$?
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
|
||||
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
|
||||
echo "$object : \\" > "$depfile"
|
||||
# Clip off the initial element (the dependent). Don't try to be
|
||||
# clever and replace this with sed code, as IRIX sed won't handle
|
||||
# lines with more than a fixed number of characters (4096 in
|
||||
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
|
||||
# the IRIX cc adds comments like '#:fec' to the end of the
|
||||
# dependency line.
|
||||
tr ' ' "$nl" < "$tmpdepfile" \
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
|
||||
| tr "$nl" ' ' >> "$depfile"
|
||||
echo >> "$depfile"
|
||||
# The second pass generates a dummy entry for each header file.
|
||||
tr ' ' "$nl" < "$tmpdepfile" \
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
|
||||
>> "$depfile"
|
||||
else
|
||||
make_dummy_depfile
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
xlc)
|
||||
# This case exists only to let depend.m4 do its work. It works by
|
||||
# looking at the text of this script. This case will never be run,
|
||||
# since it is checked for above.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
aix)
|
||||
# The C for AIX Compiler uses -M and outputs the dependencies
|
||||
# in a .u file. In older versions, this file always lives in the
|
||||
# current directory. Also, the AIX compiler puts '$object:' at the
|
||||
# start of each line; $object doesn't have directory information.
|
||||
# Version 6 uses the directory in both cases.
|
||||
set_dir_from "$object"
|
||||
set_base_from "$object"
|
||||
if test "$libtool" = yes; then
|
||||
tmpdepfile1=$dir$base.u
|
||||
tmpdepfile2=$base.u
|
||||
tmpdepfile3=$dir.libs/$base.u
|
||||
"$@" -Wc,-M
|
||||
else
|
||||
tmpdepfile1=$dir$base.u
|
||||
tmpdepfile2=$dir$base.u
|
||||
tmpdepfile3=$dir$base.u
|
||||
"$@" -M
|
||||
fi
|
||||
stat=$?
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
||||
do
|
||||
test -f "$tmpdepfile" && break
|
||||
done
|
||||
aix_post_process_depfile
|
||||
;;
|
||||
|
||||
tcc)
|
||||
# tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
|
||||
# FIXME: That version still under development at the moment of writing.
|
||||
# Make that this statement remains true also for stable, released
|
||||
# versions.
|
||||
# It will wrap lines (doesn't matter whether long or short) with a
|
||||
# trailing '\', as in:
|
||||
#
|
||||
# foo.o : \
|
||||
# foo.c \
|
||||
# foo.h \
|
||||
#
|
||||
# It will put a trailing '\' even on the last line, and will use leading
|
||||
# spaces rather than leading tabs (at least since its commit 0394caf7
|
||||
# "Emit spaces for -MD").
|
||||
"$@" -MD -MF "$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
# Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
|
||||
# We have to change lines of the first kind to '$object: \'.
|
||||
sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
|
||||
# And for each line of the second kind, we have to emit a 'dep.h:'
|
||||
# dummy dependency, to avoid the deleted-header problem.
|
||||
sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
## The order of this option in the case statement is important, since the
|
||||
## shell code in configure will try each of these formats in the order
|
||||
## listed in this file. A plain '-MD' option would be understood by many
|
||||
## compilers, so we must ensure this comes after the gcc and icc options.
|
||||
pgcc)
|
||||
# Portland's C compiler understands '-MD'.
|
||||
# Will always output deps to 'file.d' where file is the root name of the
|
||||
# source file under compilation, even if file resides in a subdirectory.
|
||||
# The object file name does not affect the name of the '.d' file.
|
||||
# pgcc 10.2 will output
|
||||
# foo.o: sub/foo.c sub/foo.h
|
||||
# and will wrap long lines using '\' :
|
||||
# foo.o: sub/foo.c ... \
|
||||
# sub/foo.h ... \
|
||||
# ...
|
||||
set_dir_from "$object"
|
||||
# Use the source, not the object, to determine the base name, since
|
||||
# that's sadly what pgcc will do too.
|
||||
set_base_from "$source"
|
||||
tmpdepfile=$base.d
|
||||
|
||||
# For projects that build the same source file twice into different object
|
||||
# files, the pgcc approach of using the *source* file root name can cause
|
||||
# problems in parallel builds. Use a locking strategy to avoid stomping on
|
||||
# the same $tmpdepfile.
|
||||
lockdir=$base.d-lock
|
||||
trap "
|
||||
echo '$0: caught signal, cleaning up...' >&2
|
||||
rmdir '$lockdir'
|
||||
exit 1
|
||||
" 1 2 13 15
|
||||
numtries=100
|
||||
i=$numtries
|
||||
while test $i -gt 0; do
|
||||
# mkdir is a portable test-and-set.
|
||||
if mkdir "$lockdir" 2>/dev/null; then
|
||||
# This process acquired the lock.
|
||||
"$@" -MD
|
||||
stat=$?
|
||||
# Release the lock.
|
||||
rmdir "$lockdir"
|
||||
break
|
||||
else
|
||||
# If the lock is being held by a different process, wait
|
||||
# until the winning process is done or we timeout.
|
||||
while test -d "$lockdir" && test $i -gt 0; do
|
||||
sleep 1
|
||||
i=`expr $i - 1`
|
||||
done
|
||||
fi
|
||||
i=`expr $i - 1`
|
||||
done
|
||||
trap - 1 2 13 15
|
||||
if test $i -le 0; then
|
||||
echo "$0: failed to acquire lock after $numtries attempts" >&2
|
||||
echo "$0: check lockdir '$lockdir'" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
# Each line is of the form `foo.o: dependent.h',
|
||||
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
|
||||
# Do two passes, one to just change these to
|
||||
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
|
||||
# Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
# correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
|
||||
| sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
hp2)
|
||||
# The "hp" stanza above does not work with aCC (C++) and HP's ia64
|
||||
# compilers, which have integrated preprocessors. The correct option
|
||||
# to use with these is +Maked; it writes dependencies to a file named
|
||||
# 'foo.d', which lands next to the object file, wherever that
|
||||
# happens to be.
|
||||
# Much of this is similar to the tru64 case; see comments there.
|
||||
set_dir_from "$object"
|
||||
set_base_from "$object"
|
||||
if test "$libtool" = yes; then
|
||||
tmpdepfile1=$dir$base.d
|
||||
tmpdepfile2=$dir.libs/$base.d
|
||||
"$@" -Wc,+Maked
|
||||
else
|
||||
tmpdepfile1=$dir$base.d
|
||||
tmpdepfile2=$dir$base.d
|
||||
"$@" +Maked
|
||||
fi
|
||||
stat=$?
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
|
||||
do
|
||||
test -f "$tmpdepfile" && break
|
||||
done
|
||||
if test -f "$tmpdepfile"; then
|
||||
sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
|
||||
# Add 'dependent.h:' lines.
|
||||
sed -ne '2,${
|
||||
s/^ *//
|
||||
s/ \\*$//
|
||||
s/$/:/
|
||||
p
|
||||
}' "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
make_dummy_depfile
|
||||
fi
|
||||
rm -f "$tmpdepfile" "$tmpdepfile2"
|
||||
;;
|
||||
|
||||
tru64)
|
||||
# The Tru64 compiler uses -MD to generate dependencies as a side
|
||||
# effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
|
||||
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
|
||||
# dependencies in 'foo.d' instead, so we check for that too.
|
||||
# Subdirectories are respected.
|
||||
set_dir_from "$object"
|
||||
set_base_from "$object"
|
||||
|
||||
if test "$libtool" = yes; then
|
||||
# Libtool generates 2 separate objects for the 2 libraries. These
|
||||
# two compilations output dependencies in $dir.libs/$base.o.d and
|
||||
# in $dir$base.o.d. We have to check for both files, because
|
||||
# one of the two compilations can be disabled. We should prefer
|
||||
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
|
||||
# automatically cleaned when .libs/ is deleted, while ignoring
|
||||
# the former would cause a distcleancheck panic.
|
||||
tmpdepfile1=$dir$base.o.d # libtool 1.5
|
||||
tmpdepfile2=$dir.libs/$base.o.d # Likewise.
|
||||
tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504
|
||||
"$@" -Wc,-MD
|
||||
else
|
||||
tmpdepfile1=$dir$base.d
|
||||
tmpdepfile2=$dir$base.d
|
||||
tmpdepfile3=$dir$base.d
|
||||
"$@" -MD
|
||||
fi
|
||||
|
||||
stat=$?
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
||||
do
|
||||
test -f "$tmpdepfile" && break
|
||||
done
|
||||
# Same post-processing that is required for AIX mode.
|
||||
aix_post_process_depfile
|
||||
;;
|
||||
|
||||
msvc7)
|
||||
if test "$libtool" = yes; then
|
||||
showIncludes=-Wc,-showIncludes
|
||||
else
|
||||
showIncludes=-showIncludes
|
||||
fi
|
||||
"$@" $showIncludes > "$tmpdepfile"
|
||||
stat=$?
|
||||
grep -v '^Note: including file: ' "$tmpdepfile"
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
# The first sed program below extracts the file names and escapes
|
||||
# backslashes for cygpath. The second sed program outputs the file
|
||||
# name when reading, but also accumulates all include files in the
|
||||
# hold buffer in order to output them again at the end. This only
|
||||
# works with sed implementations that can handle large buffers.
|
||||
sed < "$tmpdepfile" -n '
|
||||
/^Note: including file: *\(.*\)/ {
|
||||
s//\1/
|
||||
s/\\/\\\\/g
|
||||
p
|
||||
}' | $cygpath_u | sort -u | sed -n '
|
||||
s/ /\\ /g
|
||||
s/\(.*\)/'"$tab"'\1 \\/p
|
||||
s/.\(.*\) \\/\1:/
|
||||
H
|
||||
$ {
|
||||
s/.*/'"$tab"'/
|
||||
G
|
||||
p
|
||||
}' >> "$depfile"
|
||||
echo >> "$depfile" # make sure the fragment doesn't end with a backslash
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
msvc7msys)
|
||||
# This case exists only to let depend.m4 do its work. It works by
|
||||
# looking at the text of this script. This case will never be run,
|
||||
# since it is checked for above.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
#nosideeffect)
|
||||
# This comment above is used by automake to tell side-effect
|
||||
# dependency tracking mechanisms from slower ones.
|
||||
|
||||
dashmstdout)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout, regardless of -o.
|
||||
"$@" || exit $?
|
||||
|
||||
# Remove the call to Libtool.
|
||||
if test "$libtool" = yes; then
|
||||
while test "X$1" != 'X--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
|
||||
# Remove '-o $object'.
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-o)
|
||||
shift
|
||||
;;
|
||||
$object)
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
test -z "$dashmflag" && dashmflag=-M
|
||||
# Require at least two characters before searching for ':'
|
||||
# in the target name. This is to cope with DOS-style filenames:
|
||||
# a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
|
||||
"$@" $dashmflag |
|
||||
sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
cat < "$tmpdepfile" > "$depfile"
|
||||
# Some versions of the HPUX 10.20 sed can't process this sed invocation
|
||||
# correctly. Breaking it into two sed invocations is a workaround.
|
||||
tr ' ' "$nl" < "$tmpdepfile" \
|
||||
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
|
||||
| sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
dashXmstdout)
|
||||
# This case only exists to satisfy depend.m4. It is never actually
|
||||
# run, as this mode is specially recognized in the preamble.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
makedepend)
|
||||
"$@" || exit $?
|
||||
# Remove any Libtool call
|
||||
if test "$libtool" = yes; then
|
||||
while test "X$1" != 'X--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
# X makedepend
|
||||
shift
|
||||
cleared=no eat=no
|
||||
for arg
|
||||
do
|
||||
case $cleared in
|
||||
no)
|
||||
set ""; shift
|
||||
cleared=yes ;;
|
||||
esac
|
||||
if test $eat = yes; then
|
||||
eat=no
|
||||
continue
|
||||
fi
|
||||
case "$arg" in
|
||||
-D*|-I*)
|
||||
set fnord "$@" "$arg"; shift ;;
|
||||
# Strip any option that makedepend may not understand. Remove
|
||||
# the object too, otherwise makedepend will parse it as a source file.
|
||||
-arch)
|
||||
eat=yes ;;
|
||||
-*|$object)
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"; shift ;;
|
||||
esac
|
||||
done
|
||||
obj_suffix=`echo "$object" | sed 's/^.*\././'`
|
||||
touch "$tmpdepfile"
|
||||
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
|
||||
rm -f "$depfile"
|
||||
# makedepend may prepend the VPATH from the source file name to the object.
|
||||
# No need to regex-escape $object, excess matching of '.' is harmless.
|
||||
sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
|
||||
# Some versions of the HPUX 10.20 sed can't process the last invocation
|
||||
# correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed '1,2d' "$tmpdepfile" \
|
||||
| tr ' ' "$nl" \
|
||||
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
|
||||
| sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile" "$tmpdepfile".bak
|
||||
;;
|
||||
|
||||
cpp)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout.
|
||||
"$@" || exit $?
|
||||
|
||||
# Remove the call to Libtool.
|
||||
if test "$libtool" = yes; then
|
||||
while test "X$1" != 'X--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
|
||||
# Remove '-o $object'.
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-o)
|
||||
shift
|
||||
;;
|
||||
$object)
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
"$@" -E \
|
||||
| sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
|
||||
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
|
||||
| sed '$ s: \\$::' > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
cat < "$tmpdepfile" >> "$depfile"
|
||||
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
msvisualcpp)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout.
|
||||
"$@" || exit $?
|
||||
|
||||
# Remove the call to Libtool.
|
||||
if test "$libtool" = yes; then
|
||||
while test "X$1" != 'X--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case "$arg" in
|
||||
-o)
|
||||
shift
|
||||
;;
|
||||
$object)
|
||||
shift
|
||||
;;
|
||||
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
|
||||
set fnord "$@"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
done
|
||||
"$@" -E 2>/dev/null |
|
||||
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
|
||||
echo "$tab" >> "$depfile"
|
||||
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
msvcmsys)
|
||||
# This case exists only to let depend.m4 do its work. It works by
|
||||
# looking at the text of this script. This case will never be run,
|
||||
# since it is checked for above.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
none)
|
||||
exec "$@"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Unknown depmode $depmode" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'before-save-hook 'time-stamp nil t)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%Y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC0"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
||||
+541
@@ -0,0 +1,541 @@
|
||||
#!/bin/sh
|
||||
# install - install a program, script, or datafile
|
||||
|
||||
scriptversion=2025-06-18.21; # UTC
|
||||
|
||||
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
||||
# later released in X11R6 (xc/config/util/install.sh) with the
|
||||
# following copyright and license.
|
||||
#
|
||||
# Copyright (C) 1994 X Consortium
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to
|
||||
# deal in the Software without restriction, including without limitation the
|
||||
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
# sell copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
|
||||
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#
|
||||
# Except as contained in this notice, the name of the X Consortium shall not
|
||||
# be used in advertising or otherwise to promote the sale, use or other deal-
|
||||
# ings in this Software without prior written authorization from the X Consor-
|
||||
# tium.
|
||||
#
|
||||
#
|
||||
# FSF changes to this file are in the public domain.
|
||||
#
|
||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||
# 'make' implicit rules from creating a file called install from it
|
||||
# when there is no Makefile.
|
||||
#
|
||||
# This script is compatible with the BSD install script, but was written
|
||||
# from scratch.
|
||||
|
||||
tab=' '
|
||||
nl='
|
||||
'
|
||||
IFS=" $tab$nl"
|
||||
|
||||
# Set DOITPROG to "echo" to test this script.
|
||||
|
||||
doit=${DOITPROG-}
|
||||
doit_exec=${doit:-exec}
|
||||
|
||||
# Put in absolute file names if you don't have them in your path;
|
||||
# or use environment vars.
|
||||
|
||||
chgrpprog=${CHGRPPROG-chgrp}
|
||||
chmodprog=${CHMODPROG-chmod}
|
||||
chownprog=${CHOWNPROG-chown}
|
||||
cmpprog=${CMPPROG-cmp}
|
||||
cpprog=${CPPROG-cp}
|
||||
mkdirprog=${MKDIRPROG-mkdir}
|
||||
mvprog=${MVPROG-mv}
|
||||
rmprog=${RMPROG-rm}
|
||||
stripprog=${STRIPPROG-strip}
|
||||
|
||||
posix_mkdir=
|
||||
|
||||
# Desired mode of installed file.
|
||||
mode=0755
|
||||
|
||||
# Create dirs (including intermediate dirs) using mode 755.
|
||||
# This is like GNU 'install' as of coreutils 8.32 (2020).
|
||||
mkdir_umask=22
|
||||
|
||||
backupsuffix=
|
||||
chgrpcmd=
|
||||
chmodcmd=$chmodprog
|
||||
chowncmd=
|
||||
mvcmd=$mvprog
|
||||
rmcmd="$rmprog -f"
|
||||
stripcmd=
|
||||
|
||||
src=
|
||||
dst=
|
||||
dir_arg=
|
||||
dst_arg=
|
||||
|
||||
copy_on_change=false
|
||||
is_target_a_directory=possibly
|
||||
|
||||
usage="\
|
||||
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
|
||||
or: $0 [OPTION]... SRCFILES... DIRECTORY
|
||||
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
|
||||
or: $0 [OPTION]... -d DIRECTORIES...
|
||||
|
||||
In the 1st form, copy SRCFILE to DSTFILE.
|
||||
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
|
||||
In the 4th, create DIRECTORIES.
|
||||
|
||||
Options:
|
||||
--help display this help and exit.
|
||||
--version display version info and exit.
|
||||
|
||||
-c (ignored)
|
||||
-C install only if different (preserve data modification time)
|
||||
-d create directories instead of installing files.
|
||||
-g GROUP $chgrpprog installed files to GROUP.
|
||||
-m MODE $chmodprog installed files to MODE.
|
||||
-o USER $chownprog installed files to USER.
|
||||
-p pass -p to $cpprog.
|
||||
-s $stripprog installed files.
|
||||
-S SUFFIX attempt to back up existing files, with suffix SUFFIX.
|
||||
-t DIRECTORY install into DIRECTORY.
|
||||
-T report an error if DSTFILE is a directory.
|
||||
|
||||
Environment variables override the default commands:
|
||||
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
|
||||
RMPROG STRIPPROG
|
||||
|
||||
By default, rm is invoked with -f; when overridden with RMPROG,
|
||||
it's up to you to specify -f if you want it.
|
||||
|
||||
If -S is not specified, no backups are attempted.
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>.
|
||||
GNU Automake home page: <https://www.gnu.org/software/automake/>.
|
||||
General help using GNU software: <https://www.gnu.org/gethelp/>."
|
||||
|
||||
while test $# -ne 0; do
|
||||
case $1 in
|
||||
-c) ;;
|
||||
|
||||
-C) copy_on_change=true;;
|
||||
|
||||
-d) dir_arg=true;;
|
||||
|
||||
-g) chgrpcmd="$chgrpprog $2"
|
||||
shift;;
|
||||
|
||||
--help) echo "$usage"; exit $?;;
|
||||
|
||||
-m) mode=$2
|
||||
case $mode in
|
||||
*' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
|
||||
echo "$0: invalid mode: $mode" >&2
|
||||
exit 1;;
|
||||
esac
|
||||
shift;;
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift;;
|
||||
|
||||
-p) cpprog="$cpprog -p";;
|
||||
|
||||
-s) stripcmd=$stripprog;;
|
||||
|
||||
-S) backupsuffix="$2"
|
||||
shift;;
|
||||
|
||||
-t)
|
||||
is_target_a_directory=always
|
||||
dst_arg=$2
|
||||
# Protect names problematic for 'test' and other utilities.
|
||||
case $dst_arg in
|
||||
-* | [=\(\)!]) dst_arg=./$dst_arg;;
|
||||
esac
|
||||
shift;;
|
||||
|
||||
-T) is_target_a_directory=never;;
|
||||
|
||||
--version) echo "$0 (GNU Automake) $scriptversion"; exit $?;;
|
||||
|
||||
--) shift
|
||||
break;;
|
||||
|
||||
-*) echo "$0: invalid option: $1" >&2
|
||||
exit 1;;
|
||||
|
||||
*) break;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
# We allow the use of options -d and -T together, by making -d
|
||||
# take the precedence; this is for compatibility with GNU install.
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
if test -n "$dst_arg"; then
|
||||
echo "$0: target directory not allowed when installing a directory." >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
|
||||
# When -d is used, all remaining arguments are directories to create.
|
||||
# When -t is used, the destination is already specified.
|
||||
# Otherwise, the last argument is the destination. Remove it from $@.
|
||||
for arg
|
||||
do
|
||||
if test -n "$dst_arg"; then
|
||||
# $@ is not empty: it contains at least $arg.
|
||||
set fnord "$@" "$dst_arg"
|
||||
shift # fnord
|
||||
fi
|
||||
shift # arg
|
||||
dst_arg=$arg
|
||||
# Protect names problematic for 'test' and other utilities.
|
||||
case $dst_arg in
|
||||
-* | [=\(\)!]) dst_arg=./$dst_arg;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
|
||||
if test $# -eq 0; then
|
||||
if test -z "$dir_arg"; then
|
||||
echo "$0: no input file specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
# It's OK to call 'install-sh -d' without argument.
|
||||
# This can happen when creating conditional directories.
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if test -z "$dir_arg"; then
|
||||
if test $# -gt 1 || test "$is_target_a_directory" = always; then
|
||||
if test ! -d "$dst_arg"; then
|
||||
echo "$0: $dst_arg: Is not a directory." >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -z "$dir_arg"; then
|
||||
do_exit='(exit $ret); exit $ret'
|
||||
trap "ret=129; $do_exit" 1
|
||||
trap "ret=130; $do_exit" 2
|
||||
trap "ret=141; $do_exit" 13
|
||||
trap "ret=143; $do_exit" 15
|
||||
|
||||
# Set umask so as not to create temps with too-generous modes.
|
||||
# However, 'strip' requires both read and write access to temps.
|
||||
case $mode in
|
||||
# Optimize common cases.
|
||||
*644) cp_umask=133;;
|
||||
*755) cp_umask=22;;
|
||||
|
||||
*[0-7])
|
||||
if test -z "$stripcmd"; then
|
||||
u_plus_rw=
|
||||
else
|
||||
u_plus_rw='% 200'
|
||||
fi
|
||||
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
|
||||
*)
|
||||
if test -z "$stripcmd"; then
|
||||
u_plus_rw=
|
||||
else
|
||||
u_plus_rw=,u+rw
|
||||
fi
|
||||
cp_umask=$mode$u_plus_rw;;
|
||||
esac
|
||||
fi
|
||||
|
||||
for src
|
||||
do
|
||||
# Protect names problematic for 'test' and other utilities.
|
||||
case $src in
|
||||
-* | [=\(\)!]) src=./$src;;
|
||||
esac
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
dst=$src
|
||||
dstdir=$dst
|
||||
test -d "$dstdir"
|
||||
dstdir_status=$?
|
||||
# Don't chown directories that already exist.
|
||||
if test $dstdir_status = 0; then
|
||||
chowncmd=""
|
||||
fi
|
||||
else
|
||||
|
||||
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
|
||||
# might cause directories to be created, which would be especially bad
|
||||
# if $src (and thus $dsttmp) contains '*'.
|
||||
if test ! -f "$src" && test ! -d "$src"; then
|
||||
echo "$0: $src does not exist." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test -z "$dst_arg"; then
|
||||
echo "$0: no destination specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
dst=$dst_arg
|
||||
|
||||
# If destination is a directory, append the input filename.
|
||||
if test -d "$dst"; then
|
||||
if test "$is_target_a_directory" = never; then
|
||||
echo "$0: $dst_arg: Is a directory" >&2
|
||||
exit 1
|
||||
fi
|
||||
dstdir=$dst
|
||||
dstbase=`basename "$src"`
|
||||
case $dst in
|
||||
*/) dst=$dst$dstbase;;
|
||||
*) dst=$dst/$dstbase;;
|
||||
esac
|
||||
dstdir_status=0
|
||||
else
|
||||
dstdir=`dirname "$dst"`
|
||||
test -d "$dstdir"
|
||||
dstdir_status=$?
|
||||
fi
|
||||
fi
|
||||
|
||||
case $dstdir in
|
||||
*/) dstdirslash=$dstdir;;
|
||||
*) dstdirslash=$dstdir/;;
|
||||
esac
|
||||
|
||||
obsolete_mkdir_used=false
|
||||
|
||||
if test $dstdir_status != 0; then
|
||||
case $posix_mkdir in
|
||||
'')
|
||||
# With -d, create the new directory with the user-specified mode.
|
||||
# Otherwise, rely on $mkdir_umask.
|
||||
if test -n "$dir_arg"; then
|
||||
mkdir_mode=-m$mode
|
||||
else
|
||||
mkdir_mode=
|
||||
fi
|
||||
|
||||
posix_mkdir=false
|
||||
# The $RANDOM variable is not portable (e.g., dash). Use it
|
||||
# here however when possible just to lower collision chance.
|
||||
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
|
||||
|
||||
trap '
|
||||
ret=$?
|
||||
rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null
|
||||
exit $ret
|
||||
' 0
|
||||
|
||||
# Because "mkdir -p" follows existing symlinks and we likely work
|
||||
# directly in world-writable /tmp, make sure that the '$tmpdir'
|
||||
# directory is successfully created first before we actually test
|
||||
# 'mkdir -p'.
|
||||
if (umask $mkdir_umask &&
|
||||
$mkdirprog $mkdir_mode "$tmpdir" &&
|
||||
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
|
||||
then
|
||||
if test -z "$dir_arg" || {
|
||||
# Check for POSIX incompatibility with -m.
|
||||
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
|
||||
# other-writable bit of parent directory when it shouldn't.
|
||||
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
|
||||
test_tmpdir="$tmpdir/a"
|
||||
ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
|
||||
case $ls_ld_tmpdir in
|
||||
d????-?r-*) different_mode=700;;
|
||||
d????-?--*) different_mode=755;;
|
||||
*) false;;
|
||||
esac &&
|
||||
$mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
|
||||
ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
|
||||
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
|
||||
}
|
||||
}
|
||||
then posix_mkdir=:
|
||||
fi
|
||||
rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
|
||||
else
|
||||
# Remove any dirs left behind by ancient mkdir implementations.
|
||||
rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
|
||||
fi
|
||||
trap '' 0;;
|
||||
esac
|
||||
|
||||
if
|
||||
$posix_mkdir && (
|
||||
umask $mkdir_umask &&
|
||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
|
||||
)
|
||||
then :
|
||||
else
|
||||
|
||||
# mkdir does not conform to POSIX,
|
||||
# or it failed possibly due to a race condition. Create the
|
||||
# directory the slow way, step by step, checking for races as we go.
|
||||
|
||||
case $dstdir in
|
||||
/*) prefix='/';;
|
||||
[-=\(\)!]*) prefix='./';;
|
||||
*) prefix='';;
|
||||
esac
|
||||
|
||||
oIFS=$IFS
|
||||
IFS=/
|
||||
set -f
|
||||
set fnord $dstdir
|
||||
shift
|
||||
set +f
|
||||
IFS=$oIFS
|
||||
|
||||
prefixes=
|
||||
|
||||
for d
|
||||
do
|
||||
test X"$d" = X && continue
|
||||
|
||||
prefix=$prefix$d
|
||||
if test -d "$prefix"; then
|
||||
prefixes=
|
||||
else
|
||||
if $posix_mkdir; then
|
||||
(umask $mkdir_umask &&
|
||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
|
||||
# Don't fail if two instances are running concurrently.
|
||||
test -d "$prefix" || exit 1
|
||||
else
|
||||
case $prefix in
|
||||
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
|
||||
*) qprefix=$prefix;;
|
||||
esac
|
||||
prefixes="$prefixes '$qprefix'"
|
||||
fi
|
||||
fi
|
||||
prefix=$prefix/
|
||||
done
|
||||
|
||||
if test -n "$prefixes"; then
|
||||
# Don't fail if two instances are running concurrently.
|
||||
(umask $mkdir_umask &&
|
||||
eval "\$doit_exec \$mkdirprog $prefixes") ||
|
||||
test -d "$dstdir" || exit 1
|
||||
obsolete_mkdir_used=true
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
|
||||
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
|
||||
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
|
||||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
|
||||
else
|
||||
|
||||
# Make a couple of temp file names in the proper directory.
|
||||
dsttmp=${dstdirslash}_inst.$$_
|
||||
rmtmp=${dstdirslash}_rm.$$_
|
||||
|
||||
# Trap to clean up those temp files at exit.
|
||||
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
|
||||
|
||||
# Copy the file name to the temp name.
|
||||
(umask $cp_umask &&
|
||||
{ test -z "$stripcmd" || {
|
||||
# Create $dsttmp read-write so that cp doesn't create it read-only,
|
||||
# which would cause strip to fail.
|
||||
if test -z "$doit"; then
|
||||
: >"$dsttmp" # No need to fork-exec 'touch'.
|
||||
else
|
||||
$doit touch "$dsttmp"
|
||||
fi
|
||||
}
|
||||
} &&
|
||||
$doit_exec $cpprog "$src" "$dsttmp") &&
|
||||
|
||||
# and set any options; do chmod last to preserve setuid bits.
|
||||
#
|
||||
# If any of these fail, we abort the whole thing. If we want to
|
||||
# ignore errors from any of these, just make sure not to ignore
|
||||
# errors from the above "$doit $cpprog $src $dsttmp" command.
|
||||
#
|
||||
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
|
||||
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
|
||||
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
|
||||
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
|
||||
|
||||
# If -C, don't bother to copy if it wouldn't change the file.
|
||||
if $copy_on_change &&
|
||||
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
|
||||
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
|
||||
set -f &&
|
||||
set X $old && old=:$2:$4:$5:$6 &&
|
||||
set X $new && new=:$2:$4:$5:$6 &&
|
||||
set +f &&
|
||||
test "$old" = "$new" &&
|
||||
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
|
||||
then
|
||||
rm -f "$dsttmp"
|
||||
else
|
||||
# If $backupsuffix is set, and the file being installed
|
||||
# already exists, attempt a backup. Don't worry if it fails,
|
||||
# e.g., if mv doesn't support -f.
|
||||
if test -n "$backupsuffix" && test -f "$dst"; then
|
||||
$doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null
|
||||
fi
|
||||
|
||||
# Rename the file to the real destination.
|
||||
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
|
||||
|
||||
# The rename failed, perhaps because mv can't rename something else
|
||||
# to itself, or perhaps because mv is so ancient that it does not
|
||||
# support -f.
|
||||
{
|
||||
# Now remove or move aside any old file at destination location.
|
||||
# We try this two ways since rm can't unlink itself on some
|
||||
# systems and the destination file might be busy for other
|
||||
# reasons. In this case, the final cleanup might fail but the new
|
||||
# file should still install successfully.
|
||||
{
|
||||
test ! -f "$dst" ||
|
||||
$doit $rmcmd "$dst" 2>/dev/null ||
|
||||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
|
||||
{ $doit $rmcmd "$rmtmp" 2>/dev/null; :; }
|
||||
} ||
|
||||
{ echo "$0: cannot unlink or rename $dst" >&2
|
||||
(exit 1); exit 1
|
||||
}
|
||||
} &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
$doit $mvcmd "$dsttmp" "$dst"
|
||||
}
|
||||
fi || exit 1
|
||||
|
||||
trap '' 0
|
||||
fi
|
||||
done
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'before-save-hook 'time-stamp nil t)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%Y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC0"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
||||
+227
@@ -0,0 +1,227 @@
|
||||
#!/bin/sh
|
||||
# Get modification time of a file or directory, or value of
|
||||
# $SOURCE_DATE_EPOCH, and pretty-print it, formatted like 1 January 2000.
|
||||
|
||||
scriptversion=2025-06-25.21; # UTC
|
||||
|
||||
# Copyright (C) 1995-2025 Free Software Foundation, Inc.
|
||||
# written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, June 1995
|
||||
#
|
||||
# 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, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# This file is maintained in Automake, please report
|
||||
# bugs to <bug-automake@gnu.org> or send patches to
|
||||
# <automake-patches@gnu.org>.
|
||||
|
||||
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
|
||||
emulate sh
|
||||
NULLCMD=:
|
||||
# Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
|
||||
# is contrary to our usage. Disable this feature.
|
||||
alias -g '${1+"$@"}'='"$@"'
|
||||
setopt NO_GLOB_SUBST
|
||||
fi
|
||||
|
||||
case $1 in
|
||||
'')
|
||||
echo "$0: No file. Try '$0 --help' for more information." 1>&2
|
||||
exit 1;
|
||||
;;
|
||||
-h | --h*)
|
||||
cat <<\EOF
|
||||
Usage: mdate-sh [--help] [--version] FILE
|
||||
|
||||
Pretty-print the modification day of FILE, in the format:
|
||||
1 January 1970
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>.
|
||||
GNU Automake home page: <https://www.gnu.org/software/automake/>.
|
||||
General help using GNU software: <https://www.gnu.org/gethelp/>.
|
||||
EOF
|
||||
exit $?
|
||||
;;
|
||||
-v | --v*)
|
||||
echo "mdate-sh (GNU Automake) $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
esac
|
||||
|
||||
# Warn if more than one file given.
|
||||
if test $# -ne 1; then
|
||||
echo "$0: warning: multiple files given, using first: $*" >&2
|
||||
fi
|
||||
|
||||
error ()
|
||||
{
|
||||
echo "$0: $1" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
# set $month ("January") and $nummonth (1) given arg MON ("Jan").
|
||||
mon_to_month ()
|
||||
{
|
||||
case $1 in
|
||||
Jan) month=January; nummonth=1;;
|
||||
Feb) month=February; nummonth=2;;
|
||||
Mar) month=March; nummonth=3;;
|
||||
Apr) month=April; nummonth=4;;
|
||||
May) month=May; nummonth=5;;
|
||||
Jun) month=June; nummonth=6;;
|
||||
Jul) month=July; nummonth=7;;
|
||||
Aug) month=August; nummonth=8;;
|
||||
Sep) month=September; nummonth=9;;
|
||||
Oct) month=October; nummonth=10;;
|
||||
Nov) month=November; nummonth=11;;
|
||||
Dec) month=December; nummonth=12;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Prevent date giving response in another language.
|
||||
LANG=C
|
||||
export LANG
|
||||
LC_ALL=C
|
||||
export LC_ALL
|
||||
LC_TIME=C
|
||||
export LC_TIME
|
||||
|
||||
# Use UTC to get reproducible result.
|
||||
TZ=UTC0
|
||||
export TZ
|
||||
|
||||
#
|
||||
# GNU ls changes its time format in response to the TIME_STYLE
|
||||
# variable. Since we cannot assume 'unset' works, revert this
|
||||
# variable to its documented default.
|
||||
if test "${TIME_STYLE+set}" = set; then
|
||||
TIME_STYLE=posix-long-iso
|
||||
export TIME_STYLE
|
||||
fi
|
||||
|
||||
save_arg1=$1
|
||||
|
||||
# Find out how to get the extended ls output of a file or directory.
|
||||
if ls -L /dev/null 1>/dev/null 2>&1; then
|
||||
ls_command='ls -L -l -d'
|
||||
else
|
||||
ls_command='ls -l -d'
|
||||
fi
|
||||
# Avoid user/group names that might have spaces, when possible.
|
||||
if ls -n /dev/null 1>/dev/null 2>&1; then
|
||||
ls_command="$ls_command -n"
|
||||
fi
|
||||
|
||||
# A 'ls -l' line looks as follows on OS/2.
|
||||
# drwxrwx--- 0 Aug 11 2001 foo
|
||||
# This differs from Unix, which adds ownership information.
|
||||
# drwxrwx--- 2 root root 4096 Aug 11 2001 foo
|
||||
#
|
||||
# To find the date, we split the line on spaces and iterate on words
|
||||
# until we find a month. This cannot work with files whose owner is a
|
||||
# user named "Jan", or "Feb", etc. However, it's unlikely that '/'
|
||||
# will be owned by a user whose name is a month. So we first look at
|
||||
# the extended ls output of the root directory to decide how many
|
||||
# words should be skipped to get the date.
|
||||
|
||||
# On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below.
|
||||
set x`$ls_command /`
|
||||
|
||||
# Find which argument is the month.
|
||||
month=
|
||||
command=
|
||||
until test $month
|
||||
do
|
||||
test $# -gt 0 || error "failed parsing '$ls_command /' output"
|
||||
shift
|
||||
# Add another shift to the command.
|
||||
command="$command shift;"
|
||||
mon_to_month $1
|
||||
done
|
||||
|
||||
test -n "$month" || error "failed parsing '$ls_command /' output"
|
||||
|
||||
# Get the extended ls output of the file or directory.
|
||||
set dummy x`eval "$ls_command \"\\\$save_arg1\""`
|
||||
|
||||
# Remove all preceding arguments
|
||||
eval $command
|
||||
|
||||
# Because of the dummy argument above, month is in $2.
|
||||
#
|
||||
# On a POSIX system, we should have
|
||||
# $# = 5
|
||||
# $1 = file size
|
||||
# $2 = month
|
||||
# $3 = day
|
||||
# $4 = year or time
|
||||
# $5 = filename
|
||||
#
|
||||
# On Darwin 7.7.0 and 7.6.0, we have
|
||||
# $# = 4
|
||||
# $1 = day
|
||||
# $2 = month
|
||||
# $3 = year or time
|
||||
# $4 = filename
|
||||
|
||||
# Get the month.
|
||||
mon_to_month $2
|
||||
|
||||
case $3 in
|
||||
???*) day=$1;;
|
||||
*) day=$3; shift;;
|
||||
esac
|
||||
|
||||
# Here we have to deal with the problem that the ls output gives either
|
||||
# the time of day or the year.
|
||||
case $3 in
|
||||
*:*) set `date`; eval year=\$$#
|
||||
case $2 in
|
||||
Jan) nummonthtod=1;;
|
||||
Feb) nummonthtod=2;;
|
||||
Mar) nummonthtod=3;;
|
||||
Apr) nummonthtod=4;;
|
||||
May) nummonthtod=5;;
|
||||
Jun) nummonthtod=6;;
|
||||
Jul) nummonthtod=7;;
|
||||
Aug) nummonthtod=8;;
|
||||
Sep) nummonthtod=9;;
|
||||
Oct) nummonthtod=10;;
|
||||
Nov) nummonthtod=11;;
|
||||
Dec) nummonthtod=12;;
|
||||
esac
|
||||
# For the first six months of the year the time notation can also
|
||||
# be used for files modified in the last year.
|
||||
if (expr $nummonth \> $nummonthtod) >/dev/null;
|
||||
then
|
||||
year=`expr $year - 1`
|
||||
fi;;
|
||||
*) year=$3;;
|
||||
esac
|
||||
|
||||
# The result.
|
||||
echo $day $month $year
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'before-save-hook 'time-stamp nil t)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%Y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC0"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
||||
+236
@@ -0,0 +1,236 @@
|
||||
#! /bin/sh
|
||||
# Common wrapper for a few potentially missing GNU and other programs.
|
||||
|
||||
scriptversion=2025-06-18.21; # UTC
|
||||
|
||||
# shellcheck disable=SC2006,SC2268 # we must support pre-POSIX shells
|
||||
|
||||
# Copyright (C) 1996-2025 Free Software Foundation, Inc.
|
||||
# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
|
||||
|
||||
# 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, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
if test $# -eq 0; then
|
||||
echo 1>&2 "Try '$0 --help' for more information"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
case $1 in
|
||||
|
||||
--is-lightweight)
|
||||
# Used by our autoconf macros to check whether the available missing
|
||||
# script is modern enough.
|
||||
exit 0
|
||||
;;
|
||||
|
||||
--run)
|
||||
# Back-compat with the calling convention used by older automake.
|
||||
shift
|
||||
;;
|
||||
|
||||
-h|--h|--he|--hel|--help)
|
||||
echo "\
|
||||
$0 [OPTION]... PROGRAM [ARGUMENT]...
|
||||
|
||||
Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
|
||||
to PROGRAM being missing or too old.
|
||||
|
||||
Options:
|
||||
-h, --help display this help and exit
|
||||
-v, --version output version information and exit
|
||||
|
||||
Supported PROGRAM values:
|
||||
aclocal autoconf autogen autoheader autom4te automake autoreconf
|
||||
bison flex help2man lex makeinfo perl yacc
|
||||
|
||||
Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
|
||||
'g' are ignored when checking the name.
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>.
|
||||
GNU Automake home page: <https://www.gnu.org/software/automake/>.
|
||||
General help using GNU software: <https://www.gnu.org/gethelp/>."
|
||||
exit $?
|
||||
;;
|
||||
|
||||
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
|
||||
echo "missing (GNU Automake) $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
|
||||
-*)
|
||||
echo 1>&2 "$0: unknown '$1' option"
|
||||
echo 1>&2 "Try '$0 --help' for more information"
|
||||
exit 1
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
# Run the given program, remember its exit status.
|
||||
"$@"; st=$?
|
||||
|
||||
# If it succeeded, we are done.
|
||||
test $st -eq 0 && exit 0
|
||||
|
||||
# Also exit now if we it failed (or wasn't found), and '--version' was
|
||||
# passed; such an option is passed most likely to detect whether the
|
||||
# program is present and works.
|
||||
case $2 in --version|--help) exit $st;; esac
|
||||
|
||||
# Exit code 63 means version mismatch. This often happens when the user
|
||||
# tries to use an ancient version of a tool on a file that requires a
|
||||
# minimum version.
|
||||
if test $st -eq 63; then
|
||||
msg="probably too old"
|
||||
elif test $st -eq 127; then
|
||||
# Program was missing.
|
||||
msg="missing on your system"
|
||||
else
|
||||
# Program was found and executed, but failed. Give up.
|
||||
exit $st
|
||||
fi
|
||||
|
||||
perl_URL=https://www.perl.org/
|
||||
flex_URL=https://github.com/westes/flex
|
||||
gnu_software_URL=https://www.gnu.org/software
|
||||
|
||||
program_details ()
|
||||
{
|
||||
case $1 in
|
||||
aclocal|automake|autoreconf)
|
||||
echo "The '$1' program is part of the GNU Automake package:"
|
||||
echo "<$gnu_software_URL/automake>"
|
||||
echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
|
||||
echo "<$gnu_software_URL/autoconf>"
|
||||
echo "<$gnu_software_URL/m4/>"
|
||||
echo "<$perl_URL>"
|
||||
;;
|
||||
autoconf|autom4te|autoheader)
|
||||
echo "The '$1' program is part of the GNU Autoconf package:"
|
||||
echo "<$gnu_software_URL/autoconf/>"
|
||||
echo "It also requires GNU m4 and Perl in order to run:"
|
||||
echo "<$gnu_software_URL/m4/>"
|
||||
echo "<$perl_URL>"
|
||||
;;
|
||||
*)
|
||||
:
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
give_advice ()
|
||||
{
|
||||
# Normalize program name to check for.
|
||||
normalized_program=`echo "$1" | sed '
|
||||
s/^gnu-//; t
|
||||
s/^gnu//; t
|
||||
s/^g//; t'`
|
||||
|
||||
printf '%s\n' "'$1' is $msg."
|
||||
|
||||
configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
|
||||
autoheader_deps="'acconfig.h'"
|
||||
automake_deps="'Makefile.am'"
|
||||
aclocal_deps="'acinclude.m4'"
|
||||
case $normalized_program in
|
||||
aclocal*)
|
||||
echo "You should only need it if you modified $aclocal_deps or"
|
||||
echo "$configure_deps."
|
||||
;;
|
||||
autoconf*)
|
||||
echo "You should only need it if you modified $configure_deps."
|
||||
;;
|
||||
autogen*)
|
||||
echo "You should only need it if you modified a '.def' or '.tpl' file."
|
||||
echo "You may want to install the GNU AutoGen package:"
|
||||
echo "<$gnu_software_URL/autogen/>"
|
||||
;;
|
||||
autoheader*)
|
||||
echo "You should only need it if you modified $autoheader_deps or"
|
||||
echo "$configure_deps."
|
||||
;;
|
||||
automake*)
|
||||
echo "You should only need it if you modified $automake_deps or"
|
||||
echo "$configure_deps."
|
||||
;;
|
||||
autom4te*)
|
||||
echo "You might have modified some maintainer files that require"
|
||||
echo "the 'autom4te' program to be rebuilt."
|
||||
;;
|
||||
autoreconf*)
|
||||
echo "You should only need it if you modified $aclocal_deps or"
|
||||
echo "$automake_deps or $autoheader_deps or $automake_deps or"
|
||||
echo "$configure_deps."
|
||||
;;
|
||||
bison*|yacc*)
|
||||
echo "You should only need it if you modified a '.y' file."
|
||||
echo "You may want to install the GNU Bison package:"
|
||||
echo "<$gnu_software_URL/bison/>"
|
||||
;;
|
||||
help2man*)
|
||||
echo "You should only need it if you modified a dependency" \
|
||||
"of a man page."
|
||||
echo "You may want to install the GNU Help2man package:"
|
||||
echo "<$gnu_software_URL/help2man/>"
|
||||
;;
|
||||
lex*|flex*)
|
||||
echo "You should only need it if you modified a '.l' file."
|
||||
echo "You may want to install the Fast Lexical Analyzer package:"
|
||||
echo "<$flex_URL>"
|
||||
;;
|
||||
makeinfo*)
|
||||
echo "You should only need it if you modified a '.texi' file, or"
|
||||
echo "any other file indirectly affecting the aspect of the manual."
|
||||
echo "You might want to install the Texinfo package:"
|
||||
echo "<$gnu_software_URL/texinfo/>"
|
||||
echo "The spurious makeinfo call might also be the consequence of"
|
||||
echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
|
||||
echo "want to install GNU make:"
|
||||
echo "<$gnu_software_URL/make/>"
|
||||
;;
|
||||
perl*)
|
||||
echo "You should only need it to run GNU Autoconf, GNU Automake, "
|
||||
echo " assorted other tools, or if you modified a Perl source file."
|
||||
echo "You may want to install the Perl 5 language interpreter:"
|
||||
echo "<$perl_URL>"
|
||||
;;
|
||||
*)
|
||||
echo "You might have modified some files without having the proper"
|
||||
echo "tools for further handling them. Check the 'README' file, it"
|
||||
echo "often tells you about the needed prerequisites for installing"
|
||||
echo "this package. You may also peek at any GNU archive site, in"
|
||||
echo "case some other package contains this missing '$1' program."
|
||||
;;
|
||||
esac
|
||||
program_details "$normalized_program"
|
||||
}
|
||||
|
||||
give_advice "$1" | sed -e '1s/^/WARNING: /' \
|
||||
-e '2,$s/^/ /' >&2
|
||||
|
||||
# Propagate the correct exit status (expected to be 127 for a program
|
||||
# not found, 63 for a program that failed due to version mismatch).
|
||||
exit $st
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'before-save-hook 'time-stamp nil t)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%Y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC0"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,38 @@
|
||||
# Configuration for building GNU Make in the absence of any 'make' program.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1993-2022 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 3 of the License, 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
|
||||
# this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# See Makefile.in for comments describing these variables.
|
||||
|
||||
top_srcdir='@top_srcdir@'
|
||||
|
||||
prefix='@prefix@'
|
||||
exec_prefix=`eval echo @exec_prefix@`
|
||||
|
||||
CC='@CC@'
|
||||
AR='@AR@'
|
||||
CFLAGS='@CFLAGS@ @GUILE_CFLAGS@'
|
||||
CPPFLAGS='@CPPFLAGS@'
|
||||
DEFS='@DEFS@'
|
||||
ARFLAGS='@ARFLAGS@'
|
||||
LDFLAGS='@AM_LDFLAGS@ @LDFLAGS@'
|
||||
ALLOCA='@ALLOCA@'
|
||||
LOADLIBES='@LIBS@ @GUILE_LIBS@ @LIBINTL@'
|
||||
REMOTE='@REMOTE@'
|
||||
OBJEXT='@OBJEXT@'
|
||||
EXEEXT='@EXEEXT@'
|
||||
Executable
+182
@@ -0,0 +1,182 @@
|
||||
#!/bin/sh
|
||||
# Shell script to build GNU Make in the absence of any 'make' program.
|
||||
|
||||
# Copyright (C) 1993-2022 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 3 of the License, 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
|
||||
# this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# Get configure-generated values
|
||||
. ./build.cfg
|
||||
|
||||
die () { echo "$*" 1>&2; exit 1; }
|
||||
usage () { echo "$0 [-k]"; exit $1; }
|
||||
|
||||
keep_going=false
|
||||
|
||||
: ${OUTDIR:=.}
|
||||
OUTLIB="$OUTDIR/lib"
|
||||
|
||||
# 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
|
||||
|
||||
defines="-DLOCALEDIR=\"$localedir\" -DLIBDIR=\"$libdir\" -DINCLUDEDIR=\"$includedir\""
|
||||
|
||||
# Look up a make variable value.
|
||||
# It can handle simple recursion where variables are separate words.
|
||||
# Print the value to stdout.
|
||||
get_mk_var ()
|
||||
{
|
||||
file=$1
|
||||
var=$2
|
||||
|
||||
val=
|
||||
v=$(sed -e :a -e '/\\$/N; s/\\\n//; ta' "$file" | sed -n "s=^ *$var *\= *==p")
|
||||
for w in $v; do
|
||||
case $w in
|
||||
(\$[\(\{]*[\)\}]) w=${w#\$[\(\{]}; w=$(get_mk_var "$file" "${w%[\)\}]}") ;;
|
||||
esac
|
||||
val="${val:+$val }$w"
|
||||
done
|
||||
|
||||
printf '%s\n' "$val"
|
||||
}
|
||||
|
||||
# Compile source files. Object files are put into $objs.
|
||||
compile ()
|
||||
{
|
||||
success=true
|
||||
objs=
|
||||
for ofile in "$@"; do
|
||||
# We should try to use a Makefile variable like libgnu_a_SOURCES or
|
||||
# something but just hardcode it.
|
||||
file="${ofile%.$OBJEXT}.c"
|
||||
case $file in
|
||||
(lib/libgnu_a-*.c) file="lib/${file#lib/libgnu_a-}" ;;
|
||||
esac
|
||||
echo "compiling $file..."
|
||||
of="$OUTDIR/$ofile"
|
||||
mkdir -p "${of%/*}" || exit 1
|
||||
if $CC $cflags $CPPFLAGS $CFLAGS -c -o "$of" "$top_srcdir/$file"; then
|
||||
: worked
|
||||
else
|
||||
$keep_going || die "Compilation failed."
|
||||
success=false
|
||||
fi
|
||||
|
||||
objs="${objs:+$objs }$of"
|
||||
done
|
||||
|
||||
$success
|
||||
}
|
||||
|
||||
# Use config.status to convert a .in file. Output file is put into $out.
|
||||
# $out will be empty if no conversion was needed.
|
||||
convert ()
|
||||
{
|
||||
out=
|
||||
base=$1
|
||||
var="GENERATE_$(echo $base | tr 'a-z./+' A-Z__X)"
|
||||
|
||||
# Is this file disabled?
|
||||
grep "${var}_FALSE\"]=\"\"" config.status >/dev/null && return 0
|
||||
|
||||
# If there's no .in file then no conversion needed
|
||||
in="$top_srcdir/lib/$(echo ${base%.*}.in.${base##*.} | tr / _)"
|
||||
test -f "$in" || return 0
|
||||
|
||||
# Not disabled, so create it
|
||||
out="$OUTLIB/$base"
|
||||
mkdir -p "${out%/*}"
|
||||
|
||||
# First perform the normal replacements, using config.status
|
||||
sed -e 's|@GUARD_PREFIX@|GL|g' \
|
||||
-e 's/@GNULIB_UNISTD_H_GETOPT@/0/g' \
|
||||
"$in" > "${out}_"
|
||||
./config.status --file "${out}__:${out}_"
|
||||
int="${out}__"
|
||||
|
||||
# Then see if there any files we need to include. Unfortunately there's no
|
||||
# algorithmic conversion so we just have to hard-code it.
|
||||
incls=$(sed -n 's/.*definitions* of \(_[^ $]*\).*/\1/p' "$in")
|
||||
|
||||
for inc in $incls; do
|
||||
case $inc in
|
||||
(_GL_FUNCDECL_RPL) fn=$(get_mk_var lib/Makefile CXXDEFS_H) ;;
|
||||
(_GL_ARG_NONNULL) fn=$(get_mk_var lib/Makefile ARG_NONNULL_H) ;;
|
||||
(_GL_WARN_ON_USE) fn=$(get_mk_var lib/Makefile WARN_ON_USE_H) ;;
|
||||
(_Noreturn) fn=$(get_mk_var lib/Makefile _NORETURN_H) ;;
|
||||
(*) echo "Unknown file replacement: $inc"; exit 1 ;;
|
||||
esac
|
||||
|
||||
fn="$top_srcdir/lib/${fn##*/}"
|
||||
test -f "$fn" || { echo "Missing file: $fn"; exit 1; }
|
||||
|
||||
sed "/definitions* of $inc/r $fn" "$int" > "${int}_"
|
||||
int=${int}_
|
||||
done
|
||||
|
||||
# Done!
|
||||
mv "$int" "$out"
|
||||
}
|
||||
|
||||
# Get source files provided from gnulib and convert to object files
|
||||
LIBOBJS=
|
||||
for lo in $( (get_mk_var lib/Makefile libgnu_a_OBJECTS; get_mk_var lib/Makefile libgnu_a_LIBADD) | sed "s=\$[\(\{]OBJEXT[\)\}]=$OBJEXT=g"); do
|
||||
LIBOBJS="${LIBOBJS:+$LIBOBJS }lib/$lo"
|
||||
done
|
||||
|
||||
# Get object files from the Makefile
|
||||
OBJS=$(get_mk_var Makefile make_OBJECTS | sed "s=\$[\(\{]OBJEXT[\)\}]=$OBJEXT=g")
|
||||
|
||||
while test -n "$1"; do
|
||||
case $1 in
|
||||
(-k) keep_going=true; shift ;;
|
||||
(--) shift; break ;;
|
||||
(-[h?]) usage 0 ;;
|
||||
(-*) echo "Unknown option: $1"; usage 1 ;;
|
||||
esac
|
||||
done
|
||||
|
||||
test -z "$1" || die "Unknown argument: $*"
|
||||
|
||||
# Generate gnulib header files that would normally be created by make
|
||||
set -e
|
||||
for b in $(get_mk_var lib/Makefile BUILT_SOURCES); do
|
||||
convert $b
|
||||
done
|
||||
set +e
|
||||
|
||||
# Build the gnulib library
|
||||
cflags="$DEFS -I$OUTLIB -Ilib -I$top_srcdir/lib -I$OUTDIR/src -Isrc -I$top_srcdir/src"
|
||||
compile $LIBOBJS || die "Compilation failed."
|
||||
|
||||
echo "creating libgnu.a..."
|
||||
$AR $ARFLAGS "$OUTLIB"/libgnu.a $objs || die "Archive of libgnu failed."
|
||||
|
||||
# Compile the source files into those objects.
|
||||
cflags="$DEFS $defines -I$OUTDIR/src -Isrc -I$top_srcdir/src -I$OUTLIB -Ilib -I$top_srcdir/lib"
|
||||
compile $OBJS || die "Compilation failed."
|
||||
|
||||
# Link all the objects together.
|
||||
echo "linking make..."
|
||||
$CC $CFLAGS $LDFLAGS -L"$OUTLIB" -o "$OUTDIR/makenew$EXEEXT" $objs -lgnu $LOADLIBES || die "Link failed."
|
||||
|
||||
mv -f "$OUTDIR/makenew$EXEEXT" "$OUTDIR/make$EXEEXT" || exit 1
|
||||
|
||||
echo done.
|
||||
@@ -0,0 +1,458 @@
|
||||
@echo off
|
||||
:: Copyright (C) 1996-2022 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 3 of the License, 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 this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
setlocal
|
||||
if not "%RECURSEME%"=="%~0" (
|
||||
set "RECURSEME=%~0"
|
||||
%ComSpec% /s /c ""%~0" %*"
|
||||
goto :EOF
|
||||
)
|
||||
|
||||
call :Reset
|
||||
|
||||
if "%1" == "-h" goto Usage
|
||||
if "%1" == "--help" goto Usage
|
||||
|
||||
echo.
|
||||
echo Creating GNU Make for Windows 9X/NT/2K/XP/Vista/7/8/10
|
||||
echo.
|
||||
|
||||
set MAKE=gnumake
|
||||
set GUILE=Y
|
||||
set COMPILER=cl.exe
|
||||
set O=obj
|
||||
set ARCH=x64
|
||||
set DEBUG=N
|
||||
set DIRENT=Y
|
||||
set VERBOSE=N
|
||||
|
||||
if exist maintMakefile (
|
||||
set MAINT=Y
|
||||
) else (
|
||||
set MAINT=N
|
||||
)
|
||||
|
||||
:ParseSW
|
||||
if "%1" == "--verbose" goto SetVerbose
|
||||
if "%1" == "--debug" goto SetDebug
|
||||
if "%1" == "--without-guile" goto NoGuile
|
||||
if "%1" == "--x86" goto Set32Bit
|
||||
if "%1" == "gcc" goto SetCC
|
||||
if "%1" == "tcc" goto SetTCC
|
||||
if "%1" == "" goto DoneSW
|
||||
goto Usage
|
||||
|
||||
:SetVerbose
|
||||
set VERBOSE=Y
|
||||
shift
|
||||
goto ParseSW
|
||||
|
||||
:SetDebug
|
||||
set DEBUG=Y
|
||||
echo - Building without compiler optimizations
|
||||
shift
|
||||
goto ParseSW
|
||||
|
||||
:NoGuile
|
||||
set GUILE=N
|
||||
echo - Building without Guile
|
||||
shift
|
||||
goto ParseSW
|
||||
|
||||
:Set32Bit
|
||||
set ARCH=x86
|
||||
echo - Building 32bit GNU Make
|
||||
shift
|
||||
goto ParseSW
|
||||
|
||||
:SetCC
|
||||
set COMPILER=gcc
|
||||
set O=o
|
||||
echo - Building with GCC
|
||||
shift
|
||||
goto ParseSW
|
||||
|
||||
:SetTCC
|
||||
set COMPILER=tcc
|
||||
set O=o
|
||||
echo - Building with TinyC
|
||||
shift
|
||||
goto ParseSW
|
||||
|
||||
:DoneSW
|
||||
if "%MAINT%" == "Y" echo - Enabling maintainer mode
|
||||
|
||||
if "%COMPILER%" == "gcc" goto FindGcc
|
||||
if "%COMPILER%" == "tcc" goto FindTcc
|
||||
|
||||
:: Find a compiler. Visual Studio requires a lot of effort to locate :-/.
|
||||
call %COMPILER% >nul 2>&1
|
||||
if not ERRORLEVEL 1 goto FoundMSVC
|
||||
|
||||
:: Visual Studio 17 and above provides the "vswhere" tool
|
||||
call :FindVswhere
|
||||
if ERRORLEVEL 1 goto LegacyVS
|
||||
|
||||
for /f "tokens=* usebackq" %%i in (`"%VSWHERE%" -latest -property installationPath`) do (
|
||||
set InstallPath=%%i
|
||||
)
|
||||
set "VSVARS=%InstallPath%\VC\Auxiliary\Build\vcvarsall.bat"
|
||||
call :CheckMSVC
|
||||
if not ERRORLEVEL 1 goto FoundMSVC
|
||||
|
||||
:: No "vswhere" or it can't find a compiler. Go old-school.
|
||||
:LegacyVS
|
||||
set "VSVARS=%VS150COMNTOOLS%\..\..\VC\vcvarsall.bat"
|
||||
call :CheckMSVC
|
||||
if not ERRORLEVEL 1 goto FoundMSVC
|
||||
|
||||
set "VSVARS=%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat"
|
||||
call :CheckMSVC
|
||||
if not ERRORLEVEL 1 goto FoundMSVC
|
||||
|
||||
set "VSVARS=%VS120COMNTOOLS%\..\..\VC\vcvarsall.bat"
|
||||
call :CheckMSVC
|
||||
if not ERRORLEVEL 1 goto FoundMSVC
|
||||
|
||||
set "VSVARS=%VS110COMNTOOLS%\..\..\VC\vcvarsall.bat"
|
||||
call :CheckMSVC
|
||||
if not ERRORLEVEL 1 goto FoundMSVC
|
||||
|
||||
set "VSVARS=%VS100COMNTOOLS%\..\..\VC\vcvarsall.bat"
|
||||
call :CheckMSVC
|
||||
if not ERRORLEVEL 1 goto FoundMSVC
|
||||
|
||||
set "VSVARS=%VS90COMNTOOLS%\..\..\VC\vcvarsall.bat"
|
||||
call :CheckMSVC
|
||||
if not ERRORLEVEL 1 goto FoundMSVC
|
||||
|
||||
set "VSVARS=%VS80COMNTOOLS%\..\..\VC\vcvarsall.bat"
|
||||
call :CheckMSVC
|
||||
if not ERRORLEVEL 1 goto FoundMSVC
|
||||
|
||||
set "VSVARS=%VS71COMNTOOLS%\..\..\VC\vcvarsall.bat"
|
||||
call :CheckMSVC
|
||||
if not ERRORLEVEL 1 goto FoundMSVC
|
||||
|
||||
set "VSVARS=%VS70COMNTOOLS%\..\..\VC\vcvarsall.bat"
|
||||
call :CheckMSVC
|
||||
if not ERRORLEVEL 1 goto FoundMSVC
|
||||
|
||||
set "VSVARS=%V6TOOLS%\VC98\Bin\vcvars32.bat"
|
||||
call :CheckMSVC
|
||||
if not ERRORLEVEL 1 goto FoundMSVC
|
||||
|
||||
set "VSVARS=%V6TOOLS%\VC97\Bin\vcvars32.bat"
|
||||
call :CheckMSVC
|
||||
if not ERRORLEVEL 1 goto FoundMSVC
|
||||
|
||||
set "VSVARS=%V5TOOLS%\VC\Bin\vcvars32.bat"
|
||||
call :CheckMSVC
|
||||
if not ERRORLEVEL 1 goto FoundMSVC
|
||||
|
||||
:: We did not find anything--fail
|
||||
echo No MSVC compiler available.
|
||||
echo Please run vcvarsall.bat and/or configure your Path.
|
||||
exit 1
|
||||
|
||||
:FoundMSVC
|
||||
set OUTDIR=.\WinRel
|
||||
set LNKOUT=./WinRel
|
||||
set "OPTS=/O2 /D NDEBUG"
|
||||
set LINKOPTS=
|
||||
if "%DEBUG%" == "Y" set OUTDIR=.\WinDebug
|
||||
if "%DEBUG%" == "Y" set LNKOUT=./WinDebug
|
||||
if "%DEBUG%" == "Y" set "OPTS=/Zi /Od /D _DEBUG"
|
||||
if "%DEBUG%" == "Y" set LINKOPTS=/DEBUG
|
||||
if "%MAINT%" == "Y" set "OPTS=%OPTS% /D MAKE_MAINTAINER_MODE"
|
||||
:: Show the compiler version that we found
|
||||
:: Unfortunately this also shows a "usage" note; I can't find anything better.
|
||||
echo.
|
||||
call %COMPILER%
|
||||
goto Build
|
||||
|
||||
:FindGcc
|
||||
set OUTDIR=.\GccRel
|
||||
set LNKOUT=./GccRel
|
||||
set OPTS=-O2
|
||||
set DIRENT=N
|
||||
if "%DEBUG%" == "Y" set OPTS=-O0
|
||||
if "%DEBUG%" == "Y" set OUTDIR=.\GccDebug
|
||||
if "%DEBUG%" == "Y" set LNKOUT=./GccDebug
|
||||
if "%MAINT%" == "Y" set "OPTS=%OPTS% -DMAKE_MAINTAINER_MODE"
|
||||
:: Show the compiler version that we found
|
||||
echo.
|
||||
call %COMPILER% --version
|
||||
if not ERRORLEVEL 1 goto Build
|
||||
echo No %COMPILER% found.
|
||||
exit 1
|
||||
|
||||
:FindTcc
|
||||
set OUTDIR=.\TccRel
|
||||
set LNKOUT=./TccRel
|
||||
set OPTS=-O2
|
||||
if "%DEBUG%" == "Y" set OPTS=-O0
|
||||
if "%DEBUG%" == "Y" set OUTDIR=.\TccDebug
|
||||
if "%DEBUG%" == "Y" set LNKOUT=./TccDebug
|
||||
if "%MAINT%" == "Y" set "OPTS=%OPTS% -DMAKE_MAINTAINER_MODE"
|
||||
:: Show the compiler version that we found
|
||||
echo.
|
||||
call %COMPILER% -v
|
||||
if not ERRORLEVEL 1 goto Build
|
||||
echo No %COMPILER% found.
|
||||
exit 1
|
||||
|
||||
:Build
|
||||
:: Clean the directory if it exists
|
||||
if exist %OUTDIR%\nul rmdir /S /Q %OUTDIR%
|
||||
|
||||
:: Recreate it
|
||||
mkdir %OUTDIR%
|
||||
mkdir %OUTDIR%\src
|
||||
mkdir %OUTDIR%\src\w32
|
||||
mkdir %OUTDIR%\src\w32\compat
|
||||
mkdir %OUTDIR%\src\w32\subproc
|
||||
mkdir %OUTDIR%\lib
|
||||
|
||||
if "%GUILE%" == "Y" call :ChkGuile
|
||||
|
||||
if not exist src\config.h.W32 goto NotConfig
|
||||
|
||||
echo.
|
||||
echo Compiling %OUTDIR% version
|
||||
|
||||
copy src\config.h.W32 %OUTDIR%\src\config.h
|
||||
|
||||
copy lib\glob.in.h %OUTDIR%\lib\glob.h
|
||||
copy lib\fnmatch.in.h %OUTDIR%\lib\fnmatch.h
|
||||
|
||||
if exist %OUTDIR%\link.sc del %OUTDIR%\link.sc
|
||||
|
||||
call :Compile src/ar
|
||||
call :Compile src/arscan
|
||||
call :Compile src/commands
|
||||
call :Compile src/default
|
||||
call :Compile src/dir
|
||||
call :Compile src/expand
|
||||
call :Compile src/file
|
||||
call :Compile src/function
|
||||
call :Compile src/getopt
|
||||
call :Compile src/getopt1
|
||||
call :Compile src/guile GUILE
|
||||
call :Compile src/hash
|
||||
call :Compile src/implicit
|
||||
call :Compile src/job
|
||||
call :Compile src/load
|
||||
call :Compile src/loadapi
|
||||
call :Compile src/main GUILE
|
||||
call :Compile src/misc
|
||||
call :Compile src/output
|
||||
call :Compile src/read
|
||||
call :Compile src/remake
|
||||
call :Compile src/remote-stub
|
||||
call :Compile src/rule
|
||||
call :Compile src/shuffle
|
||||
call :Compile src/signame
|
||||
call :Compile src/strcache
|
||||
call :Compile src/variable
|
||||
call :Compile src/version
|
||||
call :Compile src/vpath
|
||||
call :Compile src/w32/pathstuff
|
||||
call :Compile src/w32/w32os
|
||||
call :Compile src/w32/compat/posixfcn
|
||||
call :Compile src/w32/subproc/misc
|
||||
call :Compile src/w32/subproc/sub_proc
|
||||
call :Compile src/w32/subproc/w32err
|
||||
call :Compile lib/fnmatch
|
||||
call :Compile lib/glob
|
||||
call :Compile lib/getloadavg
|
||||
|
||||
:: Compile dirent unless it is supported by compiler library (like with gcc).
|
||||
if "%DIRENT%" == "Y" call :Compile src\w32\compat\dirent
|
||||
|
||||
call :Link
|
||||
|
||||
echo.
|
||||
if exist %OUTDIR%\%MAKE%.exe goto Success
|
||||
echo %OUTDIR% build FAILED!
|
||||
exit 1
|
||||
|
||||
:Success
|
||||
echo %OUTDIR% build succeeded.
|
||||
if exist Basic.mk copy /Y Basic.mk Makefile
|
||||
if not exist tests\config-flags.pm copy /Y tests\config-flags.pm.W32 tests\config-flags.pm
|
||||
call :Reset
|
||||
goto :EOF
|
||||
|
||||
::
|
||||
:: Subroutines
|
||||
::
|
||||
|
||||
:Compile
|
||||
if "%VERBOSE%" == "N" echo - Compiling %1.c
|
||||
echo %LNKOUT%/%1.%O% >>%OUTDIR%\link.sc
|
||||
set EXTRAS=
|
||||
if "%2" == "GUILE" set "EXTRAS=%GUILECFLAGS%"
|
||||
if exist "%OUTDIR%\%1.%O%" del "%OUTDIR%\%1.%O%"
|
||||
if "%COMPILER%" == "gcc" goto GccCompile
|
||||
if "%COMPILER%" == "tcc" goto TccCompile
|
||||
|
||||
:: MSVC Compile
|
||||
if "%VERBOSE%" == "Y" echo on
|
||||
call %COMPILER% /nologo /MT /W4 /EHsc %OPTS% /I %OUTDIR%/src /I src /I %OUTDIR%/lib /I lib /I src/w32/include /D _CONSOLE /D HAVE_CONFIG_H /FR%OUTDIR% /Fp%OUTDIR%\%MAKE%.pch /Fo%OUTDIR%\%1.%O% /Fd%OUTDIR%\%MAKE%.pdb %EXTRAS% /c %1.c
|
||||
@echo off
|
||||
goto CompileDone
|
||||
|
||||
:GccCompile
|
||||
:: GCC Compile
|
||||
if "%VERBOSE%" == "Y" echo on
|
||||
call %COMPILER% -mthreads -Wall -std=gnu99 -gdwarf-2 -g3 %OPTS% -I%OUTDIR%/src -I./src -I%OUTDIR%/lib -I./lib -I./src/w32/include -DHAVE_CONFIG_H %EXTRAS% -o %OUTDIR%/%1.%O% -c %1.c
|
||||
@echo off
|
||||
goto CompileDone
|
||||
|
||||
:TccCompile
|
||||
:: TCC Compile
|
||||
if "%VERBOSE%" == "Y" echo on
|
||||
call %COMPILER% -mthreads -Wall -std=c11 %OPTS% -I%OUTDIR%/src -I./src -I%OUTDIR%/lib -I./lib -I./src/w32/include -D_cdecl= -D_MSC_VER -DHAVE_CONFIG_H %EXTRAS% -o %OUTDIR%/%1.%O% -c %1.c
|
||||
@echo off
|
||||
goto CompileDone
|
||||
|
||||
:CompileDone
|
||||
if not exist "%OUTDIR%\%1.%O%" exit 1
|
||||
goto :EOF
|
||||
|
||||
:Link
|
||||
echo.
|
||||
echo - Linking %LNKOUT%/%MAKE%.exe
|
||||
if "%COMPILER%" == "gcc" goto GccLink
|
||||
if "%COMPILER%" == "tcc" goto TccLink
|
||||
|
||||
:: MSVC Link
|
||||
echo %GUILELIBS% kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib >>%OUTDIR%\link.sc
|
||||
if "%VERBOSE%" == "Y" echo on
|
||||
call link.exe /NOLOGO /SUBSYSTEM:console /PDB:%LNKOUT%\%MAKE%.pdb %LINKOPTS% /OUT:%LNKOUT%\%MAKE%.exe @%LNKOUT%\link.sc
|
||||
@echo off
|
||||
goto :EOF
|
||||
|
||||
:GccLink
|
||||
:: GCC Link
|
||||
if "%VERBOSE%" == "Y" echo on
|
||||
echo %GUILELIBS% -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 >>%OUTDIR%\link.sc
|
||||
call %COMPILER% -mthreads -gdwarf-2 -g3 %OPTS% -o %LNKOUT%/%MAKE%.exe @%LNKOUT%/link.sc -Wl,--out-implib=%LNKOUT%/libgnumake-1.dll.a
|
||||
@echo off
|
||||
goto :EOF
|
||||
|
||||
:TccLink
|
||||
:: TCC Link
|
||||
if "%VERBOSE%" == "Y" echo on
|
||||
echo %GUILELIBS% -lkernel32 -luser32 -lgdi32 -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lodbc32 -lodbccp32 >>%OUTDIR%\link.sc
|
||||
call %COMPILER% -mthreads %OPTS% -o %LNKOUT%/%MAKE%.exe @%LNKOUT%/link.sc
|
||||
@echo off
|
||||
goto :EOF
|
||||
|
||||
:ChkGuile
|
||||
:: Build with Guile is supported only on NT and later versions
|
||||
if not "%OS%" == "Windows_NT" goto NoGuile
|
||||
call pkg-config --help > %OUTDIR%\guile.tmp 2> NUL
|
||||
if ERRORLEVEL 1 goto NoPkgCfg
|
||||
|
||||
set PKGMSC=
|
||||
if not "%COMPILER%" == "gcc" set PKGMSC=--msvc-syntax
|
||||
|
||||
echo Checking for Guile 2.0
|
||||
call pkg-config --cflags --short-errors "guile-2.0" > %OUTDIR%\gl-c2.tmp 2> NUL
|
||||
if not ERRORLEVEL 1 set /P GUILECFLAGS= < %OUTDIR%\gl-c2.tmp
|
||||
|
||||
call pkg-config --libs --static --short-errors %PKGMSC% "guile-2.0" > %OUTDIR%\gl-l2.tmp 2> NUL
|
||||
if not ERRORLEVEL 1 set /P GUILELIBS= < %OUTDIR%\gl-l2.tmp
|
||||
|
||||
if not "%GUILECFLAGS%" == "" goto GuileDone
|
||||
|
||||
echo Checking for Guile 1.8
|
||||
call pkg-config --cflags --short-errors "guile-1.8" > %OUTDIR%\gl-c18.tmp 2> NUL
|
||||
if not ERRORLEVEL 1 set /P GUILECFLAGS= < %OUTDIR%\gl-c18.tmp
|
||||
|
||||
call pkg-config --libs --static --short-errors %PKGMSC% "guile-1.8" > %OUTDIR%\gl-l18.tmp 2> NUL
|
||||
if not ERRORLEVEL 1 set /P GUILELIBS= < %OUTDIR%\gl-l18.tmp
|
||||
|
||||
if not "%GUILECFLAGS%" == "" goto GuileDone
|
||||
|
||||
echo - No Guile found, building without Guile
|
||||
goto GuileDone
|
||||
|
||||
:NoPkgCfg
|
||||
echo - pkg-config not found, building without Guile
|
||||
|
||||
:GuileDone
|
||||
if "%GUILECFLAGS%" == "" goto :EOF
|
||||
|
||||
echo - Guile found: building with Guile
|
||||
set "GUILECFLAGS=%GUILECFLAGS% -DHAVE_GUILE"
|
||||
goto :EOF
|
||||
|
||||
:FindVswhere
|
||||
set VSWHERE=vswhere
|
||||
call "%VSWHERE%" -help >nul 2>&1
|
||||
if not ERRORLEVEL 1 exit /b 0
|
||||
set "VSWHERE=C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere"
|
||||
call "%VSWHERE%" -help >nul 2>&1
|
||||
if ERRORLEVEL 1 exit /b 1
|
||||
goto :EOF
|
||||
|
||||
:CheckMSVC
|
||||
if not exist "%VSVARS%" exit /b 1
|
||||
call "%VSVARS%" %ARCH%
|
||||
if ERRORLEVEL 1 exit /b 1
|
||||
call %COMPILER% >nul 2>&1
|
||||
if ERRORLEVEL 1 exit /b 1
|
||||
goto :EOF
|
||||
|
||||
:NotConfig
|
||||
echo.
|
||||
echo *** This workspace is not configured.
|
||||
echo Either retrieve the configured source in the release tarball
|
||||
echo or, if building from Git, run the .\bootstrap.bat script first.
|
||||
exit /b 1
|
||||
|
||||
:Usage
|
||||
echo Usage: %0 [options] [gcc] OR [tcc]
|
||||
echo Options:
|
||||
echo. --without-guile Do not compile Guile support even if found
|
||||
echo. --debug Make a Debug build--default is Release
|
||||
echo. --x86 Make a 32bit binary--default is 64bit
|
||||
echo. --help Display these instructions and exit
|
||||
echo.
|
||||
echo. "gcc" means compile with GCC, "tcc" means compile with Tiny C's TCC
|
||||
goto :EOF
|
||||
|
||||
:Reset
|
||||
set ARCH=
|
||||
set COMPILER=
|
||||
set DEBUG=
|
||||
set GUILE=
|
||||
set GUILECFLAGS=
|
||||
set GUILELIBS=
|
||||
set LINKOPTS=
|
||||
set MAKE=
|
||||
set NOGUILE=
|
||||
set O=
|
||||
set OPTS=
|
||||
set OUTDIR=
|
||||
set LNKOUT=
|
||||
set PKGMSC=
|
||||
set VSVARS=
|
||||
goto :EOF
|
||||
@@ -0,0 +1,97 @@
|
||||
@echo off
|
||||
rem Copyright (C) 1998-2022 Free Software Foundation, Inc.
|
||||
rem This file is part of GNU Make.
|
||||
rem
|
||||
rem GNU Make is free software; you can redistribute it and/or modify it under
|
||||
rem the terms of the GNU General Public License as published by the Free
|
||||
rem Software Foundation; either version 3 of the License, or (at your option)
|
||||
rem any later version.
|
||||
rem
|
||||
rem GNU Make is distributed in the hope that it will be useful, but WITHOUT
|
||||
rem ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
rem FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for.
|
||||
rem more details.
|
||||
rem
|
||||
rem You should have received a copy of the GNU General Public License along
|
||||
rem with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
echo Building Make for MSDOS with DJGPP
|
||||
|
||||
rem The SmallEnv trick protects against too small environment block,
|
||||
rem in which case the values will be truncated and the whole thing
|
||||
rem goes awry. COMMAND.COM will say "Out of environment space", but
|
||||
rem many people don't care, so we force them to care by refusing to go.
|
||||
|
||||
rem Where is the srcdir?
|
||||
set XSRC=.
|
||||
if not "%XSRC%"=="." goto SmallEnv
|
||||
if "%1%"=="" goto SrcDone
|
||||
if "%1%"=="." goto SrcDone
|
||||
set XSRC=%1
|
||||
|
||||
if not "%XSRC%"=="%1" goto SmallEnv
|
||||
|
||||
:SrcDone
|
||||
|
||||
if not exist src mkdir src
|
||||
if not exist lib mkdir lib
|
||||
|
||||
copy /Y %XSRC%\src\configh.dos .\src\config.h
|
||||
|
||||
copy /Y %XSRC%\lib\glob.in.h .\lib\glob.h
|
||||
copy /Y %XSRC%\lib\fnmatch.in.h .\lib\fnmatch.h
|
||||
|
||||
rem Echo ON so they will see what is going on.
|
||||
@echo on
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/commands.c -o commands.o
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/output.c -o output.o
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/job.c -o job.o
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/dir.c -o dir.o
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/file.c -o file.o
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/misc.c -o misc.o
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -DLOCALEDIR=\"/dev/env/DJDIR/share/locale\" -O2 -g %XSRC%/src/main.c -o main.o
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -DINCLUDEDIR=\"/dev/env/DJDIR/include\" -O2 -g %XSRC%/src/read.c -o read.o
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -DLIBDIR=\"/dev/env/DJDIR/lib\" -O2 -g %XSRC%/src/remake.c -o remake.o
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/rule.c -o rule.o
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/implicit.c -o implicit.o
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/default.c -o default.o
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/variable.c -o variable.o
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/expand.c -o expand.o
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/function.c -o function.o
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/vpath.c -o vpath.o
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/hash.c -o hash.o
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/strcache.c -o strcache.o
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/version.c -o version.o
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/ar.c -o ar.o
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/arscan.c -o arscan.o
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/signame.c -o signame.o
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/remote-stub.c -o remote-stub.o
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/getopt.c -o getopt.o
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/getopt1.c -o getopt1.o
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/shuffle.c -o shuffle.o
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/load.c -o load.o
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/lib/glob.c -o lib/glob.o
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/lib/fnmatch.c -o lib/fnmatch.o
|
||||
@echo off
|
||||
echo commands.o > respf.$$$
|
||||
for %%f in (job output dir file misc main read remake rule implicit default variable load) do echo %%f.o >> respf.$$$
|
||||
for %%f in (expand function vpath hash strcache version ar arscan signame remote-stub getopt getopt1 shuffle) do echo %%f.o >> respf.$$$
|
||||
for %%f in (lib\glob lib\fnmatch) do echo %%f.o >> respf.$$$
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/guile.c -o guile.o
|
||||
echo guile.o >> respf.$$$
|
||||
@echo Linking...
|
||||
@echo on
|
||||
gcc -o make.exe @respf.$$$
|
||||
@echo off
|
||||
if not exist make.exe echo Make.exe build failed...
|
||||
if exist make.exe echo make.exe is now built!
|
||||
if exist make.exe del respf.$$$
|
||||
if exist make.exe copy /Y %XSRC%\Basic.mk Makefile
|
||||
goto End
|
||||
|
||||
:SmallEnv
|
||||
echo Your environment is too small. Please enlarge it and run me again.
|
||||
|
||||
:End
|
||||
set XRSC=
|
||||
@echo on
|
||||
+17351
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,554 @@
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
#
|
||||
# Copyright (C) 1993-2022 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 3 of the License, 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
|
||||
# this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
AC_INIT([GNU Make],[4.4],[bug-make@gnu.org])
|
||||
|
||||
AC_PREREQ([2.69])
|
||||
|
||||
# Autoconf setup
|
||||
AC_CONFIG_AUX_DIR([build-aux])
|
||||
AC_CONFIG_SRCDIR([src/vpath.c])
|
||||
AC_CONFIG_HEADERS([src/config.h])
|
||||
|
||||
AC_CONFIG_LIBOBJ_DIR([lib])
|
||||
|
||||
# Automake setup
|
||||
# We have to enable "foreign" because ChangeLog is auto-generated
|
||||
# Automake 1.15 and gnulib don't get along: gnulib has some strange error
|
||||
# in the way it handles getloadavg.c which causes make distcheck to fail.
|
||||
# https://lists.gnu.org/archive/html/bug-gnulib/2018-06/msg00024.html
|
||||
AM_INIT_AUTOMAKE([1.16.1 foreign -Werror -Wall])
|
||||
|
||||
# Checks for programs.
|
||||
AC_USE_SYSTEM_EXTENSIONS
|
||||
AC_PROG_CC
|
||||
|
||||
# Configure gnulib
|
||||
gl_EARLY
|
||||
gl_INIT
|
||||
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_RANLIB
|
||||
AC_PROG_CPP
|
||||
AC_CHECK_PROG([AR], [ar], [ar], [ar])
|
||||
# Perl is needed for the test suite (only)
|
||||
AC_CHECK_PROG([PERL], [perl], [perl], [perl])
|
||||
|
||||
# Specialized system macros
|
||||
AC_CANONICAL_HOST
|
||||
AC_C_BIGENDIAN
|
||||
|
||||
# Enable gettext, in "external" mode.
|
||||
AM_GNU_GETTEXT_VERSION([0.19.4])
|
||||
AM_GNU_GETTEXT([external])
|
||||
|
||||
# Checks for libraries.
|
||||
AC_SEARCH_LIBS([strerror],[cposix])
|
||||
AC_SEARCH_LIBS([getpwnam], [sun])
|
||||
|
||||
AC_HEADER_DIRENT
|
||||
AC_HEADER_STAT
|
||||
|
||||
AC_CHECK_HEADERS([stdlib.h locale.h unistd.h limits.h fcntl.h string.h \
|
||||
memory.h sys/param.h sys/resource.h sys/timeb.h sys/time.h \
|
||||
sys/select.h sys/file.h spawn.h])
|
||||
|
||||
AM_PROG_CC_C_O
|
||||
AC_C_CONST
|
||||
AC_TYPE_UID_T
|
||||
AC_TYPE_PID_T
|
||||
AC_TYPE_OFF_T
|
||||
AC_TYPE_SIZE_T
|
||||
AC_TYPE_SSIZE_T
|
||||
AC_TYPE_INTMAX_T
|
||||
AC_TYPE_UINTMAX_T
|
||||
|
||||
# Check for sig_atomic_t
|
||||
gt_TYPE_SIG_ATOMIC_T
|
||||
|
||||
# Find out whether our struct stat returns nanosecond resolution timestamps.
|
||||
|
||||
AC_STRUCT_ST_MTIM_NSEC
|
||||
AC_CACHE_CHECK([whether to use high resolution file timestamps],
|
||||
[make_cv_file_timestamp_hi_res],
|
||||
[ make_cv_file_timestamp_hi_res=no
|
||||
AS_IF([test "$ac_cv_struct_st_mtim_nsec" != no],
|
||||
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||
#if HAVE_INTTYPES_H
|
||||
# include <inttypes.h>
|
||||
#endif]],
|
||||
[[char a[0x7fffffff < (uintmax_t)-1 >> 30 ? 1 : -1];]])],
|
||||
[make_cv_file_timestamp_hi_res=yes])
|
||||
])])
|
||||
AS_IF([test "$make_cv_file_timestamp_hi_res" = yes], [val=1], [val=0])
|
||||
AC_DEFINE_UNQUOTED([FILE_TIMESTAMP_HI_RES], [$val],
|
||||
[Use high resolution file timestamps if nonzero.])
|
||||
|
||||
AS_IF([test "$make_cv_file_timestamp_hi_res" = yes],
|
||||
[ # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function.
|
||||
# Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4.
|
||||
AC_SEARCH_LIBS([clock_gettime], [rt posix4])
|
||||
AS_IF([test "$ac_cv_search_clock_gettime" != no],
|
||||
[ AC_DEFINE([HAVE_CLOCK_GETTIME], [1],
|
||||
[Define to 1 if you have the clock_gettime function.])
|
||||
])
|
||||
])
|
||||
|
||||
# See if we have a standard version of gettimeofday(). Since actual
|
||||
# implementations can differ, just make sure we have the most common
|
||||
# one.
|
||||
AC_CACHE_CHECK([for standard gettimeofday], [ac_cv_func_gettimeofday],
|
||||
[ac_cv_func_gettimeofday=no
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <sys/time.h>
|
||||
int main ()
|
||||
{
|
||||
struct timeval t; t.tv_sec = -1; t.tv_usec = -1;
|
||||
return gettimeofday (&t, 0) != 0
|
||||
|| t.tv_sec < 0 || t.tv_usec < 0;
|
||||
}]])],
|
||||
[ac_cv_func_gettimeofday=yes],
|
||||
[ac_cv_func_gettimeofday=no],
|
||||
[ac_cv_func_gettimeofday="no (cross-compiling)"])])
|
||||
AS_IF([test "$ac_cv_func_gettimeofday" = yes],
|
||||
[ AC_DEFINE([HAVE_GETTIMEOFDAY], [1],
|
||||
[Define to 1 if you have a standard gettimeofday function])
|
||||
])
|
||||
|
||||
AC_CHECK_FUNCS([strtoll strdup strndup stpcpy memrchr mempcpy umask mkstemp \
|
||||
mktemp fdopen dup dup2 getcwd realpath sigsetmask sigaction \
|
||||
getgroups seteuid setegid setlinebuf setreuid setregid \
|
||||
mkfifo getrlimit setrlimit setvbuf pipe strerror strsignal \
|
||||
lstat readlink atexit isatty ttyname pselect posix_spawn \
|
||||
posix_spawnattr_setsigmask])
|
||||
|
||||
# We need to check declarations, not just existence, because on Tru64 this
|
||||
# function is not declared without special flags, which themselves cause
|
||||
# other problems. We'll just use our own.
|
||||
AC_CHECK_DECLS([bsd_signal], [], [], [[#define _GNU_SOURCE 1
|
||||
#include <signal.h>]])
|
||||
|
||||
AC_FUNC_FORK
|
||||
|
||||
# Rumor has it that strcasecmp lives in -lresolv on some odd systems.
|
||||
# It doesn't hurt much to use our own if we can't find it so I don't
|
||||
# make the effort here.
|
||||
AC_CHECK_FUNCS([strcasecmp strncasecmp strcmpi strncmpi stricmp strnicmp])
|
||||
|
||||
# strcoll() is used by the GNU glob library
|
||||
AC_FUNC_STRCOLL
|
||||
AC_FUNC_CLOSEDIR_VOID
|
||||
|
||||
# dir.c and our glob.c use dirent.d_type if available
|
||||
AC_STRUCT_DIRENT_D_TYPE
|
||||
|
||||
# See if the user wants to add (or not) GNU Guile support
|
||||
AC_ARG_WITH([guile], [AS_HELP_STRING([--with-guile],
|
||||
[Support GNU Guile for embedded scripting])])
|
||||
|
||||
# Annoyingly, each version of Guile comes with it's own PC file so we have to
|
||||
# specify them as individual packages. Ugh.
|
||||
PKG_PROG_PKG_CONFIG
|
||||
|
||||
AS_IF([test "x$with_guile" != xno],
|
||||
[ guile_versions="3.0 2.2 2.0 1.8"
|
||||
guile_version=no
|
||||
have_guile=no
|
||||
AC_MSG_CHECKING([for GNU Guile])
|
||||
for v in $guile_versions; do
|
||||
PKG_CHECK_EXISTS([guile-$v], [guile_version=$v; have_guile=yes; break], [])
|
||||
done
|
||||
AC_MSG_RESULT([$guile_version])
|
||||
AS_IF([test "$have_guile" = yes],
|
||||
[ PKG_CHECK_MODULES(GUILE, [guile-$guile_version])
|
||||
# Unfortunately pkg doesn't help in multi-arch environments where the
|
||||
# package is installed for some architectures but not others; we need
|
||||
# to try to link.
|
||||
keep_CPPFLAGS="$CPPFLAGS"
|
||||
keep_LIBS="$LIBS"
|
||||
CPPFLAGS="$CPPFLAGS $GUILE_CFLAGS"
|
||||
LIBS="$LIBS $GUILE_LIBS"
|
||||
AC_CHECK_HEADER([libguile.h],
|
||||
[AC_DEFINE([HAVE_GUILE], [1], [Embed GNU Guile support])],
|
||||
[have_guile=no],
|
||||
[/* Avoid configuration error warnings. */])
|
||||
AS_IF([test "$have_guile" = yes],
|
||||
[ AC_MSG_CHECKING([whether we can link GNU Guile])
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
||||
#include <libguile.h>
|
||||
static void *
|
||||
guile_init (void *arg)
|
||||
{
|
||||
(void) arg;
|
||||
return 0;
|
||||
}
|
||||
]], [[
|
||||
scm_with_guile (guile_init, 0);
|
||||
]])],
|
||||
[have_guile=yes],
|
||||
[have_guile=no])
|
||||
AC_MSG_RESULT([$have_guile])])
|
||||
CPPFLAGS="$keep_CPPFLAGS"
|
||||
LIBS="$keep_LIBS"
|
||||
])
|
||||
])
|
||||
|
||||
AM_CONDITIONAL([HAVE_GUILE], [test "$have_guile" = "yes"])
|
||||
|
||||
AC_CHECK_DECLS([sys_siglist, _sys_siglist, __sys_siglist], , ,
|
||||
[AC_INCLUDES_DEFAULT
|
||||
#include <signal.h>
|
||||
/* NetBSD declares sys_siglist in unistd.h. */
|
||||
#if HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
])
|
||||
|
||||
|
||||
# Check out the wait reality.
|
||||
AC_CHECK_HEADERS([sys/wait.h],[],[],[[#include <sys/types.h>]])
|
||||
AC_CHECK_FUNCS([waitpid wait3])
|
||||
AC_CACHE_CHECK([for union wait], [make_cv_union_wait],
|
||||
[ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
|
||||
#include <sys/wait.h>]],
|
||||
[[union wait status; int pid; pid = wait (&status);
|
||||
#ifdef WEXITSTATUS
|
||||
/* Some POSIXoid systems have both the new-style macros and the old
|
||||
union wait type, and they do not work together. If union wait
|
||||
conflicts with WEXITSTATUS et al, we don't want to use it at all. */
|
||||
if (WEXITSTATUS (status) != 0) pid = -1;
|
||||
#ifdef WTERMSIG
|
||||
/* If we have WEXITSTATUS and WTERMSIG, just use them on ints. */
|
||||
-- blow chunks here --
|
||||
#endif
|
||||
#endif
|
||||
#ifdef HAVE_WAITPID
|
||||
/* Make sure union wait works with waitpid. */
|
||||
pid = waitpid (-1, &status, 0);
|
||||
#endif
|
||||
]])],
|
||||
[make_cv_union_wait=yes],
|
||||
[make_cv_union_wait=no])
|
||||
])
|
||||
AS_IF([test "$make_cv_union_wait" = yes],
|
||||
[ AC_DEFINE([HAVE_UNION_WAIT], [1],
|
||||
[Define to 1 if you have the 'union wait' type in <sys/wait.h>.])
|
||||
])
|
||||
|
||||
|
||||
# If we're building on Windows/DOS/OS/2, add some support for DOS drive specs.
|
||||
AS_IF([test "$PATH_SEPARATOR" = ';'],
|
||||
[ AC_DEFINE([HAVE_DOS_PATHS], [1],
|
||||
[Define to 1 if your system requires backslashes or drive specs in pathnames.])
|
||||
])
|
||||
|
||||
# See if the user wants to use pmake's "customs" distributed build capability
|
||||
AC_SUBST([REMOTE]) REMOTE=stub
|
||||
use_customs=false
|
||||
AC_ARG_WITH([customs],
|
||||
[AS_HELP_STRING([--with-customs=DIR],[enable remote jobs via Customs--see README.customs])],
|
||||
[ AS_CASE([$withval], [n|no], [:],
|
||||
[make_cppflags="$CPPFLAGS"
|
||||
AS_CASE([$withval],
|
||||
[y|ye|yes], [:],
|
||||
[CPPFLAGS="$CPPFLAGS -I$with_customs/include/customs"
|
||||
make_ldflags="$LDFLAGS -L$with_customs/lib"])
|
||||
CF_NETLIBS
|
||||
AC_CHECK_HEADER([customs.h],
|
||||
[use_customs=true
|
||||
REMOTE=cstms
|
||||
LIBS="$LIBS -lcustoms" LDFLAGS="$make_ldflags"],
|
||||
[with_customs=no
|
||||
CPPFLAGS="$make_cppflags" make_badcust=yes])
|
||||
])
|
||||
])
|
||||
|
||||
# Tell automake about this, so it can include the right .c files.
|
||||
AM_CONDITIONAL([USE_CUSTOMS], [test "$use_customs" = true])
|
||||
|
||||
# See if the user asked to handle case insensitive file systems.
|
||||
AH_TEMPLATE([HAVE_CASE_INSENSITIVE_FS], [Use case insensitive file names])
|
||||
AC_ARG_ENABLE([case-insensitive-file-system],
|
||||
AS_HELP_STRING([--enable-case-insensitive-file-system],[assume file systems are case insensitive]),
|
||||
[AS_IF([test "$enableval" = yes], [AC_DEFINE([HAVE_CASE_INSENSITIVE_FS])])])
|
||||
|
||||
# See if we can handle the job server feature, and if the user wants it.
|
||||
AC_ARG_ENABLE([job-server],
|
||||
AS_HELP_STRING([--disable-job-server],[disallow recursive make communication during -jN]),
|
||||
[make_cv_job_server="$enableval" user_job_server="$enableval"],
|
||||
[make_cv_job_server="yes"])
|
||||
|
||||
AS_IF([test "$ac_cv_func_waitpid" = no && test "$ac_cv_func_wait3" = no],
|
||||
[has_wait_nohang=no],
|
||||
[has_wait_nohang=yes])
|
||||
|
||||
AC_CACHE_CHECK([for SA_RESTART], [make_cv_sa_restart], [
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <signal.h>]],
|
||||
[[return SA_RESTART;]])],
|
||||
[make_cv_sa_restart=yes],
|
||||
[make_cv_sa_restart=no])])
|
||||
|
||||
AS_IF([test "$make_cv_sa_restart" != no],
|
||||
[ AC_DEFINE([HAVE_SA_RESTART], [1],
|
||||
[Define to 1 if <signal.h> defines the SA_RESTART constant.])
|
||||
])
|
||||
|
||||
# Only allow jobserver on systems that support it
|
||||
AS_CASE([/$ac_cv_func_pipe/$ac_cv_func_sigaction/$make_cv_sa_restart/$has_wait_nohang/],
|
||||
[*/no/*], [make_cv_job_server=no])
|
||||
|
||||
# Also supported on OS2 and MinGW
|
||||
AS_CASE([$host_os], [os2*|mingw*], [make_cv_job_server=yes])
|
||||
|
||||
# If we support it and the user didn't disable it, build with jobserver
|
||||
AS_CASE([/$make_cv_job_server/$user_job_server/],
|
||||
[*/no/*], [: no jobserver],
|
||||
[AC_DEFINE(MAKE_JOBSERVER, 1,
|
||||
[Define to 1 to enable job server support in GNU make.])
|
||||
])
|
||||
|
||||
# If dl*() functions are supported we can enable the load operation
|
||||
AC_CHECK_DECLS([dlopen, dlsym, dlerror], [], [],
|
||||
[[#include <dlfcn.h>]])
|
||||
|
||||
AC_ARG_ENABLE([load],
|
||||
AS_HELP_STRING([--disable-load],[disable support for the 'load' operation]),
|
||||
[make_cv_load="$enableval" user_load="$enableval"],
|
||||
[make_cv_load="yes"])
|
||||
|
||||
AS_CASE([/$ac_cv_have_decl_dlopen/$ac_cv_have_decl_dlsym/$ac_cv_have_decl_dlerror/],
|
||||
[*/no/*], [make_cv_load=no])
|
||||
|
||||
# We might need -ldl
|
||||
AS_IF([test "$make_cv_load" = yes], [
|
||||
AC_SEARCH_LIBS([dlopen], [dl], [], [make_cv_load=])
|
||||
])
|
||||
|
||||
AS_CASE([/$make_cv_load/$user_load/],
|
||||
[*/no/*], [make_cv_load=no],
|
||||
[AC_DEFINE(MAKE_LOAD, 1,
|
||||
[Define to 1 to enable 'load' support in GNU make.])
|
||||
])
|
||||
|
||||
# If we want load support, we might need to link with export-dynamic.
|
||||
# See if we can figure it out. Unfortunately this is very difficult.
|
||||
# For example passing -rdynamic to the SunPRO linker gives a warning
|
||||
# but succeeds and creates a shared object, not an executable!
|
||||
AS_IF([test "$make_cv_load" = yes], [
|
||||
AC_MSG_CHECKING([If the linker accepts -Wl,--export-dynamic])
|
||||
old_LDFLAGS="$LDFLAGS"
|
||||
LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
|
||||
AC_LINK_IFELSE([AC_LANG_SOURCE([int main(){}])],
|
||||
[AC_MSG_RESULT([yes])
|
||||
AC_SUBST([AM_LDFLAGS], [-Wl,--export-dynamic])],
|
||||
[AC_MSG_RESULT([no])
|
||||
AC_MSG_CHECKING([If the linker accepts -rdynamic])
|
||||
LDFLAGS="$old_LDFLAGS -rdynamic"
|
||||
AC_LINK_IFELSE([AC_LANG_SOURCE([int main(){}])],
|
||||
[AC_MSG_RESULT([yes])
|
||||
AC_SUBST([AM_LDFLAGS], [-rdynamic])],
|
||||
[AC_MSG_RESULT([no])])
|
||||
])
|
||||
LDFLAGS="$old_LDFLAGS"
|
||||
])
|
||||
|
||||
# if we have both lstat() and readlink() then we can support symlink
|
||||
# timechecks.
|
||||
AS_IF([test "$ac_cv_func_lstat" = yes && test "$ac_cv_func_readlink" = yes],
|
||||
[ AC_DEFINE([MAKE_SYMLINKS], [1],
|
||||
[Define to 1 to enable symbolic link timestamp checking.])
|
||||
])
|
||||
|
||||
# Use posix_spawn if we have support and the user didn't disable it
|
||||
|
||||
AC_ARG_ENABLE([posix-spawn],
|
||||
AS_HELP_STRING([--disable-posix-spawn],[disable support for posix_spawn()]),
|
||||
[make_cv_posix_spawn="$enableval" user_posix_spawn="$enableval"],
|
||||
[make_cv_posix_spawn="yes"])
|
||||
|
||||
AS_CASE([/$ac_cv_header_spawn/$ac_cv_func_posix_spawn/],
|
||||
[*/no/*], [make_cv_posix_spawn=no])
|
||||
|
||||
AS_IF([test "$make_cv_posix_spawn" = yes],
|
||||
AC_CACHE_CHECK([for posix_spawn that fails synchronously],
|
||||
[make_cv_synchronous_posix_spawn],
|
||||
[make_cv_synchronous_posix_spawn=no
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <errno.h>
|
||||
#include <spawn.h>
|
||||
extern char **environ;
|
||||
int main () {
|
||||
char path[[]] = "./xxx-non-existent";
|
||||
char *argv[[]] = {path, 0};
|
||||
return posix_spawn (0, path, 0, 0, argv, environ) == ENOENT ? 0 : 1;
|
||||
}]])],
|
||||
[make_cv_synchronous_posix_spawn=yes],
|
||||
[make_cv_synchronous_posix_spawn=no],
|
||||
[make_cv_synchronous_posix_spawn="no (cross-compiling)"])]))
|
||||
|
||||
AS_CASE([/$user_posix_spawn/$make_cv_posix_spawn/$make_cv_synchronous_posix_spawn/],
|
||||
[*/no/*], [make_cv_posix_spawn=no],
|
||||
[AC_DEFINE(USE_POSIX_SPAWN, 1, [Define to 1 to use posix_spawn().])
|
||||
])
|
||||
|
||||
# Find the SCCS commands, so we can include them in our default rules.
|
||||
|
||||
AC_CACHE_CHECK([for location of SCCS get command], [make_cv_path_sccs_get], [
|
||||
AS_IF([test -f /usr/sccs/get],
|
||||
[make_cv_path_sccs_get=/usr/sccs/get],
|
||||
[make_cv_path_sccs_get=get])
|
||||
])
|
||||
AC_DEFINE_UNQUOTED([SCCS_GET], ["$make_cv_path_sccs_get"],
|
||||
[Define to the name of the SCCS 'get' command.])
|
||||
|
||||
ac_clean_files="$ac_clean_files s.conftest conftoast" # Remove these later.
|
||||
AS_IF([(/usr/sccs/admin -n s.conftest || admin -n s.conftest) >/dev/null 2>&1 &&
|
||||
test -f s.conftest],
|
||||
[ # We successfully created an SCCS file.
|
||||
AC_CACHE_CHECK([if SCCS get command understands -G], [make_cv_sys_get_minus_G],
|
||||
[AS_IF([$make_cv_path_sccs_get -Gconftoast s.conftest >/dev/null 2>&1 &&
|
||||
test -f conftoast],
|
||||
[make_cv_sys_get_minus_G=yes],
|
||||
[make_cv_sys_get_minus_G=no])
|
||||
])
|
||||
AS_IF([test "$make_cv_sys_get_minus_G" = yes],
|
||||
[AC_DEFINE([SCCS_GET_MINUS_G], [1],
|
||||
[Define to 1 if the SCCS 'get' command understands the '-G<file>' option.])
|
||||
])
|
||||
])
|
||||
rm -f s.conftest conftoast
|
||||
|
||||
# Let the makefile know what our build host is
|
||||
|
||||
AC_DEFINE_UNQUOTED([MAKE_HOST],["$host"],[Build host information.])
|
||||
MAKE_HOST="$host"
|
||||
AC_SUBST([MAKE_HOST])
|
||||
|
||||
w32_target_env=no
|
||||
AM_CONDITIONAL([WINDOWSENV], [false])
|
||||
|
||||
AS_CASE([$host],
|
||||
[*-*-mingw32],
|
||||
[AM_CONDITIONAL([WINDOWSENV], [true])
|
||||
w32_target_env=yes
|
||||
AC_DEFINE([WINDOWS32], [1], [Build for the WINDOWS32 API.])
|
||||
AC_DEFINE([HAVE_DOS_PATHS], [1], [Support DOS-style pathnames.])
|
||||
])
|
||||
|
||||
AC_DEFINE_UNQUOTED([PATH_SEPARATOR_CHAR],['$PATH_SEPARATOR'],
|
||||
[Define to the character that separates directories in PATH.])
|
||||
|
||||
AC_DEFINE_UNQUOTED([HAVE_DECL_GETLOADAVG],[$HAVE_DECL_GETLOADAVG],
|
||||
[Define to 1 if you have the declaration of 'getloadavg'.])
|
||||
|
||||
# Remember that we ran configure to generate config.h
|
||||
|
||||
AC_DEFINE([MK_CONFIGURE], [1],
|
||||
[Define to 1 if config.h is generated by running the configure script.])
|
||||
|
||||
# Include the Maintainer's Makefile section, if it's here.
|
||||
|
||||
MAINT_MAKEFILE=/dev/null
|
||||
AS_IF([test -r "$srcdir/maintMakefile"],
|
||||
[ MAINT_MAKEFILE="$srcdir/maintMakefile"
|
||||
])
|
||||
AC_SUBST_FILE([MAINT_MAKEFILE])
|
||||
|
||||
# Allow building with dmalloc
|
||||
AM_WITH_DMALLOC
|
||||
|
||||
# Forcibly disable SET_MAKE. If it's set it breaks things like the test
|
||||
# scripts, etc.
|
||||
SET_MAKE=
|
||||
|
||||
# Sanity check and inform the user of what we found
|
||||
|
||||
AS_IF([test "x$make_badcust" = xyes], [
|
||||
echo
|
||||
echo "WARNING: --with-customs specified but no customs.h could be found;"
|
||||
echo " disabling Customs support."
|
||||
echo
|
||||
])
|
||||
|
||||
AS_CASE([$with_customs],
|
||||
[""|n|no|y|ye|yes], [:],
|
||||
[AS_IF([test -f "$with_customs/lib/libcustoms.a"], [:],
|
||||
[ echo
|
||||
echo "WARNING: '$with_customs/lib' does not appear to contain the"
|
||||
echo " Customs library. You must build and install Customs"
|
||||
echo " before compiling GNU make."
|
||||
echo
|
||||
])])
|
||||
|
||||
AS_IF([test "x$has_wait_nohang" = xno],
|
||||
[ echo
|
||||
echo "WARNING: Your system has neither waitpid() nor wait3()."
|
||||
echo " Without one of these, signal handling is unreliable."
|
||||
echo " You should be aware that running GNU make with -j"
|
||||
echo " could result in erratic behavior."
|
||||
echo
|
||||
])
|
||||
|
||||
AS_IF([test "x$make_cv_job_server" = xno && test "x$user_job_server" = xyes],
|
||||
[ echo
|
||||
echo "WARNING: Make job server requires a POSIX-ish system that"
|
||||
echo " supports the pipe(), sigaction(), and either"
|
||||
echo " waitpid() or wait3() functions. Your system doesn't"
|
||||
echo " appear to provide one or more of those."
|
||||
echo " Disabling job server support."
|
||||
echo
|
||||
])
|
||||
|
||||
AS_IF([test "x$make_cv_load" = xno && test "x$user_load" = xyes],
|
||||
[ echo
|
||||
echo "WARNING: 'load' support requires a POSIX-ish system that"
|
||||
echo " supports the dlopen(), dlsym(), and dlerror() functions."
|
||||
echo " Your system doesn't appear to provide one or more of these."
|
||||
echo " Disabling 'load' support."
|
||||
echo
|
||||
])
|
||||
|
||||
AS_IF([test "x$make_cv_posix_spawn" = xno && test "x$user_posix_spawn" = xyes],
|
||||
[ echo
|
||||
echo "WARNING: posix_spawn() is not supported on this system."
|
||||
echo
|
||||
])
|
||||
|
||||
# autoconf initializes $prefix to NONE.
|
||||
AM_CONDITIONAL([KNOWN_PREFIX],
|
||||
[test "x$prefix" = xNONE -o "x$prefix" = x/usr/local \
|
||||
-o "x$prefix" = x/usr/gnu -o "x$prefix" = x/usr])
|
||||
|
||||
# Specify what files are to be created.
|
||||
AC_CONFIG_FILES([build.cfg tests/config-flags.pm \
|
||||
Makefile lib/Makefile doc/Makefile po/Makefile.in])
|
||||
# We don't need this: the standard automake output suffices for POSIX systems.
|
||||
#mk/Posix.mk
|
||||
|
||||
# Put build.sh in the build directory so it's easy to find
|
||||
AC_CONFIG_LINKS([build.sh:build.sh])
|
||||
|
||||
# OK, do it!
|
||||
|
||||
AC_OUTPUT
|
||||
|
||||
dnl Local Variables:
|
||||
dnl comment-start: "dnl "
|
||||
dnl comment-end: ""
|
||||
dnl comment-start-skip: "\\bdnl\\b\\s *"
|
||||
dnl compile-command: "make configure config.h.in"
|
||||
dnl End:
|
||||
Executable
+16404
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,24 @@
|
||||
# -*-Makefile-*-, or close enough
|
||||
# Copyright (C) 2000-2022 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 3 of the License, 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
|
||||
# this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
TEXI2HTML = texi2html
|
||||
TEXI2HTML_FLAGS = -split_chapter
|
||||
|
||||
info_TEXINFOS = make.texi
|
||||
make_TEXINFOS = fdl.texi make-stds.texi
|
||||
|
||||
CLEANFILES = make*.html
|
||||
@@ -0,0 +1,846 @@
|
||||
# Makefile.in generated by automake 1.18.1 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2025 Free Software Foundation, Inc.
|
||||
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
# -*-Makefile-*-, or close enough
|
||||
# Copyright (C) 2000-2022 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 3 of the License, 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
|
||||
# this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
VPATH = @srcdir@
|
||||
am__is_gnu_make = { \
|
||||
if test -z '$(MAKELEVEL)'; then \
|
||||
false; \
|
||||
elif test -n '$(MAKE_HOST)'; then \
|
||||
true; \
|
||||
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
|
||||
true; \
|
||||
else \
|
||||
false; \
|
||||
fi; \
|
||||
}
|
||||
am__make_running_with_option = \
|
||||
case $${target_option-} in \
|
||||
?) ;; \
|
||||
*) echo "am__make_running_with_option: internal error: invalid" \
|
||||
"target option '$${target_option-}' specified" >&2; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
has_opt=no; \
|
||||
sane_makeflags=$$MAKEFLAGS; \
|
||||
if $(am__is_gnu_make); then \
|
||||
sane_makeflags=$$MFLAGS; \
|
||||
else \
|
||||
case $$MAKEFLAGS in \
|
||||
*\\[\ \ ]*) \
|
||||
bs=\\; \
|
||||
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
|
||||
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
|
||||
esac; \
|
||||
fi; \
|
||||
skip_next=no; \
|
||||
strip_trailopt () \
|
||||
{ \
|
||||
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
|
||||
}; \
|
||||
for flg in $$sane_makeflags; do \
|
||||
test $$skip_next = yes && { skip_next=no; continue; }; \
|
||||
case $$flg in \
|
||||
*=*|--*) continue;; \
|
||||
-*I) strip_trailopt 'I'; skip_next=yes;; \
|
||||
-*I?*) strip_trailopt 'I';; \
|
||||
-*O) strip_trailopt 'O'; skip_next=yes;; \
|
||||
-*O?*) strip_trailopt 'O';; \
|
||||
-*l) strip_trailopt 'l'; skip_next=yes;; \
|
||||
-*l?*) strip_trailopt 'l';; \
|
||||
-[dEDm]) skip_next=yes;; \
|
||||
-[JT]) skip_next=yes;; \
|
||||
esac; \
|
||||
case $$flg in \
|
||||
*$$target_option*) has_opt=yes; break;; \
|
||||
esac; \
|
||||
done; \
|
||||
test $$has_opt = yes
|
||||
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
|
||||
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
|
||||
am__rm_f = rm -f $(am__rm_f_notfound)
|
||||
am__rm_rf = rm -rf $(am__rm_f_notfound)
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
subdir = doc
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \
|
||||
$(top_srcdir)/m4/acinclude.m4 $(top_srcdir)/m4/alloca.m4 \
|
||||
$(top_srcdir)/m4/asm-underscore.m4 \
|
||||
$(top_srcdir)/m4/dospaths.m4 $(top_srcdir)/m4/eaccess.m4 \
|
||||
$(top_srcdir)/m4/extensions.m4 $(top_srcdir)/m4/findprog-in.m4 \
|
||||
$(top_srcdir)/m4/getloadavg.m4 $(top_srcdir)/m4/gettext.m4 \
|
||||
$(top_srcdir)/m4/gnulib-common.m4 \
|
||||
$(top_srcdir)/m4/gnulib-comp.m4 \
|
||||
$(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
|
||||
$(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/largefile.m4 \
|
||||
$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
|
||||
$(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/longlong.m4 \
|
||||
$(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
|
||||
$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/sig_atomic_t.m4 \
|
||||
$(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/warn-on-use.m4 \
|
||||
$(top_srcdir)/m4/year2038.m4 $(top_srcdir)/m4/zzgnulib.m4 \
|
||||
$(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/version.texi \
|
||||
$(srcdir)/stamp-vti $(am__DIST_COMMON)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/src/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
AM_V_P = $(am__v_P_@AM_V@)
|
||||
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
|
||||
am__v_P_0 = false
|
||||
am__v_P_1 = :
|
||||
AM_V_GEN = $(am__v_GEN_@AM_V@)
|
||||
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
|
||||
am__v_GEN_0 = @echo " GEN " $@;
|
||||
am__v_GEN_1 =
|
||||
AM_V_at = $(am__v_at_@AM_V@)
|
||||
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
||||
am__v_at_0 = @
|
||||
am__v_at_1 =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
AM_V_DVIPS = $(am__v_DVIPS_@AM_V@)
|
||||
am__v_DVIPS_ = $(am__v_DVIPS_@AM_DEFAULT_V@)
|
||||
am__v_DVIPS_0 = @echo " DVIPS " $@;
|
||||
am__v_DVIPS_1 =
|
||||
AM_V_MAKEINFO = $(am__v_MAKEINFO_@AM_V@)
|
||||
am__v_MAKEINFO_ = $(am__v_MAKEINFO_@AM_DEFAULT_V@)
|
||||
am__v_MAKEINFO_0 = @echo " MAKEINFO" $@;
|
||||
am__v_MAKEINFO_1 =
|
||||
AM_V_INFOHTML = $(am__v_INFOHTML_@AM_V@)
|
||||
am__v_INFOHTML_ = $(am__v_INFOHTML_@AM_DEFAULT_V@)
|
||||
am__v_INFOHTML_0 = @echo " INFOHTML" $@;
|
||||
am__v_INFOHTML_1 =
|
||||
AM_V_TEXI2DVI = $(am__v_TEXI2DVI_@AM_V@)
|
||||
am__v_TEXI2DVI_ = $(am__v_TEXI2DVI_@AM_DEFAULT_V@)
|
||||
am__v_TEXI2DVI_0 = @echo " TEXI2DVI" $@;
|
||||
am__v_TEXI2DVI_1 =
|
||||
AM_V_TEXI2PDF = $(am__v_TEXI2PDF_@AM_V@)
|
||||
am__v_TEXI2PDF_ = $(am__v_TEXI2PDF_@AM_DEFAULT_V@)
|
||||
am__v_TEXI2PDF_0 = @echo " TEXI2PDF" $@;
|
||||
am__v_TEXI2PDF_1 =
|
||||
AM_V_texinfo = $(am__v_texinfo_@AM_V@)
|
||||
am__v_texinfo_ = $(am__v_texinfo_@AM_DEFAULT_V@)
|
||||
am__v_texinfo_0 = -q
|
||||
am__v_texinfo_1 =
|
||||
AM_V_texidevnull = $(am__v_texidevnull_@AM_V@)
|
||||
am__v_texidevnull_ = $(am__v_texidevnull_@AM_DEFAULT_V@)
|
||||
am__v_texidevnull_0 = > /dev/null
|
||||
am__v_texidevnull_1 =
|
||||
INFO_DEPS = $(srcdir)/make.info
|
||||
TEXINFO_TEX = $(top_srcdir)/build-aux/texinfo.tex
|
||||
am__TEXINFO_TEX_DIR = $(top_srcdir)/build-aux
|
||||
DVIS = make.dvi
|
||||
PDFS = make.pdf
|
||||
PSS = make.ps
|
||||
HTMLS = make.html
|
||||
TEXINFOS = make.texi
|
||||
TEXI2DVI = texi2dvi
|
||||
TEXI2PDF = $(TEXI2DVI) --pdf --batch
|
||||
MAKEINFOHTML = $(MAKEINFO) --html
|
||||
AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS)
|
||||
DVIPS = dvips
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
am__installdirs = "$(DESTDIR)$(infodir)"
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
*) f=$$p;; \
|
||||
esac;
|
||||
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
|
||||
am__install_max = 40
|
||||
am__nobase_strip_setup = \
|
||||
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
|
||||
am__nobase_strip = \
|
||||
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
|
||||
am__nobase_list = $(am__nobase_strip_setup); \
|
||||
for p in $$list; do echo "$$p $$p"; done | \
|
||||
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
|
||||
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
|
||||
if (++n[$$2] == $(am__install_max)) \
|
||||
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
|
||||
END { for (dir in files) print dir, files[dir] }'
|
||||
am__base_list = \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
|
||||
am__uninstall_files_from_dir = { \
|
||||
{ test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|
||||
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
|
||||
$(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \
|
||||
}
|
||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
|
||||
am__DIST_COMMON = $(make_TEXINFOS) $(srcdir)/Makefile.in \
|
||||
$(top_srcdir)/build-aux/mdate-sh \
|
||||
$(top_srcdir)/build-aux/texinfo.tex
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
ALLOCA = @ALLOCA@
|
||||
ALLOCA_H = @ALLOCA_H@
|
||||
AMTAR = @AMTAR@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AM_LDFLAGS = @AM_LDFLAGS@
|
||||
AR = @AR@
|
||||
ARFLAGS = @ARFLAGS@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CSCOPE = @CSCOPE@
|
||||
CTAGS = @CTAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
ETAGS = @ETAGS@
|
||||
EXEEXT = @EXEEXT@
|
||||
GETLOADAVG_LIBS = @GETLOADAVG_LIBS@
|
||||
GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
|
||||
GL_CFLAG_ALLOW_WARNINGS = @GL_CFLAG_ALLOW_WARNINGS@
|
||||
GL_CFLAG_GNULIB_WARNINGS = @GL_CFLAG_GNULIB_WARNINGS@
|
||||
GL_GNULIB_GETLOADAVG = @GL_GNULIB_GETLOADAVG@
|
||||
GMSGFMT = @GMSGFMT@
|
||||
GMSGFMT_015 = @GMSGFMT_015@
|
||||
GUILE_CFLAGS = @GUILE_CFLAGS@
|
||||
GUILE_LIBS = @GUILE_LIBS@
|
||||
HAVE_ALLOCA_H = @HAVE_ALLOCA_H@
|
||||
HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
|
||||
HAVE__BOOL = @HAVE__BOOL@
|
||||
HOST_CPU = @HOST_CPU@
|
||||
HOST_CPU_C_ABI = @HOST_CPU_C_ABI@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
INTLLIBS = @INTLLIBS@
|
||||
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBGNU_LIBDEPS = @LIBGNU_LIBDEPS@
|
||||
LIBGNU_LTLIBDEPS = @LIBGNU_LTLIBDEPS@
|
||||
LIBICONV = @LIBICONV@
|
||||
LIBINTL = @LIBINTL@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LTLIBICONV = @LTLIBICONV@
|
||||
LTLIBINTL = @LTLIBINTL@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MAKE_HOST = @MAKE_HOST@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
MSGFMT = @MSGFMT@
|
||||
MSGFMT_015 = @MSGFMT_015@
|
||||
MSGMERGE = @MSGMERGE@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PERL = @PERL@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
|
||||
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
|
||||
POSUB = @POSUB@
|
||||
RANLIB = @RANLIB@
|
||||
REMOTE = @REMOTE@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STDBOOL_H = @STDBOOL_H@
|
||||
STRIP = @STRIP@
|
||||
USE_NLS = @USE_NLS@
|
||||
USE_SYSTEM_GLOB = @USE_SYSTEM_GLOB@
|
||||
VERSION = @VERSION@
|
||||
XGETTEXT = @XGETTEXT@
|
||||
XGETTEXT_015 = @XGETTEXT_015@
|
||||
XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__rm_f_notfound = @am__rm_f_notfound@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
am__xargs_n = @am__xargs_n@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
gl_LIBOBJDEPS = @gl_LIBOBJDEPS@
|
||||
gl_LIBOBJS = @gl_LIBOBJS@
|
||||
gl_LTLIBOBJS = @gl_LTLIBOBJS@
|
||||
gltests_LIBOBJDEPS = @gltests_LIBOBJDEPS@
|
||||
gltests_LIBOBJS = @gltests_LIBOBJS@
|
||||
gltests_LTLIBOBJS = @gltests_LTLIBOBJS@
|
||||
gltests_WITNESS = @gltests_WITNESS@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
runstatedir = @runstatedir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
TEXI2HTML = texi2html
|
||||
TEXI2HTML_FLAGS = -split_chapter
|
||||
info_TEXINFOS = make.texi
|
||||
make_TEXINFOS = fdl.texi make-stds.texi
|
||||
CLEANFILES = make*.html
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .dvi .html .info .pdf .ps .texi
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
||||
&& { if test -f $@; then exit 0; else break; fi; }; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign doc/Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
|
||||
.texi.info:
|
||||
$(AM_V_MAKEINFO)restore=: && backupdir="$(am__leading_dot)am$$$$" && \
|
||||
am__cwd=`pwd` && $(am__cd) $(srcdir) && \
|
||||
rm -rf $$backupdir && mkdir $$backupdir && \
|
||||
if ($(MAKEINFO) --version) >/dev/null 2>&1; then \
|
||||
for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \
|
||||
if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \
|
||||
done; \
|
||||
else :; fi && \
|
||||
cd "$$am__cwd"; \
|
||||
if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
|
||||
-o $@ $<; \
|
||||
then \
|
||||
rc=0; \
|
||||
$(am__cd) $(srcdir); \
|
||||
else \
|
||||
rc=$$?; \
|
||||
$(am__cd) $(srcdir) && \
|
||||
$$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \
|
||||
fi; \
|
||||
rm -rf $$backupdir; exit $$rc
|
||||
|
||||
.texi.dvi:
|
||||
$(AM_V_TEXI2DVI)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
|
||||
MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
|
||||
$(TEXI2DVI) $(AM_TEXI2FLAGS) -I $(srcdir) $(AM_V_texinfo) --build-dir=$(@:.dvi=.t2d) -o $@ $(AM_V_texidevnull) \
|
||||
$<
|
||||
|
||||
.texi.pdf:
|
||||
$(AM_V_TEXI2PDF)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
|
||||
MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
|
||||
$(TEXI2PDF) $(AM_TEXI2FLAGS) -I $(srcdir) $(AM_V_texinfo) --build-dir=$(@:.pdf=.t2p) -o $@ $(AM_V_texidevnull) \
|
||||
$<
|
||||
|
||||
.texi.html:
|
||||
$(AM_V_MAKEINFO)rm -rf $(@:.html=.htp)
|
||||
$(AM_V_at)if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
|
||||
-o $(@:.html=.htp) $<; \
|
||||
then \
|
||||
rm -rf $@ && mv $(@:.html=.htp) $@; \
|
||||
else \
|
||||
rm -rf $(@:.html=.htp); exit 1; \
|
||||
fi
|
||||
$(srcdir)/make.info: make.texi $(srcdir)/version.texi $(make_TEXINFOS)
|
||||
make.dvi: make.texi $(srcdir)/version.texi $(make_TEXINFOS)
|
||||
make.pdf: make.texi $(srcdir)/version.texi $(make_TEXINFOS)
|
||||
make.html: make.texi $(srcdir)/version.texi $(make_TEXINFOS)
|
||||
$(srcdir)/version.texi: $(srcdir)/stamp-vti
|
||||
$(srcdir)/stamp-vti: make.texi $(top_srcdir)/configure
|
||||
@(dir=.; test -f ./make.texi || dir=$(srcdir); \
|
||||
set `$(SHELL) $(top_srcdir)/build-aux/mdate-sh $$dir/make.texi`; \
|
||||
echo "@set UPDATED $$1 $$2 $$3"; \
|
||||
echo "@set UPDATED-MONTH $$2 $$3"; \
|
||||
echo "@set EDITION $(VERSION)"; \
|
||||
echo "@set VERSION $(VERSION)") > vti.tmp$$$$ && \
|
||||
(cmp -s vti.tmp$$$$ $(srcdir)/version.texi \
|
||||
|| (echo "Updating $(srcdir)/version.texi" && \
|
||||
cp vti.tmp$$$$ $(srcdir)/version.texi.tmp$$$$ && \
|
||||
mv $(srcdir)/version.texi.tmp$$$$ $(srcdir)/version.texi)) && \
|
||||
rm -f vti.tmp$$$$ $(srcdir)/version.texi.$$$$
|
||||
@cp $(srcdir)/version.texi $@
|
||||
|
||||
mostlyclean-vti:
|
||||
-rm -f vti.tmp* $(srcdir)/version.texi.tmp*
|
||||
|
||||
maintainer-clean-vti:
|
||||
-rm -f $(srcdir)/stamp-vti $(srcdir)/version.texi
|
||||
.dvi.ps:
|
||||
$(AM_V_DVIPS)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
|
||||
$(DVIPS) $(AM_V_texinfo) -o $@ $<
|
||||
|
||||
uninstall-dvi-am:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(DVIS)'; test -n "$(dvidir)" || list=; \
|
||||
for p in $$list; do \
|
||||
$(am__strip_dir) \
|
||||
echo " rm -f '$(DESTDIR)$(dvidir)/$$f'"; \
|
||||
rm -f "$(DESTDIR)$(dvidir)/$$f"; \
|
||||
done
|
||||
|
||||
uninstall-html-am:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(HTMLS)'; test -n "$(htmldir)" || list=; \
|
||||
for p in $$list; do \
|
||||
$(am__strip_dir) \
|
||||
echo " rm -rf '$(DESTDIR)$(htmldir)/$$f'"; \
|
||||
rm -rf "$(DESTDIR)$(htmldir)/$$f"; \
|
||||
done
|
||||
|
||||
uninstall-info-am:
|
||||
@$(PRE_UNINSTALL)
|
||||
@if test -d '$(DESTDIR)$(infodir)' && $(am__can_run_installinfo); then \
|
||||
list='$(INFO_DEPS)'; \
|
||||
for file in $$list; do \
|
||||
relfile=`echo "$$file" | sed 's|^.*/||'`; \
|
||||
echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'"; \
|
||||
if install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \
|
||||
then :; else test ! -f "$(DESTDIR)$(infodir)/$$relfile" || exit 1; fi; \
|
||||
done; \
|
||||
else :; fi
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(INFO_DEPS)'; \
|
||||
for file in $$list; do \
|
||||
relfile=`echo "$$file" | sed 's|^.*/||'`; \
|
||||
relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \
|
||||
(if test -d "$(DESTDIR)$(infodir)" && cd "$(DESTDIR)$(infodir)"; then \
|
||||
echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]"; \
|
||||
rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \
|
||||
else :; fi); \
|
||||
done
|
||||
|
||||
uninstall-pdf-am:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(PDFS)'; test -n "$(pdfdir)" || list=; \
|
||||
for p in $$list; do \
|
||||
$(am__strip_dir) \
|
||||
echo " rm -f '$(DESTDIR)$(pdfdir)/$$f'"; \
|
||||
rm -f "$(DESTDIR)$(pdfdir)/$$f"; \
|
||||
done
|
||||
|
||||
uninstall-ps-am:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(PSS)'; test -n "$(psdir)" || list=; \
|
||||
for p in $$list; do \
|
||||
$(am__strip_dir) \
|
||||
echo " rm -f '$(DESTDIR)$(psdir)/$$f'"; \
|
||||
rm -f "$(DESTDIR)$(psdir)/$$f"; \
|
||||
done
|
||||
|
||||
dist-info: $(INFO_DEPS)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
|
||||
list='$(INFO_DEPS)'; \
|
||||
for base in $$list; do \
|
||||
case $$base in \
|
||||
$(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
esac; \
|
||||
if test -f $$base; then d=.; else d=$(srcdir); fi; \
|
||||
base_i=`echo "$$base" | sed 's|\.info$$||;s|$$|.i|'`; \
|
||||
for file in $$d/$$base $$d/$$base-[0-9] $$d/$$base-[0-9][0-9] $$d/$$base_i[0-9] $$d/$$base_i[0-9][0-9]; do \
|
||||
if test -f $$file; then \
|
||||
relfile=`expr "$$file" : "$$d/\(.*\)"`; \
|
||||
test -f "$(distdir)/$$relfile" || \
|
||||
cp -p $$file "$(distdir)/$$relfile"; \
|
||||
else :; fi; \
|
||||
done; \
|
||||
done
|
||||
|
||||
mostlyclean-aminfo:
|
||||
-$(am__rm_rf) make.t2d make.t2p
|
||||
|
||||
clean-aminfo:
|
||||
-$(am__rm_rf) make.dvi make.pdf make.ps make.html
|
||||
|
||||
maintainer-clean-aminfo:
|
||||
@list='$(INFO_DEPS)'; for i in $$list; do \
|
||||
i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \
|
||||
echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \
|
||||
rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \
|
||||
done
|
||||
tags TAGS:
|
||||
|
||||
ctags CTAGS:
|
||||
|
||||
cscope cscopelist:
|
||||
|
||||
|
||||
distdir: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
||||
|
||||
distdir-am: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d "$(distdir)/$$file"; then \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
||||
else \
|
||||
test -f "$(distdir)/$$file" \
|
||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
$(MAKE) $(AM_MAKEFLAGS) \
|
||||
top_distdir="$(top_distdir)" distdir="$(distdir)" \
|
||||
dist-info
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(INFO_DEPS)
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(infodir)"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
done
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
if test -z '$(STRIP)'; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
install; \
|
||||
else \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
||||
fi
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
-$(am__rm_f) $(CLEANFILES)
|
||||
|
||||
distclean-generic:
|
||||
-$(am__rm_f) $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-aminfo clean-generic mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am: $(DVIS)
|
||||
|
||||
html: html-am
|
||||
|
||||
html-am: $(HTMLS)
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am: $(INFO_DEPS)
|
||||
|
||||
install-data-am: install-info-am
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-dvi-am: $(DVIS)
|
||||
@$(NORMAL_INSTALL)
|
||||
@list='$(DVIS)'; test -n "$(dvidir)" || list=; \
|
||||
if test -n "$$list"; then \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(dvidir)'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(dvidir)" || exit 1; \
|
||||
fi; \
|
||||
for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
echo "$$d$$p"; \
|
||||
done | $(am__base_list) | \
|
||||
while read files; do \
|
||||
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(dvidir)'"; \
|
||||
$(INSTALL_DATA) $$files "$(DESTDIR)$(dvidir)" || exit $$?; \
|
||||
done
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-html-am: $(HTMLS)
|
||||
@$(NORMAL_INSTALL)
|
||||
@list='$(HTMLS)'; list2=; test -n "$(htmldir)" || list=; \
|
||||
if test -n "$$list"; then \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(htmldir)" || exit 1; \
|
||||
fi; \
|
||||
for p in $$list; do \
|
||||
if test -f "$$p" || test -d "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
$(am__strip_dir) \
|
||||
d2=$$d$$p; \
|
||||
if test -d "$$d2"; then \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)/$$f'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \
|
||||
echo " $(INSTALL_DATA) '$$d2'/* '$(DESTDIR)$(htmldir)/$$f'"; \
|
||||
$(INSTALL_DATA) "$$d2"/* "$(DESTDIR)$(htmldir)/$$f" || exit $$?; \
|
||||
else \
|
||||
list2="$$list2 $$d2"; \
|
||||
fi; \
|
||||
done; \
|
||||
test -z "$$list2" || { echo "$$list2" | $(am__base_list) | \
|
||||
while read files; do \
|
||||
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(htmldir)'"; \
|
||||
$(INSTALL_DATA) $$files "$(DESTDIR)$(htmldir)" || exit $$?; \
|
||||
done; }
|
||||
install-info: install-info-am
|
||||
|
||||
install-info-am: $(INFO_DEPS)
|
||||
@$(NORMAL_INSTALL)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
|
||||
list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \
|
||||
if test -n "$$list"; then \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(infodir)'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(infodir)" || exit 1; \
|
||||
fi; \
|
||||
for file in $$list; do \
|
||||
case $$file in \
|
||||
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
esac; \
|
||||
if test -f $$file; then d=.; else d=$(srcdir); fi; \
|
||||
file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \
|
||||
for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \
|
||||
$$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \
|
||||
if test -f $$ifile; then \
|
||||
echo "$$ifile"; \
|
||||
else : ; fi; \
|
||||
done; \
|
||||
done | $(am__base_list) | \
|
||||
while read files; do \
|
||||
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(infodir)'"; \
|
||||
$(INSTALL_DATA) $$files "$(DESTDIR)$(infodir)" || exit $$?; done
|
||||
@$(POST_INSTALL)
|
||||
@if $(am__can_run_installinfo); then \
|
||||
list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \
|
||||
for file in $$list; do \
|
||||
relfile=`echo "$$file" | sed 's|^.*/||'`; \
|
||||
echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\
|
||||
install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\
|
||||
done; \
|
||||
else : ; fi
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-pdf-am: $(PDFS)
|
||||
@$(NORMAL_INSTALL)
|
||||
@list='$(PDFS)'; test -n "$(pdfdir)" || list=; \
|
||||
if test -n "$$list"; then \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(pdfdir)'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(pdfdir)" || exit 1; \
|
||||
fi; \
|
||||
for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
echo "$$d$$p"; \
|
||||
done | $(am__base_list) | \
|
||||
while read files; do \
|
||||
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pdfdir)'"; \
|
||||
$(INSTALL_DATA) $$files "$(DESTDIR)$(pdfdir)" || exit $$?; done
|
||||
install-ps: install-ps-am
|
||||
|
||||
install-ps-am: $(PSS)
|
||||
@$(NORMAL_INSTALL)
|
||||
@list='$(PSS)'; test -n "$(psdir)" || list=; \
|
||||
if test -n "$$list"; then \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(psdir)'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(psdir)" || exit 1; \
|
||||
fi; \
|
||||
for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
echo "$$d$$p"; \
|
||||
done | $(am__base_list) | \
|
||||
while read files; do \
|
||||
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(psdir)'"; \
|
||||
$(INSTALL_DATA) $$files "$(DESTDIR)$(psdir)" || exit $$?; done
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-aminfo \
|
||||
maintainer-clean-generic maintainer-clean-vti
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-aminfo mostlyclean-generic mostlyclean-vti
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am: $(PDFS)
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am: $(PSS)
|
||||
|
||||
uninstall-am: uninstall-dvi-am uninstall-html-am uninstall-info-am \
|
||||
uninstall-pdf-am uninstall-ps-am
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: all all-am check check-am clean clean-aminfo clean-generic \
|
||||
cscopelist-am ctags-am dist-info distclean distclean-generic \
|
||||
distdir dvi dvi-am html html-am info info-am install \
|
||||
install-am install-data install-data-am install-dvi \
|
||||
install-dvi-am install-exec install-exec-am install-html \
|
||||
install-html-am install-info install-info-am install-man \
|
||||
install-pdf install-pdf-am install-ps install-ps-am \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
maintainer-clean maintainer-clean-aminfo \
|
||||
maintainer-clean-generic maintainer-clean-vti mostlyclean \
|
||||
mostlyclean-aminfo mostlyclean-generic mostlyclean-vti pdf \
|
||||
pdf-am ps ps-am tags-am uninstall uninstall-am \
|
||||
uninstall-dvi-am uninstall-html-am uninstall-info-am \
|
||||
uninstall-pdf-am uninstall-ps-am
|
||||
|
||||
.PRECIOUS: Makefile
|
||||
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
|
||||
# Tell GNU make to disable its built-in pattern rules.
|
||||
%:: %,v
|
||||
%:: RCS/%,v
|
||||
%:: RCS/%
|
||||
%:: s.%
|
||||
%:: SCCS/s.%
|
||||
@@ -0,0 +1,505 @@
|
||||
@c The GNU Free Documentation License.
|
||||
@center Version 1.3, 3 November 2008
|
||||
|
||||
@c This file is intended to be included within another document,
|
||||
@c hence no sectioning command or @node.
|
||||
|
||||
@display
|
||||
Copyright @copyright{} 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
|
||||
@uref{https://fsf.org/}
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
@end display
|
||||
|
||||
@enumerate 0
|
||||
@item
|
||||
PREAMBLE
|
||||
|
||||
The purpose of this License is to make a manual, textbook, or other
|
||||
functional and useful document @dfn{free} in the sense of freedom: to
|
||||
assure everyone the effective freedom to copy and redistribute it,
|
||||
with or without modifying it, either commercially or noncommercially.
|
||||
Secondarily, this License preserves for the author and publisher a way
|
||||
to get credit for their work, while not being considered responsible
|
||||
for modifications made by others.
|
||||
|
||||
This License is a kind of ``copyleft'', which means that derivative
|
||||
works of the document must themselves be free in the same sense. It
|
||||
complements the GNU General Public License, which is a copyleft
|
||||
license designed for free software.
|
||||
|
||||
We have designed this License in order to use it for manuals for free
|
||||
software, because free software needs free documentation: a free
|
||||
program should come with manuals providing the same freedoms that the
|
||||
software does. But this License is not limited to software manuals;
|
||||
it can be used for any textual work, regardless of subject matter or
|
||||
whether it is published as a printed book. We recommend this License
|
||||
principally for works whose purpose is instruction or reference.
|
||||
|
||||
@item
|
||||
APPLICABILITY AND DEFINITIONS
|
||||
|
||||
This License applies to any manual or other work, in any medium, that
|
||||
contains a notice placed by the copyright holder saying it can be
|
||||
distributed under the terms of this License. Such a notice grants a
|
||||
world-wide, royalty-free license, unlimited in duration, to use that
|
||||
work under the conditions stated herein. The ``Document'', below,
|
||||
refers to any such manual or work. Any member of the public is a
|
||||
licensee, and is addressed as ``you''. You accept the license if you
|
||||
copy, modify or distribute the work in a way requiring permission
|
||||
under copyright law.
|
||||
|
||||
A ``Modified Version'' of the Document means any work containing the
|
||||
Document or a portion of it, either copied verbatim, or with
|
||||
modifications and/or translated into another language.
|
||||
|
||||
A ``Secondary Section'' is a named appendix or a front-matter section
|
||||
of the Document that deals exclusively with the relationship of the
|
||||
publishers or authors of the Document to the Document's overall
|
||||
subject (or to related matters) and contains nothing that could fall
|
||||
directly within that overall subject. (Thus, if the Document is in
|
||||
part a textbook of mathematics, a Secondary Section may not explain
|
||||
any mathematics.) The relationship could be a matter of historical
|
||||
connection with the subject or with related matters, or of legal,
|
||||
commercial, philosophical, ethical or political position regarding
|
||||
them.
|
||||
|
||||
The ``Invariant Sections'' are certain Secondary Sections whose titles
|
||||
are designated, as being those of Invariant Sections, in the notice
|
||||
that says that the Document is released under this License. If a
|
||||
section does not fit the above definition of Secondary then it is not
|
||||
allowed to be designated as Invariant. The Document may contain zero
|
||||
Invariant Sections. If the Document does not identify any Invariant
|
||||
Sections then there are none.
|
||||
|
||||
The ``Cover Texts'' are certain short passages of text that are listed,
|
||||
as Front-Cover Texts or Back-Cover Texts, in the notice that says that
|
||||
the Document is released under this License. A Front-Cover Text may
|
||||
be at most 5 words, and a Back-Cover Text may be at most 25 words.
|
||||
|
||||
A ``Transparent'' copy of the Document means a machine-readable copy,
|
||||
represented in a format whose specification is available to the
|
||||
general public, that is suitable for revising the document
|
||||
straightforwardly with generic text editors or (for images composed of
|
||||
pixels) generic paint programs or (for drawings) some widely available
|
||||
drawing editor, and that is suitable for input to text formatters or
|
||||
for automatic translation to a variety of formats suitable for input
|
||||
to text formatters. A copy made in an otherwise Transparent file
|
||||
format whose markup, or absence of markup, has been arranged to thwart
|
||||
or discourage subsequent modification by readers is not Transparent.
|
||||
An image format is not Transparent if used for any substantial amount
|
||||
of text. A copy that is not ``Transparent'' is called ``Opaque''.
|
||||
|
||||
Examples of suitable formats for Transparent copies include plain
|
||||
ASCII without markup, Texinfo input format, La@TeX{} input
|
||||
format, SGML or XML using a publicly available
|
||||
DTD, and standard-conforming simple HTML,
|
||||
PostScript or PDF designed for human modification. Examples
|
||||
of transparent image formats include PNG, XCF and
|
||||
JPG@. Opaque formats include proprietary formats that can be
|
||||
read and edited only by proprietary word processors, SGML or
|
||||
XML for which the DTD and/or processing tools are
|
||||
not generally available, and the machine-generated HTML,
|
||||
PostScript or PDF produced by some word processors for
|
||||
output purposes only.
|
||||
|
||||
The ``Title Page'' means, for a printed book, the title page itself,
|
||||
plus such following pages as are needed to hold, legibly, the material
|
||||
this License requires to appear in the title page. For works in
|
||||
formats which do not have any title page as such, ``Title Page'' means
|
||||
the text near the most prominent appearance of the work's title,
|
||||
preceding the beginning of the body of the text.
|
||||
|
||||
The ``publisher'' means any person or entity that distributes copies
|
||||
of the Document to the public.
|
||||
|
||||
A section ``Entitled XYZ'' means a named subunit of the Document whose
|
||||
title either is precisely XYZ or contains XYZ in parentheses following
|
||||
text that translates XYZ in another language. (Here XYZ stands for a
|
||||
specific section name mentioned below, such as ``Acknowledgements'',
|
||||
``Dedications'', ``Endorsements'', or ``History''.) To ``Preserve the Title''
|
||||
of such a section when you modify the Document means that it remains a
|
||||
section ``Entitled XYZ'' according to this definition.
|
||||
|
||||
The Document may include Warranty Disclaimers next to the notice which
|
||||
states that this License applies to the Document. These Warranty
|
||||
Disclaimers are considered to be included by reference in this
|
||||
License, but only as regards disclaiming warranties: any other
|
||||
implication that these Warranty Disclaimers may have is void and has
|
||||
no effect on the meaning of this License.
|
||||
|
||||
@item
|
||||
VERBATIM COPYING
|
||||
|
||||
You may copy and distribute the Document in any medium, either
|
||||
commercially or noncommercially, provided that this License, the
|
||||
copyright notices, and the license notice saying this License applies
|
||||
to the Document are reproduced in all copies, and that you add no other
|
||||
conditions whatsoever to those of this License. You may not use
|
||||
technical measures to obstruct or control the reading or further
|
||||
copying of the copies you make or distribute. However, you may accept
|
||||
compensation in exchange for copies. If you distribute a large enough
|
||||
number of copies you must also follow the conditions in section 3.
|
||||
|
||||
You may also lend copies, under the same conditions stated above, and
|
||||
you may publicly display copies.
|
||||
|
||||
@item
|
||||
COPYING IN QUANTITY
|
||||
|
||||
If you publish printed copies (or copies in media that commonly have
|
||||
printed covers) of the Document, numbering more than 100, and the
|
||||
Document's license notice requires Cover Texts, you must enclose the
|
||||
copies in covers that carry, clearly and legibly, all these Cover
|
||||
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
|
||||
the back cover. Both covers must also clearly and legibly identify
|
||||
you as the publisher of these copies. The front cover must present
|
||||
the full title with all words of the title equally prominent and
|
||||
visible. You may add other material on the covers in addition.
|
||||
Copying with changes limited to the covers, as long as they preserve
|
||||
the title of the Document and satisfy these conditions, can be treated
|
||||
as verbatim copying in other respects.
|
||||
|
||||
If the required texts for either cover are too voluminous to fit
|
||||
legibly, you should put the first ones listed (as many as fit
|
||||
reasonably) on the actual cover, and continue the rest onto adjacent
|
||||
pages.
|
||||
|
||||
If you publish or distribute Opaque copies of the Document numbering
|
||||
more than 100, you must either include a machine-readable Transparent
|
||||
copy along with each Opaque copy, or state in or with each Opaque copy
|
||||
a computer-network location from which the general network-using
|
||||
public has access to download using public-standard network protocols
|
||||
a complete Transparent copy of the Document, free of added material.
|
||||
If you use the latter option, you must take reasonably prudent steps,
|
||||
when you begin distribution of Opaque copies in quantity, to ensure
|
||||
that this Transparent copy will remain thus accessible at the stated
|
||||
location until at least one year after the last time you distribute an
|
||||
Opaque copy (directly or through your agents or retailers) of that
|
||||
edition to the public.
|
||||
|
||||
It is requested, but not required, that you contact the authors of the
|
||||
Document well before redistributing any large number of copies, to give
|
||||
them a chance to provide you with an updated version of the Document.
|
||||
|
||||
@item
|
||||
MODIFICATIONS
|
||||
|
||||
You may copy and distribute a Modified Version of the Document under
|
||||
the conditions of sections 2 and 3 above, provided that you release
|
||||
the Modified Version under precisely this License, with the Modified
|
||||
Version filling the role of the Document, thus licensing distribution
|
||||
and modification of the Modified Version to whoever possesses a copy
|
||||
of it. In addition, you must do these things in the Modified Version:
|
||||
|
||||
@enumerate A
|
||||
@item
|
||||
Use in the Title Page (and on the covers, if any) a title distinct
|
||||
from that of the Document, and from those of previous versions
|
||||
(which should, if there were any, be listed in the History section
|
||||
of the Document). You may use the same title as a previous version
|
||||
if the original publisher of that version gives permission.
|
||||
|
||||
@item
|
||||
List on the Title Page, as authors, one or more persons or entities
|
||||
responsible for authorship of the modifications in the Modified
|
||||
Version, together with at least five of the principal authors of the
|
||||
Document (all of its principal authors, if it has fewer than five),
|
||||
unless they release you from this requirement.
|
||||
|
||||
@item
|
||||
State on the Title page the name of the publisher of the
|
||||
Modified Version, as the publisher.
|
||||
|
||||
@item
|
||||
Preserve all the copyright notices of the Document.
|
||||
|
||||
@item
|
||||
Add an appropriate copyright notice for your modifications
|
||||
adjacent to the other copyright notices.
|
||||
|
||||
@item
|
||||
Include, immediately after the copyright notices, a license notice
|
||||
giving the public permission to use the Modified Version under the
|
||||
terms of this License, in the form shown in the Addendum below.
|
||||
|
||||
@item
|
||||
Preserve in that license notice the full lists of Invariant Sections
|
||||
and required Cover Texts given in the Document's license notice.
|
||||
|
||||
@item
|
||||
Include an unaltered copy of this License.
|
||||
|
||||
@item
|
||||
Preserve the section Entitled ``History'', Preserve its Title, and add
|
||||
to it an item stating at least the title, year, new authors, and
|
||||
publisher of the Modified Version as given on the Title Page. If
|
||||
there is no section Entitled ``History'' in the Document, create one
|
||||
stating the title, year, authors, and publisher of the Document as
|
||||
given on its Title Page, then add an item describing the Modified
|
||||
Version as stated in the previous sentence.
|
||||
|
||||
@item
|
||||
Preserve the network location, if any, given in the Document for
|
||||
public access to a Transparent copy of the Document, and likewise
|
||||
the network locations given in the Document for previous versions
|
||||
it was based on. These may be placed in the ``History'' section.
|
||||
You may omit a network location for a work that was published at
|
||||
least four years before the Document itself, or if the original
|
||||
publisher of the version it refers to gives permission.
|
||||
|
||||
@item
|
||||
For any section Entitled ``Acknowledgements'' or ``Dedications'', Preserve
|
||||
the Title of the section, and preserve in the section all the
|
||||
substance and tone of each of the contributor acknowledgements and/or
|
||||
dedications given therein.
|
||||
|
||||
@item
|
||||
Preserve all the Invariant Sections of the Document,
|
||||
unaltered in their text and in their titles. Section numbers
|
||||
or the equivalent are not considered part of the section titles.
|
||||
|
||||
@item
|
||||
Delete any section Entitled ``Endorsements''. Such a section
|
||||
may not be included in the Modified Version.
|
||||
|
||||
@item
|
||||
Do not retitle any existing section to be Entitled ``Endorsements'' or
|
||||
to conflict in title with any Invariant Section.
|
||||
|
||||
@item
|
||||
Preserve any Warranty Disclaimers.
|
||||
@end enumerate
|
||||
|
||||
If the Modified Version includes new front-matter sections or
|
||||
appendices that qualify as Secondary Sections and contain no material
|
||||
copied from the Document, you may at your option designate some or all
|
||||
of these sections as invariant. To do this, add their titles to the
|
||||
list of Invariant Sections in the Modified Version's license notice.
|
||||
These titles must be distinct from any other section titles.
|
||||
|
||||
You may add a section Entitled ``Endorsements'', provided it contains
|
||||
nothing but endorsements of your Modified Version by various
|
||||
parties---for example, statements of peer review or that the text has
|
||||
been approved by an organization as the authoritative definition of a
|
||||
standard.
|
||||
|
||||
You may add a passage of up to five words as a Front-Cover Text, and a
|
||||
passage of up to 25 words as a Back-Cover Text, to the end of the list
|
||||
of Cover Texts in the Modified Version. Only one passage of
|
||||
Front-Cover Text and one of Back-Cover Text may be added by (or
|
||||
through arrangements made by) any one entity. If the Document already
|
||||
includes a cover text for the same cover, previously added by you or
|
||||
by arrangement made by the same entity you are acting on behalf of,
|
||||
you may not add another; but you may replace the old one, on explicit
|
||||
permission from the previous publisher that added the old one.
|
||||
|
||||
The author(s) and publisher(s) of the Document do not by this License
|
||||
give permission to use their names for publicity for or to assert or
|
||||
imply endorsement of any Modified Version.
|
||||
|
||||
@item
|
||||
COMBINING DOCUMENTS
|
||||
|
||||
You may combine the Document with other documents released under this
|
||||
License, under the terms defined in section 4 above for modified
|
||||
versions, provided that you include in the combination all of the
|
||||
Invariant Sections of all of the original documents, unmodified, and
|
||||
list them all as Invariant Sections of your combined work in its
|
||||
license notice, and that you preserve all their Warranty Disclaimers.
|
||||
|
||||
The combined work need only contain one copy of this License, and
|
||||
multiple identical Invariant Sections may be replaced with a single
|
||||
copy. If there are multiple Invariant Sections with the same name but
|
||||
different contents, make the title of each such section unique by
|
||||
adding at the end of it, in parentheses, the name of the original
|
||||
author or publisher of that section if known, or else a unique number.
|
||||
Make the same adjustment to the section titles in the list of
|
||||
Invariant Sections in the license notice of the combined work.
|
||||
|
||||
In the combination, you must combine any sections Entitled ``History''
|
||||
in the various original documents, forming one section Entitled
|
||||
``History''; likewise combine any sections Entitled ``Acknowledgements'',
|
||||
and any sections Entitled ``Dedications''. You must delete all
|
||||
sections Entitled ``Endorsements.''
|
||||
|
||||
@item
|
||||
COLLECTIONS OF DOCUMENTS
|
||||
|
||||
You may make a collection consisting of the Document and other documents
|
||||
released under this License, and replace the individual copies of this
|
||||
License in the various documents with a single copy that is included in
|
||||
the collection, provided that you follow the rules of this License for
|
||||
verbatim copying of each of the documents in all other respects.
|
||||
|
||||
You may extract a single document from such a collection, and distribute
|
||||
it individually under this License, provided you insert a copy of this
|
||||
License into the extracted document, and follow this License in all
|
||||
other respects regarding verbatim copying of that document.
|
||||
|
||||
@item
|
||||
AGGREGATION WITH INDEPENDENT WORKS
|
||||
|
||||
A compilation of the Document or its derivatives with other separate
|
||||
and independent documents or works, in or on a volume of a storage or
|
||||
distribution medium, is called an ``aggregate'' if the copyright
|
||||
resulting from the compilation is not used to limit the legal rights
|
||||
of the compilation's users beyond what the individual works permit.
|
||||
When the Document is included in an aggregate, this License does not
|
||||
apply to the other works in the aggregate which are not themselves
|
||||
derivative works of the Document.
|
||||
|
||||
If the Cover Text requirement of section 3 is applicable to these
|
||||
copies of the Document, then if the Document is less than one half of
|
||||
the entire aggregate, the Document's Cover Texts may be placed on
|
||||
covers that bracket the Document within the aggregate, or the
|
||||
electronic equivalent of covers if the Document is in electronic form.
|
||||
Otherwise they must appear on printed covers that bracket the whole
|
||||
aggregate.
|
||||
|
||||
@item
|
||||
TRANSLATION
|
||||
|
||||
Translation is considered a kind of modification, so you may
|
||||
distribute translations of the Document under the terms of section 4.
|
||||
Replacing Invariant Sections with translations requires special
|
||||
permission from their copyright holders, but you may include
|
||||
translations of some or all Invariant Sections in addition to the
|
||||
original versions of these Invariant Sections. You may include a
|
||||
translation of this License, and all the license notices in the
|
||||
Document, and any Warranty Disclaimers, provided that you also include
|
||||
the original English version of this License and the original versions
|
||||
of those notices and disclaimers. In case of a disagreement between
|
||||
the translation and the original version of this License or a notice
|
||||
or disclaimer, the original version will prevail.
|
||||
|
||||
If a section in the Document is Entitled ``Acknowledgements'',
|
||||
``Dedications'', or ``History'', the requirement (section 4) to Preserve
|
||||
its Title (section 1) will typically require changing the actual
|
||||
title.
|
||||
|
||||
@item
|
||||
TERMINATION
|
||||
|
||||
You may not copy, modify, sublicense, or distribute the Document
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense, or distribute it is void, and
|
||||
will automatically terminate your rights under this License.
|
||||
|
||||
However, if you cease all violation of this License, then your license
|
||||
from a particular copyright holder is reinstated (a) provisionally,
|
||||
unless and until the copyright holder explicitly and finally
|
||||
terminates your license, and (b) permanently, if the copyright holder
|
||||
fails to notify you of the violation by some reasonable means prior to
|
||||
60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, receipt of a copy of some or all of the same material does
|
||||
not give you any rights to use it.
|
||||
|
||||
@item
|
||||
FUTURE REVISIONS OF THIS LICENSE
|
||||
|
||||
The Free Software Foundation may publish new, revised versions
|
||||
of the GNU Free Documentation 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. See
|
||||
@uref{https://www.gnu.org/licenses/}.
|
||||
|
||||
Each version of the License is given a distinguishing version number.
|
||||
If the Document specifies that a particular numbered version of this
|
||||
License ``or any later version'' applies to it, you have the option of
|
||||
following the terms and conditions either of that specified version or
|
||||
of any later version that has been published (not as a draft) by the
|
||||
Free Software Foundation. If the Document does not specify a version
|
||||
number of this License, you may choose any version ever published (not
|
||||
as a draft) by the Free Software Foundation. If the Document
|
||||
specifies that a proxy can decide which future versions of this
|
||||
License can be used, that proxy's public statement of acceptance of a
|
||||
version permanently authorizes you to choose that version for the
|
||||
Document.
|
||||
|
||||
@item
|
||||
RELICENSING
|
||||
|
||||
``Massive Multiauthor Collaboration Site'' (or ``MMC Site'') means any
|
||||
World Wide Web server that publishes copyrightable works and also
|
||||
provides prominent facilities for anybody to edit those works. A
|
||||
public wiki that anybody can edit is an example of such a server. A
|
||||
``Massive Multiauthor Collaboration'' (or ``MMC'') contained in the
|
||||
site means any set of copyrightable works thus published on the MMC
|
||||
site.
|
||||
|
||||
``CC-BY-SA'' means the Creative Commons Attribution-Share Alike 3.0
|
||||
license published by Creative Commons Corporation, a not-for-profit
|
||||
corporation with a principal place of business in San Francisco,
|
||||
California, as well as future copyleft versions of that license
|
||||
published by that same organization.
|
||||
|
||||
``Incorporate'' means to publish or republish a Document, in whole or
|
||||
in part, as part of another Document.
|
||||
|
||||
An MMC is ``eligible for relicensing'' if it is licensed under this
|
||||
License, and if all works that were first published under this License
|
||||
somewhere other than this MMC, and subsequently incorporated in whole
|
||||
or in part into the MMC, (1) had no cover texts or invariant sections,
|
||||
and (2) were thus incorporated prior to November 1, 2008.
|
||||
|
||||
The operator of an MMC Site may republish an MMC contained in the site
|
||||
under CC-BY-SA on the same site at any time before August 1, 2009,
|
||||
provided the MMC is eligible for relicensing.
|
||||
|
||||
@end enumerate
|
||||
|
||||
@page
|
||||
@heading ADDENDUM: How to use this License for your documents
|
||||
|
||||
To use this License in a document you have written, include a copy of
|
||||
the License in the document and put the following copyright and
|
||||
license notices just after the title page:
|
||||
|
||||
@smallexample
|
||||
@group
|
||||
Copyright (C) @var{year} @var{your name}.
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3
|
||||
or any later version published by the Free Software Foundation;
|
||||
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
|
||||
Texts. A copy of the license is included in the section entitled ``GNU
|
||||
Free Documentation License''.
|
||||
@end group
|
||||
@end smallexample
|
||||
|
||||
If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
|
||||
replace the ``with@dots{}Texts.''@: line with this:
|
||||
|
||||
@smallexample
|
||||
@group
|
||||
with the Invariant Sections being @var{list their titles}, with
|
||||
the Front-Cover Texts being @var{list}, and with the Back-Cover Texts
|
||||
being @var{list}.
|
||||
@end group
|
||||
@end smallexample
|
||||
|
||||
If you have Invariant Sections without Cover Texts, or some other
|
||||
combination of the three, merge those two alternatives to suit the
|
||||
situation.
|
||||
|
||||
If your document contains nontrivial examples of program code, we
|
||||
recommend releasing these examples in parallel under your choice of
|
||||
free software license, such as the GNU General Public License,
|
||||
to permit their use in free software.
|
||||
|
||||
@c Local Variables:
|
||||
@c ispell-local-pdict: "ispell-dict"
|
||||
@c End:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,416 @@
|
||||
.TH MAKE 1 "31 May 2022" "GNU" "User Commands"
|
||||
.SH NAME
|
||||
make \- GNU make utility to maintain groups of programs
|
||||
.SH SYNOPSIS
|
||||
.B make
|
||||
[\fIOPTION\fR]... [\fITARGET\fR]...
|
||||
.SH DESCRIPTION
|
||||
.LP
|
||||
The
|
||||
.I make
|
||||
utility will determine automatically which pieces of a large program need to
|
||||
be recompiled, and issue the commands to recompile them. The manual describes
|
||||
the GNU implementation of
|
||||
.BR make ,
|
||||
which was written by Richard Stallman and Roland McGrath, and is currently
|
||||
maintained by Paul Smith. Our examples show C programs, since they are very
|
||||
common, but you can use
|
||||
.B make
|
||||
with any programming language whose compiler can be run with a shell command.
|
||||
In fact,
|
||||
.B make
|
||||
is not limited to programs. You can use it to describe any task where some
|
||||
files must be updated automatically from others whenever the others change.
|
||||
.LP
|
||||
To prepare to use
|
||||
.BR make ,
|
||||
you must write a file called the
|
||||
.I makefile
|
||||
that describes the relationships among files in your program, and provides
|
||||
commands for updating each file. In a program, typically the executable file
|
||||
is updated from object files, which are in turn made by compiling source
|
||||
files.
|
||||
.LP
|
||||
Once a suitable makefile exists, each time you change some source files,
|
||||
this simple shell command:
|
||||
.sp 1
|
||||
.RS
|
||||
.B make
|
||||
.RE
|
||||
.sp 1
|
||||
suffices to perform all necessary recompilations.
|
||||
The
|
||||
.B make
|
||||
program uses the makefile description and the last-modification times of the
|
||||
files to decide which of the files need to be updated. For each of those
|
||||
files, it issues the commands recorded in the makefile.
|
||||
.LP
|
||||
.B make
|
||||
executes commands in the
|
||||
.I makefile
|
||||
to update one or more
|
||||
.IR targets ,
|
||||
where
|
||||
.I target
|
||||
is typically a program.
|
||||
If no
|
||||
.B \-f
|
||||
option is present,
|
||||
.B make
|
||||
will look for the makefiles
|
||||
.IR GNUmakefile ,
|
||||
.IR makefile ,
|
||||
and
|
||||
.IR Makefile ,
|
||||
in that order.
|
||||
.LP
|
||||
Normally you should call your makefile either
|
||||
.I makefile
|
||||
or
|
||||
.IR Makefile .
|
||||
(We recommend
|
||||
.I Makefile
|
||||
because it appears prominently near the beginning of a directory
|
||||
listing, right near other important files such as
|
||||
.IR README .)
|
||||
The first name checked,
|
||||
.IR GNUmakefile ,
|
||||
is not recommended for most makefiles. You should use this name if you have a
|
||||
makefile that is specific to GNU
|
||||
.BR make ,
|
||||
and will not be understood by other versions of
|
||||
.BR make .
|
||||
If
|
||||
.I makefile
|
||||
is '\-', the standard input is read.
|
||||
.LP
|
||||
.B make
|
||||
updates a target if it depends on prerequisite files
|
||||
that have been modified since the target was last modified,
|
||||
or if the target does not exist.
|
||||
.SH OPTIONS
|
||||
.sp 1
|
||||
.TP 0.5i
|
||||
\fB\-b\fR, \fB\-m\fR
|
||||
These options are ignored for compatibility with other versions of
|
||||
.BR make .
|
||||
.TP 0.5i
|
||||
\fB\-B\fR, \fB\-\-always\-make\fR
|
||||
Unconditionally make all targets.
|
||||
.TP 0.5i
|
||||
\fB\-C\fR \fIdir\fR, \fB\-\-directory\fR=\fIdir\fR
|
||||
Change to directory
|
||||
.I dir
|
||||
before reading the makefiles or doing anything else.
|
||||
If multiple
|
||||
.B \-C
|
||||
options are specified, each is interpreted relative to the
|
||||
previous one:
|
||||
.BR "\-C " /
|
||||
.BR "\-C " etc
|
||||
is equivalent to
|
||||
.BR "\-C " /etc.
|
||||
This is typically used with recursive invocations of
|
||||
.BR make .
|
||||
.TP 0.5i
|
||||
.B \-d
|
||||
Print debugging information in addition to normal processing.
|
||||
The debugging information says which files are being considered for
|
||||
remaking, which file-times are being compared and with what results,
|
||||
which files actually need to be remade, which implicit rules are
|
||||
considered and which are applied---everything interesting about how
|
||||
.B make
|
||||
decides what to do.
|
||||
.TP 0.5i
|
||||
.BI \-\-debug "[=FLAGS]"
|
||||
Print debugging information in addition to normal processing.
|
||||
If the
|
||||
.I FLAGS
|
||||
are omitted, then the behavior is the same as if
|
||||
.B \-d
|
||||
was specified.
|
||||
.I FLAGS
|
||||
may be any or all of the following names, comma- or space-separated. Only the
|
||||
first character is significant: the rest may be omitted:
|
||||
.I all
|
||||
for all debugging output (same as using
|
||||
.BR \-d ),
|
||||
.I basic
|
||||
for basic debugging,
|
||||
.I verbose
|
||||
for more verbose basic debugging,
|
||||
.I implicit
|
||||
for showing implicit rule search operations,
|
||||
.I jobs
|
||||
for details on invocation of commands,
|
||||
.I makefile
|
||||
for debugging while remaking makefiles,
|
||||
.I print
|
||||
shows all recipes that are run even if they are silent, and
|
||||
.I why
|
||||
shows the reason
|
||||
.BR make
|
||||
decided to rebuild each target. Use
|
||||
.I none
|
||||
to disable all previous debugging flags.
|
||||
.TP 0.5i
|
||||
\fB\-e\fR, \fB\-\-environment\-overrides\fR
|
||||
Give variables taken from the environment precedence over variables
|
||||
from makefiles.
|
||||
.TP 0.5i
|
||||
\fB\-E\fR \fIstring\fR, \fB\-\-eval\fR \fIstring\fR
|
||||
Interpret \fIstring\fR using the \fBeval\fR function, before parsing any
|
||||
makefiles.
|
||||
.TP 0.5i
|
||||
\fB\-f\fR \fIfile\fR, \fB\-\-file\fR=\fIfile\fR, \fB\-\-makefile\fR=\fIFILE\fR
|
||||
Use
|
||||
.I file
|
||||
as a makefile.
|
||||
.TP 0.5i
|
||||
\fB\-i\fR, \fB\-\-ignore\-errors\fR
|
||||
Ignore all errors in commands executed to remake files.
|
||||
.TP 0.5i
|
||||
\fB\-I\fR \fIdir\fR, \fB\-\-include\-dir\fR=\fIdir\fR
|
||||
Specifies a directory
|
||||
.I dir
|
||||
to search for included makefiles.
|
||||
If several
|
||||
.B \-I
|
||||
options are used to specify several directories, the directories are
|
||||
searched in the order specified.
|
||||
Unlike the arguments to other flags of
|
||||
.BR make ,
|
||||
directories given with
|
||||
.B \-I
|
||||
flags may come directly after the flag:
|
||||
.BI \-I dir
|
||||
is allowed, as well as
|
||||
.B \-I
|
||||
.IR dir .
|
||||
This syntax is allowed for compatibility with the C
|
||||
preprocessor's
|
||||
.B \-I
|
||||
flag.
|
||||
.TP 0.5i
|
||||
\fB\-j\fR [\fIjobs\fR], \fB\-\-jobs\fR[=\fIjobs\fR]
|
||||
Specifies the number of
|
||||
.I jobs
|
||||
(commands) to run simultaneously.
|
||||
If there is more than one
|
||||
.B \-j
|
||||
option, the last one is effective.
|
||||
If the
|
||||
.B \-j
|
||||
option is given without an argument,
|
||||
.BR make
|
||||
will not limit the number of jobs that can run simultaneously.
|
||||
.TP 0.5i
|
||||
\fB\--jobserver-style=\fR\fIstyle\fR
|
||||
The style of jobserver to use. The
|
||||
.I style
|
||||
may be one of
|
||||
.BR fifo ,
|
||||
.BR pipe ,
|
||||
or
|
||||
.B sem
|
||||
(Windows only).
|
||||
.TP 0.5i
|
||||
\fB\-k\fR, \fB\-\-keep\-going\fR
|
||||
Continue as much as possible after an error.
|
||||
While the target that failed, and those that depend on it, cannot
|
||||
be remade, the other dependencies of these targets can be processed
|
||||
all the same.
|
||||
.TP 0.5i
|
||||
\fB\-l\fR [\fIload\fR], \fB\-\-load\-average\fR[=\fIload\fR]
|
||||
Specifies that no new jobs (commands) should be started if there are
|
||||
others jobs running and the load average is at least
|
||||
.I load
|
||||
(a floating-point number).
|
||||
With no argument, removes a previous load limit.
|
||||
.TP 0.5i
|
||||
\fB\-L\fR, \fB\-\-check\-symlink\-times\fR
|
||||
Use the latest mtime between symlinks and target.
|
||||
.TP 0.5i
|
||||
\fB\-n\fR, \fB\-\-just\-print\fR, \fB\-\-dry\-run\fR, \fB\-\-recon\fR
|
||||
Print the commands that would be executed, but do not execute them (except in
|
||||
certain circumstances).
|
||||
.TP 0.5i
|
||||
\fB\-o\fR \fIfile\fR, \fB\-\-old\-file\fR=\fIfile\fR, \fB\-\-assume\-old\fR=\fIfile\fR
|
||||
Do not remake the file
|
||||
.I file
|
||||
even if it is older than its dependencies, and do not remake anything
|
||||
on account of changes in
|
||||
.IR file .
|
||||
Essentially the file is treated as very old and its rules are ignored.
|
||||
.TP 0.5i
|
||||
\fB\-O\fR[\fItype\fR], \fB\-\-output\-sync\fR[=\fItype\fR]
|
||||
When running multiple jobs in parallel with \fB-j\fR, ensure the output of
|
||||
each job is collected together rather than interspersed with output from
|
||||
other jobs. If
|
||||
.I type
|
||||
is not specified or is
|
||||
.B target
|
||||
the output from the entire recipe for each target is grouped together. If
|
||||
.I type
|
||||
is
|
||||
.B line
|
||||
the output from each command line within a recipe is grouped together.
|
||||
If
|
||||
.I type
|
||||
is
|
||||
.B recurse
|
||||
output from an entire recursive make is grouped together. If
|
||||
.I type
|
||||
is
|
||||
.B none
|
||||
output synchronization is disabled.
|
||||
.TP 0.5i
|
||||
\fB\-p\fR, \fB\-\-print\-data\-base\fR
|
||||
Print the data base (rules and variable values) that results from
|
||||
reading the makefiles; then execute as usual or as otherwise
|
||||
specified.
|
||||
This also prints the version information given by the
|
||||
.B \-v
|
||||
switch (see below).
|
||||
To print the data base without trying to remake any files, use
|
||||
.IR "make \-p \-f/dev/null" .
|
||||
.TP 0.5i
|
||||
\fB\-q\fR, \fB\-\-question\fR
|
||||
``Question mode''.
|
||||
Do not run any commands, or print anything; just return an exit status
|
||||
that is zero if the specified targets are already up to date, nonzero
|
||||
otherwise.
|
||||
.TP 0.5i
|
||||
\fB\-r\fR, \fB\-\-no\-builtin\-rules\fR
|
||||
Eliminate use of the built\-in implicit rules.
|
||||
Also clear out the default list of suffixes for suffix rules.
|
||||
.TP 0.5i
|
||||
\fB\-R\fR, \fB\-\-no\-builtin\-variables\fR
|
||||
Don't define any built\-in variables.
|
||||
.TP 0.5i
|
||||
\fB\-s\fR, \fB\-\-silent\fR, \fB\-\-quiet\fR
|
||||
Silent operation; do not print the commands as they are executed.
|
||||
.TP 0.5i
|
||||
.B \-\-no\-silent
|
||||
Cancel the effect of the \fB\-s\fR option.
|
||||
.TP 0.5i
|
||||
\fB\-S\fR, \fB\-\-no\-keep\-going\fR, \fB\-\-stop\fR
|
||||
Cancel the effect of the
|
||||
.B \-k
|
||||
option.
|
||||
.TP 0.5i
|
||||
\fB\-t\fR, \fB\-\-touch\fR
|
||||
Touch files (mark them up to date without really changing them)
|
||||
instead of running their commands.
|
||||
This is used to pretend that the commands were done, in order to fool
|
||||
future invocations of
|
||||
.BR make .
|
||||
.TP 0.5i
|
||||
.B \-\-trace
|
||||
Information about the disposition of each target is printed (why the target is
|
||||
being rebuilt and what commands are run to rebuild it).
|
||||
.TP 0.5i
|
||||
\fB\-v\fR, \fB\-\-version\fR
|
||||
Print the version of the
|
||||
.B make
|
||||
program plus a copyright, a list of authors and a notice that there
|
||||
is no warranty.
|
||||
.TP 0.5i
|
||||
\fB\-w\fR, \fB\-\-print\-directory\fR
|
||||
Print a message containing the working directory
|
||||
before and after other processing.
|
||||
This may be useful for tracking down errors from complicated nests of
|
||||
recursive
|
||||
.B make
|
||||
commands.
|
||||
.TP 0.5i
|
||||
.B \-\-no\-print\-directory
|
||||
Turn off
|
||||
.BR \-w ,
|
||||
even if it was turned on implicitly.
|
||||
.TP 0.5i
|
||||
.BI \-\-shuffle "[=MODE]"
|
||||
Enable shuffling of goal and prerequisite ordering.
|
||||
.I MODE
|
||||
is one of
|
||||
.I none
|
||||
to disable shuffle mode,
|
||||
.I random
|
||||
to shuffle prerequisites in random order,
|
||||
.I reverse
|
||||
to consider prerequisites in reverse order, or an integer
|
||||
.I <seed>
|
||||
which enables
|
||||
.I random
|
||||
mode with a specific
|
||||
.I seed
|
||||
value. If
|
||||
.I MODE
|
||||
is omitted the default is
|
||||
.IR random .
|
||||
.TP 0.5i
|
||||
\fB\-W\fR \fIfile\fR, \fB\-\-what\-if\fR=\fIfile\fR, \fB\-\-new\-file\fR=\fIfile\fR, \fB\-\-assume\-new\fR=\fIfile\fR
|
||||
Pretend that the target
|
||||
.I file
|
||||
has just been modified.
|
||||
When used with the
|
||||
.B \-n
|
||||
flag, this shows you what would happen if you were to modify that file.
|
||||
Without
|
||||
.BR \-n ,
|
||||
it is almost the same as running a
|
||||
.I touch
|
||||
command on the given file before running
|
||||
.BR make ,
|
||||
except that the modification time is changed only in the imagination of
|
||||
.BR make .
|
||||
.TP 0.5i
|
||||
.B \-\-warn\-undefined\-variables
|
||||
Warn when an undefined variable is referenced.
|
||||
.SH "EXIT STATUS"
|
||||
GNU
|
||||
.B make
|
||||
exits with a status of zero if all makefiles were successfully parsed
|
||||
and no targets that were built failed. A status of one will be returned
|
||||
if the
|
||||
.B \-q
|
||||
flag was used and
|
||||
.B make
|
||||
determines that a target needs to be rebuilt. A status of two will be
|
||||
returned if any errors were encountered.
|
||||
.SH "SEE ALSO"
|
||||
The full documentation for
|
||||
.B make
|
||||
is maintained as a Texinfo manual. If the
|
||||
.B info
|
||||
and
|
||||
.B make
|
||||
programs are properly installed at your site, the command
|
||||
.IP
|
||||
.B info make
|
||||
.PP
|
||||
should give you access to the complete manual.
|
||||
.SH BUGS
|
||||
See the chapter ``Problems and Bugs'' in
|
||||
.IR "The GNU Make Manual" .
|
||||
.SH AUTHOR
|
||||
This manual page contributed by Dennis Morse of Stanford University.
|
||||
Further updates contributed by Mike Frysinger. It has been reworked by Roland
|
||||
McGrath. Maintained by Paul Smith.
|
||||
.SH "COPYRIGHT"
|
||||
Copyright \(co 1992-1993, 1996-2022 Free Software Foundation, Inc.
|
||||
This file is part of
|
||||
.IR "GNU make" .
|
||||
.LP
|
||||
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 3 of the License, or (at your option) any later
|
||||
version.
|
||||
.LP
|
||||
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.
|
||||
.LP
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program. If not, see
|
||||
.IR https://www.gnu.org/licenses/ .
|
||||
@@ -0,0 +1,221 @@
|
||||
This is make.info, produced by makeinfo version 6.7 from make.texi.
|
||||
|
||||
This file documents the GNU 'make' utility, which determines
|
||||
automatically which pieces of a large program need to be recompiled, and
|
||||
issues the commands to recompile them.
|
||||
|
||||
This is Edition 0.76, last updated 31 October 2022, of 'The GNU Make
|
||||
Manual', for GNU 'make' version 4.4.
|
||||
|
||||
Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
|
||||
1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
|
||||
2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021,
|
||||
2022 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this
|
||||
document under the terms of the GNU Free Documentation License,
|
||||
Version 1.3 or any later version published by the Free Software
|
||||
Foundation; with no Invariant Sections, with the Front-Cover Texts
|
||||
being "A GNU Manual," and with the Back-Cover Texts as in (a)
|
||||
below. A copy of the license is included in the section entitled
|
||||
"GNU Free Documentation License."
|
||||
|
||||
(a) The FSF's Back-Cover Text is: "You have the freedom to copy and
|
||||
modify this GNU manual. Buying copies from the FSF supports it in
|
||||
developing GNU and promoting software freedom."
|
||||
INFO-DIR-SECTION Software development
|
||||
START-INFO-DIR-ENTRY
|
||||
* Make: (make). Remake files automatically.
|
||||
END-INFO-DIR-ENTRY
|
||||
|
||||
|
||||
Indirect:
|
||||
make.info-1: 1391
|
||||
make.info-2: 302239
|
||||
make.info-3: 626899
|
||||
|
||||
Tag Table:
|
||||
(Indirect)
|
||||
Node: Top1391
|
||||
Node: Overview17167
|
||||
Node: Preparing18180
|
||||
Node: Reading19148
|
||||
Node: Bugs20075
|
||||
Node: Introduction22025
|
||||
Node: Rule Introduction23618
|
||||
Node: Simple Makefile25551
|
||||
Node: How Make Works29287
|
||||
Node: Variables Simplify31977
|
||||
Node: make Deduces34183
|
||||
Node: Combine By Prerequisite35916
|
||||
Node: Cleanup36945
|
||||
Node: Makefiles38363
|
||||
Node: Makefile Contents39258
|
||||
Node: Splitting Lines42431
|
||||
Node: Makefile Names44920
|
||||
Node: Include46527
|
||||
Ref: Include-Footnote-150706
|
||||
Node: MAKEFILES Variable50840
|
||||
Node: Remaking Makefiles52381
|
||||
Node: Overriding Makefiles57285
|
||||
Node: Reading Makefiles59313
|
||||
Node: Parsing Makefiles63097
|
||||
Node: Secondary Expansion64955
|
||||
Node: Rules72330
|
||||
Node: Rule Example74917
|
||||
Node: Rule Syntax75765
|
||||
Node: Prerequisite Types78360
|
||||
Node: Wildcards81399
|
||||
Ref: Wildcards-Footnote-183432
|
||||
Node: Wildcard Examples83522
|
||||
Node: Wildcard Pitfall84872
|
||||
Node: Wildcard Function86661
|
||||
Node: Directory Search88716
|
||||
Node: General Search89851
|
||||
Node: Selective Search91558
|
||||
Node: Search Algorithm94548
|
||||
Node: Recipes/Search97066
|
||||
Node: Implicit/Search98389
|
||||
Node: Libraries/Search99331
|
||||
Node: Phony Targets101302
|
||||
Node: Force Targets106894
|
||||
Node: Empty Targets107931
|
||||
Node: Special Targets109233
|
||||
Node: Multiple Targets118577
|
||||
Node: Multiple Rules122919
|
||||
Node: Static Pattern125137
|
||||
Node: Static Usage125789
|
||||
Node: Static versus Implicit129508
|
||||
Node: Double-Colon131248
|
||||
Node: Automatic Prerequisites133008
|
||||
Node: Recipes137269
|
||||
Node: Recipe Syntax138441
|
||||
Node: Splitting Recipe Lines140556
|
||||
Node: Variables in Recipes143709
|
||||
Node: Echoing145035
|
||||
Node: Execution146247
|
||||
Ref: Execution-Footnote-1147660
|
||||
Node: One Shell147805
|
||||
Node: Choosing the Shell151123
|
||||
Node: Parallel155267
|
||||
Node: Parallel Disable157983
|
||||
Node: Parallel Output161414
|
||||
Node: Parallel Input165849
|
||||
Node: Errors166968
|
||||
Node: Interrupts170603
|
||||
Node: Recursion172964
|
||||
Node: MAKE Variable175061
|
||||
Node: Variables/Recursion177304
|
||||
Node: Options/Recursion183159
|
||||
Node: -w Option189605
|
||||
Node: Canned Recipes190600
|
||||
Node: Empty Recipes193583
|
||||
Node: Using Variables195023
|
||||
Node: Reference198599
|
||||
Node: Flavors200409
|
||||
Node: Recursive Assignment201154
|
||||
Node: Simple Assignment203028
|
||||
Node: Immediate Assignment206613
|
||||
Node: Conditional Assignment209096
|
||||
Node: Advanced209732
|
||||
Node: Substitution Refs210237
|
||||
Node: Computed Names211839
|
||||
Node: Values216206
|
||||
Node: Setting217281
|
||||
Node: Appending220547
|
||||
Node: Override Directive224103
|
||||
Node: Multi-Line225730
|
||||
Node: Undefine Directive228593
|
||||
Node: Environment229682
|
||||
Node: Target-specific231881
|
||||
Node: Pattern-specific235058
|
||||
Node: Suppressing Inheritance236905
|
||||
Node: Special Variables238358
|
||||
Node: Conditionals247482
|
||||
Node: Conditional Example248195
|
||||
Node: Conditional Syntax250758
|
||||
Node: Testing Flags256518
|
||||
Node: Functions257918
|
||||
Node: Syntax of Functions259527
|
||||
Node: Text Functions262112
|
||||
Node: File Name Functions270753
|
||||
Node: Conditional Functions275979
|
||||
Node: Let Function279821
|
||||
Node: Foreach Function282444
|
||||
Node: File Function285727
|
||||
Node: Call Function288284
|
||||
Node: Value Function291177
|
||||
Node: Eval Function292614
|
||||
Node: Origin Function294892
|
||||
Node: Flavor Function298118
|
||||
Node: Make Control Functions299162
|
||||
Node: Shell Function302239
|
||||
Node: Guile Function305227
|
||||
Node: Running305977
|
||||
Node: Makefile Arguments308030
|
||||
Node: Goals308746
|
||||
Node: Instead of Execution313494
|
||||
Node: Avoiding Compilation317209
|
||||
Node: Overriding319184
|
||||
Node: Testing321496
|
||||
Node: Temporary Files323380
|
||||
Node: Options Summary324489
|
||||
Node: Implicit Rules338769
|
||||
Node: Using Implicit340906
|
||||
Node: Catalogue of Rules344425
|
||||
Node: Implicit Variables353815
|
||||
Node: Chained Rules358888
|
||||
Node: Pattern Rules363703
|
||||
Node: Pattern Intro365237
|
||||
Node: Pattern Examples367966
|
||||
Node: Automatic Variables369773
|
||||
Node: Pattern Match377180
|
||||
Node: Match-Anything Rules380610
|
||||
Node: Canceling Rules384531
|
||||
Node: Last Resort385245
|
||||
Node: Suffix Rules387074
|
||||
Node: Implicit Rule Search390808
|
||||
Node: Archives394760
|
||||
Node: Archive Members395465
|
||||
Node: Archive Update397075
|
||||
Node: Archive Symbols398986
|
||||
Node: Archive Pitfalls400219
|
||||
Node: Archive Suffix Rules400941
|
||||
Node: Extending make402489
|
||||
Node: Guile Integration403634
|
||||
Node: Guile Types404862
|
||||
Node: Guile Interface407282
|
||||
Node: Guile Example408568
|
||||
Node: Loading Objects410759
|
||||
Node: load Directive412249
|
||||
Node: Remaking Loaded Objects415003
|
||||
Node: Loaded Object API415637
|
||||
Node: Loaded Object Example422522
|
||||
Node: Integrating make424894
|
||||
Node: Job Slots425645
|
||||
Node: POSIX Jobserver429021
|
||||
Node: Windows Jobserver432647
|
||||
Node: Terminal Output434059
|
||||
Node: Features436451
|
||||
Node: Missing445620
|
||||
Node: Makefile Conventions449348
|
||||
Node: Makefile Basics450327
|
||||
Node: Utilities in Makefiles453494
|
||||
Node: Command Variables455993
|
||||
Node: DESTDIR459233
|
||||
Node: Directory Variables461400
|
||||
Node: Standard Targets476759
|
||||
Node: Install Command Categories490865
|
||||
Node: Quick Reference495391
|
||||
Node: Error Messages508608
|
||||
Node: Complex Makefile517403
|
||||
Node: GNU Free Documentation License526021
|
||||
Node: Concept Index551179
|
||||
Node: Name Index626899
|
||||
|
||||
End Tag Table
|
||||
|
||||
|
||||
Local Variables:
|
||||
coding: utf-8
|
||||
End:
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,4 @@
|
||||
@set UPDATED 31 October 2022
|
||||
@set UPDATED-MONTH October 2022
|
||||
@set EDITION 4.4
|
||||
@set VERSION 4.4
|
||||
@@ -0,0 +1,4 @@
|
||||
@set UPDATED 31 October 2022
|
||||
@set UPDATED-MONTH October 2022
|
||||
@set EDITION 4.4
|
||||
@set VERSION 4.4
|
||||
@@ -0,0 +1,242 @@
|
||||
## DO NOT EDIT! GENERATED AUTOMATICALLY!
|
||||
## Process this file with automake to produce Makefile.in.
|
||||
# Copyright (C) 2002-2022 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file 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 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This file 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 file. If not, see <https://www.gnu.org/licenses/>.
|
||||
#
|
||||
# As a special exception to the GNU General Public License,
|
||||
# this file may be distributed as part of a program that
|
||||
# contains a configuration script generated by Autoconf, under
|
||||
# the same distribution terms as the rest of that program.
|
||||
#
|
||||
# Generated by gnulib-tool.
|
||||
# Reproduce by:
|
||||
# gnulib-tool --import --local-dir=gl \
|
||||
# --lib=libgnu \
|
||||
# --source-base=lib \
|
||||
# --m4-base=m4 \
|
||||
# --doc-base=doc \
|
||||
# --tests-base=tests \
|
||||
# --aux-dir=build-aux \
|
||||
# --no-conditional-dependencies \
|
||||
# --no-libtool \
|
||||
# --macro-prefix=gl \
|
||||
# alloca \
|
||||
# fdl \
|
||||
# findprog-in \
|
||||
# getloadavg \
|
||||
# host-cpu-c-abi \
|
||||
# largefile \
|
||||
# make-glob \
|
||||
# make-macros
|
||||
|
||||
AUTOMAKE_OPTIONS = 1.14 gnits
|
||||
|
||||
SUBDIRS =
|
||||
noinst_HEADERS =
|
||||
noinst_LIBRARIES =
|
||||
noinst_LTLIBRARIES =
|
||||
EXTRA_DIST =
|
||||
BUILT_SOURCES =
|
||||
SUFFIXES =
|
||||
MOSTLYCLEANFILES = core *.stackdump
|
||||
MOSTLYCLEANDIRS =
|
||||
CLEANFILES =
|
||||
DISTCLEANFILES =
|
||||
MAINTAINERCLEANFILES =
|
||||
# No GNU Make output.
|
||||
|
||||
AM_CPPFLAGS =
|
||||
AM_CFLAGS =
|
||||
|
||||
noinst_LIBRARIES += libgnu.a
|
||||
|
||||
libgnu_a_SOURCES =
|
||||
libgnu_a_CFLAGS = $(AM_CFLAGS) $(GL_CFLAG_GNULIB_WARNINGS)
|
||||
libgnu_a_LIBADD = $(gl_LIBOBJS)
|
||||
libgnu_a_DEPENDENCIES = $(gl_LIBOBJS)
|
||||
EXTRA_libgnu_a_SOURCES =
|
||||
|
||||
## begin gnulib module alloca
|
||||
|
||||
|
||||
libgnu_a_LIBADD += @ALLOCA@
|
||||
libgnu_a_DEPENDENCIES += @ALLOCA@
|
||||
EXTRA_DIST += alloca.c
|
||||
|
||||
EXTRA_libgnu_a_SOURCES += alloca.c
|
||||
|
||||
## end gnulib module alloca
|
||||
|
||||
## begin gnulib module alloca-opt
|
||||
|
||||
BUILT_SOURCES += $(ALLOCA_H)
|
||||
|
||||
# We need the following in order to create <alloca.h> when the system
|
||||
# doesn't have one that works with the given compiler.
|
||||
if GL_GENERATE_ALLOCA_H
|
||||
alloca.h: alloca.in.h $(top_builddir)/config.status
|
||||
$(gl_V_at)$(SED_HEADER_STDOUT) \
|
||||
-e 's|@''HAVE_ALLOCA_H''@|$(HAVE_ALLOCA_H)|g' \
|
||||
$(srcdir)/alloca.in.h > $@-t
|
||||
$(AM_V_at)mv $@-t $@
|
||||
else
|
||||
alloca.h: $(top_builddir)/config.status
|
||||
rm -f $@
|
||||
endif
|
||||
MOSTLYCLEANFILES += alloca.h alloca.h-t
|
||||
|
||||
EXTRA_DIST += alloca.in.h
|
||||
|
||||
## end gnulib module alloca-opt
|
||||
|
||||
## begin gnulib module concat-filename
|
||||
|
||||
libgnu_a_SOURCES += concat-filename.c
|
||||
|
||||
EXTRA_DIST += concat-filename.h
|
||||
|
||||
## end gnulib module concat-filename
|
||||
|
||||
## begin gnulib module filename
|
||||
|
||||
|
||||
EXTRA_DIST += filename.h
|
||||
|
||||
## end gnulib module filename
|
||||
|
||||
## begin gnulib module findprog-in
|
||||
|
||||
libgnu_a_SOURCES += findprog.h findprog-in.c
|
||||
|
||||
## end gnulib module findprog-in
|
||||
|
||||
## begin gnulib module gen-header
|
||||
|
||||
# In 'sed', replace the pattern space with a "DO NOT EDIT" comment.
|
||||
SED_HEADER_NOEDIT = s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,
|
||||
|
||||
# '$(SED_HEADER_STDOUT) -e "..."' runs 'sed' but first outputs "DO NOT EDIT".
|
||||
SED_HEADER_STDOUT = sed -e 1h -e '1$(SED_HEADER_NOEDIT)' -e 1G
|
||||
|
||||
# '$(SED_HEADER_TO_AT_t) FILE' copies FILE to $@-t, prepending a leading
|
||||
# "DO_NOT_EDIT". Although this could be done more simply via:
|
||||
# SED_HEADER_TO_AT_t = $(SED_HEADER_STDOUT) > $@-t
|
||||
# the -n and 'w' avoid a fork+exec, at least when GNU Make is used.
|
||||
SED_HEADER_TO_AT_t = $(SED_HEADER_STDOUT) -n -e 'w $@-t'
|
||||
|
||||
# Use $(gl_V_at) instead of $(AM_V_GEN) or $(AM_V_at) on a line that
|
||||
gl_V_at = $(AM_V_GEN)
|
||||
|
||||
## end gnulib module gen-header
|
||||
|
||||
## begin gnulib module getloadavg
|
||||
|
||||
if GL_COND_OBJ_GETLOADAVG
|
||||
libgnu_a_SOURCES += getloadavg.c
|
||||
endif
|
||||
|
||||
## end gnulib module getloadavg
|
||||
|
||||
## begin gnulib module intprops
|
||||
|
||||
|
||||
EXTRA_DIST += intprops.h
|
||||
|
||||
## end gnulib module intprops
|
||||
|
||||
## begin gnulib module make-glob
|
||||
|
||||
if !USE_SYSTEM_GLOB
|
||||
libgnu_a_SOURCES += fnmatch.c
|
||||
|
||||
BUILT_SOURCES += fnmatch.h
|
||||
|
||||
fnmatch.h: fnmatch.in.h $(top_builddir)/config.status
|
||||
$(AM_V_GEN)rm -f $@-t $@ && \
|
||||
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
|
||||
cat $(srcdir)/fnmatch.in.h; \
|
||||
} > $@-t && \
|
||||
mv -f $@-t $@
|
||||
|
||||
MOSTLYCLEANFILES += fnmatch.h fnmatch.h-t
|
||||
|
||||
libgnu_a_SOURCES += glob.c
|
||||
|
||||
BUILT_SOURCES += glob.h
|
||||
|
||||
glob.h: glob.in.h $(top_builddir)/config.status
|
||||
$(AM_V_GEN)rm -f $@-t $@ && \
|
||||
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
|
||||
cat $(srcdir)/glob.in.h; \
|
||||
} > $@-t && \
|
||||
mv -f $@-t $@
|
||||
|
||||
MOSTLYCLEANFILES += glob.h glob.h-t
|
||||
endif
|
||||
|
||||
EXTRA_DIST += fnmatch.in.h glob.in.h
|
||||
|
||||
EXTRA_DIST += fnmatch.c fnmatch.in.h glob.c glob.in.h
|
||||
|
||||
EXTRA_libgnu_a_SOURCES += fnmatch.c glob.c
|
||||
|
||||
## end gnulib module make-glob
|
||||
|
||||
## begin gnulib module snippet/warn-on-use
|
||||
|
||||
# Because this Makefile snippet defines a variable used by other
|
||||
# gnulib Makefile snippets, it must be present in all makefiles that
|
||||
# need it. This is ensured by the applicability 'all' defined above.
|
||||
|
||||
WARN_ON_USE_H=$(srcdir)/warn-on-use.h
|
||||
|
||||
EXTRA_DIST += warn-on-use.h
|
||||
|
||||
## end gnulib module snippet/warn-on-use
|
||||
|
||||
## begin gnulib module stdbool
|
||||
|
||||
BUILT_SOURCES += $(STDBOOL_H)
|
||||
|
||||
# We need the following in order to create <stdbool.h> when the system
|
||||
# doesn't have one that works.
|
||||
if GL_GENERATE_STDBOOL_H
|
||||
stdbool.h: stdbool.in.h $(top_builddir)/config.status
|
||||
$(gl_V_at)$(SED_HEADER_STDOUT) \
|
||||
-e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' \
|
||||
$(srcdir)/stdbool.in.h > $@-t
|
||||
$(AM_V_at)mv $@-t $@
|
||||
else
|
||||
stdbool.h: $(top_builddir)/config.status
|
||||
rm -f $@
|
||||
endif
|
||||
MOSTLYCLEANFILES += stdbool.h stdbool.h-t
|
||||
|
||||
EXTRA_DIST += stdbool.in.h
|
||||
|
||||
## end gnulib module stdbool
|
||||
|
||||
|
||||
mostlyclean-local: mostlyclean-generic
|
||||
@for dir in '' $(MOSTLYCLEANDIRS); do \
|
||||
if test -n "$$dir" && test -d $$dir; then \
|
||||
echo "rmdir $$dir"; rmdir $$dir; \
|
||||
fi; \
|
||||
done; \
|
||||
:
|
||||
distclean-local: distclean-gnulib-libobjs
|
||||
distclean-gnulib-libobjs:
|
||||
-rm -f @gl_LIBOBJDEPS@
|
||||
maintainer-clean-local: distclean-gnulib-libobjs
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,167 @@
|
||||
/* alloca.c -- allocate automatically reclaimed memory
|
||||
This file is in the public domain. */
|
||||
|
||||
/* (Mostly) portable implementation -- D A Gwyn
|
||||
|
||||
This implementation of the PWB library alloca function,
|
||||
which is used to allocate space off the run-time stack so
|
||||
that it is automatically reclaimed upon procedure exit,
|
||||
was inspired by discussions with J. Q. Johnson of Cornell.
|
||||
J.Otto Tennant <jot@cray.com> contributed the Cray support.
|
||||
|
||||
There are some preprocessor constants that can
|
||||
be defined when compiling for your specific system, for
|
||||
improved efficiency; however, the defaults should be okay.
|
||||
|
||||
The general concept of this implementation is to keep
|
||||
track of all alloca-allocated blocks, and reclaim any
|
||||
that are found to be deeper in the stack than the current
|
||||
invocation. This heuristic does not reclaim storage as
|
||||
soon as it becomes invalid, but it will do so eventually.
|
||||
|
||||
As a special case, alloca(0) reclaims storage without
|
||||
allocating any. It is a good idea to use alloca(0) in
|
||||
your main control loop, etc. to force garbage collection. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <alloca.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/* If compiling with GCC or clang, this file is not needed. */
|
||||
#if !(defined __GNUC__ || defined __clang__)
|
||||
|
||||
/* If someone has defined alloca as a macro,
|
||||
there must be some other way alloca is supposed to work. */
|
||||
# ifndef alloca
|
||||
|
||||
/* Define STACK_DIRECTION if you know the direction of stack
|
||||
growth for your system; otherwise it will be automatically
|
||||
deduced at run-time.
|
||||
|
||||
STACK_DIRECTION > 0 => grows toward higher addresses
|
||||
STACK_DIRECTION < 0 => grows toward lower addresses
|
||||
STACK_DIRECTION = 0 => direction of growth unknown */
|
||||
|
||||
# ifndef STACK_DIRECTION
|
||||
# define STACK_DIRECTION 0 /* Direction unknown. */
|
||||
# endif
|
||||
|
||||
# if STACK_DIRECTION != 0
|
||||
|
||||
# define STACK_DIR STACK_DIRECTION /* Known at compile-time. */
|
||||
|
||||
# else /* STACK_DIRECTION == 0; need run-time code. */
|
||||
|
||||
static int stack_dir; /* 1 or -1 once known. */
|
||||
# define STACK_DIR stack_dir
|
||||
|
||||
static int
|
||||
find_stack_direction (int *addr, int depth)
|
||||
{
|
||||
int dir, dummy = 0;
|
||||
if (! addr)
|
||||
addr = &dummy;
|
||||
*addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1;
|
||||
dir = depth ? find_stack_direction (addr, depth - 1) : 0;
|
||||
return dir + dummy;
|
||||
}
|
||||
|
||||
# endif /* STACK_DIRECTION == 0 */
|
||||
|
||||
/* An "alloca header" is used to:
|
||||
(a) chain together all alloca'ed blocks;
|
||||
(b) keep track of stack depth.
|
||||
|
||||
It is very important that sizeof(header) agree with malloc
|
||||
alignment chunk size. The following default should work okay. */
|
||||
|
||||
# ifndef ALIGN_SIZE
|
||||
# define ALIGN_SIZE sizeof(double)
|
||||
# endif
|
||||
|
||||
typedef union hdr
|
||||
{
|
||||
char align[ALIGN_SIZE]; /* To force sizeof(header). */
|
||||
struct
|
||||
{
|
||||
union hdr *next; /* For chaining headers. */
|
||||
char *deep; /* For stack depth measure. */
|
||||
} h;
|
||||
} header;
|
||||
|
||||
static header *last_alloca_header = NULL; /* -> last alloca header. */
|
||||
|
||||
/* Return a pointer to at least SIZE bytes of storage,
|
||||
which will be automatically reclaimed upon exit from
|
||||
the procedure that called alloca. Originally, this space
|
||||
was supposed to be taken from the current stack frame of the
|
||||
caller, but that method cannot be made to work for some
|
||||
implementations of C, for example under Gould's UTX/32. */
|
||||
|
||||
void *
|
||||
alloca (size_t size)
|
||||
{
|
||||
auto char probe; /* Probes stack depth: */
|
||||
register char *depth = &probe;
|
||||
|
||||
# if STACK_DIRECTION == 0
|
||||
if (STACK_DIR == 0) /* Unknown growth direction. */
|
||||
STACK_DIR = find_stack_direction (NULL, (size & 1) + 20);
|
||||
# endif
|
||||
|
||||
/* Reclaim garbage, defined as all alloca'd storage that
|
||||
was allocated from deeper in the stack than currently. */
|
||||
|
||||
{
|
||||
register header *hp; /* Traverses linked list. */
|
||||
|
||||
for (hp = last_alloca_header; hp != NULL;)
|
||||
if ((STACK_DIR > 0 && hp->h.deep > depth)
|
||||
|| (STACK_DIR < 0 && hp->h.deep < depth))
|
||||
{
|
||||
register header *np = hp->h.next;
|
||||
|
||||
free (hp); /* Collect garbage. */
|
||||
|
||||
hp = np; /* -> next header. */
|
||||
}
|
||||
else
|
||||
break; /* Rest are not deeper. */
|
||||
|
||||
last_alloca_header = hp; /* -> last valid storage. */
|
||||
}
|
||||
|
||||
if (size == 0)
|
||||
return NULL; /* No allocation required. */
|
||||
|
||||
/* Allocate combined header + user data storage. */
|
||||
|
||||
{
|
||||
/* Address of header. */
|
||||
register header *new;
|
||||
|
||||
size_t combined_size = sizeof (header) + size;
|
||||
if (combined_size < sizeof (header))
|
||||
memory_full ();
|
||||
|
||||
new = malloc (combined_size);
|
||||
|
||||
if (! new)
|
||||
memory_full ();
|
||||
|
||||
new->h.next = last_alloca_header;
|
||||
new->h.deep = depth;
|
||||
|
||||
last_alloca_header = new;
|
||||
|
||||
/* User storage begins just after header. */
|
||||
|
||||
return (void *) (new + 1);
|
||||
}
|
||||
}
|
||||
|
||||
# endif /* no alloca */
|
||||
#endif /* not GCC || clang */
|
||||
@@ -0,0 +1,72 @@
|
||||
/* Memory allocation on the stack.
|
||||
|
||||
Copyright (C) 1995, 1999, 2001-2004, 2006-2022 Free Software Foundation,
|
||||
Inc.
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This file 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 Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Avoid using the symbol _ALLOCA_H here, as Bison assumes _ALLOCA_H
|
||||
means there is a real alloca function. */
|
||||
#ifndef _GL_ALLOCA_H
|
||||
#define _GL_ALLOCA_H
|
||||
|
||||
/* alloca (N) returns a pointer to N bytes of memory
|
||||
allocated on the stack, which will last until the function returns.
|
||||
Use of alloca should be avoided:
|
||||
- inside arguments of function calls - undefined behaviour,
|
||||
- in inline functions - the allocation may actually last until the
|
||||
calling function returns,
|
||||
- for huge N (say, N >= 65536) - you never know how large (or small)
|
||||
the stack is, and when the stack cannot fulfill the memory allocation
|
||||
request, the program just crashes.
|
||||
*/
|
||||
|
||||
#ifndef alloca
|
||||
/* Some version of mingw have an <alloca.h> that causes trouble when
|
||||
included after 'alloca' gets defined as a macro. As a workaround,
|
||||
include this <alloca.h> first and define 'alloca' as a macro afterwards
|
||||
if needed. */
|
||||
# if defined __GNUC__ && (defined _WIN32 && ! defined __CYGWIN__) && @HAVE_ALLOCA_H@
|
||||
# include_next <alloca.h>
|
||||
# endif
|
||||
#endif
|
||||
#ifndef alloca
|
||||
# if defined __GNUC__ || (__clang_major__ >= 4)
|
||||
# define alloca __builtin_alloca
|
||||
# elif defined _AIX
|
||||
# define alloca __alloca
|
||||
# elif defined _MSC_VER
|
||||
# include <malloc.h>
|
||||
# define alloca _alloca
|
||||
# elif defined __DECC && defined __VMS
|
||||
# define alloca __ALLOCA
|
||||
# elif defined __TANDEM && defined _TNS_E_TARGET
|
||||
# ifdef __cplusplus
|
||||
extern "C"
|
||||
# endif
|
||||
void *_alloca (unsigned short);
|
||||
# pragma intrinsic (_alloca)
|
||||
# define alloca _alloca
|
||||
# elif defined __MVS__
|
||||
# include <stdlib.h>
|
||||
# else
|
||||
# include <stddef.h>
|
||||
# ifdef __cplusplus
|
||||
extern "C"
|
||||
# endif
|
||||
void *alloca (size_t);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif /* _GL_ALLOCA_H */
|
||||
@@ -0,0 +1,73 @@
|
||||
/* Construct a full filename from a directory and a relative filename.
|
||||
Copyright (C) 2001-2004, 2006-2022 Free Software Foundation, Inc.
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This file 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 Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Bruno Haible <haible@clisp.cons.org>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#include "concat-filename.h"
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "filename.h"
|
||||
|
||||
/* Concatenate a directory filename, a relative filename and an optional
|
||||
suffix. The directory may end with the directory separator. The second
|
||||
argument may not start with the directory separator (it is relative).
|
||||
Return a freshly allocated filename. Return NULL and set errno
|
||||
upon memory allocation failure. */
|
||||
char *
|
||||
concatenated_filename (const char *directory, const char *filename,
|
||||
const char *suffix)
|
||||
{
|
||||
char *result;
|
||||
char *p;
|
||||
|
||||
if (strcmp (directory, ".") == 0)
|
||||
{
|
||||
/* No need to prepend the directory. */
|
||||
result = (char *) malloc (strlen (filename)
|
||||
+ (suffix != NULL ? strlen (suffix) : 0)
|
||||
+ 1);
|
||||
if (result == NULL)
|
||||
return NULL; /* errno is set here */
|
||||
p = result;
|
||||
}
|
||||
else
|
||||
{
|
||||
size_t directory_len = strlen (directory);
|
||||
int need_slash =
|
||||
(directory_len > FILE_SYSTEM_PREFIX_LEN (directory)
|
||||
&& !ISSLASH (directory[directory_len - 1]));
|
||||
result = (char *) malloc (directory_len + need_slash
|
||||
+ strlen (filename)
|
||||
+ (suffix != NULL ? strlen (suffix) : 0)
|
||||
+ 1);
|
||||
if (result == NULL)
|
||||
return NULL; /* errno is set here */
|
||||
memcpy (result, directory, directory_len);
|
||||
p = result + directory_len;
|
||||
if (need_slash)
|
||||
*p++ = '/';
|
||||
}
|
||||
p = stpcpy (p, filename);
|
||||
if (suffix != NULL)
|
||||
stpcpy (p, suffix);
|
||||
return result;
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/* Construct a full filename from a directory and a relative filename.
|
||||
Copyright (C) 2001-2004, 2007-2022 Free Software Foundation, Inc.
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This file 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 Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _CONCAT_FILENAME_H
|
||||
#define _CONCAT_FILENAME_H
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/* Concatenate a directory filename, a relative filename and an optional
|
||||
suffix. Return a freshly allocated filename. Return NULL and set errno
|
||||
upon memory allocation failure. */
|
||||
extern char *concatenated_filename (const char *directory,
|
||||
const char *filename, const char *suffix)
|
||||
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
|
||||
|
||||
/* Concatenate a directory filename, a relative filename and an optional
|
||||
suffix. Return a freshly allocated filename. */
|
||||
extern char *xconcatenated_filename (const char *directory,
|
||||
const char *filename, const char *suffix)
|
||||
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
|
||||
_GL_ATTRIBUTE_RETURNS_NONNULL;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _CONCAT_FILENAME_H */
|
||||
@@ -0,0 +1,112 @@
|
||||
/* Basic filename support macros.
|
||||
Copyright (C) 2001-2022 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
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* From Paul Eggert and Jim Meyering. */
|
||||
|
||||
#ifndef _FILENAME_H
|
||||
#define _FILENAME_H
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/* Filename support.
|
||||
ISSLASH(C) tests whether C is a directory separator
|
||||
character.
|
||||
HAS_DEVICE(Filename) tests whether Filename contains a device
|
||||
specification.
|
||||
FILE_SYSTEM_PREFIX_LEN(Filename) length of the device specification
|
||||
at the beginning of Filename,
|
||||
index of the part consisting of
|
||||
alternating components and slashes.
|
||||
FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
|
||||
1 when a non-empty device specification
|
||||
can be followed by an empty or relative
|
||||
part,
|
||||
0 when a non-empty device specification
|
||||
must be followed by a slash,
|
||||
0 when device specification don't exist.
|
||||
IS_ABSOLUTE_FILE_NAME(Filename)
|
||||
tests whether Filename is independent of
|
||||
any notion of "current directory".
|
||||
IS_RELATIVE_FILE_NAME(Filename)
|
||||
tests whether Filename may be concatenated
|
||||
to a directory filename.
|
||||
Note: On native Windows, OS/2, DOS, "c:" is neither an absolute nor a
|
||||
relative file name!
|
||||
IS_FILE_NAME_WITH_DIR(Filename) tests whether Filename contains a device
|
||||
or directory specification.
|
||||
*/
|
||||
#if defined _WIN32 || defined __CYGWIN__ \
|
||||
|| defined __EMX__ || defined __MSDOS__ || defined __DJGPP__
|
||||
/* Native Windows, Cygwin, OS/2, DOS */
|
||||
# define ISSLASH(C) ((C) == '/' || (C) == '\\')
|
||||
/* Internal macro: Tests whether a character is a drive letter. */
|
||||
# define _IS_DRIVE_LETTER(C) \
|
||||
(((C) >= 'A' && (C) <= 'Z') || ((C) >= 'a' && (C) <= 'z'))
|
||||
/* Help the compiler optimizing it. This assumes ASCII. */
|
||||
# undef _IS_DRIVE_LETTER
|
||||
# define _IS_DRIVE_LETTER(C) \
|
||||
(((unsigned int) (C) | ('a' - 'A')) - 'a' <= 'z' - 'a')
|
||||
# define HAS_DEVICE(Filename) \
|
||||
(_IS_DRIVE_LETTER ((Filename)[0]) && (Filename)[1] == ':')
|
||||
# define FILE_SYSTEM_PREFIX_LEN(Filename) (HAS_DEVICE (Filename) ? 2 : 0)
|
||||
# ifdef __CYGWIN__
|
||||
# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 0
|
||||
# else
|
||||
/* On native Windows, OS/2, DOS, the system has the notion of a
|
||||
"current directory" on each drive. */
|
||||
# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 1
|
||||
# endif
|
||||
# if FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
|
||||
# define IS_ABSOLUTE_FILE_NAME(Filename) \
|
||||
ISSLASH ((Filename)[FILE_SYSTEM_PREFIX_LEN (Filename)])
|
||||
# else
|
||||
# define IS_ABSOLUTE_FILE_NAME(Filename) \
|
||||
(ISSLASH ((Filename)[0]) || HAS_DEVICE (Filename))
|
||||
# endif
|
||||
# define IS_RELATIVE_FILE_NAME(Filename) \
|
||||
(! (ISSLASH ((Filename)[0]) || HAS_DEVICE (Filename)))
|
||||
# define IS_FILE_NAME_WITH_DIR(Filename) \
|
||||
(strchr ((Filename), '/') != NULL || strchr ((Filename), '\\') != NULL \
|
||||
|| HAS_DEVICE (Filename))
|
||||
#else
|
||||
/* Unix */
|
||||
# define ISSLASH(C) ((C) == '/')
|
||||
# define HAS_DEVICE(Filename) ((void) (Filename), 0)
|
||||
# define FILE_SYSTEM_PREFIX_LEN(Filename) ((void) (Filename), 0)
|
||||
# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 0
|
||||
# define IS_ABSOLUTE_FILE_NAME(Filename) ISSLASH ((Filename)[0])
|
||||
# define IS_RELATIVE_FILE_NAME(Filename) (! ISSLASH ((Filename)[0]))
|
||||
# define IS_FILE_NAME_WITH_DIR(Filename) (strchr ((Filename), '/') != NULL)
|
||||
#endif
|
||||
|
||||
/* Deprecated macros. For backward compatibility with old users of the
|
||||
'filename' module. */
|
||||
#define IS_ABSOLUTE_PATH IS_ABSOLUTE_FILE_NAME
|
||||
#define IS_PATH_WITH_DIR IS_FILE_NAME_WITH_DIR
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _FILENAME_H */
|
||||
@@ -0,0 +1,399 @@
|
||||
/* Locating a program in a given path.
|
||||
Copyright (C) 2001-2004, 2006-2022 Free Software Foundation, Inc.
|
||||
Written by Bruno Haible <haible@clisp.cons.org>, 2001, 2019.
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This file 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 Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#include "findprog.h"
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "filename.h"
|
||||
#include "concat-filename.h"
|
||||
|
||||
#if (defined _WIN32 && !defined __CYGWIN__) || defined __EMX__ || defined __DJGPP__
|
||||
/* Native Windows, OS/2, DOS */
|
||||
# define NATIVE_SLASH '\\'
|
||||
#else
|
||||
/* Unix */
|
||||
# define NATIVE_SLASH '/'
|
||||
#endif
|
||||
|
||||
/* Separator in PATH like lists of pathnames. */
|
||||
#if (defined _WIN32 && !defined __CYGWIN__) || defined __EMX__ || defined __DJGPP__
|
||||
/* Native Windows, OS/2, DOS */
|
||||
# define PATH_SEPARATOR ';'
|
||||
#else
|
||||
/* Unix */
|
||||
# define PATH_SEPARATOR ':'
|
||||
#endif
|
||||
|
||||
/* The list of suffixes that the execlp/execvp function tries when searching
|
||||
for the program. */
|
||||
static const char * const suffixes[] =
|
||||
{
|
||||
#if defined _WIN32 && !defined __CYGWIN__ /* Native Windows */
|
||||
"", ".com", ".exe", ".bat", ".cmd"
|
||||
/* Note: Files without any suffix are not considered executable. */
|
||||
/* Note: The cmd.exe program does a different lookup: It searches according
|
||||
to the PATHEXT environment variable.
|
||||
See <https://stackoverflow.com/questions/7839150/>.
|
||||
Also, it executes files ending in .bat and .cmd directly without letting
|
||||
the kernel interpret the program file. */
|
||||
#elif defined __CYGWIN__
|
||||
"", ".exe", ".com"
|
||||
#elif defined __EMX__
|
||||
"", ".exe"
|
||||
#elif defined __DJGPP__
|
||||
"", ".com", ".exe", ".bat"
|
||||
#else /* Unix */
|
||||
""
|
||||
#endif
|
||||
};
|
||||
|
||||
const char *
|
||||
find_in_given_path (const char *progname, const char *path,
|
||||
const char *directory, bool optimize_for_exec)
|
||||
{
|
||||
{
|
||||
bool has_slash = false;
|
||||
{
|
||||
const char *p;
|
||||
|
||||
for (p = progname; *p != '\0'; p++)
|
||||
if (ISSLASH (*p))
|
||||
{
|
||||
has_slash = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (has_slash)
|
||||
{
|
||||
/* If progname contains a slash, it is either absolute or relative to
|
||||
the current directory. PATH is not used. */
|
||||
if (optimize_for_exec)
|
||||
/* The execl/execv/execlp/execvp functions will try the various
|
||||
suffixes anyway and fail if no executable is found. */
|
||||
return progname;
|
||||
else
|
||||
{
|
||||
/* Try the various suffixes and see whether one of the files
|
||||
with such a suffix is actually executable. */
|
||||
int failure_errno;
|
||||
size_t i;
|
||||
|
||||
const char *directory_as_prefix =
|
||||
(directory != NULL && IS_RELATIVE_FILE_NAME (progname)
|
||||
? directory
|
||||
: "");
|
||||
|
||||
#if defined _WIN32 && !defined __CYGWIN__ /* Native Windows */
|
||||
const char *progbasename;
|
||||
|
||||
{
|
||||
const char *p;
|
||||
|
||||
progbasename = progname;
|
||||
for (p = progname; *p != '\0'; p++)
|
||||
if (ISSLASH (*p))
|
||||
progbasename = p + 1;
|
||||
}
|
||||
|
||||
bool progbasename_has_dot = (strchr (progbasename, '.') != NULL);
|
||||
#endif
|
||||
|
||||
/* Try all platform-dependent suffixes. */
|
||||
failure_errno = ENOENT;
|
||||
for (i = 0; i < sizeof (suffixes) / sizeof (suffixes[0]); i++)
|
||||
{
|
||||
const char *suffix = suffixes[i];
|
||||
|
||||
#if defined _WIN32 && !defined __CYGWIN__ /* Native Windows */
|
||||
/* File names without a '.' are not considered executable, and
|
||||
for file names with a '.' no additional suffix is tried. */
|
||||
if ((*suffix != '\0') != progbasename_has_dot)
|
||||
#endif
|
||||
{
|
||||
/* Concatenate directory_as_prefix, progname, suffix. */
|
||||
char *progpathname =
|
||||
concatenated_filename (directory_as_prefix, progname,
|
||||
suffix);
|
||||
|
||||
if (progpathname == NULL)
|
||||
return NULL; /* errno is set here */
|
||||
|
||||
/* On systems which have the eaccess() system call, let's
|
||||
use it. On other systems, let's hope that this program
|
||||
is not installed setuid or setgid, so that it is ok to
|
||||
call access() despite its design flaw. */
|
||||
if (eaccess (progpathname, X_OK) == 0)
|
||||
{
|
||||
/* Check that the progpathname does not point to a
|
||||
directory. */
|
||||
struct stat statbuf;
|
||||
|
||||
if (stat (progpathname, &statbuf) >= 0)
|
||||
{
|
||||
if (! S_ISDIR (statbuf.st_mode))
|
||||
{
|
||||
/* Found! */
|
||||
if (strcmp (progpathname, progname) == 0)
|
||||
{
|
||||
free (progpathname);
|
||||
return progname;
|
||||
}
|
||||
else
|
||||
return progpathname;
|
||||
}
|
||||
|
||||
errno = EACCES;
|
||||
}
|
||||
}
|
||||
|
||||
if (errno != ENOENT)
|
||||
failure_errno = errno;
|
||||
|
||||
free (progpathname);
|
||||
}
|
||||
}
|
||||
#if defined _WIN32 && !defined __CYGWIN__ /* Native Windows */
|
||||
if (failure_errno == ENOENT && !progbasename_has_dot)
|
||||
{
|
||||
/* In the loop above, we skipped suffix = "". Do this loop
|
||||
round now, merely to provide a better errno than ENOENT. */
|
||||
|
||||
char *progpathname =
|
||||
concatenated_filename (directory_as_prefix, progname, "");
|
||||
|
||||
if (progpathname == NULL)
|
||||
return NULL; /* errno is set here */
|
||||
|
||||
if (eaccess (progpathname, X_OK) == 0)
|
||||
{
|
||||
struct stat statbuf;
|
||||
|
||||
if (stat (progpathname, &statbuf) >= 0)
|
||||
{
|
||||
if (! S_ISDIR (statbuf.st_mode))
|
||||
errno = ENOEXEC;
|
||||
else
|
||||
errno = EACCES;
|
||||
}
|
||||
}
|
||||
|
||||
failure_errno = errno;
|
||||
|
||||
free (progpathname);
|
||||
}
|
||||
#endif
|
||||
|
||||
errno = failure_errno;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (path == NULL)
|
||||
/* If PATH is not set, the default search path is implementation dependent.
|
||||
In practice, it is treated like an empty PATH. */
|
||||
path = "";
|
||||
|
||||
{
|
||||
/* Make a copy, to prepare for destructive modifications. */
|
||||
char *path_copy = strdup (path);
|
||||
if (path_copy == NULL)
|
||||
return NULL; /* errno is set here */
|
||||
|
||||
int failure_errno;
|
||||
char *path_rest;
|
||||
char *cp;
|
||||
|
||||
#if defined _WIN32 && !defined __CYGWIN__ /* Native Windows */
|
||||
bool progname_has_dot = (strchr (progname, '.') != NULL);
|
||||
#endif
|
||||
|
||||
failure_errno = ENOENT;
|
||||
for (path_rest = path_copy; ; path_rest = cp + 1)
|
||||
{
|
||||
const char *dir;
|
||||
bool last;
|
||||
char *dir_as_prefix_to_free;
|
||||
const char *dir_as_prefix;
|
||||
size_t i;
|
||||
|
||||
/* Extract next directory in PATH. */
|
||||
dir = path_rest;
|
||||
for (cp = path_rest; *cp != '\0' && *cp != PATH_SEPARATOR; cp++)
|
||||
;
|
||||
last = (*cp == '\0');
|
||||
*cp = '\0';
|
||||
|
||||
/* Empty PATH components designate the current directory. */
|
||||
if (dir == cp)
|
||||
dir = ".";
|
||||
|
||||
/* Concatenate directory and dir. */
|
||||
if (directory != NULL && IS_RELATIVE_FILE_NAME (dir))
|
||||
{
|
||||
dir_as_prefix_to_free =
|
||||
concatenated_filename (directory, dir, NULL);
|
||||
if (dir_as_prefix_to_free == NULL)
|
||||
{
|
||||
/* errno is set here. */
|
||||
failure_errno = errno;
|
||||
goto failed;
|
||||
}
|
||||
dir_as_prefix = dir_as_prefix_to_free;
|
||||
}
|
||||
else
|
||||
{
|
||||
dir_as_prefix_to_free = NULL;
|
||||
dir_as_prefix = dir;
|
||||
}
|
||||
|
||||
/* Try all platform-dependent suffixes. */
|
||||
for (i = 0; i < sizeof (suffixes) / sizeof (suffixes[0]); i++)
|
||||
{
|
||||
const char *suffix = suffixes[i];
|
||||
|
||||
#if defined _WIN32 && !defined __CYGWIN__ /* Native Windows */
|
||||
/* File names without a '.' are not considered executable, and
|
||||
for file names with a '.' no additional suffix is tried. */
|
||||
if ((*suffix != '\0') != progname_has_dot)
|
||||
#endif
|
||||
{
|
||||
/* Concatenate dir_as_prefix, progname, and suffix. */
|
||||
char *progpathname =
|
||||
concatenated_filename (dir_as_prefix, progname, suffix);
|
||||
|
||||
if (progpathname == NULL)
|
||||
{
|
||||
/* errno is set here. */
|
||||
failure_errno = errno;
|
||||
free (dir_as_prefix_to_free);
|
||||
goto failed;
|
||||
}
|
||||
|
||||
/* On systems which have the eaccess() system call, let's
|
||||
use it. On other systems, let's hope that this program
|
||||
is not installed setuid or setgid, so that it is ok to
|
||||
call access() despite its design flaw. */
|
||||
if (eaccess (progpathname, X_OK) == 0)
|
||||
{
|
||||
/* Check that the progpathname does not point to a
|
||||
directory. */
|
||||
struct stat statbuf;
|
||||
|
||||
if (stat (progpathname, &statbuf) >= 0)
|
||||
{
|
||||
if (! S_ISDIR (statbuf.st_mode))
|
||||
{
|
||||
/* Found! */
|
||||
if (strcmp (progpathname, progname) == 0)
|
||||
{
|
||||
free (progpathname);
|
||||
|
||||
/* Add the "./" prefix for real, that
|
||||
concatenated_filename() optimized away.
|
||||
This avoids a second PATH search when the
|
||||
caller uses execl/execv/execlp/execvp. */
|
||||
progpathname =
|
||||
(char *) malloc (2 + strlen (progname) + 1);
|
||||
if (progpathname == NULL)
|
||||
{
|
||||
/* errno is set here. */
|
||||
failure_errno = errno;
|
||||
free (dir_as_prefix_to_free);
|
||||
goto failed;
|
||||
}
|
||||
progpathname[0] = '.';
|
||||
progpathname[1] = NATIVE_SLASH;
|
||||
memcpy (progpathname + 2, progname,
|
||||
strlen (progname) + 1);
|
||||
}
|
||||
|
||||
free (dir_as_prefix_to_free);
|
||||
free (path_copy);
|
||||
return progpathname;
|
||||
}
|
||||
|
||||
errno = EACCES;
|
||||
}
|
||||
}
|
||||
|
||||
if (errno != ENOENT)
|
||||
failure_errno = errno;
|
||||
|
||||
free (progpathname);
|
||||
}
|
||||
}
|
||||
#if defined _WIN32 && !defined __CYGWIN__ /* Native Windows */
|
||||
if (failure_errno == ENOENT && !progname_has_dot)
|
||||
{
|
||||
/* In the loop above, we skipped suffix = "". Do this loop
|
||||
round now, merely to provide a better errno than ENOENT. */
|
||||
|
||||
char *progpathname =
|
||||
concatenated_filename (dir_as_prefix, progname, "");
|
||||
|
||||
if (progpathname == NULL)
|
||||
{
|
||||
/* errno is set here. */
|
||||
failure_errno = errno;
|
||||
free (dir_as_prefix_to_free);
|
||||
goto failed;
|
||||
}
|
||||
|
||||
if (eaccess (progpathname, X_OK) == 0)
|
||||
{
|
||||
struct stat statbuf;
|
||||
|
||||
if (stat (progpathname, &statbuf) >= 0)
|
||||
{
|
||||
if (! S_ISDIR (statbuf.st_mode))
|
||||
errno = ENOEXEC;
|
||||
else
|
||||
errno = EACCES;
|
||||
}
|
||||
}
|
||||
|
||||
failure_errno = errno;
|
||||
|
||||
free (progpathname);
|
||||
}
|
||||
#endif
|
||||
|
||||
free (dir_as_prefix_to_free);
|
||||
|
||||
if (last)
|
||||
break;
|
||||
}
|
||||
|
||||
failed:
|
||||
/* Not found in PATH. */
|
||||
free (path_copy);
|
||||
|
||||
errno = failure_errno;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
/* Locating a program in PATH.
|
||||
Copyright (C) 2001-2003, 2009-2022 Free Software Foundation, Inc.
|
||||
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This file 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 Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _FINDPROG_H
|
||||
#define _FINDPROG_H
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/* Looks up a program in the PATH.
|
||||
Attempts to determine the pathname that would be called by execlp/execvp
|
||||
of PROGNAME. If successful, it returns a pathname containing a slash
|
||||
(either absolute or relative to the current directory). Otherwise, it
|
||||
returns PROGNAME unmodified.
|
||||
Because of the latter case, callers should use execlp/execvp, not
|
||||
execl/execv on the returned pathname.
|
||||
The returned string is freshly malloc()ed if it is != PROGNAME. */
|
||||
extern const char *find_in_path (const char *progname);
|
||||
|
||||
/* Looks up a program in the given PATH-like string.
|
||||
|
||||
The PATH argument consists of a list of directories, separated by ':' or
|
||||
(on native Windows) by ';'. An empty PATH element designates the current
|
||||
directory. A null PATH is equivalent to an empty PATH, that is, to the
|
||||
singleton list that contains only the current directory.
|
||||
|
||||
If DIRECTORY is not NULL, all relative filenames (i.e. PROGNAME when it
|
||||
contains a slash, and the PATH elements) are considered relative to
|
||||
DIRECTORY instead of relative to the current directory of this process.
|
||||
|
||||
Determines the pathname that would be called by execlp/execvp of PROGNAME.
|
||||
- If successful, it returns a pathname containing a slash (either absolute
|
||||
or relative to the current directory). The returned string can be used
|
||||
with either execl/execv or execlp/execvp. It is freshly malloc()ed if it
|
||||
is != PROGNAME.
|
||||
- Otherwise, it sets errno and returns NULL.
|
||||
Specific errno values include:
|
||||
- ENOENT: means that the program's file was not found.
|
||||
- EACCES: means that the program's file cannot be accessed (due to some
|
||||
issue with one of the ancestor directories) or lacks the execute
|
||||
permissions.
|
||||
- ENOMEM: means out of memory.
|
||||
If OPTIMIZE_FOR_EXEC is true, the function saves some work, under the
|
||||
assumption that the resulting pathname will not be accessed directly,
|
||||
only through execl/execv or execlp/execvp.
|
||||
|
||||
Here, a "slash" means:
|
||||
- On POSIX systems excluding Cygwin: a '/',
|
||||
- On Windows, OS/2, DOS platforms: a '/' or '\'. */
|
||||
extern const char *find_in_given_path (const char *progname, const char *path,
|
||||
const char *directory,
|
||||
bool optimize_for_exec);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _FINDPROG_H */
|
||||
@@ -0,0 +1,489 @@
|
||||
/* Copyright (C) 1991, 1992, 1993, 1996, 1997, 1998, 1999 Free Software
|
||||
Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to the Free
|
||||
Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
|
||||
USA. */
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
/* Enable GNU extensions in fnmatch.h. */
|
||||
#ifndef _GNU_SOURCE
|
||||
# define _GNU_SOURCE 1
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
#include <fnmatch.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#if HAVE_STRING_H || defined _LIBC
|
||||
# include <string.h>
|
||||
#else
|
||||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
#if defined STDC_HEADERS || defined _LIBC
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
|
||||
/* For platform which support the ISO C amendement 1 functionality we
|
||||
support user defined character classes. */
|
||||
#if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
|
||||
/* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>. */
|
||||
# include <wchar.h>
|
||||
# include <wctype.h>
|
||||
#endif
|
||||
|
||||
/* Comment out all this code if we are using the GNU C Library, and are not
|
||||
actually compiling the library itself. This code is part of the GNU C
|
||||
Library, but also included in many other GNU distributions. Compiling
|
||||
and linking in this code is a waste when using the GNU C library
|
||||
(especially if it is a shared library). Rather than having every GNU
|
||||
program understand `configure --with-gnu-libc' and omit the object files,
|
||||
it is simpler to just do this in the source for each such file. */
|
||||
|
||||
#if defined _LIBC || !defined __GNU_LIBRARY__
|
||||
|
||||
|
||||
# if defined STDC_HEADERS || !defined isascii
|
||||
# define ISASCII(c) 1
|
||||
# else
|
||||
# define ISASCII(c) isascii(c)
|
||||
# endif
|
||||
|
||||
# ifdef isblank
|
||||
# define ISBLANK(c) (ISASCII (c) && isblank (c))
|
||||
# else
|
||||
# define ISBLANK(c) ((c) == ' ' || (c) == '\t')
|
||||
# endif
|
||||
# ifdef isgraph
|
||||
# define ISGRAPH(c) (ISASCII (c) && isgraph (c))
|
||||
# else
|
||||
# define ISGRAPH(c) (ISASCII (c) && isprint (c) && !isspace (c))
|
||||
# endif
|
||||
|
||||
# define ISPRINT(c) (ISASCII (c) && isprint (c))
|
||||
# define ISDIGIT(c) (ISASCII (c) && isdigit (c))
|
||||
# define ISALNUM(c) (ISASCII (c) && isalnum (c))
|
||||
# define ISALPHA(c) (ISASCII (c) && isalpha (c))
|
||||
# define ISCNTRL(c) (ISASCII (c) && iscntrl (c))
|
||||
# define ISLOWER(c) (ISASCII (c) && islower (c))
|
||||
# define ISPUNCT(c) (ISASCII (c) && ispunct (c))
|
||||
# define ISSPACE(c) (ISASCII (c) && isspace (c))
|
||||
# define ISUPPER(c) (ISASCII (c) && isupper (c))
|
||||
# define ISXDIGIT(c) (ISASCII (c) && isxdigit (c))
|
||||
|
||||
# define STREQ(s1, s2) ((strcmp (s1, s2) == 0))
|
||||
|
||||
# if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
|
||||
/* The GNU C library provides support for user-defined character classes
|
||||
and the functions from ISO C amendement 1. */
|
||||
# ifdef CHARCLASS_NAME_MAX
|
||||
# define CHAR_CLASS_MAX_LENGTH CHARCLASS_NAME_MAX
|
||||
# else
|
||||
/* This shouldn't happen but some implementation might still have this
|
||||
problem. Use a reasonable default value. */
|
||||
# define CHAR_CLASS_MAX_LENGTH 256
|
||||
# endif
|
||||
|
||||
# ifdef _LIBC
|
||||
# define IS_CHAR_CLASS(string) __wctype (string)
|
||||
# else
|
||||
# define IS_CHAR_CLASS(string) wctype (string)
|
||||
# endif
|
||||
# else
|
||||
# define CHAR_CLASS_MAX_LENGTH 6 /* Namely, `xdigit'. */
|
||||
|
||||
# define IS_CHAR_CLASS(string) \
|
||||
(STREQ (string, "alpha") || STREQ (string, "upper") \
|
||||
|| STREQ (string, "lower") || STREQ (string, "digit") \
|
||||
|| STREQ (string, "alnum") || STREQ (string, "xdigit") \
|
||||
|| STREQ (string, "space") || STREQ (string, "print") \
|
||||
|| STREQ (string, "punct") || STREQ (string, "graph") \
|
||||
|| STREQ (string, "cntrl") || STREQ (string, "blank"))
|
||||
# endif
|
||||
|
||||
/* Avoid depending on library functions or files
|
||||
whose names are inconsistent. */
|
||||
|
||||
# if !defined _LIBC && !defined getenv
|
||||
extern char *getenv ();
|
||||
# endif
|
||||
|
||||
# ifndef errno
|
||||
extern int errno;
|
||||
# endif
|
||||
|
||||
/* This function doesn't exist on most systems. */
|
||||
|
||||
# if !defined HAVE___STRCHRNUL && !defined _LIBC
|
||||
static char *
|
||||
__strchrnul (s, c)
|
||||
const char *s;
|
||||
int c;
|
||||
{
|
||||
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
|
||||
internal_function
|
||||
internal_fnmatch (pattern, string, no_leading_period, flags)
|
||||
const char *pattern;
|
||||
const char *string;
|
||||
int no_leading_period;
|
||||
int flags;
|
||||
{
|
||||
register const char *p = pattern, *n = string;
|
||||
register unsigned char c;
|
||||
|
||||
/* Note that this evaluates C many times. */
|
||||
# ifdef _LIBC
|
||||
# define FOLD(c) ((flags & FNM_CASEFOLD) ? tolower (c) : (c))
|
||||
# else
|
||||
# define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) : (c))
|
||||
# endif
|
||||
|
||||
while ((c = *p++) != '\0')
|
||||
{
|
||||
c = FOLD (c);
|
||||
|
||||
switch (c)
|
||||
{
|
||||
case '?':
|
||||
if (*n == '\0')
|
||||
return FNM_NOMATCH;
|
||||
else if (*n == '/' && (flags & FNM_FILE_NAME))
|
||||
return FNM_NOMATCH;
|
||||
else if (*n == '.' && no_leading_period
|
||||
&& (n == string
|
||||
|| (n[-1] == '/' && (flags & FNM_FILE_NAME))))
|
||||
return FNM_NOMATCH;
|
||||
break;
|
||||
|
||||
case '\\':
|
||||
if (!(flags & FNM_NOESCAPE))
|
||||
{
|
||||
c = *p++;
|
||||
if (c == '\0')
|
||||
/* Trailing \ loses. */
|
||||
return FNM_NOMATCH;
|
||||
c = FOLD (c);
|
||||
}
|
||||
if (FOLD ((unsigned char) *n) != c)
|
||||
return FNM_NOMATCH;
|
||||
break;
|
||||
|
||||
case '*':
|
||||
if (*n == '.' && no_leading_period
|
||||
&& (n == string
|
||||
|| (n[-1] == '/' && (flags & FNM_FILE_NAME))))
|
||||
return FNM_NOMATCH;
|
||||
|
||||
for (c = *p++; c == '?' || c == '*'; c = *p++)
|
||||
{
|
||||
if (*n == '/' && (flags & FNM_FILE_NAME))
|
||||
/* A slash does not match a wildcard under FNM_FILE_NAME. */
|
||||
return FNM_NOMATCH;
|
||||
else if (c == '?')
|
||||
{
|
||||
/* A ? needs to match one character. */
|
||||
if (*n == '\0')
|
||||
/* There isn't another character; no match. */
|
||||
return FNM_NOMATCH;
|
||||
else
|
||||
/* One character of the string is consumed in matching
|
||||
this ? wildcard, so *??? won't match if there are
|
||||
less than three characters. */
|
||||
++n;
|
||||
}
|
||||
}
|
||||
|
||||
if (c == '\0')
|
||||
/* The wildcard(s) is/are the last element of the pattern.
|
||||
If the name is a file name and contains another slash
|
||||
this does mean it cannot match. */
|
||||
return ((flags & FNM_FILE_NAME) && strchr (n, '/') != NULL
|
||||
? FNM_NOMATCH : 0);
|
||||
else
|
||||
{
|
||||
const char *endp;
|
||||
|
||||
endp = __strchrnul (n, (flags & FNM_FILE_NAME) ? '/' : '\0');
|
||||
|
||||
if (c == '[')
|
||||
{
|
||||
int flags2 = ((flags & FNM_FILE_NAME)
|
||||
? flags : (flags & ~FNM_PERIOD));
|
||||
|
||||
for (--p; n < endp; ++n)
|
||||
if (internal_fnmatch (p, n,
|
||||
(no_leading_period
|
||||
&& (n == string
|
||||
|| (n[-1] == '/'
|
||||
&& (flags
|
||||
& FNM_FILE_NAME)))),
|
||||
flags2)
|
||||
== 0)
|
||||
return 0;
|
||||
}
|
||||
else if (c == '/' && (flags & FNM_FILE_NAME))
|
||||
{
|
||||
while (*n != '\0' && *n != '/')
|
||||
++n;
|
||||
if (*n == '/'
|
||||
&& (internal_fnmatch (p, n + 1, flags & FNM_PERIOD,
|
||||
flags) == 0))
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
int flags2 = ((flags & FNM_FILE_NAME)
|
||||
? flags : (flags & ~FNM_PERIOD));
|
||||
|
||||
if (c == '\\' && !(flags & FNM_NOESCAPE))
|
||||
c = *p;
|
||||
c = FOLD (c);
|
||||
for (--p; n < endp; ++n)
|
||||
if (FOLD ((unsigned char) *n) == c
|
||||
&& (internal_fnmatch (p, n,
|
||||
(no_leading_period
|
||||
&& (n == string
|
||||
|| (n[-1] == '/'
|
||||
&& (flags
|
||||
& FNM_FILE_NAME)))),
|
||||
flags2) == 0))
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* If we come here no match is possible with the wildcard. */
|
||||
return FNM_NOMATCH;
|
||||
|
||||
case '[':
|
||||
{
|
||||
/* Nonzero if the sense of the character class is inverted. */
|
||||
static int posixly_correct;
|
||||
register int not;
|
||||
char cold;
|
||||
|
||||
if (posixly_correct == 0)
|
||||
posixly_correct = getenv ("POSIXLY_CORRECT") != NULL ? 1 : -1;
|
||||
|
||||
if (*n == '\0')
|
||||
return FNM_NOMATCH;
|
||||
|
||||
if (*n == '.' && no_leading_period && (n == string
|
||||
|| (n[-1] == '/'
|
||||
&& (flags
|
||||
& FNM_FILE_NAME))))
|
||||
return FNM_NOMATCH;
|
||||
|
||||
if (*n == '/' && (flags & FNM_FILE_NAME))
|
||||
/* `/' cannot be matched. */
|
||||
return FNM_NOMATCH;
|
||||
|
||||
not = (*p == '!' || (posixly_correct < 0 && *p == '^'));
|
||||
if (not)
|
||||
++p;
|
||||
|
||||
c = *p++;
|
||||
for (;;)
|
||||
{
|
||||
unsigned char fn = FOLD ((unsigned char) *n);
|
||||
|
||||
if (!(flags & FNM_NOESCAPE) && c == '\\')
|
||||
{
|
||||
if (*p == '\0')
|
||||
return FNM_NOMATCH;
|
||||
c = FOLD ((unsigned char) *p);
|
||||
++p;
|
||||
|
||||
if (c == fn)
|
||||
goto matched;
|
||||
}
|
||||
else if (c == '[' && *p == ':')
|
||||
{
|
||||
/* Leave room for the null. */
|
||||
char str[CHAR_CLASS_MAX_LENGTH + 1];
|
||||
size_t c1 = 0;
|
||||
# if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
|
||||
wctype_t wt;
|
||||
# endif
|
||||
const char *startp = p;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
if (c1 == CHAR_CLASS_MAX_LENGTH)
|
||||
/* The name is too long and therefore the pattern
|
||||
is ill-formed. */
|
||||
return FNM_NOMATCH;
|
||||
|
||||
c = *++p;
|
||||
if (c == ':' && p[1] == ']')
|
||||
{
|
||||
p += 2;
|
||||
break;
|
||||
}
|
||||
if (c < 'a' || c >= 'z')
|
||||
{
|
||||
/* This cannot possibly be a character class name.
|
||||
Match it as a normal range. */
|
||||
p = startp;
|
||||
c = '[';
|
||||
goto normal_bracket;
|
||||
}
|
||||
str[c1++] = c;
|
||||
}
|
||||
str[c1] = '\0';
|
||||
|
||||
# if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
|
||||
wt = IS_CHAR_CLASS (str);
|
||||
if (wt == 0)
|
||||
/* Invalid character class name. */
|
||||
return FNM_NOMATCH;
|
||||
|
||||
if (__iswctype (__btowc ((unsigned char) *n), wt))
|
||||
goto matched;
|
||||
# else
|
||||
if ((STREQ (str, "alnum") && ISALNUM ((unsigned char) *n))
|
||||
|| (STREQ (str, "alpha") && ISALPHA ((unsigned char) *n))
|
||||
|| (STREQ (str, "blank") && ISBLANK ((unsigned char) *n))
|
||||
|| (STREQ (str, "cntrl") && ISCNTRL ((unsigned char) *n))
|
||||
|| (STREQ (str, "digit") && ISDIGIT ((unsigned char) *n))
|
||||
|| (STREQ (str, "graph") && ISGRAPH ((unsigned char) *n))
|
||||
|| (STREQ (str, "lower") && ISLOWER ((unsigned char) *n))
|
||||
|| (STREQ (str, "print") && ISPRINT ((unsigned char) *n))
|
||||
|| (STREQ (str, "punct") && ISPUNCT ((unsigned char) *n))
|
||||
|| (STREQ (str, "space") && ISSPACE ((unsigned char) *n))
|
||||
|| (STREQ (str, "upper") && ISUPPER ((unsigned char) *n))
|
||||
|| (STREQ (str, "xdigit") && ISXDIGIT ((unsigned char) *n)))
|
||||
goto matched;
|
||||
# endif
|
||||
}
|
||||
else if (c == '\0')
|
||||
/* [ (unterminated) loses. */
|
||||
return FNM_NOMATCH;
|
||||
else
|
||||
{
|
||||
normal_bracket:
|
||||
if (FOLD (c) == fn)
|
||||
goto matched;
|
||||
|
||||
cold = c;
|
||||
c = *p++;
|
||||
|
||||
if (c == '-' && *p != ']')
|
||||
{
|
||||
/* It is a range. */
|
||||
unsigned char cend = *p++;
|
||||
if (!(flags & FNM_NOESCAPE) && cend == '\\')
|
||||
cend = *p++;
|
||||
if (cend == '\0')
|
||||
return FNM_NOMATCH;
|
||||
|
||||
if (cold <= fn && fn <= FOLD (cend))
|
||||
goto matched;
|
||||
|
||||
c = *p++;
|
||||
}
|
||||
}
|
||||
|
||||
if (c == ']')
|
||||
break;
|
||||
}
|
||||
|
||||
if (!not)
|
||||
return FNM_NOMATCH;
|
||||
break;
|
||||
|
||||
matched:
|
||||
/* Skip the rest of the [...] that already matched. */
|
||||
while (c != ']')
|
||||
{
|
||||
if (c == '\0')
|
||||
/* [... (unterminated) loses. */
|
||||
return FNM_NOMATCH;
|
||||
|
||||
c = *p++;
|
||||
if (!(flags & FNM_NOESCAPE) && c == '\\')
|
||||
{
|
||||
if (*p == '\0')
|
||||
return FNM_NOMATCH;
|
||||
/* XXX 1003.2d11 is unclear if this is right. */
|
||||
++p;
|
||||
}
|
||||
else if (c == '[' && *p == ':')
|
||||
{
|
||||
do
|
||||
if (*++p == '\0')
|
||||
return FNM_NOMATCH;
|
||||
while (*p != ':' || p[1] == ']');
|
||||
p += 2;
|
||||
c = *p;
|
||||
}
|
||||
}
|
||||
if (not)
|
||||
return FNM_NOMATCH;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
if (c != FOLD ((unsigned char) *n))
|
||||
return FNM_NOMATCH;
|
||||
}
|
||||
|
||||
++n;
|
||||
}
|
||||
|
||||
if (*n == '\0')
|
||||
return 0;
|
||||
|
||||
if ((flags & FNM_LEADING_DIR) && *n == '/')
|
||||
/* The FNM_LEADING_DIR flag says that "foo*" matches "foobar/frobozz". */
|
||||
return 0;
|
||||
|
||||
return FNM_NOMATCH;
|
||||
|
||||
# undef FOLD
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
fnmatch (pattern, string, flags)
|
||||
const char *pattern;
|
||||
const char *string;
|
||||
int flags;
|
||||
{
|
||||
return internal_fnmatch (pattern, string, flags & FNM_PERIOD, flags);
|
||||
}
|
||||
|
||||
#endif /* _LIBC or not __GNU_LIBRARY__. */
|
||||
@@ -0,0 +1,85 @@
|
||||
/* Copyright (C) 1991, 1992, 1993, 1996, 1997, 1998, 1999 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
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to the Free
|
||||
Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
|
||||
USA. */
|
||||
|
||||
#ifndef _FNMATCH_H
|
||||
#define _FNMATCH_H 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if defined __cplusplus || (defined __STDC__ && __STDC__) || defined WINDOWS32
|
||||
# if !defined __GLIBC__
|
||||
# undef __P
|
||||
# define __P(protos) protos
|
||||
# endif
|
||||
#else /* Not C++ or ANSI C. */
|
||||
# undef __P
|
||||
# define __P(protos) ()
|
||||
/* We can get away without defining `const' here only because in this file
|
||||
it is used only inside the prototype for `fnmatch', which is elided in
|
||||
non-ANSI C where `const' is problematical. */
|
||||
#endif /* C++ or ANSI C. */
|
||||
|
||||
#ifndef const
|
||||
# if (defined __STDC__ && __STDC__) || defined __cplusplus || defined WINDOWS32
|
||||
# define __const const
|
||||
# else
|
||||
# define __const
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* We #undef these before defining them because some losing systems
|
||||
(HP-UX A.08.07 for example) define these in <unistd.h>. */
|
||||
#undef FNM_PATHNAME
|
||||
#undef FNM_NOESCAPE
|
||||
#undef FNM_PERIOD
|
||||
|
||||
/* Bits set in the FLAGS argument to `fnmatch'. */
|
||||
#define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */
|
||||
#define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */
|
||||
#define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */
|
||||
|
||||
#if !defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _GNU_SOURCE
|
||||
# define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */
|
||||
# define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */
|
||||
# define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */
|
||||
#endif
|
||||
|
||||
/* Value returned by `fnmatch' if STRING does not match PATTERN. */
|
||||
#define FNM_NOMATCH 1
|
||||
|
||||
/* This value is returned if the implementation does not support
|
||||
`fnmatch'. Since this is not the case here it will never be
|
||||
returned but the conformance test suites still require the symbol
|
||||
to be defined. */
|
||||
#ifdef _XOPEN_SOURCE
|
||||
# define FNM_NOSYS (-1)
|
||||
#endif
|
||||
|
||||
/* Match NAME against the filename pattern PATTERN,
|
||||
returning zero if it matches, FNM_NOMATCH if not. */
|
||||
extern int fnmatch __P ((__const char *__pattern, __const char *__name,
|
||||
int __flags));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* fnmatch.h */
|
||||
@@ -0,0 +1,944 @@
|
||||
/* Get the system load averages.
|
||||
|
||||
Copyright (C) 1985-1989, 1991-1995, 1997, 1999-2000, 2003-2022 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
NOTE: The canonical source of this file is maintained with gnulib.
|
||||
Bugs can be reported to bug-gnulib@gnu.org.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 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, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Compile-time symbols that this file uses:
|
||||
|
||||
HAVE_PSTAT_GETDYNAMIC Define this if your system has the
|
||||
pstat_getdynamic function. I think it
|
||||
is unique to HPUX9. The best way to get the
|
||||
definition is through the AC_FUNC_GETLOADAVG
|
||||
macro that comes with autoconf 2.13 or newer.
|
||||
If that isn't an option, then just put
|
||||
AC_CHECK_FUNCS(pstat_getdynamic) in your
|
||||
configure.ac file.
|
||||
HAVE_LIBPERFSTAT Define this if your system has the
|
||||
perfstat_cpu_total function in libperfstat (AIX).
|
||||
FIXUP_KERNEL_SYMBOL_ADDR() Adjust address in returned struct nlist.
|
||||
KERNEL_FILE Name of the kernel file to nlist.
|
||||
LDAV_CVT() Scale the load average from the kernel.
|
||||
Returns a double.
|
||||
LDAV_SYMBOL Name of kernel symbol giving load average.
|
||||
LOAD_AVE_TYPE Type of the load average array in the kernel.
|
||||
Must be defined unless one of
|
||||
apollo, DGUX, NeXT, or UMAX is defined;
|
||||
or we have libkstat;
|
||||
otherwise, no load average is available.
|
||||
HAVE_NLIST_H nlist.h is available. NLIST_STRUCT defaults
|
||||
to this.
|
||||
NLIST_STRUCT Include nlist.h, not a.out.h.
|
||||
N_NAME_POINTER The nlist n_name element is a pointer,
|
||||
not an array.
|
||||
HAVE_STRUCT_NLIST_N_UN_N_NAME 'n_un.n_name' is member of 'struct nlist'.
|
||||
LINUX_LDAV_FILE [__linux__, __ANDROID__, __CYGWIN__]: File
|
||||
containing load averages.
|
||||
|
||||
Specific system predefines this file uses, aside from setting
|
||||
default values if not emacs:
|
||||
|
||||
apollo
|
||||
BSD Real BSD, not just BSD-like.
|
||||
DGUX
|
||||
eunice UNIX emulator under VMS.
|
||||
hpux
|
||||
__MSDOS__ No-op for MSDOS.
|
||||
NeXT
|
||||
sgi
|
||||
UMAX
|
||||
UMAX4_3
|
||||
VMS
|
||||
_WIN32 Native Windows (possibly also defined on Cygwin)
|
||||
__linux__, __ANDROID__ Linux: assumes /proc file system mounted.
|
||||
Support from Michael K. Johnson.
|
||||
__CYGWIN__ Cygwin emulates linux /proc/loadavg.
|
||||
__NetBSD__ NetBSD: assumes /kern file system mounted.
|
||||
|
||||
In addition, to avoid nesting many #ifdefs, we internally set
|
||||
LDAV_DONE to indicate that the load average has been computed.
|
||||
|
||||
We also #define LDAV_PRIVILEGED if a program will require
|
||||
special installation to be able to call getloadavg. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
|
||||
# include <sys/types.h>
|
||||
|
||||
# if HAVE_SYS_PARAM_H
|
||||
# include <sys/param.h>
|
||||
# endif
|
||||
|
||||
# include "intprops.h"
|
||||
|
||||
# if defined _WIN32 && ! defined __CYGWIN__ && ! defined WINDOWS32
|
||||
# define WINDOWS32
|
||||
# endif
|
||||
|
||||
# ifdef NeXT
|
||||
/* NeXT in the 2.{0,1,2} releases defines BSD in <sys/param.h>, which
|
||||
conflicts with the definition understood in this file, that this
|
||||
really is BSD. */
|
||||
# undef BSD
|
||||
|
||||
/* NeXT defines FSCALE in <sys/param.h>. However, we take FSCALE being
|
||||
defined to mean that the nlist method should be used, which is not true. */
|
||||
# undef FSCALE
|
||||
# endif
|
||||
|
||||
/* Same issues as for NeXT apply to the HURD-based GNU system. */
|
||||
# ifdef __GNU__
|
||||
# undef BSD
|
||||
# undef FSCALE
|
||||
# endif /* __GNU__ */
|
||||
|
||||
/* Set values that are different from the defaults, which are
|
||||
set a little farther down with #ifndef. */
|
||||
|
||||
|
||||
/* Some shorthands. */
|
||||
|
||||
# if defined (HPUX) && !defined (hpux)
|
||||
# define hpux
|
||||
# endif
|
||||
|
||||
# if defined (__hpux) && !defined (hpux)
|
||||
# define hpux
|
||||
# endif
|
||||
|
||||
# if defined (__sun) && !defined (sun)
|
||||
# define sun
|
||||
# endif
|
||||
|
||||
# if defined (hp300) && !defined (hpux)
|
||||
# define MORE_BSD
|
||||
# endif
|
||||
|
||||
# if defined (__SVR4) && !defined (SVR4)
|
||||
# define SVR4
|
||||
# endif
|
||||
|
||||
# if (defined (sun) && defined (SVR4)) || defined (SOLARIS2)
|
||||
# define SUNOS_5
|
||||
# endif
|
||||
|
||||
# if defined (__osf__) && (defined (__alpha) || defined (__alpha__))
|
||||
# define OSF_ALPHA
|
||||
# include <sys/mbuf.h>
|
||||
# include <sys/socket.h>
|
||||
# include <net/route.h>
|
||||
# include <sys/table.h>
|
||||
/* Tru64 4.0D's table.h redefines sys */
|
||||
# undef sys
|
||||
# endif
|
||||
|
||||
# if defined (__osf__) && (defined (mips) || defined (__mips__))
|
||||
# define OSF_MIPS
|
||||
# include <sys/table.h>
|
||||
# endif
|
||||
|
||||
|
||||
/* VAX C can't handle multi-line #ifs, or lines longer than 256 chars. */
|
||||
# ifndef LOAD_AVE_TYPE
|
||||
|
||||
# ifdef MORE_BSD
|
||||
# define LOAD_AVE_TYPE long
|
||||
# endif
|
||||
|
||||
# ifdef sun
|
||||
# define LOAD_AVE_TYPE long
|
||||
# endif
|
||||
|
||||
# ifdef sgi
|
||||
# define LOAD_AVE_TYPE long
|
||||
# endif
|
||||
|
||||
# ifdef SVR4
|
||||
# define LOAD_AVE_TYPE long
|
||||
# endif
|
||||
|
||||
# ifdef OSF_ALPHA
|
||||
# define LOAD_AVE_TYPE long
|
||||
# endif
|
||||
|
||||
# if defined _AIX && ! defined HAVE_LIBPERFSTAT
|
||||
# define LOAD_AVE_TYPE long
|
||||
# endif
|
||||
|
||||
# endif /* No LOAD_AVE_TYPE. */
|
||||
|
||||
# ifdef OSF_ALPHA
|
||||
/* <sys/param.h> defines an incorrect value for FSCALE on Alpha OSF/1,
|
||||
according to ghazi@noc.rutgers.edu. */
|
||||
# undef FSCALE
|
||||
# define FSCALE 1024.0
|
||||
# endif
|
||||
|
||||
|
||||
# ifndef FSCALE
|
||||
|
||||
/* SunOS and some others define FSCALE in sys/param.h. */
|
||||
|
||||
# ifdef MORE_BSD
|
||||
# define FSCALE 2048.0
|
||||
# endif
|
||||
|
||||
# if defined (MIPS) || defined (SVR4)
|
||||
# define FSCALE 256
|
||||
# endif
|
||||
|
||||
# if defined (sgi)
|
||||
/* Sometimes both MIPS and sgi are defined, so FSCALE was just defined
|
||||
above under #ifdef MIPS. But we want the sgi value. */
|
||||
# undef FSCALE
|
||||
# define FSCALE 1000.0
|
||||
# endif
|
||||
|
||||
# if defined _AIX && !defined HAVE_LIBPERFSTAT
|
||||
# define FSCALE 65536.0
|
||||
# endif
|
||||
|
||||
# endif /* Not FSCALE. */
|
||||
|
||||
# if !defined (LDAV_CVT) && defined (FSCALE)
|
||||
# define LDAV_CVT(n) (((double) (n)) / FSCALE)
|
||||
# endif
|
||||
|
||||
# ifndef NLIST_STRUCT
|
||||
# if HAVE_NLIST_H
|
||||
# define NLIST_STRUCT
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# if defined (sgi) || (defined (mips) && !defined (BSD))
|
||||
# define FIXUP_KERNEL_SYMBOL_ADDR(nl) ((nl)[0].n_value &= ~(1 << 31))
|
||||
# endif
|
||||
|
||||
|
||||
# if !defined (KERNEL_FILE) && defined (hpux)
|
||||
# define KERNEL_FILE "/hp-ux"
|
||||
# endif
|
||||
|
||||
# if !defined (KERNEL_FILE) && (defined (MIPS) || defined (SVR4) || defined (ISC) || defined (sgi))
|
||||
# define KERNEL_FILE "/unix"
|
||||
# endif
|
||||
|
||||
|
||||
# if !defined (LDAV_SYMBOL) && (defined (hpux) || defined (SVR4) || defined (ISC) || defined (sgi) || (defined (_AIX) && !defined(HAVE_LIBPERFSTAT)))
|
||||
# define LDAV_SYMBOL "avenrun"
|
||||
# endif
|
||||
|
||||
# ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
# endif
|
||||
|
||||
/* LOAD_AVE_TYPE should only get defined if we're going to use the
|
||||
nlist method. */
|
||||
# if !defined (LOAD_AVE_TYPE) && (defined (BSD) || defined (LDAV_CVT) || defined (KERNEL_FILE) || defined (LDAV_SYMBOL))
|
||||
# define LOAD_AVE_TYPE double
|
||||
# endif
|
||||
|
||||
# ifdef LOAD_AVE_TYPE
|
||||
|
||||
# ifndef __VMS
|
||||
# if !(defined __linux__ || defined __ANDROID__)
|
||||
# ifndef NLIST_STRUCT
|
||||
# include <a.out.h>
|
||||
# else /* NLIST_STRUCT */
|
||||
# include <nlist.h>
|
||||
# endif /* NLIST_STRUCT */
|
||||
|
||||
# ifdef SUNOS_5
|
||||
# include <kvm.h>
|
||||
# include <kstat.h>
|
||||
# endif
|
||||
|
||||
# if defined (hpux) && defined (HAVE_PSTAT_GETDYNAMIC)
|
||||
# include <sys/pstat.h>
|
||||
# endif
|
||||
|
||||
# ifndef KERNEL_FILE
|
||||
# define KERNEL_FILE "/vmunix"
|
||||
# endif /* KERNEL_FILE */
|
||||
|
||||
# ifndef LDAV_SYMBOL
|
||||
# define LDAV_SYMBOL "_avenrun"
|
||||
# endif /* LDAV_SYMBOL */
|
||||
# endif /* __linux__ || __ANDROID__ */
|
||||
|
||||
# else /* __VMS */
|
||||
|
||||
# ifndef eunice
|
||||
# include <iodef.h>
|
||||
# include <descrip.h>
|
||||
# else /* eunice */
|
||||
# include <vms/iodef.h>
|
||||
# endif /* eunice */
|
||||
# endif /* __VMS */
|
||||
|
||||
# ifndef LDAV_CVT
|
||||
# define LDAV_CVT(n) ((double) (n))
|
||||
# endif /* !LDAV_CVT */
|
||||
|
||||
# endif /* LOAD_AVE_TYPE */
|
||||
|
||||
# if defined HAVE_LIBPERFSTAT
|
||||
# include <sys/protosw.h>
|
||||
# include <libperfstat.h>
|
||||
# include <sys/proc.h>
|
||||
# ifndef SBITS
|
||||
# define SBITS 16
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# if defined (__GNU__) && !defined (NeXT)
|
||||
/* Note that NeXT Openstep defines __GNU__ even though it should not. */
|
||||
/* GNU system acts much like NeXT, for load average purposes,
|
||||
but not exactly. */
|
||||
# define NeXT
|
||||
# define host_self mach_host_self
|
||||
# endif
|
||||
|
||||
# ifdef NeXT
|
||||
# ifdef HAVE_MACH_MACH_H
|
||||
# include <mach/mach.h>
|
||||
# else
|
||||
# include <mach.h>
|
||||
# endif
|
||||
# endif /* NeXT */
|
||||
|
||||
# ifdef sgi
|
||||
# include <sys/sysmp.h>
|
||||
# endif /* sgi */
|
||||
|
||||
# ifdef UMAX
|
||||
# include <signal.h>
|
||||
# include <sys/time.h>
|
||||
# include <sys/wait.h>
|
||||
# include <sys/syscall.h>
|
||||
|
||||
# ifdef UMAX_43
|
||||
# include <machine/cpu.h>
|
||||
# include <inq_stats/statistics.h>
|
||||
# include <inq_stats/sysstats.h>
|
||||
# include <inq_stats/cpustats.h>
|
||||
# include <inq_stats/procstats.h>
|
||||
# else /* Not UMAX_43. */
|
||||
# include <sys/sysdefs.h>
|
||||
# include <sys/statistics.h>
|
||||
# include <sys/sysstats.h>
|
||||
# include <sys/cpudefs.h>
|
||||
# include <sys/cpustats.h>
|
||||
# include <sys/procstats.h>
|
||||
# endif /* Not UMAX_43. */
|
||||
# endif /* UMAX */
|
||||
|
||||
# ifdef DGUX
|
||||
# include <sys/dg_sys_info.h>
|
||||
# endif
|
||||
|
||||
# if (defined __linux__ || defined __ANDROID__ \
|
||||
|| defined __CYGWIN__ || defined SUNOS_5 \
|
||||
|| (defined LOAD_AVE_TYPE && ! defined __VMS))
|
||||
# include <fcntl.h>
|
||||
# endif
|
||||
|
||||
/* Avoid static vars inside a function since in HPUX they dump as pure. */
|
||||
|
||||
# ifdef NeXT
|
||||
static processor_set_t default_set;
|
||||
static bool getloadavg_initialized;
|
||||
# endif /* NeXT */
|
||||
|
||||
# ifdef UMAX
|
||||
static unsigned int cpus = 0;
|
||||
static unsigned int samples;
|
||||
# endif /* UMAX */
|
||||
|
||||
# ifdef DGUX
|
||||
static struct dg_sys_info_load_info load_info; /* what-a-mouthful! */
|
||||
# endif /* DGUX */
|
||||
|
||||
# if !defined (HAVE_LIBKSTAT) && defined (LOAD_AVE_TYPE)
|
||||
/* File descriptor open to /dev/kmem or VMS load ave driver. */
|
||||
static int channel;
|
||||
/* True if channel is valid. */
|
||||
static bool getloadavg_initialized;
|
||||
/* Offset in kmem to seek to read load average, or 0 means invalid. */
|
||||
static long offset;
|
||||
|
||||
# if ! defined __VMS && ! defined sgi && ! (defined __linux__ || defined __ANDROID__)
|
||||
static struct nlist name_list[2];
|
||||
# endif
|
||||
|
||||
# ifdef SUNOS_5
|
||||
static kvm_t *kd;
|
||||
# endif /* SUNOS_5 */
|
||||
|
||||
# endif /* LOAD_AVE_TYPE && !HAVE_LIBKSTAT */
|
||||
|
||||
/* Put the 1 minute, 5 minute and 15 minute load averages
|
||||
into the first NELEM elements of LOADAVG.
|
||||
Return the number written (never more than 3, but may be less than NELEM),
|
||||
or -1 (setting errno) if an error occurred. */
|
||||
|
||||
int
|
||||
getloadavg (double loadavg[], int nelem)
|
||||
{
|
||||
int elem = 0; /* Return value. */
|
||||
|
||||
# ifdef NO_GET_LOAD_AVG
|
||||
# define LDAV_DONE
|
||||
errno = ENOSYS;
|
||||
elem = -1;
|
||||
# endif
|
||||
|
||||
# if !defined (LDAV_DONE) && defined (HAVE_LIBKSTAT) /* Solaris <= 2.6 */
|
||||
/* Use libkstat because we don't have to be root. */
|
||||
# define LDAV_DONE
|
||||
kstat_ctl_t *kc;
|
||||
kstat_t *ksp;
|
||||
kstat_named_t *kn;
|
||||
int saved_errno;
|
||||
|
||||
kc = kstat_open ();
|
||||
if (kc == NULL)
|
||||
return -1;
|
||||
ksp = kstat_lookup (kc, "unix", 0, "system_misc");
|
||||
if (ksp == NULL)
|
||||
return -1;
|
||||
if (kstat_read (kc, ksp, 0) == -1)
|
||||
return -1;
|
||||
|
||||
|
||||
kn = kstat_data_lookup (ksp, "avenrun_1min");
|
||||
if (kn == NULL)
|
||||
{
|
||||
/* Return -1 if no load average information is available. */
|
||||
nelem = 0;
|
||||
elem = -1;
|
||||
}
|
||||
|
||||
if (nelem >= 1)
|
||||
loadavg[elem++] = (double) kn->value.ul / FSCALE;
|
||||
|
||||
if (nelem >= 2)
|
||||
{
|
||||
kn = kstat_data_lookup (ksp, "avenrun_5min");
|
||||
if (kn != NULL)
|
||||
{
|
||||
loadavg[elem++] = (double) kn->value.ul / FSCALE;
|
||||
|
||||
if (nelem >= 3)
|
||||
{
|
||||
kn = kstat_data_lookup (ksp, "avenrun_15min");
|
||||
if (kn != NULL)
|
||||
loadavg[elem++] = (double) kn->value.ul / FSCALE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
saved_errno = errno;
|
||||
kstat_close (kc);
|
||||
errno = saved_errno;
|
||||
# endif /* HAVE_LIBKSTAT */
|
||||
|
||||
# if !defined (LDAV_DONE) && defined (hpux) && defined (HAVE_PSTAT_GETDYNAMIC)
|
||||
/* HP-UX */
|
||||
/* Use pstat_getdynamic() because we don't have to be root. */
|
||||
# define LDAV_DONE
|
||||
# undef LOAD_AVE_TYPE
|
||||
|
||||
struct pst_dynamic dyn_info;
|
||||
if (pstat_getdynamic (&dyn_info, sizeof (dyn_info), 0, 0) < 0)
|
||||
return -1;
|
||||
if (nelem > 0)
|
||||
loadavg[elem++] = dyn_info.psd_avg_1_min;
|
||||
if (nelem > 1)
|
||||
loadavg[elem++] = dyn_info.psd_avg_5_min;
|
||||
if (nelem > 2)
|
||||
loadavg[elem++] = dyn_info.psd_avg_15_min;
|
||||
|
||||
# endif /* hpux && HAVE_PSTAT_GETDYNAMIC */
|
||||
|
||||
# if ! defined LDAV_DONE && defined HAVE_LIBPERFSTAT /* AIX */
|
||||
# define LDAV_DONE
|
||||
# undef LOAD_AVE_TYPE
|
||||
/* Use perfstat_cpu_total because we don't have to be root. */
|
||||
{
|
||||
perfstat_cpu_total_t cpu_stats;
|
||||
int result = perfstat_cpu_total (NULL, &cpu_stats, sizeof cpu_stats, 1);
|
||||
if (result == -1)
|
||||
return result;
|
||||
loadavg[0] = cpu_stats.loadavg[0] / (double)(1 << SBITS);
|
||||
loadavg[1] = cpu_stats.loadavg[1] / (double)(1 << SBITS);
|
||||
loadavg[2] = cpu_stats.loadavg[2] / (double)(1 << SBITS);
|
||||
elem = 3;
|
||||
}
|
||||
# endif
|
||||
|
||||
# if !defined (LDAV_DONE) && (defined __linux__ || defined __ANDROID__ || defined __CYGWIN__)
|
||||
/* Linux without glibc, Android, Cygwin */
|
||||
# define LDAV_DONE
|
||||
# undef LOAD_AVE_TYPE
|
||||
|
||||
# ifndef LINUX_LDAV_FILE
|
||||
# define LINUX_LDAV_FILE "/proc/loadavg"
|
||||
# endif
|
||||
|
||||
char ldavgbuf[3 * (INT_STRLEN_BOUND (int) + sizeof ".00 ")];
|
||||
char const *ptr = ldavgbuf;
|
||||
int fd, count, saved_errno;
|
||||
|
||||
fd = open (LINUX_LDAV_FILE, O_RDONLY | O_CLOEXEC);
|
||||
if (fd == -1)
|
||||
return -1;
|
||||
count = read (fd, ldavgbuf, sizeof ldavgbuf - 1);
|
||||
saved_errno = errno;
|
||||
(void) close (fd);
|
||||
errno = saved_errno;
|
||||
if (count <= 0)
|
||||
return -1;
|
||||
ldavgbuf[count] = '\0';
|
||||
|
||||
for (elem = 0; elem < nelem; elem++)
|
||||
{
|
||||
double numerator = 0;
|
||||
double denominator = 1;
|
||||
|
||||
while (*ptr == ' ')
|
||||
ptr++;
|
||||
|
||||
/* Finish if this number is missing, and report an error if all
|
||||
were missing. */
|
||||
if (! ('0' <= *ptr && *ptr <= '9'))
|
||||
{
|
||||
if (elem == 0)
|
||||
{
|
||||
errno = ENOTSUP;
|
||||
return -1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
while ('0' <= *ptr && *ptr <= '9')
|
||||
numerator = 10 * numerator + (*ptr++ - '0');
|
||||
|
||||
if (*ptr == '.')
|
||||
for (ptr++; '0' <= *ptr && *ptr <= '9'; ptr++)
|
||||
numerator = 10 * numerator + (*ptr - '0'), denominator *= 10;
|
||||
|
||||
loadavg[elem] = numerator / denominator;
|
||||
}
|
||||
|
||||
return elem;
|
||||
|
||||
# endif /* __linux__ || __ANDROID__ || __CYGWIN__ */
|
||||
|
||||
# if !defined (LDAV_DONE) && defined (__NetBSD__) /* NetBSD < 0.9 */
|
||||
# define LDAV_DONE
|
||||
# undef LOAD_AVE_TYPE
|
||||
|
||||
# ifndef NETBSD_LDAV_FILE
|
||||
# define NETBSD_LDAV_FILE "/kern/loadavg"
|
||||
# endif
|
||||
|
||||
unsigned long int load_ave[3], scale;
|
||||
int count;
|
||||
char readbuf[4 * INT_BUFSIZE_BOUND (unsigned long int) + 1];
|
||||
int fd = open (NETBSD_LDAV_FILE, O_RDONLY | O_CLOEXEC);
|
||||
if (fd < 0)
|
||||
return fd;
|
||||
int nread = read (fd, readbuf, sizeof readbuf - 1);
|
||||
int err = errno;
|
||||
close (fd);
|
||||
if (nread < 0)
|
||||
{
|
||||
errno = err;
|
||||
return -1;
|
||||
}
|
||||
readbuf[nread] = '\0';
|
||||
count = sscanf (readbuf, "%lu %lu %lu %lu\n",
|
||||
&load_ave[0], &load_ave[1], &load_ave[2],
|
||||
&scale);
|
||||
if (count != 4)
|
||||
{
|
||||
errno = ENOTSUP;
|
||||
return -1;
|
||||
}
|
||||
|
||||
for (elem = 0; elem < nelem; elem++)
|
||||
loadavg[elem] = (double) load_ave[elem] / (double) scale;
|
||||
|
||||
return elem;
|
||||
|
||||
# endif /* __NetBSD__ */
|
||||
|
||||
# if !defined (LDAV_DONE) && defined (NeXT) /* NeXTStep */
|
||||
# define LDAV_DONE
|
||||
/* The NeXT code was adapted from iscreen 3.2. */
|
||||
|
||||
host_t host;
|
||||
struct processor_set_basic_info info;
|
||||
unsigned int info_count;
|
||||
|
||||
/* We only know how to get the 1-minute average for this system,
|
||||
so even if the caller asks for more than 1, we only return 1. */
|
||||
|
||||
if (!getloadavg_initialized)
|
||||
{
|
||||
if (processor_set_default (host_self (), &default_set) == KERN_SUCCESS)
|
||||
getloadavg_initialized = true;
|
||||
}
|
||||
|
||||
if (getloadavg_initialized)
|
||||
{
|
||||
info_count = PROCESSOR_SET_BASIC_INFO_COUNT;
|
||||
if (processor_set_info (default_set, PROCESSOR_SET_BASIC_INFO, &host,
|
||||
(processor_set_info_t) &info, &info_count)
|
||||
!= KERN_SUCCESS)
|
||||
getloadavg_initialized = false;
|
||||
else
|
||||
{
|
||||
if (nelem > 0)
|
||||
loadavg[elem++] = (double) info.load_average / LOAD_SCALE;
|
||||
}
|
||||
}
|
||||
|
||||
if (!getloadavg_initialized)
|
||||
{
|
||||
errno = ENOTSUP;
|
||||
return -1;
|
||||
}
|
||||
# endif /* NeXT */
|
||||
|
||||
# if !defined (LDAV_DONE) && defined (UMAX)
|
||||
# define LDAV_DONE
|
||||
/* UMAX 4.2, which runs on the Encore Multimax multiprocessor, does not
|
||||
have a /dev/kmem. Information about the workings of the running kernel
|
||||
can be gathered with inq_stats system calls.
|
||||
We only know how to get the 1-minute average for this system. */
|
||||
|
||||
struct proc_summary proc_sum_data;
|
||||
struct stat_descr proc_info;
|
||||
double load;
|
||||
register unsigned int i, j;
|
||||
|
||||
if (cpus == 0)
|
||||
{
|
||||
register unsigned int c, i;
|
||||
struct cpu_config conf;
|
||||
struct stat_descr desc;
|
||||
|
||||
desc.sd_next = 0;
|
||||
desc.sd_subsys = SUBSYS_CPU;
|
||||
desc.sd_type = CPUTYPE_CONFIG;
|
||||
desc.sd_addr = (char *) &conf;
|
||||
desc.sd_size = sizeof conf;
|
||||
|
||||
if (inq_stats (1, &desc))
|
||||
return -1;
|
||||
|
||||
c = 0;
|
||||
for (i = 0; i < conf.config_maxclass; ++i)
|
||||
{
|
||||
struct class_stats stats;
|
||||
memset (&stats, 0, sizeof stats);
|
||||
|
||||
desc.sd_type = CPUTYPE_CLASS;
|
||||
desc.sd_objid = i;
|
||||
desc.sd_addr = (char *) &stats;
|
||||
desc.sd_size = sizeof stats;
|
||||
|
||||
if (inq_stats (1, &desc))
|
||||
return -1;
|
||||
|
||||
c += stats.class_numcpus;
|
||||
}
|
||||
cpus = c;
|
||||
samples = cpus < 2 ? 3 : (2 * cpus / 3);
|
||||
}
|
||||
|
||||
proc_info.sd_next = 0;
|
||||
proc_info.sd_subsys = SUBSYS_PROC;
|
||||
proc_info.sd_type = PROCTYPE_SUMMARY;
|
||||
proc_info.sd_addr = (char *) &proc_sum_data;
|
||||
proc_info.sd_size = sizeof (struct proc_summary);
|
||||
proc_info.sd_sizeused = 0;
|
||||
|
||||
if (inq_stats (1, &proc_info) != 0)
|
||||
return -1;
|
||||
|
||||
load = proc_sum_data.ps_nrunnable;
|
||||
j = 0;
|
||||
for (i = samples - 1; i > 0; --i)
|
||||
{
|
||||
load += proc_sum_data.ps_nrun[j];
|
||||
if (j++ == PS_NRUNSIZE)
|
||||
j = 0;
|
||||
}
|
||||
|
||||
if (nelem > 0)
|
||||
loadavg[elem++] = load / samples / cpus;
|
||||
# endif /* UMAX */
|
||||
|
||||
# if !defined (LDAV_DONE) && defined (DGUX)
|
||||
# define LDAV_DONE
|
||||
/* This call can return -1 for an error, but with good args
|
||||
it's not supposed to fail. The first argument is for no
|
||||
apparent reason of type 'long int *'. */
|
||||
dg_sys_info ((long int *) &load_info,
|
||||
DG_SYS_INFO_LOAD_INFO_TYPE,
|
||||
DG_SYS_INFO_LOAD_VERSION_0);
|
||||
|
||||
if (nelem > 0)
|
||||
loadavg[elem++] = load_info.one_minute;
|
||||
if (nelem > 1)
|
||||
loadavg[elem++] = load_info.five_minute;
|
||||
if (nelem > 2)
|
||||
loadavg[elem++] = load_info.fifteen_minute;
|
||||
# endif /* DGUX */
|
||||
|
||||
# if !defined (LDAV_DONE) && defined (apollo)
|
||||
# define LDAV_DONE
|
||||
/* Apollo code from lisch@mentorg.com (Ray Lischner).
|
||||
|
||||
This system call is not documented. The load average is obtained as
|
||||
three long integers, for the load average over the past minute,
|
||||
five minutes, and fifteen minutes. Each value is a scaled integer,
|
||||
with 16 bits of integer part and 16 bits of fraction part.
|
||||
|
||||
I'm not sure which operating system first supported this system call,
|
||||
but I know that SR10.2 supports it. */
|
||||
|
||||
extern void proc1_$get_loadav ();
|
||||
unsigned long load_ave[3];
|
||||
|
||||
proc1_$get_loadav (load_ave);
|
||||
|
||||
if (nelem > 0)
|
||||
loadavg[elem++] = load_ave[0] / 65536.0;
|
||||
if (nelem > 1)
|
||||
loadavg[elem++] = load_ave[1] / 65536.0;
|
||||
if (nelem > 2)
|
||||
loadavg[elem++] = load_ave[2] / 65536.0;
|
||||
# endif /* apollo */
|
||||
|
||||
# if !defined (LDAV_DONE) && defined (OSF_MIPS)
|
||||
# define LDAV_DONE
|
||||
|
||||
struct tbl_loadavg load_ave;
|
||||
table (TBL_LOADAVG, 0, &load_ave, 1, sizeof (load_ave));
|
||||
loadavg[elem++]
|
||||
= (load_ave.tl_lscale == 0
|
||||
? load_ave.tl_avenrun.d[0]
|
||||
: (load_ave.tl_avenrun.l[0] / (double) load_ave.tl_lscale));
|
||||
# endif /* OSF_MIPS */
|
||||
|
||||
# if !defined (LDAV_DONE) && (defined (__MSDOS__) || defined (WINDOWS32))
|
||||
/* DJGPP */
|
||||
# define LDAV_DONE
|
||||
|
||||
/* A faithful emulation is going to have to be saved for a rainy day. */
|
||||
for ( ; elem < nelem; elem++)
|
||||
{
|
||||
loadavg[elem] = 0.0;
|
||||
}
|
||||
# endif /* __MSDOS__ || WINDOWS32 */
|
||||
|
||||
# if !defined (LDAV_DONE) && defined (OSF_ALPHA) /* OSF/1 */
|
||||
# define LDAV_DONE
|
||||
|
||||
struct tbl_loadavg load_ave;
|
||||
table (TBL_LOADAVG, 0, &load_ave, 1, sizeof (load_ave));
|
||||
for (elem = 0; elem < nelem; elem++)
|
||||
loadavg[elem]
|
||||
= (load_ave.tl_lscale == 0
|
||||
? load_ave.tl_avenrun.d[elem]
|
||||
: (load_ave.tl_avenrun.l[elem] / (double) load_ave.tl_lscale));
|
||||
# endif /* OSF_ALPHA */
|
||||
|
||||
# if ! defined LDAV_DONE && defined __VMS /* VMS */
|
||||
/* VMS specific code -- read from the Load Ave driver. */
|
||||
|
||||
LOAD_AVE_TYPE load_ave[3];
|
||||
static bool getloadavg_initialized;
|
||||
# ifdef eunice
|
||||
struct
|
||||
{
|
||||
int dsc$w_length;
|
||||
char *dsc$a_pointer;
|
||||
} descriptor;
|
||||
# endif
|
||||
|
||||
/* Ensure that there is a channel open to the load ave device. */
|
||||
if (!getloadavg_initialized)
|
||||
{
|
||||
/* Attempt to open the channel. */
|
||||
# ifdef eunice
|
||||
descriptor.dsc$w_length = 18;
|
||||
descriptor.dsc$a_pointer = "$$VMS_LOAD_AVERAGE";
|
||||
# else
|
||||
$DESCRIPTOR (descriptor, "LAV0:");
|
||||
# endif
|
||||
if (sys$assign (&descriptor, &channel, 0, 0) & 1)
|
||||
getloadavg_initialized = true;
|
||||
}
|
||||
|
||||
/* Read the load average vector. */
|
||||
if (getloadavg_initialized
|
||||
&& !(sys$qiow (0, channel, IO$_READVBLK, 0, 0, 0,
|
||||
load_ave, 12, 0, 0, 0, 0) & 1))
|
||||
{
|
||||
sys$dassgn (channel);
|
||||
getloadavg_initialized = false;
|
||||
}
|
||||
|
||||
if (!getloadavg_initialized)
|
||||
{
|
||||
errno = ENOTSUP;
|
||||
return -1;
|
||||
}
|
||||
# endif /* ! defined LDAV_DONE && defined __VMS */
|
||||
|
||||
# if ! defined LDAV_DONE && defined LOAD_AVE_TYPE && ! defined __VMS
|
||||
/* IRIX, other old systems */
|
||||
|
||||
/* UNIX-specific code -- read the average from /dev/kmem. */
|
||||
|
||||
# define LDAV_PRIVILEGED /* This code requires special installation. */
|
||||
|
||||
LOAD_AVE_TYPE load_ave[3];
|
||||
|
||||
/* Get the address of LDAV_SYMBOL. */
|
||||
if (offset == 0)
|
||||
{
|
||||
# ifndef sgi
|
||||
# if ! defined NLIST_STRUCT || ! defined N_NAME_POINTER
|
||||
strcpy (name_list[0].n_name, LDAV_SYMBOL);
|
||||
strcpy (name_list[1].n_name, "");
|
||||
# else /* NLIST_STRUCT */
|
||||
# ifdef HAVE_STRUCT_NLIST_N_UN_N_NAME
|
||||
name_list[0].n_un.n_name = LDAV_SYMBOL;
|
||||
name_list[1].n_un.n_name = 0;
|
||||
# else /* not HAVE_STRUCT_NLIST_N_UN_N_NAME */
|
||||
name_list[0].n_name = LDAV_SYMBOL;
|
||||
name_list[1].n_name = 0;
|
||||
# endif /* not HAVE_STRUCT_NLIST_N_UN_N_NAME */
|
||||
# endif /* NLIST_STRUCT */
|
||||
|
||||
# ifndef SUNOS_5
|
||||
if (
|
||||
# if !defined (_AIX)
|
||||
nlist (KERNEL_FILE, name_list)
|
||||
# else /* _AIX */
|
||||
knlist (name_list, 1, sizeof (name_list[0]))
|
||||
# endif
|
||||
>= 0)
|
||||
/* Omit "&& name_list[0].n_type != 0 " -- it breaks on Sun386i. */
|
||||
{
|
||||
# ifdef FIXUP_KERNEL_SYMBOL_ADDR
|
||||
FIXUP_KERNEL_SYMBOL_ADDR (name_list);
|
||||
# endif
|
||||
offset = name_list[0].n_value;
|
||||
}
|
||||
# endif /* !SUNOS_5 */
|
||||
# else /* sgi */
|
||||
ptrdiff_t ldav_off = sysmp (MP_KERNADDR, MPKA_AVENRUN);
|
||||
if (ldav_off != -1)
|
||||
offset = (long int) ldav_off & 0x7fffffff;
|
||||
# endif /* sgi */
|
||||
}
|
||||
|
||||
/* Make sure we have /dev/kmem open. */
|
||||
if (!getloadavg_initialized)
|
||||
{
|
||||
# ifndef SUNOS_5
|
||||
int fd = open ("/dev/kmem", O_RDONLY | O_CLOEXEC);
|
||||
if (0 <= fd)
|
||||
{
|
||||
channel = fd;
|
||||
getloadavg_initialized = true;
|
||||
}
|
||||
# else /* SUNOS_5 */
|
||||
/* We pass 0 for the kernel, corefile, and swapfile names
|
||||
to use the currently running kernel. */
|
||||
kd = kvm_open (0, 0, 0, O_RDONLY, 0);
|
||||
if (kd != NULL)
|
||||
{
|
||||
/* nlist the currently running kernel. */
|
||||
kvm_nlist (kd, name_list);
|
||||
offset = name_list[0].n_value;
|
||||
getloadavg_initialized = true;
|
||||
}
|
||||
# endif /* SUNOS_5 */
|
||||
}
|
||||
|
||||
/* If we can, get the load average values. */
|
||||
if (offset && getloadavg_initialized)
|
||||
{
|
||||
/* Try to read the load. */
|
||||
# ifndef SUNOS_5
|
||||
if (lseek (channel, offset, 0) == -1L
|
||||
|| read (channel, (char *) load_ave, sizeof (load_ave))
|
||||
!= sizeof (load_ave))
|
||||
{
|
||||
close (channel);
|
||||
getloadavg_initialized = false;
|
||||
}
|
||||
# else /* SUNOS_5 */
|
||||
if (kvm_read (kd, offset, (char *) load_ave, sizeof (load_ave))
|
||||
!= sizeof (load_ave))
|
||||
{
|
||||
kvm_close (kd);
|
||||
getloadavg_initialized = false;
|
||||
}
|
||||
# endif /* SUNOS_5 */
|
||||
}
|
||||
|
||||
if (offset == 0 || !getloadavg_initialized)
|
||||
{
|
||||
errno = ENOTSUP;
|
||||
return -1;
|
||||
}
|
||||
# endif /* ! defined LDAV_DONE && defined LOAD_AVE_TYPE && ! defined __VMS */
|
||||
|
||||
# if !defined (LDAV_DONE) && defined (LOAD_AVE_TYPE) /* Including VMS. */
|
||||
if (nelem > 0)
|
||||
loadavg[elem++] = LDAV_CVT (load_ave[0]);
|
||||
if (nelem > 1)
|
||||
loadavg[elem++] = LDAV_CVT (load_ave[1]);
|
||||
if (nelem > 2)
|
||||
loadavg[elem++] = LDAV_CVT (load_ave[2]);
|
||||
|
||||
# define LDAV_DONE
|
||||
# endif /* !LDAV_DONE && LOAD_AVE_TYPE */
|
||||
|
||||
# if !defined LDAV_DONE
|
||||
errno = ENOSYS;
|
||||
elem = -1;
|
||||
# endif
|
||||
return elem;
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,210 @@
|
||||
/* Copyright (C) 1991, 1992, 1995, 1996, 1997, 1998 Free Software Foundation,
|
||||
Inc.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to the Free
|
||||
Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
|
||||
USA. */
|
||||
|
||||
#ifndef _GLOB_H
|
||||
#define _GLOB_H 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#undef __ptr_t
|
||||
#if defined __cplusplus || (defined __STDC__ && __STDC__) || defined WINDOWS32
|
||||
# if !defined __GLIBC__
|
||||
# undef __P
|
||||
# undef __PMT
|
||||
# define __P(protos) protos
|
||||
# define __PMT(protos) protos
|
||||
# if !defined __GNUC__ || __GNUC__ < 2
|
||||
# undef __const
|
||||
# define __const const
|
||||
# endif
|
||||
# endif
|
||||
# define __ptr_t void *
|
||||
#else /* Not C++ or ANSI C. */
|
||||
# undef __P
|
||||
# undef __PMT
|
||||
# define __P(protos) ()
|
||||
# define __PMT(protos) ()
|
||||
# undef __const
|
||||
# define __const
|
||||
# define __ptr_t char *
|
||||
#endif /* C++ or ANSI C. */
|
||||
|
||||
/* We need `size_t' for the following definitions. */
|
||||
#ifndef __size_t
|
||||
# if defined __FreeBSD__
|
||||
# define __size_t size_t
|
||||
# else
|
||||
# if defined __GNUC__ && __GNUC__ >= 2
|
||||
typedef __SIZE_TYPE__ __size_t;
|
||||
# else
|
||||
/* This is a guess. */
|
||||
/*hb
|
||||
* Conflicts with DECCs already 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
|
||||
# endif
|
||||
#else
|
||||
/* The GNU CC stddef.h version defines __size_t as empty. We need a real
|
||||
definition. */
|
||||
# undef __size_t
|
||||
# define __size_t size_t
|
||||
#endif
|
||||
|
||||
/* Bits set in the FLAGS argument to `glob'. */
|
||||
#define GLOB_ERR (1 << 0)/* Return on read errors. */
|
||||
#define GLOB_MARK (1 << 1)/* Append a slash to each name. */
|
||||
#define GLOB_NOSORT (1 << 2)/* Don't sort the names. */
|
||||
#define GLOB_DOOFFS (1 << 3)/* Insert PGLOB->gl_offs NULLs. */
|
||||
#define GLOB_NOCHECK (1 << 4)/* If nothing matches, return the pattern. */
|
||||
#define GLOB_APPEND (1 << 5)/* Append to results of a previous call. */
|
||||
#define GLOB_NOESCAPE (1 << 6)/* Backslashes don't quote metacharacters. */
|
||||
#define GLOB_PERIOD (1 << 7)/* Leading `.' can be matched by metachars. */
|
||||
|
||||
#if (!defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _BSD_SOURCE \
|
||||
|| defined _GNU_SOURCE)
|
||||
# define GLOB_MAGCHAR (1 << 8)/* Set in gl_flags if any metachars seen. */
|
||||
# define GLOB_ALTDIRFUNC (1 << 9)/* Use gl_opendir et al functions. */
|
||||
# define GLOB_BRACE (1 << 10)/* Expand "{a,b}" to "a" "b". */
|
||||
# define GLOB_NOMAGIC (1 << 11)/* If no magic chars, return the pattern. */
|
||||
# define GLOB_TILDE (1 << 12)/* Expand ~user and ~ to home directories. */
|
||||
# define GLOB_ONLYDIR (1 << 13)/* Match only directories. */
|
||||
# define GLOB_TILDE_CHECK (1 << 14)/* Like GLOB_TILDE but return an error
|
||||
if the user name is not available. */
|
||||
# define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
|
||||
GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \
|
||||
GLOB_PERIOD|GLOB_ALTDIRFUNC|GLOB_BRACE| \
|
||||
GLOB_NOMAGIC|GLOB_TILDE|GLOB_ONLYDIR|GLOB_TILDE_CHECK)
|
||||
#else
|
||||
# define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
|
||||
GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \
|
||||
GLOB_PERIOD)
|
||||
#endif
|
||||
|
||||
/* Error returns from `glob'. */
|
||||
#define GLOB_NOSPACE 1 /* Ran out of memory. */
|
||||
#define GLOB_ABORTED 2 /* Read error. */
|
||||
#define GLOB_NOMATCH 3 /* No matches found. */
|
||||
#define GLOB_NOSYS 4 /* Not implemented. */
|
||||
#ifdef _GNU_SOURCE
|
||||
/* Previous versions of this file defined GLOB_ABEND instead of
|
||||
GLOB_ABORTED. Provide a compatibility definition here. */
|
||||
# define GLOB_ABEND GLOB_ABORTED
|
||||
#endif
|
||||
|
||||
/* Structure describing a globbing run. */
|
||||
#if !defined _AMIGA && !defined VMS /* Buggy compiler. */
|
||||
struct stat;
|
||||
#endif
|
||||
typedef struct
|
||||
{
|
||||
__size_t gl_pathc; /* Count of paths matched by the pattern. */
|
||||
char **gl_pathv; /* List of matched pathnames. */
|
||||
__size_t gl_offs; /* Slots to reserve in `gl_pathv'. */
|
||||
int gl_flags; /* Set to FLAGS, maybe | GLOB_MAGCHAR. */
|
||||
|
||||
/* If the GLOB_ALTDIRFUNC flag is set, the following functions
|
||||
are used instead of the normal file access functions. */
|
||||
void (*gl_closedir) __PMT ((void *));
|
||||
struct 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
|
||||
struct stat64;
|
||||
typedef struct
|
||||
{
|
||||
__size_t gl_pathc;
|
||||
char **gl_pathv;
|
||||
__size_t gl_offs;
|
||||
int gl_flags;
|
||||
|
||||
/* If the GLOB_ALTDIRFUNC flag is set, the following functions
|
||||
are used instead of the normal file access functions. */
|
||||
void (*gl_closedir) __PMT ((void *));
|
||||
struct dirent64 *(*gl_readdir) __PMT ((void *));
|
||||
__ptr_t (*gl_opendir) __PMT ((__const char *));
|
||||
int (*gl_lstat) __PMT ((__const char *, struct stat64 *));
|
||||
int (*gl_stat) __PMT ((__const char *, struct stat64 *));
|
||||
} glob64_t;
|
||||
#endif
|
||||
|
||||
#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,
|
||||
it is called with the pathname that caused the error, and the
|
||||
`errno' value from the failing call; if it returns non-zero
|
||||
`glob' returns GLOB_ABEND; if it returns zero, the error is ignored.
|
||||
If memory cannot be allocated for PGLOB, GLOB_NOSPACE is returned.
|
||||
Otherwise, `glob' returns zero. */
|
||||
#if _FILE_OFFSET_BITS != 64 || __GNUC__ < 2
|
||||
extern int glob __P ((__const char *__pattern, int __flags,
|
||||
int (*__errfunc) (__const char *, int),
|
||||
glob_t *__pglob));
|
||||
|
||||
/* Free storage allocated in PGLOB by a previous `glob' call. */
|
||||
extern void globfree __P ((glob_t *__pglob));
|
||||
#else
|
||||
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");
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef _GNU_SOURCE
|
||||
/* Return nonzero if PATTERN contains any metacharacters.
|
||||
Metacharacters can be quoted with backslashes if QUOTE is nonzero.
|
||||
|
||||
This function is not part of the interface specified by POSIX.2
|
||||
but several programs want to use it. */
|
||||
extern int glob_pattern_p __P ((__const char *__pattern, int __quote));
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* glob.h */
|
||||
@@ -0,0 +1,642 @@
|
||||
/* intprops.h -- properties of integer types
|
||||
|
||||
Copyright (C) 2001-2022 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU Lesser General Public License as published
|
||||
by the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
|
||||
#ifndef _GL_INTPROPS_H
|
||||
#define _GL_INTPROPS_H
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
/* Return a value with the common real type of E and V and the value of V.
|
||||
Do not evaluate E. */
|
||||
#define _GL_INT_CONVERT(e, v) ((1 ? 0 : (e)) + (v))
|
||||
|
||||
/* Act like _GL_INT_CONVERT (E, -V) but work around a bug in IRIX 6.5 cc; see
|
||||
<https://lists.gnu.org/r/bug-gnulib/2011-05/msg00406.html>. */
|
||||
#define _GL_INT_NEGATE_CONVERT(e, v) ((1 ? 0 : (e)) - (v))
|
||||
|
||||
/* The extra casts in the following macros work around compiler bugs,
|
||||
e.g., in Cray C 5.0.3.0. */
|
||||
|
||||
/* True if the arithmetic type T is an integer type. bool counts as
|
||||
an integer. */
|
||||
#define TYPE_IS_INTEGER(t) ((t) 1.5 == 1)
|
||||
|
||||
/* True if the real type T is signed. */
|
||||
#define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
|
||||
|
||||
/* Return 1 if the real expression E, after promotion, has a
|
||||
signed or floating type. Do not evaluate E. */
|
||||
#define EXPR_SIGNED(e) (_GL_INT_NEGATE_CONVERT (e, 1) < 0)
|
||||
|
||||
|
||||
/* Minimum and maximum values for integer types and expressions. */
|
||||
|
||||
/* The width in bits of the integer type or expression T.
|
||||
Do not evaluate T. T must not be a bit-field expression.
|
||||
Padding bits are not supported; this is checked at compile-time below. */
|
||||
#define TYPE_WIDTH(t) (sizeof (t) * CHAR_BIT)
|
||||
|
||||
/* The maximum and minimum values for the integer type T. */
|
||||
#define TYPE_MINIMUM(t) ((t) ~ TYPE_MAXIMUM (t))
|
||||
#define TYPE_MAXIMUM(t) \
|
||||
((t) (! TYPE_SIGNED (t) \
|
||||
? (t) -1 \
|
||||
: ((((t) 1 << (TYPE_WIDTH (t) - 2)) - 1) * 2 + 1)))
|
||||
|
||||
/* The maximum and minimum values for the type of the expression E,
|
||||
after integer promotion. E is not evaluated. */
|
||||
#define _GL_INT_MINIMUM(e) \
|
||||
(EXPR_SIGNED (e) \
|
||||
? ~ _GL_SIGNED_INT_MAXIMUM (e) \
|
||||
: _GL_INT_CONVERT (e, 0))
|
||||
#define _GL_INT_MAXIMUM(e) \
|
||||
(EXPR_SIGNED (e) \
|
||||
? _GL_SIGNED_INT_MAXIMUM (e) \
|
||||
: _GL_INT_NEGATE_CONVERT (e, 1))
|
||||
#define _GL_SIGNED_INT_MAXIMUM(e) \
|
||||
(((_GL_INT_CONVERT (e, 1) << (TYPE_WIDTH (+ (e)) - 2)) - 1) * 2 + 1)
|
||||
|
||||
/* Work around OpenVMS incompatibility with C99. */
|
||||
#if !defined LLONG_MAX && defined __INT64_MAX
|
||||
# define LLONG_MAX __INT64_MAX
|
||||
# define LLONG_MIN __INT64_MIN
|
||||
#endif
|
||||
|
||||
/* This include file assumes that signed types are two's complement without
|
||||
padding bits; the above macros have undefined behavior otherwise.
|
||||
If this is a problem for you, please let us know how to fix it for your host.
|
||||
This assumption is tested by the intprops-tests module. */
|
||||
|
||||
/* Does the __typeof__ keyword work? This could be done by
|
||||
'configure', but for now it's easier to do it by hand. */
|
||||
#if (2 <= __GNUC__ \
|
||||
|| (4 <= __clang_major__) \
|
||||
|| (1210 <= __IBMC__ && defined __IBM__TYPEOF__) \
|
||||
|| (0x5110 <= __SUNPRO_C && !__STDC__))
|
||||
# define _GL_HAVE___TYPEOF__ 1
|
||||
#else
|
||||
# define _GL_HAVE___TYPEOF__ 0
|
||||
#endif
|
||||
|
||||
/* Return 1 if the integer type or expression T might be signed. Return 0
|
||||
if it is definitely unsigned. T must not be a bit-field expression.
|
||||
This macro does not evaluate its argument, and expands to an
|
||||
integer constant expression. */
|
||||
#if _GL_HAVE___TYPEOF__
|
||||
# define _GL_SIGNED_TYPE_OR_EXPR(t) TYPE_SIGNED (__typeof__ (t))
|
||||
#else
|
||||
# define _GL_SIGNED_TYPE_OR_EXPR(t) 1
|
||||
#endif
|
||||
|
||||
/* Bound on length of the string representing an unsigned integer
|
||||
value representable in B bits. log10 (2.0) < 146/485. The
|
||||
smallest value of B where this bound is not tight is 2621. */
|
||||
#define INT_BITS_STRLEN_BOUND(b) (((b) * 146 + 484) / 485)
|
||||
|
||||
/* Bound on length of the string representing an integer type or expression T.
|
||||
T must not be a bit-field expression.
|
||||
|
||||
Subtract 1 for the sign bit if T is signed, and then add 1 more for
|
||||
a minus sign if needed.
|
||||
|
||||
Because _GL_SIGNED_TYPE_OR_EXPR sometimes returns 1 when its argument is
|
||||
unsigned, this macro may overestimate the true bound by one byte when
|
||||
applied to unsigned types of size 2, 4, 16, ... bytes. */
|
||||
#define INT_STRLEN_BOUND(t) \
|
||||
(INT_BITS_STRLEN_BOUND (TYPE_WIDTH (t) - _GL_SIGNED_TYPE_OR_EXPR (t)) \
|
||||
+ _GL_SIGNED_TYPE_OR_EXPR (t))
|
||||
|
||||
/* Bound on buffer size needed to represent an integer type or expression T,
|
||||
including the terminating null. T must not be a bit-field expression. */
|
||||
#define INT_BUFSIZE_BOUND(t) (INT_STRLEN_BOUND (t) + 1)
|
||||
|
||||
|
||||
/* Range overflow checks.
|
||||
|
||||
The INT_<op>_RANGE_OVERFLOW macros return 1 if the corresponding C
|
||||
operators might not yield numerically correct answers due to
|
||||
arithmetic overflow. They do not rely on undefined or
|
||||
implementation-defined behavior. Their implementations are simple
|
||||
and straightforward, but they are harder to use and may be less
|
||||
efficient than the INT_<op>_WRAPV, INT_<op>_OK, and
|
||||
INT_<op>_OVERFLOW macros described below.
|
||||
|
||||
Example usage:
|
||||
|
||||
long int i = ...;
|
||||
long int j = ...;
|
||||
if (INT_MULTIPLY_RANGE_OVERFLOW (i, j, LONG_MIN, LONG_MAX))
|
||||
printf ("multiply would overflow");
|
||||
else
|
||||
printf ("product is %ld", i * j);
|
||||
|
||||
Restrictions on *_RANGE_OVERFLOW macros:
|
||||
|
||||
These macros do not check for all possible numerical problems or
|
||||
undefined or unspecified behavior: they do not check for division
|
||||
by zero, for bad shift counts, or for shifting negative numbers.
|
||||
|
||||
These macros may evaluate their arguments zero or multiple times,
|
||||
so the arguments should not have side effects. The arithmetic
|
||||
arguments (including the MIN and MAX arguments) must be of the same
|
||||
integer type after the usual arithmetic conversions, and the type
|
||||
must have minimum value MIN and maximum MAX. Unsigned types should
|
||||
use a zero MIN of the proper type.
|
||||
|
||||
Because all arguments are subject to integer promotions, these
|
||||
macros typically do not work on types narrower than 'int'.
|
||||
|
||||
These macros are tuned for constant MIN and MAX. For commutative
|
||||
operations such as A + B, they are also tuned for constant B. */
|
||||
|
||||
/* Return 1 if A + B would overflow in [MIN,MAX] arithmetic.
|
||||
See above for restrictions. */
|
||||
#define INT_ADD_RANGE_OVERFLOW(a, b, min, max) \
|
||||
((b) < 0 \
|
||||
? (a) < (min) - (b) \
|
||||
: (max) - (b) < (a))
|
||||
|
||||
/* Return 1 if A - B would overflow in [MIN,MAX] arithmetic.
|
||||
See above for restrictions. */
|
||||
#define INT_SUBTRACT_RANGE_OVERFLOW(a, b, min, max) \
|
||||
((b) < 0 \
|
||||
? (max) + (b) < (a) \
|
||||
: (a) < (min) + (b))
|
||||
|
||||
/* Return 1 if - A would overflow in [MIN,MAX] arithmetic.
|
||||
See above for restrictions. */
|
||||
#define INT_NEGATE_RANGE_OVERFLOW(a, min, max) \
|
||||
((min) < 0 \
|
||||
? (a) < - (max) \
|
||||
: 0 < (a))
|
||||
|
||||
/* Return 1 if A * B would overflow in [MIN,MAX] arithmetic.
|
||||
See above for restrictions. Avoid && and || as they tickle
|
||||
bugs in Sun C 5.11 2010/08/13 and other compilers; see
|
||||
<https://lists.gnu.org/r/bug-gnulib/2011-05/msg00401.html>. */
|
||||
#define INT_MULTIPLY_RANGE_OVERFLOW(a, b, min, max) \
|
||||
((b) < 0 \
|
||||
? ((a) < 0 \
|
||||
? (a) < (max) / (b) \
|
||||
: (b) == -1 \
|
||||
? 0 \
|
||||
: (min) / (b) < (a)) \
|
||||
: (b) == 0 \
|
||||
? 0 \
|
||||
: ((a) < 0 \
|
||||
? (a) < (min) / (b) \
|
||||
: (max) / (b) < (a)))
|
||||
|
||||
/* Return 1 if A / B would overflow in [MIN,MAX] arithmetic.
|
||||
See above for restrictions. Do not check for division by zero. */
|
||||
#define INT_DIVIDE_RANGE_OVERFLOW(a, b, min, max) \
|
||||
((min) < 0 && (b) == -1 && (a) < - (max))
|
||||
|
||||
/* Return 1 if A % B would overflow in [MIN,MAX] arithmetic.
|
||||
See above for restrictions. Do not check for division by zero.
|
||||
Mathematically, % should never overflow, but on x86-like hosts
|
||||
INT_MIN % -1 traps, and the C standard permits this, so treat this
|
||||
as an overflow too. */
|
||||
#define INT_REMAINDER_RANGE_OVERFLOW(a, b, min, max) \
|
||||
INT_DIVIDE_RANGE_OVERFLOW (a, b, min, max)
|
||||
|
||||
/* Return 1 if A << B would overflow in [MIN,MAX] arithmetic.
|
||||
See above for restrictions. Here, MIN and MAX are for A only, and B need
|
||||
not be of the same type as the other arguments. The C standard says that
|
||||
behavior is undefined for shifts unless 0 <= B < wordwidth, and that when
|
||||
A is negative then A << B has undefined behavior and A >> B has
|
||||
implementation-defined behavior, but do not check these other
|
||||
restrictions. */
|
||||
#define INT_LEFT_SHIFT_RANGE_OVERFLOW(a, b, min, max) \
|
||||
((a) < 0 \
|
||||
? (a) < (min) >> (b) \
|
||||
: (max) >> (b) < (a))
|
||||
|
||||
/* True if __builtin_add_overflow (A, B, P) and __builtin_sub_overflow
|
||||
(A, B, P) work when P is non-null. */
|
||||
#ifdef __EDG__
|
||||
/* EDG-based compilers like nvc 22.1 cannot add 64-bit signed to unsigned
|
||||
<https://bugs.gnu.org/53256>. */
|
||||
# define _GL_HAS_BUILTIN_ADD_OVERFLOW 0
|
||||
#elif defined __has_builtin
|
||||
# define _GL_HAS_BUILTIN_ADD_OVERFLOW __has_builtin (__builtin_add_overflow)
|
||||
/* __builtin_{add,sub}_overflow exists but is not reliable in GCC 5.x and 6.x,
|
||||
see <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98269>. */
|
||||
#elif 7 <= __GNUC__
|
||||
# define _GL_HAS_BUILTIN_ADD_OVERFLOW 1
|
||||
#else
|
||||
# define _GL_HAS_BUILTIN_ADD_OVERFLOW 0
|
||||
#endif
|
||||
|
||||
/* True if __builtin_mul_overflow (A, B, P) works when P is non-null. */
|
||||
#if defined __clang_major__ && __clang_major__ < 14
|
||||
/* Work around Clang bug <https://bugs.llvm.org/show_bug.cgi?id=16404>. */
|
||||
# define _GL_HAS_BUILTIN_MUL_OVERFLOW 0
|
||||
#else
|
||||
# define _GL_HAS_BUILTIN_MUL_OVERFLOW _GL_HAS_BUILTIN_ADD_OVERFLOW
|
||||
#endif
|
||||
|
||||
/* True if __builtin_add_overflow_p (A, B, C) works, and similarly for
|
||||
__builtin_sub_overflow_p and __builtin_mul_overflow_p. */
|
||||
#ifdef __EDG__
|
||||
/* In EDG-based compilers like ICC 2021.3 and earlier,
|
||||
__builtin_add_overflow_p etc. are not treated as integral constant
|
||||
expressions even when all arguments are. */
|
||||
# define _GL_HAS_BUILTIN_OVERFLOW_P 0
|
||||
#elif defined __has_builtin
|
||||
# define _GL_HAS_BUILTIN_OVERFLOW_P __has_builtin (__builtin_mul_overflow_p)
|
||||
#else
|
||||
# define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__)
|
||||
#endif
|
||||
|
||||
/* The _GL*_OVERFLOW macros have the same restrictions as the
|
||||
*_RANGE_OVERFLOW macros, except that they do not assume that operands
|
||||
(e.g., A and B) have the same type as MIN and MAX. Instead, they assume
|
||||
that the result (e.g., A + B) has that type. */
|
||||
#if _GL_HAS_BUILTIN_OVERFLOW_P
|
||||
# define _GL_ADD_OVERFLOW(a, b, min, max) \
|
||||
__builtin_add_overflow_p (a, b, (__typeof__ ((a) + (b))) 0)
|
||||
# define _GL_SUBTRACT_OVERFLOW(a, b, min, max) \
|
||||
__builtin_sub_overflow_p (a, b, (__typeof__ ((a) - (b))) 0)
|
||||
# define _GL_MULTIPLY_OVERFLOW(a, b, min, max) \
|
||||
__builtin_mul_overflow_p (a, b, (__typeof__ ((a) * (b))) 0)
|
||||
#else
|
||||
# define _GL_ADD_OVERFLOW(a, b, min, max) \
|
||||
((min) < 0 ? INT_ADD_RANGE_OVERFLOW (a, b, min, max) \
|
||||
: (a) < 0 ? (b) <= (a) + (b) \
|
||||
: (b) < 0 ? (a) <= (a) + (b) \
|
||||
: (a) + (b) < (b))
|
||||
# define _GL_SUBTRACT_OVERFLOW(a, b, min, max) \
|
||||
((min) < 0 ? INT_SUBTRACT_RANGE_OVERFLOW (a, b, min, max) \
|
||||
: (a) < 0 ? 1 \
|
||||
: (b) < 0 ? (a) - (b) <= (a) \
|
||||
: (a) < (b))
|
||||
# define _GL_MULTIPLY_OVERFLOW(a, b, min, max) \
|
||||
(((min) == 0 && (((a) < 0 && 0 < (b)) || ((b) < 0 && 0 < (a)))) \
|
||||
|| INT_MULTIPLY_RANGE_OVERFLOW (a, b, min, max))
|
||||
#endif
|
||||
#define _GL_DIVIDE_OVERFLOW(a, b, min, max) \
|
||||
((min) < 0 ? (b) == _GL_INT_NEGATE_CONVERT (min, 1) && (a) < - (max) \
|
||||
: (a) < 0 ? (b) <= (a) + (b) - 1 \
|
||||
: (b) < 0 && (a) + (b) <= (a))
|
||||
#define _GL_REMAINDER_OVERFLOW(a, b, min, max) \
|
||||
((min) < 0 ? (b) == _GL_INT_NEGATE_CONVERT (min, 1) && (a) < - (max) \
|
||||
: (a) < 0 ? (a) % (b) != ((max) - (b) + 1) % (b) \
|
||||
: (b) < 0 && ! _GL_UNSIGNED_NEG_MULTIPLE (a, b, max))
|
||||
|
||||
/* Return a nonzero value if A is a mathematical multiple of B, where
|
||||
A is unsigned, B is negative, and MAX is the maximum value of A's
|
||||
type. A's type must be the same as (A % B)'s type. Normally (A %
|
||||
-B == 0) suffices, but things get tricky if -B would overflow. */
|
||||
#define _GL_UNSIGNED_NEG_MULTIPLE(a, b, max) \
|
||||
(((b) < -_GL_SIGNED_INT_MAXIMUM (b) \
|
||||
? (_GL_SIGNED_INT_MAXIMUM (b) == (max) \
|
||||
? (a) \
|
||||
: (a) % (_GL_INT_CONVERT (a, _GL_SIGNED_INT_MAXIMUM (b)) + 1)) \
|
||||
: (a) % - (b)) \
|
||||
== 0)
|
||||
|
||||
/* Check for integer overflow, and report low order bits of answer.
|
||||
|
||||
The INT_<op>_OVERFLOW macros return 1 if the corresponding C operators
|
||||
might not yield numerically correct answers due to arithmetic overflow.
|
||||
The INT_<op>_WRAPV macros compute the low-order bits of the sum,
|
||||
difference, and product of two C integers, and return 1 if these
|
||||
low-order bits are not numerically correct.
|
||||
These macros work correctly on all known practical hosts, and do not rely
|
||||
on undefined behavior due to signed arithmetic overflow.
|
||||
|
||||
Example usage, assuming A and B are long int:
|
||||
|
||||
if (INT_MULTIPLY_OVERFLOW (a, b))
|
||||
printf ("result would overflow\n");
|
||||
else
|
||||
printf ("result is %ld (no overflow)\n", a * b);
|
||||
|
||||
Example usage with WRAPV flavor:
|
||||
|
||||
long int result;
|
||||
bool overflow = INT_MULTIPLY_WRAPV (a, b, &result);
|
||||
printf ("result is %ld (%s)\n", result,
|
||||
overflow ? "after overflow" : "no overflow");
|
||||
|
||||
Restrictions on these macros:
|
||||
|
||||
These macros do not check for all possible numerical problems or
|
||||
undefined or unspecified behavior: they do not check for division
|
||||
by zero, for bad shift counts, or for shifting negative numbers.
|
||||
|
||||
These macros may evaluate their arguments zero or multiple times, so the
|
||||
arguments should not have side effects.
|
||||
|
||||
The WRAPV macros are not constant expressions. They support only
|
||||
+, binary -, and *.
|
||||
|
||||
Because the WRAPV macros convert the result, they report overflow
|
||||
in different circumstances than the OVERFLOW macros do. For
|
||||
example, in the typical case with 16-bit 'short' and 32-bit 'int',
|
||||
if A, B and R are all of type 'short' then INT_ADD_OVERFLOW (A, B)
|
||||
returns false because the addition cannot overflow after A and B
|
||||
are converted to 'int', whereas INT_ADD_WRAPV (A, B, &R) returns
|
||||
true or false depending on whether the sum fits into 'short'.
|
||||
|
||||
These macros are tuned for their last input argument being a constant.
|
||||
|
||||
Return 1 if the integer expressions A * B, A - B, -A, A * B, A / B,
|
||||
A % B, and A << B would overflow, respectively. */
|
||||
|
||||
#define INT_ADD_OVERFLOW(a, b) \
|
||||
_GL_BINARY_OP_OVERFLOW (a, b, _GL_ADD_OVERFLOW)
|
||||
#define INT_SUBTRACT_OVERFLOW(a, b) \
|
||||
_GL_BINARY_OP_OVERFLOW (a, b, _GL_SUBTRACT_OVERFLOW)
|
||||
#if _GL_HAS_BUILTIN_OVERFLOW_P
|
||||
# define INT_NEGATE_OVERFLOW(a) INT_SUBTRACT_OVERFLOW (0, a)
|
||||
#else
|
||||
# define INT_NEGATE_OVERFLOW(a) \
|
||||
INT_NEGATE_RANGE_OVERFLOW (a, _GL_INT_MINIMUM (a), _GL_INT_MAXIMUM (a))
|
||||
#endif
|
||||
#define INT_MULTIPLY_OVERFLOW(a, b) \
|
||||
_GL_BINARY_OP_OVERFLOW (a, b, _GL_MULTIPLY_OVERFLOW)
|
||||
#define INT_DIVIDE_OVERFLOW(a, b) \
|
||||
_GL_BINARY_OP_OVERFLOW (a, b, _GL_DIVIDE_OVERFLOW)
|
||||
#define INT_REMAINDER_OVERFLOW(a, b) \
|
||||
_GL_BINARY_OP_OVERFLOW (a, b, _GL_REMAINDER_OVERFLOW)
|
||||
#define INT_LEFT_SHIFT_OVERFLOW(a, b) \
|
||||
INT_LEFT_SHIFT_RANGE_OVERFLOW (a, b, \
|
||||
_GL_INT_MINIMUM (a), _GL_INT_MAXIMUM (a))
|
||||
|
||||
/* Return 1 if the expression A <op> B would overflow,
|
||||
where OP_RESULT_OVERFLOW (A, B, MIN, MAX) does the actual test,
|
||||
assuming MIN and MAX are the minimum and maximum for the result type.
|
||||
Arguments should be free of side effects. */
|
||||
#define _GL_BINARY_OP_OVERFLOW(a, b, op_result_overflow) \
|
||||
op_result_overflow (a, b, \
|
||||
_GL_INT_MINIMUM (_GL_INT_CONVERT (a, b)), \
|
||||
_GL_INT_MAXIMUM (_GL_INT_CONVERT (a, b)))
|
||||
|
||||
/* Store the low-order bits of A + B, A - B, A * B, respectively, into *R.
|
||||
Return 1 if the result overflows. See above for restrictions. */
|
||||
#if _GL_HAS_BUILTIN_ADD_OVERFLOW
|
||||
# define INT_ADD_WRAPV(a, b, r) __builtin_add_overflow (a, b, r)
|
||||
# define INT_SUBTRACT_WRAPV(a, b, r) __builtin_sub_overflow (a, b, r)
|
||||
#else
|
||||
# define INT_ADD_WRAPV(a, b, r) \
|
||||
_GL_INT_OP_WRAPV (a, b, r, +, _GL_INT_ADD_RANGE_OVERFLOW)
|
||||
# define INT_SUBTRACT_WRAPV(a, b, r) \
|
||||
_GL_INT_OP_WRAPV (a, b, r, -, _GL_INT_SUBTRACT_RANGE_OVERFLOW)
|
||||
#endif
|
||||
#if _GL_HAS_BUILTIN_MUL_OVERFLOW
|
||||
# if ((9 < __GNUC__ + (3 <= __GNUC_MINOR__) \
|
||||
|| (__GNUC__ == 8 && 4 <= __GNUC_MINOR__)) \
|
||||
&& !defined __EDG__)
|
||||
# define INT_MULTIPLY_WRAPV(a, b, r) __builtin_mul_overflow (a, b, r)
|
||||
# else
|
||||
/* Work around GCC bug 91450. */
|
||||
# define INT_MULTIPLY_WRAPV(a, b, r) \
|
||||
((!_GL_SIGNED_TYPE_OR_EXPR (*(r)) && EXPR_SIGNED (a) && EXPR_SIGNED (b) \
|
||||
&& _GL_INT_MULTIPLY_RANGE_OVERFLOW (a, b, 0, (__typeof__ (*(r))) -1)) \
|
||||
? ((void) __builtin_mul_overflow (a, b, r), 1) \
|
||||
: __builtin_mul_overflow (a, b, r))
|
||||
# endif
|
||||
#else
|
||||
# define INT_MULTIPLY_WRAPV(a, b, r) \
|
||||
_GL_INT_OP_WRAPV (a, b, r, *, _GL_INT_MULTIPLY_RANGE_OVERFLOW)
|
||||
#endif
|
||||
|
||||
/* Nonzero if this compiler has GCC bug 68193 or Clang bug 25390. See:
|
||||
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68193
|
||||
https://llvm.org/bugs/show_bug.cgi?id=25390
|
||||
For now, assume all versions of GCC-like compilers generate bogus
|
||||
warnings for _Generic. This matters only for compilers that
|
||||
lack relevant builtins. */
|
||||
#if __GNUC__ || defined __clang__
|
||||
# define _GL__GENERIC_BOGUS 1
|
||||
#else
|
||||
# define _GL__GENERIC_BOGUS 0
|
||||
#endif
|
||||
|
||||
/* Store the low-order bits of A <op> B into *R, where OP specifies
|
||||
the operation and OVERFLOW the overflow predicate. Return 1 if the
|
||||
result overflows. See above for restrictions. */
|
||||
#if 201112 <= __STDC_VERSION__ && !_GL__GENERIC_BOGUS
|
||||
# define _GL_INT_OP_WRAPV(a, b, r, op, overflow) \
|
||||
(_Generic \
|
||||
(*(r), \
|
||||
signed char: \
|
||||
_GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
|
||||
signed char, SCHAR_MIN, SCHAR_MAX), \
|
||||
unsigned char: \
|
||||
_GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
|
||||
unsigned char, 0, UCHAR_MAX), \
|
||||
short int: \
|
||||
_GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
|
||||
short int, SHRT_MIN, SHRT_MAX), \
|
||||
unsigned short int: \
|
||||
_GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
|
||||
unsigned short int, 0, USHRT_MAX), \
|
||||
int: \
|
||||
_GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
|
||||
int, INT_MIN, INT_MAX), \
|
||||
unsigned int: \
|
||||
_GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
|
||||
unsigned int, 0, UINT_MAX), \
|
||||
long int: \
|
||||
_GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
|
||||
long int, LONG_MIN, LONG_MAX), \
|
||||
unsigned long int: \
|
||||
_GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
|
||||
unsigned long int, 0, ULONG_MAX), \
|
||||
long long int: \
|
||||
_GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \
|
||||
long long int, LLONG_MIN, LLONG_MAX), \
|
||||
unsigned long long int: \
|
||||
_GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \
|
||||
unsigned long long int, 0, ULLONG_MAX)))
|
||||
#else
|
||||
/* Store the low-order bits of A <op> B into *R, where OP specifies
|
||||
the operation and OVERFLOW the overflow predicate. If *R is
|
||||
signed, its type is ST with bounds SMIN..SMAX; otherwise its type
|
||||
is UT with bounds U..UMAX. ST and UT are narrower than int.
|
||||
Return 1 if the result overflows. See above for restrictions. */
|
||||
# if _GL_HAVE___TYPEOF__
|
||||
# define _GL_INT_OP_WRAPV_SMALLISH(a,b,r,op,overflow,st,smin,smax,ut,umax) \
|
||||
(TYPE_SIGNED (__typeof__ (*(r))) \
|
||||
? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, st, smin, smax) \
|
||||
: _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, ut, 0, umax))
|
||||
# else
|
||||
# define _GL_INT_OP_WRAPV_SMALLISH(a,b,r,op,overflow,st,smin,smax,ut,umax) \
|
||||
(overflow (a, b, smin, smax) \
|
||||
? (overflow (a, b, 0, umax) \
|
||||
? (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a,b,op,unsigned,st), 1) \
|
||||
: (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a,b,op,unsigned,st)) < 0) \
|
||||
: (overflow (a, b, 0, umax) \
|
||||
? (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a,b,op,unsigned,st)) >= 0 \
|
||||
: (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a,b,op,unsigned,st), 0)))
|
||||
# endif
|
||||
|
||||
# define _GL_INT_OP_WRAPV(a, b, r, op, overflow) \
|
||||
(sizeof *(r) == sizeof (signed char) \
|
||||
? _GL_INT_OP_WRAPV_SMALLISH (a, b, r, op, overflow, \
|
||||
signed char, SCHAR_MIN, SCHAR_MAX, \
|
||||
unsigned char, UCHAR_MAX) \
|
||||
: sizeof *(r) == sizeof (short int) \
|
||||
? _GL_INT_OP_WRAPV_SMALLISH (a, b, r, op, overflow, \
|
||||
short int, SHRT_MIN, SHRT_MAX, \
|
||||
unsigned short int, USHRT_MAX) \
|
||||
: sizeof *(r) == sizeof (int) \
|
||||
? (EXPR_SIGNED (*(r)) \
|
||||
? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
|
||||
int, INT_MIN, INT_MAX) \
|
||||
: _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
|
||||
unsigned int, 0, UINT_MAX)) \
|
||||
: _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow))
|
||||
# ifdef LLONG_MAX
|
||||
# define _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow) \
|
||||
(sizeof *(r) == sizeof (long int) \
|
||||
? (EXPR_SIGNED (*(r)) \
|
||||
? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
|
||||
long int, LONG_MIN, LONG_MAX) \
|
||||
: _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
|
||||
unsigned long int, 0, ULONG_MAX)) \
|
||||
: (EXPR_SIGNED (*(r)) \
|
||||
? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \
|
||||
long long int, LLONG_MIN, LLONG_MAX) \
|
||||
: _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \
|
||||
unsigned long long int, 0, ULLONG_MAX)))
|
||||
# else
|
||||
# define _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow) \
|
||||
(EXPR_SIGNED (*(r)) \
|
||||
? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
|
||||
long int, LONG_MIN, LONG_MAX) \
|
||||
: _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
|
||||
unsigned long int, 0, ULONG_MAX))
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Store the low-order bits of A <op> B into *R, where the operation
|
||||
is given by OP. Use the unsigned type UT for calculation to avoid
|
||||
overflow problems. *R's type is T, with extrema TMIN and TMAX.
|
||||
T must be a signed integer type. Return 1 if the result overflows. */
|
||||
#define _GL_INT_OP_CALC(a, b, r, op, overflow, ut, t, tmin, tmax) \
|
||||
(overflow (a, b, tmin, tmax) \
|
||||
? (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a, b, op, ut, t), 1) \
|
||||
: (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a, b, op, ut, t), 0))
|
||||
|
||||
/* Return the low-order bits of A <op> B, where the operation is given
|
||||
by OP. Use the unsigned type UT for calculation to avoid undefined
|
||||
behavior on signed integer overflow, and convert the result to type T.
|
||||
UT is at least as wide as T and is no narrower than unsigned int,
|
||||
T is two's complement, and there is no padding or trap representations.
|
||||
Assume that converting UT to T yields the low-order bits, as is
|
||||
done in all known two's-complement C compilers. E.g., see:
|
||||
https://gcc.gnu.org/onlinedocs/gcc/Integers-implementation.html
|
||||
|
||||
According to the C standard, converting UT to T yields an
|
||||
implementation-defined result or signal for values outside T's
|
||||
range. However, code that works around this theoretical problem
|
||||
runs afoul of a compiler bug in Oracle Studio 12.3 x86. See:
|
||||
https://lists.gnu.org/r/bug-gnulib/2017-04/msg00049.html
|
||||
As the compiler bug is real, don't try to work around the
|
||||
theoretical problem. */
|
||||
|
||||
#define _GL_INT_OP_WRAPV_VIA_UNSIGNED(a, b, op, ut, t) \
|
||||
((t) ((ut) (a) op (ut) (b)))
|
||||
|
||||
/* Return true if the numeric values A + B, A - B, A * B fall outside
|
||||
the range TMIN..TMAX. Arguments should be integer expressions
|
||||
without side effects. TMIN should be signed and nonpositive.
|
||||
TMAX should be positive, and should be signed unless TMIN is zero. */
|
||||
#define _GL_INT_ADD_RANGE_OVERFLOW(a, b, tmin, tmax) \
|
||||
((b) < 0 \
|
||||
? (((tmin) \
|
||||
? ((EXPR_SIGNED (_GL_INT_CONVERT (a, (tmin) - (b))) || (b) < (tmin)) \
|
||||
&& (a) < (tmin) - (b)) \
|
||||
: (a) <= -1 - (b)) \
|
||||
|| ((EXPR_SIGNED (a) ? 0 <= (a) : (tmax) < (a)) && (tmax) < (a) + (b))) \
|
||||
: (a) < 0 \
|
||||
? (((tmin) \
|
||||
? ((EXPR_SIGNED (_GL_INT_CONVERT (b, (tmin) - (a))) || (a) < (tmin)) \
|
||||
&& (b) < (tmin) - (a)) \
|
||||
: (b) <= -1 - (a)) \
|
||||
|| ((EXPR_SIGNED (_GL_INT_CONVERT (a, b)) || (tmax) < (b)) \
|
||||
&& (tmax) < (a) + (b))) \
|
||||
: (tmax) < (b) || (tmax) - (b) < (a))
|
||||
#define _GL_INT_SUBTRACT_RANGE_OVERFLOW(a, b, tmin, tmax) \
|
||||
(((a) < 0) == ((b) < 0) \
|
||||
? ((a) < (b) \
|
||||
? !(tmin) || -1 - (tmin) < (b) - (a) - 1 \
|
||||
: (tmax) < (a) - (b)) \
|
||||
: (a) < 0 \
|
||||
? ((!EXPR_SIGNED (_GL_INT_CONVERT ((a) - (tmin), b)) && (a) - (tmin) < 0) \
|
||||
|| (a) - (tmin) < (b)) \
|
||||
: ((! (EXPR_SIGNED (_GL_INT_CONVERT (tmax, b)) \
|
||||
&& EXPR_SIGNED (_GL_INT_CONVERT ((tmax) + (b), a))) \
|
||||
&& (tmax) <= -1 - (b)) \
|
||||
|| (tmax) + (b) < (a)))
|
||||
#define _GL_INT_MULTIPLY_RANGE_OVERFLOW(a, b, tmin, tmax) \
|
||||
((b) < 0 \
|
||||
? ((a) < 0 \
|
||||
? (EXPR_SIGNED (_GL_INT_CONVERT (tmax, b)) \
|
||||
? (a) < (tmax) / (b) \
|
||||
: ((INT_NEGATE_OVERFLOW (b) \
|
||||
? _GL_INT_CONVERT (b, tmax) >> (TYPE_WIDTH (+ (b)) - 1) \
|
||||
: (tmax) / -(b)) \
|
||||
<= -1 - (a))) \
|
||||
: INT_NEGATE_OVERFLOW (_GL_INT_CONVERT (b, tmin)) && (b) == -1 \
|
||||
? (EXPR_SIGNED (a) \
|
||||
? 0 < (a) + (tmin) \
|
||||
: 0 < (a) && -1 - (tmin) < (a) - 1) \
|
||||
: (tmin) / (b) < (a)) \
|
||||
: (b) == 0 \
|
||||
? 0 \
|
||||
: ((a) < 0 \
|
||||
? (INT_NEGATE_OVERFLOW (_GL_INT_CONVERT (a, tmin)) && (a) == -1 \
|
||||
? (EXPR_SIGNED (b) ? 0 < (b) + (tmin) : -1 - (tmin) < (b) - 1) \
|
||||
: (tmin) / (a) < (b)) \
|
||||
: (tmax) / (b) < (a)))
|
||||
|
||||
/* The following macros compute A + B, A - B, and A * B, respectively.
|
||||
If no overflow occurs, they set *R to the result and return 1;
|
||||
otherwise, they return 0 and may modify *R.
|
||||
|
||||
Example usage:
|
||||
|
||||
long int result;
|
||||
if (INT_ADD_OK (a, b, &result))
|
||||
printf ("result is %ld\n", result);
|
||||
else
|
||||
printf ("overflow\n");
|
||||
|
||||
A, B, and *R should be integers; they need not be the same type,
|
||||
and they need not be all signed or all unsigned.
|
||||
|
||||
These macros work correctly on all known practical hosts, and do not rely
|
||||
on undefined behavior due to signed arithmetic overflow.
|
||||
|
||||
These macros are not constant expressions.
|
||||
|
||||
These macros may evaluate their arguments zero or multiple times, so the
|
||||
arguments should not have side effects.
|
||||
|
||||
These macros are tuned for B being a constant. */
|
||||
|
||||
#define INT_ADD_OK(a, b, r) ! INT_ADD_WRAPV (a, b, r)
|
||||
#define INT_SUBTRACT_OK(a, b, r) ! INT_SUBTRACT_WRAPV (a, b, r)
|
||||
#define INT_MULTIPLY_OK(a, b, r) ! INT_MULTIPLY_WRAPV (a, b, r)
|
||||
|
||||
#endif /* _GL_INTPROPS_H */
|
||||
@@ -0,0 +1,143 @@
|
||||
/* Copyright (C) 2001-2003, 2006-2022 Free Software Foundation, Inc.
|
||||
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This file 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 Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _GL_STDBOOL_H
|
||||
#define _GL_STDBOOL_H
|
||||
|
||||
/* ISO C 99 <stdbool.h> for platforms that lack it. */
|
||||
|
||||
/* Usage suggestions:
|
||||
|
||||
Programs that use <stdbool.h> should be aware of some limitations
|
||||
and standards compliance issues.
|
||||
|
||||
Standards compliance:
|
||||
|
||||
- <stdbool.h> must be #included before 'bool', 'false', 'true'
|
||||
can be used.
|
||||
|
||||
- You cannot assume that sizeof (bool) == 1.
|
||||
|
||||
- Programs should not undefine the macros bool, true, and false,
|
||||
as C99 lists that as an "obsolescent feature".
|
||||
|
||||
Limitations of this substitute, when used in a C89 environment:
|
||||
|
||||
- <stdbool.h> must be #included before the '_Bool' type can be used.
|
||||
|
||||
- You cannot assume that _Bool is a typedef; it might be a macro.
|
||||
|
||||
- Bit-fields of type 'bool' are not supported. Portable code
|
||||
should use 'unsigned int foo : 1;' rather than 'bool foo : 1;'.
|
||||
|
||||
- In C99, casts and automatic conversions to '_Bool' or 'bool' are
|
||||
performed in such a way that every nonzero value gets converted
|
||||
to 'true', and zero gets converted to 'false'. This doesn't work
|
||||
with this substitute. With this substitute, only the values 0 and 1
|
||||
give the expected result when converted to _Bool' or 'bool'.
|
||||
|
||||
- C99 allows the use of (_Bool)0.0 in constant expressions, but
|
||||
this substitute cannot always provide this property.
|
||||
|
||||
Also, it is suggested that programs use 'bool' rather than '_Bool';
|
||||
this isn't required, but 'bool' is more common. */
|
||||
|
||||
|
||||
/* 7.16. Boolean type and values */
|
||||
|
||||
/* BeOS <sys/socket.h> already #defines false 0, true 1. We use the same
|
||||
definitions below, but temporarily we have to #undef them. */
|
||||
#if defined __BEOS__ && !defined __HAIKU__
|
||||
# include <OS.h> /* defines bool but not _Bool */
|
||||
# undef false
|
||||
# undef true
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
# if !defined _MSC_VER
|
||||
# define _Bool bool
|
||||
# define bool bool
|
||||
# endif
|
||||
#else
|
||||
# if defined __BEOS__ && !defined __HAIKU__
|
||||
/* A compiler known to have 'bool'. */
|
||||
/* If the compiler already has both 'bool' and '_Bool', we can assume they
|
||||
are the same types. */
|
||||
# if !@HAVE__BOOL@
|
||||
typedef bool _Bool;
|
||||
# endif
|
||||
# else
|
||||
# if !defined __GNUC__
|
||||
/* If @HAVE__BOOL@:
|
||||
Some HP-UX cc and AIX IBM C compiler versions have compiler bugs when
|
||||
the built-in _Bool type is used. See
|
||||
https://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
|
||||
https://lists.gnu.org/r/bug-coreutils/2005-11/msg00161.html
|
||||
https://lists.gnu.org/r/bug-coreutils/2005-10/msg00086.html
|
||||
Similar bugs are likely with other compilers as well; this file
|
||||
wouldn't be used if <stdbool.h> was working.
|
||||
So we override the _Bool type.
|
||||
If !@HAVE__BOOL@:
|
||||
Need to define _Bool ourselves. As 'signed char' or as an enum type?
|
||||
Use of a typedef, with SunPRO C, leads to a stupid
|
||||
"warning: _Bool is a keyword in ISO C99".
|
||||
Use of an enum type, with IRIX cc, leads to a stupid
|
||||
"warning(1185): enumerated type mixed with another type".
|
||||
Even the existence of an enum type, without a typedef,
|
||||
"Invalid enumerator. (badenum)" with HP-UX cc on Tru64.
|
||||
The only benefit of the enum, debuggability, is not important
|
||||
with these compilers. So use 'signed char' and no enum. */
|
||||
# define _Bool signed char
|
||||
# else
|
||||
/* With this compiler, trust the _Bool type if the compiler has it. */
|
||||
# if !@HAVE__BOOL@
|
||||
/* For the sake of symbolic names in gdb, define true and false as
|
||||
enum constants, not only as macros.
|
||||
It is tempting to write
|
||||
typedef enum { false = 0, true = 1 } _Bool;
|
||||
so that gdb prints values of type 'bool' symbolically. But then
|
||||
values of type '_Bool' might promote to 'int' or 'unsigned int'
|
||||
(see ISO C 99 6.7.2.2.(4)); however, '_Bool' must promote to 'int'
|
||||
(see ISO C 99 6.3.1.1.(2)). So add a negative value to the
|
||||
enum; this ensures that '_Bool' promotes to 'int'. */
|
||||
typedef enum { _Bool_must_promote_to_int = -1, false = 0, true = 1 } _Bool;
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
# define bool _Bool
|
||||
#endif
|
||||
|
||||
/* The other macros must be usable in preprocessor directives. */
|
||||
#ifdef __cplusplus
|
||||
# if !defined _MSC_VER
|
||||
# define false false
|
||||
# define true true
|
||||
# endif
|
||||
/* In Sun C++ 5.11 (Solaris Studio 12.2) and older, 'true' as a preprocessor
|
||||
expression evaluates to 0, not 1. Fix this by overriding 'true'. Note that
|
||||
the replacement has to be of type 'bool'. */
|
||||
# if defined __SUNPRO_CC && true != 1
|
||||
# undef true
|
||||
# define true (!false)
|
||||
# endif
|
||||
#else
|
||||
# define false 0
|
||||
# define true 1
|
||||
#endif
|
||||
|
||||
#define __bool_true_false_are_defined 1
|
||||
|
||||
#endif /* _GL_STDBOOL_H */
|
||||
@@ -0,0 +1,149 @@
|
||||
/* A C macro for emitting warnings if a function is used.
|
||||
Copyright (C) 2010-2022 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU Lesser 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
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* _GL_WARN_ON_USE (function, "literal string") issues a declaration
|
||||
for FUNCTION which will then trigger a compiler warning containing
|
||||
the text of "literal string" anywhere that function is called, if
|
||||
supported by the compiler. If the compiler does not support this
|
||||
feature, the macro expands to an unused extern declaration.
|
||||
|
||||
_GL_WARN_ON_USE_ATTRIBUTE ("literal string") expands to the
|
||||
attribute used in _GL_WARN_ON_USE. If the compiler does not support
|
||||
this feature, it expands to empty.
|
||||
|
||||
These macros are useful for marking a function as a potential
|
||||
portability trap, with the intent that "literal string" include
|
||||
instructions on the replacement function that should be used
|
||||
instead.
|
||||
_GL_WARN_ON_USE is for functions with 'extern' linkage.
|
||||
_GL_WARN_ON_USE_ATTRIBUTE is for functions with 'static' or 'inline'
|
||||
linkage.
|
||||
|
||||
However, one of the reasons that a function is a portability trap is
|
||||
if it has the wrong signature. Declaring FUNCTION with a different
|
||||
signature in C is a compilation error, so this macro must use the
|
||||
same type as any existing declaration so that programs that avoid
|
||||
the problematic FUNCTION do not fail to compile merely because they
|
||||
included a header that poisoned the function. But this implies that
|
||||
_GL_WARN_ON_USE is only safe to use if FUNCTION is known to already
|
||||
have a declaration. Use of this macro implies that there must not
|
||||
be any other macro hiding the declaration of FUNCTION; but
|
||||
undefining FUNCTION first is part of the poisoning process anyway
|
||||
(although for symbols that are provided only via a macro, the result
|
||||
is a compilation error rather than a warning containing
|
||||
"literal string"). Also note that in C++, it is only safe to use if
|
||||
FUNCTION has no overloads.
|
||||
|
||||
For an example, it is possible to poison 'getline' by:
|
||||
- adding a call to gl_WARN_ON_USE_PREPARE([[#include <stdio.h>]],
|
||||
[getline]) in configure.ac, which potentially defines
|
||||
HAVE_RAW_DECL_GETLINE
|
||||
- adding this code to a header that wraps the system <stdio.h>:
|
||||
#undef getline
|
||||
#if HAVE_RAW_DECL_GETLINE
|
||||
_GL_WARN_ON_USE (getline, "getline is required by POSIX 2008, but"
|
||||
"not universally present; use the gnulib module getline");
|
||||
#endif
|
||||
|
||||
It is not possible to directly poison global variables. But it is
|
||||
possible to write a wrapper accessor function, and poison that
|
||||
(less common usage, like &environ, will cause a compilation error
|
||||
rather than issue the nice warning, but the end result of informing
|
||||
the developer about their portability problem is still achieved):
|
||||
#if HAVE_RAW_DECL_ENVIRON
|
||||
static char ***
|
||||
rpl_environ (void) { return &environ; }
|
||||
_GL_WARN_ON_USE (rpl_environ, "environ is not always properly declared");
|
||||
# undef environ
|
||||
# define environ (*rpl_environ ())
|
||||
#endif
|
||||
or better (avoiding contradictory use of 'static' and 'extern'):
|
||||
#if HAVE_RAW_DECL_ENVIRON
|
||||
static char ***
|
||||
_GL_WARN_ON_USE_ATTRIBUTE ("environ is not always properly declared")
|
||||
rpl_environ (void) { return &environ; }
|
||||
# undef environ
|
||||
# define environ (*rpl_environ ())
|
||||
#endif
|
||||
*/
|
||||
#ifndef _GL_WARN_ON_USE
|
||||
|
||||
# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
|
||||
/* A compiler attribute is available in gcc versions 4.3.0 and later. */
|
||||
# define _GL_WARN_ON_USE(function, message) \
|
||||
_GL_WARN_EXTERN_C __typeof__ (function) function __attribute__ ((__warning__ (message)))
|
||||
# define _GL_WARN_ON_USE_ATTRIBUTE(message) \
|
||||
__attribute__ ((__warning__ (message)))
|
||||
# elif __clang_major__ >= 4
|
||||
/* Another compiler attribute is available in clang. */
|
||||
# define _GL_WARN_ON_USE(function, message) \
|
||||
_GL_WARN_EXTERN_C __typeof__ (function) function \
|
||||
__attribute__ ((__diagnose_if__ (1, message, "warning")))
|
||||
# define _GL_WARN_ON_USE_ATTRIBUTE(message) \
|
||||
__attribute__ ((__diagnose_if__ (1, message, "warning")))
|
||||
# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
|
||||
/* Verify the existence of the function. */
|
||||
# define _GL_WARN_ON_USE(function, message) \
|
||||
_GL_WARN_EXTERN_C __typeof__ (function) function
|
||||
# define _GL_WARN_ON_USE_ATTRIBUTE(message)
|
||||
# else /* Unsupported. */
|
||||
# define _GL_WARN_ON_USE(function, message) \
|
||||
_GL_WARN_EXTERN_C int _gl_warn_on_use
|
||||
# define _GL_WARN_ON_USE_ATTRIBUTE(message)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* _GL_WARN_ON_USE_CXX (function, rettype_gcc, rettype_clang, parameters_and_attributes, "message")
|
||||
is like _GL_WARN_ON_USE (function, "message"), except that in C++ mode the
|
||||
function is declared with the given prototype, consisting of return type,
|
||||
parameters, and attributes.
|
||||
This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does
|
||||
not work in this case. */
|
||||
#ifndef _GL_WARN_ON_USE_CXX
|
||||
# if !defined __cplusplus
|
||||
# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
|
||||
_GL_WARN_ON_USE (function, msg)
|
||||
# else
|
||||
# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
|
||||
/* A compiler attribute is available in gcc versions 4.3.0 and later. */
|
||||
# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
|
||||
extern rettype_gcc function parameters_and_attributes \
|
||||
__attribute__ ((__warning__ (msg)))
|
||||
# elif __clang_major__ >= 4
|
||||
/* Another compiler attribute is available in clang. */
|
||||
# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
|
||||
extern rettype_clang function parameters_and_attributes \
|
||||
__attribute__ ((__diagnose_if__ (1, msg, "warning")))
|
||||
# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
|
||||
/* Verify the existence of the function. */
|
||||
# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
|
||||
extern rettype_gcc function parameters_and_attributes
|
||||
# else /* Unsupported. */
|
||||
# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
|
||||
_GL_WARN_EXTERN_C int _gl_warn_on_use
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* _GL_WARN_EXTERN_C declaration;
|
||||
performs the declaration with C linkage. */
|
||||
#ifndef _GL_WARN_EXTERN_C
|
||||
# if defined __cplusplus
|
||||
# define _GL_WARN_EXTERN_C extern "C"
|
||||
# else
|
||||
# define _GL_WARN_EXTERN_C extern
|
||||
# endif
|
||||
#endif
|
||||
@@ -0,0 +1,85 @@
|
||||
# 00gnulib.m4 serial 8
|
||||
dnl Copyright (C) 2009-2022 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
dnl This file must be named something that sorts before all other
|
||||
dnl gnulib-provided .m4 files. It is needed until the clang fix has
|
||||
dnl been included in Autoconf.
|
||||
|
||||
# The following definitions arrange to use a compiler option
|
||||
# -Werror=implicit-function-declaration in AC_CHECK_DECL, when the
|
||||
# compiler is clang. Without it, clang implicitly declares "known"
|
||||
# library functions in C mode, but not in C++ mode, which would cause
|
||||
# Gnulib to omit a declaration and thus later produce an error in C++
|
||||
# mode. As of clang 9.0, these "known" functions are identified through
|
||||
# LIBBUILTIN invocations in the LLVM source file
|
||||
# llvm/tools/clang/include/clang/Basic/Builtins.def.
|
||||
# It's not possible to AC_REQUIRE the extra tests from AC_CHECK_DECL,
|
||||
# because AC_CHECK_DECL, like other Autoconf built-ins, is not supposed
|
||||
# to AC_REQUIRE anything: some configure.ac files have their first
|
||||
# AC_CHECK_DECL executed conditionally. Therefore append the extra tests
|
||||
# to AC_PROG_CC.
|
||||
AC_DEFUN([gl_COMPILER_CLANG],
|
||||
[
|
||||
dnl AC_REQUIRE([AC_PROG_CC])
|
||||
AC_CACHE_CHECK([whether the compiler is clang],
|
||||
[gl_cv_compiler_clang],
|
||||
[dnl Use _AC_COMPILE_IFELSE instead of AC_EGREP_CPP, to avoid error
|
||||
dnl "circular dependency of AC_LANG_COMPILER(C)" if AC_PROG_CC has
|
||||
dnl not yet been invoked.
|
||||
_AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM([[
|
||||
#ifdef __clang__
|
||||
barfbarf
|
||||
#endif
|
||||
]],[[]])
|
||||
],
|
||||
[gl_cv_compiler_clang=no],
|
||||
[gl_cv_compiler_clang=yes])
|
||||
])
|
||||
])
|
||||
AC_DEFUN([gl_COMPILER_PREPARE_CHECK_DECL],
|
||||
[
|
||||
dnl AC_REQUIRE([AC_PROG_CC])
|
||||
dnl AC_REQUIRE([gl_COMPILER_CLANG])
|
||||
AC_CACHE_CHECK([for compiler option needed when checking for declarations],
|
||||
[gl_cv_compiler_check_decl_option],
|
||||
[if test $gl_cv_compiler_clang = yes; then
|
||||
dnl Test whether the compiler supports the option
|
||||
dnl '-Werror=implicit-function-declaration'.
|
||||
save_ac_compile="$ac_compile"
|
||||
ac_compile="$ac_compile -Werror=implicit-function-declaration"
|
||||
dnl Use _AC_COMPILE_IFELSE instead of AC_COMPILE_IFELSE, to avoid a
|
||||
dnl warning "AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS".
|
||||
_AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[]])],
|
||||
[gl_cv_compiler_check_decl_option='-Werror=implicit-function-declaration'],
|
||||
[gl_cv_compiler_check_decl_option=none])
|
||||
ac_compile="$save_ac_compile"
|
||||
else
|
||||
gl_cv_compiler_check_decl_option=none
|
||||
fi
|
||||
])
|
||||
if test "x$gl_cv_compiler_check_decl_option" != xnone; then
|
||||
ac_compile_for_check_decl="$ac_compile $gl_cv_compiler_check_decl_option"
|
||||
else
|
||||
ac_compile_for_check_decl="$ac_compile"
|
||||
fi
|
||||
])
|
||||
dnl Redefine _AC_CHECK_DECL_BODY so that it references ac_compile_for_check_decl
|
||||
dnl instead of ac_compile. If, for whatever reason, the override of AC_PROG_CC
|
||||
dnl in zzgnulib.m4 is inactive, use the original ac_compile.
|
||||
m4_define([_AC_CHECK_DECL_BODY],
|
||||
[ ac_save_ac_compile="$ac_compile"
|
||||
if test -n "$ac_compile_for_check_decl"; then
|
||||
ac_compile="$ac_compile_for_check_decl"
|
||||
fi]
|
||||
m4_defn([_AC_CHECK_DECL_BODY])[ ac_compile="$ac_save_ac_compile"
|
||||
])
|
||||
|
||||
# gl_00GNULIB
|
||||
# -----------
|
||||
# Witness macro that this file has been included. Needed to force
|
||||
# Automake to include this file prior to all other gnulib .m4 files.
|
||||
AC_DEFUN([gl_00GNULIB])
|
||||
@@ -0,0 +1,132 @@
|
||||
dnl acinclude.m4 -- Extra macros needed for GNU make.
|
||||
dnl
|
||||
dnl Automake will incorporate this into its generated aclocal.m4.
|
||||
dnl Copyright (C) 1998-2022 Free Software Foundation, Inc.
|
||||
dnl This file is part of GNU Make.
|
||||
dnl
|
||||
dnl GNU Make is free software; you can redistribute it and/or modify it under
|
||||
dnl the terms of the GNU General Public License as published by the Free
|
||||
dnl Software Foundation; either version 3 of the License, or (at your option)
|
||||
dnl any later version.
|
||||
dnl
|
||||
dnl GNU Make is distributed in the hope that it will be useful, but WITHOUT
|
||||
dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for.
|
||||
dnl more details.
|
||||
dnl
|
||||
dnl You should have received a copy of the GNU General Public License along
|
||||
dnl with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl Got this from the lynx 2.8 distribution.
|
||||
dnl by T.E.Dickey <dickey@clark.net>
|
||||
dnl and Jim Spath <jspath@mail.bcpl.lib.md.us>
|
||||
dnl and Philippe De Muyter <phdm@macqel.be>
|
||||
dnl
|
||||
dnl Created: 1997/1/28
|
||||
dnl Updated: 1997/12/23
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl After checking for functions in the default $LIBS, make a further check
|
||||
dnl for the functions that are netlib-related (these aren't always in the
|
||||
dnl libc, etc., and have to be handled specially because there are conflicting
|
||||
dnl and broken implementations.
|
||||
dnl Common library requirements (in order):
|
||||
dnl -lresolv -lsocket -lnsl
|
||||
dnl -lnsl -lsocket
|
||||
dnl -lsocket
|
||||
dnl -lbsd
|
||||
AC_DEFUN([CF_NETLIBS],[
|
||||
cf_test_netlibs=no
|
||||
AC_MSG_CHECKING(for network libraries)
|
||||
AC_CACHE_VAL(cf_cv_netlibs,[
|
||||
AC_MSG_RESULT(working...)
|
||||
cf_cv_netlibs=""
|
||||
cf_test_netlibs=yes
|
||||
AC_CHECK_FUNCS(gethostname,,[
|
||||
CF_RECHECK_FUNC(gethostname,nsl,cf_cv_netlibs,[
|
||||
CF_RECHECK_FUNC(gethostname,socket,cf_cv_netlibs)])])
|
||||
#
|
||||
# FIXME: sequent needs this library (i.e., -lsocket -linet -lnsl), but
|
||||
# I don't know the entrypoints - 97/7/22 TD
|
||||
AC_CHECK_LIB(inet,main,cf_cv_netlibs="-linet $cf_cv_netlibs")
|
||||
#
|
||||
if test "$ac_cv_func_lsocket" != no ; then
|
||||
AC_CHECK_FUNCS(socket,,[
|
||||
CF_RECHECK_FUNC(socket,socket,cf_cv_netlibs,[
|
||||
CF_RECHECK_FUNC(socket,bsd,cf_cv_netlibs)])])
|
||||
fi
|
||||
#
|
||||
AC_CHECK_FUNCS(gethostbyname,,[
|
||||
CF_RECHECK_FUNC(gethostbyname,nsl,cf_cv_netlibs)])
|
||||
])
|
||||
LIBS="$LIBS $cf_cv_netlibs"
|
||||
test $cf_test_netlibs = no && echo "$cf_cv_netlibs" >&AC_FD_MSG
|
||||
])dnl
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl Re-check on a function to see if we can pick it up by adding a library.
|
||||
dnl $1 = function to check
|
||||
dnl $2 = library to check in
|
||||
dnl $3 = environment to update (e.g., $LIBS)
|
||||
dnl $4 = what to do if this fails
|
||||
dnl
|
||||
dnl This uses 'unset' if the shell happens to support it, but leaves the
|
||||
dnl configuration variable set to 'unknown' if not. This is a little better
|
||||
dnl than the normal autoconf test, which gives misleading results if a test
|
||||
dnl for the function is made (e.g., with AC_CHECK_FUNC) after this macro is
|
||||
dnl used (autoconf does not distinguish between a null token and one that is
|
||||
dnl set to 'no').
|
||||
AC_DEFUN([CF_RECHECK_FUNC],[
|
||||
AC_CHECK_LIB($2,$1,[
|
||||
CF_UPPER(cf_tr_func,$1)
|
||||
AC_DEFINE_UNQUOTED(HAVE_$cf_tr_func,1,[Define if you have function $1])
|
||||
ac_cv_func_$1=yes
|
||||
$3="-l$2 [$]$3"],[
|
||||
ac_cv_func_$1=unknown
|
||||
unset ac_cv_func_$1 2>/dev/null
|
||||
$4],
|
||||
[[$]$3])
|
||||
])dnl
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl Make an uppercase version of a variable
|
||||
dnl $1=uppercase($2)
|
||||
AC_DEFUN([CF_UPPER],
|
||||
[
|
||||
changequote(,)dnl
|
||||
$1=`echo $2 | tr '[a-z]' '[A-Z]'`
|
||||
changequote([,])dnl
|
||||
])dnl
|
||||
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl From Paul Eggert <eggert@twinsun.com>
|
||||
dnl Update for Darwin by Troy Runkel <Troy.Runkel@mathworks.com>
|
||||
dnl Update for AIX by Olexiy Buyanskyy (Savannah bug 32485)
|
||||
|
||||
AC_DEFUN([AC_STRUCT_ST_MTIM_NSEC],
|
||||
[AC_CACHE_CHECK([for nanoseconds field of struct stat],
|
||||
ac_cv_struct_st_mtim_nsec,
|
||||
[ac_save_CPPFLAGS="$CPPFLAGS"
|
||||
ac_cv_struct_st_mtim_nsec=no
|
||||
# st_mtim.tv_nsec -- the usual case
|
||||
# st_mtim._tv_nsec -- Solaris 2.6, if
|
||||
# (defined _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED == 1
|
||||
# && !defined __EXTENSIONS__)
|
||||
# st_mtim.st__tim.tv_nsec -- UnixWare 2.1.2
|
||||
# st_mtime_n -- AIX 5.2 and above
|
||||
# st_mtimespec.tv_nsec -- Darwin (Mac OSX)
|
||||
for ac_val in st_mtim.tv_nsec st_mtim._tv_nsec st_mtim.st__tim.tv_nsec st_mtime_n st_mtimespec.tv_nsec; do
|
||||
CPPFLAGS="$ac_save_CPPFLAGS -DST_MTIM_NSEC=$ac_val"
|
||||
AC_TRY_COMPILE([#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
], [struct stat s; s.ST_MTIM_NSEC;],
|
||||
[ac_cv_struct_st_mtim_nsec=$ac_val; break])
|
||||
done
|
||||
CPPFLAGS="$ac_save_CPPFLAGS"
|
||||
])
|
||||
|
||||
if test $ac_cv_struct_st_mtim_nsec != no; then
|
||||
AC_DEFINE_UNQUOTED([ST_MTIM_NSEC], [$ac_cv_struct_st_mtim_nsec],
|
||||
[Define if struct stat contains a nanoseconds field])
|
||||
fi
|
||||
]
|
||||
)
|
||||
@@ -0,0 +1,106 @@
|
||||
# alloca.m4 serial 21
|
||||
dnl Copyright (C) 2002-2004, 2006-2007, 2009-2022 Free Software Foundation,
|
||||
dnl Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
AC_DEFUN([gl_FUNC_ALLOCA],
|
||||
[
|
||||
AC_REQUIRE([AC_FUNC_ALLOCA])
|
||||
if test $ac_cv_func_alloca_works = no; then
|
||||
gl_PREREQ_ALLOCA
|
||||
fi
|
||||
|
||||
# Define an additional variable used in the Makefile substitution.
|
||||
if test $ac_cv_working_alloca_h = yes; then
|
||||
AC_CACHE_CHECK([for alloca as a compiler built-in], [gl_cv_rpl_alloca], [
|
||||
AC_EGREP_CPP([Need own alloca], [
|
||||
#if defined __GNUC__ || defined _AIX || defined _MSC_VER
|
||||
Need own alloca
|
||||
#endif
|
||||
], [gl_cv_rpl_alloca=yes], [gl_cv_rpl_alloca=no])
|
||||
])
|
||||
if test $gl_cv_rpl_alloca = yes; then
|
||||
dnl OK, alloca can be implemented through a compiler built-in.
|
||||
AC_DEFINE([HAVE_ALLOCA], [1],
|
||||
[Define to 1 if you have 'alloca' after including <alloca.h>,
|
||||
a header that may be supplied by this distribution.])
|
||||
GL_GENERATE_ALLOCA_H=true
|
||||
else
|
||||
dnl alloca exists as a library function, i.e. it is slow and probably
|
||||
dnl a memory leak. Don't define HAVE_ALLOCA in this case.
|
||||
GL_GENERATE_ALLOCA_H=false
|
||||
fi
|
||||
else
|
||||
GL_GENERATE_ALLOCA_H=true
|
||||
fi
|
||||
|
||||
if test $ac_cv_working_alloca_h = yes; then
|
||||
HAVE_ALLOCA_H=1
|
||||
else
|
||||
HAVE_ALLOCA_H=0
|
||||
fi
|
||||
AC_SUBST([HAVE_ALLOCA_H])
|
||||
])
|
||||
|
||||
# Prerequisites of lib/alloca.c.
|
||||
# STACK_DIRECTION is already handled by AC_FUNC_ALLOCA.
|
||||
AC_DEFUN([gl_PREREQ_ALLOCA], [:])
|
||||
|
||||
m4_version_prereq([2.70], [], [
|
||||
|
||||
# This works around a bug in autoconf <= 2.68 and has simplifications
|
||||
# from 2.70. See:
|
||||
# https://lists.gnu.org/r/bug-gnulib/2011-06/msg00277.html
|
||||
# https://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=6cd9f12520b0d6f76d3230d7565feba1ecf29497
|
||||
# https://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=15edf7fd8094fd14a89d9891dd72a9624762597a
|
||||
|
||||
# _AC_LIBOBJ_ALLOCA
|
||||
# -----------------
|
||||
# Set up the LIBOBJ replacement of 'alloca'. Well, not exactly
|
||||
# AC_LIBOBJ since we actually set the output variable 'ALLOCA'.
|
||||
# Nevertheless, for Automake, AC_LIBSOURCES it.
|
||||
m4_define([_AC_LIBOBJ_ALLOCA],
|
||||
[# The SVR3 libPW and SVR4 libucb both contain incompatible functions
|
||||
# that cause trouble. Some versions do not even contain alloca or
|
||||
# contain a buggy version. If you still want to use their alloca,
|
||||
# use ar to extract alloca.o from them instead of compiling alloca.c.
|
||||
AC_LIBSOURCES(alloca.c)
|
||||
AC_SUBST([ALLOCA], [\${LIBOBJDIR}alloca.$ac_objext])dnl
|
||||
AC_DEFINE(C_ALLOCA, 1, [Define to 1 if using 'alloca.c'.])
|
||||
|
||||
AC_CACHE_CHECK([stack direction for C alloca],
|
||||
[ac_cv_c_stack_direction],
|
||||
[AC_RUN_IFELSE([AC_LANG_SOURCE(
|
||||
[AC_INCLUDES_DEFAULT
|
||||
int
|
||||
find_stack_direction (int *addr, int depth)
|
||||
{
|
||||
int dir, dummy = 0;
|
||||
if (! addr)
|
||||
addr = &dummy;
|
||||
*addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1;
|
||||
dir = depth ? find_stack_direction (addr, depth - 1) : 0;
|
||||
return dir + dummy;
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
return find_stack_direction (0, argc + !argv + 20) < 0;
|
||||
}])],
|
||||
[ac_cv_c_stack_direction=1],
|
||||
[ac_cv_c_stack_direction=-1],
|
||||
[ac_cv_c_stack_direction=0])])
|
||||
AH_VERBATIM([STACK_DIRECTION],
|
||||
[/* If using the C implementation of alloca, define if you know the
|
||||
direction of stack growth for your system; otherwise it will be
|
||||
automatically deduced at runtime.
|
||||
STACK_DIRECTION > 0 => grows toward higher addresses
|
||||
STACK_DIRECTION < 0 => grows toward lower addresses
|
||||
STACK_DIRECTION = 0 => direction of growth unknown */
|
||||
#undef STACK_DIRECTION])dnl
|
||||
AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction)
|
||||
])# _AC_LIBOBJ_ALLOCA
|
||||
])
|
||||
@@ -0,0 +1,83 @@
|
||||
# asm-underscore.m4 serial 5
|
||||
dnl Copyright (C) 2010-2022 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
dnl From Bruno Haible. Based on as-underscore.m4 in GNU clisp.
|
||||
|
||||
# gl_ASM_SYMBOL_PREFIX
|
||||
# Tests for the prefix of C symbols at the assembly language level and the
|
||||
# linker level. This prefix is either an underscore or empty. Defines the
|
||||
# C macro USER_LABEL_PREFIX to this prefix, and sets ASM_SYMBOL_PREFIX to
|
||||
# a stringified variant of this prefix.
|
||||
|
||||
AC_DEFUN([gl_ASM_SYMBOL_PREFIX],
|
||||
[
|
||||
AC_REQUIRE([AC_PROG_EGREP])
|
||||
dnl We don't use GCC's __USER_LABEL_PREFIX__ here, because
|
||||
dnl 1. It works only for GCC.
|
||||
dnl 2. It is incorrectly defined on some platforms, in some GCC versions.
|
||||
AC_REQUIRE([gl_C_ASM])
|
||||
AC_CACHE_CHECK(
|
||||
[whether C symbols are prefixed with underscore at the linker level],
|
||||
[gl_cv_prog_as_underscore],
|
||||
[cat > conftest.c <<EOF
|
||||
#ifdef __cplusplus
|
||||
extern "C" int foo (void);
|
||||
#endif
|
||||
int foo(void) { return 0; }
|
||||
EOF
|
||||
# Look for the assembly language name in the .s file.
|
||||
AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS $gl_c_asm_opt conftest.c) >/dev/null 2>&1
|
||||
if LC_ALL=C $EGREP '(^|[[^a-zA-Z0-9_]])_foo([[^a-zA-Z0-9_]]|$)' conftest.$gl_asmext >/dev/null; then
|
||||
gl_cv_prog_as_underscore=yes
|
||||
else
|
||||
gl_cv_prog_as_underscore=no
|
||||
fi
|
||||
rm -f conftest*
|
||||
])
|
||||
if test $gl_cv_prog_as_underscore = yes; then
|
||||
USER_LABEL_PREFIX=_
|
||||
else
|
||||
USER_LABEL_PREFIX=
|
||||
fi
|
||||
AC_DEFINE_UNQUOTED([USER_LABEL_PREFIX], [$USER_LABEL_PREFIX],
|
||||
[Define to the prefix of C symbols at the assembler and linker level,
|
||||
either an underscore or empty.])
|
||||
ASM_SYMBOL_PREFIX='"'${USER_LABEL_PREFIX}'"'
|
||||
AC_SUBST([ASM_SYMBOL_PREFIX])
|
||||
])
|
||||
|
||||
# gl_C_ASM
|
||||
# Determines how to produce an assembly language file from C source code.
|
||||
# Sets the variables:
|
||||
# gl_asmext - the extension of assembly language output,
|
||||
# gl_c_asm_opt - the C compiler option that produces assembly language output.
|
||||
|
||||
AC_DEFUN([gl_C_ASM],
|
||||
[
|
||||
AC_EGREP_CPP([MicrosoftCompiler],
|
||||
[
|
||||
#ifdef _MSC_VER
|
||||
MicrosoftCompiler
|
||||
#endif
|
||||
],
|
||||
[dnl Microsoft's 'cl' and 'clang-cl' produce an .asm file, whereas 'clang'
|
||||
dnl produces a .s file. Need to distinguish 'clang' and 'clang-cl'.
|
||||
rm -f conftest*
|
||||
echo 'int dummy;' > conftest.c
|
||||
AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS -c conftest.c) >/dev/null 2>&1
|
||||
if test -f conftest.o; then
|
||||
gl_asmext='s'
|
||||
gl_c_asm_opt='-S'
|
||||
else
|
||||
gl_asmext='asm'
|
||||
gl_c_asm_opt='-c -Fa'
|
||||
fi
|
||||
rm -f conftest*
|
||||
],
|
||||
[gl_asmext='s'
|
||||
gl_c_asm_opt='-S'
|
||||
])
|
||||
])
|
||||
@@ -0,0 +1,23 @@
|
||||
# codeset.m4 serial 5 (gettext-0.18.2)
|
||||
dnl Copyright (C) 2000-2002, 2006, 2008-2014 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
dnl From Bruno Haible.
|
||||
|
||||
AC_DEFUN([AM_LANGINFO_CODESET],
|
||||
[
|
||||
AC_CACHE_CHECK([for nl_langinfo and CODESET], [am_cv_langinfo_codeset],
|
||||
[AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[#include <langinfo.h>]],
|
||||
[[char* cs = nl_langinfo(CODESET); return !cs;]])],
|
||||
[am_cv_langinfo_codeset=yes],
|
||||
[am_cv_langinfo_codeset=no])
|
||||
])
|
||||
if test $am_cv_langinfo_codeset = yes; then
|
||||
AC_DEFINE([HAVE_LANGINFO_CODESET], [1],
|
||||
[Define if you have <langinfo.h> and nl_langinfo(CODESET).])
|
||||
fi
|
||||
])
|
||||
@@ -0,0 +1,33 @@
|
||||
# Test if the system uses DOS-style pathnames (drive specs and backslashes)
|
||||
# By Paul Smith <psmith@gnu.org>. Based on dos.m4 by Jim Meyering.
|
||||
#
|
||||
# Copyright (C) 1993-2022 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 3 of the License, 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
|
||||
# this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
AC_DEFUN([pds_AC_DOS_PATHS], [
|
||||
AC_CACHE_CHECK([whether system uses MSDOS-style paths], [ac_cv_dos_paths], [
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||
#if !defined _WIN32 && !defined __WIN32__ && !defined __MSDOS__ && !defined __EMX__ && !defined __MSYS__ && !defined __CYGWIN__
|
||||
neither MSDOS nor Windows nor OS2
|
||||
#endif
|
||||
]])],
|
||||
[ac_cv_dos_paths=yes],
|
||||
[ac_cv_dos_paths=no])])
|
||||
|
||||
AS_IF([test x"$ac_cv_dos_paths" = xyes],
|
||||
[ AC_DEFINE_UNQUOTED([HAVE_DOS_PATHS], 1,
|
||||
[Define if the system uses DOS-style pathnames.])])
|
||||
])
|
||||
@@ -0,0 +1,12 @@
|
||||
# eaccess.m4 serial 2
|
||||
dnl Copyright (C) 2003, 2009-2022 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
AC_DEFUN([gl_FUNC_EACCESS],
|
||||
[
|
||||
AC_CHECK_FUNC([eaccess], ,
|
||||
[AC_DEFINE([eaccess], [access],
|
||||
[Define as 'access' if you don't have the eaccess() function.])])
|
||||
])
|
||||
@@ -0,0 +1,227 @@
|
||||
# serial 22 -*- Autoconf -*-
|
||||
# Enable extensions on systems that normally disable them.
|
||||
|
||||
# Copyright (C) 2003, 2006-2022 Free Software Foundation, Inc.
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
dnl Define to empty for the benefit of Autoconf 2.69 and earlier, so that
|
||||
dnl AC_USE_SYSTEM_EXTENSIONS (below) can be used unchanged from Autoconf 2.70+.
|
||||
m4_ifndef([AC_CHECK_INCLUDES_DEFAULT],
|
||||
[AC_DEFUN([AC_CHECK_INCLUDES_DEFAULT], [])])
|
||||
|
||||
# This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from git
|
||||
# Autoconf. Perhaps we can remove this once we can assume Autoconf
|
||||
# is recent-enough everywhere, but since Autoconf mutates rapidly
|
||||
# enough in this area it's likely we'll need to redefine
|
||||
# AC_USE_SYSTEM_EXTENSIONS for quite some time.
|
||||
|
||||
# If autoconf reports a warning
|
||||
# warning: AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS
|
||||
# or warning: AC_RUN_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS
|
||||
# the fix is
|
||||
# 1) to ensure that AC_USE_SYSTEM_EXTENSIONS is never directly invoked
|
||||
# but always AC_REQUIREd,
|
||||
# 2) to ensure that for each occurrence of
|
||||
# AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
|
||||
# or
|
||||
# AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
|
||||
# the corresponding gnulib module description has 'extensions' among
|
||||
# its dependencies. This will ensure that the gl_USE_SYSTEM_EXTENSIONS
|
||||
# invocation occurs in gl_EARLY, not in gl_INIT.
|
||||
|
||||
m4_version_prereq([2.70.1], [], [
|
||||
|
||||
# AC_USE_SYSTEM_EXTENSIONS
|
||||
# ------------------------
|
||||
# Enable extensions on systems that normally disable them,
|
||||
# typically due to standards-conformance issues.
|
||||
# We unconditionally define as many of the known feature-enabling
|
||||
# as possible, reserving conditional behavior for macros that are
|
||||
# known to cause problems on some platforms (such as __EXTENSIONS__).
|
||||
AC_DEFUN_ONCE([AC_USE_SYSTEM_EXTENSIONS],
|
||||
[AC_BEFORE([$0], [AC_PREPROC_IFELSE])dnl
|
||||
AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
|
||||
AC_BEFORE([$0], [AC_LINK_IFELSE])dnl
|
||||
AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
|
||||
AC_BEFORE([$0], [AC_CHECK_INCLUDES_DEFAULT])dnl
|
||||
dnl #undef in AH_VERBATIM gets replaced with #define by AC_DEFINE.
|
||||
dnl Use a different key than __EXTENSIONS__, as that name broke existing
|
||||
dnl configure.ac when using autoheader 2.62.
|
||||
dnl The macros below are in alphabetical order ignoring leading _ or __
|
||||
dnl prefixes.
|
||||
AH_VERBATIM([USE_SYSTEM_EXTENSIONS],
|
||||
[/* Enable extensions on AIX 3, Interix. */
|
||||
#ifndef _ALL_SOURCE
|
||||
# undef _ALL_SOURCE
|
||||
#endif
|
||||
/* Enable general extensions on macOS. */
|
||||
#ifndef _DARWIN_C_SOURCE
|
||||
# undef _DARWIN_C_SOURCE
|
||||
#endif
|
||||
/* Enable general extensions on Solaris. */
|
||||
#ifndef __EXTENSIONS__
|
||||
# undef __EXTENSIONS__
|
||||
#endif
|
||||
/* Enable GNU extensions on systems that have them. */
|
||||
#ifndef _GNU_SOURCE
|
||||
# undef _GNU_SOURCE
|
||||
#endif
|
||||
/* Enable X/Open compliant socket functions that do not require linking
|
||||
with -lxnet on HP-UX 11.11. */
|
||||
#ifndef _HPUX_ALT_XOPEN_SOCKET_API
|
||||
# undef _HPUX_ALT_XOPEN_SOCKET_API
|
||||
#endif
|
||||
/* Identify the host operating system as Minix.
|
||||
This macro does not affect the system headers' behavior.
|
||||
A future release of Autoconf may stop defining this macro. */
|
||||
#ifndef _MINIX
|
||||
# undef _MINIX
|
||||
#endif
|
||||
/* Enable general extensions on NetBSD.
|
||||
Enable NetBSD compatibility extensions on Minix. */
|
||||
#ifndef _NETBSD_SOURCE
|
||||
# undef _NETBSD_SOURCE
|
||||
#endif
|
||||
/* Enable OpenBSD compatibility extensions on NetBSD.
|
||||
Oddly enough, this does nothing on OpenBSD. */
|
||||
#ifndef _OPENBSD_SOURCE
|
||||
# undef _OPENBSD_SOURCE
|
||||
#endif
|
||||
/* Define to 1 if needed for POSIX-compatible behavior. */
|
||||
#ifndef _POSIX_SOURCE
|
||||
# undef _POSIX_SOURCE
|
||||
#endif
|
||||
/* Define to 2 if needed for POSIX-compatible behavior. */
|
||||
#ifndef _POSIX_1_SOURCE
|
||||
# undef _POSIX_1_SOURCE
|
||||
#endif
|
||||
/* Enable POSIX-compatible threading on Solaris. */
|
||||
#ifndef _POSIX_PTHREAD_SEMANTICS
|
||||
# undef _POSIX_PTHREAD_SEMANTICS
|
||||
#endif
|
||||
/* Enable extensions specified by ISO/IEC TS 18661-5:2014. */
|
||||
#ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__
|
||||
# undef __STDC_WANT_IEC_60559_ATTRIBS_EXT__
|
||||
#endif
|
||||
/* Enable extensions specified by ISO/IEC TS 18661-1:2014. */
|
||||
#ifndef __STDC_WANT_IEC_60559_BFP_EXT__
|
||||
# undef __STDC_WANT_IEC_60559_BFP_EXT__
|
||||
#endif
|
||||
/* Enable extensions specified by ISO/IEC TS 18661-2:2015. */
|
||||
#ifndef __STDC_WANT_IEC_60559_DFP_EXT__
|
||||
# undef __STDC_WANT_IEC_60559_DFP_EXT__
|
||||
#endif
|
||||
/* Enable extensions specified by ISO/IEC TS 18661-4:2015. */
|
||||
#ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__
|
||||
# undef __STDC_WANT_IEC_60559_FUNCS_EXT__
|
||||
#endif
|
||||
/* Enable extensions specified by ISO/IEC TS 18661-3:2015. */
|
||||
#ifndef __STDC_WANT_IEC_60559_TYPES_EXT__
|
||||
# undef __STDC_WANT_IEC_60559_TYPES_EXT__
|
||||
#endif
|
||||
/* Enable extensions specified by ISO/IEC TR 24731-2:2010. */
|
||||
#ifndef __STDC_WANT_LIB_EXT2__
|
||||
# undef __STDC_WANT_LIB_EXT2__
|
||||
#endif
|
||||
/* Enable extensions specified by ISO/IEC 24747:2009. */
|
||||
#ifndef __STDC_WANT_MATH_SPEC_FUNCS__
|
||||
# undef __STDC_WANT_MATH_SPEC_FUNCS__
|
||||
#endif
|
||||
/* Enable extensions on HP NonStop. */
|
||||
#ifndef _TANDEM_SOURCE
|
||||
# undef _TANDEM_SOURCE
|
||||
#endif
|
||||
/* Enable X/Open extensions. Define to 500 only if necessary
|
||||
to make mbstate_t available. */
|
||||
#ifndef _XOPEN_SOURCE
|
||||
# undef _XOPEN_SOURCE
|
||||
#endif
|
||||
])dnl
|
||||
|
||||
AC_REQUIRE([AC_CHECK_INCLUDES_DEFAULT])dnl
|
||||
_AC_CHECK_HEADER_ONCE([wchar.h])
|
||||
_AC_CHECK_HEADER_ONCE([minix/config.h])
|
||||
|
||||
dnl Defining __EXTENSIONS__ may break the system headers on some systems.
|
||||
dnl (FIXME: Which ones?)
|
||||
AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
|
||||
[ac_cv_safe_to_define___extensions__],
|
||||
[AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM([[
|
||||
# define __EXTENSIONS__ 1
|
||||
]AC_INCLUDES_DEFAULT])],
|
||||
[ac_cv_safe_to_define___extensions__=yes],
|
||||
[ac_cv_safe_to_define___extensions__=no])])
|
||||
|
||||
dnl HP-UX 11.11 defines mbstate_t only if _XOPEN_SOURCE is defined to
|
||||
dnl 500, regardless of whether compiling with -Ae or -D_HPUX_SOURCE=1.
|
||||
dnl But defining _XOPEN_SOURCE may turn *off* extensions on platforms
|
||||
dnl not covered by turn-on-extensions macros (notably Dragonfly, Free,
|
||||
dnl and OpenBSD, which don't have any equivalent of _NETBSD_SOURCE) so
|
||||
dnl it should only be defined when necessary.
|
||||
AC_CACHE_CHECK([whether _XOPEN_SOURCE should be defined],
|
||||
[ac_cv_should_define__xopen_source],
|
||||
[ac_cv_should_define__xopen_source=no
|
||||
AS_IF([test $ac_cv_header_wchar_h = yes],
|
||||
[AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM([[
|
||||
#include <wchar.h>
|
||||
mbstate_t x;]])],
|
||||
[],
|
||||
[AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM([[
|
||||
#define _XOPEN_SOURCE 500
|
||||
#include <wchar.h>
|
||||
mbstate_t x;]])],
|
||||
[ac_cv_should_define__xopen_source=yes])])])])
|
||||
|
||||
AC_DEFINE([_ALL_SOURCE])
|
||||
AC_DEFINE([_DARWIN_C_SOURCE])
|
||||
AC_DEFINE([_GNU_SOURCE])
|
||||
AC_DEFINE([_HPUX_ALT_XOPEN_SOCKET_API])
|
||||
AC_DEFINE([_NETBSD_SOURCE])
|
||||
AC_DEFINE([_OPENBSD_SOURCE])
|
||||
AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
|
||||
AC_DEFINE([__STDC_WANT_IEC_60559_ATTRIBS_EXT__])
|
||||
AC_DEFINE([__STDC_WANT_IEC_60559_BFP_EXT__])
|
||||
AC_DEFINE([__STDC_WANT_IEC_60559_DFP_EXT__])
|
||||
AC_DEFINE([__STDC_WANT_IEC_60559_FUNCS_EXT__])
|
||||
AC_DEFINE([__STDC_WANT_IEC_60559_TYPES_EXT__])
|
||||
AC_DEFINE([__STDC_WANT_LIB_EXT2__])
|
||||
AC_DEFINE([__STDC_WANT_MATH_SPEC_FUNCS__])
|
||||
AC_DEFINE([_TANDEM_SOURCE])
|
||||
AS_IF([test $ac_cv_header_minix_config_h = yes],
|
||||
[MINIX=yes
|
||||
AC_DEFINE([_MINIX])
|
||||
AC_DEFINE([_POSIX_SOURCE])
|
||||
AC_DEFINE([_POSIX_1_SOURCE], [2])],
|
||||
[MINIX=])
|
||||
AS_IF([test $ac_cv_safe_to_define___extensions__ = yes],
|
||||
[AC_DEFINE([__EXTENSIONS__])])
|
||||
AS_IF([test $ac_cv_should_define__xopen_source = yes],
|
||||
[AC_DEFINE([_XOPEN_SOURCE], [500])])
|
||||
])# AC_USE_SYSTEM_EXTENSIONS
|
||||
])
|
||||
|
||||
# gl_USE_SYSTEM_EXTENSIONS
|
||||
# ------------------------
|
||||
# Enable extensions on systems that normally disable them,
|
||||
# typically due to standards-conformance issues.
|
||||
AC_DEFUN_ONCE([gl_USE_SYSTEM_EXTENSIONS],
|
||||
[
|
||||
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
|
||||
|
||||
dnl On OpenBSD 6.8 with GCC, the include files contain a couple of
|
||||
dnl definitions that are only activated with an explicit -D_ISOC11_SOURCE.
|
||||
dnl That's because this version of GCC (4.2.1) supports the option
|
||||
dnl '-std=gnu99' but not the option '-std=gnu11'.
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
case "$host_os" in
|
||||
openbsd*)
|
||||
AC_DEFINE([_ISOC11_SOURCE], [1],
|
||||
[Define to enable the declarations of ISO C 11 types and functions.])
|
||||
;;
|
||||
esac
|
||||
])
|
||||
@@ -0,0 +1,100 @@
|
||||
dnl 'extern inline' a la ISO C99.
|
||||
|
||||
dnl Copyright 2012-2014 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
AC_DEFUN([gl_EXTERN_INLINE],
|
||||
[
|
||||
AH_VERBATIM([extern_inline],
|
||||
[/* Please see the Gnulib manual for how to use these macros.
|
||||
|
||||
Suppress extern inline with HP-UX cc, as it appears to be broken; see
|
||||
<http://lists.gnu.org/archive/html/bug-texinfo/2013-02/msg00030.html>.
|
||||
|
||||
Suppress extern inline with Sun C in standards-conformance mode, as it
|
||||
mishandles inline functions that call each other. E.g., for 'inline void f
|
||||
(void) { } inline void g (void) { f (); }', c99 incorrectly complains
|
||||
'reference to static identifier "f" in extern inline function'.
|
||||
This bug was observed with Sun C 5.12 SunOS_i386 2011/11/16.
|
||||
|
||||
Suppress extern inline (with or without __attribute__ ((__gnu_inline__)))
|
||||
on configurations that mistakenly use 'static inline' to implement
|
||||
functions or macros in standard C headers like <ctype.h>. For example,
|
||||
if isdigit is mistakenly implemented via a static inline function,
|
||||
a program containing an extern inline function that calls isdigit
|
||||
may not work since the C standard prohibits extern inline functions
|
||||
from calling static functions. This bug is known to occur on:
|
||||
|
||||
OS X 10.8 and earlier; see:
|
||||
http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html
|
||||
|
||||
DragonFly; see
|
||||
http://muscles.dragonflybsd.org/bulk/bleeding-edge-potential/latest-per-pkg/ah-tty-0.3.12.log
|
||||
|
||||
FreeBSD; see:
|
||||
http://lists.gnu.org/archive/html/bug-gnulib/2014-07/msg00104.html
|
||||
|
||||
OS X 10.9 has a macro __header_inline indicating the bug is fixed for C and
|
||||
for clang but remains for g++; see <http://trac.macports.org/ticket/41033>.
|
||||
Assume DragonFly and FreeBSD will be similar. */
|
||||
#if (((defined __APPLE__ && defined __MACH__) \
|
||||
|| defined __DragonFly__ || defined __FreeBSD__) \
|
||||
&& (defined __header_inline \
|
||||
? (defined __cplusplus && defined __GNUC_STDC_INLINE__ \
|
||||
&& ! defined __clang__) \
|
||||
: ((! defined _DONT_USE_CTYPE_INLINE_ \
|
||||
&& (defined __GNUC__ || defined __cplusplus)) \
|
||||
|| (defined _FORTIFY_SOURCE && 0 < _FORTIFY_SOURCE \
|
||||
&& defined __GNUC__ && ! defined __cplusplus))))
|
||||
# define _GL_EXTERN_INLINE_STDHEADER_BUG
|
||||
#endif
|
||||
#if ((__GNUC__ \
|
||||
? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \
|
||||
: (199901L <= __STDC_VERSION__ \
|
||||
&& !defined __HP_cc \
|
||||
&& !(defined __SUNPRO_C && __STDC__))) \
|
||||
&& !defined _GL_EXTERN_INLINE_STDHEADER_BUG)
|
||||
# define _GL_INLINE inline
|
||||
# define _GL_EXTERN_INLINE extern inline
|
||||
# define _GL_EXTERN_INLINE_IN_USE
|
||||
#elif (2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __STRICT_ANSI__ \
|
||||
&& !defined _GL_EXTERN_INLINE_STDHEADER_BUG)
|
||||
# if defined __GNUC_GNU_INLINE__ && __GNUC_GNU_INLINE__
|
||||
/* __gnu_inline__ suppresses a GCC 4.2 diagnostic. */
|
||||
# define _GL_INLINE extern inline __attribute__ ((__gnu_inline__))
|
||||
# else
|
||||
# define _GL_INLINE extern inline
|
||||
# endif
|
||||
# define _GL_EXTERN_INLINE extern
|
||||
# define _GL_EXTERN_INLINE_IN_USE
|
||||
#else
|
||||
# define _GL_INLINE static _GL_UNUSED
|
||||
# define _GL_EXTERN_INLINE static _GL_UNUSED
|
||||
#endif
|
||||
|
||||
/* In GCC, suppress bogus "no previous prototype for 'FOO'"
|
||||
and "no previous declaration for 'FOO'" diagnostics,
|
||||
when FOO is an inline function in the header; see
|
||||
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113> and
|
||||
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63877>. */
|
||||
#if 4 < __GNUC__ + (6 <= __GNUC_MINOR__)
|
||||
# if defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__
|
||||
# define _GL_INLINE_HEADER_CONST_PRAGMA
|
||||
# else
|
||||
# define _GL_INLINE_HEADER_CONST_PRAGMA \
|
||||
_Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=const\"")
|
||||
# endif
|
||||
# define _GL_INLINE_HEADER_BEGIN \
|
||||
_Pragma ("GCC diagnostic push") \
|
||||
_Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \
|
||||
_Pragma ("GCC diagnostic ignored \"-Wmissing-declarations\"") \
|
||||
_GL_INLINE_HEADER_CONST_PRAGMA
|
||||
# define _GL_INLINE_HEADER_END \
|
||||
_Pragma ("GCC diagnostic pop")
|
||||
#else
|
||||
# define _GL_INLINE_HEADER_BEGIN
|
||||
# define _GL_INLINE_HEADER_END
|
||||
#endif])
|
||||
])
|
||||
@@ -0,0 +1,134 @@
|
||||
# fcntl-o.m4 serial 4
|
||||
dnl Copyright (C) 2006, 2009-2014 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
dnl Written by Paul Eggert.
|
||||
|
||||
# Test whether the flags O_NOATIME and O_NOFOLLOW actually work.
|
||||
# Define HAVE_WORKING_O_NOATIME to 1 if O_NOATIME works, or to 0 otherwise.
|
||||
# Define HAVE_WORKING_O_NOFOLLOW to 1 if O_NOFOLLOW works, or to 0 otherwise.
|
||||
AC_DEFUN([gl_FCNTL_O_FLAGS],
|
||||
[
|
||||
dnl Persuade glibc <fcntl.h> to define O_NOATIME and O_NOFOLLOW.
|
||||
dnl AC_USE_SYSTEM_EXTENSIONS was introduced in autoconf 2.60 and obsoletes
|
||||
dnl AC_GNU_SOURCE.
|
||||
m4_ifdef([AC_USE_SYSTEM_EXTENSIONS],
|
||||
[AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])],
|
||||
[AC_REQUIRE([AC_GNU_SOURCE])])
|
||||
|
||||
AC_CHECK_HEADERS_ONCE([unistd.h])
|
||||
AC_CHECK_FUNCS_ONCE([symlink])
|
||||
AC_CACHE_CHECK([for working fcntl.h], [gl_cv_header_working_fcntl_h],
|
||||
[AC_RUN_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#if HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#else /* on Windows with MSVC */
|
||||
# include <io.h>
|
||||
# include <stdlib.h>
|
||||
# defined sleep(n) _sleep ((n) * 1000)
|
||||
#endif
|
||||
#include <fcntl.h>
|
||||
#ifndef O_NOATIME
|
||||
#define O_NOATIME 0
|
||||
#endif
|
||||
#ifndef O_NOFOLLOW
|
||||
#define O_NOFOLLOW 0
|
||||
#endif
|
||||
static int const constants[] =
|
||||
{
|
||||
O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND,
|
||||
O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY
|
||||
};
|
||||
]],
|
||||
[[
|
||||
int result = !constants;
|
||||
#if HAVE_SYMLINK
|
||||
{
|
||||
static char const sym[] = "conftest.sym";
|
||||
if (symlink ("/dev/null", sym) != 0)
|
||||
result |= 2;
|
||||
else
|
||||
{
|
||||
int fd = open (sym, O_WRONLY | O_NOFOLLOW | O_CREAT, 0);
|
||||
if (fd >= 0)
|
||||
{
|
||||
close (fd);
|
||||
result |= 4;
|
||||
}
|
||||
}
|
||||
if (unlink (sym) != 0 || symlink (".", sym) != 0)
|
||||
result |= 2;
|
||||
else
|
||||
{
|
||||
int fd = open (sym, O_RDONLY | O_NOFOLLOW);
|
||||
if (fd >= 0)
|
||||
{
|
||||
close (fd);
|
||||
result |= 4;
|
||||
}
|
||||
}
|
||||
unlink (sym);
|
||||
}
|
||||
#endif
|
||||
{
|
||||
static char const file[] = "confdefs.h";
|
||||
int fd = open (file, O_RDONLY | O_NOATIME);
|
||||
if (fd < 0)
|
||||
result |= 8;
|
||||
else
|
||||
{
|
||||
struct stat st0;
|
||||
if (fstat (fd, &st0) != 0)
|
||||
result |= 16;
|
||||
else
|
||||
{
|
||||
char c;
|
||||
sleep (1);
|
||||
if (read (fd, &c, 1) != 1)
|
||||
result |= 24;
|
||||
else
|
||||
{
|
||||
if (close (fd) != 0)
|
||||
result |= 32;
|
||||
else
|
||||
{
|
||||
struct stat st1;
|
||||
if (stat (file, &st1) != 0)
|
||||
result |= 40;
|
||||
else
|
||||
if (st0.st_atime != st1.st_atime)
|
||||
result |= 64;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;]])],
|
||||
[gl_cv_header_working_fcntl_h=yes],
|
||||
[case $? in #(
|
||||
4) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #(
|
||||
64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #(
|
||||
68) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #(
|
||||
*) gl_cv_header_working_fcntl_h='no';;
|
||||
esac],
|
||||
[gl_cv_header_working_fcntl_h=cross-compiling])])
|
||||
|
||||
case $gl_cv_header_working_fcntl_h in #(
|
||||
*O_NOATIME* | no | cross-compiling) ac_val=0;; #(
|
||||
*) ac_val=1;;
|
||||
esac
|
||||
AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOATIME], [$ac_val],
|
||||
[Define to 1 if O_NOATIME works.])
|
||||
|
||||
case $gl_cv_header_working_fcntl_h in #(
|
||||
*O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #(
|
||||
*) ac_val=1;;
|
||||
esac
|
||||
AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOFOLLOW], [$ac_val],
|
||||
[Define to 1 if O_NOFOLLOW works.])
|
||||
])
|
||||
@@ -0,0 +1,11 @@
|
||||
# findprog-in.m4 serial 1
|
||||
dnl Copyright (C) 2003, 2009-2022 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
AC_DEFUN([gl_FINDPROG_IN],
|
||||
[
|
||||
dnl Prerequisites of lib/findprog-in.c.
|
||||
AC_REQUIRE([gl_FUNC_EACCESS])
|
||||
])
|
||||
@@ -0,0 +1,216 @@
|
||||
# Check for getloadavg.
|
||||
|
||||
# Copyright (C) 1992-1996, 1999-2000, 2002-2003, 2006, 2008-2022 Free Software
|
||||
# Foundation, Inc.
|
||||
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
#serial 10
|
||||
|
||||
# Autoconf defines AC_FUNC_GETLOADAVG, but that is obsolescent.
|
||||
# New applications should use gl_GETLOADAVG instead.
|
||||
|
||||
# gl_GETLOADAVG
|
||||
# -------------
|
||||
AC_DEFUN([gl_GETLOADAVG],
|
||||
[AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
|
||||
|
||||
# Persuade glibc <stdlib.h> to declare getloadavg().
|
||||
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
|
||||
|
||||
gl_save_LIBS=$LIBS
|
||||
|
||||
# getloadavg is present in libc on glibc >= 2.2, Mac OS X, FreeBSD >= 2.0,
|
||||
# NetBSD >= 0.9, OpenBSD >= 2.0, Solaris >= 7.
|
||||
HAVE_GETLOADAVG=1
|
||||
AC_CHECK_FUNC([getloadavg], [],
|
||||
[gl_func_getloadavg_done=no
|
||||
|
||||
# Some systems with -lutil have (and need) -lkvm as well, some do not.
|
||||
# On Solaris, -lkvm requires nlist from -lelf, so check that first
|
||||
# to get the right answer into the cache.
|
||||
# For kstat on solaris, we need to test for libelf and libkvm to force the
|
||||
# definition of SVR4 below.
|
||||
if test $gl_func_getloadavg_done = no; then
|
||||
AC_CHECK_LIB([elf], [elf_begin], [LIBS="-lelf $LIBS"])
|
||||
AC_CHECK_LIB([kvm], [kvm_open], [LIBS="-lkvm $LIBS"])
|
||||
# Check for the 4.4BSD definition of getloadavg.
|
||||
AC_CHECK_LIB([util], [getloadavg],
|
||||
[LIBS="-lutil $LIBS" gl_func_getloadavg_done=yes])
|
||||
fi
|
||||
|
||||
if test $gl_func_getloadavg_done = no; then
|
||||
# There is a commonly available library for RS/6000 AIX.
|
||||
# Since it is not a standard part of AIX, it might be installed locally.
|
||||
gl_getloadavg_LIBS=$LIBS
|
||||
if test $cross_compiling != yes; then
|
||||
LIBS="-L/usr/local/lib $LIBS"
|
||||
fi
|
||||
AC_CHECK_LIB([getloadavg], [getloadavg],
|
||||
[LIBS="-lgetloadavg $LIBS" gl_func_getloadavg_done=yes],
|
||||
[LIBS=$gl_getloadavg_LIBS])
|
||||
fi
|
||||
|
||||
# Set up the replacement function if necessary.
|
||||
if test $gl_func_getloadavg_done = no; then
|
||||
HAVE_GETLOADAVG=0
|
||||
|
||||
# Solaris has libkstat which does not require root.
|
||||
AC_CHECK_LIB([kstat], [kstat_open])
|
||||
test $ac_cv_lib_kstat_kstat_open = yes && gl_func_getloadavg_done=yes
|
||||
|
||||
# AIX has libperfstat which does not require root
|
||||
if test $gl_func_getloadavg_done = no; then
|
||||
AC_CHECK_LIB([perfstat], [perfstat_cpu_total])
|
||||
test $ac_cv_lib_perfstat_perfstat_cpu_total = yes && gl_func_getloadavg_done=yes
|
||||
fi
|
||||
|
||||
if test $gl_func_getloadavg_done = no; then
|
||||
AC_CHECK_HEADER([sys/dg_sys_info.h],
|
||||
[gl_func_getloadavg_done=yes
|
||||
AC_DEFINE([DGUX], [1], [Define to 1 for DGUX with <sys/dg_sys_info.h>.])
|
||||
AC_CHECK_LIB([dgc], [dg_sys_info])])
|
||||
fi
|
||||
fi])
|
||||
|
||||
if test "x$gl_save_LIBS" = x; then
|
||||
GETLOADAVG_LIBS=$LIBS
|
||||
else
|
||||
GETLOADAVG_LIBS=`echo "$LIBS" | sed "s!$gl_save_LIBS!!"`
|
||||
fi
|
||||
LIBS=$gl_save_LIBS
|
||||
|
||||
AC_SUBST([GETLOADAVG_LIBS])dnl
|
||||
|
||||
# Test whether the system declares getloadavg. Solaris has the function
|
||||
# but declares it in <sys/loadavg.h>, not <stdlib.h>.
|
||||
AC_CHECK_HEADERS([sys/loadavg.h])
|
||||
if test $ac_cv_header_sys_loadavg_h = yes; then
|
||||
HAVE_SYS_LOADAVG_H=1
|
||||
else
|
||||
HAVE_SYS_LOADAVG_H=0
|
||||
fi
|
||||
AC_CHECK_DECL([getloadavg], [], [HAVE_DECL_GETLOADAVG=0],
|
||||
[[#if HAVE_SYS_LOADAVG_H
|
||||
/* OpenIndiana has a bug: <sys/time.h> must be included before
|
||||
<sys/loadavg.h>. */
|
||||
# include <sys/time.h>
|
||||
# include <sys/loadavg.h>
|
||||
#endif
|
||||
#include <stdlib.h>]])
|
||||
])# gl_GETLOADAVG
|
||||
|
||||
|
||||
# gl_PREREQ_GETLOADAVG
|
||||
# --------------------
|
||||
# Set up the AC_LIBOBJ replacement of 'getloadavg'.
|
||||
AC_DEFUN([gl_PREREQ_GETLOADAVG],
|
||||
[
|
||||
# Figure out what our getloadavg.c needs.
|
||||
|
||||
AC_CHECK_HEADERS_ONCE([sys/param.h unistd.h])
|
||||
|
||||
# On HPUX9, an unprivileged user can get load averages this way.
|
||||
if test $gl_func_getloadavg_done = no; then
|
||||
AC_CHECK_FUNCS([pstat_getdynamic], [gl_func_getloadavg_done=yes])
|
||||
fi
|
||||
|
||||
# We cannot check for <dwarf.h>, because Solaris 2 does not use dwarf (it
|
||||
# uses stabs), but it is still SVR4. We cannot check for <elf.h> because
|
||||
# Irix 4.0.5F has the header but not the library.
|
||||
if test $gl_func_getloadavg_done = no && test "$ac_cv_lib_elf_elf_begin" = yes \
|
||||
&& test "$ac_cv_lib_kvm_kvm_open" = yes; then
|
||||
gl_func_getloadavg_done=yes
|
||||
AC_DEFINE([SVR4], [1], [Define to 1 on System V Release 4.])
|
||||
fi
|
||||
|
||||
if test $gl_func_getloadavg_done = no; then
|
||||
AC_CHECK_HEADER([inq_stats/cpustats.h],
|
||||
[gl_func_getloadavg_done=yes
|
||||
AC_DEFINE([UMAX], [1], [Define to 1 for Encore UMAX.])
|
||||
AC_DEFINE([UMAX4_3], [1],
|
||||
[Define to 1 for Encore UMAX 4.3 that has <inq_status/cpustats.h>
|
||||
instead of <sys/cpustats.h>.])])
|
||||
fi
|
||||
|
||||
if test $gl_func_getloadavg_done = no; then
|
||||
AC_CHECK_HEADER([sys/cpustats.h],
|
||||
[gl_func_getloadavg_done=yes; AC_DEFINE([UMAX])])
|
||||
fi
|
||||
|
||||
if test $gl_func_getloadavg_done = no; then
|
||||
AC_CHECK_HEADERS([mach/mach.h])
|
||||
fi
|
||||
|
||||
AC_CHECK_HEADERS([nlist.h],
|
||||
[AC_CHECK_MEMBERS([struct nlist.n_un.n_name],
|
||||
[], [],
|
||||
[#include <nlist.h>])
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <nlist.h>]],
|
||||
[[struct nlist x;
|
||||
#ifdef HAVE_STRUCT_NLIST_N_UN_N_NAME
|
||||
x.n_un.n_name = "";
|
||||
#else
|
||||
x.n_name = "";
|
||||
#endif]])],
|
||||
[AC_DEFINE([N_NAME_POINTER], [1],
|
||||
[Define to 1 if the nlist n_name member is a pointer])])
|
||||
])dnl
|
||||
])# gl_PREREQ_GETLOADAVG
|
||||
|
||||
# ---- GNU make
|
||||
# These macros are imported from stdlib which we don't want to include
|
||||
# Only the getloadavg content is imported.
|
||||
|
||||
AC_DEFUN_ONCE([gl_STDLIB_H],
|
||||
[
|
||||
AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
|
||||
|
||||
dnl Check for declarations of anything we want to poison if the
|
||||
dnl corresponding gnulib module is not in use, and which is not
|
||||
dnl guaranteed by C89.
|
||||
gl_WARN_ON_USE_PREPARE([[#include <stdlib.h>
|
||||
#if HAVE_SYS_LOADAVG_H
|
||||
/* OpenIndiana has a bug: <sys/time.h> must be included before
|
||||
<sys/loadavg.h>. */
|
||||
# include <sys/time.h>
|
||||
# include <sys/loadavg.h>
|
||||
#endif
|
||||
#if HAVE_RANDOM_H
|
||||
# include <random.h>
|
||||
#endif
|
||||
]], [getloadavg])
|
||||
])
|
||||
|
||||
# gl_STDLIB_MODULE_INDICATOR([modulename])
|
||||
# sets the shell variable that indicates the presence of the given module
|
||||
# to a C preprocessor expression that will evaluate to 1.
|
||||
# This macro invocation must not occur in macros that are AC_REQUIREd.
|
||||
AC_DEFUN([gl_STDLIB_MODULE_INDICATOR],
|
||||
[
|
||||
dnl Ensure to expand the default settings once only.
|
||||
gl_STDLIB_H_REQUIRE_DEFAULTS
|
||||
gl_MODULE_INDICATOR_SET_VARIABLE([$1])
|
||||
dnl Define it also as a C macro, for the benefit of the unit tests.
|
||||
gl_MODULE_INDICATOR_FOR_TESTS([$1])
|
||||
])
|
||||
|
||||
# Initializes the default values for AC_SUBSTed shell variables.
|
||||
# This macro must not be AC_REQUIREd. It must only be invoked, and only
|
||||
# outside of macros or in macros that are not AC_REQUIREd.
|
||||
AC_DEFUN([gl_STDLIB_H_REQUIRE_DEFAULTS],
|
||||
[
|
||||
m4_defun(GL_MODULE_INDICATOR_PREFIX[_STDLIB_H_MODULE_INDICATOR_DEFAULTS], [
|
||||
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETLOADAVG])
|
||||
])
|
||||
m4_require(GL_MODULE_INDICATOR_PREFIX[_STDLIB_H_MODULE_INDICATOR_DEFAULTS])
|
||||
AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_STDLIB_H_DEFAULTS],
|
||||
[
|
||||
dnl Assume proper GNU behavior unless another module says otherwise.
|
||||
HAVE_DECL_GETLOADAVG=1; AC_SUBST([HAVE_DECL_GETLOADAVG])
|
||||
])
|
||||
@@ -0,0 +1,401 @@
|
||||
# gettext.m4 serial 66 (gettext-0.18.2)
|
||||
dnl Copyright (C) 1995-2014 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
dnl
|
||||
dnl This file can can be used in projects which are not available under
|
||||
dnl the GNU General Public License or the GNU Library General Public
|
||||
dnl License but which still want to provide support for the GNU gettext
|
||||
dnl functionality.
|
||||
dnl Please note that the actual code of the GNU gettext library is covered
|
||||
dnl by the GNU Library General Public License, and the rest of the GNU
|
||||
dnl gettext package package is covered by the GNU General Public License.
|
||||
dnl They are *not* in the public domain.
|
||||
|
||||
dnl Authors:
|
||||
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
|
||||
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2006, 2008-2010.
|
||||
|
||||
dnl Macro to add for using GNU gettext.
|
||||
|
||||
dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
|
||||
dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
|
||||
dnl default (if it is not specified or empty) is 'no-libtool'.
|
||||
dnl INTLSYMBOL should be 'external' for packages with no intl directory,
|
||||
dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory.
|
||||
dnl If INTLSYMBOL is 'use-libtool', then a libtool library
|
||||
dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
|
||||
dnl depending on --{enable,disable}-{shared,static} and on the presence of
|
||||
dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
|
||||
dnl $(top_builddir)/intl/libintl.a will be created.
|
||||
dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
|
||||
dnl implementations (in libc or libintl) without the ngettext() function
|
||||
dnl will be ignored. If NEEDSYMBOL is specified and is
|
||||
dnl 'need-formatstring-macros', then GNU gettext implementations that don't
|
||||
dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
|
||||
dnl INTLDIR is used to find the intl libraries. If empty,
|
||||
dnl the value '$(top_builddir)/intl/' is used.
|
||||
dnl
|
||||
dnl The result of the configuration is one of three cases:
|
||||
dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
|
||||
dnl and used.
|
||||
dnl Catalog format: GNU --> install in $(datadir)
|
||||
dnl Catalog extension: .mo after installation, .gmo in source tree
|
||||
dnl 2) GNU gettext has been found in the system's C library.
|
||||
dnl Catalog format: GNU --> install in $(datadir)
|
||||
dnl Catalog extension: .mo after installation, .gmo in source tree
|
||||
dnl 3) No internationalization, always use English msgid.
|
||||
dnl Catalog format: none
|
||||
dnl Catalog extension: none
|
||||
dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
|
||||
dnl The use of .gmo is historical (it was needed to avoid overwriting the
|
||||
dnl GNU format catalogs when building on a platform with an X/Open gettext),
|
||||
dnl but we keep it in order not to force irrelevant filename changes on the
|
||||
dnl maintainers.
|
||||
dnl
|
||||
AC_DEFUN([AM_GNU_GETTEXT],
|
||||
[
|
||||
dnl Argument checking.
|
||||
ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
|
||||
[errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
|
||||
])])])])])
|
||||
ifelse(ifelse([$1], [], [old])[]ifelse([$1], [no-libtool], [old]), [old],
|
||||
[AC_DIAGNOSE([obsolete], [Use of AM_GNU_GETTEXT without [external] argument is deprecated.])])
|
||||
ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
|
||||
[errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
|
||||
])])])])
|
||||
define([gt_included_intl],
|
||||
ifelse([$1], [external],
|
||||
ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]),
|
||||
[yes]))
|
||||
define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], []))
|
||||
gt_NEEDS_INIT
|
||||
AM_GNU_GETTEXT_NEED([$2])
|
||||
|
||||
AC_REQUIRE([AM_PO_SUBDIRS])dnl
|
||||
ifelse(gt_included_intl, yes, [
|
||||
AC_REQUIRE([AM_INTL_SUBDIR])dnl
|
||||
])
|
||||
|
||||
dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
|
||||
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
|
||||
AC_REQUIRE([AC_LIB_RPATH])
|
||||
|
||||
dnl Sometimes libintl requires libiconv, so first search for libiconv.
|
||||
dnl Ideally we would do this search only after the
|
||||
dnl if test "$USE_NLS" = "yes"; then
|
||||
dnl if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
|
||||
dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
|
||||
dnl the configure script would need to contain the same shell code
|
||||
dnl again, outside any 'if'. There are two solutions:
|
||||
dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
|
||||
dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
|
||||
dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
|
||||
dnl documented, we avoid it.
|
||||
ifelse(gt_included_intl, yes, , [
|
||||
AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
|
||||
])
|
||||
|
||||
dnl Sometimes, on Mac OS X, libintl requires linking with CoreFoundation.
|
||||
gt_INTL_MACOSX
|
||||
|
||||
dnl Set USE_NLS.
|
||||
AC_REQUIRE([AM_NLS])
|
||||
|
||||
ifelse(gt_included_intl, yes, [
|
||||
BUILD_INCLUDED_LIBINTL=no
|
||||
USE_INCLUDED_LIBINTL=no
|
||||
])
|
||||
LIBINTL=
|
||||
LTLIBINTL=
|
||||
POSUB=
|
||||
|
||||
dnl Add a version number to the cache macros.
|
||||
case " $gt_needs " in
|
||||
*" need-formatstring-macros "*) gt_api_version=3 ;;
|
||||
*" need-ngettext "*) gt_api_version=2 ;;
|
||||
*) gt_api_version=1 ;;
|
||||
esac
|
||||
gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc"
|
||||
gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl"
|
||||
|
||||
dnl If we use NLS figure out what method
|
||||
if test "$USE_NLS" = "yes"; then
|
||||
gt_use_preinstalled_gnugettext=no
|
||||
ifelse(gt_included_intl, yes, [
|
||||
AC_MSG_CHECKING([whether included gettext is requested])
|
||||
AC_ARG_WITH([included-gettext],
|
||||
[ --with-included-gettext use the GNU gettext library included here],
|
||||
nls_cv_force_use_gnu_gettext=$withval,
|
||||
nls_cv_force_use_gnu_gettext=no)
|
||||
AC_MSG_RESULT([$nls_cv_force_use_gnu_gettext])
|
||||
|
||||
nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
|
||||
if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
|
||||
])
|
||||
dnl User does not insist on using GNU NLS library. Figure out what
|
||||
dnl to use. If GNU gettext is available we use this. Else we have
|
||||
dnl to fall back to GNU NLS library.
|
||||
|
||||
if test $gt_api_version -ge 3; then
|
||||
gt_revision_test_code='
|
||||
#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
|
||||
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
|
||||
#endif
|
||||
changequote(,)dnl
|
||||
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
|
||||
changequote([,])dnl
|
||||
'
|
||||
else
|
||||
gt_revision_test_code=
|
||||
fi
|
||||
if test $gt_api_version -ge 2; then
|
||||
gt_expression_test_code=' + * ngettext ("", "", 0)'
|
||||
else
|
||||
gt_expression_test_code=
|
||||
fi
|
||||
|
||||
AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc],
|
||||
[AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[
|
||||
#include <libintl.h>
|
||||
$gt_revision_test_code
|
||||
extern int _nl_msg_cat_cntr;
|
||||
extern int *_nl_domain_bindings;
|
||||
]],
|
||||
[[
|
||||
bindtextdomain ("", "");
|
||||
return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings
|
||||
]])],
|
||||
[eval "$gt_func_gnugettext_libc=yes"],
|
||||
[eval "$gt_func_gnugettext_libc=no"])])
|
||||
|
||||
if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
|
||||
dnl Sometimes libintl requires libiconv, so first search for libiconv.
|
||||
ifelse(gt_included_intl, yes, , [
|
||||
AM_ICONV_LINK
|
||||
])
|
||||
dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
|
||||
dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
|
||||
dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
|
||||
dnl even if libiconv doesn't exist.
|
||||
AC_LIB_LINKFLAGS_BODY([intl])
|
||||
AC_CACHE_CHECK([for GNU gettext in libintl],
|
||||
[$gt_func_gnugettext_libintl],
|
||||
[gt_save_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $INCINTL"
|
||||
gt_save_LIBS="$LIBS"
|
||||
LIBS="$LIBS $LIBINTL"
|
||||
dnl Now see whether libintl exists and does not depend on libiconv.
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[
|
||||
#include <libintl.h>
|
||||
$gt_revision_test_code
|
||||
extern int _nl_msg_cat_cntr;
|
||||
extern
|
||||
#ifdef __cplusplus
|
||||
"C"
|
||||
#endif
|
||||
const char *_nl_expand_alias (const char *);
|
||||
]],
|
||||
[[
|
||||
bindtextdomain ("", "");
|
||||
return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")
|
||||
]])],
|
||||
[eval "$gt_func_gnugettext_libintl=yes"],
|
||||
[eval "$gt_func_gnugettext_libintl=no"])
|
||||
dnl Now see whether libintl exists and depends on libiconv.
|
||||
if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then
|
||||
LIBS="$LIBS $LIBICONV"
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[
|
||||
#include <libintl.h>
|
||||
$gt_revision_test_code
|
||||
extern int _nl_msg_cat_cntr;
|
||||
extern
|
||||
#ifdef __cplusplus
|
||||
"C"
|
||||
#endif
|
||||
const char *_nl_expand_alias (const char *);
|
||||
]],
|
||||
[[
|
||||
bindtextdomain ("", "");
|
||||
return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")
|
||||
]])],
|
||||
[LIBINTL="$LIBINTL $LIBICONV"
|
||||
LTLIBINTL="$LTLIBINTL $LTLIBICONV"
|
||||
eval "$gt_func_gnugettext_libintl=yes"
|
||||
])
|
||||
fi
|
||||
CPPFLAGS="$gt_save_CPPFLAGS"
|
||||
LIBS="$gt_save_LIBS"])
|
||||
fi
|
||||
|
||||
dnl If an already present or preinstalled GNU gettext() is found,
|
||||
dnl use it. But if this macro is used in GNU gettext, and GNU
|
||||
dnl gettext is already preinstalled in libintl, we update this
|
||||
dnl libintl. (Cf. the install rule in intl/Makefile.in.)
|
||||
if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \
|
||||
|| { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \
|
||||
&& test "$PACKAGE" != gettext-runtime \
|
||||
&& test "$PACKAGE" != gettext-tools; }; then
|
||||
gt_use_preinstalled_gnugettext=yes
|
||||
else
|
||||
dnl Reset the values set by searching for libintl.
|
||||
LIBINTL=
|
||||
LTLIBINTL=
|
||||
INCINTL=
|
||||
fi
|
||||
|
||||
ifelse(gt_included_intl, yes, [
|
||||
if test "$gt_use_preinstalled_gnugettext" != "yes"; then
|
||||
dnl GNU gettext is not found in the C library.
|
||||
dnl Fall back on included GNU gettext library.
|
||||
nls_cv_use_gnu_gettext=yes
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$nls_cv_use_gnu_gettext" = "yes"; then
|
||||
dnl Mark actions used to generate GNU NLS library.
|
||||
BUILD_INCLUDED_LIBINTL=yes
|
||||
USE_INCLUDED_LIBINTL=yes
|
||||
LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD"
|
||||
LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD"
|
||||
LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
|
||||
fi
|
||||
|
||||
CATOBJEXT=
|
||||
if test "$gt_use_preinstalled_gnugettext" = "yes" \
|
||||
|| test "$nls_cv_use_gnu_gettext" = "yes"; then
|
||||
dnl Mark actions to use GNU gettext tools.
|
||||
CATOBJEXT=.gmo
|
||||
fi
|
||||
])
|
||||
|
||||
if test -n "$INTL_MACOSX_LIBS"; then
|
||||
if test "$gt_use_preinstalled_gnugettext" = "yes" \
|
||||
|| test "$nls_cv_use_gnu_gettext" = "yes"; then
|
||||
dnl Some extra flags are needed during linking.
|
||||
LIBINTL="$LIBINTL $INTL_MACOSX_LIBS"
|
||||
LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS"
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$gt_use_preinstalled_gnugettext" = "yes" \
|
||||
|| test "$nls_cv_use_gnu_gettext" = "yes"; then
|
||||
AC_DEFINE([ENABLE_NLS], [1],
|
||||
[Define to 1 if translation of program messages to the user's native language
|
||||
is requested.])
|
||||
else
|
||||
USE_NLS=no
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([whether to use NLS])
|
||||
AC_MSG_RESULT([$USE_NLS])
|
||||
if test "$USE_NLS" = "yes"; then
|
||||
AC_MSG_CHECKING([where the gettext function comes from])
|
||||
if test "$gt_use_preinstalled_gnugettext" = "yes"; then
|
||||
if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
|
||||
gt_source="external libintl"
|
||||
else
|
||||
gt_source="libc"
|
||||
fi
|
||||
else
|
||||
gt_source="included intl directory"
|
||||
fi
|
||||
AC_MSG_RESULT([$gt_source])
|
||||
fi
|
||||
|
||||
if test "$USE_NLS" = "yes"; then
|
||||
|
||||
if test "$gt_use_preinstalled_gnugettext" = "yes"; then
|
||||
if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
|
||||
AC_MSG_CHECKING([how to link with libintl])
|
||||
AC_MSG_RESULT([$LIBINTL])
|
||||
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
|
||||
fi
|
||||
|
||||
dnl For backward compatibility. Some packages may be using this.
|
||||
AC_DEFINE([HAVE_GETTEXT], [1],
|
||||
[Define if the GNU gettext() function is already present or preinstalled.])
|
||||
AC_DEFINE([HAVE_DCGETTEXT], [1],
|
||||
[Define if the GNU dcgettext() function is already present or preinstalled.])
|
||||
fi
|
||||
|
||||
dnl We need to process the po/ directory.
|
||||
POSUB=po
|
||||
fi
|
||||
|
||||
ifelse(gt_included_intl, yes, [
|
||||
dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
|
||||
dnl to 'yes' because some of the testsuite requires it.
|
||||
if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
|
||||
BUILD_INCLUDED_LIBINTL=yes
|
||||
fi
|
||||
|
||||
dnl Make all variables we use known to autoconf.
|
||||
AC_SUBST([BUILD_INCLUDED_LIBINTL])
|
||||
AC_SUBST([USE_INCLUDED_LIBINTL])
|
||||
AC_SUBST([CATOBJEXT])
|
||||
|
||||
dnl For backward compatibility. Some configure.ins may be using this.
|
||||
nls_cv_header_intl=
|
||||
nls_cv_header_libgt=
|
||||
|
||||
dnl For backward compatibility. Some Makefiles may be using this.
|
||||
DATADIRNAME=share
|
||||
AC_SUBST([DATADIRNAME])
|
||||
|
||||
dnl For backward compatibility. Some Makefiles may be using this.
|
||||
INSTOBJEXT=.mo
|
||||
AC_SUBST([INSTOBJEXT])
|
||||
|
||||
dnl For backward compatibility. Some Makefiles may be using this.
|
||||
GENCAT=gencat
|
||||
AC_SUBST([GENCAT])
|
||||
|
||||
dnl For backward compatibility. Some Makefiles may be using this.
|
||||
INTLOBJS=
|
||||
if test "$USE_INCLUDED_LIBINTL" = yes; then
|
||||
INTLOBJS="\$(GETTOBJS)"
|
||||
fi
|
||||
AC_SUBST([INTLOBJS])
|
||||
|
||||
dnl Enable libtool support if the surrounding package wishes it.
|
||||
INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
|
||||
AC_SUBST([INTL_LIBTOOL_SUFFIX_PREFIX])
|
||||
])
|
||||
|
||||
dnl For backward compatibility. Some Makefiles may be using this.
|
||||
INTLLIBS="$LIBINTL"
|
||||
AC_SUBST([INTLLIBS])
|
||||
|
||||
dnl Make all documented variables known to autoconf.
|
||||
AC_SUBST([LIBINTL])
|
||||
AC_SUBST([LTLIBINTL])
|
||||
AC_SUBST([POSUB])
|
||||
])
|
||||
|
||||
|
||||
dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized.
|
||||
m4_define([gt_NEEDS_INIT],
|
||||
[
|
||||
m4_divert_text([DEFAULTS], [gt_needs=])
|
||||
m4_define([gt_NEEDS_INIT], [])
|
||||
])
|
||||
|
||||
|
||||
dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL])
|
||||
AC_DEFUN([AM_GNU_GETTEXT_NEED],
|
||||
[
|
||||
m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"])
|
||||
])
|
||||
|
||||
|
||||
dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
|
||||
AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
|
||||
@@ -0,0 +1,31 @@
|
||||
# glibc2.m4 serial 3
|
||||
dnl Copyright (C) 2000-2002, 2004, 2008, 2010-2014 Free Software Foundation,
|
||||
dnl Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# Test for the GNU C Library, version 2.0 or newer.
|
||||
# From Bruno Haible.
|
||||
|
||||
AC_DEFUN([gt_GLIBC2],
|
||||
[
|
||||
AC_CACHE_CHECK([whether we are using the GNU C Library 2 or newer],
|
||||
[ac_cv_gnu_library_2],
|
||||
[AC_EGREP_CPP([Lucky GNU user],
|
||||
[
|
||||
#include <features.h>
|
||||
#ifdef __GNU_LIBRARY__
|
||||
#if (__GLIBC__ >= 2) && !defined __UCLIBC__
|
||||
Lucky GNU user
|
||||
#endif
|
||||
#endif
|
||||
],
|
||||
[ac_cv_gnu_library_2=yes],
|
||||
[ac_cv_gnu_library_2=no])
|
||||
]
|
||||
)
|
||||
AC_SUBST([GLIBC2])
|
||||
GLIBC2="$ac_cv_gnu_library_2"
|
||||
]
|
||||
)
|
||||
@@ -0,0 +1,34 @@
|
||||
# glibc21.m4 serial 5
|
||||
dnl Copyright (C) 2000-2002, 2004, 2008, 2010-2014 Free Software Foundation,
|
||||
dnl Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# Test for the GNU C Library, version 2.1 or newer, or uClibc.
|
||||
# From Bruno Haible.
|
||||
|
||||
AC_DEFUN([gl_GLIBC21],
|
||||
[
|
||||
AC_CACHE_CHECK([whether we are using the GNU C Library >= 2.1 or uClibc],
|
||||
[ac_cv_gnu_library_2_1],
|
||||
[AC_EGREP_CPP([Lucky],
|
||||
[
|
||||
#include <features.h>
|
||||
#ifdef __GNU_LIBRARY__
|
||||
#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
|
||||
Lucky GNU user
|
||||
#endif
|
||||
#endif
|
||||
#ifdef __UCLIBC__
|
||||
Lucky user
|
||||
#endif
|
||||
],
|
||||
[ac_cv_gnu_library_2_1=yes],
|
||||
[ac_cv_gnu_library_2_1=no])
|
||||
]
|
||||
)
|
||||
AC_SUBST([GLIBC21])
|
||||
GLIBC21="$ac_cv_gnu_library_2_1"
|
||||
]
|
||||
)
|
||||
@@ -0,0 +1,71 @@
|
||||
# Copyright (C) 2002-2022 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file 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 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This file 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 file. If not, see <https://www.gnu.org/licenses/>.
|
||||
#
|
||||
# As a special exception to the GNU General Public License,
|
||||
# this file may be distributed as part of a program that
|
||||
# contains a configuration script generated by Autoconf, under
|
||||
# the same distribution terms as the rest of that program.
|
||||
#
|
||||
# Generated by gnulib-tool.
|
||||
#
|
||||
# This file represents the specification of how gnulib-tool is used.
|
||||
# It acts as a cache: It is written and read by gnulib-tool.
|
||||
# In projects that use version control, this file is meant to be put under
|
||||
# version control, like the configure.ac and various Makefile.am files.
|
||||
|
||||
|
||||
# Specification in the form of a command-line invocation:
|
||||
# gnulib-tool --import --local-dir=gl \
|
||||
# --lib=libgnu \
|
||||
# --source-base=lib \
|
||||
# --m4-base=m4 \
|
||||
# --doc-base=doc \
|
||||
# --tests-base=tests \
|
||||
# --aux-dir=build-aux \
|
||||
# --no-conditional-dependencies \
|
||||
# --no-libtool \
|
||||
# --macro-prefix=gl \
|
||||
# alloca \
|
||||
# fdl \
|
||||
# findprog-in \
|
||||
# getloadavg \
|
||||
# host-cpu-c-abi \
|
||||
# largefile \
|
||||
# make-glob \
|
||||
# make-macros
|
||||
|
||||
# Specification in the form of a few gnulib-tool.m4 macro invocations:
|
||||
gl_LOCAL_DIR([gl])
|
||||
gl_MODULES([
|
||||
alloca
|
||||
fdl
|
||||
findprog-in
|
||||
getloadavg
|
||||
host-cpu-c-abi
|
||||
largefile
|
||||
make-glob
|
||||
make-macros
|
||||
])
|
||||
gl_AVOID([])
|
||||
gl_SOURCE_BASE([lib])
|
||||
gl_M4_BASE([m4])
|
||||
gl_PO_BASE([])
|
||||
gl_DOC_BASE([doc])
|
||||
gl_TESTS_BASE([tests])
|
||||
gl_LIB([libgnu])
|
||||
gl_MAKEFILE_NAME([])
|
||||
gl_MACRO_PREFIX([gl])
|
||||
gl_PO_DOMAIN([])
|
||||
gl_WITNESS_C_MACRO([])
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,329 @@
|
||||
# DO NOT EDIT! GENERATED AUTOMATICALLY!
|
||||
# Copyright (C) 2002-2022 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file 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 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This file 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 file. If not, see <https://www.gnu.org/licenses/>.
|
||||
#
|
||||
# As a special exception to the GNU General Public License,
|
||||
# this file may be distributed as part of a program that
|
||||
# contains a configuration script generated by Autoconf, under
|
||||
# the same distribution terms as the rest of that program.
|
||||
#
|
||||
# Generated by gnulib-tool.
|
||||
#
|
||||
# This file represents the compiled summary of the specification in
|
||||
# gnulib-cache.m4. It lists the computed macro invocations that need
|
||||
# to be invoked from configure.ac.
|
||||
# In projects that use version control, this file can be treated like
|
||||
# other built files.
|
||||
|
||||
|
||||
# This macro should be invoked from ./configure.ac, in the section
|
||||
# "Checks for programs", right after AC_PROG_CC, and certainly before
|
||||
# any checks for libraries, header files, types and library functions.
|
||||
AC_DEFUN([gl_EARLY],
|
||||
[
|
||||
m4_pattern_forbid([^gl_[A-Z]])dnl the gnulib macro namespace
|
||||
m4_pattern_allow([^gl_ES$])dnl a valid locale name
|
||||
m4_pattern_allow([^gl_LIBOBJS$])dnl a variable
|
||||
m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable
|
||||
|
||||
# Pre-early section.
|
||||
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
|
||||
AC_REQUIRE([gl_PROG_AR_RANLIB])
|
||||
|
||||
# Code from module alloca:
|
||||
# Code from module alloca-opt:
|
||||
# Code from module concat-filename:
|
||||
# Code from module extensions:
|
||||
# Code from module fdl:
|
||||
# Code from module filename:
|
||||
# Code from module findprog-in:
|
||||
# Code from module gen-header:
|
||||
# Code from module getloadavg:
|
||||
# Code from module host-cpu-c-abi:
|
||||
# Code from module intprops:
|
||||
# Code from module largefile:
|
||||
AC_REQUIRE([AC_SYS_LARGEFILE])
|
||||
AC_REQUIRE([gl_YEAR2038_EARLY])
|
||||
# Code from module make-glob:
|
||||
# Code from module make-macros:
|
||||
# Code from module snippet/warn-on-use:
|
||||
# Code from module stdbool:
|
||||
])
|
||||
|
||||
# This macro should be invoked from ./configure.ac, in the section
|
||||
# "Check for header files, types and library functions".
|
||||
AC_DEFUN([gl_INIT],
|
||||
[
|
||||
AC_CONFIG_LIBOBJ_DIR([lib])
|
||||
AM_CONDITIONAL([GL_COND_LIBTOOL], [false])
|
||||
gl_cond_libtool=false
|
||||
gl_libdeps=
|
||||
gl_ltlibdeps=
|
||||
gl_m4_base='m4'
|
||||
m4_pushdef([AC_LIBOBJ], m4_defn([gl_LIBOBJ]))
|
||||
m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gl_REPLACE_FUNCS]))
|
||||
m4_pushdef([AC_LIBSOURCES], m4_defn([gl_LIBSOURCES]))
|
||||
m4_pushdef([gl_LIBSOURCES_LIST], [])
|
||||
m4_pushdef([gl_LIBSOURCES_DIR], [])
|
||||
m4_pushdef([GL_MACRO_PREFIX], [gl])
|
||||
m4_pushdef([GL_MODULE_INDICATOR_PREFIX], [GL])
|
||||
gl_COMMON
|
||||
gl_source_base='lib'
|
||||
gl_source_base_prefix=
|
||||
gl_FUNC_ALLOCA
|
||||
gl_CONDITIONAL_HEADER([alloca.h])
|
||||
AC_PROG_MKDIR_P
|
||||
gl_FINDPROG_IN
|
||||
gl_STDLIB_H
|
||||
gl_STDLIB_H_REQUIRE_DEFAULTS
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
gl_GETLOADAVG
|
||||
gl_CONDITIONAL([GL_COND_OBJ_GETLOADAVG], [test $HAVE_GETLOADAVG = 0])
|
||||
AM_COND_IF([GL_COND_OBJ_GETLOADAVG], [
|
||||
gl_PREREQ_GETLOADAVG
|
||||
])
|
||||
gl_STDLIB_MODULE_INDICATOR([getloadavg])
|
||||
AC_REQUIRE([gl_HOST_CPU_C_ABI])
|
||||
AC_REQUIRE([gl_LARGEFILE])
|
||||
# Check the system to see if it provides GNU glob. If not, use our
|
||||
# local version.
|
||||
AC_CACHE_CHECK([if system libc has GNU glob], [make_cv_sys_gnu_glob],
|
||||
[ AC_EGREP_CPP([gnu glob],[
|
||||
#include <features.h>
|
||||
#include <glob.h>
|
||||
#include <fnmatch.h>
|
||||
#if !defined _LIBC && defined __GNU_LIBRARY__ && __GNU_LIBRARY__ > 1
|
||||
# include <gnu-versions.h>
|
||||
# if _GNU_GLOB_INTERFACE_VERSION == 1 || _GNU_GLOB_INTERFACE_VERSION == 2
|
||||
gnu glob
|
||||
# endif
|
||||
#endif],
|
||||
[make_cv_sys_gnu_glob=yes],
|
||||
[make_cv_sys_gnu_glob=no])])
|
||||
# Tell automake about this, so it can build the right .c files.
|
||||
AM_CONDITIONAL([USE_SYSTEM_GLOB], [test "$make_cv_sys_gnu_glob" = yes])
|
||||
# Tell build.sh which to use
|
||||
USE_SYSTEM_GLOB="$make_cv_sys_gnu_glob"
|
||||
AC_SUBST([USE_SYSTEM_GLOB])
|
||||
# Check for DOS-style pathnames.
|
||||
pds_AC_DOS_PATHS
|
||||
gl_STDBOOL_H
|
||||
gl_CONDITIONAL_HEADER([stdbool.h])
|
||||
AC_PROG_MKDIR_P
|
||||
# End of code from modules
|
||||
m4_ifval(gl_LIBSOURCES_LIST, [
|
||||
m4_syscmd([test ! -d ]m4_defn([gl_LIBSOURCES_DIR])[ ||
|
||||
for gl_file in ]gl_LIBSOURCES_LIST[ ; do
|
||||
if test ! -r ]m4_defn([gl_LIBSOURCES_DIR])[/$gl_file ; then
|
||||
echo "missing file ]m4_defn([gl_LIBSOURCES_DIR])[/$gl_file" >&2
|
||||
exit 1
|
||||
fi
|
||||
done])dnl
|
||||
m4_if(m4_sysval, [0], [],
|
||||
[AC_FATAL([expected source file, required through AC_LIBSOURCES, not found])])
|
||||
])
|
||||
m4_popdef([GL_MODULE_INDICATOR_PREFIX])
|
||||
m4_popdef([GL_MACRO_PREFIX])
|
||||
m4_popdef([gl_LIBSOURCES_DIR])
|
||||
m4_popdef([gl_LIBSOURCES_LIST])
|
||||
m4_popdef([AC_LIBSOURCES])
|
||||
m4_popdef([AC_REPLACE_FUNCS])
|
||||
m4_popdef([AC_LIBOBJ])
|
||||
AC_CONFIG_COMMANDS_PRE([
|
||||
gl_libobjs=
|
||||
gl_ltlibobjs=
|
||||
gl_libobjdeps=
|
||||
if test -n "$gl_LIBOBJS"; then
|
||||
# Remove the extension.
|
||||
changequote(,)dnl
|
||||
sed_drop_objext='s/\.o$//;s/\.obj$//'
|
||||
sed_dirname1='s,//*,/,g'
|
||||
sed_dirname2='s,\(.\)/$,\1,'
|
||||
sed_dirname3='s,^[^/]*$,.,'
|
||||
sed_dirname4='s,\(.\)/[^/]*$,\1,'
|
||||
sed_basename1='s,.*/,,'
|
||||
changequote([, ])dnl
|
||||
for i in `for i in $gl_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do
|
||||
gl_libobjs="$gl_libobjs $i.$ac_objext"
|
||||
gl_ltlibobjs="$gl_ltlibobjs $i.lo"
|
||||
i_dir=`echo "$i" | sed -e "$sed_dirname1" -e "$sed_dirname2" -e "$sed_dirname3" -e "$sed_dirname4"`
|
||||
i_base=`echo "$i" | sed -e "$sed_basename1"`
|
||||
gl_libobjdeps="$gl_libobjdeps $i_dir/\$(DEPDIR)/$i_base.Po"
|
||||
done
|
||||
fi
|
||||
AC_SUBST([gl_LIBOBJS], [$gl_libobjs])
|
||||
AC_SUBST([gl_LTLIBOBJS], [$gl_ltlibobjs])
|
||||
AC_SUBST([gl_LIBOBJDEPS], [$gl_libobjdeps])
|
||||
])
|
||||
gltests_libdeps=
|
||||
gltests_ltlibdeps=
|
||||
m4_pushdef([AC_LIBOBJ], m4_defn([gltests_LIBOBJ]))
|
||||
m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gltests_REPLACE_FUNCS]))
|
||||
m4_pushdef([AC_LIBSOURCES], m4_defn([gltests_LIBSOURCES]))
|
||||
m4_pushdef([gltests_LIBSOURCES_LIST], [])
|
||||
m4_pushdef([gltests_LIBSOURCES_DIR], [])
|
||||
m4_pushdef([GL_MACRO_PREFIX], [gltests])
|
||||
m4_pushdef([GL_MODULE_INDICATOR_PREFIX], [GL])
|
||||
gl_COMMON
|
||||
gl_source_base='tests'
|
||||
gl_source_base_prefix=
|
||||
changequote(,)dnl
|
||||
gltests_WITNESS=IN_`echo "${PACKAGE-$PACKAGE_TARNAME}" | LC_ALL=C tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ | LC_ALL=C sed -e 's/[^A-Z0-9_]/_/g'`_GNULIB_TESTS
|
||||
changequote([, ])dnl
|
||||
AC_SUBST([gltests_WITNESS])
|
||||
gl_module_indicator_condition=$gltests_WITNESS
|
||||
m4_pushdef([gl_MODULE_INDICATOR_CONDITION], [$gl_module_indicator_condition])
|
||||
m4_popdef([gl_MODULE_INDICATOR_CONDITION])
|
||||
m4_ifval(gltests_LIBSOURCES_LIST, [
|
||||
m4_syscmd([test ! -d ]m4_defn([gltests_LIBSOURCES_DIR])[ ||
|
||||
for gl_file in ]gltests_LIBSOURCES_LIST[ ; do
|
||||
if test ! -r ]m4_defn([gltests_LIBSOURCES_DIR])[/$gl_file ; then
|
||||
echo "missing file ]m4_defn([gltests_LIBSOURCES_DIR])[/$gl_file" >&2
|
||||
exit 1
|
||||
fi
|
||||
done])dnl
|
||||
m4_if(m4_sysval, [0], [],
|
||||
[AC_FATAL([expected source file, required through AC_LIBSOURCES, not found])])
|
||||
])
|
||||
m4_popdef([GL_MODULE_INDICATOR_PREFIX])
|
||||
m4_popdef([GL_MACRO_PREFIX])
|
||||
m4_popdef([gltests_LIBSOURCES_DIR])
|
||||
m4_popdef([gltests_LIBSOURCES_LIST])
|
||||
m4_popdef([AC_LIBSOURCES])
|
||||
m4_popdef([AC_REPLACE_FUNCS])
|
||||
m4_popdef([AC_LIBOBJ])
|
||||
AC_CONFIG_COMMANDS_PRE([
|
||||
gltests_libobjs=
|
||||
gltests_ltlibobjs=
|
||||
gltests_libobjdeps=
|
||||
if test -n "$gltests_LIBOBJS"; then
|
||||
# Remove the extension.
|
||||
changequote(,)dnl
|
||||
sed_drop_objext='s/\.o$//;s/\.obj$//'
|
||||
sed_dirname1='s,//*,/,g'
|
||||
sed_dirname2='s,\(.\)/$,\1,'
|
||||
sed_dirname3='s,^[^/]*$,.,'
|
||||
sed_dirname4='s,\(.\)/[^/]*$,\1,'
|
||||
sed_basename1='s,.*/,,'
|
||||
changequote([, ])dnl
|
||||
for i in `for i in $gltests_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do
|
||||
gltests_libobjs="$gltests_libobjs $i.$ac_objext"
|
||||
gltests_ltlibobjs="$gltests_ltlibobjs $i.lo"
|
||||
i_dir=`echo "$i" | sed -e "$sed_dirname1" -e "$sed_dirname2" -e "$sed_dirname3" -e "$sed_dirname4"`
|
||||
i_base=`echo "$i" | sed -e "$sed_basename1"`
|
||||
gltests_libobjdeps="$gltests_libobjdeps $i_dir/\$(DEPDIR)/$i_base.Po"
|
||||
done
|
||||
fi
|
||||
AC_SUBST([gltests_LIBOBJS], [$gltests_libobjs])
|
||||
AC_SUBST([gltests_LTLIBOBJS], [$gltests_ltlibobjs])
|
||||
AC_SUBST([gltests_LIBOBJDEPS], [$gltests_libobjdeps])
|
||||
])
|
||||
AC_REQUIRE([gl_CC_GNULIB_WARNINGS])
|
||||
LIBGNU_LIBDEPS="$gl_libdeps"
|
||||
AC_SUBST([LIBGNU_LIBDEPS])
|
||||
LIBGNU_LTLIBDEPS="$gl_ltlibdeps"
|
||||
AC_SUBST([LIBGNU_LTLIBDEPS])
|
||||
])
|
||||
|
||||
# Like AC_LIBOBJ, except that the module name goes
|
||||
# into gl_LIBOBJS instead of into LIBOBJS.
|
||||
AC_DEFUN([gl_LIBOBJ], [
|
||||
AS_LITERAL_IF([$1], [gl_LIBSOURCES([$1.c])])dnl
|
||||
gl_LIBOBJS="$gl_LIBOBJS $1.$ac_objext"
|
||||
])
|
||||
|
||||
# Like AC_REPLACE_FUNCS, except that the module name goes
|
||||
# into gl_LIBOBJS instead of into LIBOBJS.
|
||||
AC_DEFUN([gl_REPLACE_FUNCS], [
|
||||
m4_foreach_w([gl_NAME], [$1], [AC_LIBSOURCES(gl_NAME[.c])])dnl
|
||||
AC_CHECK_FUNCS([$1], , [gl_LIBOBJ($ac_func)])
|
||||
])
|
||||
|
||||
# Like AC_LIBSOURCES, except the directory where the source file is
|
||||
# expected is derived from the gnulib-tool parameterization,
|
||||
# and alloca is special cased (for the alloca-opt module).
|
||||
# We could also entirely rely on EXTRA_lib..._SOURCES.
|
||||
AC_DEFUN([gl_LIBSOURCES], [
|
||||
m4_foreach([_gl_NAME], [$1], [
|
||||
m4_if(_gl_NAME, [alloca.c], [], [
|
||||
m4_define([gl_LIBSOURCES_DIR], [lib])
|
||||
m4_append([gl_LIBSOURCES_LIST], _gl_NAME, [ ])
|
||||
])
|
||||
])
|
||||
])
|
||||
|
||||
# Like AC_LIBOBJ, except that the module name goes
|
||||
# into gltests_LIBOBJS instead of into LIBOBJS.
|
||||
AC_DEFUN([gltests_LIBOBJ], [
|
||||
AS_LITERAL_IF([$1], [gltests_LIBSOURCES([$1.c])])dnl
|
||||
gltests_LIBOBJS="$gltests_LIBOBJS $1.$ac_objext"
|
||||
])
|
||||
|
||||
# Like AC_REPLACE_FUNCS, except that the module name goes
|
||||
# into gltests_LIBOBJS instead of into LIBOBJS.
|
||||
AC_DEFUN([gltests_REPLACE_FUNCS], [
|
||||
m4_foreach_w([gl_NAME], [$1], [AC_LIBSOURCES(gl_NAME[.c])])dnl
|
||||
AC_CHECK_FUNCS([$1], , [gltests_LIBOBJ($ac_func)])
|
||||
])
|
||||
|
||||
# Like AC_LIBSOURCES, except the directory where the source file is
|
||||
# expected is derived from the gnulib-tool parameterization,
|
||||
# and alloca is special cased (for the alloca-opt module).
|
||||
# We could also entirely rely on EXTRA_lib..._SOURCES.
|
||||
AC_DEFUN([gltests_LIBSOURCES], [
|
||||
m4_foreach([_gl_NAME], [$1], [
|
||||
m4_if(_gl_NAME, [alloca.c], [], [
|
||||
m4_define([gltests_LIBSOURCES_DIR], [tests])
|
||||
m4_append([gltests_LIBSOURCES_LIST], _gl_NAME, [ ])
|
||||
])
|
||||
])
|
||||
])
|
||||
|
||||
# This macro records the list of files which have been installed by
|
||||
# gnulib-tool and may be removed by future gnulib-tool invocations.
|
||||
AC_DEFUN([gl_FILE_LIST], [
|
||||
doc/fdl.texi
|
||||
lib/alloca.c
|
||||
lib/alloca.in.h
|
||||
lib/concat-filename.c
|
||||
lib/concat-filename.h
|
||||
lib/filename.h
|
||||
lib/findprog-in.c
|
||||
lib/findprog.h
|
||||
lib/fnmatch.c
|
||||
lib/fnmatch.in.h
|
||||
lib/getloadavg.c
|
||||
lib/glob.c
|
||||
lib/glob.in.h
|
||||
lib/intprops.h
|
||||
lib/stdbool.in.h
|
||||
lib/warn-on-use.h
|
||||
m4/00gnulib.m4
|
||||
m4/acinclude.m4
|
||||
m4/alloca.m4
|
||||
m4/asm-underscore.m4
|
||||
m4/dospaths.m4
|
||||
m4/eaccess.m4
|
||||
m4/extensions.m4
|
||||
m4/findprog-in.m4
|
||||
m4/getloadavg.m4
|
||||
m4/gnulib-common.m4
|
||||
m4/host-cpu-c-abi.m4
|
||||
m4/largefile.m4
|
||||
m4/stdbool.m4
|
||||
m4/warn-on-use.m4
|
||||
m4/year2038.m4
|
||||
m4/zzgnulib.m4
|
||||
])
|
||||
@@ -0,0 +1,678 @@
|
||||
# host-cpu-c-abi.m4 serial 15
|
||||
dnl Copyright (C) 2002-2022 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
dnl From Bruno Haible and Sam Steingold.
|
||||
|
||||
dnl Sets the HOST_CPU variable to the canonical name of the CPU.
|
||||
dnl Sets the HOST_CPU_C_ABI variable to the canonical name of the CPU with its
|
||||
dnl C language ABI (application binary interface).
|
||||
dnl Also defines __${HOST_CPU}__ and __${HOST_CPU_C_ABI}__ as C macros in
|
||||
dnl config.h.
|
||||
dnl
|
||||
dnl This canonical name can be used to select a particular assembly language
|
||||
dnl source file that will interoperate with C code on the given host.
|
||||
dnl
|
||||
dnl For example:
|
||||
dnl * 'i386' and 'sparc' are different canonical names, because code for i386
|
||||
dnl will not run on SPARC CPUs and vice versa. They have different
|
||||
dnl instruction sets.
|
||||
dnl * 'sparc' and 'sparc64' are different canonical names, because code for
|
||||
dnl 'sparc' and code for 'sparc64' cannot be linked together: 'sparc' code
|
||||
dnl contains 32-bit instructions, whereas 'sparc64' code contains 64-bit
|
||||
dnl instructions. A process on a SPARC CPU can be in 32-bit mode or in 64-bit
|
||||
dnl mode, but not both.
|
||||
dnl * 'mips' and 'mipsn32' are different canonical names, because they use
|
||||
dnl different argument passing and return conventions for C functions, and
|
||||
dnl although the instruction set of 'mips' is a large subset of the
|
||||
dnl instruction set of 'mipsn32'.
|
||||
dnl * 'mipsn32' and 'mips64' are different canonical names, because they use
|
||||
dnl different sizes for the C types like 'int' and 'void *', and although
|
||||
dnl the instruction sets of 'mipsn32' and 'mips64' are the same.
|
||||
dnl * The same canonical name is used for different endiannesses. You can
|
||||
dnl determine the endianness through preprocessor symbols:
|
||||
dnl - 'arm': test __ARMEL__.
|
||||
dnl - 'mips', 'mipsn32', 'mips64': test _MIPSEB vs. _MIPSEL.
|
||||
dnl - 'powerpc64': test _BIG_ENDIAN vs. _LITTLE_ENDIAN.
|
||||
dnl * The same name 'i386' is used for CPUs of type i386, i486, i586
|
||||
dnl (Pentium), AMD K7, Pentium II, Pentium IV, etc., because
|
||||
dnl - Instructions that do not exist on all of these CPUs (cmpxchg,
|
||||
dnl MMX, SSE, SSE2, 3DNow! etc.) are not frequently used. If your
|
||||
dnl assembly language source files use such instructions, you will
|
||||
dnl need to make the distinction.
|
||||
dnl - Speed of execution of the common instruction set is reasonable across
|
||||
dnl the entire family of CPUs. If you have assembly language source files
|
||||
dnl that are optimized for particular CPU types (like GNU gmp has), you
|
||||
dnl will need to make the distinction.
|
||||
dnl See <https://en.wikipedia.org/wiki/X86_instruction_listings>.
|
||||
AC_DEFUN([gl_HOST_CPU_C_ABI],
|
||||
[
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
AC_REQUIRE([gl_C_ASM])
|
||||
AC_CACHE_CHECK([host CPU and C ABI], [gl_cv_host_cpu_c_abi],
|
||||
[case "$host_cpu" in
|
||||
|
||||
changequote(,)dnl
|
||||
i[34567]86 )
|
||||
changequote([,])dnl
|
||||
gl_cv_host_cpu_c_abi=i386
|
||||
;;
|
||||
|
||||
x86_64 )
|
||||
# On x86_64 systems, the C compiler may be generating code in one of
|
||||
# these ABIs:
|
||||
# - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64.
|
||||
# - 64-bit instruction set, 64-bit pointers, 32-bit 'long': x86_64
|
||||
# with native Windows (mingw, MSVC).
|
||||
# - 64-bit instruction set, 32-bit pointers, 32-bit 'long': x86_64-x32.
|
||||
# - 32-bit instruction set, 32-bit pointers, 32-bit 'long': i386.
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_SOURCE(
|
||||
[[#if (defined __x86_64__ || defined __amd64__ \
|
||||
|| defined _M_X64 || defined _M_AMD64)
|
||||
int ok;
|
||||
#else
|
||||
error fail
|
||||
#endif
|
||||
]])],
|
||||
[AC_COMPILE_IFELSE(
|
||||
[AC_LANG_SOURCE(
|
||||
[[#if defined __ILP32__ || defined _ILP32
|
||||
int ok;
|
||||
#else
|
||||
error fail
|
||||
#endif
|
||||
]])],
|
||||
[gl_cv_host_cpu_c_abi=x86_64-x32],
|
||||
[gl_cv_host_cpu_c_abi=x86_64])],
|
||||
[gl_cv_host_cpu_c_abi=i386])
|
||||
;;
|
||||
|
||||
changequote(,)dnl
|
||||
alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] )
|
||||
changequote([,])dnl
|
||||
gl_cv_host_cpu_c_abi=alpha
|
||||
;;
|
||||
|
||||
arm* | aarch64 )
|
||||
# Assume arm with EABI.
|
||||
# On arm64 systems, the C compiler may be generating code in one of
|
||||
# these ABIs:
|
||||
# - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64.
|
||||
# - aarch64 instruction set, 32-bit pointers, 32-bit 'long': arm64-ilp32.
|
||||
# - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or armhf.
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_SOURCE(
|
||||
[[#ifdef __aarch64__
|
||||
int ok;
|
||||
#else
|
||||
error fail
|
||||
#endif
|
||||
]])],
|
||||
[AC_COMPILE_IFELSE(
|
||||
[AC_LANG_SOURCE(
|
||||
[[#if defined __ILP32__ || defined _ILP32
|
||||
int ok;
|
||||
#else
|
||||
error fail
|
||||
#endif
|
||||
]])],
|
||||
[gl_cv_host_cpu_c_abi=arm64-ilp32],
|
||||
[gl_cv_host_cpu_c_abi=arm64])],
|
||||
[# Don't distinguish little-endian and big-endian arm, since they
|
||||
# don't require different machine code for simple operations and
|
||||
# since the user can distinguish them through the preprocessor
|
||||
# defines __ARMEL__ vs. __ARMEB__.
|
||||
# But distinguish arm which passes floating-point arguments and
|
||||
# return values in integer registers (r0, r1, ...) - this is
|
||||
# gcc -mfloat-abi=soft or gcc -mfloat-abi=softfp - from arm which
|
||||
# passes them in float registers (s0, s1, ...) and double registers
|
||||
# (d0, d1, ...) - this is gcc -mfloat-abi=hard. GCC 4.6 or newer
|
||||
# sets the preprocessor defines __ARM_PCS (for the first case) and
|
||||
# __ARM_PCS_VFP (for the second case), but older GCC does not.
|
||||
echo 'double ddd; void func (double dd) { ddd = dd; }' > conftest.c
|
||||
# Look for a reference to the register d0 in the .s file.
|
||||
AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS $gl_c_asm_opt conftest.c) >/dev/null 2>&1
|
||||
if LC_ALL=C grep 'd0,' conftest.$gl_asmext >/dev/null; then
|
||||
gl_cv_host_cpu_c_abi=armhf
|
||||
else
|
||||
gl_cv_host_cpu_c_abi=arm
|
||||
fi
|
||||
rm -f conftest*
|
||||
])
|
||||
;;
|
||||
|
||||
hppa1.0 | hppa1.1 | hppa2.0* | hppa64 )
|
||||
# On hppa, the C compiler may be generating 32-bit code or 64-bit
|
||||
# code. In the latter case, it defines _LP64 and __LP64__.
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_SOURCE(
|
||||
[[#ifdef __LP64__
|
||||
int ok;
|
||||
#else
|
||||
error fail
|
||||
#endif
|
||||
]])],
|
||||
[gl_cv_host_cpu_c_abi=hppa64],
|
||||
[gl_cv_host_cpu_c_abi=hppa])
|
||||
;;
|
||||
|
||||
ia64* )
|
||||
# On ia64 on HP-UX, the C compiler may be generating 64-bit code or
|
||||
# 32-bit code. In the latter case, it defines _ILP32.
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_SOURCE(
|
||||
[[#ifdef _ILP32
|
||||
int ok;
|
||||
#else
|
||||
error fail
|
||||
#endif
|
||||
]])],
|
||||
[gl_cv_host_cpu_c_abi=ia64-ilp32],
|
||||
[gl_cv_host_cpu_c_abi=ia64])
|
||||
;;
|
||||
|
||||
mips* )
|
||||
# We should also check for (_MIPS_SZPTR == 64), but gcc keeps this
|
||||
# at 32.
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_SOURCE(
|
||||
[[#if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64)
|
||||
int ok;
|
||||
#else
|
||||
error fail
|
||||
#endif
|
||||
]])],
|
||||
[gl_cv_host_cpu_c_abi=mips64],
|
||||
[# In the n32 ABI, _ABIN32 is defined, _ABIO32 is not defined (but
|
||||
# may later get defined by <sgidefs.h>), and _MIPS_SIM == _ABIN32.
|
||||
# In the 32 ABI, _ABIO32 is defined, _ABIN32 is not defined (but
|
||||
# may later get defined by <sgidefs.h>), and _MIPS_SIM == _ABIO32.
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_SOURCE(
|
||||
[[#if (_MIPS_SIM == _ABIN32)
|
||||
int ok;
|
||||
#else
|
||||
error fail
|
||||
#endif
|
||||
]])],
|
||||
[gl_cv_host_cpu_c_abi=mipsn32],
|
||||
[gl_cv_host_cpu_c_abi=mips])])
|
||||
;;
|
||||
|
||||
powerpc* )
|
||||
# Different ABIs are in use on AIX vs. Mac OS X vs. Linux,*BSD.
|
||||
# No need to distinguish them here; the caller may distinguish
|
||||
# them based on the OS.
|
||||
# On powerpc64 systems, the C compiler may still be generating
|
||||
# 32-bit code. And on powerpc-ibm-aix systems, the C compiler may
|
||||
# be generating 64-bit code.
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_SOURCE(
|
||||
[[#if defined __powerpc64__ || defined __LP64__
|
||||
int ok;
|
||||
#else
|
||||
error fail
|
||||
#endif
|
||||
]])],
|
||||
[# On powerpc64, there are two ABIs on Linux: The AIX compatible
|
||||
# one and the ELFv2 one. The latter defines _CALL_ELF=2.
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_SOURCE(
|
||||
[[#if defined _CALL_ELF && _CALL_ELF == 2
|
||||
int ok;
|
||||
#else
|
||||
error fail
|
||||
#endif
|
||||
]])],
|
||||
[gl_cv_host_cpu_c_abi=powerpc64-elfv2],
|
||||
[gl_cv_host_cpu_c_abi=powerpc64])
|
||||
],
|
||||
[gl_cv_host_cpu_c_abi=powerpc])
|
||||
;;
|
||||
|
||||
rs6000 )
|
||||
gl_cv_host_cpu_c_abi=powerpc
|
||||
;;
|
||||
|
||||
riscv32 | riscv64 )
|
||||
# There are 2 architectures (with variants): rv32* and rv64*.
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_SOURCE(
|
||||
[[#if __riscv_xlen == 64
|
||||
int ok;
|
||||
#else
|
||||
error fail
|
||||
#endif
|
||||
]])],
|
||||
[cpu=riscv64],
|
||||
[cpu=riscv32])
|
||||
# There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d.
|
||||
# Size of 'long' and 'void *':
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_SOURCE(
|
||||
[[#if defined __LP64__
|
||||
int ok;
|
||||
#else
|
||||
error fail
|
||||
#endif
|
||||
]])],
|
||||
[main_abi=lp64],
|
||||
[main_abi=ilp32])
|
||||
# Float ABIs:
|
||||
# __riscv_float_abi_double:
|
||||
# 'float' and 'double' are passed in floating-point registers.
|
||||
# __riscv_float_abi_single:
|
||||
# 'float' are passed in floating-point registers.
|
||||
# __riscv_float_abi_soft:
|
||||
# No values are passed in floating-point registers.
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_SOURCE(
|
||||
[[#if defined __riscv_float_abi_double
|
||||
int ok;
|
||||
#else
|
||||
error fail
|
||||
#endif
|
||||
]])],
|
||||
[float_abi=d],
|
||||
[AC_COMPILE_IFELSE(
|
||||
[AC_LANG_SOURCE(
|
||||
[[#if defined __riscv_float_abi_single
|
||||
int ok;
|
||||
#else
|
||||
error fail
|
||||
#endif
|
||||
]])],
|
||||
[float_abi=f],
|
||||
[float_abi=''])
|
||||
])
|
||||
gl_cv_host_cpu_c_abi="${cpu}-${main_abi}${float_abi}"
|
||||
;;
|
||||
|
||||
s390* )
|
||||
# On s390x, the C compiler may be generating 64-bit (= s390x) code
|
||||
# or 31-bit (= s390) code.
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_SOURCE(
|
||||
[[#if defined __LP64__ || defined __s390x__
|
||||
int ok;
|
||||
#else
|
||||
error fail
|
||||
#endif
|
||||
]])],
|
||||
[gl_cv_host_cpu_c_abi=s390x],
|
||||
[gl_cv_host_cpu_c_abi=s390])
|
||||
;;
|
||||
|
||||
sparc | sparc64 )
|
||||
# UltraSPARCs running Linux have `uname -m` = "sparc64", but the
|
||||
# C compiler still generates 32-bit code.
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_SOURCE(
|
||||
[[#if defined __sparcv9 || defined __arch64__
|
||||
int ok;
|
||||
#else
|
||||
error fail
|
||||
#endif
|
||||
]])],
|
||||
[gl_cv_host_cpu_c_abi=sparc64],
|
||||
[gl_cv_host_cpu_c_abi=sparc])
|
||||
;;
|
||||
|
||||
*)
|
||||
gl_cv_host_cpu_c_abi="$host_cpu"
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
||||
dnl In most cases, $HOST_CPU and $HOST_CPU_C_ABI are the same.
|
||||
HOST_CPU=`echo "$gl_cv_host_cpu_c_abi" | sed -e 's/-.*//'`
|
||||
HOST_CPU_C_ABI="$gl_cv_host_cpu_c_abi"
|
||||
AC_SUBST([HOST_CPU])
|
||||
AC_SUBST([HOST_CPU_C_ABI])
|
||||
|
||||
# This was
|
||||
# AC_DEFINE_UNQUOTED([__${HOST_CPU}__])
|
||||
# AC_DEFINE_UNQUOTED([__${HOST_CPU_C_ABI}__])
|
||||
# earlier, but KAI C++ 3.2d doesn't like this.
|
||||
sed -e 's/-/_/g' >> confdefs.h <<EOF
|
||||
#ifndef __${HOST_CPU}__
|
||||
#define __${HOST_CPU}__ 1
|
||||
#endif
|
||||
#ifndef __${HOST_CPU_C_ABI}__
|
||||
#define __${HOST_CPU_C_ABI}__ 1
|
||||
#endif
|
||||
EOF
|
||||
AH_TOP([/* CPU and C ABI indicator */
|
||||
#ifndef __i386__
|
||||
#undef __i386__
|
||||
#endif
|
||||
#ifndef __x86_64_x32__
|
||||
#undef __x86_64_x32__
|
||||
#endif
|
||||
#ifndef __x86_64__
|
||||
#undef __x86_64__
|
||||
#endif
|
||||
#ifndef __alpha__
|
||||
#undef __alpha__
|
||||
#endif
|
||||
#ifndef __arm__
|
||||
#undef __arm__
|
||||
#endif
|
||||
#ifndef __armhf__
|
||||
#undef __armhf__
|
||||
#endif
|
||||
#ifndef __arm64_ilp32__
|
||||
#undef __arm64_ilp32__
|
||||
#endif
|
||||
#ifndef __arm64__
|
||||
#undef __arm64__
|
||||
#endif
|
||||
#ifndef __hppa__
|
||||
#undef __hppa__
|
||||
#endif
|
||||
#ifndef __hppa64__
|
||||
#undef __hppa64__
|
||||
#endif
|
||||
#ifndef __ia64_ilp32__
|
||||
#undef __ia64_ilp32__
|
||||
#endif
|
||||
#ifndef __ia64__
|
||||
#undef __ia64__
|
||||
#endif
|
||||
#ifndef __loongarch64__
|
||||
#undef __loongarch64__
|
||||
#endif
|
||||
#ifndef __m68k__
|
||||
#undef __m68k__
|
||||
#endif
|
||||
#ifndef __mips__
|
||||
#undef __mips__
|
||||
#endif
|
||||
#ifndef __mipsn32__
|
||||
#undef __mipsn32__
|
||||
#endif
|
||||
#ifndef __mips64__
|
||||
#undef __mips64__
|
||||
#endif
|
||||
#ifndef __powerpc__
|
||||
#undef __powerpc__
|
||||
#endif
|
||||
#ifndef __powerpc64__
|
||||
#undef __powerpc64__
|
||||
#endif
|
||||
#ifndef __powerpc64_elfv2__
|
||||
#undef __powerpc64_elfv2__
|
||||
#endif
|
||||
#ifndef __riscv32__
|
||||
#undef __riscv32__
|
||||
#endif
|
||||
#ifndef __riscv64__
|
||||
#undef __riscv64__
|
||||
#endif
|
||||
#ifndef __riscv32_ilp32__
|
||||
#undef __riscv32_ilp32__
|
||||
#endif
|
||||
#ifndef __riscv32_ilp32f__
|
||||
#undef __riscv32_ilp32f__
|
||||
#endif
|
||||
#ifndef __riscv32_ilp32d__
|
||||
#undef __riscv32_ilp32d__
|
||||
#endif
|
||||
#ifndef __riscv64_ilp32__
|
||||
#undef __riscv64_ilp32__
|
||||
#endif
|
||||
#ifndef __riscv64_ilp32f__
|
||||
#undef __riscv64_ilp32f__
|
||||
#endif
|
||||
#ifndef __riscv64_ilp32d__
|
||||
#undef __riscv64_ilp32d__
|
||||
#endif
|
||||
#ifndef __riscv64_lp64__
|
||||
#undef __riscv64_lp64__
|
||||
#endif
|
||||
#ifndef __riscv64_lp64f__
|
||||
#undef __riscv64_lp64f__
|
||||
#endif
|
||||
#ifndef __riscv64_lp64d__
|
||||
#undef __riscv64_lp64d__
|
||||
#endif
|
||||
#ifndef __s390__
|
||||
#undef __s390__
|
||||
#endif
|
||||
#ifndef __s390x__
|
||||
#undef __s390x__
|
||||
#endif
|
||||
#ifndef __sh__
|
||||
#undef __sh__
|
||||
#endif
|
||||
#ifndef __sparc__
|
||||
#undef __sparc__
|
||||
#endif
|
||||
#ifndef __sparc64__
|
||||
#undef __sparc64__
|
||||
#endif
|
||||
])
|
||||
|
||||
])
|
||||
|
||||
|
||||
dnl Sets the HOST_CPU_C_ABI_32BIT variable to 'yes' if the C language ABI
|
||||
dnl (application binary interface) is a 32-bit one, to 'no' if it is a 64-bit
|
||||
dnl one, or to 'unknown' if unknown.
|
||||
dnl This is a simplified variant of gl_HOST_CPU_C_ABI.
|
||||
AC_DEFUN([gl_HOST_CPU_C_ABI_32BIT],
|
||||
[
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
AC_CACHE_CHECK([32-bit host C ABI], [gl_cv_host_cpu_c_abi_32bit],
|
||||
[if test -n "$gl_cv_host_cpu_c_abi"; then
|
||||
case "$gl_cv_host_cpu_c_abi" in
|
||||
i386 | x86_64-x32 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32 | mips | mipsn32 | powerpc | riscv*-ilp32* | s390 | sparc)
|
||||
gl_cv_host_cpu_c_abi_32bit=yes ;;
|
||||
x86_64 | alpha | arm64 | hppa64 | ia64 | mips64 | powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 )
|
||||
gl_cv_host_cpu_c_abi_32bit=no ;;
|
||||
*)
|
||||
gl_cv_host_cpu_c_abi_32bit=unknown ;;
|
||||
esac
|
||||
else
|
||||
case "$host_cpu" in
|
||||
|
||||
# CPUs that only support a 32-bit ABI.
|
||||
arc \
|
||||
| bfin \
|
||||
| cris* \
|
||||
| csky \
|
||||
| epiphany \
|
||||
| ft32 \
|
||||
| h8300 \
|
||||
| m68k \
|
||||
| microblaze | microblazeel \
|
||||
| nds32 | nds32le | nds32be \
|
||||
| nios2 | nios2eb | nios2el \
|
||||
| or1k* \
|
||||
| or32 \
|
||||
| sh | sh[1234] | sh[1234]e[lb] \
|
||||
| tic6x \
|
||||
| xtensa* )
|
||||
gl_cv_host_cpu_c_abi_32bit=yes
|
||||
;;
|
||||
|
||||
# CPUs that only support a 64-bit ABI.
|
||||
changequote(,)dnl
|
||||
alpha | alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] \
|
||||
| mmix )
|
||||
changequote([,])dnl
|
||||
gl_cv_host_cpu_c_abi_32bit=no
|
||||
;;
|
||||
|
||||
changequote(,)dnl
|
||||
i[34567]86 )
|
||||
changequote([,])dnl
|
||||
gl_cv_host_cpu_c_abi_32bit=yes
|
||||
;;
|
||||
|
||||
x86_64 )
|
||||
# On x86_64 systems, the C compiler may be generating code in one of
|
||||
# these ABIs:
|
||||
# - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64.
|
||||
# - 64-bit instruction set, 64-bit pointers, 32-bit 'long': x86_64
|
||||
# with native Windows (mingw, MSVC).
|
||||
# - 64-bit instruction set, 32-bit pointers, 32-bit 'long': x86_64-x32.
|
||||
# - 32-bit instruction set, 32-bit pointers, 32-bit 'long': i386.
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_SOURCE(
|
||||
[[#if (defined __x86_64__ || defined __amd64__ \
|
||||
|| defined _M_X64 || defined _M_AMD64) \
|
||||
&& !(defined __ILP32__ || defined _ILP32)
|
||||
int ok;
|
||||
#else
|
||||
error fail
|
||||
#endif
|
||||
]])],
|
||||
[gl_cv_host_cpu_c_abi_32bit=no],
|
||||
[gl_cv_host_cpu_c_abi_32bit=yes])
|
||||
;;
|
||||
|
||||
arm* | aarch64 )
|
||||
# Assume arm with EABI.
|
||||
# On arm64 systems, the C compiler may be generating code in one of
|
||||
# these ABIs:
|
||||
# - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64.
|
||||
# - aarch64 instruction set, 32-bit pointers, 32-bit 'long': arm64-ilp32.
|
||||
# - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or armhf.
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_SOURCE(
|
||||
[[#if defined __aarch64__ && !(defined __ILP32__ || defined _ILP32)
|
||||
int ok;
|
||||
#else
|
||||
error fail
|
||||
#endif
|
||||
]])],
|
||||
[gl_cv_host_cpu_c_abi_32bit=no],
|
||||
[gl_cv_host_cpu_c_abi_32bit=yes])
|
||||
;;
|
||||
|
||||
hppa1.0 | hppa1.1 | hppa2.0* | hppa64 )
|
||||
# On hppa, the C compiler may be generating 32-bit code or 64-bit
|
||||
# code. In the latter case, it defines _LP64 and __LP64__.
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_SOURCE(
|
||||
[[#ifdef __LP64__
|
||||
int ok;
|
||||
#else
|
||||
error fail
|
||||
#endif
|
||||
]])],
|
||||
[gl_cv_host_cpu_c_abi_32bit=no],
|
||||
[gl_cv_host_cpu_c_abi_32bit=yes])
|
||||
;;
|
||||
|
||||
ia64* )
|
||||
# On ia64 on HP-UX, the C compiler may be generating 64-bit code or
|
||||
# 32-bit code. In the latter case, it defines _ILP32.
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_SOURCE(
|
||||
[[#ifdef _ILP32
|
||||
int ok;
|
||||
#else
|
||||
error fail
|
||||
#endif
|
||||
]])],
|
||||
[gl_cv_host_cpu_c_abi_32bit=yes],
|
||||
[gl_cv_host_cpu_c_abi_32bit=no])
|
||||
;;
|
||||
|
||||
mips* )
|
||||
# We should also check for (_MIPS_SZPTR == 64), but gcc keeps this
|
||||
# at 32.
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_SOURCE(
|
||||
[[#if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64)
|
||||
int ok;
|
||||
#else
|
||||
error fail
|
||||
#endif
|
||||
]])],
|
||||
[gl_cv_host_cpu_c_abi_32bit=no],
|
||||
[gl_cv_host_cpu_c_abi_32bit=yes])
|
||||
;;
|
||||
|
||||
powerpc* )
|
||||
# Different ABIs are in use on AIX vs. Mac OS X vs. Linux,*BSD.
|
||||
# No need to distinguish them here; the caller may distinguish
|
||||
# them based on the OS.
|
||||
# On powerpc64 systems, the C compiler may still be generating
|
||||
# 32-bit code. And on powerpc-ibm-aix systems, the C compiler may
|
||||
# be generating 64-bit code.
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_SOURCE(
|
||||
[[#if defined __powerpc64__ || defined __LP64__
|
||||
int ok;
|
||||
#else
|
||||
error fail
|
||||
#endif
|
||||
]])],
|
||||
[gl_cv_host_cpu_c_abi_32bit=no],
|
||||
[gl_cv_host_cpu_c_abi_32bit=yes])
|
||||
;;
|
||||
|
||||
rs6000 )
|
||||
gl_cv_host_cpu_c_abi_32bit=yes
|
||||
;;
|
||||
|
||||
riscv32 | riscv64 )
|
||||
# There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d.
|
||||
# Size of 'long' and 'void *':
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_SOURCE(
|
||||
[[#if defined __LP64__
|
||||
int ok;
|
||||
#else
|
||||
error fail
|
||||
#endif
|
||||
]])],
|
||||
[gl_cv_host_cpu_c_abi_32bit=no],
|
||||
[gl_cv_host_cpu_c_abi_32bit=yes])
|
||||
;;
|
||||
|
||||
s390* )
|
||||
# On s390x, the C compiler may be generating 64-bit (= s390x) code
|
||||
# or 31-bit (= s390) code.
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_SOURCE(
|
||||
[[#if defined __LP64__ || defined __s390x__
|
||||
int ok;
|
||||
#else
|
||||
error fail
|
||||
#endif
|
||||
]])],
|
||||
[gl_cv_host_cpu_c_abi_32bit=no],
|
||||
[gl_cv_host_cpu_c_abi_32bit=yes])
|
||||
;;
|
||||
|
||||
sparc | sparc64 )
|
||||
# UltraSPARCs running Linux have `uname -m` = "sparc64", but the
|
||||
# C compiler still generates 32-bit code.
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_SOURCE(
|
||||
[[#if defined __sparcv9 || defined __arch64__
|
||||
int ok;
|
||||
#else
|
||||
error fail
|
||||
#endif
|
||||
]])],
|
||||
[gl_cv_host_cpu_c_abi_32bit=no],
|
||||
[gl_cv_host_cpu_c_abi_32bit=yes])
|
||||
;;
|
||||
|
||||
*)
|
||||
gl_cv_host_cpu_c_abi_32bit=unknown
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
])
|
||||
|
||||
HOST_CPU_C_ABI_32BIT="$gl_cv_host_cpu_c_abi_32bit"
|
||||
])
|
||||
@@ -0,0 +1,271 @@
|
||||
# iconv.m4 serial 19 (gettext-0.18.2)
|
||||
dnl Copyright (C) 2000-2002, 2007-2014 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
dnl From Bruno Haible.
|
||||
|
||||
AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
|
||||
[
|
||||
dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
|
||||
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
|
||||
AC_REQUIRE([AC_LIB_RPATH])
|
||||
|
||||
dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
|
||||
dnl accordingly.
|
||||
AC_LIB_LINKFLAGS_BODY([iconv])
|
||||
])
|
||||
|
||||
AC_DEFUN([AM_ICONV_LINK],
|
||||
[
|
||||
dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
|
||||
dnl those with the standalone portable GNU libiconv installed).
|
||||
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
|
||||
|
||||
dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
|
||||
dnl accordingly.
|
||||
AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
|
||||
|
||||
dnl Add $INCICONV to CPPFLAGS before performing the following checks,
|
||||
dnl because if the user has installed libiconv and not disabled its use
|
||||
dnl via --without-libiconv-prefix, he wants to use it. The first
|
||||
dnl AC_LINK_IFELSE will then fail, the second AC_LINK_IFELSE will succeed.
|
||||
am_save_CPPFLAGS="$CPPFLAGS"
|
||||
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
|
||||
|
||||
AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [
|
||||
am_cv_func_iconv="no, consider installing GNU libiconv"
|
||||
am_cv_lib_iconv=no
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[
|
||||
#include <stdlib.h>
|
||||
#include <iconv.h>
|
||||
]],
|
||||
[[iconv_t cd = iconv_open("","");
|
||||
iconv(cd,NULL,NULL,NULL,NULL);
|
||||
iconv_close(cd);]])],
|
||||
[am_cv_func_iconv=yes])
|
||||
if test "$am_cv_func_iconv" != yes; then
|
||||
am_save_LIBS="$LIBS"
|
||||
LIBS="$LIBS $LIBICONV"
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[
|
||||
#include <stdlib.h>
|
||||
#include <iconv.h>
|
||||
]],
|
||||
[[iconv_t cd = iconv_open("","");
|
||||
iconv(cd,NULL,NULL,NULL,NULL);
|
||||
iconv_close(cd);]])],
|
||||
[am_cv_lib_iconv=yes]
|
||||
[am_cv_func_iconv=yes])
|
||||
LIBS="$am_save_LIBS"
|
||||
fi
|
||||
])
|
||||
if test "$am_cv_func_iconv" = yes; then
|
||||
AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [
|
||||
dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11,
|
||||
dnl Solaris 10.
|
||||
am_save_LIBS="$LIBS"
|
||||
if test $am_cv_lib_iconv = yes; then
|
||||
LIBS="$LIBS $LIBICONV"
|
||||
fi
|
||||
am_cv_func_iconv_works=no
|
||||
for ac_iconv_const in '' 'const'; do
|
||||
AC_RUN_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[
|
||||
#include <iconv.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifndef ICONV_CONST
|
||||
# define ICONV_CONST $ac_iconv_const
|
||||
#endif
|
||||
]],
|
||||
[[int result = 0;
|
||||
/* Test against AIX 5.1 bug: Failures are not distinguishable from successful
|
||||
returns. */
|
||||
{
|
||||
iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
|
||||
if (cd_utf8_to_88591 != (iconv_t)(-1))
|
||||
{
|
||||
static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */
|
||||
char buf[10];
|
||||
ICONV_CONST char *inptr = input;
|
||||
size_t inbytesleft = strlen (input);
|
||||
char *outptr = buf;
|
||||
size_t outbytesleft = sizeof (buf);
|
||||
size_t res = iconv (cd_utf8_to_88591,
|
||||
&inptr, &inbytesleft,
|
||||
&outptr, &outbytesleft);
|
||||
if (res == 0)
|
||||
result |= 1;
|
||||
iconv_close (cd_utf8_to_88591);
|
||||
}
|
||||
}
|
||||
/* Test against Solaris 10 bug: Failures are not distinguishable from
|
||||
successful returns. */
|
||||
{
|
||||
iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
|
||||
if (cd_ascii_to_88591 != (iconv_t)(-1))
|
||||
{
|
||||
static ICONV_CONST char input[] = "\263";
|
||||
char buf[10];
|
||||
ICONV_CONST char *inptr = input;
|
||||
size_t inbytesleft = strlen (input);
|
||||
char *outptr = buf;
|
||||
size_t outbytesleft = sizeof (buf);
|
||||
size_t res = iconv (cd_ascii_to_88591,
|
||||
&inptr, &inbytesleft,
|
||||
&outptr, &outbytesleft);
|
||||
if (res == 0)
|
||||
result |= 2;
|
||||
iconv_close (cd_ascii_to_88591);
|
||||
}
|
||||
}
|
||||
/* Test against AIX 6.1..7.1 bug: Buffer overrun. */
|
||||
{
|
||||
iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1");
|
||||
if (cd_88591_to_utf8 != (iconv_t)(-1))
|
||||
{
|
||||
static ICONV_CONST char input[] = "\304";
|
||||
static char buf[2] = { (char)0xDE, (char)0xAD };
|
||||
ICONV_CONST char *inptr = input;
|
||||
size_t inbytesleft = 1;
|
||||
char *outptr = buf;
|
||||
size_t outbytesleft = 1;
|
||||
size_t res = iconv (cd_88591_to_utf8,
|
||||
&inptr, &inbytesleft,
|
||||
&outptr, &outbytesleft);
|
||||
if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
|
||||
result |= 4;
|
||||
iconv_close (cd_88591_to_utf8);
|
||||
}
|
||||
}
|
||||
#if 0 /* This bug could be worked around by the caller. */
|
||||
/* Test against HP-UX 11.11 bug: Positive return value instead of 0. */
|
||||
{
|
||||
iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
|
||||
if (cd_88591_to_utf8 != (iconv_t)(-1))
|
||||
{
|
||||
static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
|
||||
char buf[50];
|
||||
ICONV_CONST char *inptr = input;
|
||||
size_t inbytesleft = strlen (input);
|
||||
char *outptr = buf;
|
||||
size_t outbytesleft = sizeof (buf);
|
||||
size_t res = iconv (cd_88591_to_utf8,
|
||||
&inptr, &inbytesleft,
|
||||
&outptr, &outbytesleft);
|
||||
if ((int)res > 0)
|
||||
result |= 8;
|
||||
iconv_close (cd_88591_to_utf8);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
/* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
|
||||
provided. */
|
||||
if (/* Try standardized names. */
|
||||
iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1)
|
||||
/* Try IRIX, OSF/1 names. */
|
||||
&& iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1)
|
||||
/* Try AIX names. */
|
||||
&& iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
|
||||
/* Try HP-UX names. */
|
||||
&& iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
|
||||
result |= 16;
|
||||
return result;
|
||||
]])],
|
||||
[am_cv_func_iconv_works=yes], ,
|
||||
[case "$host_os" in
|
||||
aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
|
||||
*) am_cv_func_iconv_works="guessing yes" ;;
|
||||
esac])
|
||||
test "$am_cv_func_iconv_works" = no || break
|
||||
done
|
||||
LIBS="$am_save_LIBS"
|
||||
])
|
||||
case "$am_cv_func_iconv_works" in
|
||||
*no) am_func_iconv=no am_cv_lib_iconv=no ;;
|
||||
*) am_func_iconv=yes ;;
|
||||
esac
|
||||
else
|
||||
am_func_iconv=no am_cv_lib_iconv=no
|
||||
fi
|
||||
if test "$am_func_iconv" = yes; then
|
||||
AC_DEFINE([HAVE_ICONV], [1],
|
||||
[Define if you have the iconv() function and it works.])
|
||||
fi
|
||||
if test "$am_cv_lib_iconv" = yes; then
|
||||
AC_MSG_CHECKING([how to link with libiconv])
|
||||
AC_MSG_RESULT([$LIBICONV])
|
||||
else
|
||||
dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
|
||||
dnl either.
|
||||
CPPFLAGS="$am_save_CPPFLAGS"
|
||||
LIBICONV=
|
||||
LTLIBICONV=
|
||||
fi
|
||||
AC_SUBST([LIBICONV])
|
||||
AC_SUBST([LTLIBICONV])
|
||||
])
|
||||
|
||||
dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to
|
||||
dnl avoid warnings like
|
||||
dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required".
|
||||
dnl This is tricky because of the way 'aclocal' is implemented:
|
||||
dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN.
|
||||
dnl Otherwise aclocal's initial scan pass would miss the macro definition.
|
||||
dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions.
|
||||
dnl Otherwise aclocal would emit many "Use of uninitialized value $1"
|
||||
dnl warnings.
|
||||
m4_define([gl_iconv_AC_DEFUN],
|
||||
m4_version_prereq([2.64],
|
||||
[[AC_DEFUN_ONCE(
|
||||
[$1], [$2])]],
|
||||
[m4_ifdef([gl_00GNULIB],
|
||||
[[AC_DEFUN_ONCE(
|
||||
[$1], [$2])]],
|
||||
[[AC_DEFUN(
|
||||
[$1], [$2])]])]))
|
||||
gl_iconv_AC_DEFUN([AM_ICONV],
|
||||
[
|
||||
AM_ICONV_LINK
|
||||
if test "$am_cv_func_iconv" = yes; then
|
||||
AC_MSG_CHECKING([for iconv declaration])
|
||||
AC_CACHE_VAL([am_cv_proto_iconv], [
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[
|
||||
#include <stdlib.h>
|
||||
#include <iconv.h>
|
||||
extern
|
||||
#ifdef __cplusplus
|
||||
"C"
|
||||
#endif
|
||||
#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus)
|
||||
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
|
||||
#else
|
||||
size_t iconv();
|
||||
#endif
|
||||
]],
|
||||
[[]])],
|
||||
[am_cv_proto_iconv_arg1=""],
|
||||
[am_cv_proto_iconv_arg1="const"])
|
||||
am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
|
||||
am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
|
||||
AC_MSG_RESULT([
|
||||
$am_cv_proto_iconv])
|
||||
AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
|
||||
[Define as const if the declaration of iconv() needs const.])
|
||||
dnl Also substitute ICONV_CONST in the gnulib generated <iconv.h>.
|
||||
m4_ifdef([gl_ICONV_H_DEFAULTS],
|
||||
[AC_REQUIRE([gl_ICONV_H_DEFAULTS])
|
||||
if test -n "$am_cv_proto_iconv_arg1"; then
|
||||
ICONV_CONST="const"
|
||||
fi
|
||||
])
|
||||
fi
|
||||
])
|
||||
@@ -0,0 +1,87 @@
|
||||
# intdiv0.m4 serial 6 (gettext-0.18.2)
|
||||
dnl Copyright (C) 2002, 2007-2008, 2010-2014 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
dnl From Bruno Haible.
|
||||
|
||||
AC_DEFUN([gt_INTDIV0],
|
||||
[
|
||||
AC_REQUIRE([AC_PROG_CC])dnl
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
||||
|
||||
AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
|
||||
gt_cv_int_divbyzero_sigfpe,
|
||||
[
|
||||
gt_cv_int_divbyzero_sigfpe=
|
||||
changequote(,)dnl
|
||||
case "$host_os" in
|
||||
macos* | darwin[6-9]* | darwin[1-9][0-9]*)
|
||||
# On Mac OS X 10.2 or newer, just assume the same as when cross-
|
||||
# compiling. If we were to perform the real test, 1 Crash Report
|
||||
# dialog window would pop up.
|
||||
case "$host_cpu" in
|
||||
i[34567]86 | x86_64)
|
||||
gt_cv_int_divbyzero_sigfpe="guessing yes" ;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
changequote([,])dnl
|
||||
if test -z "$gt_cv_int_divbyzero_sigfpe"; then
|
||||
AC_RUN_IFELSE(
|
||||
[AC_LANG_SOURCE([[
|
||||
#include <stdlib.h>
|
||||
#include <signal.h>
|
||||
|
||||
static void
|
||||
sigfpe_handler (int sig)
|
||||
{
|
||||
/* Exit with code 0 if SIGFPE, with code 1 if any other signal. */
|
||||
exit (sig != SIGFPE);
|
||||
}
|
||||
|
||||
int x = 1;
|
||||
int y = 0;
|
||||
int z;
|
||||
int nan;
|
||||
|
||||
int main ()
|
||||
{
|
||||
signal (SIGFPE, sigfpe_handler);
|
||||
/* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */
|
||||
#if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
|
||||
signal (SIGTRAP, sigfpe_handler);
|
||||
#endif
|
||||
/* Linux/SPARC yields signal SIGILL. */
|
||||
#if defined (__sparc__) && defined (__linux__)
|
||||
signal (SIGILL, sigfpe_handler);
|
||||
#endif
|
||||
|
||||
z = x / y;
|
||||
nan = y / y;
|
||||
exit (2);
|
||||
}
|
||||
]])],
|
||||
[gt_cv_int_divbyzero_sigfpe=yes],
|
||||
[gt_cv_int_divbyzero_sigfpe=no],
|
||||
[
|
||||
# Guess based on the CPU.
|
||||
changequote(,)dnl
|
||||
case "$host_cpu" in
|
||||
alpha* | i[34567]86 | x86_64 | m68k | s390*)
|
||||
gt_cv_int_divbyzero_sigfpe="guessing yes";;
|
||||
*)
|
||||
gt_cv_int_divbyzero_sigfpe="guessing no";;
|
||||
esac
|
||||
changequote([,])dnl
|
||||
])
|
||||
fi
|
||||
])
|
||||
case "$gt_cv_int_divbyzero_sigfpe" in
|
||||
*yes) value=1;;
|
||||
*) value=0;;
|
||||
esac
|
||||
AC_DEFINE_UNQUOTED([INTDIV0_RAISES_SIGFPE], [$value],
|
||||
[Define if integer division by zero raises signal SIGFPE.])
|
||||
])
|
||||
@@ -0,0 +1,298 @@
|
||||
# intl.m4 serial 28 (gettext-0.19)
|
||||
dnl Copyright (C) 1995-2014 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
dnl
|
||||
dnl This file can can be used in projects which are not available under
|
||||
dnl the GNU General Public License or the GNU Library General Public
|
||||
dnl License but which still want to provide support for the GNU gettext
|
||||
dnl functionality.
|
||||
dnl Please note that the actual code of the GNU gettext library is covered
|
||||
dnl by the GNU Library General Public License, and the rest of the GNU
|
||||
dnl gettext package package is covered by the GNU General Public License.
|
||||
dnl They are *not* in the public domain.
|
||||
|
||||
dnl Authors:
|
||||
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
|
||||
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2009.
|
||||
|
||||
AC_PREREQ([2.60])
|
||||
|
||||
dnl Checks for all prerequisites of the intl subdirectory,
|
||||
dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
|
||||
dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
|
||||
AC_DEFUN([AM_INTL_SUBDIR],
|
||||
[
|
||||
AC_REQUIRE([AC_PROG_INSTALL])dnl
|
||||
AC_REQUIRE([AC_PROG_MKDIR_P])dnl
|
||||
AC_REQUIRE([AC_PROG_CC])dnl
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
||||
AC_REQUIRE([gt_GLIBC2])dnl
|
||||
AC_REQUIRE([AC_PROG_RANLIB])dnl
|
||||
AC_REQUIRE([gl_VISIBILITY])dnl
|
||||
AC_REQUIRE([gt_INTL_SUBDIR_CORE])dnl
|
||||
AC_REQUIRE([AC_TYPE_LONG_LONG_INT])dnl
|
||||
AC_REQUIRE([gt_TYPE_WCHAR_T])dnl
|
||||
AC_REQUIRE([gt_TYPE_WINT_T])dnl
|
||||
AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
|
||||
AC_REQUIRE([gt_TYPE_INTMAX_T])
|
||||
AC_REQUIRE([gt_PRINTF_POSIX])
|
||||
AC_REQUIRE([gl_GLIBC21])dnl
|
||||
AC_REQUIRE([gl_XSIZE])dnl
|
||||
AC_REQUIRE([gl_FCNTL_O_FLAGS])dnl
|
||||
AC_REQUIRE([gt_INTL_MACOSX])dnl
|
||||
AC_REQUIRE([gl_EXTERN_INLINE])dnl
|
||||
AC_REQUIRE([gt_GL_ATTRIBUTE])dnl
|
||||
|
||||
dnl Support for automake's --enable-silent-rules.
|
||||
case "$enable_silent_rules" in
|
||||
yes) INTL_DEFAULT_VERBOSITY=0;;
|
||||
no) INTL_DEFAULT_VERBOSITY=1;;
|
||||
*) INTL_DEFAULT_VERBOSITY=1;;
|
||||
esac
|
||||
AC_SUBST([INTL_DEFAULT_VERBOSITY])
|
||||
|
||||
AC_CHECK_TYPE([ptrdiff_t], ,
|
||||
[AC_DEFINE([ptrdiff_t], [long],
|
||||
[Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
|
||||
])
|
||||
AC_CHECK_HEADERS([features.h stddef.h stdlib.h string.h])
|
||||
AC_CHECK_FUNCS([asprintf fwprintf newlocale putenv setenv setlocale \
|
||||
snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb])
|
||||
|
||||
dnl Use the _snprintf function only if it is declared (because on NetBSD it
|
||||
dnl is defined as a weak alias of snprintf; we prefer to use the latter).
|
||||
AC_CHECK_DECLS([_snprintf, _snwprintf], , , [#include <stdio.h>])
|
||||
|
||||
dnl Use the *_unlocked functions only if they are declared.
|
||||
dnl (because some of them were defined without being declared in Solaris
|
||||
dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
|
||||
dnl on Solaris 2.5.1 to run on Solaris 2.6).
|
||||
AC_CHECK_DECLS([getc_unlocked], , , [#include <stdio.h>])
|
||||
|
||||
case $gt_cv_func_printf_posix in
|
||||
*yes) HAVE_POSIX_PRINTF=1 ;;
|
||||
*) HAVE_POSIX_PRINTF=0 ;;
|
||||
esac
|
||||
AC_SUBST([HAVE_POSIX_PRINTF])
|
||||
if test "$ac_cv_func_asprintf" = yes; then
|
||||
HAVE_ASPRINTF=1
|
||||
else
|
||||
HAVE_ASPRINTF=0
|
||||
fi
|
||||
AC_SUBST([HAVE_ASPRINTF])
|
||||
if test "$ac_cv_func_snprintf" = yes; then
|
||||
HAVE_SNPRINTF=1
|
||||
else
|
||||
HAVE_SNPRINTF=0
|
||||
fi
|
||||
AC_SUBST([HAVE_SNPRINTF])
|
||||
if test "$ac_cv_func_newlocale" = yes; then
|
||||
HAVE_NEWLOCALE=1
|
||||
else
|
||||
HAVE_NEWLOCALE=0
|
||||
fi
|
||||
AC_SUBST([HAVE_NEWLOCALE])
|
||||
if test "$ac_cv_func_wprintf" = yes; then
|
||||
HAVE_WPRINTF=1
|
||||
else
|
||||
HAVE_WPRINTF=0
|
||||
fi
|
||||
AC_SUBST([HAVE_WPRINTF])
|
||||
|
||||
AM_LANGINFO_CODESET
|
||||
gt_LC_MESSAGES
|
||||
|
||||
dnl Compilation on mingw and Cygwin needs special Makefile rules, because
|
||||
dnl 1. when we install a shared library, we must arrange to export
|
||||
dnl auxiliary pointer variables for every exported variable,
|
||||
dnl 2. when we install a shared library and a static library simultaneously,
|
||||
dnl the include file specifies __declspec(dllimport) and therefore we
|
||||
dnl must arrange to define the auxiliary pointer variables for the
|
||||
dnl exported variables _also_ in the static library.
|
||||
if test "$enable_shared" = yes; then
|
||||
case "$host_os" in
|
||||
mingw* | cygwin*) is_woe32dll=yes ;;
|
||||
*) is_woe32dll=no ;;
|
||||
esac
|
||||
else
|
||||
is_woe32dll=no
|
||||
fi
|
||||
WOE32DLL=$is_woe32dll
|
||||
AC_SUBST([WOE32DLL])
|
||||
|
||||
dnl On mingw and Cygwin, we can activate special Makefile rules which add
|
||||
dnl version information to the shared libraries and executables.
|
||||
case "$host_os" in
|
||||
mingw* | cygwin*) is_woe32=yes ;;
|
||||
*) is_woe32=no ;;
|
||||
esac
|
||||
WOE32=$is_woe32
|
||||
AC_SUBST([WOE32])
|
||||
if test $WOE32 = yes; then
|
||||
dnl Check for a program that compiles Windows resource files.
|
||||
AC_CHECK_TOOL([WINDRES], [windres])
|
||||
fi
|
||||
|
||||
dnl Determine whether when creating a library, "-lc" should be passed to
|
||||
dnl libtool or not. On many platforms, it is required for the libtool option
|
||||
dnl -no-undefined to work. On HP-UX, however, the -lc - stored by libtool
|
||||
dnl in the *.la files - makes it impossible to create multithreaded programs,
|
||||
dnl because libtool also reorders the -lc to come before the -pthread, and
|
||||
dnl this disables pthread_create() <http://docs.hp.com/en/1896/pthreads.html>.
|
||||
case "$host_os" in
|
||||
hpux*) LTLIBC="" ;;
|
||||
*) LTLIBC="-lc" ;;
|
||||
esac
|
||||
AC_SUBST([LTLIBC])
|
||||
|
||||
dnl Rename some macros and functions used for locking.
|
||||
AH_BOTTOM([
|
||||
#define __libc_lock_t gl_lock_t
|
||||
#define __libc_lock_define gl_lock_define
|
||||
#define __libc_lock_define_initialized gl_lock_define_initialized
|
||||
#define __libc_lock_init gl_lock_init
|
||||
#define __libc_lock_lock gl_lock_lock
|
||||
#define __libc_lock_unlock gl_lock_unlock
|
||||
#define __libc_lock_recursive_t gl_recursive_lock_t
|
||||
#define __libc_lock_define_recursive gl_recursive_lock_define
|
||||
#define __libc_lock_define_initialized_recursive gl_recursive_lock_define_initialized
|
||||
#define __libc_lock_init_recursive gl_recursive_lock_init
|
||||
#define __libc_lock_lock_recursive gl_recursive_lock_lock
|
||||
#define __libc_lock_unlock_recursive gl_recursive_lock_unlock
|
||||
#define glthread_in_use libintl_thread_in_use
|
||||
#define glthread_lock_init_func libintl_lock_init_func
|
||||
#define glthread_lock_lock_func libintl_lock_lock_func
|
||||
#define glthread_lock_unlock_func libintl_lock_unlock_func
|
||||
#define glthread_lock_destroy_func libintl_lock_destroy_func
|
||||
#define glthread_rwlock_init_multithreaded libintl_rwlock_init_multithreaded
|
||||
#define glthread_rwlock_init_func libintl_rwlock_init_func
|
||||
#define glthread_rwlock_rdlock_multithreaded libintl_rwlock_rdlock_multithreaded
|
||||
#define glthread_rwlock_rdlock_func libintl_rwlock_rdlock_func
|
||||
#define glthread_rwlock_wrlock_multithreaded libintl_rwlock_wrlock_multithreaded
|
||||
#define glthread_rwlock_wrlock_func libintl_rwlock_wrlock_func
|
||||
#define glthread_rwlock_unlock_multithreaded libintl_rwlock_unlock_multithreaded
|
||||
#define glthread_rwlock_unlock_func libintl_rwlock_unlock_func
|
||||
#define glthread_rwlock_destroy_multithreaded libintl_rwlock_destroy_multithreaded
|
||||
#define glthread_rwlock_destroy_func libintl_rwlock_destroy_func
|
||||
#define glthread_recursive_lock_init_multithreaded libintl_recursive_lock_init_multithreaded
|
||||
#define glthread_recursive_lock_init_func libintl_recursive_lock_init_func
|
||||
#define glthread_recursive_lock_lock_multithreaded libintl_recursive_lock_lock_multithreaded
|
||||
#define glthread_recursive_lock_lock_func libintl_recursive_lock_lock_func
|
||||
#define glthread_recursive_lock_unlock_multithreaded libintl_recursive_lock_unlock_multithreaded
|
||||
#define glthread_recursive_lock_unlock_func libintl_recursive_lock_unlock_func
|
||||
#define glthread_recursive_lock_destroy_multithreaded libintl_recursive_lock_destroy_multithreaded
|
||||
#define glthread_recursive_lock_destroy_func libintl_recursive_lock_destroy_func
|
||||
#define glthread_once_func libintl_once_func
|
||||
#define glthread_once_singlethreaded libintl_once_singlethreaded
|
||||
#define glthread_once_multithreaded libintl_once_multithreaded
|
||||
])
|
||||
])
|
||||
|
||||
|
||||
dnl Checks for the core files of the intl subdirectory:
|
||||
dnl dcigettext.c
|
||||
dnl eval-plural.h
|
||||
dnl explodename.c
|
||||
dnl finddomain.c
|
||||
dnl gettextP.h
|
||||
dnl gmo.h
|
||||
dnl hash-string.h hash-string.c
|
||||
dnl l10nflist.c
|
||||
dnl libgnuintl.h.in (except the *printf stuff)
|
||||
dnl loadinfo.h
|
||||
dnl loadmsgcat.c
|
||||
dnl localealias.c
|
||||
dnl log.c
|
||||
dnl plural-exp.h plural-exp.c
|
||||
dnl plural.y
|
||||
dnl Used by libglocale.
|
||||
AC_DEFUN([gt_INTL_SUBDIR_CORE],
|
||||
[
|
||||
AC_REQUIRE([AC_C_INLINE])dnl
|
||||
AC_REQUIRE([AC_TYPE_SIZE_T])dnl
|
||||
AC_REQUIRE([gl_AC_HEADER_STDINT_H])
|
||||
AC_REQUIRE([AC_FUNC_ALLOCA])dnl
|
||||
AC_REQUIRE([AC_FUNC_MMAP])dnl
|
||||
AC_REQUIRE([gt_INTDIV0])dnl
|
||||
AC_REQUIRE([gl_AC_TYPE_UINTMAX_T])dnl
|
||||
AC_REQUIRE([gt_INTTYPES_PRI])dnl
|
||||
AC_REQUIRE([gl_LOCK])dnl
|
||||
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[int foo (int a) { a = __builtin_expect (a, 10); return a == 10 ? 0 : 1; }]],
|
||||
[[]])],
|
||||
[AC_DEFINE([HAVE_BUILTIN_EXPECT], [1],
|
||||
[Define to 1 if the compiler understands __builtin_expect.])])
|
||||
|
||||
AC_CHECK_HEADERS([argz.h inttypes.h limits.h unistd.h sys/param.h])
|
||||
AC_CHECK_FUNCS([getcwd getegid geteuid getgid getuid mempcpy munmap \
|
||||
stpcpy strcasecmp strdup strtoul tsearch uselocale argz_count \
|
||||
argz_stringify argz_next __fsetlocking])
|
||||
|
||||
dnl Use the *_unlocked functions only if they are declared.
|
||||
dnl (because some of them were defined without being declared in Solaris
|
||||
dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
|
||||
dnl on Solaris 2.5.1 to run on Solaris 2.6).
|
||||
AC_CHECK_DECLS([feof_unlocked, fgets_unlocked], , , [#include <stdio.h>])
|
||||
|
||||
AM_ICONV
|
||||
|
||||
dnl intl/plural.c is generated from intl/plural.y. It requires bison,
|
||||
dnl because plural.y uses bison specific features. It requires at least
|
||||
dnl bison-2.7 for %define api.pure.
|
||||
dnl bison is only needed for the maintainer (who touches plural.y). But in
|
||||
dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
|
||||
dnl the rule in general Makefile. Now, some people carelessly touch the
|
||||
dnl files or have a broken "make" program, hence the plural.c rule will
|
||||
dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
|
||||
dnl present or too old.
|
||||
AC_CHECK_PROGS([INTLBISON], [bison])
|
||||
if test -z "$INTLBISON"; then
|
||||
ac_verc_fail=yes
|
||||
else
|
||||
dnl Found it, now check the version.
|
||||
AC_MSG_CHECKING([version of bison])
|
||||
changequote(<<,>>)dnl
|
||||
ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
|
||||
case $ac_prog_version in
|
||||
'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
|
||||
2.[7-9]* | [3-9].*)
|
||||
changequote([,])dnl
|
||||
ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
|
||||
*) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
|
||||
esac
|
||||
AC_MSG_RESULT([$ac_prog_version])
|
||||
fi
|
||||
if test $ac_verc_fail = yes; then
|
||||
INTLBISON=:
|
||||
fi
|
||||
])
|
||||
|
||||
dnl Copies _GL_UNUSED and _GL_ATTRIBUTE_PURE definitions from
|
||||
dnl gnulib-common.m4 as a fallback, if the project isn't using Gnulib.
|
||||
AC_DEFUN([gt_GL_ATTRIBUTE], [
|
||||
m4_ifndef([gl_[]COMMON],
|
||||
AH_VERBATIM([gt_gl_attribute],
|
||||
[/* Define as a marker that can be attached to declarations that might not
|
||||
be used. This helps to reduce warnings, such as from
|
||||
GCC -Wunused-parameter. */
|
||||
#ifndef _GL_UNUSED
|
||||
# if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
|
||||
# define _GL_UNUSED __attribute__ ((__unused__))
|
||||
# else
|
||||
# define _GL_UNUSED
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* The __pure__ attribute was added in gcc 2.96. */
|
||||
#ifndef _GL_ATTRIBUTE_PURE
|
||||
# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
|
||||
# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
|
||||
# else
|
||||
# define _GL_ATTRIBUTE_PURE /* empty */
|
||||
# endif
|
||||
#endif
|
||||
]))])
|
||||
@@ -0,0 +1,19 @@
|
||||
# intldir.m4 serial 2 (gettext-0.18)
|
||||
dnl Copyright (C) 2006, 2009-2014 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
dnl
|
||||
dnl This file can can be used in projects which are not available under
|
||||
dnl the GNU General Public License or the GNU Library General Public
|
||||
dnl License but which still want to provide support for the GNU gettext
|
||||
dnl functionality.
|
||||
dnl Please note that the actual code of the GNU gettext library is covered
|
||||
dnl by the GNU Library General Public License, and the rest of the GNU
|
||||
dnl gettext package package is covered by the GNU General Public License.
|
||||
dnl They are *not* in the public domain.
|
||||
|
||||
AC_PREREQ([2.52])
|
||||
|
||||
dnl Tells the AM_GNU_GETTEXT macro to consider an intl/ directory.
|
||||
AC_DEFUN([AM_GNU_GETTEXT_INTL_SUBDIR], [])
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user