Author: mturk
Date: Tue Oct 25 06:51:03 2011
New Revision: 1188536
URL: http://svn.apache.org/viewvc?rev=1188536&view=rev
Log:
Add initial stub for Linux Containers
Added:
commons/sandbox/runtime/trunk/src/main/native/include/acr/lxc.h (with
props)
commons/sandbox/runtime/trunk/src/main/native/modules/lxc/
commons/sandbox/runtime/trunk/src/main/native/modules/lxc/api.c (with
props)
commons/sandbox/runtime/trunk/src/main/native/modules/lxc/init.c (with
props)
Modified:
commons/sandbox/runtime/trunk/src/main/native/Makefile.unx.in
commons/sandbox/runtime/trunk/src/main/native/configure
Modified: commons/sandbox/runtime/trunk/src/main/native/Makefile.unx.in
URL:
http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/Makefile.unx.in?rev=1188536&r1=1188535&r2=1188536&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/Makefile.unx.in (original)
+++ commons/sandbox/runtime/trunk/src/main/native/Makefile.unx.in Tue Oct 25
06:51:03 2011
@@ -169,10 +169,15 @@ SSLSOURCES=\
$(TOPDIR)/modules/openssl/stapling.c \
$(TOPDIR)/modules/openssl/util.c
+LXCSOURCES=\
+ $(TOPDIR)/modules/lxc/api.c \
+ $(TOPDIR)/modules/lxc/init.c
+
CXXSOURCES=
SHROBJECTS=$(LIBSOURCES:.c=.$(SLO)) $(CXXSOURCES:.cc=.$(SLO))
$(ASMSOURCES:.S=.$(SLO))
SSLOBJECTS=$(SSLSOURCES:.c=.$(SLO))
+LXCOBJECTS=$(LXCSOURCES:.c=.$(SLO))
all: prepare @sharedlib@ @modules@
Modified: commons/sandbox/runtime/trunk/src/main/native/configure
URL:
http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/configure?rev=1188536&r1=1188535&r2=1188536&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/configure (original)
+++ commons/sandbox/runtime/trunk/src/main/native/configure Tue Oct 25 06:51:03
2011
@@ -117,8 +117,10 @@ has_shared=yes
has_shared_version=no
has_zlib_asm=yes
has_openssl=no
+has_lxc=no
has_libaio_static=yes
has_libcgroup_static=yes
+has_lxc_static=yes
has_openssl_static=yes
has_openssl_runtime=no
openssl_home="$OPENSSL_HOME"
@@ -312,6 +314,10 @@ Optional packages:
--with-openssl=DIR Path to the OpenSSL toolkit install location.
If not specified default compiler include and
library paths will be used.
+ --enable-lxc Enable compilation of Linux LXC module
+ [disabled]
+ --enable-lxc-static Link to the LXC library at compile time.
+ [enabled]
EOH
exit 1
;;
@@ -1225,6 +1231,8 @@ fi
have_libaio_static=0
have_libcgroup_static=0
+have_lxc=0
+have_lxc_static=0
if [ ".$host" = ".linux" ]; then
have_libaio=`have_include libaio`
if [ ".$have_libaio" = .1 ]; then
@@ -1240,6 +1248,22 @@ if [ ".$host" = ".linux" ]; then
test ".$have_libcgroup_static" = .1 && varadds ldflags -lcgroup
fi
fi
+ if [ ".$has_lxc" = .yes ]; then
+ have_lxc=`have_include lxc/lxc`
+ if [ ".$have_lxc" = .0 ]; then
+ echo "[ERROR] Cannot find lxc/lxc.h"
+ exit 22
+ fi
+ if [ ".$has_lxc_static" = .yes ]; then
+ have_lxc_static=`have_library lxc`
+ if [ ".$have_liblxc_static" = .0 ]; then
+ echo "[ERROR] Cannot find lxc library"
+ exit 22
+ fi
+ varadds -llxc
+ fi
+ varadds modules '??(LXCOBJECTS)'
+ fi
else
have_libaio=0
have_libcgroup=0
@@ -1494,6 +1518,8 @@ extern "C" {
#define HAVE_LIBCGROUP_STATIC $have_libcgroup_static
#define HAVE_OPENSSL $have_openssl
#define HAVE_OPENSSL_STATIC $have_openssl_static
+#define HAVE_LXC $have_lxc
+#define HAVE_LXC_STATIC $have_lxc_static
#define HAVE_FIPS $have_fips
#define HAVE_OCSP $have_ocsp
#define HAVE_KSTAT $have_kstat
Added: commons/sandbox/runtime/trunk/src/main/native/include/acr/lxc.h
URL:
http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/acr/lxc.h?rev=1188536&view=auto
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/include/acr/lxc.h (added)
+++ commons/sandbox/runtime/trunk/src/main/native/include/acr/lxc.h Tue Oct 25
06:51:03 2011
@@ -0,0 +1,31 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _ACR_LXC_H_
+#define _ACR_LXC_H_
+
+#include "acr/stdtypes.h"
+#include "acr/callback.h"
+#include "acr/descriptor.h"
+#include "acr/time.h"
+
+#if HAVE_LXC
+#include <lxc/lxc.h>
+#include <lxc/conf.h>
+
+
+#endif
+#endif /* _ACR_LCX_H_ */
Propchange: commons/sandbox/runtime/trunk/src/main/native/include/acr/lxc.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/sandbox/runtime/trunk/src/main/native/modules/lxc/api.c
URL:
http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/modules/lxc/api.c?rev=1188536&view=auto
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/modules/lxc/api.c (added)
+++ commons/sandbox/runtime/trunk/src/main/native/modules/lxc/api.c Tue Oct 25
06:51:03 2011
@@ -0,0 +1,27 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "acr/clazz.h"
+#include "acr/error.h"
+#include "acr/misc.h"
+#include "acr/dso.h"
+#include "acr/string.h"
+#include "acr/port.h"
+#include "arch_sync.h"
+
+#if !HAVE_LXC
+#error "Cannot compile this file without HAVE_LXC defined"
+#endif
Propchange: commons/sandbox/runtime/trunk/src/main/native/modules/lxc/api.c
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/sandbox/runtime/trunk/src/main/native/modules/lxc/init.c
URL:
http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/modules/lxc/init.c?rev=1188536&view=auto
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/modules/lxc/init.c (added)
+++ commons/sandbox/runtime/trunk/src/main/native/modules/lxc/init.c Tue Oct 25
06:51:03 2011
@@ -0,0 +1,27 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "acr/clazz.h"
+#include "acr/error.h"
+#include "acr/misc.h"
+#include "acr/dso.h"
+#include "acr/string.h"
+#include "acr/port.h"
+#include "arch_sync.h"
+
+#if !HAVE_LXC
+#error "Cannot compile this file without HAVE_LXC defined"
+#endif
Propchange: commons/sandbox/runtime/trunk/src/main/native/modules/lxc/init.c
------------------------------------------------------------------------------
svn:eol-style = native