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

Allow appending CXXFLAGS from command line #55

Closed
wants to merge 1 commit into from

Conversation

robgjansen
Copy link

This allows appending CXXFLAGS from the command line when building libutp.

$ make before patch:

g++ -c -DPOSIX -I . -I utp_config_lib -fno-exceptions -fno-rtti -Wall -g  utp.cpp
g++ -c -DPOSIX -I . -I utp_config_lib -fno-exceptions -fno-rtti -Wall -g  utp_utils.cpp
rm -f libutp.a
ar q libutp.a utp.o utp_utils.o
ar: creating libutp.a
ranlib libutp.a

$ make after patch:

g++ -c -DPOSIX -I . -I utp_config_lib -fno-exceptions -fno-rtti -Wall -g  utp.cpp
g++ -c -DPOSIX -I . -I utp_config_lib -fno-exceptions -fno-rtti -Wall -g  utp_utils.cpp
rm -f libutp.a
ar q libutp.a utp.o utp_utils.o
ar: creating libutp.a
ranlib libutp.a

make CXXFLAGS=-fPIC before patch:

g++ -c -DPOSIX -I . -I utp_config_lib -fPIC utp.cpp
g++ -c -DPOSIX -I . -I utp_config_lib -fPIC utp_utils.cpp
rm -f libutp.a
ar q libutp.a utp.o utp_utils.o
ar: creating libutp.a
ranlib libutp.a

make CXXFLAGS=-fPIC after patch:

g++ -c -DPOSIX -I . -I utp_config_lib -fno-exceptions -fno-rtti -Wall -g -fPIC utp.cpp
g++ -c -DPOSIX -I . -I utp_config_lib -fno-exceptions -fno-rtti -Wall -g -fPIC utp_utils.cpp
rm -f libutp.a
ar q libutp.a utp.o utp_utils.o
ar: creating libutp.a
ranlib libutp.a

@massar
Copy link

massar commented Sep 10, 2013

That is a handy one! Will also definitely be something various distributions will want to have, as it also allows stack checking options, optimisations etc to be set that way.

@robgjansen
Copy link
Author

FYI, you can also prepend flags with override CXXFLAGS += -fno-exceptions -fno-rtti -Wall -g and something like $ make CXXFLAGS=-fPIC.

http://stackoverflow.com/questions/2129391/append-to-gnu-make-variables-via-command-line

@robgjansen
Copy link
Author

Guess no one cared enough and now I don't anymore either :/

@robgjansen robgjansen closed this Oct 2, 2020
@anacrolix
Copy link
Contributor

Open source 🎉

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

3 participants