summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Safranek <jsafrane@redhat.com>2009-03-13 15:16:20 +0100
committerJan Safranek <jsafrane@redhat.com>2009-03-26 09:36:41 +0100
commit07ff50e0856fecd937fb6a5ce87871f19f20f004 (patch)
treed35b0a391af1bc48d0b9ec7e9cd7f138a2126f58
parentb64a3c84e46550df4455ef4e46ec5d3b36486d65 (diff)
downloadlibcg-07ff50e0856fecd937fb6a5ce87871f19f20f004.tar.gz
libcg-07ff50e0856fecd937fb6a5ce87871f19f20f004.tar.xz
libcg-07ff50e0856fecd937fb6a5ce87871f19f20f004.zip
Add automake makefiles
Add automake makefiles and prepare everything to run, but don't actually run the automake - it would generate lot of noise, where my manual changes would get lots. Signed-off-by: Jan Safranek <jsafrane@redhat.com>
-rw-r--r--Makefile.am4
-rw-r--r--configure.in31
-rw-r--r--dist/Makefile.am1
-rw-r--r--doc/Makefile.am2
-rw-r--r--doc/man/Makefile.am5
-rw-r--r--include/Makefile.am2
-rw-r--r--samples/Makefile.am1
-rw-r--r--scripts/Makefile.am1
-rw-r--r--src/Makefile.am11
-rw-r--r--src/daemon/Makefile.am6
-rw-r--r--src/pam/Makefile.am6
-rw-r--r--src/tools/Makefile.am11
-rw-r--r--tests/Makefile.am15
13 files changed, 90 insertions, 6 deletions
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..ca8cd17
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,4 @@
+AUTOMAKE_OPTIONS = foreign
+SUBDIRS = dist doc include samples scripts src tests
+
+EXTRA_DIST = README_daemon libcgroup.doxyfile
diff --git a/configure.in b/configure.in
index d9ae295..19d6254 100644
--- a/configure.in
+++ b/configure.in
@@ -13,9 +13,17 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
AC_PREREQ(2.61)
+
+# In following section update all occurences of version, including soname
AC_INIT([control groups library and utilities], 0.34,
[http://sourceforge.net/tracker/?group_id=218421&atid=1043649])
-AC_CONFIG_SRCDIR([wrapper.c])
+AM_INIT_AUTOMAKE(libcgroup, 0.34)
+# set library version (X:Y:Z gets transfromed to libcgroup.so.X.Y.Z,
+# soname is libcgroup.so.X
+AC_SUBST(LIBRARY_VERSION, 1:0:34)
+
+
+AC_CONFIG_SRCDIR([src])
AC_CONFIG_HEADER([config.h])
# Process command line options
@@ -34,10 +42,10 @@ if test "$YACC" != byacc; then
YACC="$SHELL $missing_dir/missing byacc"
AC_SUBST(YACC, "byacc")
fi
-AC_PROG_LEX
+AM_PROG_LEX
+AC_PROG_LIBTOOL
# Checks for libraries.
-# FIXME: Replace `main' with a function in `-lcgroup':
AC_CHECK_LIB([cgroup], [cgroup_create_cgroup])
# Checks for header files.
@@ -61,8 +69,19 @@ AC_FUNC_REALLOC
AC_FUNC_STAT
AC_CHECK_FUNCS([getmntent hasmntopt memset mkdir rmdir strdup])
-AC_CONFIG_FILES([Makefile])
-AC_CONFIG_FILES([libcgroup.spec:libcgroup.spec.in])
-AC_CONFIG_FILES([mktarball:mktarball.in])
+AC_CONFIG_FILES([Makefile
+ tests/Makefile
+ src/Makefile
+ src/daemon/Makefile
+ src/tools/Makefile
+ src/pam/Makefile
+ scripts/Makefile
+ samples/Makefile
+ include/Makefile
+ doc/Makefile
+ doc/man/Makefile
+ dist/Makefile])
+AC_CONFIG_FILES([dist/libcgroup.spec:dist/libcgroup.spec.in])
CFLAGS="$CFLAGS -Wall"
AC_OUTPUT
+
diff --git a/dist/Makefile.am b/dist/Makefile.am
new file mode 100644
index 0000000..346b8b8
--- /dev/null
+++ b/dist/Makefile.am
@@ -0,0 +1 @@
+EXTRA_DIST = libcgroup.spec
diff --git a/doc/Makefile.am b/doc/Makefile.am
new file mode 100644
index 0000000..5822dc1
--- /dev/null
+++ b/doc/Makefile.am
@@ -0,0 +1,2 @@
+SUBDIRS = man
+
diff --git a/doc/man/Makefile.am b/doc/man/Makefile.am
new file mode 100644
index 0000000..ef27069
--- /dev/null
+++ b/doc/man/Makefile.am
@@ -0,0 +1,5 @@
+man_MANS = cgclassify.1 cgconfig.conf.5 cgconfigparser.8 cgexec.1 cgred.conf.5 \
+ cgrules.conf.5 cgrulesengd.8
+
+EXTRA_DIST = $(man_MANS)
+
diff --git a/include/Makefile.am b/include/Makefile.am
new file mode 100644
index 0000000..2733f09
--- /dev/null
+++ b/include/Makefile.am
@@ -0,0 +1,2 @@
+include_HEADERS = libcgroup.h
+
diff --git a/samples/Makefile.am b/samples/Makefile.am
new file mode 100644
index 0000000..347dd60
--- /dev/null
+++ b/samples/Makefile.am
@@ -0,0 +1 @@
+EXTRA_DIST = cgconfig.conf cgred.conf cgrules.conf
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
new file mode 100644
index 0000000..b5270fb
--- /dev/null
+++ b/scripts/Makefile.am
@@ -0,0 +1 @@
+EXTRA_DIST = init.d/cgconfig init.d/cgred
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644
index 0000000..c30393a
--- /dev/null
+++ b/src/Makefile.am
@@ -0,0 +1,11 @@
+SUBDIRS = . daemon pam tools
+
+# generate parse.h from parse.y
+AM_YFLAGS = -d
+
+INCLUDES = -I$(top_srcdir)/include
+lib_LTLIBRARIES = libcgroup.la
+libcgroup_la_SOURCES = parse.y lex.l api.c config.c libcgroup-internal.h libcgroup.map wrapper.c
+libcgroup_la_LIBADD = -lpthread
+libcgroup_la_LDFLAGS = -Wl,--version-script,libcgroup.map -version-number $(LIBRARY_VERSION)
+
diff --git a/src/daemon/Makefile.am b/src/daemon/Makefile.am
new file mode 100644
index 0000000..17d31d9
--- /dev/null
+++ b/src/daemon/Makefile.am
@@ -0,0 +1,6 @@
+INCLUDES = -I $(top_srcdir)/include
+sbin_PROGRAMS = cgrulesengd
+
+cgrulesengd_SOURCES = cgrulesengd.c cgrulesengd.h
+cgrulesengd_LDADD = $(top_srcdir)/src/.libs/libcgroup.la
+cgrulesengd_LDFLAGS = -L$(top_srcdir)/src/.libs
diff --git a/src/pam/Makefile.am b/src/pam/Makefile.am
new file mode 100644
index 0000000..1a1e782
--- /dev/null
+++ b/src/pam/Makefile.am
@@ -0,0 +1,6 @@
+INCLUDES = -I $(top_srcdir)/include
+lib_LTLIBRARIES = pam_cgroup.la
+
+pam_cgroup_la_SOURCES = pam_cgroup.c
+pam_cgroup_la_LDFLAGS = -module
+pam_cgroup_la_LIBADD = $(top_srcdir)/src/.libs/libcgroup.la -lpam
diff --git a/src/tools/Makefile.am b/src/tools/Makefile.am
new file mode 100644
index 0000000..b237744
--- /dev/null
+++ b/src/tools/Makefile.am
@@ -0,0 +1,11 @@
+INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/include
+LDADD = $(top_srcdir)/src/.libs/libcgroup.la
+
+bin_PROGRAMS = cgexec cgclassify cgconfigparser
+
+cgexec_SOURCES = cgexec.c tools-common.c tools-common.h
+
+cgclassify_SOURCES = cgclassify.c tools-common.c tools-common.h
+
+cgconfigparser_SOURCES = cgconfig.c
+
diff --git a/tests/Makefile.am b/tests/Makefile.am
new file mode 100644
index 0000000..3927621
--- /dev/null
+++ b/tests/Makefile.am
@@ -0,0 +1,15 @@
+INCLUDES = -I$(top_srcdir)/include
+LDADD = $(top_srcdir)/src/.libs/libcgroup.la
+
+# compile the tests, but do not install them
+noinst_PROGRAMS = libcgrouptest01 libcg_ba setuid pathtest walk_test
+
+libcgrouptest01_SOURCES=libcgrouptest01.c test_functions.c libcgrouptest.h
+libcg_ba_SOURCES=libcg_ba.cpp
+setuid_SOURCES=setuid.c
+pathtest_SOURCES=pathtest.c
+walk_test_SOURCES=walk_test.c
+
+EXTRA_DIST = pathtest.sh runlibcgrouptest.sh
+
+TESTS = runlibcgrouptest.sh