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    148   
   149    149   function configure() {
   150    150   	local tryopts tryopt
   151    151   	local staticpkg staticpkgvar
   152    152   	local isshared
   153    153   	local save_cflags
   154    154   	local base_var kc_var
          155  +	local configure_opt configure_opts configure_opts_new
          156  +	local ignore_opt ignore_this_opt
   155    157   
   156    158   	# Determine if the user decided this should be static or not
   157    159   	staticpkgvar="$(echo "STATIC${internalpkgname}" | dd conv=ucase 2>/dev/null)"
   158    160   	staticpkg="$(eval "echo \"\$${staticpkgvar}\"")"
   159    161   
   160    162   	# Determine if the build script overrides this
   161    163   	if [ "${pkg_always_static}" = '1' ]; then
................................................................................
   170    172   		if [ -n "${kc_var_val}" ]; then
   171    173   			eval "${base_var}=\"\$${base_var} \$${kc_var}\"; export ${base_var}"
   172    174   		fi
   173    175   	done
   174    176   
   175    177   	# Determine if we should enable shared or not
   176    178   	if [ "${staticpkg}" = "0" ]; then
   177         -		tryopts="--enable-shared --disable-shared"
          179  +		tryopts=("--enable-shared" "--disable-shared")
   178    180   	elif [ "${staticpkg}" = "-1" ]; then
   179         -		tryopts="--enable-shared"
          181  +		tryopts=("--enable-shared")
          182  +	elif [ "${pkg_no_support_for_static}" = '1' ]; then
          183  +		tryopts=('')
   180    184   	else
   181         -		tryopts="--disable-shared"
          185  +		tryopts=("--disable-shared")
   182    186   	fi
   183    187   
   184    188   	save_cflags="${CFLAGS}"
   185         -	for tryopt in $tryopts __fail__; do
          189  +	for tryopt in "${tryopts[@]}" __fail__; do
   186    190   		if [ "${tryopt}" = "__fail__" ]; then
   187    191   			return 1
   188    192   		fi
   189    193   
   190    194   		# Clean up, if needed
   191    195   		make distclean >/dev/null 2>/dev/null
   192         -		if [ "${tryopt}" == "--enable-shared" ]; then
          196  +		if [ "${tryopt}" = "--enable-shared" -o "${tryopt}" = '' ]; then
   193    197   			isshared="1"
   194    198   		else
   195    199   			isshared="0"
   196    200   		fi
   197    201   
   198    202   		# If build a static package for KitDLL, ensure that we use PIC
   199    203   		# so that it can be linked into the shared object
................................................................................
   221    225   				sed 's@XXX_TCL_STUBS@USE_TCL_STUBS@g' configure > configure.new
   222    226   			fi
   223    227   
   224    228   			cat configure.new > configure
   225    229   			rm -f configure.new
   226    230   		fi
   227    231   
   228         -		./configure $tryopt --prefix="${installdir}" --exec-prefix="${installdir}" --libdir="${installdir}/lib" --with-tcl="${TCLCONFIGDIR}" "${configure_extra[@]}" ${CONFIGUREEXTRA} && break
          232  +		configure_opts=($tryopt --prefix="${installdir}" --exec-prefix="${installdir}" --libdir="${installdir}/lib" --with-tcl="${TCLCONFIGDIR}" "${configure_extra[@]}" ${CONFIGUREEXTRA})
          233  +		configure_opts_new=()
          234  +		for configure_opt in "${configure_opts[@]}"; do
          235  +			ignore_this_opt='0'
          236  +			for ignore_opt in "${pkg_ignore_opts[@]}"; do
          237  +				case "${configure_opt}" in
          238  +					"${ignore_opt}"|"${ignore_opt}"=*)
          239  +						ignore_this_opt='1'
          240  +						;;
          241  +				esac
          242  +			done
          243  +
          244  +			if [ "${ignore_this_opt}" = '1' ]; then
          245  +				continue
          246  +			fi
          247  +
          248  +			configure_opts_new+=("${configure_opt}")
          249  +		done
          250  +		configure_opts=("${configure_opts_new[@]}")
          251  +
          252  +		"${pkg_path_to_configure:-./configure}" "${configure_opts[@]}" && break
   229    253   	done
   230    254   
   231    255   	return 0
   232    256   }
   233    257   
   234    258   function postconfigure() {
   235    259   	:
................................................................................
   249    273   
   250    274   function preinstall() {
   251    275   	:
   252    276   }
   253    277   
   254    278   function install() {
   255    279   	mkdir -p "${installdir}/lib" || return 1
   256         -	${MAKE:-make} tcllibdir="${installdir}/lib" "${make_extra[@]}" install || return 1
          280  +	${MAKE:-make} tcllibdir="${installdir}/lib" TCL_PACKAGE_PATH="${installdir}/lib" "${make_extra[@]}" install || return 1
   257    281   }
   258    282   
   259    283   function postinstall() {
   260    284   	:
   261    285   }
   262    286   
   263    287   function createruntime() {