Skip to content

Commit

Permalink
Moved spdlog to prerequisites.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
dimiden committed Feb 22, 2025
1 parent fe4574f commit c8509aa
Show file tree
Hide file tree
Showing 180 changed files with 88 additions and 33,475 deletions.
104 changes: 84 additions & 20 deletions misc/prerequisites.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

set -x
# set -x

PREFIX=/opt/ovenmediaengine
TEMP_PATH=/tmp
Expand All @@ -21,6 +21,8 @@ HIREDIS_VERSION=1.0.2
NVCC_HDR_VERSION=11.1.5.2
X264_VERSION=31e19f92
WEBP_VERSION=1.5.0
SPDLOG_VERSION=1.15.1

INTEL_QSV_HWACCELS=false
NETINT_LOGAN_HWACCELS=false
NETINT_LOGAN_PATCH_PATH=""
Expand All @@ -29,7 +31,6 @@ NVIDIA_NV_CODEC_HWACCELS=false
XILINX_XMA_CODEC_HWACCELS=false
VIDEOLAN_X264_CODEC=true


if [[ "$OSTYPE" == "darwin"* ]]; then
NCPU=$(sysctl -n hw.ncpu)
OSNAME=$(sw_vers -productName)
Expand Down Expand Up @@ -419,6 +420,51 @@ install_hiredis()
rm -rf ${DIR} ) || fail_exit "hiredis"
}

