forked from pekwm/pekwm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure
executable file
·67 lines (58 loc) · 1.97 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
#!/bin/sh
PREFIX="/usr/local"
echo $1 | grep -- --prefix= 2>&1 >/dev/null
if test $? -eq 0; then
PREFIX=`echo $1 | sed -e 's/--prefix=//' -e 's@/$@@'`
fi
OS=`uname`
REL=`uname -r`
# extract version information from CMakeLists.txt to avoid duplication
VERSION_MAJOR=`awk '/set\(pekwm_VERSION_MAJOR/ { print $2 }' CMakeLists.txt | tr -d ')'`
VERSION_MINOR=`awk '/set\(pekwm_VERSION_MINOR/ { print $2 }' CMakeLists.txt | tr -d ')'`
VERSION_PATCH=`awk '/set\(pekwm_VERSION_PATCH/ { print $2 }' CMakeLists.txt | tr -d ')'`
PLATFORM="generic"
CONFIG_PLATFORM="generic"
if test "x$OS" = "xFreeBSD"; then
PLATFORM="FreeBSD"
elif test "x$OS" = "xLinux"; then
PLATFORM="linux"
elif test "x$OS" = "xOpenBSD"; then
if test `echo $REL |tr -d .` -lt 35; then
# gcc 2.95
PLATFORM="OpenBSD34"
CONFIG_PLATFORM="OpenBSD34"
else
PLATFORM="OpenBSD"
fi
elif test "x$OS" = "xNetBSD"; then
PLATFORM="NetBSD"
elif test "x$OS" = "xSunOS"; then
if test "x$REL" = "x5.11"; then
PLATFORM="SunOS-5.11"
else
PLATFORM="SunOS"
CONFIG_PLATFORM="SunOS"
isainfo -v |grep 64-bit 2>&1 >/dev/null
if test $? -eq 0; then
SUNOS_ARCH_LIB="/`isainfo -n`"
SUNOS_ARCH_FLAG="-m64"
else
SUNOS_ARCH_LIB=""
SUNOS_ARCH_FLAG=""
fi
fi
fi
sed -e "s@VERSION_MAJOR@$VERSION_MAJOR@g" \
-e "s@VERSION_MINOR@$VERSION_MINOR@g" \
-e "s@VERSION_PATCH@$VERSION_PATCH@g" \
-e "s@CONF_PLATFORM@$PLATFORM@g" \
-e "s@CONF_PREFIX@$PREFIX@g" \
-e "s@CONF_SUNOS_ARCH_LIB@$SUNOS_ARCH_LIB@g" \
-e "s@CONF_SUNOS_ARCH_FLAG@$SUNOS_ARCH_FLAG@g" \
mk/config.mk.in > mk/config.mk
sed -e "s@VERSION_MAJOR@$VERSION_MAJOR@g" \
-e "s@VERSION_MINOR@$VERSION_MINOR@g" \
-e "s@VERSION_PATCH@$VERSION_PATCH@g" \
-e "s@CONFIG_PLATFORM@$CONFIG_PLATFORM@g" \
mk/config.h.in > mk/config.h
echo "Configured pekwm $VERSION_MAJOR.$VERSION_MINOR.$VERSION_PATCH for $PLATFORM"