From 31f70db16dcac31786140cd650f745903aa5eda1 Mon Sep 17 00:00:00 2001 From: "Andrew \"Bob\" Brockhurst" Date: Wed, 25 Mar 2015 22:11:14 +0000 Subject: [PATCH] Updated to use apxs or apxs2, copied from github.com/gnif/mod_rpaf --- Makefile | 17 +++++++++++++++-- apxs.sh | 13 +++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) create mode 100755 apxs.sh diff --git a/Makefile b/Makefile index b47034e..ff244c2 100755 --- a/Makefile +++ b/Makefile @@ -1,6 +1,19 @@ #!/usr/bin/make -f # -all: - apxs2 -a -c -Wl,-Wall -Wl,-lm -I. mod_statsd.c +APXS=./apxs.sh +mod_statsd: mod_statsd.so + @echo make done + @echo type \"make install\" to install mod_statsd + +mod_statsd.so: mod_statsd.c + @$(APXS) -c -n $@ mod_statsd.c + +mod_statsd.c: + +install: mod_statsd.so + @$(APXS) -i -S LIBEXECDIR=$(DESTDIR)$$($(APXS) -q LIBEXECDIR)/ -n mod_statsd.so mod_statsd.la + +clean: + @rm -rf *~ *.o *.so *.lo *.la *.slo *.loT .libs/ diff --git a/apxs.sh b/apxs.sh new file mode 100755 index 0000000..2e184b8 --- /dev/null +++ b/apxs.sh @@ -0,0 +1,13 @@ +#!/bin/sh +APXS=`which apxs2 2>/dev/null` +if [ -z "$APXS" ]; then + APXS=`which apxs 2>/dev/null` +fi +if [ -z "$APXS" ]; then + if [ -f /usr/sbin/apxs2 ]; then + APXS=/usr/sbin/apxs2 + elif [ -f /usr/sbin/apxs ]; then + APXS=/usr/sbin/apxs + fi +fi +$APXS $@