2006-11-28 05:35:37 +08:00
|
|
|
# Make Autoconf commands.
|
2001-08-01 23:11:04 +08:00
|
|
|
|
2024-01-06 01:11:48 +08:00
|
|
|
# Copyright (C) 1999-2007, 2009-2017, 2020-2024 Free Software
|
2021-01-29 04:19:21 +08:00
|
|
|
# Foundation, Inc.
|
2004-01-05 16:18:24 +08:00
|
|
|
|
2007-07-21 07:11:49 +08:00
|
|
|
# This program is free software: you can redistribute it and/or modify
|
2006-11-28 05:35:37 +08:00
|
|
|
# it under the terms of the GNU General Public License as published by
|
2007-07-21 07:11:49 +08:00
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
2001-08-01 23:11:04 +08:00
|
|
|
|
2006-11-28 05:35:37 +08:00
|
|
|
# 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.
|
2001-08-01 23:11:04 +08:00
|
|
|
|
2006-11-28 05:35:37 +08:00
|
|
|
# You should have received a copy of the GNU General Public License
|
2017-09-17 08:48:19 +08:00
|
|
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2001-08-01 23:11:04 +08:00
|
|
|
|
2013-05-05 22:40:10 +08:00
|
|
|
bin_SCRIPTS = \
|
|
|
|
bin/autoconf \
|
|
|
|
bin/autoheader \
|
|
|
|
bin/autom4te \
|
|
|
|
bin/autoreconf \
|
|
|
|
bin/autoscan \
|
|
|
|
bin/autoupdate \
|
|
|
|
bin/ifnames
|
|
|
|
|
|
|
|
EXTRA_DIST += \
|
Rewrite bin/autoconf in Perl.
Of all the installed programs (autoconf, autoheader, autom4te,
autoreconf, autoscan, autoupdate, ifnames) autoconf is the only one
that is a shell script instead of a Perl script. This means it has to
do a lot of fiddly quoting and requoting to assemble an autom4te
command line, it doesn’t get to use the shared option handling code in
Autom4te/{General,Getopt}.pm, and it has to duplicate usage text that
properly should only be in Autom4te/ChannelDefs.pm. It also means
there’s extra code in build-aux/help-extract.pl just for it, and a
special two-phase generation process in bin/local.mk.
This also paves the way for the bootstrap script mentioned in the
previous commit; it will only have to know how to deal with
substitution variables, not generation of m4sh scripts.
The new script winds up being slightly longer on disk but that’s
because our boilerplate for Perl scripts is quite long. The code is
visibly simpler.
* bin/autoconf.as: Rename to bin/autoconf.in and rewrite in Perl.
* bin/local.mk (EXTRA_DIST): Change autoconf.as to autoconf.in.
(MOSTLYCLEANFILES): Don’t delete autoconf.in.
(bin/autoconf.in): Delete rule.
(ETAGS_PERL): Add autoconf.in and sort list.
(ETAGS_SH): Delete, no longer needed.
* tests/tools.at: Syntax-check autoconf as a Perl script.
* build-aux/help-extract.pl: Remove all code for extracting usage text
from shell scripts.
* man/autoconf.w, man/local.mk: Refer to autoconf.in, not autoconf.as.
2021-02-05 00:14:37 +08:00
|
|
|
bin/autoconf.in \
|
2013-05-05 22:40:10 +08:00
|
|
|
bin/autoheader.in \
|
|
|
|
bin/autom4te.in \
|
|
|
|
bin/autoreconf.in \
|
|
|
|
bin/autoscan.in \
|
|
|
|
bin/autoupdate.in \
|
|
|
|
bin/ifnames.in
|
2001-08-01 23:11:04 +08:00
|
|
|
|
|
|
|
# Files that should be removed, but which Automake does not know.
|
Rewrite bin/autoconf in Perl.
Of all the installed programs (autoconf, autoheader, autom4te,
autoreconf, autoscan, autoupdate, ifnames) autoconf is the only one
that is a shell script instead of a Perl script. This means it has to
do a lot of fiddly quoting and requoting to assemble an autom4te
command line, it doesn’t get to use the shared option handling code in
Autom4te/{General,Getopt}.pm, and it has to duplicate usage text that
properly should only be in Autom4te/ChannelDefs.pm. It also means
there’s extra code in build-aux/help-extract.pl just for it, and a
special two-phase generation process in bin/local.mk.
This also paves the way for the bootstrap script mentioned in the
previous commit; it will only have to know how to deal with
substitution variables, not generation of m4sh scripts.
The new script winds up being slightly longer on disk but that’s
because our boilerplate for Perl scripts is quite long. The code is
visibly simpler.
* bin/autoconf.as: Rename to bin/autoconf.in and rewrite in Perl.
* bin/local.mk (EXTRA_DIST): Change autoconf.as to autoconf.in.
(MOSTLYCLEANFILES): Don’t delete autoconf.in.
(bin/autoconf.in): Delete rule.
(ETAGS_PERL): Add autoconf.in and sort list.
(ETAGS_SH): Delete, no longer needed.
* tests/tools.at: Syntax-check autoconf as a Perl script.
* build-aux/help-extract.pl: Remove all code for extracting usage text
from shell scripts.
* man/autoconf.w, man/local.mk: Refer to autoconf.in, not autoconf.as.
2021-02-05 00:14:37 +08:00
|
|
|
MOSTLYCLEANFILES += $(bin_SCRIPTS) bin/*.tmp
|
2001-08-01 23:11:04 +08:00
|
|
|
|
|
|
|
## ------------- ##
|
|
|
|
## The scripts. ##
|
|
|
|
## ------------- ##
|
|
|
|
|
2005-05-24 14:14:27 +08:00
|
|
|
## All the scripts depend on Makefile so that they are rebuilt when the
|
|
|
|
## prefix etc. changes. It took quite a while to have the rule correct,
|
|
|
|
## don't break it!
|
2003-09-25 17:30:34 +08:00
|
|
|
## Use chmod -w to prevent people from editing the wrong file by accident.
|
2005-05-24 14:14:27 +08:00
|
|
|
$(bin_SCRIPTS): Makefile
|
2004-12-11 07:56:45 +08:00
|
|
|
rm -f $@ $@.tmp
|
2013-05-05 22:40:10 +08:00
|
|
|
$(MKDIR_P) $(@D)
|
'echo' has some portability problems, when given a first argument
with a leading '-', or when given any argument containing '\'.
Avoid using 'echo' in these cases.
* bin/Makefile.am $(bin_SCRIPTS): Rewrite to avoid 'echo' entirely.
* lib/autoconf/c.m4 (AC_PROG_CC, AC_PROG_CXX, AC_PROG_OBJC): Likewise.
* lib/autoconf/fortran.m4 (_AC_PROG_FC): Likewise.
* lib/autotest/general.m4 (AT_INIT): Likewise.
* bin/autoconf.as: Use AS_ECHO rather than plain echo, when the
argument might be unportable.
* lib/autoconf/c.m4 (AC_PROG_CC_C_O): Likewise.
* lib/autoconf/erlang.m4 (AC_LANG(Erlang)): Likewise.
* lib/autoconf/fortran.m4 (_AC_PROG_FC_V_OUTPUT):
(_AC_FC_LIBRARY_LDFLAGS): Likewise.
* lib/autoconf/functions.m4 (AC_FUNC_GETLOADAVG): Likewise.
* lib/autoconf/general.m4 (_AC_INIT_PARSE_ENABLE, _AC_INIT_PREPARE):
(_AC_ARG_VAR_VALIDATE, AC_ARG_PROGRAM, _AC_MSG_LOG_CONFTEST):
(AC_RUN_LOG, _AC_RUN_IFELSE, _AC_LIBOBJS_NORMALIZE): Likewise.
* lib/autoconf/lang.m4 (_AC_COMPILER_EXEEXT_DEFAULT): Likewise.
* lib/autoconf/libs.m4 (_AC_PATH_X_DIRECT): Likewise.
* lib/autoconf/programs.m4 (_AC_FEATURE_CHECK_LENGTH):
(AC_PROG_MAKE_SET): Likewise.
* lib/autoconf/status.m4 (_AC_SRCDIRS, _AC_OUTPUT_HEADER):
(_AC_OUTPUT_SUBDIRS, _AC_OUTPUT_CONFIG_STATUS): Likewise.
* lib/autotest/general.m4 (_AT_CREATE_DEBUGGING_SCRIPT, AT_INIT):
(AT_CLEANUP, _AT_DECIDE_TRACEABLE, _AT_CHECK): Likewise.
* lib/m4sugar/m4sh.m4 (AS_SHELL_SANITIZE, _AS_ECHO_UNQUOTED):
(_AS_BASENAME_SED, _AS_DIRNAME_SED, AS_MKDIR_P, AS_TMPDIR, AS_UNAME):
(AS_TR_SH, AS_TR_CPP, AS_VAR_GET): Likewise.
* bin/autoconf.as: Redo verbose flag implementation, as the old
scheme wouldn't work with AS_ECHO.
* lib/autotest/general.m4 (AT_INIT): Likewise.
* lib/autoconf/general.m4 (AC_MSG_RESULT, AC_MSG_RESULT_UNQUOTED):
Don't use ECHO_T, since ECHO_N is now reliable.
* lib/autotest/general.m4 (AT_INIT): Likewise.
* lib/autoconf/general.m4 (AC_ARG_PROGRAM): Use sed "$script"
rather than using a here-document to put the script into a file.
(_AC_DO_ECHO): Hoist the eval out of the echo, so that we can
use AS_ECHO.
* lib/m4sugar/m4sh.m4 (AS_VAR_GET): Likewise.
* lib/autoconf/programs.m4 (_AC_FEATURE_CHECK_LENGTH): Use
AS_ECHO_N rather than ECHO_N and ECHO_C. This doesn't fix any
bug, but we might as well stop using ECHO_N and ECHO_C internally.
* lib/autotest/general.m4 (AT_SETUP): Likewise.
* lib/m4sugar/m4sh.m4 (_AS_ECHO_N): Likewise.
* lib/autoconf/status.m4 (_AC_OUTPUT_CONFIG_STATUS):
(_AC_OUTPUT_MAIN_LOOP): Rework echo so that it has just one
operand, as AS_ECHO requires. Avoid double file name expansion.
* lib/m4sugar/m4sh.m4 (AS_SHELL_SANITIZE): Invoke _AS_ECHO_PREPARE.
Don't set as_nl, since _AS_ECHO_PREPARE does that now.
(_AS_PREPARE): Comment that _AS_ECHO_N_PREPARE is just for user code.
(AS_ECHO, AS_ECHO_N, _AS_ECHO_PREPARE): New macros.
* tests/c.at (AC_PROG_CPP without warnings, AC_PROG_CPP via CC):
Double-quote strings that would otherwise contain M4 comments.
* tests/m4sh.at (AS_ECHO and AS_ECHO_N): New test.
2006-11-18 05:04:54 +08:00
|
|
|
srcdir=''; \
|
|
|
|
test -f ./$@.in || srcdir=$(srcdir)/; \
|
|
|
|
$(edit) $${srcdir}$@.in >$@.tmp
|
2004-12-11 07:56:45 +08:00
|
|
|
chmod +x $@.tmp
|
|
|
|
chmod a-w $@.tmp
|
|
|
|
mv $@.tmp $@
|
|
|
|
|
2013-05-05 22:40:10 +08:00
|
|
|
bin/autoconf: bin/autoconf.in
|
|
|
|
bin/autoheader: $(srcdir)/bin/autoheader.in
|
|
|
|
bin/autom4te: $(srcdir)/bin/autom4te.in
|
|
|
|
bin/autoreconf: $(srcdir)/bin/autoreconf.in
|
|
|
|
bin/autoscan: $(srcdir)/bin/autoscan.in
|
|
|
|
bin/autoupdate: $(srcdir)/bin/autoupdate.in
|
|
|
|
bin/ifnames: $(srcdir)/bin/ifnames.in
|
2001-08-17 20:06:44 +08:00
|
|
|
|
|
|
|
|
|
|
|
## --------------- ##
|
|
|
|
## Building TAGS. ##
|
|
|
|
## --------------- ##
|
|
|
|
|
|
|
|
TAGS_DEPENDENCIES = $(EXTRA_DIST)
|
|
|
|
|
2001-09-24 01:16:43 +08:00
|
|
|
letters = abcdefghijklmnopqrstuvwxyz
|
|
|
|
LETTERS = ABCDEFGHIJKLMNOPQRSTUVWXYZ
|
|
|
|
DIGITS = 0123456789
|
|
|
|
WORD_REGEXP = [$(LETTERS)$(letters)_][$(LETTERS)$(letters)$(DIGITS)_]*
|
2001-08-17 20:06:44 +08:00
|
|
|
ETAGS_PERL = --lang=perl \
|
Rewrite bin/autoconf in Perl.
Of all the installed programs (autoconf, autoheader, autom4te,
autoreconf, autoscan, autoupdate, ifnames) autoconf is the only one
that is a shell script instead of a Perl script. This means it has to
do a lot of fiddly quoting and requoting to assemble an autom4te
command line, it doesn’t get to use the shared option handling code in
Autom4te/{General,Getopt}.pm, and it has to duplicate usage text that
properly should only be in Autom4te/ChannelDefs.pm. It also means
there’s extra code in build-aux/help-extract.pl just for it, and a
special two-phase generation process in bin/local.mk.
This also paves the way for the bootstrap script mentioned in the
previous commit; it will only have to know how to deal with
substitution variables, not generation of m4sh scripts.
The new script winds up being slightly longer on disk but that’s
because our boilerplate for Perl scripts is quite long. The code is
visibly simpler.
* bin/autoconf.as: Rename to bin/autoconf.in and rewrite in Perl.
* bin/local.mk (EXTRA_DIST): Change autoconf.as to autoconf.in.
(MOSTLYCLEANFILES): Don’t delete autoconf.in.
(bin/autoconf.in): Delete rule.
(ETAGS_PERL): Add autoconf.in and sort list.
(ETAGS_SH): Delete, no longer needed.
* tests/tools.at: Syntax-check autoconf as a Perl script.
* build-aux/help-extract.pl: Remove all code for extracting usage text
from shell scripts.
* man/autoconf.w, man/local.mk: Refer to autoconf.in, not autoconf.as.
2021-02-05 00:14:37 +08:00
|
|
|
bin/autoconf.in \
|
2013-05-05 22:40:10 +08:00
|
|
|
bin/autoheader.in \
|
Rewrite bin/autoconf in Perl.
Of all the installed programs (autoconf, autoheader, autom4te,
autoreconf, autoscan, autoupdate, ifnames) autoconf is the only one
that is a shell script instead of a Perl script. This means it has to
do a lot of fiddly quoting and requoting to assemble an autom4te
command line, it doesn’t get to use the shared option handling code in
Autom4te/{General,Getopt}.pm, and it has to duplicate usage text that
properly should only be in Autom4te/ChannelDefs.pm. It also means
there’s extra code in build-aux/help-extract.pl just for it, and a
special two-phase generation process in bin/local.mk.
This also paves the way for the bootstrap script mentioned in the
previous commit; it will only have to know how to deal with
substitution variables, not generation of m4sh scripts.
The new script winds up being slightly longer on disk but that’s
because our boilerplate for Perl scripts is quite long. The code is
visibly simpler.
* bin/autoconf.as: Rename to bin/autoconf.in and rewrite in Perl.
* bin/local.mk (EXTRA_DIST): Change autoconf.as to autoconf.in.
(MOSTLYCLEANFILES): Don’t delete autoconf.in.
(bin/autoconf.in): Delete rule.
(ETAGS_PERL): Add autoconf.in and sort list.
(ETAGS_SH): Delete, no longer needed.
* tests/tools.at: Syntax-check autoconf as a Perl script.
* build-aux/help-extract.pl: Remove all code for extracting usage text
from shell scripts.
* man/autoconf.w, man/local.mk: Refer to autoconf.in, not autoconf.as.
2021-02-05 00:14:37 +08:00
|
|
|
bin/autom4te.in \
|
2013-05-05 22:40:10 +08:00
|
|
|
bin/autoreconf.in \
|
|
|
|
bin/autoscan.in \
|
Rewrite bin/autoconf in Perl.
Of all the installed programs (autoconf, autoheader, autom4te,
autoreconf, autoscan, autoupdate, ifnames) autoconf is the only one
that is a shell script instead of a Perl script. This means it has to
do a lot of fiddly quoting and requoting to assemble an autom4te
command line, it doesn’t get to use the shared option handling code in
Autom4te/{General,Getopt}.pm, and it has to duplicate usage text that
properly should only be in Autom4te/ChannelDefs.pm. It also means
there’s extra code in build-aux/help-extract.pl just for it, and a
special two-phase generation process in bin/local.mk.
This also paves the way for the bootstrap script mentioned in the
previous commit; it will only have to know how to deal with
substitution variables, not generation of m4sh scripts.
The new script winds up being slightly longer on disk but that’s
because our boilerplate for Perl scripts is quite long. The code is
visibly simpler.
* bin/autoconf.as: Rename to bin/autoconf.in and rewrite in Perl.
* bin/local.mk (EXTRA_DIST): Change autoconf.as to autoconf.in.
(MOSTLYCLEANFILES): Don’t delete autoconf.in.
(bin/autoconf.in): Delete rule.
(ETAGS_PERL): Add autoconf.in and sort list.
(ETAGS_SH): Delete, no longer needed.
* tests/tools.at: Syntax-check autoconf as a Perl script.
* build-aux/help-extract.pl: Remove all code for extracting usage text
from shell scripts.
* man/autoconf.w, man/local.mk: Refer to autoconf.in, not autoconf.as.
2021-02-05 00:14:37 +08:00
|
|
|
bin/autoupdate.in \
|
2013-05-05 22:40:10 +08:00
|
|
|
bin/ifnames.in
|
2001-08-17 20:06:44 +08:00
|
|
|
|
Rewrite bin/autoconf in Perl.
Of all the installed programs (autoconf, autoheader, autom4te,
autoreconf, autoscan, autoupdate, ifnames) autoconf is the only one
that is a shell script instead of a Perl script. This means it has to
do a lot of fiddly quoting and requoting to assemble an autom4te
command line, it doesn’t get to use the shared option handling code in
Autom4te/{General,Getopt}.pm, and it has to duplicate usage text that
properly should only be in Autom4te/ChannelDefs.pm. It also means
there’s extra code in build-aux/help-extract.pl just for it, and a
special two-phase generation process in bin/local.mk.
This also paves the way for the bootstrap script mentioned in the
previous commit; it will only have to know how to deal with
substitution variables, not generation of m4sh scripts.
The new script winds up being slightly longer on disk but that’s
because our boilerplate for Perl scripts is quite long. The code is
visibly simpler.
* bin/autoconf.as: Rename to bin/autoconf.in and rewrite in Perl.
* bin/local.mk (EXTRA_DIST): Change autoconf.as to autoconf.in.
(MOSTLYCLEANFILES): Don’t delete autoconf.in.
(bin/autoconf.in): Delete rule.
(ETAGS_PERL): Add autoconf.in and sort list.
(ETAGS_SH): Delete, no longer needed.
* tests/tools.at: Syntax-check autoconf as a Perl script.
* build-aux/help-extract.pl: Remove all code for extracting usage text
from shell scripts.
* man/autoconf.w, man/local.mk: Refer to autoconf.in, not autoconf.as.
2021-02-05 00:14:37 +08:00
|
|
|
ETAGS_ARGS += $(ETAGS_PERL)
|