Browse code

* use CC, CXX and MAKE internally and heed possible external environment variable of same name

Nat! authored on 20-09-2017 18:53:50
Showing 3 changed files
... ...
@@ -1,3 +1,7 @@
1
+### 3.13.1
2
+
3
+* use CC, CXX and MAKE internally and heed possible external environment variable of same name
4
+
1 5
 ## 3.13.0
2 6
 
3 7
 * add mulle-bootstrap log command, for looking at build logs of a specific dependency
... ...
@@ -31,7 +31,7 @@
31 31
 #
32 32
 MULLE_EXECUTABLE_VERSION_MAJOR=3
33 33
 MULLE_EXECUTABLE_VERSION_MINOR=13
34
-MULLE_EXECUTABLE_VERSION_PATCH=0
34
+MULLE_EXECUTABLE_VERSION_PATCH=1
35 35
 
36 36
 MULLE_EXECUTABLE_VERSION="${MULLE_EXECUTABLE_VERSION_MAJOR}.${MULLE_EXECUTABLE_VERSION_MINOR}.${MULLE_EXECUTABLE_VERSION_PATCH}"
37 37
 
... ...
@@ -211,8 +211,15 @@ tools_environment_common()
211 211
    local srcdir="$2"
212 212
 
213 213
    # no problem if those are empty
214
-   C_COMPILER="`find_compiler "${name}" "${srcdir}" CC`"
215
-   CXX_COMPILER="`find_compiler "${name}" "${srcdir}" CXX`"
214
+   if [ -z "${CC}" ]
215
+   then
216
+      CC="`find_compiler "${name}" "${srcdir}" CC`"
217
+   fi
218
+
219
+   if [ -z "${CXX}" ]
220
+   then
221
+      CXX="`find_compiler "${name}" "${srcdir}" CXX`"
222
+   fi
216 223
    TR="`verify_binary "tr" "tr" "tr"`"
217 224
    SED="`verify_binary "sed" "sed" "sed"`"
218 225
 }
... ...
@@ -236,23 +243,24 @@ tools_environment_make()
236 243
 
237 244
    tools_environment_common "$@"
238 245
 
239
-   local defaultmake
240
-
241
-   defaultmake="`platform_make "${C_COMPILER}"`"
246
+   if [ -z "${MAKE}" ]
247
+   then
248
+      defaultmake="`platform_make "${CC}"`"
242 249
 
243
-   case "${UNAME}" in
244
-      mingw)
245
-         MAKE="`find_make "${name}" "${defaultmake}"`"
246
-      ;;
250
+      case "${UNAME}" in
251
+         mingw)
252
+            MAKE="`find_make "${name}" "${defaultmake}"`"
253
+         ;;
247 254
 
248
-      darwin)
249
-         MAKE="`find_make "${name}"`"
250
-      ;;
255
+         darwin)
256
+            MAKE="`find_make "${name}"`"
257
+         ;;
251 258
 
252
-      *)
253
-         MAKE="`find_make "${name}"`"
254
-      ;;
255
-   esac
259
+         *)
260
+            MAKE="`find_make "${name}"`"
261
+         ;;
262
+      esac
263
+   fi
256 264
 }
257 265
 
258 266
 
... ...
@@ -267,8 +275,15 @@ tools_environment_cmake()
267 275
 
268 276
    defaultgenerator="`platform_cmake_generator "${MAKE}"`"
269 277
 
270
-   CMAKE="`find_cmake "${name}"`"
271
-   CMAKE_GENERATOR="`read_build_setting "${name}" "cmake_generator" "${defaultgenerator}"`"
278
+   if [ -z "${CMAKE}" ]
279
+   then
280
+      CMAKE="`find_cmake "${name}"`"
281
+   fi
282
+
283
+   if [ -z "${CMAKE_GENERATOR}" ]
284
+   then
285
+      CMAKE_GENERATOR="`read_build_setting "${name}" "cmake_generator" "${defaultgenerator}"`"
286
+   fi
272 287
 
273 288
    [ -z "${CMAKE_GENERATOR}" ]  && internal_fail "CMAKE_GENERATOR must not be empty"
274 289
 }
... ...
@@ -1043,13 +1058,13 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
1043 1058
    local c_compiler_line
1044 1059
    local cxx_compiler_line
1045 1060
 
1046
-   if [ ! -z "${C_COMPILER}" ]
1061
+   if [ ! -z "${CC}" ]
1047 1062
    then
1048
-      c_compiler_line="-DCMAKE_C_COMPILER='${C_COMPILER}'"
1063
+      c_compiler_line="-DCMAKE_C_COMPILER='${CC}'"
1049 1064
    fi
1050
-   if [ ! -z "${CXX_COMPILER}" ]
1065
+   if [ ! -z "${CXX}" ]
1051 1066
    then
1052
-      cxx_compiler_line="-DCMAKE_CXX_COMPILER='${CXX_COMPILER}'"
1067
+      cxx_compiler_line="-DCMAKE_CXX_COMPILER='${CXX}'"
1053 1068
    fi
1054 1069
 
1055 1070
    # linker="`read_build_setting "${name}" "LD"`"
... ...
@@ -1306,13 +1321,13 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
1306 1321
    local c_compiler_line
1307 1322
    local cxx_compiler_line
1308 1323
 
1309
-   if [ ! -z "${C_COMPILER}" ]
1324
+   if [ ! -z "${CC}" ]
1310 1325
    then
1311
-      c_compiler_line="CC='${C_COMPILER}'"
1326
+      c_compiler_line="CC='${CC}'"
1312 1327
    fi
1313
-   if [ ! -z "${CXX_COMPILER}" ]
1328
+   if [ ! -z "${CXX}" ]
1314 1329
    then
1315
-      cxx_compiler_line="CXX='${CXX_COMPILER}'"
1330
+      cxx_compiler_line="CXX='${CXX}'"
1316 1331
    fi
1317 1332
 
1318 1333
    mkdir_if_missing "${builddir}"