Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow build on FreeBSD #277

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ set (CMAKE_CXX_STANDARD 11)

set (RENDERER_FLAGS "")

find_package(PkgConfig REQUIRED)
pkg_check_modules(DNSSD REQUIRED avahi-compat-libdns_sd)
pkg_check_modules(PLIST REQUIRED libplist-2.0)
link_directories(${DNS_SD_LIBRARY_DIRS})
link_directories(${PLIST_LIBRARY_DIRS})

add_subdirectory(lib/playfair)
add_subdirectory(lib/llhttp)
add_subdirectory(lib)
Expand All @@ -23,6 +29,6 @@ add_subdirectory(renderers)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${RENDERER_FLAGS}" )

add_executable( rpiplay rpiplay.cpp)
target_link_libraries ( rpiplay renderers airplay )
target_link_libraries ( rpiplay renderers airplay ${PLIST_LIBRARIES})

install(TARGETS rpiplay RUNTIME DESTINATION bin)
7 changes: 6 additions & 1 deletion lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ if( UNIX AND NOT APPLE )
find_package(OpenSSL 1.1.1 REQUIRED)
target_compile_definitions(airplay PUBLIC OPENSSL_API_COMPAT=0x10101000L)
target_link_libraries( airplay OpenSSL::Crypto )
target_link_libraries( airplay dns_sd )
target_include_directories( airplay PUBLIC ${DNSSD_INCLUDE_DIRS} )
target_include_directories( airplay PUBLIC ${PLIST_INCLUDE_DIRS} )
link_directories(${DNS_SD_LIBRARY_DIRS})
link_directories(${PLIST_LIBRARY_DIRS})
target_link_libraries( airplay ${PLIST_LIBRARIES})
target_link_libraries( airplay ${DNSSD_LIBRARIES})
else()
include_directories( /usr/local/opt/[email protected]/include/ )
target_link_libraries( airplay /usr/local/opt/[email protected]/lib/libcrypto.a )
Expand Down
5 changes: 5 additions & 0 deletions lib/byteutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@
#include "byteutils.h"

#ifndef htonll
#ifdef __linux__
#include <endian.h>
#endif
#ifdef __FreeBSD__
#include <sys/endian.h>
#endif
#define htonll(x) htobe64(x)
#define ntohll(x) be64toh(x)
#endif
Expand Down
3 changes: 3 additions & 0 deletions lib/raop_rtp_mirror.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
#include "mirror_buffer.h"
#include "stream.h"

#ifdef __FreeBSD__
#define SOL_TCP 6
#endif

struct h264codec_s {
unsigned char compatibility;
Expand Down