From: Daniel Lezcano Date: Thu, 22 Oct 2009 13:33:40 +0000 (+0200) Subject: use config.h to define the lxcpath and co X-Git-Tag: lxc_0_6_4~48 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=881450bbedbe722f4b92f03c3b2633fae2f8a13c;p=thirdparty%2Flxc.git use config.h to define the lxcpath and co Instead of passing the LXCPATH definition in the compiler command line, use configure.ac to define the value in the config.h file and include this file where it is needed. Signed-off-by: Daniel Lezcano --- diff --git a/configure.ac b/configure.ac index 3e68ed638..3acd0fd05 100644 --- a/configure.ac +++ b/configure.ac @@ -25,6 +25,11 @@ AS_AC_EXPAND(LOCALSTATEDIR, $localstatedir) AS_AC_EXPAND(LXCPATH, "${localstatedir}/lib/lxc") AS_AC_EXPAND(LXC_GENERATE_DATE, "$(date)") +AH_TEMPLATE([LXCPATH], [lxc configuration repository]) +AH_TEMPLATE([LXCLIBEXECDIR], [lxc executable library path]) +AC_DEFINE_UNQUOTED(LXCPATH, "$LXCPATH") +AC_DEFINE_UNQUOTED(LXCLIBEXECDIR, "$LIBEXECDIR") + AC_CHECK_HEADERS([linux/netlink.h linux/genetlink.h], [], AC_MSG_ERROR([netlink headers not found. Please install the linux kernel headers.]), diff --git a/src/lxc/Makefile.am b/src/lxc/Makefile.am index eb90e3e49..0e5fa24be 100644 --- a/src/lxc/Makefile.am +++ b/src/lxc/Makefile.am @@ -1,6 +1,5 @@ -INCLUDES= -I$(top_srcdir)/src -DLXCPATH="\"@LXCPATH@\"" \ - -DLXCBINDIR="\"$(bindir)\"" \ - -DLXCLIBEXECDIR="\"$(libexecdir)\"" +AM_CFLAGS= -I$(top_srcdir)/src + lib_LTLIBRARIES = liblxc.la pkginclude_HEADERS = \ start.h \ diff --git a/src/lxc/cgroup.c b/src/lxc/cgroup.c index aa06dd548..8225ed8df 100644 --- a/src/lxc/cgroup.c +++ b/src/lxc/cgroup.c @@ -37,6 +37,7 @@ #include #include "error.h" +#include "config.h" #include #include diff --git a/src/lxc/conf.c b/src/lxc/conf.c index c733bff15..69cf8e638 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -48,6 +48,7 @@ #include "network.h" #include "error.h" #include "parse.h" +#include "config.h" #include #include diff --git a/src/lxc/create.c b/src/lxc/create.c index 2527c779f..a78aaed17 100644 --- a/src/lxc/create.c +++ b/src/lxc/create.c @@ -32,11 +32,12 @@ #include #include #include - #include "error.h" #include #include +#include "config.h" + lxc_log_define(lxc_create, lxc); static int dir_filter(const struct dirent *dirent) diff --git a/src/lxc/destroy.c b/src/lxc/destroy.c index 63d7c3a12..d0e7b52d8 100644 --- a/src/lxc/destroy.c +++ b/src/lxc/destroy.c @@ -33,6 +33,8 @@ #include #include +#include "config.h" + lxc_log_define(lxc_destroy, lxc); static int remove_lxc_directory(const char *dirname) diff --git a/src/lxc/lock.c b/src/lxc/lock.c index 76eaccf74..820668b0b 100644 --- a/src/lxc/lock.c +++ b/src/lxc/lock.c @@ -31,6 +31,8 @@ #include #include "error.h" +#include "config.h" + #include lxc_log_define(lxc_lock, lxc); diff --git a/src/lxc/lxc_checkpoint.c b/src/lxc/lxc_checkpoint.c index 2fe9f51da..4d0e210b6 100644 --- a/src/lxc/lxc_checkpoint.c +++ b/src/lxc/lxc_checkpoint.c @@ -29,6 +29,7 @@ #include #include "arguments.h" +#include "config.h" lxc_log_define(lxc_checkpoint, lxc); diff --git a/src/lxc/lxc_execute.c b/src/lxc/lxc_execute.c index 22defbcb9..226c6ec8c 100644 --- a/src/lxc/lxc_execute.c +++ b/src/lxc/lxc_execute.c @@ -34,6 +34,7 @@ #include #include "confile.h" #include "arguments.h" +#include "config.h" lxc_log_define(lxc_execute, lxc); diff --git a/src/lxc/namespace.h b/src/lxc/namespace.h index 16cbf08a7..5442dd3b7 100644 --- a/src/lxc/namespace.h +++ b/src/lxc/namespace.h @@ -24,7 +24,6 @@ #define __namespace_h #include -#define _GNU_SOURCE #include #ifndef CLONE_FS diff --git a/src/lxc/state.c b/src/lxc/state.c index 1e8b8e159..6125fa36b 100644 --- a/src/lxc/state.c +++ b/src/lxc/state.c @@ -34,6 +34,7 @@ #include #include #include "commands.h" +#include "config.h" lxc_log_define(lxc_state, lxc);