Skip to content

Commit 08ed781

Browse files
committed
start an autotools based build
1 parent ef907e9 commit 08ed781

File tree

11 files changed

+206
-0
lines changed

11 files changed

+206
-0
lines changed

autoclean.sh

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/bin/sh
2+
3+
set -x
4+
5+
rm -f INSTALL NEWS AUTHORS \
6+
&& rm -f aclocal.m4 \
7+
&& rm -f -r autom4te.cache \
8+
&& rm -f compile \
9+
&& rm -f config.guess \
10+
&& rm -f config.log \
11+
&& rm -f config.status \
12+
&& rm -f config.sub \
13+
&& rm -f configure \
14+
&& rm -f depcomp \
15+
&& rm -f src/config.h \
16+
&& rm -f src/config.h.in \
17+
&& rm -f install-sh \
18+
&& rm -f -r libltdl \
19+
&& rm -f libtool \
20+
&& rm -f ltmain.sh \
21+
&& rm -f Makefile \
22+
&& rm -f Makefile.in \
23+
&& rm -f missing \
24+
&& rm -f src/*.la \
25+
&& rm -f src/*.lo \
26+
&& rm -f src/*.o \
27+
&& rm -f -r src/.libs \
28+
&& rm -f -r src/.deps \
29+
&& rm -f src/os/Makefile \
30+
&& rm -f src/os/Makefile.in \
31+
&& rm -f src/os/*/Makefile \
32+
&& rm -f src/os/*/Makefile.in \
33+
&& rm -f src/os/*/*.la \
34+
&& rm -f src/os/*/*.lo \
35+
&& rm -f src/os/*/*.o \
36+
&& rm -f -r src/os/*/.libs \
37+
&& rm -f -r src/os/*/.deps \
38+
&& rm -f src/Makefile \
39+
&& rm -f src/Makefile.in \
40+
&& rm -f src/stamp-h1 \
41+
&& rm -f src/stamp-h1.in \
42+
&& rm -f examples/Makefile \
43+
&& rm -f examples/Makefile.in \
44+
&& rm -f examples/*.o \
45+
&& rm -f -r examples/.libs \
46+
&& rm -f -r examples/.deps \
47+
&& perl -le 's/\.c$// && unlink && print "rm $_" for <examples/*.c>'
48+
49+

autogen.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/sh
2+
set -x
3+
4+
touch INSTALL NEWS AUTHORS
5+
6+
autoheader \
7+
&& aclocal \
8+
&& libtoolize --ltdl --copy --force \
9+
&& automake --add-missing --copy \
10+
&& autoconf

configure.ac

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
AC_INIT(libsigar, 1.6.2)
2+
AC_CONFIG_SRCDIR(src/sigar.c)
3+
AC_CONFIG_HEADERS(src/config.h)
4+
AM_INIT_AUTOMAKE
5+
AC_CANONICAL_HOST
6+
7+
AC_PROG_CC
8+
AC_PROG_LN_S
9+
AC_PROG_INSTALL
10+
AC_PROG_MAKE_SET
11+
AC_PROG_LIBTOOL
12+
13+
AC_MSG_CHECKING([for os type ($host_os)])
14+
case $host_os in
15+
*aix*)
16+
SRC_OS="aix"
17+
;;
18+
*darwin*)
19+
SRC_OS="darwin"
20+
;;
21+
*freebsd*)
22+
SRC_OS="darwin"
23+
LIBS="-lkvm"
24+
;;
25+
*hpux*)
26+
SRC_OS="hpux"
27+
;;
28+
*linux*)
29+
SRC_OS="linux"
30+
;;
31+
*openbsd*)
32+
SRC_OS="darwin"
33+
LIBS="-lkvm"
34+
;;
35+
*netbsd*)
36+
SRC_OS="darwin"
37+
LIBS="-lkvm"
38+
;;
39+
*solaris*)
40+
SRC_OS="solaris"
41+
LIBS="-lkstat -lsocket"
42+
;;
43+
*)
44+
ac_system="unknown"
45+
esac
46+
AC_MSG_RESULT([$ac_system])
47+
AC_MSG_RESULT([$SRC_OS])
48+
49+
INCLUDES="-I\$(top_builddir)/include -I\$(srcdir)/os/$SRC_OS"
50+
51+
AC_SUBST(SRC_OS)
52+
AC_SUBST(INCLUDES)
53+
AC_SUBST(LIBS)
54+
55+
AC_CONFIG_FILES([
56+
Makefile
57+
src/Makefile
58+
src/os/Makefile
59+
src/os/aix/Makefile
60+
src/os/darwin/Makefile
61+
src/os/linux/Makefile
62+
src/os/hpux/Makefile
63+
src/os/solaris/Makefile
64+
examples/Makefile
65+
])
66+
67+
AC_OUTPUT

examples/Makefile.am

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@
2+
3+
INCLUDES = @INCLUDES@
4+
5+
noinst_PROGRAMS = cpuinfo sigar_ps
6+
7+
cpuinfo_SOURCES = cpuinfo.c
8+
cpuinfo_LDADD = $(top_builddir)/src/libsigar.la
9+
10+
sigar_ps_SOURCES = sigar_ps.c
11+
sigar_ps_LDADD = $(top_builddir)/src/libsigar.la

src/Makefile.am

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
SUBDIRS = os
2+
3+
INCLUDES = @INCLUDES@
4+
5+
include_HEADERS = \
6+
$(top_builddir)/include/sigar.h \
7+
$(top_builddir)/include/sigar_log.h \
8+
$(top_builddir)/include/sigar_format.h \
9+
$(top_builddir)/include/sigar_fileinfo.h \
10+
$(top_builddir)/include/sigar_ptql.h
11+
12+
lib_LTLIBRARIES = libsigar.la
13+
14+
libsigar_la_LDFLAGS =
15+
16+
libsigar_la_LIBADD = $(top_builddir)/src/os/@SRC_OS@/libsigar_os.la
17+
18+
libsigar_la_CFLAGS =
19+
20+
libsigar_la_SOURCES = \
21+
$(include_HEADERS) \
22+
$(top_builddir)/include/sigar_private.h \
23+
$(top_builddir)/include/sigar_util.h \
24+
$(top_builddir)/include/sigar_getline.h \
25+
sigar.c \
26+
sigar_cache.c \
27+
sigar_fileinfo.c \
28+
sigar_format.c \
29+
sigar_getline.c \
30+
sigar_ptql.c \
31+
sigar_signal.c \
32+
sigar_util.c
33+

src/os/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SUBDIRS = @SRC_OS@

src/os/aix/Makefile.am

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
INCLUDES = @INCLUDES@
2+
3+
noinst_LTLIBRARIES = libsigar_os.la
4+
5+
libsigar_os_la_SOURCES = aix_sigar.c
6+
7+
noinst_HEADERS = sigar_os.h

src/os/darwin/Makefile.am

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
INCLUDES = @INCLUDES@
2+
3+
noinst_LTLIBRARIES = libsigar_os.la
4+
5+
libsigar_os_la_SOURCES = darwin_sigar.c
6+
7+
noinst_HEADERS = sigar_os.h

src/os/hpux/Makefile.am

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
INCLUDES = @INCLUDES@
2+
3+
noinst_LTLIBRARIES = libsigar_os.la
4+
5+
libsigar_os_la_SOURCES = hpux_sigar.c dlpi.c
6+
7+
noinst_HEADERS = sigar_os.h

src/os/linux/Makefile.am

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
INCLUDES = @INCLUDES@
2+
3+
noinst_LTLIBRARIES = libsigar_os.la
4+
5+
libsigar_os_la_SOURCES = linux_sigar.c
6+
7+
noinst_HEADERS = sigar_os.h

0 commit comments

Comments
 (0)