diff --git a/configure/Makefile b/configure/Makefile index 86c59048e..6c4faf688 100644 --- a/configure/Makefile +++ b/configure/Makefile @@ -23,5 +23,48 @@ CONFIGS += $(subst ../,,$(wildcard ../os/CONFIG*)) CONFIGS += $(subst ../,,$(wildcard ../RELEASE*)) CONFIGS += $(subst ../,,$(wildcard ../RULES*)) +ifdef T_A +ifeq ($(BUILD_CLASS)$(POSIX),HOSTYES) + +FINAL_LOCATION ?= $(shell $(PERL) $(TOOLS)/fullPathName.pl $(INSTALL_LOCATION)) + +INSTALL_PC ?= $(INSTALL_LOCATION)/lib/pkgconfig + +DIRECTORY_TARGETS += $(INSTALL_PC) + +C_CFLAGS += $(filter-out -g,$(filter-out -O%,$(filter-out -W%,$(CPPFLAGS)))) +C_CFLAGS += $(filter-out -g,$(filter-out -O%,$(filter-out -W%,$(CFLAGS)))) + +MVARS += FINAL_LOCATION OS_CLASS CMPLR_CLASS C_CFLAGS LDFLAGS LDLIBS +MVARS += EPICS_VERSION EPICS_REVISION EPICS_MODIFICATION EPICS_MODIFICATION + +EXPANDFLAGS += $(foreach var,$(MVARS),-D$(var)="$(strip $($(var)))") + +endif +endif + include $(TOP)/configure/RULES +ifdef T_A +ifeq ($(BUILD_CLASS)$(POSIX),HOSTYES) + +epics-base-$(T_A).pc: ../epics-base-arch.pc.in +epics-base.pc: ../epics-base.pc.in + +epics-base-$(T_A).pc epics-base.pc: + $(ECHO) "Expanding $< to $@" + @$(RM) $@ + @$(EXPAND_TOOL) $(EXPANDFLAGS) $($@_EXPANDFLAGS) $< $@ + +$(INSTALL_PC)/%: % + $(ECHO) "Installing pkgconfig file $@" + @$(INSTALL) -d -m $(INSTALL_PERMISSIONS) $< $(@D) + +buildInstall: $(INSTALL_PC)/epics-base-$(T_A).pc + +ifeq ($(T_A),$(EPICS_HOST_ARCH)) +buildInstall: $(INSTALL_PC)/epics-base.pc +endif + +endif +endif diff --git a/configure/epics-base-arch.pc.in b/configure/epics-base-arch.pc.in new file mode 100644 index 000000000..b5807abd9 --- /dev/null +++ b/configure/epics-base-arch.pc.in @@ -0,0 +1,24 @@ +# non-standard variables +top=@FINAL_LOCATION@ +arch=@ARCH@ +os_class=@OS_CLASS@ +cmplr_class=@CMPLR_CLASS@ + +includedir_osi=${top}/include +includedir_osd=${top}/include/os/@OS_CLASS@ +includedir_comp=${top}/include/compiler/@CMPLR_CLASS@ + +includedirs=${includedir_osi} ${includedir_osd} ${includedir_comp} + +# standard variables +prefix=@FINAL_LOCATION@ +exec_prefix=@FINAL_LOCATION@ +bindir=${top}/bin/@ARCH@ +libdir=${top}/lib/@ARCH@ + +Name: epics-base-@ARCH@ +Version: @EPICS_VERSION@.@EPICS_REVISION@.@EPICS_MODIFICATION@.@EPICS_MODIFICATION@ +Description: EPICS Base for @ARCH@ +Cflags: -I${includedir_osi} -I${includedir_osd} -I${includedir_comp} @C_CFLAGS@ +Libs: -L${libdir} @LDFLAGS@ +Libs.private: @LDLIBS@ diff --git a/configure/epics-base.pc.in b/configure/epics-base.pc.in new file mode 100644 index 000000000..274594a82 --- /dev/null +++ b/configure/epics-base.pc.in @@ -0,0 +1,22 @@ +# non-standard variables +top=@FINAL_LOCATION@ +arch=@ARCH@ +os_class=@OS_CLASS@ +cmplr_class=@CMPLR_CLASS@ + +includedir_osi=${top}/include +includedir_osd=${top}/include/os/@OS_CLASS@ +includedir_comp=${top}/include/os/@CMPLR_CLASS@ + +includedirs=${includedir_osi} ${includedir_osd} ${includedir_comp} + +# standard variables +prefix=@FINAL_LOCATION@ +exec_prefix=@FINAL_LOCATION@ +bindir=${top}/bin/@ARCH@ +libdir=${top}/lib/@ARCH@ + +Name: epics-base +Version: @EPICS_VERSION@.@EPICS_REVISION@.@EPICS_MODIFICATION@.@EPICS_MODIFICATION@ +Description: EPICS Base for the host arch +Requires: epics-base-@ARCH@ = @EPICS_VERSION@.@EPICS_REVISION@.@EPICS_MODIFICATION@.@EPICS_MODIFICATION@