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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
|
$NetBSD: patch-ab,v 1.26 2006/11/02 17:42:03 adam Exp $
--- unix/configure.orig 2006-10-19 19:27:34.000000000 +0200
+++ unix/configure
@@ -2055,12 +2055,13 @@ fi
# Step 3: set configuration options based on system name and version.
do64bit_ok=no
+ RPATH_FLAG=""
LDFLAGS_ORIG="$LDFLAGS"
TCL_EXPORT_FILE_SUFFIX=""
UNSHARED_LIB_SUFFIX=""
TCL_TRIM_DOTS='`echo ${VERSION} | tr -d .`'
ECHO_VERSION='`echo ${VERSION}`'
- TCL_LIB_VERSIONS_OK=ok
+ TCL_LIB_VERSIONS_OK=nodots
CFLAGS_DEBUG=-g
CFLAGS_OPTIMIZE=-O
if test "$GCC" = "yes" ; then
@@ -2747,7 +2748,6 @@ if eval "test \"`echo '$ac_cv_header_'$a
# NetBSD/SPARC needs -fPIC, -fpic will not do.
SHLIB_CFLAGS="-fPIC"
- SHLIB_LD="ld -Bshareable -x"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
@@ -2782,6 +2782,9 @@ rm -f conftest*
fi
echo "$ac_t""$tcl_cv_ld_elf" 1>&6
+ SHLIB_LD='${TCL_CC} -shared -Wl,-x'
+ RPATH_FLAG='-Wl,-R'
+ LD_SEARCH_FLAGS='-Wl,-R${LIB_RUNTIME_DIR}'
if test $tcl_cv_ld_elf = yes; then
SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so'
else
@@ -2879,12 +2882,13 @@ echo "$ac_t""$tcl_cv_ld_elf" 1>&6
UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a'
TCL_LIB_VERSIONS_OK=nodots
;;
- FreeBSD-*)
+ FreeBSD-*|DragonFly-*)
# FreeBSD 3.* and greater have ELF.
SHLIB_CFLAGS="-fPIC"
SHLIB_LD="ld -Bshareable -x"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
+ RPATH_FLAG='-Wl,-R'
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
LDFLAGS="$LDFLAGS -export-dynamic"
@@ -3635,7 +3639,7 @@ fi
;;
IRIX*)
;;
- NetBSD-*|FreeBSD-*|OpenBSD-*)
+ NetBSD-*|FreeBSD-*|OpenBSD-*|DragonFly-*)
;;
Darwin-*)
;;
@@ -3653,16 +3657,16 @@ fi
fi
if test "$SHARED_LIB_SUFFIX" = "" ; then
- SHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}${SHLIB_SUFFIX}'
+ SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}${SHLIB_SUFFIX}'
fi
if test "$UNSHARED_LIB_SUFFIX" = "" ; then
- UNSHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}.a'
+ UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a'
fi
if test "${SHARED_BUILD}" = "1" && test "${SHLIB_SUFFIX}" != "" ; then
LIB_SUFFIX=${SHARED_LIB_SUFFIX}
- MAKE_LIB='${SHLIB_LD} -o $@ ${OBJS} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS}'
- INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) $(LIB_INSTALL_DIR)/$(LIB_FILE)'
+ MAKE_LIB='${SHLIB_LD} -o $@ ${OBJS:.o=.lo} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS} -version-info 1:0'
+ INSTALL_LIB='$(INSTALL_LIBRARY) $(TK_LA_FILE) $(LIB_INSTALL_DIR)/$(LIB_FILE)'
else
LIB_SUFFIX=${UNSHARED_LIB_SUFFIX}
@@ -5213,7 +5217,11 @@ echo "configure:5211: checking for X11 l
for i in $dirs ; do
if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl; then
echo "$ac_t""$i" 1>&6
- XLIBSW="-L$i -lX11"
+ if test "${RPATH_FLAG}" != ""; then
+ XLIBSW="-L$i ${RPATH_FLAG}$i -lX11"
+ else
+ XLIBSW="-L$i -lX11"
+ fi
x_libraries="$i"
break
fi
@@ -5222,7 +5230,11 @@ echo "configure:5211: checking for X11 l
if test "$x_libraries" = ""; then
XLIBSW=-lX11
else
- XLIBSW="-L$x_libraries -lX11"
+ if test "${RPATH_FLAG}" != ""; then
+ XLIBSW="-L$x_libraries ${RPATH_FLAG}$x_libraries -lX11"
+ else
+ XLIBSW="-L$x_libraries -lX11"
+ fi
fi
fi
if test "$XLIBSW" = nope ; then
@@ -5294,6 +5306,10 @@ if test "x${x_libraries}" != "x"; then
fi
if test "${TCL_LD_SEARCH_FLAGS}" = '-L${LIB_RUNTIME_DIR}'; then
LIB_RUNTIME_DIR=`echo ${LIB_RUNTIME_DIR} |sed -e 's/:/ -L/g'`
+elif test "${TCL_LD_SEARCH_FLAGS}" = '-R${LIB_RUNTIME_DIR}'; then
+ LIB_RUNTIME_DIR=`echo ${LIB_RUNTIME_DIR} |sed -e 's/:/ -R/g'`
+elif test "${TCL_LD_SEARCH_FLAGS}" = '-Wl,-R${LIB_RUNTIME_DIR}'; then
+ LIB_RUNTIME_DIR=`echo ${LIB_RUNTIME_DIR} |sed -e 's/:/ -Wl,-R/g'`
fi
# The statement below is very tricky! It actually *evaluates* the
@@ -5827,11 +5843,18 @@ else
if test "$SHARED_BUILD" = "0" || test "$TCL_NEEDS_EXP_FILE" = "0"; then
if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
eval TK_LIB_FLAG="-ltk${VERSION}\${TK_DBGX}"
+ eval TK_BUILD_LIB_SPEC="libtk${VERSION}\${TK_DBGX}.la"
else
eval TK_LIB_FLAG="-ltk`echo ${VERSION} | tr -d .`\${TK_DBGX}"
+ eval TK_BUILD_LIB_SPEC="libtk`echo ${VERSION} | tr -d .`\${TK_DBGX}.la"
fi
- TK_BUILD_LIB_SPEC="-L`pwd` ${TK_LIB_FLAG}"
TK_LIB_SPEC="-L${libdir} ${TK_LIB_FLAG}"
+ if test "${RPATH_FLAG}" != ""; then
+ TK_LIB_SPEC_RPATH="${RPATH_FLAG}${exec_prefix}/lib"
+ else
+ TK_LIB_SPEC_RPATH=""
+ fi
+ TK_LIB_SPEC="-L${exec_prefix}/lib ${TK_LIB_SPEC_RPATH} ${TK_LIB_FLAG}"
else
TK_BUILD_EXP_FILE="lib.exp"
eval "TK_EXP_FILE=libtk${TCL_EXPORT_FILE_SUFFIX}"
|