Add WITH_HOST_TOOLS option
[reactos.git] / configure.sh
1 #!/bin/sh
2
3 if [ "x$ROS_ARCH" = "x" ]; then
4 echo Could not detect RosBE.
5 exit 1
6 fi
7
8 BUILD_ENVIRONMENT=MinGW
9 ARCH=$ROS_ARCH
10 REACTOS_SOURCE_DIR=$(cd `dirname $0` && pwd)
11 REACTOS_OUTPUT_PATH=output-$BUILD_ENVIRONMENT-$ARCH
12
13 usage() {
14 echo Invalid parameter given.
15 exit 1
16 }
17
18 CMAKE_GENERATOR="Ninja"
19 while [ $# -gt 0 ]; do
20 case $1 in
21 -D)
22 shift
23 if echo "x$1" | grep 'x?*=*' > /dev/null; then
24 ROS_CMAKEOPTS=$ROS_CMAKEOPTS" -D $1"
25 else
26 usage
27 fi
28 ;;
29
30 -D?*=*|-D?*)
31 ROS_CMAKEOPTS=$ROS_CMAKEOPTS" $1"
32 ;;
33 makefiles|Makefiles)
34 CMAKE_GENERATOR="Unix Makefiles"
35 ;;
36 *)
37 usage
38 esac
39
40 shift
41 done
42
43 if [ "$REACTOS_SOURCE_DIR" = "$PWD" ]; then
44 echo Creating directories in $REACTOS_OUTPUT_PATH
45 mkdir -p "$REACTOS_OUTPUT_PATH"
46 cd "$REACTOS_OUTPUT_PATH"
47 fi
48
49 echo Preparing reactos...
50 rm -f CMakeCache.txt host-tools/CMakeCache.txt
51
52 cmake -G "$CMAKE_GENERATOR" -DENABLE_CCACHE:BOOL=0 -DCMAKE_TOOLCHAIN_FILE:FILEPATH=toolchain-gcc.cmake -DARCH:STRING=$ARCH $EXTRA_ARGS $ROS_CMAKEOPTS "$REACTOS_SOURCE_DIR"
53
54 echo Configure script complete! Enter directories and execute appropriate build commands \(ex: ninja, make, makex, etc...\).