# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.67])
-AC_INIT([kconfig-frontends], [m4_esyscmd_s([cat .version])], [nobody@nowhere.org])
+AC_INIT(
+ [kconfig-frontends],
+ [m4_esyscmd_s([./scripts/version.sh])],
+ [nobody@nowhere.org])
AC_CONFIG_SRCDIR([frontends/conf/conf.c])
# Use a config.h to avoid brazilions -DHAVE_FOO on compile lines
AC_CONFIG_HEADERS([config.h])
# If an argument is given, it's the location
# of the Linux kernel source tree
k_dir="${1}"
-if [ -n "${k_dir}" -a -d "${k_dir}/kernel" ]; then
- # Get the version
- eval $( head -n 5 "${k_dir}/Makefile" \
- |sed -r -e 's/^/K_/; s/"//g; s/ = ?/="/; s/$/"/;' \
- )
- printf "Found Linux kernel %d.%d.%d%s '%s'\n" \
- "${K_VERSION}" "${K_PATCHLEVEL}" "${K_SUBLEVEL}" \
- "${K_EXTRAVERSION}" "${K_NAME}"
-else
+if [ ! \( -n "${k_dir}" -a -d "${k_dir}/kernel" \) ]; then
if [ -n "${k_dir}" ]; then
printf "%s: \`%s': not a Linux kernel source tree\n" \
"${my_name}" "${k_dir}"
exit 1
fi
-exec <misc/kernel2kfrontends.list
+# Get the kernel version
+eval $( head -n 5 "${k_dir}/Makefile" \
+ |sed -r -e 's/^/K_/; s/"//g; s/ = ?/="/; s/$/"/;' \
+ )
+k_cset="$( cd "${k_dir}"; \
+ git log -n 1 --pretty='format:%H' \
+ )"
+printf "Found Linux kernel %d.%d.%d%s '%s' (%7.7s)\n" \
+ "${K_VERSION}" "${K_PATCHLEVEL}" "${K_SUBLEVEL}" \
+ "${K_EXTRAVERSION}" "${K_NAME}" "${k_cset}"
+
+# Get the kconfig-frontends version
+kf_version="$( tail -n 1 .version )"
+# Store the new version
+printf "%d.%d.%d%s %s %s\n%s\n" \
+ "${K_VERSION}" "${K_PATCHLEVEL}" \
+ "${K_SUBLEVEL}" "${K_EXTRAVERSION}" \
+ "${k_cset}" "${K_NAME}" \
+ "${kf_version}" \
+ >.version
+
+exec <misc/kernel2kfrontends.list
while read k_file trash kf_file; do
cp -v "${k_dir}/${k_file}" "${kf_file}"
if [ -f "${kf_file}.patch" ]; then
--- /dev/null
+#!/bin/sh
+
+k_ver="$( head -n 1 .version |cut -d ' ' -f 1 )"
+k_cset="$( head -n 1 .version |cut -d ' ' -f 2 )"
+k_name="$( head -n 1 .version |cut -d ' ' -f 3- )"
+kf_ver="$( tail -n 1 .version )"
+
+case "${k_ver}" in
+ *-rc*) k_ver="${k_ver}_$( printf "%-7.7s" "${k_cset}" )";;
+ *) ;;
+esac
+k_ver="$( echo "${k_ver}" |tr '-' '_' )"
+
+case "${kf_ver}" in
+ hg) kf_ver="-hg_$( hg id -i -r . )";;
+ "") kf_ver="";;
+ *) kf_ver="-${kf_ver}";;
+esac
+
+echo "${k_ver}${kf_ver}"