Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 71 lines (56 sloc) 1.406 kB
#!/bin/sh
ERROR="[ !! ]"
WARNING="[ ** ]"
OK="[ ok ]"
# Update $PATH so that we will also find the znc binary if we were compiled
# with ./configure --prefix=/some/path
prefix="@prefix@"
exec_prefix="@exec_prefix@"
bindir="@bindir@"
PATH="$bindir:$PATH"
# Check if we got everything we need
ZNC_CONFIG=znc-config
check_binary()
{
which $1 > /dev/null 2>&1
if test $? = 1 ; then
echo "${ERROR} Could not find $1. $2"
exit 1
fi
}
check_binary "${ZNC_CONFIG}" "Please (re)install ZNC."
if test "x$CXX" = "x" ; then
CXX=`${ZNC_CONFIG} --cxx`
fi
if test "x$CXX" = "x" ; then
CXX=g++
fi
check_binary ${CXX} "What happened to your compiler?"
if test -z "$1"; then
echo "${WARNING} USAGE: $0 <file.cpp> [file.cpp ... ]"
exit 1
fi
CXXFLAGS="`${ZNC_CONFIG} --cflags` $CXXFLAGS"
LIBS="`${ZNC_CONFIG} --libs` $LIBS"
LDFLAGS="`${ZNC_CONFIG} --libznc` $LDFLAGS"
MODLINK="`${ZNC_CONFIG} --modlink` $MODLINK"
VERSION="`${ZNC_CONFIG} --version`"
while test ! -z "$1"
do
FILE=$1
shift
MOD="${FILE%.cpp}"
MOD="${MOD%.cc}"
if test ! -f "${FILE}"; then
echo "${ERROR} Building \"${MOD}.so\" for ZNC $VERSION... File not found"
else
printf "Building \"${MOD}.so\" for ZNC $VERSION... "
if ${CXX} ${CXXFLAGS} ${INCLUDES} ${LDFLAGS} ${LIBS} ${MODLINK} -o "${MOD}.so" "${FILE}" ; then
echo "${OK}"
else
echo "${ERROR} Error while building \"${MOD}.so\""
exit 1
fi
fi
done
exit 0
Jump to Line
Something went wrong with that request. Please try again.