forked from frida/frida-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
74 lines (64 loc) · 2.15 KB
/
configure.ac
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
AC_INIT([frida-python], [1.0.0])
AC_CONFIG_SRCDIR([src/_frida.c])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE([-Wall -Werror no-dist-gzip dist-bzip2 foreign])
# Enable silent rules if available
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AM_MAINTAINER_MODE
AM_PROG_AR
AC_PROG_INSTALL
LT_INIT
case $host_os in
darwin*) HAVE_DARWIN=yes ;;
*) ;;
esac
if echo $CC | grep -q "gcc"; then
CFLAGS="$CFLAGS -fno-strict-aliasing"
fi
AM_PATH_PYTHON([2.6],, [AC_ERROR([Python is required])])
PYTHON_PREFIX=$($PYTHON -c 'import sys; print(sys.prefix)')
PYTHON_EXEC_PREFIX=$($PYTHON -c 'import sys; print(sys.exec_prefix)')
PYTHON_ABIFLAGS=$($PYTHON -c 'import sys; print(getattr(sys, "abiflags", ""))')
PYTHON_CFLAGS=""
PYTHON_LDFLAGS=""
PYTHON_LIBS=""
AC_DEFUN([ADD_PYTHON_INCDIR], [
if [[ -d "$1" ]]; then
PYTHON_CFLAGS="$PYTHON_CFLAGS -I\"$1\""
fi
])
AC_DEFUN([ADD_PYTHON_LIBDIR], [
if [[ -d "$1" ]]; then
PYTHON_LIBS="$PYTHON_LIBS -L\"$1\""
fi
])
ADD_PYTHON_INCDIR([${PYTHON_PREFIX}/include/python${PYTHON_VERSION}${PYTHON_ABIFLAGS}/])
ADD_PYTHON_LIBDIR([${PYTHON_PREFIX}/lib/])
ADD_PYTHON_LIBDIR([${PYTHON_PREFIX}/lib/python${PYTHON_VERSION}/config/])
ADD_PYTHON_LIBDIR([${PYTHON_PREFIX}/lib/python${PYTHON_VERSION}/config-${PYTHON_VERSION}${PYTHON_ABIFLAGS}/])
if [[ "$PYTHON_EXEC_PREFIX" != "$PYTHON_PREFIX" ]]; then
ADD_PYTHON_INCDIR([${PYTHON_EXEC_PREFIX}/include/python${PYTHON_VERSION}${PYTHON_ABIFLAGS}/])
ADD_PYTHON_LIBDIR([${PYTHON_EXEC_PREFIX}/lib/])
ADD_PYTHON_LIBDIR([${PYTHON_EXEC_PREFIX}/lib/python${PYTHON_VERSION}/config/])
ADD_PYTHON_LIBDIR([${PYTHON_EXEC_PREFIX}/lib/python${PYTHON_VERSION}/config-${PYTHON_VERSION}${PYTHON_ABIFLAGS}/])
fi
if [[ "x$HAVE_DARWIN" != "xyes" ]]; then
PYTHON_LIBS="$PYTHON_LIBS -lpython${PYTHON_VERSION}${PYTHON_ABIFLAGS}"
fi
AC_SUBST(PYTHON_CFLAGS)
AC_SUBST(PYTHON_LDFLAGS)
AC_SUBST(PYTHON_LIBS)
PKG_CHECK_MODULES(PYFRIDA, ["frida-core-1.0"])
AC_SUBST(PYFRIDA_CFLAGS)
AC_SUBST(PYFRIDA_LDFLAGS)
AC_SUBST(PYFRIDA_LIBS)
AC_CONFIG_FILES([
Makefile
src/Makefile
src/frida/Makefile
src/scripts/Makefile
])
AC_OUTPUT