1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
|
if WITH_PYTHON
if CREATING_SHARED_LIBS
###############################################################################
# Case when shared libraries are enabled
###############################################################################
pkgpyexec_LTLIBRARIES = _gribapi_swig.la
_gribapi_swig_la_SOURCES = gribapi_swig_wrap.c grib_interface.c grib_interface.h
_gribapi_swig_la_LIBADD = $(top_builddir)/src/libeccodes.la $(PYTHON_LIBS)
_gribapi_swig_la_LDFLAGS = -module -avoid-version $(PYTHON_LDFLAGS)
INCLUDES = $(PYTHON_INCLUDES) -I$(NUMPY_INCLUDE)
gribapi_swig_wrap.c: swig_wrap_$(PYTHON_DATA_HANDLER).c
ln -s gribapi/gribapi.py
ln -s eccodes/eccodes.py
cp -f swig_wrap_$(PYTHON_DATA_HANDLER).c gribapi_swig_wrap.c
gribapi_swig.py: swig_wrap_$(PYTHON_DATA_HANDLER).py
cp -f swig_wrap_$(PYTHON_DATA_HANDLER).py gribapi_swig.py
# Extra stuff to go into the distribution
EXTRA_DIST = grib_interface.h \
grib_interface.c \
gribapi_swig.i \
gribapi.py \
eccodes.py \
numpy.i \
grib_errors.h \
extrules.am \
dummy.am \
swig_wrap_array.c \
swig_wrap_numpy.c \
swig_wrap_array.py \
swig_wrap_numpy.py \
CMakeLists.txt
# What else I want installed
pkgpyexec_DATA = \
gribapi.py \
eccodes.py \
gribapi_swig.py
CLEANFILES = \
gribapi_swig_wrap.c \
gribapi_swig.py \
_gribapi_swig.la
include $(DEVEL_RULES)
else
###############################################################################
# When shared libraries are disabled.
# Uses the static library so must have --with-pic
###############################################################################
noinst_SCRIPTS = setup.py
CLEANFILES = $(noinst_SCRIPTS) \
gribapi_swig_wrap.c \
gribapi_swig.py \
_gribapi_swig.so
# Extra stuff to go into the distribution
EXTRA_DIST = setup.py.autotools.in \
grib_interface.h \
grib_interface.c \
gribapi_swig.i \
gribapi.py \
eccodes.py \
numpy.i \
grib_errors.h \
extrules.am \
dummy.am \
swig_wrap_array.c \
swig_wrap_numpy.c \
swig_wrap_array.py \
swig_wrap_numpy.py \
CMakeLists.txt
# What I want installed
pdir = $(libdir)/python$(PYTHON_VERSION)/site-packages/eccodes
p_DATA = \
_gribapi_swig.so \
gribapi.py \
eccodes.py \
gribapi_swig.py
do_subst = sed -e 's,[@]LIB_JASPER[@],$(LIB_JASPER),g' \
-e 's,[@]JASPER_DIR[@],$(JASPER_DIR),g' \
-e 's,[@]LIB_OPENJPEG[@],$(LIB_OPENJPEG),g' \
-e 's,[@]OPENJPEG_DIR[@],$(OPENJPEG_DIR),g' \
-e 's,[@]LIB_AEC[@],$(LIB_AEC),g' \
-e 's,[@]AEC_DIR[@],$(AEC_DIR),g' \
-e 's,[@]LIB_PNG[@],$(LIB_PNG),g' \
-e 's,[@]BUILD_DIR[@],$(top_builddir),g' \
-e 's,[@]DATA_HANDLER[@],$(PYTHON_DATA_HANDLER),g'
clean-local:
-rm -rf build
setup.py: setup.py.autotools.in
$(do_subst) < setup.py.autotools.in > setup.py
gribapi_swig_wrap.c: swig_wrap_$(PYTHON_DATA_HANDLER).c
ln -s gribapi/gribapi.py
ln -s eccodes/eccodes.py
cp -f swig_wrap_$(PYTHON_DATA_HANDLER).c gribapi_swig_wrap.c
gribapi_swig.py: swig_wrap_$(PYTHON_DATA_HANDLER).py
cp -f swig_wrap_$(PYTHON_DATA_HANDLER).py gribapi_swig.py
_gribapi_swig.so: setup.py gribapi_swig_wrap.c gribapi_swig.py
$(PYTHON) setup.py build_ext --inplace
include $(DEVEL_RULES)
endif
else
# Case when WITH_PYTHON is not defined. Must add this rule otherwise
# make dist will fail
gribapi_swig_wrap.c: swig_wrap_array.c
cp -f swig_wrap_array.c gribapi_swig_wrap.c
endif
|