Skip to content

Commit

Permalink
Merge pull request #148 from Wolf3s/smb2
Browse files Browse the repository at this point in the history
Add libsmb2
  • Loading branch information
fjtrujy authored Jul 8, 2024
2 parents 409dd0e + 5f567dc commit 2a0d2a3
Showing 1 changed file with 25 additions and 5 deletions.
30 changes: 25 additions & 5 deletions build-cmakelibs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,41 @@ else
XTRA_OPTS=(. -G"Unix Makefiles")
fi

CMAKE_OPTIONS=(-Wno-dev "-DCMAKE_TOOLCHAIN_FILE=$PS2DEV/share/ps2dev.cmake" "-DCMAKE_INSTALL_PREFIX=$PS2SDK/ports" -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo "-DCMAKE_PREFIX_PATH=$PS2SDK/ports")
#CMAKE_OPTIONS=("${CMAKE_OPTIONS[@]}" -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON)
EE_CMAKE_OPTIONS=(-Wno-dev "-DCMAKE_TOOLCHAIN_FILE=$PS2DEV/share/ps2dev.cmake" "-DCMAKE_INSTALL_PREFIX=$PS2SDK/ports" -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo "-DCMAKE_PREFIX_PATH=$PS2SDK/ports")
IOP_CMAKE_OPTIONS=("-DCMAKE_TOOLCHAIN_FILE=$PS2DEV/share/ps2dev_iop.cmake" "-DCMAKE_INSTALL_PREFIX=$PS2SDK/ports_iop" -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo "-DCMAKE_PREFIX_PATH=$PS2SDK/ports_iop")

function build {
START_DIR="${PWD}"
cd "$1"
shift
mkdir -p build
cd build
CFLAGS="$CFLAGS" cmake "${CMAKE_OPTIONS[@]}" "$@" "${XTRA_OPTS[@]}" .. || { exit 1; }
CFLAGS="$CFLAGS" cmake "${EE_CMAKE_OPTIONS[@]}" "$@" "${XTRA_OPTS[@]}" .. || { exit 1; }
"${MAKECMD}" --quiet -j "$PROC_NR" clean all install || { exit 1; }
cd "${START_DIR}"
}

## Create a synbolic link with relative folder for retro-compatibility ps2dev.cmake
function build_iop {
START_DIR="${PWD}"
cd "$1"
shift
mkdir -p build_iop
cd build_iop
CFLAGS="$CFLAGS" cmake "${IOP_CMAKE_OPTIONS[@]}" "$@" "${XTRA_OPTS[@]}" .. || { exit 1; }
"${MAKECMD}" --quiet -j "$PROC_NR" clean all install || { exit 1; }
cd "${START_DIR}"
}

## Create a synbolic link for retro-compatibility ps2dev.cmake and ps2dev_iop.cmake
(cd "${PS2SDK}" && ln -sf "../share/ps2dev.cmake" "ps2dev.cmake" && cd -) || { exit 1; }
(cd "${PS2SDK}" && ln -sf "../share/ps2dev_iop.cmake" "ps2dev_iop.cmake" && cd -) || { exit 1; }

##
## Remove build folder
##
rm -rf build
rm -rf build_iop

mkdir build
cd build

Expand Down Expand Up @@ -90,7 +104,10 @@ git clone --depth 1 -b release-2.20.2 https://github.com/libsdl-org/SDL_ttf.git

# We need to clone the whole repo and point to the specific hash for now,
# till a new version is released after this commit

git clone https://github.com/sahlberg/libsmb2.git || { exit 1; }
(cd libsmb2 && git checkout dccf1dbccd66a8c433e336de4951a249096e1c22 && cd -) || { exit 1; }
# We need to clone the whole repo and point to the specific hash for now,
# till a new version is released after this commit
git clone https://github.com/lsalzman/enet.git || { exit 1; }
(cd enet && git checkout 7083138fd401faa391c4f829a86b50fdb9c5c727 && cd -) || { exit 1; }

Expand Down Expand Up @@ -139,5 +156,8 @@ install -m644 argtable2-13/src/argtable2.h $PS2SDK/ports/include/

build argtable3 -DARGTABLE3_INSTALL_CMAKEDIR="${PS2SDK}/ports/lib/cmake/" -DARGTABLE3_REPLACE_GETOPT=OFF -DARGTABLE3_ENABLE_EXAMPLES=OFF -DARGTABLE3_ENABLE_TESTS=OFF

build libsmb2
build_iop libsmb2

# Finish
cd ..

0 comments on commit 2a0d2a3

Please sign in to comment.