Sun, 07 Dec 2025 16:31:21 +0100
cleanup compiled location regex
| 40 | 1 | #!/bin/sh |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
2 | |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
3 | |
| 615 | 4 | # some utility functions |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
5 | isplatform() |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
6 | { |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
7 | for p in $PLATFORM |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
8 | do |
| 511 | 9 | if [ "$p" = "$1" ]; then |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
10 | return 0 |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
11 | fi |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
12 | done |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
13 | return 1 |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
14 | } |
| 515 | 15 | notisplatform() |
|
207
27f8a41882a7
more buildsystem fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
206
diff
changeset
|
16 | { |
|
27f8a41882a7
more buildsystem fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
206
diff
changeset
|
17 | for p in $PLATFORM |
|
27f8a41882a7
more buildsystem fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
206
diff
changeset
|
18 | do |
| 511 | 19 | if [ "$p" = "$1" ]; then |
|
207
27f8a41882a7
more buildsystem fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
206
diff
changeset
|
20 | return 1 |
|
27f8a41882a7
more buildsystem fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
206
diff
changeset
|
21 | fi |
|
27f8a41882a7
more buildsystem fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
206
diff
changeset
|
22 | done |
|
27f8a41882a7
more buildsystem fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
206
diff
changeset
|
23 | return 0 |
|
27f8a41882a7
more buildsystem fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
206
diff
changeset
|
24 | } |
| 515 | 25 | istoolchain() |
| 26 | { | |
| 27 | for t in $TOOLCHAIN | |
| 28 | do | |
| 29 | if [ "$t" = "$1" ]; then | |
| 30 | return 0 | |
| 31 | fi | |
| 32 | done | |
| 33 | return 1 | |
| 34 | } | |
| 35 | notistoolchain() | |
| 36 | { | |
| 37 | for t in $TOOLCHAIN | |
| 38 | do | |
| 39 | if [ "$t" = "$1" ]; then | |
| 40 | return 1 | |
| 41 | fi | |
| 42 | done | |
| 43 | return 0 | |
| 44 | } | |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
45 | |
| 615 | 46 | # clean abort |
| 47 | abort_configure() | |
| 48 | { | |
| 49 | rm -Rf "$TEMP_DIR" | |
| 50 | exit 1 | |
| 51 | } | |
| 52 | ||
| 53 | # Test for availability of pkg-config | |
| 54 | PKG_CONFIG=`command -v pkg-config` | |
| 55 | : ${PKG_CONFIG:="false"} | |
| 56 | ||
| 57 | # Simple uname based platform detection | |
| 58 | # $PLATFORM is used for platform dependent dependency selection | |
| 59 | OS=`uname -s` | |
| 60 | OS_VERSION=`uname -r` | |
| 61 | printf "detect platform... " | |
| 62 | if [ "$OS" = "SunOS" ]; then | |
| 63 | PLATFORM="solaris sunos unix svr4" | |
| 64 | elif [ "$OS" = "Linux" ]; then | |
| 65 | PLATFORM="linux unix" | |
| 66 | elif [ "$OS" = "FreeBSD" ]; then | |
| 67 | PLATFORM="freebsd bsd unix" | |
| 68 | elif [ "$OS" = "OpenBSD" ]; then | |
| 69 | PLATFORM="openbsd bsd unix" | |
| 70 | elif [ "$OS" = "NetBSD" ]; then | |
| 71 | PLATFORM="netbsd bsd unix" | |
| 72 | elif [ "$OS" = "Darwin" ]; then | |
| 73 | PLATFORM="macos osx bsd unix" | |
| 74 | elif echo "$OS" | grep -i "MINGW" > /dev/null; then | |
| 75 | PLATFORM="windows mingw" | |
| 76 | fi | |
| 77 | : ${PLATFORM:="unix"} | |
| 78 | ||
| 79 | PLATFORM_NAME=`echo "$PLATFORM" | cut -f1 -d' ' -` | |
| 80 | echo "$PLATFORM_NAME" | |
| 81 | ||
| 82 | ||
| 83 | # help text | |
| 84 | printhelp() | |
| 85 | { | |
| 86 | echo "Usage: $0 [OPTIONS]..." | |
| 87 | cat << __EOF__ | |
| 88 | Installation directories: | |
| 89 | --prefix=PREFIX path prefix for architecture-independent files | |
| 90 | [$prefix] | |
| 91 | --exec-prefix=EPREFIX path prefix for architecture-dependent files | |
| 92 | [PREFIX] | |
| 93 | ||
| 94 | --bindir=DIR user executables [EPREFIX/bin] | |
| 95 | --sbindir=DIR system admin executables [EPREFIX/sbin] | |
| 96 | --libexecdir=DIR program executables [EPREFIX/libexec] | |
| 97 | --sysconfdir=DIR system configuration files [PREFIX/etc] | |
| 98 | --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] | |
| 99 | --localstatedir=DIR modifiable single-machine data [PREFIX/var] | |
| 100 | --runstatedir=DIR run-time variable data [LOCALSTATEDIR/run] | |
| 101 | --libdir=DIR object code libraries [EPREFIX/lib] | |
| 102 | --includedir=DIR C header files [PREFIX/include] | |
| 103 | --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] | |
| 104 | --datadir=DIR read-only architecture-independent data [DATAROOTDIR] | |
| 105 | --infodir=DIR info documentation [DATAROOTDIR/info] | |
| 106 | --mandir=DIR man documentation [DATAROOTDIR/man] | |
| 107 | --localedir=DIR locale-dependent data [DATAROOTDIR/locale] | |
| 108 | ||
| 109 | Build Types: | |
| 110 | --debug add extra compile flags for debug builds | |
| 111 | --release add extra compile flags for release builds | |
| 112 | ||
| 113 | Optional Features: | |
| 114 | --enable-postgresql | |
| 115 | ||
| 116 | __EOF__ | |
| 117 | } | |
| 118 | ||
| 119 | # create temporary directory | |
| 120 | TEMP_DIR=".tmp-`uname -n`" | |
| 121 | rm -Rf "$TEMP_DIR" | |
| 122 | if mkdir -p "$TEMP_DIR"; then | |
| 123 | : | |
| 124 | else | |
| 125 | echo "Cannot create tmp dir $TEMP_DIR" | |
| 126 | echo "Abort" | |
| 127 | exit 1 | |
| 128 | fi | |
| 129 | touch "$TEMP_DIR/options" | |
| 130 | touch "$TEMP_DIR/features" | |
| 131 | ||
| 132 | # define standard variables | |
| 133 | # also define standard prefix (this is where we will search for config.site) | |
| 134 | prefix=/usr | |
| 135 | exec_prefix= | |
| 136 | bindir= | |
| 137 | sbindir= | |
| 138 | libdir= | |
| 139 | libexecdir= | |
| 140 | datarootdir= | |
| 141 | datadir= | |
| 142 | sysconfdir= | |
| 143 | sharedstatedir= | |
| 144 | localstatedir= | |
| 145 | runstatedir= | |
| 146 | includedir= | |
| 147 | infodir= | |
| 148 | localedir= | |
| 149 | mandir= | |
| 150 | ||
| 151 | # custom variables | |
| 152 | if true \ | |
| 153 | ; then | |
|
616
7a0a364a1d67
fix user-after-free in case evt_add_request/ev_pollin fails
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
615
diff
changeset
|
154 | host=`uname -n` |
|
7a0a364a1d67
fix user-after-free in case evt_add_request/ev_pollin fails
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
615
diff
changeset
|
155 | prefix="`pwd`/work" |
| 615 | 156 | fi |
| 157 | ||
| 158 | # features | |
| 159 | ||
| 160 | # | |
| 161 | # parse arguments | |
| 162 | # | |
| 163 | BUILD_TYPE="default" | |
| 164 | for ARG in "$@" | |
| 165 | do | |
| 166 | case "$ARG" in | |
| 167 | "--prefix="*) prefix=${ARG#--prefix=} ;; | |
| 168 | "--exec-prefix="*) exec_prefix=${ARG#--exec-prefix=} ;; | |
| 169 | "--bindir="*) bindir=${ARG#----bindir=} ;; | |
| 170 | "--sbindir="*) sbindir=${ARG#--sbindir=} ;; | |
| 171 | "--libdir="*) libdir=${ARG#--libdir=} ;; | |
| 172 | "--libexecdir="*) libexecdir=${ARG#--libexecdir=} ;; | |
| 173 | "--datarootdir="*) datarootdir=${ARG#--datarootdir=} ;; | |
| 174 | "--datadir="*) datadir=${ARG#--datadir=} ;; | |
| 175 | "--sysconfdir="*) sysconfdir=${ARG#--sysconfdir=} ;; | |
| 176 | "--sharedstatedir="*) sharedstatedir=${ARG#--sharedstatedir=} ;; | |
| 177 | "--localstatedir="*) localstatedir=${ARG#--localstatedir=} ;; | |
| 178 | "--includedir="*) includedir=${ARG#--includedir=} ;; | |
| 179 | "--infodir="*) infodir=${ARG#--infodir=} ;; | |
| 180 | "--mandir"*) mandir=${ARG#--mandir} ;; | |
| 181 | "--localedir"*) localedir=${ARG#--localedir} ;; | |
| 182 | "--help"*) printhelp; abort_configure ;; | |
| 183 | "--debug") BUILD_TYPE="debug" ;; | |
| 184 | "--release") BUILD_TYPE="release" ;; | |
| 185 | "--enable-postgresql") FEATURE_POSTGRESQL=on ;; | |
| 186 | "--disable-postgresql") unset FEATURE_POSTGRESQL ;; | |
| 187 | "-"*) echo "unknown option: $ARG"; abort_configure ;; | |
| 188 | esac | |
| 189 | done | |
| 190 | ||
| 191 | ||
| 192 | ||
| 193 | # set defaults for dir variables | |
| 194 | : ${exec_prefix:="$prefix"} | |
| 195 | : ${bindir:='${exec_prefix}/bin'} | |
| 196 | : ${sbindir:='${exec_prefix}/sbin'} | |
| 197 | : ${libdir:='${exec_prefix}/lib'} | |
| 198 | : ${libexecdir:='${exec_prefix}/libexec'} | |
| 199 | : ${datarootdir:='${prefix}/share'} | |
| 200 | : ${datadir:='${datarootdir}'} | |
| 201 | : ${sysconfdir:='${prefix}/etc'} | |
| 202 | : ${sharedstatedir:='${prefix}/com'} | |
| 203 | : ${localstatedir:='${prefix}/var'} | |
| 204 | : ${runstatedir:='${localstatedir}/run'} | |
| 205 | : ${includedir:='${prefix}/include'} | |
| 206 | : ${infodir:='${datarootdir}/info'} | |
| 207 | : ${mandir:='${datarootdir}/man'} | |
| 208 | : ${localedir:='${datarootdir}/locale'} | |
| 209 | ||
| 210 | # remember the above values and compare them later | |
| 211 | orig_bindir="$bindir" | |
| 212 | orig_sbindir="$sbindir" | |
| 213 | orig_libdir="$libdir" | |
| 214 | orig_libexecdir="$libexecdir" | |
| 215 | orig_datarootdir="$datarootdir" | |
| 216 | orig_datadir="$datadir" | |
| 217 | orig_sysconfdir="$sysconfdir" | |
| 218 | orig_sharedstatedir="$sharedstatedir" | |
| 219 | orig_localstatedir="$localstatedir" | |
| 220 | orig_runstatedir="$runstatedir" | |
| 221 | orig_includedir="$includedir" | |
| 222 | orig_infodir="$infodir" | |
| 223 | orig_mandir="$mandir" | |
| 224 | orig_localedir="$localedir" | |
| 225 | ||
| 226 | # check if a config.site exists and load it | |
| 227 | if [ -n "$CONFIG_SITE" ]; then | |
| 228 | # CONFIG_SITE may contain space separated file names | |
| 229 | for cs in $CONFIG_SITE; do | |
| 230 | printf "loading defaults from $cs... " | |
| 231 | . "$cs" | |
| 232 | echo ok | |
| 233 | done | |
| 234 | elif [ -f "$prefix/share/config.site" ]; then | |
| 235 | printf "loading site defaults... " | |
| 236 | . "$prefix/share/config.site" | |
| 237 | echo ok | |
| 238 | elif [ -f "$prefix/etc/config.site" ]; then | |
| 239 | printf "loading site defaults... " | |
| 240 | . "$prefix/etc/config.site" | |
| 241 | echo ok | |
| 242 | fi | |
| 243 | ||
| 40 | 244 | |
| 515 | 245 | # generate vars.mk |
| 246 | cat > "$TEMP_DIR/vars.mk" << __EOF__ | |
| 247 | prefix=$prefix | |
| 248 | exec_prefix=$exec_prefix | |
| 249 | bindir=$bindir | |
| 250 | sbindir=$sbindir | |
| 251 | libdir=$libdir | |
| 252 | libexecdir=$libexecdir | |
| 253 | datarootdir=$datarootdir | |
| 254 | datadir=$datadir | |
| 255 | sysconfdir=$sysconfdir | |
| 256 | sharedstatedir=$sharedstatedir | |
| 257 | localstatedir=$localstatedir | |
| 258 | runstatedir=$runstatedir | |
| 259 | includedir=$includedir | |
| 260 | infodir=$infodir | |
| 261 | mandir=$mandir | |
| 262 | localedir=$localedir | |
| 40 | 263 | __EOF__ |
| 264 | ||
| 515 | 265 | # toolchain detection utilities |
|
209
a6d8181a8127
replace source with . in configure script and fix toolchain detection
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
208
diff
changeset
|
266 | . make/toolchain.sh |
| 40 | 267 | |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
268 | # |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
269 | # DEPENDENCIES |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
270 | # |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
271 | |
| 515 | 272 | # check languages |
| 273 | lang_c= | |
| 274 | lang_cpp= | |
| 275 | if detect_c_compiler ; then | |
| 276 | lang_c=1 | |
| 277 | fi | |
| 278 | ||
| 279 | # create buffer for make variables required by dependencies | |
| 280 | echo > "$TEMP_DIR/make.mk" | |
| 281 | ||
| 282 | test_pkg_config() | |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
283 | { |
| 515 | 284 | if "$PKG_CONFIG" --exists "$1" ; then : |
| 285 | else return 1 ; fi | |
| 286 | if [ -z "$2" ] || "$PKG_CONFIG" --atleast-version="$2" "$1" ; then : | |
| 287 | else return 1 ; fi | |
| 288 | if [ -z "$3" ] || "$PKG_CONFIG" --exact-version="$3" "$1" ; then : | |
| 289 | else return 1 ; fi | |
| 290 | if [ -z "$4" ] || "$PKG_CONFIG" --max-version="$4" "$1" ; then : | |
| 291 | else return 1 ; fi | |
| 292 | return 0 | |
| 293 | } | |
| 294 | ||
| 295 | print_check_msg() | |
| 296 | { | |
| 297 | if [ -z "$1" ]; then | |
| 298 | shift | |
| 299 | printf "$@" | |
| 300 | fi | |
| 301 | } | |
| 302 | ||
| 303 | dependency_error_libpq() | |
| 304 | { | |
| 305 | print_check_msg "$dep_checked_libpq" "checking for libpq... " | |
| 511 | 306 | # dependency libpq |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
307 | while true |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
308 | do |
|
206
f5bdca63bbe7
fix some incompabilities in configure
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
204
diff
changeset
|
309 | if [ -z "$PKG_CONFIG" ]; then |
| 511 | 310 | break |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
311 | fi |
| 515 | 312 | if test_pkg_config "libpq" "" "" "" ; then |
| 313 | TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags libpq`" | |
| 314 | TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs libpq`" | |
| 315 | else | |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
316 | break |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
317 | fi |
| 511 | 318 | cat >> $TEMP_DIR/make.mk << __EOF__ |
| 319 | # Dependency: libpq | |
|
287
a171da778817
prepare build system for postgresql plugin tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
270
diff
changeset
|
320 | CFLAGS += -DENABLE_POSTGRESQL |
|
270
4cfaa02055cd
add first code for postgresql plugin: resourcepool type implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
267
diff
changeset
|
321 | PLUGINS += postgresql |
|
287
a171da778817
prepare build system for postgresql plugin tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
270
diff
changeset
|
322 | TEST_PLUGIN_LDFLAGS += -lwspgtest |
|
270
4cfaa02055cd
add first code for postgresql plugin: resourcepool type implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
267
diff
changeset
|
323 | __EOF__ |
| 515 | 324 | print_check_msg "$dep_checked_libpq" "yes\n" |
| 325 | dep_checked_libpq=1 | |
| 326 | return 1 | |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
327 | done |
| 511 | 328 | |
| 515 | 329 | print_check_msg "$dep_checked_libpq" "no\n" |
| 330 | dep_checked_libpq=1 | |
| 331 | return 0 | |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
332 | } |
| 515 | 333 | dependency_error_openssl() |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
334 | { |
| 515 | 335 | print_check_msg "$dep_checked_openssl" "checking for openssl... " |
| 511 | 336 | # dependency openssl |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
337 | while true |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
338 | do |
|
206
f5bdca63bbe7
fix some incompabilities in configure
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
204
diff
changeset
|
339 | if [ -z "$PKG_CONFIG" ]; then |
| 511 | 340 | break |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
341 | fi |
| 515 | 342 | if test_pkg_config "openssl" "" "" "" ; then |
| 343 | TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags openssl`" | |
| 344 | TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs openssl`" | |
| 345 | else | |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
346 | break |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
347 | fi |
| 515 | 348 | print_check_msg "$dep_checked_openssl" "yes\n" |
| 349 | dep_checked_openssl=1 | |
| 350 | return 1 | |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
351 | done |
| 511 | 352 | |
| 353 | # dependency openssl | |
|
458
15bf3c1796f2
fix openssl dependency resolution on bsd
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
453
diff
changeset
|
354 | while true |
|
15bf3c1796f2
fix openssl dependency resolution on bsd
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
453
diff
changeset
|
355 | do |
| 511 | 356 | TEMP_LDFLAGS="$TEMP_LDFLAGS -lssl -lcrypto" |
| 515 | 357 | print_check_msg "$dep_checked_openssl" "yes\n" |
| 358 | dep_checked_openssl=1 | |
| 359 | return 1 | |
|
458
15bf3c1796f2
fix openssl dependency resolution on bsd
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
453
diff
changeset
|
360 | done |
| 511 | 361 | |
| 515 | 362 | print_check_msg "$dep_checked_openssl" "no\n" |
| 363 | dep_checked_openssl=1 | |
| 364 | return 0 | |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
365 | } |
| 515 | 366 | dependency_error_libxml2() |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
367 | { |
| 515 | 368 | print_check_msg "$dep_checked_libxml2" "checking for libxml2... " |
| 511 | 369 | # dependency libxml2 |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
370 | while true |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
371 | do |
|
206
f5bdca63bbe7
fix some incompabilities in configure
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
204
diff
changeset
|
372 | if [ -z "$PKG_CONFIG" ]; then |
| 511 | 373 | break |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
374 | fi |
| 515 | 375 | if test_pkg_config "libxml-2.0" "" "" "" ; then |
| 376 | TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags libxml-2.0`" | |
| 377 | TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs libxml-2.0`" | |
| 378 | else | |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
379 | break |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
380 | fi |
| 515 | 381 | print_check_msg "$dep_checked_libxml2" "yes\n" |
| 382 | dep_checked_libxml2=1 | |
| 383 | return 1 | |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
384 | done |
| 511 | 385 | |
| 386 | # dependency libxml2 | |
|
453
4586d534f9b5
fix build on macos
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
287
diff
changeset
|
387 | while true |
|
4586d534f9b5
fix build on macos
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
287
diff
changeset
|
388 | do |
| 515 | 389 | if tmp_flags=`xml2-config --cflags` ; then |
| 390 | TEMP_CFLAGS="$TEMP_CFLAGS $tmp_flags" | |
| 391 | else | |
| 392 | break | |
| 393 | fi | |
| 394 | if tmp_flags=`xml2-config --libs` ; then | |
| 395 | TEMP_LDFLAGS="$TEMP_LDFLAGS $tmp_flags" | |
|
453
4586d534f9b5
fix build on macos
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
287
diff
changeset
|
396 | else |
|
4586d534f9b5
fix build on macos
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
287
diff
changeset
|
397 | break |
|
4586d534f9b5
fix build on macos
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
287
diff
changeset
|
398 | fi |
| 515 | 399 | print_check_msg "$dep_checked_libxml2" "yes\n" |
| 400 | dep_checked_libxml2=1 | |
| 401 | return 1 | |
|
453
4586d534f9b5
fix build on macos
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
287
diff
changeset
|
402 | done |
| 511 | 403 | |
| 515 | 404 | print_check_msg "$dep_checked_libxml2" "no\n" |
| 405 | dep_checked_libxml2=1 | |
| 406 | return 0 | |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
407 | } |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
408 | |
| 515 | 409 | # start collecting dependency information |
| 410 | echo > "$TEMP_DIR/flags.mk" | |
| 411 | ||
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
412 | DEPENDENCIES_FAILED= |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
413 | ERROR=0 |
| 515 | 414 | # unnamed dependencies |
| 615 | 415 | TEMP_CFLAGS="$CFLAGS" |
| 416 | TEMP_CXXFLAGS="$CXXFLAGS" | |
| 417 | TEMP_LDFLAGS="$LDFLAGS" | |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
418 | while true |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
419 | do |
| 515 | 420 | while true |
| 421 | do | |
| 422 | if [ -z "$lang_c" ] ; then | |
| 423 | ERROR=1 | |
| 424 | break | |
| 425 | fi | |
| 426 | ||
| 427 | break | |
| 428 | done | |
| 429 | break | |
| 430 | done | |
| 431 | while true | |
| 432 | do | |
| 433 | if notisplatform "linux"; then | |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
434 | break |
|
109
8a0a7754f123
experimental BSD support
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
94
diff
changeset
|
435 | fi |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
436 | while true |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
437 | do |
| 511 | 438 | |
| 439 | TEMP_CFLAGS="$TEMP_CFLAGS -DLINUX" | |
| 440 | TEMP_LDFLAGS="$TEMP_LDFLAGS -lpthread -ldl -lm -lldap -llber" | |
| 441 | cat >> "$TEMP_DIR/make.mk" << __EOF__ | |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
442 | # platform dependend source files |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
443 | PLATFORM_DAEMONOBJ = event_linux.o |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
444 | |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
445 | # platform dependend vars |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
446 | OBJ_EXT = .o |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
447 | LIB_EXT = .so |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
448 | APP_EXT = |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
449 | |
|
453
4586d534f9b5
fix build on macos
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
287
diff
changeset
|
450 | # ld flags |
|
4586d534f9b5
fix build on macos
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
287
diff
changeset
|
451 | UCX_SO_NAME = |
|
485
222557f4f595
fix configure script: escape $$ORIGIN
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
464
diff
changeset
|
452 | RPATH_WS_LIB_FLAG = -Wl,-rpath,'\$\$ORIGIN/../lib' |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
453 | __EOF__ |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
454 | break |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
455 | done |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
456 | break |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
457 | done |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
458 | while true |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
459 | do |
| 515 | 460 | if notisplatform "bsd"; then |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
461 | break |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
462 | fi |
| 515 | 463 | if isplatform "macos" || istoolchain "macos"; then |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
464 | break |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
465 | fi |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
466 | while true |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
467 | do |
| 511 | 468 | |
| 469 | TEMP_CFLAGS="$TEMP_CFLAGS -DBSD -I/usr/local/include" | |
| 470 | TEMP_LDFLAGS="$TEMP_LDFLAGS -lpthread -lm -lldap -llber" | |
| 471 | cat >> "$TEMP_DIR/make.mk" << __EOF__ | |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
472 | # platform dependend source files |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
473 | PLATFORM_DAEMONOBJ = event_bsd.o |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
474 | |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
475 | # platform dependend vars |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
476 | OBJ_EXT = .o |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
477 | LIB_EXT = .so |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
478 | APP_EXT = |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
479 | |
|
453
4586d534f9b5
fix build on macos
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
287
diff
changeset
|
480 | # ld flags |
|
4586d534f9b5
fix build on macos
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
287
diff
changeset
|
481 | UCX_SO_NAME = |
|
485
222557f4f595
fix configure script: escape $$ORIGIN
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
464
diff
changeset
|
482 | RPATH_WS_LIB_FLAG = -Wl,-rpath,'\$\$ORIGIN/../lib' |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
483 | __EOF__ |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
484 | break |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
485 | done |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
486 | break |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
487 | done |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
488 | while true |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
489 | do |
| 515 | 490 | if notisplatform "macos"; then |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
491 | break |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
492 | fi |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
493 | while true |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
494 | do |
| 511 | 495 | |
| 496 | TEMP_CFLAGS="$TEMP_CFLAGS -DBSD -DOSX" | |
| 497 | TEMP_LDFLAGS="$TEMP_LDFLAGS -lpthread -ldl -lm -lldap -llber" | |
| 498 | cat >> "$TEMP_DIR/make.mk" << __EOF__ | |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
499 | # platform dependend source files |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
500 | PLATFORM_DAEMONOBJ = event_bsd.o |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
501 | |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
502 | # platform dependend vars |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
503 | OBJ_EXT = .o |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
504 | LIB_EXT = .dylib |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
505 | APP_EXT = |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
506 | |
|
453
4586d534f9b5
fix build on macos
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
287
diff
changeset
|
507 | # ld flags |
|
620
a202cb1ee175
use -dynamiclib flag to build a dylib on macos
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
616
diff
changeset
|
508 | SHLIB_LDFLAGS = -dynamiclib |
|
453
4586d534f9b5
fix build on macos
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
287
diff
changeset
|
509 | UCX_SO_NAME = -install_name @rpath/libucx.dylib |
|
4586d534f9b5
fix build on macos
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
287
diff
changeset
|
510 | RPATH_WS_LIB_FLAG = -rpath @loader_path/../lib |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
511 | __EOF__ |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
512 | break |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
513 | done |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
514 | break |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
515 | done |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
516 | while true |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
517 | do |
| 515 | 518 | if notisplatform "solaris"; then |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
519 | break |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
520 | fi |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
521 | while true |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
522 | do |
| 511 | 523 | |
| 524 | TEMP_CFLAGS="$TEMP_CFLAGS -DSOLARIS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS" | |
| 525 | TEMP_LDFLAGS="$TEMP_LDFLAGS -lsocket -lnsl -lsendfile -lposix4 -lpthread -ldl -lm -lmd -lldap" | |
| 526 | cat >> "$TEMP_DIR/make.mk" << __EOF__ | |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
527 | # platform dependend source files |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
528 | PLATFORM_DAEMONOBJ = event_solaris.o |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
529 | |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
530 | # platform dependend vars |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
531 | OBJ_EXT = .o |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
532 | LIB_EXT = .so |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
533 | APP_EXT = |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
534 | __EOF__ |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
535 | break |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
536 | done |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
537 | break |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
538 | done |
|
616
7a0a364a1d67
fix user-after-free in case evt_add_request/ev_pollin fails
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
615
diff
changeset
|
539 | while true |
|
7a0a364a1d67
fix user-after-free in case evt_add_request/ev_pollin fails
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
615
diff
changeset
|
540 | do |
|
7a0a364a1d67
fix user-after-free in case evt_add_request/ev_pollin fails
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
615
diff
changeset
|
541 | while true |
|
7a0a364a1d67
fix user-after-free in case evt_add_request/ev_pollin fails
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
615
diff
changeset
|
542 | do |
|
7a0a364a1d67
fix user-after-free in case evt_add_request/ev_pollin fails
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
615
diff
changeset
|
543 | |
|
7a0a364a1d67
fix user-after-free in case evt_add_request/ev_pollin fails
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
615
diff
changeset
|
544 | cat >> "$TEMP_DIR/make.mk" << __EOF__ |
|
7a0a364a1d67
fix user-after-free in case evt_add_request/ev_pollin fails
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
615
diff
changeset
|
545 | HOST = $host |
|
7a0a364a1d67
fix user-after-free in case evt_add_request/ev_pollin fails
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
615
diff
changeset
|
546 | INSTALL_DIR = $prefix |
|
7a0a364a1d67
fix user-after-free in case evt_add_request/ev_pollin fails
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
615
diff
changeset
|
547 | __EOF__ |
|
7a0a364a1d67
fix user-after-free in case evt_add_request/ev_pollin fails
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
615
diff
changeset
|
548 | break |
|
7a0a364a1d67
fix user-after-free in case evt_add_request/ev_pollin fails
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
615
diff
changeset
|
549 | done |
|
7a0a364a1d67
fix user-after-free in case evt_add_request/ev_pollin fails
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
615
diff
changeset
|
550 | break |
|
7a0a364a1d67
fix user-after-free in case evt_add_request/ev_pollin fails
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
615
diff
changeset
|
551 | done |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
552 | |
| 615 | 553 | # build type |
| 554 | if [ "$BUILD_TYPE" = "debug" ]; then | |
| 555 | TEMP_CFLAGS="\${DEBUG_CFLAGS} $TEMP_CFLAGS" | |
| 556 | TEMP_CXXFLAGS="\${DEBUG_CXXFLAGS} $TEMP_CXXFLAGS" | |
| 557 | fi | |
| 558 | if [ "$BUILD_TYPE" = "release" ]; then | |
| 559 | TEMP_CFLAGS="\${RELEASE_CFLAGS} $TEMP_CFLAGS" | |
| 560 | TEMP_CXXFLAGS="\${RELEASE_CXXFLAGS} $TEMP_CXXFLAGS" | |
| 561 | fi | |
| 562 | ||
| 515 | 563 | # add general dependency flags to flags.mk |
| 564 | echo "# general flags" >> "$TEMP_DIR/flags.mk" | |
| 565 | if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then | |
| 566 | echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" | |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
567 | fi |
| 515 | 568 | if [ -n "${TEMP_CXXFLAGS}" ] && [ -n "$lang_cpp" ]; then |
| 569 | echo "CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk" | |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
570 | fi |
| 511 | 571 | if [ -n "${TEMP_LDFLAGS}" ]; then |
| 515 | 572 | echo "LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk" |
|
109
8a0a7754f123
experimental BSD support
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
94
diff
changeset
|
573 | fi |
|
8a0a7754f123
experimental BSD support
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
94
diff
changeset
|
574 | |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
575 | # |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
576 | # OPTION VALUES |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
577 | # |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
578 | |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
579 | # |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
580 | # TARGETS |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
581 | # |
| 515 | 582 | |
| 583 | echo >> "$TEMP_DIR/flags.mk" | |
| 584 | echo "configuring global target" | |
| 585 | echo "# flags for unnamed target" >> "$TEMP_DIR/flags.mk" | |
| 511 | 586 | TEMP_CFLAGS= |
| 587 | TEMP_CXXFLAGS= | |
| 588 | TEMP_LDFLAGS= | |
|
62
c47e081b6c0f
added keyfile based authentication
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
44
diff
changeset
|
589 | |
| 515 | 590 | if dependency_error_libxml2; then |
| 511 | 591 | DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED libxml2 " |
| 592 | ERROR=1 | |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
593 | fi |
| 515 | 594 | if dependency_error_openssl; then |
| 511 | 595 | DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED openssl " |
| 596 | ERROR=1 | |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
597 | fi |
|
41
bb7a1f5a8b48
added Linux support
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
40
diff
changeset
|
598 | |
|
250
f4d93355b054
update configure script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
210
diff
changeset
|
599 | # Features |
|
270
4cfaa02055cd
add first code for postgresql plugin: resourcepool type implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
267
diff
changeset
|
600 | |
|
4cfaa02055cd
add first code for postgresql plugin: resourcepool type implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
267
diff
changeset
|
601 | |
| 515 | 602 | if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then |
| 603 | echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" | |
| 604 | fi | |
| 605 | if [ -n "${TEMP_CXXFLAGS}" ] && [ -n "$lang_cpp" ]; then | |
| 606 | echo "CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk" | |
|
270
4cfaa02055cd
add first code for postgresql plugin: resourcepool type implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
267
diff
changeset
|
607 | fi |
| 511 | 608 | if [ -n "${TEMP_LDFLAGS}" ]; then |
| 515 | 609 | echo "LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk" |
|
270
4cfaa02055cd
add first code for postgresql plugin: resourcepool type implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
267
diff
changeset
|
610 | fi |
|
4cfaa02055cd
add first code for postgresql plugin: resourcepool type implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
267
diff
changeset
|
611 | |
| 515 | 612 | echo >> "$TEMP_DIR/flags.mk" |
| 613 | echo "configuring target: postgresql" | |
| 614 | echo "# flags for target postgresql" >> "$TEMP_DIR/flags.mk" | |
| 511 | 615 | TEMP_CFLAGS= |
| 515 | 616 | TEMP_CXXFLAGS= |
| 511 | 617 | TEMP_LDFLAGS= |
|
270
4cfaa02055cd
add first code for postgresql plugin: resourcepool type implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
267
diff
changeset
|
618 | |
|
4cfaa02055cd
add first code for postgresql plugin: resourcepool type implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
267
diff
changeset
|
619 | |
|
4cfaa02055cd
add first code for postgresql plugin: resourcepool type implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
267
diff
changeset
|
620 | # Features |
| 511 | 621 | if [ -n "$FEATURE_POSTGRESQL" ]; then |
| 622 | # check dependency | |
| 515 | 623 | if dependency_error_libpq ; then |
| 511 | 624 | # "auto" features can fail and are just disabled in this case |
| 515 | 625 | if [ "$FEATURE_POSTGRESQL" = "auto" ]; then |
| 626 | DISABLE_FEATURE_POSTGRESQL=1 | |
| 627 | else | |
| 511 | 628 | DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED libpq " |
| 629 | ERROR=1 | |
| 630 | fi | |
| 631 | fi | |
| 515 | 632 | if [ -n "$DISABLE_FEATURE_POSTGRESQL" ]; then |
| 633 | unset FEATURE_POSTGRESQL | |
| 634 | fi | |
|
250
f4d93355b054
update configure script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
210
diff
changeset
|
635 | fi |
| 615 | 636 | if [ -n "$FEATURE_POSTGRESQL" ]; then |
| 637 | : | |
| 638 | else | |
| 639 | : | |
| 640 | fi | |
|
250
f4d93355b054
update configure script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
210
diff
changeset
|
641 | |
| 40 | 642 | |
| 515 | 643 | if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then |
| 644 | echo "POSTGRESQL_CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" | |
| 645 | fi | |
| 646 | if [ -n "${TEMP_CXXFLAGS}" ] && [ -n "$lang_cpp" ]; then | |
| 647 | echo "POSTGRESQL_CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk" | |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
648 | fi |
| 511 | 649 | if [ -n "${TEMP_LDFLAGS}" ]; then |
| 515 | 650 | echo "POSTGRESQL_LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk" |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
651 | fi |
| 40 | 652 | |
| 515 | 653 | |
| 654 | # final result | |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
655 | if [ $ERROR -ne 0 ]; then |
| 511 | 656 | echo |
| 657 | echo "Error: Unresolved dependencies" | |
| 658 | echo "$DEPENDENCIES_FAILED" | |
| 515 | 659 | abort_configure |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
660 | fi |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
661 | |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
662 | echo "configure finished" |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
663 | echo |
| 615 | 664 | echo "Toolchain" |
| 665 | echo " name: $TOOLCHAIN_NAME" | |
| 666 | if [ -n "$TOOLCHAIN_CC" ]; then | |
| 667 | echo " cc: $TOOLCHAIN_CC" | |
| 668 | fi | |
| 669 | if [ -n "$TOOLCHAIN_CXX" ]; then | |
| 670 | echo " cxx: $TOOLCHAIN_CXX" | |
| 671 | fi | |
| 672 | if [ -n "$TOOLCHAIN_WSIZE" ]; then | |
| 673 | echo " word size: $TOOLCHAIN_WSIZE bit" | |
| 674 | fi | |
| 675 | if [ -n "$TOOLCHAIN_CSTD" ]; then | |
| 676 | echo " default C std: $TOOLCHAIN_CSTD" | |
| 677 | fi | |
| 678 | echo | |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
679 | echo "Build Config:" |
| 615 | 680 | echo " prefix: $prefix" |
| 681 | echo " exec_prefix: $exec_prefix" | |
| 682 | if [ "$orig_bindir" != "$bindir" ]; then | |
| 683 | echo " bindir: $bindir" | |
| 684 | fi | |
| 685 | if [ "$orig_sbindir" != "$sbindir" ]; then | |
| 686 | echo " sbindir: $sbindir" | |
| 687 | fi | |
| 688 | if [ "$orig_libdir" != "$libdir" ]; then | |
| 689 | echo " libdir: $libdir" | |
| 690 | fi | |
| 691 | if [ "$orig_libexecdir" != "$libexecdir" ]; then | |
| 692 | echo " libexecdir: $libexecdir" | |
| 693 | fi | |
| 694 | if [ "$orig_datarootdir" != "$datarootdir" ]; then | |
| 695 | echo " datarootdir: $datarootdir" | |
| 696 | fi | |
| 697 | if [ "$orig_datadir" != "$datadir" ]; then | |
| 698 | echo " datadir: $datadir" | |
| 699 | fi | |
| 700 | if [ "$orig_sysconfdir" != "$sysconfdir" ]; then | |
| 701 | echo " sysconfdir: $sysconfdir" | |
| 702 | fi | |
| 703 | if [ "$orig_sharedstatedir" != "$sharedstatedir" ]; then | |
| 704 | echo " sharedstatedir: $sharedstatedir" | |
| 705 | fi | |
| 706 | if [ "$orig_localstatedir" != "$localstatedir" ]; then | |
| 707 | echo " localstatedir: $localstatedir" | |
| 708 | fi | |
| 709 | if [ "$orig_runstatedir" != "$runstatedir" ]; then | |
| 710 | echo " runstatedir: $runstatedir" | |
| 711 | fi | |
| 712 | if [ "$orig_includedir" != "$includedir" ]; then | |
| 713 | echo " includedir: $includedir" | |
| 714 | fi | |
| 715 | if [ "$orig_infodir" != "$infodir" ]; then | |
| 716 | echo " infodir: $infodir" | |
| 717 | fi | |
| 718 | if [ "$orig_mandir" != "$mandir" ]; then | |
| 719 | echo " mandir: $mandir" | |
| 720 | fi | |
| 721 | if [ "$orig_localedir" != "$localedir" ]; then | |
| 722 | echo " localedir: $localedir" | |
| 723 | fi | |
| 724 | echo | |
| 515 | 725 | echo "Features:" |
| 726 | if [ -n "$FEATURE_POSTGRESQL" ]; then | |
| 727 | echo " postgresql: on" | |
| 728 | else | |
| 729 | echo " postgresql: off" | |
| 730 | fi | |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
731 | echo |
| 515 | 732 | |
| 733 | # generate the config.mk file | |
| 615 | 734 | pwd=`pwd` |
| 515 | 735 | cat > "$TEMP_DIR/config.mk" << __EOF__ |
| 736 | # | |
| 615 | 737 | # config.mk generated by: |
| 738 | # pwd: $pwd | |
| 739 | # $0 $@ | |
| 515 | 740 | # |
| 741 | ||
| 742 | __EOF__ | |
| 743 | write_toolchain_defaults "$TEMP_DIR/toolchain.mk" | |
| 615 | 744 | cat "$TEMP_DIR/config.mk" "$TEMP_DIR/vars.mk" "$TEMP_DIR/toolchain.mk" "$TEMP_DIR/flags.mk" "$TEMP_DIR/make.mk" > config.mk |
| 511 | 745 | rm -Rf "$TEMP_DIR" |