(AC_SYS_LARGEFILE_TEST_INCLUDES): Don't reject
[autoconf.git] / TODO
blob697ceffa78db650ffd3ed117544ff46e73c4aa3d
1 -*- outline -*-
3 Things it might be nice to do someday.  I haven't evaluated all of
4 these suggestions... their presence here doesn't imply my endorsement.
5 -djm & his successors.
8 ------------------------------------------------------------------------------
10 * Autoconf 2.50
12 ** --target & AC_ARG_PROGRAM
13 Shouldn't *any* `program' be installed as `$target_alias-program' even
14 if AC_ARG_PROGRAM is not called?  That would be much more predictable.
15 Ian?
17 ** Document
18 Automake, Libtool.
20 ** AC_CHECK_TOOL...
21 Write a test that checks that it honors the values set by the user.
23 * Autoconf 2.51
25 ** AC_CHECK_FUNCS and AC_TRY_LINK_FUNC
26 I have still not understood what's the difference  between the two
27 which requires to have two different sources: AC_LANG_CALL and
28 AC_LANG_FUNC_LINK_TRY (which names seem to be inappropriate).
29 Wouldn't one be enough?
31 ** autom4te
32 Eve it out of autoconf.  Install support for Autotest, M4sugar, and
33 M4sh.  Give a means to trace at the same time as we produce the
34 output.  autoconf shall use this feature to make autoheader obsolete,
35 and to produce some kind of input file for automake which should no
36 longer *ever* try to parse Autoconf files.
38 ** Autotest
39 Document it.
41 ** Document AC_COMPILE_IFELSE, AC_LANG_PROGRAM etc.
42 And make AC_TRY_COMPILE etc. obsolete.
44 ** Autoscan macros
45 Can be introduced even before specializing macros.  It just means that
46 specializing macros will call them.  OTOH, this doubles our work,
47 since specializing macros will save us from additional typing.  But
48 the more powerful autoscan is, the better...
50 * Autoconf 2.51 or later
52 ** Libtool
53 Define once for all the hooks they need, any redefinition of
54 AC_PROG_CC etc. is way too dangerous and too limiting.  The GCC team
55 certainly has requirements too.
57 ** Pentateuch
58 Heck, there is nothing after `Deuteronomy'!  We're stuck, but we
59 _must_ update the `history' section.  Can't go to `New testament', we
60 might hurt feelings?  In addition, it means that the Messiah has come,
61 which might be slightly presumptuous :).  Still, someone fluent in
62 English should write it.
64 ** AC_FUNC_GETLOADAVG
65 We must find a solution for this macro which needs to find
66 `getloadavg.c'.
68 ** Revamp the language support
69 We should probably have a language for C89, and C99.  We must give the
70 means to the users to specify some needs over the compilers, and
71 actually look for a good compiler, instead of stopping at the first
72 compiler we find.
74 In fact, the AC_CHECK_PROG macro and variations have proved their
75 limitation: we really need something more powerful and simpler too.
77 We must take into account the specific problems of the GCC team.  We
78 must extend AC_CHECK_FUNCS in order to use the headers instead of fake
79 declarations as we currently do.  Default headers could be triggered
80 on when C99, but not with the other languages?
82 At the end, we should have a simple macro, such as AC_LANG_COMPILER
83 for instance, which is built over simpler macros.  Each language
84 support should come with these simpler macros, but each language
85 should follow the same process.
87 We also need to check the srcext which are supported by the compiler.
88 In fact, this macro is also probably the right place to check for
89 objext and exeext.
91 ** AC_PROG_CC_STDC
92 Should be: AC_PROG_CC_ISO?  Or even more specific for the ISO version?
93 Should include more tests (e.g., AC_C_CONST etc.)?
95 ** AC_SYS_INTERPRETER
96 Defines $interpval.  This is not a standard name.  Do we want to keep
97 this?  Clarify our policy on those names.
99 ** autoupdate
100 We should probably install the files which do not depend upon the
101 user, just the Autoconf library files.  But conversely autoupdate must
102 be opened to user macros, i.e., for instance libtool itself must be
103 able to say that AM_PROG_LIBTOOL is now AC_PROG_LIBTOOL, and have
104 autoupdate do its job on old configure.in.
106 ** AC_LIBOBJ_DECL
107 Decide with the Automake team whether this macro should list only `.c'
108 files, or it should include the `.h' too.  For instance the
109 AC_FUNC_GNU_GETOPT macro could provide the three files, likewise for
110 the macro which allows to choose a regex engine.
112 ** Allow --recursive to config.status
113 So that --recheck does not pass --no-recursive to configure.
115 ** AC_PROG_CC_STDC
116 Well, back onto this one :( See Peter for very useful comments on the
117 technology.  Should we make this a new language?  AC_LANG(ISO C).  It
118 would be great to introduce AC_LANG_COMPILER in this release too.
120 ------------------------------------------------------------------------------
122 * Automake
124 ** missing.m4
125 The test for a recent missing doesn't hide the error messages from the
126 old missing.
128 ** AU_DEFUN
129 The section for old macros is not completely up to date.  For
130 instance, there is still AM_PROG_LIBTOOL.  Anyway, since autoupdate
131 takes care of them, it is no longer the role of Automake to handle
132 this.  Most should be removed.
134 ** AC_EXEXT, AC_OBJEXT
135 Support should be enabled by default.
137 ** Macros now swallowed by Autoconf.
138 error.m4, obstack.m4, ptrdiff.m4, strtod.m4, termios.m4, winsz.m4.
140 ------------------------------------------------------------------------------
142 * m4
144 ** I18n
145 The error messages for indir and dumpdef are uselessly different.  Fix
146 this for translators.
148 ** Tracing `builtin'
149 F**k!  --trace FOO does not catch indir([FOO], $@)!
151 ** Tracing builtins
152 GNU M4 1.4's tracing of builtins is buggy.  When run on this input:
154 | divert(-1)
155 | changequote([, ])
156 | define([m4_eval], defn([eval]))
157 | eval(1)
158 | m4_eval(2)
159 | undefine([eval])
160 | m4_eval(3)
162 it behaves this way:
164 | % m4 input.m4 -da -t eval
165 | m4trace: -1- eval(1)
166 | m4trace: -1- m4_eval(2)
167 | m4trace: -1- m4_eval(3)
168 | %
170 Conversely:
172 | % m4 input.m4 -da -t m4_eval
173 | %
175 ------------------------------------------------------------------------------
177 * Autoconf 3
179 ** Split all those &#@! files.
180 acgeneral and acspecific is a bad design.  The split should be done
181 according to the families.  For instance AC_CHECK_FUNCS,
182 AC_CHECK_FUNC, AC_FUNC_FNMATCH etc. *and* AH_CHECK_FUNCS, AU_* should
183 be in, acfunc.m4.  I suppose there should be small exceptions, e.g.,
184 the family AC_REPLACE_FUNCS should still be in acfunc.m4.
186 ** Cache name spaces.
187 Cf the discussion with Kaveh.  One would like to
188 AC_CHECK_FUNCS(bar)
189 # Do something that changes the environment
190 AC_CACHE_PUSH(foo)
191 AC_CHECK_FUNCS(bar)
192 AC_CACHE_POP
193 in order not to erase the results of a check with another.
195 ** Cache var names
196 should depend upon the current language.
198 ** Use m4 lists?
199 I think one sad decision in Autoconf was to use white space separated
200 lists for some arguments.  For instance AC_CHECK_FUNCS(foo bar).  I
201 tend to think that, even if it is not as nice, we should use m4 lists,
202 i.e., AC_CHECK_FUNCS((foo, bar)) in this case.  This would ease
203 specializing loops, and more importantly, make them much more robust.
205 A typical example of things that can be performed if we use m4 lists
206 instead of white space separated lists is the case of things that have
207 a space in their names, eg, structures.
209 With the current scheme it would be extremely difficult to loop over
210 AC_CHECK_STRUCTS(struct foo struct bar), while it natural and well
211 defined for m4 lists: AC_CHECK_STRUCTS((struct foo, struct bar)).
213 I know that makes a huge difference in syntax, but a major release
214 should be ready to settle a new world.  We *can* provide helping tools
215 for the transition.  Considering the benefits, I really think it is
216 worth thinking. --akim
218 ** Forbid shell variables as main arguments
219 The fact that we have to support shell variables as main argument
220 forbids many interesting constructions (specialization are not always
221 possible, equally for AC_REQUIRE'ing macros *with their arguments*).
222 Any loop should be handled by m4 itself, and nothing should be hidden
223 to it.  As a consequence, shell variables on the main arguments become
224 useless (the main reason we support shell variables is to allow the
225 loop versions of single argument macros, eg, to go from AC_CHECK_FUNC
226 to AC_CHECK_FUNCS). --akim
228 ** Use the @SUBST@ technology also for headers instead of #undef.
229 This requires that acconfig.h becomes completely obsolete: autoheader
230 should generate all the templates.
232 ** Specializing loops.
233 For instance, make AC_CHECK_FUNC[S] automatically use any particular
234 macros for the listed functions.
235 This requires to obsolete the feature `break' in ACTION-IF, since all
236 the loops are to be handled by m4, not sh.
238 ** Faces of a test
239 Each macro can potentially come with several faces: of course the
240 configure snippet (AC_foo), a config.h snippet (AH_foo), a system.h
241 snippet (AS_foo), documentation (AD_foo) and, why not, the some C code
242 for instance to replace a function.
244 The motivation for the `faces' is to encapsulate.  It is abnormal that
245 once one has a configure macro, then she has to read somewhere to find
246 the piece of system.h to use etc.  The macros should come in a
247 self-contained way, or, said it another way, PnP.
249 A major issue is that of specialization.  AC_CHECK_HEADER (or another
250 name) for instance, will have as an effect, via system.h to include
251 the header.  But if the test for the header is specific, the generic
252 AS_CHECK_HEADER will still be used.  Conversely, some headers may not
253 require a specific AC_ tests, but a specialized AS_ macro.
255 ------------------------------------------------------------------------------
257 * Make AC_CHECK_LIB check whether the function is already available
258   before checking for the library.  This might involve adding another
259   kind of cache variable to indicate whether a given function needs a
260   given library.  The current ac_cv_func_ variables are intended to
261   indicate whether the function is in the default libraries, but
262   actually also take into account whatever value LIBS had when they
263   were checked for.
265   Isn't this the issue of AC_SEARCH_LIB? --akim
266   How come the list of libraries to browse not an additional parameter
267   of AC_CHECK_FUNC, exactly like for the headers? --akim
269 ------------------------------------------------------------------------------
271 * Add AC_PROG_CC_POSIX to replace the current ad-hoc macros for AIX,
272   Minix, ISC, etc.
274 ------------------------------------------------------------------------------
276 * Support creating both config.h and DEFS in the same configure.
278 ------------------------------------------------------------------------------
280 * Select the right CONFIG_SHELL automatically (for Ultrix, Lynx especially.)
282 ------------------------------------------------------------------------------
284 * Doc: Centralize information on POSIX, MS-DOS, cross-compiling, and
285   other important topics.
287 ------------------------------------------------------------------------------
289 * Mike Haertel's suggestions:
291 ** Provide header files containing decls for alloca, strings, etc.
293 ** Cross compiling:
295 *** Error messages include instructions for overriding defaults using
296 config.site.
298 *** Distribute a config.site corresponding to a hypothetical bare POSIX system with c89.
300 ** Site defaults:
302 *** Convention for consistency checking of env vars and options in config.site so config.site can print obnoxious messages if it doesn't like options or env vars that users use.
304 ------------------------------------------------------------------------------
306 * Look at user contributed macros:
307         IEEE double precision math
308         more
310 ------------------------------------------------------------------------------
312 For AC_TYPE_SIGNAL signal handlers, provide a way for code to know
313 whether to do "return 0" or "return" (int vs void) to avoid compiler
314 warnings.  (Roland McGrath)
316 ------------------------------------------------------------------------------
318 In config.status comment, put the host/target/build types, if used.
320 ------------------------------------------------------------------------------
322 on hal.gnu.ai.mit.edu, configure is getting the wrong answer for
323 AC_CHECK_FUNCS(select).
325 The problem here is that there's severe name space pollution: when
326 conftest.c includes <ctype.h> to pick up any __stub macro definitions,
327 it's getting a prototype declaration for select(), which collides
328 with the dummy declaration in conftest.c.  (The chain of includes
329 is conftest.c -> <ctype.h> -> <sys/localedef.h> -> <sys/lc_core.h>
330 -> <sys/types.h> -> <sys/select.h>.)
332         #define $ac_func __dummy_$ac_func
333         #include <ctype.h>
334         #undef $ac_func
335 From: kwzh@gnu.ai.mit.edu (Karl Heuer)
337 The test for the isascii function was failing because that function is
338 also a macro.  He proposed that the test file look like this:
340 /* Remove any macro definition. */
341 #undef isascii
342 /* Override any gcc2 internal prototype to avoid an error.  */
343 char isascii(); isascii();
345 Andreas Schwab
347 ------------------------------------------------------------------------------
349 It would be nice if I could (in the Makefile.in files) set
350 the path to config.h. You have config.h ../config.h ../../config.h's all
351 over the place, in the findutils-4.1 directory.
352 From: "Randall S. Winchester" <rsw@eng.umd.edu>
354 ------------------------------------------------------------------------------
356 In a future version (after 2.2), make AC_PROG_{CC,RANLIB,anything else}
357 use AC_CHECK_TOOL.
358 From Roland McGrath.
360 ------------------------------------------------------------------------------
362         ls -lt configure configure.in | sort
363 doesn't work right if configure.in is from a symlink farm, where the
364 symlink has either a timestamp of its own, or under BSD 4.4, it has
365 the timestamp of the current directory, neither of which
366 helps. Changing it to
367         ls -Llt configure configure.in | sort
368 works for me, though I don't know how portable that is
369 _Mark_ <eichin@cygnus.com>
371 ------------------------------------------------------------------------------
373 Here is the thing I would like the most;
374 AC_PKG_WITH(PACKAGE, HELP_STRING, PACKAGE-ROOT, PACKAGE-LIBS, PACKAGE-DEFS,
375         PACKAGE-CCPFLAGS)
376 like
378 AC_PKG_WITH(kerberos,,/usr/local/athena,-lkrb -ldes,[KERBEROS KRB4
379 CRYPT],include)
380 AC_PKG_WITH(hesiod,
381 [if hesiod is not in kerberos-root add --with-hesiod-root=somewhere]
382 ,,-lhesiod,HESIOD,,)
383 AC_PKG_WITH(glue,,,-lglue,GLUE,,)
384 AC_PKG_WITH(bind,,/usr/local/bind, [lib/resolv.a lib/lib44bsd.a], ,include)
385 After the apropriate checks, the existance of the paths, and libs and such
386 LIBS=$LIBS $PKG-LIBS
387 DEFS=$DEFS $PKG-DEFS
388 CPPFLAGS=$PKG-CPPFLAGS $CPPFLAGS
389 $PKG-ROOT=$PKG-ROOT
390 The cppflags should reverse the order so that you can have;
391 -I/usr/local/bind/include -I/usr/local/athena/include
393 -L/usr/local/athena/lib -lkrb -ldes /usr/local/bind/lib/libresolv.a
394 as order matters.
396 also an AC_PKG_CHK_HEADER
397 and an AC_PKG_CHK_FUNCTION
398 so one can give alternate paths to check for stuff ($PKG-ROOT/lib for
399 example)
400 From: Randall Winchester
402 ------------------------------------------------------------------------------
404 AC_C_CROSS assumes that configure was called like 'CC=target-gcc;
405 ./configure'. I want to write a package that has target dependent
406 libraries and host dependent tools. So I don't like to lose the
407 distinction between CC and [G]CC_FOR_TARGET.  AC_C_CROSS should check
408 for equality of target and host.
410 It would be great if
412 GCC_FOR_TARGET
413 AR_FOR_TARGET
414 RANLIB_FOR_TARGET
416 would be set automatically if host != target.
417 AC_LANG_CROSS_C would be nice too, to check header files
418 etc. with GCC_FOR_TARGET instead of CC
420 Here is one simple test
422 if test "x$host" != "x$target"; then
423 AC_PROGRAMS_CHECK(AR_FOR_TARGET, $target-ar, $target-ar, ar)
424 AC_PROGRAMS_CHECK(RANLIB_FOR_TARGET, $target-ranlib, $target-ranlib, ranlib)
425 AC_PROGRAMS_CHECK(GCC_FOR_TARGET, $target-gcc, $target-gcc, gcc)
428 This could be improved to also look for gcc in PATH, but require the
429 prefix to contain the target e.g.:
431 target=m68k-coff -->GCC_FOR_TARGET = /usr/gnu/m68k-coff/bin/gcc
433 From: nennker@cs.tu-berlin.DE (Axel Nennker)
435 ------------------------------------------------------------------------------
437 The problem occurs with the following libc functions in SunOS 5.4:
439         fnmatch glob globfree regcomp regexec regerror regfree wordexp wordfree
441 It also occurs with a bunch more libposix4 functions that most people
442 probably aren't worried about yet, e.g. shm_open.
444 All these functions fail with errno set to ENOSYS (89)
445 ``Operation not applicable''.
447 Perhaps Autoconf should have a specific macro for fnmatch, another for
448 glob+globfree, another for regcomp+regexec+regerror+regfree, and
449 another for wordexp+wordfree.  This wouldn't solve the problem in
450 general, but it should work for Solaris 2.4.  Or Autoconf could limit
451 itself to fnmatch and regcomp, the only two functions that I know have
452 been a problem so far.
454 From Paul Eggert.
456 ------------------------------------------------------------------------------
458 Make easy macros for checking for X functions and libraries, such as Motif.
460 ------------------------------------------------------------------------------
462 There are basically three ways to lock files
463         lockf, fnctl, flock
464 I'd be interested in adding a macro to pick the "right one" if you're
465 interested.
467 From:    Rich Salz <rsalz@osf.org>
469 ------------------------------------------------------------------------------
471 Timezone calculations checks.
473 ------------------------------------------------------------------------------
475 Support different default filesystem layouts, e.g. SVR4, Linux.
476 Of course, this can be done locally with config.site.
478 ------------------------------------------------------------------------------
480 I wonder if it is possible to get the path for X11's app-defaults
481 directory by autoconf. Moreover, I'd like to have a general way of
482 accessing imake variables by autoconf, something like
484 AC_DEFINE(WINE_APP_DEFAULTS, AC_IMAKE_VAR(XAPPLOADDIR))
486 Slaven Rezic <eserte@cabulja.herceg.de>
488 ------------------------------------------------------------------------------
490 Cache consistency checking: ignore cache if environment
491 (CC or PATH) differs.
492 From Mike Haertel
494 So we need a general mechanism for storing variables' values in the cache,
495 and checking if they are the same after reading the cache.  Then we can add
496 to the list of variables as we come across the need.  So far we want
497 LD_LIBRARY_PATH and the internal variables for some of (all?) the args.
498 From: roland@gnu.ai.mit.edu (Roland McGrath)
500 Hmm.  That list might include LD_LIBRARY_PATH, LD_RUN_PATH (for solaris),
501 and PATH.  I can't think of any others so far.
502 From: friedman@splode.com (Noah Friedman)
504 ------------------------------------------------------------------------------
506 Every user running X11 usually has a directory like *X11* in his PATH
507 variable. By replacing bin by include, you can find good places to
508 look for the include files or libraries.
510 From: rcb5@win.tue.nl (Richard Verhoeven)
512 ------------------------------------------------------------------------------
514 In most cases, when autoscan suggests something, using the search or
515 index command into the Info reader for autoconf manual quickly
516 explains me what the test is about.  However, for header files and
517 functions, the search might fail, because the test is not of the
518 specific kind.  The Autoconf manual should reflect somewhere all
519 header files or functions (non-specific features, generally)
520 triggering autoscan to generate tests, and tell in a few words what is
521 the problem, and the suggested approach for a solution; that is, how
522 one should use the result of testing the feature.
524 From: pinard@iro.umontreal.ca
526 ------------------------------------------------------------------------------
528 It would be nice if the configure script would handle an option such as
529 --x-libraries="/usr/openwin/lib /usr/dt/lib".
531 Rick Boykin <rboykin@cscsun3.larc.nasa.gov>
533 Under Solaris 2.4, the regular X includes and libs and the Motif
534 includes and libs are in different places.  The Emacs configure script
535 actually allows dir1:dir2:dir3 --
537     if test "${x_libraries}" != NONE && test -n "${x_libraries}"; then
538       LD_SWITCH_X_SITE=-L`echo ${x_libraries} | sed -e "s/:/ -L/g"`
539       LD_SWITCH_X_SITE_AUX=-R`echo ${x_libraries} | sed -e "s/:/ -R/g"`
540     fi
541     if test "${x_includes}" != NONE && test -n "${x_includes}"; then
542       C_SWITCH_X_SITE=-I`echo ${x_includes} | sed -e "s/:/ -I/g"`
543     fi
545 ------------------------------------------------------------------------------
547     What messages should be produced by default, if any?
549 Probably only the few most important ones, like which configuration
550 name was used, whether X or Xt are in use, etc. The specific
551 decisions, and progress messages, should be recorded on the terminal
552 only if --verbose is used.
554     --silent just supresses the "checking for...result"
555     messages, not the "creating FOO" messages.
557 I think the default should be to suppress both.
558 From: Richard Stallman <rms@gnu.ai.mit.edu>
560 There is no distinction now between
561 important decisions (we have X) vs minor decisions (we have lstat).
562 However, there are probably only a few things you deem important enough to
563 announce and only those few things will need to be changed.
564 Perhaps config.status could be written with comments saying what was
565 decided.
566 From: Roland McGrath <roland@gnu.ai.mit.edu>
568 ------------------------------------------------------------------------------
570 Another thing I wish for is a macro which figures out which libraries are
571 needed for BSD-sytle sockets.  AC_PATH_X already detects this
572 correctly...so it's just a matter of seperating out the socket-related code.
573 From: "Joel N. Weber II" <nemo@koa.iolani.honolulu.hi.us>
575 ------------------------------------------------------------------------------
577 in order to use the AC_CANONICAL_SYSTEM macro, I have to have
578 install-sh somewhere nearby --- why is this?  I have no real reason to
579 distribute install-sh, other than that its absence breaks this code.
581 Shouldn't the above loop be looking for config.sub and config.guess?
582 From: jimb@totoro.bio.indiana.edu (Jim Blandy)
584 adding AC_CANONICAL_HOST to my configure.in script caused
585 all sorts of odd/unexplained errors.  Obviously, I had to go
586 get copies of config.guess, config.sub and install-sh from the
587 autoconf distribution, but the error messages and autoconf docs
588 didn't explain that very well.
589 From: bostic@bsdi.com (Keith Bostic)
591 ------------------------------------------------------------------------------
593 Perhaps also have AC_TRY_COMPILER try to link an invalid program, and
594 die if the compiler seemed to succeed--in which case it's not usable
595 with autoconf scripts.
597 ------------------------------------------------------------------------------
599 autoreconf doesn't support having (in the same tree) both directories
600 that are parts of a larger package (sharing aclocal.m4 and
601 acconfig.h), and directories that are independent packages (each with
602 their own ac*).  It assumes that they are all part of the same
603 package, if you use --localdir, or that each directory is a separate
604 package, if you don't use it.
606 autoreconf should automatically figure out which ac* files to use--the
607 closest ones up the tree from each directory, probably, unless
608 overridden by --localdir.
610 Also, autoreconf recurses on all subdirectories containing a
611 configure.in, not just those given by an AC_CONFIG_SUBDIRS directive.
612 This may not be a problem in practice.
614 ------------------------------------------------------------------------------