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

Fix FreeBSD linking issues #2560

Merged
merged 2 commits into from
May 29, 2016
Merged

Fix FreeBSD linking issues #2560

merged 2 commits into from
May 29, 2016

Conversation

valpackett
Copy link
Contributor

This PR:

  • Removes the need for setting LIBRARY_PATH to /lib:/usr/lib:/usr/local/lib from @ysbaddaden's FreeBSD instructions.
  • Fixes libm linking on FreeBSD — examples like neural_net now work.
  • Fixes SDL examples on FreeBSD (I assume the redefine_main thing is for OS X — on FreeBSD, it breaks everything, but the examples work without it).

@valpackett
Copy link
Contributor Author

@asterite?

@asterite
Copy link
Member

@myfreeweb I unfortunately know nothing about FreeBSD.

@ysbaddaden if you think this is good you can merge it. You can freely choose what to do with stuff related to FreeBSD :-)

# where the default cc doesn't use /usr/local/lib by default
library_path.each do |path|
flags << " -L#{path}"
end
Copy link
Contributor

Choose a reason for hiding this comment

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

@asterite are you OK with this change?

Copy link
Member

Choose a reason for hiding this comment

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

Hmmm... not sure. Could it only be done if the target platform is freebsd? I don't know if that could break something.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe? But I don't think adding -L/usr/lib -L/usr/local/lib can break anything anywhere… Do people not add this to all linker invocations?

@jhass
Copy link
Member

jhass commented May 19, 2016

@myfreeweb Could you rebase so that we get another Travis run? For some reason it didn't trigger.

On FreeBSD, the default cc compiler does not have /usr/local/lib
in its default library path. Usually pkg-config adds it.
@jhass
Copy link
Member

jhass commented May 29, 2016

Looks okay to me and easy to spot in case it breaks somewhere. Let's make it platform specific once we find a setup that it does break.

Thank you!

@jhass jhass merged commit f40694b into crystal-lang:master May 29, 2016
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.

None yet

4 participants