Bugfixes
[rtl-433.git] / configure.ac
1 AC_INIT([rtl433],
2         m4_esyscmd([./git-version-gen .tarball-version]),
3         [rtl_433@googlegroups.com])
4
5 AM_INIT_AUTOMAKE([dist-bzip2 subdir-objects])
6
7 dnl kernel style compile messages
8 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
9
10 dnl checks for programs
11 AC_PROG_MAKE_SET
12 AC_PROG_CC
13 AC_PROG_CC_STDC
14 AC_PROG_INSTALL
15 LT_INIT
16 AC_PROG_LIBTOOL
17
18 PKG_CHECK_MODULES(LIBRTLSDR, librtlsdr)
19 LIBS="$LIBS $LIBRTLSDR_LIBS"
20 CFLAGS="$CFLAGS $LIBRTLSDR_CFLAGS"
21
22 AC_PATH_PROG(DOXYGEN,doxygen,false)
23 AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false)
24
25 AC_CONFIG_MACRO_DIR([m4])
26
27 dnl checks for header files
28 AC_HEADER_STDC
29 AC_CHECK_HEADERS(sys/types.h)
30
31 # pc variables
32 AC_SUBST(RTLSDR_PC_LIBS,["$LIBS"])
33 AC_SUBST(RTLSDR_PC_CFLAGS,["$CFLAGS"])
34
35 dnl checks for required libraries
36
37 # The following test is taken from WebKit's webkit.m4
38 saved_CFLAGS="$CFLAGS"
39 CFLAGS="$CFLAGS -fvisibility=hidden "
40 AC_MSG_CHECKING([if ${CC} supports -fvisibility=hidden])
41 AC_COMPILE_IFELSE([AC_LANG_SOURCE([char foo;])],
42     [ AC_MSG_RESULT([yes])
43       SYMBOL_VISIBILITY="-fvisibility=hidden"],
44       AC_MSG_RESULT([no]))
45 CFLAGS="$saved_CFLAGS"
46 AC_SUBST(SYMBOL_VISIBILITY)
47
48 AC_MSG_CHECKING(whether compiler understands -Wall)
49 old_CFLAGS="$CFLAGS"
50 CFLAGS="$CFLAGS -Wall -Wextra -Wno-unused -Wsign-compare"
51 AC_TRY_COMPILE([],[],
52   AC_MSG_RESULT(yes),
53   AC_MSG_RESULT(no)
54   CFLAGS="$old_CFLAGS")
55
56 dnl Generate the output
57 AM_CONFIG_HEADER(config.h)
58
59 AC_OUTPUT(
60         rtl433.pc
61         include/Makefile
62         src/Makefile
63         Makefile
64         Doxyfile
65 )