Changeset 30604 in project


Ignore:
Timestamp:
03/26/14 19:44:38 (7 years ago)
Author:
sjamaan
Message:

crypt: don't use -lcrypt on OpenBSD (crypt is part of libc there)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/crypt/trunk/crypt.setup

    r26464 r30604  
     1;; -*- Scheme -*-
     2
    13(use files)
    24
     
    1517
    1618(define *compile-features* '())
     19
     20;; OpenBSD is odd: it doesn't have libcrypt, crypt is part of libc
     21(define uses-libcrypt
     22  (cond ((get-environment-variable "FORCE_CRYPT_USE_LIBCRYPT")
     23         => (lambda (f)
     24              (or (string-ci=? f "true")
     25                  (string-ci=? f "1")
     26                  (string-ci=? f "yes"))))
     27        (else (cond-expand
     28                (openbsd #f)
     29                (else #t)))))
     30
     31(define libcrypt-flags
     32  (if uses-libcrypt '(-L -lcrypt) '()))
    1733
    1834(cond
     
    4157   (print "================================================================\n"))
    4258 
    43  ((try-compile libcrypt-presence-checker cflags: "-D_XOPEN_SOURCE" ldflags: "-lcrypt")
    44   (compile -C -D_XOPEN_SOURCE -L -lcrypt detect-native-crypt-features.scm)
     59 ((try-compile libcrypt-presence-checker
     60               cflags: "-D_XOPEN_SOURCE"
     61               ldflags: (if uses-libcrypt "-lcrypt" ""))
     62  (compile -C -D_XOPEN_SOURCE ,@libcrypt-flags detect-native-crypt-features.scm)
    4563  (run (./detect-native-crypt-features))
    4664  (let ((features (with-input-from-file "crypt-features" read)))
     
    5977
    6078(let* ((feature-flags (intersperse *compile-features* '-feature))
    61        (flags (if (null? feature-flags) '() `(-feature has-native-crypt
    62                                                        -feature ,@feature-flags))))
    63   (compile -s -O2 crypt.scm -L -lcrypt -C -D_XOPEN_SOURCE ,@flags -j crypt))
     79       (flags (if (null? feature-flags)
     80                  '()
     81                  `(-feature has-native-crypt -feature ,@feature-flags))))
     82  (compile -s -O2 crypt.scm ,@libcrypt-flags -C -D_XOPEN_SOURCE ,@flags -j crypt))
    6483
    6584(compile -s -O2 crypt.import.scm)
Note: See TracChangeset for help on using the changeset viewer.