forked from gammu/gammu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure
executable file
·147 lines (131 loc) · 3.65 KB
/
configure
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
#! /bin/sh
# vim: expandtab sw=4 ts=4 sts=4:
# Wrapper for cmake to keep minimal compatibility with auto*
# Exit on error and undefined variables
set -e -u
cat <<EOT
Wrapper script for configuring CMake for Gammu.
This provides limited compatibility with configure, if you want full
configuration control, use directly CMake. More information about CMake
is available at <http://www.cmake.org>.
EOT
for cmd in cmake readlink dirname ; do
if ! type $cmd > /dev/null 2>&1 ; then
echo "ERROR: $cmd not found, please install it, it is required for build."
exit 1
fi
done
help() {
cat <<EOT
Usage: ./configure [options]
--help|-h shows this help
--prefix=<path> installation prefix
--enable-shared enables shared build
--enable-debug enables debug build
--enable-tiger enables Mac OS X 10.4 (Tiger) build
--enable-backup enable backup support
--enable-win32 enable mingw crosscomilation
--enable-protection enable compile time protections
--with-python=<path> path to Python interpreter
--without-gnapplet disable installation of gnapplet
--without-completion disable installation of bash completion script
All enable params have their disable counterparts.
EOT
exit 2
}
# directory where sources are located
SOURCE_DIR="$(dirname $(readlink -f $0))"
# directory where we will build
BUILD_DIR="$SOURCE_DIR/build-configure"
# cmake parameters
CMAKE_PREFIX=
CMAKE_SHARED=
CMAKE_DEBUG=
CMAKE_BACKUP=
CMAKE_CROSS=
CMAKE_PROTECTION=
CMAKE_PYTHON=
CMAKE_GNAP=
CMAKE_COMPLETE=
# process command line
while [ "$#" -gt 0 ] ; do
case "$1" in
--help|-h)
help
;;
--prefix=*)
CMAKE_PREFIX="-DCMAKE_INSTALL_PREFIX=${1##--prefix=}"
;;
--with-python=*)
CMAKE_PYTHON="-DBUILD_PYTHON=${1##--with-python=}"
;;
--enable-backup)
CMAKE_BACKUP="-DWITH_BACKUP=ON"
;;
--disable-backup)
CMAKE_BACKUP="-DWITH_BACKUP=OFF"
;;
--enable-win32)
CMAKE_CROSS="-DCROSS_MINGW=ON"
;;
--disable-win32)
CMAKE_CROSS="-DCROSS_MINGW=OFF"
;;
--enable-shared)
CMAKE_SHARED="-DBUILD_SHARED_LIBS=ON"
;;
--disable-shared)
CMAKE_SHARED="-DBUILD_SHARED_LIBS=OFF"
;;
--enable-protection)
CMAKE_PROTECTION="-DENABLE_PROTECTION=ON"
;;
--disable-protection)
CMAKE_PROTECTION="-DENABLE_PROTECTION=OFF"
;;
--enable-debug)
CMAKE_DEBUG="-DCMAKE_BUILD_TYPE=Debug"
;;
--disable-debug)
CMAKE_DEBUG=
;;
--without-gnapplet)
CMAKE_GNAP="-DINSTALL_GNAPPLET=OFF"
;;
--without-completion)
CMAKE_COMPLETE="-DINSTALL_BASH_COMPLETION=OFF"
;;
--build=*)
;;
--disable-dependency-tracking)
;;
--disable-maintainer-mode)
;;
--includedir=*)
;;
--mandir=*)
;;
--infodir=*)
;;
--sysconfdir=*)
;;
--localstatedir=*)
;;
--libexecdir=*)
;;
*)
echo "Unknown parameter: $1"
echo
help
;;
esac
shift
done
# create build dir if needed
if [ ! -d "$BUILD_DIR" ] ; then
mkdir -p "$BUILD_DIR"
fi
# go to build dir
cd "$BUILD_DIR"
# invoke cmake to do configuration
cmake $SOURCE_DIR $CMAKE_PREFIX $CMAKE_SHARED $CMAKE_DEBUG $CMAKE_BACKUP $CMAKE_CROSS $CMAKE_PROTECTION $CMAKE_PYTHON $CMAKE_GNAP $CMAKE_COMPLETE