automake
[Top][All Lists]
Advanced

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

Re: AC_CONFIG_LIBOBJ_DIR


From: Ralf Wildenhues
Subject: Re: AC_CONFIG_LIBOBJ_DIR
Date: Mon, 21 Aug 2006 18:13:05 +0200
User-agent: Mutt/1.5.12 (2006-08-10)

Hello Russ,

* Russ Allbery wrote on Wed, Aug 16, 2006 at 08:20:26PM CEST:
> Ralf Wildenhues <address@hidden> writes:
> > * Russ Allbery wrote on Tue, Aug 15, 2006 at 07:19:10PM CEST:
> 
> >> A while back, I asked about Automake support for AC_CONFIG_LIBOBJ_DIR
> >> in the context of using Automake to support a non-recursive build of a
> >> package.
[...]
> > The CVS version of Automake has AC_CONFIG_LIBOBJ_DIR support not in
> > 1.9.6.  Is that sufficient for your needs?

> I'm not sure.

> I essentially gave an example package in my previous message, in that if
> you put together a configure script and Makefile.am with those lines,
> you'll see the problem.  The package that I can't currently build with a
> released Automake is at:
> 
>     <http://www.eyrie.org/~eagle/software/remctl/>

I have tried Automake-1.9b together with the patch below for this
package, and I believe it to work well.  See the first patch below to
introduce usage of AC_CONFIG_LIBOBJ_DIR.  With a small change to be able
to run `make check' in a VPATH build, I get two failures and some
skipped tests:

| client/remctl...........execution failed (not found?)
[...]
| util/xmalloc............execution failed (not found?)

Running these manually seems to work, though, revealing that it's just a
VPATH bug:
$ ../remctl-2.0/tests/client/remctl-t >/dev/null; echo $?
0
$ ../remctl-2.0/tests/util/xmalloc-t >/dev/null; echo $?
0

The second patch below fixes that by substituting @srcdir@ into TESTS,
after which distcheck passes for me.

Your package reveals (because it works around) a couple more bugs in
Automake (some files and directories not cleaned up by `clean' and
`distclean'); moving to use `libtool --mode=clean' would probably
simplify fixing those inside Automake...

Please do a
  mv tests/TESTS tests/TESTS.in

before actually applying the patch.

Cheers,
Ralf

        * configure.ac: Take advantage of Automake-1.9b LIBOBJDIR
        support, remove paths from `AC_LIBOBJ' arguments.
        * Makefile.am: No need to specify MOSTLYCLEANFILES any more.

        * tests/TESTS: Removed; this is now generated from...
        * tests/TESTS.in: this.  Add @srcdir@ for non-generated files.
        * configure.ac (AC_CONFIG_FILES): Adjust; update notation.
        * Makefile.am (check-local): Also depend on `tests/TESTS'.

--- remctl-2.0/configure.ac     2006-08-08 05:03:45.000000000 +0200
+++ remctl-2.0/configure.ac     2006-08-21 18:05:37.000000000 +0200
@@ -11,6 +11,7 @@
 AC_PREREQ(2.57)
 AC_INIT([remctl], [2.0], address@hidden)
 AC_CONFIG_AUX_DIR([tools])
+AC_CONFIG_LIBOBJ_DIR([util])
 AM_INIT_AUTOMAKE
 AM_MAINTAINER_MODE
 
@@ -31,11 +32,12 @@
 AC_CHECK_TYPES([long long])
 RRA_FUNC_SNPRINTF
 AC_CHECK_FUNCS([setrlimit])
-AC_CHECK_FUNC([asprintf], [], [AC_LIBOBJ([util/asprintf])])
-AC_CHECK_FUNC([setenv], [], [AC_LIBOBJ([util/setenv])])
-AC_CHECK_FUNC([strlcat], [], [AC_LIBOBJ([util/strlcat])])
-AC_CHECK_FUNC([strlcpy], [], [AC_LIBOBJ([util/strlcpy])])
+AC_CHECK_FUNC([asprintf], [], [AC_LIBOBJ([asprintf])])
+AC_CHECK_FUNC([setenv], [], [AC_LIBOBJ([setenv])])
+AC_CHECK_FUNC([strlcat], [], [AC_LIBOBJ([strlcat])])
+AC_CHECK_FUNC([strlcpy], [], [AC_LIBOBJ([strlcpy])])
 AC_TYPE_SIGNAL
 
 AC_CONFIG_HEADER([config.h])
-AC_OUTPUT([Makefile])
+AC_CONFIG_FILES([Makefile tests/TESTS])
+AC_OUTPUT
--- remctl-2.0/Makefile.am      2006-08-09 17:45:17.000000000 +0200
+++ remctl-2.0/Makefile.am      2006-08-21 18:05:30.000000000 +0200
@@ -59,9 +59,6 @@
 $(srcdir)/docs/protocol.txt: $(srcdir)/docs/protocol.xml
        xml2rfc $(srcdir)/docs/protocol.xml $(srcdir)/docs/protocol.txt
 
-# We shouldn't have to explicitly list $(LIBOBJS) and $(LTLIBOBJS) here.
-# This is a bug in the non-recursive support.
-MOSTLYCLEANFILES = $(LIBOBJS) $(LTLIBOBJS)
 CLEANFILES = server/remctld.8
 MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.h.in config.h.in~ \
        configure client/remctl.1 docs/protocol.html docs/protocol.txt \
@@ -137,6 +134,6 @@
        tests/util/xwrite-t.c
 tests_util_xwrite_t_LDADD = tests/libtest.a util/libutil.la
 
-check-local: $(noinst_PROGRAMS)
+check-local: $(noinst_PROGRAMS) tests/TESTS
        cd tests && ./runtests TESTS
 
--- remctl-2.0/tests/TESTS      2006-07-29 01:00:42.000000000 +0200
+++ remctl-2.0/tests/TESTS.in   2006-08-21 18:05:18.000000000 +0200
@@ -1,6 +1,6 @@
 client/api
 client/open
-client/remctl
address@hidden@/client/remctl
 server/accept
 server/streaming
 server/version
@@ -14,5 +14,5 @@
 util/strlcpy
 util/tokens
 util/vector
-util/xmalloc
address@hidden@/util/xmalloc
 util/xwrite





reply via email to

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