Translation update done using Pootle.
[gammu.git] / configure
blob5b485634ec8e91014e1c50d530c100f9c52cefa3
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
37 All enable params have their disable counterparts.
39 EOT
40 exit 2
43 # directory where we will build
44 BUILD_DIR=build-configure
46 # directory where sources are located
47 SOURCE_DIR=`pwd`
49 # cmake parameters
50 CMAKE_PREFIX=
51 CMAKE_SHARED=
52 CMAKE_DEBUG=
53 CMAKE_BACKUP=
54 CMAKE_CROSS=
55 CMAKE_PROTECTION=
56 CMAKE_PYTHON=
57 CMAKE_GNAP=
58 CMAKE_TIGER=
60 # process command line
61 while [ "$#" -gt 0 ] ; do
62 case "$1" in
63 --help|-h)
64 help
66 --prefix=*)
67 CMAKE_PREFIX="-DCMAKE_INSTALL_PREFIX=${1##--prefix=}"
69 --with-python=*)
70 CMAKE_PYTHON="-DBUILD_PYTHON=${1##--with-python=}"
72 --enable-backup)
73 CMAKE_BACKUP="-DWITH_BACKUP=ON"
75 --disable-backup)
76 CMAKE_BACKUP="-DWITH_BACKUP=OFF"
78 --enable-win32)
79 CMAKE_CROSS="-DCROSS_MINGW=ON"
81 --disable-win32)
82 CMAKE_CROSS="-DCROSS_MINGW=OFF"
84 --enable-shared)
85 CMAKE_SHARED="-DBUILD_SHARED_LIBS=ON"
87 --disable-shared)
88 CMAKE_SHARED="-DBUILD_SHARED_LIBS=OFF"
90 --enable-protection)
91 CMAKE_PROTECTION="-DENABLE_PROTECTION=ON"
93 --disable-protection)
94 CMAKE_PROTECTION="-DENABLE_PROTECTION=OFF"
96 --enable-debug)
97 CMAKE_DEBUG="-DCMAKE_BUILD_TYPE=Debug"
99 --disable-debug)
100 CMAKE_DEBUG=
102 --without-gnapplet)
103 CMAKE_GNAP="-DINSTALL_GNAPPLET=OFF"
105 --enable-tiger)
106 CMAKE_TIGER="-DENABLE_TIGER=ON"
108 --build=*)
110 --disable-dependency-tracking)
112 --disable-maintainer-mode)
114 --includedir=*)
116 --mandir=*)
118 --infodir=*)
120 --sysconfdir=*)
122 --localstatedir=*)
124 --libexecdir=*)
127 echo "Unknown parameter: $1"
128 echo
129 help
131 esac
132 shift
133 done
135 # create build dir if needed
136 if [ ! -d "$BUILD_DIR" ] ; then
137 mkdir -p "$BUILD_DIR"
140 # go to build dir
141 cd "$BUILD_DIR"
143 # invoke cmake to do configuration
144 cmake $SOURCE_DIR $CMAKE_PREFIX $CMAKE_SHARED $CMAKE_DEBUG $CMAKE_BACKUP $CMAKE_CROSS $CMAKE_PROTECTION $CMAKE_PYTHON $CMAKE_GNAP $CMAKE_TIGER