[MBEDTLS] Update to version 2.7.10. CORE-15895
[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 USE_NEW_STYLE=1
13
14 usage() {
15 echo Invalid parameter given.
16 exit 1
17 }
18
19 CMAKE_GENERATOR="Ninja"
20 while [ $# -gt 0 ]; do
21 case $1 in
22 -D)
23 shift
24 if echo "x$1" | grep 'x?*=*' > /dev/null; then
25 ROS_CMAKEOPTS=$ROS_CMAKEOPTS" -D $1"
26 else
27 usage
28 fi
29 ;;
30
31 -D?*=*|-D?*)
32 ROS_CMAKEOPTS=$ROS_CMAKEOPTS" $1"
33 ;;
34 makefiles|Makefiles)
35 CMAKE_GENERATOR="Unix Makefiles"
36 ;;
37 with-host-tools)
38 USE_NEW_STYLE=0
39 ;;
40 *)
41 usage
42 esac
43
44 shift
45 done
46
47 if [ "$REACTOS_SOURCE_DIR" = "$PWD" ]; then
48 echo Creating directories in $REACTOS_OUTPUT_PATH
49 mkdir -p "$REACTOS_OUTPUT_PATH"
50 cd "$REACTOS_OUTPUT_PATH"
51 fi
52
53 #EXTRA_ARGS=""
54 if [ $USE_NEW_STYLE -eq 0 ]; then
55 mkdir -p host-tools
56 mkdir -p reactos
57 echo Preparing host tools...
58 cd host-tools
59 rm -f CMakeCache.txt
60
61 REACTOS_BUILD_TOOLS_DIR="$PWD"
62 cmake -G "$CMAKE_GENERATOR" -DARCH:STRING=$ARCH $ROS_CMAKEOPTS -DNEW_STYLE_BUILD:BOOL=0 "$REACTOS_SOURCE_DIR"
63
64 EXTRA_ARGS="$EXTRA_ARGS -DREACTOS_BUILD_TOOLS_DIR:PATH=$REACTOS_BUILD_TOOLS_DIR"
65
66 cd ..
67 fi
68
69 echo Preparing reactos...
70
71 if [ $USE_NEW_STYLE -eq 0 ]; then
72 cd reactos
73 fi
74
75 rm -f CMakeCache.txt host-tools/CMakeCache.txt
76
77 cmake -G "$CMAKE_GENERATOR" -DENABLE_CCACHE:BOOL=0 -DCMAKE_TOOLCHAIN_FILE:FILEPATH=toolchain-gcc.cmake -DARCH:STRING=$ARCH -DNEW_STYLE_BUILD:BOOL=$USE_NEW_STYLE $EXTRA_ARGS $ROS_CMAKEOPTS "$REACTOS_SOURCE_DIR"
78
79 echo Configure script complete! Enter directories and execute appropriate build commands \(ex: ninja, make, makex, etc...\).