Commit 80ecc29f authored by Jonathan Michalon's avatar Jonathan Michalon
Browse files

Add a build system to the bot

parent b06f222d
SUBDIRS = src
ACLOCAL_AMFLAGS = -I build/m4
#!/bin/bash
## have() check for a program
# Usage: have [-r|-o] [-m <error message>] <program>
#
# Options:
# -o: The <program> is optional; don't exit on failure [default]
# -r: The <program> is required; exit if not found
# -m <message>: Message to show if program is not found in place of the
# default one.
have () {
local optional=true, message=""
for o; do
case "$o" in
-o) optional=true;;
-r) optional=false;;
-m) message="$1"; shift;;
*) break;;
esac
shift
done
echo -n "checking for \`$1'... "
cmd="`which "$1" 2>/dev/null`"
if [ "x$cmd" = "x" ]; then
echo "not found!" >&2
if [ "x$message" != "x" ]; then
echo "$message" >&2
else
echo "The program \`$1' cannot be found on your system." >&2
if $optional; then
echo "Continuing without." >&2
else
echo "Cannot continue without it;" \
"please fix this problem and retry." >&2
fi
fi
$optional && return 1 || exit 127
else
echo "ok, \`$cmd'."
fi
return 0
}
# check for needed autotools
have -r automake
have -r autoconf
have -r autoheader
have -r autoreconf
mkdir -p build/aux || exit 1
mkdir -p build/m4 || exit 1
autoreconf -vfi || exit 1
#~ ./configure "$@"
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.63])
AC_INIT([ovccbot], [0.0], [dev@ovcc.tuxfamily.org])
AC_CONFIG_SRCDIR([src/main.vala])
AC_CONFIG_AUX_DIR([build/aux])
AC_CONFIG_MACRO_DIR([build/m4])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AC_CONFIG_HEADERS([config.h])
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
# Checks for programs.
AC_PROG_CC
AM_PROG_VALAC([0.11.1])
# Checks for libraries.
GLIB_REQUIRE=2.12
GIO_REQUIRE=2.0
OVCC_REQUIRE=0.0
OVCCCLIENT_REQUIRE=0.0
PKG_CHECK_MODULES([OVCCBOT], [glib-2.0 >= ${GLIB_REQUIRE}
gio-2.0 >= ${GIO_REQUIRE}
ovcc >= ${OVCC_REQUIRE}
ovccclient >= ${OVCCCLIENT_REQUIRE}])
CFLAGS="${CFLAGS} ${OVCCBOT_CFLAGS} -Werror-implicit-function-declaration"
LIBS="${LIBS} ${OVCCBOT_LIBS}"
VALAFLAGS="--pkg glib-2.0 --pkg gio-2.0 --pkg ovcc --pkg ovccclient"
# get the correct VAPI directory for ovcc
AC_MSG_CHECKING([for OVCC VAPI dir])
ovcc_vapidir="$($PKG_CONFIG --variable prefix ovcc)/share/vala/vapi"
VALAFLAGS="$VALAFLAGS --vapidir=$ovcc_vapidir"
AC_MSG_RESULT([$ovcc_vapidir])
AC_SUBST([VALAFLAGS])
# Checks for header files.
# Checks for typedefs, structures, and compiler characteristics.
# Checks for library functions.
AC_CONFIG_FILES([Makefile
src/Makefile
])
AC_OUTPUT
bin_PROGRAMS = ovccbot
ovccbot_CPPFLAGS = -DG_LOG_DOMAIN=\"OVCCBot\"
ovccbot_VALAFLAGS = $(VALAFLAGS)
ovccbot_SOURCES = main.vala
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment