diff --git a/documentation/RELEASE_NOTES.html b/documentation/RELEASE_NOTES.html index e7b6cb31b..ff8efd4f0 100644 --- a/documentation/RELEASE_NOTES.html +++ b/documentation/RELEASE_NOTES.html @@ -13,6 +13,22 @@ +

Path for Cap5 loadable library changed

+ +

The perl CA module makes use of a loadable library, which used to be loaded +from the base/lib/<host-arch> directory. However different versions of +Perl require different loadable library binaries as the Perl ABI can change. +Now the library will be installed into and loaded from the directory +base/lib/perl/<version>/<archname> where both <version> and +<archname> are taken from the Perl configuration. This makes it possible +for the same Perl script to be run on both RHEL5 and RHEL6 workstations say, even +though they use different versions of Perl.

+ +

To achieve that, first build EPICS Base using the older OS version. Then +on a machine running the newer version, go into the base/src/cap5 directory and +run a make rebuild command. This will rebuild the libCap5.so file and +install it into the location appropriate for its Perl version and architecture.

+

Build configurations updated for Apple iOS targets

The build process can now construct universal binaries containing both ARMv6 diff --git a/src/cap5/CA.pm b/src/cap5/CA.pm index 3aa7c7f51..ac6542e01 100644 --- a/src/cap5/CA.pm +++ b/src/cap5/CA.pm @@ -6,9 +6,6 @@ use warnings; my $version = '0.4'; -exists $ENV{EPICS_HOST_ARCH} - or die "EPICS_HOST_ARCH environment variable not set"; - package CA; @@ -26,12 +23,17 @@ package Cap5; our $VERSION = $version; our @ISA = qw(DynaLoader); +# Library is specific to the Perl version and archname +use Config; +my $perl_version = $Config::Config{version}; +my $perl_archname = $Config::Config{archname}; + require DynaLoader; # Add our lib/ directory to the shared library search path use File::Basename; my $Lib = dirname(__FILE__); -push @DynaLoader::dl_library_path, "$Lib/../$ENV{EPICS_HOST_ARCH}"; +push @DynaLoader::dl_library_path, "$Lib/$perl_version/$perl_archname"; bootstrap Cap5 $VERSION; diff --git a/src/cap5/Makefile b/src/cap5/Makefile index e408a1cde..4707c1621 100644 --- a/src/cap5/Makefile +++ b/src/cap5/Makefile @@ -22,6 +22,11 @@ ifneq ($(findstring darwin,$(T_A)),) LOADABLE_SHRLIB_SUFFIX = .bundle endif +PERL_VERSION = $(shell $(PERL) ../perlConfig.pl version) +PERL_ARCHNAME = $(shell $(PERL) ../perlConfig.pl archname) +PERL_ARCHPATH = $(PERL_VERSION)/$(PERL_ARCHNAME) + +ifeq ($(findstring Host,$(VALID_BUILDS)),Host) ifeq ($(findstring $(OS_CLASS),WIN32 cygwin32),) # Doesn't build on WIN32 LOADABLE_LIBRARY_HOST = Cap5 @@ -33,12 +38,11 @@ ifeq ($(findstring $(OS_CLASS),WIN32 cygwin32),) PERL_SCRIPTS += camonitor.pl PERL_MODULES += CA.pm + PERL_MODULES += $(PERL_ARCHPATH)/$(LOADABLE_SHRLIB_PREFIX)Cap5$(LOADABLE_SHRLIB_SUFFIX) - ifeq ($(findstring Host,$(VALID_BUILDS)),Host) - # Can only create docs in Host build - HTMLS_DIR = . - HTMLS = CA.html - endif + HTMLS_DIR = . + HTMLS = CA.html +endif endif Cap5_SRCS = Cap5.xs @@ -59,6 +63,10 @@ ifdef T_A $(RM) $@ podchecker $< && pod2html --infile=$< --outfile=$@ + $(INSTALL_PERL_MODULES)/$(PERL_ARCHPATH)/%: % + $(ECHO) "Installing loadable shared library $@" + @$(INSTALL_LIBRARY) -d -m $(LIB_PERMISSIONS) $< $(INSTALL_PERL_MODULES)/$(PERL_ARCHPATH) + clean:: $(RM) Cap5.c endif