Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build issues with gawk on OSX. #197

Closed
hydra opened this issue Apr 23, 2018 · 7 comments
Closed

build issues with gawk on OSX. #197

hydra opened this issue Apr 23, 2018 · 7 comments
Assignees

Comments

@hydra
Copy link

hydra commented Apr 23, 2018

gawk isn't in /usr/bin/gawk on OSX by default, brew install gawk installs it to usr/local/bin/gawk so the scripts don't work.

@TG9541
Copy link
Owner

TG9541 commented Apr 23, 2018

An interesting problem.

I tried using / the following approaches, without success:

  • use #!/usr/bin/env gawk -f (env doesn't like -f), and
  • a polyglott approach (the script hangs, or exec doesn't like -a)

Do you have any suggestions?

@TG9541
Copy link
Owner

TG9541 commented Apr 23, 2018

The problem is even more interesting: https://groups.google.com/forum/#!topic/comp.unix.shell/msq-6mTHJRo

@hydra
Copy link
Author

hydra commented Apr 23, 2018

didnt realise the -f option wouldnt work on linux though.

perhaps look at some other projects on github and see what they do?

@TG9541
Copy link
Owner

TG9541 commented Apr 23, 2018

Awk is hardly the most popular scripting language these days ;-)
One option might be patching the scripts when they run on OSX. It wouldn't be a nuisance if done automatically.

@TG9541
Copy link
Owner

TG9541 commented Apr 25, 2018

@hydra I tried some more variants of the "polyglot" method, but I had no success passing in command line parameters and gawk options at the same time. Some remaining option might be passing options in a file, through STDIN, or with environment variables.

TG9541 referenced this issue in plumbum/stm8ef May 11, 2018
@David-Gould
Copy link

Can you use awk instead or do you depend on gawk extensions?

@TG9541
Copy link
Owner

TG9541 commented Jul 22, 2018

I think I didn't use any non-POSIX gawk features.

By the way, there is an obvious way to approaching the OSX problem.

In the makefile's main.ihx target the following sidesteps the shell script problem:

	awk -f tools/genalias.awk -v target="out/$(BOARD)/target/" out/$(BOARD)/forth.rst
	awk -f tools/genconst.awk -v target="out/$(BOARD)/target/" out/$(BOARD)/forth.rst

@hydra FYI
@David-Gould I'll change the script processor to awk

@TG9541 TG9541 closed this as completed in 7a21e88 Jul 22, 2018
TG9541 added a commit that referenced this issue Jul 22, 2018
fixes #197 use POSIX awk, don't rely on linux script processor path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants