Commit ec99b30c authored by Jonathan Michalon's avatar Jonathan Michalon

Merge branch 'mr-gitlab-1' into 'master'

Build system fixes and enhancements

See merge request !1
parents a402453d 1eed08da
......@@ -5,6 +5,8 @@
# ------------------------------------
AC_DEFUN([OVCC_VALADOC_CHECK],
[
AC_REQUIRE([AC_PROG_SED])
AC_ARG_ENABLE([valadoc],
[AS_HELP_STRING([--enable-valadoc],
[Whether to build the documentation @<:@default=auto@:>@])],
......@@ -16,7 +18,7 @@ AC_DEFUN([OVCC_VALADOC_CHECK],
[AC_PATH_PROG([VALADOC], [valadoc], [NONE])
AS_IF([test "x$VALADOC" != xNONE],
[AC_MSG_CHECKING([whether $VALADOC is at least version $1])
ovcc__valadoc_version=`$VALADOC --version | sed 's/Valadoc *//'`
ovcc__valadoc_version=`$VALADOC --version | $SED 's/Valadoc *//'`
AS_VERSION_COMPARE([$1], ["$ovcc__valadoc_version"],
[have_valadoc=yes],
[have_valadoc=yes],
......
......@@ -4,7 +4,7 @@ VALADOC_SRCDIR = $(top_srcdir)/src
VALADOC_FILES = $(wildcard $(VALADOC_SRCDIR)/*.vala) \
$(wildcard $(VALADOC_SRCDIR)/*/*.vala)
VALADOC_FLAGS = $(LIBOVCC_VALAFLAGS) --pkg=hack
VALADOC_LIB = $(VALADOC_SRCDIR)/.libs/libovcc.so
VALADOC_LIB = $(top_builddir)/src/.libs/libovcc.so
VALADOC_CHEADER = $(VALADOC_SRCDIR)/ovcc.h
include $(top_srcdir)/build/ovcc-valadoc.make
......@@ -41,6 +41,8 @@ test_CFLAGS = $(LIBOVCC_CFLAGS)
test_LDADD = $(LIBOVCC_LIBS) libovcc.la -lpthread
test_SOURCES = test.c
test.c: ovcc.h
$(srcdir)/ovcc.h $(srcdir)/ovcc.vapi: libovcc_la_vala.stamp
$(lib_LTLIBRARIES): stamp-hack
......@@ -48,12 +50,12 @@ $(lib_LTLIBRARIES): stamp-hack
stamp-hack: ovcc.h ovcc.vapi
(f=`mktemp $@.XXXXXXXXXX`; trap -- "rm -f '$$f'" EXIT QUIT TERM; \
ovcc_h=ovcc.h; [ -f "$$ovcc_h" ] || ovcc_h="$(srcdir)/$$ovcc_h"; \
cat $(srcdir)/hack.h "$$ovcc_h" | sed '/<hack.h>/d'> "$$f" && \
cat $(srcdir)/hack.h "$$ovcc_h" | $(SED) '/<hack.h>/d'> "$$f" && \
(echo "/* this file is auto-generated, do not modify it (XXX: generated by valac) */" && \
cat "$$f") > ovcc.h)
(f=`mktemp $@.XXXXXXXXXX`; trap -- "rm -f '$$f'" EXIT QUIT TERM; \
ovcc_vapi=ovcc.vapi; [ -f "$$ovcc_vapi" ] || ovcc_vapi="$(srcdir)/$$ovcc_vapi"; \
cat $(srcdir)/hack.vapi "$$ovcc_vapi" | sed 's~"\(hack\|ovcc\).h"~"ovcc/ovcc.h"~g' > "$$f" && \
cat $(srcdir)/hack.vapi "$$ovcc_vapi" | $(SED) 's~"\(hack\|ovcc\).h"~"ovcc/ovcc.h"~g' > "$$f" && \
(echo "/* this file is auto-generated, do not modify it (XXX: generated by valac) */" && \
cat "$$f") > ovcc.vapi)
touch $@
......@@ -5,6 +5,8 @@
# ------------------------------------
AC_DEFUN([OVCC_VALADOC_CHECK],
[
AC_REQUIRE([AC_PROG_SED])
AC_ARG_ENABLE([valadoc],
[AS_HELP_STRING([--enable-valadoc],
[Whether to build the documentation @<:@default=auto@:>@])],
......@@ -16,7 +18,7 @@ AC_DEFUN([OVCC_VALADOC_CHECK],
[AC_PATH_PROG([VALADOC], [valadoc], [NONE])
AS_IF([test "x$VALADOC" != xNONE],
[AC_MSG_CHECKING([whether $VALADOC is at least version $1])
ovcc__valadoc_version=`$VALADOC --version | sed 's/Valadoc *//'`
ovcc__valadoc_version=`$VALADOC --version | $SED 's/Valadoc *//'`
AS_VERSION_COMPARE([$1], ["$ovcc__valadoc_version"],
[have_valadoc=yes],
[have_valadoc=yes],
......
......@@ -2,7 +2,7 @@
VALADOC_MODULE_NAME = LibOVCCClient
VALADOC_SRCDIR = $(top_srcdir)/src
VALADOC_FLAGS = $(LIBOVCCCLIENT_VALAFLAGS)
VALADOC_LIB = $(VALADOC_SRCDIR)/.libs/libovccclient.so
VALADOC_LIB = $(top_builddir)/src/.libs/libovccclient.so
VALADOC_CHEADER = $(VALADOC_SRCDIR)/ovccclient.h
include $(top_srcdir)/build/ovcc-valadoc.make
......@@ -13,8 +13,10 @@ vapi_DATA = ovccclient.vapi
$(lib_LTLIBRARIES): stamp-hack
$(srcdir)/ovccclient.h $(srcdir)/ovccclient.vapi: libovccclient_la_vala.stamp
# hack: add prefix to header filename in VAPI file
stamp-hack: ovccclient.vapi
stamp-hack: $(srcdir)/ovccclient.vapi
$(AM_V_GEN) \
sed -i 's~"\(ovccclient.h\)"~"ovcc/\1"~g' $<
$(SED) -i 's~"\(ovccclient.h\)"~"ovcc/\1"~g' $<
touch $@
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