diff --git a/src/tools/gcc.jam b/src/tools/gcc.jam index 760a47a9a..de66d4cd7 100644 --- a/src/tools/gcc.jam +++ b/src/tools/gcc.jam @@ -61,7 +61,18 @@ flags gcc.compile OPTIONS full : -finline-functions -Wno-inline ; flags gcc.compile OPTIONS on : -g ; flags gcc.compile OPTIONS on : -pg ; -flags gcc.compile OPTIONS shared/LIB : -fPIC ; +# On cygwin, gcc generates position independent code by default, +# and warns if -fPIC is specified. This might not be the right way +# of checking if we're using cygwin. For example, it's possible +# to run cygwin gcc from NT shell, or using crosscompiling. +# But we'll solve that problem when it's time. In that case +# we'll just add another parameter to 'init' and move this login +# inside 'init'. +if [ os.path ] != CYGWIN +{ + flags gcc.compile OPTIONS shared/LIB : -fPIC ; +} + flags gcc.compile OPTIONS ; flags gcc.compile.c++ OPTIONS ;