Skip to content

Commit

Permalink
Try minimal no module
Browse files Browse the repository at this point in the history
  • Loading branch information
Drew Crampsie authored and Drew Crampsie committed Apr 17, 2024
1 parent 3685613 commit 921b9bd
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 5 deletions.
28 changes: 28 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,34 @@ EOF
}


set_gerbil_gcc () {
echo "\n;; Added auto via ./configure\n(set! %default-gerbil-gcc \"$1\")" >> \
./src/gerbil/compiler/driver.ss
}

find_gerbil_gcc () {
local cc=''

[[ -n "${CC}" ]] && cc="$CC";
[[ -n "${GERBIL_GCC}" ]] && cc="$GERBIL_GCC";

if [[ -n "${cc}" ]];
then
set_gerbil_gcc "${cc}"
elif which gcc;
then
set_gerbil_gcc "$(which gcc)"
elif which cc ;
then
set_gerbil_gcc "$(which cc)"
else

echo "ERROR: Cannot find a C compiler.\nSet CC or GERBIL_GCC" && exit 42
fi
}

find_gerbil_gcc

std_patch_feature() {
sed -i -e "$1" src/std/build-features.ss
}
Expand Down
3 changes: 0 additions & 3 deletions src/build/build-bach.ss
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
(def (gerbil-gsc)
(getenv "GERBIL_GSC" default-gerbil-gsc))

(def (gerbil-gcc)
(getenv "GERBIL_GCC" "gcc"))

(def gerbil-bindir
(path-expand "bin" build-home))
(def gerbil-libdir
Expand Down
10 changes: 8 additions & 2 deletions src/gerbil/compiler/driver.ss
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ namespace: gxc
"base"
"compile"
"optimize")
(export compile-module compile-exe)
(export compile-module compile-exe gerbil-gcc)

(extern namespace: #f gerbil-path) ;; needed until bootstrap re-generated

(def default-gerbil-gsc
(path-expand "gsc" (path-expand "bin" (path-expand "~~"))))
(def default-gerbil-gcc "gcc")
(def %default-gerbil-gcc #f)
(def default-gerbil-ar "ar")

(def +driver-mutex+ (make-mutex 'compiler/driver))
Expand Down Expand Up @@ -44,7 +45,9 @@ namespace: gxc
(def +gerbil-gcc+ #f)
(def (gerbil-gcc)
(unless +gerbil-gcc+
(set! +gerbil-gcc+ (getenv "GERBIL_GCC" default-gerbil-gcc)))
(set! +gerbil-gcc+
(getenv "GERBIL_GCC"
(or %default-gerbil-gcc default-gerbil-gcc))))
+gerbil-gcc+)

(def +gerbil-ar+ #f)
Expand Down Expand Up @@ -945,3 +948,6 @@ namespace: gxc
(raise-compile-error "Compilation error; process exit with nonzero status"
[program . args]
status)))))

;; Added auto via ./configure
(set! %default-gerbil-gcc "/opt/local/bin/gcc-mp-13")

0 comments on commit 921b9bd

Please sign in to comment.