1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
$NetBSD: patch-aa,v 1.2 2004/10/02 22:09:46 adrianp Exp $
--- configure.orig 2004-10-02 16:05:10.000000000 +0100
+++ configure 2004-10-02 16:11:19.000000000 +0100
@@ -1310,10 +1310,10 @@
cat >$CONFTMP/test-lib.c <<EOT
int foo() {no_such_symbol();}
EOT
- if run $CC $CC_FLAGS $CC_LIBS $CONFTMP/test-dlopen.c -o $CONFTMP/test ; then
+ if run $CC -fPIC $CC_FLAGS $CC_LIBS $CONFTMP/test-dlopen.c -o $CONFTMP/test ; then
CC_DYN_LIBS=""
log "dlopen() found (no libs)"
- elif run $CC $CC_FLAGS $CC_LIBS $CONFTMP/test-dlopen.c -ldl -o $CONFTMP/test
+ elif run $CC -fPIC $CC_FLAGS $CC_LIBS $CONFTMP/test-dlopen.c -ldl -o $CONFTMP/test
then
CC_DYN_LIBS=" -ldl"
log "dlopen() found (libdl)"
@@ -1322,7 +1322,7 @@
OK=
fi
if [ "$OK" ] ; then
- if run $CC -rdynamic $CC_FLAGS $CC_LIBS $CC_DYN_LIBS $CONFTMP/test-dlopen.c -o $CONFTMP/test ; then
+ if run $CC -rdynamic -fPIC $CC_FLAGS $CC_LIBS $CC_DYN_LIBS $CONFTMP/test-dlopen.c -o $CONFTMP/test ; then
log "-rdynamic works"
CC_DYN_LFLAGS=" -rdynamic"
else
@@ -1336,7 +1336,7 @@
else
CC_SHARED="$CC -shared"
fi
- if run $CC_SHARED $CC_FLAGS $CC_LIBS $CONFTMP/test-lib.c -o $CONFTMP/test-lib.so ; then
+ if run $CC_SHARED -fPIC $CC_FLAGS $CC_LIBS $CONFTMP/test-lib.c -o $CONFTMP/test-lib.so ; then
log "-shared works"
else
log "no -shared, aborting dlfcn test"
@@ -1374,8 +1374,8 @@
return quux(bar)*2;
}
EOT
- if run $CC_SHARED $CC_FLAGS $CC_LIBS $CONFTMP/test-dynamic.c -o $CONFTMP/test.so \
- && run $CC $CC_FLAGS $CC_DYN_LFLAGS $CC_LIBS $CC_DYN_LIBS $CONFTMP/test-dynamic2.c $CONFTMP/test.so -o $CONFTMP/test
+ if run $CC_SHARED -fPIC $CC_FLAGS $CC_LIBS $CONFTMP/test-dynamic.c -o $CONFTMP/test.so \
+ && run $CC -fPIC $CC_FLAGS $CC_DYN_LFLAGS $CC_LIBS $CC_DYN_LIBS $CONFTMP/test-dynamic2.c $CONFTMP/test.so -o $CONFTMP/test
then
a=`$CONFTMP/test 1`
log "symbol resolution test: $CONFTMP/test 1 => $a"
@@ -1404,7 +1404,7 @@
}
int quux(int x) {return x;}
EOT
- if run $CC $CC_FLAGS $CC_DYN_LFLAGS $CC_LIBS $CC_DYN_LIBS $CONFTMP/test-dynamic2.c $CONFTMP/test.so -o $CONFTMP/test
+ if run $CC -fPIC $CC_FLAGS $CC_DYN_LFLAGS $CC_LIBS $CC_DYN_LIBS $CONFTMP/test-dynamic2.c $CONFTMP/test.so -o $CONFTMP/test
then
a=`$CONFTMP/test`
log "underscore test: $CONFTMP/test => $a"
@@ -1428,6 +1428,7 @@
if [ "$OK" ] ; then
echo "yes."
STATIC_MODULES=0
+ CC_FLAGS="-fPIC $CC_FLAGS"
else
log "static modules selected"
echo "no."
|