From e1a8c0582889d979019e710bd0dab6e8dbf77031 Mon Sep 17 00:00:00 2001 From: Mark Lodato Date: Sun, 4 Oct 2009 19:39:07 -0400 Subject: [PATCH] freeze: Makefile: flags from distutils.sysconfig Instead of hard-coding the compiler flags and libraries, extract them from distutils.sysconfig. --- Demos/freeze/Makefile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Demos/freeze/Makefile b/Demos/freeze/Makefile index 9f484e45..2b6dd353 100644 --- a/Demos/freeze/Makefile +++ b/Demos/freeze/Makefile @@ -1,12 +1,16 @@ CC = gcc CYTHON = ../../bin/cython CYTHON_FREEZE = ../../bin/cython_freeze +PYTHON = python + +PY_LDFLAGS = $(shell $(PYTHON) -c 'from distutils.sysconfig import get_config_var as g; print " ".join([g("LINKFORSHARED"), "-L"+g("LIBPL")])') +PY_CPPFLAGS = $(shell $(PYTHON) -c 'from distutils.sysconfig import *; print "-I"+get_python_inc()') +PY_LDLIBS = $(shell $(PYTHON) -c 'from distutils.sysconfig import get_config_var as g; print " ".join(["-lpython"+g("VERSION"), g("SYSLIBS"), g("LIBS"), g("LOCALMODLIBS")])') CFLAGS = -fPIC -g -O2 -Wall -Wextra -CPPFLAGS = -I /usr/include/python2.6 -LDFLAGS = -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions -LDLIBS = /usr/lib/python2.6/config/libpython2.6.a \ - -lm -ldl -pthread -lutil -lz +CPPFLAGS = $(PY_CPPFLAGS) +LDFLAGS = $(PY_LDFLAGS) +LDLIBS = $(PY_LDLIBS) # Name of executable -- 2.26.2