2012-02-11 13:35:43 -06:00
|
|
|
#!/bin/bash
|
|
|
|
|
2012-02-11 14:00:33 -06:00
|
|
|
INSTALLNAMETOOL=`which install_name_tool` # Fixes Mac OS X issue with linking.
|
2012-02-11 13:35:43 -06:00
|
|
|
ZNCBUILD=`which znc-buildmod`
|
2012-02-11 20:15:21 -06:00
|
|
|
|
|
|
|
if [ -f logMySQL.buildconfig ]; then
|
|
|
|
. ./logMySQL.buildconfig
|
|
|
|
fi
|
|
|
|
|
2012-02-11 13:35:43 -06:00
|
|
|
if [ "$ZNCBUILD" = "" ]; then
|
|
|
|
echo "Where is znc-buildmod:"
|
|
|
|
read ZNCBUILD
|
|
|
|
if [ "$ZNCBUILD" = "" ]; then
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$MYSQL" = "" ]; then
|
2012-02-11 20:15:21 -06:00
|
|
|
echo "Where is MySQL path [/usr/local/mysql]:"
|
|
|
|
read MYSQL
|
|
|
|
if [ "$MYSQL" = "" ]; then
|
|
|
|
MYSQL="/usr/local/mysql"
|
|
|
|
fi
|
2012-02-11 13:35:43 -06:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$ZNCCONFIG" = "" ]; then
|
2012-02-11 20:15:21 -06:00
|
|
|
echo "Where is ZNC configuration path [$HOME/.znc]:"
|
|
|
|
read ZNCCONFIG
|
|
|
|
if [ "$ZNCCONFIG" = "" ]; then
|
|
|
|
ZNCCONFIG="$HOME/.znc"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -f logMySQL.buildconfig ]; then
|
|
|
|
echo "#!/bin/bash" > logMySQL.buildconfig
|
|
|
|
echo "ZNCBUILD=\"$ZNCBUILD\"" >> logMySQL.buildconfig
|
|
|
|
echo "MYSQL=\"$MYSQL\"" >> logMySQL.buildconfig
|
|
|
|
echo "ZNCCONFIG=\"$ZNCCONFIG\"" >> logMySQL.buildconfig
|
|
|
|
chmod 755 logMySQL.buildconfig
|
2012-02-11 13:35:43 -06:00
|
|
|
fi
|
|
|
|
|
2012-02-11 14:00:33 -06:00
|
|
|
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
|
2012-02-11 13:35:43 -06:00
|
|
|
cp logmysql.so "$ZNCCONFIG/modules/logmysql.so"
|