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