Branch
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 53 54 55 56 57 58 59 60 61
#!/bin/sh
BASEDIR=..
CONFIG_H_IN="$BASEDIR/config.h.in"
CONFIG_H="$BASEDIR/config.h"
LIBQRENCODE_PC_IN="$BASEDIR/libqrencode.pc.in"
LIBQRENCODE_PC="$BASEDIR/libqrencode.pc"
echo "Testing configure scripts..."
(cd $BASEDIR; ./autogen.sh)
# test config.h.in
grep "#undef HAVE_LIBPTHREAD" $CONFIG_H_IN > /dev/null
if test ! $? -eq 0; then
echo "HAVE_LIBPTHREAD undefined in config.h.in."
exit 1
fi
# test libqrencode.pc.in
grep "Libs.private: @LIBPTHREAD@" $LIBQRENCODE_PC_IN > /dev/null
if test ! $? -eq 0; then
echo "Pthread is not handled in libqrencode.pc.in."
exit 1
fi
# test pthread checks in configure
(cd $BASEDIR; ./configure --with-tests --enable-thread-safety > /dev/null)
grep "#define HAVE_LIBPTHREAD 1" $CONFIG_H > /dev/null
if test ! $? -eq 0; then
echo "HAVE_LIBPTHREAD undefined in config.h."
exit 1
fi
grep "Libs.private: -lpthread" $LIBQRENCODE_PC > /dev/null
if test ! $? -eq 0; then
echo "Pthread is not handled in libqrencode.pc."
exit 1
fi
(cd $BASEDIR; ./configure --with-tests --disable-thread-safety > /dev/null)
grep "#define HAVE_LIBPTHREAD 1" $CONFIG_H > /dev/null
if test ! $? -eq 1; then
echo "HAVE_LIBPTHREAD incorrectly defined in config.h."
exit 1
fi
grep "Libs.private: -lpthread" $LIBQRENCODE_PC > /dev/null
if test ! $? -eq 1; then
echo "Pthread is incorrectly handled in libqrencode.pc."
exit 1
fi
echo "All tests of configure script passed. Now reconfiguring..."
(cd $BASEDIR; ./configure --with-tests > /dev/null)
echo "Done."
exit 0