Mass update GPLv2 from http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
[dockapps.git] / wmnotify / configure.ac
blob140a62492fea9255a9d147f137ed8ec227df523a
1 # configure.ac -- Process this file with autoconf to produce configure.
3 dnl Initialization stuff.
4 AC_INIT(wmnotify, 1.0.0)
5 AC_CONFIG_AUX_DIR(config)
6 AC_CONFIG_SRCDIR(src/wmnotify.c)
7 AM_CONFIG_HEADER(config.h:config-h.in)
8 dnl Checking if the NEWS file has been updated to reflect the current version.
9 AM_INIT_AUTOMAKE(check-news)
10 AM_SILENT_RULES([yes])
12 dnl Testing the C compiler.
13 AM_PROG_CC_C_O
14 AC_LANG_C
16 dnl Checking for header files.
17 AC_HEADER_STDC
18 AC_HEADER_SYS_WAIT
19 AC_CHECK_HEADERS(stdlib.h unistd.h errno.h assert.h)
20 AC_CHECK_HEADERS(string.h strings.h)
22 dnl Checking for typedefs, structures, and compiler characteristics.
23 AC_C_CONST
24 AC_TYPE_PID_T
25 AC_TYPE_SIZE_T
27 dnl Basic CFLAGS values
28 CFLAGS="${CFLAGS} -Wall"
30 dnl Checking for POSIX threads library.
31 ACX_PTHREAD([CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LDFLAGS="$PTHREAD_LIBS $LDFLAGS" CC="$PTHREAD_CC"],
32             [AC_MSG_ERROR([POSIX thread support required])])
34 dnl Trying to locate the X window system's includes and libraries, and sets the
35 dnl variables x_includes and x_libraries to their locations. Also adds the
36 dnl required include flags to X_CFLAGS and required linking flags to X_LIBS.
37 AC_PATH_XTRA
38 CFLAGS="${CFLAGS} ${X_CFLAGS}"
39 LIBS="${LIBS} ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
41 dnl Checking for X11 library.
42 AC_CHECK_LIB(X11, XOpenDisplay, LIBS="${LIBS} -lX11",
43              echo "Can't find X11 library" ; exit 1, "${X_LIBS}")
45 dnl Checking for Xpm library and headers.
46 AC_CHECK_HEADERS(X11/xpm.h, ,echo "Can't find header file for library Xpm" ; exit 1)
47 AC_CHECK_LIB(Xpm, XpmCreatePixmapFromXpmImage, LIBS="${LIBS} -lXpm",
48              echo "Can't find Xpm library" ; exit 1, "${X_LIBS}")
50 dnl Checking for Xext library and headers.
51 AC_CHECK_HEADERS(X11/extensions/shape.h, ,
52 echo "Can't find header file for library Xext" ; exit 1)
53 AC_CHECK_LIB(Xext, XShapeCombineMask, LIBS="${LIBS} -lXext",
54              echo "Can't find Xext library" ; exit 1, "${X_LIBS}")
56 dnl Checks for libsndfile
57 AC_ARG_ENABLE(libsndfile,
58         [  --enable-libsndfile     Enable libsndfile support for audible notification (default=yes)],
59         [ac_cv_enable_libsndfile=$enableval], [ac_cv_enable_libsndfile=yes])
60 AC_MSG_CHECKING([whether to use libsndfile])
61 if test x$ac_cv_enable_libsndfile = xyes; then
62         AC_MSG_RESULT(yes)
63         PKG_CHECK_MODULES([SNDFILE], sndfile >= 1.0.2, :, ac_cv_enable_libsndfile=no)
64         if test x$ac_cv_enable_libsndfile = xyes; then
65             AC_DEFINE([HAVE_SNDFILE],1,[Set to 1 to enable libsndfile support.])
66         fi
67 else
68         AC_MSG_RESULT(no)
71 dnl Checks for OpenSSL
72 AC_ARG_ENABLE(ssl,
73         [  --enable-ssl            Enable SSL support using OpenSSL (default=yes)],
74         [ac_cv_enable_ssl=$enableval], [ac_cv_enable_ssl=yes])
75 AC_MSG_CHECKING([whether to use OpenSSL])
76 if test x$ac_cv_enable_ssl = xyes; then
77         AC_MSG_RESULT(yes)
78         PKG_CHECK_MODULES([OPENSSL], openssl >= 0.9.6, :, ac_cv_enable_ssl=no)
79         if test x$ac_cv_enable_ssl = xyes; then
80             AC_DEFINE([HAVE_SSL],1,[Set to 1 to enable OpenSSL support.])
81         fi
82 else
83         AC_MSG_RESULT(no)
86 CFLAGS="${CFLAGS} ${SNDFILE_CFLAGS} ${OPENSSL_CFLAGS}"
87 LIBS="${SNDFILE_LIBS} ${OPENSSL_LIBS} ${LIBS}"
89 AC_SUBST(CFLAGS)
90 AC_SUBST(LIBS)
91 AC_SUBST(ac_aux_dir)
93 dnl Creating output file(s)
94 AC_OUTPUT(Makefile src/Makefile doc/Makefile)
96 dnl Output the configuration summary
97 echo
98 echo "Configuration summary:"
99 echo
100 echo "  Install path:   ${prefix}"
101 echo "  Compiler:       ${CC}"
102 echo "  Compiler flags: ${CFLAGS}"
103 echo "  Linker flags:   ${LIBS}"
104 echo "  OpenSSL support:    $ac_cv_enable_ssl"
105 echo "  libsndfile support: $ac_cv_enable_libsndfile"
106 if test "x${ac_cv_enable_libsndfile}" = xno; then
107   echo
108   echo "  WARNING: Althought the 'libsndfile' library is not mandatory, without it"
109   echo "           you won't have audible notifications."
112 echo
113 echo "Configure finished. Type 'make' to build."