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
# 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
# Platform-specific versioned library filename
@ -59,8 +60,9 @@ else
endif
# Library flags
LIB_PATHS = -L$(DPP_BUILD_DIR) -L../sqlite3
LIBRARIES = -ldpp -lsqlite3
#LIB_PATHS = -L$(DPP_BUILD_DIR) -L../sqlite3
LIB_PATHS = -L$(DPP_BUILD_DIR) -L.
LIBRARIES = -ldpp -lsqlite3 -lssl -lcrypto
# Build type specific flags
ifeq ($(BUILD_TYPE), debug)
@ -96,6 +98,14 @@ ifeq ($(PLATFORM), Darwin)
else \
cp $(DPP_BUILD_DIR)/$(DPP_LIB_NAME) $(BIN_DIR)/$(DPP_LIB_NAME); \
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
@# Linux: Handle versioned libraries (follow standard convention)
@if [ -f $(DPP_BUILD_DIR)/$(DPP_VERSIONED_FILE) ]; then \
@ -149,4 +159,5 @@ cleanall:
rmdir obj/* 2>/dev/null || true
rmdir bin/* 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
cd DPP
/Applications/CMake.app/Contents/bin/cmake -B ./build \
-DOPENSSL_ROOT_DIR=../homebrew/opt/openssl@3 \
-DOPENSSL_INCLUDE_DIR=../homebrew/opt/openssl@3/include \
-DOPENSSL_CRYPTO_LIBRARY=../homebrew/opt/openssl@3/lib/libcrypto.a \
-DOPENSSL_SSL_LIBRARY=../homebrew/opt/openssl@3/lib/libssl.a
/Applications/CMake.app/Contents/bin/cmake --build ./build -j8
cd ..
git clone https://git.indoodle.com/oomer/poomer-discord.git
cd poomer-discord
-DOPENSSL_INCLUDE_DIR="$PWD/../libssl/include" \
-DOPENSSL_CRYPTO_LIBRARY="$PWD/../libssl/lib/libcrypto.dylib" \
-DOPENSSL_SSL_LIBRARY="$PWD/../libssl/lib/libssl.dylib" \
-DCMAKE_PREFIX_PATH="$PWD/../zlib"
/Applications/CMake.app/Contents/bin/cmake --build ./build -j8
cd ../poomer-discord
git clone https://git.indoodle.com/oomer/poomer-discord.git .
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
make all -j4