Commit 6f8ce609 authored by Charlie Jacobsen's avatar Charlie Jacobsen

Adds contributors file, updates install notes, tweaks kernel install.

Adds KERNEL_HEADERS_INSTALL param so you can install the headers
in a place of your choosing. (Otherwise, they're strewn across the
source and build dirs - nice to coalesce into one spot.)
parent 0b77dce0
Pipeline #409 passed with stage
In alphabetical order, with email:
Anton Burtsev aburtsev@flux.utah.edu
Charles Jacobsen charlesj@cs.utah.edu
David M. Johnson johnsond@flux.utah.edu
Pankaj Kumar pankajk@cs.utah.edu
Muktesh Khole mukteshkhole86@gmail.com
\ No newline at end of file
......@@ -41,28 +41,80 @@ lint in your source tree.
$ mkdir libcap.obj
$ cd libcap.obj
Third, configure the build. You can run `../libcap/configure --help` to
see a list of configure options. --prefix is the installation prefix;
you may want to set it to something out-of-the-way like /opt/libcap, or
you might not. You can skip the kernel module build by supplying
--disable-kernel . If your glib is installed in a non-standard place,
you can tell configure by passing the appropriate directory to the
--with-glib option.
Third, configure the build. Important options:
$ ../libcap/configure --prefix=/opt/libcap
PLATFORM={kernel|user} -- platform to build for
Fourth, make and make install!
CSPACE_DEPTH_BITS -- number between 0 and 8. Controls the
depth of the CSpace radix tree. (The
depth will be 2^CSPACE_DEPTH_BITS.)
$ make && make install
CSPACE_CNODE_TABLE_BITS -- number between 0 and 9. Controls the size
of the nodes (number of slots) in the
CSpace radix tree. (The total slots per
cnode table/node will be
2^CSPACE_CNODE_TABLE_BITS.)
This will build the libcap library, kernel module, and test programs;
and install the libcap headers and library. If you want to run the test
programs, you'd do something like
--with-kernel-headers -- if you selected PLATFORM=kernel, you can
set the directory that contains the kernel
headers to use for the build; the default
is lib/modules/`uname -r`/build.
$ test/user/multi_thrd_cap
--enable-test-build -- build all of the tests for the platform;
default is no (does not build tests)
and watch the fun.
--enable-kernel-module -- if you selected PLATFORM=kernel, you can
build libcap as a kernel module (default no).
You will be able to install libcap.ko and
use it with other kernel modules (rather than
statically linking libcap.a into those
modules at compile time)
KERNEL_HEADERS_INSTALL=dir -- if you selected PLATFORM=kernel, this is
where the libcap headers will be installed;
the default is (libcap build dir)/include.
If the directory does not exist, it will be
created. Note that the uninstall will not
remove the directory, just the headers.
--prefix -- the installation prefix; you may want to set
it to something out-of-the-way like
/opt/libcap, or you might not. E.g.,
$ ../libcap/configure --prefix=/opt/libcap
--with-glib -- if you selected PLATFORM=user, you can
set the root of your glib 2.0 install if
it is installed in a non-standard place; the
default is /usr
You can run `../libcap/configure --help` to see a list of all configure
options.
Fourth, make!
$ make
Finally, if you want to install the kernel module, do that like this:
Depending on your settings, this will build libcap as a library for
user or kernel land, the libcap kernel module, and test programs.
$ make -C src/kernel modules_install
Fifth, make install!
$ make install
For user-level, this will install libcap and its headers into the prefix
you specified. For kernel-level, this will do nothing (you probably don't
want kernel headers getting mixed up in your user stuff). If you want to
install libcap.ko, the kernel module, do:
$ make modules_install
Note: You probably won't be able to link a user-level build of libcap with a
kernel module, or the kernel-level build of libcap with a user app; the
compilation and linking process differs too much.
If you want to run the test programs, you'd do something like
$ src/platform/user/test/multi_thrd_cap
and watch the fun.
......@@ -116,6 +116,23 @@ AS_IF([test "x$PLATFORM" = "xkernel"],
])
# libcap headers install for kernel land (user probably doesn't want
# them going in the user-level include dirs)
AS_IF([test "x$PLATFORM" = "xkernel"],
[
AC_ARG_VAR([KERNEL_HEADERS_INSTALL],
[Where to install the libcap headers for kernel builds (default is (libcap build dir)/include)])
AS_IF([test "x$KERNEL_HEADERS_INSTALL" = "x"],
[KERNEL_HEADERS_INSTALL=../../../include]) # default
AS_IF([test -e $KERNEL_HEADERS_INSTALL && test ! -d $KERNEL_HEADERS_INSTALL],
[AC_MSG_ERROR([libcap kernel headers install location ($KERNEL_HEADERS_INSTALL) exists and is not a directory. Please choose a different location.])])
AC_SUBST(KERNEL_HEADERS_INSTALL)
AC_MSG_NOTICE([libcap kernel headers install dir = $KERNEL_HEADERS_INSTALL])
])
# Build tests?
AC_ARG_ENABLE([test_build],
[AS_HELP_STRING([--enable-test-build],
[Enable building test applications (default=no)])],
......
top_srcdir = @top_srcdir@
abs_top_srcdir = @abs_top_srcdir@
abs_top_builddir = @abs_top_builddir@
COMMON_SRCFILES = \
$(top_srcdir)/src/common/cap.c $(top_srcdir)/src/common/cptr_cache.c
SRCFILES = \
$(top_srcdir)cap_module.c
HFILES = \
$(top_srcdir)/include/libcap.h $(top_srcdir)/include/libcap_types.h $(top_srcdir)/include/libcap_kernel.h $(top_srcdir)/include/libcap_internal.h $(top_srcdir)/include/libcap_internal_kernel.h
libcap_la_SOURCES = \
obj-m += cap_module.o
cap_module-objs := cap.o cptr_cache.o
KDIR ?= /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
ccflags-y = -DMODULE -D__KERNEL__ -I$(abs_top_srcdir)/include \
-I$(abs_top_builddir)/include
$(CFILES:.c=.o): $(HFILES) Makefile
all:
$(MAKE) -C $(KDIR) M=$(PWD) modules
# $(MAKE) -C $(KDIR) M=$(top_srcdir)/src/kernel O=$(PWD) modules
modules_install:
$(MAKE) -C $(KDIR) M=$(PWD) modules_install
install:
clean:
$(MAKE) -C $(KDIR) M=$(PWD) clean
......@@ -51,20 +51,43 @@ all-lib-cp: all-lib
all-lib:
$(MAKE) -C $(KDIR) M=$(LIBCAP_KBUILD)
install-headers:
@echo "Installing libcap kernel headers to $(KERNEL_HEADERS_INSTALL)..."
mkdir -p $(KERNEL_HEADERS_INSTALL)
cp $(top_srcdir)/src/platform/kernel/include/libcap_platform.h $(KERNEL_HEADERS_INSTALL)
cp $(top_srcdir)/src/platform/kernel/include/libcap_platform_types.h $(KERNEL_HEADERS_INSTALL)
cp $(top_srcdir)/src/include/libcap.h $(KERNEL_HEADERS_INSTALL)
cp $(top_builddir)/src/include/libcap_config.h $(KERNEL_HEADERS_INSTALL)
cp $(top_srcdir)/src/include/libcap_types.h $(KERNEL_HEADERS_INSTALL)
cp $(top_srcdir)/src/include/libcap_list.h $(KERNEL_HEADERS_INSTALL)
uninstall-headers:
@echo "Uninstalling libcap kernel headers from $(KERNEL_HEADERS_INSTALL)..."
rm -f $(KERNEL_HEADERS_INSTALL)/libcap_platform.h
rm -f $(KERNEL_HEADERS_INSTALL)/libcap_platform_types.h
rm -f $(KERNEL_HEADERS_INSTALL)/libcap.h
rm -f $(KERNEL_HEADERS_INSTALL)/libcap_config.h
rm -f $(KERNEL_HEADERS_INSTALL)/libcap_types.h
rm -f $(KERNEL_HEADERS_INSTALL)/libcap_list.h
# Don't do regular install; user probably doesn't want kernel stuff in
# user-level directories.
install-exec-hook:
@echo "----------------------------------------"; \
install: install-headers
@echo ""; \
echo "----------------------------------------"; \
echo " NOTE"; \
echo ""; \
echo "Skipping copy of libcap.a and libcap.ko."; \
echo "You can find them in (libcap build dir)/src/platform/kernel."; \
echo "We only install the kernel headers (according to the"; \
echo "KERNEL_HEADERS_INSTALL variable). You probably don't want"; \
echo "e.g. kernel headers mixed up in your user include directories"; \
echo "and stuff. You can find libcap.a and libcap.ko in"; \
echo "(libcap build dir)/src/platform/kernel."; \
echo "To install the kernel module, do 'make modules_install'"; \
echo "in the root of the libcap build tree."; \
echo ""; \
echo "----------------------------------------"
uninstall-hook:
uninstall: uninstall-headers
@echo "----------------------------------------"; \
echo " NOTE"; \
echo ""; \
......@@ -96,4 +119,4 @@ clean-lib:
rm -f libcap.a
.PHONY: all-module all-lib all-lib-cp do-modules-install modules_install \
clean-module clean-lib
clean-module clean-lib install-headers uninstall-headers
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment