From 9ef3b773486128f157bae6ff2931bf5ffcd44537 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Fri, 1 Feb 2019 16:14:45 -0600 Subject: [PATCH] Fix ca/client/perl/Makefile for macOS Mojave ... in which Apple moved the Perl headers into XCode. This should also make the build a little more forgiving on other architectures that have incomplete Perl installations; it gives up trying to build the Perl bindings with a warning if perl.h is missing. --- src/ca/client/perl/Makefile | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/src/ca/client/perl/Makefile b/src/ca/client/perl/Makefile index 9b61b3b32..98352b2e7 100644 --- a/src/ca/client/perl/Makefile +++ b/src/ca/client/perl/Makefile @@ -8,6 +8,18 @@ TOP=../../../.. include $(TOP)/configure/CONFIG +ifdef T_A + PERL_VERSION = $(shell $(PERL) ../perlConfig.pl version) + PERL_ARCHNAME = $(shell $(PERL) ../perlConfig.pl archname) + PERL_ARCHPATH := $(PERL_VERSION)/$(PERL_ARCHNAME) + + PERL_ARCHLIB := $(shell $(PERL) ../perlConfig.pl archlib) + PERL_h = $(PERL_ARCHLIB)/CORE/perl.h + + EXTUTILS := $(shell $(PERL) ../perlConfig.pl privlib)/ExtUtils + PERLBIN := $(shell $(PERL) ../perlConfig.pl bin) + XSUBPP := $(firstword $(wildcard $(PERLBIN)/xsubpp $(EXTUTILS)/xsubpp)) + # Special settings for Darwin: ifeq ($(OS_CLASS),Darwin) # Use hdepends command (not GNU compiler flags) @@ -18,22 +30,23 @@ ifeq ($(OS_CLASS),Darwin) # Perl loadable libraries on Darwin have funny names LOADABLE_SHRLIB_PREFIX = LOADABLE_SHRLIB_SUFFIX = .$(shell $(PERL) ../perlConfig.pl dlext) + +ifeq ($(wildcard $(PERL_h)),) + # Perl's headers moved in Mojave + SDK_PATH := $(shell xcodebuild -version -sdk macosx Path) + PERL_ARCHLIB := $(SDK_PATH)/$(PERL_ARCHLIB) +endif endif -ifdef T_A - PERL_VERSION = $(shell $(PERL) ../perlConfig.pl version) - PERL_ARCHNAME = $(shell $(PERL) ../perlConfig.pl archname) - PERL_ARCHPATH := $(PERL_VERSION)/$(PERL_ARCHNAME) - - EXTUTILS := $(shell $(PERL) ../perlConfig.pl privlib)/ExtUtils - PERLBIN := $(shell $(PERL) ../perlConfig.pl bin) - XSUBPP := $(firstword $(wildcard $(PERLBIN)/xsubpp $(EXTUTILS)/xsubpp)) - +ifeq ($(T_A),$(EPICS_HOST_ARCH)) # No cross-builds (wrong Perl!) ifeq ($(strip $(XSUBPP)),) $(warning Perl's xsubpp program was not found.) $(warning The Perl CA module will not be built.) else -ifeq ($(T_A),$(EPICS_HOST_ARCH)) # No cross-builds (wrong Perl!) +ifeq ($(wildcard $(PERL_h)),) + $(warning Perl's C header files were not found.) + $(warning The Perl CA module will not be built.) +else ifeq ($(findstring $(OS_CLASS),WIN32 cygwin32),) # Doesn't build on WIN32 LOADABLE_LIBRARY_HOST = Cap5 @@ -52,10 +65,11 @@ endif endif endif endif +endif Cap5_SRCS = Cap5.xs Cap5_LIBS = ca Com -Cap5_INCLUDES = -I$(shell $(PERL) ../perlConfig.pl archlib)/CORE +Cap5_INCLUDES = -I$(PERL_ARCHLIB)/CORE Cap5_CFLAGS = $(shell $(PERL) ../perlConfig.pl ccflags) CLEANS += Cap5.c