configure

Wed, 06 Mar 2024 23:12:56 +0100

author
Mike Becker <universe@uap-core.de>
date
Wed, 06 Mar 2024 23:12:56 +0100
changeset 34
45d29d7221cc
parent 1
e3113d4e2fc0
permissions
-rwxr-xr-x

fix const-warning

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

mercurial