LogSQL/buildLogMySQL

30 lines
750 B
Bash
Executable File

#!/bin/bash
INSTALLNAMETOOL=`which install_name_tool` # Fixes Mac OS X issue with linking.
ZNCBUILD=`which znc-buildmod`
if [ "$ZNCBUILD" = "" ]; then
echo "Where is znc-buildmod:"
read ZNCBUILD
if [ "$ZNCBUILD" = "" ]; then
exit
fi
fi
echo "Where is MySQL path [/usr/local/mysql]:"
read MYSQL
if [ "$MYSQL" = "" ]; then
MYSQL="/usr/local/mysql"
fi
echo "Where is ZNC configuration path [$HOME/.znc]:"
read ZNCCONFIG
if [ "$ZNCCONFIG" = "" ]; then
ZNCCONFIG="$HOME/.znc"
fi
LDFLAGS="-L $MYSQL/lib -lmysqlclient -I $MYSQL/include" "$ZNCBUILD" logmysql.cpp
if [ "$INSTALLNAMETOOL" != "" ]; then
"$INSTALLNAMETOOL" -change libmysqlclient.18.dylib "$MYSQL/libmysqlclient.dylib" logmysql.so
fi
cp logmysql.so "$ZNCCONFIG/modules/logmysql.so"