mozprog.m4 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. dnl This Source Code Form is subject to the terms of the Mozilla Public
  2. dnl License, v. 2.0. If a copy of the MPL was not distributed with this
  3. dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
  4. AC_DEFUN([MOZ_PROG_CHECKMSYS],
  5. [AC_REQUIRE([AC_INIT_BINSH])dnl
  6. if test `uname -s | grep -c MINGW 2>/dev/null` != "0"; then
  7. msyshost=1
  8. fi
  9. ])
  10. AC_DEFUN([MOZ_PATH_PROG],
  11. [ AC_PATH_PROG($1,$2,$3,$4)
  12. if test "$msyshost"; then
  13. case "[$]$1" in
  14. /*)
  15. tmp_DIRNAME=`dirname "[$]$1"`
  16. tmp_BASENAME=`basename "[$]$1"`
  17. tmp_PWD=`cd "$tmp_DIRNAME" && pwd -W`
  18. $1="$tmp_PWD/$tmp_BASENAME"
  19. if test -e "[$]$1.exe"; then
  20. $1="[$]$1.exe"
  21. fi
  22. esac
  23. fi
  24. ])
  25. AC_DEFUN([MOZ_PATH_PROGS],
  26. [ AC_PATH_PROGS($1,$2,$3,$4)
  27. if test "$msyshost"; then
  28. case "[$]$1" in
  29. /*)
  30. tmp_DIRNAME=`dirname "[$]$1"`
  31. tmp_BASENAME=`basename "[$]$1"`
  32. tmp_PWD=`cd "$tmp_DIRNAME" && pwd -W`
  33. $1="$tmp_PWD/$tmp_BASENAME"
  34. if test -e "[$]$1.exe"; then
  35. $1="[$]$1.exe"
  36. fi
  37. esac
  38. fi
  39. ])