summaryrefslogtreecommitdiffstats
path: root/cython
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2013-12-13 00:44:17 +0100
committerGravatar Nikias Bassen2013-12-13 00:44:17 +0100
commita798afc8b5b00a43f4b121168e0419df2d398338 (patch)
treec178d7a149028944254511d03f91266ca43cfcbd /cython
parent3b7647499474619b3e24bf01105b6b037887a0ed (diff)
downloadlibplist-a798afc8b5b00a43f4b121168e0419df2d398338.tar.gz
libplist-a798afc8b5b00a43f4b121168e0419df2d398338.tar.bz2
change build system to autotools
Diffstat (limited to 'cython')
-rw-r--r--cython/CMakeLists.txt30
-rw-r--r--cython/Makefile.am31
2 files changed, 31 insertions, 30 deletions
diff --git a/cython/CMakeLists.txt b/cython/CMakeLists.txt
deleted file mode 100644
index eac6bee..0000000
--- a/cython/CMakeLists.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-
-INCLUDE_DIRECTORIES( ${PYTHON_INCLUDE_PATH} ${CMAKE_CURRENT_SOURCE_DIR} )
-
-
-SET(plist_SRC
- ${CMAKE_CURRENT_BINARY_DIR}/plist.c )
-
-SET(plist_HDR
- ${CMAKE_CURRENT_SOURCE_DIR}/plist.pxd )
-
-ADD_CUSTOM_COMMAND(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/plist.c
- COMMAND ${CYTHON_EXECUTABLE} -o ${CMAKE_CURRENT_BINARY_DIR}/plist.c ${CMAKE_CURRENT_SOURCE_DIR}/plist.pyx
- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/plist.pyx ${CMAKE_CURRENT_SOURCE_DIR}/plist.pxd
-)
-
-
-EXEC_PROGRAM("${PYTHON_EXECUTABLE}"
- ARGS "-c 'try:\n import distutils.sysconfig; print distutils.sysconfig.get_python_lib(1,0,\"${CMAKE_INSTALL_PREFIX}\")\nexcept: pass\n'"
- OUTPUT_VARIABLE DISTUTILS_PYTHON_ILIBRARY_PATH
- )
-
-PYTHON_ADD_MODULE(cython_plist plist.c plist_util.c)
-SET_TARGET_PROPERTIES(cython_plist PROPERTIES PREFIX "" OUTPUT_NAME plist)
-TARGET_LINK_LIBRARIES(cython_plist plist ${PYTHON_LIBRARIES})
-
-INSTALL( FILES ${CMAKE_CURRENT_BINARY_DIR}/plist${CMAKE_SHARED_MODULE_SUFFIX}
- DESTINATION ${DISTUTILS_PYTHON_ILIBRARY_PATH} )
-INSTALL( FILES ${CMAKE_CURRENT_SOURCE_DIR}/plist.pxd
- DESTINATION include/plist/cython COMPONENT dev)
diff --git a/cython/Makefile.am b/cython/Makefile.am
new file mode 100644
index 0000000..1dc8a00
--- /dev/null
+++ b/cython/Makefile.am
@@ -0,0 +1,31 @@
+AM_CPPFLAGS = -I$(top_srcdir)/include
+
+AM_CFLAGS = $(GLOBAL_CFLAGS) $(libxml2_CFLAGS)
+AM_LDFLAGS = $(libxml2_LIBS)
+
+if HAVE_CYTHON
+
+BUILT_SOURCES = plist.c
+PXDINCLUDES = plist.pxd $(CYTHON_PLIST_INCLUDE_DIR)/plist.pxd
+PXIINCLUDES =
+
+CLEANFILES = \
+ *.pyc \
+ *.pyo \
+ plist.c
+
+EXTRA_DIST = plist.pyx plist.pxd $(PXIINCLUDES)
+
+plistdir = $(pyexecdir)
+plist_LTLIBRARIES = plist.la
+plist_la_SOURCES = plist_util.c plist_util.h plist.pyx
+plist_la_CFLAGS = -I../include -I../src $(PYTHON_CPPFLAGS) $(AM_CFLAGS) -Wno-shadow -Wno-redundant-decls -Wno-switch-default -Wno-strict-aliasing -Wno-implicit-function-declaration
+plist_la_LDFLAGS = -module -avoid-version -L$(libdir) $(PYTHON_LDFLAGS) $(AM_LDFLAGS)
+plist_la_LIBADD = ../src/libplist.la
+
+plist.c: plist.pyx $(PXDINCLUDES) $(PXIINCLUDES)
+
+.pyx.c:
+ $(CYTHON) -I$(CYTHON_PLIST_INCLUDE_DIR) -I$(top_srcdir)/src -o $@ $<
+
+endif