summaryrefslogtreecommitdiff
path: root/x11/tk/patches/patch-unix_configure
blob: f26cf73767c76d3183d82d035235b559cbbbb0cd (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
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
$NetBSD: patch-unix_configure,v 1.15 2019/06/27 09:33:27 jperkin Exp $

Support MirBSD.
Honor LDFLAGS.
Standardize file names.

--- unix/configure.orig	2018-11-16 19:02:48.000000000 +0000
+++ unix/configure
@@ -4391,10 +4391,10 @@ fi
     # LDFLAGS_ARCH so they eventually end up in LDFLAGS even if [load]
     # is disabled by the user. [Bug 1016796]
     LDFLAGS_ARCH=""
-    UNSHARED_LIB_SUFFIX=""
+    UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
     TCL_TRIM_DOTS='`echo ${VERSION} | tr -d .`'
     ECHO_VERSION='`echo ${VERSION}`'
-    TCL_LIB_VERSIONS_OK=ok
+    TCL_LIB_VERSIONS_OK=nodots
     CFLAGS_DEBUG=-g
     if test "$GCC" = yes; then
 
@@ -5357,7 +5357,7 @@ fi
 	    CC_SEARCH_FLAGS=""
 	    LD_SEARCH_FLAGS=""
 	    ;;
-	OpenBSD-*)
+	OpenBSD-*|MirBSD-*)
 	    arch=`arch -s`
 	    case "$arch" in
 	    alpha|sparc64)
@@ -5378,7 +5378,7 @@ fi
 
 	    LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
 	    SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so${SHLIB_VERSION}'
-	    LDFLAGS="-Wl,-export-dynamic"
+	    LDFLAGS="-Wl,--export-dynamic"
 	    CFLAGS_OPTIMIZE="-O2"
 	    if test "${TCL_THREADS}" = "1"; then
 
@@ -5396,11 +5396,10 @@ fi
 	NetBSD-*)
 	    # NetBSD has ELF and can use 'cc -shared' to build shared libs
 	    SHLIB_CFLAGS="-fPIC"
-	    SHLIB_LD='${CC} ${SHLIB_CFLAGS} -shared'
+	    SHLIB_LD='${CC} ${SHLIB_CFLAGS} -shared ${LDFLAGS}'
 	    SHLIB_SUFFIX=".so"
 	    DL_OBJS="tclLoadDl.o"
 	    DL_LIBS=""
-	    LDFLAGS="$LDFLAGS -export-dynamic"
 	    if test $doRpath = yes; then
 
 		CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
@@ -6646,12 +6645,12 @@ fi
 
     if test "$SHARED_LIB_SUFFIX" = ""; then
 
-	SHARED_LIB_SUFFIX='${VERSION}${SHLIB_SUFFIX}'
+	SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}${SHLIB_SUFFIX}'
 fi
 
     if test "$UNSHARED_LIB_SUFFIX" = ""; then
 
-	UNSHARED_LIB_SUFFIX='${VERSION}.a'
+	UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
 fi
 
     DLL_INSTALL_DIR="\$(LIB_INSTALL_DIR)"
@@ -6667,8 +6666,11 @@ fi
 
 else
 
-            INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)/$(LIB_FILE)"'
-
+       if test "${SHLIB_SUFFIX}" = ".dylib" ; then
+            INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)/libtk$(MAJOR_VERSION)$(MINOR_VERSION)$(SHLIB_VERSION)$(SHLIB_SUFFIX)"'
+        else
+            INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)/$(LIB_FILE)$(SHLIB_VERSION)"'
+        fi
 fi
 
 
@@ -6702,7 +6704,7 @@ else
 
 fi
 
-    INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) "$(LIB_INSTALL_DIR)/$(STUB_LIB_FILE)"'
+    INSTALL_STUB_LIB='$(INSTALL_DATA) $(STUB_LIB_FILE) "$(LIB_INSTALL_DIR)/$(STUB_LIB_FILE)"'
 
     # Define TCL_LIBS now that we know what DL_LIBS is.
     # The trick here is that we don't want to change the value of TCL_LIBS if
