first try
This commit is contained in:
parent
d4f0db33b2
commit
05c199f20a
30
Makefile
30
Makefile
@ -1,30 +0,0 @@
|
||||
# Toplevel Makefile
|
||||
|
||||
SAMMLER_SRC := sammler.c config.c logging.c rrdtool.c plugins.c
|
||||
PLUGIN_SRC := $(wildcard p_*.c)
|
||||
CFLAGS := -O2 -Wall
|
||||
LDFLAGS := -ldl -lrrd -rdynamic
|
||||
|
||||
# ############################
|
||||
|
||||
all: sammler $(PLUGIN_SRC:%.c=%.so)
|
||||
|
||||
sammler: $(SAMMLER_SRC:%.c=%.o)
|
||||
$(CC) $(LDFLAGS) $^ -o $@
|
||||
|
||||
%.d: %.c
|
||||
$(CC) $(CFLAGS) -MM -c $< -o $@
|
||||
|
||||
%.o: %.c
|
||||
$(CC) $(CFLAGS) -o $@ -c $<
|
||||
|
||||
%_sh.o: %.c
|
||||
$(CC) $(CFLAGS) -fPIC -o $@ -c $<
|
||||
|
||||
%.so: %_sh.o
|
||||
$(LD) -shared -o $@ $<
|
||||
|
||||
clean:
|
||||
rm -rf *.d *.o *.so sammler
|
||||
|
||||
#-include $(SAMMLER_SRC:.c=.d) $(PLUGIN_SRC:.c=.d)
|
73
Makefile.am
Normal file
73
Makefile.am
Normal file
@ -0,0 +1,73 @@
|
||||
EXTRA_DIST = sammler.conf
|
||||
|
||||
AM_CFLAGS = -Wall -Werror
|
||||
|
||||
bin_PROGRAMMS = sammler
|
||||
|
||||
sammler_SOURCES = config.c config.h \
|
||||
list.h \
|
||||
logging.c logging.h \
|
||||
plugins.c plugins.h \
|
||||
rrdtool.c rrdtool.h \
|
||||
|
||||
sammler_LDFLAGS = -ldl -lrrd -rdynamic
|
||||
|
||||
pkglib_LTLIBRARIES += p_ctstat.la
|
||||
p_ctstat_la_SOURCES = p_ctstat.c
|
||||
p_ctstat_la_LDFLAGS = -module -avoid-version
|
||||
sammler_LDADD += "-dlopen" p_ctstat.la
|
||||
sammler_DEPENDENCIES += p_ctstat.la
|
||||
|
||||
pkglib_LTLIBRARIES += p_load.la
|
||||
p_load_la_SOURCES = p_load.c
|
||||
p_load_la_LDFLAGS = -module -avoid-version
|
||||
sammler_LDADD += "-dlopen" p_load.la
|
||||
sammler_DEPENDENCIES += p_load.la
|
||||
|
||||
pkglib_LTLIBRARIES += p_memory.la
|
||||
p_memory_la_SOURCES = p_memory.c
|
||||
p_memory_la_LDFLAGS = -module -avoid-version
|
||||
sammler_LDADD += "-dlopen" p_memory.la
|
||||
sammler_DEPENDENCIES += p_memory.la
|
||||
|
||||
pkglib_LTLIBRARIES += p_mount.la
|
||||
p_mount_la_SOURCES = p_mount.c
|
||||
p_mount_la_LDFLAGS = -module -avoid-version
|
||||
sammler_LDADD += "-dlopen" p_mount.la
|
||||
sammler_DEPENDENCIES += p_mount.la
|
||||
|
||||
pkglib_LTLIBRARIES += p_netdev.la
|
||||
p_netdev_la_SOURCES = p_netdev.c
|
||||
p_netdev_la_LDFLAGS = -module -avoid-version
|
||||
sammler_LDADD += "-dlopen" p_netdev.la
|
||||
sammler_DEPENDENCIES += p_netdev.la
|
||||
|
||||
pkglib_LTLIBRARIES += p_random.la
|
||||
p_random_la_SOURCES = p_random.c
|
||||
p_random_la_LDFLAGS = -module -avoid-version
|
||||
sammler_LDADD += "-dlopen" p_random.la
|
||||
sammler_DEPENDENCIES += p_random.la
|
||||
|
||||
pkglib_LTLIBRARIES += p_rtstat.la
|
||||
p_rtstat_la_SOURCES = p_rtstat.c
|
||||
p_rtstat_la_LDFLAGS = -module -avoid-version
|
||||
sammler_LDADD += "-dlopen" p_rtstat.la
|
||||
sammler_DEPENDENCIES += p_rtstat.la
|
||||
|
||||
pkglib_LTLIBRARIES += p_stat.la
|
||||
p_stat_la_SOURCES = p_stat.c
|
||||
p_stat_la_LDFLAGS = -module -avoid-version
|
||||
sammler_LDADD += "-dlopen" p_stat.la
|
||||
sammler_DEPENDENCIES += p_stat.la
|
||||
|
||||
pkglib_LTLIBRARIES += p_uptime.la
|
||||
p_uptime_la_SOURCES = p_uptime.c
|
||||
p_uptime_la_LDFLAGS = -module -avoid-version
|
||||
sammler_LDADD += "-dlopen" p_uptime.la
|
||||
sammler_DEPENDENCIES += p_uptime.la
|
||||
|
||||
pkglib_LTLIBRARIES += p_vmstat.la
|
||||
p_vmstat_la_SOURCES = p_vmstat.c
|
||||
p_vmstat_la_LDFLAGS = -module -avoid-version
|
||||
sammler_LDADD += "-dlopen" p_vmstat.la
|
||||
sammler_DEPENDENCIES += p_vmstat.la
|
7
autobuild.sh
Executable file
7
autobuild.sh
Executable file
@ -0,0 +1,7 @@
|
||||
#! /bin/sh
|
||||
|
||||
autoheader \
|
||||
&& aclocal \
|
||||
&& libtoolize --copy --force \
|
||||
&& automake --add-missing --copy \
|
||||
&& autoconf
|
21
configure.in
Normal file
21
configure.in
Normal file
@ -0,0 +1,21 @@
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
AC_INIT(sammler, 0.00)
|
||||
AC_CONFIG_SRCDIR(sammler.c)
|
||||
AC_CONFIG_HEADER(autoconfig.h)
|
||||
AM_INIT_AUTOMAKE(dist-bzip2)
|
||||
AC_LANG(C)
|
||||
|
||||
AC_PREFIX_DEFAULT("/usr/local")
|
||||
|
||||
AC_PROG_CC
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_LN_S
|
||||
AC_PROG_MAKE_SET
|
||||
AM_CONDITIONAL(COMPILER_IS_GCC, test "x$GCC" = "xyes")
|
||||
|
||||
dnl configure libtool
|
||||
AC_DISABLE_STATIC
|
||||
AC_LIBTOOL_DLOPEN
|
||||
AC_PROG_LIBTOOL
|
||||
|
||||
AC_OUTPUT(Makefile)
|
Loading…
Reference in New Issue
Block a user