[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[6488] Texinfo::ModulePath
From: |
Gavin D. Smith |
Subject: |
[6488] Texinfo::ModulePath |
Date: |
Fri, 31 Jul 2015 22:50:39 +0000 |
Revision: 6488
http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=6488
Author: gavin
Date: 2015-07-31 22:50:37 +0000 (Fri, 31 Jul 2015)
Log Message:
-----------
Texinfo::ModulePath
Modified Paths:
--------------
trunk/ChangeLog
trunk/README-hacking
trunk/configure.ac
trunk/doc/Makefile.am
trunk/doc/refcard/txirefcard.pdf
trunk/man/Makefile.am
trunk/tp/Makefile.am
trunk/tp/Texinfo/Convert/Info.pm
trunk/tp/Texinfo/Convert/Plaintext.pm
trunk/tp/Texinfo/Convert/XSParagraph/Makefile.am
trunk/tp/Texinfo/Convert/XSParagraph/XSParagraph.pm
trunk/tp/Texinfo/Convert/XSParagraph/XSParagraph.xs
trunk/tp/t/paragraph.t
trunk/tp/t/test_utils.pl
trunk/tp/tests/Makefile.am
trunk/tp/tests/htmlxref/Makefile.am
trunk/tp/tests/htmlxref-only_mono/Makefile.am
trunk/tp/tests/htmlxref-only_split/Makefile.am
trunk/tp/tests/many_input_files/Makefile.am
trunk/tp/tests/many_input_files/indices.sh
trunk/tp/tests/many_input_files/tex_t4ht.sh
trunk/tp/tests/run_parser_all.sh
trunk/tp/texi2any.pl
Added Paths:
-----------
trunk/tp/Texinfo/ModulePath.pm.in
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2015-07-31 21:48:35 UTC (rev 6487)
+++ trunk/ChangeLog 2015-07-31 22:50:37 UTC (rev 6488)
@@ -1,5 +1,40 @@
2015-07-31 Gavin Smith <address@hidden>
+ * tp/Texinfo/ModulePath.pm.in: New file, to add directories to
+ module search path.
+ * configure.ac: Process it to create ModulePath.pm.
+ * tp/Makefile.am: List ModulePath.pm.in and ModulePath.pm.
+ * tp/texi2any.pl (BEGIN): Use Texinfo::ModulePath module. Don't
+ look at file extension of invoked program to decide whether to
+ use installed modules; instead, check whether strings like
+ @these@ have been substituted.
+ * README-hacking: Update advice on running uninstalled texi2any
+ scripts.
+ * tp/paragraph.t (BEGIN): Use Texinfo::ModulePath.
+ * tp/t/test_utils.t (BEGIN): Use Texinfo::ModulePath.
+
+ * tp/Texinfo/Convert/Info.pm,
+ * tp/Texinfo/Convert/Plaintext.pm,
+ * tp/Texinfo/Convert/XSParagraph/XSParagraph.pm,
+ * tp/Texinfo/Convert/XSParagraph/XSParagraph.xs,
+ * tp/t/paragraph.t: Uniformly refer to XSParagraph.pm
+ as "Texinfo::Convert::XSParagraph::XSParagraph".
+
+ * tp/Texinfo/Convert/XSParagraph/Makefile.am: Install
+ XSParagraph.pm under $(pkgdatadir)/Texinfo/Convert/XSParagraph.
+
+ * tp/tests/htmlxref/Makefile.am,
+ * tp/tests/htmlxref-only_mono/Makefile.am,
+ * tp/tests/htmlxref-only_split/Makefile.am,
+ * tp/tests/many_input_files/indices.sh,
+ * tp/tests/many_input_files/tex_t4ht.sh,
+ * tp/tests/run_parser_all.sh
+ Set AM_TESTS_ENVIRONMENT to pass 'top_srcdir', 'top_builddir'
+ onto tests. Don't specify location of directories containing
+ Perl modules with "-I" flags to Perl.
+
+2015-07-31 Gavin Smith <address@hidden>
+
* NEWS: Mention improvements in speed and memory usage for Info.
(Changes on 2015-07-31 and 2015-07-13.)
Modified: trunk/README-hacking
===================================================================
--- trunk/README-hacking 2015-07-31 21:48:35 UTC (rev 6487)
+++ trunk/README-hacking 2015-07-31 22:50:37 UTC (rev 6488)
@@ -80,11 +80,9 @@
directly. This is the original source file for the program, so it's
convenient to be able to make changes and then run it.
-To run it under a name that doesn't end in .pl, e.g., "makeinfo", you
-can use an alias, or set the environment variable TEXINFO_DEV_SOURCE to 1,
-or symlink to a trivial script along these lines:
-#!/bin/sh
-exec /YOUR/TEXINFO/CHECKOUT/tp/texi2any.pl "$@"
+To run the output "tp/texi2any" instead, you can set the environment
+variable TEXINFO_DEV_SOURCE to 1. Otherwise, it will try to use
+Texinfo's Perl modules in the installed locations.
Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac 2015-07-31 21:48:35 UTC (rev 6487)
+++ trunk/configure.ac 2015-07-31 22:50:37 UTC (rev 6488)
@@ -447,6 +447,7 @@
util/Makefile
texindex/Makefile
tp/Makefile
+ tp/Texinfo/ModulePath.pm
tp/tests/Makefile
tp/tests/many_input_files/Makefile
tp/tests/sectioning/Makefile
Modified: trunk/doc/Makefile.am
===================================================================
--- trunk/doc/Makefile.am 2015-07-31 21:48:35 UTC (rev 6487)
+++ trunk/doc/Makefile.am 2015-07-31 22:50:37 UTC (rev 6488)
@@ -18,11 +18,10 @@
info_TEXINFOS = texinfo.texi info-stnd.texi info.texi
DISTCLEANFILES = texinfo.info* info*.info*
-# Use the programs built in our distribution, taking account of possible
-# cross-compiling.
-tpdir = $(top_srcdir)/tp
-tplibdir = $(tpdir)/maintain/lib
-MAKEINFO = $(PERL) -I "$(tpdir)" -I "$(tplibdir)/libintl-perl/lib" -I
"$(tpdir)/Texinfo/Convert/XSParagraph" -I "../tp/Texinfo/Convert/XSParagraph"
-I "$(tplibdir)/Unicode-EastAsianWidth/lib" -I "$(tplibdir)/Text-Unidecode/lib"
$(top_builddir)/tp/texi2any
+MAKEINFO_ENVIRONMENT = TEXINFO_DEV_SOURCE=1 ; export TEXINFO_DEV_SOURCE ; \
+ top_srcdir="$(top_srcdir)" ; export top_srcdir ; \
+ top_builddir="$(top_builddir)" ; export top_builddir ;
+MAKEINFO = $(MAKEINFO_ENVIRONMENT) $(PERL) $(top_builddir)/tp/texi2any
# We'd also like to use something like this, but Automake calls
# "install-info" directly.
Modified: trunk/doc/refcard/txirefcard.pdf
===================================================================
(Binary files differ)
Modified: trunk/man/Makefile.am
===================================================================
--- trunk/man/Makefile.am 2015-07-31 21:48:35 UTC (rev 6487)
+++ trunk/man/Makefile.am 2015-07-31 22:50:37 UTC (rev 6488)
@@ -39,18 +39,20 @@
# Use the programs built in our distribution, taking account of possible
# cross-compiling. makeinfo needs a bunch of our included modules.
tpdir = $(top_srcdir)/tp
-MAKEINFO = $(PERL) -I "$(tpdir)" "$(tpdir)"/texi2any.pl
+MAKEINFO_ENVIRONMENT = TEXINFO_DEV_SOURCE=1 ; export TEXINFO_DEV_SOURCE ; \
+ top_srcdir="$(top_srcdir)" ; export top_srcdir ; \
+ top_builddir="$(top_srcdir)" ; export top_builddir ;
+
+MAKEINFO = $(MAKEINFO_ENVIRIONMENT) $(PERL) "$(tpdir)"/texi2any.pl
#
-tplibdir = $(tpdir)/maintain/lib
-mi_perl5lib_path =
"$(tpdir):$(tplibdir)/libintl-perl/lib:$(tplibdir)/Unicode-EastAsianWidth/lib:$(tplibdir)/Text-Unidecode/lib:../tp/Texinfo/Convert/XSParagraph:$(tpdir)/Texinfo/Convert/XSParagraph"
-mi_perl5lib = PERL5LIB=$(mi_perl5lib_path); export PERL5LIB
+mi_env = TEXINFO_DEV_SOURCE=1; export TEXINFO_DEV_SOURCE;
# Set up the variables. makeinfo, texindex are no longer a .exe(cutable).
man_rule_0 = \
exe_ext="$(EXEEXT)" \
&& program=`expr '/$@' : '.*/\(.*\)\.1'` \
&& case $$program in \
- makeinfo) dir=tp; $(mi_perl5lib); exe_ext="";; \
+ makeinfo) dir=tp; $(mi_env) exe_ext="";; \
info*) dir=info; test $$program != info || program=g$$program;; \
*install-info) dir=install-info; program=g$$program;; \
*texindex) dir=texindex; exe_ext="";; \
Modified: trunk/tp/Makefile.am
===================================================================
--- trunk/tp/Makefile.am 2015-07-31 21:48:35 UTC (rev 6487)
+++ trunk/tp/Makefile.am 2015-07-31 22:50:37 UTC (rev 6488)
@@ -64,6 +64,12 @@
Texinfo/Structuring.pm \
Texinfo/Documentlanguages.pm
+dist_noinst_DATA = \
+ Texinfo/ModulePath.pm.in
+
+modules_DATA = \
+ Texinfo/ModulePath.pm
+
convertersdir = $(pkgdatadir)/Texinfo/Convert
dist_converters_DATA = \
Texinfo/Convert/Converter.pm \
@@ -181,7 +187,7 @@
AM_T_LOG_FLAGS += -ITexinfo/Convert/XSParagraph
AM_T_LOG_FLAGS += -I$(srcdir)/Texinfo/Convert/XSParagraph
-AM_TESTS_ENVIRONMENT = srcdir="$(srcdir)"; export srcdir;
top_srcdir="$(top_srcdir)"; export top_srcdir; builddir="$(srcdir)"; export
buildir;
+AM_TESTS_ENVIRONMENT = srcdir="$(srcdir)"; export srcdir;
top_srcdir="$(top_srcdir)"; export top_srcdir; builddir="$(builddir)"; export
buildir; top_builddir="$(top_builddir)"; export top_builddir;
# just a convenience for running these additional tests.
long-checks:
Modified: trunk/tp/Texinfo/Convert/Info.pm
===================================================================
--- trunk/tp/Texinfo/Convert/Info.pm 2015-07-31 21:48:35 UTC (rev 6487)
+++ trunk/tp/Texinfo/Convert/Info.pm 2015-07-31 22:50:37 UTC (rev 6488)
@@ -304,7 +304,7 @@
my $self = shift;
$self->_set_global_multiple_commands();
- my $paragraph = XSParagraph->new();
+ my $paragraph = Texinfo::Convert::XSParagraph::XSParagraph->new();
my $result = $paragraph->add_text("This is ");
# This ensures that spaces in file are kept.
$result .= $paragraph->add_next($self->{'output_filename'});
Modified: trunk/tp/Texinfo/Convert/Plaintext.pm
===================================================================
--- trunk/tp/Texinfo/Convert/Plaintext.pm 2015-07-31 21:48:35 UTC (rev
6487)
+++ trunk/tp/Texinfo/Convert/Plaintext.pm 2015-07-31 22:50:37 UTC (rev
6488)
@@ -26,7 +26,7 @@
use Texinfo::Convert::Converter;
use Texinfo::Common;
use Texinfo::Convert::Texinfo;
-use XSParagraph;
+use Texinfo::Convert::XSParagraph::XSParagraph;
use Texinfo::Convert::Text;
use Texinfo::Convert::Line;
use Texinfo::Convert::UnFilled;
@@ -661,7 +661,8 @@
$container = Texinfo::Convert::Line->new($container_conf);
} elsif ($type eq 'paragraph') {
#$container = Texinfo::Convert::Paragraph->new($container_conf);
- $container = XSParagraph->new($container_conf);
+ $container =
+ Texinfo::Convert::XSParagraph::XSParagraph->new($container_conf);
} elsif ($type eq 'unfilled') {
$container = Texinfo::Convert::UnFilled->new($container_conf);
} else {
Modified: trunk/tp/Texinfo/Convert/XSParagraph/Makefile.am
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/Makefile.am 2015-07-31 21:48:35 UTC
(rev 6487)
+++ trunk/tp/Texinfo/Convert/XSParagraph/Makefile.am 2015-07-31 22:50:37 UTC
(rev 6488)
@@ -36,7 +36,9 @@
################### End Gnulib section #########################
-modulesdir = $(pkglibexecdir)/Texinfo
+modulesdir = $(pkgdatadir)/Texinfo/Convert/XSParagraph
+xsdir = $(pkglibexecdir)
+
dist_modules_DATA = XSParagraph.pm
EXTRA_DIST += fetch_conf.pl
@@ -59,7 +61,7 @@
# -------------------------------------------------------
-modules_LTLIBRARIES = XSParagraph.la
+xs_LTLIBRARIES = XSParagraph.la
XSParagraph_la_SOURCES = XSParagraph.c xspara.c xspara.h \
text.c text.h ppport.h
Modified: trunk/tp/Texinfo/Convert/XSParagraph/XSParagraph.pm
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/XSParagraph.pm 2015-07-31 21:48:35 UTC
(rev 6487)
+++ trunk/tp/Texinfo/Convert/XSParagraph/XSParagraph.pm 2015-07-31 22:50:37 UTC
(rev 6488)
@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-package XSParagraph;
+package Texinfo::Convert::XSParagraph::XSParagraph;
use DynaLoader;
@@ -137,7 +137,7 @@
#print STDERR "loadable object is at $dlpath\n";
-my $module = "XSParagraph";
+my $module = "Texinfo::Convert::XSParagraph::XSParagraph";
our $VERSION = '6.0';
# Following steps under "bootstrap" in "man DynaLoader".
@@ -157,7 +157,9 @@
if ($#undefined_symbols+1 != 0) {
_fatal "XSParagraph: still have undefined symbols after dl_load_file";
}
-my $symref = DynaLoader::dl_find_symbol($libref, "boot_$module");
+my $bootname = "boot_$module";
+$bootname =~ s/:/_/g;
+my $symref = DynaLoader::dl_find_symbol($libref, $bootname);
if (!$symref) {
_fatal "XSParagraph: couldn't find boot_$module symbol";
goto FALLBACK;
@@ -177,7 +179,7 @@
# be called from Perl code.
&$boot_fn($module, $VERSION);
-if (!XSParagraph::init ()) {
+if (!Texinfo::Convert::XSParagraph::XSParagraph::init ()) {
_fatal "XSParagraph: error initializing";
goto FALLBACK;
}
@@ -192,7 +194,8 @@
}
# Fall back to using the Perl code.
require Texinfo::Convert::Paragraph;
- *XSParagraph:: = *Texinfo::Convert::Paragraph::;
+ *Texinfo::Convert::XSParagraph::XSParagraph::
+ = *Texinfo::Convert::Paragraph::;
DONTFALLBACK: ;
} # end BEGIN
Modified: trunk/tp/Texinfo/Convert/XSParagraph/XSParagraph.xs
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/XSParagraph.xs 2015-07-31 21:48:35 UTC
(rev 6487)
+++ trunk/tp/Texinfo/Convert/XSParagraph/XSParagraph.xs 2015-07-31 22:50:37 UTC
(rev 6488)
@@ -10,7 +10,7 @@
#include "xspara.h"
-MODULE = XSParagraph PACKAGE = XSParagraph PREFIX = xspara_
+MODULE = Texinfo::Convert::XSParagraph::XSParagraph PACKAGE =
Texinfo::Convert::XSParagraph::XSParagraph PREFIX = xspara_
int
xspara_init ()
@@ -48,7 +48,7 @@
/* Create a new blessed hash reference, which the other functions
need as their first argument. */
/* Note that nothing is actually put in the hash yet. */
- pkg = gv_stashpv ("XSParagraph", 0);
+ pkg = gv_stashpv ("Texinfo::Convert::XSParagraph::XSParagraph", 0);
hv = newHV ();
RETVAL = newRV_inc ((SV *) hv);
sv_bless (RETVAL, pkg);
Added: trunk/tp/Texinfo/ModulePath.pm.in
===================================================================
--- trunk/tp/Texinfo/ModulePath.pm.in (rev 0)
+++ trunk/tp/Texinfo/ModulePath.pm.in 2015-07-31 22:50:37 UTC (rev 6488)
@@ -0,0 +1,64 @@
+# @configure_input@
+#
+# Add directories to @INC, Perl's module search path, to find modules,
+# either in the source or build directories.
+
+package Texinfo::ModulePath;
+use File::Spec;
+
+BEGIN {
+
+} # end BEGIN
+
+# If $LIB_DIR and $LIBEXEC_DIR are given, use them to add directories
+# to @INC (likely the installation directories), otherwise use 'top_srcdir'
+# and 'top_builddir' environment variables.
+sub init (;$$) {
+ my $lib_dir = shift;
+ my $libexec_dir = shift;
+
+ if (defined($ENV{'top_builddir'}) and !defined($ENV{'top_srcdir'})) {
+ $ENV{'top_srcdir'} = $ENV{'top_builddir'};
+ }
+
+ if (!$lib_dir) {
+ if (defined($ENV{'top_srcdir'})) {
+ # For Texinfo::Parser and the rest.
+ unshift @INC, File::Spec->catdir($ENV{'top_srcdir'}, 'tp');
+
+ $lib_dir = File::Spec->catdir($ENV{'top_srcdir'}, 'tp', 'maintain');
+ }
+ }
+
+ # module using values from configure
+ if (defined($lib_dir)) {
+ #warn "lib dir is $lib_dir\n";
+
+ unshift @INC, $lib_dir;
+
+ # '@USE_EXTERNAL_LIBINTL @ and similar are substituted
+ if ('@USE_EXTERNAL_LIBINTL@' ne 'yes') {
+ unshift @INC, (File::Spec->catdir($lib_dir, 'lib', 'libintl-perl',
'lib'));
+ }
+ if ('@USE_EXTERNAL_EASTASIANWIDTH@' ne 'yes') {
+ unshift @INC, (File::Spec->catdir($lib_dir, 'lib',
'Unicode-EastAsianWidth', 'lib'));
+ }
+ if ('@USE_EXTERNAL_UNIDECODE@' ne 'yes') {
+ unshift @INC, (File::Spec->catdir($lib_dir, 'lib', 'Text-Unidecode',
'lib'));
+ }
+ }
+
+ if (!$libexec_dir) {
+ # XSParagraph.la is generated in the build directory.
+ if (defined($ENV{'top_builddir'})) {
+ $libexec_dir = File::Spec->catdir($ENV{'top_builddir'}, 'tp',
+ 'Texinfo', 'Convert', 'XSParagraph');
+ }
+ }
+
+ if (defined($libexec_dir)) {
+ unshift @INC, (File::Spec->catdir($libexec_dir));
+ }
+}
+
+1;
Modified: trunk/tp/t/paragraph.t
===================================================================
--- trunk/tp/t/paragraph.t 2015-07-31 21:48:35 UTC (rev 6487)
+++ trunk/tp/t/paragraph.t 2015-07-31 22:50:37 UTC (rev 6488)
@@ -2,20 +2,26 @@
use Test::More;
use File::Spec;
+use File::Basename;
-BEGIN { plan tests => 127 * 2 - 45;
- if (defined($ENV{'top_srcdir'})) {
- unshift @INC, File::Spec->catdir($ENV{'top_srcdir'}, 'tp');
- my $lib_dir = File::Spec->catdir($ENV{'top_srcdir'}, 'tp',
'maintain');
- unshift @INC, (File::Spec->catdir($lib_dir, 'lib', 'libintl-perl',
'lib'),
- File::Spec->catdir($lib_dir, 'lib',
'Unicode-EastAsianWidth', 'lib'),
- File::Spec->catdir($lib_dir, 'lib', 'Text-Unidecode',
'lib'));
- }
- };
+BEGIN {
-use lib 'maintain/lib/Unicode-EastAsianWidth/lib/';
+plan tests => 127 * 2 - 45;
+
+my ($real_command_name, $command_directory, $command_suffix)
+ = fileparse($0, '.t');
+my $updir = File::Spec->updir();
+my $up = File::Spec->catdir($command_directory, $updir);
+push @INC, $up;
+if (!defined($ENV{'top_srcdir'})) {
+ $ENV{'top_srcdir'} = File::Spec->catdir($up, $updir);
+}
+require Texinfo::ModulePath;
+Texinfo::ModulePath::init();
+
+}; # end BEGIN
+
use Texinfo::Convert::Paragraph;
-use lib 'Texinfo/Convert/XSParagraph';
use Texinfo::Convert::XSParagraph::XSParagraph;
use Texinfo::Convert::Line;
use Texinfo::Convert::UnFilled;
@@ -503,7 +509,8 @@
$result .= $para->end();
is ($para->{'lines_counter'}, 2, 'count lines end paragraph');
- *Texinfo::Convert::Paragraph:: = *XSParagraph::;
+ *Texinfo::Convert::Paragraph::
+ = *Texinfo::Convert::XSParagraph::XSParagraph::;
$testing_XSParagraph = 1;
goto DOITAGAIN;
}
Modified: trunk/tp/t/test_utils.pl
===================================================================
--- trunk/tp/t/test_utils.pl 2015-07-31 21:48:35 UTC (rev 6487)
+++ trunk/tp/t/test_utils.pl 2015-07-31 22:50:37 UTC (rev 6488)
@@ -23,28 +23,26 @@
use 5.006;
-use Test::More;
+use File::Basename;
use File::Spec;
+
BEGIN {
- if (defined($ENV{'top_srcdir'})) {
- my $lib_dir = File::Spec->catdir($ENV{'top_srcdir'}, 'tp', 'maintain');
- unshift @INC,
- (File::Spec->catdir($lib_dir, 'lib', 'libintl-perl', 'lib'),
- File::Spec->catdir($lib_dir, 'lib', 'Unicode-EastAsianWidth', 'lib'),
- File::Spec->catdir($lib_dir, 'lib', 'Text-Unidecode', 'lib'),
- File::Spec->catdir($ENV{'top_srcdir'}, 'tp',
- 'Texinfo', 'Convert', 'XSParagraph'));
- }
- if (defined($ENV{'top_builddir'})) {
- unshift @INC, (File::Spec->catdir($ENV{'top_builddir'}, 'tp',
- 'Texinfo', 'Convert', 'XSParagraph'));
- }
+
+if (!$ENV{'top_srcdir'}) {
+ my ($real_command_name, $command_directory, $command_suffix)
+ = fileparse($0, '.pl');
+ my $updir = File::Spec->updir();
+
+ # tp/t -> tp/t/../..
+ $ENV{'top_srcdir'} = File::Spec->catdir($command_directory, $updir, $updir);
}
+require Texinfo::ModulePath;
+Texinfo::ModulePath::init();
-use lib 'maintain/lib/Unicode-EastAsianWidth/lib/';
-use lib 'maintain/lib/libintl-perl/lib/';
-use lib 'maintain/lib/Text-Unidecode/lib/';
-use lib 'Texinfo/Convert/XSParagraph';
+} # end BEGIN
+
+use Test::More;
+
use Texinfo::Parser;
use Texinfo::Convert::Text;
use Texinfo::Convert::Texinfo;
Modified: trunk/tp/tests/Makefile.am
===================================================================
--- trunk/tp/tests/Makefile.am 2015-07-31 21:48:35 UTC (rev 6487)
+++ trunk/tp/tests/Makefile.am 2015-07-31 22:50:37 UTC (rev 6488)
@@ -60,6 +60,8 @@
#TESTS = $(old_test_scripts)
TESTS = $(one_test_files_generated_list) $(other_tests)
+AM_TESTS_ENVIRONMENT = srcdir="$(srcdir)"; export srcdir;
top_srcdir="$(top_srcdir)"; export top_srcdir; builddir="$(builddir)"; export
buildir; top_builddir="$(top_builddir)"; export top_builddir;
+
long-checks long-check: all
$(MAKE) $(AM_MAKEFLAGS) check LONG_TESTS=yes
Modified: trunk/tp/tests/htmlxref/Makefile.am
===================================================================
--- trunk/tp/tests/htmlxref/Makefile.am 2015-07-31 21:48:35 UTC (rev 6487)
+++ trunk/tp/tests/htmlxref/Makefile.am 2015-07-31 22:50:37 UTC (rev 6488)
@@ -8,7 +8,7 @@
-base .
TESTS = $(one_test_files_generated_list)
-AM_TESTS_ENVIRONMENT =
PERL5LIB='$(top_builddir)/tp/Texinfo/Convert/XSParagraph'; export PERL5LIB;
+AM_TESTS_ENVIRONMENT = srcdir="$(srcdir)"; export srcdir;
top_srcdir="$(top_srcdir)"; export top_srcdir; builddir="$(builddir)"; export
buildir; top_builddir="$(top_builddir)"; export top_builddir;
copy-tests:
$(srcdir)/../run_parser_all.sh -copy
Modified: trunk/tp/tests/htmlxref-only_mono/Makefile.am
===================================================================
--- trunk/tp/tests/htmlxref-only_mono/Makefile.am 2015-07-31 21:48:35 UTC
(rev 6487)
+++ trunk/tp/tests/htmlxref-only_mono/Makefile.am 2015-07-31 22:50:37 UTC
(rev 6488)
@@ -8,7 +8,7 @@
-base .
TESTS = $(one_test_files_generated_list)
-AM_TESTS_ENVIRONMENT =
PERL5LIB='$(top_builddir)/tp/Texinfo/Convert/XSParagraph'; export PERL5LIB;
+AM_TESTS_ENVIRONMENT = srcdir="$(srcdir)"; export srcdir;
top_srcdir="$(top_srcdir)"; export top_srcdir; builddir="$(builddir)"; export
buildir; top_builddir="$(top_builddir)"; export top_builddir;
copy-tests:
$(srcdir)/../run_parser_all.sh -copy
Modified: trunk/tp/tests/htmlxref-only_split/Makefile.am
===================================================================
--- trunk/tp/tests/htmlxref-only_split/Makefile.am 2015-07-31 21:48:35 UTC
(rev 6487)
+++ trunk/tp/tests/htmlxref-only_split/Makefile.am 2015-07-31 22:50:37 UTC
(rev 6488)
@@ -8,7 +8,7 @@
-base .
TESTS = $(one_test_files_generated_list)
-AM_TESTS_ENVIRONMENT =
PERL5LIB='$(top_builddir)/tp/Texinfo/Convert/XSParagraph'; export PERL5LIB;
+AM_TESTS_ENVIRONMENT = srcdir="$(srcdir)"; export srcdir;
top_srcdir="$(top_srcdir)"; export top_srcdir; builddir="$(builddir)"; export
buildir; top_builddir="$(top_builddir)"; export top_builddir;
copy-tests:
$(srcdir)/../run_parser_all.sh -copy
Modified: trunk/tp/tests/many_input_files/Makefile.am
===================================================================
--- trunk/tp/tests/many_input_files/Makefile.am 2015-07-31 21:48:35 UTC (rev
6487)
+++ trunk/tp/tests/many_input_files/Makefile.am 2015-07-31 22:50:37 UTC (rev
6488)
@@ -14,7 +14,7 @@
indices_res index_split_res tex_l2h_res tex_t4ht_res
TESTS = indices.sh tex_l2h.sh tex_t4ht.sh
-AM_TESTS_ENVIRONMENT =
PERL5LIB='$(top_builddir)/tp/Texinfo/Convert/XSParagraph'; export PERL5LIB;
+AM_TESTS_ENVIRONMENT = srcdir="$(srcdir)"; export srcdir;
top_srcdir="$(top_srcdir)"; export top_srcdir; builddir="$(builddir)"; export
buildir; top_builddir="$(top_builddir)"; export top_builddir;
test_dirs = indices index_split
tex_html_dirs = tex_l2h tex_t4ht
Modified: trunk/tp/tests/many_input_files/indices.sh
===================================================================
--- trunk/tp/tests/many_input_files/indices.sh 2015-07-31 21:48:35 UTC (rev
6487)
+++ trunk/tp/tests/many_input_files/indices.sh 2015-07-31 22:50:37 UTC (rev
6488)
@@ -26,8 +26,8 @@
[ -d index_split ] && rm -rf index_split
[ -d $basename ] && rm -rf $basename
mkdir $basename
-echo "$PERL -I $srcdir/../.. -I
$srcdir/../../maintain/lib/Unicode-EastAsianWidth/lib/ -I
$srcdir/../../maintain/lib/libintl-perl/lib -I
$srcdir/../../maintain/lib/Text-Unidecode/lib/ -w $srcdir/../../texi2any.pl
--set-customization-variable 'TEXI2HTML 1' --conf-dir $srcdir/../indices/
--set-customization-variable 'TEST 1' --split chapter --out $basename/
$srcdir/../indices/index_table.texi $srcdir/../indices/index_split.texi --force
>> $stdout_file 2>$basename/${basename}.2" >> $logfile
-$PERL -I $srcdir/../.. -I
$srcdir/../../maintain/lib/Unicode-EastAsianWidth/lib/ -I
$srcdir/../../maintain/lib/libintl-perl/lib -I
$srcdir/../../maintain/lib/Text-Unidecode/lib/ -w $srcdir/../../texi2any.pl
--set-customization-variable 'TEXI2HTML 1' --conf-dir $srcdir/../indices/
--set-customization-variable 'TEST 1' --split chapter --out $basename/
$srcdir/../indices/index_table.texi $srcdir/../indices/index_split.texi --force
>> $stdout_file 2>$basename/${basename}.2
+echo "$PERL -w $srcdir/../../texi2any.pl --set-customization-variable
'TEXI2HTML 1' --conf-dir $srcdir/../indices/ --set-customization-variable 'TEST
1' --split chapter --out $basename/ $srcdir/../indices/index_table.texi
$srcdir/../indices/index_split.texi --force >> $stdout_file
2>$basename/${basename}.2" >> $logfile
+$PERL -w $srcdir/../../texi2any.pl --set-customization-variable 'TEXI2HTML 1'
--conf-dir $srcdir/../indices/ --set-customization-variable 'TEST 1' --split
chapter --out $basename/ $srcdir/../indices/index_table.texi
$srcdir/../indices/index_split.texi --force >> $stdout_file
2>$basename/${basename}.2
ret=$?
if [ $ret != 0 ]; then
Modified: trunk/tp/tests/many_input_files/tex_t4ht.sh
===================================================================
--- trunk/tp/tests/many_input_files/tex_t4ht.sh 2015-07-31 21:48:35 UTC (rev
6487)
+++ trunk/tp/tests/many_input_files/tex_t4ht.sh 2015-07-31 22:50:37 UTC (rev
6488)
@@ -35,8 +35,8 @@
raw_outdir=$raw_output_dir/$basename
[ -d $raw_outdir ] && rm -rf $raw_outdir
mkdir $basename
-echo "$PERL -I $srcdir/../.. -I
$srcdir/../../maintain/lib/Unicode-EastAsianWidth/lib/ -I
$srcdir/../../maintain/lib/libintl-perl/lib -I
$srcdir/../../maintain/lib/Text-Unidecode/lib/ -w $srcdir/../../texi2any.pl
--set-customization-variable 'TEXI2HTML 1' --set-customization-variable 'TEST
1' --conf-dir $srcdir/../../init --init-file tex4ht.pm --iftex --out $basename/
$srcdir/../tex_html/tex_complex.texi $srcdir/../tex_html/tex.texi --force >>
$stdout_file 2>$basename/${basename}.2" >> $logfile
-$PERL -I $srcdir/../.. -I
$srcdir/../../maintain/lib/Unicode-EastAsianWidth/lib/ -I
$srcdir/../../maintain/lib/libintl-perl/lib -I
$srcdir/../../maintain/lib/Text-Unidecode/lib/ -w $srcdir/../../texi2any.pl
--set-customization-variable 'TEXI2HTML 1' --set-customization-variable 'TEST
1' --conf-dir $srcdir/../../init --init-file tex4ht.pm --iftex --out $basename/
$srcdir/../tex_html/tex_complex.texi $srcdir/../tex_html/tex.texi --force >>
$stdout_file 2>$basename/${basename}.2
+echo "$PERL -w $srcdir/../../texi2any.pl --set-customization-variable
'TEXI2HTML 1' --set-customization-variable 'TEST 1' --conf-dir
$srcdir/../../init --init-file tex4ht.pm --iftex --out $basename/
$srcdir/../tex_html/tex_complex.texi $srcdir/../tex_html/tex.texi --force >>
$stdout_file 2>$basename/${basename}.2" >> $logfile
+$PERL -w $srcdir/../../texi2any.pl --set-customization-variable 'TEXI2HTML 1'
--set-customization-variable 'TEST 1' --conf-dir $srcdir/../../init --init-file
tex4ht.pm --iftex --out $basename/ $srcdir/../tex_html/tex_complex.texi
$srcdir/../tex_html/tex.texi --force >> $stdout_file 2>$basename/${basename}.2
return_code=0
ret=$?
Modified: trunk/tp/tests/run_parser_all.sh
===================================================================
--- trunk/tp/tests/run_parser_all.sh 2015-07-31 21:48:35 UTC (rev 6487)
+++ trunk/tp/tests/run_parser_all.sh 2015-07-31 22:50:37 UTC (rev 6488)
@@ -274,7 +274,7 @@
# @setfilename
echo "$command $dir" >>$logfile
#echo "$dir($format)"
- cmd="$prepended_command $PERL -w -I $srcdir/../ -I
$srcdir/../maintain/lib/Unicode-EastAsianWidth/lib/ -I
$srcdir/../maintain/lib/libintl-perl/lib/ -I
$srcdir/../maintain/lib/Text-Unidecode/lib/ -I
../../tp/Texinfo/Convert/XSParagraph -I
$srcdir/tp/Texinfo/Convert/XSParagraph/lib $command_run $format_option --force
--conf-dir $srcdir/../t/init/ --conf-dir $srcdir/../init --error-limit=1000
--set-customization-variable TEST=1 --set-customization-variable L2H_CLEAN=0
--output ${outdir}$dir/ -I $testdir/ -I $srcdir/
--set-customization-variable=DUMP_TEXI=1
--macro-expand=${outdir}$dir/$basename.texi $remaining_out_dir $src_file
2>${outdir}$dir/$basename.2" >> $logfile
+ cmd="$prepended_command $PERL -w $command_run $format_option --force
--conf-dir $srcdir/../t/init/ --conf-dir $srcdir/../init --error-limit=1000
--set-customization-variable TEST=1 --set-customization-variable L2H_CLEAN=0
--output ${outdir}$dir/ -I $testdir/ -I $srcdir/
--set-customization-variable=DUMP_TEXI=1
--macro-expand=${outdir}$dir/$basename.texi $remaining_out_dir $src_file
2>${outdir}$dir/$basename.2" >> $logfile
echo "$cmd" >>$logfile
eval $cmd
ret=$?
@@ -325,7 +325,7 @@
mkdir "${outdir}$dir"
remaining_out_dir=`echo $remaining | sed
's,@OUT_DIR@,'"${outdir}$dir/"',g'`
echo "$command $dir -> ${outdir}$dir" >> $logfile
- cmd="$prepended_command $PERL -w -I $srcdir/../ -I
$srcdir/../maintain/lib/Unicode-EastAsianWidth/lib/ -I
$srcdir/../maintain/lib/libintl-perl/lib/ -I
$srcdir/../maintain/lib/Text-Unidecode/lib/ -I
../../tp/Texinfo/Convert/XSParagraph -I
$srcdir/tp/Texinfo/Convert/XSParagraph/lib $command_run $format_option --force
--conf-dir $srcdir/../t/init/ --conf-dir $srcdir/../init -I $testdir/ -I
$srcdir/ --set-customization-variable L2H_FILE=$srcdir/../t/init/l2h.init
--error-limit=1000 --set-customization-variable TEST=1
--set-customization-variable L2H_CLEAN=0 $l2h_tmp_dir --output ${outdir}$dir/
$remaining_out_dir $src_file > ${outdir}$dir/$basename.1
2>${outdir}$dir/$basename.2"
+ cmd="$prepended_command $PERL -w $command_run $format_option --force
--conf-dir $srcdir/../t/init/ --conf-dir $srcdir/../init -I $testdir/ -I
$srcdir/ --set-customization-variable L2H_FILE=$srcdir/../t/init/l2h.init
--error-limit=1000 --set-customization-variable TEST=1
--set-customization-variable L2H_CLEAN=0 $l2h_tmp_dir --output ${outdir}$dir/
$remaining_out_dir $src_file > ${outdir}$dir/$basename.1
2>${outdir}$dir/$basename.2"
echo "$cmd" >>$logfile
eval $cmd
ret=$?
Modified: trunk/tp/texi2any.pl
===================================================================
--- trunk/tp/texi2any.pl 2015-07-31 21:48:35 UTC (rev 6487)
+++ trunk/tp/texi2any.pl 2015-07-31 22:50:37 UTC (rev 6488)
@@ -49,68 +49,47 @@
$^W = 1;
my ($real_command_name, $command_directory, $command_suffix)
= fileparse($0, '.pl');
+ my $updir = File::Spec->updir();
# These are substituted by the Makefile to create "texi2any".
my $datadir = '@datadir@';
my $package = '@PACKAGE@';
my $packagedir = '@pkglibexecdir@/Texinfo';
- my $updir = File::Spec->updir();
+ if ($datadir eq '@' .'datadir@' or $package eq '@' . 'PACKAGE@'
+ or $packagedir eq '@' .'pkglibexecdir@/Texinfo'
+ or defined($ENV{'TEXINFO_DEV_SOURCE'})
+ and $ENV{'TEXINFO_DEV_SOURCE'} ne '0')
+ {
+ if (!defined($ENV{'top_builddir'})) {
+ $ENV{'top_builddir'} = File::Spec->catdir($command_directory, $updir);
+ }
+ # In-source run.
+ #warn "in source\n";
+ my $lib_dir = File::Spec->catdir($ENV{'top_builddir'}, 'tp');
- my $texinfolibdir;
- my $lib_dir;
+ unshift @INC, $lib_dir;
- # in-source run
- if (($command_suffix eq '.pl' and !(defined($ENV{'TEXINFO_DEV_SOURCE'})
- and $ENV{'TEXINFO_DEV_SOURCE'} eq 0)) or $ENV{'TEXINFO_DEV_SOURCE'}) {
- if (defined($ENV{'top_srcdir'})) {
- $texinfolibdir = File::Spec->catdir($ENV{'top_srcdir'}, 'tp');
- } else {
- $texinfolibdir = $command_directory;
- }
- $lib_dir = File::Spec->catdir($texinfolibdir, 'maintain');
- unshift @INC, $texinfolibdir;
+ require Texinfo::ModulePath;
+ Texinfo::ModulePath::init();
+ } else {
+ # Look for modules in their installed locations.
- # For XSParagraph.pm, XSParagraph.la, and XSParagraph.so.
- push @INC, "${texinfolibdir}Texinfo/Convert/XSParagraph";
- } elsif ($datadir ne '@' .'datadir@' and $package ne '@' . 'PACKAGE@'
- and $packagedir ne '@' .'pkglibexecdir@/Texinfo'
- and $datadir ne '') {
- $texinfolibdir = File::Spec->catdir($datadir, $package);
- # try to make package relocatable, will only work if standard relative
paths
- # are used
- if (! -f File::Spec->catfile($texinfolibdir, 'Texinfo', 'Parser.pm')
+ my $lib_dir = File::Spec->catdir($datadir, $package);
+
+ # try to make package relocatable, will only work if
+ # standard relative paths are used
+ if (! -f File::Spec->catfile($lib_dir, 'Texinfo', 'Parser.pm')
and -f File::Spec->catfile($command_directory, $updir, 'share',
'texinfo', 'Texinfo', 'Parser.pm')) {
- $texinfolibdir = File::Spec->catdir($command_directory, $updir,
+ $lib_dir = File::Spec->catdir($command_directory, $updir,
'share', 'texinfo');
}
- $lib_dir = $texinfolibdir;
- #unshift @INC, $texinfolibdir;
- # the directory where modules are searched for is placed last
- # in @INC, as we do not want to take precedence over perl -I
- # arguments. It unfortunatly means that system directories are
- # searched for before the installation directories. This could
- # cause trouble if the modules are separately installed.
- push @INC, $texinfolibdir;
+ unshift @INC, $lib_dir;
- # For XSParagraph.pm and XSParagraph.so.
- push @INC, $packagedir;
+ require Texinfo::ModulePath;
+ Texinfo::ModulePath::init($lib_dir, $packagedir);
}
-
- # '@USE_EXTERNAL_LIBINTL @ and similar are substituted in the
- # makefile using values from configure
- if (defined($texinfolibdir)) {
- if ('@USE_EXTERNAL_LIBINTL@' ne 'yes') {
- unshift @INC, (File::Spec->catdir($lib_dir, 'lib', 'libintl-perl',
'lib'));
- }
- if ('@USE_EXTERNAL_EASTASIANWIDTH@' ne 'yes') {
- unshift @INC, (File::Spec->catdir($lib_dir, 'lib',
'Unicode-EastAsianWidth', 'lib'));
- }
- if ('@USE_EXTERNAL_UNIDECODE@' ne 'yes') {
- unshift @INC, (File::Spec->catdir($lib_dir, 'lib', 'Text-Unidecode',
'lib'));
- }
- }
} # end BEGIN
use Locale::Messages;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [6488] Texinfo::ModulePath,
Gavin D. Smith <=