Create a branch for Aleksandar Andrejevic for his work on NTVDM. See http://jira...
[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 for (( i=1; i<=$#; i++ )); do
20 case ${!i} in
21 -D)
22 ((i++))
23 if [[ "x${!i}" == x?*=* ]] ; then
24 ROS_CMAKEOPTS+=" -D ${!i}"
25 else
26 usage
27 fi
28 ;;
29
30 -D?*=*)
31 ROS_CMAKEOPTS+=" ${!i}"
32 ;;
33 makefiles|Makefiles)
34 CMAKE_GENERATOR="Unix Makefiles"
35 ;;
36 *)
37 usage
38 esac
39 done
40
41 if [ "$REACTOS_SOURCE_DIR" = "$PWD" ]; then
42 echo Creating directories in $REACTOS_OUTPUT_PATH
43 mkdir -p "$REACTOS_OUTPUT_PATH"
44 cd "$REACTOS_OUTPUT_PATH"
45 fi
46
47 mkdir -p host-tools reactos
48
49 echo Preparing host tools...
50 cd host-tools
51 rm -f CMakeCache.txt
52
53 REACTOS_BUILD_TOOLS_DIR="$PWD"
54 cmake -G "$CMAKE_GENERATOR" -DARCH=$ARCH $ROS_CMAKEOPTS "$REACTOS_SOURCE_DIR"
55
56 echo Preparing reactos...
57 cd ../reactos
58 rm -f CMakeCache.txt
59
60 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"
61
62 echo Configure script complete! Enter directories and execute appropriate build commands\(ex: ninja, make, makex, etc...\).