MacOS build instruction rewrite to build third party libs from source

This commit is contained in:
Harvey Fong 2026-01-03 20:53:58 +00:00
parent 4cc07f9112
commit 0f19a691c2
2 changed files with 22 additions and 13 deletions

View File

@ -48,7 +48,8 @@ else
endif endif
# Common include and library paths # Common include and library paths
INCLUDE_PATHS = -I$(DPP_PATH)/include -I../sqlite3 #INCLUDE_PATHS = -I$(DPP_PATH)/include -I../sqlite3
INCLUDE_PATHS = -I$(DPP_PATH)/include
DPP_BUILD_DIR = $(DPP_PATH)/build/library DPP_BUILD_DIR = $(DPP_PATH)/build/library
# Platform-specific versioned library filename # Platform-specific versioned library filename
@ -59,8 +60,9 @@ else
endif endif
# Library flags # Library flags
LIB_PATHS = -L$(DPP_BUILD_DIR) -L../sqlite3 #LIB_PATHS = -L$(DPP_BUILD_DIR) -L../sqlite3
LIBRARIES = -ldpp -lsqlite3 LIB_PATHS = -L$(DPP_BUILD_DIR) -L.
LIBRARIES = -ldpp -lsqlite3 -lssl -lcrypto
# Build type specific flags # Build type specific flags
ifeq ($(BUILD_TYPE), debug) ifeq ($(BUILD_TYPE), debug)
@ -96,6 +98,14 @@ ifeq ($(PLATFORM), Darwin)
else \ else \
cp $(DPP_BUILD_DIR)/$(DPP_LIB_NAME) $(BIN_DIR)/$(DPP_LIB_NAME); \ cp $(DPP_BUILD_DIR)/$(DPP_LIB_NAME) $(BIN_DIR)/$(DPP_LIB_NAME); \
fi fi
@# Fix library paths for OpenSSL dependencies
@if [ -f $(BIN_DIR)/$(DPP_VERSIONED_FILE) ]; then \
install_name_tool -change /Users/harvey/learndir/libssl/install/lib/libssl.4.dylib @executable_path/libssl.dylib $(BIN_DIR)/$(DPP_VERSIONED_FILE); \
install_name_tool -change /Users/harvey/learndir/libssl/install/lib/libcrypto.4.dylib @executable_path/libcrypto.dylib $(BIN_DIR)/$(DPP_VERSIONED_FILE); \
fi
@install_name_tool -change /Users/harvey/learndir/libssl/install/lib/libssl.4.dylib @executable_path/libssl.dylib $(OUTPUT_FILE); \
install_name_tool -change /Users/harvey/learndir/libssl/install/lib/libcrypto.4.dylib @executable_path/libcrypto.dylib $(OUTPUT_FILE); \
cp libssl.dylib libcrypto.dylib $(BIN_DIR)/
else else
@# Linux: Handle versioned libraries (follow standard convention) @# Linux: Handle versioned libraries (follow standard convention)
@if [ -f $(DPP_BUILD_DIR)/$(DPP_VERSIONED_FILE) ]; then \ @if [ -f $(DPP_BUILD_DIR)/$(DPP_VERSIONED_FILE) ]; then \
@ -150,3 +160,4 @@ cleanall:
rmdir bin/* 2>/dev/null || true rmdir bin/* 2>/dev/null || true
rmdir obj 2>/dev/null || true rmdir obj 2>/dev/null || true
rmdir bin 2>/dev/null || true rmdir bin 2>/dev/null || true

View File

@ -56,15 +56,13 @@ brew install openssl
git clone https://github.com/brainboxdotcc/DPP.git git clone https://github.com/brainboxdotcc/DPP.git
cd DPP cd DPP
/Applications/CMake.app/Contents/bin/cmake -B ./build \ /Applications/CMake.app/Contents/bin/cmake -B ./build \
-DOPENSSL_ROOT_DIR=../homebrew/opt/openssl@3 \ -DOPENSSL_INCLUDE_DIR="$PWD/../libssl/include" \
-DOPENSSL_INCLUDE_DIR=../homebrew/opt/openssl@3/include \ -DOPENSSL_CRYPTO_LIBRARY="$PWD/../libssl/lib/libcrypto.dylib" \
-DOPENSSL_CRYPTO_LIBRARY=../homebrew/opt/openssl@3/lib/libcrypto.a \ -DOPENSSL_SSL_LIBRARY="$PWD/../libssl/lib/libssl.dylib" \
-DOPENSSL_SSL_LIBRARY=../homebrew/opt/openssl@3/lib/libssl.a -DCMAKE_PREFIX_PATH="$PWD/../zlib"
/Applications/CMake.app/Contents/bin/cmake --build ./build -j8
/Applications/CMake.app/Contents/bin/cmake --build ./build -j8 cd ../poomer-discord
cd .. git clone https://git.indoodle.com/oomer/poomer-discord.git .
git clone https://git.indoodle.com/oomer/poomer-discord.git
cd poomer-discord
curl -LO https://raw.githubusercontent.com/nothings/stb/master/stb_image.h curl -LO https://raw.githubusercontent.com/nothings/stb/master/stb_image.h
curl -LO https://raw.githubusercontent.com/nothings/stb/master/stb_image_write.h curl -LO https://raw.githubusercontent.com/nothings/stb/master/stb_image_write.h
make all -j4 make all -j4