scheme48-config.in 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #! /usr/bin/env scheme-srfi-7
  2. ; Part of Scheme 48 1.9. See file COPYING for notices and license.
  3. ; Authors: Mike Sperber
  4. (program
  5. (requires srfi-37) ; args-fold
  6. (code
  7. (define (main args)
  8. (call-with-current-continuation
  9. (lambda (exit)
  10. (define maybe-space
  11. (let ((first? #t))
  12. (lambda ()
  13. (if first?
  14. (set! first? #f)
  15. (write-char #\space)))))
  16. (let ((options
  17. (list (option '(#\? #\h "help") #f #f
  18. (lambda (option name arg . stuff)
  19. (display "usage: ")
  20. (display (car args))
  21. (display " [--ld] [--cc] [--libs-external] [--cflags-external]")
  22. (newline)))
  23. (option '("ld") #f #f
  24. (lambda (option name arg . stuff)
  25. (maybe-space)
  26. (display "@LD@")))
  27. (option '("cc") #f #f
  28. (lambda (option name arg . stuff)
  29. (maybe-space)
  30. (display "@CC@")))
  31. (option '("libs-external") #f #f
  32. (lambda (option name arg . stuff)
  33. (maybe-space)
  34. (display "@DYNAMIC_EXTERNALS_LDFLAGS@")))
  35. (option '("cflags-external") #f #f
  36. (lambda (option name arg . stuff)
  37. (maybe-space)
  38. (display "@DYNAMIC_EXTERNALS_CFLAGS@")
  39. (display " -I@incdir@"))))))
  40. (args-fold (cdr args) options
  41. (lambda (option name arg . stuff)
  42. (display "unrecognized option: ")
  43. (display name)
  44. (newline)
  45. (exit -1))
  46. (lambda (operand . stuff)
  47. (display "extra command-line argument: ")
  48. (display operand)
  49. (newline)
  50. (exit -1))))))
  51. 0)))