texinfo-commits
[Top][All Lists]
Advanced

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

[6551] * tp/Texinfo/Convert/XSParagraph/Makefile.PL,


From: Patrice Dumas
Subject: [6551] * tp/Texinfo/Convert/XSParagraph/Makefile.PL,
Date: Tue, 18 Aug 2015 22:17:44 +0000

Revision: 6551
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=6551
Author:   pertusus
Date:     2015-08-18 22:17:44 +0000 (Tue, 18 Aug 2015)
Log Message:
-----------
        * tp/Texinfo/Convert/XSParagraph/Makefile.PL,
        tp/Texinfo/Convert/XSParagraph/Makefile.am,
        tp/Texinfo/Convert/XSParagraph/XSParagraph.pm,
        tp/Texinfo/Convert/XSParagraph/configure.ac: use a specific value
        for the XSParagraph XS interface version, instead of the project 
        version, and use it to match with bootstrap in XSParagraph.pm.
        Do not version the XSParagraph shared object, as it is only dlopened.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/tp/Texinfo/Convert/XSParagraph/Makefile.PL
    trunk/tp/Texinfo/Convert/XSParagraph/Makefile.am
    trunk/tp/Texinfo/Convert/XSParagraph/XSParagraph.pm
    trunk/tp/Texinfo/Convert/XSParagraph/configure.ac

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2015-08-18 22:06:35 UTC (rev 6550)
+++ trunk/ChangeLog     2015-08-18 22:17:44 UTC (rev 6551)
@@ -1,5 +1,15 @@
 2015-08-19  Patrice Dumas  <address@hidden>
 
