configure

Fri, 06 Oct 2023 21:21:10 +0200

author
Mike Becker <universe@uap-core.de>
date
Fri, 06 Oct 2023 21:21:10 +0200
changeset 0
593b60458157
child 1
e3113d4e2fc0
permissions
-rwxr-xr-x

initial commit

0
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
1 #!/bin/sh
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
2
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
3 # create temporary directory
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
4 TEMP_DIR=".tmp-`uname -n`"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
5 rm -Rf "$TEMP_DIR"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
6 if mkdir -p "$TEMP_DIR"; then
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
7 :
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
8 else
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
9 echo "Cannot create tmp dir $TEMP_DIR"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
10 echo "Abort"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
11 exit 1
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
12 fi
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
13 touch "$TEMP_DIR/options"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
14 touch "$TEMP_DIR/features"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
15
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
16 # define standard variables
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
17 PREFIX=/usr
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
18 EPREFIX=
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
19 BINDIR=
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
20 SBINDIR=
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
21 LIBDIR=
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
22 LIBEXECDIR=
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
23 DATADIR=
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
24 SYSCONFDIR=
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
25 SHAREDSTATEDIR=
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
26 LOCALSTATEDIR=
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
27 INCLUDEDIR=
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
28 INFODIR=
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
29 MANDIR=
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
30
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
31 # custom variables
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
32
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
33 # features
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
34
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
35 # clean abort
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
36 abort_configure()
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
37 {
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
38 rm -Rf "$TEMP_DIR"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
39 exit 1
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
40 }
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
41
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
42 # help text
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
43 printhelp()
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
44 {
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
45 echo "Usage: $0 [OPTIONS]..."
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
46 cat << __EOF__
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
47 Installation directories:
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
48 --prefix=PREFIX path prefix for architecture-independent files
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
49 [/usr]
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
50 --exec-prefix=EPREFIX path prefix for architecture-dependent files
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
51 [PREFIX]
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
52
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
53 --bindir=DIR user executables [EPREFIX/bin]
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
54 --sbindir=DIR system admin executables [EPREFIX/sbin]
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
55 --libexecdir=DIR program executables [EPREFIX/libexec]
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
56 --sysconfdir=DIR system configuration files [PREFIX/etc]
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
57 --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
58 --localstatedir=DIR modifiable single-machine data [PREFIX/var]
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
59 --libdir=DIR object code libraries [EPREFIX/lib]
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
60 --includedir=DIR C header files [PREFIX/include]
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
61 --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
62 --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
63 --infodir=DIR info documentation [DATAROOTDIR/info]
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
64 --mandir=DIR man documentation [DATAROOTDIR/man]
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
65
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
66 __EOF__
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
67 }
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
68
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
69 #
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
70 # parse arguments
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
71 #
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
72 BUILD_TYPE="default"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
73 for ARG in "$@"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
74 do
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
75 case "$ARG" in
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
76 "--prefix="*) PREFIX=${ARG#--prefix=} ;;
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
77 "--exec-prefix="*) EPREFIX=${ARG#--exec-prefix=} ;;
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
78 "--bindir="*) BINDIR=${ARG#----bindir=} ;;
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
79 "--sbindir="*) SBINDIR=${ARG#--sbindir=} ;;
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
80 "--libdir="*) LIBDIR=${ARG#--libdir=} ;;
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
81 "--libexecdir="*) LIBEXECDIR=${ARG#--libexecdir=} ;;
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
82 "--datadir="*) DATADIR=${ARG#--datadir=} ;;
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
83 "--sysconfdir="*) SYSCONFDIR=${ARG#--sysconfdir=} ;;
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
84 "--sharedstatedir="*) SHAREDSTATEDIR=${ARG#--sharedstatedir=} ;;
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
85 "--localstatedir="*) LOCALSTATEDIR=${ARG#--localstatedir=} ;;
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
86 "--includedir="*) INCLUDEDIR=${ARG#--includedir=} ;;
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
87 "--infodir="*) INFODIR=${ARG#--infodir=} ;;
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
88 "--mandir"*) MANDIR=${ARG#--mandir} ;;
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
89 "--help"*) printhelp; abort_configure ;;
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
90 "--debug") BUILD_TYPE="debug" ;;
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
91 "--release") BUILD_TYPE="release" ;;
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
92 "-"*) echo "unknown option: $ARG"; abort_configure ;;
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
93 esac
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
94 done
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
95
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
96
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
97 # set dir variables
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
98 : ${EPREFIX:="$PREFIX"}
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
99 : ${BINDIR:="$EPREFIX/bin"}
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
100 : ${SBINDIR:="$EPREFIX/sbin"}
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
101 : ${LIBDIR:="$EPREFIX/lib"}
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
102 : ${LIBEXECDIR:="$EPREFIX/libexec"}
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
103 : ${DATADIR:="$PREFIX/share"}
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
104 : ${SYSCONFDIR:="$PREFIX/etc"}
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
105 : ${SHAREDSTATEDIR:="$PREFIX/com"}
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
106 : ${LOCALSTATEDIR:="$PREFIX/var"}
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
107 : ${INCLUDEDIR:="$PREFIX/include"}
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
108 : ${INFODIR:="$PREFIX/info"}
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
109 : ${MANDIR:="$PREFIX/man"}
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
110
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
111 # Test for availability of pkg-config
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
112 PKG_CONFIG=`command -v pkg-config`
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
113 : ${PKG_CONFIG:="false"}
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
114
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
115 # Simple uname based platform detection
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
116 # $PLATFORM is used for platform dependent dependency selection
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
117 OS=`uname -s`
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
118 OS_VERSION=`uname -r`
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
119 printf "detect platform... "
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
120 if [ "$OS" = "SunOS" ]; then
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
121 PLATFORM="solaris sunos unix svr4"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
122 fi
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
123 if [ "$OS" = "Linux" ]; then
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
124 PLATFORM="linux unix"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
125 fi
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
126 if [ "$OS" = "FreeBSD" ]; then
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
127 PLATFORM="freebsd bsd unix"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
128 fi
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
129 if [ "$OS" = "Darwin" ]; then
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
130 PLATFORM="macos osx bsd unix"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
131 fi
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
132 if echo "$OS" | grep -i "MINGW" > /dev/null; then
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
133 PLATFORM="windows mingw"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
134 fi
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
135 : ${PLATFORM:="unix"}
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
136
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
137 PLATFORM_NAME=`echo "$PLATFORM" | cut -f1 -d' ' -`
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
138 echo "$PLATFORM_NAME"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
139
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
140 isplatform()
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
141 {
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
142 for p in $PLATFORM
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
143 do
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
144 if [ "$p" = "$1" ]; then
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
145 return 0
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
146 fi
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
147 done
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
148 return 1
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
149 }
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
150 notisplatform()
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
151 {
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
152 for p in $PLATFORM
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
153 do
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
154 if [ "$p" = "$1" ]; then
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
155 return 1
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
156 fi
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
157 done
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
158 return 0
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
159 }
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
160
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
161
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
162 # generate vars.mk
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
163 cat > "$TEMP_DIR/vars.mk" << __EOF__
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
164 PREFIX="$PREFIX"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
165 EPREFIX="$EPREFIX"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
166 BINDIR="$BINDIR"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
167 SBINDIR="$SBINDIR"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
168 LIBDIR="$LIBDIR"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
169 LIBEXECDIR="$LIBEXECDIR"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
170 DATADIR="$DATADIR"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
171 SYSCONFDIR="$SYSCONFDIR"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
172 SHAREDSTATEDIR="$SHAREDSTATEDIR"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
173 LOCALSTATEDIR="$LOCALSTATEDIR"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
174 INCLUDEDIR="$INCLUDEDIR"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
175 INFODIR="$INFODIR"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
176 MANDIR="$MANDIR"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
177 __EOF__
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
178 sort -u -o "$TEMP_DIR/vars.mk" "$TEMP_DIR/vars.mk"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
179
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
180
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
181 # toolchain detection utilities
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
182 . make/toolchain.sh
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
183
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
184 #
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
185 # DEPENDENCIES
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
186 #
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
187
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
188 # check languages
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
189 lang_c=
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
190 lang_cpp=
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
191 if detect_c_compiler ; then
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
192 lang_c=1
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
193 fi
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
194
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
195 # create buffer for make variables required by dependencies
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
196 echo > "$TEMP_DIR/make.mk"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
197
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
198 test_pkg_config()
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
199 {
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
200 if "$PKG_CONFIG" --exists "$1" ; then :
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
201 else return 1 ; fi
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
202 if [ -z "$2" ] || "$PKG_CONFIG" --atleast-version="$2" "$1" ; then :
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
203 else return 1 ; fi
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
204 if [ -z "$3" ] || "$PKG_CONFIG" --exact-version="$3" "$1" ; then :
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
205 else return 1 ; fi
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
206 if [ -z "$4" ] || "$PKG_CONFIG" --max-version="$4" "$1" ; then :
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
207 else return 1 ; fi
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
208 return 0
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
209 }
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
210
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
211 dependency_error_sdl2_ttf()
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
212 {
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
213 printf "checking for sdl2_ttf... "
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
214 # dependency sdl2_ttf
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
215 while true
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
216 do
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
217 if [ -z "$PKG_CONFIG" ]; then
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
218 break
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
219 fi
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
220 if test_pkg_config "SDL2_ttf" "" "" "" ; then
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
221 TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags SDL2_ttf`"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
222 TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs SDL2_ttf`"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
223 else
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
224 break
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
225 fi
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
226 echo yes
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
227 return 1
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
228 done
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
229
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
230 echo no
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
231 return 0
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
232 }
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
233 dependency_error_sdl2()
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
234 {
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
235 printf "checking for sdl2... "
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
236 # dependency sdl2
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
237 while true
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
238 do
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
239 if [ -z "$PKG_CONFIG" ]; then
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
240 break
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
241 fi
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
242 if test_pkg_config "sdl2" "" "" "" ; then
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
243 TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags sdl2`"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
244 TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs sdl2`"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
245 else
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
246 break
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
247 fi
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
248 echo yes
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
249 return 1
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
250 done
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
251
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
252 echo no
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
253 return 0
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
254 }
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
255 dependency_error_glew()
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
256 {
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
257 printf "checking for glew... "
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
258 # dependency glew
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
259 while true
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
260 do
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
261 if [ -z "$PKG_CONFIG" ]; then
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
262 break
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
263 fi
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
264 if test_pkg_config "glew" "" "" "" ; then
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
265 TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags glew`"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
266 TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs glew`"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
267 else
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
268 break
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
269 fi
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
270 echo yes
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
271 return 1
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
272 done
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
273
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
274 echo no
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
275 return 0
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
276 }
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
277 dependency_error_ucx()
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
278 {
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
279 printf "checking for ucx... "
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
280 # dependency ucx
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
281 while true
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
282 do
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
283 if check_lib ucx cx/common.h > /dev/null ; then
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
284 :
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
285 else
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
286 break
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
287 fi
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
288 TEMP_LDFLAGS="$TEMP_LDFLAGS -lucx"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
289 echo yes
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
290 return 1
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
291 done
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
292
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
293 echo no
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
294 return 0
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
295 }
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
296
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
297
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
298
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
299
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
300 # start collecting dependency information
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
301 echo > "$TEMP_DIR/flags.mk"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
302
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
303 DEPENDENCIES_FAILED=
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
304 ERROR=0
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
305 # unnamed dependencies
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
306 TEMP_CFLAGS=
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
307 TEMP_CXXFLAGS=
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
308 TEMP_LDFLAGS=
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
309 while true
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
310 do
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
311 while true
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
312 do
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
313 if [ -z "$lang_c" ] ; then
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
314 ERROR=1
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
315 break
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
316 fi
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
317
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
318 break
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
319 done
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
320 break
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
321 done
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
322
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
323 # add general dependency flags to flags.mk
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
324 echo "# general flags" >> "$TEMP_DIR/flags.mk"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
325 if [ -n "${TEMP_CFLAGS}" -a -n "$lang_c" ]; then
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
326 echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
327 fi
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
328 if [ -n "${TEMP_CXXFLAGS}" -a -n "$lang_cpp" ]; then
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
329 echo "CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
330 fi
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
331 if [ -n "${TEMP_LDFLAGS}" ]; then
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
332 echo "LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
333 fi
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
334
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
335 #
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
336 # OPTION VALUES
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
337 #
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
338
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
339 #
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
340 # TARGETS
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
341 #
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
342
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
343 echo >> "$TEMP_DIR/flags.mk"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
344 echo "configuring target: default"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
345 echo "# flags for target default" >> "$TEMP_DIR/flags.mk"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
346 TEMP_CFLAGS=
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
347 TEMP_CXXFLAGS=
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
348 TEMP_LDFLAGS=
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
349
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
350 if dependency_error_sdl2_ttf; then
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
351 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED sdl2_ttf "
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
352 ERROR=1
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
353 fi
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
354 if dependency_error_sdl2; then
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
355 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED sdl2 "
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
356 ERROR=1
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
357 fi
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
358 if dependency_error_glew; then
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
359 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED glew "
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
360 ERROR=1
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
361 fi
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
362 if dependency_error_ucx; then
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
363 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED ucx "
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
364 ERROR=1
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
365 fi
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
366
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
367 # Features
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
368
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
369
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
370 if [ -n "${TEMP_CFLAGS}" -a -n "$lang_c" ]; then
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
371 echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
372 fi
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
373 if [ -n "${TEMP_CXXFLAGS}" -a -n "$lang_cpp" ]; then
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
374 echo "CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
375 fi
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
376 if [ "$BUILD_TYPE" = "debug" ]; then
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
377 if [ -n "$lang_c" ]; then
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
378 echo 'CFLAGS += ${DEBUG_CC_FLAGS}' >> "$TEMP_DIR/flags.mk"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
379 fi
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
380 if [ -n "$lang_cpp" ]; then
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
381 echo 'CXXFLAGS += ${DEBUG_CXX_FLAGS}' >> "$TEMP_DIR/flags.mk"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
382 fi
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
383 fi
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
384 if [ "$BUILD_TYPE" = "release" ]; then
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
385 if [ -n "$lang_c" ]; then
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
386 echo 'CFLAGS += ${RELEASE_CC_FLAGS}' >> "$TEMP_DIR/flags.mk"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
387 fi
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
388 if [ -n "$lang_cpp" ]; then
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
389 echo 'CXXFLAGS += ${RELEASE_CXX_FLAGS}' >> "$TEMP_DIR/flags.mk"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
390 fi
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
391 fi
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
392 if [ -n "${TEMP_LDFLAGS}" ]; then
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
393 echo "LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
394 fi
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
395
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
396
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
397 # final result
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
398 if [ $ERROR -ne 0 ]; then
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
399 echo
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
400 echo "Error: Unresolved dependencies"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
401 echo "$DEPENDENCIES_FAILED"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
402 abort_configure
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
403 fi
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
404
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
405 echo "configure finished"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
406 echo
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
407 echo "Build Config:"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
408 echo " PREFIX: $PREFIX"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
409 echo " TOOLCHAIN: $TOOLCHAIN_NAME"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
410 echo
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
411
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
412 # generate the config.mk file
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
413 cat > "$TEMP_DIR/config.mk" << __EOF__
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
414 #
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
415 # config.mk generated by configure
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
416 #
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
417
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
418 __EOF__
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
419 write_toolchain_defaults "$TEMP_DIR/toolchain.mk"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
420 cat "$TEMP_DIR/vars.mk" "$TEMP_DIR/toolchain.mk" "$TEMP_DIR/flags.mk" "$TEMP_DIR/make.mk" > config.mk
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
421 rm -Rf "$TEMP_DIR"
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
422
593b60458157 initial commit
Mike Becker <universe@uap-core.de>
parents:
diff changeset
423

mercurial