Fix --wssshtools-only option to build only C implementations

- Move C building logic outside Python-building conditional block
- Ensure --wssshtools-only builds all C tools (wssshc, wsssh, wsscp)
- Skip Python binary building when --wssshtools-only is specified
- Maintain compatibility with other build options
parent e6376dfa
...@@ -48,6 +48,7 @@ while [[ $# -gt 0 ]]; do ...@@ -48,6 +48,7 @@ while [[ $# -gt 0 ]]; do
esac esac
done done
# Check if virtual environment exists, create if not # Check if virtual environment exists, create if not
if [ ! -d "venv" ]; then if [ ! -d "venv" ]; then
echo "Creating virtual environment..." echo "Creating virtual environment..."
...@@ -121,27 +122,30 @@ if [ "$BUILD_DEBIAN_ONLY" = false ] && [ "$BUILD_WSSSHTOOLS_ONLY" = false ]; the ...@@ -121,27 +122,30 @@ if [ "$BUILD_DEBIAN_ONLY" = false ] && [ "$BUILD_WSSSHTOOLS_ONLY" = false ]; the
pyinstaller --onefile --distpath dist --runtime-tmpdir /tmp --clean wsscp.py pyinstaller --onefile --distpath dist --runtime-tmpdir /tmp --clean wsscp.py
fi fi
fi fi
fi
# Build C version if wssshtools directory exists # Build C version if wssshtools directory exists and not debian-only
if [ -d "wssshtools" ]; then if [ "$BUILD_DEBIAN_ONLY" = false ] && [ -d "wssshtools" ]; then
echo "Building C version..." echo "Building C version..."
cd wssshtools cd wssshtools
if [ -f "configure.sh" ]; then if [ -f "configure.sh" ]; then
./configure.sh ./configure.sh
if [ "$BUILD_SERVER_ONLY" = true ]; then if [ "$BUILD_WSSSHTOOLS_ONLY" = true ]; then
# Build only wssshc (client) for server-only mode # Build all C tools for wssshtools-only mode
make wssshc make
elif [ "$BUILD_NO_SERVER" = true ]; then elif [ "$BUILD_SERVER_ONLY" = true ]; then
# Build only wssshc for no-server mode # Build only wssshc (client) for server-only mode
make wssshc make wssshc
else elif [ "$BUILD_NO_SERVER" = true ]; then
make # Build only wssshc for no-server mode
fi make wssshc
cd ..
else else
echo "Warning: configure.sh not found in wssshtools/" make
cd ..
fi fi
cd ..
else
echo "Warning: configure.sh not found in wssshtools/"
cd ..
fi fi
fi fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment