Copying autoconf 2.59 into the trunk.

git-svn-id: file:///srv/svn/repos/haiku/buildtools/trunk@15329 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2005-12-05 13:17:04 +00:00
parent e6c8d025f2
commit 77f19290fd
157 changed files with 124233 additions and 0 deletions

130
autoconf/bin/Makefile.am Normal file
View File

@@ -0,0 +1,130 @@
## Process this file with automake to create Makefile.in. -*-Makefile-*-
## Makefile for Autoconf.
## Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2, or (at your option)
## any later version.
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
## 02111-1307, USA.
include ../lib/freeze.mk
bin_SCRIPTS = autom4te \
autoconf autoheader autoreconf ifnames autoscan autoupdate
EXTRA_DIST = autoconf.in autoheader.in autoreconf.in autoupdate.in ifnames.in \
autoscan.in autom4te.in \
autoconf.as
# Files that should be removed, but which Automake does not know.
CLEANFILES = $(bin_SCRIPTS)
## ------------- ##
## The scripts. ##
## ------------- ##
edit = sed \
-e 's,@SHELL\@,$(SHELL),g' \
-e 's,@PERL\@,$(PERL),g' \
-e 's,@bindir\@,$(bindir),g' \
-e 's,@datadir\@,$(pkgdatadir),g' \
-e 's,@prefix\@,$(prefix),g' \
-e 's,@autoconf-name\@,'`echo autoconf | sed '$(transform)'`',g' \
-e 's,@autoheader-name\@,'`echo autoheader | sed '$(transform)'`',g' \
-e 's,@autom4te-name\@,'`echo autom4te | sed '$(transform)'`',g' \
-e 's,@M4\@,$(M4),g' \
-e 's,@AWK\@,$(AWK),g' \
-e 's,@VERSION\@,$(VERSION),g' \
-e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' \
-e 's,@configure_input\@,Generated from $<; do not edit by hand.,g'
# autoconf is written in M4sh.
AUTOM4SH = $(top_builddir)/tests/autom4te --language M4sh --cache ''
$(srcdir)/autoconf.in: $(srcdir)/autoconf.as # FIXME: $(m4sh_m4f_dependencies)
$(AUTOM4SH) $(srcdir)/autoconf.as -o $@
## All the files below depend on Makefile so that they are rebuilt
## when the prefix etc. changes. It took quite a while to have these
## rules correct, don't break them! In particular, we believe there is
## no solution to factor the code.
## Use chmod -w to prevent people from editing the wrong file by accident.
autoconf: $(srcdir)/autoconf.in Makefile
rm -f autoconf autoconf.tmp
$(edit) $(srcdir)/autoconf.in >autoconf.tmp
chmod +x autoconf.tmp
chmod -w autoconf.tmp
mv -f autoconf.tmp autoconf
autoheader: $(srcdir)/autoheader.in Makefile
rm -f autoheader autoheader.tmp
$(edit) $(srcdir)/autoheader.in >autoheader.tmp
chmod +x autoheader.tmp
chmod -w autoheader.tmp
mv -f autoheader.tmp autoheader
autom4te: $(srcdir)/autom4te.in Makefile
rm -f autom4te autom4te.tmp
$(edit) $(srcdir)/autom4te.in >autom4te.tmp
chmod +x autom4te.tmp
chmod -w autom4te.tmp
mv -f autom4te.tmp autom4te
autoreconf: $(srcdir)/autoreconf.in Makefile
rm -f autoreconf autoreconf.tmp
$(edit) $(srcdir)/autoreconf.in >autoreconf.tmp
chmod +x autoreconf.tmp
chmod -w autoreconf.tmp
mv -f autoreconf.tmp autoreconf
autoscan: $(srcdir)/autoscan.in Makefile
rm -f autoscan autoscan.tmp
$(edit) $(srcdir)/autoscan.in >autoscan.tmp
chmod +x autoscan.tmp
chmod -w autoscan.tmp
mv -f autoscan.tmp autoscan
autoupdate: $(srcdir)/autoupdate.in Makefile
rm -f autoupdate autoupdate.tmp
$(edit) $(srcdir)/autoupdate.in >autoupdate.tmp
chmod +x autoupdate.tmp
chmod -w autoupdate.tmp
mv -f autoupdate.tmp autoupdate
ifnames: $(srcdir)/ifnames.in Makefile
rm -f ifnames ifnames.tmp
$(edit) $(srcdir)/ifnames.in >ifnames.tmp
chmod +x ifnames.tmp
chmod -w ifnames.tmp
mv -f ifnames.tmp ifnames
## --------------- ##
## Building TAGS. ##
## --------------- ##
TAGS_DEPENDENCIES = $(EXTRA_DIST)
letters = abcdefghijklmnopqrstuvwxyz
LETTERS = ABCDEFGHIJKLMNOPQRSTUVWXYZ
DIGITS = 0123456789
WORD_REGEXP = [$(LETTERS)$(letters)_][$(LETTERS)$(letters)$(DIGITS)_]*
ETAGS_PERL = --lang=perl \
autoheader.in autoreconf.in autoupdate.in autoscan.in autom4te.in \
ifnames.in
ETAGS_SH = --lang=none --regex='/\($(WORD_REGEXP)\)=/\1/' \
autoconf.in
ETAGS_ARGS = $(ETAGS_PERL) $(ETAGS_SH)

519
autoconf/bin/Makefile.in Normal file
View File

