From 32237014a1bd0ee2cdec9a54344f84c5c178c75f Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Mon, 17 Jan 2005 19:13:39 -0500 Subject: [PATCH] Various portability fixes for Solaris systems. --- ChangeLog | 6 ++++++ configure | 45 ++++++++++++++++++++++++++++++--------------- configure.in | 3 ++- lib/uuid/ChangeLog | 5 +++++ lib/uuid/uuidP.h | 4 ++-- misc/ChangeLog | 6 ++++++ misc/tune2fs.c | 4 ++++ tests/ChangeLog | 5 +++++ tests/Makefile.in | 2 +- tests/test_script.in | 2 +- 10 files changed, 62 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index dd285b9..4355fe5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-01-17 Theodore Ts'o + + * 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 * configure.in: Use AC_CHECK_TYPES instead of the autoconf 2.13 diff --git a/configure b/configure index 44e972d..517139a 100644 --- 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 diff --git a/configure.in b/configure.in index 6ce5b72..f8ea1b6 100644 --- a/configure.in +++ b/configure.in @@ -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, :) diff --git a/lib/uuid/ChangeLog b/lib/uuid/ChangeLog index 2a2808a..297c573 100644 --- a/lib/uuid/ChangeLog +++ b/lib/uuid/ChangeLog @@ -1,3 +1,8 @@ +2005-01-17 Theodore Ts'o + + * uuidP.h: Use inttypes.h in preference to stdint.h for + compatibility with older FreeBSD and Solaris systems. + 2004-12-14 Theodore Ts'o * Makefile.in: Use Linux-kernel-style makefile output for "make diff --git a/lib/uuid/uuidP.h b/lib/uuid/uuidP.h index 4bf779d..adf233d 100644 --- a/lib/uuid/uuidP.h +++ b/lib/uuid/uuidP.h @@ -32,8 +32,8 @@ * %End-Header% */ -#ifdef HAVE_STDINT_H -#include +#ifdef HAVE_INTTYPES_H +#include #else #include #endif diff --git a/misc/ChangeLog b/misc/ChangeLog index 214babf..c8356f8 100644 --- a/misc/ChangeLog +++ b/misc/ChangeLog @@ -1,5 +1,11 @@ 2005-01-17 Theodore Ts'o + * 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. diff --git a/misc/tune2fs.c b/misc/tune2fs.c index 92eee83..73ca95b 100644 --- a/misc/tune2fs.c +++ b/misc/tune2fs.c @@ -25,7 +25,11 @@ * 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 #include diff --git a/tests/ChangeLog b/tests/ChangeLog index 02214bb..9b1cf34 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,8 @@ +2005-01-17 Theodore Ts'o + + * Makefile.in, test_script.in: Use @EGREP@ instead of grep -E for + portability with Solaris systems. + 2005-01-13 Matthias Andree * f_dup_de, r_resize_inode: change ">& /dev/null" to ">/dev/null 2>&1" diff --git a/tests/Makefile.in b/tests/Makefile.in index fc3f67c..945b1d6 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -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} - diff --git a/tests/test_script.in b/tests/test_script.in index 51cb099..b8d72cc 100644 --- a/tests/test_script.in +++ b/tests/test_script.in @@ -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 -- 1.8.3.1