configure

Sun, 10 Nov 2024 13:54:17 +0100

author
Mike Becker <universe@uap-core.de>
date
Sun, 10 Nov 2024 13:54:17 +0100
changeset 76
d11c154e33e1
parent 74
ed9a5ffd1f13
permissions
-rwxr-xr-x

fix zero-terminator written to wrong position when encountering too long lines - fixes #490

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

mercurial