envadd.bat 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. rem Hack to change/add environment variables in the makefiles for the
  2. rem Windows platform.
  3. rem Copyright (C) 2003-2012 Free Software Foundation, Inc.
  4. rem This file is part of GNU Emacs.
  5. rem GNU Emacs is free software: you can redistribute it and/or modify
  6. rem it under the terms of the GNU General Public License as published by
  7. rem the Free Software Foundation, either version 3 of the License, or
  8. rem (at your option) any later version.
  9. rem GNU Emacs is distributed in the hope that it will be useful,
  10. rem but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. rem GNU General Public License for more details.
  13. rem You should have received a copy of the GNU General Public License
  14. rem along with GNU Emacs. If not, see http://www.gnu.org/licenses/.
  15. rem Usage:
  16. rem envadd "ENV1=VAL1" "ENV2=VAL2" ... /C <command line>
  17. rem
  18. rem The "/C" switch marks the end of environment variables, and the
  19. rem beginning of the command line.
  20. rem
  21. rem By Peter 'Luna' Runestig <peter@runestig.com> 2003
  22. :Loop
  23. if .%1% == ./C goto EndLoop
  24. rem just to avoid an endless loop:
  25. if .%1% == . goto EndLoop
  26. set %1
  27. shift
  28. goto Loop
  29. :EndLoop
  30. rem Eat the "/C"
  31. shift
  32. rem Now, run the command line
  33. %1 %2 %3 %4 %5 %6 %7 %8 %9