forked from scanmem/scanmem
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
142 lines (118 loc) · 3.64 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# $Id: configure.ac,v 1.1 2007/06/04 22:51:13 taviso Exp $
AC_INIT([scanmem],[0.15.2],[https://github.com/scanmem/scanmem])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([-Wall -Werror -Wno-extra-portability foreign])
AC_CONFIG_SRCDIR([main.c])
AC_CONFIG_HEADER([config.h])
AC_USE_SYSTEM_EXTENSIONS
AC_HEADER_STDBOOL
LT_INIT
IT_PROG_INTLTOOL
AC_CHECK_FUNCS(memset strcasecmp strchr strdup strerror strtoul)
AC_CHECK_HEADERS(fcntl.h limits.h stddef.h sys/time.h)
AC_FUNC_ALLOCA
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_FUNC_STRTOD
AC_TYPE_INT8_T
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_INT64_T
AC_TYPE_UINT8_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_C_BIGENDIAN
# also need to check if the file is zero'ed (some hardened systems)
AC_CHECK_FILE([/proc/self/maps], [], [
echo "This system does not seem to have /proc/pid/maps files."
exit 1
])
# also need to check this file works
AC_CHECK_FILE([/proc/self/mem], [
# LARGEFILE support required for this to work
AC_SYS_LARGEFILE
AC_DEFINE(HAVE_PROCMEM, [1], [Enable /proc/pid/mem support])
],[
# This will hurt performance.
echo "This system does not seem to have /proc/pid/mem files."
echo "Falling back to ptrace() only support."
AC_DEFINE(HAVE_PROCMEM, [0], [Enable /proc/pid/mem support])
])
# copied from ubuntu-tweak
dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR)
dnl
dnl example
dnl AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
dnl will set SYSCONFDIR to /usr/local/etc if prefix=/usr/local
AC_DEFUN([AS_AC_EXPAND],
[
EXP_VAR=[$1]
FROM_VAR=[$2]
dnl first expand prefix and exec_prefix if necessary
prefix_save=$prefix
exec_prefix_save=$exec_prefix
dnl if no prefix given, then use /usr/local, the default prefix
if test "x$prefix" = "xNONE"; then
prefix=$ac_default_prefix
fi
dnl if no exec_prefix given, then use prefix
if test "x$exec_prefix" = "xNONE"; then
exec_prefix=$prefix
fi
full_var="$FROM_VAR"
dnl loop until it doesn't change anymore
while true; do
new_full_var="`eval echo $full_var`"
if test "x$new_full_var" = "x$full_var"; then break; fi
full_var=$new_full_var
done
dnl clean up
full_var=$new_full_var
AC_SUBST([$1], "$full_var")
dnl restore prefix and exec_prefix
prefix=$prefix_save
exec_prefix=$exec_prefix_save
])
# end copy
AS_AC_EXPAND(PKGDATADIR, $datadir/gameconqueror)
GETTEXT_PACKAGE=GameConqueror
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"],
[The domain to use with gettext])
AS_AC_EXPAND(LOCALEDIR, $localedir)
AC_CONFIG_FILES([
Makefile
po/Makefile.in
])
AC_ARG_ENABLE(gui, [AS_HELP_STRING([--enable-gui],
[enable gameconqueror, the gui front-end of scanmem])])
AM_CONDITIONAL([ENABLE_GUI], [test "x$enable_gui" = "xyes"])
AS_IF([test "x$enable_gui" = "xyes"], [
AM_PATH_PYTHON([2.7])
AC_CONFIG_FILES([
gui/Makefile
gui/icons/Makefile
gui/consts.py
gui/gameconqueror
gui/org.freedesktop.gameconqueror.policy.in
])
])
# Check for termcap and readline or bypass checking for the libraries.
AC_ARG_WITH([readline], [AS_HELP_STRING([--without-readline],
[build without readline])])
AM_CONDITIONAL([WITH_READLINE], [test "x$with_readline" != "xno"])
AS_IF([test "x$with_readline" != "xno"], [
# termcap is sometimes required by readline
AC_CHECK_LIB([termcap], [tgetent], [], [])
AC_CHECK_LIB([readline], [readline], [], [
echo "libreadline could not be found, which is required to continue."
echo "The libreadline-dev package may be required."
exit 1
])
])
AC_OUTPUT