Diff

Differences From Artifact [6f7681a2e1]:

To Artifact [eaa77b3a1b]:


    93     93   		tryopts="--disable-shared"
    94     94   	fi
    95     95   
    96     96   	# Disable SSLv2, newer SSL libraries drop support for it entirely
    97     97   	CFLAGS="${CFLAGS} -DNO_SSL2=1"
    98     98   
    99     99   	SAVE_CFLAGS="${CFLAGS}"
          100  +	SAVE_LIBS="${LIBS}"
   100    101   	for tryopt in $tryopts __fail__; do
          102  +		CFLAGS="${SAVE_CFLAGS}"
          103  +		LIBS="${SAVE_LIBS}"
          104  +		export CFLAGS LIBS
          105  +
   101    106   		# Clean up, if needed
   102    107   		make distclean >/dev/null 2>/dev/null
   103    108   		rm -rf "${INSTDIR}"
   104    109   		mkdir "${INSTDIR}"
   105    110   
   106    111   		if [ "${tryopt}" = "__fail__" ]; then
   107    112   			exit 1
................................................................................
   108    113   		fi
   109    114   
   110    115   		if [ "${tryopt}" == "--enable-shared" ]; then
   111    116   			isshared="1"
   112    117   		else
   113    118   			isshared="0"
   114    119   		fi
          120  +
          121  +		# If building a shared TLS, add the LINKADD libraries here
          122  +		if [ "${isshared}" = '1' ]; then
          123  +			LIBS="${LIBS} ${KC_TLS_LINKADD}"
          124  +		fi
   115    125   
   116    126   		# If build a static TLS for KitDLL, ensure that we use PIC
   117    127   		# so that it can be linked into the shared object
   118    128   		if [ "${isshared}" = "0" -a "${KITTARGET}" = "kitdll" ]; then
   119         -			CFLAGS="${SAVE_CFLAGS} -fPIC"
   120         -		else
   121         -			CFLAGS="${SAVE_CFLAGS}"
          129  +			CFLAGS="${CFLAGS} -fPIC"
   122    130   		fi
   123         -		export CFLAGS
   124    131   
   125    132   		if [ "${isshared}" = '0' ]; then
   126    133   			sed 's@USE_TCL_STUBS@XXX_TCL_STUBS@g' configure > configure.new
   127    134   		else
   128    135   			sed 's@XXX_TCL_STUBS@USE_TCL_STUBS@g' configure > configure.new
   129    136   		fi
   130    137   		cat configure.new > configure
................................................................................
   155    162   package ifneeded tls ${TLSVERS} \
   156    163       "[list source [file join \$dir tls.tcl]] ; \
   157    164        [list load {} tls]"
   158    165   _EOF_
   159    166   	fi
   160    167   
   161    168   	# Determine name of static object
   162         -	LINKADDFILE="$(find "${INSTDIR}" -name '*.a' | head -n 1).linkadd"
          169  +	LINKADDFILE="$(find "${INSTDIR}" -name '*.a' | head -n 1)"
          170  +	if [ -n "${LINKADDFILE}" ]; then
          171  +		LINKADDFILE="${LINKADDFILE}.linkadd"
   163    172   
   164         -	## XXX: TODO: Determine what we actually need to link against
   165         -	addlibs="-L${SSL_LIB_DIR:-/lib} -lssl -lcrypto ${KC_TLS_LINKADD}"
   166         -	addlibs_staticOnly=""
   167         -	if [ "${KC_TLS_LINKSSLSTATIC}" = '1' ]; then
   168         -		echo "-Wl,-Bstatic ${addlibs} ${addlibs_staticOnly} -Wl,-Bdynamic"
   169         -	else
   170         -		echo "${addlibs}"
   171         -	fi > "${LINKADDFILE}"
          173  +		## XXX: TODO: Determine what we actually need to link against
          174  +		addlibs="-L${SSL_LIB_DIR:-/lib} -lssl -lcrypto ${KC_TLS_LINKADD}"
          175  +		addlibs_staticOnly=""
          176  +		if [ "${KC_TLS_LINKSSLSTATIC}" = '1' ]; then
          177  +			echo "-Wl,-Bstatic ${addlibs} ${addlibs_staticOnly} -Wl,-Bdynamic"
          178  +		else
          179  +			echo "${addlibs}"
          180  +		fi > "${LINKADDFILE}"
          181  +	fi
   172    182   
   173    183   	# Install files needed by installation
   174    184   	cp -r "${INSTDIR}/lib" "${OUTDIR}" || exit 1
   175    185   	find "${OUTDIR}" -name '*.a' -type f | xargs -n 1 rm -f --
   176    186   
   177    187   	exit 0
   178    188   ) || exit 1
   179    189   
   180    190   exit 0