@@ -1079,7 +1079,7 @@ (define-public glibc
(string-append locale "/C.UTF-8")))))
,@(if (target-hurd?)
- '((add-after 'install 'augment-libc.so
+ `((add-after 'install 'augment-libc.so
(lambda* (#:key outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out")))
(substitute* (string-append out "/lib/libc.so")
@@ -1088,11 +1088,17 @@ (define-public glibc
" libmachuser.so libhurduser.so"))))))
(add-after 'install 'create-machine-symlink
(lambda* (#:key outputs #:allow-other-keys)
- (let ((out (assoc-ref outputs "out"))
- (cpu "i386"))
- (symlink cpu
- (string-append out
- "/include/mach/machine"))))))
+ (let* ((out (assoc-ref outputs "out"))
+ (cpu ,(match (or (%current-target-system)
+ (%current-system))
+ ((? target-x86-32?)
+ "i386")
+ ((? target-x86-64?)
+ "x86_64")))
+ (machine (string-append
+ out "/include/mach/machine")))
+ (unless (file-exists? machine)
+ (symlink cpu machine))))))
'()))))
(inputs `(("static-bash" ,static-bash)))
@@ -738,7 +738,7 @@ (define* (cross-libc* target
(delete 'install-utf8-c-locale)
,@(if (target-hurd? target)
- '((add-after 'install 'augment-libc.so
+ `((add-after 'install 'augment-libc.so
(lambda* (#:key outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out")))
(substitute* (string-append out "/lib/libc.so")
@@ -747,11 +747,16 @@ (define* (cross-libc* target
" libmachuser.so libhurduser.so"))))))
(add-after 'install 'create-machine-symlink
(lambda* (#:key outputs #:allow-other-keys)
- (let ((out (assoc-ref outputs "out"))
- (cpu "i386"))
- (symlink cpu
- (string-append out
- "/include/mach/machine"))))))
+ (let* ((out (assoc-ref outputs "out"))
+ (cpu ,(match target
+ ((? target-x86-32?)
+ "i386")
+ ((? target-x86-64?)
+ "x86_64")))
+ (machine (string-append
+ out "/include/mach/machine")))
+ (unless (file-exists? machine)
+ (symlink cpu machine))))))
'())))))
;; Shadow the native "kernel-headers" because glibc's recipe expects the