autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RFC: Autom4te: defining M4 sets


From: akim
Subject: RFC: Autom4te: defining M4 sets
Date: Tue, 21 Aug 2001 17:22:56 +0200
User-agent: Mutt/1.3.20i

There are still problems to solve with Autom4te (considered as a
package with a set of M4 files, hence the capitalization).  One of
them is that I don't know how to extend it properly to M4 libraries.

Currently running

autom4te -I /usr/share/autoconf autoconf/autoconf.m4f aclocal.m4 configure.ac 
-o configure

is the same as running autoconf.  To create an Autotest script, run

autom4te -I /usr/share/autoconf autotest/general.m4 testsuite.at -o testsuite

and so on.

Ideally, we should not need wrapper scripts such as `autoconf' or
`autotest' which sole purpose today consists in knowing `autoconf =>
-I /usr/share/autoconf autoconf/autoconf.m4f aclocal.m4', and
`autotest => -I /usr/share/autoconf autotest/general.m4'.

So I'd like to encode this knowledge into autom4te, so that one could
run

        autom4te testsuite.at

or

        autom4te configure.ac

or

        autom4te --mode=autoconf some-weird-input-name.yy -o configure

and have the right thing happen.  But I would also like to make it
user extendible, i.e., it should be hard coded in autom4te, rather it
should be defined in files.  I'd like three such files: one in
pkglibdir defining the standard libraries, one in $HOME for user
global extensions, and one in cwd for specific package extensions.

Now the actual question is how should these files look like?  What
must go in?

1. Globing
Obviously, we need some form of globing on the input file: *.ac and
configure.in map to Autoconf, *.at maps to Autotest and so on.

2. Set of lib files
Autoconf = autoconf/autoconf.m4 (or .m4f)
Autotest = autotest/general.m4
M4sh = m4sugar/m4sh.m4

3. Permission
One thing that currently autom4te doesn't support is `chmod +x'ing its
output, autoconf does it for configure for instance.  I think I'll
introduce a `-m MODE' option for the command line (or just `-x'?), but
one problem is that a set of M4 files, depending whether you use
--trace or not, yield completely different results.  OTOH, I can't
think of a place where a trace output would have to be executable, so
maybe we could just ignore -m when --trace.

4. --initialization
When tracing, using or not using the frozen files makes a difference
(typically, tracing `define' with autoconf.m4f will not output the
Autoconf macros since `define' is no longer executed).  So we might
need a means to say `when --initialization was passed, don't use the
frozen files'.  Hm, after all, this might be enough.

5. Preselected traces
autom4te caches the traces.  Say you run it asking `--trace foo', it
will run m4.  Ask for `--trace bar', it will run m4 again.  In a third
run, ask for `--trace bar --trace foo', it won't run m4, since it
keeps an incremental list of trace requests.

But it would be a pity to wait for autoheader and automake to be run
to discover we are interested in AC_CONFIG_HEADER, AC_DEFINE
etc. OT1H, and AC_SUBST, AM_INIT_AUTOMAKE etc. OTOH.  Hence we want
preselected traces, thus --preselect.

6. More?
I'm sure there are more things to think about.


Below is the current state of what I'd like to implement.  I did not
want to have some Perlism or even shism get into the syntax, so that
moving to another language must remain easy.

I still have doubts, for instance: globbing, or regex a` la PRCS?  I
enjoy the power of regex, they make it possible for the user to have
her own special rules for some very specific paths.

But there might be other problems I have not considered, so please,
comment!


------------------------------
# autom4te.cfg, generated from autom4te.in
# -*- Makefile -*-

# Autoconf.
begin mode: "Autoconf"
patterns: "*.ac"
patterns: "configure.in"
arguments: --include /usr/local/share/autoconf
arguments: autoconf/autoconf.m4f
arguments: --mode 755
# Wanted by autoheader
preselect: AC_CONFIG_HEADERS AH_OUTPUT AC_DEFINE_TRACE_LITERAL
# Wanted by Automake
preselect: AC_SUBST AC_LIBSOURCE
# Wanted by autoscan
preselect: AC_CHECK_FUNCS
preselect: AC_CHECK_HEADERS
preselect: AC_CHECK_LIB
preselect: AC_CHECK_TYPES
preselect: AC_C_CONST
preselect: AC_C_INLINE
preselect: AC_DECL_SYS_SIGLIST
preselect: AC_FUNC_ALLOCA
preselect: AC_FUNC_CHOWN
preselect: AC_FUNC_ERROR_AT_LINE
preselect: AC_FUNC_FNMATCH
preselect: AC_FUNC_FORK
preselect: AC_FUNC_FSEEKO
preselect: AC_FUNC_GETGROUPS
preselect: AC_FUNC_GETLOADAVG
preselect: AC_FUNC_GETPGRP
preselect: AC_FUNC_LSTAT
preselect: AC_FUNC_MALLOC
preselect: AC_FUNC_MEMCMP
preselect: AC_FUNC_MKTIME
preselect: AC_FUNC_MMAP
preselect: AC_FUNC_OBSTACK
preselect: AC_FUNC_SETPGRP
preselect: AC_FUNC_SETVBUF_REVERSED
preselect: AC_FUNC_STAT
preselect: AC_FUNC_STRCOLL
preselect: AC_FUNC_STRERROR_R
preselect: AC_FUNC_STRFTIME
preselect: AC_FUNC_STRTOD
preselect: AC_FUNC_UTIME_NULL
preselect: AC_FUNC_VPRINTF
preselect: AC_FUNC_WAIT3
preselect: AC_HEADER_DIRENT
preselect: AC_HEADER_MAJOR
preselect: AC_HEADER_STAT
preselect: AC_HEADER_STDC
preselect: AC_HEADER_SYS_WAIT
preselect: AC_HEADER_TIME
preselect: AC_PATH_X
preselect: AC_PROG_AWK
preselect: AC_PROG_CC
preselect: AC_PROG_CPP
preselect: AC_PROG_CXX
preselect: AC_PROG_GCC_TRADITIONAL
preselect: AC_PROG_INSTALL
preselect: AC_PROG_LEX
preselect: AC_PROG_LN_S
preselect: AC_PROG_MAKE_SET
preselect: AC_PROG_RANLIB
preselect: AC_PROG_YACC
preselect: AC_STRUCT_ST_BLOCKS
preselect: AC_STRUCT_TIMEZONE
preselect: AC_STRUCT_TM
preselect: AC_TYPE_MODE_T
preselect: AC_TYPE_OFF_T
preselect: AC_TYPE_PID_T
preselect: AC_TYPE_SIGNAL
preselect: AC_TYPE_SIZE_T
preselect: AC_TYPE_UID_T
end mode: "Autoconf"

# Autotest
begin mode: "Autotest"
patterns: *.at
arguments: --include /usr/local/share/autoconf
arguments: autotest/general.m4
arguments: --mode 755
end mode: "Autotest"

# M4sh
begin mode: "M4sh"
patterns: *.as
arguments: --include /usr/local/share/autoconf
arguments: m4sugar/m4sh.m4
arguments: --mode 755
end mode: "M4sh"

# M4sugar
begin mode: "M4sh"
patterns: *.msh
arguments: --include /usr/local/share/autoconf
arguments: m4sugar/m4sugar.m4
end mode: "M4sh"
------------------------------




reply via email to

[Prev in Thread] Current Thread [Next in Thread]