Check-in [71730030d6]
Overview
Comment:Better handling of shared linking and TCL_PACKAGE_PATH
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 71730030d6be17962adf6c8b47bcfeeeb01955a7
User & Date: rkeene on 2019-06-12 22:02:57
Other Links: manifest | tags
Context
2019-06-12
22:06
Added TclPKCS11 package check-in: 9c31bfe7cb user: rkeene tags: trunk
22:02
Better handling of shared linking and TCL_PACKAGE_PATH check-in: 71730030d6 user: rkeene tags: trunk
2019-05-09
21:53
Updated to NSF 2.3.0 release check-in: ea086b4b2b user: ssoberni tags: trunk
Changes

Modified common/common.sh from [e672e78acf] to [5c91dc1965].

148
149
150
151
152
153
154


155
156
157
158
159
160
161

function configure() {
	local tryopts tryopt
	local staticpkg staticpkgvar
	local isshared
	local save_cflags
	local base_var kc_var



	# Determine if the user decided this should be static or not
	staticpkgvar="$(echo "STATIC${internalpkgname}" | dd conv=ucase 2>/dev/null)"
	staticpkg="$(eval "echo \"\$${staticpkgvar}\"")"

	# Determine if the build script overrides this
	if [ "${pkg_always_static}" = '1' ]; then







>
>







148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163

function configure() {
	local tryopts tryopt
	local staticpkg staticpkgvar
	local isshared
	local save_cflags
	local base_var kc_var
	local configure_opt configure_opts configure_opts_new
	local ignore_opt ignore_this_opt

	# Determine if the user decided this should be static or not
	staticpkgvar="$(echo "STATIC${internalpkgname}" | dd conv=ucase 2>/dev/null)"
	staticpkg="$(eval "echo \"\$${staticpkgvar}\"")"

	# Determine if the build script overrides this
	if [ "${pkg_always_static}" = '1' ]; then
170
171
172
173
174
175
176
177
178


179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
		if [ -n "${kc_var_val}" ]; then
			eval "${base_var}=\"\$${base_var} \$${kc_var}\"; export ${base_var}"
		fi
	done

	# Determine if we should enable shared or not
	if [ "${staticpkg}" = "0" ]; then
		tryopts="--enable-shared --disable-shared"
	elif [ "${staticpkg}" = "-1" ]; then


		tryopts="--enable-shared"
	else
		tryopts="--disable-shared"
	fi

	save_cflags="${CFLAGS}"
	for tryopt in $tryopts __fail__; do
		if [ "${tryopt}" = "__fail__" ]; then
			return 1
		fi

		# Clean up, if needed
		make distclean >/dev/null 2>/dev/null
		if [ "${tryopt}" == "--enable-shared" ]; then
			isshared="1"
		else
			isshared="0"
		fi

		# If build a static package for KitDLL, ensure that we use PIC
		# so that it can be linked into the shared object







|

>
>
|

|



|






|







172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
		if [ -n "${kc_var_val}" ]; then
			eval "${base_var}=\"\$${base_var} \$${kc_var}\"; export ${base_var}"
		fi
	done

	# Determine if we should enable shared or not
	if [ "${staticpkg}" = "0" ]; then
		tryopts=("--enable-shared" "--disable-shared")
	elif [ "${staticpkg}" = "-1" ]; then
		tryopts=("--enable-shared")
	elif [ "${pkg_no_support_for_static}" = '1' ]; then
		tryopts=('')
	else
		tryopts=("--disable-shared")
	fi

	save_cflags="${CFLAGS}"
	for tryopt in "${tryopts[@]}" __fail__; do
		if [ "${tryopt}" = "__fail__" ]; then
			return 1
		fi

		# Clean up, if needed
		make distclean >/dev/null 2>/dev/null
		if [ "${tryopt}" = "--enable-shared" -o "${tryopt}" = '' ]; then
			isshared="1"
		else
			isshared="0"
		fi

		# If build a static package for KitDLL, ensure that we use PIC
		# so that it can be linked into the shared object
221
222
223
224
225
226
227
228




















229
230
231
232
233
234
235
				sed 's@XXX_TCL_STUBS@USE_TCL_STUBS@g' configure > configure.new
			fi

			cat configure.new > configure
			rm -f configure.new
		fi

		./configure $tryopt --prefix="${installdir}" --exec-prefix="${installdir}" --libdir="${installdir}/lib" --with-tcl="${TCLCONFIGDIR}" "${configure_extra[@]}" ${CONFIGUREEXTRA} && break




















	done

	return 0
}

function postconfigure() {
	:







|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
				sed 's@XXX_TCL_STUBS@USE_TCL_STUBS@g' configure > configure.new
			fi

			cat configure.new > configure
			rm -f configure.new
		fi

		configure_opts=($tryopt --prefix="${installdir}" --exec-prefix="${installdir}" --libdir="${installdir}/lib" --with-tcl="${TCLCONFIGDIR}" "${configure_extra[@]}" ${CONFIGUREEXTRA})
		configure_opts_new=()
		for configure_opt in "${configure_opts[@]}"; do
			ignore_this_opt='0'
			for ignore_opt in "${pkg_ignore_opts[@]}"; do
				case "${configure_opt}" in
					"${ignore_opt}"|"${ignore_opt}"=*)
						ignore_this_opt='1'
						;;
				esac
			done

			if [ "${ignore_this_opt}" = '1' ]; then
				continue
			fi

			configure_opts_new+=("${configure_opt}")
		done
		configure_opts=("${configure_opts_new[@]}")

		"${pkg_path_to_configure:-./configure}" "${configure_opts[@]}" && break
	done

	return 0
}

function postconfigure() {
	:
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263

function preinstall() {
	:
}

function install() {
	mkdir -p "${installdir}/lib" || return 1
	${MAKE:-make} tcllibdir="${installdir}/lib" "${make_extra[@]}" install || return 1
}

function postinstall() {
	:
}

function createruntime() {







|







273
274
275
276
277
278
279
280
281
282
283
284
285
286
287

function preinstall() {
	:
}

function install() {
	mkdir -p "${installdir}/lib" || return 1
	${MAKE:-make} tcllibdir="${installdir}/lib" TCL_PACKAGE_PATH="${installdir}/lib" "${make_extra[@]}" install || return 1
}

function postinstall() {
	:
}

function createruntime() {