build-scripts/strip_fPIC.sh
author Sam Lantinga <slouken@libsdl.org>
Tue, 19 Aug 2014 21:17:21 -0700
changeset 9094 65a23b7b43c7
parent 1889 5225a9cc25a2
child 4297 27fe0dd48269
permissions -rwxr-xr-x
Fixed bug 2694 - configure bug __has_feature macro not detected

skaller

using gcc 4.2 (the default) on Mac OSX 10.6.8

CC build/SDL_dynapi.lo
In file included from /Users/johnskaller/SDL/src/dynapi/SDL_dynapi.c:31:
include/SDL_syswm.h:211:39: error: missing binary operator before token "("

The fault appears to be here:

#if defined(__OBJC__) && __has_feature(objc_arc)

that the __has_feature macro is not supported by gcc 4.2.

The code works fine with my clang 3.3svn.
slouken@1361
     1
#!/bin/sh
slouken@1361
     2
#
slouken@1361
     3
# libtool assumes that the compiler can handle the -fPIC flag
slouken@1361
     4
# This isn't always true (for example, nasm can't handle it)
slouken@1361
     5
command=""
slouken@1361
     6
while [ $# -gt 0 ]; do
slouken@1361
     7
    case "$1" in
slouken@1361
     8
        -?PIC)
slouken@1361
     9
            # Ignore -fPIC and -DPIC options
slouken@1361
    10
            ;;
slouken@1889
    11
        -fno-common)
slouken@1889
    12
            # Ignore -fPIC and -DPIC options
slouken@1889
    13
            ;;
slouken@1361
    14
        *)
slouken@1361
    15
            command="$command $1"
slouken@1361
    16
            ;;
slouken@1361
    17
    esac
slouken@1361
    18
    shift
slouken@1361
    19
done
slouken@1361
    20
echo $command
slouken@1361
    21
exec $command