@@ -0,0 +1,519 @@
# Makefile.in generated by automake 1.7a from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
# 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@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
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 = :
DIST_COMMON = $(srcdir)/../lib/freeze.mk $(srcdir)/Makefile.in \
Makefile.am
subdir = bin
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/config/m4.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
CONFIG_CLEAN_FILES =
am__installdirs = $(DESTDIR)$(bindir)
binSCRIPT_INSTALL = $(INSTALL_SCRIPT)
SCRIPTS = $(bin_SCRIPTS)
SOURCES =
DIST_SOURCES =
ETAGS = etags
ETAGSFLAGS =
CTAGS = ctags
CTAGSFLAGS =
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EMACS = @EMACS@
EMACSLOADPATH = @EMACSLOADPATH@
EXPR = @EXPR@
HELP2MAN = @HELP2MAN@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
M4 = @M4@
MAKEINFO = @MAKEINFO@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PERL = @PERL@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
TEST_EMACS = @TEST_EMACS@
VERSION = @VERSION@
ac_ct_STRIP = @ac_ct_STRIP@
am__leading_dot = @am__leading_dot@
bindir = @bindir@
build_alias = @build_alias@
datadir = @datadir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
lispdir = @lispdir@
localstatedir = @localstatedir@
mandir = @mandir@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
SUFFIXES = .m4 .m4f
# Do not use AUTOM4TE here, since Makefile.maint (my-distcheck)
# checks if we are independent of Autoconf by defining AUTOM4TE (and
# others) to `false'. But we _ship_ tests/autom4te, so it doesn't
# apply to us.
MY_AUTOM4TE = $(top_builddir)/tests/autom4te
AUTOM4TE_CFG = $(top_builddir)/lib/autom4te.cfg
# Factor the dependencies between all the frozen files.
# Some day we should explain to Automake how to use autom4te to compute
# the dependencies...
src_libdir = $(top_srcdir)/lib
build_libdir = $(top_builddir)/lib
m4f_dependencies = $(MY_AUTOM4TE) $(AUTOM4TE_CFG)
m4sugar_m4f_dependencies = \
$(m4f_dependencies) \
$(src_libdir)/m4sugar/m4sugar.m4 \
$(build_libdir)/m4sugar/version.m4
m4sh_m4f_dependencies = \
$(m4sugar_m4f_dependencies) \
$(src_libdir)/m4sugar/m4sh.m4
autotest_m4f_dependencies = \
$(m4sh_m4f_dependencies) \
$(src_libdir)/autotest/autotest.m4 \
$(src_libdir)/autotest/general.m4
autoconf_m4f_dependencies = \
$(m4sh_m4f_dependencies) \
$(src_libdir)/autoconf/autoscan.m4 \
$(src_libdir)/autoconf/general.m4 \
$(src_libdir)/autoconf/autoheader.m4 \
$(src_libdir)/autoconf/autoupdate.m4 \
$(src_libdir)/autoconf/autotest.m4 \
$(src_libdir)/autoconf/status.m4 \
$(src_libdir)/autoconf/oldnames.m4 \
$(src_libdir)/autoconf/specific.m4 \
$(src_libdir)/autoconf/lang.m4 \
$(src_libdir)/autoconf/c.m4 \
$(src_libdir)/autoconf/fortran.m4 \
$(src_libdir)/autoconf/functions.m4 \
$(src_libdir)/autoconf/headers.m4 \
$(src_libdir)/autoconf/types.m4 \
$(src_libdir)/autoconf/libs.m4 \
$(src_libdir)/autoconf/programs.m4 \
$(src_libdir)/autoconf/autoconf.m4
ETAGS_FOR_M4 = \
--lang=none \
--regex='/\(m4_define\|define\)(\[\([^]]*\)\]/\2/'
ETAGS_FOR_M4SUGAR = \
$(ETAGS_FOR_M4) \
--regex='/m4_defun(\[\([^]]*\)\]/\1/'
ETAGS_FOR_AUTOCONF = \
$(ETAGS_FOR_M4SUGAR) \
--regex='/\(A[CU]_DEFUN\|AU_ALIAS\)(\[\([^]]*\)\]/\2/' \
--regex='/AN_\(FUNCTION\|HEADER\|IDENTIFIER\|LIBRARY\|MAKEVAR\|PROGRAM\)(\[\([^]]*\)\]/\2/'
bin_SCRIPTS = autom4te \
autoconf autoheader autoreconf ifnames autoscan autoupdate
EXTRA_DIST = autoconf.in autoheader.in autoreconf.in autoupdate.in ifnames.in \
autoscan.in autom4te.in \
autoconf.as
# Files that should be removed, but which Automake does not know.
CLEANFILES = $(bin_SCRIPTS)
edit = sed \
-e 's,@SHELL\@,$(SHELL),g' \
-e 's,@PERL\@,$(PERL),g' \
-e 's,@bindir\@,$(bindir),g' \
-e 's,@datadir\@,$(pkgdatadir),g' \
-e 's,@prefix\@,$(prefix),g' \
-e 's,@autoconf-name\@,'`echo autoconf | sed '$(transform)'`',g' \
-e 's,@autoheader-name\@,'`echo autoheader | sed '$(transform)'`',g' \
-e 's,@autom4te-name\@,'`echo autom4te | sed '$(transform)'`',g' \
-e 's,@M4\@,$(M4),g' \
-e 's,@AWK\@,$(AWK),g' \
-e 's,@VERSION\@,$(VERSION),g' \
-e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' \
-e 's,@configure_input\@,Generated from $<; do not edit by hand.,g'
# autoconf is written in M4sh.
AUTOM4SH = $(top_builddir)/tests/autom4te --language M4sh --cache ''
TAGS_DEPENDENCIES = $(EXTRA_DIST)
letters = abcdefghijklmnopqrstuvwxyz
LETTERS = ABCDEFGHIJKLMNOPQRSTUVWXYZ
DIGITS = 0123456789
WORD_REGEXP = [$(LETTERS)$(letters)_][$(LETTERS)$(letters)$(DIGITS)_]*
ETAGS_PERL = --lang=perl \
autoheader.in autoreconf.in autoupdate.in autoscan.in autom4te.in \
ifnames.in
ETAGS_SH = --lang=none --regex='/\($(WORD_REGEXP)\)=/\1/' \
autoconf.in
ETAGS_ARGS = $(ETAGS_PERL) $(ETAGS_SH)
all: all-am
.SUFFIXES:
.SUFFIXES: .m4 .m4f
$(srcdir)/Makefile.in: Makefile.am $(srcdir)/../lib/freeze.mk $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu bin/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu bin/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__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
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
install-binSCRIPTS: $(bin_SCRIPTS)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(bindir)
@list='$(bin_SCRIPTS)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
if test -f $$d$$p; then \
f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
echo " $(binSCRIPT_INSTALL) $$d$$p $(DESTDIR)$(bindir)/$$f"; \
$(binSCRIPT_INSTALL) $$d$$p $(DESTDIR)$(bindir)/$$f; \
else :; fi; \
done
uninstall-binSCRIPTS:
@$(NORMAL_UNINSTALL)
@list='$(bin_SCRIPTS)'; for p in $$list; do \
f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
echo " rm -f $(DESTDIR)$(bindir)/$$f"; \
rm -f $(DESTDIR)$(bindir)/$$f; \
done
uninstall-info-am:
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
$(mkinstalldirs) $(distdir)/../lib
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkinstalldirs) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(SCRIPTS)
installdirs:
$(mkinstalldirs) $(DESTDIR)$(bindir)
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:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-rm -f $(CONFIG_CLEAN_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-generic mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am:
install-exec-am: install-binSCRIPTS
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-binSCRIPTS uninstall-info-am
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
ctags distclean distclean-generic distclean-tags distdir dvi \
dvi-am html html-am info info-am install install-am \
install-binSCRIPTS install-data install-data-am install-exec \
install-exec-am install-info install-info-am install-man \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
uninstall-am uninstall-binSCRIPTS uninstall-info-am
$(MY_AUTOM4TE): $(top_srcdir)/tests/wrapper.in
cd $(top_builddir)/tests && $(MAKE) $(AM_MAKEFLAGS) autom4te
$(AUTOM4TE_CFG): $(top_srcdir)/lib/autom4te.in
cd $(top_builddir)/lib && $(MAKE) $(AM_MAKEFLAGS) autom4te.cfg
# When processing the file with diversion disabled, there must be no
# output but comments and empty lines.
# If freezing produces output, something went wrong: a bad `divert',
# or an improper paren etc.
# It may happen that the output does not end with a end of line, hence
# force an end of line when reporting errors.
.m4.m4f:
$(MY_AUTOM4TE) \
--language=$* \
--freeze \
--output=$@
# For parallel builds.
$(build_libdir)/m4sugar/version.m4:
cd $(build_libdir)/m4sugar && $(MAKE) $(AM_MAKEFLAGS) version.m4
check-forbidden-patterns:
if (cd $(srcdir) && \
grep $(forbidden_patterns) $(forbidden_patterns_files)) \
>forbidden.log; then \
echo "ERROR: forbidden patterns were found:" >&2; \
sed "s,^,$*.m4: ," <forbidden.log >&2; \
echo >&2; \
exit 1; \
else \
rm -f forbidden.log; \
fi
$(srcdir)/autoconf.in: $(srcdir)/autoconf.as # FIXME: $(m4sh_m4f_dependencies)
$(AUTOM4SH) $(srcdir)/autoconf.as -o $@
autoconf: $(srcdir)/autoconf.in Makefile
rm -f autoconf autoconf.tmp
$(edit) $(srcdir)/autoconf.in >autoconf.tmp
chmod +x autoconf.tmp
chmod -w autoconf.tmp
mv -f autoconf.tmp autoconf
autoheader: $(srcdir)/autoheader.in Makefile
rm -f autoheader autoheader.tmp
$(edit) $(srcdir)/autoheader.in >autoheader.tmp
chmod +x autoheader.tmp
chmod -w autoheader.tmp
mv -f autoheader.tmp autoheader
autom4te: $(srcdir)/autom4te.in Makefile
rm -f autom4te autom4te.tmp
$(edit) $(srcdir)/autom4te.in >autom4te.tmp
chmod +x autom4te.tmp
chmod -w autom4te.tmp
mv -f autom4te.tmp autom4te
autoreconf: $(srcdir)/autoreconf.in Makefile
rm -f autoreconf autoreconf.tmp
$(edit) $(srcdir)/autoreconf.in >autoreconf.tmp
chmod +x autoreconf.tmp
chmod -w autoreconf.tmp
mv -f autoreconf.tmp autoreconf
autoscan: $(srcdir)/autoscan.in Makefile
rm -f autoscan autoscan.tmp
$(edit) $(srcdir)/autoscan.in >autoscan.tmp
chmod +x autoscan.tmp
chmod -w autoscan.tmp
mv -f autoscan.tmp autoscan
autoupdate: $(srcdir)/autoupdate.in Makefile
rm -f autoupdate autoupdate.tmp
$(edit) $(srcdir)/autoupdate.in >autoupdate.tmp
chmod +x autoupdate.tmp
chmod -w autoupdate.tmp
mv -f autoupdate.tmp autoupdate
ifnames: $(srcdir)/ifnames.in Makefile
rm -f ifnames ifnames.tmp
$(edit) $(srcdir)/ifnames.in >ifnames.tmp
chmod +x ifnames.tmp
chmod -w ifnames.tmp
mv -f ifnames.tmp ifnames
# 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:

182
autoconf/bin/autoconf.as Normal file
View File

@@ -0,0 +1,182 @@
AS_INIT[]dnl -*- shell-script -*-
# autoconf -- create `configure' using m4 macros
# Copyright (C) 1992, 1993, 1994, 1996, 1999, 2000, 2001, 2002, 2003
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
usage=["\
Usage: $0 [OPTION] ... [TEMPLATE-FILE]
Generate a configuration script from a TEMPLATE-FILE if given, or
\`configure.ac' if present, or else \`configure.in'. Output is sent
to the standard output if TEMPLATE-FILE is given, else into
\`configure'.
Operation modes:
-h, --help print this help, then exit
-V, --version print version number, then exit
-v, --verbose verbosely report processing
-d, --debug don't remove temporary files
-f, --force consider all files obsolete
-o, --output=FILE save output in FILE (stdout is the default)
-W, --warnings=CATEGORY report the warnings falling in CATEGORY [syntax]
Warning categories include:
\`cross' cross compilation issues
\`obsolete' obsolete constructs
\`syntax' dubious syntactic constructs
\`all' all the warnings
\`no-CATEGORY' turn off the warnings on CATEGORY
\`none' turn off all the warnings
\`error' warnings are error
The environment variable \`WARNINGS' is honored.
Library directories:
-B, --prepend-include=DIR prepend directory DIR to search path
-I, --include=DIR append directory DIR to search path
Tracing:
-t, --trace=MACRO report the list of calls to MACRO
-i, --initialization also trace Autoconf's initialization process
In tracing mode, no configuration script is created.
Report bugs to <bug-autoconf@gnu.org>."]
version=["\
autoconf (@PACKAGE_NAME@) @VERSION@
Written by David J. MacKenzie and Akim Demaille.
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."]
me=`AS_BASENAME([$0])`
help="\
Try \`$me --help' for more information."
exit_missing_arg="\
echo \"$me: option \\\`\$1' requires an argument\" >&2
echo \"\$help\" >&2
exit 1"
# Variables.
: ${AUTOM4TE='@bindir@/@autom4te-name@'}
dir=`AS_DIRNAME([$0])`
outfile=
verbose=:
# Parse command line.
while test $# -gt 0 ; do
option=[`expr "x$1" : 'x\(--[^=]*\)' \| \
"x$1" : 'x\(-.\)'`]
optarg=[`expr "x$1" : 'x--[^=]*=\(.*\)' \| \
"x$1" : 'x-.\(.*\)'`]
case $1 in
--version | -V )
echo "$version" ; exit 0 ;;
--help | -h )
echo "$usage"; exit 0 ;;
--verbose | -v )
verbose=echo
AUTOM4TE="$AUTOM4TE $1"; shift ;;
# Arguments passed as is to autom4te.
--debug | -d | \
--force | -f | \
--include=* | -I?* | \
--prepend-include=* | -B?* | \
--warnings=* | -W?* )
AUTOM4TE="$AUTOM4TE $1"; shift ;;
# Options with separated arg passed as is to autom4te.
--include | -I | \
--prepend-include | -B | \
--warnings | -W )
test $# = 1 && eval "$exit_missing_arg"
AUTOM4TE="$AUTOM4TE $option $2"
shift 2 ;;
--trace=* | -t?* )
traces="$traces --trace='"`echo "$optarg" | sed "s/'/'\\\\\\\\''/g"`"'"
shift ;;
--trace | -t )
test $# = 1 && eval "$exit_missing_arg"
shift
traces="$traces --trace='"`echo "$1" | sed "s/'/'\\\\\\\\''/g"`"'"
shift ;;
--initialization | -i )
AUTOM4TE="$AUTOM4TE --melt"
shift;;
--output=* | -o?* )
outfile=$optarg
shift ;;
--output | -o )
test $# = 1 && eval "$exit_missing_arg"
shift
outfile=$1
shift ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
break ;;
-* )
exec >&2
echo "$me: invalid option $1"
echo "$help"
exit 1 ;;
* )
break ;;
esac
done
# Find the input file.
case $# in
0)
if test -f configure.ac; then
if test -f configure.in; then
echo "$me: warning: both \`configure.ac' and \`configure.in' are present." >&2
echo "$me: warning: proceeding with \`configure.ac'." >&2
fi
infile=configure.ac
elif test -f configure.in; then
infile=configure.in
else
echo "$me: no input file" >&2
exit 1
fi
test -z "$traces" && test -z "$outfile" && outfile=configure;;
1) # autom4te doesn't like `-'.
test "x$1" != "x-" && infile=$1 ;;
*) exec >&2
echo "$me: invalid number of arguments."
echo "$help"
(exit 1); exit 1 ;;
esac
# Unless specified, the output is stdout.
test -z "$outfile" && outfile=-
# Run autom4te with expansion.
eval set \$AUTOM4TE --language=autoconf --output=\$outfile "$traces" \$infile
$verbose "$me: running $*" >&2
exec "$@"

271
autoconf/bin/autoconf.in Normal file
View File

@@ -0,0 +1,271 @@
#! /bin/sh
## --------------------- ##
## M4sh Initialization. ##
## --------------------- ##
# Be Bourne compatible
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
emulate sh
NULLCMD=:
# Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
set -o posix
fi
# Support unset when possible.
if (as_foo=foo; unset as_foo) >/dev/null 2>&1; then
as_unset=unset
else
as_unset=false
fi
# Work around bugs in pre-3.0 UWIN ksh.
$as_unset ENV MAIL MAILPATH
PS1='$ '
PS2='> '
PS4='+ '
# NLS nuisances.
for as_var in \
LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
LC_TELEPHONE LC_TIME
do
if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
eval $as_var=C; export $as_var
else
$as_unset $as_var
fi
done
# Required to use basename.
if expr a : '\(a\)' >/dev/null 2>&1; then
as_expr=expr
else
as_expr=false
fi
if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
as_basename=basename
else
as_basename=false
fi
# Name of the executable.
as_me=`$as_basename "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
X"$0" : 'X\(/\)$' \| \
. : '\(.\)' 2>/dev/null ||
echo X/"$0" |
sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
/^X\/\(\/\/\)$/{ s//\1/; q; }
/^X\/\(\/\).*/{ s//\1/; q; }
s/.*/./; q'`
# autoconf -- create `configure' using m4 macros
# Copyright (C) 1992, 1993, 1994, 1996, 1999, 2000, 2001, 2002, 2003
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
usage="\
Usage: $0 [OPTION] ... [TEMPLATE-FILE]
Generate a configuration script from a TEMPLATE-FILE if given, or
\`configure.ac' if present, or else \`configure.in'. Output is sent
to the standard output if TEMPLATE-FILE is given, else into
\`configure'.
Operation modes:
-h, --help print this help, then exit
-V, --version print version number, then exit
-v, --verbose verbosely report processing
-d, --debug don't remove temporary files
-f, --force consider all files obsolete
-o, --output=FILE save output in FILE (stdout is the default)
-W, --warnings=CATEGORY report the warnings falling in CATEGORY [syntax]
Warning categories include:
\`cross' cross compilation issues
\`obsolete' obsolete constructs
\`syntax' dubious syntactic constructs
\`all' all the warnings
\`no-CATEGORY' turn off the warnings on CATEGORY
\`none' turn off all the warnings
\`error' warnings are error
The environment variable \`WARNINGS' is honored.
Library directories:
-B, --prepend-include=DIR prepend directory DIR to search path
-I, --include=DIR append directory DIR to search path
Tracing:
-t, --trace=MACRO report the list of calls to MACRO
-i, --initialization also trace Autoconf's initialization process
In tracing mode, no configuration script is created.
Report bugs to <bug-autoconf@gnu.org>."
version="\
autoconf (@PACKAGE_NAME@) @VERSION@
Written by David J. MacKenzie and Akim Demaille.
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
me=`$as_basename $0 ||
$as_expr X/$0 : '.*/\([^/][^/]*\)/*$' \| \
X$0 : 'X\(//\)$' \| \
X$0 : 'X\(/\)$' \| \
. : '\(.\)' 2>/dev/null ||
echo X/$0 |
sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
/^X\/\(\/\/\)$/{ s//\1/; q; }
/^X\/\(\/\).*/{ s//\1/; q; }
s/.*/./; q'`
help="\
Try \`$me --help' for more information."
exit_missing_arg="\
echo \"$me: option \\\`\$1' requires an argument\" >&2
echo \"\$help\" >&2
exit 1"
# Variables.
: ${AUTOM4TE='@bindir@/@autom4te-name@'}
dir=`(dirname $0) 2>/dev/null ||
$as_expr X$0 : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X$0 : 'X\(//\)[^/]' \| \
X$0 : 'X\(//\)$' \| \
X$0 : 'X\(/\)' \| \
. : '\(.\)' 2>/dev/null ||
echo X$0 |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
/^X\(\/\/\)[^/].*/{ s//\1/; q; }
/^X\(\/\/\)$/{ s//\1/; q; }
/^X\(\/\).*/{ s//\1/; q; }
s/.*/./; q'`
outfile=
verbose=:
# Parse command line.
while test $# -gt 0 ; do
option=`expr "x$1" : 'x\(--[^=]*\)' \| \
"x$1" : 'x\(-.\)'`
optarg=`expr "x$1" : 'x--[^=]*=\(.*\)' \| \
"x$1" : 'x-.\(.*\)'`
case $1 in
--version | -V )
echo "$version" ; exit 0 ;;
--help | -h )
echo "$usage"; exit 0 ;;
--verbose | -v )
verbose=echo
AUTOM4TE="$AUTOM4TE $1"; shift ;;
# Arguments passed as is to autom4te.
--debug | -d | \
--force | -f | \
--include=* | -I?* | \
--prepend-include=* | -B?* | \
--warnings=* | -W?* )
AUTOM4TE="$AUTOM4TE $1"; shift ;;
# Options with separated arg passed as is to autom4te.
--include | -I | \
--prepend-include | -B | \
--warnings | -W )
test $# = 1 && eval "$exit_missing_arg"
AUTOM4TE="$AUTOM4TE $option $2"
shift 2 ;;
--trace=* | -t?* )
traces="$traces --trace='"`echo "$optarg" | sed "s/'/'\\\\\\\\''/g"`"'"
shift ;;
--trace | -t )
test $# = 1 && eval "$exit_missing_arg"
shift
traces="$traces --trace='"`echo "$1" | sed "s/'/'\\\\\\\\''/g"`"'"
shift ;;
--initialization | -i )
AUTOM4TE="$AUTOM4TE --melt"
shift;;
--output=* | -o?* )
outfile=$optarg
shift ;;
--output | -o )
test $# = 1 && eval "$exit_missing_arg"
shift
outfile=$1
shift ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
break ;;
-* )
exec >&2
echo "$me: invalid option $1"
echo "$help"
exit 1 ;;
* )
break ;;
esac
done
# Find the input file.
case $# in
0)
if test -f configure.ac; then
if test -f configure.in; then
echo "$me: warning: both \`configure.ac' and \`configure.in' are present." >&2
echo "$me: warning: proceeding with \`configure.ac'." >&2
fi
infile=configure.ac
elif test -f configure.in; then
infile=configure.in
else
echo "$me: no input file" >&2
exit 1
fi
test -z "$traces" && test -z "$outfile" && outfile=configure;;
1) # autom4te doesn't like `-'.
test "x$1" != "x-" && infile=$1 ;;
*) exec >&2
echo "$me: invalid number of arguments."
echo "$help"
(exit 1); exit 1 ;;
esac
# Unless specified, the output is stdout.
test -z "$outfile" && outfile=-
# Run autom4te with expansion.
eval set \$AUTOM4TE --language=autoconf --output=\$outfile "$traces" \$infile
$verbose "$me: running $*" >&2
exec "$@"

