Whamcloud - gitweb
Various portability fixes for Solaris systems.
authorTheodore Ts'o <tytso@mit.edu>
Tue, 18 Jan 2005 00:13:39 +0000 (19:13 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 18 Jan 2005 00:13:39 +0000 (19:13 -0500)
ChangeLog
configure
configure.in
lib/uuid/ChangeLog
lib/uuid/uuidP.h
misc/ChangeLog
misc/tune2fs.c
tests/ChangeLog
tests/Makefile.in
tests/test_script.in

index dd285b9..4355fe5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-01-17  Theodore Ts'o  <tytso@mit.edu>
+
+       * configure.in: Use AC_PROG_AWK instead of AC_PATH_PROG so that we
+               use nawk in preference to awk for Solaris systems.  Use
+               AC_PROG_EGREP because Solaris doesn't support "grep -E".
+
 2005-01-09  Theodore Ts'o  <tytso@mit.edu>
 
        * configure.in: Use AC_CHECK_TYPES instead of the autoconf 2.13
index 44e972d..517139a 100644 (file)
--- a/configure
+++ b/configure
@@ -10168,38 +10168,35 @@ else
 echo "${ECHO_T}no" >&6
 fi
 
-# Extract the first word of "awk", so it can be a program name with args.
-set dummy awk; ac_word=$2
+for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
 echo "$as_me:$LINENO: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_AWK+set}" = set; then
+if test "${ac_cv_prog_AWK+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case $AWK in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_AWK="$AWK" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+  if test -n "$AWK"; then
+  ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
   if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_AWK="$as_dir/$ac_word$ac_exec_ext"
+    ac_cv_prog_AWK="$ac_prog"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
 
-  test -z "$ac_cv_path_AWK" && ac_cv_path_AWK="awk"
-  ;;
-esac
 fi
-AWK=$ac_cv_path_AWK
-
+fi
+AWK=$ac_cv_prog_AWK
 if test -n "$AWK"; then
   echo "$as_me:$LINENO: result: $AWK" >&5
 echo "${ECHO_T}$AWK" >&6
@@ -10208,6 +10205,24 @@ else
 echo "${ECHO_T}no" >&6
 fi
 
+  test -n "$AWK" && break
+done
+
+echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6
+if test "${ac_cv_prog_egrep+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+    then ac_cv_prog_egrep='grep -E'
+    else ac_cv_prog_egrep='egrep'
+    fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
+echo "${ECHO_T}$ac_cv_prog_egrep" >&6
+ EGREP=$ac_cv_prog_egrep
+
+
 # Extract the first word of "sed", so it can be a program name with args.
 set dummy sed; ac_word=$2
 echo "$as_me:$LINENO: checking for $ac_word" >&5
index 6ce5b72..f8ea1b6 100644 (file)
@@ -525,7 +525,8 @@ AC_PATH_PROG(MV, mv, mv)
 AC_PATH_PROG(CP, cp, cp)
 AC_PATH_PROG(RM, rm, rm)
 AC_PATH_PROG(CHMOD, chmod, :)
-AC_PATH_PROG(AWK, awk, awk)
+AC_PROG_AWK
+AC_PROG_EGREP
 AC_PATH_PROG(SED, sed, sed)
 AC_PATH_PROG(PERL, perl, perl)
 AC_PATH_PROG(LDCONFIG, ldconfig, :)
index 2a2808a..297c573 100644 (file)
@@ -1,3 +1,8 @@
+2005-01-17  Theodore Ts'o  <tytso@mit.edu>
+
+       * uuidP.h: Use inttypes.h in preference to stdint.h for
+               compatibility with older FreeBSD and Solaris systems.
+
 2004-12-14  Theodore Ts'o  <tytso@mit.edu>
 
        * Makefile.in: Use Linux-kernel-style makefile output for "make
index 4bf779d..adf233d 100644 (file)
@@ -32,8 +32,8 @@
  * %End-Header%
  */
 
-#ifdef HAVE_STDINT_H
-#include <stdint.h>
+#ifdef HAVE_INTTYPES_H
+#include <inttypes.h>
 #else
 #include <uuid/uuid_types.h>
 #endif
index 214babf..c8356f8 100644 (file)
@@ -1,5 +1,11 @@
 2005-01-17  Theodore Ts'o  <tytso@mit.edu>
 
+       * tune2fs.c: On Solaris, defining _XOPEN_SOURCE inexplicably
+               causes struct timeval to be undefined, breaking system
+               header files left and right.  But glibc requires
+               _XOPEN_SOURCE in order for strptime() to be defined.  So
+               don't define _XOPEN_SOURCE on Solaris systems.
+
        * filefrag.c (frag_report): Applied patch from Francois Petillon
                (fantec at proxad.net) to avoid a file descriptor leak.
 
index 92eee83..73ca95b 100644 (file)
  * 94/03/06    - Added the checks interval from Uwe Ohse (uwe@tirka.gun.de)
  */
 
+#ifndef __sun__
+       /* Solaris for a strange reason drops struct 
+          timeval if _XOPEN_SOURCE defined */
 #define _XOPEN_SOURCE /* for inclusion of strptime() */
+#endif
 #define _BSD_SOURCE /* for inclusion of strcasecmp() */
 #include <fcntl.h>
 #include <grp.h>
index 02214bb..9b1cf34 100644 (file)
@@ -1,3 +1,8 @@
+2005-01-17  Theodore Ts'o  <tytso@mit.edu>
+
+       * Makefile.in, test_script.in: Use @EGREP@ instead of grep -E for
+               portability with Solaris systems.
+
 2005-01-13  Matthias Andree  <matthias.andree@gmx.de>
 
        * f_dup_de, r_resize_inode: change ">& /dev/null" to ">/dev/null 2>&1"
index fc3f67c..945b1d6 100644 (file)
@@ -18,6 +18,7 @@ test_script: test_script.in Makefile
        @echo "#!/bin/sh" > test_script
 @HTREE_CMT@    @echo "HTREE=y" >> test_script
 @HTREE_CLR_CMT@        @echo "HTREE_CLR=y" >> test_script
+       @echo 'EGREP="@EGREP@"' >> test_script
        @echo "SRCDIR=@srcdir@" >> test_script
        @cat $(srcdir)/test_script.in >> test_script
        @chmod +x test_script
@@ -58,4 +59,3 @@ clean::
 distclean:: clean
        $(RM) -f Makefile
        $(RM) -rf ${TDIR}
-       
index 51cb099..b8d72cc 100644 (file)
@@ -4,7 +4,7 @@
 #
 
 if test "$1"x = x ; then
-  TESTS=`ls -d $SRCDIR/[a-zA-Z]_* | grep -E -v "\.failed|\.new"`
+  TESTS=`ls -d $SRCDIR/[a-zA-Z]_* | $EGREP -v "\.failed|\.new"`
 else
   TESTS=
   for i