Translated using Weblate.
[gammu.git] / configure
blob0cfa655f3185ef39874ae78f977fee64c5dc7da8
1 #! /bin/sh
2 # vim: expandtab sw=4 ts=4 sts=4:
3 # Wrapper for cmake to keep minimal compatibility with auto*
5 # Exit on error and undefined variables
6 set -e -u
8 cat <<EOT
9 Wrapper script for configuring CMake for Gammu.
11 This provides limited compatibility with configure, if you want full
12 configuration control, use directly CMake. More information about CMake
13 is available at <http://www.cmake.org>.
15 EOT
17 if ! type cmake > /dev/null 2>&1 ; then
18 echo 'ERROR: CMake not found, please install it, it is required for build.'
19 exit 1
22 help() {
23 cat <<EOT
24 Usage: ./configure [options]
26 --help|-h shows this help
27 --prefix=<path> installation prefix
28 --enable-shared enables shared build
29 --enable-debug enables debug build
30 --enable-tiger enables Mac OS X 10.4 (Tiger) build
31 --enable-backup enable backup support
32 --enable-win32 enable mingw crosscomilation
33 --enable-protection enable compile time protections
34 --with-python=<path> path to Python interpreter
35 --without-gnapplet disable installation of gnapplet
36 --without-completion disable installation of bash completion script
38 All enable params have their disable counterparts.
40 EOT
41 exit 2
44 # directory where we will build
45 BUILD_DIR=build-configure
47 # directory where sources are located
48 SOURCE_DIR=`pwd`
50 # cmake parameters
51 CMAKE_PREFIX=
52 CMAKE_SHARED=
53 CMAKE_DEBUG=
54 CMAKE_BACKUP=
55 CMAKE_CROSS=
56 CMAKE_PROTECTION=
57 CMAKE_PYTHON=
58 CMAKE_GNAP=
59 CMAKE_TIGER=
60 CMAKE_COMPLETE=
62 # process command line
63 while [ "$#" -gt 0 ] ; do
64 case "$1" in
65 --help|-h)
66 help
68 --prefix=*)
69 CMAKE_PREFIX="-DCMAKE_INSTALL_PREFIX=${1##--prefix=}"
71 --with-python=*)
72 CMAKE_PYTHON="-DBUILD_PYTHON=${1##--with-python=}"
74 --enable-backup)
75 CMAKE_BACKUP="-DWITH_BACKUP=ON"
77 --disable-backup)
78 CMAKE_BACKUP="-DWITH_BACKUP=OFF"
80 --enable-win32)
81 CMAKE_CROSS="-DCROSS_MINGW=ON"
83 --disable-win32)
84 CMAKE_CROSS="-DCROSS_MINGW=OFF"
86 --enable-shared)
87 CMAKE_SHARED="-DBUILD_SHARED_LIBS=ON"
89 --disable-shared)
90 CMAKE_SHARED="-DBUILD_SHARED_LIBS=OFF"
92 --enable-protection)
93 CMAKE_PROTECTION="-DENABLE_PROTECTION=ON"
95 --disable-protection)
96 CMAKE_PROTECTION="-DENABLE_PROTECTION=OFF"
98 --enable-debug)
99 CMAKE_DEBUG="-DCMAKE_BUILD_TYPE=Debug"
101 --disable-debug)
102 CMAKE_DEBUG=
104 --without-gnapplet)
105 CMAKE_GNAP="-DINSTALL_GNAPPLET=OFF"
107 --without-completion)
108 CMAKE_COMPLETE="-DINSTALL_BASH_COMPLETION=OFF"
110 --enable-tiger)
111 CMAKE_TIGER="-DENABLE_TIGER=ON"
113 --build=*)
115 --disable-dependency-tracking)
117 --disable-maintainer-mode)
119 --includedir=*)
121 --mandir=*)
123 --infodir=*)
125 --sysconfdir=*)
127 --localstatedir=*)
129 --libexecdir=*)
132 echo "Unknown parameter: $1"
133 echo
134 help
136 esac
137 shift
138 done
140 # create build dir if needed
141 if [ ! -d "$BUILD_DIR" ] ; then
142 mkdir -p "$BUILD_DIR"
145 # go to build dir
146 cd "$BUILD_DIR"
148 # invoke cmake to do configuration
149 cmake $SOURCE_DIR $CMAKE_PREFIX $CMAKE_SHARED $CMAKE_DEBUG $CMAKE_BACKUP $CMAKE_CROSS $CMAKE_PROTECTION $CMAKE_PYTHON $CMAKE_GNAP $CMAKE_TIGER $CMAKE_COMPLETE