texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[6022] build and use awk texindex instead of C


From: karl
Subject: [6022] build and use awk texindex instead of C
Date: Tue, 06 Jan 2015 23:46:54 +0000

Revision: 6022
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=6022
Author:   karl
Date:     2015-01-06 23:46:52 +0000 (Tue, 06 Jan 2015)
Log Message:
-----------
build and use awk texindex instead of C

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/Makefile.am
    trunk/configure.ac
    trunk/texindex/ChangeLog
    trunk/texindex/README
    trunk/texindex/ti.twjr
    trunk/util/Makefile.am

Added Paths:
-----------
    trunk/texindex/Makefile.am
    trunk/texindex/alt.mak
    trunk/texindex/dek_idx.png
    trunk/texindex/texindex.in

Removed Paths:
-------------
    trunk/texindex/GNUmakefile
    trunk/texindex/donald_knuth.png

Property Changed:
----------------
    trunk/texindex/

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2015-01-05 23:28:25 UTC (rev 6021)
+++ trunk/ChangeLog     2015-01-06 23:46:52 UTC (rev 6022)
@@ -1,3 +1,13 @@
+2015-01-05  Karl Berry  <address@hidden>
+
+       * configure.ac (AC_CONFIG_FILES): add texindex/Makefile.
+       * Makefile.am (SUBDIRS): add texindex.
+       (po-check): also look at *.twjr.
+       * util/Makefile.am (bin_PROGRAMS): remove, we'll no longer build
+       the C texindex.
+
+       * texindex/ti.twjr: --help formatting.
+       
 2015-01-03  Gavin Smith  <address@hidden>
 
        * info/session.c (point_forward_char, point_backward_char): 

Modified: trunk/Makefile.am
===================================================================
--- trunk/Makefile.am   2015-01-05 23:28:25 UTC (rev 6021)
+++ trunk/Makefile.am   2015-01-06 23:46:52 UTC (rev 6022)
@@ -3,7 +3,7 @@
 # Process this file with automake to produce Makefile.in in all directories.
 #
 # Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
-# 2012, 2013 Free Software Foundation, Inc.
+# 2012, 2013, 2014, 2015 Free Software Foundation, Inc.
 #
 # This file is free software; as a special exception the author gives
 # unlimited permission to copy and/or distribute it, with or without
@@ -55,7 +55,7 @@
   SUBDIRS += info
 endif
 endif
-  SUBDIRS += install-info po po_document tp Pod-Simple-Texinfo util \
+  SUBDIRS += install-info po po_document tp Pod-Simple-Texinfo texindex util \
              doc man
 endif
 
