clean fixlet
[automake.git] / TODO
blobefe3d3032c33b31099d903c8d2ea694373dd90cb
1 * "make diff" capability
2   look at gcc's Makefile.in to see what to do
3   or look at maint program
5 * Karl wants to be able to set LIBS and LDFLAGS at build time, like CFLAGS
6   maybe we need something more general?
8 * add $(srcdir)/ before some dependencies?
10 * define LINK if a program is mentioned, even if no C sources appear
12 * BUILT_SOURCES should not be distributed, even when they appear in
13   another _SOURCES line. [? or maybe just leave this up to the
14   to-be-defined generic distribution method ]
15   must completely revisit the entire BUILT_SOURCES idea
16   probably should generate dependencies as side effect of compile
17   (but that will mess up guile distributions... sigh)
19 * in --cygnus, clean-info not generated at top level
21 * what if an element of a scanned variable looks like
22         $(FOO).$(BAR)  ?
23   or some other arbitrary thing?
24   right now we try to cope, but not very well
26 * if `interlock' exists, that should be an error (?)
27   should also warn about using new ylwrap and not old one
28   only do this when looking for ylwrap
30 ** make sure every variable that is used is also defined
32 * make sure `missing' defines are generated
33 * if no AM_INIT_AUTOMAKE, then don't handle `missing' stuff.
34   Yuck!
35 * missing should handle install -d and rmdir -p (for uninstall)
37 * allow 'cygnus' in AUTOMAKE_OPTIONS
39 * a couple ways to be smarter:
40   - notice when a .c file is a target somewhere, and auto-add it to
41     BUILT_SOURCES
42   - notice a target of the form `.x.y:' and assume it is a suffix rule
45 * NORMAL_INSTALL / NORMAL_UNINSTALL -vs- recursive rules
46   [ requires changes to the standard ]
48 * cross-compilation support:
49   programs built and used by the build process need to be
50   built for CC_FOR_BUILD
52 * if foo.y is a source, foo.h isn't auto-distributed?
54 * dependency tracking doesn't work well when a file is removed
55   the new code to track header dependencies exacerbates this
56   what is the fix?
57   it would probably be better to use "gcc -MD" and move the .d
58   file into the .deps directory.  That is, create the dependencies
59   as a side effect of compilation
60   This still won't solve the file-deletion problem
61   [ also: jim makes distributions by checking out, configuring,
62     and running "make dist".  This scheme would cause that to fail ]
64 * copyrights on m4 files, aclocal output
66 * is there a way to add a directory and then have "make" do all the
67   updating?  think.
69 * put standards.texi into distribution
72 * should not put texiname_TEXINFOS into distribution
73   should rename this macro anyway, to foo_texi_DEPENDENCIES
75 * *all* installed scripts should support --version, --help
77 * have aclocal diagnose unrecognized AM_ macros
79 For now I guess I'll just have automake give an error if it encounters
80 non-C source in a libtool library specification.
82 * must split $obj into two parts: one for libtool and one for
83   deansification.  Otherwise .S files will be deansified!
85 * if program has the same name as a target, do something sensible:
86   - if the target is internal, rename it
87   - if the target is mandated (eg, "info"), tell the user
88     consider auto-modifying the program name to work around this
90 * should separate actual options from strictness levels
91   strictness should only cover requirements
92   You should be able to pick and choose options
94 should clean up texinfos.am; one rule is repeated 3 times, but
95 shouldn't be
97 should always use perl -w
99 rewrite in guile (RMS request)
100 at the same time, consider adding a GUI
101 could use the same parsing code for the GUI and the standalone version
102 that means figuring out a better representation of internal state
103 [ that's easy -- anything is better than what we have now ]
105 having just one Makefile for a project would give a big speed increase
106 for a project with many directories, eg glibc.  ideally (?) you'd
107 still be able to have a Makefile.am in each directory somehow; this
108 might make editing conceptually easier.
110 * finish up TAGS work
111 * `acinstall'
112 * put parser.h into distribution if "yacc -d" is used
114 * only remove libtool at top level?
116 * clean up source directory by moving stuff into subdirs
118 * consider adding pkglibexecdir, maybe others?
119   requests for pkg-dirs with version included
121 Further:
122 - man page fixes
124 Avoid loops when installing; instead unroll them in automake
126 * for new autoconf:
127   * completely handle multi-":" mode for AC_CONFIG_HEADER
128   * Scan multiple input files when Makefile is generated?
129     This would provide flexibility for large projects; subsumes
130     the "Makefile.tmpl" idea
132    [ can't do this.  must explain why in manual.
133      basically, solving all the problems is too hard
134      like: how to remove redundancies between generated .in files
135      instead should implement `include' directive for Makefile.am ]
136 * for multi-":" mode and AC_OUTPUT, it might be good to pick the
137   first input file that has a corresponding .am file.
139 Some long-term projects:
140 * if $(FOO) is used somewhere, ensure FOO is defined, either by
141   user or by automake if possible
142 * Don't rearrange order of `include' lines relative to += assignments.
143 * Handle += assignments at all.
144 * Handle `include' lines by scanning other files, and adding
145   to Makefile.in dependency
147 consider putting all check-* targets onto @check?
148 To support --help/--version checking?
150 take diff-n-query code from libit
152 Per Bothner says:
153 Per> 1) Being able to build a set of non-source programs
154 Per> from source programs, without necessarily linking them together.
155 Per> I.e. one should be able to say something like:
156 Per>    dummy_SOURCES=foo.c bar.c
157 Per> and automake should realize that it needs to build foo.o and bar.o.
158 Per> 2) Being intelligent about new kinds of suffixes.
159 Per> If it sees:
160 Per>    SUFFIXES = .class .java
161 Per> and a suffix rule of the form:
162 Per>    .java.class:
163 Per> then it should be able to realize it can build .class files from
164 Per> .java files, and thus be able to generate a list of
165 Per> .class files from a list of .java source files.
167 !! Must fix require_file stuff.  It is really gross, and I don't
168    understand it any more.
170 * error messages should print ``[info blah blah]'' command when a
171   certain part of the standards apply.  saw idea in message from
172   Craig Burley.  wouldn't it be really cool if compile-mode in Emacs
173   understood this convention, and you could click on such text to
174   go to the appropriate info page?
176 Jim's idea: should look for @setfilename and warn if filenames too long
177 * guess split size
179 ** many requests for a way to omit a file from the distribution.
180    Should be done like `!foo' or `~foo' in _SOURCES, etc.
181    Such files should be removed explicitly after the copy step!
182    Doing this requires rewriting macros before generating Makefile.in.
184 from joerg-martin schwarz:
185  -- If Makefile.am contains $(CC), $(COMPILE), $(YLWRAP), .... 
186     in an explicitly written rule,  you should emit the corresponding
187     Makefile variables automatically.
189 Configuring in the large:
190 * allow hierarchy of dirs to share one aclocal.m4
191   How?
193 consider printing full file name of Makefile.am or configure.in when
194 giving error.  This would help for very large trees with many
195 configure.in scripts
197 From the GNU Standards.  These things could be checked, and probably
198 should be if --gnu.
199 *    Make sure that the directory into which the distribution unpacks (as
200 well as any subdirectories) are all world-writable (octal mode 777).
201 *   Make sure that no file name in the distribution is more than 14
202 characters long.
203 *    Don't include any symbolic links in the distribution itself.
204      (ditto hard links)
205 *    Make sure that all the files in the distribution are world-readable.
206 ** also, check --help output and --version output.  Idea from François
207 * standards no longer prohibit ANSI C.  What does this imply
208   for the de-ansi-fication feature?
210 consider supporting "var+= stuff" syntax.  rewrite to just var=... on
211 output.  This is sometimes convenient when you want to write a
212 Makefile.am in more-or-less modular parts
214 should be able to determine what is built by looking at rules (and
215 configure.in).  Then built man pages (eg) could automatically be
216 omitted from the distribution.
218 Idea from Joerg-Martin Schwarz: allow passing different -D flags to
219 different compiles.  This can be done, but with the restriction that a
220 .c cannot appear in 2 different "objects" (programs/libraries)
221 compiled with different -D options (because -c and -o do not always
222 work together and parallel makes must work).  This could be
223 implemented by noticing whenever a ".o" target with no rules is being
224 emitted, and adding the appropriate compilation rule as appropriate.
225 This should work with targets from Makefile.am as well as from .P
226 files, which means rewriting so that the Makefile.am contents aren't
227 copied into the output immediately.
228  [ this could be probably done more directly by examining the sources
229    as we scan Makefile.am ]
231 Henrik Frystyk Nielsen says:
232 Henrik> 4) Flags like --include-deps are lost when you make changes to
233 Henrik> Makefile.am files and automake is run automatically. It would
234 Henrik> be nice to keep these flags as I now have to redo everything
235 Henrik> manually.
236 ... what about other options here too?
238 Think about: maybe "make check" should just bomb if error occurs?
239 Then user must use "make -k check".  This is probably more natural.
241 Consider: "cvs" option adds some cvs-specific rules?
243 Right now, targets generated internally (eg "install") are not
244 overridable by user code.  This should probably be possible, even
245 though it isn't very important.  This could be done by generating all
246 internal rules via a function call instead of just appending to
247 $output_rules.
248  [ this will be harder to implement when scanning a rule like all-recursive
249    from subdirs.am ]
251 * Should be a way to have "nobuild_PROGRAMS" which aren't even built,
252   but which could be by running the magic make command.
254 Other priorities:
255 * Must rewrite am_install_var.  Should break into multiple functions.
256   This will allow the callers to be a little smarter.
257 * Rewrite clean targets.
258 * Must rewrite error handling code.  Right now it is a real mess
259   Should fix up require_file junk at the same time
261 djm wants ``LINKS'' variable; list of things to link together after
262 install.  In BSD environment, use:
263         LINKS = from1 to1 from2 to2 ...
265 Need way to say there are no suffixes in a Makefile (Franc,ois'
266 "override" idea suffices here)
268 Check to make sure various scripts are executable (IE when looking for
269 them in a directory)
271 Use recode in dist target when MAINT_CHARSET specified.  Read caveats
272 in automake.in before doing this.  Note the same problem used to apply
273 to the no-dependencies option; maybe it still should?  Note also that
274 each Makefile.am must be rewritten at "make dist" time if
275 MAINT_CHARSET and DIST_CHARSET are not identical.  NOTE: gettext must
276 arrange for all .po files not to be recoded.  In the long term this
277 might be a problem (consider when some systems use Unicode but the
278 rest do not)
279   MAINT_CHARSET *must* be local to each Makefile.am, to enable
280         merged distributions.
281   DIST_CHARSET must be passed down to subdir makes during a "make dist"
283 Handle dist-zoo.  Generally add more DOS support.  Maybe run "doschk"
284 (why isn't this merged with "pathchk"?) when doing a dist.  Do
285 whatever else François says here...
287 Add support for html via an option.  Use texi2html.  Use
288 "html_TEXINFOS", and htmldir = .../html.  Include html files in
289 distribution.  Also allow "html_DATA", for raw .html files.
290   [ when will texinfo directly support html? ]
292 uninstall and pkg-dirs should rm -rf the dir.
294 a potential bug: configure puts "blah.o" into LIBOBJS, thus implying
295 these files can't be de-ansified.  Not a problem?
296   [ fix by using ansi2knr wrapper program ]
298 In general most .am files should be merged into automake.  For
299 instance all the "clean" targets could be merged by keeping lists of
300 things to be removed.  This would be a lot nicer looking.  Note that
301 the install targets probably should not be merged; it is sometimes
302 useful to only install a small part.
304 Clean up the output:
305 * Order rules sensibly
306 * Ensure every line has a purpose.  Omit unused stuff
307 * Eliminate extraneous rules when possible (eg 'install-am' stuff)
308 * Make sure vertical spacing is correct
309 Omit program transform vars from header if no program installed.  This
310 is currently pretty hard to do.  (But with beautification code it
311 would probably be easy)
313 Lex, yacc support:
314 * It would be nice to automatically support using bison's better features
315   to rename the output files.  This requires autoconf support
316 * Consider supporting syntax from autoconf "derived:source", eg:
317         y.tab.c:perly.y
318   for yacc and lex source
319 * what if you use flex and the option to avoid -lfl?
320   should support this?
322 Multi-language support:
323 * should have mapping of file extensions to languages
324 * should automatically handle the linking issue (special-case C++)
325 * must get compile rules for various languages; FORTRAN probably
326   most important unimplemented language
327 This should be integrated in some way with Per's idea.
328 Eg .f.o rules should be recognized & auto-handled in _SOURCES
329 That way any random language can be treated with C/C++ on a first-class
330 basis (maybe)
332 It might be cool to generate .texi dependencies by grepping for
333 @include.  (If done, it should be done the same way C dependencies are
334 done)
336 It would be good to check some parts of GNU standards.  Already check
337 for install-sh and mkinstalldirs.  What else is required to be in
338 package by GNU standards or by automake?
339 Some things for --strictness=gnits:
340 * "cd $(foo); something" is an error in a rule.  Should be:
341   "cd $(foo) && something"
342 * Look for 'ln -s' and warn about using $(LN) and AC_PROG_LN_S
343 * Look for $(LN) and require AC_PROG_LN_S
345 Auto-distribute "ChangeLog.[0-9]+"?  "ChangeLog.[a-z]+"?
347 Internationalize. [ gettext doesn't have the necessary machinery yet ]
348 am_error should use printf-style arguments (for eventual gettext scheme)
350 François says the ordering of files in a distribution should be as follows:
351 * README
352 * source files
353 * derived files
354 I agree, but I don't see how to implement this yet.
355 It might be easier if "derived files" is limited to those that
356 Automake itself knows about, eg output of yacc.
358 Check all source files to make sure that FSF address is up-to-date.
359 --gnits or --gnu only.
361 Merge each -vars.am file with corresponding ".am" file.  Can do this
362 because of changes to &file_contents.
364 Should libexec programs have the name transform done on them?
366 Order the output rules sensibly, so FOO_SOURCES and FOO_OBJECTS are
367 together and rules are in the usual order.
369 Make the output minimal: only output definitions for variables that
370 are used.
372 djm says:
373 David> To avoid comments like the one about subdirs getting buried in
374 David> the middle of a Makefile.in, how about pushing comments that
375 David> start with ### to the top of the Makefile.in (in order)?  Sort
376 David> of like how Autoconf uses diversions to force initialization
377 David> code to the top of configure.
379 Karl Berry says:
380 Karl> 2) Your Makefile variable names are generally uppercase, but GNU
381 Karl> generally uses lowercase. Not that it matters :-).
383 ================================================================
385 Stuff for aclocal:
387 probably should put each group of m4 files into a subdir owned by the
388 containing application.
390 ================================================================
392 Document:
394 AM_MISSING_PROG
396 how to use the generated makefiles
397  - standard targets
398  - required targets
399  - NORMAL_INSTALL junk
401 what goes in AC_CONFIG_AUX_DIR
403 multi-":" mode in AC_OUTPUT -- automake only looks at the first file
404     also a note on how a .am file is found in this case
406 rationale for avoiding
407         make CFLAGS="$CFLAGS" ...
408 in subdirs make rule
410 a package that installs its own aclocal macros
412 write example of using automake with dejagnu
413 follow calc example in dejagnu docs
415 document which variables are actually scanned and which are not.
417 Document customary ordering of Makefile.am.  From François.
419 Should include extended version of diagram from Autoconf (suggested by
420 Greg Woods)
422 Make a definition of the term "source"
424 document how to use Automake with CVS.  Idea from Mark Galassi.  Also
425 include Greg Woods' more sophisticated "cvs-dist" target.
427 document rebuilding configure.  CONFIGURE_DEPENDENCIES
429 -- must document all variables that are supposed
430    to be public knowledge
432 must document the targets required for integration with
433 non-automake-using subdirs
435 document the "make SHELL='/bin/sh -x'" trick for debugging
437 section on relationship to GNU make.  include notes on parallel makes
439 add a concept index
441 move discussion of cygwin32, etags, mkid under other gnu tools
443 ================================================================
445 Things to do for autoconf:
447 * patch autoreconf to run automake and aclocal.  I've done this but it is
448   not really available.  It can't be made available until automake
449   is officially released
451 ================================================================
453 Libraries:
455 * Should support standalone library along with subdir library in same
456   Makefile.am.  Maybe: turn off "standalone" mode if library's Makefile.am
457   is not only one specd? [ add an option for this ]
459 ================================================================
461 Longer term:
463 Would it be useful to integrate in some way with the Debian package
464 building utility?  Must check.  maybe it would be possible to deal
465 with all the different package utilities somehow.  Lately I've been
466 hearing good things about the RedHat packaging utilities.  Why are
467 there so many of these?  Are they fun to write or something?
468 The RedHat package utility is called RPM; see
469         ftp://ftp.redhat.com/pub/code/rpm
470 It actually has problems, like no configure script and no documentation.
472 For Cygnus it would probably be good to be able to handle the native
473 package utility on each platform.  There are probably 3 or 4 of these
474 (sysv, solaris?, aix?)
476 tcl/unix/Makefile.in has some code to generate a Solaris package.
478 Automake probably can't do all of this on its own.  A new tool might
479 be a better idea
481 I have some notes from a Debian developer on how the integration
482 should work
484 ================================================================
486 A tool to guess what the local Makefile.am should look like:
487 (see Gord's Maint program!)
489 * Probably integrate with autoscan
490 * Use various simple rules to determine what to do:
491   * get name of top directory, sans version info
492   * search for .c files with 'main' in them
493     * if in main.c, use directory name for program
494     * if in more than one, generate multiple programs
495     * if not found, generate a library named after directory
496   * order subdir searches correctly: lib first, src last
497   * assume 'testsuite' dir means we are using dejagnu
498 * maybe be smart about reading existing Makefile.am, so tool
499   can be run for incremental changes?  You could imagine:
501         Makefile.am:
502                 autoproject --incremental
504 ================================================================
506 Stuff NOT to do, and why:
508 consider auto-including any file that matches "*.in".
509   [ no: po/Makefile.in shouldn't be included ]
511 must look at mkid to see how it works (for subdir usage)
512   [ right now, it doesn't.  i don't see a simple fix right now ]
514 if configure.in not found, move up a directory and try again?  This
515 could eliminate a common source of problems.
516   [ this is just a bad idea ]
518 * scripts are installed in $exec_prefix/bin, not $prefix/bin
519   Bug or feature?
520   [ the consensus on Gnits is that this isn't required.
521     doubters can work around it anyway ]
523 * make the auto-dep code crash if GNU make not in use?
524   (doesn't it already?)
526 Looked at a program called 'ezmake', which seems to do something
527 similar.  The only idea there that is possibly worth stealing is using
528 globs in definitions.  Also has negations.  Eg in a directory with
529 files a.c, b.c and c.c, the line:
530         foo_SOURCES = *.c ~c.c
531 would be equivalent to:
532         foo_SOURCES = a.c b.c
533 Is this worth implementing?
534   [ No... it is more reliable to spell everything out. ]
536 Scan source directories and warn about missing files, eg .c/.h files
537 that aren't mentioned?
538   [ distcheck makes this less useful ]