Tue, 26 Nov 2024 22:16:27 +0100
make names of destroy and free functions consistent - fixes #484
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` |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
62 | printf "detect platform... " |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
63 | if [ "$OS" = "SunOS" ]; then |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
64 | PLATFORM="solaris sunos unix svr4" |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
65 | elif [ "$OS" = "Linux" ]; then |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
66 | PLATFORM="linux unix" |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
67 | elif [ "$OS" = "FreeBSD" ]; then |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
68 | PLATFORM="freebsd bsd unix" |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
69 | elif [ "$OS" = "OpenBSD" ]; then |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
70 | PLATFORM="openbsd bsd unix" |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
71 | elif [ "$OS" = "NetBSD" ]; then |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
72 | PLATFORM="netbsd bsd unix" |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
73 | elif [ "$OS" = "Darwin" ]; then |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
74 | PLATFORM="macos osx bsd unix" |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
75 | 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
|
76 | PLATFORM="windows mingw" |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
77 | fi |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
78 | : ${PLATFORM:="unix"} |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
79 | |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
80 | 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
|
81 | echo "$PLATFORM_NAME" |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
82 | ]]# |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
83 | |
753
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
84 | # help text |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
85 | printhelp() |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
86 | { |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
87 | echo "Usage: $0 [OPTIONS]..." |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
88 | cat << __EOF__ |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
89 | Installation directories: |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
90 | --prefix=PREFIX path prefix for architecture-independent files |
960
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
91 | [${D}prefix] |
753
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
92 | --exec-prefix=EPREFIX path prefix for architecture-dependent files |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
93 | [PREFIX] |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
94 | |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
95 | --bindir=DIR user executables [EPREFIX/bin] |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
96 | --sbindir=DIR system admin executables [EPREFIX/sbin] |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
97 | --libexecdir=DIR program executables [EPREFIX/libexec] |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
98 | --sysconfdir=DIR system configuration files [PREFIX/etc] |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
99 | --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
100 | --localstatedir=DIR modifiable single-machine data [PREFIX/var] |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
101 | --runstatedir=DIR run-time variable data [LOCALSTATEDIR/run] |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
102 | --libdir=DIR object code libraries [EPREFIX/lib] |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
103 | --includedir=DIR C header files [PREFIX/include] |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
104 | --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
105 | --datadir=DIR read-only architecture-independent data [DATAROOTDIR] |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
106 | --infodir=DIR info documentation [DATAROOTDIR/info] |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
107 | --mandir=DIR man documentation [DATAROOTDIR/man] |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
108 | --localedir=DIR locale-dependent data [DATAROOTDIR/locale] |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
109 | |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
110 | #if( $options.size() > 0 ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
111 | Options: |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
112 | --debug add extra compile flags for debug builds |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
113 | --release add extra compile flags for release builds |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
114 | #foreach( $opt in $options ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
115 | --${opt.argument}=${opt.valuesString} |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
116 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
117 | |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
118 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
119 | #if( $features.size() > 0 ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
120 | Optional Features: |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
121 | #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
|
122 | ${feature.helpText} |
753
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 | |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
125 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
126 | __EOF__ |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
127 | } |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
128 | |
960
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
129 | # create temporary directory |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
130 | TEMP_DIR=".tmp-`uname -n`" |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
131 | rm -Rf "$TEMP_DIR" |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
132 | 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
|
133 | : |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
134 | else |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
135 | 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
|
136 | echo "Abort" |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
137 | exit 1 |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
138 | fi |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
139 | touch "$TEMP_DIR/options" |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
140 | touch "$TEMP_DIR/features" |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
141 | |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
142 | # define standard variables |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
143 | # also define standard prefix (this is where we will search for config.site) |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
144 | prefix=/usr |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
145 | exec_prefix= |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
146 | bindir= |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
147 | sbindir= |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
148 | libdir= |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
149 | libexecdir= |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
150 | datarootdir= |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
151 | datadir= |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
152 | sysconfdir= |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
153 | sharedstatedir= |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
154 | localstatedir= |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
155 | runstatedir= |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
156 | includedir= |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
157 | infodir= |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
158 | localedir= |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
159 | mandir= |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
160 | |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
161 | # custom variables |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
162 | #foreach( $cfg in $config ) |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
163 | if true \ |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
164 | #if( $cfg.platform ) |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
165 | && isplatform "${cfg.platform}" \ |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
166 | #end |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
167 | #foreach( $np in $cfg.notList ) |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
168 | && notisplatform "${np}" \ |
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 | ; then |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
171 | #foreach( $var in $cfg.vars ) |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
172 | #if( $var.exec ) |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
173 | ${var.varName}=`${var.value}` |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
174 | #else |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
175 | ${var.varName}="${var.value}" |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
176 | #end |
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 | fi |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
179 | #end |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
180 | |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
181 | # features |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
182 | #foreach( $feature in $features ) |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
183 | #if( ${feature.auto} ) |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
184 | ${feature.varName}=auto |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
185 | #end |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
186 | #end |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
187 | |
753
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
188 | # |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
189 | # parse arguments |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
190 | # |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
191 | BUILD_TYPE="default" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
192 | for ARG in "$@" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
193 | do |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
194 | case "$ARG" in |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
195 | "--prefix="*) prefix=${D}{ARG#--prefix=} ;; |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
196 | "--exec-prefix="*) exec_prefix=${D}{ARG#--exec-prefix=} ;; |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
197 | "--bindir="*) bindir=${D}{ARG#----bindir=} ;; |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
198 | "--sbindir="*) sbindir=${D}{ARG#--sbindir=} ;; |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
199 | "--libdir="*) libdir=${D}{ARG#--libdir=} ;; |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
200 | "--libexecdir="*) libexecdir=${D}{ARG#--libexecdir=} ;; |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
201 | "--datarootdir="*) datarootdir=${D}{ARG#--datarootdir=} ;; |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
202 | "--datadir="*) datadir=${D}{ARG#--datadir=} ;; |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
203 | "--sysconfdir="*) sysconfdir=${D}{ARG#--sysconfdir=} ;; |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
204 | "--sharedstatedir="*) sharedstatedir=${D}{ARG#--sharedstatedir=} ;; |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
205 | "--localstatedir="*) localstatedir=${D}{ARG#--localstatedir=} ;; |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
206 | "--includedir="*) includedir=${D}{ARG#--includedir=} ;; |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
207 | "--infodir="*) infodir=${D}{ARG#--infodir=} ;; |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
208 | "--mandir"*) mandir=${D}{ARG#--mandir} ;; |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
209 | "--localedir"*) localedir=${D}{ARG#--localedir} ;; |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
210 | "--help"*) printhelp; abort_configure ;; |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
211 | "--debug") BUILD_TYPE="debug" ;; |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
212 | "--release") BUILD_TYPE="release" ;; |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
213 | #foreach( $opt in $options ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
214 | "--${opt.argument}="*) ${opt.varName}=${D}{ARG#--${opt.argument}=} ;; |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
215 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
216 | #foreach( $feature in $features ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
217 | "--enable-${feature.arg}") ${feature.varName}=on ;; |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
218 | "--disable-${feature.arg}") unset ${feature.varName} ;; |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
219 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
220 | "-"*) echo "unknown option: $ARG"; abort_configure ;; |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
221 | esac |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
222 | done |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
223 | |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
224 | ## Begin unparsed content. ** |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
225 | #[[ |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
226 | |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
227 | # set defaults for dir variables |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
228 | : ${exec_prefix:="$prefix"} |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
229 | : ${bindir:='${exec_prefix}/bin'} |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
230 | : ${sbindir:='${exec_prefix}/sbin'} |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
231 | : ${libdir:='${exec_prefix}/lib'} |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
232 | : ${libexecdir:='${exec_prefix}/libexec'} |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
233 | : ${datarootdir:='${prefix}/share'} |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
234 | : ${datadir:='${datarootdir}'} |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
235 | : ${sysconfdir:='${prefix}/etc'} |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
236 | : ${sharedstatedir:='${prefix}/com'} |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
237 | : ${localstatedir:='${prefix}/var'} |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
238 | : ${runstatedir:='${localstatedir}/run'} |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
239 | : ${includedir:='${prefix}/include'} |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
240 | : ${infodir:='${datarootdir}/info'} |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
241 | : ${mandir:='${datarootdir}/man'} |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
242 | : ${localedir:='${datarootdir}/locale'} |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
243 | |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
244 | # check if a config.site exists and load it |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
245 | if [ -n "$CONFIG_SITE" ]; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
246 | # 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
|
247 | for cs in $CONFIG_SITE; do |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
248 | printf "loading defaults from $cs... " |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
249 | . "$cs" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
250 | echo ok |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
251 | done |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
252 | 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
|
253 | printf "loading site defaults... " |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
254 | . "$prefix/share/config.site" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
255 | echo ok |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
256 | 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
|
257 | printf "loading site defaults... " |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
258 | . "$prefix/etc/config.site" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
259 | echo ok |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
260 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
261 | ]]# |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
262 | ## End of unparsed content ** |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
263 | |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
264 | # generate vars.mk |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
265 | cat > "$TEMP_DIR/vars.mk" << __EOF__ |
821
5e6f15005efd
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
815
diff
changeset
|
266 | prefix=$prefix |
5e6f15005efd
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
815
diff
changeset
|
267 | exec_prefix=$exec_prefix |
5e6f15005efd
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
815
diff
changeset
|
268 | bindir=$bindir |
5e6f15005efd
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
815
diff
changeset
|
269 | sbindir=$sbindir |
5e6f15005efd
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
815
diff
changeset
|
270 | libdir=$libdir |
5e6f15005efd
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
815
diff
changeset
|
271 | libexecdir=$libexecdir |
5e6f15005efd
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
815
diff
changeset
|
272 | datarootdir=$datarootdir |
5e6f15005efd
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
815
diff
changeset
|
273 | datadir=$datadir |
5e6f15005efd
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
815
diff
changeset
|
274 | sysconfdir=$sysconfdir |
5e6f15005efd
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
815
diff
changeset
|
275 | sharedstatedir=$sharedstatedir |
5e6f15005efd
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
815
diff
changeset
|
276 | localstatedir=$localstatedir |
5e6f15005efd
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
815
diff
changeset
|
277 | runstatedir=$runstatedir |
5e6f15005efd
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
815
diff
changeset
|
278 | includedir=$includedir |
5e6f15005efd
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
815
diff
changeset
|
279 | infodir=$infodir |
5e6f15005efd
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
815
diff
changeset
|
280 | mandir=$mandir |
5e6f15005efd
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
815
diff
changeset
|
281 | localedir=$localedir |
753
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
282 | #foreach( $var in $vars ) |
821
5e6f15005efd
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
815
diff
changeset
|
283 | ${var.varName}=${D}${var.varName} |
753
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
284 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
285 | __EOF__ |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
286 | |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
287 | # toolchain detection utilities |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
288 | . make/toolchain.sh |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
289 | |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
290 | # |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
291 | # DEPENDENCIES |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
292 | # |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
293 | |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
294 | # check languages |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
295 | lang_c= |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
296 | lang_cpp= |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
297 | #foreach( $lang in $languages ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
298 | if detect_${lang}_compiler ; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
299 | lang_${lang}=1 |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
300 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
301 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
302 | |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
303 | # 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
|
304 | echo > "$TEMP_DIR/make.mk" |
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 | test_pkg_config() |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
307 | { |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
308 | if "$PKG_CONFIG" --exists "$1" ; then : |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
309 | else return 1 ; fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
310 | 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
|
311 | else return 1 ; fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
312 | 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
|
313 | else return 1 ; fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
314 | 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
|
315 | else return 1 ; fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
316 | return 0 |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
317 | } |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
318 | |
796
fec90b848f4b
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
753
diff
changeset
|
319 | print_check_msg() |
fec90b848f4b
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
753
diff
changeset
|
320 | { |
fec90b848f4b
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
753
diff
changeset
|
321 | if [ -z "$1" ]; then |
fec90b848f4b
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
753
diff
changeset
|
322 | shift |
fec90b848f4b
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
753
diff
changeset
|
323 | printf "$@" |
fec90b848f4b
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
753
diff
changeset
|
324 | fi |
fec90b848f4b
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
753
diff
changeset
|
325 | } |
fec90b848f4b
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
753
diff
changeset
|
326 | |
753
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
327 | #foreach( $dependency in $namedDependencies ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
328 | dependency_error_${dependency.id}() |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
329 | { |
796
fec90b848f4b
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
753
diff
changeset
|
330 | 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
|
331 | #foreach( $sub in $dependency.subdependencies ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
332 | # dependency $sub.fullName |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
333 | while true |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
334 | do |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
335 | #if( $sub.platform ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
336 | if notisplatform "${sub.platform}"; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
337 | break |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
338 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
339 | #end |
815
b0c4750cecd8
update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents:
796
diff
changeset
|
340 | #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
|
341 | 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
|
342 | break |
b0c4750cecd8
update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents:
796
diff
changeset
|
343 | fi |
b0c4750cecd8
update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents:
796
diff
changeset
|
344 | #end |
753
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
345 | #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
|
346 | 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
|
347 | break |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
348 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
349 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
350 | #foreach( $lang in $sub.lang ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
351 | if [ -z "$lang_${lang}" ] ; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
352 | break |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
353 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
354 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
355 | #if( $sub.pkgconfig.size() > 0 ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
356 | if [ -z "$PKG_CONFIG" ]; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
357 | break |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
358 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
359 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
360 | #foreach( $test in $sub.tests ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
361 | if $test > /dev/null ; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
362 | : |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
363 | else |
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( $pkg in $sub.pkgconfig ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
368 | 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
|
369 | 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
|
370 | 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
|
371 | else |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
372 | break |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
373 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
374 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
375 | #foreach( $flags in $sub.flags ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
376 | #if( $flags.exec ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
377 | if tmp_flags=`$flags.value` ; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
378 | 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
|
379 | else |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
380 | break |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
381 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
382 | #else |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
383 | 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
|
384 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
385 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
386 | #if ( $sub.make.length() > 0 ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
387 | cat >> $TEMP_DIR/make.mk << __EOF__ |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
388 | # Dependency: $dependency.name |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
389 | $sub.make |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
390 | __EOF__ |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
391 | #end |
796
fec90b848f4b
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
753
diff
changeset
|
392 | 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
|
393 | dep_checked_${dependency.id}=1 |
753
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
394 | return 1 |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
395 | done |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
396 | |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
397 | #end |
796
fec90b848f4b
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
753
diff
changeset
|
398 | 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
|
399 | dep_checked_${dependency.id}=1 |
753
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
400 | return 0 |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
401 | } |
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 | |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
404 | # start collecting dependency information |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
405 | echo > "$TEMP_DIR/flags.mk" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
406 | |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
407 | DEPENDENCIES_FAILED= |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
408 | ERROR=0 |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
409 | #if( $dependencies.size() > 0 ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
410 | # unnamed dependencies |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
411 | TEMP_CFLAGS= |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
412 | TEMP_CXXFLAGS= |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
413 | TEMP_LDFLAGS= |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
414 | #foreach( $dependency in $dependencies ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
415 | while true |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
416 | do |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
417 | #if( $dependency.platform ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
418 | if notisplatform "${dependency.platform}"; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
419 | break |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
420 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
421 | #end |
815
b0c4750cecd8
update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents:
796
diff
changeset
|
422 | #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
|
423 | 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
|
424 | break |
b0c4750cecd8
update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents:
796
diff
changeset
|
425 | fi |
b0c4750cecd8
update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents:
796
diff
changeset
|
426 | #end |
753
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
427 | #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
|
428 | 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
|
429 | break |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
430 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
431 | #end |
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 | #foreach( $lang in $dependency.lang ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
435 | if [ -z "$lang_${lang}" ] ; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
436 | ERROR=1 |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
437 | break |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
438 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
439 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
440 | #if( $dependency.pkgconfig.size() > 0 ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
441 | if [ -z "$PKG_CONFIG" ]; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
442 | ERROR=1 |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
443 | break |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
444 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
445 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
446 | #foreach( $pkg in $dependency.pkgconfig ) |
796
fec90b848f4b
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
753
diff
changeset
|
447 | 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
|
448 | 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
|
449 | 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
|
450 | 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
|
451 | 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
|
452 | 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
|
453 | else |
796
fec90b848f4b
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
753
diff
changeset
|
454 | 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
|
455 | 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
|
456 | ERROR=1 |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
457 | break |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
458 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
459 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
460 | |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
461 | #foreach( $flags in $dependency.flags ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
462 | #if( $flags.exec ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
463 | $flags.value > /dev/null |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
464 | if tmp_flags=`$flags.value` ; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
465 | 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
|
466 | else |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
467 | ERROR=1 |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
468 | break |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
469 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
470 | #else |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
471 | 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
|
472 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
473 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
474 | #if ( $dependency.make.length() > 0 ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
475 | cat >> "$TEMP_DIR/make.mk" << __EOF__ |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
476 | $dependency.make |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
477 | __EOF__ |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
478 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
479 | break |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
480 | done |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
481 | break |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
482 | done |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
483 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
484 | |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
485 | # 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
|
486 | 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
|
487 | 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
|
488 | 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
|
489 | fi |
815
b0c4750cecd8
update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents:
796
diff
changeset
|
490 | 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
|
491 | 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
|
492 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
493 | if [ -n "${TEMP_LDFLAGS}" ]; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
494 | 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
|
495 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
496 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
497 | |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
498 | # |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
499 | # OPTION VALUES |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
500 | # |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
501 | #foreach( $opt in $options ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
502 | #foreach( $val in $opt.values ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
503 | ${val.func}() |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
504 | { |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
505 | VERR=0 |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
506 | #foreach( $dep in $val.dependencies ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
507 | if dependency_error_$dep ; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
508 | VERR=1 |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
509 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
510 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
511 | if [ $VERR -ne 0 ]; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
512 | return 1 |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
513 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
514 | #foreach( $def in $val.defines ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
515 | TEMP_CFLAGS="$TEMP_CFLAGS ${def.toFlags()}" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
516 | TEMP_CXXFLAGS="$TEMP_CXXFLAGS ${def.toFlags()}" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
517 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
518 | #if( $val.hasMake() ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
519 | cat >> "$TEMP_DIR/make.mk" << __EOF__ |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
520 | $val.make |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
521 | __EOF__ |
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 | return 0 |
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 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
526 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
527 | |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
528 | # |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
529 | # TARGETS |
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 | |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
532 | #foreach( $target in $targets ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
533 | echo >> "$TEMP_DIR/flags.mk" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
534 | #if ( $target.name ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
535 | echo "configuring target: $target.name" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
536 | 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
|
537 | #else |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
538 | echo "configuring global target" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
539 | 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
|
540 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
541 | TEMP_CFLAGS= |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
542 | TEMP_CXXFLAGS= |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
543 | TEMP_LDFLAGS= |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
544 | |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
545 | #foreach( $dependency in $target.dependencies ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
546 | if dependency_error_$dependency; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
547 | DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED ${dependency} " |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
548 | ERROR=1 |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
549 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
550 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
551 | |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
552 | # Features |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
553 | #foreach( $feature in $target.features ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
554 | if [ -n "${D}${feature.varName}" ]; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
555 | #foreach( $dependency in $feature.dependencies ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
556 | # check dependency |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
557 | if dependency_error_$dependency ; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
558 | # "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
|
559 | if [ "${D}${feature.varName}" = "auto" ]; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
560 | DISABLE_${feature.varName}=1 |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
561 | else |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
562 | DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED ${dependency} " |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
563 | ERROR=1 |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
564 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
565 | fi |
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 | if [ -n "$DISABLE_${feature.varName}" ]; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
568 | unset ${feature.varName} |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
569 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
570 | fi |
987
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
571 | if [ -n "${D}${feature.varName}" ]; then |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
572 | : |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
573 | #foreach( $def in $feature.defines ) |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
574 | TEMP_CFLAGS="$TEMP_CFLAGS ${def.toFlags()}" |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
575 | TEMP_CXXFLAGS="$TEMP_CXXFLAGS ${def.toFlags()}" |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
576 | #end |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
577 | #if( $feature.hasMake() ) |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
578 | cat >> "$TEMP_DIR/make.mk" << __EOF__ |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
579 | $feature.make |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
580 | __EOF__ |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
581 | #end |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
582 | else |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
583 | : |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
584 | #foreach( $def in $feature.disabled.defines ) |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
585 | TEMP_CFLAGS="$TEMP_CFLAGS ${def.toFlags()}" |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
586 | TEMP_CXXFLAGS="$TEMP_CXXFLAGS ${def.toFlags()}" |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
587 | #end |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
588 | #if( $feature.disabled.hasMake() ) |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
589 | cat >> "$TEMP_DIR/make.mk" << __EOF__ |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
590 | $feature.disabled.make |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
591 | __EOF__ |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
592 | #end |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
593 | #foreach( $dependency in $feature.disabled.dependencies ) |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
594 | if dependency_error_$dependency ; then |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
595 | DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED ${dependency} " |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
596 | ERROR=1 |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
597 | fi |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
598 | #end |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
599 | fi |
753
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
600 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
601 | |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
602 | #foreach( $opt in $target.options ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
603 | # Option: --${opt.argument} |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
604 | if [ -z "${D}${opt.varName}" ]; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
605 | echo "auto-detecting option '${opt.argument}'" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
606 | SAVED_ERROR="$ERROR" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
607 | SAVED_DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
608 | ERROR=1 |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
609 | while true |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
610 | do |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
611 | #foreach( $optdef in $opt.defaults ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
612 | #if( $optdef.platform ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
613 | if isplatform "$optdef.platform"; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
614 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
615 | if $optdef.func ; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
616 | echo " ${opt.argument}: ${optdef.valueName}" >> "$TEMP_DIR/options" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
617 | ERROR=0 |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
618 | break |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
619 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
620 | #if( $optdef.platform ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
621 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
622 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
623 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
624 | break |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
625 | done |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
626 | if [ $ERROR -ne 0 ]; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
627 | SAVED_ERROR=1 |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
628 | SAVED_DEPENDENCIES_FAILED="option '${opt.argument}' $SAVED_DEPENDENCIES_FAILED" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
629 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
630 | ERROR="$SAVED_ERROR" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
631 | DEPENDENCIES_FAILED="$SAVED_DEPENDENCIES_FAILED" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
632 | else |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
633 | echo "checking option ${opt.argument} = ${D}${opt.varName}" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
634 | if false; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
635 | false |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
636 | #foreach( $optval in $opt.values ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
637 | elif [ "${D}${opt.varName}" = "${optval.value}" ]; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
638 | echo " ${opt.argument}: ${D}${opt.varName}" >> $TEMP_DIR/options |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
639 | if $optval.func ; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
640 | : |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
641 | else |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
642 | ERROR=1 |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
643 | DEPENDENCIES_FAILED="option '${opt.argument}' $DEPENDENCIES_FAILED" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
644 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
645 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
646 | fi |
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 | |
815
b0c4750cecd8
update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents:
796
diff
changeset
|
650 | 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
|
651 | 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
|
652 | fi |
815
b0c4750cecd8
update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents:
796
diff
changeset
|
653 | 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
|
654 | 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
|
655 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
656 | if [ "$BUILD_TYPE" = "debug" ]; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
657 | if [ -n "$lang_c" ]; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
658 | echo '${target.cFlags} += ${DEBUG_CC_FLAGS}' >> "$TEMP_DIR/flags.mk" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
659 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
660 | if [ -n "$lang_cpp" ]; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
661 | echo '${target.cxxFlags} += ${DEBUG_CXX_FLAGS}' >> "$TEMP_DIR/flags.mk" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
662 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
663 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
664 | if [ "$BUILD_TYPE" = "release" ]; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
665 | if [ -n "$lang_c" ]; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
666 | echo '${target.cFlags} += ${RELEASE_CC_FLAGS}' >> "$TEMP_DIR/flags.mk" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
667 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
668 | if [ -n "$lang_cpp" ]; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
669 | echo '${target.cxxFlags} += ${RELEASE_CXX_FLAGS}' >> "$TEMP_DIR/flags.mk" |
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 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
672 | if [ -n "${TEMP_LDFLAGS}" ]; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
673 | 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
|
674 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
675 | |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
676 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
677 | |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
678 | # final result |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
679 | if [ $ERROR -ne 0 ]; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
680 | echo |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
681 | echo "Error: Unresolved dependencies" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
682 | echo "$DEPENDENCIES_FAILED" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
683 | abort_configure |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
684 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
685 | |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
686 | echo "configure finished" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
687 | echo |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
688 | echo "Build Config:" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
689 | echo " PREFIX: $prefix" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
690 | echo " TOOLCHAIN: $TOOLCHAIN_NAME" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
691 | #if ( $options.size() > 0 ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
692 | echo "Options:" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
693 | cat "$TEMP_DIR/options" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
694 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
695 | #if ( $features.size() > 0 ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
696 | echo "Features:" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
697 | #foreach( $feature in $features ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
698 | if [ -n "${D}${feature.varName}" ]; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
699 | echo " $feature.name: on" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
700 | else |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
701 | echo " $feature.name: off" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
702 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
703 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
704 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
705 | echo |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
706 | |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
707 | # generate the config.mk file |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
708 | cat > "$TEMP_DIR/config.mk" << __EOF__ |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
709 | # |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
710 | # config.mk generated by configure |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
711 | # |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
712 | |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
713 | __EOF__ |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
714 | write_toolchain_defaults "$TEMP_DIR/toolchain.mk" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
715 | cat "$TEMP_DIR/vars.mk" "$TEMP_DIR/toolchain.mk" "$TEMP_DIR/flags.mk" "$TEMP_DIR/make.mk" > config.mk |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
716 | rm -Rf "$TEMP_DIR" |