Configure script can be invoked outside of source directory, which allows
to compile sources without spoiling the source directory with compilation
artifacts (like .o files). This patch tries to fix our Makefiles to allow
this to work.

You can test it in current GIT checkout (in the root dir):
# mkdir build; cd build; ../configure; make

As result, you should see all binary files in the 'build' directory.

Signed-off-by: Jan Safranek <[email protected]>
---

 src/Makefile.am        |    2 +-
 src/daemon/Makefile.am |    4 ++--
 src/pam/Makefile.am    |    2 +-
 src/tools/Makefile.am  |    2 +-
 tests/Makefile.am      |    2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index f4106ba..652a23f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -7,6 +7,6 @@ INCLUDES = -I$(top_srcdir)/include
 lib_LTLIBRARIES = libcgroup.la
 libcgroup_la_SOURCES = parse.y lex.l api.c config.c libcgroup-internal.h 
libcgroup.map wrapper.c
 libcgroup_la_LIBADD = -lpthread
-libcgroup_la_LDFLAGS = -Wl,--version-script,libcgroup.map \
+libcgroup_la_LDFLAGS = -Wl,--version-script,$(srcdir)/libcgroup.map \
        -version-number 
$(LIBRARY_VERSION_MAJOR):$(LIBRARY_VERSION_MINOR):$(LIBRARY_VERSION_RELEASE)
 
diff --git a/src/daemon/Makefile.am b/src/daemon/Makefile.am
index feeeb3a..f3100ed 100644
--- a/src/daemon/Makefile.am
+++ b/src/daemon/Makefile.am
@@ -4,7 +4,7 @@ if WITH_DAEMON
 
 sbin_PROGRAMS = cgrulesengd
 cgrulesengd_SOURCES = cgrulesengd.c cgrulesengd.h
-cgrulesengd_LDADD = $(top_srcdir)/src/.libs/libcgroup.la -lrt
-cgrulesengd_LDFLAGS = -L$(top_srcdir)/src/.libs
+cgrulesengd_LDADD = $(top_builddir)/src/.libs/libcgroup.la -lrt
+cgrulesengd_LDFLAGS = -L$(top_builddir)/src/.libs
 
 endif
diff --git a/src/pam/Makefile.am b/src/pam/Makefile.am
index 2ad565e..841f85a 100644
--- a/src/pam/Makefile.am
+++ b/src/pam/Makefile.am
@@ -5,6 +5,6 @@ if WITH_PAM
 lib_LTLIBRARIES = pam_cgroup.la
 pam_cgroup_la_SOURCES = pam_cgroup.c
 pam_cgroup_la_LDFLAGS = -module
-pam_cgroup_la_LIBADD = $(top_srcdir)/src/.libs/libcgroup.la -lpam
+pam_cgroup_la_LIBADD = $(top_builddir)/src/.libs/libcgroup.la -lpam
 
 endif
diff --git a/src/tools/Makefile.am b/src/tools/Makefile.am
index d541445..ccfeeae 100644
--- a/src/tools/Makefile.am
+++ b/src/tools/Makefile.am
@@ -1,5 +1,5 @@
 INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/include
-LDADD = $(top_srcdir)/src/.libs/libcgroup.la
+LDADD = $(top_builddir)/src/.libs/libcgroup.la
 
 if WITH_TOOLS
 
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 14bcdf3..90e2f94 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,5 +1,5 @@
 INCLUDES = -I$(top_srcdir)/include
-LDADD = $(top_srcdir)/src/.libs/libcgroup.la
+LDADD = $(top_builddir)/src/.libs/libcgroup.la
 
 # compile the tests, but do not install them
 noinst_PROGRAMS = libcgrouptest01 libcg_ba setuid pathtest walk_test 
read_stats walk_task get_controller get_mount_point proctest


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Libcg-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to