bug-automake
[Top][All Lists]
Advanced

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

LTLIBOBJS not built when using AC_REPLACE_FUNCS without AC_CONFIG_LIBOBJ


From: Chris Pickett
Subject: LTLIBOBJS not built when using AC_REPLACE_FUNCS without AC_CONFIG_LIBOBJ_DIR
Date: Tue, 23 Dec 2008 01:00:08 -0500
User-agent: Thunderbird 1.5.0.14 (Macintosh/20071210)

Hi,

I'm trying to use AC_REPLACE_FUNCS to provide strsignal. However, when I run make it doesn't build a strsignal.lo for me, and libtool complains "link: `strsignal.lo' is not a valid libtool object". This is using the latest versions of the Autotools on MinGW/MSYS.

The Automake manual says, "The AC_CONFIG_LIBOBJ_DIR tells Autoconf that the source files of these object files are to be found in the lib/ directory. Automake can also use this information, otherwise it expects the source files are to be in the directory where the ‘$(LIBOBJS)’ and ‘$(ALLOCA)’ variables are used."

My problem is that I do have the strsignal.c source in the same directory as the src/Makefile.am but it isn't apparently getting built. Is this an Automake bug or is it my fault, and if it is my fault, what am I doing wrong? Relevant files/file snippets follow.

Side question: is the form of strsignal.c correct? For example, is the strsignal prototype in the right place? I'm a bit sleepy / confused.

Cheers,
Chris

configure.ac:
=============
...
AC_REPLACE_FUNCS([strsignal])
...

src/strsignal.c:
================
/* This file gets included if AC_REPLACE_FUNCS([strsignal]) cannot find the function. */
#if HAVE_CONFIG_H
#include <config.h>
#endif

#include <sys/types.h>
#include <stdio.h>

#if !HAVE_STRSIGNAL
static const char *strsignal(int sig);
#endif /* !HAVE_STRSIGNAL */

/* Note that Gnulib has a much more advanced version of strsignal */
static const char *
strsignal (int sig)
{
  static char signame[40];
  sprintf(signame, "SIG #%d", sig);
  return signame;
}

src/Makefile.am:
================
...
libcheck_la_LIBADD      = @LTLIBOBJS@ @GCOV_LIBS@
...
libcheckinternal_la_LIBADD      = @LTLIBOBJS@ @GCOV_LIBS@
...





reply via email to

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