Merge commit 'd360671c1cca335600079f1c5714572d1c2e676d'
[bpt/guile.git] / meta / guild.in
index be4e5b5..d501a0d 100755 (executable)
@@ -1,12 +1,14 @@
 #!/bin/sh
 # -*- scheme -*-
-exec guile $GUILE_FLAGS -e '(@@ (guild) main)' -s "$0" "$@"
+prefix="@prefix@"
+exec_prefix="@exec_prefix@"
+exec ${GUILE:-@bindir@/@guile_program_name@} $GUILE_FLAGS -e '(@@ (guild) main)' -s "$0" "$@"
 !#
 
 ;;;; guild --- running scripts bundled with Guile
 ;;;; Andy Wingo <wingo@pobox.com> --- April 2009
 ;;;; 
-;;;;   Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
+;;;;   Copyright (C) 2009, 2010, 2011, 2013 Free Software Foundation, Inc.
 ;;;; 
 ;;;; This library is free software; you can redistribute it and/or
 ;;;; modify it under the terms of the GNU Lesser General Public
@@ -39,8 +41,8 @@ exec guile $GUILE_FLAGS -e '(@@ (guild) main)' -s "$0" "$@"
     (version (single-char #\v))))
 
 (define (display-version)
-  (version-etc "GNU Guile"
-               (effective-version)
+  (version-etc "@PACKAGE_NAME@"
+               (version)
                #:command-name "guild"
                #:license *LGPLv3+*))
 
@@ -49,7 +51,13 @@ exec guile $GUILE_FLAGS -e '(@@ (guild) main)' -s "$0" "$@"
 
 (define (main args)
   (if (defined? 'setlocale)
-      (setlocale LC_ALL ""))
+      (catch 'system-error
+        (lambda ()
+          (setlocale LC_ALL ""))
+        (lambda args
+          (format (current-error-port)
+                  "warning: failed to install locale: ~a~%"
+                  (strerror (system-error-errno args))))))
 
   (let* ((options (getopt-long args *option-grammar*
                                #:stop-at-first-non-option #t))