+       * tp/Texinfo/Convert/XSParagraph/Makefile.PL,
+       tp/Texinfo/Convert/XSParagraph/Makefile.am,
+       tp/Texinfo/Convert/XSParagraph/XSParagraph.pm,
+       tp/Texinfo/Convert/XSParagraph/configure.ac: use a specific value
+       for the XSParagraph XS interface version, instead of the project 
+       version, and use it to match with bootstrap in XSParagraph.pm.
+       Do not version the XSParagraph shared object, as it is only dlopened.
+
+2015-08-19  Patrice Dumas  <address@hidden>
+
        * tp/Texinfo/Convert/XSParagraph/XSParagraph.xs, 
        tp/Texinfo/Convert/XSParagraph/*.c: protect #include <config.h> by
        #ifdef HAVE_CONFIG_H.

Modified: trunk/tp/Texinfo/Convert/XSParagraph/Makefile.PL
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/Makefile.PL    2015-08-18 22:06:35 UTC 
(rev 6550)
+++ trunk/tp/Texinfo/Convert/XSParagraph/Makefile.PL    2015-08-18 22:17:44 UTC 
(rev 6551)
@@ -3,17 +3,25 @@
 # See lib/ExtUtils/MakeMaker.pm for details of how to influence
 # the contents of the Makefile that is written.
 
-# Non numeric characters are not accepted by XS.
-# FIXME instead pass -noversioncheck to xsubpp?
-# REMARK MM->parse_version is part of an internal API, so could change in
-# the future.
-my $version = MM->parse_version('XSParagraph.pm');
-$version =~ s/[[:alpha:]]+//i;
+my $XSPARAGRAPH_INTERFACE_VERSION = "1";
+# Verify XS version in configure.ac is the same as in the current file.
+my $fh;
+open $fh, "configure.ac";
+if ($fh) {
+  while (my $line = <$fh>) {
+    if ($line =~ /^\s*XSPARAGRAPH_INTERFACE_VERSION\s*=\s*([^\s]+)\s$/) {
+      my $configure_XSPARAGRAPH_INTERFACE_VERSION = $1;
+      if ($configure_XSPARAGRAPH_INTERFACE_VERSION ne 
$XSPARAGRAPH_INTERFACE_VERSION) {
+        die "configure.ac XSPARAGRAPH_INTERFACE_VERSION 
$configure_XSPARAGRAPH_INTERFACE_VERSION != $XSPARAGRAPH_INTERFACE_VERSION\n";
+      }
+      last;
+    }
+  }
+}
 
 WriteMakefile(
     NAME              => 'Texinfo::Convert::XSParagraph::XSParagraph',
-#    VERSION_FROM      => 'XSParagraph.pm', # finds $VERSION
-    VERSION           => $version, 
+    VERSION_FROM      => 'XSParagraph.pm', # finds $VERSION
     PREREQ_PM         => {}, # e.g., Module::Name => 1.1
     ($] >= 5.005 ?     ## Add these new keywords supported since 5.005
       (AUTHOR         => 'Gavin Smith  <address@hidden>') : ()),
@@ -22,6 +30,7 @@
     INC               => '-I.', # e.g., '-I. -I/usr/include/other'
        # Un-comment this if you add C files to link with later:
     OBJECT            => '$(O_FILES)', # link all the C files too
+    XS_VERSION        => "$XSPARAGRAPH_INTERFACE_VERSION",
     #'MYEXTLIB' => 'mylib/libxspara.a',
 );
 

Modified: trunk/tp/Texinfo/Convert/XSParagraph/Makefile.am
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/Makefile.am    2015-08-18 22:06:35 UTC 
(rev 6550)
+++ trunk/tp/Texinfo/Convert/XSParagraph/Makefile.am    2015-08-18 22:17:44 UTC 
(rev 6551)
@@ -68,9 +68,9 @@
 
 XSParagraph_la_CFLAGS = $(PERL_CONF_ccflags)
 
-XSParagraph_la_CFLAGS += -DVERSION=\"$(VERSION)\" -DXS_VERSION=\"$(VERSION)\"  
"-I$(PERL_INC)"
+XSParagraph_la_CFLAGS += -DVERSION=\"$(VERSION)\" 
-DXS_VERSION=\"$(XSPARAGRAPH_INTERFACE_VERSION)\"  "-I$(PERL_INC)"
 
-XSParagraph_la_LDFLAGS=-module $(PERL_CONF_cccdlflags)
+XSParagraph_la_LDFLAGS=-avoid-version -module $(PERL_CONF_cccdlflags)
 
 
 # only used to regenerate a stand-alone perl module

Modified: trunk/tp/Texinfo/Convert/XSParagraph/XSParagraph.pm
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/XSParagraph.pm 2015-08-18 22:06:35 UTC 
(rev 6550)
+++ trunk/tp/Texinfo/Convert/XSParagraph/XSParagraph.pm 2015-08-18 22:17:44 UTC 
(rev 6551)
@@ -50,9 +50,11 @@
 
 my $module = "Texinfo::Convert::XSParagraph::XSParagraph";
 our $VERSION = '6.0dev';
-# match what is used as version in xsub, with non numeric characters
-# removed, as they trigger an error on module version check.
-$VERSION =~ s/[[:alpha:]]+//i;
+# Module interface number, to be changed when the XS interface changes.  
+# The value used for the .xs file compilation is set in configure.ac.  
+# Both should correspond, but it should be manually changed here to make
+# sure that a changed interface has not been missed.
+my $XSPARAGRAPH_INTERFACE_VERSION = "1";
 
 # Possible values for TEXINFO_XS environmental variable:
 #
@@ -215,7 +217,7 @@
 # This is the module bootstrap function, which causes all the other
 # functions (XSUB's) provided by the module to become available to
 # be called from Perl code.
-&$boot_fn($module, $VERSION);
+&$boot_fn($module, $XSPARAGRAPH_INTERFACE_VERSION);
 
 if (!Texinfo::Convert::XSParagraph::XSParagraph::init ()) {
   _fatal "XSParagraph: error initializing";

Modified: trunk/tp/Texinfo/Convert/XSParagraph/configure.ac
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/configure.ac   2015-08-18 22:06:35 UTC 
(rev 6550)
+++ trunk/tp/Texinfo/Convert/XSParagraph/configure.ac   2015-08-18 22:17:44 UTC 
(rev 6551)
@@ -80,6 +80,16 @@
 AC_ARG_VAR([PERL_EXT_CPPFLAGS], [C preprocessor flags for a Perl extension])
 AC_ARG_VAR([PERL_EXT_LDFLAGS], [Linker flags for a Perl extension])
 
+# version of the XSParagraph interface
+XSPARAGRAPH_INTERFACE_VERSION=1
+AC_ARG_WITH([interface-version],
+  AC_HELP_STRING([--with-interface-version],
+   dnl FIXME $XSPARAGRAPH_INTERFACE_VERSION is not expanded
+   [interface version (default: 1)]),
+   [XSPARAGRAPH_INTERFACE_VERSION=$with_interface_version])
+
+AC_SUBST([XSPARAGRAPH_INTERFACE_VERSION])
+
 if test x$disable_xs != xyes; then
 lookup_perl_flags([ccflags])
 lookup_perl_flags([cccdlflags])




reply via email to

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