configure

Sun, 30 Nov 2025 22:16:31 +0100

author
Mike Becker <universe@uap-core.de>
date
Sun, 30 Nov 2025 22:16:31 +0100
changeset 100
714fbd1391a2
parent 94
48ebc3dd34a5
permissions
-rwxr-xr-x

update uwproj

72
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
1 #!/bin/sh
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
2
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
3
87
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
4 # some utility functions
72
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
5 isplatform()
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
6 {
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
7 for p in $PLATFORM
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
8 do
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
9 if [ "$p" = "$1" ]; then
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
10 return 0
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
11 fi
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
12 done
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
13 return 1
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
14 }
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
15 notisplatform()
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
16 {
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
17 for p in $PLATFORM
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
18 do
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
19 if [ "$p" = "$1" ]; then
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
20 return 1
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
21 fi
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
22 done
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
23 return 0
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
24 }
87
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
25 istoolchain()
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
26 {
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
27 for t in $TOOLCHAIN
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
28 do
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
29 if [ "$t" = "$1" ]; then
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
30 return 0
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
31 fi
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
32 done
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
33 return 1
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
34 }
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
35 notistoolchain()
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
36 {
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
37 for t in $TOOLCHAIN
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
38 do
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
39 if [ "$t" = "$1" ]; then
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
40 return 1
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
41 fi
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
42 done
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
43 return 0
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
44 }
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
45
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
46 # clean abort
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
47 abort_configure()
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
48 {
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
49 rm -Rf "$TEMP_DIR"
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
50 exit 1
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
51 }
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
52
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
53 # Test for availability of pkg-config
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
54 PKG_CONFIG=`command -v pkg-config`
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
55 : ${PKG_CONFIG:="false"}
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
56
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
57 # Simple uname based platform detection
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
58 # $PLATFORM is used for platform dependent dependency selection
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
59 OS=`uname -s`
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
60 OS_VERSION=`uname -r`
94
48ebc3dd34a5 update uwproj and UCX
Mike Becker <universe@uap-core.de>
parents: 93
diff changeset
61 ARCH=`uname -m`
87
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
62 printf "detect platform... "
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
63 if [ "$OS" = "SunOS" ]; then
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
64 PLATFORM="solaris sunos unix svr4"
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
65 elif [ "$OS" = "Linux" ]; then
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
66 PLATFORM="linux unix"
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
67 elif [ "$OS" = "FreeBSD" ]; then
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
68 PLATFORM="freebsd bsd unix"
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
69 elif [ "$OS" = "OpenBSD" ]; then
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
70 PLATFORM="openbsd bsd unix"
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
71 elif [ "$OS" = "NetBSD" ]; then
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
72 PLATFORM="netbsd bsd unix"
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
73 elif [ "$OS" = "Darwin" ]; then
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
74 PLATFORM="macos osx bsd unix"
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
75 elif echo "$OS" | grep -i "MINGW" > /dev/null; then
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
76 PLATFORM="windows mingw"
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
77 fi
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
78 : ${PLATFORM:="unix"}
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
79
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
80 PLATFORM_NAME=`echo "$PLATFORM" | cut -f1 -d' ' -`
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
81 echo "$PLATFORM_NAME"
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
82
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
83
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
84 # help text
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
85 printhelp()
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
86 {
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
87 echo "Usage: $0 [OPTIONS]..."
100
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
88 echo 'Configuration:'
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
89 if true \
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
90 ; then
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
91 :
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
92 fi
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
93 cat << '__EOF__'
87
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
94
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
95 Build Types:
93
661dd5f26bfd update uwproj
Mike Becker <universe@uap-core.de>
parents: 87
diff changeset
96 --debug add extra compile flags for debug builds
661dd5f26bfd update uwproj
Mike Becker <universe@uap-core.de>
parents: 87
diff changeset
97 --release add extra compile flags for release builds
87
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
98
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
99 __EOF__
100
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
100 abort_configure
87
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
101 }
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
102
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
103 # create temporary directory
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
104 TEMP_DIR=".tmp-`uname -n`"
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
105 rm -Rf "$TEMP_DIR"
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
106 if mkdir -p "$TEMP_DIR"; then
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
107 :
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
108 else
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
109 echo "Cannot create tmp dir $TEMP_DIR"
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
110 echo "Abort"
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
111 exit 1
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
112 fi
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
113 touch "$TEMP_DIR/options"
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
114 touch "$TEMP_DIR/features"
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
115
100
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
116 # config variables
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
117 if true \
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
118 ; then
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
119 :
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
120 if test -z "$RMDIR__initialized__"; then
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
121 RMDIR__initialized__=1
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
122 RMDIR='rm -fR'
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
123 fi
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
124 if test -z "$MKDIR__initialized__"; then
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
125 MKDIR__initialized__=1
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
126 MKDIR='mkdir -p'
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
127 fi
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
128 if test -z "$COPYFILE__initialized__"; then
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
129 COPYFILE__initialized__=1
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
130 COPYFILE='cp'
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
131 fi
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
132 if test -z "$AR__initialized__"; then
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
133 AR__initialized__=1
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
134 AR='ar cr'
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
135 fi
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
136 fi
87
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
137
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
138 # features
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
139
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
140 #
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
141 # parse arguments
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
142 #
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
143 BUILD_TYPE="default"
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
144 for ARG in "$@"
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
145 do
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
146 case "$ARG" in
100
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
147 "--help"*) printhelp ;;
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
148 "--debug") BUILD_TYPE="debug" ;;
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
149 "--release") BUILD_TYPE="release" ;;
87
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
150 "-"*) echo "unknown option: $ARG"; abort_configure ;;
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
151 esac
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
152 done
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
153
100
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
154 # toolchain detection utilities
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
155 . make/toolchain.sh
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
156
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
157 # check languages
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
158 lang_c=
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
159 lang_cpp=
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
160 if detect_c_compiler ; then
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
161 lang_c=1
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
162 fi
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
163
87
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
164
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
165
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
166 # set defaults for dir variables
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
167 : ${exec_prefix:="$prefix"}
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
168 : ${bindir:='${exec_prefix}/bin'}
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
169 : ${sbindir:='${exec_prefix}/sbin'}
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
170 : ${libdir:='${exec_prefix}/lib'}
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
171 : ${libexecdir:='${exec_prefix}/libexec'}
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
172 : ${datarootdir:='${prefix}/share'}
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
173 : ${datadir:='${datarootdir}'}
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
174 : ${sharedstatedir:='${prefix}/com'}
100
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
175 if [ -z "$sysconfdir" ]; then
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
176 if [ "$prefix" = '/usr' ]; then
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
177 sysconfdir='/etc'
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
178 else
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
179 sysconfdir='${prefix}/etc'
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
180 fi
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
181 fi
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
182 if [ -z "$localstatedir" ]; then
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
183 if [ "$prefix" = '/usr' ]; then
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
184 localstatedir='/var'
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
185 else
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
186 localstatedir='${prefix}/var'
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
187 fi
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
188 fi
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
189 if [ -z "$runstatedir" ]; then
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
190 if [ "$prefix" = '/usr' ]; then
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
191 runstatedir='/var/run'
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
192 else
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
193 runstatedir='${prefix}/var'
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
194 fi
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
195 fi
87
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
196 : ${includedir:='${prefix}/include'}
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
197 : ${infodir:='${datarootdir}/info'}
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
198 : ${mandir:='${datarootdir}/man'}
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
199 : ${localedir:='${datarootdir}/locale'}
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
200
93
661dd5f26bfd update uwproj
Mike Becker <universe@uap-core.de>
parents: 87
diff changeset
201
87
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
202 # check if a config.site exists and load it
100
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
203 CONFIG_SITE_OK=0
87
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
204 if [ -n "$CONFIG_SITE" ]; then
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
205 # CONFIG_SITE may contain space separated file names
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
206 for cs in $CONFIG_SITE; do
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
207 printf "loading defaults from $cs... "
100
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
208 if [ -f "$cs" ]; then
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
209 . "$cs"
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
210 echo ok
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
211 CONFIG_SITE_OK=1
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
212 break
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
213 else
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
214 echo "not found"
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
215 fi
87
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
216 done
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
217 elif [ -f "$prefix/share/config.site" ]; then
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
218 printf "loading site defaults... "
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
219 . "$prefix/share/config.site"
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
220 echo ok
100
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
221 CONFIG_SITE_OK=1
87
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
222 elif [ -f "$prefix/etc/config.site" ]; then
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
223 printf "loading site defaults... "
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
224 . "$prefix/etc/config.site"
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
225 echo ok
100
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
226 CONFIG_SITE_OK=1
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
227 fi
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
228
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
229 if [ $CONFIG_SITE_OK -eq 0 ]; then
94
48ebc3dd34a5 update uwproj and UCX
Mike Becker <universe@uap-core.de>
parents: 93
diff changeset
230 # try to detect the correct libdir on our own, except it was changed by the user
100
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
231 if [ "$libdir" = '${exec_prefix}/lib' ] ; then
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
232 if [ "$TOOLCHAIN_WSIZE" = "64" ] ; then
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
233 if [ "$OS" = "SunOS" ]; then
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
234 [ -d "${exec_prefix}/lib/64" ] && libdir='${exec_prefix}/lib/64'
94
48ebc3dd34a5 update uwproj and UCX
Mike Becker <universe@uap-core.de>
parents: 93
diff changeset
235 else
100
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
236 [ -d "${exec_prefix}/lib64" ] && libdir='${exec_prefix}/lib64'
94
48ebc3dd34a5 update uwproj and UCX
Mike Becker <universe@uap-core.de>
parents: 93
diff changeset
237 fi
100
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
238 elif [ "$TOOLCHAIN_WSIZE" = "32" ] ; then
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
239 if [ "$OS" = "SunOS" ]; then
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
240 [ -d "${exec_prefix}/lib/32" ] && libdir='${exec_prefix}/lib/32'
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
241 else
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
242 [ -d "${exec_prefix}/lib32" ] && libdir='${exec_prefix}/lib32'
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
243 fi
94
48ebc3dd34a5 update uwproj and UCX
Mike Becker <universe@uap-core.de>
parents: 93
diff changeset
244 fi
48ebc3dd34a5 update uwproj and UCX
Mike Becker <universe@uap-core.de>
parents: 93
diff changeset
245 fi
87
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
246 fi
72
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
247
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
248
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
249 # generate vars.mk
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
250 cat > "$TEMP_DIR/vars.mk" << __EOF__
100
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
251 RMDIR=$RMDIR
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
252 MKDIR=$MKDIR
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
253 COPYFILE=$COPYFILE
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
254 AR=$AR
72
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
255 __EOF__
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
256
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
257
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
258 #
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
259 # DEPENDENCIES
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
260 #
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
261
100
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
262
72
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
263
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
264 # create buffer for make variables required by dependencies
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
265 echo > "$TEMP_DIR/make.mk"
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
266
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
267 test_pkg_config()
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
268 {
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
269 if "$PKG_CONFIG" --exists "$1" ; then :
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
270 else return 1 ; fi
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
271 if [ -z "$2" ] || "$PKG_CONFIG" --atleast-version="$2" "$1" ; then :
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
272 else return 1 ; fi
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
273 if [ -z "$3" ] || "$PKG_CONFIG" --exact-version="$3" "$1" ; then :
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
274 else return 1 ; fi
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
275 if [ -z "$4" ] || "$PKG_CONFIG" --max-version="$4" "$1" ; then :
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
276 else return 1 ; fi
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
277 return 0
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
278 }
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
279
87
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
280 print_check_msg()
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
281 {
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
282 if [ -z "$1" ]; then
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
283 shift
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
284 printf "$@"
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
285 fi
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
286 }
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
287
72
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
288 dependency_error_ucx()
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
289 {
87
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
290 print_check_msg "$dep_checked_ucx" "checking for ucx... "
72
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
291 # dependency ucx
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
292 while true
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
293 do
94
48ebc3dd34a5 update uwproj and UCX
Mike Becker <universe@uap-core.de>
parents: 93
diff changeset
294 if [ -z "$PKG_CONFIG" ]; then
48ebc3dd34a5 update uwproj and UCX
Mike Becker <universe@uap-core.de>
parents: 93
diff changeset
295 break
48ebc3dd34a5 update uwproj and UCX
Mike Becker <universe@uap-core.de>
parents: 93
diff changeset
296 fi
48ebc3dd34a5 update uwproj and UCX
Mike Becker <universe@uap-core.de>
parents: 93
diff changeset
297 if test_pkg_config "ucx" "3.2" "" "" ; then
48ebc3dd34a5 update uwproj and UCX
Mike Becker <universe@uap-core.de>
parents: 93
diff changeset
298 TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags ucx`"
48ebc3dd34a5 update uwproj and UCX
Mike Becker <universe@uap-core.de>
parents: 93
diff changeset
299 TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs ucx`"
72
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
300 else
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
301 break
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
302 fi
87
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
303 print_check_msg "$dep_checked_ucx" "yes\n"
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
304 dep_checked_ucx=1
72
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
305 return 1
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
306 done
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
307
87
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
308 print_check_msg "$dep_checked_ucx" "no\n"
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
309 dep_checked_ucx=1
72
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
310 return 0
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
311 }
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
312
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
313 # start collecting dependency information
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
314 echo > "$TEMP_DIR/flags.mk"
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
315
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
316 DEPENDENCIES_FAILED=
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
317 ERROR=0
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
318 # unnamed dependencies
87
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
319 TEMP_CFLAGS="$CFLAGS"
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
320 TEMP_CXXFLAGS="$CXXFLAGS"
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
321 TEMP_LDFLAGS="$LDFLAGS"
72
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
322 while true
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
323 do
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
324 while true
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
325 do
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
326 if [ -z "$lang_c" ] ; then
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
327 ERROR=1
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
328 break
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
329 fi
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
330
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
331 break
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
332 done
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
333 break
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
334 done
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
335
93
661dd5f26bfd update uwproj
Mike Becker <universe@uap-core.de>
parents: 87
diff changeset
336 # build type
661dd5f26bfd update uwproj
Mike Becker <universe@uap-core.de>
parents: 87
diff changeset
337 if [ "$BUILD_TYPE" = "debug" ]; then
94
48ebc3dd34a5 update uwproj and UCX
Mike Becker <universe@uap-core.de>
parents: 93
diff changeset
338 TEMP_CFLAGS="\${DEBUG_CFLAGS} $TEMP_CFLAGS"
48ebc3dd34a5 update uwproj and UCX
Mike Becker <universe@uap-core.de>
parents: 93
diff changeset
339 TEMP_CXXFLAGS="\${DEBUG_CXXFLAGS} $TEMP_CXXFLAGS"
93
661dd5f26bfd update uwproj
Mike Becker <universe@uap-core.de>
parents: 87
diff changeset
340 fi
661dd5f26bfd update uwproj
Mike Becker <universe@uap-core.de>
parents: 87
diff changeset
341 if [ "$BUILD_TYPE" = "release" ]; then
94
48ebc3dd34a5 update uwproj and UCX
Mike Becker <universe@uap-core.de>
parents: 93
diff changeset
342 TEMP_CFLAGS="\${RELEASE_CFLAGS} $TEMP_CFLAGS"
48ebc3dd34a5 update uwproj and UCX
Mike Becker <universe@uap-core.de>
parents: 93
diff changeset
343 TEMP_CXXFLAGS="\${RELEASE_CXXFLAGS} $TEMP_CXXFLAGS"
93
661dd5f26bfd update uwproj
Mike Becker <universe@uap-core.de>
parents: 87
diff changeset
344 fi
661dd5f26bfd update uwproj
Mike Becker <universe@uap-core.de>
parents: 87
diff changeset
345
72
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
346 # add general dependency flags to flags.mk
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
347 echo "# general flags" >> "$TEMP_DIR/flags.mk"
87
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
348 if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then
72
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
349 echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk"
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
350 fi
87
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
351 if [ -n "${TEMP_CXXFLAGS}" ] && [ -n "$lang_cpp" ]; then
72
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
352 echo "CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk"
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
353 fi
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
354 if [ -n "${TEMP_LDFLAGS}" ]; then
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
355 echo "LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk"
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
356 fi
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
357
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
358 #
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
359 # OPTION VALUES
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
360 #
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
361
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
362 #
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
363 # TARGETS
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
364 #
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
365
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
366 echo >> "$TEMP_DIR/flags.mk"
87
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
367 echo "configuring target: default"
72
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
368 echo "# flags for target default" >> "$TEMP_DIR/flags.mk"
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
369 TEMP_CFLAGS=
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
370 TEMP_CXXFLAGS=
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
371 TEMP_LDFLAGS=
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
372
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
373 if dependency_error_ucx; then
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
374 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED ucx "
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
375 ERROR=1
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
376 fi
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
377
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
378 # Features
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
379
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
380
87
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
381 if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then
72
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
382 echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk"
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
383 fi
87
a53fa82bbdcf upgrade uwproj and add lib target and README
Mike Becker <universe@uap-core.de>
parents: 74
diff changeset
384 if [ -n "${TEMP_CXXFLAGS}" ] && [ -n "$lang_cpp" ]; then
72
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
385 echo "CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk"
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
386 fi
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
387 if [ -n "${TEMP_LDFLAGS}" ]; then
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
388 echo "LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk"
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
389 fi
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
390
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
391
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
392 # final result
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
393 if [ $ERROR -ne 0 ]; then
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
394 echo
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
395 echo "Error: Unresolved dependencies"
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
396 echo "$DEPENDENCIES_FAILED"
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
397 abort_configure
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
398 fi
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
399
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
400 echo "configure finished"
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
401 echo
100
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
402 echo "Toolchain:"
93
661dd5f26bfd update uwproj
Mike Becker <universe@uap-core.de>
parents: 87
diff changeset
403 echo " name: $TOOLCHAIN_NAME"
661dd5f26bfd update uwproj
Mike Becker <universe@uap-core.de>
parents: 87
diff changeset
404 if [ -n "$TOOLCHAIN_CC" ]; then
661dd5f26bfd update uwproj
Mike Becker <universe@uap-core.de>
parents: 87
diff changeset
405 echo " cc: $TOOLCHAIN_CC"
661dd5f26bfd update uwproj
Mike Becker <universe@uap-core.de>
parents: 87
diff changeset
406 fi
661dd5f26bfd update uwproj
Mike Becker <universe@uap-core.de>
parents: 87
diff changeset
407 if [ -n "$TOOLCHAIN_CXX" ]; then
661dd5f26bfd update uwproj
Mike Becker <universe@uap-core.de>
parents: 87
diff changeset
408 echo " cxx: $TOOLCHAIN_CXX"
661dd5f26bfd update uwproj
Mike Becker <universe@uap-core.de>
parents: 87
diff changeset
409 fi
661dd5f26bfd update uwproj
Mike Becker <universe@uap-core.de>
parents: 87
diff changeset
410 if [ -n "$TOOLCHAIN_WSIZE" ]; then
661dd5f26bfd update uwproj
Mike Becker <universe@uap-core.de>
parents: 87
diff changeset
411 echo " word size: $TOOLCHAIN_WSIZE bit"
661dd5f26bfd update uwproj
Mike Becker <universe@uap-core.de>
parents: 87
diff changeset
412 fi
661dd5f26bfd update uwproj
Mike Becker <universe@uap-core.de>
parents: 87
diff changeset
413 if [ -n "$TOOLCHAIN_CSTD" ]; then
661dd5f26bfd update uwproj
Mike Becker <universe@uap-core.de>
parents: 87
diff changeset
414 echo " default C std: $TOOLCHAIN_CSTD"
661dd5f26bfd update uwproj
Mike Becker <universe@uap-core.de>
parents: 87
diff changeset
415 fi
661dd5f26bfd update uwproj
Mike Becker <universe@uap-core.de>
parents: 87
diff changeset
416 echo
100
714fbd1391a2 update uwproj
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
417 echo "Config:"
72
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
418 echo
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
419
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
420 # generate the config.mk file
93
661dd5f26bfd update uwproj
Mike Becker <universe@uap-core.de>
parents: 87
diff changeset
421 pwd=`pwd`
72
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
422 cat > "$TEMP_DIR/config.mk" << __EOF__
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
423 #
93
661dd5f26bfd update uwproj
Mike Becker <universe@uap-core.de>
parents: 87
diff changeset
424 # config.mk generated by:
661dd5f26bfd update uwproj
Mike Becker <universe@uap-core.de>
parents: 87
diff changeset
425 # pwd: $pwd
661dd5f26bfd update uwproj
Mike Becker <universe@uap-core.de>
parents: 87
diff changeset
426 # $0 $@
72
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
427 #
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
428
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
429 __EOF__
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
430 write_toolchain_defaults "$TEMP_DIR/toolchain.mk"
93
661dd5f26bfd update uwproj
Mike Becker <universe@uap-core.de>
parents: 87
diff changeset
431 cat "$TEMP_DIR/config.mk" "$TEMP_DIR/vars.mk" "$TEMP_DIR/toolchain.mk" "$TEMP_DIR/flags.mk" "$TEMP_DIR/make.mk" > config.mk
72
b533da8e7411 use uwproj for build config generation
Mike Becker <universe@uap-core.de>
parents:
diff changeset
432 rm -Rf "$TEMP_DIR"

mercurial