Skip to content

Commit

Permalink
Remove checks for semaphore.h in CMake and configure
Browse files Browse the repository at this point in the history
  • Loading branch information
ktmf01 committed Feb 26, 2024
1 parent 82c23ba commit 7f7da55
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 18 deletions.
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ check_include_file("inttypes.h" HAVE_INTTYPES_H)
check_include_file("stdint.h" HAVE_STDINT_H)
check_include_file("stdbool.h" HAVE_STDBOOL_H)
check_include_file("arm_neon.h" FLAC__HAS_NEONINTRIN)
check_include_file("semaphore.h" HAVE_SEMAPHORE_H)

if(NOT HAVE_STDINT_H OR NOT HAVE_STDBOOL_H)
message(SEND_ERROR "Header stdint.h and/or stdbool.h not found")
Expand Down Expand Up @@ -200,7 +199,7 @@ if(CMAKE_BUILD_TYPE STREQUAL Debug OR CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo)
add_definitions(-DFLAC__OVERFLOW_DETECT)
endif()

if(ENABLE_MULTITHREADING AND HAVE_SEMAPHORE_H)
if(ENABLE_MULTITHREADING)
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
find_package(Threads)
Expand Down
28 changes: 12 additions & 16 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ AM_PROG_CC_C_O
AC_C_INLINE
AC_C_TYPEOF

AC_CHECK_HEADERS([stdint.h stdbool.h inttypes.h byteswap.h sys/auxv.h sys/param.h sys/ioctl.h termios.h x86intrin.h cpuid.h arm_neon.h semaphore.h])
AC_CHECK_HEADERS([stdint.h stdbool.h inttypes.h byteswap.h sys/auxv.h sys/param.h sys/ioctl.h termios.h x86intrin.h cpuid.h arm_neon.h])

if test "x$ac_cv_header_stdint_h" != xyes -o "x$ac_cv_header_stdbool_h" != xyes; then
AC_MSG_ERROR("Header stdint.h and/or stdbool.h not found")
Expand Down Expand Up @@ -377,21 +377,17 @@ AC_ARG_ENABLE([multithreading],

HAVE_PTHREAD=no
if test "x$enable_multithreading" != "xno" ; then
if test "x$ac_cv_header_semaphore_h" != "xyes"; then
AC_MSG_WARN("Header semaphore.h, needed for multithreading, is not found")
else
AX_PTHREAD([
HAVE_PTHREAD=yes
AC_DEFINE(HAVE_PTHREAD,1,[Define if pthread is enabled])
LIBS="$PTHREAD_LIBS $LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS"
CC="$PTHREAD_CC"
CXX="$PTHREAD_CXX"
],[HAVE_PTHREAD=no])
if test "x${HAVE_PTHREAD}" == "xno"; then
AC_MSG_WARN("pthread support, needed for multithreading, is not found")
fi
AX_PTHREAD([
HAVE_PTHREAD=yes
AC_DEFINE(HAVE_PTHREAD,1,[Define if pthread is enabled])
LIBS="$PTHREAD_LIBS $LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS"
CC="$PTHREAD_CC"
CXX="$PTHREAD_CXX"
],[HAVE_PTHREAD=no])
if test "x${HAVE_PTHREAD}" == "xno"; then
AC_MSG_WARN("pthread support, needed for multithreading, is not found")
fi
fi

Expand Down

0 comments on commit 7f7da55

Please sign in to comment.