[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: autotest/package.m4 question [PATCH]

From: William Pursell
Subject: Re: autotest/package.m4 question [PATCH]
Date: Mon, 13 Oct 2008 16:11:19 +0100
User-agent: Thunderbird (Macintosh/20080914)

Eric Blake wrote:
According to William Pursell on 10/13/2008 1:06 AM:

Thirdly, is there any standard way to take a file
foo.c and generate an autoconfiscated tree structure?

Not that I know of.  What tree structure are you proposing?

I suspect that would be a contentious issue.  Personally,
I like a recursive build with src/foo.c and tests/foo-test.c.
Maybe starting new projects is rare enough (only occurs
once in the life of a project) that there's no need
for such a script.  Also, once a project has grown
to any significant state, automating the conversion
is difficult if not impossible, but there is a *lot*
of resistance to the autotools in general, and it
takes a lot of trial and error and reading before
one realizes that it's fairly easy to start a new

It seems like it would be a good marketing move if
it were easy to start.  eg, instead of requiring the
would be project developer to do:

mkdir hello;
cd hello;
mkdir src; mkdir tests;
echo "SUBDIRS = src tests" >
echo bin_PROGRAMS = hello > src/
echo check_PROGRAMS = hello > tests/
echo hello_SOURCES = '$(srcdir)/../src/hello.c' >> tests/
mv configure.scan

or to write their own script to do this, it would be
fantastic if the developer of a brand new implementation
of "Hello, World!" could write the initial hello.c
file and then use a script developed by those most
knowledgeable about the autotools to generate
a tree.

As I was writing this, I thought that the following
would be handy.  My perl is weak, and I'm sure there
is a much terser way to do this:

diff --git a/bin/ b/bin/
index 18d9ac1..064d2a3 100644
--- a/bin/
+++ b/bin/
@@ -528,7 +528,15 @@ sub output ($)
"# Process this file with autoconf to produce a configure script.\n" .
      "\n" .
      "AC_PREREQ(address@hidden@])\n" .
+  if (defined $ENV{EMAIL})
+    {
+      print $file "[$ENV{EMAIL}])\n";
+    }
+  else
+    {
+      print $file "[BUG-REPORT-ADDRESS])\n";
+    }
   if (defined $cfiles[0])
       print $file "AC_CONFIG_SRCDIR([$cfiles[0]])\n";

William Pursell

reply via email to

[Prev in Thread] Current Thread [Next in Thread]