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

Deps Makefiles do not work for cross-compilation #208

Open
ghost opened this issue Aug 8, 2016 · 5 comments
Open

Deps Makefiles do not work for cross-compilation #208

ghost opened this issue Aug 8, 2016 · 5 comments
Assignees
Milestone

Comments

@ghost
Copy link

ghost commented Aug 8, 2016

The following dependencies (deps/) break when trying to cross-compile using the configure command ./configure --host=$(SOME_TOOLCHAIN):

  • ae
  • inih
  • murmurhash

This seems to be related to the line in each of their related Makefiles: CC = /usr/bin/gcc. Also, these makefiles overwrite the CFLAGS and LDFLAGS variables. Ideally I believe all of this information would be picked up from the configuration step.

Removing the CC line and changing CFLAGS and LDFLAGS from = to += worked for me in getting the project to cross-compile successfully.

@armon
Copy link
Collaborator

armon commented Aug 9, 2016

Could you please send a PR? Thanks!

@ghost
Copy link
Author

ghost commented Aug 10, 2016

I'll definitely look into it. Haven't used automake too much personally, and making my simple change doesn't quite have the expected behavior outside of the build system I'm using. When I compile on a Mac using the suggestion I made above, it uses cc and doesn't pick up the automake CFLAGS for the deps folders, and gcc with the right CFLAGS for everything else. So I'll hold off on the PR for now until I have something that works across the board. Any ideas on how to build the deps with automake as well?

@johnkeates
Copy link
Contributor

I've done almost all of the automake conversion for this project, initially, without putting the deps into automake since they may need to be split off or pulled in a packages on other systems.

Basically, if you want to choose a different compiler, it will depend on your system's defaults and/or any environment variables you set before the build (they override the presets).

You could also try re-generating the autotools stuff by running bootstrap before configure+make, since it could pull in any system-specific dependencies first.

@ghost
Copy link
Author

ghost commented Aug 11, 2016

@johnkeates Yeah, that's how I did get it cross-compiling for my system. I set all of the CC, AR, etc., build variables. I guess my suggestion would be to have the deps not explicitly override the CC variable as they currently do to allow the system defaults to be picked up without manual configuration if full automake isn't an option. Currently, the deps don't fall back to system default and someone trying to cross-compile needs to poke around in the makefiles to find that CC (and also CFLAGS and LDFLAGS) are being explicitly overwritten.

@johnkeates
Copy link
Contributor

I'm currently working on a few changes, they might help with your compilation issue. I'm also thinking about maybe adding some stuff for multi-target tools, as right now I only added a Debian vagrant box and I'm pretty sure there's going to be a need more more targets. I do know that within Debian, it's possible to cross-compile by default, and that you can generate packages for other Linux distro's as well, but I'm not sure how much work that would need vs. how many people want this.

@johnkeates johnkeates self-assigned this Jan 3, 2017
@johnkeates johnkeates added this to the 0.8.1 milestone May 8, 2017
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

No branches or pull requests

2 participants