~unity-team/dee/mypy

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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
m4_define([dee_major], [0])
m4_define([dee_minor], [4])
m4_define([dee_micro], [1])

m4_define([dee_api],
          [dee_major.dee_minor])
m4_define([dee_version],
          [dee_major.dee_minor.dee_micro])

m4_define([dee_interface_age], [0])
m4_define([dee_binary_age],
          [m4_eval(100 * dee_minor + dee_micro)])

AC_PREREQ(2.65)

AC_INIT([dee],[dee_version],[https://bugs.launchpad.net/avani])
AC_CONFIG_SRCDIR([dee/dee.h])
AC_CONFIG_MACRO_DIR([build/autotools])

AC_CONFIG_HEADERS([config.h])

AM_INIT_AUTOMAKE([1.9])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])

DEE_MAJOR_VERSION=dee_major
DEE_MINOR_VERSION=dee_minor
DEE_MICRO_VERSION=dee_micro
DEE_VERSION=dee_version
AC_SUBST(DEE_MAJOR_VERSION)
AC_SUBST(DEE_MINOR_VERSION)
AC_SUBST(DEE_MICRO_VERSION)
AC_SUBST(DEE_VERSION)

m4_define([lt_current],
          [m4_eval(100 * dee_minor + dee_micro - dee_interface_age)])
m4_define([lt_revision], [dee_interface_age])
m4_define([lt_age], [m4_eval(dee_binary_age - dee_interface_age)])
DEE_LT_CURRENT=lt_current
DEE_LT_REV=lt_revision
DEE_LT_AGE=lt_age
DEE_LT_VERSION="$DEE_LT_CURRENT:$DEE_LT_REV:$DEE_LT_AGE"
DEE_LT_LDFLAGS="-version-info $DEE_LT_VERSION -export-symbols-regex '^dee_.*'"

AC_SUBST(DEE_LT_VERSION)
AC_SUBST(DEE_LT_LDFLAGS)

dnl ===========================================================================

# Checks for programs
AC_PROG_CC
AM_PROG_CC_C_O
AC_DISABLE_STATIC
LT_INIT

# Checks for header files
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h])

# Checks for typedefs, structures and compiler charecteristics
AC_C_CONST

# Checks for library functions
AC_FUNC_MALLOC
AC_FUNC_MMAP
AC_CHECK_FUNCS([memset munmap strcasecmp strdup])

PKG_CHECK_MODULES(DEE,
                  glib-2.0     >= 2.22
                  gthread-2.0  >= 2.22
                  gobject-2.0  >= 2.22
                  gio-2.0      >= 2.22
                  gio-unix-2.0 >= 2.22
                  dbus-glib-1  >= 0.80
                  dbus-1       >= 1.0
                 )
AC_SUBST(DEE_CFLAGS)
AC_SUBST(DEE_LIBS)

dnl ===========================================================================

if test "x$GCC" = "xyes"; then
  GCC_FLAGS="-g -Wall"
fi
AC_SUBST(GCC_FLAGS)

dnl = use strict compiler flags only on development releases ==================
m4_define([maintainer_flags_default], [m4_if(m4_eval(dee_micro  % 2), [1], [yes], [no])])
AC_ARG_ENABLE([maintainer-flags],
              [AS_HELP_STRING([--enable-maintainer-flags=@<:@no/yes@:>@],[Use strict compiler flags @<:@default=no@:>@])],
              [],
              [enable_maintainer_flags=maintainer_flags_default])

MAINTAINER_CFLAGS=""
AS_IF([test "x$enable_maintainer_flags" = "xyes" && test "x$GCC" = "xyes"],
      [
        MAINTAINER_CFLAGS="-Werror -Wall -Wcast-align -Wno-uninitialized -Wempty-body -Wformat-security -Winit-self"
      ]
)

AC_SUBST(MAINTAINER_CFLAGS)

dnl = GObject Introspection Check =============================================
GOBJECT_INTROSPECTION_CHECK([0.6.3])

dnl = GTK Doc Check ===========================================================
GTK_DOC_CHECK([1.8])

dnl = Check for GLib Test Extensions (GTX) ====================================
PKG_CHECK_MODULES(GTX, [ gtx >= 0.2.2 ],
                  [have_gtx=yes], [have_gtx=no])
AC_SUBST(GTX_CFLAGS)
AC_SUBST(GTX_LIBS)

if test "$have_gtx" = "yes" ; then
   AC_DEFINE(HAVE_GTX, 1, [Define to 1 if we have GLib Test Extensions])
fi

AM_CONDITIONAL(HAVE_GTX, test "$have_gtx" = "yes")

dnl = Check if we should compile with trace logging ===========================
AC_ARG_ENABLE([trace-log],
              AS_HELP_STRING([--enable-trace-log],[build with very verbose logging]),,
              [enable_trace_log=no])

if test "x$enable_trace_log" = "xyes"; then
	AC_DEFINE(ENABLE_TRACE_LOG, 1, [build with vert verbose logging])
fi

AM_CONDITIONAL(ENABLE_TRACE_LOG, test "$enable_trace_log" = "yes")

dnl ===========================================================================

AC_PATH_PROG(GLIB_MKENUMS, glib-mkenums)
AC_SUBST(GLIB_MKENUMS)

AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
AC_SUBST(GLIB_GENMARSHAL)

dnl ===========================================================================

AC_PATH_PROG([VALA_API_GEN], [vapigen])

dnl ===========================================================================
AC_OUTPUT([
  Makefile
  build/Makefile
  build/autotools/Makefile
  dee/Makefile
  doc/Makefile
  doc/reference/Makefile
  doc/reference/dee-1.0/Makefile
  dee-1.0.pc
  tests/Makefile
  examples/Makefile
  vapi/Makefile
])

AC_OUTPUT

dnl Output the results
AC_MSG_NOTICE([

  dee $VERSION
  ----------------

  Prefix         : ${prefix}

  Documentation  : ${enable_gtk_doc}
  Introspection  : ${enable_introspection}

  Extended Tests : ${have_gtx}
  Verbose logging: ${enable_trace_log}

  Extra CFlags   : ${CPPFLAGS} $MAINTAINER_CFLAGS
  Extra ValaFlags: ${CPPFLAGS} $MAINTAINER_VALAFLAGS
])