Wed, 10 Jul 2024 21:35:37 +0200
add basic support for line continuations in C highlighter
things that still do not work:
- user includes
- splitting keywords
fixes #392
72
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
1 | #!/bin/sh |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
2 | |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
3 | # create temporary directory |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
4 | TEMP_DIR=".tmp-`uname -n`" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
5 | rm -Rf "$TEMP_DIR" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
6 | if mkdir -p "$TEMP_DIR"; then |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
7 | : |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
8 | else |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
9 | echo "Cannot create tmp dir $TEMP_DIR" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
10 | echo "Abort" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
11 | exit 1 |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
12 | fi |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
13 | touch "$TEMP_DIR/options" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
14 | touch "$TEMP_DIR/features" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
15 | |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
16 | # define standard variables |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
17 | PREFIX=/usr |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
18 | EPREFIX= |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
19 | BINDIR= |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
20 | SBINDIR= |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
21 | LIBDIR= |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
22 | LIBEXECDIR= |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
23 | DATADIR= |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
24 | SYSCONFDIR= |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
25 | SHAREDSTATEDIR= |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
26 | LOCALSTATEDIR= |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
27 | INCLUDEDIR= |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
28 | INFODIR= |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
29 | MANDIR= |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
30 | |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
31 | # custom variables |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
32 | #foreach( $var in $vars ) |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
33 | #if( $var.exec ) |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
34 | ${var.varName}=`${var.value}` |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
35 | #else |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
36 | ${var.varName}="${var.value}" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
37 | #end |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
38 | #end |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
39 | |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
40 | # features |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
41 | #foreach( $feature in $features ) |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
42 | #if( ${feature.isDefault()} ) |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
43 | ${feature.getVarName()}=auto |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
44 | #end |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
45 | #end |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
46 | |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
47 | # clean abort |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
48 | abort_configure() |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
49 | { |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
50 | rm -Rf "$TEMP_DIR" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
51 | exit 1 |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
52 | } |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
53 | |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
54 | # help text |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
55 | printhelp() |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
56 | { |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
57 | echo "Usage: $0 [OPTIONS]..." |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
58 | cat << __EOF__ |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
59 | Installation directories: |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
60 | --prefix=PREFIX path prefix for architecture-independent files |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
61 | [/usr] |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
62 | --exec-prefix=EPREFIX path prefix for architecture-dependent files |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
63 | [PREFIX] |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
64 | |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
65 | --bindir=DIR user executables [EPREFIX/bin] |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
66 | --sbindir=DIR system admin executables [EPREFIX/sbin] |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
67 | --libexecdir=DIR program executables [EPREFIX/libexec] |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
68 | --sysconfdir=DIR system configuration files [PREFIX/etc] |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
69 | --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
70 | --localstatedir=DIR modifiable single-machine data [PREFIX/var] |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
71 | --libdir=DIR object code libraries [EPREFIX/lib] |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
72 | --includedir=DIR C header files [PREFIX/include] |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
73 | --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
74 | --datadir=DIR read-only architecture-independent data [DATAROOTDIR] |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
75 | --infodir=DIR info documentation [DATAROOTDIR/info] |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
76 | --mandir=DIR man documentation [DATAROOTDIR/man] |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
77 | |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
78 | #if( $options.size() > 0 ) |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
79 | Options: |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
80 | --debug add extra compile flags for debug builds |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
81 | --release add extra compile flags for release builds |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
82 | #foreach( $opt in $options ) |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
83 | --${opt.getArgument()}=${opt.getValuesString()} |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
84 | #end |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
85 | |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
86 | #end |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
87 | #if( $features.size() > 0 ) |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
88 | Optional Features: |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
89 | #foreach( $feature in $features ) |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
90 | #if( $feature.default ) |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
91 | --disable-${feature.arg} |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
92 | #else |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
93 | --enable-${feature.arg} |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
94 | #end |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
95 | #end |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
96 | |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
97 | #end |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
98 | __EOF__ |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
99 | } |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
100 | |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
101 | # |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
102 | # parse arguments |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
103 | # |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
104 | BUILD_TYPE="default" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
105 | #set( $D = '$' ) |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
106 | for ARG in "$@" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
107 | do |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
108 | case "$ARG" in |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
109 | "--prefix="*) PREFIX=${D}{ARG#--prefix=} ;; |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
110 | "--exec-prefix="*) EPREFIX=${D}{ARG#--exec-prefix=} ;; |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
111 | "--bindir="*) BINDIR=${D}{ARG#----bindir=} ;; |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
112 | "--sbindir="*) SBINDIR=${D}{ARG#--sbindir=} ;; |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
113 | "--libdir="*) LIBDIR=${D}{ARG#--libdir=} ;; |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
114 | "--libexecdir="*) LIBEXECDIR=${D}{ARG#--libexecdir=} ;; |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
115 | "--datadir="*) DATADIR=${D}{ARG#--datadir=} ;; |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
116 | "--sysconfdir="*) SYSCONFDIR=${D}{ARG#--sysconfdir=} ;; |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
117 | "--sharedstatedir="*) SHAREDSTATEDIR=${D}{ARG#--sharedstatedir=} ;; |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
118 | "--localstatedir="*) LOCALSTATEDIR=${D}{ARG#--localstatedir=} ;; |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
119 | "--includedir="*) INCLUDEDIR=${D}{ARG#--includedir=} ;; |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
120 | "--infodir="*) INFODIR=${D}{ARG#--infodir=} ;; |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
121 | "--mandir"*) MANDIR=${D}{ARG#--mandir} ;; |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
122 | "--help"*) printhelp; abort_configure ;; |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
123 | "--debug") BUILD_TYPE="debug" ;; |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
124 | "--release") BUILD_TYPE="release" ;; |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
125 | #foreach( $opt in $options ) |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
126 | "--${opt.getArgument()}="*) ${opt.getVarName()}=${D}{ARG#--${opt.getArgument()}=} ;; |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
127 | #end |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
128 | #foreach( $feature in $features ) |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
129 | "--enable-${feature.arg}") ${feature.getVarName()}=on ;; |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
130 | "--disable-${feature.arg}") unset ${feature.getVarName()} ;; |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
131 | #end |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
132 | "-"*) echo "unknown option: $ARG"; abort_configure ;; |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
133 | esac |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
134 | done |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
135 | |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
136 | ## Begin unparsed content. ** |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
137 | #[[ |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
138 | # set dir variables |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
139 | : ${EPREFIX:="$PREFIX"} |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
140 | : ${BINDIR:="$EPREFIX/bin"} |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
141 | : ${SBINDIR:="$EPREFIX/sbin"} |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
142 | : ${LIBDIR:="$EPREFIX/lib"} |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
143 | : ${LIBEXECDIR:="$EPREFIX/libexec"} |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
144 | : ${DATADIR:="$PREFIX/share"} |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
145 | : ${SYSCONFDIR:="$PREFIX/etc"} |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
146 | : ${SHAREDSTATEDIR:="$PREFIX/com"} |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
147 | : ${LOCALSTATEDIR:="$PREFIX/var"} |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
148 | : ${INCLUDEDIR:="$PREFIX/include"} |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
149 | : ${INFODIR:="$PREFIX/info"} |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
150 | : ${MANDIR:="$PREFIX/man"} |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
151 | |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
152 | # Test for availability of pkg-config |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
153 | PKG_CONFIG=`command -v pkg-config` |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
154 | : ${PKG_CONFIG:="false"} |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
155 | |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
156 | # Simple uname based platform detection |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
157 | # $PLATFORM is used for platform dependent dependency selection |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
158 | OS=`uname -s` |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
159 | OS_VERSION=`uname -r` |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
160 | printf "detect platform... " |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
161 | if [ "$OS" = "SunOS" ]; then |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
162 | PLATFORM="solaris sunos unix svr4" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
163 | fi |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
164 | if [ "$OS" = "Linux" ]; then |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
165 | PLATFORM="linux unix" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
166 | fi |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
167 | if [ "$OS" = "FreeBSD" ]; then |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
168 | PLATFORM="freebsd bsd unix" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
169 | fi |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
170 | if [ "$OS" = "Darwin" ]; then |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
171 | PLATFORM="macos osx bsd unix" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
172 | fi |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
173 | if echo "$OS" | grep -i "MINGW" > /dev/null; then |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
174 | PLATFORM="windows mingw" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
175 | fi |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
176 | : ${PLATFORM:="unix"} |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
177 | |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
178 | PLATFORM_NAME=`echo "$PLATFORM" | cut -f1 -d' ' -` |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
179 | echo "$PLATFORM_NAME" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
180 | |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
181 | isplatform() |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
182 | { |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
183 | for p in $PLATFORM |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
184 | do |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
185 | if [ "$p" = "$1" ]; then |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
186 | return 0 |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
187 | fi |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
188 | done |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
189 | return 1 |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
190 | } |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
191 | notisplatform() |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
192 | { |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
193 | for p in $PLATFORM |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
194 | do |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
195 | if [ "$p" = "$1" ]; then |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
196 | return 1 |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
197 | fi |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
198 | done |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
199 | return 0 |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
200 | } |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
201 | ]]# |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
202 | ## End of unparsed content ** |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
203 | |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
204 | # generate vars.mk |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
205 | cat > "$TEMP_DIR/vars.mk" << __EOF__ |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
206 | PREFIX="$PREFIX" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
207 | EPREFIX="$EPREFIX" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
208 | BINDIR="$BINDIR" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
209 | SBINDIR="$SBINDIR" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
210 | LIBDIR="$LIBDIR" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
211 | LIBEXECDIR="$LIBEXECDIR" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
212 | DATADIR="$DATADIR" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
213 | SYSCONFDIR="$SYSCONFDIR" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
214 | SHAREDSTATEDIR="$SHAREDSTATEDIR" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
215 | LOCALSTATEDIR="$LOCALSTATEDIR" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
216 | INCLUDEDIR="$INCLUDEDIR" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
217 | INFODIR="$INFODIR" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
218 | MANDIR="$MANDIR" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
219 | #foreach( $var in $vars ) |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
220 | ${var.varName}="$${var.varName}" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
221 | #end |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
222 | __EOF__ |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
223 | sort -u -o "$TEMP_DIR/vars.mk" "$TEMP_DIR/vars.mk" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
224 | |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
225 | |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
226 | # toolchain detection utilities |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
227 | . make/toolchain.sh |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
228 | |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
229 | # |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
230 | # DEPENDENCIES |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
231 | # |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
232 | |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
233 | # check languages |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
234 | lang_c= |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
235 | lang_cpp= |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
236 | #foreach( $lang in $languages ) |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
237 | if detect_${lang}_compiler ; then |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
238 | lang_${lang}=1 |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
239 | fi |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
240 | #end |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
241 | |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
242 | # create buffer for make variables required by dependencies |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
243 | echo > "$TEMP_DIR/make.mk" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
244 | |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
245 | test_pkg_config() |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
246 | { |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
247 | if "$PKG_CONFIG" --exists "$1" ; then : |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
248 | else return 1 ; fi |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
249 | if [ -z "$2" ] || "$PKG_CONFIG" --atleast-version="$2" "$1" ; then : |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
250 | else return 1 ; fi |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
251 | if [ -z "$3" ] || "$PKG_CONFIG" --exact-version="$3" "$1" ; then : |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
252 | else return 1 ; fi |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
253 | if [ -z "$4" ] || "$PKG_CONFIG" --max-version="$4" "$1" ; then : |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
254 | else return 1 ; fi |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
255 | return 0 |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
256 | } |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
257 | |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
258 | #foreach( $dependency in $namedDependencies ) |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
259 | dependency_error_${dependency.name}() |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
260 | { |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
261 | printf "checking for ${dependency.name}... " |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
262 | #foreach( $sub in $dependency.getSubdependencies() ) |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
263 | # dependency $sub.getFullName() |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
264 | while true |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
265 | do |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
266 | #if( $sub.platform ) |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
267 | if notisplatform "${sub.platform}"; then |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
268 | break |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
269 | fi |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
270 | #end |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
271 | #foreach( $np in $sub.getNotList() ) |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
272 | if isplatform "${np}"; then |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
273 | break |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
274 | fi |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
275 | #end |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
276 | #foreach( $lang in $sub.lang ) |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
277 | if [ -z "$lang_${lang}" ] ; then |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
278 | break |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
279 | fi |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
280 | #end |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
281 | #if( $sub.pkgconfig.size() > 0 ) |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
282 | if [ -z "$PKG_CONFIG" ]; then |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
283 | break |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
284 | fi |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
285 | #end |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
286 | #foreach( $test in $sub.tests ) |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
287 | if $test > /dev/null ; then |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
288 | : |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
289 | else |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
290 | break |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
291 | fi |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
292 | #end |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
293 | #foreach( $pkg in $sub.pkgconfig ) |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
294 | if test_pkg_config "$pkg.name" "$pkg.atleast" "$pkg.exact" "$pkg.max" ; then |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
295 | TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags $pkg.name`" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
296 | TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs $pkg.name`" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
297 | else |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
298 | break |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
299 | fi |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
300 | #end |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
301 | #foreach( $flags in $sub.flags ) |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
302 | #if( $flags.exec ) |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
303 | if tmp_flags=`$flags.value` ; then |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
304 | TEMP_$flags.varName="$TEMP_$flags.varName $tmp_flags" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
305 | else |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
306 | break |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
307 | fi |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
308 | #else |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
309 | TEMP_$flags.varName="$TEMP_$flags.varName $flags.value" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
310 | #end |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
311 | #end |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
312 | #if ( $sub.make.length() > 0 ) |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
313 | cat >> $TEMP_DIR/make.mk << __EOF__ |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
314 | # Dependency: $dependency.name |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
315 | $sub.make |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
316 | __EOF__ |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
317 | #end |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
318 | echo yes |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
319 | return 1 |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
320 | done |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
321 | |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
322 | #end |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
323 | echo no |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
324 | return 0 |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
325 | } |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
326 | #end |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
327 | |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
328 | |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
329 | |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
330 | |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
331 | # start collecting dependency information |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
332 | echo > "$TEMP_DIR/flags.mk" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
333 | |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
334 | DEPENDENCIES_FAILED= |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
335 | ERROR=0 |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
336 | #if( $dependencies.size() > 0 ) |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
337 | # unnamed dependencies |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
338 | TEMP_CFLAGS= |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
339 | TEMP_CXXFLAGS= |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
340 | TEMP_LDFLAGS= |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
341 | #foreach( $dependency in $dependencies ) |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
342 | while true |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
343 | do |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
344 | #if( $dependency.platform ) |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
345 | if notisplatform "${dependency.platform}"; then |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
346 | break |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
347 | fi |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
348 | #end |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
349 | #foreach( $np in $dependency.getNotList() ) |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
350 | if isplatform "${np}"; then |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
351 | break |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
352 | fi |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
353 | #end |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
354 | while true |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
355 | do |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
356 | #foreach( $lang in $dependency.lang ) |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
357 | if [ -z "$lang_${lang}" ] ; then |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
358 | ERROR=1 |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
359 | break |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
360 | fi |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
361 | #end |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
362 | #if( $dependency.pkgconfig.size() > 0 ) |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
363 | if [ -z "$PKG_CONFIG" ]; then |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
364 | ERROR=1 |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
365 | break |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
366 | fi |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
367 | #end |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
368 | #foreach( $pkg in $dependency.pkgconfig ) |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
369 | printf "checking for pkg-config package $pkg.name... " |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
370 | if test_pkg_config "$pkg.name" "$pkg.atleast" "$pkg.exact" "$pkg.max" ; then |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
371 | echo yes |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
372 | TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags $pkg.name`" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
373 | TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs $pkg.name`" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
374 | else |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
375 | echo no |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
376 | ERROR=1 |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
377 | break |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
378 | fi |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
379 | #end |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
380 | |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
381 | #foreach( $flags in $dependency.flags ) |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
382 | #if( $flags.exec ) |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
383 | $flags.value > /dev/null |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
384 | if tmp_flags=`$flags.value` ; then |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
385 | TEMP_$flags.varName="$TEMP_$flags.varName $tmp_flags" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
386 | else |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
387 | ERROR=1 |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
388 | break |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
389 | fi |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
390 | #else |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
391 | TEMP_$flags.varName="$TEMP_$flags.varName $flags.value" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
392 | #end |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
393 | #end |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
394 | #if ( $dependency.make.length() > 0 ) |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
395 | cat >> "$TEMP_DIR/make.mk" << __EOF__ |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
396 | $dependency.make |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
397 | __EOF__ |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
398 | #end |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
399 | break |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
400 | done |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
401 | break |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
402 | done |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
403 | #end |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
404 | |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
405 | # add general dependency flags to flags.mk |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
406 | echo "# general flags" >> "$TEMP_DIR/flags.mk" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
407 | if [ -n "${TEMP_CFLAGS}" ]; then |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
408 | echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
409 | fi |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
410 | if [ -n "${TEMP_CXXFLAGS}" ]; then |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
411 | echo "CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
412 | fi |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
413 | if [ -n "${TEMP_LDFLAGS}" ]; then |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
414 | echo "LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
415 | fi |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
416 | #end |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
417 | |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
418 | # |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
419 | # OPTION VALUES |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
420 | # |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
421 | #foreach( $opt in $options ) |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
422 | #foreach( $val in $opt.values ) |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
423 | ${val.func}() |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
424 | { |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
425 | VERR=0 |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
426 | #foreach( $dep in $val.dependencies ) |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
427 | if dependency_error_$dep ; then |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
428 | VERR=1 |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
429 | fi |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
430 | #end |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
431 | if [ $VERR -ne 0 ]; then |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
432 | return 1 |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
433 | fi |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
434 | #foreach( $def in $val.defines ) |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
435 | TEMP_CFLAGS="$TEMP_CFLAGS ${def.toFlags()}" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
436 | TEMP_CXXFLAGS="$TEMP_CXXFLAGS ${def.toFlags()}" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
437 | #end |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
438 | #if( $val.hasMake() ) |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
439 | cat >> "$TEMP_DIR/make.mk" << __EOF__ |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
440 | $val.make |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
441 | __EOF__ |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
442 | #end |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
443 | return 0 |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
444 | } |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
445 | #end |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
446 | #end |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
447 | |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
448 | # |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
449 | # TARGETS |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
450 | # |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
451 | |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
452 | #foreach( $target in $targets ) |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
453 | echo >> "$TEMP_DIR/flags.mk" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
454 | #if ( $target.name ) |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
455 | # Target: $target.name |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
456 | echo "# flags for target $target.name" >> "$TEMP_DIR/flags.mk" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
457 | #else |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
458 | # Target |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
459 | echo "# flags for unnamed target" >> "$TEMP_DIR/flags.mk" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
460 | #end |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
461 | TEMP_CFLAGS= |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
462 | TEMP_CXXFLAGS= |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
463 | TEMP_LDFLAGS= |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
464 | |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
465 | #foreach( $dependency in $target.dependencies ) |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
466 | if dependency_error_$dependency; then |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
467 | DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED ${dependency} " |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
468 | ERROR=1 |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
469 | fi |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
470 | #end |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
471 | |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
472 | # Features |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
473 | #foreach( $feature in $target.features ) |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
474 | if [ -n "$${feature.getVarName()}" ]; then |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
475 | #foreach( $dependency in $feature.dependencies ) |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
476 | # check dependency |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
477 | if dependency_error_$dependency ; then |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
478 | # "auto" features can fail and are just disabled in this case |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
479 | if [ "$${feature.getVarName()}" = "auto" ]; then |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
480 | DISABLE_${feature.getVarName()}=1 |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
481 | else |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
482 | DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED ${dependency} " |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
483 | ERROR=1 |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
484 | fi |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
485 | fi |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
486 | #end |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
487 | if [ -n "$DISABLE_${feature.getVarName()}" ]; then |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
488 | unset ${feature.getVarName()} |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
489 | fi |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
490 | fi |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
491 | #end |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
492 | |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
493 | #foreach( $opt in $target.options ) |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
494 | # Option: --${opt.argument} |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
495 | if [ -z ${D}${opt.getVarName()} ]; then |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
496 | SAVED_ERROR="$ERROR" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
497 | SAVED_DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
498 | ERROR=1 |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
499 | while true |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
500 | do |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
501 | #foreach( $optdef in $opt.defaults ) |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
502 | #if( $optdef.platform ) |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
503 | if isplatform "$optdef.platform"; then |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
504 | #end |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
505 | if $optdef.func ; then |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
506 | echo " ${opt.argument}: ${optdef.valueName}" >> "$TEMP_DIR/options" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
507 | ERROR=0 |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
508 | break |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
509 | fi |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
510 | #if( $optdef.platform ) |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
511 | fi |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
512 | #end |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
513 | #end |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
514 | break |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
515 | done |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
516 | if [ $ERROR -ne 0 ]; then |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
517 | SAVED_ERROR=1 |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
518 | fi |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
519 | ERROR="$SAVED_ERROR" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
520 | DEPENDENCIES_FAILED="$SAVED_DEPENDENCIES_FAILED" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
521 | else |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
522 | if false; then |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
523 | false |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
524 | #foreach( $optval in $opt.values ) |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
525 | elif [ "${D}${opt.getVarName()}" = "${optval.value}" ]; then |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
526 | echo " ${opt.argument}: ${D}${opt.getVarName()}" >> $TEMP_DIR/options |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
527 | if $optval.func ; then |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
528 | : |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
529 | else |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
530 | ERROR=1 |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
531 | fi |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
532 | #end |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
533 | fi |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
534 | fi |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
535 | #end |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
536 | |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
537 | if [ -n "${TEMP_CFLAGS}" ]; then |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
538 | echo "${target.getCFlags()} += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
539 | fi |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
540 | if [ -n "${TEMP_CXXFLAGS}" ]; then |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
541 | echo "${target.getCXXFlags()} += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
542 | fi |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
543 | if [ "$BUILD_TYPE" = "debug" ]; then |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
544 | echo '${target.getCFlags()} += ${DEBUG_CC_FLAGS}' >> "$TEMP_DIR/flags.mk" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
545 | echo '${target.getCXXFlags()} += ${DEBUG_CXX_FLAGS}' >> "$TEMP_DIR/flags.mk" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
546 | fi |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
547 | if [ "$BUILD_TYPE" = "release" ]; then |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
548 | echo '${target.getCFlags()} += ${RELEASE_CC_FLAGS}' >> "$TEMP_DIR/flags.mk" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
549 | echo '${target.getCXXFlags()} += ${RELEASE_CXX_FLAGS}' >> "$TEMP_DIR/flags.mk" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
550 | fi |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
551 | if [ -n "${TEMP_LDFLAGS}" ]; then |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
552 | echo "${target.getLDFlags()} += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
553 | fi |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
554 | |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
555 | #end |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
556 | |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
557 | # final result |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
558 | if [ $ERROR -ne 0 ]; then |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
559 | echo |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
560 | echo "Error: Unresolved dependencies" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
561 | echo "$DEPENDENCIES_FAILED" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
562 | abort_configure |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
563 | fi |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
564 | |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
565 | echo "configure finished" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
566 | echo |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
567 | echo "Build Config:" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
568 | echo " PREFIX: $PREFIX" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
569 | echo " TOOLCHAIN: $TOOLCHAIN_NAME" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
570 | #if ( $options.size() > 0 ) |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
571 | echo "Options:" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
572 | cat "$TEMP_DIR/options" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
573 | #end |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
574 | #if ( $features.size() > 0 ) |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
575 | echo "Features:" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
576 | #foreach( $feature in $features ) |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
577 | if [ -n "$${feature.getVarName()}" ]; then |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
578 | echo " $feature.name: on" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
579 | else |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
580 | echo " $feature.name: off" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
581 | fi |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
582 | #end |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
583 | #end |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
584 | echo |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
585 | |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
586 | # generate the config.mk file |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
587 | cat > "$TEMP_DIR/config.mk" << __EOF__ |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
588 | # |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
589 | # config.mk generated by configure |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
590 | # |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
591 | |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
592 | __EOF__ |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
593 | write_toolchain_defaults "$TEMP_DIR/toolchain.mk" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
594 | cat "$TEMP_DIR/vars.mk" "$TEMP_DIR/toolchain.mk" "$TEMP_DIR/flags.mk" "$TEMP_DIR/make.mk" > config.mk |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
595 | rm -Rf "$TEMP_DIR" |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
596 | |
b533da8e7411
use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
597 |