make/configure.vm

Fri, 29 Sep 2023 20:30:22 +0200

author
Mike Becker <universe@uap-core.de>
date
Fri, 29 Sep 2023 20:30:22 +0200
changeset 71
a2ea57a16348
parent 68
ae763178ee1e
child 74
ed9a5ffd1f13
permissions
-rw-r--r--

fix dist files not being in subdir

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

mercurial