[Date Prev][Date Next] [Chronological] [Thread] [Top]

OpenLDAP port to strict POSIX 1003.1-2001 hosts (ITS#2667)



Full_Name: Paul Eggert
Version: 2.1.22
OS: Solaris 8
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (66.80.53.59)


OpenLDAP makes some assumptions about shell commands that are not guaranteed
by the latest POSIX spec (POSIX 1003.1-2001, without XSI extensions).  Briefly:

* egrep and fgrep have been withdrawn from the standard.
  You're supposed to use grep -E and grep -F.
  (These commands are not portable to older systems, so
  the patch below avoids both egrep/fgrep and grep -E/-F.)

* test -a and test -o are not part of the standard; you're
  supposed to use && and || instead.

Here's a patch.

diff -pru openldap-2.1.22/build/mkdep openldap-2.1.22-posix/build/mkdep
--- openldap-2.1.22/build/mkdep	2003-03-03 09:10:01.000000000 -0800
+++ openldap-2.1.22-posix/build/mkdep	2003-07-28 09:58:05.000000000 -0700
@@ -153,7 +153,7 @@ for i in $files; do
 	esac
 done
 for i in $FILES; do
-	$MKDEP_CC $MKDEP_CFLAGS $FLAGS $i | egrep '^#.*"' > $TMP.sed
+	$MKDEP_CC $MKDEP_CFLAGS $FLAGS $i | grep '^#.*"' > $TMP.sed
 awk '
 BEGIN {
 	file = "'$i'"
diff -pru openldap-2.1.22/build/openldap.m4
openldap-2.1.22-posix/build/openldap.m4
--- openldap-2.1.22/build/openldap.m4	2003-04-03 17:45:49.000000000 -0800
+++ openldap-2.1.22-posix/build/openldap.m4	2003-07-28 10:10:43.000000000 -0700
@@ -128,7 +128,7 @@ if test -z "${MKDEP}"; then
  noCode;
 EOF
 				if AC_TRY_COMMAND($OL_MKDEP $flag conftest.c) \
-					| egrep '^conftest\.'"${ac_objext}" >/dev/null 2>&1
+					| grep '^conftest\.'"${ac_objext}" >/dev/null 2>&1
 				then
 					if test ! -f conftest."${ac_object}" ; then
 						ol_cv_mkdep=$flag
@@ -453,7 +453,7 @@ dnl ------------------------------------
 dnl Find old Berkeley DB 1.85/1.86
 AC_DEFUN([OL_BERKELEY_COMPAT_DB],
 [AC_CHECK_HEADERS(db_185.h db.h)
-if test $ac_cv_header_db_185_h = yes -o $ac_cv_header_db_h = yes; then
+if test $ac_cv_header_db_185_h = yes || test $ac_cv_header_db_h = yes; then
 	AC_CACHE_CHECK([if Berkeley DB header compatibility], [ol_cv_header_db1],[
 		AC_EGREP_CPP(__db_version_1,[
 #if HAVE_DB_185_H
@@ -515,7 +515,7 @@ AC_DEFUN([OL_GDBM],
 [AC_REQUIRE([OL_LIB_GDBM])
  AC_CHECK_HEADERS(gdbm.h)
  AC_CACHE_CHECK(for db, [ol_cv_gdbm], [
-	if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
+	if test $ol_cv_lib_gdbm = no || test $ac_cv_header_gdbm_h = no ; then
 		ol_cv_gdbm=no
 	else
 		ol_cv_gdbm=yes
@@ -560,7 +560,7 @@ AC_DEFUN([OL_MDBM],
 [AC_REQUIRE([OL_LIB_MDBM])
  AC_CHECK_HEADERS(mdbm.h)
  AC_CACHE_CHECK(for db, [ol_cv_mdbm], [
-	if test $ol_cv_lib_mdbm = no -o $ac_cv_header_mdbm_h = no ; then
+	if test $ol_cv_lib_mdbm = no || test $ac_cv_header_mdbm_h = no ; then
 		ol_cv_mdbm=no
 	else
 		ol_cv_mdbm=yes
@@ -616,7 +616,7 @@ AC_DEFUN([OL_NDBM],
 [AC_REQUIRE([OL_LIB_NDBM])
  AC_CHECK_HEADERS(ndbm.h)
  AC_CACHE_CHECK(for db, [ol_cv_ndbm], [
-	if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
+	if test $ol_cv_lib_ndbm = no || test $ac_cv_header_ndbm_h = no ; then
 		ol_cv_ndbm=no
 	else
 		ol_cv_ndbm=yes
@@ -845,11 +845,11 @@ AC_DEFUN([OL_LINUX_THREADS], [
 	AC_REQUIRE([OL_HEADER_LINUX_THREADS])
 	AC_REQUIRE([OL_SYS_LINUX_THREADS])
 	AC_CACHE_CHECK([for LinuxThreads consistency], [ol_cv_linux_threads], [
-		if test $ol_cv_header_linux_threads = yes -a \
-			$ol_cv_sys_linux_threads = yes; then
+		if test $ol_cv_header_linux_threads = yes &&
+		   test $ol_cv_sys_linux_threads = yes; then
 			ol_cv_linux_threads=yes
-		elif test $ol_cv_header_linux_threads = no -a \
-			$ol_cv_sys_linux_threads = no; then
+		elif test $ol_cv_header_linux_threads = no &&
+		     test $ol_cv_sys_linux_threads = no; then
 			ol_cv_linux_threads=no
 		else
 			ol_cv_linux_threads=error
@@ -1055,13 +1055,13 @@ AC_DEFUN(OL_FUNC_CTIME_R_NARGS,
 			ol_cv_func_ctime_r_nargs2=yes,
 			ol_cv_func_ctime_r_nargs2=no)
 
-	if test $ol_cv_func_ctime_r_nargs3 = yes -a \
-		$ol_cv_func_ctime_r_nargs2 = no ; then
+	if test $ol_cv_func_ctime_r_nargs3 = yes &&
+	   test $ol_cv_func_ctime_r_nargs2 = no ; then
 
 		ol_cv_func_ctime_r_nargs=3
 
-	elif test $ol_cv_func_ctime_r_nargs3 = no -a \
-		$ol_cv_func_ctime_r_nargs2 = yes ; then
+	elif test $ol_cv_func_ctime_r_nargs3 = no &&
+	     test $ol_cv_func_ctime_r_nargs2 = yes ; then
 
 		ol_cv_func_ctime_r_nargs=2
 
@@ -1118,13 +1118,13 @@ AC_DEFUN(OL_FUNC_GETHOSTBYNAME_R_NARGS,
 		ol_cv_func_gethostbyname_r_nargs6=yes,
 		ol_cv_func_gethostbyname_r_nargs6=no)
 
-	if test $ol_cv_func_gethostbyname_r_nargs5 = yes -a \
-		$ol_cv_func_gethostbyname_r_nargs6 = no ; then
+	if test $ol_cv_func_gethostbyname_r_nargs5 = yes &&
+	   test $ol_cv_func_gethostbyname_r_nargs6 = no ; then
 
 		ol_cv_func_gethostbyname_r_nargs=5
 
-	elif test $ol_cv_func_gethostbyname_r_nargs5 = no -a \
-		$ol_cv_func_gethostbyname_r_nargs6 = yes ; then
+	elif test $ol_cv_func_gethostbyname_r_nargs5 = no &&
+	     test $ol_cv_func_gethostbyname_r_nargs6 = yes ; then
 
 		ol_cv_func_gethostbyname_r_nargs=6
 
@@ -1173,13 +1173,13 @@ AC_DEFUN(OL_FUNC_GETHOSTBYADDR_R_NARGS,
 		ol_cv_func_gethostbyaddr_r_nargs8=yes,
 		ol_cv_func_gethostbyaddr_r_nargs8=no)
 
-	if test $ol_cv_func_gethostbyaddr_r_nargs7 = yes -a \
-		$ol_cv_func_gethostbyaddr_r_nargs8 = no ; then
+	if test $ol_cv_func_gethostbyaddr_r_nargs7 = yes &&
+	   test $ol_cv_func_gethostbyaddr_r_nargs8 = no ; then
 
 		ol_cv_func_gethostbyaddr_r_nargs=7
 
-	elif test $ol_cv_func_gethostbyaddr_r_nargs7 = no -a \
-		$ol_cv_func_gethostbyaddr_r_nargs8 = yes ; then
+	elif test $ol_cv_func_gethostbyaddr_r_nargs7 = no &&
+	     test $ol_cv_func_gethostbyaddr_r_nargs8 = yes ; then
 
 		ol_cv_func_gethostbyaddr_r_nargs=8
 
diff -pru openldap-2.1.22/configure.in openldap-2.1.22-posix/configure.in
--- openldap-2.1.22/configure.in	2003-06-21 10:18:37.000000000 -0700
+++ openldap-2.1.22-posix/configure.in	2003-07-28 14:52:44.000000000 -0700
@@ -51,7 +51,7 @@ if test -z "$OL_STRING"; then
 	AC_MSG_ERROR([could not determine version])
 fi
 
-if test -f "$ac_aux_dir/shtool" -a ! -d $ac_aux_dir/shtool; then
+if test -f "$ac_aux_dir/shtool" && test ! -d $ac_aux_dir/shtool; then
 	ac_cv_shtool="$ac_aux_dir/shtool"
 else
 	AC_MSG_ERROR([no shtool found in $ac_aux_dir])
@@ -395,17 +395,17 @@ elif test $ol_enable_ldbm = no ; then
 		AC_MSG_WARN([LDBM disabled, ignoring --with-ldbm-module argument])
 	fi
 
-	if test $ol_enable_modules != yes -a \
-		$ol_enable_bdb = no -a \
-		$ol_enable_dnssrv = no -a \
-		$ol_enable_ldap = no -a \
-		$ol_enable_meta = no -a \
-		$ol_enable_monitor = no -a \
-		$ol_enable_null = no -a \
-		$ol_enable_passwd = no -a \
-		$ol_enable_perl = no -a \
-		$ol_enable_shell = no -a \
-		$ol_enable_sql = no ; then
+	if test $ol_enable_modules != yes &&
+	   test $ol_enable_bdb = no &&
+	   test $ol_enable_dnssrv = no &&
+	   test $ol_enable_ldap = no &&
+	   test $ol_enable_meta = no &&
+	   test $ol_enable_monitor = no &&
+	   test $ol_enable_null = no &&
+	   test $ol_enable_passwd = no &&
+	   test $ol_enable_perl = no &&
+	   test $ol_enable_shell = no &&
+	   test $ol_enable_sql = no ; then
 
 		if test $ol_enable_slapd = yes ; then
 			AC_MSG_ERROR([slapd requires a backend])
@@ -425,16 +425,16 @@ elif test $ol_enable_ldbm = no ; then
 
 else
 	dnl SLAPD with LDBM
-	if test $ol_with_ldbm_api = gdbm -a \
-		$ol_with_ldbm_type = btree ; then
+	if test $ol_with_ldbm_api = gdbm &&
+	   test $ol_with_ldbm_type = btree ; then
 		AC_MSG_ERROR([GDBM only supports LDBM type hash])
 	fi
-	if test $ol_with_ldbm_api = mdbm -a \
-		$ol_with_ldbm_type = btree ; then
+	if test $ol_with_ldbm_api = mdbm &&
+	   test $ol_with_ldbm_type = btree ; then
 		AC_MSG_ERROR([MDBM only supports LDBM type hash])
 	fi
-	if test $ol_with_ldbm_api = ndbm -a \
-		$ol_with_ldbm_type = btree ; then
+	if test $ol_with_ldbm_api = ndbm &&
+	   test $ol_with_ldbm_type = btree ; then
 		AC_MSG_ERROR([NDBM only supports LDBM type hash])
 	fi
 
@@ -467,14 +467,14 @@ if test $ol_enable_lmpasswd = yes ; then
 	fi
 fi
 
-if test $ol_enable_kbind = yes -o $ol_enable_kpasswd = yes ; then
+if test $ol_enable_kbind = yes || test $ol_enable_kpasswd = yes ; then
 	if test $ol_with_kerberos = no ; then
 		AC_MSG_ERROR([options require --with-kerberos])
 	elif test $ol_with_kerberos = auto ; then
 		ol_with_kerberos=yes
 	fi
 
-elif test $ol_enable_kbind = no -o $ol_enable_kpasswd = no ; then
+elif test $ol_enable_kbind = no || test $ol_enable_kpasswd = no ; then
 	if test $ol_with_kerberos = auto ; then
 		ol_with_kerberos=no
 	elif test $ol_with_kerberos != no ; then
@@ -604,7 +604,7 @@ if test $ol_aix_threads = yes ; then
   		fi
 	fi
 
-	if test "${CC}" = "cc_r" -o "${CC}" = "xlc_r" ; then
+	if test "${CC}" = "cc_r" || test "${CC}" = "xlc_r" ; then
 		ol_with_threads=posix
 		ol_cv_pthread_create=yes
 	fi
@@ -660,14 +660,14 @@ AC_PROG_CPP
 
 dnl ----------------------------------------------------------------
 dnl Cross compiling checks
-if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
+if test $cross_compiling = yes && test $ol_enable_x_compile = yes; then
 	AC_MSG_WARN([cross compiling....  some functionality will be removed.])
 
-elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then
+elif test $cross_compiling = no && test $ol_enable_x_compile = yes; then
 	AC_MSG_WARN([programs compiled here do run here...])
 	AC_MSG_ERROR([  if not cross compiling, use --disable-x-compile.])
 
-elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
+elif test $cross_compiling = yes && test $ol_enable_x_compile = no; then
 	AC_MSG_WARN([programs compiled here do not run here...])
 	AC_MSG_ERROR([  if cross compiling,  add --enable-x-compile.])
 fi
@@ -991,7 +991,7 @@ if test "$ac_cv_func_res_query" = yes ; 
 	fi
 fi
 
-if test "$ol_enable_dnssrv" = yes -a "$ol_link_dnssrv" = no ; then
+if test "$ol_enable_dnssrv" = yes && test "$ol_link_dnssrv" = no ; then
 	AC_MSG_ERROR([DNSSRV requires res_query()])
 fi
 
@@ -1001,7 +1001,7 @@ dnl PF_LOCAL may use getaddrinfo in avai
 AC_CHECK_FUNCS( getaddrinfo getnameinfo gai_strerror inet_ntop )
 
 ol_link_ipv6=no
-if test $ac_cv_func_getaddrinfo = no -o $ac_cv_func_inet_ntop = no ; then
+if test $ac_cv_func_getaddrinfo = no || test $ac_cv_func_inet_ntop = no ; then
 	if test $ol_enable_ipv6 = yes ; then
 		AC_MSG_ERROR([IPv6 support requires getaddrinfo() and inet_ntop()])
 	fi
@@ -1053,9 +1053,9 @@ ol_link_kpasswd=no
 ol_link_krb5=no
 ol_link_krb4=no
 
-if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
-	-o $ol_with_kerberos = k5 -o $ol_with_kerberos = k5only \
-	-o $ol_with_kerberos = k425 ; then
+if test $ol_with_kerberos = yes || test $ol_with_kerberos = auto ||
+   test $ol_with_kerberos = k5 || test $ol_with_kerberos = k5only ||
+   test $ol_with_kerberos = k425 ; then
 
 	AC_CHECK_HEADERS(krb5.h)
 
@@ -1119,8 +1119,10 @@ if test $ol_with_kerberos = yes -o $ol_w
 	fi
 fi
 
-if test $ol_link_krb5 = yes -a \( $ol_with_kerberos = yes -o \
-	$ol_with_kerberos = auto -o $ol_with_kerberos = k425 \) ; then
+if test $ol_link_krb5 = yes &&
+   { test $ol_with_kerberos = yes ||
+     test $ol_with_kerberos = auto ||
+     test $ol_with_kerberos = k425; }; then
 
 	AC_CHECK_HEADERS(kerberosIV/krb.h kerberosIV/des.h)
 
@@ -1179,8 +1181,8 @@ if test $ol_link_krb5 = yes ; then
 	ol_with_kerberos=found
 fi
 
-if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
-	-o $ol_with_kerberos = k4 -o $ol_with_kerberos = kth ; then
+if test $ol_with_kerberos = yes || test $ol_with_kerberos = auto ||
+   test $ol_with_kerberos = k4 || test $ol_with_kerberos = kth ; then
 
 	AC_CHECK_HEADERS(krb.h des.h krb-archaeology.h )
 
@@ -1204,21 +1206,21 @@ if test $ol_with_kerberos = yes -o $ol_w
 	fi
 fi
 
-if test $ol_link_krb4 = yes -a $ol_enable_kpasswd != no ; then
+if test $ol_link_krb4 = yes && test $ol_enable_kpasswd != no ; then
 	ol_link_kpasswd=yes
 fi
 
-if test $ol_link_krb4 = yes -a $ol_enable_kbind != no ; then
+if test $ol_link_krb4 = yes && test $ol_enable_kbind != no ; then
 	ol_link_kbind=yes
 
 elif test $ol_enable_kbind = yes ; then
 	AC_MSG_ERROR([Kerberos IV detection failed])
 fi
 
-if test $ol_link_krb4 = yes -o $ol_link_krb5 = yes ; then
+if test $ol_link_krb4 = yes || test $ol_link_krb5 = yes ; then
 	AC_DEFINE(HAVE_KERBEROS, 1, [define if you have Kerberos])
 
-elif test $ol_with_kerberos != auto -a $ol_with_kerberos != no ; then
+elif test $ol_with_kerberos != auto && test $ol_with_kerberos != no ; then
 	AC_MSG_ERROR([Kerberos detection failed])
 fi
 
@@ -1297,8 +1299,8 @@ dnl ------------------------------------
 dnl Threads?
 ol_link_threads=no
 
-if test $ol_with_threads = auto -o $ol_with_threads = yes \
-	-o $ol_with_threads = nt ; then
+if test $ol_with_threads = auto || test $ol_with_threads = yes ||
+   test $ol_with_threads = nt ; then
 
 	OL_NT_THREADS
 
@@ -1316,8 +1318,8 @@ if test $ol_with_threads = auto -o $ol_w
 	fi
 fi
 
-if test $ol_with_threads = auto -o $ol_with_threads = yes \
-	-o $ol_with_threads = posix ; then
+if test $ol_with_threads = auto || test $ol_with_threads = yes ||
+   test $ol_with_threads = posix ; then
 
 	AC_CHECK_HEADERS(pthread.h)
 
@@ -1433,9 +1435,9 @@ dnl			[ol_cv_pthread_lpthread_lexc])
 			dnl check for both, and thr_yield for Solaris
 			AC_CHECK_FUNCS(sched_yield pthread_yield thr_yield)
 
-			if test $ac_cv_func_sched_yield = no -a \
-				$ac_cv_func_pthread_yield = no -a \
-				$ac_cv_func_thr_yield = no ; then
+			if test $ac_cv_func_sched_yield = no &&
+			   test $ac_cv_func_pthread_yield = no &&
+			   test $ac_cv_func_thr_yield = no ; then
 				dnl Digital UNIX has sched_yield() in -lrt
 				AC_CHECK_LIB(rt, sched_yield,
 					[LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
@@ -1444,9 +1446,9 @@ dnl			[ol_cv_pthread_lpthread_lexc])
 					ac_cv_func_sched_yield=yes],
 					[ac_cv_func_sched_yield=no])
 			fi
-			if test $ac_cv_func_sched_yield = no -a \
-				$ac_cv_func_pthread_yield = no -a \
-				"$ac_cv_func_thr_yield" = no ; then
+			if test $ac_cv_func_sched_yield = no &&
+			   test $ac_cv_func_pthread_yield = no &&
+			   test "$ac_cv_func_thr_yield" = no ; then
 				AC_MSG_WARN([could not locate sched_yield() or pthread_yield()])
 			fi
 
@@ -1607,8 +1609,8 @@ int main(argc, argv)
 	fi
 fi
 
-if test $ol_with_threads = auto -o $ol_with_threads = yes \
-	-o $ol_with_threads = mach ; then
+if test $ol_with_threads = auto || test $ol_with_threads = yes ||
+   test $ol_with_threads = mach ; then
 
 	dnl check for Mach CThreads
 	AC_CHECK_HEADERS(mach/cthreads.h cthreads.h)
@@ -1672,8 +1674,8 @@ if test $ol_with_threads = auto -o $ol_w
 	fi
 fi
 
-if test $ol_with_threads = auto -o $ol_with_threads = yes \
-	-o $ol_with_threads = pth ; then
+if test $ol_with_threads = auto || test $ol_with_threads = yes ||
+   test $ol_with_threads = pth ; then
 
 	AC_CHECK_HEADERS(pth.h)
 
@@ -1693,12 +1695,13 @@ if test $ol_with_threads = auto -o $ol_w
 	fi
 fi
 
-if test $ol_with_threads = auto -o $ol_with_threads = yes \
-	-o $ol_with_threads = lwp ; then
+if test $ol_with_threads = auto || test $ol_with_threads = yes ||
+   test $ol_with_threads = lwp ; then
 
 	dnl check for SunOS5 LWP
 	AC_CHECK_HEADERS(thread.h synch.h)
-	if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
+	if test $ac_cv_header_thread_h = yes &&
+	   test $ac_cv_header_synch_h = yes ; then
 		AC_CHECK_LIB(thread, thr_create, [have_thr=yes], [have_thr=no])
 
 		if test $have_thr = yes ; then
@@ -1757,7 +1760,7 @@ if test $ol_with_threads = manual ; then
 	AC_CHECK_HEADERS(thread.h synch.h)
 fi
 
-if test $ol_link_threads != no -a $ol_link_threads != nt ; then  
+if test $ol_link_threads != no && test $ol_link_threads != nt ; then  
 	dnl needed to get reentrant/threadsafe versions
 	dnl
 	AC_DEFINE(REENTRANT,1)
@@ -1924,9 +1927,9 @@ if test $ol_with_ldbm_api = auto \
 	fi
 fi
 
-if test $ol_enable_bdb = yes -a $ol_link_ldbm != berkeley ; then
+if test $ol_enable_bdb = yes && test $ol_link_ldbm != berkeley ; then
 	AC_MSG_ERROR(BDB: BerkeleyDB not available)
-elif test $ol_enable_bdb != no -a $ol_link_ldbm = berkeley ; then
+elif test $ol_enable_bdb != no && test $ol_link_ldbm = berkeley ; then
 	OL_BDB_COMPAT
 
 	if test $ol_cv_bdb_compat = yes ; then
@@ -1938,12 +1941,12 @@ elif test $ol_enable_bdb != no -a $ol_li
 	fi
 fi
 
-if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
+if test $ol_link_ldbm = no && test $ol_with_ldbm_type = btree ; then
 	AC_MSG_WARN(Could not find LDBM with BTREE support)
 	ol_with_ldbm_api=none
 fi
 
-if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
+if test $ol_with_ldbm_api = auto || test $ol_with_ldbm_api = mdbm ; then
 	OL_MDBM
 
 	if test $ol_cv_mdbm = yes ; then
@@ -1955,7 +1958,7 @@ if test $ol_with_ldbm_api = auto -o $ol_
 	fi
 fi
 
-if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
+if test $ol_with_ldbm_api = auto || test $ol_with_ldbm_api = gdbm ; then
 	OL_GDBM
 
 	if test $ol_cv_gdbm = yes ; then
@@ -1981,7 +1984,7 @@ if test $ol_with_ldbm_api = ndbm ; then
 	fi
 fi
 
-if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
+if test $ol_link_ldbm = no && test $ol_enable_ldbm != no ; then
 	AC_MSG_WARN(could not find suitable LDBM backend)
 	if test $ol_enable_ldbm = yes ; then
 		AC_MSG_ERROR(select appropriate LDBM options or disable)
@@ -1993,7 +1996,7 @@ fi
 
 dnl ----------------------------------------------------------------
 
-if test $ol_enable_dynamic = yes -a $enable_shared = yes ; then
+if test $ol_enable_dynamic = yes && test $enable_shared = yes ; then
 	BUILD_LIBS_DYNAMIC=shared
 	AC_DEFINE(LDAP_LIBS_DYNAMIC, 1, [define if LDAP libs are dynamic])
 	LTSTATIC=""
@@ -2052,7 +2055,7 @@ fi
 dnl ----------------------------------------------------------------
 if test $ol_enable_syslog != no ; then
 	AC_CHECK_FUNC(openlog)
-	if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
+	if test $ac_cv_func_openlog = no && test $ol_enable_syslog = yes; then
 		AC_MSG_ERROR(could not find syslog, select appropriate options or disable)
 	fi
 	ol_enable_syslog=$ac_cv_func_openlog
@@ -2128,7 +2131,8 @@ ol_link_spasswd=no
 if test $ol_with_cyrus_sasl != no ; then
 	AC_CHECK_HEADERS(sasl/sasl.h sasl.h)
 
-	if test $ac_cv_header_sasl_sasl_h = yes -o $ac_cv_header_sasl_h = yes; then
+	if test $ac_cv_header_sasl_sasl_h = yes ||
+	   test $ac_cv_header_sasl_h = yes; then
 		AC_CHECK_LIB(sasl2, sasl_client_init,
 			[ol_link_sasl="-lsasl2"],
 			[AC_CHECK_LIB(sasl, sasl_client_init,
@@ -2174,7 +2178,7 @@ fi
 
 dnl ----------------------------------------------------------------
 dnl Check for entropy sources
-if test $cross_compiling != yes -a "$ac_cv_mingw32" != yes ; then
+if test $cross_compiling != yes && test "$ac_cv_mingw32" != yes ; then
 	dev=no
 	if test -r /dev/urandom ; then
 		dev="/dev/urandom";
@@ -2443,7 +2447,8 @@ if test "$ac_cv_func_getpeereid" != yes;
 	OL_MSGHDR_MSG_ACCRIGHTS
 	LIBSRCS="$LIBSRCS getpeereid.c"
 fi
-if test "$ac_cv_func_snprintf" != yes -o "$ac_cv_func_vsnprintf" != yes; then
+if test "$ac_cv_func_snprintf" != yes ||
+   test "$ac_cv_func_vsnprintf" != yes; then
 	if test "$ac_cv_func_snprintf" != yes; then
 		AC_DEFINE(snprintf, ber_pvt_snprintf, [define to snprintf routine])
 	fi
@@ -2559,7 +2564,7 @@ if test "$ol_enable_ldap" != no ; then
 	fi
 fi
 
-if test "$ol_link_ldbm" != no -a $ol_enable_ldbm != no; then
+if test "$ol_link_ldbm" != no && test $ol_enable_ldbm != no; then
 	AC_DEFINE(SLAPD_LDBM,1,[define to support LDBM backend])
 	BUILD_SLAPD=yes
 	BUILD_LDBM=yes
@@ -2689,8 +2694,8 @@ if test "$ol_link_sql" != no ; then
 	fi
 fi
 
-if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
-	$BUILD_SLAPD = yes ; then
+if test "$ol_enable_slurpd" != no && test "$ol_link_threads" != no &&
+   test $BUILD_SLAPD = yes ; then
 	BUILD_SLURPD=yes
 fi
 
diff -pru openldap-2.1.22/servers/slapd/Makefile.in
openldap-2.1.22-posix/servers/slapd/Makefile.in
--- openldap-2.1.22/servers/slapd/Makefile.in	2003-03-31 08:48:17.000000000
-0800
+++ openldap-2.1.22-posix/servers/slapd/Makefile.in	2003-07-28
14:52:44.000000000 -0700
@@ -283,7 +283,7 @@ version.o: version.c $(OBJS) $(SLAPD_LIB
 
 depend-local-srv: FORCE
 	@for i in back-* shell-backends tools; do \
-		if test -d $$i -a -f $$i/Makefile ; then \
+		if test -d $$i && test -f $$i/Makefile ; then \
 			echo; echo "  cd $$i; $(MAKE) $(MFLAGS) depend"; \
 			( cd $$i; $(MAKE) $(MFLAGS) depend ); \
 			if test $$? != 0 ; then exit 1; fi ; \
@@ -296,7 +296,7 @@ clean-local:
 
 clean-local-srv: FORCE
 	@for i in back-* shell-backends tools; do \
-		if test -d $$i -a -f $$i/Makefile ; then \
+		if test -d $$i && test -f $$i/Makefile ; then \
 			echo; echo "  cd $$i; $(MAKE) $(MFLAGS) clean"; \
 			( cd $$i; $(MAKE) $(MFLAGS) clean ); \
 			if test $$? != 0 ; then exit 1; fi ; \
@@ -306,7 +306,7 @@ clean-local-srv: FORCE
 
 veryclean-local-srv: FORCE
 	@for i in back-* shell-backends tools; do \
-		if test -d $$i -a -f $$i/Makefile ; then \
+		if test -d $$i && test -f $$i/Makefile ; then \
 			echo; echo "  cd $$i; $(MAKE) $(MFLAGS) clean"; \
 			( cd $$i; $(MAKE) $(MFLAGS) veryclean ); \
 		fi; \
@@ -320,7 +320,7 @@ install-slapd: FORCE
 	$(LTINSTALL) $(INSTALLFLAGS) -s -m 755 \
 		slapd$(EXEEXT) $(DESTDIR)$(libexecdir)
 	@for i in back-* shell-backends tools; do \
-	    if test -d $$i -a -f $$i/Makefile ; then \
+	    if test -d $$i && test -f $$i/Makefile ; then \
 		echo; echo "  cd $$i; $(MAKE) $(MFLAGS) install"; \
 		( cd $$i; $(MAKE) $(MFLAGS) install ); \
 		if test $$? != 0 ; then exit 1; fi ; \
diff -pru openldap-2.1.22/tests/scripts/acfilter.sh
openldap-2.1.22-posix/tests/scripts/acfilter.sh
--- openldap-2.1.22/tests/scripts/acfilter.sh	2000-06-24 15:35:20.000000000
-0700
+++ openldap-2.1.22-posix/tests/scripts/acfilter.sh	2003-07-28
14:52:23.000000000 -0700
@@ -3,4 +3,4 @@
 #
 # Strip comments
 #
-egrep -iv '^#'
+grep -v '^#'
diff -pru openldap-2.1.22/tests/scripts/test000-rootdse
openldap-2.1.22-posix/tests/scripts/test000-rootdse
--- openldap-2.1.22/tests/scripts/test000-rootdse	2002-09-23 17:05:01.000000000
-0700
+++ openldap-2.1.22-posix/tests/scripts/test000-rootdse	2003-07-28
14:52:32.000000000 -0700
@@ -48,7 +48,7 @@ for i in 0 1 2 3 4 5; do
 	sleep 5
 done
 
-if test $RC = 0 -a $MONITORDB = yes ; then
+if test $RC = 0 && test $MONITORDB = yes ; then
 	echo "Using ldapsearch to retrieve the cn=Monitor..."
 	$LDAPSEARCH -b "cn=Monitor" -s base -h $LOCALHOST -p $PORT '+extensibleObject'
>> $SEARCHOUT 2>&1
 	RC=$?