forked from kubo/funchook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
61 lines (53 loc) · 1.08 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
AC_INIT([funchook], [0.1])
AC_PROG_CC
AC_GNU_SOURCE
AC_CANONICAL_HOST
if test "$GCC"; then
CFLAGS="$CFLAGS -Wall -fvisibility=hidden"
fi
AC_CHECK_SIZEOF(void*)
if test "$ac_cv_sizeof_voidp" = 4; then
FUNCHOOK_CPU=x86
else
FUNCHOOK_CPU=x86_64
fi
AC_SUBST(FUNCHOOK_CPU)
IF_WIN32='#'
IF_LINUX='#'
IF_OSX='#'
if test "$EXEEXT"; then
FUNCHOOK_OS=windows
LIBFUNCHOOK_SO=funchook.dll
CFLAGS="$CFLAGS -DFUNCHOOK_EXPORTS"
LINK_SHARED="\$(CC) -shared -Wl,--out-implib,funchook.lib"
IF_WIN32=
else
FUNCHOOK_OS=unix
PIC_CFLAGS="-fPIC"
LINK_SHARED="\$(CC) -shared"
LINK_STATIC="ar rcs"
LIBFUNCHOOK_A=libfunchook.a
case "$host_os" in
linux*)
LIBFUNCHOOK_SO=libfunchook.so
LIBS="-ldl"
IF_LINUX=
;;
darwin*)
LIBFUNCHOOK_SO=libfunchook.dylib
IF_OSX=
;;
esac
fi
AC_SUBST(FUNCHOOK_OS)
AC_SUBST(LIBFUNCHOOK_SO)
AC_SUBST(LIBFUNCHOOK_A)
AC_SUBST(LINK_SHARED)
AC_SUBST(LINK_STATIC)
AC_SUBST(PIC_CFLAGS)
AC_SUBST(IF_WIN32)
AC_SUBST(IF_LINUX)
AC_SUBST(IF_OSX)
AC_CONFIG_HEADERS([src/config.h])
AC_CONFIG_FILES([Makefile src/Makefile test/Makefile])
AC_OUTPUT