build rtl_fm

Signed-off-by: Steve Markgraf <steve@steve-m.de>
This commit is contained in:
Steve Markgraf 2012-07-17 20:41:27 +02:00
parent 6328e11da6
commit fc390b3224
3 changed files with 19 additions and 1 deletions

View File

@ -36,6 +36,9 @@ dnl checks for required libraries
dnl pthreads dnl pthreads
AC_CHECK_LIB(pthread, pthread_create, [LIBS="$LIBS -lpthread"]) AC_CHECK_LIB(pthread, pthread_create, [LIBS="$LIBS -lpthread"])
dnl libmath (for rtl_fm)
AC_CHECK_LIB(m, atan2, [LIBS="$LIBS -lm"])
# The following test is taken from WebKit's webkit.m4 # The following test is taken from WebKit's webkit.m4
saved_CFLAGS="$CFLAGS" saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fvisibility=hidden " CFLAGS="$CFLAGS -fvisibility=hidden "

View File

@ -36,6 +36,10 @@ set_target_properties(rtlsdr_shared PROPERTIES DEFINE_SYMBOL "rtlsdr_EXPORTS")
set_target_properties(rtlsdr_shared PROPERTIES OUTPUT_NAME rtlsdr) set_target_properties(rtlsdr_shared PROPERTIES OUTPUT_NAME rtlsdr)
set_target_properties(rtlsdr_shared PROPERTIES SOVERSION 0 VERSION 0.0.0) set_target_properties(rtlsdr_shared PROPERTIES SOVERSION 0 VERSION 0.0.0)
if(UNIX)
link_libraries(m)
endif(UNIX)
add_library(rtlsdr_static STATIC add_library(rtlsdr_static STATIC
librtlsdr.c librtlsdr.c
tuner_e4k.c tuner_e4k.c
@ -67,6 +71,8 @@ endif()
add_executable(rtl_sdr rtl_sdr.c) add_executable(rtl_sdr rtl_sdr.c)
add_executable(rtl_tcp rtl_tcp.c) add_executable(rtl_tcp rtl_tcp.c)
add_executable(rtl_test rtl_test.c) add_executable(rtl_test rtl_test.c)
add_executable(rtl_fm rtl_fm.c)
target_link_libraries(rtl_sdr rtlsdr_shared target_link_libraries(rtl_sdr rtlsdr_shared
${LIBUSB_LIBRARIES} ${LIBUSB_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT} ${CMAKE_THREAD_LIBS_INIT}
@ -79,14 +85,20 @@ target_link_libraries(rtl_test rtlsdr_shared
${LIBUSB_LIBRARIES} ${LIBUSB_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT} ${CMAKE_THREAD_LIBS_INIT}
) )
target_link_libraries(rtl_fm rtlsdr_shared
${LIBUSB_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
)
if(WIN32) if(WIN32)
target_link_libraries(rtl_sdr libgetopt_static) target_link_libraries(rtl_sdr libgetopt_static)
target_link_libraries(rtl_tcp libgetopt_static) target_link_libraries(rtl_tcp libgetopt_static)
target_link_libraries(rtl_test libgetopt_static) target_link_libraries(rtl_test libgetopt_static)
target_link_libraries(rtl_fm libgetopt_static)
set_property(TARGET rtl_sdr APPEND PROPERTY COMPILE_DEFINITIONS "rtlsdr_STATIC" ) set_property(TARGET rtl_sdr APPEND PROPERTY COMPILE_DEFINITIONS "rtlsdr_STATIC" )
set_property(TARGET rtl_tcp APPEND PROPERTY COMPILE_DEFINITIONS "rtlsdr_STATIC" ) set_property(TARGET rtl_tcp APPEND PROPERTY COMPILE_DEFINITIONS "rtlsdr_STATIC" )
set_property(TARGET rtl_test APPEND PROPERTY COMPILE_DEFINITIONS "rtlsdr_STATIC" ) set_property(TARGET rtl_test APPEND PROPERTY COMPILE_DEFINITIONS "rtlsdr_STATIC" )
set_property(TARGET rtl_fm APPEND PROPERTY COMPILE_DEFINITIONS "rtlsdr_STATIC" )
endif() endif()
######################################################################## ########################################################################
# Install built library files & utilities # Install built library files & utilities

View File

@ -10,7 +10,7 @@ lib_LTLIBRARIES = librtlsdr.la
librtlsdr_la_SOURCES = librtlsdr.c tuner_e4k.c tuner_fc0012.c tuner_fc0013.c tuner_fc2580.c librtlsdr_la_SOURCES = librtlsdr.c tuner_e4k.c tuner_fc0012.c tuner_fc0013.c tuner_fc2580.c
librtlsdr_la_LDFLAGS = -version-info $(LIBVERSION) librtlsdr_la_LDFLAGS = -version-info $(LIBVERSION)
bin_PROGRAMS = rtl_sdr rtl_tcp rtl_test bin_PROGRAMS = rtl_sdr rtl_tcp rtl_test rtl_fm
rtl_sdr_SOURCES = rtl_sdr.c rtl_sdr_SOURCES = rtl_sdr.c
rtl_sdr_LDADD = librtlsdr.la rtl_sdr_LDADD = librtlsdr.la
@ -20,3 +20,6 @@ rtl_tcp_LDADD = librtlsdr.la
rtl_test_SOURCES = rtl_test.c rtl_test_SOURCES = rtl_test.c
rtl_test_LDADD = librtlsdr.la rtl_test_LDADD = librtlsdr.la
rtl_fm_SOURCES = rtl_fm.c
rtl_fm_LDADD = librtlsdr.la $(LIBM)