(args, compat)
| 430 | |
| 431 | |
| 432 | def set_env(args, compat): |
| 433 | global CONST_env, CONST_env_path, CONST_lib_dir |
| 434 | |
| 435 | CONST_env = """#!/bin/sh |
| 436 | # wasmedge shell setup |
| 437 | # affix colons on either side of $PATH to simplify matching |
| 438 | case :"${1}": in |
| 439 | *:"{0}/bin":*) |
| 440 | ;; |
| 441 | *) |
| 442 | # Prepend the path in case a system-installed wasmedge needs to be overridden |
| 443 | if [ -n "${1}" ]; then |
| 444 | export PATH="{0}/bin:$PATH" |
| 445 | else |
| 446 | export PATH="{0}/bin" |
| 447 | fi |
| 448 | ;; |
| 449 | esac |
| 450 | case :"${2}": in |
| 451 | *:"{0}/{6}":*) |
| 452 | ;; |
| 453 | *) |
| 454 | # Prepend the path in case system-installed wasmedge libraries need to be overridden |
| 455 | if [ -n "${2}" ]; then |
| 456 | export {2}="{0}/{6}:${2}" |
| 457 | else |
| 458 | export {2}="{0}/{6}" |
| 459 | fi |
| 460 | ;; |
| 461 | esac |
| 462 | case :"${3}": in |
| 463 | *:"{0}/{6}":*) |
| 464 | ;; |
| 465 | *) |
| 466 | if [ -n "${3}" ]; then |
| 467 | export LIBRARY_PATH="{0}/{6}:$LIBRARY_PATH" |
| 468 | else |
| 469 | export LIBRARY_PATH="{0}/{6}" |
| 470 | fi |
| 471 | ;; |
| 472 | esac |
| 473 | case :"${4}": in |
| 474 | *:"{0}/include":*) |
| 475 | ;; |
| 476 | *) |
| 477 | if [ -n "${4}" ]; then |
| 478 | export C_INCLUDE_PATH="{0}/include:$C_INCLUDE_PATH" |
| 479 | else |
| 480 | export C_INCLUDE_PATH="{0}/include" |
| 481 | fi |
| 482 | ;; |
| 483 | esac |
| 484 | case :"${5}": in |
| 485 | *:"{0}/include":*) |
| 486 | ;; |
| 487 | *) |
| 488 | if [ -n "${5}" ]; then |
| 489 | export CPLUS_INCLUDE_PATH="{0}/include:$CPLUS_INCLUDE_PATH" |
no test coverage detected