install_spdlog()
{
# Apply patch for getting thread name
local SPDLOG_PATCH_CONTENT='diff --git a/include/spdlog/details/log_msg-inl.h b/include/spdlog/details/log_msg-inl.h
index aa3a9576..508ae9c1 100644
--- a/include/spdlog/details/log_msg-inl.h
+++ b/include/spdlog/details/log_msg-inl.h
@@ -25,6 +25,8 @@ SPDLOG_INLINE log_msg::log_msg(spdlog::log_clock::time_point log_time,
thread_id(os::thread_id())
#endif
,
+ // AirenSoft - Add pthread to get thread name
+ pthread_id(::pthread_self()),
source(loc),
payload(msg) {
}
diff --git a/include/spdlog/details/log_msg.h b/include/spdlog/details/log_msg.h
index 87df1e83..e83f8576 100644
--- a/include/spdlog/details/log_msg.h
+++ b/include/spdlog/details/log_msg.h
@@ -24,6 +24,8 @@ struct SPDLOG_API log_msg {
level::level_enum level{level::off};
log_clock::time_point time;
size_t thread_id{0};
+ // AirenSoft - Add pthread to get thread name
+ pthread_t pthread_id{0};
// wrapping the formatted text with color (updated by pattern_formatter).
mutable size_t color_range_start{0};
'
(DIR=${TEMP_PATH}/spdlog && \
mkdir -p ${DIR} && \
cd ${DIR} && \
curl -sSLf https://github.com/gabime/spdlog/archive/refs/tags/v${SPDLOG_VERSION}.tar.gz | tar -xz --strip-components=1 && \
echo "${SPDLOG_PATCH_CONTENT}" | git apply && \
mkdir -p build && \
cd build && \
cmake .. \
"-DCMAKE_INSTALL_PREFIX=${PREFIX}" \
"-DCMAKE_INSTALL_LIBDIR=${PREFIX}/lib" && \
make -j$(nproc) && \
sudo make install && \
rm -rf ${DIR} ) || fail_exit "spdlog"
}

install_base_ubuntu()
{
sudo apt-get install -y build-essential autoconf libtool zlib1g-dev tclsh cmake curl pkg-config bc uuid-dev
Expand Down Expand Up @@ -516,6 +562,8 @@ Do you want to continue [y/N] ? " ANS
fi
}

INSTALL_TARGETS=()

for i in "$@"
do
case $i in
Expand Down Expand Up @@ -561,7 +609,12 @@ case $i in
shift
;;
*)
# unknown option
if declare -f "install_$i" > /dev/null
then
INSTALL_TARGETS+=("$i")
else
echo "Unknown option: $i"
fi
;;
esac
done
Expand Down Expand Up @@ -601,23 +654,34 @@ else
exit 1
fi

install_nasm
install_openssl
install_libsrtp
install_libsrt
install_libopus
install_libopenh264
install_libx264
install_libvpx
install_libwebp
install_fdk_aac
install_nvcc_hdr
install_ffmpeg
install_stubs
install_jemalloc
install_libpcre2
install_hiredis
if [ ${#INSTALL_TARGETS[@]} -eq 0 ]
then
INSTALL_TARGETS=(
nasm
openssl
libsrtp
libsrt
libopus
libopenh264
libx264
libvpx
libwebp
fdk_aac
nvcc_hdr
ffmpeg
stubs
jemalloc
libpcre2
hiredis
spdlog
)
fi

if [ "${WITH_OME}" == "true" ]; then
install_ovenmediaengine
INSTALL_TARGETS+=(ovenmediaengine)
fi

for INSTALL_TARGET in ${INSTALL_TARGETS[@]}
do
install_${INSTALL_TARGET} || exit 1
done
3 changes: 2 additions & 1 deletion src/projects/AMS.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ PROJECT_C_INCLUDES := \
PROJECT_CXX_INCLUDES := \
$(PROJECT_C_INCLUDES)

# -Wfatal-errors: build 중 첫 번째 오류를 만나면 멈춤
# -Wfatal-errors: Stop at the first error encountered during build
PROJECT_CFLAGS := \
-D__STDC_CONSTANT_MACROS \
-Wfatal-errors \
-Wno-unused-function

PROJECT_CXXFLAGS := \
$(PROJECT_CFLAGS) \
-DSPDLOG_COMPILED_LIB \
-Wliteral-suffix \
-std=c++17

Expand Down
2 changes: 1 addition & 1 deletion src/projects/main/AMS.mk
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ LOCAL_STATIC_LIBRARIES := \
# rtsp_provider

LOCAL_PREBUILT_LIBRARIES := \
libspdlog.a \
libpugixml.a

LOCAL_LDFLAGS := -lpthread -luuid
Expand All @@ -81,6 +80,7 @@ $(call add_pkg_config,opus)
$(call add_pkg_config,libsrtp2)
$(call add_pkg_config,libpcre2-8)
$(call add_pkg_config,hiredis)
$(call add_pkg_config,spdlog)

ifeq ($(call chk_pkg_exist,ffnvcodec),0)
$(call add_pkg_config,ffnvcodec)
Expand Down
26 changes: 0 additions & 26 deletions src/projects/third_party/AMS-spdlog.mk

This file was deleted.

2 changes: 1 addition & 1 deletion src/projects/third_party/AMS.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
LOCAL_PATH := $(call get_local_path)

# 현재 디렉토리의 AMS-*.mk 호출
# Call AMS-*.mk in the current directory
AMS_FILE_LIST := $(call get_local_file_list,AMS-*.mk)
$(foreach file,$(AMS_FILE_LIST),$(eval include $(LOCAL_PATH)/$(file)))

19 changes: 0 additions & 19 deletions src/projects/third_party/spdlog-1.15.1/.clang-format

This file was deleted.

53 changes: 0 additions & 53 deletions src/projects/third_party/spdlog-1.15.1/.clang-tidy

This file was deleted.

6 changes: 0 additions & 6 deletions src/projects/third_party/spdlog-1.15.1/.git-blame-ignore-revs

This file was deleted.

1 change: 0 additions & 1 deletion src/projects/third_party/spdlog-1.15.1/.gitattributes

This file was deleted.

87 changes: 0 additions & 87 deletions src/projects/third_party/spdlog-1.15.1/.github/workflows/linux.yml

This file was deleted.

Loading

0 comments on commit c8509aa

Please sign in to comment.