Re: vpath builds and include paths
On Mon, 2003-12-22 at 06:55, [EMAIL PROTECTED] wrote: The contents of /test/project1/sublevel/src/Makefile.am is: INCLUDE = -I../inc This attempts to build in this new /build directory, but during compilation it cannot locate the header file, myproj.hpp, and the rest of the build fails. What do I need to do in order to tell automake where this header is? I've already tried using the absolute path variables in the Makefile.am: INCLUDE = -I$(abs_top_srcdir)/project2/sublevel/inc AM_CPPFLAGS = -I$(srcdir)/../inc Ralf
Re: vpath builds and include paths
On Mon, 22 Dec 2003 [EMAIL PROTECTED] wrote: However, if I want to build in a separate build tree (relying on VPATH), then I try the following: mkdir /build cd /build /test/configure make This attempts to build in this new /build directory, but during compilation it cannot locate the header file, myproj.hpp, and the rest of the build fails. What do I need to do in order to tell automake where this header is? I've already tried using the absolute path variables in the Makefile.am: INCLUDE = -I$(abs_top_srcdir)/project2/sublevel/inc Note that abs_top_srcdir calculation was broken in Autoconf 2.58. It is fixed in 2.59. Rather than using INCLUDE you should use AM_CPPFLAGS. For example AM_CPPFLAGS = -I$(top_srcdir)/project2/sublevel/inc Bob == Bob Friesenhahn [EMAIL PROTECTED] http://www.simplesystems.org/users/bfriesen
Re: vpath builds and include paths
Bob Friesenhahn wrote: On Mon, 22 Dec 2003 [EMAIL PROTECTED] wrote: However, if I want to build in a separate build tree (relying on VPATH), then I try the following: mkdir /build cd /build /test/configure make This attempts to build in this new /build directory, but during compilation it cannot locate the header file, myproj.hpp, and the rest of the build fails. What do I need to do in order to tell automake where this header is? I've already tried using the absolute path variables in the Makefile.am: INCLUDE = -I$(abs_top_srcdir)/project2/sublevel/inc Note that abs_top_srcdir calculation was broken in Autoconf 2.58. It is fixed in 2.59. Rather than using INCLUDE you should use AM_CPPFLAGS. For example AM_CPPFLAGS = -I$(top_srcdir)/project2/sublevel/inc *g* or override DEFS to let the local includes be found first always... since the days I have had serious problems with includes I do tend to make up projects only ever with a prefix/my.h which needs then only -I$(top_srcdir) where top_srcdir/prefix/ exists. That needs to override the default_includes as well to cut away the -I. -I$(srcdir) settings. Personally, I'd never do myproj.h anymore, only ever now myproj/inc.h just my 2cent, -- guidohttp://AC-Archive.sf.net GCS/E/S/P C++/$ ULHS L++w- N++@ s+:a d(+-) r+@+++ y++ 5++X-
Re: vpath builds and include paths
Thank you Bob, that suggestion worked. Also, using $(srcdir) also worked. John - Original Message - From: Bob Friesenhahn [EMAIL PROTECTED] Date: Monday, December 22, 2003 10:04 am Subject: Re: vpath builds and include paths On Mon, 22 Dec 2003 [EMAIL PROTECTED] wrote: However, if I want to build in a separate build tree (relying on VPATH), then I try the following: mkdir /build cd /build /test/configure make This attempts to build in this new /build directory, but during compilation it cannot locate the header file, myproj.hpp, and the rest of the build fails. What do I need to do in order to tell automake where this header is? I've already tried using the absolute path variables in the Makefile.am: INCLUDE = -I$(abs_top_srcdir)/project2/sublevel/inc Note that abs_top_srcdir calculation was broken in Autoconf 2.58. It is fixed in 2.59. Rather than using INCLUDE you should use AM_CPPFLAGS. For example AM_CPPFLAGS = -I$(top_srcdir)/project2/sublevel/inc Bob == Bob Friesenhahn [EMAIL PROTECTED] http://www.simplesystems.org/users/bfriesen
vpath builds and include paths
I was doing a test where I am using GNU automake and autoconf. I have a directory structure such as: /test Makefile.am configure.in /test/project1 Makefile.am /test/project1/sublevel Makefile.am /test/project1/sublevel/src myproj.cpp Makefile.am /test/project1/sublevel/inc myproj.hpp The contents of /test/project1/sublevel/src/Makefile.am is: INCLUDE = -I../inc lib_LIBRARIES = libmyproj.a libmyproj_a_SOURCES = myproj.cpp myproj.hpp So this works alright if I am building within the source tree (i.e. myproj.a is built in /test/project1/sublevel/src). However, if I want to build in a separate build tree (relying on VPATH), then I try the following: mkdir /build cd /build /test/configure make This attempts to build in this new /build directory, but during compilation it cannot locate the header file, myproj.hpp, and the rest of the build fails. What do I need to do in order to tell automake where this header is? I've already tried using the absolute path variables in the Makefile.am: INCLUDE = -I$(abs_top_srcdir)/project2/sublevel/inc This doesn't seem to help. Thanks, John