configure

Sun, 17 Dec 2023 15:33:50 +0100

author
Mike Becker <universe@uap-core.de>
date
Sun, 17 Dec 2023 15:33:50 +0100
changeset 800
30d484806c2b
parent 787
bd96cbb0e205
child 802
16e5b9d32754
permissions
-rwxr-xr-x

fix faulty string to int conversion utilities

Probably it was expected that errno is set to EINVAL when illegal characters are encountered. But this is not standard and does not happen on every system, allowing illegal strings to be parsed as valid integers.

742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
1 #!/bin/sh
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
2
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
3
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
4 PREFIX=/usr
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
5 EPREFIX=$PREFIX
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
6
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
7 BINDIR=
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
8 SBINDIR=
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
9 LIBDIR=
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
10 LIBEXECDIR=
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
11 DATADIR=
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
12 SYSCONFDIR=
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
13 SHAREDSTATEDIR=
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
14 LOCALSTATEDIR=
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
15 INCLUDEDIR=
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
16 INFODIR=
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
17 MANDIR=
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
18
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
19 OS=`uname -s`
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
20 OS_VERSION=`uname -r`
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
21
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
22 TEMP_DIR=".tmp-`uname -n`"
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
23 mkdir -p "$TEMP_DIR"
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
24 if [ $? -ne 0 ]; then
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
25 echo "Cannot create tmp dir"
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
26 echo "Abort"
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
27 fi
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
28 touch "$TEMP_DIR/options"
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
29 touch "$TEMP_DIR/features"
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
30
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
31 # features
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
32
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
33 # help text
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
34 printhelp()
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
35 {
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
36 echo "Usage: $0 [OPTIONS]..."
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
37 cat << __EOF__
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
38 Installation directories:
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
39 --prefix=PREFIX path prefix for architecture-independent files
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
40 [/usr]
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
41 --exec-prefix=EPREFIX path prefix for architecture-dependent files
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
42 [PREFIX]
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
43
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
44 --bindir=DIR user executables [EPREFIX/bin]
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
45 --sbindir=DIR system admin executables [EPREFIX/sbin]
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
46 --libexecdir=DIR program executables [EPREFIX/libexec]
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
47 --sysconfdir=DIR system configuration files [PREFIX/etc]
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
48 --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
49 --localstatedir=DIR modifiable single-machine data [PREFIX/var]
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
50 --libdir=DIR object code libraries [EPREFIX/lib]
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
51 --includedir=DIR C header files [PREFIX/include]
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
52 --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
53 --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
54 --infodir=DIR info documentation [DATAROOTDIR/info]
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
55 --mandir=DIR man documentation [DATAROOTDIR/man]
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
56
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
57 __EOF__
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
58 }
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
59
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
60 #
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
61 # parse arguments
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
62 #
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
63 for ARG in "$@"
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
64 do
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
65 case "$ARG" in
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
66 "--prefix="*) PREFIX=${ARG#--prefix=} ;;
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
67 "--exec-prefix="*) EPREFIX=${ARG#--exec-prefix=} ;;
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
68 "--bindir="*) BINDIR=${ARG#----bindir=} ;;
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
69 "--sbindir="*) SBINDIR=${ARG#--sbindir=} ;;
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
70 "--libdir="*) LIBDIR=${ARG#--libdir=} ;;
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
71 "--libexecdir="*) LIBEXECDIR=${ARG#--libexecdir=} ;;
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
72 "--datadir="*) DATADIR=${ARG#--datadir=} ;;
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
73 "--sysconfdir="*) SYSCONFDIR=${ARG#--sysconfdir=} ;;
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
74 "--sharedstatedir="*) SHAREDSTATEDIR=${ARG#--sharedstatedir=} ;;
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
75 "--localstatedir="*) LOCALSTATEDIR=${ARG#--localstatedir=} ;;
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
76 "--includedir="*) INCLUDEDIR=${ARG#--includedir=} ;;
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
77 "--infodir="*) INFODIR=${ARG#--infodir=} ;;
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
78 "--mandir"*) MANDIR=${ARG#--mandir} ;;
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
79 "--help"*) printhelp; rm -Rf "$TEMP_DIR"; exit 1 ;;
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
80 "-"*) echo "unknown option: $ARG"; rm -Rf "$TEMP_DIR"; exit 1 ;;
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
81 esac
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
82 done
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
83
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
84 # set dir variables
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
85 if [ -z "$BINDIR" ]; then
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
86 BINDIR=$EPREFIX/bin
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
87 fi
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
88 if [ -z "$SBINDIR" ]; then
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
89 SBINDIR=$EPREFIX/sbin
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
90 fi
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
91 if [ -z "$LIBDIR" ]; then
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
92 LIBDIR=$EPREFIX/lib
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
93 fi
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
94 if [ -z "$LIBEXEC" ]; then
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
95 LIBEXECDIR=$EPREFIX/libexec
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
96 fi
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
97 if [ -z "$DATADIR" ]; then
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
98 DATADIR=$PREFIX/share
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
99 fi
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
100 if [ -z "$SYSCONFDIR" ]; then
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
101 SYSCONFDIR=$PREFIX/etc
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
102 fi
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
103 if [ -z "$SHAREDSTATEDIR" ]; then
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
104 SHAREDSTATEDIR=$PREFIX/com
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
105 fi
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
106 if [ -z "$LOCALSTATEDIR" ]; then
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
107 LOCALSTATEDIR=$PREFIX/var
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
108 fi
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
109 if [ -z "$INCLUDEDIR" ]; then
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
110 INCLUDEDIR=$PREFIX/include
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
111 fi
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
112 if [ -z "$INFODIR" ]; then
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
113 INFODIR=$PREFIX/info
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
114 fi
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
115 if [ -z "$MANDIR" ]; then
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
116 MANDIR=$PREFIX/man
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
117 fi
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
118
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
119 which pkg-config > /dev/null
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
120 if [ $? -eq 0 ]; then
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
121 PKG_CONFIG=pkg-config
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
122 else
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
123 PKG_CONFIG=false
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
124 fi
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
125
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
126 # Simple uname based platform detection
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
127 # $PLATFORM is used for platform dependent dependency selection
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
128 printf "detect platform... "
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
129 if [ "$OS" = "SunOS" ]; then
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
130 PLATFORM="solaris sunos unix svr4"
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
131 fi
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
132 if [ "$OS" = "Linux" ]; then
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
133 PLATFORM="linux unix"
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
134 fi
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
135 if [ "$OS" = "FreeBSD" ]; then
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
136 PLATFORM="freebsd bsd unix"
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
137 fi
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
138 if [ "$OS" = "Darwin" ]; then
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
139 PLATFORM="macos osx bsd unix"
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
140 fi
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
141 echo "$OS" | grep -i "MINGW" > /dev/null
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
142 if [ $? -eq 0 ]; then
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
143 PLATFORM="windows mingw"
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
144 fi
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
145
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
146 if [ -z "$PLATFORM" ]; then
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
147 PLATFORM="unix"
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
148 fi
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
149
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
150 for p in $PLATFORM
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
151 do
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
152 PLATFORM_NAME=$p
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
153 break
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
154 done
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
155 echo $PLATFORM_NAME
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
156
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
157 isplatform()
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
158 {
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
159 for p in $PLATFORM
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
160 do
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
161 if [ "$p" = "$1" ]; then
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
162 return 0
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
163 fi
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
164 done
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
165 return 1
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
166 }
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
167 isnotplatform()
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
168 {
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
169 for p in $PLATFORM
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
170 do
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
171 if [ "$p" = "$1" ]; then
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
172 return 1
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
173 fi
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
174 done
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
175 return 0
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
176 }
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
177
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
178 # generate config.mk and config.h
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
179 cat > "$TEMP_DIR/config.mk" << __EOF__
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
180 #
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
181 # config.mk generated by configure
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
182 #
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
183
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
184 # general vars
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
185
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
186 PREFIX=$PREFIX
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
187 EPREFIX=$EPREFIX
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
188
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
189 BINDIR=$BINDIR
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
190 SBINDIR=$SBINDIR
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
191 LIBDIR=$LIBDIR
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
192 LIBEXECDIR=$LIBEXECDIR
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
193 DATADIR=$DATADIR
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
194 SYSCONFDIR=$SYSCONFDIR
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
195 SHAREDSTATEDIR=$SHAREDSTATEDIR
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
196 LOCALSTATEDIR=$LOCALSTATEDIR
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
197 INCLUDEDIR=$INCLUDEDIR
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
198 INFODIR=$INFODIR
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
199 MANDIR=$MANDIR
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
200
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
201 __EOF__
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
202
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
203 echo > "$TEMP_DIR/make.mk"
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
204
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
205 ENV_CFLAGS=$CFLAGS
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
206 ENV_LDFLAGS=$LDFLAGS
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
207 ENV_CXXFLAGS=$CXXFLAGS
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
208
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
209 # Toolchain detection
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
210 # this will insert make vars to config.mk
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
211 . make/toolchain.sh
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
212
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
213 # add user specified flags to config.mk
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
214 echo "# project specific flags" >> "$TEMP_DIR/config.mk"
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
215 if [ -n "${ENV_CFLAGS}" ]; then
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
216 echo "CFLAGS += $ENV_CFLAGS" >> "$TEMP_DIR/config.mk"
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
217 fi
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
218 if [ -n "${ENV_CXXFLAGS}" ]; then
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
219 echo "CXXFLAGS += $ENV_CXXFLAGS" >> "$TEMP_DIR/config.mk"
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
220 fi
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
221 if [ -n "${ENV_LDFLAGS}" ]; then
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
222 echo "LDFLAGS += $ENV_LDFLAGS" >> "$TEMP_DIR/config.mk"
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
223 fi
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
224
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
225 #
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
226 # DEPENDENCIES
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
227 #
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
228
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
229 dependency_curl()
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
230 {
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
231 printf "checking for curl... "
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
232 # dependency curl platform="windows"
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
233 while true
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
234 do
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
235 if isnotplatform "windows"; then
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
236 break
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
237 fi
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
238 TEMP_CFLAGS="$TEMP_CFLAGS -I/mingw/include"
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
239 TEMP_LDFLAGS="$TEMP_LDFLAGS -lcurl"
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
240 echo yes
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
241 return 0
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
242 done
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
243
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
244 # dependency curl platform="macos"
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
245 while true
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
246 do
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
247 if isnotplatform "macos"; then
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
248 break
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
249 fi
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
250 curl-config --cflags > /dev/null
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
251 if [ $? -eq 0 ]; then
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
252 TEMP_CFLAGS="$TEMP_CFLAGS `curl-config --cflags`"
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
253 else
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
254 break
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
255 fi
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
256 curl-config --ldflags > /dev/null
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
257 if [ $? -eq 0 ]; then
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
258 TEMP_LDFLAGS="$TEMP_LDFLAGS `curl-config --ldflags`"
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
259 else
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
260 break
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
261 fi
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
262 echo yes
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
263 return 0
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
264 done
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
265
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
266 # dependency curl
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
267 while true
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
268 do
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
269 if [ -z "$PKG_CONFIG" ]; then
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
270 break
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
271 fi
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
272 $PKG_CONFIG libcurl
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
273 if [ $? -ne 0 ] ; then
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
274 break
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
275 fi
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
276 TEMP_CFLAGS="$TEMP_CFLAGS `$PKG_CONFIG --cflags libcurl`"
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
277 TEMP_LDFLAGS="$TEMP_LDFLAGS `$PKG_CONFIG --libs libcurl`"
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
278 echo yes
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
279 return 0
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
280 done
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
281
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
282 # dependency curl
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
283 while true
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
284 do
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
285 curl-config --cflags > /dev/null
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
286 if [ $? -eq 0 ]; then
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
287 TEMP_CFLAGS="$TEMP_CFLAGS `curl-config --cflags`"
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
288 else
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
289 break
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
290 fi
758
606519b4a867 fix configure script again, this time correctly
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 751
diff changeset
291 curl-config --libs > /dev/null
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
292 if [ $? -eq 0 ]; then
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
293 TEMP_LDFLAGS="$TEMP_LDFLAGS `curl-config --libs`"
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
294 else
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
295 break
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
296 fi
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
297 echo yes
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
298 return 0
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
299 done
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
300
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
301 echo no
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
302 return 1
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
303 }
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
304 dependency_openssl()
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
305 {
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
306 printf "checking for openssl... "
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
307 # dependency openssl platform="windows"
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
308 while true
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
309 do
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
310 if isnotplatform "windows"; then
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
311 break
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
312 fi
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
313 TEMP_LDFLAGS="$TEMP_LDFLAGS -lssl -lcrypto"
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
314 echo yes
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
315 return 0
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
316 done
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
317
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
318 # dependency openssl platform="macos"
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
319 while true
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
320 do
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
321 if isnotplatform "macos"; then
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
322 break
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
323 fi
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
324 TEMP_LDFLAGS="$TEMP_LDFLAGS -framework CoreFoundation"
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
325 echo yes
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
326 return 0
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
327 done
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
328
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
329 # dependency openssl platform="bsd"
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
330 while true
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
331 do
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
332 if isnotplatform "bsd"; then
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
333 break
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
334 fi
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
335 if isplatform "macos"; then
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
336 break
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
337 fi
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
338 TEMP_LDFLAGS="$TEMP_LDFLAGS -lssl -lcrypto"
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
339 echo yes
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
340 return 0
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
341 done
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
342
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
343 # dependency openssl
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
344 while true
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
345 do
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
346 if [ -z "$PKG_CONFIG" ]; then
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
347 break
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
348 fi
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
349 $PKG_CONFIG openssl
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
350 if [ $? -ne 0 ] ; then
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
351 break
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
352 fi
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
353 TEMP_CFLAGS="$TEMP_CFLAGS `$PKG_CONFIG --cflags openssl`"
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
354 TEMP_LDFLAGS="$TEMP_LDFLAGS `$PKG_CONFIG --libs openssl`"
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
355 echo yes
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
356 return 0
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
357 done
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
358
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
359 echo no
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
360 return 1
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
361 }
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
362 dependency_libxml2()
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
363 {
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
364 printf "checking for libxml2... "
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
365 # dependency libxml2 platform="windows"
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
366 while true
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
367 do
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
368 if isnotplatform "windows"; then
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
369 break
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
370 fi
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
371 xml2-config --cflags > /dev/null
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
372 if [ $? -eq 0 ]; then
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
373 TEMP_CFLAGS="$TEMP_CFLAGS `xml2-config --cflags`"
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
374 else
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
375 break
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
376 fi
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
377 xml2-config --libs > /dev/null
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
378 if [ $? -eq 0 ]; then
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
379 TEMP_LDFLAGS="$TEMP_LDFLAGS `xml2-config --libs`"
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
380 else
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
381 break
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
382 fi
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
383 echo yes
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
384 return 0
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
385 done
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
386
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
387 # dependency libxml2 platform="macos"
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
388 while true
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
389 do
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
390 if isnotplatform "macos"; then
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
391 break
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
392 fi
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
393 xml2-config --cflags > /dev/null
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
394 if [ $? -eq 0 ]; then
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
395 TEMP_CFLAGS="$TEMP_CFLAGS `xml2-config --cflags`"
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
396 else
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
397 break
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
398 fi
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
399 xml2-config --libs > /dev/null
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
400 if [ $? -eq 0 ]; then
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
401 TEMP_LDFLAGS="$TEMP_LDFLAGS `xml2-config --libs`"
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
402 else
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
403 break
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
404 fi
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
405 echo yes
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
406 return 0
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
407 done
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
408
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
409 # dependency libxml2
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
410 while true
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
411 do
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
412 if [ -z "$PKG_CONFIG" ]; then
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
413 break
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
414 fi
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
415 $PKG_CONFIG libxml-2.0
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
416 if [ $? -ne 0 ] ; then
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
417 break
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
418 fi
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
419 TEMP_CFLAGS="$TEMP_CFLAGS `$PKG_CONFIG --cflags libxml-2.0`"
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
420 TEMP_LDFLAGS="$TEMP_LDFLAGS `$PKG_CONFIG --libs libxml-2.0`"
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
421 echo yes
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
422 return 0
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
423 done
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
424
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
425 # dependency libxml2
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
426 while true
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
427 do
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
428 xml2-config --cflags > /dev/null
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
429 if [ $? -eq 0 ]; then
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
430 TEMP_CFLAGS="$TEMP_CFLAGS `xml2-config --cflags`"
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
431 else
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
432 break
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
433 fi
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
434 xml2-config --libs > /dev/null
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
435 if [ $? -eq 0 ]; then
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
436 TEMP_LDFLAGS="$TEMP_LDFLAGS `xml2-config --libs`"
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
437 else
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
438 break
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
439 fi
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
440 echo yes
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
441 return 0
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
442 done
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
443
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
444 echo no
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
445 return 1
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
446 }
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
447
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
448 DEPENDENCIES_FAILED=
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
449 ERROR=0
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
450 # general dependencies
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
451 TEMP_CFLAGS=
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
452 TEMP_LDFLAGS=
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
453 while true
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
454 do
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
455 while true
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
456 do
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
457
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
458 TEMP_LDFLAGS="$TEMP_LDFLAGS -lm -lpthread"
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
459
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
460 break
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
461 done
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
462
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
463 break
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
464 done
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
465 while true
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
466 do
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
467 if isnotplatform "bsd"; then
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
468 break
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
469 fi
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
470 if isplatform "macos"; then
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
471 break
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
472 fi
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
473 while true
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
474 do
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
475
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
476 TEMP_CFLAGS="$TEMP_CFLAGS -I/usr/local/include"
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
477 TEMP_LDFLAGS="$TEMP_LDFLAGS -L/usr/local/lib"
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
478
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
479 break
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
480 done
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
481
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
482 break
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
483 done
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
484 while true
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
485 do
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
486 if isnotplatform "macos"; then
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
487 break
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
488 fi
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
489 while true
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
490 do
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
491
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
492 cat >> "$TEMP_DIR/make.mk" << __EOF__
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
493 OBJ_EXT = .o
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
494 LIB_EXT = .a
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
495
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
496 __EOF__
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
497
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
498 break
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
499 done
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
500
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
501 break
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
502 done
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
503 while true
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
504 do
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
505 if isnotplatform "unix"; then
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
506 break
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
507 fi
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
508 if isplatform "macos"; then
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
509 break
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
510 fi
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
511 while true
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
512 do
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
513
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
514 cat >> "$TEMP_DIR/make.mk" << __EOF__
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
515 OBJ_EXT = .o
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
516 LIB_EXT = .a
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
517
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
518 __EOF__
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
519
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
520 break
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
521 done
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
522
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
523 break
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
524 done
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
525
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
526 # add general dependency flags to config.mk
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
527 echo >> "$TEMP_DIR/config.mk"
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
528 if [ -n "${TEMP_CFLAGS}" ]; then
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
529 echo "CFLAGS += $TEMP_CFLAGS" >> $TEMP_DIR/config.mk
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
530 fi
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
531 if [ -n "${TEMP_CXXFLAGS}" ]; then
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
532 echo "CXXFLAGS += $TEMP_CXXFLAGS" >> $TEMP_DIR/config.mk
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
533 fi
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
534 if [ -n "${TEMP_LDFLAGS}" ]; then
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
535 echo "LDFLAGS += $TEMP_LDFLAGS" >> $TEMP_DIR/config.mk
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
536 fi
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
537
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
538 #
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
539 # OPTION VALUES
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
540 #
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
541
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
542 #
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
543 # TARGETS
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
544 #
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
545 TEMP_CFLAGS=
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
546 TEMP_CXXFLAGS=
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
547 TEMP_LDFLAGS=
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
548
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
549 # Target: dav
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
550 TEMP_CFLAGS=
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
551 TEMP_LDFLAGS=
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
552 TEMP_CXXFLAGS=
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
553
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
554 dependency_curl
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
555 if [ $? -ne 0 ]; then
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
556 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED curl "
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
557 ERROR=1
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
558 fi
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
559 dependency_libxml2
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
560 if [ $? -ne 0 ]; then
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
561 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED libxml2 "
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
562 ERROR=1
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
563 fi
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
564 dependency_openssl
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
565 if [ $? -ne 0 ]; then
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
566 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED openssl "
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
567 ERROR=1
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
568 fi
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
569
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
570 # Features
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
571
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
572
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
573 echo >> "$TEMP_DIR/config.mk"
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
574 if [ -n "${TEMP_CFLAGS}" ]; then
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
575 echo "DAV_CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/config.mk"
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
576 fi
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
577 if [ -n "${TEMP_CXXFLAGS}" ]; then
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
578 echo "DAV_CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/config.mk"
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
579 fi
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
580 if [ -n "${TEMP_LDFLAGS}" ]; then
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
581 echo "DAV_LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/config.mk"
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
582 fi
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
583
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
584 if [ $ERROR -ne 0 ]; then
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
585 echo
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
586 echo "Error: Unresolved dependencies"
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
587 echo "$DEPENDENCIES_FAILED"
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
588 rm -Rf "$TEMP_DIR"
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
589 exit 1
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
590 fi
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
591
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
592 echo "configure finished"
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
593 echo
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
594 echo "Build Config:"
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
595 echo " PREFIX: $PREFIX"
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
596 echo " TOOLCHAIN: $TOOLCHAIN_NAME"
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
597 echo
787
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
598 cat "$TEMP_DIR/config.mk" "$TEMP_DIR/make.mk" > config.mk
bd96cbb0e205 update uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 758
diff changeset
599 rm -Rf "$TEMP_DIR"
742
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
600
7e67689241fd new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
601

mercurial