Skip to content

Conversation

@demotomohiro
Copy link
Contributor

No description provided.

## it should also get OS from GCC so that csource can be build with more GCC for cross compilation.
## but parsing OS name from `gcc -dumpmachine` is hard:
## https://wiki.osdev.org/Target_Triplet
ucpu := $(shell sh -c 'gcc -dumpmachine | cut --delimiter=- --field=1 | tr "[:upper:]" "[:lower:]"')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Long options are a GNUism so this won't work on FreeBSD etc. cut -d - -f 1 seems preferable.
Also, later down the file there's this line:

mycpu = $(shell /bin/sh -c '"$(CC)" -dumpmachine | sed "s/-.*//"')

clang supports dumpmachine too, so maybe $(CC) is better?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! I wasn't aware there is already code calls $(CC) -dumpmachine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants