Open joshfrench opened 2 years ago
Aha! I needed to pass another flag when building:
CGO_CFLAGS="-I${HOMEBREW_PREFIX}/include" CGO_LDFLAGS="-L${HOMEBREW_PREFIX}/lib" go build
Aha! I needed to pass another flag when building:
CGO_CFLAGS="-I${HOMEBREW_PREFIX}/include" CGO_LDFLAGS="-L${HOMEBREW_PREFIX}/lib" go build
Do you think @joshfrench this could be empbedded into the makefile? I mean, could we detect that we are building on a macos machine, and add these flags automatically?
You could shell out and check uname -sp
(although I'm not sure if -p
is present on every platform, so maybe a combination of uname
and arch
?)
Either way you're looking for Darwin
and one of x86_64
or arm64
. It's been a while but I think pistol built fine on a previous Intel mac, so you'd only need to add the flags when you detect an Apple chip.
I'd send a PR but my make syntax is pretty rusty :)
Hey, you may want to check the new 0.4.1 release which not necessarily include many new features, but it does include statically compiled binary for aarch64. I still think this issue is worth staying open, for any Mac OS user that will want to build and help develop pistol in the future, so I'm keeping this open.
Env:
I've previously installed Pistol on OS 11.6/Intel with no issues, but on a new machine I'm unable to install or build it.
Steps:
I get the last error (
ld: library not found for -lmagic
) when attempting to build from source, as well.I'm mostly posting this in case other OS X users run into it -- the problem seems to be with
libmagic
, and I suspect you're unable to help troubleshoot OS X anyway :)