]> git.proxmox.com Git - mirror_lxc.git/commitdiff
replace lxc-version by lxc-config
authorDaniel Lezcano <dlezcano@fr.ibm.com>
Wed, 10 Jun 2009 16:21:48 +0000 (18:21 +0200)
committerDaniel Lezcano <dlezcano@fr.ibm.com>
Wed, 10 Jun 2009 16:21:48 +0000 (18:21 +0200)
As we have the correct informations with pkg-config we can
write a script which will collect the informations and we get
rid of the C program.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
configure.ac
src/lxc/Makefile.am
src/lxc/lxc-config.in [new file with mode: 0644]
src/lxc/lxc_version.c [deleted file]

index 12a4f8252b5fe55264f5fff8e3c02397d1f75d21..3571d5d4b30841caf084054465dd879af2fc186f 100644 (file)
@@ -20,6 +20,7 @@ AS_AC_EXPAND(BINDIR, $bindir)
 AS_AC_EXPAND(INCLUDEDIR, $includedir)
 AS_AC_EXPAND(LIBEXECDIR, $libexecdir)
 AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
+AS_AC_EXPAND(DATADIR, $datadir)
 AS_AC_EXPAND(LOCALSTATEDIR, $localstatedir)
 AS_AC_EXPAND(LXCPATH, "${localstatedir}/lib/lxc")
 AS_AC_EXPAND(LXC_GENERATE_DATE, "$(date)")
@@ -97,6 +98,7 @@ AC_CONFIG_FILES([
        src/lxc/lxc-netstat
        src/lxc/lxc-checkconfig
        src/lxc/lxc-setcap
+       src/lxc/lxc-config
 
        etc/Makefile
        etc/lxc-macvlan.conf
index 58c8ef3849e9c5ad67cfcac944942d8127277837..66d9f28cf3b193fe66bd31eedcf79f294394df8d 100644 (file)
@@ -29,7 +29,6 @@ liblxc_la_SOURCES = \
        freezer.c \
        checkpoint.c \
        restart.c \
-       version.c \
        error.h error.c \
        parse.c parse.h \
        cgroup.c cgroup.h \
@@ -59,7 +58,8 @@ bin_SCRIPTS = \
        lxc-netstat \
        lxc-ls \
        lxc-checkconfig \
-       lxc-setcap
+       lxc-setcap \
+       lxc-config
 
 bin_PROGRAMS = \
        lxc-unshare \
@@ -76,8 +76,7 @@ bin_PROGRAMS = \
        lxc-cgroup \
        lxc-unfreeze \
        lxc-checkpoint \
-       lxc-restart \
-       lxc-version
+       lxc-restart
 
 libexec_PROGRAMS = \
        lxc-init
@@ -130,8 +129,5 @@ lxc_checkpoint_LDADD = liblxc.la
 lxc_restart_SOURCES = lxc_restart.c
 lxc_restart_LDADD = liblxc.la
 
-lxc_version_SOURCES = lxc_version.c
-lxc_version_LDADD = liblxc.la
-
 install-exec-local:
        @mkdir -p $(DESTDIR)@LXCPATH@
diff --git a/src/lxc/lxc-config.in b/src/lxc/lxc-config.in
new file mode 100644 (file)
index 0000000..547e649
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:@DATADIR@/pkgconfig
+
+echo "lxc version: $(pkg-config --modversion lxc)"
+echo "libdir     : $(pkg-config --variable=libdir lxc)"
+echo "bindir     : $(pkg-config --variable=bindir lxc)"
+echo "includedir : $(pkg-config --variable=includedir lxc)"
+echo "statedir   : $(pkg-config --variable=localstatedir lxc)"
+echo "libs       : $(pkg-config --libs lxc)"
+
+if [ "$(pkg-config --cflags lxc)" != " " ]; then
+    echo "cflags     : $(pkg-config --cflags lxc)"
+fi
\ No newline at end of file
diff --git a/src/lxc/lxc_version.c b/src/lxc/lxc_version.c
deleted file mode 100644 (file)
index 621c937..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * lxc: linux Container library
- *
- * (C) Copyright IBM Corp. 2007, 2008
- *
- * Authors:
- * Daniel Lezcano <dlezcano at fr.ibm.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-#include <stdio.h>
-#include <lxc/lxc.h>
-
-int main(int argc, char *argv[])
-{
-       printf("Version: %s\n", lxc_version());
-       return 0;
-}