Skip to content

Commit

Permalink
tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin committed Mar 20, 2024
1 parent 10e4617 commit 34056e5
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions src/setup.jl
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,6 @@ function regenerate_gaproot()
haskey(ENV, "GAP_CXX") && pushfirst!(cxx_candidates, ENV["GAP_CXX"])
CXX = sysinfo["GAP_CXX"] = select_compiler("C++", cxx_candidates, ".cc")

##sysinfo["GAP_CFLAGS"] = " -g -O2"
##sysinfo["GAP_CXXFLAGS"] = " -g -O2"
#sysinfo["GAP_CFLAGS"] = " -pthread -g -O2"
#sysinfo["GAP_CXXFLAGS"] = " -pthread -g -O2"

# set include flags
gap_include = joinpath(gap_prefix, "include", "gap")
gap_include2 = joinpath(gaproot_mutable) # for code doing `#include "src/compiled.h"`
Expand All @@ -126,15 +121,6 @@ function regenerate_gaproot()
gap_lib = joinpath(gap_prefix, "lib")
sysinfo["GAP_LDFLAGS"] = "-L$(gap_lib) -lgap"

# set gac compiler flags (get appended to GAP_CFLAGS and GAP_CXXFLAGS)
sysinfo["GAC_CFLAGS"] = "-fPIC"
if Sys.isapple()
sysinfo["GAC_CFLAGS"] = "-fno-common"
end

# set gac linker flags (get appended to GAP_LDFLAGS)
sysinfo["GAC_LDFLAGS"] = Sys.isapple() ? "-bundle" : "-shared -fPIC"

GAP_VERSION = VersionNumber(sysinfo["GAP_VERSION"])
gaproot_packages = joinpath(Base.DEPOT_PATH[1], "gaproot", "v$(GAP_VERSION.major).$(GAP_VERSION.minor)")
sysinfo["DEFAULT_PKGDIR"] = joinpath(gaproot_packages, "pkg")
Expand All @@ -152,6 +138,22 @@ function regenerate_gaproot()
sysinfo["GAP"] = joinpath(gaproot_mutable, "bin", "gap.sh")
sysinfo["GAC"] = joinpath(gaproot_mutable, "gac")

# the following sysinfo entries are intentional left as they are:
# - GAParch
# - GAC_CFLAGS
# - GAC_LDFLAGS
# - GAP_ABI
# - GAP_BUILD_VERSION
# - GAP_CFLAGS
# - GAP_CXXFLAGS
# - GAP_HPCGAP
# - GAP_KERNEL_MAJOR_VERSION
# - GAP_KERNEL_MINOR_VERSION
# - GAP_OBJEXT

# TODO: add a check for any additional entries so we notice when GAP adds
# stuff and can then decide whether we need to adjust it... E.g.
# GMP_PREFIX was added in 4.13.0.
#sysinfo["GMP_PREFIX"] = TODO

# create the mutable gaproot
Expand Down

0 comments on commit 34056e5

Please sign in to comment.