diff --git a/.travis.yml b/.travis.yml index c796201..c9796ac 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,4 +5,7 @@ perl: install: - sudo apt-get update -qq - sudo apt-get install -y openssl libcppunit-dev libreadline6 libreadline6-dev valgrind realpath libmodule-install-perl -script: "make && make test-fast" +script: "make && make test-fast && make perl" +notifications: + irc: + - "irc.freenode.net#mdbm" diff --git a/src/perl/Makefile.PL b/src/perl/Makefile.PL index 79eb7bb..21a968a 100644 --- a/src/perl/Makefile.PL +++ b/src/perl/Makefile.PL @@ -42,7 +42,7 @@ EOT } my $ccflags = '$(COMP_CFLAGS_RELAXED)'; -my $ldflags = '-shared -L/usr/local/lib64 -Wl,-rpath,$(LIBDIR)'; +my $ldflags = ' -Wl,--no-as-needed -shared -L/usr/local/lib64 -Wl,-rpath,$(LIBDIR)'; my $libs = "-L\$(LIBDIR) -L../lib/\$(OBJDIR) -lmdbm -lstdc++ "; #my $makefileSuffix = ($ObjDir eq '.' ? '' : '.' . $ObjDir); @@ -83,7 +83,7 @@ WriteMakefile( AUTHOR => 'Yahoo! MDBM developers') : ()), CCFLAGS => $ccflags, #LIBS => ":nosearch $libs", - LDDLFLAGS => "$libs $ldflags", + LDDLFLAGS => " $ldflags $libs ", DEFINE => '', # e.g., '-DHAVE_SOMETHING' INC => '-I$(INCDIR) -I../../include', 'XSOPT' => '-C++', diff --git a/src/perl/Makefile.old b/src/perl/Makefile.old deleted file mode 100644 index 0043ce1..0000000 --- a/src/perl/Makefile.old +++ /dev/null @@ -1,120 +0,0 @@ -# Copyright 2013 Yahoo! Inc. # -# See LICENSE in the root of the distribution for licensing details. # - -# Although the perl_MDBM_File is only built for PLATFORM x86_64-linux-gcc, -# Makefile targets must treat it in a platform-independent fashion. For -# example, in multi-platform build, the `clean' target will be invoked -# for each PLATFORM. Targets must be careful not to wipe out state -# relevant to other targets. - -TOPDIR=$(shell pwd)/../.. -include $(TOPDIR)/Makefile.base -SRCTOPABS := $(shell realpath $(SRCTOP)) - -MAKEFILE_BUILD = Makefile.build -ifneq ($(OBJDIR),.) - MAKEFILE_BUILD := $(MAKEFILE_BUILD).$(OBJDIR) -endif - -# perl wrapper targets -all:: wrapper - -# Define object files to be forcibly removed before each -# platform-specific build. These objects must be removed because -# MakeMaker generates Makefiles that cannot put temporary objects in -# platform-specific directories. Consquently, a subsequent platform -# might use those objects from a previous build. -PLATFORM_OBJECTS = MDBM_File.o shakedata.o - -# The clean target in the generated Makefile.build.* doesn't remove all -# all of the platform specific files, so force it here. -clean:: -ifneq ($(OBJDIR),.) - rm -rf $(OBJDIR) -endif - rm -f $(PLATFORM_OBJECTS) - if [ -e $(MAKEFILE_BUILD) ]; then \ - $(MAKE) -f $(MAKEFILE_BUILD) clean; \ - else \ - rm -f $(MAKEFILE_BUILD); \ - fi - -# -# Generate Makefile.build -# - -# Whether it's a 32-bit platform is needed to determine whether to build -# for a platform. It is also passed to Makefile.PL to construct the -# appropriate compilation flags. -# -# MDBM v2 and v3 are 32-bit only. MDBM v4 is 64-bit only. -$(warning XXX PLATFORMS=$(PLATFORMS), PLATFORM=$(PLATFORM), PLATFORM_CURRENT=$(PLATFORM_CURRENT)) -IS_32BIT_PLATFORM = 0 -BUILD_PLATFORM = 1 - -IS_64_BIT_PLATFORM = $(strip $(if $(filter x86_64%, $(PLATFORM)), 1, 0)) -ifeq ($(IS_64_BIT_PLATFORM),1) -# # The next warning line must start with spaces instead of a tab, or it doesn't parse. - $(warning perl_MDBM_File RHEL6 building for x86_64, PLATFORM=$(PLATFORM)) -else -# # The next warning line must start with spaces instead of a tab, or it doesn't parse. - $(warning SKIPPING BUILD, perl_MDBM_File RHEL6 will only build for x86_64, PLATFORM=$(PLATFORM)) - IS_32BIT_PLATFORM = -1 - BUILD_PLATFORM = 0 -endif - -# Target show-config is useful for debugging the integration with the -# MakeMaker generated Makefile.build.* and Platform Makefiles. -.PHONY: show-config -show-config: - @echo "### PLATFORM=$(PLATFORM) PLATFORM_CURRENT=$(PLATFORM) \ - MODE=$(MODE) OBJDIR=$(OBJDIR) \ - IS_32BIT_PLATFORM=$(IS_32BIT_PLATFORM) BUILD_PLATFORM=$(BUILD_PLATFORM)" - -$(MAKEFILE_BUILD): Makefile.PL show-config -ifeq ($(BUILD_PLATFORM),1) - OBJDIR=$(OBJDIR) IS_32BIT_PLATFORM=$(IS_32BIT_PLATFORM) $(PERL) Makefile.PL -endif - -# OBJDIR and IS_32BIT_PLATFORM must be specified because the generated -# Makefile may decide to self-clean and re-invoke Makefile.PL. -.PHONY: wrapper -wrapper: $(MAKEFILE_BUILD) show-config -ifeq ($(BUILD_PLATFORM),1) - rm -f $(PLATFORM_OBJECTS) - OBJDIR=$(OBJDIR) IS_32BIT_PLATFORM=$(IS_32BIT_PLATFORM) $(MAKE) -f $(MAKEFILE_BUILD) -else - @echo "Skipping perl_MDBM_File build target for non-64-bit platform $(PLATFORM)." - @echo "perl_MDBM_File builds will only be done for 64-bit (x86_64) platforms." -endif - -# Run the regression-test for the perl wrapper. -# On RHEL4, the perl wrapper is 32-bit only. -# On RHEL6, the perl wrapper is 64-bit only. -# -# The test target is not working with MODE=prof. Skip running them for now -# FIX: Why don't prof builds work for the test target? -# -# LD_LIBRARY_PATH must be set so that libmdbm.so's directory can be -# found in a sandbox at runtime (when the mdbm package is not -# installed). When testing interactively in the perl directory, you -# must define LD_LIBRARY_PATH because the generated Makefile does not -# set an rpath. -# -# Here, LD_LIBRARY_PATH is set to the 32-bit entry from cfg/localdefs PLATFORMS. -# A 64-bit shareable is required because perl is 64-bit only on RHEL6. -test:: wrapper show-config -ifeq ($(BUILD_PLATFORM),1) -ifeq ($(MODE),prof) - @echo "Skipping perl_MDBM_File test target for MODE=$(MODE)." -else - rm -f $(PLATFORM_OBJECTS) - export LD_LIBRARY_PATH=$(SRCTOPABS)/src/lib/$(OBJDIR):/usr/lib; \ - echo "LD_LIBRARY_PATH=$$LD_LIBRARY_PATH"; \ - OBJDIR=$(OBJDIR) IS_32BIT_PLATFORM=$(IS_32BIT_PLATFORM) $(MAKE) -f $(MAKEFILE_BUILD) test -endif -else - @echo "Skipping perl_MDBM_File test target for non-64-bit platform $(PLATFORM)." - @echo "perl_MDBM_File tests will only be run for 64-bit (x86_64) platforms." -endif -