Check-in [d3f770e3c3]
Overview
Comment:Added script to create precompiled binaries
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:d3f770e3c3771c5b7e426b9ee47bf5ad0c898e75
User & Date: rkeene on 2016-09-22 19:28:48
Other Links: manifest | tags
Context
2016-09-22
19:30
Filed 1.20 check-in: 1c7faf07aa user: rkeene tags: trunk, 1.20
19:28
Added script to create precompiled binaries check-in: d3f770e3c3 user: rkeene tags: trunk
19:02
Updated to support compiling filed in alternate directories check-in: 08602df0fc user: rkeene tags: trunk
Changes

Modified .fossil-settings/ignore-glob from [72ecff7281] to [3d8734b3a3].

     1      1   filed
     2      2   filed.o
     3      3   filed-mime-types.h
            4  +compiled

Added build/build-precompiled version [46b4f35d88].

            1  +#! /usr/bin/env bash
            2  +
            3  +# Ensure we are in the correct working directory
            4  +cd "$(dirname "$(which "$0")")/.." || exit 1
            5  +
            6  +# Determine the version of Filed
            7  +version=''
            8  +eval "$(( grep '^# *define  *FILED_VERSION' filed.c; echo '|version=FILED_VERSION' ) | cpp -E | grep '^|' | sed 's@^|@@')"
            9  +if [ -z "${version}" ]; then
           10  +	echo "Unable to determine which version of Filed we are compiling.  Aborting." >&2
           11  +
           12  +	exit 1
           13  +fi
           14  +
           15  +# Cleanup
           16  +rm -rf workdir-buildPrecompiled-*
           17  +
           18  +# Compile everything, all at once
           19  +idx=-1
           20  +for tryCompilerDir in "$(readlink -f ~/root/cross-compilers)" "$(readlink -f ~/devel/build-cc/TMP)"; do
           21  +	setup_cc="${tryCompilerDir}/setup-cc"
           22  +
           23  +	platforms=(
           24  +		$("${setup_cc}" | tail -n +2)
           25  +	)
           26  +
           27  +	for platform in "${platforms[@]}"; do
           28  +		idx=$[$idx + 1]
           29  +		(
           30  +			workdir="workdir-buildPrecompiled-${idx}-$(openssl rand 20 -hex)-platform-${platform}" || exit 1
           31  +			mkdir "${workdir}" || exit 1
           32  +			cd "${workdir}" || exit 1
           33  +
           34  +			eval $("${setup_cc}" "${platform}")
           35  +			make_extra=(
           36  +				-f ../Makefile
           37  +				srcdir=..
           38  +				CC="${CC}"
           39  +			)
           40  +
           41  +			case "${platform}" in
           42  +				*-musl-*|*-musl)
           43  +					make_extra=("${make_extra[@]}" FILED_EXTRA_LDFLAGS="-static")
           44  +					;;
           45  +			esac
           46  +
           47  +			make "${make_extra[@]}"
           48  +		) &
           49  +	done
           50  +done
           51  +
           52  +# Wait for that to get done
           53  +wait
           54  +
           55  +# Rename the files into place
           56  +mkdir -p compiled
           57  +for binary in workdir-buildPrecompiled-*/filed; do
           58  +	platform="$(echo "${binary}" | sed 's@^.*-platform-@@;s@/.*$@@')"
           59  +	mv "${binary}" "compiled/filed-${version}-${platform}"
           60  +done
           61  +
           62  +# Cleanup
           63  +rm -rf workdir-buildPrecompiled-*
           64  +
           65  +exit 0