52:afcb57893858 | 53:704368f1bb23 |
---|---|
1 #!/bin/sh | 1 #!/bin/sh |
2 | 2 |
3 # create temporary directory | 3 # create temporary directory |
4 TEMP_DIR=".tmp-$(uname -n)" | 4 TEMP_DIR=".tmp-`uname -n`" |
5 rm -Rf "$TEMP_DIR" | 5 rm -Rf "$TEMP_DIR" |
6 if ! mkdir -p "$TEMP_DIR"; then | 6 if ! mkdir -p "$TEMP_DIR"; then |
7 echo "Cannot create tmp dir $TEMP_DIR" | 7 echo "Cannot create tmp dir $TEMP_DIR" |
8 echo "Abort" | 8 echo "Abort" |
9 exit 1 | 9 exit 1 |
25 INCLUDEDIR= | 25 INCLUDEDIR= |
26 INFODIR= | 26 INFODIR= |
27 MANDIR= | 27 MANDIR= |
28 | 28 |
29 # custom variables | 29 # custom variables |
30 HOST=$(uname -n) | 30 HOST=`uname -n` |
31 PREFIX=$(pwd)/work | 31 PREFIX=$(pwd)/work |
32 INSTALL_DIR=$PREFIX | 32 INSTALL_DIR=$PREFIX |
33 | 33 |
34 # features | 34 # features |
35 FEATURE_PG=auto | 35 FEATURE_PG=auto |
113 INCLUDEDIR=${INCLUDEDIR:-"$PREFIX/include"} | 113 INCLUDEDIR=${INCLUDEDIR:-"$PREFIX/include"} |
114 INFODIR=${INFODIR:-"$PREFIX/info"} | 114 INFODIR=${INFODIR:-"$PREFIX/info"} |
115 MANDIR=${MANDIR:-"$PREFIX/man"} | 115 MANDIR=${MANDIR:-"$PREFIX/man"} |
116 | 116 |
117 # Test for availability of pkg-config | 117 # Test for availability of pkg-config |
118 PKG_CONFIG=$(command -v pkg-config) | 118 PKG_CONFIG=`command -v pkg-config` |
119 PKG_CONFIG=${PKG_CONFIG:-"false"} | 119 PKG_CONFIG=${PKG_CONFIG:-"false"} |
120 | 120 |
121 # Simple uname based platform detection | 121 # Simple uname based platform detection |
122 # $PLATFORM is used for platform dependent dependency selection | 122 # $PLATFORM is used for platform dependent dependency selection |
123 OS=$(uname -s) | 123 OS=`uname -s` |
124 OS_VERSION=$(uname -r) | 124 OS_VERSION=`uname -r` |
125 printf "detect platform... " | 125 printf "detect platform... " |
126 if [ "$OS" = "SunOS" ]; then | 126 if [ "$OS" = "SunOS" ]; then |
127 PLATFORM="solaris sunos unix svr4" | 127 PLATFORM="solaris sunos unix svr4" |
128 fi | 128 fi |
129 if [ "$OS" = "Linux" ]; then | 129 if [ "$OS" = "Linux" ]; then |
138 if echo "$OS" | grep -i "MINGW" > /dev/null; then | 138 if echo "$OS" | grep -i "MINGW" > /dev/null; then |
139 PLATFORM="windows mingw" | 139 PLATFORM="windows mingw" |
140 fi | 140 fi |
141 PLATFORM=${PLATFORM:-"unix"} | 141 PLATFORM=${PLATFORM:-"unix"} |
142 | 142 |
143 PLATFORM_NAME=$(echo "$PLATFORM" | cut -f1 -d' ' -) | 143 PLATFORM_NAME=`echo "$PLATFORM" | cut -f1 -d' ' -` |
144 echo "$PLATFORM_NAME" | 144 echo "$PLATFORM_NAME" |
145 | 145 |
146 isplatform() | 146 isplatform() |
147 { | 147 { |
148 for p in $PLATFORM | 148 for p in $PLATFORM |
208 break | 208 break |
209 fi | 209 fi |
210 if ! $PKG_CONFIG libpq ; then | 210 if ! $PKG_CONFIG libpq ; then |
211 break | 211 break |
212 fi | 212 fi |
213 TEMP_CFLAGS="$TEMP_CFLAGS $("$PKG_CONFIG" --cflags libpq)" | 213 TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags libpq`" |
214 TEMP_LDFLAGS="$TEMP_LDFLAGS $("$PKG_CONFIG" --libs libpq)" | 214 TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs libpq`" |
215 echo yes | 215 echo yes |
216 return 0 | 216 return 0 |
217 done | 217 done |
218 | 218 |
219 echo no | 219 echo no |
229 break | 229 break |
230 fi | 230 fi |
231 if ! $PKG_CONFIG openssl ; then | 231 if ! $PKG_CONFIG openssl ; then |
232 break | 232 break |
233 fi | 233 fi |
234 TEMP_CFLAGS="$TEMP_CFLAGS $("$PKG_CONFIG" --cflags openssl)" | 234 TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags openssl`" |
235 TEMP_LDFLAGS="$TEMP_LDFLAGS $("$PKG_CONFIG" --libs openssl)" | 235 TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs openssl`" |
236 echo yes | 236 echo yes |
237 return 0 | 237 return 0 |
238 done | 238 done |
239 | 239 |
240 # dependency openssl platform="bsd" | 240 # dependency openssl platform="bsd" |
258 while true | 258 while true |
259 do | 259 do |
260 if ! isplatform "macos"; then | 260 if ! isplatform "macos"; then |
261 break | 261 break |
262 fi | 262 fi |
263 if tmp_flags=$(xml2-config --cflags) ; then | 263 if tmp_flags=`xml2-config --cflags` ; then |
264 TEMP_CFLAGS="$TEMP_CFLAGS $tmp_flags" | 264 TEMP_CFLAGS="$TEMP_CFLAGS $tmp_flags" |
265 else | 265 else |
266 break | 266 break |
267 fi | 267 fi |
268 if tmp_flags=$(xml2-config --libs) ; then | 268 if tmp_flags=`xml2-config --libs` ; then |
269 TEMP_LDFLAGS="$TEMP_LDFLAGS $tmp_flags" | 269 TEMP_LDFLAGS="$TEMP_LDFLAGS $tmp_flags" |
270 else | 270 else |
271 break | 271 break |
272 fi | 272 fi |
273 echo yes | 273 echo yes |
281 break | 281 break |
282 fi | 282 fi |
283 if ! $PKG_CONFIG libxml-2.0 ; then | 283 if ! $PKG_CONFIG libxml-2.0 ; then |
284 break | 284 break |
285 fi | 285 fi |
286 TEMP_CFLAGS="$TEMP_CFLAGS $("$PKG_CONFIG" --cflags libxml-2.0)" | 286 TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags libxml-2.0`" |
287 TEMP_LDFLAGS="$TEMP_LDFLAGS $("$PKG_CONFIG" --libs libxml-2.0)" | 287 TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs libxml-2.0`" |
288 echo yes | 288 echo yes |
289 return 0 | 289 return 0 |
290 done | 290 done |
291 | 291 |
292 echo no | 292 echo no |