#! /bin/sh
-# Copyright (C) 2012 Free Software Foundation, Inc.
+# Copyright (C) 2012-2013 Free Software Foundation, Inc.
#
# 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
# Vala sources and C sources in the same program. Functional test.
-required='valac cc GNUmake'
-. ./defs || Exit 1
+required='valac cc pkg-config GNUmake'
+. test-init.sh
cat >> configure.ac <<'END'
AC_PROG_CC
-AM_PROG_CC_C_O
AM_PROG_VALAC([0.7.3])
+PKG_CHECK_MODULES([GOBJECT], [gobject-2.0 >= 2.4])
AC_OUTPUT
END
cat > Makefile.am <<'END'
bin_PROGRAMS = zardoz mu baz
-AM_VALAFLAGS = --profile=posix
+AM_CFLAGS = $(GOBJECT_CFLAGS)
+LDADD = $(GOBJECT_LIBS)
zardoz_SOURCES = foo.vala bar.c
mu_SOURCES = 1.vala 2.c
-mu_VALAFLAGS = $(AM_VALAFLAGS) --main=run
-mu_CFLAGS = -DHAVE_MU
+mu_VALAFLAGS = --main=run
+mu_CFLAGS = -DHAVE_MU $(AM_CFLAGS)
baz_SOURCES = baz.c
END
# Remake rules are not uselessly triggered.
$MAKE -q
-$MAKE -n | $FGREP vala.stamp && Exit 1
+$MAKE -n | $FGREP vala.stamp && exit 1
# Check the distribution.
$MAKE distcheck
# behaviour w.r.t. intermediate C files is still unclear, and
# better left undefined for the moment).
$MAKE maintainer-clean
-ls *vala*.stamp | grep . && Exit 1
+ls *vala*.stamp | grep . && exit 1
: