aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Seebach <peter.seebach@windriver.com>2014-04-24 17:34:32 -0500
committerPeter Seebach <peter.seebach@windriver.com>2014-04-24 17:34:32 -0500
commit36689a76e79bf6e6231f6f03cbfad297d4411588 (patch)
treebe195675acdb59b70b2d2e66fcc28041aeb55b4e
parent6c6d0a3e4a4d382fd0b2e056a3ecffb015652767 (diff)
downloadpseudo-36689a76e79bf6e6231f6f03cbfad297d4411588.tar.gz
pseudo-36689a76e79bf6e6231f6f03cbfad297d4411588.tar.bz2
pseudo-36689a76e79bf6e6231f6f03cbfad297d4411588.zip
subports: Use right compiler
Turns out the checks for feature support were using plain cc, not ${CC}, which could break tests. Also add a sanity check to the xattr support to confirm that <attr/xattr.h> is available. Signed-off-by: Peter Seebach <peter.seebach@windriver.com>
-rw-r--r--Makefile.in2
-rwxr-xr-xports/linux/subports16
2 files changed, 14 insertions, 4 deletions
diff --git a/Makefile.in b/Makefile.in
index 6aa4659..d5a78b5 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -134,7 +134,7 @@ tables: enums/*.in maketables templatefile.py $(TABLES)
./maketables enums/*.in
wrappers: makewrappers templatefile.py $(TEMPLATES) ports/*/wrapfuncs.in
- ./makewrappers "xattr=$(XATTR)"
+ CC="$(CC) $(CFLAGS) $(CFLAGS_PSEUDO)" ./makewrappers "xattr=$(XATTR)"
.SECONDARY: tables wrappers
diff --git a/ports/linux/subports b/ports/linux/subports
index 94d43e7..507794e 100755
--- a/ports/linux/subports
+++ b/ports/linux/subports
@@ -1,11 +1,11 @@
#!/bin/sh
found=false
-printf >&2 "Checking for old/new clone mechanics..."
+printf >&2 "Checking for old/new clone mechanics... "
cat > dummy.c <<EOF
#include <sched.h>
int clone(int (*fn)(void *), void *child_stack, int flags, void *arg, ...) { return 0; }
EOF
-if cc -c -o dummy.o dummy.c >/dev/null 2>&1; then
+if ${CC} -c -o dummy.o dummy.c >/dev/null 2>&1; then
rm -f dummy.c dummy.o
echo >&2 "New clone."
echo "linux/newclone"
@@ -15,7 +15,7 @@ cat > dummy.c <<EOF
#include <sched.h>
int clone(int (*fn)(void *), void *child_stack, int flags, void *arg) { return 0; }
EOF
-if ! $found && cc -c -o dummy.o dummy.c >/dev/null 2>&1; then
+if ! $found && ${CC} -c -o dummy.o dummy.c >/dev/null 2>&1; then
rm -f dummy.c dummy.o
echo >&2 "Old clone."
echo "linux/oldclone"
@@ -27,7 +27,17 @@ if ! $found; then
fi
if $port_xattr; then
+ cat > dummy.c <<EOF
+#include <sys/types.h>
+#include <attr/xattr.h>
+int i;
+EOF
+ if ! ${CC} -c -o dummy.o dummy.c >/dev/null 2>&1; then
+ echo >&2 "Warning: Can't compile trivial program using <attr/xattr.h>".
+ echo >&2 " xattr support will require that header."
+ fi
echo "linux/xattr"
else
echo "linux/noxattr"
fi
+rm -f dummy.c dummy.o