Sun, 17 Nov 2024 13:11:14 +0100
fix PUT request with chunked transfer encoding
742 | 1 | #!/bin/sh |
2 | ||
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
3 | # create temporary directory |
742 | 4 | TEMP_DIR=".tmp-`uname -n`" |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
5 | rm -Rf "$TEMP_DIR" |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
6 | if mkdir -p "$TEMP_DIR"; then |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
7 | : |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
8 | else |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
9 | echo "Cannot create tmp dir $TEMP_DIR" |
787 | 10 | echo "Abort" |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
11 | exit 1 |
742 | 12 | fi |
787 | 13 | touch "$TEMP_DIR/options" |
14 | touch "$TEMP_DIR/features" | |
742 | 15 | |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
16 | # define standard variables |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
17 | # also define standard prefix (this is where we will search for config.site) |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
18 | prefix=/usr |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
19 | exec_prefix= |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
20 | bindir= |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
21 | sbindir= |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
22 | libdir= |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
23 | libexecdir= |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
24 | datarootdir= |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
25 | datadir= |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
26 | sysconfdir= |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
27 | sharedstatedir= |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
28 | localstatedir= |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
29 | runstatedir= |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
30 | includedir= |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
31 | infodir= |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
32 | localedir= |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
33 | mandir= |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
34 | |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
35 | # custom variables |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
36 | |
742 | 37 | # features |
38 | ||
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
39 | # clean abort |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
40 | abort_configure() |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
41 | { |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
42 | rm -Rf "$TEMP_DIR" |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
43 | exit 1 |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
44 | } |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
45 | |
742 | 46 | # help text |
47 | printhelp() | |
48 | { | |
787 | 49 | echo "Usage: $0 [OPTIONS]..." |
50 | cat << __EOF__ | |
742 | 51 | Installation directories: |
52 | --prefix=PREFIX path prefix for architecture-independent files | |
53 | [/usr] | |
54 | --exec-prefix=EPREFIX path prefix for architecture-dependent files | |
55 | [PREFIX] | |
56 | ||
57 | --bindir=DIR user executables [EPREFIX/bin] | |
58 | --sbindir=DIR system admin executables [EPREFIX/sbin] | |
59 | --libexecdir=DIR program executables [EPREFIX/libexec] | |
60 | --sysconfdir=DIR system configuration files [PREFIX/etc] | |
61 | --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] | |
62 | --localstatedir=DIR modifiable single-machine data [PREFIX/var] | |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
63 | --runstatedir=DIR run-time variable data [LOCALSTATEDIR/run] |
742 | 64 | --libdir=DIR object code libraries [EPREFIX/lib] |
65 | --includedir=DIR C header files [PREFIX/include] | |
66 | --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] | |
67 | --datadir=DIR read-only architecture-independent data [DATAROOTDIR] | |
68 | --infodir=DIR info documentation [DATAROOTDIR/info] | |
69 | --mandir=DIR man documentation [DATAROOTDIR/man] | |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
70 | --localedir=DIR locale-dependent data [DATAROOTDIR/locale] |
742 | 71 | |
72 | __EOF__ | |
73 | } | |
74 | ||
75 | # | |
787 | 76 | # parse arguments |
742 | 77 | # |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
78 | BUILD_TYPE="default" |
787 | 79 | for ARG in "$@" |
742 | 80 | do |
81 | case "$ARG" in | |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
82 | "--prefix="*) prefix=${ARG#--prefix=} ;; |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
83 | "--exec-prefix="*) exec_prefix=${ARG#--exec-prefix=} ;; |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
84 | "--bindir="*) bindir=${ARG#----bindir=} ;; |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
85 | "--sbindir="*) sbindir=${ARG#--sbindir=} ;; |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
86 | "--libdir="*) libdir=${ARG#--libdir=} ;; |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
87 | "--libexecdir="*) libexecdir=${ARG#--libexecdir=} ;; |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
88 | "--datarootdir="*) datarootdir=${ARG#--datarootdir=} ;; |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
89 | "--datadir="*) datadir=${ARG#--datadir=} ;; |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
90 | "--sysconfdir="*) sysconfdir=${ARG#--sysconfdir=} ;; |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
91 | "--sharedstatedir="*) sharedstatedir=${ARG#--sharedstatedir=} ;; |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
92 | "--localstatedir="*) localstatedir=${ARG#--localstatedir=} ;; |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
93 | "--includedir="*) includedir=${ARG#--includedir=} ;; |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
94 | "--infodir="*) infodir=${ARG#--infodir=} ;; |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
95 | "--mandir"*) mandir=${ARG#--mandir} ;; |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
96 | "--localedir"*) localedir=${ARG#--localedir} ;; |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
97 | "--help"*) printhelp; abort_configure ;; |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
98 | "--debug") BUILD_TYPE="debug" ;; |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
99 | "--release") BUILD_TYPE="release" ;; |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
100 | "-"*) echo "unknown option: $ARG"; abort_configure ;; |
787 | 101 | esac |
742 | 102 | done |
103 | ||
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
104 | |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
105 | |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
106 | # set defaults for dir variables |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
107 | : ${exec_prefix:="$prefix"} |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
108 | : ${bindir:='${exec_prefix}/bin'} |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
109 | : ${sbindir:='${exec_prefix}/sbin'} |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
110 | : ${libdir:='${exec_prefix}/lib'} |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
111 | : ${libexecdir:='${exec_prefix}/libexec'} |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
112 | : ${datarootdir:='${prefix}/share'} |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
113 | : ${datadir:='${datarootdir}'} |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
114 | : ${sysconfdir:='${prefix}/etc'} |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
115 | : ${sharedstatedir:='${prefix}/com'} |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
116 | : ${localstatedir:='${prefix}/var'} |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
117 | : ${runstatedir:='${localstatedir}/run'} |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
118 | : ${includedir:='${prefix}/include'} |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
119 | : ${infodir:='${datarootdir}/info'} |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
120 | : ${mandir:='${datarootdir}/man'} |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
121 | : ${localedir:='${datarootdir}/locale'} |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
122 | |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
123 | # check if a config.site exists and load it |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
124 | if [ -n "$CONFIG_SITE" ]; then |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
125 | # CONFIG_SITE may contain space separated file names |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
126 | for cs in $CONFIG_SITE; do |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
127 | printf "loading defaults from $cs... " |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
128 | . "$cs" |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
129 | echo ok |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
130 | done |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
131 | elif [ -f "$prefix/share/config.site" ]; then |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
132 | printf "loading site defaults... " |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
133 | . "$prefix/share/config.site" |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
134 | echo ok |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
135 | elif [ -f "$prefix/etc/config.site" ]; then |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
136 | printf "loading site defaults... " |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
137 | . "$prefix/etc/config.site" |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
138 | echo ok |
742 | 139 | fi |
140 | ||
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
141 | # Test for availability of pkg-config |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
142 | PKG_CONFIG=`command -v pkg-config` |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
143 | : ${PKG_CONFIG:="false"} |
742 | 144 | |
145 | # Simple uname based platform detection | |
146 | # $PLATFORM is used for platform dependent dependency selection | |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
147 | OS=`uname -s` |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
148 | OS_VERSION=`uname -r` |
742 | 149 | printf "detect platform... " |
787 | 150 | if [ "$OS" = "SunOS" ]; then |
742 | 151 | PLATFORM="solaris sunos unix svr4" |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
152 | elif [ "$OS" = "Linux" ]; then |
742 | 153 | PLATFORM="linux unix" |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
154 | elif [ "$OS" = "FreeBSD" ]; then |
742 | 155 | PLATFORM="freebsd bsd unix" |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
156 | elif [ "$OS" = "OpenBSD" ]; then |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
157 | PLATFORM="openbsd bsd unix" |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
158 | elif [ "$OS" = "NetBSD" ]; then |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
159 | PLATFORM="netbsd bsd unix" |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
160 | elif [ "$OS" = "Darwin" ]; then |
742 | 161 | PLATFORM="macos osx bsd unix" |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
162 | elif echo "$OS" | grep -i "MINGW" > /dev/null; then |
742 | 163 | PLATFORM="windows mingw" |
164 | fi | |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
165 | : ${PLATFORM:="unix"} |
742 | 166 | |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
167 | PLATFORM_NAME=`echo "$PLATFORM" | cut -f1 -d' ' -` |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
168 | echo "$PLATFORM_NAME" |
742 | 169 | |
170 | isplatform() | |
171 | { | |
172 | for p in $PLATFORM | |
173 | do | |
787 | 174 | if [ "$p" = "$1" ]; then |
742 | 175 | return 0 |
176 | fi | |
177 | done | |
178 | return 1 | |
179 | } | |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
180 | notisplatform() |
742 | 181 | { |
182 | for p in $PLATFORM | |
183 | do | |
787 | 184 | if [ "$p" = "$1" ]; then |
742 | 185 | return 1 |
186 | fi | |
187 | done | |
188 | return 0 | |
189 | } | |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
190 | istoolchain() |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
191 | { |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
192 | for t in $TOOLCHAIN |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
193 | do |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
194 | if [ "$t" = "$1" ]; then |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
195 | return 0 |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
196 | fi |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
197 | done |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
198 | return 1 |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
199 | } |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
200 | notistoolchain() |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
201 | { |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
202 | for t in $TOOLCHAIN |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
203 | do |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
204 | if [ "$t" = "$1" ]; then |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
205 | return 1 |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
206 | fi |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
207 | done |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
208 | return 0 |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
209 | } |
742 | 210 | |
211 | ||
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
212 | # generate vars.mk |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
213 | cat > "$TEMP_DIR/vars.mk" << __EOF__ |
809 | 214 | prefix=$prefix |
215 | exec_prefix=$exec_prefix | |
216 | bindir=$bindir | |
217 | sbindir=$sbindir | |
218 | libdir=$libdir | |
219 | libexecdir=$libexecdir | |
220 | datarootdir=$datarootdir | |
221 | datadir=$datadir | |
222 | sysconfdir=$sysconfdir | |
223 | sharedstatedir=$sharedstatedir | |
224 | localstatedir=$localstatedir | |
225 | runstatedir=$runstatedir | |
226 | includedir=$includedir | |
227 | infodir=$infodir | |
228 | mandir=$mandir | |
229 | localedir=$localedir | |
742 | 230 | __EOF__ |
231 | ||
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
232 | # toolchain detection utilities |
742 | 233 | . make/toolchain.sh |
234 | ||
235 | # | |
236 | # DEPENDENCIES | |
237 | # | |
238 | ||
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
239 | # check languages |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
240 | lang_c= |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
241 | lang_cpp= |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
242 | if detect_c_compiler ; then |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
243 | lang_c=1 |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
244 | fi |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
245 | |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
246 | # create buffer for make variables required by dependencies |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
247 | echo > "$TEMP_DIR/make.mk" |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
248 | |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
249 | test_pkg_config() |
742 | 250 | { |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
251 | if "$PKG_CONFIG" --exists "$1" ; then : |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
252 | else return 1 ; fi |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
253 | if [ -z "$2" ] || "$PKG_CONFIG" --atleast-version="$2" "$1" ; then : |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
254 | else return 1 ; fi |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
255 | if [ -z "$3" ] || "$PKG_CONFIG" --exact-version="$3" "$1" ; then : |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
256 | else return 1 ; fi |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
257 | if [ -z "$4" ] || "$PKG_CONFIG" --max-version="$4" "$1" ; then : |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
258 | else return 1 ; fi |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
259 | return 0 |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
260 | } |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
261 | |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
262 | print_check_msg() |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
263 | { |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
264 | if [ -z "$1" ]; then |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
265 | shift |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
266 | printf "$@" |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
267 | fi |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
268 | } |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
269 | |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
270 | dependency_error_curl() |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
271 | { |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
272 | print_check_msg "$dep_checked_curl" "checking for curl... " |
742 | 273 | # dependency curl platform="windows" |
274 | while true | |
275 | do | |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
276 | if notisplatform "windows"; then |
742 | 277 | break |
278 | fi | |
787 | 279 | TEMP_CFLAGS="$TEMP_CFLAGS -I/mingw/include" |
280 | TEMP_LDFLAGS="$TEMP_LDFLAGS -lcurl" | |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
281 | print_check_msg "$dep_checked_curl" "yes\n" |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
282 | dep_checked_curl=1 |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
283 | return 1 |
742 | 284 | done |
787 | 285 | |
742 | 286 | # dependency curl platform="macos" |
287 | while true | |
288 | do | |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
289 | if notisplatform "macos"; then |
742 | 290 | break |
291 | fi | |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
292 | if tmp_flags=`curl-config --cflags` ; then |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
293 | TEMP_CFLAGS="$TEMP_CFLAGS $tmp_flags" |
742 | 294 | else |
295 | break | |
296 | fi | |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
297 | if tmp_flags=`curl-config --ldflags` ; then |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
298 | TEMP_LDFLAGS="$TEMP_LDFLAGS $tmp_flags" |
742 | 299 | else |
300 | break | |
301 | fi | |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
302 | print_check_msg "$dep_checked_curl" "yes\n" |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
303 | dep_checked_curl=1 |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
304 | return 1 |
742 | 305 | done |
787 | 306 | |
307 | # dependency curl | |
742 | 308 | while true |
309 | do | |
310 | if [ -z "$PKG_CONFIG" ]; then | |
787 | 311 | break |
742 | 312 | fi |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
313 | if test_pkg_config "libcurl" "" "" "" ; then |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
314 | TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags libcurl`" |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
315 | TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs libcurl`" |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
316 | else |
742 | 317 | break |
318 | fi | |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
319 | print_check_msg "$dep_checked_curl" "yes\n" |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
320 | dep_checked_curl=1 |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
321 | return 1 |
742 | 322 | done |
787 | 323 | |
324 | # dependency curl | |
742 | 325 | while true |
326 | do | |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
327 | if tmp_flags=`curl-config --cflags` ; then |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
328 | TEMP_CFLAGS="$TEMP_CFLAGS $tmp_flags" |
742 | 329 | else |
330 | break | |
331 | fi | |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
332 | if tmp_flags=`curl-config --libs` ; then |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
333 | TEMP_LDFLAGS="$TEMP_LDFLAGS $tmp_flags" |
742 | 334 | else |
335 | break | |
336 | fi | |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
337 | print_check_msg "$dep_checked_curl" "yes\n" |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
338 | dep_checked_curl=1 |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
339 | return 1 |
742 | 340 | done |
787 | 341 | |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
342 | print_check_msg "$dep_checked_curl" "no\n" |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
343 | dep_checked_curl=1 |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
344 | return 0 |
742 | 345 | } |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
346 | dependency_error_openssl() |
742 | 347 | { |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
348 | print_check_msg "$dep_checked_openssl" "checking for openssl... " |
742 | 349 | # dependency openssl platform="windows" |
350 | while true | |
351 | do | |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
352 | if notisplatform "windows"; then |
742 | 353 | break |
354 | fi | |
787 | 355 | TEMP_LDFLAGS="$TEMP_LDFLAGS -lssl -lcrypto" |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
356 | print_check_msg "$dep_checked_openssl" "yes\n" |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
357 | dep_checked_openssl=1 |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
358 | return 1 |
742 | 359 | done |
787 | 360 | |
742 | 361 | # dependency openssl platform="macos" |
362 | while true | |
363 | do | |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
364 | if notisplatform "macos"; then |
742 | 365 | break |
366 | fi | |
787 | 367 | TEMP_LDFLAGS="$TEMP_LDFLAGS -framework CoreFoundation" |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
368 | print_check_msg "$dep_checked_openssl" "yes\n" |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
369 | dep_checked_openssl=1 |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
370 | return 1 |
742 | 371 | done |
787 | 372 | |
742 | 373 | # dependency openssl platform="bsd" |
374 | while true | |
375 | do | |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
376 | if notisplatform "bsd"; then |
742 | 377 | break |
378 | fi | |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
379 | if isplatform "macos" || istoolchain "macos"; then |
742 | 380 | break |
381 | fi | |
787 | 382 | TEMP_LDFLAGS="$TEMP_LDFLAGS -lssl -lcrypto" |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
383 | print_check_msg "$dep_checked_openssl" "yes\n" |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
384 | dep_checked_openssl=1 |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
385 | return 1 |
742 | 386 | done |
787 | 387 | |
388 | # dependency openssl | |
742 | 389 | while true |
390 | do | |
391 | if [ -z "$PKG_CONFIG" ]; then | |
787 | 392 | break |
742 | 393 | fi |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
394 | if test_pkg_config "openssl" "" "" "" ; then |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
395 | TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags openssl`" |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
396 | TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs openssl`" |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
397 | else |
742 | 398 | break |
399 | fi | |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
400 | print_check_msg "$dep_checked_openssl" "yes\n" |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
401 | dep_checked_openssl=1 |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
402 | return 1 |
742 | 403 | done |
787 | 404 | |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
405 | print_check_msg "$dep_checked_openssl" "no\n" |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
406 | dep_checked_openssl=1 |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
407 | return 0 |
742 | 408 | } |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
409 | dependency_error_libxml2() |
742 | 410 | { |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
411 | print_check_msg "$dep_checked_libxml2" "checking for libxml2... " |
742 | 412 | # dependency libxml2 platform="windows" |
413 | while true | |
414 | do | |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
415 | if notisplatform "windows"; then |
742 | 416 | break |
417 | fi | |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
418 | if tmp_flags=`xml2-config --cflags` ; then |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
419 | TEMP_CFLAGS="$TEMP_CFLAGS $tmp_flags" |
742 | 420 | else |
421 | break | |
422 | fi | |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
423 | if tmp_flags=`xml2-config --libs` ; then |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
424 | TEMP_LDFLAGS="$TEMP_LDFLAGS $tmp_flags" |
742 | 425 | else |
426 | break | |
427 | fi | |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
428 | print_check_msg "$dep_checked_libxml2" "yes\n" |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
429 | dep_checked_libxml2=1 |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
430 | return 1 |
742 | 431 | done |
787 | 432 | |
742 | 433 | # dependency libxml2 platform="macos" |
434 | while true | |
435 | do | |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
436 | if notisplatform "macos"; then |
742 | 437 | break |
438 | fi | |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
439 | if tmp_flags=`xml2-config --cflags` ; then |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
440 | TEMP_CFLAGS="$TEMP_CFLAGS $tmp_flags" |
742 | 441 | else |
442 | break | |
443 | fi | |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
444 | if tmp_flags=`xml2-config --libs` ; then |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
445 | TEMP_LDFLAGS="$TEMP_LDFLAGS $tmp_flags" |
742 | 446 | else |
447 | break | |
448 | fi | |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
449 | print_check_msg "$dep_checked_libxml2" "yes\n" |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
450 | dep_checked_libxml2=1 |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
451 | return 1 |
742 | 452 | done |
787 | 453 | |
454 | # dependency libxml2 | |
742 | 455 | while true |
456 | do | |
457 | if [ -z "$PKG_CONFIG" ]; then | |
787 | 458 | break |
742 | 459 | fi |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
460 | if test_pkg_config "libxml-2.0" "" "" "" ; then |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
461 | TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags libxml-2.0`" |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
462 | TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs libxml-2.0`" |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
463 | else |
742 | 464 | break |
465 | fi | |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
466 | print_check_msg "$dep_checked_libxml2" "yes\n" |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
467 | dep_checked_libxml2=1 |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
468 | return 1 |
742 | 469 | done |
787 | 470 | |
471 | # dependency libxml2 | |
742 | 472 | while true |
473 | do | |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
474 | if tmp_flags=`xml2-config --cflags` ; then |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
475 | TEMP_CFLAGS="$TEMP_CFLAGS $tmp_flags" |
742 | 476 | else |
477 | break | |
478 | fi | |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
479 | if tmp_flags=`xml2-config --libs` ; then |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
480 | TEMP_LDFLAGS="$TEMP_LDFLAGS $tmp_flags" |
742 | 481 | else |
482 | break | |
483 | fi | |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
484 | print_check_msg "$dep_checked_libxml2" "yes\n" |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
485 | dep_checked_libxml2=1 |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
486 | return 1 |
742 | 487 | done |
787 | 488 | |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
489 | print_check_msg "$dep_checked_libxml2" "no\n" |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
490 | dep_checked_libxml2=1 |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
491 | return 0 |
742 | 492 | } |
493 | ||
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
494 | # start collecting dependency information |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
495 | echo > "$TEMP_DIR/flags.mk" |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
496 | |
742 | 497 | DEPENDENCIES_FAILED= |
498 | ERROR=0 | |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
499 | # unnamed dependencies |
787 | 500 | TEMP_CFLAGS= |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
501 | TEMP_CXXFLAGS= |
787 | 502 | TEMP_LDFLAGS= |
742 | 503 | while true |
504 | do | |
505 | while true | |
506 | do | |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
507 | if [ -z "$lang_c" ] ; then |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
508 | ERROR=1 |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
509 | break |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
510 | fi |
787 | 511 | |
512 | TEMP_LDFLAGS="$TEMP_LDFLAGS -lm -lpthread" | |
742 | 513 | break |
514 | done | |
515 | break | |
516 | done | |
517 | while true | |
518 | do | |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
519 | if notisplatform "bsd"; then |
742 | 520 | break |
521 | fi | |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
522 | if isplatform "macos" || istoolchain "macos"; then |
742 | 523 | break |
524 | fi | |
525 | while true | |
526 | do | |
787 | 527 | |
528 | TEMP_CFLAGS="$TEMP_CFLAGS -I/usr/local/include" | |
529 | TEMP_LDFLAGS="$TEMP_LDFLAGS -L/usr/local/lib" | |
742 | 530 | break |
531 | done | |
532 | break | |
533 | done | |
534 | while true | |
535 | do | |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
536 | if notisplatform "macos"; then |
742 | 537 | break |
538 | fi | |
539 | while true | |
540 | do | |
787 | 541 | |
542 | cat >> "$TEMP_DIR/make.mk" << __EOF__ | |
742 | 543 | OBJ_EXT = .o |
544 | LIB_EXT = .a | |
545 | __EOF__ | |
546 | break | |
547 | done | |
548 | break | |
549 | done | |
550 | while true | |
551 | do | |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
552 | if notisplatform "unix"; then |
742 | 553 | break |
554 | fi | |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
555 | if isplatform "macos" || istoolchain "macos"; then |
742 | 556 | break |
557 | fi | |
558 | while true | |
559 | do | |
787 | 560 | |
561 | cat >> "$TEMP_DIR/make.mk" << __EOF__ | |
742 | 562 | OBJ_EXT = .o |
563 | LIB_EXT = .a | |
564 | __EOF__ | |
565 | break | |
566 | done | |
567 | break | |
568 | done | |
569 | ||
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
570 | # add general dependency flags to flags.mk |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
571 | echo "# general flags" >> "$TEMP_DIR/flags.mk" |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
572 | if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
573 | echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" |
742 | 574 | fi |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
575 | if [ -n "${TEMP_CXXFLAGS}" ] && [ -n "$lang_cpp" ]; then |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
576 | echo "CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk" |
742 | 577 | fi |
787 | 578 | if [ -n "${TEMP_LDFLAGS}" ]; then |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
579 | echo "LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk" |
742 | 580 | fi |
581 | ||
582 | # | |
583 | # OPTION VALUES | |
584 | # | |
585 | ||
586 | # | |
587 | # TARGETS | |
588 | # | |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
589 | |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
590 | echo >> "$TEMP_DIR/flags.mk" |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
591 | echo "configuring target: dav" |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
592 | echo "# flags for target dav" >> "$TEMP_DIR/flags.mk" |
787 | 593 | TEMP_CFLAGS= |
594 | TEMP_CXXFLAGS= | |
595 | TEMP_LDFLAGS= | |
742 | 596 | |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
597 | if dependency_error_curl; then |
787 | 598 | DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED curl " |
599 | ERROR=1 | |
742 | 600 | fi |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
601 | if dependency_error_libxml2; then |
787 | 602 | DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED libxml2 " |
603 | ERROR=1 | |
742 | 604 | fi |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
605 | if dependency_error_openssl; then |
787 | 606 | DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED openssl " |
607 | ERROR=1 | |
742 | 608 | fi |
609 | ||
610 | # Features | |
611 | ||
612 | ||
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
613 | if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
614 | echo "DAV_CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
615 | fi |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
616 | if [ -n "${TEMP_CXXFLAGS}" ] && [ -n "$lang_cpp" ]; then |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
617 | echo "DAV_CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk" |
742 | 618 | fi |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
619 | if [ "$BUILD_TYPE" = "debug" ]; then |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
620 | if [ -n "$lang_c" ]; then |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
621 | echo 'DAV_CFLAGS += ${DEBUG_CC_FLAGS}' >> "$TEMP_DIR/flags.mk" |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
622 | fi |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
623 | if [ -n "$lang_cpp" ]; then |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
624 | echo 'DAV_CXXFLAGS += ${DEBUG_CXX_FLAGS}' >> "$TEMP_DIR/flags.mk" |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
625 | fi |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
626 | fi |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
627 | if [ "$BUILD_TYPE" = "release" ]; then |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
628 | if [ -n "$lang_c" ]; then |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
629 | echo 'DAV_CFLAGS += ${RELEASE_CC_FLAGS}' >> "$TEMP_DIR/flags.mk" |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
630 | fi |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
631 | if [ -n "$lang_cpp" ]; then |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
632 | echo 'DAV_CXXFLAGS += ${RELEASE_CXX_FLAGS}' >> "$TEMP_DIR/flags.mk" |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
633 | fi |
742 | 634 | fi |
787 | 635 | if [ -n "${TEMP_LDFLAGS}" ]; then |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
636 | echo "DAV_LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk" |
742 | 637 | fi |
638 | ||
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
639 | |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
640 | # final result |
742 | 641 | if [ $ERROR -ne 0 ]; then |
787 | 642 | echo |
643 | echo "Error: Unresolved dependencies" | |
644 | echo "$DEPENDENCIES_FAILED" | |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
645 | abort_configure |
742 | 646 | fi |
647 | ||
648 | echo "configure finished" | |
649 | echo | |
650 | echo "Build Config:" | |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
651 | echo " PREFIX: $prefix" |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
652 | echo " TOOLCHAIN: $TOOLCHAIN_NAME" |
742 | 653 | echo |
802
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
654 | |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
655 | # generate the config.mk file |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
656 | cat > "$TEMP_DIR/config.mk" << __EOF__ |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
657 | # |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
658 | # config.mk generated by configure |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
659 | # |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
660 | |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
661 | __EOF__ |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
662 | write_toolchain_defaults "$TEMP_DIR/toolchain.mk" |
16e5b9d32754
update build files to latest uwproj
Mike Becker <universe@uap-core.de>
parents:
787
diff
changeset
|
663 | cat "$TEMP_DIR/vars.mk" "$TEMP_DIR/toolchain.mk" "$TEMP_DIR/flags.mk" "$TEMP_DIR/make.mk" > config.mk |
787 | 664 | rm -Rf "$TEMP_DIR" |