2 m4_esyscmd([./git-version-gen .tarball-version]),
3 [osmocom-sdr@lists.osmocom.org])
5 AM_INIT_AUTOMAKE([dist-bzip2])
7 dnl kernel style compile messages
8 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
10 dnl checks for programs
17 PKG_CHECK_MODULES(LIBUSB, libusb-1.0 >= 1.0)
18 LIBS="$LIBS $LIBUSB_LIBS"
19 CFLAGS="$CFLAGS $LIBUSB_CFLAGS"
21 AC_PATH_PROG(DOXYGEN,doxygen,false)
22 AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false)
24 AC_CONFIG_MACRO_DIR([m4])
26 dnl checks for header files
28 AC_CHECK_HEADERS(sys/types.h)
29 AC_CHECK_HEADERS(pthread.h,, [AC_MSG_ERROR([pthread.h required])])
32 AC_SUBST(RTLSDR_PC_LIBS,["$LIBS"])
33 AC_SUBST(RTLSDR_PC_CFLAGS,["$CFLAGS"])
35 dnl checks for required libraries
37 AC_CHECK_LIB(pthread, pthread_create, [LIBS="$LIBS -lpthread"])
39 dnl libmath (for rtl_fm)
40 AC_CHECK_LIB(m, atan2, [LIBS="$LIBS -lm"])
42 dnl libmath (for rtl_adsb)
43 AC_CHECK_LIB(m, sqrt, [LIBS="$LIBS -lm"])
45 dnl librealtime (for rtl_test)
46 AC_CHECK_LIB(rt, clock_gettime, [LIBS="$LIBS -lrt"])
48 # The following test is taken from WebKit's webkit.m4
49 saved_CFLAGS="$CFLAGS"
50 CFLAGS="$CFLAGS -fvisibility=hidden "
51 AC_MSG_CHECKING([if ${CC} supports -fvisibility=hidden])
52 AC_COMPILE_IFELSE([AC_LANG_SOURCE([char foo;])],
53 [ AC_MSG_RESULT([yes])
54 SYMBOL_VISIBILITY="-fvisibility=hidden"],
56 CFLAGS="$saved_CFLAGS"
57 AC_SUBST(SYMBOL_VISIBILITY)
59 AC_MSG_CHECKING(whether compiler understands -Wall)
61 CFLAGS="$CFLAGS -Wall -Wextra -Wno-unused -Wsign-compare"
67 dnl Generate the output
68 AM_CONFIG_HEADER(config.h)