~macslow/notify-osd/make-distcheck-pain

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
AC_INIT(notify-osd, 0.9.15, dx-team@canonical.com)

AC_CONFIG_SRCDIR(src/main.c)
AC_CONFIG_HEADERS(config.h)
AC_CONFIG_MACRO_DIR([m4])

AM_INIT_AUTOMAKE
GNOME_COMMON_INIT
GNOME_COMPILE_WARNINGS(maximum)

AM_MAINTAINER_MODE
AM_DISABLE_STATIC
AM_PROG_LIBTOOL
AC_SUBST(ACLOCAL_AMFLAGS, "$ACLOCAL_FLAGS -I m4")
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_INSTALL

#
# pkg-config
#
PKG_PROG_PKG_CONFIG

#
# glib, we need 2.16.0 for the unit-tests
#
PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.16.0 gthread-2.0 gconf-2.0 gio-2.0])

#
# gconf, used by the Defaults class to get system font-face and font-size
#
PKG_CHECK_MODULES([GCONF], [gconf-2.0])


#
# libwnck used by the dnd code
#
PKG_CHECK_MODULES([WNCK], [libwnck-1.0])

#
# libnotify, used unit-tests 
#
PKG_CHECK_MODULES([LIBNOTIFY], [libnotify >= 0.4.5])

#
# dbus
#
PKG_CHECK_MODULES([DBUS], [dbus-glib-1 >= 0.76])
DBUS_GLIB_BIN="`$PKG_CONFIG --variable=exec_prefix dbus-glib-1`/bin"
AC_SUBST(DBUS_GLIB_BIN)

#
# Gnome/GTK checks
#

AM_PATH_GTK_2_0


PKG_CHECK_MODULES(notify_osd, 
		  gtk+-2.0 >= 2.14)
AC_SUBST(NOTIFY_OSD_CFLAGS)
AC_SUBST(NOTIFY_OSD_LIBS)

#
# checks for building C- or C#-examples
#
AC_DEFUN([CHECK_FOR_MONO_STUFF],
[
        NAME="gmcs"
        AC_PATH_PROG(GMCS, $NAME, no)
        AC_SUBST(GMCS)
        if test "x$GMCS" = "xno"; then
                AC_MSG_ERROR([You need to install '$NAME'])
        fi

        NAME="Mono.Posix"
        AC_MSG_CHECKING([for Mono 2.0 GAC $NAME.dll])
        if test -e "$(pkg-config --variable=libdir mono)/mono/2.0/$NAME.dll";
        then
                AC_MSG_RESULT([found])
        else
                AC_MSG_RESULT([not found])
                AC_MSG_ERROR([missing reqired Mono 2.0 assembly $NAME.dll])
        fi

        NAME="notify-sharp"
        AC_MSG_CHECKING([for Mono 2.0 CIL $NAME])
        pkg-config --exists $NAME
        if test "$?" == "0"
        then
                AC_MSG_RESULT([found])
        else
                AC_MSG_RESULT([not found])
                AC_MSG_ERROR([missing reqired Mono 2.0 CIL $NAME])
        fi
])

AC_ARG_WITH(examples, [  --with-examples=[[all/c/mono]]
                          build C or C#-examples using libnotify
                          demonstrating special features of notify-osd
                          there are Python-examples too, but they don't
                          need to be build])

c_examples=no
csharp_examples=no
if test "x$with_examples" = "xc"; then
        c_examples=yes
        AC_MSG_NOTICE([Build with ANSI-C examples])
fi
if test "x$with_examples" = "xmono"; then
        CHECK_FOR_MONO_STUFF
        csharp_examples=yes
        AC_MSG_NOTICE([Build with C-sharp examples])
fi
if test "x$with_examples" = "xall"; then
        CHECK_FOR_MONO_STUFF
        c_examples=yes
        csharp_examples=yes
        AC_MSG_NOTICE([Build with ANSI-C examples])
        AC_MSG_NOTICE([Build with C-sharp examples])
fi

AM_CONDITIONAL(BUILD_C_EXAMPLES, test "x$c_examples" != "xno")
AM_CONDITIONAL(BUILD_MONO_EXAMPLES, test "x$csharp_examples" != "xno")

dnl CFLAGS
CFLAGS="$CFLAGS -lm -Wall -Werror -std=c99"

AC_OUTPUT([
Makefile
src/Makefile
tests/Makefile
examples/Makefile
data/Makefile
data/icons/Makefile
data/icons/scalable/Makefile
])

echo ""
echo "                 Notify OSD $VERSION"
echo "             ============================"
echo ""
echo "                   prefix:   ${prefix}"
echo ""
echo "         Build C Examples:   ${c_examples}"
echo ""
echo "        Build C# Examples:   ${csharp_examples}"
echo ""