Use the 'test' program properly, with command-line arguments.
authoraland <aland>
Fri, 24 Aug 2001 18:28:38 +0000 (18:28 +0000)
committeraland <aland>
Fri, 24 Aug 2001 18:28:38 +0000 (18:28 +0000)
Bug found by Robert Haskins <rhaskins@ziplink.net>

aclocal.m4
configure

index 8b4e855..1978ba9 100644 (file)
@@ -20,6 +20,8 @@
 ## distribute this file as part of a program that contains a
 ## configuration script generated by Autoconf, you may include it under
 ## the same distribution terms that you use for the rest of that program.
+##
+##  $Id$
 
 # serial 40 AC_PROG_LIBTOOL
 AC_DEFUN(AC_PROG_LIBTOOL,
@@ -569,7 +571,7 @@ AC_DEFUN(POSTGRESQL_CHECKS, [
 AC_CHECKING(for PostgreSQL includes)
 
 dnl First Check for a local install
-if test $PGROOT ; then
+if test -d $PGROOT ; then
        IS_LOCAL=1
 else
        dnl Check common local install paths
@@ -588,7 +590,7 @@ else
        fi
 fi
 dnl If we have a local install path, check for some files
-if test $PGROOT && test IS_LOCAL ; then
+if test -d $PGROOT && test "x$IS_LOCAL" != "x" ; then
        if test -e $PGROOT/lib/libpq${libltdl_cv_shlibext} ; then
                if test -e $PGROOT/lib/libpq.a ; then
                        PQ_LIBS="-L$PGROOT/lib -lpq"
@@ -596,7 +598,7 @@ if test $PGROOT && test IS_LOCAL ; then
        fi
        AC_CHECK_HEADERS($PGROOT/include/libpq-fe.h $PGROOT/include/postgres.h,
                FOUND_PG_HEADERS=1)
-       if test $FOUND_PG_HEADERS ; then
+       if test "x$FOUND_PG_HEADERS" != "x" ; then
                PG_INCLUDE_DIR="$PGROOT/include"
        fi
 fi
@@ -604,7 +606,7 @@ fi
 dnl Now check for the two common distribution installation locations
 if test "x$PGROOT" = "x" ; then
        AC_CHECK_LIB(pq,PQconnectdb,FOUND_PQLIB=1)
-       if test $FOUND_PQLIB ; then
+       if test "x$FOUND_PQLIB" != "x" ; then
                PQ_LIBS="-lpq"
        fi
        if test -d /usr/include/pgsql ; then
@@ -616,7 +618,7 @@ if test "x$PGROOT" = "x" ; then
        fi
        AC_CHECK_HEADER("${PG_INCLUDED_DIR}libpq-fe.h",AC_DEFINE(HAVE_LIBPQ_FE_H))
        AC_CHECK_HEADER("${PG_INCLUDED_DIR}postgres.h",AC_DEFINE(HAVE_POSTGRES_H))
-       if test $HAVE_HEADER-LIBPQ-FE.H ; then
+       if test "x$HAVE_HEADER-LIBPQ-FE.H" != "x" ; then
                PG_INCLUDE_DIR="$PG_INCLUDE_DIR"
        fi
        if test -d /usr/lib/pgsql ; then
index d400edf..e21d69c 100755 (executable)
--- a/configure
+++ b/configure
@@ -562,7 +562,7 @@ fi
 
 
 
-# From configure.in Revision: 1.125 
+# From configure.in Revision: 1.126 
 RADIUSD_VERSION=0.2
 
 
@@ -4009,7 +4009,7 @@ fi
 echo "checking for PostgreSQL includes" 1>&6
 echo "configure:4011: checking for PostgreSQL includes" >&5
 
-if test $PGROOT ; then
+if test -d $PGROOT ; then
        IS_LOCAL=1
 else
                if test -d /usr/local/pgsql ; then 
@@ -4026,7 +4026,7 @@ else
                ISLOCAL=1
        fi
 fi
-if test $PGROOT && test IS_LOCAL ; then
+if test -d $PGROOT && test "x$IS_LOCAL" != "x" ; then
        if test -e $PGROOT/lib/libpq${libltdl_cv_shlibext} ; then
                if test -e $PGROOT/lib/libpq.a ; then
                        PQ_LIBS="-L$PGROOT/lib -lpq"
@@ -4072,7 +4072,7 @@ else
 fi
 done
 
-       if test $FOUND_PG_HEADERS ; then
+       if test "x$FOUND_PG_HEADERS" != "x" ; then
                PG_INCLUDE_DIR="$PGROOT/include"
        fi
 fi
@@ -4118,7 +4118,7 @@ else
   echo "$ac_t""no" 1>&6
 fi
 
-       if test $FOUND_PQLIB ; then
+       if test "x$FOUND_PQLIB" != "x" ; then
                PQ_LIBS="-lpq"
        fi
        if test -d /usr/include/pgsql ; then
@@ -4200,7 +4200,7 @@ else
   echo "$ac_t""no" 1>&6
 fi
 
-       if test $HAVE_HEADER-LIBPQ-FE.H ; then
+       if test "x$HAVE_HEADER-LIBPQ-FE.H" != "x" ; then
                PG_INCLUDE_DIR="$PG_INCLUDE_DIR"
        fi
        if test -d /usr/lib/pgsql ; then