| 1 |
|
| 2 |
#@ $pp_platform: set to the platform identifier (eg, "aix", "linux" etc.)
|
| 3 |
pp_platform=
|
| 4 |
|
| 5 |
#@ pp_set_platform(): sets the $pp_platform variable
|
| 6 |
# If --platform is provided, use that and check in the $pp_platforms list
|
| 7 |
# Otherwise probe each backend to see if it recognises `uname -s`
|
| 8 |
# Uses the $pp_platforms global variable.
|
| 9 |
pp_set_platform () {
|
| 10 |
if test -n "$pp_opt_platform"; then
|
| 11 |
pp_contains "$pp_platforms" "$pp_opt_platform" ||
|
| 12 |
pp_die "$pp_opt_platform: unknown platform"
|
| 13 |
pp_platform="$pp_opt_platform"
|
| 14 |
else
|
| 15 |
uname_s=`uname -s 2>/dev/null`
|
| 16 |
pp_platform=
|
| 17 |
for p in $pp_platforms; do
|
| 18 |
pp_debug "probing for platform $p"
|
| 19 |
if eval pp_backend_${p}_detect "$uname_s"; then
|
| 20 |
pp_platform="$p"
|
| 21 |
break;
|
| 22 |
fi
|
| 23 |
done
|
| 24 |
test -z "$pp_platform" &&
|
| 25 |
pp_die "cannot detect platform (supported: $pp_platforms)"
|
| 26 |
fi
|
| 27 |
pp_debug "pp_platform = $pp_platform"
|
| 28 |
}
|