source: trunk/third/startup-notification/configure.in @ 21546

Revision 21546, 2.3 KB checked in by ghudson, 20 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r21545, which included commits to RCS files with non-trunk default branches.
Line 
1AC_INIT([startup-notification], [0.8],
2        [http://www.freedesktop.org/Software/startup-notification])
3AC_CONFIG_SRCDIR(libsn/sn-launchee.c)
4
5AM_INIT_AUTOMAKE
6AM_CONFIG_HEADER(config.h)
7
8# Honor aclocal flags
9AC_SUBST(ACLOCAL_AMFLAGS, "\${ACLOCAL_FLAGS}")
10
11AM_MAINTAINER_MODE
12
13AC_PROG_CC
14AC_ISC_POSIX
15AC_HEADER_STDC
16AC_LIBTOOL_WIN32_DLL
17AM_PROG_LIBTOOL
18
19changequote(,)dnl
20if test "x$GCC" = "xyes"; then
21  case " $CFLAGS " in
22  *[\ \ ]-Wall[\ \      ]*) ;;
23  *) CFLAGS="$CFLAGS -Wall" ;;
24  esac
25fi
26changequote([,])dnl
27
28AC_PATH_XTRA
29
30if test x$no_x = xyes ; then
31  AC_MSG_ERROR([X11 development libraries/headers not found])
32fi
33
34
35dnl (check from glib)
36dnl ok, here we try to check whether the systems prototypes for
37dnl malloc and friends actually match the prototypes provided
38dnl by sn-common.h (keep in sync). i currently only know how to check
39dnl this reliably with gcc (-Werror), improvements for other
40dnl compilers are appreciated.
41SANE_MALLOC_PROTOS=no
42AC_MSG_CHECKING([if malloc() and friends prototypes are sn-util.h compatible])
43lf_save_CFLAGS=$CFLAGS
44if 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)
59fi
60AC_MSG_RESULT($SANE_MALLOC_PROTOS)
61CFLAGS=$lf_save_CFLAGS
62
63dnl *** check for sane realloc() ***
64AC_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])
74if test x$lf_cv_sane_realloc = xyes; then
75  AC_DEFINE(REALLOC_0_WORKS,1,[whether realloc (NULL,) works])
76fi
77
78## try definining HAVE_BACKTRACE
79AC_CHECK_HEADERS(execinfo.h, [AC_CHECK_FUNCS(backtrace)])
80
81LIBSN_CFLAGS=$X_CFLAGS
82LIBSN_LIBS=" $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
83AC_SUBST(LIBSN_CFLAGS)
84AC_SUBST(LIBSN_LIBS)
85
86AC_CONFIG_FILES([
87Makefile
88libsn/Makefile
89test/Makefile
90doc/Makefile
91libstartup-notification-1.0.pc
92])
93
94AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.