Check-in [71be3ff1a1]
Overview
Comment:Improved compiling CMake-based yajl for yajltcl
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:71be3ff1a11355c5fcbf1383cc2d867bfbe74c45
User & Date: rkeene on 2016-09-06 14:29:12
Other Links: manifest | tags
Context
2016-09-06
15:21
Fixed issue with static linking of TLS when also building a local static executable check-in: 20deaf934e user: rkeene tags: trunk
14:29
Improved compiling CMake-based yajl for yajltcl check-in: 71be3ff1a1 user: rkeene tags: trunk
07:47
Added TUAPI and tDOM check-in: 36d65f9f09 user: rkeene tags: trunk
Changes

Modified yajltcl/build.sh from [fd907b16f4] to [16e015d0cc].

    23     23   		"${_download}" "${url}" "${archive}" "${hash}" || return 1
    24     24   	fi
    25     25   
    26     26   	(
    27     27   		gzip -dc "${archive}" | tar -xf - || exit 1
    28     28   		cd "${yajlbuilddir}" || exit 1
    29     29   
    30         -		./configure -p "$(pwd)/INST" || exit 1
           30  +		if [ "${KC_CROSSCOMPILE}" = '1' ]; then
           31  +			case "${KC_CROSSCOMPILE_HOST_OS}" in
           32  +				*-mingw32|*-mingw32msvc|*-mingw64)
           33  +					cmake_system_name='Windows'
           34  +					;;
           35  +				*)
           36  +					cmake_system_name="$(
           37  +						echo "${KC_CROSSCOMPILE_HOST_OS}" | \
           38  +						cut -f 3 -d - | \
           39  +						sed 's@[0-9\.]*$@@' | \
           40  +						awk '{ f = substr($1, 1, 1); r = substr($1, 2); print toupper(f) tolower(r) }' | \
           41  +						sed 's@bsd$@BSD@;s@^Aix@AIX@;s@^Hpux@HPUX@'
           42  +					)"
           43  +					;;
           44  +			esac
           45  +
           46  +			cmake_extra=(
           47  +				-DCMAKE_SYSTEM_NAME="${cmake_system_name}"
           48  +				-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER
           49  +				-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY
           50  +				-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY
           51  +				-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ONLY
           52  +				-DCMAKE_CROSSCOMPILING=1
           53  +			)
           54  +		else
           55  +			cmake_extra=()
           56  +		fi
           57  +
           58  +		if [ -n "${CC}" ]; then
           59  +			CC_path="$(echo "${CC}" | cut -f 1 -d ' ')"
           60  +			CC_flags="$(echo "${CC}" | cut -f 2- -d ' ')"
           61  +
           62  +			cmake_extra=("${cmake_extra[@]}" -DCMAKE_C_COMPILER="${CC_path}")
           63  +			if [ -n "${CC_flags}" ]; then
           64  +				cmake_extra=("${cmake_extra[@]}" -DCMAKE_C_FLAGS="${CC_flags}")
           65  +			fi
           66  +		fi
           67  +
           68  +		if [ -n "${CXX}" ]; then
           69  +			CXX_path="$(echo "${CXX}" | cut -f 1 -d ' ')"
           70  +			CXX_flags="$(echo "${CXX}" | cut -f 2- -d ' ')"
           71  +
           72  +			cmake_extra=("${cmake_extra[@]}" -DCMAKE_CXX_COMPILER="${CXX_path}")
           73  +			if [ -n "${CXX_flags}" ]; then
           74  +				cmake_extra=("${cmake_extra[@]}" -DCMAKE_CXX_FLAGS="${CXX_flags}")
           75  +			fi
           76  +		fi
           77  +
           78  +		cmake \
           79  +			-DCMAKE_INSTALL_PREFIX="${yajlbuilddir}/INST" \
           80  +			-DBUILD_SHARED_LIBS=OFF \
           81  +			-DBUILD_STATIC_LIBS=ON \
           82  +			"${cmake_extra[@]}" . || exit 1
    31     83   
    32     84   		${MAKE:-make} || exit 1
    33     85   
    34     86   		${MAKE:-make} install || exit 1
    35     87   
    36     88   		rm -f INST/lib/*.so*
    37     89   		mv INST/lib/libyajl_s.a INST/lib/libyajl.a || exit 1