forked from Axosoft/nsfw
-
Notifications
You must be signed in to change notification settings - Fork 3
/
configure.ac
116 lines (100 loc) · 2.21 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
AC_INIT([sfw], [1.0])
AC_CONFIG_SRCDIR([README.md])
AC_CONFIG_HEADERS([src/config.h])
AC_CONFIG_MACRO_DIRS([m4])
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE([foreign subdir-objects])
AM_MAINTAINER_MODE
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_CXX
AX_CXX_COMPILE_STDCXX_11
LT_INIT
OS="unknown"
ARCH="unknown"
case "$target_cpu" in
x86_64 | amd64)
ARCH=64
;;
i*86)
ARCH=32
;;
arm64 | aarch64)
ARCH=64
;;
arm)
ARCH=32
;;
*)
AC_MSG_ERROR([$target_cpu is not supported!])
;;
esac
INCLUDE_PATHS="src src/sfw/includes"
CFLAGS="$CFLAGS -fPIC"
CPPFLAGS="$CPPFLAGS -fPIC"
LDFLAGS="$LDFLAGS -fPIC"
case "$target_os" in
mingw* | cygwin*)
OS=win
AC_DEFINE([TARGET_WIN], [1], [ ])
INCLUDE_PATHS="$INCLUDE_PATHS src/sfw/includes/win32"
;;
linux*)
OS=linux
AC_DEFINE([TARGET_LINUX], [1], [ ])
INCLUDE_PATHS="$INCLUDE_PATHS src/sfw/includes/linux"
;;
darwin*)
OS=mac
AC_DEFINE([TARGET_MAC], [1], [ ])
INCLUDE_PATHS="$INCLUDE_PATHS src/sfw/includes/osx"
LDFLAGS="$LDFLAGS -undefined suppress -flat_namespace"
;;
*)
AC_MSG_ERROR([$target_os is not supported!])
;;
esac
case "$ARCH" in
64)
AC_DEFINE(OPA_SIZEOF_VOID_P, 8, [64 bit architecture detected])
;;
32)
AC_DEFINE(OPA_SIZEOF_VOID_P, 4, [32 bit architecture detected])
;;
esac
case "$OS" in
linux | mac)
AC_DEFINE([OPA_HAVE_GCC_INTRINSIC_ATOMICS], [1], [ ])
AC_DEFINE([HAVE_STDDEF_H], [1], [ ])
AC_DEFINE([HAVE_STDLIB_H], [1], [ ])
AC_DEFINE([HAVE_UNISTD_H], [1], [ ])
;;
esac
AM_CONDITIONAL(TARGET_32, [test x$ARCH = x32])
AM_CONDITIONAL(TARGET_64, [test x$ARCH = x64])
AM_CONDITIONAL(TARGET_WIN, [test x$OS = xwin])
AM_CONDITIONAL(TARGET_LINUX, [test x$OS = xlinux])
AM_CONDITIONAL(TARGET_MAC, [test x$OS = xmac])
AM_CONDITIONAL(TARGET_UNIX, [test x$OS = xlinux || test x$OS = xmac])
AC_SUBST(CFLAGS)
AC_SUBST(CPPFLAGS)
AC_SUBST(LDFLAGS)
AC_SUBST(INCLUDE_PATHS)
AC_CONFIG_FILES([
Makefile
src/Makefile
src/sfw/Makefile
src/bindings/Makefile
src/bindings/sfw.net/Makefile
tests/Makefile
tests/test-console/Makefile
tests/sfw.net.TestConsole/Makefile
])
AC_CONFIG_COMMANDS([default],[[ echo timestamp > stamp-h ]],[[]])
AC_OUTPUT
cat <<EOF
Configuration summary
---------------------
* Installation prefix: ${prefix}
EOF