296
autoconf/bin/autoheader.in Normal file
View File

@@ -0,0 +1,296 @@
#! @PERL@
# -*- Perl -*-
# @configure_input@
eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
if 0;
# autoheader -- create `config.h.in' from `configure.ac'
# Copyright (C) 1992, 1993, 1994, 1996, 1998, 1999, 2000, 2001, 2002, 2003
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# Written by Roland McGrath.
# Rewritten in Perl by Akim Demaille.
BEGIN
{
my $datadir = $ENV{'autom4te_perllibdir'} || '@datadir@';
unshift @INC, "$datadir";
# Override SHELL. On DJGPP SHELL may not be set to a shell
# that can handle redirection and quote arguments correctly,
# e.g.: COMMAND.COM. For DJGPP always use the shell that configure
# has detected.
$ENV{'SHELL'} = '@SHELL@' if ($^O eq 'dos');
}
use Autom4te::ChannelDefs;
use Autom4te::Channels;
use Autom4te::Configure_ac;
use Autom4te::FileUtils;
use Autom4te::General;
use Autom4te::XFile;
use strict;
# Using `do FILE', we need `local' vars.
use vars qw ($config_h %verbatim %symbol);
# Lib files.
my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@';
local $config_h;
my $config_h_in;
my @prepend_include;
my @include;
# $HELP
# -----
$help = "Usage: $0 [OPTION] ... [TEMPLATE-FILE]
Create a template file of C \`\#define\' statements for \`configure\' to
use. To this end, scan TEMPLATE-FILE, or \`configure.ac\' if present,
or else \`configure.in\'.
-h, --help print this help, then exit
-V, --version print version number, then exit
-v, --verbose verbosely report processing
-d, --debug don\'t remove temporary files
-f, --force consider all files obsolete
-W, --warnings=CATEGORY report the warnings falling in CATEGORY
" . Autom4te::ChannelDefs::usage () . "
Library directories:
-B, --prepend-include=DIR prepend directory DIR to search path
-I, --include=DIR append directory DIR to search path
Report bugs to <bug-autoconf\@gnu.org>.
";
# $VERSION
# --------
$version = "autoheader (@PACKAGE_NAME@) @VERSION@
Written by Roland McGrath and Akim Demaille.
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
";
## ---------- ##
## Routines. ##
## ---------- ##
# parse_args ()
# -------------
# Process any command line arguments.
sub parse_args ()
{
my $srcdir;
parse_WARNINGS;
getopt ('I|include=s' => \@include,
'B|prepend-include=s' => \@prepend_include,
'W|warnings=s' => \&parse_warnings);
if (! @ARGV)
{
my $configure_ac = require_configure_ac;
push @ARGV, $configure_ac;
}
}
## -------------- ##
## Main program. ##
## -------------- ##
mktmpdir ('ah');
switch_warning 'obsolete';
parse_args;
# Preach.
my $config_h_top = find_file ("config.h.top?",
reverse (@prepend_include), @include);
my $config_h_bot = find_file ("config.h.bot?",
reverse (@prepend_include), @include);
my $acconfig_h = find_file ("acconfig.h?",
reverse (@prepend_include), @include);
if ($config_h_top || $config_h_bot || $acconfig_h)
{
my $msg = << "END";
Using auxiliary files such as \`acconfig.h\', \`config.h.bot\'
and \`config.h.top\', to define templates for \`config.h.in\'
is deprecated and discouraged.
Using the third argument of \`AC_DEFINE\' and
\`AC_DEFINE_UNQUOTED\' allows to define a template without
\`acconfig.h\':
AC_DEFINE([NEED_FUNC_MAIN], 1,
[Define if a function \`main\' is needed.])
More sophisticated templates can also be produced, see the
documentation.
END
$msg =~ s/^ /WARNING: /gm;
msg 'obsolete', $msg;
}
# Set up autoconf.
my $autoconf = "$autom4te --language=autoconf ";
$autoconf .= join (' ', map { "--include=$_" } @include);
$autoconf .= join (' ', map { "--prepend-include=$_" } @prepend_include);
$autoconf .= ' --debug' if $debug;
$autoconf .= ' --force' if $force;
$autoconf .= ' --verbose' if $verbose;
# ----------------------- #
# Real work starts here. #
# ----------------------- #
# Source what the traces are trying to tell us.
verb "$me: running $autoconf to trace from $ARGV[0]";
xsystem ("$autoconf"
# If you change this list, update the
# `Autoheader-preselections' section of autom4te.in.
. ' --trace AC_CONFIG_HEADERS:\'$$config_h ||= \'"\'"\'$1\'"\'"\';\''
. ' --trace AH_OUTPUT:\'$$verbatim{\'"\'"\'$1\'"\'"\'} = \'"\'"\'$2\'"\'"\';\''
. ' --trace AC_DEFINE_TRACE_LITERAL:\'$$symbol{\'"\'"\'$1\'"\'"\'} = 1;\''
. " $ARGV[0] >$tmp/traces.pl");
local (%verbatim, %symbol);
debug "$me: \`do'ing $tmp/traces.pl:\n" . `sed 's/^/| /' $tmp/traces.pl`;
do "$tmp/traces.pl";
warn "couldn't parse $tmp/traces.pl: $@" if $@;
error "error: AC_CONFIG_HEADERS not found in $ARGV[0]"
unless $config_h;
# We template only the first CONFIG_HEADER.
$config_h =~ s/ .*//;
# Support "outfile[:infile]", defaulting infile="outfile.in".
($config_h, $config_h_in) = split (':', $config_h, 2);
$config_h_in ||= "$config_h.in";
# %SYMBOL might contain things like `F77_FUNC(name,NAME)', but we keep
# only the name of the macro.
%symbol = map { s/\(.*//; $_ => 1 } keys %symbol;
my $out = new Autom4te::XFile (">$tmp/config.hin");
# Don't write "do not edit" -- it will get copied into the
# config.h, which it's ok to edit.
print $out "/* $config_h_in. Generated from $ARGV[0] by autoheader. */\n";
# Dump the top.
if ($config_h_top)
{
my $in = new Autom4te::XFile ($config_h_top);
while ($_ = $in->getline)
{
print $out $_;
}
}
# Dump `acconfig.h', except for its bottom portion.
if ($acconfig_h)
{
my $in = new Autom4te::XFile ($acconfig_h);
while ($_ = $in->getline)
{
last if /\@BOTTOM\@/;
next if /\@TOP\@/;
print $out $_;
}
}
# Dump the templates from `configure.ac'.
foreach (sort keys %verbatim)
{
print $out "\n$verbatim{$_}\n";
}
# Dump bottom portion of `acconfig.h'.
if ($acconfig_h)
{
my $in = new Autom4te::XFile ($acconfig_h);
my $dump = 0;
while ($_ = $in->getline)
{
print $out $_ if $dump;
$dump = 1 if /\@BOTTOM\@/;
}
}
# Dump the bottom.
if ($config_h_bot)
{
my $in = new Autom4te::XFile ($config_h_bot);
while ($_ = $in->getline)
{
print $out $_;
}
}
$out->close;
# Check that all the symbols have a template.
{
my $in = new Autom4te::XFile ("$tmp/config.hin");
my $suggest_ac_define = 1;
while ($_ = $in->getline)
{
my ($symbol) = /^\#\s*\w+\s+(\w+)/
or next;
delete $symbol{$symbol};
}
foreach (sort keys %symbol)
{
msg 'syntax', "warning: missing template: $_";
if ($suggest_ac_define)
{
msg 'syntax', "Use AC_DEFINE([$_], [], [Description])";
$suggest_ac_define = 0;
}
}
exit 1
if keys %symbol;
}
update_file ("$tmp/config.hin", "$config_h_in");
### Setup "GNU" style for perl-mode and cperl-mode.
## Local Variables:
## perl-indent-level: 2
## perl-continued-statement-offset: 2
## perl-continued-brace-offset: 0
## perl-brace-offset: 0
## perl-brace-imaginary-offset: 0
## perl-label-offset: -2
## cperl-indent-level: 2
## cperl-brace-offset: 0
## cperl-continued-brace-offset: 0
## cperl-label-offset: -2
## cperl-extra-newline-before-brace: t
## cperl-merge-trailing-else: nil
## cperl-continued-statement-offset: 2
## End:

1055
autoconf/bin/autom4te.in Executable file

File diff suppressed because it is too large Load Diff

670
autoconf/bin/autoreconf.in Executable file
View File

@@ -0,0 +1,670 @@
#! @PERL@ -w
# -*- perl -*-
# @configure_input@
eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
if 0;
# autoreconf - install the GNU Build System in a directory tree
# Copyright (C) 1994, 1999, 2000, 2001, 2002, 2003
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# Written by David J. MacKenzie.
# Extended and rewritten in Perl by Akim Demaille.
BEGIN
{
my $datadir = $ENV{'autom4te_perllibdir'} || '@datadir@';
unshift @INC, $datadir;
# Override SHELL. On DJGPP SHELL may not be set to a shell
# that can handle redirection and quote arguments correctly,
# e.g.: COMMAND.COM. For DJGPP always use the shell that configure
# has detected.
$ENV{'SHELL'} = '@SHELL@' if ($^O eq 'dos');
}
use Autom4te::ChannelDefs;
use Autom4te::Channels;
use Autom4te::Configure_ac;
use Autom4te::FileUtils;
use Autom4te::General;
use Autom4te::XFile;
# Do not use Cwd::chdir, since it might hang.
use Cwd 'cwd';
use strict;
## ----------- ##
## Variables. ##
## ----------- ##
# $HELP
# -----
$help = "Usage: $0 [OPTION] ... [CONFIGURE-AC or DIRECTORY] ...
Run `autoconf' (and `autoheader', `aclocal', `automake', `autopoint'
(formerly `gettextize'), and `libtoolize' where appropriate)
repeatedly to remake the GNU Build System files in the DIRECTORIES or
the directory trees driven by CONFIGURE-AC (defaulting to `.').
By default, it only remakes those files that are older than their
predecessors. If you install new versions of the GNU Build System,
running `autoreconf' remakes all of the files by giving it the
`--force' option.
Operation modes:
-h, --help print this help, then exit
-V, --version print version number, then exit
-v, --verbose verbosely report processing
-d, --debug don't remove temporary files
-f, --force consider all files obsolete
-i, --install copy missing auxiliary files
-s, --symlink with -i, install symbolic links instead of copies
-m, --make when applicable, re-run ./configure && make
-W, --warnings=CATEGORY report the warnings falling in CATEGORY [syntax]
" . Autom4te::ChannelDefs::usage . "
The environment variable \`WARNINGS\' is honored. Some subtools might
support other warning types, using \`all' is encouraged.
Library directories:
-B, --prepend-include=DIR prepend directory DIR to search path
-I, --include=DIR append directory DIR to search path
The environment variables AUTOCONF, AUTOHEADER, AUTOMAKE, ACLOCAL,
AUTOPOINT, LIBTOOLIZE are honored.
Report bugs to <bug-autoconf\@gnu.org>.
";
# $VERSION
# --------
$version = "autoreconf (@PACKAGE_NAME@) @VERSION@
Written by David J. MacKenzie and Akim Demaille.
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
";
# Lib files.
my $autoconf = $ENV{'AUTOCONF'} || '@bindir@/@autoconf-name@';
my $autoheader = $ENV{'AUTOHEADER'} || '@bindir@/@autoheader-name@';
my $automake = $ENV{'AUTOMAKE'} || 'automake';
my $aclocal = $ENV{'ACLOCAL'} || 'aclocal';
my $libtoolize = $ENV{'LIBTOOLIZE'} || 'libtoolize';
my $autopoint = $ENV{'AUTOPOINT'} || 'autopoint';
# --install -- as --add-missing in other tools.
my $install = 0;
# symlink -- when --install, use symlinks instead.
my $symlink = 0;
# Does aclocal support --force?
my $aclocal_supports_force = 0;
my @prepend_include;
my @include;
# List of command line warning requests.
my @warning;
# Rerun `./configure && make'?
my $make = 0;
## ---------- ##
## Routines. ##
## ---------- ##
# parse_args ()
# -------------
# Process any command line arguments.
sub parse_args ()
{
my $srcdir;
getopt ("W|warnings=s" => \@warning,
'I|include=s' => \@include,
'B|prepend-include=s' => \@prepend_include,
'i|install' => \$install,
's|symlink' => \$symlink,
'm|make' => \$make);
# Split the warnings as a list of elements instead of a list of
# lists.
@warning = map { split /,/ } @warning;
parse_WARNINGS;
parse_warnings '--warnings', @warning;
# Even if the user specified a configure.ac, trim to get the
# directory, and look for configure.ac again. Because (i) the code
# is simpler, and (ii) we are still able to diagnose simultaneous
# presence of configure.ac and configure.in.
@ARGV = map { /configure\.(ac|in)$/ ? dirname ($_) : $_ } @ARGV;
push @ARGV, '.' unless @ARGV;
if ($verbose && $debug)
{
for my $prog ($autoconf, $autoheader,
$automake, $aclocal,
$autopoint,
$libtoolize)
{
xsystem ("$prog --version | sed 1q >&2");
print STDERR "\n";
}
}
$aclocal_supports_force = `$aclocal --help` =~ /--force/;
# Dispatch autoreconf's option to the tools.
# --include;
$autoconf .= join (' --include=', '', @include);
$autoconf .= join (' --prepend-include=', '', @prepend_include);
$autoheader .= join (' --include=', '', @include);
$autoheader .= join (' --prepend-include=', '', @prepend_include);
# --install and --symlink;
if ($install)
{
$automake .= ' --add-missing';
$automake .= ' --copy' unless $symlink;
$libtoolize .= ' --copy' unless $symlink;
}
# --force;
if ($force)
{
$aclocal .= ' --force'
if $aclocal_supports_force;
$autoconf .= ' --force';
$autoheader .= ' --force';
$automake .= ' --force-missing';
$autopoint .= ' --force';
$libtoolize .= ' --force';
}
else
{
# The implementation of --no-force is bogus in all implementations
# of Automake up to 1.8, so we avoid it in these cases. (Automake
# 1.8 is the first version where aclocal supports force, hence
# the condition.)
$automake .= ' --no-force'
if $aclocal_supports_force;
}
# --debug;
if ($debug)
{
$autoconf .= ' --verbose --debug';
$autoheader .= ' --verbose --debug';
$automake .= ' --verbose';
$aclocal .= ' --verbose';
$libtoolize .= ' --debug';
}
# --warnings;
if (@warning)
{
my $warn = ' --warnings=' . join (',', @warning);
$autoconf .= $warn;
$autoheader .= $warn;
$automake .= $warn
if `$automake --help` =~ /--warnings/;
}
}
# &run_aclocal ($ACLOCAL, $FLAGS)
# -------------------------------
# Update aclocal.m4 as lazily as possible, as aclocal pre-1.8 always
# overwrites aclocal.m4, hence triggers autoconf, autoheader, automake
# etc. uselessly. aclocal 1.8+ does not need this.
sub run_aclocal ($$)
{
my ($aclocal, $flags) = @_;
# aclocal 1.8+ does all this for free. It can be recognized by its
# --force support.
if ($aclocal_supports_force)
{
xsystem ("$aclocal $flags");
}
else
{
xsystem ("$aclocal $flags --output=aclocal.m4t");
# aclocal may produce no output.
if (-f 'aclocal.m4t')
{
update_file ('aclocal.m4t', 'aclocal.m4');
# Make sure that the local m4 files are older than
# aclocal.m4.
#
# Why is not always the case? Because we already run
# aclocal at first (before tracing), which, for instance,
# can find Gettext's macros in .../share/aclocal, so we may
# have had the right aclocal.m4 already. Then autopoint is
# run, and installs locally these M4 files. Then
# autoreconf, via update_file, sees it is the _same_
# aclocal.m4, and doesn't change its timestamp. But later,
# Automake's Makefile expresses that aclocal.m4 depends on
# these local files, which are newer, so it triggers aclocal
# again.
#
# To make sure aclocal.m4 is no older, we change the
# modification times of the local M4 files to be not newer
# than it.
#
# First, where are the local files?
my $aclocal_local_dir = '.';
if ($flags =~ /-I\s+(\S+)/)
{
$aclocal_local_dir = $1;
}
# All the local files newer than aclocal.m4 are to be
# made not newer than it.
my $aclocal_m4_mtime = mtime ('aclocal.m4');
for my $file (glob ("$aclocal_local_dir/*.m4"), 'acinclude.m4')
{
if ($aclocal_m4_mtime < mtime ($file))
{
debug "aging $file to be not newer than aclocal.m4";
utime $aclocal_m4_mtime, $aclocal_m4_mtime, $file;
}
}
}
}
}
# &autoreconf_current_directory
# -----------------------------
sub autoreconf_current_directory ()
{
my $configure_ac = require_configure_ac;
# ---------------------- #
# Is it using Autoconf? #
# ---------------------- #
my $uses_autoconf;
my $uses_gettext;
my $configure_ac_file = new Autom4te::XFile $configure_ac;
while ($_ = $configure_ac_file->getline)
{
s/#.*//;
s/dnl.*//;
$uses_autoconf = 1 if /AC_INIT/;
# See below for why we look for gettext here.
$uses_gettext = 1 if /^AM_GNU_GETTEXT_VERSION/;
}
if (!$uses_autoconf)
{
verb "$configure_ac: not using Autoconf";
return;
}
# ------------------- #
# Running autopoint. #
# ------------------- #
# Gettext is a bit of a problem: its macros are not necessarily
# visible to aclocal, so if we start with a completely striped down
# package (think of a fresh CVS checkout), running `aclocal' first
# will fail: the Gettext macros are missing.
#
# Therefore, we can't use the traces to decide if we use Gettext or
# not. I guess that once Gettext move to 2.5x we will be able to,
# but in the meanwhile forget it.
#
# We can only grep for AM_GNU_GETTEXT_VERSION in configure.ac. You
# might think this approach is naive, and indeed it is, as it
# prevents one to embed AM_GNU_GETTEXT_VERSION in another *.m4, but
# anyway we don't limit the generality, since... that's what
# autopoint does. Actually, it is even more restrictive, as it
# greps for `^AM_GNU_GETTEXT_VERSION('. We did this above, while
# scanning configure.ac.
if (!$uses_gettext)
{
verb "$configure_ac: not using Gettext";
}
elsif (!$install)
{
verb "$configure_ac: not running autopoint: --install not given";
}
else
{
xsystem "$autopoint";
}
# ----------------- #
# Running aclocal. #
# ----------------- #
# Run it first: it might discover new macros to add, e.g.,
# AC_PROG_LIBTOOL, which we will trace later to see if Libtool is
# used.
#
# Always run it. Tracking its sources for up-to-dateness is too
# complex and too error prone. The best we can do is avoiding
# nuking the time stamp.
my $uses_aclocal = 1;
# Nevertheless, if aclocal.m4 exists and is not made by aclocal,
# don't run aclocal.
if (-f 'aclocal.m4')
{
my $aclocal_m4 = new Autom4te::XFile 'aclocal.m4';
$_ = $aclocal_m4->getline;
$uses_aclocal = 0
unless defined ($_) && /generated.*by aclocal/;
}
# If there are flags for aclocal in Makefile.am, use them.
my $aclocal_flags = '';
if ($uses_aclocal && -f 'Makefile.am')
{
my $makefile = new Autom4te::XFile 'Makefile.am';
while ($_ = $makefile->getline)
{
if (/^ACLOCAL_[A-Z_]*FLAGS\s*=\s*(.*)/)
{
$aclocal_flags = $1;
last;
}
}
}
if (!$uses_aclocal)
{
verb "$configure_ac: not using aclocal";
}
else
{
# Some filesystems have sub-second time stamps, and if so we may
# run into trouble later, after we rerun autoconf and set the
# time stamps of input files to be no greater than aclocal.m4,
# because the time-stamp-setting operation (utime) has a
# resolution of only 1 second. Work around the problem by
# ensuring that there is at least a one-second window before the
# time stamp of aclocal.m4t in which no file time stamps can
# fall.
sleep 1;
run_aclocal ($aclocal, $aclocal_flags);
}
# We might have to rerun aclocal if Libtool (or others) imports new
# macros.
my $rerun_aclocal = 0;
# ------------------------------- #
# See what tools will be needed. #
# ------------------------------- #
# Perform a single trace reading to avoid --force forcing a rerun
# between two --trace, that's useless. If there is no AC_INIT, then
# we are not interested: it looks like a Cygnus thingy.
my $aux_dir;
my $uses_gettext_via_traces;
my $uses_libtool;
my $uses_autoheader;
my @subdir;
verb "$configure_ac: tracing";
my $traces = new Autom4te::XFile
("$autoconf"
. join (' --trace=', '',
# If you change this list, update the
# `Autoreconf-preselections' section of autom4te.in.
'AC_CONFIG_AUX_DIR:AC_CONFIG_AUX_DIR:\$1',
'AC_CONFIG_HEADERS',
'AC_CONFIG_SUBDIRS:AC_CONFIG_SUBDIRS:\$1',
'AC_INIT',
'AC_PROG_LIBTOOL',
'AM_GNU_GETTEXT',
)
. ' |');
while ($_ = $traces->getline)
{
$aux_dir = $1 if /AC_CONFIG_AUX_DIR:(.*)/;
$uses_autoconf = 1 if /AC_INIT/;
$uses_gettext_via_traces = 1 if /AM_GNU_GETTEXT/;
$uses_libtool = 1 if /AC_PROG_LIBTOOL/;
$uses_autoheader = 1 if /AC_CONFIG_HEADERS/;
push @subdir, split (' ', $1) if /AC_CONFIG_SUBDIRS:(.*)/;
}
# The subdirs are *optional*, they may not exist.
foreach (@subdir)
{
if (-d)
{
verb "$configure_ac: subdirectory $_ to autoreconf";
autoreconf ($_);
}
else
{
verb "$configure_ac: subdirectory $_ not present";
}
}
# Gettext consistency checks...
error "$configure_ac: AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION"
if $uses_gettext_via_traces && ! $uses_gettext;
error "$configure_ac: AM_GNU_GETTEXT_VERSION is used, but not AM_GNU_GETTEXT"
if $uses_gettext && ! $uses_gettext_via_traces;
# ---------------------------- #
# Setting up the source tree. #
# ---------------------------- #
# libtoolize, automake --add-missing etc. will drop files in the
# $AUX_DIR. But these tools fail to install these files if the
# directory itself does not exist, which valid: just imagine a CVS
# repository with hand written code only (there is not even a need
# for a Makefile.am!).
if (defined $aux_dir && ! -d $aux_dir)
{
verb "$configure_ac: creating directory $aux_dir";
mkdir $aux_dir
or error "cannot create $aux_dir: $!";
}
# -------------------- #
# Running libtoolize. #
# -------------------- #
if (!$uses_libtool)
{
verb "$configure_ac: not using Libtool";
}
elsif ($install)
{
xsystem ($libtoolize);
$rerun_aclocal = 1;
}
else
{
verb "$configure_ac: not running libtoolize: --install not given";
}
# ------------------- #
# Rerunning aclocal. #
# ------------------- #
# If we re-installed Libtool or Gettext, the macros might have changed.
# Automake also needs an up-to-date aclocal.m4.
if ($rerun_aclocal)
{
if (!$uses_aclocal)
{
verb "$configure_ac: not using aclocal";
}
else
{
run_aclocal ($aclocal, $aclocal_flags);
}
}
# ------------------ #
# Running autoconf. #
# ------------------ #
# Don't try to be smarter than `autoconf', which does its own up to
# date checks.
#
# We prefer running autoconf before autoheader, because (i) the
# latter runs the former, and (ii) autoconf is stricter than
# autoheader. So all in all, autoconf should give better error
# messages.
xsystem ($autoconf);
# -------------------- #
# Running autoheader. #
# -------------------- #
# We now consider that if AC_CONFIG_HEADERS is used, then autoheader
# is used too.
#
# Just as for autoconf, up to date ness is performed by the tool
# itself.
#
# Run it before automake, since the latter checks the presence of
# config.h.in when it sees an AC_CONFIG_HEADERS.
if (!$uses_autoheader)
{
verb "$configure_ac: not using Autoheader";
}
else
{
xsystem ($autoheader);
}
# ------------------ #
# Running automake. #
# ------------------ #
# Assumes that there is a Makefile.am in the topmost directory.
if (!-f 'Makefile.am')
{
verb "$configure_ac: not using Automake";
}
else
{
# We should always run automake, and let it decide whether it shall
# update the file or not. In fact, the effect of `$force' is already
# included in `$automake' via `--no-force'.
xsystem ($automake);
}
# -------------- #
# Running make. #
# -------------- #
if ($make)
{
if (!-f "config.status")
{
verb "no config.status: cannot re-make";
}
else
{
xsystem ("./config.status --recheck");
xsystem ("./config.status");
if (!-f "Makefile")
{
verb "no Makefile: cannot re-make";
}
else
{
xsystem ("make");
}
}
}
}
# &autoreconf ($DIRECTORY)
# ------------------------
# Reconf the $DIRECTORY.
sub autoreconf ($)
{
my ($directory) = @_;
my $cwd = cwd;
# The format for this message is not free: taken from Emacs, itself
# using GNU Make's format.
verb "Entering directory `$directory'";
chdir $directory
or error "cannot chdir to $directory: $!";
autoreconf_current_directory;
# The format is not free: taken from Emacs, itself using GNU Make's
# format.
verb "Leaving directory `$directory'";
chdir $cwd
or error "cannot chdir to $cwd: $!";
}
## ------ ##
## Main. ##
## ------ ##
# When debugging, it is convenient that all the related temporary
# files be at the same place.
mktmpdir ('ar');
$ENV{'TMPDIR'} = $tmp;
parse_args;
# Autoreconf all the given configure.ac. A while loop, not a for,
# since the list can change at runtime because of AC_CONFIG_SUBDIRS.
for my $directory (@ARGV)
{
autoreconf ($directory);
}
### Setup "GNU" style for perl-mode and cperl-mode.
## Local Variables:
## perl-indent-level: 2
## perl-continued-statement-offset: 2
## perl-continued-brace-offset: 0
## perl-brace-offset: 0
## perl-brace-imaginary-offset: 0
## perl-label-offset: -2
## cperl-indent-level: 2
## cperl-brace-offset: 0
## cperl-continued-brace-offset: 0
## cperl-label-offset: -2
## cperl-extra-newline-before-brace: t
## cperl-merge-trailing-else: nil
## cperl-continued-statement-offset: 2
## End:

655
autoconf/bin/autoscan.in Executable file
View File

@@ -0,0 +1,655 @@
#! @PERL@ -w
# -*- perl -*-
# autoscan - Create configure.scan (a preliminary configure.ac) for a package.
# Copyright (C) 1994, 1999, 2000, 2001, 2002, 2003
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# Written by David MacKenzie <djm@gnu.ai.mit.edu>.
eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
if 0;
BEGIN
{
my $datadir = $ENV{'autom4te_perllibdir'} || '@datadir@';
unshift @INC, $datadir;
# Override SHELL. On DJGPP SHELL may not be set to a shell
# that can handle redirection and quote arguments correctly,
# e.g.: COMMAND.COM. For DJGPP always use the shell that configure
# has detected.
$ENV{'SHELL'} = '@SHELL@' if ($^O eq 'dos');
}
use Autom4te::ChannelDefs;
use Autom4te::Configure_ac;
use Autom4te::General;
use Autom4te::FileUtils;
use Autom4te::XFile;
use File::Basename;
use File::Find;
use strict;
use vars qw(@cfiles @makefiles @shfiles %printed);
# The kind of the words we are looking for.
my @kinds = qw (function header identifier program
makevar librarie);
# For each kind, the default macro.
my %generic_macro =
(
'function' => 'AC_CHECK_FUNCS',
'header' => 'AC_CHECK_HEADERS',
'identifier' => 'AC_CHECK_TYPES',
'program' => 'AC_CHECK_PROGS',
'library' => 'AC_CHECK_LIB'
);
my %kind_comment =
(
'function' => 'Checks for library functions.',
'header' => 'Checks for header files.',
'identifier' => 'Checks for typedefs, structures, and compiler characteristics.',
'program' => 'Checks for programs.',
);
# $USED{KIND}{ITEM} is the list of locations where the ITEM (of KIND) was used
# in the user package.
# For instance $USED{function}{alloca} is the list of `file:line' where
# `alloca (...)' appears.
my %used = ();
# $MACRO{KIND}{ITEM} is the list of macros to use to test ITEM.
# Initialized from lib/autoscan/*. E.g., $MACRO{function}{alloca} contains
# the singleton AC_FUNC_ALLOCA. Some require several checks.
my %macro = ();
# $NEEDED_MACROS{MACRO} is an array of locations requiring MACRO.
# E.g., $NEEDED_MACROS{AC_FUNC_ALLOC} the list of `file:line' containing
# `alloca (...)'.
my %needed_macros =
(
'AC_PREREQ' => [$me],
);
my $configure_scan = 'configure.scan';
my $log = new Autom4te::XFile ">$me.log";
# Autoconf and lib files.
my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@';
my $autoconf = "$autom4te --language=autoconf";
my @prepend_include;
my @include = ('@datadir@');
# $help
# -----
$help = "Usage: $0 [OPTION] ... [SRCDIR]
Examine source files in the directory tree rooted at SRCDIR, or the
current directory if none is given. Search the source files for
common portability problems, check for incompleteness of
`configure.ac', and create a file `$configure_scan' which is a
preliminary `configure.ac' for that package.
-h, --help print this help, then exit
-V, --version print version number, then exit
-v, --verbose verbosely report processing
-d, --debug don't remove temporary files
Library directories:
-B, --prepend-include=DIR prepend directory DIR to search path
-I, --include=DIR append directory DIR to search path
Report bugs to <bug-autoconf\@gnu.org>.\n";
# $version
# --------
$version = "autoscan (@PACKAGE_NAME@) @VERSION@
Written by David J. MacKenzie and Akim Demaille.
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n";
## ------------------------ ##
## Command line interface. ##
## ------------------------ ##
# parse_args ()
# -------------
# Process any command line arguments.
sub parse_args ()
{
getopt ('I|include=s' => \@include,
'B|prepend-include=s' => \@prepend_include);
die "$me: too many arguments
Try `$me --help' for more information.\n"
if @ARGV > 1;
my $srcdir = $ARGV[0] || ".";
verb "srcdir = $srcdir";
chdir $srcdir || error "cannot cd to $srcdir: $!";
}
# init_tables ()
# --------------
# Put values in the tables of what to do with each token.
sub init_tables ()
{
# The data file format supports only one line of macros per function.
# If more than that is required for a common portability problem,
# a new Autoconf macro should probably be written for that case,
# instead of duplicating the code in lots of configure.ac files.
my $file = find_file ("autoscan/autoscan.list",
reverse (@prepend_include), @include);
my $table = new Autom4te::XFile $file;
my $tables_are_consistent = 1;
while ($_ = $table->getline)
{
# Ignore blank lines and comments.
next
if /^\s*$/ || /^\s*\#/;
# '<kind>: <word> <macro invocation>' or...
# '<kind>: <word> warn: <message>'.
if (/^(\S+):\s+(\S+)\s+(\S.*)$/)
{
my ($kind, $word, $macro) = ($1, $2, $3);
error "$file:$.: invalid kind: $_"
unless grep { $_ eq $kind } @kinds;
push @{$macro{$kind}{$word}}, $macro;
}
else
{
error "$file:$.: invalid definition: $_";
}
}
if ($debug)
{
foreach my $kind (@kinds)
{
foreach my $word (sort keys %{$macro{$kind}})
{
print "$kind: $word: @{$macro{$kind}{$word}}\n";
}
}
}
}
# used ($KIND, $WORD, [$WHERE])
# -----------------------------
# $WORD is used as a $KIND.
sub used ($$;$)
{
my ($kind, $word, $where) = @_;
$where ||= "$File::Find::name:$.";
if (
# Check for all the libraries. But `-links' is certainly a
# `find' argument, and `-le', a `test' argument.
($kind eq 'library' && $word !~ /^(e|inks)$/)
# Other than libraries are to be checked only if listed in
# the Autoscan library files.
|| defined $macro{$kind}{$word}
)
{
push (@{$used{$kind}{$word}}, $where);
}
}
## ----------------------- ##
## Scanning source files. ##
## ----------------------- ##
# scan_c_file ($FILENAME)
# -----------------------
sub scan_c_file ($)
{
my ($filename) = @_;
push @cfiles, $File::Find::name;
# Nonzero if in a multiline comment.
my $in_comment = 0;
my $file = new Autom4te::XFile "<$filename";
while ($_ = $file->getline)
{
# Strip out comments.
if ($in_comment && s,^.*?\*/,,)
{
$in_comment = 0;
}
# The whole line is inside a commment.
next if $in_comment;
# All on one line.
s,/\*.*?\*/,,g;
# Starting on this line.
if (s,/\*.*$,,)
{
$in_comment = 1;
}
# Preprocessor directives.
if (s/^\s*\#\s*//)
{
if (/^include\s*<([^>]*)>/)
{
used ('header', $1);
}
if (s/^(if|ifdef|ifndef|elif)\s+//)
{
foreach my $word (split (/\W+/))
{
used ('identifier', $word)
unless $word eq 'defined' || $word !~ /^[a-zA-Z_]/;
}
}
# Ignore other preprocessor directives.
next;
}
# Remove string and character constants.
s,\"[^\"]*\",,g;
s,\'[^\']*\',,g;
# Tokens in the code.
# Maybe we should ignore function definitions (in column 0)?
while (s/\b([a-zA-Z_]\w*)\s*\(/ /)
{
used ('function', $1);
}
while (s/\b([a-zA-Z_]\w*)\b/ /)
{
used ('identifier', $1);
}
}
$file->close;
}
# scan_makefile($MAKEFILE-NAME)
# -----------------------------
sub scan_makefile ($)
{
my ($filename) = @_;
push @makefiles, $File::Find::name;
my $file = new Autom4te::XFile "<$filename";
while ($_ = $file->getline)
{
# Strip out comments.
s/#.*//;
# Variable assignments.
while (s/\b([a-zA-Z_]\w*)\s*=/ /)
{
used ('makevar', $1);
}
# Be sure to catch a whole word. For instance `lex$U.$(OBJEXT)'
# is a single token. Otherwise we might believe `lex' is needed.
foreach my $word (split (/\s+/))
{
# Libraries.
if ($word =~ /^-l([a-zA-Z_]\w*)$/)
{
used ('library', $1);
}
# Tokens in the code.
# We allow some additional characters, e.g., `+', since
# autoscan/programs includes `c++'.
if ($word =~ /^[a-zA-Z_][\w+]*$/)
{
used ('program', $word);
}
}
}
$file->close;
}
# scan_sh_file($SHELL-SCRIPT-NAME)
# --------------------------------
sub scan_sh_file ($)
{
my ($filename) = @_;
push @shfiles, $File::Find::name;
my $file = new Autom4te::XFile "<$filename";
while ($_ = $file->getline)
{
# Strip out comments and variable references.
s/#.*//;
s/\${[^\}]*}//g;
s/@[^@]*@//g;
# Tokens in the code.
while (s/\b([a-zA-Z_]\w*)\b/ /)
{
used ('program', $1);
}
}
$file->close;
}
# scan_file ()
# ------------
# Called by &find on each file. $_ contains the current filename with
# the current directory of the walk through.
sub scan_file ()
{
# Wanted only if there is no corresponding FILE.in.
return
if -f "$_.in";
# Save $_ as Find::File requires it to be preserved.
local $_ = $_;
# Strip a useless leading `./'.
$File::Find::name =~ s,^\./,,;
if (/\.[chlym](\.in)?$/)
{
used 'program', 'cc', $File::Find::name;
scan_c_file ($_);
}
elsif (/\.(cc|cpp|cxx|CC|C|hh|hpp|hxx|HH|H|yy|ypp|ll|lpp)(\.in)?$/)
{
used 'program', 'c++', $File::Find::name;
scan_c_file ($_);
}
elsif ((/^((?:GNUm|M|m)akefile)(\.in)?$/ && ! -f "$1.am")
|| /^(?:GNUm|M|m)akefile(\.am)?$/)
{
scan_makefile ($_);
}
elsif (/\.sh(\.in)?$/)
{
scan_sh_file ($_);
}
}
# scan_files ()
# -------------
# Read through the files and collect lists of tokens in them
# that might create nonportabilities.
sub scan_files ()
{
find (\&scan_file, '.');
if ($verbose)
{
print "cfiles: @cfiles\n";
print "makefiles: @makefiles\n";
print "shfiles: @shfiles\n";
foreach my $kind (@kinds)
{
print "\n$kind:\n";
foreach my $word (sort keys %{$used{$kind}})
{
print "$word: @{$used{$kind}{$word}}\n";
}
}
}
}
## ----------------------- ##
## Output configure.scan. ##
## ----------------------- ##
# output_kind ($FILE, $KIND)
# --------------------------
sub output_kind ($$)
{
my ($file, $kind) = @_;
# Lists of words to be checked with the generic macro.
my @have;
print $file "\n# $kind_comment{$kind}\n"
if exists $kind_comment{$kind};
foreach my $word (sort keys %{$used{$kind}})
{
# Output the needed macro invocations in $configure_scan if not
# already printed, and remember these macros are needed.
foreach my $macro (@{$macro{$kind}{$word}})
{
if ($macro =~ /^warn:\s+(.*)/)
{
my $message = $1;
foreach my $location (@{$used{$kind}{$word}})
{
warn "$location: warning: $message\n";
}
}
elsif (exists $generic_macro{$kind}
&& $macro eq $generic_macro{$kind})
{
push (@have, $word);
push (@{$needed_macros{"$generic_macro{$kind}([$word])"}},
@{$used{$kind}{$word}});
}
else
{
if (! $printed{$macro})
{
print $file "$macro\n";
$printed{$macro} = 1;
}
push (@{$needed_macros{$macro}},
@{$used{$kind}{$word}});
}
}
}
print $file "$generic_macro{$kind}([" . join(' ', sort(@have)) . "])\n"
if @have;
}
# output_libraries ($FILE)
# ------------------------
sub output_libraries ($)
{
my ($file) = @_;
print $file "\n# Checks for libraries.\n";
foreach my $word (sort keys %{$used{'library'}})
{
print $file "# FIXME: Replace `main' with a function in `-l$word':\n";
print $file "AC_CHECK_LIB([$word], [main])\n";
}
}
# output ($CONFIGURE_SCAN)
# ------------------------
# Print a proto configure.ac.
sub output ($)
{
my $configure_scan = shift;
my %unique_makefiles;
my $file = new Autom4te::XFile ">$configure_scan";
print $file
("# -*- Autoconf -*-\n" .
"# Process this file with autoconf to produce a configure script.\n" .
"\n" .
"AC_PREREQ(@VERSION@)\n" .
"AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS)\n");
if (defined $cfiles[0])
{
print $file "AC_CONFIG_SRCDIR([$cfiles[0]])\n";
print $file "AC_CONFIG_HEADER([config.h])\n";
}
output_kind ($file, 'program');
output_kind ($file, 'makevar');
output_libraries ($file);
output_kind ($file, 'header');
output_kind ($file, 'identifier');
output_kind ($file, 'function');
if (@makefiles)
{
# Change DIR/Makefile.in to DIR/Makefile.
foreach my $m (@makefiles)
{
$m =~ s/\.(?:in|am)$//;
$unique_makefiles{$m}++;
}
print $file ("\nAC_CONFIG_FILES([",
join ("\n ",
sort keys %unique_makefiles), "])\n");
}
print $file "AC_OUTPUT\n";
$file->close;
}
## --------------------------------------- ##
## Checking the accuracy of configure.ac. ##
## --------------------------------------- ##
# &check_configure_ac ($CONFIGURE_AC)
# -----------------------------------
# Use autoconf to check if all the suggested macros are included
# in CONFIGURE_AC.
sub check_configure_ac ($)
{
my ($configure_ac) = @_;
# Find what needed macros are invoked in CONFIGURE_AC.
# I'd be very happy if someone could explain to me why sort (uniq ...)
# doesn't work properly: I need `uniq (sort ...)'. --akim
my $trace_option =
join (' --trace=', '',
uniq (sort (map { s/\(.*//; $_ } keys %needed_macros)));
verb "running: $autoconf $trace_option $configure_ac";
my $traces =
new Autom4te::XFile "$autoconf $trace_option $configure_ac|";
while ($_ = $traces->getline)
{
chomp;
my ($file, $line, $macro, @args) = split (/:/, $_);
if ($macro =~ /^AC_CHECK_(HEADER|FUNC|TYPE|MEMBER)S$/)
{
# To be rigorous, we should distinguish between space and comma
# separated macros. But there is no point.
foreach my $word (split (/\s|,/, $args[0]))
{
# AC_CHECK_MEMBERS wants `struct' or `union'.
if ($macro eq "AC_CHECK_MEMBERS"
&& $word =~ /^stat.st_/)
{
$word = "struct " . $word;
}
delete $needed_macros{"$macro([$word])"};
}
}
else
{
delete $needed_macros{$macro};
}
}
$traces->close;
# Report the missing macros.
foreach my $macro (sort keys %needed_macros)
{
warn ("$configure_ac: warning: missing $macro wanted by: "
. (${$needed_macros{$macro}}[0])
. "\n");
print $log "$me: warning: missing $macro wanted by: \n";
foreach my $need (@{$needed_macros{$macro}})
{
print $log "\t$need\n";
}
}
}
## -------------- ##
## Main program. ##
## -------------- ##
parse_args;
$autoconf .= " --debug" if $debug;
$autoconf .= " --verbose" if $verbose;
$autoconf .= join (' --include=', '', @include);
$autoconf .= join (' --prepend-include=', '', @prepend_include);
my $configure_ac = find_configure_ac;
init_tables;
scan_files;
output ('configure.scan');
if ($configure_ac)
{
check_configure_ac ($configure_ac);
}
# This close is really needed. For some reason, probably best named
# a bug, it seems that the dtor of $LOG is not called automatically
# at END. It results in a truncated file.
$log->close;
exit 0;
### Setup "GNU" style for perl-mode and cperl-mode.
## Local Variables:
## perl-indent-level: 2
## perl-continued-statement-offset: 2
## perl-continued-brace-offset: 0
## perl-brace-offset: 0
## perl-brace-imaginary-offset: 0
## perl-label-offset: -2
## cperl-indent-level: 2
## cperl-brace-offset: 0
## cperl-continued-brace-offset: 0
## cperl-label-offset: -2
## cperl-extra-newline-before-brace: t
## cperl-merge-trailing-else: nil
## cperl-continued-statement-offset: 2
## End:

1063
autoconf/bin/autoupdate.in Executable file

File diff suppressed because it is too large Load Diff

150
autoconf/bin/ifnames.in Normal file
View File

@@ -0,0 +1,150 @@
#! @PERL@ -w
# -*- perl -*-
# @configure_input@
eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
if 0;
# ifnames - print the identifiers used in C preprocessor conditionals
# Copyright (C) 1994, 1995, 1999, 2000, 2001, 2002, 2003 Free Software
# Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# Reads from stdin if no files are given.
# Writes to stdout.
# Written by David MacKenzie <djm@gnu.ai.mit.edu>
# and Paul Eggert <eggert@twinsun.com>.
BEGIN
{
my $datadir = $ENV{'autom4te_perllibdir'} || '@datadir@';
unshift @INC, $datadir;
# Override SHELL. On DJGPP SHELL may not be set to a shell
# that can handle redirection and quote arguments correctly,
# e.g.: COMMAND.COM. For DJGPP always use the shell that configure
# has detected.
$ENV{'SHELL'} = '@SHELL@' if ($^O eq 'dos');
}
use Autom4te::General;
use Autom4te::XFile;
# $HELP
# -----
$help = "Usage: $0 [OPTION] ... [FILE] ...
Scan all of the C source FILES (or the standard input, if none are
given) and write to the standard output a sorted list of all the
identifiers that appear in those files in `#if', `#elif', `#ifdef', or
`#ifndef' directives. Print each identifier on a line, followed by a
space-separated list of the files in which that identifier occurs.
-h, --help print this help, then exit
-V, --version print version number, then exit
Report bugs to <bug-autoconf\@gnu.org>.
";
# $VERSION
# --------
$version = "ifnames (@PACKAGE_NAME@) @VERSION@
Written by David J. MacKenzie and Paul Eggert.
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
";
# &parse_args ()
# --------------
# Process any command line arguments.
sub parse_args ()
{
getopt ();
}
# %OCCURRENCE
# -----------
my %occurrence;
# &scan_file ($FILENAME)
# ----------------------
sub scan_file ($)
{
my ($filename) = @_;
my $file = new Autom4te::XFile ($filename);
while ($_ = $file->getline)
{
# Continuation lines.
$_ .= $file->getline
while (s/\\$//);
# Preprocessor directives.
if (s/^\s*\#\s*(if|ifdef|ifndef|elif)\s+//)
{
# Remove comments. Not perfect, but close enough.
s(/\*.*?\*/)();
s(/\*.*)();
s(//.*)();
foreach my $word (split (/\W+/))
{
next
if $word eq 'defined' || $word !~ /^[a-zA-Z_]/;
$occurrence{$word}{$filename} = 1;
}
}
}
}
## ------ ##
## Main. ##
## ------ ##
parse_args();
foreach (@ARGV)
{
scan_file ($_);
}
foreach (sort keys %occurrence)
{
print "$_ ", join (' ', sort keys %{$occurrence{$_}}), "\n";
}
### Setup "GNU" style for perl-mode and cperl-mode.
## Local Variables:
## perl-indent-level: 2
## perl-continued-statement-offset: 2
## perl-continued-brace-offset: 0
## perl-brace-offset: 0
## perl-brace-imaginary-offset: 0
## perl-label-offset: -2
## cperl-indent-level: 2
## cperl-brace-offset: 0
## cperl-continued-brace-offset: 0
## cperl-label-offset: -2
## cperl-extra-newline-before-brace: t
## cperl-merge-trailing-else: nil
## cperl-continued-statement-offset: 2
## End: