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