Skip to content

Commit

Permalink
moved to libev + systemd and cleaned up build and install
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Aug 11, 2021
1 parent f232cbd commit ce597ae
Show file tree
Hide file tree
Showing 16 changed files with 134 additions and 486 deletions.
4 changes: 3 additions & 1 deletion monitor/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,6 @@ Makefile.in
/Makefile
/src/Makefile
/src/tacc_stats
/src/.deps
/src/.deps

*tar.gz
62 changes: 39 additions & 23 deletions monitor/configure.ac
Original file line number Diff line number Diff line change
@@ -1,8 +1,30 @@
AC_INIT([tacc_stats], [2.3.4], [[email protected]])
AC_INIT([tacc_stats], [2.3.5], [[email protected]])
AM_INIT_AUTOMAKE([-Wall -Werror -Wno-portability])
AC_PROG_CC
AM_PROG_CC_C_O

AC_ARG_ENABLE([rabbitmq],
[ --enable-rabbitmq Build the rabbitmq version (default is true)],
[case "${enableval}" in
yes) AC_SEARCH_LIBS([amqp_new_connection], [rabbitmq], [have_rabbitmq=yes],
[AC_MSG_ERROR([Unable to find librabbitmq.so!])])
if test "x${have_rabbitmq}" = xyes; then
AC_CHECK_HEADERS([amqp.h], [rabbitmq=true],
[AC_MSG_ERROR([Unable to find amqp.h!])])
fi
;;
no) rabbitmq=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-rabbitmq]) ;;
esac],
[AC_SEARCH_LIBS([amqp_new_connection], [rabbitmq], [have_rabbitmq=yes],
[AC_MSG_ERROR([Unable to find librabbitmq.so!])])
if test "x${have_rabbitmq}" = xyes; then
AC_CHECK_HEADERS([amqp.h], [rabbitmq=true],
[AC_MSG_ERROR([Unable to find amqp.h!])])
fi
])
AM_CONDITIONAL([RABBITMQ], [test x$rabbitmq = xtrue])

AC_ARG_ENABLE([hardware],
[ --enable-hardware Enable processor hardware counter support (default is true)],
[case "${enableval}" in
Expand All @@ -14,7 +36,7 @@ esac],
AM_CONDITIONAL([HARDWARE], [test x$hardware = xtrue])

AC_ARG_ENABLE([infiniband],
[ --enable-infiniband Enable Infiniband support (must be set to true or false)],
[ --enable-infiniband Enable Infiniband support (default is true)],
[case "${enableval}" in
yes) AC_SEARCH_LIBS([mad_rpc_open_port], [ibmad], [have_ib=yes],
[AC_MSG_ERROR([Unable to find libibmad.so!])])
Expand Down Expand Up @@ -106,30 +128,24 @@ esac],
[debug=false])
AM_CONDITIONAL([DEBUG], [test x$debug = xtrue])

AC_ARG_ENABLE([rabbitmq],
[ --enable-rabbitmq Build the rabbitmq/daemon version (default is false)],
[case "${enableval}" in
yes) rabbitmq=true
AC_SEARCH_LIBS([amqp_new_connection], [rabbitmq], [have_rabbitmq=yes], [have_rabbitmq=no])
if test "x${have_rabbitmq}" = xno; then
AC_MSG_ERROR([Unable to find rabbitmq library on this system. Stopping...])
fi
if test "x${have_rabbitmq}" = xyes; then
AC_CHECK_HEADERS([amqp.h], [], [have_rabbitmq=no])
fi
if test "x${have_rabbitmq}" = xno; then
AC_MSG_ERROR([Unable to find rabbitmq headers on this system. Stopping...])
fi
;;
no) rabbitmq=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-rabbitmq]) ;;
esac],
[rabbitmq=false])
AM_CONDITIONAL([RABBITMQ], [test x$rabbitmq = xtrue])

AC_SEARCH_LIBS([ev_run], [ev], [libev=yes], [AC_MSG_ERROR([Failed to find lib libev.so])])
AC_CHECK_HEADERS([ev.h], [ev=true], [AC_MSG_ERROR([Failed to find header ev.h])])

PKG_PROG_PKG_CONFIG
AC_ARG_WITH([systemduserunitdir],
[AS_HELP_STRING([--with-systemduserunitdir=DIR], [Directory for systemd user service files])],,
[with_systemduserunitdir=auto])
AS_IF([test "x$with_systemduserunitdir" = "xyes" -o "x$with_systemduserunitdir" = "xauto"], [
def_systemduserunitdir=$($PKG_CONFIG --variable=systemduserunitdir systemd)
AS_IF([test "x$def_systemduserunitdir" = "x"],
[AS_IF([test "x$with_systemduserunitdir" = "xyes"],
[AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])])
with_systemduserunitdir=no],
[with_systemduserunitdir="$def_systemduserunitdir"])])
AS_IF([test "x$with_systemduserunitdir" != "xno"],
[AC_SUBST([systemduserunitdir], [$with_systemduserunitdir])])
AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$with_systemduserunitdir" != "xno"])

AC_CONFIG_FILES([Makefile src/Makefile])
AC_OUTPUT

19 changes: 0 additions & 19 deletions monitor/make-rpm.ls4

This file was deleted.

31 changes: 10 additions & 21 deletions monitor/src/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
ACLOCAL_AMFLAGS = -I m4

AM_DISTCHECK_CONFIGURE_FLAGS = \
--with-systemduserunitdir=$$dc_install_base/$(systemduserunitdir)

if HAVE_SYSTEMD
systemduserunit_DATA = \
taccstats.service \
taccstats.conf
endif

bin_PROGRAMS = tacc_statsd

STATS_DIR_PATH = /var/log/tacc_stats
Expand Down Expand Up @@ -162,24 +171,4 @@ stats.o: stats.x
stats.x: Makefile
echo '$(patsubst %.c, X(%),$(sort $(TYPES)))' > $@

if RABBITMQ
initddir = $(sysconfdir)/rc.d/init.d
initd_SCRIPTS = taccstats
sysconf_DATA = tacc_stats.conf
sysconf_DATA += taccstats.service
BUILT_SOURCES += taccstats
nodist_tacc_statsd_SOURCES += \
taccstats
CLEANFILES += $(initd_SCRIPTS) $(sysconfdir_DATA)

do_subst = sed -e 's,@STATS_LOCK_PATH@,$(STATS_LOCK_PATH),g' \
-e 's,@SYSCONFDIR@,$(sysconfdir),g' \
-e 's,@PREFIX@,$(bindir),g'
taccstats: taccstats.in Makefile
$(do_subst) < taccstats.in > taccstats
chmod +x taccstats
else
bin_SCRIPTS = archive
endif

EXTRA_DIST = taccstats.in tacc_stats.conf archive taccstats.service
EXTRA_DIST = taccstats.conf taccstats.service
Empty file removed monitor/src/__init__.py
Empty file.
42 changes: 0 additions & 42 deletions monitor/src/archive

This file was deleted.

41 changes: 0 additions & 41 deletions monitor/src/archive.sh.in

This file was deleted.

73 changes: 0 additions & 73 deletions monitor/src/listend.in

This file was deleted.

Loading

0 comments on commit ce597ae

Please sign in to comment.