Sun, 26 Oct 2025 15:31:50 +0100
update uwproj
| 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 | |
| 154 | HOST=`uname -n` | |
| 155 | PREFIX="`pwd`/work" | |
| 156 | INSTALL_DIR="$PREFIX" | |
| 157 | fi | |
| 158 | ||
| 159 | # features | |
| 160 | ||
| 161 | # | |
| 162 | # parse arguments | |
| 163 | # | |
| 164 | BUILD_TYPE="default" | |
| 165 | for ARG in "$@" | |
| 166 | do | |
| 167 | case "$ARG" in | |
| 168 | "--prefix="*) prefix=${ARG#--prefix=} ;; | |
| 169 | "--exec-prefix="*) exec_prefix=${ARG#--exec-prefix=} ;; | |
| 170 | "--bindir="*) bindir=${ARG#----bindir=} ;; | |
| 171 | "--sbindir="*) sbindir=${ARG#--sbindir=} ;; | |
| 172 | "--libdir="*) libdir=${ARG#--libdir=} ;; | |
| 173 | "--libexecdir="*) libexecdir=${ARG#--libexecdir=} ;; | |
| 174 | "--datarootdir="*) datarootdir=${ARG#--datarootdir=} ;; | |
| 175 | "--datadir="*) datadir=${ARG#--datadir=} ;; | |
| 176 | "--sysconfdir="*) sysconfdir=${ARG#--sysconfdir=} ;; | |
| 177 | "--sharedstatedir="*) sharedstatedir=${ARG#--sharedstatedir=} ;; | |
| 178 | "--localstatedir="*) localstatedir=${ARG#--localstatedir=} ;; | |
| 179 | "--includedir="*) includedir=${ARG#--includedir=} ;; | |
| 180 | "--infodir="*) infodir=${ARG#--infodir=} ;; | |
| 181 | "--mandir"*) mandir=${ARG#--mandir} ;; | |
| 182 | "--localedir"*) localedir=${ARG#--localedir} ;; | |
| 183 | "--help"*) printhelp; abort_configure ;; | |
| 184 | "--debug") BUILD_TYPE="debug" ;; | |
| 185 | "--release") BUILD_TYPE="release" ;; | |
| 186 | "--enable-postgresql") FEATURE_POSTGRESQL=on ;; | |
| 187 | "--disable-postgresql") unset FEATURE_POSTGRESQL ;; | |
| 188 | "-"*) echo "unknown option: $ARG"; abort_configure ;; | |
| 189 | esac | |
| 190 | done | |
| 191 | ||
| 192 | ||
| 193 | ||
| 194 | # set defaults for dir variables | |
| 195 | : ${exec_prefix:="$prefix"} | |
| 196 | : ${bindir:='${exec_prefix}/bin'} | |
| 197 | : ${sbindir:='${exec_prefix}/sbin'} | |
| 198 | : ${libdir:='${exec_prefix}/lib'} | |
| 199 | : ${libexecdir:='${exec_prefix}/libexec'} | |
| 200 | : ${datarootdir:='${prefix}/share'} | |
| 201 | : ${datadir:='${datarootdir}'} | |
| 202 | : ${sysconfdir:='${prefix}/etc'} | |
| 203 | : ${sharedstatedir:='${prefix}/com'} | |
| 204 | : ${localstatedir:='${prefix}/var'} | |
| 205 | : ${runstatedir:='${localstatedir}/run'} | |
| 206 | : ${includedir:='${prefix}/include'} | |
| 207 | : ${infodir:='${datarootdir}/info'} | |
| 208 | : ${mandir:='${datarootdir}/man'} | |
| 209 | : ${localedir:='${datarootdir}/locale'} | |
| 210 | ||
| 211 | # remember the above values and compare them later | |
| 212 | orig_bindir="$bindir" | |
| 213 | orig_sbindir="$sbindir" | |
| 214 | orig_libdir="$libdir" | |
| 215 | orig_libexecdir="$libexecdir" | |
| 216 | orig_datarootdir="$datarootdir" | |
| 217 | orig_datadir="$datadir" | |
| 218 | orig_sysconfdir="$sysconfdir" | |
| 219 | orig_sharedstatedir="$sharedstatedir" | |
| 220 | orig_localstatedir="$localstatedir" | |
| 221 | orig_runstatedir="$runstatedir" | |
| 222 | orig_includedir="$includedir" | |
| 223 | orig_infodir="$infodir" | |
| 224 | orig_mandir="$mandir" | |
| 225 | orig_localedir="$localedir" | |
| 226 | ||
| 227 | # check if a config.site exists and load it | |
| 228 | if [ -n "$CONFIG_SITE" ]; then | |
| 229 | # CONFIG_SITE may contain space separated file names | |
| 230 | for cs in $CONFIG_SITE; do | |
| 231 | printf "loading defaults from $cs... " | |
| 232 | . "$cs" | |
| 233 | echo ok | |
| 234 | done | |
| 235 | elif [ -f "$prefix/share/config.site" ]; then | |
| 236 | printf "loading site defaults... " | |
| 237 | . "$prefix/share/config.site" | |
| 238 | echo ok | |
| 239 | elif [ -f "$prefix/etc/config.site" ]; then | |
| 240 | printf "loading site defaults... " | |
| 241 | . "$prefix/etc/config.site" | |
| 242 | echo ok | |
| 243 | fi | |
| 244 | ||
| 40 | 245 | |
| 515 | 246 | # generate vars.mk |
| 247 | cat > "$TEMP_DIR/vars.mk" << __EOF__ | |
| 248 | prefix=$prefix | |
| 249 | exec_prefix=$exec_prefix | |
| 250 | bindir=$bindir | |
| 251 | sbindir=$sbindir | |
| 252 | libdir=$libdir | |
| 253 | libexecdir=$libexecdir | |
| 254 | datarootdir=$datarootdir | |
| 255 | datadir=$datadir | |
| 256 | sysconfdir=$sysconfdir | |
| 257 | sharedstatedir=$sharedstatedir | |
| 258 | localstatedir=$localstatedir | |
| 259 | runstatedir=$runstatedir | |
| 260 | includedir=$includedir | |
| 261 | infodir=$infodir | |
| 262 | mandir=$mandir | |
| 263 | localedir=$localedir | |
| 40 | 264 | __EOF__ |
| 265 | ||
| 515 | 266 | # 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
|
267 | . make/toolchain.sh |
| 40 | 268 | |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
269 | # |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
270 | # DEPENDENCIES |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
271 | # |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
272 | |
| 515 | 273 | # check languages |
| 274 | lang_c= | |
| 275 | lang_cpp= | |
| 276 | if detect_c_compiler ; then | |
| 277 | lang_c=1 | |
| 278 | fi | |
| 279 | ||
| 280 | # create buffer for make variables required by dependencies | |
| 281 | echo > "$TEMP_DIR/make.mk" | |
| 282 | ||
| 283 | test_pkg_config() | |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
284 | { |
| 515 | 285 | if "$PKG_CONFIG" --exists "$1" ; then : |
| 286 | else return 1 ; fi | |
| 287 | if [ -z "$2" ] || "$PKG_CONFIG" --atleast-version="$2" "$1" ; then : | |
| 288 | else return 1 ; fi | |
| 289 | if [ -z "$3" ] || "$PKG_CONFIG" --exact-version="$3" "$1" ; then : | |
| 290 | else return 1 ; fi | |
| 291 | if [ -z "$4" ] || "$PKG_CONFIG" --max-version="$4" "$1" ; then : | |
| 292 | else return 1 ; fi | |
| 293 | return 0 | |
| 294 | } | |
| 295 | ||
| 296 | print_check_msg() | |
| 297 | { | |
| 298 | if [ -z "$1" ]; then | |
| 299 | shift | |
| 300 | printf "$@" | |
| 301 | fi | |
| 302 | } | |
| 303 | ||
| 304 | dependency_error_libpq() | |
| 305 | { | |
| 306 | print_check_msg "$dep_checked_libpq" "checking for libpq... " | |
| 511 | 307 | # dependency libpq |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
308 | while true |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
309 | do |
|
206
f5bdca63bbe7
fix some incompabilities in configure
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
204
diff
changeset
|
310 | if [ -z "$PKG_CONFIG" ]; then |
| 511 | 311 | break |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
312 | fi |
| 515 | 313 | if test_pkg_config "libpq" "" "" "" ; then |
| 314 | TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags libpq`" | |
| 315 | TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs libpq`" | |
| 316 | else | |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
317 | break |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
318 | fi |
| 511 | 319 | cat >> $TEMP_DIR/make.mk << __EOF__ |
| 320 | # Dependency: libpq | |
|
287
a171da778817
prepare build system for postgresql plugin tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
270
diff
changeset
|
321 | CFLAGS += -DENABLE_POSTGRESQL |
|
270
4cfaa02055cd
add first code for postgresql plugin: resourcepool type implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
267
diff
changeset
|
322 | PLUGINS += postgresql |
|
287
a171da778817
prepare build system for postgresql plugin tests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
270
diff
changeset
|
323 | 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
|
324 | __EOF__ |
| 515 | 325 | print_check_msg "$dep_checked_libpq" "yes\n" |
| 326 | dep_checked_libpq=1 | |
| 327 | return 1 | |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
328 | done |
| 511 | 329 | |
| 515 | 330 | print_check_msg "$dep_checked_libpq" "no\n" |
| 331 | dep_checked_libpq=1 | |
| 332 | return 0 | |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
333 | } |
| 515 | 334 | dependency_error_openssl() |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
335 | { |
| 515 | 336 | print_check_msg "$dep_checked_openssl" "checking for openssl... " |
| 511 | 337 | # dependency openssl |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
338 | while true |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
339 | do |
|
206
f5bdca63bbe7
fix some incompabilities in configure
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
204
diff
changeset
|
340 | if [ -z "$PKG_CONFIG" ]; then |
| 511 | 341 | break |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
342 | fi |
| 515 | 343 | if test_pkg_config "openssl" "" "" "" ; then |
| 344 | TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags openssl`" | |
| 345 | TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs openssl`" | |
| 346 | else | |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
347 | break |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
348 | fi |
| 515 | 349 | print_check_msg "$dep_checked_openssl" "yes\n" |
| 350 | dep_checked_openssl=1 | |
| 351 | return 1 | |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
352 | done |
| 511 | 353 | |
| 354 | # dependency openssl | |
|
458
15bf3c1796f2
fix openssl dependency resolution on bsd
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
453
diff
changeset
|
355 | while true |
|
15bf3c1796f2
fix openssl dependency resolution on bsd
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
453
diff
changeset
|
356 | do |
| 511 | 357 | TEMP_LDFLAGS="$TEMP_LDFLAGS -lssl -lcrypto" |
| 515 | 358 | print_check_msg "$dep_checked_openssl" "yes\n" |
| 359 | dep_checked_openssl=1 | |
| 360 | return 1 | |
|
458
15bf3c1796f2
fix openssl dependency resolution on bsd
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
453
diff
changeset
|
361 | done |
| 511 | 362 | |
| 515 | 363 | print_check_msg "$dep_checked_openssl" "no\n" |
| 364 | dep_checked_openssl=1 | |
| 365 | return 0 | |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
366 | } |
| 515 | 367 | dependency_error_libxml2() |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
368 | { |
| 515 | 369 | print_check_msg "$dep_checked_libxml2" "checking for libxml2... " |
| 511 | 370 | # dependency libxml2 |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
371 | while true |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
372 | do |
|
206
f5bdca63bbe7
fix some incompabilities in configure
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
204
diff
changeset
|
373 | if [ -z "$PKG_CONFIG" ]; then |
| 511 | 374 | break |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
375 | fi |
| 515 | 376 | if test_pkg_config "libxml-2.0" "" "" "" ; then |
| 377 | TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags libxml-2.0`" | |
| 378 | TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs libxml-2.0`" | |
| 379 | else | |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
380 | break |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
381 | fi |
| 515 | 382 | print_check_msg "$dep_checked_libxml2" "yes\n" |
| 383 | dep_checked_libxml2=1 | |
| 384 | return 1 | |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
385 | done |
| 511 | 386 | |
| 387 | # dependency libxml2 | |
|
453
4586d534f9b5
fix build on macos
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
287
diff
changeset
|
388 | while true |
|
4586d534f9b5
fix build on macos
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
287
diff
changeset
|
389 | do |
| 515 | 390 | if tmp_flags=`xml2-config --cflags` ; then |
| 391 | TEMP_CFLAGS="$TEMP_CFLAGS $tmp_flags" | |
| 392 | else | |
| 393 | break | |
| 394 | fi | |
| 395 | if tmp_flags=`xml2-config --libs` ; then | |
| 396 | TEMP_LDFLAGS="$TEMP_LDFLAGS $tmp_flags" | |
|
453
4586d534f9b5
fix build on macos
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
287
diff
changeset
|
397 | else |
|
4586d534f9b5
fix build on macos
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
287
diff
changeset
|
398 | break |
|
4586d534f9b5
fix build on macos
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
287
diff
changeset
|
399 | fi |
| 515 | 400 | print_check_msg "$dep_checked_libxml2" "yes\n" |
| 401 | dep_checked_libxml2=1 | |
| 402 | return 1 | |
|
453
4586d534f9b5
fix build on macos
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
287
diff
changeset
|
403 | done |
| 511 | 404 | |
| 515 | 405 | print_check_msg "$dep_checked_libxml2" "no\n" |
| 406 | dep_checked_libxml2=1 | |
| 407 | return 0 | |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
408 | } |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
409 | |
| 515 | 410 | # start collecting dependency information |
| 411 | echo > "$TEMP_DIR/flags.mk" | |
| 412 | ||
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
413 | DEPENDENCIES_FAILED= |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
414 | ERROR=0 |
| 515 | 415 | # unnamed dependencies |
| 615 | 416 | TEMP_CFLAGS="$CFLAGS" |
| 417 | TEMP_CXXFLAGS="$CXXFLAGS" | |
| 418 | TEMP_LDFLAGS="$LDFLAGS" | |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
419 | while true |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
420 | do |
| 515 | 421 | while true |
| 422 | do | |
| 423 | if [ -z "$lang_c" ] ; then | |
| 424 | ERROR=1 | |
| 425 | break | |
| 426 | fi | |
| 427 | ||
| 428 | break | |
| 429 | done | |
| 430 | break | |
| 431 | done | |
| 432 | while true | |
| 433 | do | |
| 434 | if notisplatform "linux"; then | |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
435 | break |
|
109
8a0a7754f123
experimental BSD support
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
94
diff
changeset
|
436 | fi |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
437 | while true |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
438 | do |
| 511 | 439 | |
| 440 | TEMP_CFLAGS="$TEMP_CFLAGS -DLINUX" | |
| 441 | TEMP_LDFLAGS="$TEMP_LDFLAGS -lpthread -ldl -lm -lldap -llber" | |
| 442 | cat >> "$TEMP_DIR/make.mk" << __EOF__ | |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
443 | # platform dependend source files |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
444 | PLATFORM_DAEMONOBJ = event_linux.o |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
445 | |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
446 | # platform dependend vars |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
447 | OBJ_EXT = .o |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
448 | LIB_EXT = .so |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
449 | APP_EXT = |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
450 | |
|
453
4586d534f9b5
fix build on macos
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
287
diff
changeset
|
451 | # ld flags |
|
4586d534f9b5
fix build on macos
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
287
diff
changeset
|
452 | UCX_SO_NAME = |
|
485
222557f4f595
fix configure script: escape $$ORIGIN
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
464
diff
changeset
|
453 | 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
|
454 | __EOF__ |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
455 | break |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
456 | done |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
457 | break |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
458 | done |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
459 | while true |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
460 | do |
| 515 | 461 | if notisplatform "bsd"; then |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
462 | break |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
463 | fi |
| 515 | 464 | if isplatform "macos" || istoolchain "macos"; then |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
465 | break |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
466 | fi |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
467 | while true |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
468 | do |
| 511 | 469 | |
| 470 | TEMP_CFLAGS="$TEMP_CFLAGS -DBSD -I/usr/local/include" | |
| 471 | TEMP_LDFLAGS="$TEMP_LDFLAGS -lpthread -lm -lldap -llber" | |
| 472 | cat >> "$TEMP_DIR/make.mk" << __EOF__ | |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
473 | # platform dependend source files |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
474 | PLATFORM_DAEMONOBJ = event_bsd.o |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
475 | |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
476 | # platform dependend vars |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
477 | OBJ_EXT = .o |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
478 | LIB_EXT = .so |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
479 | APP_EXT = |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
480 | |
|
453
4586d534f9b5
fix build on macos
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
287
diff
changeset
|
481 | # ld flags |
|
4586d534f9b5
fix build on macos
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
287
diff
changeset
|
482 | UCX_SO_NAME = |
|
485
222557f4f595
fix configure script: escape $$ORIGIN
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
464
diff
changeset
|
483 | 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
|
484 | __EOF__ |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
485 | break |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
486 | done |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
487 | break |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
488 | done |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
489 | while true |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
490 | do |
| 515 | 491 | if notisplatform "macos"; then |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
492 | break |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
493 | fi |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
494 | while true |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
495 | do |
| 511 | 496 | |
| 497 | TEMP_CFLAGS="$TEMP_CFLAGS -DBSD -DOSX" | |
| 498 | TEMP_LDFLAGS="$TEMP_LDFLAGS -lpthread -ldl -lm -lldap -llber" | |
| 499 | cat >> "$TEMP_DIR/make.mk" << __EOF__ | |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
500 | # platform dependend source files |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
501 | PLATFORM_DAEMONOBJ = event_bsd.o |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
502 | |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
503 | # platform dependend vars |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
504 | OBJ_EXT = .o |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
505 | LIB_EXT = .dylib |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
506 | APP_EXT = |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
507 | |
|
453
4586d534f9b5
fix build on macos
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
287
diff
changeset
|
508 | # ld flags |
|
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 |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
539 | |
| 615 | 540 | # build type |
| 541 | if [ "$BUILD_TYPE" = "debug" ]; then | |
| 542 | TEMP_CFLAGS="\${DEBUG_CFLAGS} $TEMP_CFLAGS" | |
| 543 | TEMP_CXXFLAGS="\${DEBUG_CXXFLAGS} $TEMP_CXXFLAGS" | |
| 544 | fi | |
| 545 | if [ "$BUILD_TYPE" = "release" ]; then | |
| 546 | TEMP_CFLAGS="\${RELEASE_CFLAGS} $TEMP_CFLAGS" | |
| 547 | TEMP_CXXFLAGS="\${RELEASE_CXXFLAGS} $TEMP_CXXFLAGS" | |
| 548 | fi | |
| 549 | ||
| 515 | 550 | # add general dependency flags to flags.mk |
| 551 | echo "# general flags" >> "$TEMP_DIR/flags.mk" | |
| 552 | if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then | |
| 553 | 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
|
554 | fi |
| 515 | 555 | if [ -n "${TEMP_CXXFLAGS}" ] && [ -n "$lang_cpp" ]; then |
| 556 | 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
|
557 | fi |
| 511 | 558 | if [ -n "${TEMP_LDFLAGS}" ]; then |
| 515 | 559 | echo "LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk" |
|
109
8a0a7754f123
experimental BSD support
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
94
diff
changeset
|
560 | fi |
|
8a0a7754f123
experimental BSD support
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
94
diff
changeset
|
561 | |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
562 | # |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
563 | # OPTION VALUES |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
564 | # |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
565 | |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
566 | # |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
567 | # TARGETS |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
568 | # |
| 515 | 569 | |
| 570 | echo >> "$TEMP_DIR/flags.mk" | |
| 571 | echo "configuring global target" | |
| 572 | echo "# flags for unnamed target" >> "$TEMP_DIR/flags.mk" | |
| 511 | 573 | TEMP_CFLAGS= |
| 574 | TEMP_CXXFLAGS= | |
| 575 | TEMP_LDFLAGS= | |
|
62
c47e081b6c0f
added keyfile based authentication
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
44
diff
changeset
|
576 | |
| 515 | 577 | if dependency_error_libxml2; then |
| 511 | 578 | DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED libxml2 " |
| 579 | ERROR=1 | |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
580 | fi |
| 515 | 581 | if dependency_error_openssl; then |
| 511 | 582 | DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED openssl " |
| 583 | ERROR=1 | |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
584 | fi |
|
41
bb7a1f5a8b48
added Linux support
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
40
diff
changeset
|
585 | |
|
250
f4d93355b054
update configure script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
210
diff
changeset
|
586 | # Features |
|
270
4cfaa02055cd
add first code for postgresql plugin: resourcepool type implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
267
diff
changeset
|
587 | |
|
4cfaa02055cd
add first code for postgresql plugin: resourcepool type implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
267
diff
changeset
|
588 | |
| 515 | 589 | if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then |
| 590 | echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" | |
| 591 | fi | |
| 592 | if [ -n "${TEMP_CXXFLAGS}" ] && [ -n "$lang_cpp" ]; then | |
| 593 | 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
|
594 | fi |
| 511 | 595 | if [ -n "${TEMP_LDFLAGS}" ]; then |
| 515 | 596 | 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
|
597 | fi |
|
4cfaa02055cd
add first code for postgresql plugin: resourcepool type implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
267
diff
changeset
|
598 | |
| 515 | 599 | echo >> "$TEMP_DIR/flags.mk" |
| 600 | echo "configuring target: postgresql" | |
| 601 | echo "# flags for target postgresql" >> "$TEMP_DIR/flags.mk" | |
| 511 | 602 | TEMP_CFLAGS= |
| 515 | 603 | TEMP_CXXFLAGS= |
| 511 | 604 | TEMP_LDFLAGS= |
|
270
4cfaa02055cd
add first code for postgresql plugin: resourcepool type implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
267
diff
changeset
|
605 | |
|
4cfaa02055cd
add first code for postgresql plugin: resourcepool type implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
267
diff
changeset
|
606 | |
|
4cfaa02055cd
add first code for postgresql plugin: resourcepool type implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
267
diff
changeset
|
607 | # Features |
| 511 | 608 | if [ -n "$FEATURE_POSTGRESQL" ]; then |
| 609 | # check dependency | |
| 515 | 610 | if dependency_error_libpq ; then |
| 511 | 611 | # "auto" features can fail and are just disabled in this case |
| 515 | 612 | if [ "$FEATURE_POSTGRESQL" = "auto" ]; then |
| 613 | DISABLE_FEATURE_POSTGRESQL=1 | |
| 614 | else | |
| 511 | 615 | DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED libpq " |
| 616 | ERROR=1 | |
| 617 | fi | |
| 618 | fi | |
| 515 | 619 | if [ -n "$DISABLE_FEATURE_POSTGRESQL" ]; then |
| 620 | unset FEATURE_POSTGRESQL | |
| 621 | fi | |
|
250
f4d93355b054
update configure script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
210
diff
changeset
|
622 | fi |
| 615 | 623 | if [ -n "$FEATURE_POSTGRESQL" ]; then |
| 624 | : | |
| 625 | else | |
| 626 | : | |
| 627 | fi | |
|
250
f4d93355b054
update configure script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
210
diff
changeset
|
628 | |
| 40 | 629 | |
| 515 | 630 | if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then |
| 631 | echo "POSTGRESQL_CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" | |
| 632 | fi | |
| 633 | if [ -n "${TEMP_CXXFLAGS}" ] && [ -n "$lang_cpp" ]; then | |
| 634 | 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
|
635 | fi |
| 511 | 636 | if [ -n "${TEMP_LDFLAGS}" ]; then |
| 515 | 637 | 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
|
638 | fi |
| 40 | 639 | |
| 515 | 640 | |
| 641 | # final result | |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
642 | if [ $ERROR -ne 0 ]; then |
| 511 | 643 | echo |
| 644 | echo "Error: Unresolved dependencies" | |
| 645 | echo "$DEPENDENCIES_FAILED" | |
| 515 | 646 | abort_configure |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
647 | fi |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
648 | |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
649 | echo "configure finished" |
|
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
650 | echo |
| 615 | 651 | echo "Toolchain" |
| 652 | echo " name: $TOOLCHAIN_NAME" | |
| 653 | if [ -n "$TOOLCHAIN_CC" ]; then | |
| 654 | echo " cc: $TOOLCHAIN_CC" | |
| 655 | fi | |
| 656 | if [ -n "$TOOLCHAIN_CXX" ]; then | |
| 657 | echo " cxx: $TOOLCHAIN_CXX" | |
| 658 | fi | |
| 659 | if [ -n "$TOOLCHAIN_WSIZE" ]; then | |
| 660 | echo " word size: $TOOLCHAIN_WSIZE bit" | |
| 661 | fi | |
| 662 | if [ -n "$TOOLCHAIN_CSTD" ]; then | |
| 663 | echo " default C std: $TOOLCHAIN_CSTD" | |
| 664 | fi | |
| 665 | echo | |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
666 | echo "Build Config:" |
| 615 | 667 | echo " prefix: $prefix" |
| 668 | echo " exec_prefix: $exec_prefix" | |
| 669 | if [ "$orig_bindir" != "$bindir" ]; then | |
| 670 | echo " bindir: $bindir" | |
| 671 | fi | |
| 672 | if [ "$orig_sbindir" != "$sbindir" ]; then | |
| 673 | echo " sbindir: $sbindir" | |
| 674 | fi | |
| 675 | if [ "$orig_libdir" != "$libdir" ]; then | |
| 676 | echo " libdir: $libdir" | |
| 677 | fi | |
| 678 | if [ "$orig_libexecdir" != "$libexecdir" ]; then | |
| 679 | echo " libexecdir: $libexecdir" | |
| 680 | fi | |
| 681 | if [ "$orig_datarootdir" != "$datarootdir" ]; then | |
| 682 | echo " datarootdir: $datarootdir" | |
| 683 | fi | |
| 684 | if [ "$orig_datadir" != "$datadir" ]; then | |
| 685 | echo " datadir: $datadir" | |
| 686 | fi | |
| 687 | if [ "$orig_sysconfdir" != "$sysconfdir" ]; then | |
| 688 | echo " sysconfdir: $sysconfdir" | |
| 689 | fi | |
| 690 | if [ "$orig_sharedstatedir" != "$sharedstatedir" ]; then | |
| 691 | echo " sharedstatedir: $sharedstatedir" | |
| 692 | fi | |
| 693 | if [ "$orig_localstatedir" != "$localstatedir" ]; then | |
| 694 | echo " localstatedir: $localstatedir" | |
| 695 | fi | |
| 696 | if [ "$orig_runstatedir" != "$runstatedir" ]; then | |
| 697 | echo " runstatedir: $runstatedir" | |
| 698 | fi | |
| 699 | if [ "$orig_includedir" != "$includedir" ]; then | |
| 700 | echo " includedir: $includedir" | |
| 701 | fi | |
| 702 | if [ "$orig_infodir" != "$infodir" ]; then | |
| 703 | echo " infodir: $infodir" | |
| 704 | fi | |
| 705 | if [ "$orig_mandir" != "$mandir" ]; then | |
| 706 | echo " mandir: $mandir" | |
| 707 | fi | |
| 708 | if [ "$orig_localedir" != "$localedir" ]; then | |
| 709 | echo " localedir: $localedir" | |
| 710 | fi | |
| 711 | echo | |
| 515 | 712 | echo "Features:" |
| 713 | if [ -n "$FEATURE_POSTGRESQL" ]; then | |
| 714 | echo " postgresql: on" | |
| 715 | else | |
| 716 | echo " postgresql: off" | |
| 717 | fi | |
|
204
e870a7c8f223
replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
109
diff
changeset
|
718 | echo |
| 515 | 719 | |
| 720 | # generate the config.mk file | |
| 615 | 721 | pwd=`pwd` |
| 515 | 722 | cat > "$TEMP_DIR/config.mk" << __EOF__ |
| 723 | # | |
| 615 | 724 | # config.mk generated by: |
| 725 | # pwd: $pwd | |
| 726 | # $0 $@ | |
| 515 | 727 | # |
| 728 | ||
| 729 | __EOF__ | |
| 730 | write_toolchain_defaults "$TEMP_DIR/toolchain.mk" | |
| 615 | 731 | cat "$TEMP_DIR/config.mk" "$TEMP_DIR/vars.mk" "$TEMP_DIR/toolchain.mk" "$TEMP_DIR/flags.mk" "$TEMP_DIR/make.mk" > config.mk |
| 511 | 732 | rm -Rf "$TEMP_DIR" |