From: Daniel Lezcano Date: Wed, 10 Jun 2009 16:21:48 +0000 (+0200) Subject: replace lxc-version by lxc-config X-Git-Tag: lxc_0_6_3~46 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3eae9733be0e89b1badb36d96bb60704f291ffc0;p=thirdparty%2Flxc.git replace lxc-version by lxc-config 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 --- diff --git a/configure.ac b/configure.ac index 12a4f8252..3571d5d4b 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/src/lxc/Makefile.am b/src/lxc/Makefile.am index 58c8ef384..66d9f28cf 100644 --- a/src/lxc/Makefile.am +++ b/src/lxc/Makefile.am @@ -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 index 000000000..547e6499c --- /dev/null +++ b/src/lxc/lxc-config.in @@ -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 index 621c9374b..000000000 --- a/src/lxc/lxc_version.c +++ /dev/null @@ -1,30 +0,0 @@ -/* - * lxc: linux Container library - * - * (C) Copyright IBM Corp. 2007, 2008 - * - * Authors: - * Daniel Lezcano - * - * 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 -#include - -int main(int argc, char *argv[]) -{ - printf("Version: %s\n", lxc_version()); - return 0; -}