File: configure.ac

package info (click to toggle)
scanmem 0.12-2
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 1,192 kB
  • sloc: ansic: 3,820; python: 1,436; xml: 1,295; sh: 1,034; exp: 342; makefile: 32
file content (123 lines) | stat: -rw-r--r-- 3,167 bytes parent folder | download
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
# $Id: configure.ac,v 1.1 2007/06/04 22:51:13 taviso Exp $
AC_INIT([scanmem], [0.12], [http://code.google.com/p/scanmem/])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AC_CONFIG_SRCDIR([main.c])
AC_CONFIG_HEADER([config.h])
AC_GNU_SOURCE
AC_HEADER_STDBOOL

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


# check if termcap is present, sometimes required by readline
AC_CHECK_LIB([termcap], [tgetent], [], [])

# check for libreadline
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
])

# 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)

AC_CONFIG_FILES([ 
                Makefile 
                test/Makefile
                ])

AC_ARG_ENABLE(gui, [AS_HELP_STRING([--enable-gui],
                            [enable gameconqueror, the gui front-end of scanmem])],
                 [enable_gui=true
                  AC_CONFIG_FILES([
                 gui/Makefile
                 gui/consts.py
                 gui/gameconqueror
                 ])],
                 [enable_gui=false]
                 )

AM_CONDITIONAL([ENABLE_GUI], [test x$enable_gui = xtrue])
AC_OUTPUT