bug-automake
[Top][All Lists]
Advanced

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

setting src_foo_CPPFLAGS in non-recursive build


From: Peter Johansson
Subject: setting src_foo_CPPFLAGS in non-recursive build
Date: Mon, 14 Sep 2009 14:14:11 -0400
User-agent: Thunderbird 2.0.0.19 (X11/20090105)

Hello,

I have a problem setting CPPFLAGS for a specific program (src_foo_CPPFLAGS) in a non-recursive build. I wonder if I'm doing something wrong or if this is a bug in Automake. I'm using
automake (GNU automake) 1.11
autoconf (GNU Autoconf) 2.64
ltmain.sh (GNU libtool) 2.2.4

Below follows a slimmed down example that reproduces the problem:

cat > Makefile.am <<EOF
ACLOCAL_AMFLAGS = -I m4 --install
AM_DEFAULT_SOURCE_EXT = .cc
AM_CPPFLAGS =
src_foo_CPPFLAGS = -I`pwd`/include
bin_PROGRAMS  =
bin_PROGRAMS += src/foo
bin_PROGRAMS += src/foo2
EOF

cat > configure.ac <<EOF
AC_INIT([foo],[1.0])
AC_CONFIG_SRCDIR([src/foo.cc])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADER([config.h])
AM_INIT_AUTOMAKE([1.11 -Wall -Werror foreign subdir-objects])
AC_LANG(C++)
AC_PROG_CXXCPP
AC_PROG_CXX
AC_PROG_INSTALL
LT_INIT
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
EOF

mkdir -p m4
mkdir -p src
mkdir -p include

cat > include/bar.h <<EOF
#include <iostream>
#include <string>
void bar(void)
{
   std::cout << "Hello World" << std::endl;
}
EOF

cat > src/foo2.cc <<EOF
#include "bar.h"
int main()
{
bar();
return 0;
}
EOF

cat > src/foo.cc <<EOF
#include <iostream>
#include <string>
int main()
{
std::cout << "Hello World\n";
return 0;
}
EOF

autoreconf -ivf
./configure
make


Thanks,

--
Peter Johansson

svndigest maintainer, http://dev.thep.lu.se/svndigest
yat maintainer,       http://dev.thep.lu.se/yat





reply via email to

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