summaryrefslogtreecommitdiff
path: root/configure.ac
blob: 008b613783b5acdc75906c325e1f6c7749d57e99 (plain)
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
# Some rules copy-pasted from telepathy-gabble's build system.

AC_PREREQ([2.65])
AC_INIT([codeshare],[0.1],[felix.kaser@collabora.co.uk])
AM_INIT_AUTOMAKE([1.11 dist-bzip2 silent-rules])
AC_CONFIG_MACRO_DIR([m4])
LT_INIT

AC_PROG_CC

#dependencies

PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.16, gobject-2.0 >= 2.16, gthread-2.0 >= 2.16])
PKG_CHECK_MODULES([TP_GLIB], [telepathy-glib >= 0.9.2])
PKG_CHECK_MODULES([GEANY], [geany >= 0.20])
PKG_CHECK_MODULES([GTK], [gtk+-2.0])

#some flag stuff
AS_COMPILER_FLAG(-Wall, ERROR_CFLAGS="-Wall", ERROR_CFLAGS="")
AS_COMPILER_FLAG(-Werror, werror=yes, werror=no)

AC_ARG_ENABLE(Werror,
  AS_HELP_STRING([--disable-Werror],[compile without -Werror (normally enabled in development builds)]),
    werror=$enableval, werror=yes)

AS_COMPILER_FLAG(-Wextra, wextra=yes, wextra=no)
AS_COMPILER_FLAG(-Wno-missing-field-initializers,
        wno_missing_field_initializers=yes,
        wno_missing_field_initializers=no)
AS_COMPILER_FLAG(-Wno-unused-parameter,
        wno_unused_parameter=yes,
        wno_unused_parameter=no)

if test x$werror = xyes; then
    ERROR_CFLAGS="$ERROR_CFLAGS -Werror"
fi
if test x$wextra = xyes -a \
    x$wno_missing_field_initializers = xyes -a \
    x$wno_unused_parameter = xyes; then
    ERROR_CFLAGS="$ERROR_CFLAGS -Wextra -Wno-missing-field-initializers -Wno-unused-parameter"
fi

AS_COMPILER_FLAG(-D_POSIX_SOURCE, ERROR_CFLAGS="$ERROR_CFLAGS -D_POSIX_SOURCE")
AS_COMPILER_FLAG(-std=c99, ERROR_CFLAGS="$ERROR_CFLAGS -std=c99")
AS_COMPILER_FLAG(-Wshadow, ERROR_CFLAGS="$ERROR_CFLAGS -Wshadow")
AS_COMPILER_FLAG(-Wmissing-prototypes, ERROR_CFLAGS="$ERROR_CFLAGS -Wmissing-prototypes")
AS_COMPILER_FLAG(-Wmissing-declarations, ERROR_CFLAGS="$ERROR_CFLAGS -Wmissing-declarations")
AS_COMPILER_FLAG(-Wstrict-prototypes, ERROR_CFLAGS="$ERROR_CFLAGS -Wstrict-prototypes")

AC_SUBST(ERROR_CFLAGS)

#final output

AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([
        Makefile
])
AC_OUTPUT