summaryrefslogtreecommitdiff
path: root/x11/tk/patches/patch-ac
blob: 003aa2991f0b057da34d4a99e326cf9b1a10a3e1 (plain)
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
$NetBSD: patch-ac,v 1.2 2001/07/29 07:54:57 tron Exp $

--- aclocal.m4.orig	Tue Aug  8 21:19:32 2000
+++ aclocal.m4	Sun Jul 29 09:43:02 2001
@@ -580,6 +580,7 @@
 
     do64bit_ok=no
     fullSrcDir=`cd $srcdir; pwd`
+    RPATH_FLAG=""
     EXTRA_CFLAGS=""
     TCL_EXPORT_FILE_SUFFIX=""
     UNSHARED_LIB_SUFFIX=""
@@ -769,7 +770,6 @@
 	    AC_CHECK_HEADER(dlfcn.h, [
 		# NetBSD/SPARC needs -fPIC, -fpic will not do.
 		SHLIB_CFLAGS="-fPIC"
-		SHLIB_LD="ld -Bshareable -x"
 		SHLIB_LD_LIBS=""
 		SHLIB_SUFFIX=".so"
 		DL_OBJS="tclLoadDl.o"
@@ -781,11 +781,19 @@
 #ifdef __ELF__
 	yes
 #endif
-		],
+		], [
 		    AC_MSG_RESULT(yes)
-		    SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so',
+		    SHLIB_LD='${TCL_CC} -shared -Wl,-x'
+		    RPATH_FLAG='-Wl,-rpath,'
+		    LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+		    SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so'
+		], [
 		    AC_MSG_RESULT(no)
+		    SHLIB_LD="ld -Bshareable -x"
+		    RPATH_FLAG='-R'
+		    LD_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}'
 		    SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0'
+		]
 		)
 	    ], [
 		SHLIB_CFLAGS=""
@@ -933,6 +941,9 @@
 	    DL_LIBS="-ldl"
 	    LDFLAGS=""
 	    LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
+	    SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so'
+	    UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a'
+	    TCL_LIB_VERSIONS_OK=nodots
 	    ;;
 	SunOS-5*)
 	    SHLIB_CFLAGS="-KPIC"
@@ -972,6 +983,9 @@
 	    else
 		LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
 	    fi
+	    SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so'
+	    UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a'
+	    TCL_LIB_VERSIONS_OK=nodots
 	    ;;
 	ULTRIX-4.*)
 	    SHLIB_CFLAGS="-G 0"
@@ -1383,7 +1397,11 @@
 	for i in $dirs ; do
 	    if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl; then
 		AC_MSG_RESULT($i)
-		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
@@ -1392,7 +1410,11 @@
 	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