configure.ac 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. AC_INIT([rtl433],
  2. m4_esyscmd([./git-version-gen .tarball-version]),
  3. [rtl_433@googlegroups.com])
  4. AM_INIT_AUTOMAKE([dist-bzip2 subdir-objects])
  5. dnl kernel style compile messages
  6. m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
  7. dnl checks for programs
  8. AC_PROG_MAKE_SET
  9. AC_PROG_CC
  10. AC_PROG_CC_STDC
  11. AC_PROG_INSTALL
  12. LT_INIT
  13. AC_PROG_LIBTOOL
  14. LT_LIB_M
  15. PKG_CHECK_MODULES([LIBRTLSDR], [librtlsdr], [HAVE_LIBRTLSDR=1], [HAVE_LIBRTLSDR=0])
  16. AM_CONDITIONAL([USE_LIBRTLSDR], [test "$HAVE_LIBRTLSDR" -eq 1])
  17. AM_COND_IF([USE_LIBRTLSDR],
  18. [ LIBS="$LIBS $LIBRTLSDR_LIBS"
  19. CFLAGS="$CFLAGS $LIBRTLSDR_CFLAGS -DRTLSDR" ])
  20. PKG_CHECK_MODULES([SOAPYSDR], [SoapySDR], [HAVE_SOAPYSDR=1], [HAVE_SOAPYSDR=0])
  21. AM_CONDITIONAL([USE_SOAPYSDR], [test "$HAVE_SOAPYSDR" -eq 1])
  22. AM_COND_IF([USE_SOAPYSDR],
  23. [ LIBS="$LIBS $SOAPYSDR_LIBS"
  24. CFLAGS="$CFLAGS $SOAPYSDR_CFLAGS -DSOAPYSDR" ])
  25. AC_PATH_PROG(DOXYGEN,doxygen,false)
  26. AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false)
  27. # cmake compat dummies for Doxyfile.in
  28. AC_SUBST(CMAKE_CURRENT_SOURCE_DIR, "$srcdir")
  29. AC_SUBST(CMAKE_CURRENT_BINARY_DIR, ".")
  30. AC_CONFIG_MACRO_DIR([m4])
  31. dnl checks for header files
  32. AC_HEADER_STDC
  33. AC_CHECK_HEADERS(sys/types.h)
  34. # pc variables
  35. AC_SUBST(RTLSDR_PC_LIBS,["$LIBS"])
  36. AC_SUBST(RTLSDR_PC_CFLAGS,["$CFLAGS"])
  37. dnl checks for required libraries
  38. # The following test is taken from WebKit's webkit.m4
  39. saved_CFLAGS="$CFLAGS"
  40. CFLAGS="$CFLAGS -fvisibility=hidden "
  41. AC_MSG_CHECKING([if ${CC} supports -fvisibility=hidden])
  42. AC_COMPILE_IFELSE([AC_LANG_SOURCE([char foo;])],
  43. [ AC_MSG_RESULT([yes])
  44. SYMBOL_VISIBILITY="-fvisibility=hidden"],
  45. AC_MSG_RESULT([no]))
  46. CFLAGS="$saved_CFLAGS"
  47. AC_SUBST(SYMBOL_VISIBILITY)
  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. dnl Generate the output
  56. AM_CONFIG_HEADER(config.h)
  57. AC_OUTPUT(
  58. rtl433.pc
  59. include/Makefile
  60. src/Makefile
  61. Makefile
  62. Doxyfile
  63. )