Commit e8937ccb authored by Colomban Wendling's avatar Colomban Wendling
Browse files

Add server build system (currently building a dummy application)

parent 1f97684f
......@@ -12,6 +12,7 @@ libtool
*.stamp
stamp-*
*~
config.h
config.h.in
*.log
*.status
......
src/*.c
src/ovccserver
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([ovccserver], [0.0], [dev@ovcc.tuxfamily.org])
AC_CONFIG_SRCDIR([src/server.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
PKG_CHECK_MODULES([OVCCSERVER], [glib-2.0 >= ${GLIB_REQUIRE}
gio-2.0 >= ${GIO_REQUIRE}])
CFLAGS="${CFLAGS} ${OVCCSERVER_CFLAGS} -Werror-implicit-function-declaration"
LIBS="${LIBS} ${OVCCSERVER_LIBS}"
VALAFLAGS="--pkg glib-2.0 --pkg gio-2.0"
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 = ovccserver
ovccserver_CPPFLAGS = -DG_LOG_DOMAIN=\"OVCCServer\"
ovccserver_VALAFLAGS = $(VALAFLAGS)
ovccserver_SOURCES = server.vala
/*
*
* Copyright (C) 2011 Colomban Wendling <ban@herbesfolles.org>
* Jonathan Michalon <studios.chalmion@no-log.org>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
public static int main (string[] args)
{
foreach (var arg in args) {
stdout.printf("%s\n", arg);
}
return 0;
}
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