2
0

osguess.sh 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #
  2. # This script can be used to automatically guess target OS.
  3. # It requires the config.guess utility which is a part of GNU Autoconf.
  4. # GNU Autoconf can be downloaded from ftp://ftp.gnu.org/gnu/autoconf/
  5. #
  6. # Use "default" as a make target for automatic builds.
  7. #
  8. # Specify path to the config.guess utility (unless set via environment)
  9. #CONFIG_GUESS_PATH=
  10. if [ x"$CONFIG_GUESS_PATH" = x ]; then
  11. echo "Error: CONFIG_GUESS_PATH variable is not set"
  12. exit 1
  13. fi
  14. if [ ! -f "$CONFIG_GUESS_PATH/config.guess" ]; then
  15. echo "Can't find $CONFIG_GUESS_PATH/config.guess utility. Wrong path?"
  16. exit 1
  17. fi
  18. sys_info=`/bin/sh $CONFIG_GUESS_PATH/config.guess`
  19. echo "Building for $sys_info"
  20. case "$sys_info" in
  21. *-ibm-aix4* ) OS=AIX ;;
  22. *-freebsd* ) OS=FREEBSD ;;
  23. hppa*-hp-hpux11*) OS=HPUX ;;
  24. *-sgi-irix6* ) OS=IRIX ;;
  25. *-linux* ) OS=LINUX ;;
  26. *-netbsd* ) OS=NETBSD ;;
  27. *-openbsd* ) OS=OPENBSD ;;
  28. *-dec-osf* ) OS=OSF1 ;;
  29. *-solaris2* ) OS=SOLARIS ;;
  30. *-darwin* ) OS=DARWIN ;;
  31. * ) OS=
  32. echo "Sorry, unsupported OS"
  33. exit 1 ;;
  34. esac
  35. echo "Making with OS=$OS"