X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=configure.sh;h=8893d4e9390b85f5c068bccd17142fec320033d6;hp=6c0579c8339c71e64ec107c15aca548e29fd8082;hb=08b3bef0806bfae71570efdd0d0dc3aa33d3e095;hpb=e385be59b16fce37dcfa604fc77bc648fad57910 diff --git a/configure.sh b/configure.sh index 6c0579c8339..8893d4e9390 100755 --- a/configure.sh +++ b/configure.sh @@ -1,8 +1,8 @@ -#!/bin/bash -if [ "x$ROS_ARCH" == "x" ] -then - echo Could not detect RosBE. - exit 1 +#!/bin/sh + +if [ "x$ROS_ARCH" = "x" ]; then + echo Could not detect RosBE. + exit 1 fi BUILD_ENVIRONMENT=MinGW @@ -10,28 +10,55 @@ ARCH=$ROS_ARCH REACTOS_SOURCE_DIR=$(cd `dirname $0` && pwd) REACTOS_OUTPUT_PATH=output-$BUILD_ENVIRONMENT-$ARCH -if [ "$REACTOS_SOURCE_DIR" == "$PWD" ] -then - echo Creating directories in $REACTOS_OUTPUT_PATH - mkdir -p $REACTOS_OUTPUT_PATH - cd "$REACTOS_OUTPUT_PATH" +usage() { + echo Invalid parameter given. + exit 1 +} + +CMAKE_GENERATOR="Ninja" +while [ $# -gt 0 ]; do + case $1 in + -D) + shift + if echo "x$1" | grep 'x?*=*' > /dev/null; then + ROS_CMAKEOPTS=$ROS_CMAKEOPTS" -D $1" + else + usage + fi + ;; + + -D?*=*|-D?*) + ROS_CMAKEOPTS=$ROS_CMAKEOPTS" $1" + ;; + makefiles|Makefiles) + CMAKE_GENERATOR="Unix Makefiles" + ;; + *) + usage + esac + + shift +done + +if [ "$REACTOS_SOURCE_DIR" = "$PWD" ]; then + echo Creating directories in $REACTOS_OUTPUT_PATH + mkdir -p "$REACTOS_OUTPUT_PATH" + cd "$REACTOS_OUTPUT_PATH" fi -mkdir -p host-tools -mkdir -p reactos +mkdir -p host-tools reactos echo Preparing host tools... cd host-tools -if [ -f CMakeCache.txt ] -then - rm -f CMakeCache.txt -fi +rm -f CMakeCache.txt REACTOS_BUILD_TOOLS_DIR="$PWD" -cmake -G "Unix Makefiles" -DARCH=$ARCH "$REACTOS_SOURCE_DIR" +cmake -G "$CMAKE_GENERATOR" -DARCH=$ARCH $ROS_CMAKEOPTS "$REACTOS_SOURCE_DIR" +echo Preparing reactos... cd ../reactos -cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=toolchain-mingw32.cmake -DARCH=$ARCH -DREACTOS_BUILD_TOOLS_DIR="$REACTOS_BUILD_TOOLS_DIR" "$REACTOS_SOURCE_DIR" +rm -f CMakeCache.txt -echo Configure script complete! Enter directories and execute appropriate build commands\(ex: make, makex, etc...\). +cmake -G "$CMAKE_GENERATOR" -DENABLE_CCACHE=0 -DPCH=0 -DCMAKE_TOOLCHAIN_FILE=toolchain-gcc.cmake -DARCH=$ARCH -DREACTOS_BUILD_TOOLS_DIR="$REACTOS_BUILD_TOOLS_DIR" $ROS_CMAKEOPTS "$REACTOS_SOURCE_DIR" +echo Configure script complete! Enter directories and execute appropriate build commands \(ex: ninja, make, makex, etc...\).