Sun, 22 Dec 2024 22:10:04 +0100
don't trust that size_t always has word width
it should be the case on all platforms supported by UCX, but it's not strictly defined in POSIX that it must be the case
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 | |
1017
b0098854071f
add check for C23 compatibility
Mike Becker <universe@uap-core.de>
parents:
987
diff
changeset
|
110 | Build Types: |
b0098854071f
add check for C23 compatibility
Mike Becker <universe@uap-core.de>
parents:
987
diff
changeset
|
111 | --debug add extra compile flags for debug builds |
b0098854071f
add check for C23 compatibility
Mike Becker <universe@uap-core.de>
parents:
987
diff
changeset
|
112 | --release add extra compile flags for release builds |
753
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
113 | #if( $options.size() > 0 ) |
1017
b0098854071f
add check for C23 compatibility
Mike Becker <universe@uap-core.de>
parents:
987
diff
changeset
|
114 | |
753
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
115 | Options: |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
116 | #foreach( $opt in $options ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
117 | --${opt.argument}=${opt.valuesString} |
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 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
120 | #if( $features.size() > 0 ) |
1017
b0098854071f
add check for C23 compatibility
Mike Becker <universe@uap-core.de>
parents:
987
diff
changeset
|
121 | |
753
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
122 | Optional Features: |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
123 | #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
|
124 | ${feature.helpText} |
753
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
125 | #end |
1017
b0098854071f
add check for C23 compatibility
Mike Becker <universe@uap-core.de>
parents:
987
diff
changeset
|
126 | #end |
753
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 | __EOF__ |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
129 | } |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
130 | |
960
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
131 | # create temporary directory |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
132 | TEMP_DIR=".tmp-`uname -n`" |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
133 | rm -Rf "$TEMP_DIR" |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
134 | 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
|
135 | : |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
136 | else |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
137 | 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
|
138 | echo "Abort" |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
139 | exit 1 |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
140 | fi |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
141 | touch "$TEMP_DIR/options" |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
142 | touch "$TEMP_DIR/features" |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
143 | |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
144 | # define standard variables |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
145 | # 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
|
146 | prefix=/usr |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
147 | exec_prefix= |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
148 | bindir= |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
149 | sbindir= |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
150 | libdir= |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
151 | libexecdir= |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
152 | datarootdir= |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
153 | datadir= |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
154 | sysconfdir= |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
155 | sharedstatedir= |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
156 | localstatedir= |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
157 | runstatedir= |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
158 | includedir= |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
159 | infodir= |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
160 | localedir= |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
161 | mandir= |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
162 | |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
163 | # custom variables |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
164 | #foreach( $cfg in $config ) |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
165 | if true \ |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
166 | #if( $cfg.platform ) |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
167 | && isplatform "${cfg.platform}" \ |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
168 | #end |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
169 | #foreach( $np in $cfg.notList ) |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
170 | && notisplatform "${np}" \ |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
171 | #end |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
172 | ; then |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
173 | #foreach( $var in $cfg.vars ) |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
174 | #if( $var.exec ) |
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 | #else |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
177 | ${var.varName}="${var.value}" |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
178 | #end |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
179 | #end |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
180 | fi |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
181 | #end |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
182 | |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
183 | # features |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
184 | #foreach( $feature in $features ) |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
185 | #if( ${feature.auto} ) |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
186 | ${feature.varName}=auto |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
187 | #end |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
188 | #end |
a8a5f3dd5c3d
test coverage does not really work with clang
Mike Becker <universe@uap-core.de>
parents:
821
diff
changeset
|
189 | |
753
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 | # parse arguments |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
192 | # |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
193 | BUILD_TYPE="default" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
194 | for ARG in "$@" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
195 | do |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
196 | case "$ARG" in |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
197 | "--prefix="*) prefix=${D}{ARG#--prefix=} ;; |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
198 | "--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
|
199 | "--bindir="*) bindir=${D}{ARG#----bindir=} ;; |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
200 | "--sbindir="*) sbindir=${D}{ARG#--sbindir=} ;; |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
201 | "--libdir="*) libdir=${D}{ARG#--libdir=} ;; |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
202 | "--libexecdir="*) libexecdir=${D}{ARG#--libexecdir=} ;; |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
203 | "--datarootdir="*) datarootdir=${D}{ARG#--datarootdir=} ;; |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
204 | "--datadir="*) datadir=${D}{ARG#--datadir=} ;; |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
205 | "--sysconfdir="*) sysconfdir=${D}{ARG#--sysconfdir=} ;; |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
206 | "--sharedstatedir="*) sharedstatedir=${D}{ARG#--sharedstatedir=} ;; |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
207 | "--localstatedir="*) localstatedir=${D}{ARG#--localstatedir=} ;; |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
208 | "--includedir="*) includedir=${D}{ARG#--includedir=} ;; |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
209 | "--infodir="*) infodir=${D}{ARG#--infodir=} ;; |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
210 | "--mandir"*) mandir=${D}{ARG#--mandir} ;; |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
211 | "--localedir"*) localedir=${D}{ARG#--localedir} ;; |
1017
b0098854071f
add check for C23 compatibility
Mike Becker <universe@uap-core.de>
parents:
987
diff
changeset
|
212 | "--help"*) printhelp; abort_configure ;; |
b0098854071f
add check for C23 compatibility
Mike Becker <universe@uap-core.de>
parents:
987
diff
changeset
|
213 | "--debug") BUILD_TYPE="debug" ;; |
b0098854071f
add check for C23 compatibility
Mike Becker <universe@uap-core.de>
parents:
987
diff
changeset
|
214 | "--release") BUILD_TYPE="release" ;; |
753
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
215 | #foreach( $opt in $options ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
216 | "--${opt.argument}="*) ${opt.varName}=${D}{ARG#--${opt.argument}=} ;; |
1017
b0098854071f
add check for C23 compatibility
Mike Becker <universe@uap-core.de>
parents:
987
diff
changeset
|
217 | "--${opt.argument}") echo "option '$ARG' needs a value:"; echo " $ARG=${opt.valuesString}"; abort_configure ;; |
753
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
218 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
219 | #foreach( $feature in $features ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
220 | "--enable-${feature.arg}") ${feature.varName}=on ;; |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
221 | "--disable-${feature.arg}") unset ${feature.varName} ;; |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
222 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
223 | "-"*) echo "unknown option: $ARG"; abort_configure ;; |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
224 | esac |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
225 | done |
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 | ## Begin unparsed content. ** |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
228 | #[[ |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
229 | |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
230 | # set defaults for dir variables |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
231 | : ${exec_prefix:="$prefix"} |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
232 | : ${bindir:='${exec_prefix}/bin'} |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
233 | : ${sbindir:='${exec_prefix}/sbin'} |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
234 | : ${libdir:='${exec_prefix}/lib'} |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
235 | : ${libexecdir:='${exec_prefix}/libexec'} |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
236 | : ${datarootdir:='${prefix}/share'} |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
237 | : ${datadir:='${datarootdir}'} |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
238 | : ${sysconfdir:='${prefix}/etc'} |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
239 | : ${sharedstatedir:='${prefix}/com'} |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
240 | : ${localstatedir:='${prefix}/var'} |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
241 | : ${runstatedir:='${localstatedir}/run'} |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
242 | : ${includedir:='${prefix}/include'} |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
243 | : ${infodir:='${datarootdir}/info'} |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
244 | : ${mandir:='${datarootdir}/man'} |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
245 | : ${localedir:='${datarootdir}/locale'} |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
246 | |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
247 | # 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
|
248 | if [ -n "$CONFIG_SITE" ]; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
249 | # 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
|
250 | for cs in $CONFIG_SITE; do |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
251 | printf "loading defaults from $cs... " |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
252 | . "$cs" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
253 | echo ok |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
254 | done |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
255 | 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
|
256 | printf "loading site defaults... " |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
257 | . "$prefix/share/config.site" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
258 | echo ok |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
259 | 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
|
260 | printf "loading site defaults... " |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
261 | . "$prefix/etc/config.site" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
262 | echo ok |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
263 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
264 | ]]# |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
265 | ## End of unparsed content ** |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
266 | |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
267 | # generate vars.mk |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
268 | cat > "$TEMP_DIR/vars.mk" << __EOF__ |
821
5e6f15005efd
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
815
diff
changeset
|
269 | prefix=$prefix |
5e6f15005efd
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
815
diff
changeset
|
270 | exec_prefix=$exec_prefix |
5e6f15005efd
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
815
diff
changeset
|
271 | bindir=$bindir |
5e6f15005efd
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
815
diff
changeset
|
272 | sbindir=$sbindir |
5e6f15005efd
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
815
diff
changeset
|
273 | libdir=$libdir |
5e6f15005efd
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
815
diff
changeset
|
274 | libexecdir=$libexecdir |
5e6f15005efd
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
815
diff
changeset
|
275 | datarootdir=$datarootdir |
5e6f15005efd
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
815
diff
changeset
|
276 | datadir=$datadir |
5e6f15005efd
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
815
diff
changeset
|
277 | sysconfdir=$sysconfdir |
5e6f15005efd
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
815
diff
changeset
|
278 | sharedstatedir=$sharedstatedir |
5e6f15005efd
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
815
diff
changeset
|
279 | localstatedir=$localstatedir |
5e6f15005efd
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
815
diff
changeset
|
280 | runstatedir=$runstatedir |
5e6f15005efd
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
815
diff
changeset
|
281 | includedir=$includedir |
5e6f15005efd
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
815
diff
changeset
|
282 | infodir=$infodir |
5e6f15005efd
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
815
diff
changeset
|
283 | mandir=$mandir |
5e6f15005efd
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
815
diff
changeset
|
284 | localedir=$localedir |
753
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
285 | #foreach( $var in $vars ) |
821
5e6f15005efd
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
815
diff
changeset
|
286 | ${var.varName}=${D}${var.varName} |
753
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
287 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
288 | __EOF__ |
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 | # toolchain detection utilities |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
291 | . make/toolchain.sh |
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 | # DEPENDENCIES |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
295 | # |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
296 | |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
297 | # check languages |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
298 | lang_c= |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
299 | lang_cpp= |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
300 | #foreach( $lang in $languages ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
301 | if detect_${lang}_compiler ; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
302 | lang_${lang}=1 |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
303 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
304 | #end |
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 | # 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
|
307 | echo > "$TEMP_DIR/make.mk" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
308 | |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
309 | test_pkg_config() |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
310 | { |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
311 | if "$PKG_CONFIG" --exists "$1" ; then : |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
312 | else return 1 ; fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
313 | 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
|
314 | else return 1 ; fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
315 | 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
|
316 | else return 1 ; fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
317 | 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
|
318 | else return 1 ; fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
319 | return 0 |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
320 | } |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
321 | |
796
fec90b848f4b
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
753
diff
changeset
|
322 | print_check_msg() |
fec90b848f4b
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
753
diff
changeset
|
323 | { |
fec90b848f4b
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
753
diff
changeset
|
324 | if [ -z "$1" ]; then |
fec90b848f4b
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
753
diff
changeset
|
325 | shift |
fec90b848f4b
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
753
diff
changeset
|
326 | printf "$@" |
fec90b848f4b
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
753
diff
changeset
|
327 | fi |
fec90b848f4b
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
753
diff
changeset
|
328 | } |
fec90b848f4b
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
753
diff
changeset
|
329 | |
753
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
330 | #foreach( $dependency in $namedDependencies ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
331 | dependency_error_${dependency.id}() |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
332 | { |
796
fec90b848f4b
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
753
diff
changeset
|
333 | 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
|
334 | #foreach( $sub in $dependency.subdependencies ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
335 | # dependency $sub.fullName |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
336 | while true |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
337 | do |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
338 | #if( $sub.platform ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
339 | if notisplatform "${sub.platform}"; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
340 | break |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
341 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
342 | #end |
815
b0c4750cecd8
update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents:
796
diff
changeset
|
343 | #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
|
344 | 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
|
345 | break |
b0c4750cecd8
update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents:
796
diff
changeset
|
346 | fi |
b0c4750cecd8
update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents:
796
diff
changeset
|
347 | #end |
753
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
348 | #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
|
349 | 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
|
350 | break |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
351 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
352 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
353 | #foreach( $lang in $sub.lang ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
354 | if [ -z "$lang_${lang}" ] ; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
355 | break |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
356 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
357 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
358 | #if( $sub.pkgconfig.size() > 0 ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
359 | if [ -z "$PKG_CONFIG" ]; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
360 | break |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
361 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
362 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
363 | #foreach( $test in $sub.tests ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
364 | if $test > /dev/null ; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
365 | : |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
366 | else |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
367 | break |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
368 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
369 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
370 | #foreach( $pkg in $sub.pkgconfig ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
371 | 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
|
372 | 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
|
373 | 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
|
374 | else |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
375 | break |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
376 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
377 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
378 | #foreach( $flags in $sub.flags ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
379 | #if( $flags.exec ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
380 | if tmp_flags=`$flags.value` ; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
381 | 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
|
382 | else |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
383 | break |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
384 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
385 | #else |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
386 | 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
|
387 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
388 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
389 | #if ( $sub.make.length() > 0 ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
390 | cat >> $TEMP_DIR/make.mk << __EOF__ |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
391 | # Dependency: $dependency.name |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
392 | $sub.make |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
393 | __EOF__ |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
394 | #end |
796
fec90b848f4b
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
753
diff
changeset
|
395 | 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
|
396 | dep_checked_${dependency.id}=1 |
753
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
397 | return 1 |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
398 | done |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
399 | |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
400 | #end |
796
fec90b848f4b
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
753
diff
changeset
|
401 | 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
|
402 | dep_checked_${dependency.id}=1 |
753
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
403 | return 0 |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
404 | } |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
405 | #end |
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 | # start collecting dependency information |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
408 | echo > "$TEMP_DIR/flags.mk" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
409 | |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
410 | DEPENDENCIES_FAILED= |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
411 | ERROR=0 |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
412 | #if( $dependencies.size() > 0 ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
413 | # unnamed dependencies |
1017
b0098854071f
add check for C23 compatibility
Mike Becker <universe@uap-core.de>
parents:
987
diff
changeset
|
414 | TEMP_CFLAGS="$CFLAGS" |
b0098854071f
add check for C23 compatibility
Mike Becker <universe@uap-core.de>
parents:
987
diff
changeset
|
415 | TEMP_CXXFLAGS="$CXXFLAGS" |
b0098854071f
add check for C23 compatibility
Mike Becker <universe@uap-core.de>
parents:
987
diff
changeset
|
416 | TEMP_LDFLAGS="$LDFLAGS" |
753
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
417 | #foreach( $dependency in $dependencies ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
418 | while true |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
419 | do |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
420 | #if( $dependency.platform ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
421 | if notisplatform "${dependency.platform}"; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
422 | break |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
423 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
424 | #end |
815
b0c4750cecd8
update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents:
796
diff
changeset
|
425 | #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
|
426 | 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
|
427 | break |
b0c4750cecd8
update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents:
796
diff
changeset
|
428 | fi |
b0c4750cecd8
update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents:
796
diff
changeset
|
429 | #end |
753
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
430 | #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
|
431 | 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
|
432 | break |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
433 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
434 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
435 | while true |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
436 | do |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
437 | #foreach( $lang in $dependency.lang ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
438 | if [ -z "$lang_${lang}" ] ; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
439 | ERROR=1 |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
440 | break |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
441 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
442 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
443 | #if( $dependency.pkgconfig.size() > 0 ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
444 | if [ -z "$PKG_CONFIG" ]; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
445 | ERROR=1 |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
446 | break |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
447 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
448 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
449 | #foreach( $pkg in $dependency.pkgconfig ) |
796
fec90b848f4b
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
753
diff
changeset
|
450 | 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
|
451 | 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
|
452 | 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
|
453 | 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
|
454 | 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
|
455 | 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
|
456 | else |
796
fec90b848f4b
update uwproj configure template
Mike Becker <universe@uap-core.de>
parents:
753
diff
changeset
|
457 | 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
|
458 | 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
|
459 | ERROR=1 |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
460 | break |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
461 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
462 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
463 | |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
464 | #foreach( $flags in $dependency.flags ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
465 | #if( $flags.exec ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
466 | $flags.value > /dev/null |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
467 | if tmp_flags=`$flags.value` ; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
468 | 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
|
469 | else |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
470 | ERROR=1 |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
471 | break |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
472 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
473 | #else |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
474 | 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
|
475 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
476 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
477 | #if ( $dependency.make.length() > 0 ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
478 | cat >> "$TEMP_DIR/make.mk" << __EOF__ |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
479 | $dependency.make |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
480 | __EOF__ |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
481 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
482 | break |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
483 | done |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
484 | break |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
485 | done |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
486 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
487 | |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
488 | # 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
|
489 | 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
|
490 | 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
|
491 | 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
|
492 | fi |
815
b0c4750cecd8
update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents:
796
diff
changeset
|
493 | 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
|
494 | 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
|
495 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
496 | if [ -n "${TEMP_LDFLAGS}" ]; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
497 | 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
|
498 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
499 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
500 | |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
501 | # |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
502 | # OPTION VALUES |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
503 | # |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
504 | #foreach( $opt in $options ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
505 | #foreach( $val in $opt.values ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
506 | ${val.func}() |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
507 | { |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
508 | VERR=0 |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
509 | #foreach( $dep in $val.dependencies ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
510 | if dependency_error_$dep ; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
511 | VERR=1 |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
512 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
513 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
514 | if [ $VERR -ne 0 ]; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
515 | return 1 |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
516 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
517 | #foreach( $def in $val.defines ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
518 | TEMP_CFLAGS="$TEMP_CFLAGS ${def.toFlags()}" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
519 | TEMP_CXXFLAGS="$TEMP_CXXFLAGS ${def.toFlags()}" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
520 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
521 | #if( $val.hasMake() ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
522 | cat >> "$TEMP_DIR/make.mk" << __EOF__ |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
523 | $val.make |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
524 | __EOF__ |
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 | return 0 |
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 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
529 | #end |
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 | # TARGETS |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
533 | # |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
534 | |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
535 | #foreach( $target in $targets ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
536 | echo >> "$TEMP_DIR/flags.mk" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
537 | #if ( $target.name ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
538 | echo "configuring target: $target.name" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
539 | 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
|
540 | #else |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
541 | echo "configuring global target" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
542 | 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
|
543 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
544 | TEMP_CFLAGS= |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
545 | TEMP_CXXFLAGS= |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
546 | TEMP_LDFLAGS= |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
547 | |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
548 | #foreach( $dependency in $target.dependencies ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
549 | if dependency_error_$dependency; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
550 | DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED ${dependency} " |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
551 | ERROR=1 |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
552 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
553 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
554 | |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
555 | # Features |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
556 | #foreach( $feature in $target.features ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
557 | if [ -n "${D}${feature.varName}" ]; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
558 | #foreach( $dependency in $feature.dependencies ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
559 | # check dependency |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
560 | if dependency_error_$dependency ; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
561 | # "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
|
562 | if [ "${D}${feature.varName}" = "auto" ]; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
563 | DISABLE_${feature.varName}=1 |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
564 | else |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
565 | DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED ${dependency} " |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
566 | ERROR=1 |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
567 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
568 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
569 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
570 | if [ -n "$DISABLE_${feature.varName}" ]; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
571 | unset ${feature.varName} |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
572 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
573 | fi |
987
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
574 | if [ -n "${D}${feature.varName}" ]; then |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
575 | : |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
576 | #foreach( $def in $feature.defines ) |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
577 | TEMP_CFLAGS="$TEMP_CFLAGS ${def.toFlags()}" |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
578 | TEMP_CXXFLAGS="$TEMP_CXXFLAGS ${def.toFlags()}" |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
579 | #end |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
580 | #if( $feature.hasMake() ) |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
581 | cat >> "$TEMP_DIR/make.mk" << __EOF__ |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
582 | $feature.make |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
583 | __EOF__ |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
584 | #end |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
585 | else |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
586 | : |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
587 | #foreach( $def in $feature.disabled.defines ) |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
588 | TEMP_CFLAGS="$TEMP_CFLAGS ${def.toFlags()}" |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
589 | TEMP_CXXFLAGS="$TEMP_CXXFLAGS ${def.toFlags()}" |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
590 | #end |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
591 | #if( $feature.disabled.hasMake() ) |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
592 | cat >> "$TEMP_DIR/make.mk" << __EOF__ |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
593 | $feature.disabled.make |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
594 | __EOF__ |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
595 | #end |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
596 | #foreach( $dependency in $feature.disabled.dependencies ) |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
597 | if dependency_error_$dependency ; then |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
598 | DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED ${dependency} " |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
599 | ERROR=1 |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
600 | fi |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
601 | #end |
53e22f112b11
add configure option for szmul
Mike Becker <universe@uap-core.de>
parents:
960
diff
changeset
|
602 | fi |
753
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
603 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
604 | |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
605 | #foreach( $opt in $target.options ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
606 | # Option: --${opt.argument} |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
607 | if [ -z "${D}${opt.varName}" ]; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
608 | echo "auto-detecting option '${opt.argument}'" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
609 | SAVED_ERROR="$ERROR" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
610 | SAVED_DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
611 | ERROR=1 |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
612 | while true |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
613 | do |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
614 | #foreach( $optdef in $opt.defaults ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
615 | #if( $optdef.platform ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
616 | if isplatform "$optdef.platform"; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
617 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
618 | if $optdef.func ; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
619 | 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
|
620 | ERROR=0 |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
621 | break |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
622 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
623 | #if( $optdef.platform ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
624 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
625 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
626 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
627 | break |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
628 | done |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
629 | if [ $ERROR -ne 0 ]; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
630 | SAVED_ERROR=1 |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
631 | 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
|
632 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
633 | ERROR="$SAVED_ERROR" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
634 | DEPENDENCIES_FAILED="$SAVED_DEPENDENCIES_FAILED" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
635 | else |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
636 | 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
|
637 | if false; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
638 | false |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
639 | #foreach( $optval in $opt.values ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
640 | 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
|
641 | 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
|
642 | if $optval.func ; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
643 | : |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
644 | else |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
645 | ERROR=1 |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
646 | 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
|
647 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
648 | #end |
1017
b0098854071f
add check for C23 compatibility
Mike Becker <universe@uap-core.de>
parents:
987
diff
changeset
|
649 | else |
b0098854071f
add check for C23 compatibility
Mike Becker <universe@uap-core.de>
parents:
987
diff
changeset
|
650 | echo |
b0098854071f
add check for C23 compatibility
Mike Becker <universe@uap-core.de>
parents:
987
diff
changeset
|
651 | echo "Invalid option value - usage:" |
b0098854071f
add check for C23 compatibility
Mike Becker <universe@uap-core.de>
parents:
987
diff
changeset
|
652 | echo " --${opt.argument}=${opt.valuesString}" |
b0098854071f
add check for C23 compatibility
Mike Becker <universe@uap-core.de>
parents:
987
diff
changeset
|
653 | abort_configure |
753
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
654 | fi |
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 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
657 | |
815
b0c4750cecd8
update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents:
796
diff
changeset
|
658 | 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
|
659 | 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
|
660 | fi |
815
b0c4750cecd8
update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents:
796
diff
changeset
|
661 | 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
|
662 | 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
|
663 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
664 | if [ "$BUILD_TYPE" = "debug" ]; 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} += ${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
|
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} += ${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
|
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 [ "$BUILD_TYPE" = "release" ]; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
673 | if [ -n "$lang_c" ]; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
674 | 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
|
675 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
676 | if [ -n "$lang_cpp" ]; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
677 | 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
|
678 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
679 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
680 | if [ -n "${TEMP_LDFLAGS}" ]; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
681 | 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
|
682 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
683 | |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
684 | #end |
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 | # final result |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
687 | if [ $ERROR -ne 0 ]; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
688 | echo |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
689 | echo "Error: Unresolved dependencies" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
690 | echo "$DEPENDENCIES_FAILED" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
691 | abort_configure |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
692 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
693 | |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
694 | echo "configure finished" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
695 | echo |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
696 | echo "Build Config:" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
697 | echo " PREFIX: $prefix" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
698 | echo " TOOLCHAIN: $TOOLCHAIN_NAME" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
699 | #if ( $options.size() > 0 ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
700 | echo "Options:" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
701 | cat "$TEMP_DIR/options" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
702 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
703 | #if ( $features.size() > 0 ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
704 | echo "Features:" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
705 | #foreach( $feature in $features ) |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
706 | if [ -n "${D}${feature.varName}" ]; then |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
707 | echo " $feature.name: on" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
708 | else |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
709 | echo " $feature.name: off" |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
710 | fi |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
711 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
712 | #end |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
713 | echo |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
714 | |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
715 | # generate the config.mk file |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
716 | cat > "$TEMP_DIR/config.mk" << __EOF__ |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
717 | # |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
718 | # config.mk generated by configure |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
719 | # |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
720 | |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
721 | __EOF__ |
24dc84788dee
replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
722 | 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
|
723 | 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
|
724 | rm -Rf "$TEMP_DIR" |