102:bc7837852b7c | 103:01ec9f32835e |
---|---|
174 : ${PLATFORM:="unix"} | 174 : ${PLATFORM:="unix"} |
175 | 175 |
176 PLATFORM_NAME=`echo "$PLATFORM" | cut -f1 -d' ' -` | 176 PLATFORM_NAME=`echo "$PLATFORM" | cut -f1 -d' ' -` |
177 echo "$PLATFORM_NAME" | 177 echo "$PLATFORM_NAME" |
178 | 178 |
179 TOOLCHAIN= | |
180 | |
179 isplatform() | 181 isplatform() |
180 { | 182 { |
181 for p in $PLATFORM | 183 for p in $PLATFORM |
182 do | 184 do |
183 if [ "$p" = "$1" ]; then | 185 if [ "$p" = "$1" ]; then |
189 notisplatform() | 191 notisplatform() |
190 { | 192 { |
191 for p in $PLATFORM | 193 for p in $PLATFORM |
192 do | 194 do |
193 if [ "$p" = "$1" ]; then | 195 if [ "$p" = "$1" ]; then |
196 return 1 | |
197 fi | |
198 done | |
199 return 0 | |
200 } | |
201 istoolchain() | |
202 { | |
203 for t in $TOOLCHAIN | |
204 do | |
205 if [ "$t" = "$1" ]; then | |
206 return 0 | |
207 fi | |
208 done | |
209 return 1 | |
210 } | |
211 notistoolchain() | |
212 { | |
213 for t in $TOOLCHAIN | |
214 do | |
215 if [ "$t" = "$1" ]; then | |
194 return 1 | 216 return 1 |
195 fi | 217 fi |
196 done | 218 done |
197 return 0 | 219 return 0 |
198 } | 220 } |
235 lang_cpp=1 | 257 lang_cpp=1 |
236 fi | 258 fi |
237 if detect_c_compiler ; then | 259 if detect_c_compiler ; then |
238 lang_c=1 | 260 lang_c=1 |
239 fi | 261 fi |
262 TOOLCHAIN=$TOOLCHAIN_NAME | |
240 | 263 |
241 # create buffer for make variables required by dependencies | 264 # create buffer for make variables required by dependencies |
242 echo > "$TEMP_DIR/make.mk" | 265 echo > "$TEMP_DIR/make.mk" |
243 | 266 |
244 test_pkg_config() | 267 test_pkg_config() |
305 return 0 | 328 return 0 |
306 } | 329 } |
307 dependency_error_openssl() | 330 dependency_error_openssl() |
308 { | 331 { |
309 print_check_msg "$dep_checked_openssl" "checking for openssl... " | 332 print_check_msg "$dep_checked_openssl" "checking for openssl... " |
310 # dependency openssl | 333 # dependency openssl toolchain="clang" |
311 while true | 334 while true |
312 do | 335 do |
336 if notistoolchain "clang"; then | |
337 break | |
338 fi | |
313 if [ -z "$lang_c" ] ; then | 339 if [ -z "$lang_c" ] ; then |
314 break | 340 break |
315 fi | 341 fi |
316 if [ -z "$PKG_CONFIG" ]; then | 342 if [ -z "$PKG_CONFIG" ]; then |
317 break | 343 break |
320 TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags openssl`" | 346 TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags openssl`" |
321 TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs openssl`" | 347 TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs openssl`" |
322 else | 348 else |
323 break | 349 break |
324 fi | 350 fi |
351 TEMP_CFLAGS="$TEMP_CFLAGS -DOPENSSL_CLANG" | |
325 print_check_msg "$dep_checked_openssl" "yes\n" | 352 print_check_msg "$dep_checked_openssl" "yes\n" |
326 dep_checked_openssl=1 | 353 dep_checked_openssl=1 |
327 return 1 | 354 return 1 |
328 done | 355 done |
329 | 356 |
332 do | 359 do |
333 if notisplatform "bsd"; then | 360 if notisplatform "bsd"; then |
334 break | 361 break |
335 fi | 362 fi |
336 TEMP_LDFLAGS="$TEMP_LDFLAGS -lssl -lcrypto" | 363 TEMP_LDFLAGS="$TEMP_LDFLAGS -lssl -lcrypto" |
364 print_check_msg "$dep_checked_openssl" "yes\n" | |
365 dep_checked_openssl=1 | |
366 return 1 | |
367 done | |
368 | |
369 # dependency openssl | |
370 while true | |
371 do | |
372 if [ -z "$lang_c" ] ; then | |
373 break | |
374 fi | |
375 if [ -z "$PKG_CONFIG" ]; then | |
376 break | |
377 fi | |
378 if test_pkg_config "openssl" "" "" "" ; then | |
379 TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags openssl`" | |
380 TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs openssl`" | |
381 else | |
382 break | |
383 fi | |
337 print_check_msg "$dep_checked_openssl" "yes\n" | 384 print_check_msg "$dep_checked_openssl" "yes\n" |
338 dep_checked_openssl=1 | 385 dep_checked_openssl=1 |
339 return 1 | 386 return 1 |
340 done | 387 done |
341 | 388 |
405 if [ -z "$lang_c" ] ; then | 452 if [ -z "$lang_c" ] ; then |
406 ERROR=1 | 453 ERROR=1 |
407 break | 454 break |
408 fi | 455 fi |
409 | 456 |
457 break | |
458 done | |
459 break | |
460 done | |
461 while true | |
462 do | |
463 if notistoolchain "gcc"; then | |
464 break | |
465 fi | |
466 while true | |
467 do | |
468 | |
469 TEMP_CFLAGS="$TEMP_CFLAGS -DTOOLCHAIN_GCC" | |
470 break | |
471 done | |
472 break | |
473 done | |
474 while true | |
475 do | |
476 if notistoolchain "clang"; then | |
477 break | |
478 fi | |
479 while true | |
480 do | |
481 | |
482 TEMP_CFLAGS="$TEMP_CFLAGS -DTOOLCHAIN_CLANG" | |
483 break | |
484 done | |
485 break | |
486 done | |
487 while true | |
488 do | |
489 if isplatform "gcc" || istoolchain "gcc"; then | |
490 break | |
491 fi | |
492 while true | |
493 do | |
494 | |
495 TEMP_CFLAGS="$TEMP_CFLAGS -DNOT_TOOLCHAIN_GCC" | |
496 break | |
497 done | |
498 break | |
499 done | |
500 while true | |
501 do | |
502 if isplatform "clang" || istoolchain "clang"; then | |
503 break | |
504 fi | |
505 while true | |
506 do | |
507 | |
508 TEMP_CFLAGS="$TEMP_CFLAGS -DNOT_TOOLCHAIN_CLANG" | |
410 break | 509 break |
411 done | 510 done |
412 break | 511 break |
413 done | 512 done |
414 | 513 |