config.scm.in 1.3 KB

123456789101112131415161718192021222324252627282930
  1. ;;; Guile-zstd --- GNU Guile bindings to the zstd compression library.
  2. ;;; Copyright © 2020 Ludovic Courtès <ludo@gnu.org>
  3. ;;;
  4. ;;; This file is part of Guile-zstd.
  5. ;;;
  6. ;;; Guile-zstd is free software; you can redistribute it and/or modify it
  7. ;;; under the terms of the GNU General Public License as published by
  8. ;;; the Free Software Foundation; either version 3 of the License, or (at
  9. ;;; your option) any later version.
  10. ;;;
  11. ;;; Guile-zstd is distributed in the hope that it will be useful, but
  12. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. ;;; GNU General Public License for more details.
  15. ;;;
  16. ;;; You should have received a copy of the GNU General Public License
  17. ;;; along with Guile-zstd. If not, see <http://www.gnu.org/licenses/>.
  18. (define-module (zstd config)
  19. #:export (%zstd-library-file-name))
  20. (define %zstd-library-file-name
  21. ;; 'dynamic-link' in Guile >= 3.0.2 first looks up file names literally
  22. ;; (hence ".so.1"), which is not the case with older versions of Guile.
  23. (cond-expand ((not guile-3) "@ZSTD_LIBDIR@/libzstd")
  24. (else
  25. (if (string-contains %host-type "darwin")
  26. "@ZSTD_LIBDIR@/libzstd.1.dylib"
  27. "@ZSTD_LIBDIR@/libzstd.so.1"))))