install python config

Usable by 3rd party modules.
Fix python3 stuff
This commit is contained in:
Michael Davidsaver
2013-12-10 20:22:57 -05:00
parent 52aa46621a
commit fb4d7a0c6f
6 changed files with 37 additions and 22 deletions

1
.gitignore vendored
View File

@ -11,3 +11,4 @@ dbd
python* python*
_build _build
envPaths envPaths
configure/os

View File

@ -2,19 +2,27 @@ PYMODULE ?= YES
ifneq ($(T_A),) ifneq ($(T_A),)
include $(TOP)/configure/O.$(T_A)/CONFIG_PY -include $(dir $(lastword $(MAKEFILE_LIST)))/os/CONFIG_PY.$(EPICS_HOST_ARCH).Common
-include $(dir $(lastword $(MAKEFILE_LIST)))/os/CONFIG_PY.Common.$(T_A)
-include $(dir $(lastword $(MAKEFILE_LIST)))/os/CONFIG_PY.$(EPICS_HOST_ARCH).$(T_A)
ifneq ($(PY_OK),YES) ifneq ($(PY_OK),YES)
$(error Unable to get python configuration) $(error Unable to get generated python configuration)
endif endif
USR_CPPFLAGS += $(PY_INCDIRS:%=-I%) PYTHON ?= python$(PY_VER)
USR_LDFLAGS += $(PY_LIBDIRS:%=-L%)
SHRLIB_DEPLIB_DIRS += $(PY_LIBDIRS)
PROD_DEPLIB_DIRS += $(PY_LIBDIRS)
INCLUDES += $(PY_INCDIRS:%=-I%)
ifeq ($(HAVE_NUMPY),YES) ifeq ($(HAVE_NUMPY),YES)
USR_CPPFLAGS += -DHAVE_NUMPY TARGET_CPPFLAGS += -DHAVE_NUMPY
endif endif
LIB_SYS_LIBS += python$(PY_VER) LIB_SYS_LIBS += python$(PY_LD_VER)
PROD_SYS_LIBS += python$(PY_LD_VER)
PY_INSTALL_DIR = $(INSTALL_LOCATION)/python$(PY_VER)/$(T_A) PY_INSTALL_DIR = $(INSTALL_LOCATION)/python$(PY_VER)/$(T_A)

View File

@ -32,4 +32,6 @@ CHECK_RELEASE = YES
# take effect. # take effect.
#IOCS_APPL_TOP = </IOC/path/to/application/top> #IOCS_APPL_TOP = </IOC/path/to/application/top>
# Module will be build against this version of the
# Python interpreter
PYTHON ?= python PYTHON ?= python

View File

@ -3,14 +3,19 @@ TOP=..
include $(TOP)/configure/CONFIG include $(TOP)/configure/CONFIG
TARGETS = $(CONFIG_TARGETS) TARGETS = $(CONFIG_TARGETS)
CONFIGS += $(subst ../,,$(wildcard $(CONFIG_INSTALLS)))
TARGETS += CONFIG_PY RULES_PY ifdef T_A
CONFIGS = CONFIG_PY RULES_PY os/CONFIG_PY.Common.$(T_A)
endif
include $(TOP)/configure/RULES include $(TOP)/configure/RULES
CONFIG_PY: $(TOP)/makehelper.py os/CONFIG_PY.Common.%: $(TOP)/makehelper.py
[ -d $(dir $@) ] || $(MKDIR) $(dir $@)
$(PYTHON) $< $@ $(PYTHON) $< $@
RULES_PY: ../RULES_PY realclean:: py_clean
install -m644 $< $@ clean:: py_clean
py_clean:
$(RMDIR) os

View File

