Skip to content

Commit

Permalink
make configure check for visibility preinclude compatible with pcc
Browse files Browse the repository at this point in the history
pcc does not search for -include relative to the working directory
unless -I. is used. rather than adding -I., which could be problematic
if there's extra junk in the top-level directory, switch back to the
old method (reverting commit 60ed988)
of using -include vis.h and relying on -I./src/internal being present
on the command line (which the Makefile guarantees). to fix the
breakage that was present in trycppif checks with the old method,
$CFLAGS_AUTO is removed from the command line passed to trycppif; this
is valid since $CFLAGS_AUTO should not contain options that alter
compiler semantics or ABI, only optimizations, warnings, etc.
  • Loading branch information
richfelker committed Apr 22, 2015
1 parent 873e0ec commit 428462a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ echo 'int (*fp)(void);' > "$tmpc"
echo 'int foo(void) { }' >> "$tmpc"
echo 'int bar(void) { fp = foo; return foo(); }' >> "$tmpc"
if $CC $CFLAGS_C99FSE $CPPFLAGS $CFLAGS \
-DSHARED -fPIC -include src/internal/vis.h \
-DSHARED -fPIC -I./src/internal -include vis.h \
-nostdlib -shared -Wl,-Bsymbolic-functions \
-o /dev/null "$tmpc" >/dev/null 2>&1 ; then
visibility=yes
Expand All @@ -442,7 +442,7 @@ printf "%s\n" "$visibility"
fi

if test "x$visibility" == xyes ; then
CFLAGS_AUTO="$CFLAGS_AUTO -include src/internal/vis.h"
CFLAGS_AUTO="$CFLAGS_AUTO -include vis.h"
CFLAGS_AUTO="${CFLAGS_AUTO# }"
fi

Expand All @@ -468,7 +468,7 @@ printf "using compiler runtime libraries: %s\n" "$LIBCC"

# Figure out arch variants for archs with variants
SUBARCH=
t="$CFLAGS_C99FSE $CPPFLAGS $CFLAGS_AUTO $CFLAGS"
t="$CFLAGS_C99FSE $CPPFLAGS $CFLAGS"

if test "$ARCH" = "x86_64" ; then
trycppif __ILP32__ "$t" && ARCH=x32
Expand Down

0 comments on commit 428462a

Please sign in to comment.