(generate_makefile): Detect write/close failure.
[automake.git] / TODO
blob72e86f8a129195e5826f2f87d03bbdcc1c48620a
1 * in depend2.am, in specialization case, what if @SOURCE@ is found
2   in srcdir?  We can't depend on $<!  We must search explicitly.
3   this is a very serious problem!
4   one solution would be to make built-source handling smarter and
5   a bit more strict.  For instance require that built sources
6   have an associated target.  In this case we must also handle suffix
7   rules and the like.
9 * Document why putting @FOO@ in _SOURCES doesn't work.
10   This must be done for 1.5
12 * think about how per-object flags should work.  in particular:
13   * how should they be specified?
14     using the object name is confusing when .lo/.obj in use
15     however, the object name provides a nice interaction with
16     per-exe flags
17   * how should they interact with per-executable flags?
19 * cross-compilation support:
20   programs built and used by the build process need to be
21   built for CC_FOR_BUILD
22   introduce a new variable for this
23   [ we can do this in an automatic way I think.
24     unfortunately it isn't that useful until autoconf has support
25     for this sort of thing as well ]
27 * distcheck should make sure that each file that uses _() is
28   listed in POTFILES.in
29   From Jim Meyering:
30     # Verify that all source files using _() are listed in po/POTFILES.in.
31     po-check:
32             grep -E -v '^(#|$$)' po/POTFILES.in | sort > $@-1
33             grep -E -l '\b_\(' lib/*.c src/*.c | sort > $@-2
34             diff -u $@-1 $@-2
35             rm -f $@-1 $@-2
37 * support prog_LIBS as override for LIBS
39 * Scan configure.in using the same trick that autoheader uses.
40   This will be much more reliable.
42 * Test subdir-objects option with yacc, lex, ansi2knr
43   Our locking scheme won't prevent a parallel make from losing
44   if there are two `bar.o' files and the timing is just right
45   This only happens with parallel make and no-`-c -o' compiler,
46   so it probably isn't very important
47   `-c -o' when doing libtool
48   try to find a losing compiler and see if it really works.
49   (actually: hack config.cache and do it)
51 * We're using `$<' in explicit rules when using per-exe flags
52   per-exe flags don't work for CPPFLAGS/YFLAGS/LFLAGS.  Fix.
53   LIBOBJS shouldn't be used when there are per-exe flags (?)
55 * Need a way to pass flags to makeinfo
56   esp --no-split
58 * test `make clean' with subdir-objects
60 * Test nodist_SOURCES with lex, yacc, etc.
62 * Support subdir-objects with fortran
64 * Allow creation of Java .zip/.jar files in natural way
65   If you are building a compiled Java library, then the .zip/.jar
66   ought to be made automatically.
68 * Run automake before libtool.  It will report an error but
69   still won't put the file into the disty.  This is wrong.
70   From Mark H Wilkinson <mhw@kremvax.demon.co.uk>
72 * CFLAGS only defined if C source seen
73   but really it should be a configure variable, shouldn't it?
74   There are other examples of this
75   [ moving to autoconf --trace ought to fix this ]
77 * in gnu/gnits mode, give error if Makefile.am overrides a user
78   variable like CFLAGS.
79   [ this is low priority because the package author can always
80     circumvent our check by redefining in configure.in
81     plus it is probably better to encourage good behavior than to
82     punish bad ]
84 * If we see `foo.o' in LIBOBJS, and we've seen AC_OBJEXT, then complain.
85   [ how will we know that?  it is better to handle this automatically
86     via an autoconf hook ]
88 * examine possibility of using any character in a macro name
89   and rewriting names automatically.  this means we must rewrite
90   all references as well.
91   [ this is a 2.0-style feature ]
93 * AM_CONFIG_HEADER might generate the wrong stamp file names
94   when given multiple headers.  Write a test.
96 * Currently don't correctly handle multiple inputs to a config header.
98 * header stamp files still in wrong dirs.
99   stamp-h.in must be in dir with h.in file
100   stamp-h must be in dir with output file
102 * foo=bar
103   if cond
104   foo += joe
105   endif
106   ... this ought to work.  The fix is probably complicated
108 * `distcheck' and `dist' should depend on `all'
110 * Add code to generate foo-config script like gnome, gtk
112 * `DEFS += foo' won't work.
113   That's because DEFS is defined in header-vars.am, which is read
114   after the user's Makefile.am.
115   This will be a problem for any macro defined internally
116     [ fixing this will probably fix the nasty `exeext redefines
117       foo_PROGRAMS' hack that is in there right now ]
118     [ we currently give an error when this occurs, so this is very low
119       priority ]
121 * document user namespace for macro/target names
122   adopt some conventions and use uniformly
123     [ this is a good thing for the rewrite ]
125 * make distcheck uses directories like `=build'.
126   Some (very rare) POSIX systems don't support `=' in filenames.
127   If this ever becomes a problem, fix it
129 * distclean must remove config.status
130   can't this cause problems for maintainer-clean?
131   shouldn't maintainer-clean print the message before running
132   any part of the make?  (just to slow things down long enough
133   for the user to stop it)
134   (maybe doesn't matter since people who even know about
135   maintainer-clean already have a clue)
137 * There are probably more bugs in variable_conditions_sub along
138   the lines of the one that caused cond4.test to fail.
140 * reintroduce AM_FUNC_FNMATCH which sets LIBOBJS
141   Then have automake know about fnmatch.h.
142     [ probably should wait for autoconf to get right functionality ]
144 * Allow per-object cflags:
145         bin_PROGRAMS = foo
146         foo_CFLAGS = -DFOO
147 * per-object compiler flags do not apply to libobjs
148   -> give error in this case
149 * At the same time, allow sources in subdirs:
150         foo_SOURCES = x/y.c
151   This requires `mkdir x' at build time
152  [ both of these require per-file rules, and not pattern rules ]
153  [ use user-written suffix rules to generate the per-file rules in
154    an automatic way -- this would be mucho cool ]
156 * Every program foo has FOOFLAGS right now.
157   It should also have AM_FOOFLAGS, which can be set in Makefile.am.
158 DONE: but needs to be documented
160 * "make diff" capability
161   look at gcc's Makefile.in to see what to do
162   or look at maint program
164 * BUILT_SOURCES should not be distributed, even when they appear in
165   another _SOURCES line. [? or maybe just leave this up to the
166   to-be-defined generic distribution method ]
167   must completely revisit the entire BUILT_SOURCES idea
169 * in --cygnus, clean-info not generated at top level
171 * what if an element of a scanned variable looks like
172         $(FOO).$(BAR)  ?
173   or some other arbitrary thing?
174   right now we try to cope, but not very well
175     [ this is only of theoretical interest for now ]
177 * make sure every variable that is used is also defined
178     [ we don't really look at variable uses in detail.
179       2.0 thing ]
181 * make sure `missing' defines are generated
182 * if no AM_INIT_AUTOMAKE, then don't handle `missing' stuff.
183   Yuck!
184 * missing should handle install -d and rmdir -p (for uninstall)
186 * a couple ways to be smarter:
187   - notice when a .c file is a target somewhere, and auto-add it to
188     BUILT_SOURCES
189   - notice a target of the form `.x.y:' and assume it is a suffix rule
191 * NORMAL_INSTALL / NORMAL_UNINSTALL -vs- recursive rules
192   [ requires changes to the standard ]
194 * copyrights on m4 files, aclocal output
196 * should not put texiname_TEXINFOS into distribution
197   should rename this macro anyway, to foo_texi_DEPENDENCIES
199 * *all* installed scripts should support --version, --help
201 For now I guess I'll just have automake give an error if it encounters
202 non-C source in a libtool library specification.
204 * must split $obj into two parts: one for libtool and one for
205   deansification.  Otherwise .S files will be deansified!
207 * ansi2knr must currently appear in a directory that has some source
209 * if program has the same name as a target, do something sensible:
210   - if the target is internal, rename it
211   - if the target is mandated (eg, "info"), tell the user
212     consider auto-modifying the program name to work around this
214 * should separate actual options from strictness levels
215   strictness should only cover requirements
216   You should be able to pick and choose options
218 should clean up texinfos.am; one rule is repeated 3 times, but
219 shouldn't be
221 should always use perl -w
223 rewrite in guile (RMS request)
224 at the same time, consider adding a GUI
225 could use the same parsing code for the GUI and the standalone version
226 that means figuring out a better representation of internal state
227 [ that's easy -- anything is better than what we have now ]
229 having just one Makefile for a project would give a big speed increase
230 for a project with many directories, eg glibc.  ideally (?) you'd
231 still be able to have a Makefile.am in each directory somehow; this
232 might make editing conceptually easier.
234 * finish up TAGS work
235 * `acinstall'
237 * only remove libtool at top level?
239 * clean up source directory by moving stuff into subdirs
241 * consider adding pkglibexecdir, maybe others?
242   requests for pkg-dirs with version included
244 Avoid loops when installing; instead unroll them in automake
246 * for new autoconf:
247   * completely handle multi-":" mode for AC_CONFIG_HEADER
248   * Scan multiple input files when Makefile is generated?
249     This would provide flexibility for large projects; subsumes
250     the "Makefile.tmpl" idea
252    [ can't do this.  must explain why in manual.
253      basically, solving all the problems is too hard
254      like: how to remove redundancies between generated .in files
255      instead should implement `include' directive for Makefile.am ]
256 * for multi-":" mode and AC_OUTPUT, it might be good to pick the
257   first input file that has a corresponding .am file.
259 Some long-term projects:
260 * if $(FOO) is used somewhere, ensure FOO is defined, either by
261   user or by automake if possible
263 [ include, += support ]
264 * even better would be allowing targets in different included
265   fragments to be merged.  e.g., `install-local'.
267 consider putting all check-* targets onto @check?
268 To support --help/--version checking?
270 take diff-n-query code from libit
272 Per Bothner says:
273 Per> 1) Being able to build a set of non-source programs
274 Per> from source programs, without necessarily linking them together.
275 Per> I.e. one should be able to say something like:
276 Per>    dummy_SOURCES=foo.c bar.c
277 Per> and automake should realize that it needs to build foo.o and bar.o.
278 Per> 2) Being intelligent about new kinds of suffixes.
279 Per> If it sees:
280 Per>    SUFFIXES = .class .java
281 Per> and a suffix rule of the form:
282 Per>    .java.class:
283 Per> then it should be able to realize it can build .class files from
284 Per> .java files, and thus be able to generate a list of
285 Per> .class files from a list of .java source files.
287 !! Must fix require_file stuff.  It is really gross, and I don't
288    understand it any more.
290 Jim's idea: should look for @setfilename and warn if filenames too long
291 * guess split size
293 ** many requests for a way to omit a file from the distribution.
294    Should be done like `!foo' or `~foo' in _SOURCES, etc.
295    Such files should be removed explicitly after the copy step!
296    Doing this requires rewriting macros before generating Makefile.in.
298 from joerg-martin schwarz:
299  -- If Makefile.am contains $(CC), $(COMPILE), $(YLWRAP), .... 
300     in an explicitly written rule,  you should emit the corresponding
301     Makefile variables automatically.
303 Configuring in the large:
304 * allow hierarchy of dirs to share one aclocal.m4
305   How?
307 consider printing full file name of Makefile.am or configure.in when
308 giving error.  This would help for very large trees with many
309 configure.in scripts
311 From the GNU Standards.  These things could be checked, and probably
312 should be if --gnu.
313 *    Make sure that the directory into which the distribution unpacks (as
314 well as any subdirectories) are all world-writable (octal mode 777).
315 *   Make sure that no file name in the distribution is more than 14
316 characters long.
317 *    Don't include any symbolic links in the distribution itself.
318      (ditto hard links)
319 *    Make sure that all the files in the distribution are world-readable.
320 ** also, check --help output and --version output.  Idea from François
321 * standards no longer prohibit ANSI C.  What does this imply
322   for the de-ansi-fication feature? [ must keep it -- some users rely on it ]
324 should be able to determine what is built by looking at rules (and
325 configure.in).  Then built man pages (eg) could automatically be
326 omitted from the distribution.
328 Henrik Frystyk Nielsen says:
329 Henrik> 4) Flags like --include-deps are lost when you make changes to
330 Henrik> Makefile.am files and automake is run automatically. It would
331 Henrik> be nice to keep these flags as I now have to redo everything
332 Henrik> manually.
333 ... what about other options here too?
335 Think about: maybe "make check" should just bomb if error occurs?
336 Then user must use "make -k check".  This is probably more natural.
338 Consider: "cvs" option adds some cvs-specific rules?
340 Right now, targets generated internally (eg "install") are not
341 overridable by user code.  This should probably be possible, even
342 though it isn't very important.  This could be done by generating all
343 internal rules via a function call instead of just appending to
344 $output_rules.
345  [ this will be harder to implement when scanning a rule like all-recursive
346    from subdirs.am ]
348 * Should be a way to have "nobuild_PROGRAMS" which aren't even built,
349   but which could be by running the magic make command.
351 Other priorities:
352 * Must rewrite am_install_var.  Should break into multiple functions.
353   This will allow the callers to be a little smarter.
354 * Rewrite clean targets.
355 * Must rewrite error handling code.  Right now it is a real mess
356   Should fix up require_file junk at the same time
358 djm wants ``LINKS'' variable; list of things to link together after
359 install.  In BSD environment, use:
360         LINKS = from1 to1 from2 to2 ...
362 Need way to say there are no suffixes in a Makefile (Franc,ois'
363 "override" idea suffices here)
365 Check to make sure various scripts are executable (IE when looking for
366 them in a directory)
368 Use recode in dist target when MAINT_CHARSET specified.  Read caveats
369 in automake.in before doing this.  Note the same problem used to apply
370 to the no-dependencies option; maybe it still should?  Note also that
371 each Makefile.am must be rewritten at "make dist" time if
372 MAINT_CHARSET and DIST_CHARSET are not identical.  NOTE: gettext must
373 arrange for all .po files not to be recoded.  In the long term this
374 might be a problem (consider when some systems use Unicode but the
375 rest do not)
376   MAINT_CHARSET *must* be local to each Makefile.am, to enable
377         merged distributions.
378   DIST_CHARSET must be passed down to subdir makes during a "make dist"
380 Handle dist-zoo.  Generally add more DOS support.  Maybe run "doschk"
381 (why isn't this merged with "pathchk"?) when doing a dist.  Do
382 whatever else François says here...
384 Add support for html via an option.  Use texi2html.  Use
385 "html_TEXINFOS", and htmldir = .../html.  Include html files in
386 distribution.  Also allow "html_DATA", for raw .html files.
387   [ when will texinfo directly support html? ]
389 uninstall and pkg-dirs should rm -rf the dir.
391 a potential bug: configure puts "blah.o" into LIBOBJS, thus implying
392 these files can't be de-ansified.  Not a problem?
393   [ fix by using ansi2knr wrapper program ]
395 In general most .am files should be merged into automake.  For
396 instance all the "clean" targets could be merged by keeping lists of
397 things to be removed.  This would be a lot nicer looking.  Note that
398 the install targets probably should not be merged; it is sometimes
399 useful to only install a small part.
401 Clean up the output:
402 * Order rules sensibly
403 * Ensure every line has a purpose.  Omit unused stuff
404 * Eliminate extraneous rules when possible (eg 'install-am' stuff)
405 * Make sure vertical spacing is correct
406 Omit program transform vars from header if no program installed.  This
407 is currently pretty hard to do.  (But with beautification code it
408 would probably be easy)
410 Lex, yacc support:
411 * It would be nice to automatically support using bison's better features
412   to rename the output files.  This requires autoconf support
413 * Consider supporting syntax from autoconf "derived:source", eg:
414         y.tab.c:perly.y
415   for yacc and lex source
416 * what if you use flex and the option to avoid -lfl?
417   should support this?
419 Multi-language support:
420 * should have mapping of file extensions to languages
421 * should automatically handle the linking issue (special-case C++)
422 * must get compile rules for various languages; FORTRAN probably
423   most important unimplemented language
424 This should be integrated in some way with Per's idea.
425 Eg .f.o rules should be recognized & auto-handled in _SOURCES
426 That way any random language can be treated with C/C++ on a first-class
427 basis (maybe)
429 It might be cool to generate .texi dependencies by grepping for
430 @include.  (If done, it should be done the same way C dependencies are
431 done)
433 It would be good to check some parts of GNU standards.  Already check
434 for install-sh and mkinstalldirs.  What else is required to be in
435 package by GNU standards or by automake?
436 Some things for --strictness=gnits:
437 * "cd $(foo); something" is an error in a rule.  Should be:
438   "cd $(foo) && something"
439 * Look for 'ln -s' and warn about using $(LN) and AC_PROG_LN_S
440 * Look for $(LN) and require AC_PROG_LN_S
442 Auto-distribute "ChangeLog.[0-9]+"?  "ChangeLog.[a-z]+"?
444 Internationalize. [ gettext doesn't have the necessary machinery yet ]
445 am_error should use printf-style arguments (for eventual gettext scheme)
447 François says the ordering of files in a distribution should be as follows:
448 * README
449 * source files
450 * derived files
451 I agree, but I don't see how to implement this yet.
452 It might be easier if "derived files" is limited to those that
453 Automake itself knows about, eg output of yacc.
455 Check all source files to make sure that FSF address is up-to-date.
456 --gnits or --gnu only.
458 Merge each -vars.am file with corresponding ".am" file.  Can do this
459 because of changes to &file_contents.
461 Should libexec programs have the name transform done on them?
463 Order the output rules sensibly, so FOO_SOURCES and FOO_OBJECTS are
464 together and rules are in the usual order.
466 Make the output minimal: only output definitions for variables that
467 are used.
469 djm says:
470 David> To avoid comments like the one about subdirs getting buried in
471 David> the middle of a Makefile.in, how about pushing comments that
472 David> start with ### to the top of the Makefile.in (in order)?  Sort
473 David> of like how Autoconf uses diversions to force initialization
474 David> code to the top of configure.
476 Karl Berry says:
477 Karl> 2) Your Makefile variable names are generally uppercase, but GNU
478 Karl> generally uses lowercase. Not that it matters :-).
480 ================================================================
482 Stuff for aclocal:
484 probably should put each group of m4 files into a subdir owned by the
485 containing application.
487 ================================================================
489 Document:
491 AM_MISSING_PROG
493 how to use the generated makefiles
494  - standard targets
495  - required targets
496  - NORMAL_INSTALL junk
498 what goes in AC_CONFIG_AUX_DIR
500 multi-":" mode in AC_OUTPUT -- automake only looks at the first file
501     also a note on how a .am file is found in this case
503 rationale for avoiding
504         make CFLAGS="$CFLAGS" ...
505 in subdirs make rule
507 a package that installs its own aclocal macros
509 write example of using automake with dejagnu
510 follow calc example in dejagnu docs
512 document which variables are actually scanned and which are not.
514 Document customary ordering of Makefile.am.  From François.
516 Should include extended version of diagram from Autoconf (suggested by
517 Greg Woods)
519 Make a definition of the term "source"
521 document how to use Automake with CVS.  Idea from Mark Galassi.  Also
522 include Greg Woods' more sophisticated "cvs-dist" target.
524 document rebuilding configure.  CONFIGURE_DEPENDENCIES
525 CONFIG_STATUS_DEPENDENCIES
527 -- must document all variables that are supposed
528    to be public knowledge
530 must document the targets required for integration with
531 non-automake-using subdirs
533 document the "make SHELL='/bin/sh -x'" trick for debugging
535 section on relationship to GNU make.  include notes on parallel makes
537 add a concept index
539 move discussion of cygwin32, etags, mkid under other gnu tools
541 CCLD, CXXLD, FLD
543 ================================================================
545 Things to do for gcc:
547 Regularize dependency generation.  Add new flags:
549 -MH   Generate a dummy dependency for each header file mentioned.
550 -MT NAME
551       Set name of target
552 -MF NAME
553       Set name of output file
555 Then automake can use -MD -MH -MT 'foo.o foo.lo' -MF .deps/...
557 ================================================================
559 Things to do for autoconf:
561 * patch autoreconf to run automake and aclocal.  I've done this but it is
562   not really available.  It can't be made available until automake
563   is officially released
565 ================================================================
567 Libraries:
569 * Should support standalone library along with subdir library in same
570   Makefile.am.  Maybe: turn off "standalone" mode if library's Makefile.am
571   is not only one specd? [ add an option for this ]
573 ================================================================
575 Longer term:
577 Would it be useful to integrate in some way with the Debian package
578 building utility?  Must check.  maybe it would be possible to deal
579 with all the different package utilities somehow.  Lately I've been
580 hearing good things about the RedHat packaging utilities.  Why are
581 there so many of these?  Are they fun to write or something?
582 The RedHat package utility is called RPM; see
583         ftp://ftp.redhat.com/pub/code/rpm
584 It actually has problems, like no configure script and no documentation.
586 For Cygnus it would probably be good to be able to handle the native
587 package utility on each platform.  There are probably 3 or 4 of these
588 (sysv, solaris?, aix?)
590 tcl/unix/Makefile.in has some code to generate a Solaris package.
592 Automake probably can't do all of this on its own.  A new tool might
593 be a better idea
595 I have some notes from a Debian developer on how the integration
596 should work
598 ================================================================
600 A tool to guess what the local Makefile.am should look like:
601 (see Gord's Maint program!)
603 * Probably integrate with autoscan
604 * Use various simple rules to determine what to do:
605   * get name of top directory, sans version info
606   * search for .c files with 'main' in them
607     * if in main.c, use directory name for program
608     * if in more than one, generate multiple programs
609     * if not found, generate a library named after directory
610   * order subdir searches correctly: lib first, src last
611   * assume 'testsuite' dir means we are using dejagnu
612 * maybe be smart about reading existing Makefile.am, so tool
613   can be run for incremental changes?  You could imagine:
615         Makefile.am:
616                 autoproject --incremental
618 ================================================================
620 Stuff NOT to do, and why:
622 consider auto-including any file that matches "*.in".
623   [ no: po/Makefile.in shouldn't be included ]
625 must look at mkid to see how it works (for subdir usage)
626   [ right now, it doesn't.  i don't see a simple fix right now ]
628 if configure.in not found, move up a directory and try again?  This
629 could eliminate a common source of problems.
630   [ this is just a bad idea ]
632 * scripts are installed in $exec_prefix/bin, not $prefix/bin
633   Bug or feature?
634   [ the consensus on Gnits is that this isn't required.
635     doubters can work around it anyway ]
637 * make the auto-dep code crash if GNU make not in use?
638   (doesn't it already?)
640 Looked at a program called 'ezmake', which seems to do something
641 similar.  The only idea there that is possibly worth stealing is using
642 globs in definitions.  Also has negations.  Eg in a directory with
643 files a.c, b.c and c.c, the line:
644         foo_SOURCES = *.c ~c.c
645 would be equivalent to:
646         foo_SOURCES = a.c b.c
647 Is this worth implementing?
648   [ No... it is more reliable to spell everything out. ]
650 Scan source directories and warn about missing files, eg .c/.h files
651 that aren't mentioned?
652   [ distcheck makes this less useful ]
654 * quoting bugs
655   - how to install file with a space in its name?
656   [ don't bother with this -- make is just too losing ]