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 <dlezcano@fr.ibm.com>
This commit is contained in:
Daniel Lezcano 2009-10-22 15:33:40 +02:00
parent 92d385229b
commit 881450bbed
11 changed files with 18 additions and 5 deletions

View File

@ -25,6 +25,11 @@ AS_AC_EXPAND(LOCALSTATEDIR, $localstatedir)
AS_AC_EXPAND(LXCPATH, "${localstatedir}/lib/lxc") AS_AC_EXPAND(LXCPATH, "${localstatedir}/lib/lxc")
AS_AC_EXPAND(LXC_GENERATE_DATE, "$(date)") 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_CHECK_HEADERS([linux/netlink.h linux/genetlink.h],
[], [],
AC_MSG_ERROR([netlink headers not found. Please install the linux kernel headers.]), AC_MSG_ERROR([netlink headers not found. Please install the linux kernel headers.]),

View File

@ -1,6 +1,5 @@
INCLUDES= -I$(top_srcdir)/src -DLXCPATH="\"@LXCPATH@\"" \ AM_CFLAGS= -I$(top_srcdir)/src
-DLXCBINDIR="\"$(bindir)\"" \
-DLXCLIBEXECDIR="\"$(libexecdir)\""
lib_LTLIBRARIES = liblxc.la lib_LTLIBRARIES = liblxc.la
pkginclude_HEADERS = \ pkginclude_HEADERS = \
start.h \ start.h \

View File

@ -37,6 +37,7 @@
#include <net/if.h> #include <net/if.h>
#include "error.h" #include "error.h"
#include "config.h"
#include <lxc/lxc.h> #include <lxc/lxc.h>
#include <lxc/log.h> #include <lxc/log.h>

View File

@ -48,6 +48,7 @@
#include "network.h" #include "network.h"
#include "error.h" #include "error.h"
#include "parse.h" #include "parse.h"
#include "config.h"
#include <lxc/lxc.h> #include <lxc/lxc.h>
#include <lxc/log.h> #include <lxc/log.h>

View File

@ -32,11 +32,12 @@
#include <sys/param.h> #include <sys/param.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/types.h> #include <sys/types.h>
#include "error.h" #include "error.h"
#include <lxc/lxc.h> #include <lxc/lxc.h>
#include <lxc/log.h> #include <lxc/log.h>
#include "config.h"
lxc_log_define(lxc_create, lxc); lxc_log_define(lxc_create, lxc);
static int dir_filter(const struct dirent *dirent) static int dir_filter(const struct dirent *dirent)

View File

@ -33,6 +33,8 @@
#include <lxc/lxc.h> #include <lxc/lxc.h>
#include <lxc/log.h> #include <lxc/log.h>
#include "config.h"
lxc_log_define(lxc_destroy, lxc); lxc_log_define(lxc_destroy, lxc);
static int remove_lxc_directory(const char *dirname) static int remove_lxc_directory(const char *dirname)

View File

@ -31,6 +31,8 @@
#include <sys/param.h> #include <sys/param.h>
#include "error.h" #include "error.h"
#include "config.h"
#include <lxc/lxc.h> #include <lxc/lxc.h>
lxc_log_define(lxc_lock, lxc); lxc_log_define(lxc_lock, lxc);

View File

@ -29,6 +29,7 @@
#include <lxc.h> #include <lxc.h>
#include "arguments.h" #include "arguments.h"
#include "config.h"
lxc_log_define(lxc_checkpoint, lxc); lxc_log_define(lxc_checkpoint, lxc);

View File

@ -34,6 +34,7 @@
#include <lxc/lxc.h> #include <lxc/lxc.h>
#include "confile.h" #include "confile.h"
#include "arguments.h" #include "arguments.h"
#include "config.h"
lxc_log_define(lxc_execute, lxc); lxc_log_define(lxc_execute, lxc);

View File

@ -24,7 +24,6 @@
#define __namespace_h #define __namespace_h
#include <syscall.h> #include <syscall.h>
#define _GNU_SOURCE
#include <sched.h> #include <sched.h>
#ifndef CLONE_FS #ifndef CLONE_FS

View File

@ -34,6 +34,7 @@
#include <lxc/lxc.h> #include <lxc/lxc.h>
#include <lxc/log.h> #include <lxc/log.h>
#include "commands.h" #include "commands.h"
#include "config.h"
lxc_log_define(lxc_state, lxc); lxc_log_define(lxc_state, lxc);