@@ -9713,7 +9715,7 @@ echo $ECHO_N "checking for X11 libraries
 	    if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl -o -r $i/libX11.dylib; then
 		echo "$as_me:$LINENO: result: $i" >&5
 echo "${ECHO_T}$i" >&6
-		XLIBSW="-L$i -lX11"
+		XLIBSW="-L$i ${COMPILER_RPATH_FLAG}$i -lX11"
 		x_libraries="$i"
 		break
 	    fi
@@ -9722,7 +9724,7 @@ echo "${ECHO_T}$i" >&6
 	if test "$x_libraries" = ""; then
 	    XLIBSW=-lX11
 	else
-	    XLIBSW="-L$x_libraries -lX11"
+	    XLIBSW="-L$x_libraries ${COMPILER_RPATH_FLAG}$x_libraries -lX11"
 	fi
     fi
     if test "$XLIBSW" = nope ; then
@@ -9818,11 +9820,6 @@ fi
 #	   be replaced by spaces.
 #--------------------------------------------------------------------
 
-if test "x${x_libraries}" != "x"; then
-  if test "x${x_libraries}" != "xNONE"; then
-    LIB_RUNTIME_DIR="${LIB_RUNTIME_DIR}:${x_libraries}"
-  fi
-fi
 if test "${TCL_LD_SEARCH_FLAGS}" = '-L${LIB_RUNTIME_DIR}'; then
     LIB_RUNTIME_DIR=`echo ${LIB_RUNTIME_DIR} |sed -e 's/:/ -L/g'`
 fi
@@ -11058,14 +11055,10 @@ else
 	TK_LIB_FLAG="-ltk`echo ${TK_VERSION} | tr -d .`"
 	TK_BUILD_LIB_SPEC="-L\$(TOP_DIR)/win ${TK_LIB_FLAG}"
     else
-	if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
-	    TK_LIB_FLAG="-ltk${TK_VERSION}"
-	else
 	    TK_LIB_FLAG="-ltk`echo ${TK_VERSION} | tr -d .`"
-	fi
 	TK_BUILD_LIB_SPEC="-L`pwd | sed -e 's/ /\\\\ /g'` ${TK_LIB_FLAG}"
     fi
-    TK_LIB_SPEC="-L${libdir} ${TK_LIB_FLAG}"
+    TK_LIB_SPEC="-L${libdir} ${COMPILER_RPATH_FLAG}${libdir} ${TK_LIB_FLAG}"
 fi
 
 #--------------------------------------------------------------------
@@ -11077,11 +11070,7 @@ fi
 eval "TK_STUB_LIB_FILE=libtkstub${TK_UNSHARED_LIB_SUFFIX}"
 eval "TK_STUB_LIB_DIR=${libdir}"
 
-if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
-    TK_STUB_LIB_FLAG="-ltkstub${TK_VERSION}"
-else
-    TK_STUB_LIB_FLAG="-ltkstub`echo ${TK_VERSION} | tr -d .`"
-fi
+TK_STUB_LIB_FLAG="-ltkstub`echo ${TK_VERSION} | tr -d .`"
 
 TK_BUILD_STUB_LIB_SPEC="-L`pwd | sed -e 's/ /\\\\ /g'` ${TK_STUB_LIB_FLAG}"
 TK_STUB_LIB_SPEC="-L${TK_STUB_LIB_DIR} ${TK_STUB_LIB_FLAG}"
@@ -11902,6 +11893,7 @@ s,@APP_RSRC_FILE@,$APP_RSRC_FILE,;t t
 s,@REZ@,$REZ,;t t
 s,@REZ_FLAGS@,$REZ_FLAGS,;t t
 s,@LTLIBOBJS@,$LTLIBOBJS,;t t
+s,@SHLIB_VERSION@,$SHLIB_VERSION,;t t
 CEOF
 
 _ACEOF