16 # Check automake version
17 AM_VERSION=`automake --version | sed -n -e 's#[^0-9]* \([0-9]*\)\.\([0-9]*\)\.*\([0-9]*\).*$#\1 \2 \3#p'`
18 AM_V1=`echo $AM_VERSION | awk '{print $1}'`
19 AM_V2=`echo $AM_VERSION | awk '{print $2}'`
20 AM_V3=`echo $AM_VERSION | awk '{print $3}'`
22 if [ "$AM_1" -gt "$AM_V1" ]; then
25 if [ "$AM_1" -eq "$AM_V1" ]; then
26 if [ "$AM_2" -gt "$AM_V2" ]; then
29 if [ "$AM_2" -eq "$AM_V2" ]; then
30 if [ -n "$AM_V3" -o "$AM_3" -gt "$AM_V3" ]; then
38 if [ "$AM_ERROR" = "1" ]; then
39 echo -n "Your automake version `automake --version | sed -n -e 's#[^0-9]* \([0-9]*\.[0-9]*\.[0-9]*\).*#\1#p'`"
40 echo " is older than the suggested one, $AM_1.$AM_2.$AM_3"
41 echo "Go on at your own risk. :-)"
45 # Check autoconf version
46 AC_VERSION=`autoconf --version | sed -n -e 's#[^0-9]* \([0-9]*\)\.\([0-9]*\).*$#\1 \2#p'`
47 AC_V1=`echo $AC_VERSION | awk '{print $1}'`
48 AC_V2=`echo $AC_VERSION | awk '{print $2}'`
50 if [ "$AC_1" -gt "$AC_V1" ]; then
53 if [ "$AC_1" -eq "$AC_V1" ]; then
54 if [ "$AC_2" -gt "$AC_V2" ]; then
60 if [ "$AC_ERROR" = "1" ]; then
61 echo -n "Your autoconf version `autoconf --version | sed -n -e 's#[^0-9]* \([0-9]*\.[0-9]*\).*#\1#p'`"
62 echo " is older than the suggested one, $AC_1.$AC_2"
63 echo "Go on at your own risk. :-)"
68 if which pkg-config 1>/dev/null 2>&1; then
69 #pkg-config seems to be installed. Check for m4 macros:
70 tmpdir=`mktemp -d "./autogenXXXXXX"`
71 if [ -z ${tmpdir} ]; then
72 echo -n "Creating a temporary directory failed. "
73 echo 'Is mktemp in $PATH?'
80 cat > configure.ac << _EOF_
82 PKG_CHECK_MODULES(QtNetwork, [QtNetwork >= 4.4], ac_qt="yes", ac_qt="no")
86 grep -q PKG_CHECK_MODULES configure
87 PKG_MACRO_AVAILABLE=$?
90 if [ ${PKG_MACRO_AVAILABLE} -eq 0 ]; then
91 echo -n "pkg-config installed, but autoconf is not able to find pkg.m4. "
92 echo "Unfortunately the generated configure would not work, so we stop here."
97 echo -n "pkg-config not found. "
98 echo "pkg-config is required to create a working configure, so we stop here."
104 # Check libtool version
105 if [ -z "$LIBTOOL" ] ; then
108 LT_VERSION=`${LIBTOOL} --version | sed -n -e 's#[^0-9]* \([0-9]*\)\.\([0-9]*\).*$#\1 \2#p'`
109 LT_V1=`echo $LT_VERSION | awk '{print $1}'`
110 LT_V2=`echo $LT_VERSION | awk '{print $2}'`
112 if [ "$LT_1" -gt "$LT_V1" ]; then
115 if [ "$LT_1" -eq "$LT_V1" ]; then
116 if [ "$LT_2" -gt "$LT_V2" ]; then
122 if [ "$LT_ERROR" = "1" ]; then
123 echo -n "Your libtool version `libtool --version | sed -n -e 's#[^0-9]* \([0-9]*\.[0-9]*\).*#\1#p'`"
124 echo " is older than the suggested one, $LT_1.$LT_2"
125 echo "Go on at your own risk. :-)"
129 if [ -z "$LIBTOOLIZE" ] ; then
130 LIBTOOLIZE="libtoolize"
132 echo Configuring build environment for gpsd
134 && ${LIBTOOLIZE} --force --copy \
135 && autoheader --force \
136 && automake --add-missing --foreign --copy --include-deps \
137 && autoconf --force \
138 && echo Now running configure to configure gpsd \
139 && echo "./configure $@" \