make/configure.vm

Sun, 30 Nov 2025 15:50:36 +0100

author
Mike Becker <universe@uap-core.de>
date
Sun, 30 Nov 2025 15:50:36 +0100
changeset 1534
38d3f40a50ec
parent 1526
047f8a19f7fa
permissions
-rw-r--r--

instead of including stdalign.h, check if the macro is defined (Solaris does not have the header)

753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
1 #!/bin/sh
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
2
960
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
3 #set( $D = '$' )
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
4 #[[
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
5 # some utility functions
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
6 isplatform()
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
7 {
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
8 for p in $PLATFORM
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
9 do
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
10 if [ "$p" = "$1" ]; then
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
11 return 0
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
12 fi
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
13 done
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
14 return 1
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
15 }
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
16 notisplatform()
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
17 {
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
18 for p in $PLATFORM
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
19 do
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
20 if [ "$p" = "$1" ]; then
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
21 return 1
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
22 fi
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
23 done
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
24 return 0
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
25 }
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
26 istoolchain()
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
27 {
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
28 for t in $TOOLCHAIN
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
29 do
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
30 if [ "$t" = "$1" ]; then
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
31 return 0
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
32 fi
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
33 done
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
34 return 1
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
35 }
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
36 notistoolchain()
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
37 {
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
38 for t in $TOOLCHAIN
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
39 do
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
40 if [ "$t" = "$1" ]; then
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
41 return 1
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
42 fi
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
43 done
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
44 return 0
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
45 }
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
46
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
47 # clean abort
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
48 abort_configure()
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
49 {
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
50 rm -Rf "$TEMP_DIR"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
51 exit 1
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
52 }
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
53
960
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
54 # Test for availability of pkg-config
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
55 PKG_CONFIG=`command -v pkg-config`
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
56 : ${PKG_CONFIG:="false"}
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
57
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
58 # Simple uname based platform detection
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
59 # $PLATFORM is used for platform dependent dependency selection
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
60 OS=`uname -s`
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
61 OS_VERSION=`uname -r`
1335
158eb29f0b27 update uwproj - adds libdir detection w/o config.site
Mike Becker <universe@uap-core.de>
parents: 1330
diff changeset
62 ARCH=`uname -m`
960
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
63 printf "detect platform... "
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
64 if [ "$OS" = "SunOS" ]; then
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
65 PLATFORM="solaris sunos unix svr4"
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
66 elif [ "$OS" = "Linux" ]; then
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
67 PLATFORM="linux unix"
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
68 elif [ "$OS" = "FreeBSD" ]; then
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
69 PLATFORM="freebsd bsd unix"
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
70 elif [ "$OS" = "OpenBSD" ]; then
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
71 PLATFORM="openbsd bsd unix"
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
72 elif [ "$OS" = "NetBSD" ]; then
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
73 PLATFORM="netbsd bsd unix"
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
74 elif [ "$OS" = "Darwin" ]; then
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
75 PLATFORM="macos osx bsd unix"
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
76 elif echo "$OS" | grep -i "MINGW" > /dev/null; then
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
77 PLATFORM="windows mingw"
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
78 fi
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
79 : ${PLATFORM:="unix"}
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
80
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
81 PLATFORM_NAME=`echo "$PLATFORM" | cut -f1 -d' ' -`
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
82 echo "$PLATFORM_NAME"
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
83 ]]#
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
84
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
85 # help text
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
86 printhelp()
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
87 {
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
88 echo "Usage: $0 [OPTIONS]..."
1523
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
89 echo 'Configuration:'
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
90 #foreach( $cfg in $config )
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
91 if true \
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
92 #if( $cfg.platform )
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
93 && isplatform "${cfg.platform}" \
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
94 #end
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
95 #foreach( $np in $cfg.notList )
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
96 && notisplatform "${np}" \
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
97 #end
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
98 ; then
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
99 :
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
100 #foreach( $var in $cfg.vars )
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
101 #if( $var.overridable )
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
102 if test -z "${D}${var.varName}__described__"; then
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
103 ${var.varName}__described__=1
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
104 cat << '__EOF__'
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
105 ${var.helpText}
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
106 __EOF__
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
107 fi
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
108 #end
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
109 #end
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
110 fi
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
111 #end
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
112 cat << '__EOF__'
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
113
1017
b0098854071f add check for C23 compatibility
Mike Becker <universe@uap-core.de>
parents: 987
diff changeset
114 Build Types:
1310
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 1017
diff changeset
115 --debug add extra compile flags for debug builds
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 1017
diff changeset
116 --release add extra compile flags for release builds
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
117 #if( $options.size() > 0 )
1017
b0098854071f add check for C23 compatibility
Mike Becker <universe@uap-core.de>
parents: 987
diff changeset
118
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
119 Options:
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
120 #foreach( $opt in $options )
1492
cc83ce484bf7 update uwproj
Mike Becker <universe@uap-core.de>
parents: 1413
diff changeset
121 ${opt.helpText}
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
122 #end
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
123 #end
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
124 #if( $features.size() > 0 )
1017
b0098854071f add check for C23 compatibility
Mike Becker <universe@uap-core.de>
parents: 987
diff changeset
125
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
126 Optional Features:
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
127 #foreach( $feature in $features )
815
b0c4750cecd8 update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents: 796
diff changeset
128 ${feature.helpText}
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
129 #end
1017
b0098854071f add check for C23 compatibility
Mike Becker <universe@uap-core.de>
parents: 987
diff changeset
130 #end
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
131
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
132 __EOF__
1523
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
133 abort_configure
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
134 }
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
135
960
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
136 # create temporary directory
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
137 TEMP_DIR=".tmp-`uname -n`"
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
138 rm -Rf "$TEMP_DIR"
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
139 if mkdir -p "$TEMP_DIR"; then
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
140 :
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
141 else
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
142 echo "Cannot create tmp dir $TEMP_DIR"
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
143 echo "Abort"
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
144 exit 1
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
145 fi
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
146 touch "$TEMP_DIR/options"
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
147 touch "$TEMP_DIR/features"
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
148
1523
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
149 # config variables
960
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
150 #foreach( $cfg in $config )
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
151 if true \
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
152 #if( $cfg.platform )
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
153 && isplatform "${cfg.platform}" \
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
154 #end
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
155 #foreach( $np in $cfg.notList )
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
156 && notisplatform "${np}" \
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
157 #end
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
158 ; then
1523
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
159 :
960
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
160 #foreach( $var in $cfg.vars )
1523
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
161 if test -z "${D}${var.varName}__initialized__"; then
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
162 ${var.varName}__initialized__=1
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
163 #if( $var.exec )
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
164 ${var.varName}=`${var.value}`
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
165 #else
1526
047f8a19f7fa add command line option for pkgconfigdir
Mike Becker <universe@uap-core.de>
parents: 1523
diff changeset
166 ${var.varName}='${var.value}'
1523
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
167 #end
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
168 fi
960
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
169 #end
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
170 fi
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
171 #end
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
172
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
173 # features
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
174 #foreach( $feature in $features )
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
175 #if( ${feature.auto} )
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
176 ${feature.varName}=auto
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
177 #end
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
178 #end
a8a5f3dd5c3d test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents: 821
diff changeset
179
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
180 #
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
181 # parse arguments
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
182 #
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
183 BUILD_TYPE="default"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
184 for ARG in "$@"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
185 do
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
186 case "$ARG" in
1523
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
187 #foreach( $var in $vars )
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
188 #if ($var.overridable)
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
189 "--${var.arg}="*) ${var.varName}=${D}{ARG#--${var.arg}=} ;;
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
190 #end
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
191 #end
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
192 "--help"*) printhelp ;;
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
193 "--debug") BUILD_TYPE="debug" ;;
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
194 "--release") BUILD_TYPE="release" ;;
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
195 #foreach( $opt in $options )
1492
cc83ce484bf7 update uwproj
Mike Becker <universe@uap-core.de>
parents: 1413
diff changeset
196 "--${opt.arg}="*) ${opt.varName}=${D}{ARG#--${opt.arg}=} ;;
1523
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
197 "--${opt.arg}") echo "option '$ARG' needs a value:"; echo " $ARG=${opt.valuesString}"; abort_configure ;;
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
198 #end
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
199 #foreach( $feature in $features )
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
200 "--enable-${feature.arg}") ${feature.varName}=on ;;
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
201 "--disable-${feature.arg}") unset ${feature.varName} ;;
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
202 #end
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
203 "-"*) echo "unknown option: $ARG"; abort_configure ;;
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
204 esac
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
205 done
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
206
1523
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
207 # toolchain detection utilities
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
208 . make/toolchain.sh
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
209
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
210 # check languages
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
211 lang_c=
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
212 lang_cpp=
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
213 #foreach( $lang in $languages )
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
214 if detect_${lang}_compiler ; then
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
215 lang_${lang}=1
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
216 fi
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
217 #end
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
218
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
219 ## Begin unparsed content. **
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
220 #[[
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
221
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
222 # set defaults for dir variables
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
223 : ${exec_prefix:="$prefix"}
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
224 : ${bindir:='${exec_prefix}/bin'}
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
225 : ${sbindir:='${exec_prefix}/sbin'}
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
226 : ${libdir:='${exec_prefix}/lib'}
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
227 : ${libexecdir:='${exec_prefix}/libexec'}
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
228 : ${datarootdir:='${prefix}/share'}
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
229 : ${datadir:='${datarootdir}'}
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
230 : ${sharedstatedir:='${prefix}/com'}
1492
cc83ce484bf7 update uwproj
Mike Becker <universe@uap-core.de>
parents: 1413
diff changeset
231 if [ -z "$sysconfdir" ]; then
cc83ce484bf7 update uwproj
Mike Becker <universe@uap-core.de>
parents: 1413
diff changeset
232 if [ "$prefix" = '/usr' ]; then
cc83ce484bf7 update uwproj
Mike Becker <universe@uap-core.de>
parents: 1413
diff changeset
233 sysconfdir='/etc'
cc83ce484bf7 update uwproj
Mike Becker <universe@uap-core.de>
parents: 1413
diff changeset
234 else
cc83ce484bf7 update uwproj
Mike Becker <universe@uap-core.de>
parents: 1413
diff changeset
235 sysconfdir='${prefix}/etc'
cc83ce484bf7 update uwproj
Mike Becker <universe@uap-core.de>
parents: 1413
diff changeset
236 fi
cc83ce484bf7 update uwproj
Mike Becker <universe@uap-core.de>
parents: 1413
diff changeset
237 fi
cc83ce484bf7 update uwproj
Mike Becker <universe@uap-core.de>
parents: 1413
diff changeset
238 if [ -z "$localstatedir" ]; then
cc83ce484bf7 update uwproj
Mike Becker <universe@uap-core.de>
parents: 1413
diff changeset
239 if [ "$prefix" = '/usr' ]; then
cc83ce484bf7 update uwproj
Mike Becker <universe@uap-core.de>
parents: 1413
diff changeset
240 localstatedir='/var'
cc83ce484bf7 update uwproj
Mike Becker <universe@uap-core.de>
parents: 1413
diff changeset
241 else
cc83ce484bf7 update uwproj
Mike Becker <universe@uap-core.de>
parents: 1413
diff changeset
242 localstatedir='${prefix}/var'
cc83ce484bf7 update uwproj
Mike Becker <universe@uap-core.de>
parents: 1413
diff changeset
243 fi
cc83ce484bf7 update uwproj
Mike Becker <universe@uap-core.de>
parents: 1413
diff changeset
244 fi
cc83ce484bf7 update uwproj
Mike Becker <universe@uap-core.de>
parents: 1413
diff changeset
245 if [ -z "$runstatedir" ]; then
cc83ce484bf7 update uwproj
Mike Becker <universe@uap-core.de>
parents: 1413
diff changeset
246 if [ "$prefix" = '/usr' ]; then
cc83ce484bf7 update uwproj
Mike Becker <universe@uap-core.de>
parents: 1413
diff changeset
247 runstatedir='/var/run'
cc83ce484bf7 update uwproj
Mike Becker <universe@uap-core.de>
parents: 1413
diff changeset
248 else
cc83ce484bf7 update uwproj
Mike Becker <universe@uap-core.de>
parents: 1413
diff changeset
249 runstatedir='${prefix}/var'
cc83ce484bf7 update uwproj
Mike Becker <universe@uap-core.de>
parents: 1413
diff changeset
250 fi
cc83ce484bf7 update uwproj
Mike Becker <universe@uap-core.de>
parents: 1413
diff changeset
251 fi
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
252 : ${includedir:='${prefix}/include'}
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
253 : ${infodir:='${datarootdir}/info'}
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
254 : ${mandir:='${datarootdir}/man'}
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
255 : ${localedir:='${datarootdir}/locale'}
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
256
1310
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 1017
diff changeset
257
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
258 # check if a config.site exists and load it
1523
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
259 CONFIG_SITE_OK=0
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
260 if [ -n "$CONFIG_SITE" ]; then
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
261 # CONFIG_SITE may contain space separated file names
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
262 for cs in $CONFIG_SITE; do
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
263 printf "loading defaults from $cs... "
1523
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
264 if [ -f "$cs" ]; then
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
265 . "$cs"
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
266 echo ok
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
267 CONFIG_SITE_OK=1
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
268 break
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
269 else
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
270 echo "not found"
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
271 fi
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
272 done
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
273 elif [ -f "$prefix/share/config.site" ]; then
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
274 printf "loading site defaults... "
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
275 . "$prefix/share/config.site"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
276 echo ok
1523
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
277 CONFIG_SITE_OK=1
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
278 elif [ -f "$prefix/etc/config.site" ]; then
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
279 printf "loading site defaults... "
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
280 . "$prefix/etc/config.site"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
281 echo ok
1523
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
282 CONFIG_SITE_OK=1
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
283 fi
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
284
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
285 if [ $CONFIG_SITE_OK -eq 0 ]; then
1335
158eb29f0b27 update uwproj - adds libdir detection w/o config.site
Mike Becker <universe@uap-core.de>
parents: 1330
diff changeset
286 # try to detect the correct libdir on our own, except it was changed by the user
1523
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
287 if [ "$libdir" = '${exec_prefix}/lib' ] ; then
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
288 if [ "$TOOLCHAIN_WSIZE" = "64" ] ; then
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
289 if [ "$OS" = "SunOS" ]; then
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
290 [ -d "${exec_prefix}/lib/64" ] && libdir='${exec_prefix}/lib/64'
1335
158eb29f0b27 update uwproj - adds libdir detection w/o config.site
Mike Becker <universe@uap-core.de>
parents: 1330
diff changeset
291 else
1523
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
292 [ -d "${exec_prefix}/lib64" ] && libdir='${exec_prefix}/lib64'
1335
158eb29f0b27 update uwproj - adds libdir detection w/o config.site
Mike Becker <universe@uap-core.de>
parents: 1330
diff changeset
293 fi
1523
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
294 elif [ "$TOOLCHAIN_WSIZE" = "32" ] ; then
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
295 if [ "$OS" = "SunOS" ]; then
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
296 [ -d "${exec_prefix}/lib/32" ] && libdir='${exec_prefix}/lib/32'
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
297 else
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
298 [ -d "${exec_prefix}/lib32" ] && libdir='${exec_prefix}/lib32'
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
299 fi
1335
158eb29f0b27 update uwproj - adds libdir detection w/o config.site
Mike Becker <universe@uap-core.de>
parents: 1330
diff changeset
300 fi
158eb29f0b27 update uwproj - adds libdir detection w/o config.site
Mike Becker <universe@uap-core.de>
parents: 1330
diff changeset
301 fi
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
302 fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
303 ]]#
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
304 ## End of unparsed content **
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
305
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
306 # generate vars.mk
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
307 cat > "$TEMP_DIR/vars.mk" << __EOF__
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
308 #foreach( $var in $vars )
821
5e6f15005efd update uwproj configure template
Mike Becker <universe@uap-core.de>
parents: 815
diff changeset
309 ${var.varName}=${D}${var.varName}
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
310 #end
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
311 __EOF__
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
312
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
313
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
314 #
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
315 # DEPENDENCIES
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
316 #
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
317
1523
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
318
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
319
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
320 # create buffer for make variables required by dependencies
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
321 echo > "$TEMP_DIR/make.mk"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
322
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
323 test_pkg_config()
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
324 {
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
325 if "$PKG_CONFIG" --exists "$1" ; then :
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
326 else return 1 ; fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
327 if [ -z "$2" ] || "$PKG_CONFIG" --atleast-version="$2" "$1" ; then :
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
328 else return 1 ; fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
329 if [ -z "$3" ] || "$PKG_CONFIG" --exact-version="$3" "$1" ; then :
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
330 else return 1 ; fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
331 if [ -z "$4" ] || "$PKG_CONFIG" --max-version="$4" "$1" ; then :
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
332 else return 1 ; fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
333 return 0
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
334 }
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
335
796
fec90b848f4b update uwproj configure template
Mike Becker <universe@uap-core.de>
parents: 753
diff changeset
336 print_check_msg()
fec90b848f4b update uwproj configure template
Mike Becker <universe@uap-core.de>
parents: 753
diff changeset
337 {
fec90b848f4b update uwproj configure template
Mike Becker <universe@uap-core.de>
parents: 753
diff changeset
338 if [ -z "$1" ]; then
fec90b848f4b update uwproj configure template
Mike Becker <universe@uap-core.de>
parents: 753
diff changeset
339 shift
fec90b848f4b update uwproj configure template
Mike Becker <universe@uap-core.de>
parents: 753
diff changeset
340 printf "$@"
fec90b848f4b update uwproj configure template
Mike Becker <universe@uap-core.de>
parents: 753
diff changeset
341 fi
fec90b848f4b update uwproj configure template
Mike Becker <universe@uap-core.de>
parents: 753
diff changeset
342 }
fec90b848f4b update uwproj configure template
Mike Becker <universe@uap-core.de>
parents: 753
diff changeset
343
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
344 #foreach( $dependency in $namedDependencies )
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
345 dependency_error_${dependency.id}()
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
346 {
796
fec90b848f4b update uwproj configure template
Mike Becker <universe@uap-core.de>
parents: 753
diff changeset
347 print_check_msg "${D}dep_checked_${dependency.id}" "checking for ${dependency.name}... "
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
348 #foreach( $sub in $dependency.subdependencies )
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
349 # dependency $sub.fullName
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
350 while true
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
351 do
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
352 #if( $sub.platform )
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
353 if notisplatform "${sub.platform}"; then
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
354 break
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
355 fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
356 #end
815
b0c4750cecd8 update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents: 796
diff changeset
357 #if( $sub.toolchain )
b0c4750cecd8 update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents: 796
diff changeset
358 if notistoolchain "${sub.toolchain}"; then
b0c4750cecd8 update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents: 796
diff changeset
359 break
b0c4750cecd8 update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents: 796
diff changeset
360 fi
b0c4750cecd8 update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents: 796
diff changeset
361 #end
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
362 #foreach( $np in $sub.notList )
815
b0c4750cecd8 update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents: 796
diff changeset
363 if isplatform "${np}" || istoolchain "${np}"; then
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
364 break
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
365 fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
366 #end
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
367 #foreach( $lang in $sub.lang )
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
368 if [ -z "$lang_${lang}" ] ; then
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
369 break
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
370 fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
371 #end
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
372 #if( $sub.pkgconfig.size() > 0 )
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
373 if [ -z "$PKG_CONFIG" ]; then
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
374 break
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
375 fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
376 #end
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
377 #foreach( $test in $sub.tests )
1413
c5a225d7228c improve feature test for memrchr() making it also available on BSD
Mike Becker <universe@uap-core.de>
parents: 1335
diff changeset
378 if $test > /dev/null 2>&1 ; then
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
379 :
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
380 else
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
381 break
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
382 fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
383 #end
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
384 #foreach( $pkg in $sub.pkgconfig )
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
385 if test_pkg_config "$pkg.name" "$pkg.atleast" "$pkg.exact" "$pkg.max" ; then
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
386 TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags $pkg.name`"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
387 TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs $pkg.name`"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
388 else
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
389 break
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
390 fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
391 #end
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
392 #foreach( $flags in $sub.flags )
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
393 #if( $flags.exec )
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
394 if tmp_flags=`$flags.value` ; then
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
395 TEMP_$flags.varName="$TEMP_$flags.varName $tmp_flags"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
396 else
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
397 break
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
398 fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
399 #else
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
400 TEMP_$flags.varName="$TEMP_$flags.varName $flags.value"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
401 #end
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
402 #end
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
403 #if ( $sub.make.length() > 0 )
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
404 cat >> $TEMP_DIR/make.mk << __EOF__
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
405 # Dependency: $dependency.name
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
406 $sub.make
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
407 __EOF__
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
408 #end
796
fec90b848f4b update uwproj configure template
Mike Becker <universe@uap-core.de>
parents: 753
diff changeset
409 print_check_msg "${D}dep_checked_${dependency.id}" "yes\n"
fec90b848f4b update uwproj configure template
Mike Becker <universe@uap-core.de>
parents: 753
diff changeset
410 dep_checked_${dependency.id}=1
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
411 return 1
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
412 done
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
413
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
414 #end
796
fec90b848f4b update uwproj configure template
Mike Becker <universe@uap-core.de>
parents: 753
diff changeset
415 print_check_msg "${D}dep_checked_${dependency.id}" "no\n"
fec90b848f4b update uwproj configure template
Mike Becker <universe@uap-core.de>
parents: 753
diff changeset
416 dep_checked_${dependency.id}=1
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
417 return 0
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
418 }
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
419 #end
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
420
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
421 # start collecting dependency information
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
422 echo > "$TEMP_DIR/flags.mk"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
423
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
424 DEPENDENCIES_FAILED=
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
425 ERROR=0
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
426 #if( $dependencies.size() > 0 )
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
427 # unnamed dependencies
1017
b0098854071f add check for C23 compatibility
Mike Becker <universe@uap-core.de>
parents: 987
diff changeset
428 TEMP_CFLAGS="$CFLAGS"
b0098854071f add check for C23 compatibility
Mike Becker <universe@uap-core.de>
parents: 987
diff changeset
429 TEMP_CXXFLAGS="$CXXFLAGS"
b0098854071f add check for C23 compatibility
Mike Becker <universe@uap-core.de>
parents: 987
diff changeset
430 TEMP_LDFLAGS="$LDFLAGS"
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
431 #foreach( $dependency in $dependencies )
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
432 while true
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
433 do
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
434 #if( $dependency.platform )
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
435 if notisplatform "${dependency.platform}"; then
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
436 break
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
437 fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
438 #end
815
b0c4750cecd8 update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents: 796
diff changeset
439 #if( $dependency.toolchain )
b0c4750cecd8 update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents: 796
diff changeset
440 if notistoolchain "${dependency.toolchain}"; then
b0c4750cecd8 update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents: 796
diff changeset
441 break
b0c4750cecd8 update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents: 796
diff changeset
442 fi
b0c4750cecd8 update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents: 796
diff changeset
443 #end
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
444 #foreach( $np in $dependency.notList )
815
b0c4750cecd8 update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents: 796
diff changeset
445 if isplatform "${np}" || istoolchain "${np}"; then
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
446 break
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
447 fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
448 #end
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
449 while true
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
450 do
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
451 #foreach( $lang in $dependency.lang )
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
452 if [ -z "$lang_${lang}" ] ; then
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
453 ERROR=1
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
454 break
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
455 fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
456 #end
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
457 #if( $dependency.pkgconfig.size() > 0 )
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
458 if [ -z "$PKG_CONFIG" ]; then
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
459 ERROR=1
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
460 break
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
461 fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
462 #end
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
463 #foreach( $pkg in $dependency.pkgconfig )
796
fec90b848f4b update uwproj configure template
Mike Becker <universe@uap-core.de>
parents: 753
diff changeset
464 print_check_msg "${D}dep_pkgconfig_checked_${pkg.id}" "checking for pkg-config package $pkg.name... "
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
465 if test_pkg_config "$pkg.name" "$pkg.atleast" "$pkg.exact" "$pkg.max" ; then
796
fec90b848f4b update uwproj configure template
Mike Becker <universe@uap-core.de>
parents: 753
diff changeset
466 print_check_msg "${D}dep_pkgconfig_checked_${pkg.id}" "yes\n"
fec90b848f4b update uwproj configure template
Mike Becker <universe@uap-core.de>
parents: 753
diff changeset
467 dep_pkgconfig_checked_${pkg.id}=1
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
468 TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags $pkg.name`"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
469 TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs $pkg.name`"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
470 else
796
fec90b848f4b update uwproj configure template
Mike Becker <universe@uap-core.de>
parents: 753
diff changeset
471 print_check_msg "${D}dep_pkgconfig_checked_${pkg.id}" "no\n"
fec90b848f4b update uwproj configure template
Mike Becker <universe@uap-core.de>
parents: 753
diff changeset
472 dep_pkgconfig_checked_${pkg.id}=1
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
473 ERROR=1
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
474 break
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
475 fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
476 #end
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
477
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
478 #foreach( $flags in $dependency.flags )
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
479 #if( $flags.exec )
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
480 if tmp_flags=`$flags.value` ; then
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
481 TEMP_$flags.varName="$TEMP_$flags.varName $tmp_flags"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
482 else
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
483 ERROR=1
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
484 break
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
485 fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
486 #else
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
487 TEMP_$flags.varName="$TEMP_$flags.varName $flags.value"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
488 #end
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
489 #end
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
490 #if ( $dependency.make.length() > 0 )
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
491 cat >> "$TEMP_DIR/make.mk" << __EOF__
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
492 $dependency.make
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
493 __EOF__
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
494 #end
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
495 break
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
496 done
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
497 break
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
498 done
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
499 #end
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
500
1310
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 1017
diff changeset
501 # build type
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 1017
diff changeset
502 if [ "$BUILD_TYPE" = "debug" ]; then
1330
caa66055b025 apply latest uwproj fixes
Mike Becker <universe@uap-core.de>
parents: 1310
diff changeset
503 TEMP_CFLAGS="\${DEBUG_CFLAGS} $TEMP_CFLAGS"
caa66055b025 apply latest uwproj fixes
Mike Becker <universe@uap-core.de>
parents: 1310
diff changeset
504 TEMP_CXXFLAGS="\${DEBUG_CXXFLAGS} $TEMP_CXXFLAGS"
1310
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 1017
diff changeset
505 fi
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 1017
diff changeset
506 if [ "$BUILD_TYPE" = "release" ]; then
1330
caa66055b025 apply latest uwproj fixes
Mike Becker <universe@uap-core.de>
parents: 1310
diff changeset
507 TEMP_CFLAGS="\${RELEASE_CFLAGS} $TEMP_CFLAGS"
caa66055b025 apply latest uwproj fixes
Mike Becker <universe@uap-core.de>
parents: 1310
diff changeset
508 TEMP_CXXFLAGS="\${RELEASE_CXXFLAGS} $TEMP_CXXFLAGS"
1310
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 1017
diff changeset
509 fi
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 1017
diff changeset
510
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
511 # add general dependency flags to flags.mk
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
512 echo "# general flags" >> "$TEMP_DIR/flags.mk"
815
b0c4750cecd8 update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents: 796
diff changeset
513 if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
514 echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
515 fi
815
b0c4750cecd8 update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents: 796
diff changeset
516 if [ -n "${TEMP_CXXFLAGS}" ] && [ -n "$lang_cpp" ]; then
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
517 echo "CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
518 fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
519 if [ -n "${TEMP_LDFLAGS}" ]; then
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
520 echo "LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
521 fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
522 #end
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
523
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
524 #
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
525 # OPTION VALUES
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
526 #
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
527 #foreach( $opt in $options )
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
528 #foreach( $val in $opt.values )
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
529 ${val.func}()
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
530 {
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
531 VERR=0
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
532 #foreach( $dep in $val.dependencies )
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
533 if dependency_error_$dep ; then
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
534 VERR=1
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
535 fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
536 #end
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
537 if [ $VERR -ne 0 ]; then
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
538 return 1
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
539 fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
540 #foreach( $def in $val.defines )
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
541 TEMP_CFLAGS="$TEMP_CFLAGS ${def.toFlags()}"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
542 TEMP_CXXFLAGS="$TEMP_CXXFLAGS ${def.toFlags()}"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
543 #end
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
544 #if( $val.hasMake() )
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
545 cat >> "$TEMP_DIR/make.mk" << __EOF__
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
546 $val.make
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
547 __EOF__
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
548 #end
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
549 return 0
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
550 }
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
551 #end
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
552 #end
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
553
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
554 #
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
555 # TARGETS
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
556 #
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
557
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
558 #foreach( $target in $targets )
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
559 echo >> "$TEMP_DIR/flags.mk"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
560 #if ( $target.name )
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
561 echo "configuring target: $target.name"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
562 echo "# flags for target $target.name" >> "$TEMP_DIR/flags.mk"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
563 #else
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
564 echo "configuring global target"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
565 echo "# flags for unnamed target" >> "$TEMP_DIR/flags.mk"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
566 #end
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
567 TEMP_CFLAGS=
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
568 TEMP_CXXFLAGS=
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
569 TEMP_LDFLAGS=
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
570
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
571 #foreach( $dependency in $target.dependencies )
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
572 if dependency_error_$dependency; then
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
573 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED ${dependency} "
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
574 ERROR=1
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
575 fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
576 #end
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
577
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
578 # Features
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
579 #foreach( $feature in $target.features )
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
580 if [ -n "${D}${feature.varName}" ]; then
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
581 #foreach( $dependency in $feature.dependencies )
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
582 # check dependency
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
583 if dependency_error_$dependency ; then
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
584 # "auto" features can fail and are just disabled in this case
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
585 if [ "${D}${feature.varName}" = "auto" ]; then
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
586 DISABLE_${feature.varName}=1
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
587 else
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
588 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED ${dependency} "
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
589 ERROR=1
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
590 fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
591 fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
592 #end
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
593 if [ -n "$DISABLE_${feature.varName}" ]; then
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
594 unset ${feature.varName}
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
595 fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
596 fi
987
53e22f112b11 add configure option for szmul
Mike Becker <universe@uap-core.de>
parents: 960
diff changeset
597 if [ -n "${D}${feature.varName}" ]; then
53e22f112b11 add configure option for szmul
Mike Becker <universe@uap-core.de>
parents: 960
diff changeset
598 :
53e22f112b11 add configure option for szmul
Mike Becker <universe@uap-core.de>
parents: 960
diff changeset
599 #foreach( $def in $feature.defines )
53e22f112b11 add configure option for szmul
Mike Becker <universe@uap-core.de>
parents: 960
diff changeset
600 TEMP_CFLAGS="$TEMP_CFLAGS ${def.toFlags()}"
53e22f112b11 add configure option for szmul
Mike Becker <universe@uap-core.de>
parents: 960
diff changeset
601 TEMP_CXXFLAGS="$TEMP_CXXFLAGS ${def.toFlags()}"
53e22f112b11 add configure option for szmul
Mike Becker <universe@uap-core.de>
parents: 960
diff changeset
602 #end
53e22f112b11 add configure option for szmul
Mike Becker <universe@uap-core.de>
parents: 960
diff changeset
603 #if( $feature.hasMake() )
53e22f112b11 add configure option for szmul
Mike Becker <universe@uap-core.de>
parents: 960
diff changeset
604 cat >> "$TEMP_DIR/make.mk" << __EOF__
53e22f112b11 add configure option for szmul
Mike Becker <universe@uap-core.de>
parents: 960
diff changeset
605 $feature.make
53e22f112b11 add configure option for szmul
Mike Becker <universe@uap-core.de>
parents: 960
diff changeset
606 __EOF__
53e22f112b11 add configure option for szmul
Mike Becker <universe@uap-core.de>
parents: 960
diff changeset
607 #end
53e22f112b11 add configure option for szmul
Mike Becker <universe@uap-core.de>
parents: 960
diff changeset
608 else
53e22f112b11 add configure option for szmul
Mike Becker <universe@uap-core.de>
parents: 960
diff changeset
609 :
53e22f112b11 add configure option for szmul
Mike Becker <universe@uap-core.de>
parents: 960
diff changeset
610 #foreach( $def in $feature.disabled.defines )
53e22f112b11 add configure option for szmul
Mike Becker <universe@uap-core.de>
parents: 960
diff changeset
611 TEMP_CFLAGS="$TEMP_CFLAGS ${def.toFlags()}"
53e22f112b11 add configure option for szmul
Mike Becker <universe@uap-core.de>
parents: 960
diff changeset
612 TEMP_CXXFLAGS="$TEMP_CXXFLAGS ${def.toFlags()}"
53e22f112b11 add configure option for szmul
Mike Becker <universe@uap-core.de>
parents: 960
diff changeset
613 #end
53e22f112b11 add configure option for szmul
Mike Becker <universe@uap-core.de>
parents: 960
diff changeset
614 #if( $feature.disabled.hasMake() )
53e22f112b11 add configure option for szmul
Mike Becker <universe@uap-core.de>
parents: 960
diff changeset
615 cat >> "$TEMP_DIR/make.mk" << __EOF__
53e22f112b11 add configure option for szmul
Mike Becker <universe@uap-core.de>
parents: 960
diff changeset
616 $feature.disabled.make
53e22f112b11 add configure option for szmul
Mike Becker <universe@uap-core.de>
parents: 960
diff changeset
617 __EOF__
53e22f112b11 add configure option for szmul
Mike Becker <universe@uap-core.de>
parents: 960
diff changeset
618 #end
53e22f112b11 add configure option for szmul
Mike Becker <universe@uap-core.de>
parents: 960
diff changeset
619 #foreach( $dependency in $feature.disabled.dependencies )
53e22f112b11 add configure option for szmul
Mike Becker <universe@uap-core.de>
parents: 960
diff changeset
620 if dependency_error_$dependency ; then
53e22f112b11 add configure option for szmul
Mike Becker <universe@uap-core.de>
parents: 960
diff changeset
621 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED ${dependency} "
53e22f112b11 add configure option for szmul
Mike Becker <universe@uap-core.de>
parents: 960
diff changeset
622 ERROR=1
53e22f112b11 add configure option for szmul
Mike Becker <universe@uap-core.de>
parents: 960
diff changeset
623 fi
53e22f112b11 add configure option for szmul
Mike Becker <universe@uap-core.de>
parents: 960
diff changeset
624 #end
53e22f112b11 add configure option for szmul
Mike Becker <universe@uap-core.de>
parents: 960
diff changeset
625 fi
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
626 #end
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
627
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
628 #foreach( $opt in $target.options )
1492
cc83ce484bf7 update uwproj
Mike Becker <universe@uap-core.de>
parents: 1413
diff changeset
629 # Option: --${opt.arg}
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
630 if [ -z "${D}${opt.varName}" ]; then
1492
cc83ce484bf7 update uwproj
Mike Becker <universe@uap-core.de>
parents: 1413
diff changeset
631 echo "auto-detecting option '${opt.arg}'"
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
632 SAVED_ERROR="$ERROR"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
633 SAVED_DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
634 ERROR=1
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
635 while true
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
636 do
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
637 #foreach( $optdef in $opt.defaults )
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
638 #if( $optdef.platform )
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
639 if isplatform "$optdef.platform"; then
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
640 #end
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
641 if $optdef.func ; then
1492
cc83ce484bf7 update uwproj
Mike Becker <universe@uap-core.de>
parents: 1413
diff changeset
642 echo " ${opt.arg}: ${optdef.valueName}" >> "$TEMP_DIR/options"
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
643 ERROR=0
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
644 break
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
645 fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
646 #if( $optdef.platform )
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
647 fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
648 #end
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
649 #end
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
650 break
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
651 done
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
652 if [ $ERROR -ne 0 ]; then
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
653 SAVED_ERROR=1
1492
cc83ce484bf7 update uwproj
Mike Becker <universe@uap-core.de>
parents: 1413
diff changeset
654 SAVED_DEPENDENCIES_FAILED="option '${opt.arg}' $SAVED_DEPENDENCIES_FAILED"
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
655 fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
656 ERROR="$SAVED_ERROR"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
657 DEPENDENCIES_FAILED="$SAVED_DEPENDENCIES_FAILED"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
658 else
1492
cc83ce484bf7 update uwproj
Mike Becker <universe@uap-core.de>
parents: 1413
diff changeset
659 echo "checking option ${opt.arg} = ${D}${opt.varName}"
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
660 if false; then
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
661 false
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
662 #foreach( $optval in $opt.values )
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
663 elif [ "${D}${opt.varName}" = "${optval.value}" ]; then
1492
cc83ce484bf7 update uwproj
Mike Becker <universe@uap-core.de>
parents: 1413
diff changeset
664 echo " ${opt.arg}: ${D}${opt.varName}" >> $TEMP_DIR/options
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
665 if $optval.func ; then
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
666 :
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
667 else
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
668 ERROR=1
1492
cc83ce484bf7 update uwproj
Mike Becker <universe@uap-core.de>
parents: 1413
diff changeset
669 DEPENDENCIES_FAILED="option '${opt.arg}' $DEPENDENCIES_FAILED"
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
670 fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
671 #end
1017
b0098854071f add check for C23 compatibility
Mike Becker <universe@uap-core.de>
parents: 987
diff changeset
672 else
b0098854071f add check for C23 compatibility
Mike Becker <universe@uap-core.de>
parents: 987
diff changeset
673 echo
b0098854071f add check for C23 compatibility
Mike Becker <universe@uap-core.de>
parents: 987
diff changeset
674 echo "Invalid option value - usage:"
1492
cc83ce484bf7 update uwproj
Mike Becker <universe@uap-core.de>
parents: 1413
diff changeset
675 echo " --${opt.arg}=${opt.valuesString}"
1017
b0098854071f add check for C23 compatibility
Mike Becker <universe@uap-core.de>
parents: 987
diff changeset
676 abort_configure
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
677 fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
678 fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
679 #end
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
680
815
b0c4750cecd8 update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents: 796
diff changeset
681 if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
682 echo "${target.cFlags} += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
683 fi
815
b0c4750cecd8 update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents: 796
diff changeset
684 if [ -n "${TEMP_CXXFLAGS}" ] && [ -n "$lang_cpp" ]; then
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
685 echo "${target.cxxFlags} += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
686 fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
687 if [ -n "${TEMP_LDFLAGS}" ]; then
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
688 echo "${target.ldFlags} += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
689 fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
690
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
691 #end
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
692
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
693 # final result
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
694 if [ $ERROR -ne 0 ]; then
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
695 echo
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
696 echo "Error: Unresolved dependencies"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
697 echo "$DEPENDENCIES_FAILED"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
698 abort_configure
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
699 fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
700
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
701 echo "configure finished"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
702 echo
1523
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
703 echo "Toolchain:"
1310
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 1017
diff changeset
704 echo " name: $TOOLCHAIN_NAME"
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 1017
diff changeset
705 if [ -n "$TOOLCHAIN_CC" ]; then
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 1017
diff changeset
706 echo " cc: $TOOLCHAIN_CC"
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 1017
diff changeset
707 fi
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 1017
diff changeset
708 if [ -n "$TOOLCHAIN_CXX" ]; then
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 1017
diff changeset
709 echo " cxx: $TOOLCHAIN_CXX"
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 1017
diff changeset
710 fi
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 1017
diff changeset
711 if [ -n "$TOOLCHAIN_WSIZE" ]; then
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 1017
diff changeset
712 echo " word size: $TOOLCHAIN_WSIZE bit"
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 1017
diff changeset
713 fi
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 1017
diff changeset
714 if [ -n "$TOOLCHAIN_CSTD" ]; then
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 1017
diff changeset
715 echo " default C std: $TOOLCHAIN_CSTD"
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 1017
diff changeset
716 fi
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 1017
diff changeset
717 echo
1523
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
718 echo "Config:"
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
719 #foreach( $var in $vars )
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
720 #if ($var.overridable)
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
721 printf ' %-16s' '${var.arg}:'
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
722 echo "${D}${var.varName}"
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
723 #end
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
724 #end
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
725 #if ( $options.size() > 0 )
1310
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 1017
diff changeset
726 echo
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
727 echo "Options:"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
728 cat "$TEMP_DIR/options"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
729 #end
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
730 #if ( $features.size() > 0 )
1310
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 1017
diff changeset
731 echo
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
732 echo "Features:"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
733 #foreach( $feature in $features )
1523
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
734 printf ' %-16s' '$feature.name:'
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
735 if [ -n "${D}${feature.varName}" ]; then
1523
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
736 echo 'on'
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
737 else
1523
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
738 echo 'off'
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
739 fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
740 #end
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
741 #end
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
742 echo
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
743
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
744 # generate the config.mk file
1310
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 1017
diff changeset
745 pwd=`pwd`
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
746 cat > "$TEMP_DIR/config.mk" << __EOF__
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
747 #
1310
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 1017
diff changeset
748 # config.mk generated by:
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 1017
diff changeset
749 # pwd: $pwd
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 1017
diff changeset
750 # $0 $@
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
751 #
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
752
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
753 __EOF__
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
754 write_toolchain_defaults "$TEMP_DIR/toolchain.mk"
1310
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 1017
diff changeset
755 cat "$TEMP_DIR/config.mk" "$TEMP_DIR/vars.mk" "$TEMP_DIR/toolchain.mk" "$TEMP_DIR/flags.mk" "$TEMP_DIR/make.mk" > config.mk
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
756 rm -Rf "$TEMP_DIR"

mercurial