1 | AC_INIT([startup-notification], [0.8], |
---|
2 | [http://www.freedesktop.org/Software/startup-notification]) |
---|
3 | AC_CONFIG_SRCDIR(libsn/sn-launchee.c) |
---|
4 | |
---|
5 | AM_INIT_AUTOMAKE |
---|
6 | AM_CONFIG_HEADER(config.h) |
---|
7 | |
---|
8 | # Honor aclocal flags |
---|
9 | AC_SUBST(ACLOCAL_AMFLAGS, "\${ACLOCAL_FLAGS}") |
---|
10 | |
---|
11 | AM_MAINTAINER_MODE |
---|
12 | |
---|
13 | AC_PROG_CC |
---|
14 | AC_ISC_POSIX |
---|
15 | AC_HEADER_STDC |
---|
16 | AC_LIBTOOL_WIN32_DLL |
---|
17 | AM_PROG_LIBTOOL |
---|
18 | |
---|
19 | changequote(,)dnl |
---|
20 | if test "x$GCC" = "xyes"; then |
---|
21 | case " $CFLAGS " in |
---|
22 | *[\ \ ]-Wall[\ \ ]*) ;; |
---|
23 | *) CFLAGS="$CFLAGS -Wall" ;; |
---|
24 | esac |
---|
25 | fi |
---|
26 | changequote([,])dnl |
---|
27 | |
---|
28 | AC_PATH_XTRA |
---|
29 | |
---|
30 | if test x$no_x = xyes ; then |
---|
31 | AC_MSG_ERROR([X11 development libraries/headers not found]) |
---|
32 | fi |
---|
33 | |
---|
34 | |
---|
35 | dnl (check from glib) |
---|
36 | dnl ok, here we try to check whether the systems prototypes for |
---|
37 | dnl malloc and friends actually match the prototypes provided |
---|
38 | dnl by sn-common.h (keep in sync). i currently only know how to check |
---|
39 | dnl this reliably with gcc (-Werror), improvements for other |
---|
40 | dnl compilers are appreciated. |
---|
41 | SANE_MALLOC_PROTOS=no |
---|
42 | AC_MSG_CHECKING([if malloc() and friends prototypes are sn-util.h compatible]) |
---|
43 | lf_save_CFLAGS=$CFLAGS |
---|
44 | if test "x$GCC" = "xyes"; then |
---|
45 | CFLAGS="$CFLAGS -Werror" |
---|
46 | AC_TRY_COMPILE([#include <stdlib.h>], [ |
---|
47 | void* (*my_calloc_p) (size_t, size_t) = calloc; |
---|
48 | void* (*my_malloc_p) (size_t) = malloc; |
---|
49 | void (*my_free_p) (void*) = free; |
---|
50 | void* (*my_realloc_p) (void*, size_t) = realloc; |
---|
51 | my_calloc_p = 0; |
---|
52 | my_malloc_p = 0; |
---|
53 | my_free_p = 0; |
---|
54 | my_realloc_p = 0; |
---|
55 | ], |
---|
56 | AC_DEFINE(SANE_MALLOC_PROTOS, 1, |
---|
57 | [Define if you have correct malloc prototypes]) |
---|
58 | SANE_MALLOC_PROTOS=yes) |
---|
59 | fi |
---|
60 | AC_MSG_RESULT($SANE_MALLOC_PROTOS) |
---|
61 | CFLAGS=$lf_save_CFLAGS |
---|
62 | |
---|
63 | dnl *** check for sane realloc() *** |
---|
64 | AC_CACHE_CHECK([whether realloc (NULL,) will work],lf_cv_sane_realloc,[ |
---|
65 | AC_TRY_RUN([ |
---|
66 | #include <stdlib.h> |
---|
67 | int main() { |
---|
68 | return realloc (0, sizeof (int)) == 0; |
---|
69 | }], |
---|
70 | [lf_cv_sane_realloc=yes], |
---|
71 | [lf_cv_sane_realloc=no], |
---|
72 | []) |
---|
73 | ]) |
---|
74 | if test x$lf_cv_sane_realloc = xyes; then |
---|
75 | AC_DEFINE(REALLOC_0_WORKS,1,[whether realloc (NULL,) works]) |
---|
76 | fi |
---|
77 | |
---|
78 | ## try definining HAVE_BACKTRACE |
---|
79 | AC_CHECK_HEADERS(execinfo.h, [AC_CHECK_FUNCS(backtrace)]) |
---|
80 | |
---|
81 | LIBSN_CFLAGS=$X_CFLAGS |
---|
82 | LIBSN_LIBS=" $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS" |
---|
83 | AC_SUBST(LIBSN_CFLAGS) |
---|
84 | AC_SUBST(LIBSN_LIBS) |
---|
85 | |
---|
86 | AC_CONFIG_FILES([ |
---|
87 | Makefile |
---|
88 | libsn/Makefile |
---|
89 | test/Makefile |
---|
90 | doc/Makefile |
---|
91 | libstartup-notification-1.0.pc |
---|
92 | ]) |
---|
93 | |
---|
94 | AC_OUTPUT |
---|