]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
Fix compilation outside of source directory
authorJan Safranek <jsafrane@redhat.com>
Mon, 14 Dec 2009 08:22:36 +0000 (09:22 +0100)
committerDhaval Giani <dhaval@linux.vnet.ibm.com>
Wed, 16 Dec 2009 08:36:39 +0000 (14:06 +0530)
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 <jsafrane@redhat.com>
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
src/Makefile.am
src/daemon/Makefile.am
src/pam/Makefile.am
src/tools/Makefile.am
tests/Makefile.am

index f4106ba4c368c1a5c4da9b937fff1d70b023a9b5..652a23f033e610a51885a99777e696b83efff38a 100644 (file)
@@ -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)
 
index feeeb3a7161766f29b257c3bcd8990a8b234dc1f..f3100eded5652a246396087bd09b9b34c45cd3c2 100644 (file)
@@ -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
index 2ad565eea2f3a382ced824a9adcf3d2e8a628d2a..841f85a1bbcfc75fb21a752f86105849526cc87e 100644 (file)
@@ -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
index d54144564547a25adfa181c259d8efa86cfbe34d..ccfeeaead40a1d42e770964d34368dc77b4e0e66 100644 (file)
@@ -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
 
index 1161292659b27077e50a79cdab7211bded081112..b88688b35f3e13087c78ad9c1f8651291724a40a 100644 (file)
@@ -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 get_all_controller