aboutsummaryrefslogtreecommitdiff
path: root/test/postinstall/test_autotools.sh
blob: 3e088fac99378969d940e2b33a46e58ca16e00ef (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
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/sh

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

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

if [ ${BUILD_MODE} = shared ]; then
  export PKG_CONFIG="pkg-config"
  ENABLE_STATIC_PROJ=no
else
  export PKG_CONFIG="pkg-config --static"
  ENABLE_STATIC_PROJ=yes
fi
export PKG_CONFIG_PATH=${prefix}/lib/pkgconfig

autogen_configure_check_clean(){
  set -e
  aclocal
  automake --add-missing --copy --foreign
  autoconf
  ./configure --enable-static-proj=${ENABLE_STATIC_PROJ}
  make clean
  make
  set +e
  make check
  EXIT=$?
  if [ ${EXIT} -ne 0 ]; then
    cat test-suite.log
    exit ${EXIT}
  fi
  make distclean
}

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

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

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