autotools + MSVC
Hi, This may not be the best list for this, but I'm already subscribed and someone here probably knows the answer. I'm trying to build an autotools in a Cygwin environment, but using MSVC's cl.exe and link.exe. However, this is what I get when I run make: ---begin--- make[1]: Entering directory `//z/parsa/parsa2/src/kernel' cl -DHAVE_CONFIG_H -I. -I. -I../../src/include -GX -TP -I../include-I../com pat -Ie:\qt/include -I../include -I../compat -Ie:\qt/include -capplicationpro ject.cc Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80x86 Copyright (C) Microsoft Corp 1984-1998. All rights reserved. Command line error D2021 : invalid numeric argument '/Wp,-MD,.deps/applicationpr oject.pp' make[1]: *** [applicationproject.o] Error 2 make[1]: Leaving directory `//z/parsa/parsa2/src/kernel' make: *** [all-recursive] Error 1 ---end--- If I manually run the command line make claims its running, it works! I'm using automake 1.4, autoconf 2.13, make 3.79.1, and MSVC 6.0 SP4. CXX=cl, CXXFLAGS="-GX -TP" I've tried making configure and the Makefile.in's on the NT machine, and on a Linux box that shares the same SMB mount. Doesn't seem to make a difference. --- Geoffrey Wossum [EMAIL PROTECTED]
Re: 31-ac-libsources.patch & Re: amtraces
On Feb 5, 2001, Akim Demaille <[EMAIL PROTECTED]> wrote: > * tests/semantics.at (AC_REPLACE_FUNCS): New test. > * acfunctions.m4 (AC_REPLACE_FUNCS, _AC_LIBOBJ_ALLOCA): Use > AC_LIBSOURCES. Ok -- Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/ Red Hat GCC Developer aoliva@{cygnus.com, redhat.com} CS PhD student at IC-Unicampoliva@{lsd.ic.unicamp.br, gnu.org} Free Software Evangelist*Please* write to mailing lists, not to me
Re: AM_INCLUDE is a bad name.
On Feb 5, 2001, Tom Tromey <[EMAIL PROTECTED]> wrote: > I'd like to also work out a naming scheme for internally generated > targets. That way eventually it will be clear what people can rely on > and what they cannot. Suggestions here are welcome. How 'bout `_am-target-name'? (note the leading underscore) -- Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/ Red Hat GCC Developer aoliva@{cygnus.com, redhat.com} CS PhD student at IC-Unicampoliva@{lsd.ic.unicamp.br, gnu.org} Free Software Evangelist*Please* write to mailing lists, not to me
Re: AM_INCLUDE is a bad name.
On Feb 6, 2001, Akim Demaille <[EMAIL PROTECTED]> wrote: > Don't go that way! AC_PREREQ. It won't let you define fallbacks for older releases, which is exactly the point. ifdef, as you proposed, is the way to go. -- Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/ Red Hat GCC Developer aoliva@{cygnus.com, redhat.com} CS PhD student at IC-Unicampoliva@{lsd.ic.unicamp.br, gnu.org} Free Software Evangelist*Please* write to mailing lists, not to me
include only in cvs-automake?
The Autotools book, the automake-1.4 manual, and the automake-1.4/NEWS all imply that "include" is part of automake 1.4. So how come it doesn't work, but when I try automake from cvs it does work? Is there some known bug I'm running into? If need be I can send a testcase, but since it works in cvs there doesn't seem much point. So what is it that is holding back a release of automake 1.5? Are people in the middle of some major-write? Are there major bugs in the cvs version that are not in 1.4? -- --Per Bothner [EMAIL PROTECTED] http://www.bothner.com/~per/
30-transform-cond.patch
A very stupid and mechanic patch, indeed, but it helps me seeing what happens. In this patch I took the freedom of introducing a new syntax: @FOO@ means `to be substituted', while `?FOO?' means to be removed if positive, or to kill the line if negative, and conversely for `?!FOO?'. This patch includes the Makefile.ins' diffs, i.e., no changes. I have pr19 and 87 fail at home but my archive is old, and tomorrow I'll adjust what needs to be before applying if approved. Index: ChangeLog --- ChangeLog Sun, 04 Feb 2001 17:31:54 +0100 akim (am/f/47_ChangeLog 1.34 644) +++ 0.40(w)/ChangeLog Wed, 07 Feb 2001 00:30:10 +0100 akim (am/f/47_ChangeLog 1.35 644) @@ -1,3 +1,13 @@ +2001-02-07 Akim Demaille <[EMAIL PROTECTED]> + + * automake.in (&transform): Use `my', not `local'. + (&transform_cond): New. + (&get_object_extension, &handle_texinfo, &handle_tags) + (&handle_dist_worker, &handle_dist, &add_depend2, &handle_clean) + (&handle_tests_dejagnu): Use it. + * texinfos.am, lisp.am, header.am, dist.am, distdir.am, depend2.am + * dejagnu.am, data.am, clean.am: Adjust to the new syntax. + 2001-02-04 Akim Demaille <[EMAIL PROTECTED]> * automake.in: Various formatting changes, and modernization of Index: automake.in --- automake.in Sun, 04 Feb 2001 17:31:54 +0100 akim (am/f/39_automake.i 1.34 755) +++ 0.40(w)/automake.in Wed, 07 Feb 2001 00:49:22 +0100 akim (am/f/39_automake.i 1.35 +755) @@ -851,8 +851,9 @@ local ($xform) = &transform ('DEFAULT_INCLUDES' => $default_include); $output_vars .= &file_contents ('comp-vars', $xform); - $xform = $seen_objext ? 's/^OBJEXT//;' : 's/^OBJEXT.*$//;'; - $output_rules .= &file_contents ('compile', $xform); + $output_rules .= + &file_contents ('compile', + &transform_cond ('OBJEXT' => $seen_objext)); # If using X, include some extra variable definitions. NOTE # we don't want to force these into CFLAGS or anything, @@ -2335,15 +2336,7 @@ # Set transform for including texinfos.am. First, handle --cygnus # stuff. -local ($xform); -if ($cygnus_mode) -{ - $xform = 's/^NOTCYGNUS.*$//; s/^CYGNUS//;'; -} -else -{ - $xform = 's/^CYGNUS.*$//; s/^NOTCYGNUS//;'; -} +my $xform = &transform_cond ('CYGNUS' => $cygnus_mode); # Handle location of texinfo.tex. local ($need_texi_file) = 0; @@ -2541,17 +2534,9 @@ $config .= &basename ($one_hdr); } } - local $xform = &transform ('CONFIG' => $xform, - 'DIRS' => join (' ', @tag_deps)); - - if (&variable_defined ('SUBDIRS')) - { - $xform .= 's/^SUBDIRS//;'; - } - else - { - $xform .= 's/^SUBDIRS.*$//;'; - } + my $xform = &transform ('CONFIG' => $xform, + 'DIRS' => join (' ', @tag_deps)); + $xform .= &transform_cond ('SUBDIRS' => &variable_defined ('SUBDIRS')); $output_rules .= &file_contents ('tags', $xform); $output_rules .= &file_contents ('tags-clean'); @@ -2586,23 +2571,8 @@ my $xform = ''; # Initialization; only at top level. -if ($relative_dir eq '.') -{ -$xform .= 's/\@TOPDIR\@//g;'; -} -else -{ -$xform .= 's/\@TOPDIR\@.*//g;'; -} - -if (defined $options{'check-news'}) -{ -$xform .= 's/\@CK-NEWS\@//g;'; -} -else -{ -$xform .= 's/\@CK-NEWS\@.*//g;'; -} +my $xform = &transform_cond ('TOPDIR' => ($relative_dir eq '.'), +'CK-NEWS' => defined $options{'check-news'}); # Scan EXTRA_DIST to see if we need to distribute anything from a # subdir. If so, add it to the list. I didn't want to do this @@ -2648,17 +2618,6 @@ $xform .= 's/.*\@DISTDIRS\@.*//g;'; } -if ($cygnus_mode) -{ -$xform .= 's/\@CYGNUS\@\t*/\t/g;'; -$xform .= 's/.*\@NCYGNUS\@.*//g;'; -} -else -{ -$xform .= 's/\@NCYGNUS\@\t*/\t/g;'; -$xform .= 's/.*\@CYGNUS\@.*//g;'; -} - # If we have SUBDIRS, create all dist subdirectories and do # recursive build. if (&variable_defined ('SUBDIRS')) @@ -2695,19 +2654,17 @@ &define_pretty_variable ('DIST_SUBDIRS', '', '$(SUBDIRS)'); } - $xform .= ('s/\@SUBDIRS\@//g;' - . &transform ('DIST_SUBDIR_NAME' -=> $dist_subdir_name, -'TOP_DISTDIR' -=> (($relative_dir eq '.') -? 'distdir' : 'top_distdir'))); -} -else -{ - $xform .= 's/\@SUBDIRS\@.*//g;'; + my $top_distdir = ($relative_dir eq '.') ? 'distdir' : 'top_distdir'; + $xform .= &transform ('DIST_SUBDIR_NAME' => $dist_subdir_name, + 'TOP_DISTDIR' => $top_dist
29-backname.patch
Index: ChangeLog from Akim Demaille <[EMAIL PROTECTED]> * automake.in: Various formatting changes, and modernization of Perl constructs. (&backname): New. (&handle_configure, define_standard_variables): Use it. Index: automake.in --- automake.in Sun, 04 Feb 2001 15:32:38 +0100 akim (am/f/39_automake.i 1.33 755) +++ automake.in Sun, 04 Feb 2001 17:30:42 +0100 akim (am/f/39_automake.i 1.33 755) @@ -447,7 +447,7 @@ sub parse_arguments if ($arglist[0] eq "--version") { print "automake (GNU $PACKAGE) $VERSION\n\n"; - print "Copyright 2000 Free Software Foundation, Inc.\n"; + print "Copyright 2000, 2001 Free Software Foundation, Inc.\n"; print "This is free software; see the source for copying conditions. There is NO\n"; print "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"; print "Written by Tom Tromey \n"; @@ -3311,37 +3311,14 @@ sub handle_configure } else { - local (@rel_out_path); - # FIXME this chunk of code should be its own sub. - # It is used elsewhere. - foreach (split (/\//, $relative_dir)) - { - next if $_ eq '' || $_ eq '.'; - if ($_ eq '..') - { - # FIXME: actually this is an error. - pop @rel_out_path; - } - else - { - push (@rel_out_path, '..'); - } - } - if (@rel_out_path) - { - $ch_sans_dir = join ('/', @rel_out_path) . '/' . $one_hdr; - } - else - { - $ch_sans_dir = $one_hdr; - } + $ch_sans_dir = backname ($relative_dir) . '/' . $one_hdr; } &require_file_with_conf_line ($config_header_line, $FOREIGN, $ch_sans_dir); # Header defined and in this directory. - local (@files); + my @files; if (-f $one_name . '.top') { push (@files, "${cn_sans_dir}.top"); @@ -3362,26 +3339,24 @@ sub handle_configure } else { - # Strange quoting because this gets fed through - # Perl. - push (@files, '\$(top_srcdir)/acconfig.h'); + push (@files, '$(top_srcdir)/acconfig.h'); } } - local ($stamp_name) = 'stamp-h'; - $stamp_name .= "${hdr_index}" if scalar (@config_headers) > 1; + my $stamp_name = 'stamp-h'; + $stamp_name .= "$hdr_index" + if scalar (@config_headers) > 1; - local ($xform) = ''; + my $xform = ''; + my $out_dir = &dirname ($ch_sans_dir); $xform = &transform ('CONFIGURE_AC' => $configure_ac, 'FILES' => join (' ', @files), 'CONFIG_HEADER' => $cn_sans_dir, 'CONFIG_HEADER_IN' => $ch_sans_dir, 'CONFIG_HEADER_FULL' => $one_fullname, -'STAMP' => "$stamp_dir$stamp_name"); - - local ($out_dir) = &dirname ($ch_sans_dir); - $xform .= &transform ('SRC_STAMP' => "${out_dir}/${stamp_name}"); +'STAMP'=> "$stamp_dir$stamp_name", +'SRC_STAMP'=> "$out_dir/$stamp_name"); $output_rules .= &file_contents ('remake-hdr', $xform); &create ("${relative_dir}/${out_dir}/${stamp_name}.in"); @@ -3773,6 +3748,7 @@ sub handle_merge_targets &depend ('.PHONY', 'install-strip'); } + # Helper for handle_merge_targets. Note that handle_merge_targets # relies on the fact that this doesn't add an extra \n at the end. sub do_one_merge_target @@ -6460,23 +6436,7 @@ sub read_am_file # twice. sub define_standard_variables { -# Compute relative location of the top object directory. -local (@topdir) = (); -foreach (split (/\//, $relative_dir)) -{ - next if $_ eq '.' || $_ eq ''; - if ($_ eq '..') - { - pop @topdir; - } - else - { - push (@topdir, '..'); - } -} -@topdir = ('.') if ! @topdir; - -$top_builddir = join ('/', @topdir); +$top_builddir = backname ($relative_dir); $output_vars .= &file_contents ('header-vars', &transform ('top_builddir' => $top_builddir)); @@ -6671,7 +6631,7 @@ sub initialize_global_constants # Copyright on generated Makefile.ins. $gen_copyright = "\ -# C
Re: amtraces
These people should be sent the file fencepost.gnu.org:/gd/gnuorg/Copyright/request-assign.future. They fill out the form, return it to me, and I send them the paperwork to sign. If you don't have easy access to fencepost, I'll include the file below. - Brian Youmans, FSF copyright clerk Free Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA voice: +1-617-542-5942 fax: +1-617-542-2652 web: http://www.gnu.org --- Please email the following information to [EMAIL PROTECTED], and we will send you the assignment form for your past and future changes. Please use your full name as the subject line of the message. -- REQUEST: SEND FORM FOR PAST AND FUTURE CHANGES [What is the name of the program or package you're contributing to?] [Did you copy any files or text written by someone else in these changes? Even if that material is free software, we need to know about it.] [Do you have an employer who might have a basis to claim to own your changes? Do you attend a school which might make such a claim?] [For the copyright registration, what country are you a citizen of?] [What year were you born?] [Please write your email address here.] [Please write your postal address here.] [Which files have you changed so far, and which new files have you written so far?]
a bug, i guess ...
i found the following in my configure generated by autoconf 2.13 & automake 1.4: if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } fi cat >> confdefs.h <
Re: AM_INCLUDE is a bad name.
> "Pavel" == Pavel Roskin <[EMAIL PROTECTED]> writes: Pavel> After another consideration I decided that AM_INCLUDE is not Pavel> meant to be private since it appears in AC_SUBST. But it is meant to be private. It is an implementation detail. If we change the implementation it might just go away -- leaving user code using it broken. There's no way to have a "private" AC_SUBST. That is what namespaces, even ad hoc ones, are for. Pavel> I believe that we should move towards "use strict" in Pavel> automake.in. Although it would catch just few errors, strict Pavel> typing in large projects (which Automake already is) is usually Pavel> worth it. I don't have a problem with this. Tom
Q: Distributing config.h
Hi, I'm using automake 1.4 for a library called "pdl". I want to include the generated config.h file in the installed library because it sets crucial defines that are needed by users of the library. I'm doing this by setting the following in my configure.in: AM_CONFIG_HEADER(include/pdl/pdl_config.h) and the following in my Makefile.am in include/pdl/pdl_config.h: include_HEADERS = pdl_config.h This works (*) pretty well for me. But then I read the automake documentation where it says: Header files listed in a _SOURCES definition will be included in the distribution but otherwise ignored. In case it isn't obvious, you should not include the header file generated by configure in an _SOURCES variable; this file should not be distributed. This seems to imply that config.h should _not_ be distributed, like I'm doing above. What's wrong with what I'm doing? If it's really so bad, how do I get around the problem that users of my library need things defined by configure? * = Actually, I needed to disable the definition of PACKAGE and VERSION by giving a third argument to AM_INIT_AUTOMAKE. If I don't disable those defines, then other programs using automake that link to my library will redefine this defines. So, question #2: what's a good way to set the name and version of my software if I can't do it through AM_INIT_AUTOMAKE? How much will life suck if I make up new defines called PDL_VERSION, PDL_PACKAGE and not update the package and version information in AM_INIT_AUTOMAKE? Thanks, david P.S.: Please reply to me as well as to the list as I'm not subscribed.
Re: AM_CONFIG_HEADER & stamp-h files edition 3
"Derek R. Price" wrote: > Inspired by Akim Demaille's use of ifdef, I wrote a third edition of > this patch which increases functionality when used with a current > Autoconf. I just wanted to let you all know that. ... Ok, fine, here's the patch. :) Derek -- Derek Price CVS Solutions Architect ( http://CVSHome.org ) mailto:[EMAIL PROTECTED] OpenAvenue ( http://OpenAvenue.com ) -- 99. Daddy, why doesn't this magnet pick up this floppy disk? ? automake-stamph3.diff ? automake-1.4c-stamph3.diff ? tests/automake-1.4c-stamph3.diff Index: ChangeLog === RCS file: /cvs/automake/ChangeLog,v retrieving revision 1.997 diff -u -r1.997 ChangeLog --- ChangeLog 2001/02/06 10:25:21 1.997 +++ ChangeLog 2001/02/06 18:07:37 @@ -77,6 +77,10 @@ about libtool, and maintainer-clean. * clean.am, libtool.am: Handle these. +2001-02-05 Derek Price <[EMAIL PROTECTED]> + + * m4/header.m4 (AM_CONFIG_HEADER): create stamp-h files in the correct + locations. 2001-02-05 Akim Demaille <[EMAIL PROTECTED]> Index: m4/header.m4 === RCS file: /cvs/automake/m4/header.m4,v retrieving revision 1.7 diff -u -r1.7 header.m4 --- m4/header.m42000/08/06 12:36:53 1.7 +++ m4/header.m42001/02/06 18:07:39 @@ -10,19 +10,57 @@ AC_PREREQ([2.12]) AC_DEFUN([AM_CONFIG_HEADER], +[ifdef([AC_FOREACH],dnl +[dnl init our file count if it isn't already +m4_ifndef([_AM_Config_Header_Index], m4_define([_AM_Config_Header_Index], +[0])) +dnl prepare to store our destination file list for use in config.status +AC_FOREACH([_AM_File], [$1], + [m4_pushdef([_AM_Dest], m4_patsubst(_AM_File, [:.*])) + m4_define([_AM_Config_Header_Index], +m4_incr(_AM_Config_Header_Index)) + dnl and add it to the list of files AC keeps track of, along + dnl with our hook + AC_CONFIG_HEADERS(_AM_File, +dnl COMMANDS, [, INIT-CMDS] +[# update the timestamp +echo timestamp >"AS_ESCAPE(_AM_DIRNAME(]_AM_Dest[))/stamp-h]_AM_Config_Header_Index[" +][$2]m4_ifval([$3], [, [$3]]))dnl AC_CONFIG_HEADERS + m4_popdef([_AM_Dest])])],dnl [AC_CONFIG_HEADER([$1]) AC_OUTPUT_COMMANDS( ifelse(patsubst([$1], [[^ ]], []), [], [test -z "$CONFIG_HEADERS" || echo timestamp >dnl - patsubst([$1], [^\([^:]*/\)?.*], [\1])stamp-h]), - [am_indx=1 - for am_file in $1; do -case " $CONFIG_HEADERS " in -*" $am_file "*) - echo timestamp > `echo $am_file | sed 's%:.*%%;s%[^/]*$%%'`stamp-h$am_indx - ;; -esac -am_indx=\`expr \$am_indx + 1\` - done]) -]) + patsubst([$1], [^\([^:]*/\)?.*], [\1])stamp-h]),dnl +[am_indx=1 +for am_file in $1; do + case " \$CONFIG_HEADERS " in + *" \$am_file "*) +am_dir=\`echo \$am_file |sed 's%:.*%%;s%[^/]*\$%%'\` +if test -n "\$am_dir"; then + am_tmpdir=\`echo \$am_dir |sed 's%^\(/*\).*\$%\1%'\` + for am_subdir in \`echo \$am_dir |sed 's%/% %'\`; do +am_tmpdir=\$am_tmpdir\$am_subdir/ +if test ! -d \$am_tmpdir; then + mkdir \$am_tmpdir +fi + done +fi +echo timestamp > "\$am_dir"stamp-h\$am_indx +;; + esac + am_indx=\`expr \$am_indx + 1\` +done]) +])]) # AM_CONFIG_HEADER + +# _AM_DIRNAME(PATH) +# - +# Like AS_DIRNAME, only do it during macro expansion +AC_DEFUN([_AM_DIRNAME], + [m4_if(m4_regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1, + m4_if(m4_regexp([$1], [^//\([^/]\|$\)]), -1, + m4_if(m4_regexp([$1], [^/.*]), -1, + [.], + m4_patsubst([$1], [^\(/\).*], [\1])), + m4_patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])), + m4_patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl +]) # _AM_DIRNAME Index: tests/Makefile.am === RCS file: /cvs/automake/tests/Makefile.am,v retrieving revision 1.248 diff -u -r1.248 Makefile.am --- tests/Makefile.am 2001/02/04 03:18:01 1.248 +++ tests/Makefile.am 2001/02/06 18:07:39 @@ -88,6 +88,7 @@ depacl2.test \ depend.test \ depend3.test \ +dirname.test \ discover.test \ distdir.test \ double.test \ @@ -226,6 +227,7 @@ spell3.test \ spelling.test \ stamph.test \ +stamph2.test \ stdlib.test \ subdir.test \ subdir2.test \ Index: tests/dirname.test === RCS file: tests/dirname.test diff -N tests/dirname.test --- /dev/null Tue Aug 29 07:25:14 2000 +++ tests/dirname.test Tue Feb 6 10:07:39 2001 @@ -0,0 +1,46 @@ +#! /bin/sh + +# Test the operation of the _AM_DIRNAME macro from m4/header.m4 + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +AC_PLAIN_SCRIPT +echo "1 /a/path/to/a/file = _AM_D
AM_CONFIG_HEADER & stamp-h files edition 3
Inspired by Akim Demaille's use of ifdef, I wrote a third edition of this patch which increases functionality when used with a current Autoconf. Derek -- Derek Price CVS Solutions Architect ( http://CVSHome.org ) mailto:[EMAIL PROTECTED] OpenAvenue ( http://OpenAvenue.com ) -- 99. Daddy, why doesn't this magnet pick up this floppy disk?
automake (cvs 2001 Feb 6) incorrectly sees .o rule collision
I built automake from the cvs sources today (2001.02.06), and ran it on the following Makefile.am: EXTRA_PROGRAMS = typedefs EXTRA_typedefs_SOURCES = typedefs.l It produced the following error: automake: Makefile.am: object `typedefs.$(OBJEXT)' created by `typedefs.c' and ` I believe automake is somehow confused by the typedefs.l --> typedefs.c --> typedefs.o make path. Adam J. Richter __ __ 4880 Stevens Creek Blvd, Suite 104 [EMAIL PROTECTED] \ / San Jose, California 95129-1034 +1 408 261-6630 | g g d r a s i l United States of America fax +1 408 261-6631 "Free Software For The Rest Of Us."
Re: 26-makesort.patch
Raja R Harinath <[EMAIL PROTECTED]> writes: > Akim Demaille <[EMAIL PROTECTED]> writes: > [snip] > > For instance, I find it quite annoying to have to know that Automake > > knows the -local targets: the code of 25 makes it possible for users > > to have just there own `clean:' target which will be appended to the > > existing code. > > That seems counter to current 'automake' behaviour. IIRC, if automake > sees a "special" target in Makefile.am, it won't generate code for > that target. E.g., if the Makefile.am has a 'check:' target, the > builtin test harness will not be generated. Thanks for pointing this out, I didn't know. And I don't remember I saw such code either...
Re: $prefix defaults to NONE?
Rob van der Leek <[EMAIL PROTECTED]> writes: > Hi list, > > I want to define a path to a configuration file in `config.h`, therefore > I call AC_DEFINE_UNQUOTED(CONFIG_FILE, $prefix/etc/config.xml, [Path to > config file]) > The problem is that $prefix defaults to NONE when no --prefix flag is > given at the command line, which forces me to test for this situation > and set $prefix to '/usr/local' by hand. > > Am I missing a point here? Any comments are welcome. Installation Directory Variables The following variables specify the directories where the package will be installed, see *Note Variables for Installation Directories: (standards)Directory Variables, for more information. See the end of this section for details on when and how to use these variables. - Variable: bindir The directory for installing executables that users run. - Variable: datadir The directory for installing read-only architecture-independent data. - Variable: exec_prefix The installation prefix for architecture-dependent files. By default it's the same as PREFIX. You should avoid installing anything directly to EXEC_PREFIX. However, the default value for directories containing architecture-dependent files should be relative to EXEC_PREFIX. - Variable: includedir The directory for installing C header files. - Variable: infodir The directory for installing documentation in Info format. - Variable: libdir The directory for installing object code libraries. - Variable: libexecdir The directory for installing executables that other programs run. - Variable: localstatedir The directory for installing modifiable single-machine data. - Variable: mandir The top-level directory for installing documentation in man format. - Variable: oldincludedir The directory for installing C header files for non-gcc compilers. - Variable: prefix The common installation prefix for all files. If EXEC_PREFIX is defined to a different value, PREFIX is used only for architecture-independent files. - Variable: sbindir The directory for installing executables that system administrators run. - Variable: sharedstatedir The directory for installing modifiable architecture-independent data. - Variable: sysconfdir The directory for installing read-only single-machine data. Most of these variables have values that rely on `prefix' or `exec_prefix'. It is on purpose that the directory output variables keep them unexpanded: typically `@datadir@' will be replaced by `${prefix}/share', not `/usr/local/share'. This behavior is mandated by the GNU coding standards, so that when the user runs: `make' she can still specify a different prefix from the one specified to `configure', in which case, if needed, the package shall hard code dependencies to her late desires. `make install' she can specify a different installation location, in which case the package _must_ still depend on the location which was compiled in (i.e., never recompile when `make install' is run). This is an extremely important feature, as many people may decide to install all the files of a package grouped together, and then install links from the final locations to there. In order to support these features, it is essential that `datadir' remains being defined as `${prefix}/share' to depend upon the current value of `prefix'. A corollary is that you should not use these variables but in Makefiles. For instance, instead of trying to evaluate `datadir' in `configure' and hardcoding it in Makefiles using e.g. `AC_DEFINE_UNQUOTED(DATADIR, "$datadir")', you should add `-DDATADIR="$(datadir)"' to your `CFLAGS'. Similarly you should not rely on `AC_OUTPUT_FILES' to replace `datadir' and friends in your shell scripts and other files, rather let `make' manage their replacement. For instance Autoconf ships templates of its shell scripts ending with `.sh', and uses this Makefile snippet: .sh: rm -f $@ $@.tmp sed 's,@datadir\@,$(pkgdatadir),g' $< >$@.tmp chmod +x $@.tmp mv $@.tmp $@ Three things are noteworthy: `@datadir\@' The backslash prevents `configure' from replacing `@datadir@' in the sed expression itself. `$(pkgdatadir)' Don't use `@pkgdatadir@'! Use the matching makefile variable instead. `,' Don't use `/' in the sed expression(s) since most probably the variables you use, such as `$(pkgdatadir)', will contain some.
Re: AM_INCLUDE is a bad name.
Pavel Roskin <[EMAIL PROTECTED]> writes: > > Tom, you should also know you can have a special exception, and tell > > autoconf AM_INCLUDE is OK. But I agree with Pavel it looks way too > > much like a macro name, in itself it is confusing. > > As far as I know, it cannot be done without breaking compatibility with > Autoconf 2.13. > > Too bad Autoconf doesn't provide (offically at least) any means for > writing macros conditionally for particular versions of Autoconf. ifdef. > This feature may be useful for Automake and other tools working > together with Autoconf, as well as for any packages installing m4 > files (gettext, GTK+, gnome-libs). > > I mean something like > > AC_VERSION_CASE( > [<=2.13], [test "$FOO" = yes && tmp=foo; AC_CONFIG_SUBDIRS([$tmp])], > [default], [test "$FOO" = yes && AC_CONFIG_SUBDIRS([foo])]) Don't go that way! AC_PREREQ.
Re: AM_INCLUDE is a bad name.
Hello, Tom! > What if instead we decide on a permanent naming scheme for automake > internal variables? Then we can start moving towards that over time, > starting here. > > What if instead we use `_AM_'? Or `_am_'? After another consideration I decided that AM_INCLUDE is not meant to be private since it appears in AC_SUBST. I have applied my patch as is (i.e. AM_INCLUDE -> AMINCLUDE), because it's bad that the testsuite is failing in the middle of a major modifications. I believe that we should move towards "use strict" in automake.in. Although it would catch just few errors, strict typing in large projects (which Automake already is) is usually worth it. Regards, Pavel Roskin
Re: Bug + patch
"Derek R. Price" <[EMAIL PROTECTED]> writes: > Somebody checked in a bad quote recently. It breaks at least the > stamph/header targets. Patch attached. Well, I seem to have lost patches. Can't find the one named `backname' either :( I'm applying yours, thanks!
Re: 27-fixsubdirs-am.patch
Tom Tromey <[EMAIL PROTECTED]> writes: > Akim> -clean: clean-recursive > Akim> +clean: clean-recursive clean-recursive > > This seems wrong. Ooops. Thanks. > Note that the clean-am rules are run from the clean-recursive rules in > subdirs.am. That happens so that we can force the ordering, and it is > important. This is true for the ordinary (all, install, etc) > -recursive rules in subdirs.am as well. !!! Do we have specific tests? Are the rules written down somewhere? Can't we imagine having some higher level construct specifying the constraints over the ordering instead of relying on the order in which things are processed? So instead of the patch validated here, but buggy, I apply the patch below. I have a question: sometimes I see `&defined_variable ('SUBDIRS')', and sometimes $recursive_install, and I couldn't determine the relationship between the two. Aren't they the same? Index: ChangeLog from Akim Demaille <[EMAIL PROTECTED]> * subdirs.am: This file is the exception: clean recursive targets are called by the clean targets, not the clean-am targets. Otherwise we have a circular dependency: clean -> clean-am -> clean-recursive -> clean. * automake.in (handle_clean): Don't declare -recursive dependencies of the clean targets: `subdirs.am' did it. Less hard coded knowledge, transfered into... * clean.am: here. Index: Makefile.in === RCS file: /cvs/automake/automake/Makefile.in,v retrieving revision 1.251 diff -u -u -r1.251 Makefile.in --- Makefile.in 2001/02/06 09:09:36 1.251 +++ Makefile.in 2001/02/06 10:04:12 @@ -574,25 +574,22 @@ -rm -f Makefile.in clean: clean-recursive -clean-am: clean-generic clean-recursive mostlyclean-am +clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f config.status -distclean-am: clean-am distclean-generic distclean-recursive \ - distclean-tags +distclean-am: clean-am distclean-generic distclean-tags maintainer-clean: maintainer-clean-recursive -rm -f config.status maintainer-clean-am: distclean-am maintainer-clean-aminfo \ - maintainer-clean-generic maintainer-clean-recursive \ - maintainer-clean-vti + maintainer-clean-generic maintainer-clean-vti mostlyclean: mostlyclean-recursive -mostlyclean-am: mostlyclean-aminfo mostlyclean-generic \ - mostlyclean-recursive mostlyclean-vti +mostlyclean-am: mostlyclean-aminfo mostlyclean-generic mostlyclean-vti .PHONY: all all-am all-recursive all-redirect check check-am \ check-recursive clean clean-generic clean-recursive distclean \ Index: automake.in === RCS file: /cvs/automake/automake/automake.in,v retrieving revision 1.862 diff -u -u -r1.862 automake.in --- automake.in 2001/02/06 09:22:15 1.862 +++ automake.in 2001/02/06 10:05:26 @@ -3910,18 +3910,21 @@ . 's,\@MFILES\@,' . join (' ', @maintainer_clean_files) . ',;'); } +if ($recursive_install) +{ + $xform .= 's/^NSUBDIRS.*$//;'; +} +else +{ + $xform .= 's/^NSUBDIRS//;'; +} $output_rules .= &file_contents ('clean', $xform); -&depend ('clean-am', 'mostlyclean-am'); -&depend ('distclean-am', 'clean-am'); -&depend ('maintainer-clean-am', 'distclean-am'); foreach ('clean', 'distclean', 'mostlyclean', 'maintainer-clean') { - &depend ($_, $_ . '-local') - if &target_defined ($_ . '-local'); - &depend ($_, -$_ . ($recursive_install ? '-recursive' : '-am')); + &depend ($_, "$_-local") + if &target_defined ("$_-local"); } # We special-case config.status here. If we do it as part of the Index: clean.am === RCS file: /cvs/automake/automake/clean.am,v retrieving revision 1.34 diff -u -u -r1.34 clean.am --- clean.am 2001/02/06 09:09:36 1.34 +++ clean.am 2001/02/06 10:05:31 @@ -23,17 +23,17 @@ mostlyclean-generic: MOSTLYCLEAN-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) -clean-am: clean-generic +clean-am: clean-generic mostlyclean-am clean-generic: CLEAN -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) -distclean-am: distclean-generic +distclean-am: distclean-generic clean-am distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log stamp-h stamp-h[0-9]* DISTCLEAN -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) -maintainer-clean-am: maintainer-clean-generic +maintainer-clean-am: maintainer-clean-generic distclean-am maintainer-clean-generic: ## FIXME: shouldn't we really print these messages before running ## the dependencies? @@ -44,3 +44,8 @@ .PHONY: clean mostlyclean distclean maintai
Re: 25-clean-targets.patch
Tom Tromey <[EMAIL PROTECTED]> writes: > > "Akim" == Akim Demaille <[EMAIL PROTECTED]> writes: > > Akim> so naturally the question is: do we really want to keep this > Akim> zillions of pseudo targets? The current automake, indeed, does > Akim> this instead: > > Akim> -- > Akim> clean-am: clean-this-am > Akim> clean-this-am: > Akim> do this > > Akim> clean-am: clean-that-am > Akim> clean-that-am: > Akim> do that > Akim> -- > > Akim> which will result in > > Akim> -- > Akim> clean-am: clean-this-am clean-that-am > > Akim> clean-this-am: > Akim> do this > > Akim> clean-that-am: > Akim> do that > Akim> -- > > > This transformation seems safe enough to me. I don't have a problem > with it. > What you don't want to do is inline the actual rules. This is > tempting (and it is what I thought you were talking about at first). > However, it breaks parallel builds and also `make -k'. That's indeed what I was referring to. Well, I think. What were you thinking about? I did not think about parallel builds... THe transformation above is what is now implemented. In fact, what I presented in the previous, both are implemented, it just depends on the input you give it. > Akim> -my $category; > Akim> -foreach $category (sort keys %dependencies) > Akim> +foreach (sort target_cmp keys %dependencies) > > I've been moving away from using $_ in any but the most trivial loops. > I thought $_ wasn't necessarily preserved across function calls. Good call! Thanks Pollux (aka Alexandre D.) who lent me a Perl book, and I found this in it: -- % cat /tmp/foo.plk #! /usr/bin/perl sub trash () { local $_ = "sub3\n"; } local $_ = "Yeeehaa!\n"; print; trash; print; % perl -w /tmp/foo.plk Yeeehaa! Yeeehaa! -- so how about using $_ with caution? Just tell me your preference. > Akim> + unless (defined $contents{$targets}) > Akim> + { > > Please use `if (! ...)' here. I find `unless' confusing when used > like this. OK!
Re: Bug + patch
"Derek R. Price" <[EMAIL PROTECTED]> writes: > Somebody checked in a bad quote recently. It breaks at least the > stamph/header targets. Patch attached. I already have this in the queue :) I just noticed it was wrong when reading the code. The quote was needed when there was no &transform.
Re: 24-clean-do-clean.patch
Tom Tromey <[EMAIL PROTECTED]> writes: > Akim> I can't proceed without a full approval of this patch, it is > Akim> required for the next ones. > > I thought I gave this, with a couple minor changes requested. Correct, but the thing is these changes were not doable at that time. I'll put it in TODO.
$prefix defaults to NONE?
Hi list, I want to define a path to a configuration file in `config.h`, therefore I call AC_DEFINE_UNQUOTED(CONFIG_FILE, $prefix/etc/config.xml, [Path to config file]) The problem is that $prefix defaults to NONE when no --prefix flag is given at the command line, which forces me to test for this situation and set $prefix to '/usr/local' by hand. Am I missing a point here? Any comments are welcome. TIA, rob.