From: Tom Tromey Date: Sat, 20 Jan 1996 02:47:22 +0000 (+0000) Subject: Better configure.in scanning. Fixlets X-Git-Tag: Release-0-29~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ee60ff32724e3e488f275bd51c1fc5480786f2ef;p=thirdparty%2Fautomake.git Better configure.in scanning. Fixlets --- diff --git a/ChangeLog b/ChangeLog index 2544b6478..bd65b170f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,16 @@ Fri Jan 19 00:50:29 1996 Tom Tromey + * automake.in (require_file): Install missing files only according + to desired strictness. + (initialize_per_input): Don't init libsources. + (scan_configure): Reinit libsources. + (handle_libraries): Search _LIBADD for @LIBOBJS@ and @ALLOCA@. + (fp_c_prototypes): New global. + (scan_configure): Set it. + (get_object_extension): Error if fp_C_PROTOTYPES not in + configure.in when using ansi2knr. + (handle_source_transform): Skip header files. + * automake.in (handle_dist_worker): Explicitly make 'dist' in subdirs. diff --git a/NEWS b/NEWS index b0cb1c30a..4dd6cc37a 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,8 @@ +New in 0.29: +* Bug fixes +* More sophisticated configure.in scanning; now understands ALLOCA and + LIBOBJS directly. + New in 0.28: * Added --gnu and --gnits options * More standards checking diff --git a/TODO b/TODO index 90de349ce..b1876987f 100644 --- a/TODO +++ b/TODO @@ -1,24 +1,22 @@ Top priorities: -* finish configure.in scanning. must do something with C files found - must handle subdir case correctly (don't reinit libsources each time) -* Use info_TEXINFOS -* Figure out how to handle MANS: - * use man_MANS? Or man1_MANS, man2_MANS, etc? +* Use info_TEXINFOS, man_MANS * Must rewrite am_install_var. Should break into multiple functions. This will allow the callers to be a little smarter. -* am_error should use printf-style arguments (for eventual gettext scheme) - ---install-missing should only install COPYRIGHT when --gnu or better. - Handle MAINT_CHARSET. Use recode in dist target. Handle dist-zoo and dist-zip. +Add support for html via an option. Use texi2html. Use "html_HTMLS", +and htmldir = .../html. + if configure.in not found, move up a directory and try again? This could eliminate a common source of problems. uninstall and pkg-dirs should rm -rf the dir. +a potential bug: configure puts "blah.o" into LIBOBJS, thus implying +these files can't be de-ansified. Not a problem? + In general most .am files should be merged into automake. For instance all the "clean" targets could be merged by keeping lists of things to be removed. This would be a lot nicer looking. Note that @@ -35,10 +33,6 @@ Clean up the output: and backslash should be the rule. Update makefile-mode to allow this. (set column to 0, probably) -Need OTHER_SOURCES to hold sources whose objects end up in eg LIBOBJS. -Dependency tracking should work here. Maybe if it doesn't exist it -should be generated automatically by scanning the directory. (yes) - It should be possible to have ansi2knr in just one place in a package. Jim Meyering says just rely on configure to make links as appropriate. Not sure how I feel about this. @@ -46,6 +40,7 @@ Not sure how I feel about this. Consider automatic support for ".y" files. [ not right now; it is nice to be able to print the number of expected conflicts, and we can't handle that ] +What about ".l" files? Write autoconf macro to do all work necessary for automake. Eg define PACKAGE, VERSION, etc. @@ -79,8 +74,8 @@ Allow ".h" files to appear in blah_SOURCES; just write them out of existence. [ This is nixed for now because of the auto-dependency tracking stuff ] -automake.in: should ".cc" really -> ".$(kr)o"? This doesn't really -seem right, but maybe it is so names can be rewritten uniformly? Must +automake.in: should ".cc" really -> "$o"? This doesn't really seem +right, but maybe it is so names can be rewritten uniformly? Must check look in configure.in's AC_OUTPUT command and include those files in @@ -96,6 +91,7 @@ must look at mkid to see how it works (for subdir usage) [ right now, it doesn't. i don't see a simple fix right now ] Internationalize. [ gettext doesn't have the necessary machinery yet ] +am_error should use printf-style arguments (for eventual gettext scheme) write test suite @@ -201,6 +197,10 @@ Document customary ordering of Makefile.am. From Franc,ois. Must document BUILT_SOURCES variable. See depend.am. +How to deal with @LIBOBJS@. +configure scanning +putting .h files into blah_SOURCES is ok now + ================================================================ Libraries: diff --git a/automake.in b/automake.in index 7d665f74c..71696131d 100755 --- a/automake.in +++ b/automake.in @@ -69,6 +69,12 @@ $symlink_exists = (eval 'symlink ("", "");', $@ eq ''); # TRUE if missing standard files should be installed. $install_missing = 0; +# Files found by scanning configure.in for LIBOBJS. +%libsources = (); + +# True if fp_C_PROTOTYPES appears in configure.in. +$fp_c_prototypes = 0; + &initialize_global_constants; @@ -324,6 +330,9 @@ sub get_object_extension if (defined $options{'ansi2knr'} || defined $contents{'@kr@'}) { + &am_error ("option \`ansi2knr' in use but \`fp_C_PROTOTYPES' not in configure.in") + if ! $fp_c_prototypes; + $dir_holds_sources = '$o'; push (@suffixes, '._c', '._o'); @@ -354,11 +363,12 @@ sub handle_source_transform { # Turn sources into objects. local (@files) = split (/\s+/, $contents{$one_file . "_SOURCES"}); - # Ugh: Perl syntax vs Emacs. - # local ($krc1, $krc2) = ('\.\$\{kr\}c', '\.\$\(kr\)c'); local (@result) = (); foreach (@files) { + # Just skip header files. + next if /\.h$/; + if (/^(.*)\.[yl]$/) { # Automatically include generated .c file in @@ -368,8 +378,6 @@ sub handle_source_transform # Transform source files into .o files. s/\.cc$/$obj/g; - # s/$krc1$/$obj/g; - # s/$krc2$/$obj/g; s/\.[cCmylfs]$/$obj/g; push (@result, $_); @@ -466,7 +474,39 @@ sub handle_libraries local ($munge); foreach $onelib (@liblist) { - if (! defined $contents{$onelib . '_LIBADD'}) + if (defined $contents{$onelib . '_LIBADD'}) + { + # We recognize certain things that are commonly put in + # LIBADD. + local ($lsearch); + + foreach $lsearch (split (/\s+/, $contents{$onelib . '_LIBADD'})) + { + # Automatically handle @LIBOBJS@ and @ALLOCA@. + # Basically this means adding entries to dep_files. + if ($lsearch eq '@LIBOBJS@') + { + local ($iter, $rewrite); + foreach $iter (keys %libsources) + { + if ($iter ne 'alloca.c') + { + ($rewrite = $iter) =~ s/\.c$/.P/; + $dep_files{$rewrite} = 1; + &require_file ($NORMAL, $iter); + } + } + } + elsif ($lsearch eq '@ALLOCA@') + { + &am_error ("\@ALLOCA\@ seen but \`AC_FUNC_ALLOCA' not in \`configure.in'") + if ! defined $libsources{'alloca.c'}; + $dep_files{'alloca.P'} = 1; + &require_file ($NORMAL, 'alloca.c'); + } + } + } + else { # Generate support for conditional object inclusion in # libraries. @@ -1217,6 +1257,11 @@ sub scan_configure open (CONFIGURE, 'configure.in') || die "automake: couldn't open configure.in: $!\n"; + # Reinitialize libsources here. This isn't really necessary, + # since we currently assume there is only one configure.in. But + # that won't always be the case. + %libsources = (); + local ($seen_make_set) = 0; local ($seen_prog_install) = 0; local ($seen_arg_prog) = 0; @@ -1255,17 +1300,24 @@ sub scan_configure $libsources{$1 . '.c'} = 1; } + # Check for ansi2knr. + $fp_c_prototypes = 1 if /fp_C_PROTOTYPES/; + # Check for NLS support. if (/ud_GNU_GETTEXT/) { - &am_error - ("ud_GNU_GETTEXT in configure.in but SUBDIRS not defined") - if ! defined $contents{'SUBDIRS'}; - &am_error ("ud_GNU_GETTEXT if configure.in but po not in SUBDIRS") - if $contents{'SUBDIRS'} !~ /\/; - &am_error - ("ud_GNU_GETTEXT if configure.in but intl not in SUBDIRS") - if $contents{'SUBDIRS'} !~ /\/; + if (! defined $contents{'SUBDIRS'}) + { + &am_error + ("ud_GNU_GETTEXT in configure.in but SUBDIRS not defined"); + } + else + { + &am_error ("ud_GNU_GETTEXT in configure.in but \`po' not in SUBDIRS") + if $contents{'SUBDIRS'} !~ /\bpo\b/; + &am_error ("ud_GNU_GETTEXT in configure.in but \`intl' not in SUBDIRS") + if $contents{'SUBDIRS'} !~ /\bintl\b/; + } &require_file ($NORMAL, 'ABOUT-NLS'); } @@ -1648,9 +1700,6 @@ sub initialize_per_input # Options from AUTOMAKE_OPTIONS. %options = (); - - # Files found by scanning configure.in for LIBOBJS. - %libsources = (); } @@ -1888,23 +1937,30 @@ sub require_file { &push_dist_common ($file); } - elsif ($install_missing && -f ($am_dir . '/' . $file)) + elsif ($strictness >= $mystrict) { - # Install the missing file. Symlink if we can, copy if we must. - if ($symlink_exists) + # Only install missing files according to our desired + # strictness level. + if ($install_missing && -f ($am_dir . '/' . $file)) { - symlink ($am_dir . '/' . $file, $fullfile); + # Install the missing file. Symlink if we can, copy + # if we must. + if ($symlink_exists) + { + symlink ($am_dir . '/' . $file, $fullfile); + } + else + { + system ('cp', $am_dir . '/' . $file, $fullfile); + } + &am_error + ("required file \"$fullfile\" not found; installing"); } else { - system ('cp', $am_dir . '/' . $file, $fullfile); + # Only an error if strictness constraint violated. + &am_error ("required file \"$fullfile\" not found"); } - &am_error ("required file \"$fullfile\" not found; installing"); - } - elsif ($strictness >= $mystrict) - { - # Only an error if strictness constraint violated. - &am_error ("required file \"$fullfile\" not found"); } } }