aboutsummaryrefslogtreecommitdiff
path: root/test/postinstall/test_pkg-config.sh
blob: d170e189a8db89b63f606b6149b3acd2071b41bd (plain)
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
35
36
37
38
39
#!/bin/sh

# Post-install tests with pkg-config and a Makefile
#
# First required argument is the installed prefix, which
# is used to set PKG_CONFIG_PATH and rpath for shared.
# Second argument is either shared (default) or static
cd $(dirname $0)
. ./common.sh
main_setup $1 $2

echo "Running post-install tests with pkg-config (${BUILD_MODE})"

export PKG_CONFIG="${PKG_CONFIG:-pkg-config}"
export PKG_CONFIG_PATH=${prefix}/lib/pkgconfig

if [ ${BUILD_MODE} = shared ]; then
  export LDFLAGS="${LDFLAGS} -Wl,-rpath,$(pkg-config proj --variable=libdir)"
fi

make_all_test_clean(){
  set -e
  make -f makefile.mak clean
  make -f makefile.mak all
  make -f makefile.mak test
  make -f makefile.mak clean
}

echo "Testing C app"
cd c_app
make_all_test_clean
cd ..

echo "Testing C++ app"
cd cpp_app
make_all_test_clean
cd ..

echo "Finished running post-install tests with pkg-config (${BUILD_MODE})"