bug-gnulib
[Top][All Lists]
Advanced

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

Re: [PATCH 00/15] Add libunistring-optional module


From: Bruno Haible
Subject: Re: [PATCH 00/15] Add libunistring-optional module
Date: Tue, 25 May 2010 02:26:52 +0200
User-agent: KMail/1.9.9

Hi all,

Since that change, that introduced the m4/libunistring-base.m4 file,
users of libunistring modules from gnulib *must* use the automake option
'subdir-objects'. The automake documentation makes it sound like the use
of the Automake option subdir-objects is merely a matter of style and
preference. But here, when this option is not used, the package breaks.

How to reproduce:

=================================== configure.ac =========================
AC_INIT([dummy], [0.0])
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_SRCDIR([configure.ac])
AC_PROG_CC

my_LIBOBJS=
AC_SUBST([my_LIBOBJS])
AC_DEFUN([my_LIBOBJ], [
  my_LIBOBJS="$my_LIBOBJS $1.$ac_objext"
])
m4_pushdef([AC_LIBOBJ], m4_defn([my_LIBOBJ]))
AC_LIBOBJ([foo/bar])
m4_popdef([AC_LIBOBJ])

AC_CONFIG_FILES([Makefile])
AC_OUTPUT
=================================== Makefile.am ==========================
AUTOMAKE_OPTIONS = 1.5 foreign subdir-objects no-dependencies
bin_PROGRAMS = bar
bar_SOURCES =
EXTRA_bar_SOURCES = foo/bar.c
bar_LDADD = $(my_LIBOBJS)
bar_DEPENDENCIES = $(my_LIBOBJS)
=================================== foo/bar.c ============================
#include <stdio.h>
int main () {
  printf ("Hello world!\n");
  return 0;
}
==========================================================================

Without subdir-objects, it doesn't work.
  $ make
  ...
  gcc -DHAVE_CONFIG_H -I.     -g -O2 -c foo/bar.c
  gcc  -g -O2   -o bar  foo/bar.o 
  gcc: foo/bar.o: No such file or directory
  gcc: no input files
  make[1]: *** [bar] Error 1

More subtle errors occur for libraries, when libtool is used.

Bruno



reply via email to

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