Skip to content

Commit

Permalink
Merge pull request #10 from theuni/build-changes2
Browse files Browse the repository at this point in the history
More build fixups
  • Loading branch information
Jeff Garzik committed Sep 25, 2015
2 parents c72d971 + f748215 commit 87d9045
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 9 deletions.
13 changes: 13 additions & 0 deletions .travis.yml
Expand Up @@ -30,10 +30,23 @@ before_script:
- test -n "$USE_SHELL" && eval '"$USE_SHELL" -c "./autogen.sh"' || ./autogen.sh

script:
- if [ -n "$UNIVALUE_CONFIG" ]; then unset CC; unset CXX; fi
- OUTDIR=$BASE_OUTDIR/$TRAVIS_PULL_REQUEST/$TRAVIS_JOB_NUMBER-$HOST
- UNIVALUE_CONFIG_ALL="--prefix=$TRAVIS_BUILD_DIR/depends/$HOST --bindir=$OUTDIR/bin --libdir=$OUTDIR/lib"
- ./configure --cache-file=config.cache $UNIVALUE_CONFIG_ALL $UNIVALUE_CONFIG || ( cat config.log && false)
- make -s $MAKEJOBS $GOAL || ( echo "Build failure. Verbose build follows." && make $GOAL ; false )
- export LD_LIBRARY_PATH=$TRAVIS_BUILD_DIR/depends/$HOST/lib
- if [ "$RUN_TESTS" = "true" ]; then make check; fi

matrix:
fast_finish: true
include:
- os: linux
compiler: gcc
env: UNIVALUE_CONFIG=--host=x86_64-w64-mingw32 RUN_TESTS=false
addons:
apt:
packages:
- g++-mingw-w64-x86-64
- gcc-mingw-w64-x86-64
- binutils-mingw-w64-x86-64
27 changes: 22 additions & 5 deletions Makefile.am
@@ -1,9 +1,15 @@
ACLOCAL_AMFLAGS = -I build-aux/m4
.PHONY: gen
.INTERMEDIATE: $(GENBIN)

include_HEADERS = lib/univalue.h lib/univalue_escapes.h
include_HEADERS = include/univalue.h
noinst_HEADERS = lib/univalue_escapes.h

lib_LTLIBRARIES = lib/libunivalue.la

pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = pc/libunivalue.pc

lib_libunivalue_la_SOURCES = \
lib/univalue.cpp \
lib/univalue_read.cpp \
Expand All @@ -12,18 +18,29 @@ lib_libunivalue_la_SOURCES = \
lib_libunivalue_la_LDFLAGS = \
-version-info $(LIBUNIVALUE_CURRENT):$(LIBUNIVALUE_REVISION):$(LIBUNIVALUE_AGE) \
-no-undefined
lib_libunivalue_la_CXXFLAGS = -I$(top_srcdir)/include

TESTS = test/unitester

noinst_PROGRAMS = lib/gen $(TESTS)
GENBIN = gen/gen$(BUILD_EXEEXT)
GEN_SRCS = gen/gen.cpp

$(GENBIN): $(GEN_SRCS)
@echo Building $@
$(AM_V_at)c++ -I$(top_srcdir)/include -o $@ $<

gen: lib/univalue_escapes.h $(GENBIN)
@echo Updating $<
$(AM_V_at)$(GENBIN) > lib/univalue_escapes.h

lib_gen_SOURCES = lib/gen.cpp
noinst_PROGRAMS = $(TESTS)

TEST_DATA_DIR=test

test_unitester_SOURCES = test/unitester.cpp
test_unitester_LDADD = lib/libunivalue.la
test_unitester_CXXFLAGS = -I$(top_srcdir)/lib -DJSON_TEST_SRC=\"$(srcdir)/$(TEST_DATA_DIR)\"
test_unitester_CXXFLAGS = -I$(top_srcdir)/include -DJSON_TEST_SRC=\"$(srcdir)/$(TEST_DATA_DIR)\"
test_unitester_LDFLAGS = -static $(LIBTOOL_APP_LDFLAGS)

TEST_FILES = \
$(TEST_DATA_DIR)/fail10.json \
Expand Down Expand Up @@ -64,4 +81,4 @@ TEST_FILES = \
$(TEST_DATA_DIR)/pass2.json \
$(TEST_DATA_DIR)/pass3.json

EXTRA_DIST=$(TEST_FILES)
EXTRA_DIST=$(TEST_FILES) $(GEN_SRCS)
18 changes: 14 additions & 4 deletions configure.ac
Expand Up @@ -47,13 +47,23 @@ LT_LANG([C++])

case $host in
*mingw*)
LDFLAGS+=" -static-libgcc -static-libstdc++"
;;
LIBTOOL_APP_LDFLAGS="$LIBTOOL_APP_LDFLAGS -all-static"
;;
esac

BUILD_EXEEXT=
case $build in
*mingw*)
BUILD_EXEEXT=".exe"
;;
esac

AC_CONFIG_FILES([
Makefile
lib/libunivalue.pc
lib/libunivalue-uninstalled.pc])
pc/libunivalue.pc
pc/libunivalue-uninstalled.pc])

AC_SUBST(LIBTOOL_APP_LDFLAGS)
AC_SUBST(BUILD_EXEEXT)
AC_OUTPUT

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 87d9045

Please sign in to comment.