[libmarpa-r2-perl] 26/32: Packaging

Jonas Smedegaard dr at jones.dk
Sat Nov 22 18:38:40 UTC 2014


This is an automated email from the git hooks/post-receive script.

js pushed a commit to annotated tag Marpa-R2-2.087_000
in repository libmarpa-r2-perl.

commit 930f2deffbddf41b472f39ee2f20dcf5c3181a7b
Author: Jeffrey Kegler <JKEGL at cpan.org>
Date:   Sun Jul 6 21:12:19 2014 -0700

    Packaging
---
 cpan/core/SHARED             | 54 ++++++++++++++++++++++++++++++++++++++++++++
 cpan/core/STATIC             | 40 ++++++++++++++++----------------
 cpan/core/cf/.gitignore      |  2 +-
 cpan/inc/Marpa/R2/License.pm |  2 +-
 cpan/lib/Marpa/R2.pm         |  9 ++------
 5 files changed, 77 insertions(+), 30 deletions(-)

diff --git a/cpan/core/SHARED b/cpan/core/SHARED
new file mode 100644
index 0000000..f3a5459
--- /dev/null
+++ b/cpan/core/SHARED
@@ -0,0 +1,54 @@
+This document describes how to link an external shared library with
+Marpa::R2.  This method, and this document, are intended for re-packagers
+and other very advanced users.  This method is not supported by the CPAN
+infrastructure.  Most users should prefer the basic method described in
+the INSTALL document at the top level of the Marpa::R2 CPAN directory.
+
+This document only describes those aspects of linking which are special
+to shared libraries.  This document assumes you have already read the
+STATIC document, which contains, along with instructions for linking
+static libraries, many instructions applicable to linking with external
+libraries in general.  That material is not repeated here.
+
+Here are the steps:
+
+1.) As with linking a static library, you must ensure that the version
+of the library is an exact match to the one that Marpa::R2 expects.
+For more detail, refer back to the "STATIC" document.
+
+2.) Build an external shared library using the separate Libmarpa
+repository.  Instructions on how to build Libmarpa can be found beginning
+in the INSTALL file at the top level of the Libmarpa repository.
+Libmarpa's repository is here: https://github.com/jeffreykegler/libmarpa
+
+3.) Install the external shared library.  Where and how you install it
+is up to you.  The Libmarpa distribution is set up to use autoconf.
+Instructions on how to install using autoconf can be found in the
+autoconf documentation.  Here, we will assume that, for test purposes,
+you have installed the external static library in /tmp/libmarpa.so.
+
+4.) To build and test
+
+    LD_LIBRARY_PATH=/tmp ./Build test --libmarpa-external=/tmp/libmarpa.so
+
+or
+
+    LD_LIBRARY_PATH=/tmp ./Build test --libmarpa-external=-L/tmp\ -lmarpa
+
+Note that, in each case, the location of the library is specified twice.
+The linker needs to find the library using the flags, as specified in the
+"--libmarpa-external" option.  At runtime, however, the tester cannot
+assume that is where the shared library is installed and, in this example,
+LD_LIBRARY_PATH is used so that Libmarpa can be found at runtime.
+
+5.)  To switch back to an internal Libmarpa, specify the
+"--libmarpa-external" option.
+
+   ./Build code --libmarpa-internal=on
+
+
+LD_LIBRARY_PATH
+===============
+
+Readers should be aware the use of LD_LIBRARY_PATH in actual installations
+is controversial.  This example is of a testing situation.
diff --git a/cpan/core/STATIC b/cpan/core/STATIC
index 0b0cc1f..724091c 100644
--- a/cpan/core/STATIC
+++ b/cpan/core/STATIC
@@ -1,7 +1,7 @@
 This document describes how to link an external static library with
-Marpa::R2.  This method, and this document, is intended for re-packagers
+Marpa::R2.  This method, and this document, are intended for re-packagers
 and other very advanced users.  This method is not supported by the CPAN
-infrastructure.  Most users should perfer the basic method described in
+infrastructure.  Most users should prefer the basic method described in
 the INSTALL document at the top level of the Marpa::R2 CPAN directory.
 
 Here are the steps:
@@ -13,16 +13,15 @@ number must match exactly the version number of your external static
 library.
 
 2.) Build an external static library using the separate Libmarpa
-repository.  Libmarpa uses autoconf.  Instructions on how to
-build it can be found beginning in the INSTALL file at the top
-level of the Libmarpa repository.  Libmarpa's repository is here:
-https://github.com/jeffreykegler/libmarpa
+repository.  Instructions on how to build Libmarpa can be found beginning
+in the INSTALL file at the top level of the Libmarpa repository.
+Libmarpa's repository is here: https://github.com/jeffreykegler/libmarpa
 
 3.) Install the external static library.  Where and how you install it
 is up to you.  The Libmarpa distribution is set up to use autoconf.
 Instructions on how to install using autoconf can be found in the