@@ -93,7 +93,7 @@
             tp/maintain/* ) continue;;                                 \
            esac;                                                       \
            case $$file in                                              \
-           *.[ch] | *.p[lm])                                           \
+           *.[ch] | *.p[lm] | *.twjr)                                  \
              base=`expr " $$file" : ' \(.*\)\..'`;                     \
              { test -f $$base.l || test -f $$base.y; } && continue;;   \
            esac;                                                       \

Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac  2015-01-05 23:28:25 UTC (rev 6021)
+++ trunk/configure.ac  2015-01-06 23:46:52 UTC (rev 6022)
@@ -2,7 +2,7 @@
 # $Id$
 #
 # Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
-# 2012, 2013, 2014 Free Software Foundation, Inc.
+# 2012, 2013, 2014, 2015 Free Software Foundation, Inc.
 #
 # This file is free software; as a special exception the author gives
 # unlimited permission to copy and/or distribute it, with or without
@@ -47,8 +47,6 @@
 
 # We need Perl
 AC_ARG_VAR([PERL], [The path to the 'perl' executable.])
-dnl AC_PATH_PROG([PERL], [perl], [/usr/bin/env perl], [/opt/perl5/bin:"$PATH"])
-
 AC_PATH_PROG([PERL], [perl])
 if test -z "$PERL"; then
    AC_MSG_ERROR(
@@ -59,7 +57,6 @@
 ])
 fi
 
-
 AC_MSG_CHECKING([Perl version and Encode module])
 if $PERL -e "use 5.007_003; use Encode;" > /dev/null 2>&1; then
   perl_version_requirement='yes'
@@ -445,6 +442,7 @@
   po/Makefile.in
   po_document/Makefile.in
   util/Makefile
+  texindex/Makefile
   tp/Makefile
   tp/tests/Makefile
   tp/tests/many_input_files/Makefile


Property changes on: trunk/texindex
___________________________________________________________________
Modified: svn:ignore
   - texindex.awk
texindex.awk.in
ti.pdf
ti.t2p
ti.texi
texindex.html
texindex.info

   + texindex.awk
texindex.awk.in
ti.pdf
ti.t2p
ti.texi
texindex.html
texindex.info
Makefile
Makefile.in
texindex


Modified: trunk/texindex/ChangeLog
===================================================================
--- trunk/texindex/ChangeLog    2015-01-05 23:28:25 UTC (rev 6021)
+++ trunk/texindex/ChangeLog    2015-01-06 23:46:52 UTC (rev 6022)
@@ -1,3 +1,11 @@
+2015-01-06  Karl Berry  <address@hidden>
+
+       first merge into automake:
+       * texindex/Makefile.am: new file.
+       * texindex/texindex.in: new file.
+       * texindex/README: update.
+       (see also ../ChangeLog.)
+
 2014-12-30         Arnold D. Robbins     <address@hidden>
 
        * ti.twjr: Remove address@hidden on'. It's now
@@ -78,7 +86,7 @@
 2014-02-26         Arnold D. Robbins     <address@hidden>
 
        * ti.twjr: Sorting in and seems to work well. Still need to add
-       more descriptive prose.  Did some cleanup and added menues.
+       more descriptive prose.  Did some cleanup and added menus.
 
 2014-02-25         Arnold D. Robbins     <address@hidden>
 
@@ -87,3 +95,9 @@
 2014-02-24         Arnold D. Robbins     <address@hidden>
 
        * ti.twjr, texinfo.tex, Makefile: Initial check-in.
+
+Copyright 2014, 2015 Free Software Foundation, Inc.
+
+Copying and distribution of this file, with or without modification,
+are permitted in any medium without royalty provided the copyright
+notice and this notice are preserved.

Deleted: trunk/texindex/GNUmakefile
===================================================================
--- trunk/texindex/GNUmakefile  2015-01-05 23:28:25 UTC (rev 6021)
+++ trunk/texindex/GNUmakefile  2015-01-06 23:46:52 UTC (rev 6022)
@@ -1,23 +0,0 @@
-SOURCE = ti.twjr
-TEXI = ti.texi
-AWK = texindex.awk
-
-all: $(AWK) html ti.pdf
-
-$(TEXI): $(SOURCE)
-       rm -f $@; $(GAWK) ./jrweave $(SOURCE) >$(TEXI) || rm -f $@; chmod a-w $@
-
-$(AWK): $(SOURCE)
-       rm -f $@; ./jrtangle $(SOURCE) || rm -f $@
-
-ti.pdf: $(TEXI)
-       texi2dvi --pdf --build-dir=ti.t2p -o ti.pdf $(TEXI)
-
-html: texindex.html
-
-texindex.html: $(TEXI)
-       makeinfo --no-split --html $(TEXI)
-
-check: $(AWK)
-       texindex $(ttests)/idxmarkup.cp
-       cat $(ttests)/idxmarkup.cps

Added: trunk/texindex/Makefile.am
===================================================================
--- trunk/texindex/Makefile.am                          (rev 0)
+++ trunk/texindex/Makefile.am  2015-01-06 23:46:52 UTC (rev 6022)
@@ -0,0 +1,59 @@
+# $Id$
+# Makefile.am for texinfo/texindex.
+# Run automake in .. to produce Makefile.in from this.
+#
+# Copyright 2015 Free Software Foundation, Inc.
+#
+# This file is free software; as a special exception the author gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# basic plan: what users invoke will be texindex, a shell script wrapper
+# for texindex.awk.
+# 
+# texindex will be created from texindex.in by configure.
+# texindex.awk will be created from ti.twjr by the maintainer (before
+# make dist), using the texiwebjr system.
+
+# what we want installed in $(bindir).
+dist_bin_SCRIPTS = texindex
+
+# since it's generated, have to clean it explicitly.
+CLEANFILES = texindex
+
+# and mention the original source explicitly.
+EXTRA_DIST = texindex.in
+
+# we'll put the awk script in $(sharedir)/texinfo.
+dist_pkgdata_SCRIPTS = texindex.awk
+
+# since we generate it, have to clean it (at maintainer-clean) explicitly.
+MAINTAINERCLEANFILES = texindex.awk
+
+# mention the texiwebjr utilities. they are maintained in another
+# repository (see their sources), and updated here manually (see
+# ../util/srclist.txt).
+noinst_SCRIPTS = jrtangle jrweave
+
+# configure-time variables we use in texindex.in.
+do_subst = sed -e 's,address@hidden@],$(pkgdatadir),g' \
+               -e 's,address@hidden@],$(AWK),g' \
+               -e 's,address@hidden@],$(PACKAGE),g' \
+               -e 's,address@hidden@],$(VERSION),g'
+
+# build the texindex shell wrapper from texindex.in, following automake.
+texindex: texindex.in Makefile
+       $(do_subst) < $(srcdir)/texindex.in > texindex
+       chmod +x texindex
+
+# build texindex.awk from ti.twjr using jrtangle.
+texindex.awk: ti.twjr
+       $(AWK) -f $(srcdir)/jrtangle $(srcdir)/ti.twjr > texindex.awk \
+       || rm -f texindex.awk
+
+# just a fun cartoon used in the literate document.
+EXTRA_DIST += donald_knuth.png


Property changes on: trunk/texindex/Makefile.am
___________________________________________________________________
Added: svn:keywords
   + Date Author Id
Added: svn:eol-style
   + native

Modified: trunk/texindex/README
===================================================================
--- trunk/texindex/README       2015-01-05 23:28:25 UTC (rev 6021)
+++ trunk/texindex/README       2015-01-06 23:46:52 UTC (rev 6022)
@@ -1,15 +1,20 @@
 $Id$
 
-This is texindex.awk, a replacement version of the texindex.c program
-from Texinfo. It's written in a literate style using TexiWebJr.
+This is texindex.awk, a replacement for the texindex.c implementation
+previously used in Texinfo.  It's written in a literate style using TexiWebJr.
 
 ChangeLog              -- What it looks like
-Makefile               -- What it looks like
+Makefile.am            -- What it looks like
 README                 -- What it looks like
 donald_knuth.png       -- A cute cartoon
 jrtangle               -- TexiWeb Jr tangle program
 jrweave                        -- TexiWeb Jr weave program
-texindex.awk           -- The program (created from ti.twjr)
+texindex.in            -- texindex shell script wrapper, for automake
+ti.twjr                        -- TexiWeb Jr source file
+
+texindex (shell wrapper) is created from texindex.in, and
+texindex.awk (the program) is created from ti.twjr.
+
 tests/gawk.cp          -- Gawk manual unsorted index, test input
 tests/gawk.cps-cvers   -- Output of same from C version
 tests/gawk.cps-good    -- Output of same from awk version
@@ -20,4 +25,3 @@
 tests/texinfo.fns-cvers        -- Output of same from C version
 tests/texinfo.fns-good -- Output of same from awk version
 tests/texinfo.tex      -- What it looks like
-ti.twjr                        -- TexiWeb Jr source file

Copied: trunk/texindex/alt.mak (from rev 6020, trunk/texindex/GNUmakefile)
===================================================================
--- trunk/texindex/alt.mak                              (rev 0)
+++ trunk/texindex/alt.mak      2015-01-06 23:46:52 UTC (rev 6022)
@@ -0,0 +1,23 @@
+SOURCE = ti.twjr
+TEXI = ti.texi
+AWK = texindex.awk
+
+all: $(AWK) html ti.pdf
+
+$(TEXI): $(SOURCE)
+       rm -f $@; $(GAWK) ./jrweave $(SOURCE) >$(TEXI) || rm -f $@; chmod a-w $@
+
+$(AWK): $(SOURCE)
+       rm -f $@; ./jrtangle $(SOURCE) || rm -f $@
+
+ti.pdf: $(TEXI)
+       texi2dvi --pdf --build-dir=ti.t2p -o ti.pdf $(TEXI)
+
+html: texindex.html
+
+texindex.html: $(TEXI)
+       makeinfo --no-split --html $(TEXI)
+
+check: $(AWK)
+       texindex $(ttests)/idxmarkup.cp
+       cat $(ttests)/idxmarkup.cps

Copied: trunk/texindex/dek_idx.png (from rev 6020, 
trunk/texindex/donald_knuth.png)
===================================================================
(Binary files differ)

Deleted: trunk/texindex/donald_knuth.png
===================================================================
(Binary files differ)

Added: trunk/texindex/texindex.in
===================================================================
--- trunk/texindex/texindex.in                          (rev 0)
+++ trunk/texindex/texindex.in  2015-01-06 23:46:52 UTC (rev 6022)
@@ -0,0 +1,73 @@
+#!/bin/sh
+# $Id$
+# Shell wrapper for the texindex.awk program.  This is the most
+# convenient way to support --options; with a #! line, it is (g)awk
+# itself that interprets the options.  We want texindex --version
+# to report texindex's version number, not gawk's.
+# 
+# So our job here is to (a) find the awk interpreter,
+# and (b) find the texindex.awk script file.
+
+mydir=`cd \`dirname $0\` && pwd`
+
+# 
+# allow user override for awk program location.
+awk_binary=
+awk_envvar=$TEXINDEX_AWK
+if test -n "$awk_envvar"; then
+  if test -s "$awk_envvar"; then
+    awk_binary=$awk_envvar
+  else
+    echo "$0: TEXINDEX_AWK environment variable set, but value" >&2
+    echo "$0: is not a readable non-empty file; ignoring: $awk_envvar" >&2
+  fi
+fi
+#
+# else use configured value for awk.
+if test -z "$awk_binary"; then
+  awk_configured="@AWK@"
+fi
+#
+# that should never be empty, but just in case, else fall back to plain
+# "awk".  (Let's not go to the trouble of searching PATH unless we get
+# reports of problems.)
+test -z "$awk_binary" && awk_binary=awk
+
+
+# 
+# finding the texindex.awk script file ...
+ti_script=
+#
+# allow user override for script location:
+ti_envvar=$TEXINDEX_SCRIPT
+if test -n "$ti_envvar"; then
+  if test -s "$ti_envvar"; then
+    ti_script=$ti_envvar
+  else
+    echo "$0: TEXINDEX_SCRIPT environment variable set, but value" >&2
+    echo "$0: is not a readable non-empty file; ignoring: $ti_script" >&2
+  fi
+fi
+#
+# else if script is in the same directory as us (development tree), use it:
+test -z "$ti_script" && test -s "$mydir/texindex.awk" \
+&& ti_script=$mydir/texindex.awk
+#
+# else look for script in pkgdatadir.
+if test -z "$ti_script"; then
+  pkgdatadir_configured="@pkgdatadir@"
+  test -s "$pkgdatadir_configured/texindex.awk" \
+  && ti_script=$pkgdatadir_configured/texindex.awk
+fi
+#
+# could also look relative to $mydir, but again, let's wait for user reports.
+#
+# didn't find it, abort.
+if test -z "$ti_script"; then
+  echo "$0: could not locate texindex.awk script file, quitting." >&2
+  echo "$0: (checked envvar TEXINDEX_SCRIPT, executable dir $mydir," >&2
+  echo "$0:  and configured pkgdatadir $pkgdatadir_configured.)"  >&2
+  exit 1
+fi
+
+exec $awk_binary -f $ti_script -- "$@"


Property changes on: trunk/texindex/texindex.in
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:keywords
   + Date Author Id
Added: svn:eol-style
   + native

Modified: trunk/texindex/ti.twjr
===================================================================
--- trunk/texindex/ti.twjr      2015-01-05 23:28:25 UTC (rev 6021)
+++ trunk/texindex/ti.twjr      2015-01-06 23:46:52 UTC (rev 6022)
@@ -304,7 +304,7 @@
 EXIT_SUCCESS = 0
 EXIT_FAILURE = 1
 
-Prgname = ARGV[0]
+Prgname = "texindex"  # ARGV[0] is "awk"
 Texindex_Version = "5.2+dev"
 
 Can_split_null = check_split_null()
@@ -1230,14 +1230,14 @@
 @<Helper functions@>=
 function usage(exit_val)
 {
-  printf(_"Usage: %s [OPTION]... FILE...", Prgname)
+  printf(_"Usage: %s [OPTION]... FILE...\n", Prgname)
   print _"Generate a sorted index for each TeX output FILE."
   print _"Usually FILE... is specified as `foo.??' for a document `foo.texi'."
   print ""
   print _"Options:"
   print _" -h, --help   display this help and exit"
-  print _" --version   display version information and exit"
-  print _" --    end option processing"
+  print _" --version    display version information and exit"
+  print _" --           end option processing"
   print ""
   print _"Email bug reports to address@hidden,"
   print _"general questions and discussion to address@hidden"

Modified: trunk/util/Makefile.am
===================================================================
--- trunk/util/Makefile.am      2015-01-05 23:28:25 UTC (rev 6021)
+++ trunk/util/Makefile.am      2015-01-06 23:46:52 UTC (rev 6022)
@@ -2,7 +2,7 @@
 # Makefile.am for texinfo/util.
 # Run automake in .. to produce Makefile.in from this.
 #
-# Copyright 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014
+# Copyright 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
 # Free Software Foundation, Inc.
 #
 # This file is free software; as a special exception the author gives
@@ -13,7 +13,6 @@
 # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
-bin_PROGRAMS = texindex
 bin_SCRIPTS = texi2dvi texi2pdf pdftexi2dvi
 nodist_noinst_SCRIPTS = txixml2texi
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]