build: Support i686, support development for arm.
* configure (CC32): Accept arm-* as 32 bit compiler. (check-compile-header-c, check-header-c): New functions. (parse-opts): New option: --with-courage. (main): Check for platform, stdio.h, limits.h.
This commit is contained in:
parent
7241756945
commit
c43e285de5
27
configure
vendored
27
configure
vendored
|
@ -139,26 +139,33 @@ exec ${GUILE} --no-auto-compile -L $(pwd) -e '(@@ (configure) main)' -s "$0" ${1
|
||||||
(define* (check-pkg-config package expected #:optional (deb #f))
|
(define* (check-pkg-config package expected #:optional (deb #f))
|
||||||
(check-version (format #f "pkg-config --modversion ~a" package) expected deb))
|
(check-version (format #f "pkg-config --modversion ~a" package) expected deb))
|
||||||
|
|
||||||
(define (check-compile-header-c++ header)
|
(define (check-compile-header-c header)
|
||||||
(and (= 0 (system (format #f "echo '#include \"~a\"' | gcc --language=c++ --std=c++11 -E - > /dev/null 2>&1" header)))
|
(and (= 0 (system (format #f "echo '#include ~s' | gcc -E - > /dev/null 2>&1" header)))
|
||||||
'yes))
|
'yes))
|
||||||
|
|
||||||
(define* (check-header-c++ header deb #:optional (check check-compile-header-c++))
|
(define (check-compile-header-c++ header)
|
||||||
|
(and (= 0 (system (format #f "echo '#include ~s' | gcc --language=c++ --std=c++11 -E - > /dev/null 2>&1" header)))
|
||||||
|
'yes))
|
||||||
|
|
||||||
|
(define* (check-header-c header deb #:optional (check check-compile-header-c))
|
||||||
(stderr "checking for ~a..." header)
|
(stderr "checking for ~a..." header)
|
||||||
(let ((result (check header)))
|
(let ((result (check header)))
|
||||||
(stderr " ~a\n" (if result result "no"))
|
(stderr " ~a\n" (if result result "no"))
|
||||||
(if (not result)
|
(if (not result)
|
||||||
(set! required (cons deb required)))))
|
(set! required (cons deb required)))))
|
||||||
|
|
||||||
|
(define* (check-header-c++ header deb #:optional (check check-compile-header-c++))
|
||||||
|
(check-header-c header deb check))
|
||||||
|
|
||||||
(define guix?
|
(define guix?
|
||||||
(and (zero? (system "guix --version &>/dev/null")) 1))
|
(and (zero? (system "guix --version 1>/dev/null 2>/dev/null")) 1))
|
||||||
;;;
|
;;;
|
||||||
|
|
||||||
(define CC (or (getenv "CC") "gcc"))
|
(define CC (or (getenv "CC") "gcc"))
|
||||||
(define BUILD_TRIPLET (gulp-pipe (string-append CC " -dumpmachine 2>/dev/null")))
|
(define BUILD_TRIPLET (gulp-pipe (string-append CC " -dumpmachine 2>/dev/null")))
|
||||||
(define ARCH (car (string-split BUILD_TRIPLET #\-)))
|
(define ARCH (car (string-split BUILD_TRIPLET #\-)))
|
||||||
(define CC32 (or (getenv "CC32")
|
(define CC32 (or (getenv "CC32")
|
||||||
(if (equal? ARCH "i686") CC
|
(if (member ARCH '("i686" "arm")) (string-append BUILD_TRIPLET "-" CC)
|
||||||
"i686-unknown-linux-gnu-gcc")))
|
"i686-unknown-linux-gnu-gcc")))
|
||||||
|
|
||||||
(define (parse-opts args)
|
(define (parse-opts args)
|
||||||
|
@ -169,6 +176,7 @@ exec ${GUILE} --no-auto-compile -L $(pwd) -e '(@@ (configure) main)' -s "$0" ${1
|
||||||
(prefix (value #t))
|
(prefix (value #t))
|
||||||
(sysconfdir (value #t))
|
(sysconfdir (value #t))
|
||||||
(verbose (single-char #\v))
|
(verbose (single-char #\v))
|
||||||
|
(with-courage)
|
||||||
;;ignore
|
;;ignore
|
||||||
(enable-fast-install)))
|
(enable-fast-install)))
|
||||||
(options (getopt-long args option-spec))
|
(options (getopt-long args option-spec))
|
||||||
|
@ -187,6 +195,7 @@ Usage: ./configure [OPTION]...
|
||||||
--prefix=DIR install in PREFIX [~a]
|
--prefix=DIR install in PREFIX [~a]
|
||||||
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
|
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
|
||||||
-v, --verbose be verbose
|
-v, --verbose be verbose
|
||||||
|
--with-courage assert being courageous to configure for unsupported platform
|
||||||
" PREFIX)
|
" PREFIX)
|
||||||
(exit (or (and usage? 2) 0)))
|
(exit (or (and usage? 2) 0)))
|
||||||
options)))
|
options)))
|
||||||
|
@ -197,10 +206,16 @@ Usage: ./configure [OPTION]...
|
||||||
(host-triplet (option-ref options 'host BUILD_TRIPLET))
|
(host-triplet (option-ref options 'host BUILD_TRIPLET))
|
||||||
(prefix (option-ref options 'prefix PREFIX))
|
(prefix (option-ref options 'prefix PREFIX))
|
||||||
(sysconfdir (option-ref options 'sysconfdir SYSCONFDIR))
|
(sysconfdir (option-ref options 'sysconfdir SYSCONFDIR))
|
||||||
(verbose? (option-ref options 'verbose #f)))
|
(verbose? (option-ref options 'verbose #f))
|
||||||
|
(with-courage? (option-ref options 'with-courage #f)))
|
||||||
(set! *verbose?* verbose?)
|
(set! *verbose?* verbose?)
|
||||||
(check-version 'bash '(4 0))
|
(check-version 'bash '(4 0))
|
||||||
|
(when (and (not (member ARCH '("i686" "x86_64"))) (not with-courage?))
|
||||||
|
(stderr "platform not supported: ~a, try --with-courage\n" ARCH)
|
||||||
|
(exit 1))
|
||||||
(check-version CC '(4 8))
|
(check-version CC '(4 8))
|
||||||
|
(check-header-c "stdio.h" "libc-dev")
|
||||||
|
(check-header-c "limits.h" "linux-headers")
|
||||||
(check-version CC32 '(4 8))
|
(check-version CC32 '(4 8))
|
||||||
(check-version 'guile '(2 0))
|
(check-version 'guile '(2 0))
|
||||||
(check-version 'make '(4 0))
|
(check-version 'make '(4 0))
|
||||||
|
|
15
guix.scm
15
guix.scm
|
@ -97,16 +97,19 @@
|
||||||
(sha256
|
(sha256
|
||||||
(base32 "1ynr0hc0k15307sgzv09k3y5rvy46h0wbh7zcblx1f9v7y8k90zv"))))
|
(base32 "1ynr0hc0k15307sgzv09k3y5rvy46h0wbh7zcblx1f9v7y8k90zv"))))
|
||||||
(build-system gnu-build-system)
|
(build-system gnu-build-system)
|
||||||
(supported-systems '("x86_64-linux"))
|
(supported-systems '("i686-linux" "x86_64-linux"))
|
||||||
(propagated-inputs
|
(propagated-inputs
|
||||||
`(("nyacc" ,nyacc)))
|
`(("nyacc" ,nyacc)))
|
||||||
(native-inputs
|
(native-inputs
|
||||||
`(("guile" ,guile-2.2)
|
`(("guile" ,guile-2.2)
|
||||||
;; Use cross-compiler rather than #:system "i686-linux" to get
|
,@(if (or (equal? (%current-system) "x86_64-linux")
|
||||||
;; MesCC 64 bit .go files installed ready for use with Guile.
|
(equal? (%current-target-system) "x86_64-linux"))
|
||||||
("i686-linux-binutils" ,(cross-binutils triplet))
|
;; Use cross-compiler rather than #:system "i686-linux" to get
|
||||||
("i686-linux-gcc" ,(let ((triplet triplet)) (cross-gcc triplet)))
|
;; MesCC 64 bit .go files installed ready for use with Guile.
|
||||||
("perl" ,perl))) ;build-aux/gitlog-to-changelog
|
`(("i686-linux-binutils" ,(cross-binutils triplet))
|
||||||
|
("i686-linux-gcc" ,(cross-gcc triplet)))
|
||||||
|
'())
|
||||||
|
("perl" ,perl))) ;build-aux/gitlog-to-changelog
|
||||||
(arguments
|
(arguments
|
||||||
`(#:phases
|
`(#:phases
|
||||||
(modify-phases %standard-phases
|
(modify-phases %standard-phases
|
||||||
|
|
Loading…
Reference in a new issue