-autoconf documentation.  We will assume that you have installed the
-external static library in /tmp/libmarpa.a.
+autoconf documentation.  Here, we will assume that, for test purposes,
+you have installed the external static library in /tmp/libmarpa.a.
 
 4.) Build Marpa::R2 to use the external static library.
 
@@ -41,26 +40,25 @@ an error message.  To go back to using the internal Libmarpa, use the
 
    ./Build code --libmarpa-internal=on
 
-
 TAGS
 ====
 
-To be sure you are actually testing the library you hope you
-are testing, Libmarpa now has a "tag", which can be set at compile
-time and which can identify every compilation uniquely.  By default,
-if you compile with GCC, the tag is a time stamp, recording when the
-preprocessor was run.  You can also set the tag explicitly:
-
-    ./configure MARPA_DEBUG_FLAG=-DMARPA_TAG=testing123
+You can configure Libmarpa to include a "tag" which identifies it.
+If Libmarpa is compiled with GCC, the tag defaults to a time stamp,
+but it can be set explicitly: For instructions on how to set the tag,
+see the installation documentation of Libmarpa.
 
-The tag appears early in the test output:
+The tag appears at the beginning of Marpa::R2's test output:
 
     t/00-load.t ............ 1/4 # Marpa::R2 version is 2.085_004
     # Libmarpa version is 6.0.3
     # Libmarpa tag: testing123
 
-You can put spaces and other non-word characters into the tag, but you have to
-figure out how to make them run the guantlet from shell to Makefile to compiler
-command line.  Here's an example who works on Linux:
+LINKER FLAGS
+============
 
-    ./configure MARPA_DEBUG_FLAG="\"-DMARPA_TAG=*This is a test*\""
+The value of "libmarpa-external" option is passed literally as a set of
+arguments to the linker, after being split on whitespace.  This means
+it is not restricted to being only the name of the static library to
+be linked.  It can also be used to pass other kinds of arguments to
+the linker.
diff --git a/cpan/core/cf/.gitignore b/cpan/core/cf/.gitignore
index 90e72d4..ba8fea0 100644
--- a/cpan/core/cf/.gitignore
+++ b/cpan/core/cf/.gitignore
@@ -1 +1 @@
-LIBMARPA_SOURCE
+LIBMARPA_MODE
diff --git a/cpan/inc/Marpa/R2/License.pm b/cpan/inc/Marpa/R2/License.pm
index ed4475b..9c42d44 100644
--- a/cpan/inc/Marpa/R2/License.pm
+++ b/cpan/inc/Marpa/R2/License.pm
@@ -291,7 +291,7 @@ my %files_by_type = (
     'core/read_only/win32/do_config_h.pl' => gen_license_problems_in_perl_file($libmarpa_hash_license),
     'etc/my_suppressions'              => \&trivial,
     'xs/ppport.h' => \&ignored,    # copied from CPAN, just leave it alone
-    'libmarpa/tavl/README' => \&trivial,
+    'core/read_only/README.INSTALL' => \&trivial,
 
     # Leave Pfaff's licensing as is
     'core/read_only/marpa_tavl.c' => \&ignored,
diff --git a/cpan/lib/Marpa/R2.pm b/cpan/lib/Marpa/R2.pm
index 37d8674..095ba37 100644
--- a/cpan/lib/Marpa/R2.pm
+++ b/cpan/lib/Marpa/R2.pm
@@ -29,6 +29,7 @@ $DEBUG = 0;
 
 use Carp;
 use English qw( -no_match_vars );
+use XSLoader;
 
 use Marpa::R2::Version;
 
@@ -76,13 +77,7 @@ LOAD_EXPLICIT_LIBRARY: {
     $Marpa::R2::LIBMARPA_FILE = $file;
 }
 
-my $ok = eval {
-    require XSLoader;
-    XSLoader::load( 'Marpa::R2', $Marpa::R2::STRING_VERSION );
-    1;
-};
-Carp::croak( "Marpa::R2 failed due to an XSLoader problem\n" . $EVAL_ERROR )
-    if not $ok;
+XSLoader::load( 'Marpa::R2', $Marpa::R2::STRING_VERSION );
 
 if ( not $ENV{'MARPA_AUTHOR_TEST'} ) {
     $Marpa::R2::DEBUG = 0;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libmarpa-r2-perl.git



More information about the Pkg-perl-cvs-commits mailing list