Description: avoid internally build or link against libmarpa
 Adapt build routines for Marpa::R2 build to treat libmarpa as an
 independent library.
 .
 By default, libmarpa is expected to be already compiled as a static
 library (i.e. passing "--with-pic --disable-shared" to configure, with
 root directory as build directory.
 .
 Alternatively when build and test actions has "--libmarpa-shared=1" and
 install action has "--libmarpa-shared", libmarpa is instead expected to
 exist as a shared library (patched to not use -release versioning) at a
 common ldconfig path (or overridden with LD_LIBRARY_PATH).
Author: Jonas Smedegaard <dr@jones.dk>
Last-Update: 2014-06-26
License: Same as Marpa::R2 code

--- a/inc/Marpa/R2/Build_Me.pm
+++ b/inc/Marpa/R2/Build_Me.pm
@@ -249,7 +249,7 @@
     # .c -> .o
     my $v = $self->dist_version;
     $self->verbose() and say "compiling $spec->{c_file}";
-    my @new_ccflags = ( '-I', $libmarpa_build_dir, '-I', 'xs' );
+    my @new_ccflags = ( '-I', 'libmarpa_dist', '-I', 'xs' );
 
     if ( $self->config('ccname') eq 'gcc' ) {
         ## -W instead of -Wextra is case the GCC is pre 3.0.0
@@ -284,31 +284,11 @@
     my @extra_linker_flags = ();
     my $libmarpa_build_directory = File::Spec->catdir(
         $self->base_dir(),
-        (   defined $self->args('libmarpa-shared')
-            ? 'libmarpa_shared'
-            : 'libmarpa_build'
-        )
     );
 
     if ( defined $self->args('libmarpa-shared') ) {
-        my $libmarpa_libs_dir;
-        if ($Marpa::R2::USE_PERL_AUTOCONF) {
-            $libmarpa_libs_dir =
-                File::Spec->catdir( $libmarpa_build_directory,
-                qw(blib_shared arch auto libmarpa) );
-        }
-        else {
-            $libmarpa_libs_dir =
-                File::Spec->catdir( $libmarpa_build_directory, '.libs' );
-        }
-        push @extra_linker_flags, '-L' . $libmarpa_libs_dir;
-        my $version_file_name =
-            File::Spec->catfile( $libmarpa_build_directory, 'LIB_VERSION' );
-        my $libmarpa_version = $self->file_slurp($version_file_name);
-        chomp $libmarpa_version;
-        my @libmarpa_version = split /[.]/xms, $libmarpa_version;
         push @extra_linker_flags,
-            sprintf q{-lmarpa-} . ( join q{.}, @libmarpa_version );
+            q{-lmarpa};
     } ## end if ( defined $self->args('libmarpa-shared') )
     else {
         my $libmarpa_archive;
@@ -843,11 +823,6 @@
             qw(pperl Marpa R2 Perl Version.pm) );
     } ## end if ( not $self->up_to_date( [ $config_pm_filename, ...]))
 
-    $self->do_libmarpa();
-
-    if ( defined $self->args('libmarpa-shared') ) {
-        $self->blib('blib_shared');
-    }
     return $self->SUPER::ACTION_code;
 } ## end sub ACTION_code
 
--- a/libmarpa_dist/Makefile.am
+++ b/libmarpa_dist/Makefile.am
@@ -17,7 +17,6 @@
 
 AM_CFLAGS = $(WARNING_CFLAGS) $(MARPA_DEBUG_FLAG)
 AM_CPPFLAGS = $(WARNING_CPPFLAGS)
-RELEASE= $(MARPA_LIB_MAJOR_VERSION).$(MARPA_LIB_MINOR_VERSION).$(MARPA_LIB_MICRO_VERSION)
 ACLOCAL_AMFLAGS = -I m4
 lib_LTLIBRARIES = libmarpa.la
 libmarpa_la_SOURCES = marpa.c marpa.h \
@@ -30,7 +29,6 @@
   win32/marpa.def Makefile.win32 win32/do_config_h.pl \
   notes/shared_test.txt
 libmarpa_la_LIBADD = $(LIBOBJS)
-libmarpa_la_LDFLAGS = -release $(RELEASE)
 include_HEADERS = marpa.h \
   marpa_avl.h marpa_tavl.h marpa_ami.h \
   marpa_slif.h marpa_obs.h
