Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package perl-Term-ReadLine-Gnu for
openSUSE:Factory checked in at 2021-05-04 22:01:23
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Term-ReadLine-Gnu (Old)
and /work/SRC/openSUSE:Factory/.perl-Term-ReadLine-Gnu.new.2988 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Term-ReadLine-Gnu"
Tue May 4 22:01:23 2021 rev:4 rq:890407 version:1.41
Changes:
--------
---
/work/SRC/openSUSE:Factory/perl-Term-ReadLine-Gnu/perl-Term-ReadLine-Gnu.changes
2021-02-26 21:59:24.399818461 +0100
+++
/work/SRC/openSUSE:Factory/.perl-Term-ReadLine-Gnu.new.2988/perl-Term-ReadLine-Gnu.changes
2021-05-04 22:01:36.200462186 +0200
@@ -1,0 +2,11 @@
+Sun May 2 03:08:40 UTC 2021 - Tina M??ller <[email protected]>
+
+- updated to 1.41
+ see /usr/share/doc/packages/perl-Term-ReadLine-Gnu/Changes
+
+ 1.41 2021-05-01
+ - Makefile.PL
+ - Search a terminal library only when it necessary. [#6]
+ - whole refactoring
+
+-------------------------------------------------------------------
Old:
----
Term-ReadLine-Gnu-1.40.tar.gz
New:
----
Term-ReadLine-Gnu-1.41.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-Term-ReadLine-Gnu.spec ++++++
--- /var/tmp/diff_new_pack.TYvzrV/_old 2021-05-04 22:01:36.656460472 +0200
+++ /var/tmp/diff_new_pack.TYvzrV/_new 2021-05-04 22:01:36.660460457 +0200
@@ -18,7 +18,7 @@
%define cpan_name Term-ReadLine-Gnu
Name: perl-Term-ReadLine-Gnu
-Version: 1.40
+Version: 1.41
Release: 0
Summary: Perl extension for the GNU Readline/History Library
License: Artistic-1.0 OR GPL-1.0-or-later
++++++ Term-ReadLine-Gnu-1.40.tar.gz -> Term-ReadLine-Gnu-1.41.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Term-ReadLine-Gnu-1.40/Changes
new/Term-ReadLine-Gnu-1.41/Changes
--- old/Term-ReadLine-Gnu-1.40/Changes 2021-02-23 07:08:35.000000000 +0100
+++ new/Term-ReadLine-Gnu-1.41/Changes 2021-05-01 16:10:38.000000000 +0200
@@ -1,5 +1,10 @@
-*- Indented-text -*-
+1.41 2021-05-01
+ - Makefile.PL
+ - Search a terminal library only when it necessary. [#6]
+ - whole refactoring
+
1.40 2021-02-23
- Migrate the repository and the bug tracker to GitHub
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Term-ReadLine-Gnu-1.40/Gnu/XS.pm
new/Term-ReadLine-Gnu-1.41/Gnu/XS.pm
--- old/Term-ReadLine-Gnu-1.40/Gnu/XS.pm 2021-02-23 07:09:14.000000000
+0100
+++ new/Term-ReadLine-Gnu-1.41/Gnu/XS.pm 2021-05-01 16:12:20.000000000
+0200
@@ -14,7 +14,7 @@
use AutoLoader 'AUTOLOAD';
our $VERSION;
-$VERSION='1.40'; # added for CPAN
+$VERSION='1.41'; # added for CPAN
# make aliases
our %Attribs;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Term-ReadLine-Gnu-1.40/Gnu.pm
new/Term-ReadLine-Gnu-1.41/Gnu.pm
--- old/Term-ReadLine-Gnu-1.40/Gnu.pm 2021-02-23 07:09:02.000000000 +0100
+++ new/Term-ReadLine-Gnu-1.41/Gnu.pm 2021-05-01 16:12:02.000000000 +0200
@@ -91,7 +91,7 @@
use Exporter ();
use DynaLoader;
- our $VERSION = '1.40'; # update Gnu::XS::VERSION also.
+ our $VERSION = '1.41'; # update Gnu::XS::VERSION also.
# Term::ReadLine::Gnu::AU makes a function in
# `Term::ReadLine::Gnu::XS' as a method.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Term-ReadLine-Gnu-1.40/META.json
new/Term-ReadLine-Gnu-1.41/META.json
--- old/Term-ReadLine-Gnu-1.40/META.json 2021-02-23 08:21:24.000000000
+0100
+++ new/Term-ReadLine-Gnu-1.41/META.json 2021-05-01 16:40:58.000000000
+0200
@@ -49,6 +49,6 @@
"url" : "https://github.com/hirooih/perl-trg.git"
}
},
- "version" : "1.40",
+ "version" : "1.41",
"x_serialization_backend" : "JSON::PP version 4.02"
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Term-ReadLine-Gnu-1.40/META.yml
new/Term-ReadLine-Gnu-1.41/META.yml
--- old/Term-ReadLine-Gnu-1.40/META.yml 2021-02-23 08:21:24.000000000 +0100
+++ new/Term-ReadLine-Gnu-1.41/META.yml 2021-05-01 16:40:58.000000000 +0200
@@ -24,5 +24,5 @@
homepage: https://github.com/hirooih/perl-trg
license: http://dev.perl.org/licenses/
repository: https://github.com/hirooih/perl-trg.git
-version: '1.40'
+version: '1.41'
x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Term-ReadLine-Gnu-1.40/Makefile.PL
new/Term-ReadLine-Gnu-1.41/Makefile.PL
--- old/Term-ReadLine-Gnu-1.40/Makefile.PL 2021-02-23 06:51:07.000000000
+0100
+++ new/Term-ReadLine-Gnu-1.41/Makefile.PL 2021-05-01 16:16:32.000000000
+0200
@@ -1,30 +1,30 @@
#
-# Makefile.PL for Term::ReadLine::Gnu
+# Makefile.PL for Term::ReadLine::Gnu
#
-# Copyright (c) 1996-2021 Hiroo Hayashi. All rights reserved.
-# <[email protected]>
+# Copyright (c) 1996-2021 Hiroo Hayashi. All rights reserved.
+# <[email protected]>
#
-# This program is free software; you can redistribute it and/or
-# modify it under the same terms as Perl itself.
+# This program is free software; you can redistribute it and/or
+# modify it under the same terms as Perl itself.
#
-# OS/2 support was contributed by Ilya Zakharevich.
-# <[email protected]>
+# OS/2 support was contributed by Ilya Zakharevich.
+# <[email protected]>
#
# Usage: perl Makefile.PL [--prefix=...] [--includedir=...] [--libdir=...]
-# [OPTIMIZE=...]
+# [OPTIMIZE=...] [verbose]
#
-# Read INSTALL for more details.
+# Read INSTALL for more details.
########################################################################
use strict;
use ExtUtils::MakeMaker;
use Config;
use Getopt::Long;
use 5.008; use 5.8.1;
-my ($defs, $libs, $lddflags, $RLLIB, $RLINC, @LIBPTH);
+my (@defs, @libs, @lddflags, @RLLIB, @RLINC, @LIBPTH, $verbose, $err);
# exit 0 before creating the Makefile to be CPAN Testers friendly
# see http://wiki.cpantester.org/wiki/CPANAuthorNotes
-my $err = $ENV{AUTOMATED_TESTING} ? 0 : 1;
+$err = $ENV{AUTOMATED_TESTING} ? 0 : 1;
# test /dev/tty for CPAN Testers
if ($ENV{AUTOMATED_TESTING} && !open(SESAMI, '/dev/tty')) {
warn "cannot open /dev/tty\n";
@@ -32,156 +32,184 @@
}
# test $TERM for CPAN Testers
# https://rt.cpan.org/Ticket/Display.html?id=128806
-if ($ENV{AUTOMATED_TESTING}
+if ($ENV{AUTOMATED_TESTING}
&& (!exists($ENV{TERM}) || !defined($ENV{TERM}) || $ENV{TERM} =~
/^(dumb|emacs|unknown|)$/)) {
warn "wrong \$TERM value: $ENV{TERM}\n";
exit 0;
}
-$defs = ($Config{strings} =~ m|/string.h$|) ? '-DHAVE_STRING_H' : '';
+push(@defs, '-DHAVE_STRING_H') if ($Config{strings} =~ m|/string.h$|);
# pacify warnings for -D_FORTIFY_SOURCE which perl 5.20.0 started using
-if ($Config{ccflags} =~ /-D_FORTIFY_SOURCE=/) {
- $defs .= ' -O';
-}
+push(@defs, '-O') if ($Config{ccflags} =~ /-D_FORTIFY_SOURCE=/);
# Parse command line to specify paths for the GNU Readline Library
{
my ($prefix, $libdir, $incdir);
GetOptions("prefix=s" => \$prefix,
- "libdir=s" => \$libdir,
- "includedir=s" => \$incdir);
+ "libdir=s" => \$libdir,
+ "includedir=s" => \$incdir);
if (defined $libdir) {
foreach (split(':', $libdir)) {
- $RLLIB .= " -L$_";
- push (@LIBPTH, $_);
+ push(@RLLIB, "-L$_");
+ push(@LIBPTH, $_);
}
}
if (defined $incdir) {
foreach (split(':', $incdir)) {
- $RLINC .= " -I$_";
+ push(@RLINC, "-I$_");
}
}
if (defined $prefix) {
foreach (split(':', $prefix)) {
- $RLLIB .= " -L$_/lib";
- push (@LIBPTH, "$_/lib");
- $RLINC .= " -I$_/include";
+ push(@RLLIB, "-L$_/lib");
+ push(@LIBPTH, "$_/lib");
+ push(@RLINC, "-I$_/include");
+ }
+ }
+ foreach (@ARGV) {
+ if ($_ eq 'verbose') {
+ $verbose = 1;
+ last;
+ }
+ }
+}
+
+# if user hasn't provided RLLIB or RLINC....
+# OS X uses libedit, but they've named it libreadline...
+# see if user has installed gnu readline via homebrew
+if ($Config{osname} eq 'darwin' && !(@RLLIB || @RLINC)) {
+ foreach ('readline', 'ncurses') {
+ my $homebrew_prefix = `brew --prefix $_`;
+ chomp $homebrew_prefix;
+ if ($homebrew_prefix
+ && ((substr($Config{osvers}, 0, index($Config{osvers}, '.')) > 19)
|| -d $homebrew_prefix)) {
+ push(@RLLIB, "-L$homebrew_prefix/lib");
+ push(@LIBPTH, "$homebrew_prefix/lib");
+ push(@RLINC, "-I$homebrew_prefix/include");
}
}
}
if ($Config{osname} eq 'os2') {
# Check ftp://ftp.math.ohio-state.edu/pub/users/ilya/os2/
- $libs = '-lreadline_import';
- $defs .= ' -DOS2_USEDLL';
- $lddflags = '';
+ push(@libs, '-lreadline_import');
+ push(@defs, '-DOS2_USEDLL');
} else {
- # if user hasn't provided RLLIB or RLINC....
- # OS X uses libedit, but they've named it libreadline...
- # see if user has installed gnu readline via homebrew
- if ($Config{osname} eq 'darwin' && !($RLLIB || $RLINC)) {
- foreach ('readline', 'ncurses') {
- my $homebrew_prefix = `brew --prefix $_`;
- chomp $homebrew_prefix;
- if ($homebrew_prefix
- && ((substr($Config{osvers}, 0, index($Config{osvers}, '.')) >
19) || -d $homebrew_prefix)) {
- $RLLIB .= " -L$homebrew_prefix/lib";
- push (@LIBPTH, "$homebrew_prefix/lib");
- $RLINC .= " -I$homebrew_prefix/include";
- }
- }
- }
+ push(@libs, '-lreadline');
+}
- # Search libtermcap, libtinfo, libncurses, or libcurses in this order.
- # I emulate the behavior of the configure script for bash, and don't
- # know why AIX prefers curses.
- # libtermcap.a on HPUX cannot be used for dynamically linked binary.
- # Old Cygwin may require setting false (0).
- # tinfo is for Debian. [Debian Bug Report #644423]
- my $PREFER_CURSES = $Config{osname} eq 'aix' || $Config{osname} eq 'hpux'
- || $Config{osname} eq 'cygwin';
- my $TERMCAP_LIB = (! $PREFER_CURSES && &search_lib('-ltermcap'))
- || &search_lib('-ltinfo')
- || &search_lib('-lncurses')
- || &search_lib('-lcurses');
-
- unless ($TERMCAP_LIB) {
- warn "Could not find neither libtermcap, libtinfo, libncurses, or
libcurses.\n";
- if ($Config{osname} eq 'darwin'
- && substr($Config{osvers}, 0, index($Config{osvers}, '.')) > 19
- && $ExtUtils::MakeMaker::VERSION < 7.58) {
- warn "Install XCode or use Homebrew package.\n";
- warn "macOS Big Sur or later requires ExtUtils::MakeMaker 7.58 or
later.\n";
- warn "See
https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/issues/381 for
details.\n";
+{
+ my $frlver = 'rlver';
+ write_rlver("$frlver.c");
+
+ # First compile rlver.c without specifing terminal library (for some
libreadline.so).
+ if (compile_rlver($frlver, "@RLINC", "@RLLIB", "@defs", "@lddflags",
"@libs", 1)) {
+ # If failed, compile rlver.c with terminal library.
+ # See https://github.com/hirooih/perl-trg/issues/6 for details
+ if (my $termlib = search_termlib()) {
+ push(@libs, $termlib);
+ if (compile_rlver($frlver, "@RLINC", "@RLLIB", "@defs",
"@lddflags", "@libs", 0)) {
+ warn <<EOM;
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+Could not compile $frlver.c.
+
+system(): $!
+
+If you have installed the GNU Readline Library (libreadline.{a,so} and
+readline/readline.h, etc.) on directories for which your perl is not
+configured to search (refer the value of `ccflags' and `libpath' in
+the output of `perl -V'), specify the paths as follows;
+
+ perl Makefile.PL --includedir=/yourdir/include --libdir=/yourdir/lib
+or
+ perl Makefile.PL --prefix=/yourdir
+
+Note that the GNU Readline Library version 2.0 and earlier causes error
+here. Update it to version 2.1 and/or later.
+
+Read INSTALL for more details.
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+EOM
+ exit $err;
+ }
+ # Succeeded
} else {
- exit $err;
+ warn "Could not find neither libtermcap, libtinfo, libncurses, or
libcurses.\n";
+ if ($Config{osname} eq 'darwin'
+ && substr($Config{osvers}, 0, index($Config{osvers}, '.')) > 19
+ && $ExtUtils::MakeMaker::VERSION < 7.58) {
+ # may not reach here
+ warn <<EOM;
+Install XCode or use Homebrew package.
+macOS Big Sur or later requires ExtUtils::MakeMaker 7.58 or later.
+See https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/issues/381 for
details.
+EOM
+ # don't exit for now
+ } else {
+ exit $err;
+ }
}
- }
-
- $libs = "-lreadline $TERMCAP_LIB";
- # Latest Perl in FreeBSD does not need this hack. (Dec.2002)
- $libs .= ' -lcrypt' if ($Config{osname} =~ /freebsd/i);
- $lddflags = '';
- # If you are using old Cygwin, enable the following line.
- #$lddflags = ($Config{osname} =~ /cygwin/i) ? '-static' : '';
+ }
}
# Check version of GNU Readline Library (for version 4.2 and before)
{
- my ($rlmajorver, $rlminorver) =
- check_readline_version($RLINC, $RLLIB, $defs, $lddflags, $libs);
+ my ($rlmajorver, $rlminorver) = check_readline_version();
+ my $rlver_hex = sprintf("0x%02x%02x", $rlmajorver, $rlminorver);
if ($rlmajorver < 4 || $rlmajorver == 4 && $rlminorver <= 2) {
- $defs .= " -DRL_READLINE_VERSION=" .
- sprintf("0x%02x%02x", $rlmajorver, $rlminorver);
- $defs .= " -DRL_VERSION_MAJOR=$rlmajorver";
- $defs .= " -DRL_VERSION_MINOR=$rlminorver";
+ push(@defs, "-DRL_READLINE_VERSION=$rlver_hex");
+ push(@defs, "-DRL_VERSION_MAJOR=$rlmajorver");
+ push(@defs, "-DRL_VERSION_MINOR=$rlminorver");
}
# to show GNU Readline Library version in CPAN Tester Reports
- $defs .= " -DTRG_READLINE_VERSION=" .
- sprintf("0x%02x%02x", $rlmajorver, $rlminorver);
+ push(@defs, "-DTRG_READLINE_VERSION=$rlver_hex");
}
+# Latest Perl in FreeBSD does not need this hack. (Dec.2002)
+push(@libs, '-lcrypt') if ($Config{osname} =~ /freebsd/i);
+# If you are using old Cygwin, enable the following line.
+#push(@lddflags, '-static') if ($Config{osname} =~ /cygwin/i);
+
# Check whether xmalloc has been renamed to _rl_malloc (Gentoo Linux)
-if (my $extra_defs = guess_malloc_names($RLINC, $RLLIB, $defs, $lddflags,
$libs)) {
- $defs .= " $extra_defs";
+if (my $extra_defs = guess_malloc_names("@RLINC", "@RLLIB", "@defs",
"@lddflags", "@libs")) {
+ push(@defs, $extra_defs);
}
# generate a Makefile
WriteMakefile
(
ABSTRACT_FROM => 'Gnu.pm',
- AUTHOR => 'Hiroo HAYASHI <[email protected]>',
- NAME => 'Term::ReadLine::Gnu',
- LICENSE => 'perl',
- EXE_FILES => [ 'eg/perlsh' ],
- META_MERGE => {
- resources => {
- license => 'http://dev.perl.org/licenses/',
- homepage => 'https://github.com/hirooih/perl-trg',
- bugtracker => 'https://github.com/hirooih/perl-trg/issues',
- repository => 'https://github.com/hirooih/perl-trg.git',
- },
+ AUTHOR => 'Hiroo HAYASHI <[email protected]>',
+ NAME => 'Term::ReadLine::Gnu',
+ LICENSE => 'perl',
+ EXE_FILES => [ 'eg/perlsh' ],
+ META_MERGE => {
+ resources => {
+ license => 'http://dev.perl.org/licenses/',
+ homepage => 'https://github.com/hirooih/perl-trg',
+ bugtracker => 'https://github.com/hirooih/perl-trg/issues',
+ repository => 'https://github.com/hirooih/perl-trg.git',
+ },
},
VERSION_FROM => 'Gnu.pm',
MIN_PERL_VERSION => '5.8.1',
- LIBS => [ "$RLLIB $libs" ],
- LDDLFLAGS => "$RLLIB $Config{lddlflags}",
- dynamic_lib => { OTHERLDFLAGS => $lddflags },
- DEFINE => $defs,
+ LIBS => [ "@RLLIB @libs" ],
+ LDDLFLAGS => "@RLLIB $Config{lddlflags}",
+ dynamic_lib => { OTHERLDFLAGS => "@lddflags" },
+ DEFINE => "@defs",
($Config{osname} eq 'os2' ?
(
- IMPORTS => { xfree => 'emxlibcm.401' }, # Yuck!
+ IMPORTS => { xfree => 'emxlibcm.401' }, # Yuck!
) : () ),
- INC => $RLINC,
- dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz' },
- clean => { FILES => "rlver.c rlver$Config{_exe} rlmalloc.c
rlmalloc$Config{_exe} .history_test" },
+ INC => "@RLINC",
+ dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz' },
+ clean => { FILES => "rlver.c rlver$Config{_exe} rlmalloc.c
rlmalloc$Config{_exe} .history_test" },
);
if ($Config{usesfio} eq 'true') {
warn <<'EOM';
-
******************** !!!Warning!!! *********************
** Your Perl is configured as `usesfio' equals true. **
** Term::ReadLine::Gnu may not work with your Perl. **
@@ -193,13 +221,30 @@
exit(0);
########################################################################
+sub search_termlib {
+ # Search libtermcap, libtinfo, libncurses, or libcurses in this order.
+ # I emulate the behavior of the configure script for bash, and don't
+ # know why AIX prefers curses.
+ # libtermcap.a on HPUX cannot be used for dynamically linked binary.
+ # Old Cygwin may require setting false (0).
+ # tinfo is for Debian. [Debian Bug Report #644423]
+ if ($Config{osname} eq 'aix' || $Config{osname} eq 'hpux' ||
$Config{osname} eq 'cygwin') {
+ return (search_lib('-lncurses') || search_lib('-ltermcap')
+ || search_lib('-ltinfo') || search_lib('-lcurses'));
+ } else {
+ return (search_lib('-ltermcap') || search_lib('-ltinfo')
+ || search_lib('-lncurses') || search_lib('-lcurses'));
+ }
+}
+
+########################################################################
# Search a library '$lib' in $Config{libpth} directories, and return
# $lib if exist or undef unless exist.
# ExtUtils::Liblist::ext() is not verbose by default any more and does much
better job.
sub search_lib {
my ($lib) = @_;
- my ($EXTRALIBS, $BSLOADLIBS, $LDLOADLIBS, $LD_RUN_PATH) =
ExtUtils::Liblist->ext($lib);
+ my ($EXTRALIBS, $BSLOADLIBS, $LDLOADLIBS, $LD_RUN_PATH) =
ExtUtils::Liblist->ext($lib, $verbose);
return $EXTRALIBS || $LDLOADLIBS || search_lib_sub($lib);
}
@@ -208,17 +253,17 @@
sub search_lib_sub {
my ($lib) = @_;
unless ($lib =~ /^-l/) {
- warn "search_lib: illegal arguments, \`$lib\'.\n";
- return undef;
+ warn "search_lib: illegal arguments, \`$lib\'.\n";
+ return undef;
}
- my $libbase = 'lib' . substr($lib, 2) . $Config{lib_ext};
+ my $libbase = 'lib' . substr($lib, 2) . $Config{lib_ext};
my $libbase_so = 'lib' . substr($lib, 2) . "." . $Config{so};
foreach (@LIBPTH) {
- if (-f $_ . '/' . $libbase) {
- return $lib;
- } elsif (-f $_ . '/' . $libbase_so) {
- return $lib;
- }
+ if (-f $_ . '/' . $libbase) {
+ return $lib;
+ } elsif (-f $_ . '/' . $libbase_so) {
+ return $lib;
+ }
}
return undef;
}
@@ -227,13 +272,12 @@
# Check libreadline.a version
#
# Readline 4.2a introduced the macro
-# RL_READLINE_VERSION
-# RL_VERSION_MAJOR
-# RL_VERSION_MINOR
+# RL_READLINE_VERSION
+# RL_VERSION_MAJOR
+# RL_VERSION_MINOR
# Someday we don't need this subroutine..
-sub check_readline_version {
- my ($RLINC, $RLLIB, $defs, $lddflags, $libs) = @_;
- my $frlver = 'rlver.c';
+sub write_rlver {
+ my ($frlver) = @_;
# make temp file
open(F, ">$frlver") || die "Cannot open $frlver:$!\n";
@@ -244,47 +288,30 @@
int main() { puts(rl_library_version); return 0; }
EOF
close(F);
+}
- # compile it
- my $comp_cmd = "$Config{cc} $RLINC $Config{ccflags} $defs $frlver -o rlver
$RLLIB $lddflags $Config{ldflags} $libs";
- print $comp_cmd, "\n";
- system($comp_cmd);
- if ($?) {
- warn <<EOM;
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-Could not compile $frlver.
-
-system(): $!
-
-If you have installed the GNU Readline Library (libreadline.{a,so} and
-readline/readline.h, etc.) on directories for which your perl is not
-configured to search (refer the value of `ccflags' and `libpath' in
-the output of `perl -V'), specify the paths as follows;
-
- perl Makefile.PL --includedir=/yourdir/include --libdir=/yourdir/lib
-or
- perl Makefile.PL --prefix=/yourdir
+sub compile_rlver {
+ my ($base, $RLINC, $RLLIB, $defs, $lddflags, $libs, $quiet) = @_;
-Note that the GNU Readline Library version 2.0 and earlier causes error
-here. Update it to version 2.1 and/or later.
-
-Read INSTALL for more details.
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-EOM
- exit $err;
- }
+ my $comp_cmd = "$Config{cc} $RLINC $Config{ccflags} $defs $base.c -o $base
$RLLIB $lddflags $Config{ldflags} $libs";
+ $comp_cmd .= " >/dev/null 2>&1" if $quiet;
+ print $comp_cmd, "\n" if $verbose;
+ system($comp_cmd);
+ return $?;
+}
- # execute it and get version
+sub check_readline_version {
+ # execute rlver and get version
my $rlver;
chomp($rlver = `./rlver`);
# MacOS X 10.4 has libedit by default.
if ($rlver =~ /EditLine/) {
- warn <<EOM;
+ warn <<EOM;
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
The libreadline you are using is the libedit library. Use the GNU Readline
Library.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
EOM
- exit $err;
+ exit $err;
}
print "<<<It seems that you have the GNU Readline Library version
$rlver.>>>\n";
# $rlver may be '8.21-beta3', '4.2a', or etc.
@@ -305,17 +332,17 @@
my $frlmalloc = 'rlmalloc.c';
my @symbol_sets = (
- {
- # try defaults first
- # xmalloc => 'xmalloc',
- # xrealloc => 'xrealloc',
- # xfree => 'xfree',
- },
- {
- xmalloc => '_rl_malloc',
- xrealloc => '_rl_realloc',
- xfree => '_rl_free',
- },
+ {
+ # try defaults first
+ # xmalloc => 'xmalloc',
+ # xrealloc => 'xrealloc',
+ # xfree => 'xfree',
+ },
+ {
+ xmalloc => '_rl_malloc',
+ xrealloc => '_rl_realloc',
+ xfree => '_rl_free',
+ },
);
# make temp file
@@ -346,23 +373,23 @@
my $extra_defs;
for my $symbol_set (@symbol_sets) {
- my $xdef = join " ", map "-D$_=$symbol_set->{$_}", sort keys
%$symbol_set;
- # compile it
- my $comp_cmd = "$Config{cc} $RLINC $Config{ccflags} $defs $xdef
$frlmalloc -o rlmalloc $RLLIB $lddflags $Config{ldflags} $libs";
- print $comp_cmd, "\n";
- unless (system($comp_cmd) || `./rlmalloc` !~ /^ok$/ || $?) {
- $extra_defs = $xdef;
- last;
- }
+ my $xdef = join " ", map "-D$_=$symbol_set->{$_}", sort keys
%$symbol_set;
+ # compile it
+ my $comp_cmd = "$Config{cc} $RLINC $Config{ccflags} $defs $xdef
$frlmalloc -o rlmalloc $RLLIB $lddflags $Config{ldflags} $libs";
+ print $comp_cmd, "\n" if $verbose;
+ unless (system($comp_cmd) || `./rlmalloc` !~ /^ok$/ || $?) {
+ $extra_defs = $xdef;
+ last;
+ }
}
unless (defined $extra_defs) {
- warn <<EOM;
+ warn <<EOM;
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
I was unable to find a working xmalloc in your readline library.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
EOM
- exit $err;
+ exit $err;
}
return $extra_defs;