@ -10,23 +10,23 @@ include $(TOP)/configure/CONFIG_PY
#============================= #=============================
# Build the IOC application # Build the IOC application
LIBRARY = pyDevSup$(PY_VER) LIBRARY = pyDevSup$(PY_LD_VER)
SHRLIB_VERSION = 0 SHRLIB_VERSION = 0
DBD += pyDevSup.dbd DBD += pyDevSup.dbd
pyDevSup$(PY_VER)_SYS_LIBS += python$(PY_VER) pyDevSup$(PY_LD_VER)_SYS_LIBS += python$(PY_LD_VER)
setup_CPPFLAGS += -DXEPICS_ARCH=\"$(T_A)\" setup_CPPFLAGS += -DXEPICS_ARCH=\"$(T_A)\"
setup_CPPFLAGS += -DXPYDEV_BASE=\"$(abspath $(INSTALL_LOCATION))\" setup_CPPFLAGS += -DXPYDEV_BASE=\"$(abspath $(INSTALL_LOCATION))\"
setup_CPPFLAGS += -DXEPICS_BASE=\"$(EPICS_BASE)\" setup_CPPFLAGS += -DXEPICS_BASE=\"$(EPICS_BASE)\"
setup_CPPFLAGS += -DPYDIR=\"python$(PY_VER)\" setup_CPPFLAGS += -DPYDIR=\"python$(PY_VER)\"
pyDevSup$(PY_VER)_SRCS += setup.c pyDevSup$(PY_LD_VER)_SRCS += setup.c
pyDevSup$(PY_VER)_SRCS += dbrec.c pyDevSup$(PY_LD_VER)_SRCS += dbrec.c
pyDevSup$(PY_VER)_SRCS += dbfield.c pyDevSup$(PY_LD_VER)_SRCS += dbfield.c
pyDevSup$(PY_VER)_SRCS += dbdset.c pyDevSup$(PY_LD_VER)_SRCS += dbdset.c
PROD_IOC = softIocPy PROD_IOC = softIocPy
@ -37,9 +37,7 @@ DBD += softIocPy.dbd
softIocPy_DBD += base.dbd softIocPy_DBD += base.dbd
softIocPy_DBD += pyDevSup.dbd softIocPy_DBD += pyDevSup.dbd
softIocPy_LIBS += pyDevSup$(PY_VER) softIocPy_LIBS += pyDevSup$(PY_LD_VER)
softIocPy_SYS_LIBS += python$(PY_VER)
# softIocPy_registerRecordDeviceDriver.cpp derives from softIocPy.dbd # softIocPy_registerRecordDeviceDriver.cpp derives from softIocPy.dbd
softIocPy_SRCS += softIocPy_registerRecordDeviceDriver.cpp softIocPy_SRCS += softIocPy_registerRecordDeviceDriver.cpp

View File

@ -36,10 +36,11 @@ except ImportError:
incdirs = [get_python_inc()]+get_numpy_include_dirs() incdirs = [get_python_inc()]+get_numpy_include_dirs()
libdirs = [get_config_var('LIBDIR')] libdirs = [get_config_var('LIBDIR')]
print('USR_CFLAGS +=',get_config_var('BASECFLAGS'), file=out) print('TARGET_CFLAGS +=',get_config_var('BASECFLAGS'), file=out)
print('USR_CXXFLAGS +=',get_config_var('BASECFLAGS'), file=out) print('TARGET_CXXFLAGS +=',get_config_var('BASECFLAGS'), file=out)
print('PY_VER :=',get_config_var('VERSION'), file=out) print('PY_VER :=',get_config_var('VERSION'), file=out)
print('PY_LD_VER :=',get_config_var('LDVERSION') or get_config_var('VERSION'), file=out)
print('PY_INCDIRS :=',' '.join(incdirs), file=out) print('PY_INCDIRS :=',' '.join(incdirs), file=out)
print('PY_LIBDIRS :=',' '.join(libdirs), file=out) print('PY_LIBDIRS :=',' '.join(libdirs), file=out)
print('HAVE_NUMPY :=',have_np, file=out) print('HAVE_NUMPY :=',have_np, file=out)