1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
#!/bin/sh
set -e
TMPDIR=$(mktemp -d)
trap "rm -rf $TMPDIR" EXIT
cd $TMPDIR
cat <<EOF > test-include-libtcod-h.c
#include <libtcod/libtcod.h>
int main () { return 0; }
EOF
cat <<EOF > test-include-libtcod-hpp.cc
#include <libtcod/libtcod.hpp>
int main () { return 0; }
EOF
cat <<EOF > test-include-libtcod-gui-hpp.cc
#include <libtcod/gui/gui.hpp>
int main () { return 0; }
EOF
cc -o test-include-libtcod-h test-include-libtcod-h.c `pkg-config --cflags --libs libtcod`
[ -x test-include-libtcod-h ]
./test-include-libtcod-h
c++ -o test-include-libtcod-hpp test-include-libtcod-hpp.cc `pkg-config --cflags --libs libtcod`
[ -x test-include-libtcod-hpp ]
./test-include-libtcod-hpp
c++ -o test-include-libtcod-gui-hpp test-include-libtcod-gui-hpp.cc `pkg-config --cflags --libs libtcod`
[ -x test-include-libtcod-gui-hpp ]
./test-include-libtcod-gui-hpp
|