summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-06-09 23:57:56 +0000
committerKarl Berry <karl@freefriends.org>2011-06-09 23:57:56 +0000
commitcf3d9fa147bda55f948e8a79430e82b0c60364be (patch)
tree678162741fcee4ae4a4c802809d0003feca64950
parent75ce3bbe9bfddedca688a41bb2c3c6e6e3a6bdf3 (diff)
use autoconf-chosen awk, to avoid broken solaris awk
git-svn-id: svn://tug.org/texlive/trunk@22899 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Build/source/texk/kpathsea/ChangeLog8
-rw-r--r--Build/source/texk/kpathsea/Makefile.am4
-rw-r--r--Build/source/texk/kpathsea/Makefile.in4
-rwxr-xr-xBuild/source/texk/kpathsea/configure44
-rw-r--r--Build/source/texk/kpathsea/configure.ac3
5 files changed, 59 insertions, 4 deletions
diff --git a/Build/source/texk/kpathsea/ChangeLog b/Build/source/texk/kpathsea/ChangeLog
index 707092e4326..82a2ea730d6 100644
--- a/Build/source/texk/kpathsea/ChangeLog
+++ b/Build/source/texk/kpathsea/ChangeLog
@@ -1,3 +1,11 @@
+2011-06-10 Karl Berry <karl@tug.org>
+
+ * configure.ac (AC_PROG_AWK): new test.
+ * Makefile.am (stamp-paths): use $(AWK).
+ This is to avoid broken Solaris /usr/bin/awk, which does
+ not have sub().
+ Report from Ettore Aldrovandi, 8 Jun 2011 23:36:44.
+
2011-06-09 Karl Berry <karl@tug.org>
* mktexlsr: write directory args to a file and read them back,
diff --git a/Build/source/texk/kpathsea/Makefile.am b/Build/source/texk/kpathsea/Makefile.am
index 1fc8ff8a460..46c23b67523 100644
--- a/Build/source/texk/kpathsea/Makefile.am
+++ b/Build/source/texk/kpathsea/Makefile.am
@@ -171,9 +171,9 @@ stamp-paths: texmf.cnf bsnl.awk cnf-to-paths.awk
#
# generate paths.h without build machine directories.
echo "/* paths.h: Generated from texmf.cnf. */" >paths.tmp
- awk -f $(srcdir)/bsnl.awk $(srcdir)/texmf.cnf \
+ $(AWK) -f $(srcdir)/bsnl.awk $(srcdir)/texmf.cnf \
| sed -e 's/%.*//' -e 's/^[ ]*//' -e 's/[ ]*$$//' \
- | awk -f $(srcdir)/cnf-to-paths.awk \
+ | $(AWK) -f $(srcdir)/cnf-to-paths.awk \
>>paths.tmp
@if cmp -s paths.h paths.tmp 2>/dev/null; then \
echo "paths.h is unchanged"; \
diff --git a/Build/source/texk/kpathsea/Makefile.in b/Build/source/texk/kpathsea/Makefile.in
index 8429aae8b2a..71da2d945b2 100644
--- a/Build/source/texk/kpathsea/Makefile.in
+++ b/Build/source/texk/kpathsea/Makefile.in
@@ -1756,9 +1756,9 @@ stamp-paths: texmf.cnf bsnl.awk cnf-to-paths.awk
#
# generate paths.h without build machine directories.
echo "/* paths.h: Generated from texmf.cnf. */" >paths.tmp
- awk -f $(srcdir)/bsnl.awk $(srcdir)/texmf.cnf \
+ $(AWK) -f $(srcdir)/bsnl.awk $(srcdir)/texmf.cnf \
| sed -e 's/%.*//' -e 's/^[ ]*//' -e 's/[ ]*$$//' \
- | awk -f $(srcdir)/cnf-to-paths.awk \
+ | $(AWK) -f $(srcdir)/cnf-to-paths.awk \
>>paths.tmp
@if cmp -s paths.h paths.tmp 2>/dev/null; then \
echo "paths.h is unchanged"; \
diff --git a/Build/source/texk/kpathsea/configure b/Build/source/texk/kpathsea/configure
index 0cc3420ddc9..bfccd3b0ca6 100755
--- a/Build/source/texk/kpathsea/configure
+++ b/Build/source/texk/kpathsea/configure
@@ -12698,6 +12698,50 @@ else
fi
+# So we can use reasonable awk in the Makefile.
+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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AWK+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_AWK="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$AWK" && break
+done
+
+
ac_fn_c_check_decl "$LINENO" "putenv" "ac_cv_have_decl_putenv" "$ac_includes_default"
if test "x$ac_cv_have_decl_putenv" = xyes; then :
ac_have_decl=1
diff --git a/Build/source/texk/kpathsea/configure.ac b/Build/source/texk/kpathsea/configure.ac
index 4b9dd2bb023..df14e5abc9b 100644
--- a/Build/source/texk/kpathsea/configure.ac
+++ b/Build/source/texk/kpathsea/configure.ac
@@ -47,6 +47,9 @@ m4_foreach([Kpse_Mktex], [kpse_mktex_opts],
[m4_ifset([Kpse_Mktex],
[KPSE_MKTEX_DEFINE(Kpse_Mktex)])])[]dnl
+# So we can use reasonable awk in the Makefile.
+AC_PROG_AWK
+
dnl Replacement functions that may be required on ancient broken system.
AC_CHECK_DECLS([putenv, strstr])
AC_REPLACE_FUNCS([putenv strcasecmp strtol strstr])