File: configure

package info (click to toggle)
hatari 2.2.0%2Bdfsg-1
  • links: PTS
  • area: main
  • in suites: buster
  • size: 11,932 kB
  • sloc: ansic: 160,820; python: 5,589; objc: 1,913; asm: 1,523; sh: 1,348; makefile: 99; xml: 32
file content (122 lines) | stat: -rwxr-xr-x 3,816 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#!/bin/sh

# NOTE: this is a simple script wrapper around the cmake command line tools,
# for those used to the autotools configure script conventions

if ! which cmake > /dev/null; then
  echo "ERROR: You need the 'cmake' program to configure the Hatari build process."
  echo "Please install 'cmake' first, then try again."
  exit 1
fi

print_help()
{
  echo "This is a simple configure script wrapper around cmake build system."
  echo "Parameters are:"
  echo "  --prefix=<path>            Set the install prefix to path"
  echo "  --enable-debug             Enable debug (non-optimized) build"
  echo "  --enable-small-mem         Use less memory - at the expense of emulation speed"
  echo "  --disable-dsp              Disable DSP emulation for Falcon mode."
  echo "  --disable-tracing          Disable tracing messages for debugging"
  echo "  --enable-winuae-cpu        Use WinUAE CPU core (default)"
  echo "  --enable-old-uae-cpu       Use old UAE CPU core (deprecated)"
  echo "  --disable-osx-bundle       Disable application bundling on macOS"
  echo "  --disable-sdl2             Do not compile with libsdl 2.0, use 1.2 instead"
  echo "  --cross-compile-win64_32   Build the 32 bit Windows version under linux using mingw-w64"
  echo "  --cross-compile-win64_64   Build the 64 bit Windows version under linux using mingw-w64"
  echo
  echo "Please run cmake directly for full control over the build."
  echo
}

cmake_args=""
build_type="Release"

while [ $# -gt 0 ]
do
  preq=${1%=*}			# get part before =
  case $preq
  in
    --help)
      print_help
      exit 0
    ;;
    --prefix)
      prefix=${1##*=}		# get part after =
      cmake_args="$cmake_args -DCMAKE_INSTALL_PREFIX:PATH=$prefix"
    ;;
    --enable-debug)
      build_type="Debug"
      cmake_args="$cmake_args -DCMAKE_BUILD_TYPE:STRING=Debug"
    ;;
    --disable-debug)
      build_type="Release"
      cmake_args="$cmake_args -DCMAKE_BUILD_TYPE:STRING=Release"
    ;;
    --enable-dsp)
      cmake_args="$cmake_args -DENABLE_DSP_EMU:BOOL=1"
    ;;
    --disable-dsp)
      cmake_args="$cmake_args -DENABLE_DSP_EMU:BOOL=0"
    ;;
    --enable-tracing)
      cmake_args="$cmake_args -DENABLE_TRACING:BOOL=1"
    ;;
    --disable-tracing)
      cmake_args="$cmake_args -DENABLE_TRACING:BOOL=0"
    ;;
    --enable-small-mem)
      cmake_args="$cmake_args -DENABLE_SMALL_MEM:BOOL=1"
    ;;
    --disable-small-mem)
      cmake_args="$cmake_args -DENABLE_SMALL_MEM:BOOL=0"
    ;;
    --enable-winuae-cpu)
      cmake_args="$cmake_args -DENABLE_WINUAE_CPU:BOOL=1"
    ;;
    --disable-winuae-cpu)
      cmake_args="$cmake_args -DENABLE_WINUAE_CPU:BOOL=0"
    ;;
    --enable-old-uae-cpu)
      cmake_args="$cmake_args -DENABLE_WINUAE_CPU:BOOL=0"
    ;;
    --disable-old-uae-cpu)
      cmake_args="$cmake_args -DENABLE_WINUAE_CPU:BOOL=1"
    ;;
    --enable-osx-bundle)
      cmake_args="$cmake_args -DENABLE_OSX_BUNDLE:BOOL=1"
    ;;
    --disable-osx-bundle)
      cmake_args="$cmake_args -DENABLE_OSX_BUNDLE:BOOL=0"
    ;;
    --enable-sdl2)
      cmake_args="$cmake_args -DENABLE_SDL2:BOOL=1"
    ;;
    --disable-sdl2)
      cmake_args="$cmake_args -DENABLE_SDL2:BOOL=0"
    ;;
    --cross-compile-win64_32)
      cmake_args="$cmake_args -DCMAKE_TOOLCHAIN_FILE=cmake/Toolchain-mingw32-win64_32.cmake"
    ;;
    --cross-compile-win64_64)
      cmake_args="$cmake_args -DCMAKE_TOOLCHAIN_FILE=cmake/Toolchain-mingw32-win64_64.cmake"
    ;;
    *)
      echo "Invalid argument: $preq"
      echo "Run $0 --help for a list of valid parameters."
      exit 2
    ;;
  esac
  shift 1
done

# remove previous cmake's cache
rm -f `dirname $0`/CMakeCache.txt
rm -rf `dirname $0`/CMakeFiles/

cmake `dirname $0` $cmake_args || exit 1

echo
echo "Now you must type: make; make install"
echo "to actually build and install the software"
echo