Commit ab1fc490 authored by Kenton Varda's avatar Kenton Varda

Update test script for XCode 5, make sure -stdlib gets in pkg-config configs,…

Update test script for XCode 5, make sure -stdlib gets in pkg-config configs, use pkg-config in test script, and build RPC tests in test script.
parent a984a0fb
...@@ -6,6 +6,6 @@ includedir=@includedir@ ...@@ -6,6 +6,6 @@ includedir=@includedir@
Name: Cap'n Proto Name: Cap'n Proto
Description: Insanely fast serialization system Description: Insanely fast serialization system
Version: @VERSION@ Version: @VERSION@
Libs: -L${libdir} -lcapnp -lkj @PTHREAD_CFLAGS@ @PTHREAD_LIBS@ Libs: -L${libdir} -lcapnp -lkj @PTHREAD_CFLAGS@ @PTHREAD_LIBS@ @STDLIB_FLAG@
Libs.private: @LIBS@ Libs.private: @LIBS@
Cflags: -I${includedir} @PTHREAD_CFLAGS@ Cflags: -I${includedir} @PTHREAD_CFLAGS@ @STDLIB_FLAG@
...@@ -50,6 +50,10 @@ AM_CONDITIONAL([USE_EXTERNAL_CAPNP], [test "$external_capnp" != "no"]) ...@@ -50,6 +50,10 @@ AM_CONDITIONAL([USE_EXTERNAL_CAPNP], [test "$external_capnp" != "no"])
AC_SEARCH_LIBS(sched_yield, rt) AC_SEARCH_LIBS(sched_yield, rt)
# Users will need to use the same -stdlib as us so we'd better let pkg-config know about it.
STDLIB_FLAG=`echo "$CXX $CXXFLAGS" | grep -o ' [[-]]stdlib=[[^ ]]*'`
AC_SUBST([STDLIB_FLAG])
LIBS="$PTHREAD_LIBS $LIBS" LIBS="$PTHREAD_LIBS $LIBS"
CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS" CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS"
......
...@@ -195,14 +195,13 @@ export CXXFLAGS="-O2 -DDEBUG -Wall -Werror -Wno-strict-aliasing -Wno-sign-compar ...@@ -195,14 +195,13 @@ export CXXFLAGS="-O2 -DDEBUG -Wall -Werror -Wno-strict-aliasing -Wno-sign-compar
STAGING=$PWD/tmp-staging STAGING=$PWD/tmp-staging
if [ "$QUICK" != quick ]; then rm -rf "$STAGING"
rm -rf "$STAGING" mkdir "$STAGING"
mkdir "$STAGING" mkdir "$STAGING/bin"
mkdir "$STAGING/bin" mkdir "$STAGING/lib"
mkdir "$STAGING/lib" export PATH=$STAGING/bin:$PATH
export PATH=$STAGING/bin:$PATH export LD_LIBRARY_PATH=$STAGING/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
export LD_LIBRARY_PATH=$STAGING/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} export PKG_CONFIG_PATH=$STAGING/lib/pkgconfig
fi
if [ "$QUICK" = quick ]; then if [ "$QUICK" = quick ]; then
echo "************************** QUICK TEST ***********************************" echo "************************** QUICK TEST ***********************************"
...@@ -212,33 +211,26 @@ echo "=========================================================================" ...@@ -212,33 +211,26 @@ echo "========================================================================="
echo "Building c++" echo "Building c++"
echo "=========================================================================" echo "========================================================================="
if [ "x`uname`" = xDarwin ]; then # Apple now aliases gcc to clang, so probe to find out what compiler we're really using.
if [ ! -e ~/clang-3.2/bin/clang++ ]; then if (${CXX:-g++} -dM -E -x c++ /dev/null 2>&1 | grep -q '__clang__'); then
echo "You need to put the clang-3.2 binaries in ~/clang-3.2." >&2 IS_CLANG=yes
exit 1
fi
export CXX=~/clang-3.2/bin/clang++
SAMPLE_CXXFLAGS=-stdlib=libc++
else else
SAMPLE_CXXFLAGS= IS_CLANG=no
fi fi
case ${CXX:-g++} in if [ $IS_CLANG = yes ]; then
*clang* ) # There's an unused private field in gtest.
# There's an unused private field in gtest. export CXXFLAGS="$CXXFLAGS -Wno-unused-private-field"
export CXXFLAGS="$CXXFLAGS -Wno-unused-private-field" else
;; if (${CXX:-g++} --version | grep -q ' 4[.]8'); then
g++* | *-g++* ) # GCC 4.8 emits a weird uninitialized warning in kj/parse/char-test, deep in one of the parser
if (${CXX:-g++} --version | grep -q ' 4[.]8'); then # combinators. It could be a real bug but there is just not enough information to figure out
# GCC 4.8 emits a weird uninitialized warning in kj/parse/char-test, deep in one of the parser # where the problem is coming from, because GCC does not provide any description of the inlining
# combinators. It could be a real bug but there is just not enough information to figure out # that has occurred. Since I have not observed any actual problem (tests pass, etc.), I'm
# where the problem is coming from, because GCC does not provide any description of the inlining # muting it for now.
# that has occurred. Since I have not observed any actual problem (tests pass, etc.), I'm CXXFLAGS="$CXXFLAGS -Wno-maybe-uninitialized"
# muting it for now. fi
CXXFLAGS="$CXXFLAGS -Wno-maybe-uninitialized" fi
fi
;;
esac
cd c++ cd c++
doit ./setup-autotools.sh | tr = - doit ./setup-autotools.sh | tr = -
...@@ -246,18 +238,11 @@ doit autoreconf -i ...@@ -246,18 +238,11 @@ doit autoreconf -i
doit ./configure --prefix="$STAGING" doit ./configure --prefix="$STAGING"
doit make -j6 check doit make -j6 check
case ${CXX:-g++} in if [ $IS_CLANG = no ]; then
g++* | *-g++* ) # Verify that generated code compiles with pedantic warnings. Make sure to treat capnp headers
# Verify that generated code compiles with pedantic warnings. Make sure to treat capnp headers # as system headers so warnings in them are ignored.
# as system headers so warnings in them are ignored. doit ${CXX:-g++} -isystem src -std=c++11 -fno-permissive -pedantic -Wall -Wextra -Werror \
doit ${CXX:-g++} -isystem src -std=c++11 -fno-permissive -pedantic -Wall -Wextra -Werror \ -c src/capnp/test.capnp.c++ -o /dev/null
-c src/capnp/test.capnp.c++ -o /dev/null
;;
esac
if [ "$QUICK" = quick ]; then
make maintainer-clean
exit 0
fi fi
echo "=========================================================================" echo "========================================================================="
...@@ -270,15 +255,36 @@ test "x$(which capnp)" = "x$STAGING/bin/capnp" ...@@ -270,15 +255,36 @@ test "x$(which capnp)" = "x$STAGING/bin/capnp"
test "x$(which capnpc-c++)" = "x$STAGING/bin/capnpc-c++" test "x$(which capnpc-c++)" = "x$STAGING/bin/capnpc-c++"
cd samples cd samples
doit capnp compile -oc++ addressbook.capnp -I"$STAGING"/include --no-standard-import doit capnp compile -oc++ addressbook.capnp -I"$STAGING"/include --no-standard-import
doit ${CXX:-g++} -std=c++11 $CXXFLAGS $SAMPLE_CXXFLAGS -I"$STAGING"/include -L"$STAGING"/lib \ doit ${CXX:-g++} -std=c++11 addressbook.c++ addressbook.capnp.c++ -o addressbook \
addressbook.c++ addressbook.capnp.c++ -lcapnp -lkj -pthread -o addressbook $CXXFLAGS $(pkg-config --cflags --libs capnp)
echo "@@@@ ./addressbook (in various configurations)" echo "@@@@ ./addressbook (in various configurations)"
./addressbook write | ./addressbook read ./addressbook write | ./addressbook read
./addressbook dwrite | ./addressbook dread ./addressbook dwrite | ./addressbook dread
rm addressbook addressbook.capnp.c++ addressbook.capnp.h rm addressbook addressbook.capnp.c++ addressbook.capnp.h
doit capnp compile -oc++ calculator.capnp -I"$STAGING"/include --no-standard-import
doit ${CXX:-g++} -std=c++11 calculator-client.c++ calculator.capnp.c++ -o calculator-client \
$CXXFLAGS $(pkg-config --cflags --libs capnp-rpc)
doit ${CXX:-g++} -std=c++11 calculator-server.c++ calculator.capnp.c++ -o calculator-server \
$CXXFLAGS $(pkg-config --cflags --libs capnp-rpc)
rm -f /tmp/capnp-calculator-example-$$
./calculator-server unix:/tmp/capnp-calculator-example-$$ &
sleep 0.1
./calculator-client unix:/tmp/capnp-calculator-example-$$
kill %+
wait %+ || true
rm calculator-client calculator-server calculator.capnp.c++ calculator.capnp.h /tmp/capnp-calculator-example-$$
cd .. cd ..
if [ "$QUICK" = quick ]; then
doit make maintainer-clean
rm -rf "$STAGING"
exit 0
fi
echo "=========================================================================" echo "========================================================================="
echo "Testing --with-external-capnp" echo "Testing --with-external-capnp"
echo "=========================================================================" echo "========================================================================="
...@@ -364,4 +370,3 @@ fi ...@@ -364,4 +370,3 @@ fi
doit make maintainer-clean doit make maintainer-clean
rm -rf "$STAGING" rm -rf "$STAGING"
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