mirror of
https://github.com/sshuttle/sshuttle.git
synced 2025-02-07 22:21:13 +01:00
Use python-config to compile with latest Python version.
For OS X systems without Python 2.5, runpython.c does not compile. Use python-config to get the paths for the latest version.
This commit is contained in:
parent
36378efe5e
commit
b8e150fc4d
@ -6,7 +6,7 @@
|
||||
* NSApplicationMain() looks for Info.plist using the path in argv[0], which
|
||||
* goes wrong if your interpreter is /usr/bin/python.
|
||||
*/
|
||||
#include <Python.h>
|
||||
#include <Python/Python.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
|
@ -2,14 +2,19 @@ exec >&2
|
||||
redo-ifchange runpython.c
|
||||
ARCHES=""
|
||||
printf "Platforms: "
|
||||
for d in /usr/libexec/gcc/darwin/*; do
|
||||
PLAT=$(basename "$d")
|
||||
[ "$PLAT" != "ppc64" ] || continue # fails for some reason on my Mac
|
||||
ARCHES="$ARCHES -arch $PLAT"
|
||||
printf "$PLAT "
|
||||
done
|
||||
if [ -d /usr/libexec/gcc/darwin ]; then
|
||||
for d in /usr/libexec/gcc/darwin/*; do
|
||||
PLAT=$(basename "$d")
|
||||
[ "$PLAT" != "ppc64" ] || continue # fails for some reason on my Mac
|
||||
ARCHES="$ARCHES -arch $PLAT"
|
||||
printf "$PLAT "
|
||||
done
|
||||
fi
|
||||
printf "\n"
|
||||
PYTHON_LDFLAGS=$(python-config --ldflags)
|
||||
PYTHON_INCLUDES=$(python-config --includes)
|
||||
gcc $ARCHES \
|
||||
-Wall -o $3 runpython.c \
|
||||
-I/usr/include/python2.5 \
|
||||
-lpython2.5
|
||||
-Wall -o $3 runpython.c \
|
||||
$PYTHON_INCLUDES \
|
||||
$PYTHON_LDFLAGS \
|
||||
-framework Python
|
||||
|
Loading…
Reference in New Issue
Block a user