1. Don't assume the system grep understands -E. Use egrep instead.
2. Search for nawk-equivalent (awk cannot handle syntax in
   po/Makefile.in.in)

-- 
albert chin ([EMAIL PROTECTED])

-- snip snip
Index: config/lyxinclude.m4
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/config/lyxinclude.m4,v
retrieving revision 1.34.2.2
diff -u -3 -p -r1.34.2.2 lyxinclude.m4
--- config/lyxinclude.m4        2001/01/22 16:09:05     1.34.2.2
+++ config/lyxinclude.m4        2001/02/13 06:47:24
@@ -967,3 +967,44 @@ if eval "test \"\${lyx_cv_declare_${tr_h
      got="yes"
 fi
 done])
+
+# dnl LYX_PATH_NAWK(VARIABLE [, VALUE-IF-NOT-FOUND [, PATH]])
+AC_DEFUN(LYX_PATH_NAWK,
+[
+  AC_MSG_CHECKING([for nawk])
+  AC_CACHE_VAL(lyx_path_$1,
+  [case "[$]$1" in
+    /*)
+    lyx_path_$1="[$]$1" # let user override path
+    ;;
+    ?:/*)
+    lyx_path_$1="[$]$1" # let user override with dos path
+    ;;
+    *)
+    IFS="${IFS=        }"; _ifs="${IFS}"; IFS=":"
+    _path="ifelse([$3], , ${PATH}, [$3])"
+    for _p in ${_path}; do
+      test -z "${_p}" && _p=.
+      for _prog in awk nawk gawk; do
+       _awk=${_p}/${_prog}
+       test ! -f "${_awk}" && continue
+       ${_awk} '[$]0 {print [$]0}' /etc/passwd >/dev/null 2>&1
+       if test $? -eq 0; then
+         lyx_path_$1=${_awk}
+         break
+       fi
+      done
+    done
+    IFS="${_ifs}"
+    ifelse([$2], , , [test -z "[$]lyx_path_$1" && lyx_path_$1="$2"])
+    ;;
+  esac])dnl
+  $1="$lyx_path_$1"
+
+  if test -n "[$]$1"; then
+    AC_MSG_RESULT([$]$1)
+  else
+    AC_MSG_RESULT(no)
+  fi
+  AC_SUBST($1)dnl
+  ])
Index: po/Makefile.in.in
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/po/Makefile.in.in,v
retrieving revision 1.9
diff -u -3 -p -r1.9 Makefile.in.in
--- po/Makefile.in.in   2000/10/24 17:53:50     1.9
+++ po/Makefile.in.in   2001/02/13 06:57:03
@@ -29,6 +29,7 @@ INSTALL_DATA = @INSTALL_DATA@
 MKINSTALLDIRS = $(top_srcdir)/@MKINSTALLDIRS@
 
 CC = @CC@
+NAWK = @NAWK@
 GENCAT = @GENCAT@
 GMSGFMT = PATH=../src:$$PATH @GMSGFMT@
 MSGFMT = @MSGFMT@
@@ -110,11 +111,11 @@ $(srcdir)/stamp-cat-id: $(PACKAGE).pot
        cd $(srcdir) && rm -f stamp-cat-id && echo timestamp > stamp-cat-id
 
 $(top_srcdir)/src/ext_l10n.h: $(top_srcdir)/lib/layouts/*.layout 
$(top_srcdir)/lib/layouts/*.inc $(top_srcdir)/lib/ui/default.ui 
$(top_srcdir)/lib/languages
-       grep -i -E "submenu|item|optitem" $(top_srcdir)/lib/ui/default.ui | cut -d '"' 
-f 2 | \
-               awk '$$0 {printf "_(\"%s\");\n", $$0}' > $@
-       grep -i -E "[ ]*style .+$$" $(top_srcdir)/lib/layouts/*.layout 
$(top_srcdir)/lib/layouts/*.inc | \
-               cut -d ' ' -f 2 | sort | uniq | awk '$$0 {printf "_(\"%s\");\n", $$0}' 
>> $@
-       awk -F '"' '$$2 {printf "_(\"%s\");\n", $$2}' $(top_srcdir)/lib/languages >> $@
+       egrep -i "submenu|item|optitem" $(top_srcdir)/lib/ui/default.ui | cut -d '"' 
+-f 2 | \
+               $(NAWK) '$$0 {printf "_(\"%s\");\n", $$0}' > $@
+       egrep -i "[ ]*style .+$$" $(top_srcdir)/lib/layouts/*.layout 
+$(top_srcdir)/lib/layouts/*.inc | \
+               cut -d ' ' -f 2 | sort | uniq | $(NAWK) '$$0 {printf "_(\"%s\");\n", 
+$$0}' >> $@
+       $(NAWK) -F '"' '$$2 {printf "_(\"%s\");\n", $$2}' $(top_srcdir)/lib/languages 
+>> $@
 
 install: install-exec install-data
 install-exec:
@@ -239,8 +240,8 @@ update-po: Makefile
 ${srcdir}/POTFILES.in: $(top_srcdir)/src/ext_l10n.h $(POTFILE_IN_DEPS)
        rm -f $@-t \
        && ( cd $(top_srcdir); \
-            grep -l -E "_\(\".*\"\)" `find src -name \*.[hHC]` | \
-            awk 'BEGIN {FS= ":"} {print $$1}' | \
+            egrep -l "_\(\".*\"\)" `find src -name \*.[hHC]` | \
+            $(NAWK) 'BEGIN {FS= ":"} {print $$1}' | \
             sed -e '/xforms.forms/d' | \
             sort -f -d | uniq ) > $@-t \
        && mv $@-t $@

Reply via email to