31 lines
784 B
Bash
Executable file
31 lines
784 B
Bash
Executable file
#!/bin/sh
|
|
|
|
dir=$(dirname $0)
|
|
tempfile="${dir}/make.conf.$$"
|
|
|
|
if [ $(ldd /bin/sh | grep 'libc.so' |grep -c /lib/) != 0 ]; then
|
|
ARCHX86=1
|
|
FILTER="^%ARCHX64%"
|
|
REMOVE="^%ARCHX86%"
|
|
else
|
|
ARCHX64=1
|
|
FILTER="^%ARCHX86%"
|
|
REMOVE="^%ARCHX64%"
|
|
fi
|
|
|
|
source "${dir}/make.defines"
|
|
|
|
if [ -z "${BUILDENV}" ]; then
|
|
grep -v '^%BUILDENV%' "${dir}/make.conf.template" | sed -e 's#^%~BUILDENV%##' | grep -v "${FILTER}" | sed -e "s#${REMOVE}##" > "${tempfile}"
|
|
else
|
|
grep -v '^%~BUILDENV%' "${dir}/make.conf.template" | sed -e 's#^%BUILDENV%##' | grep -v "${FILTER}" | sed -e "s#${REMOVE}##" > "${tempfile}"
|
|
fi
|
|
|
|
if cmp -s "${dir}/make.conf" "${tempfile}"; then
|
|
rm -f "${tempfile}"
|
|
else
|
|
touch -r "${dir}/make.defines" "${tempfile}"
|
|
mv -f "${tempfile}" "${dir}/make.conf"
|
|
echo "Updated make.conf"
|
|
fi
|