2010-01-12 21:47:14 +00:00
|
|
|
# Build script for m4
|
|
|
|
|
2018-11-19 23:17:37 +00:00
|
|
|
do_companion_tools_m4_get()
|
|
|
|
{
|
2017-05-30 05:32:38 +00:00
|
|
|
CT_Fetch M4
|
2010-01-12 21:47:14 +00:00
|
|
|
}
|
|
|
|
|
2018-11-19 23:17:37 +00:00
|
|
|
do_companion_tools_m4_extract()
|
|
|
|
{
|
2017-05-30 05:32:38 +00:00
|
|
|
CT_ExtractPatch M4
|
2010-01-12 21:47:14 +00:00
|
|
|
}
|
|
|
|
|
2018-11-19 23:17:37 +00:00
|
|
|
do_companion_tools_m4_for_build()
|
|
|
|
{
|
2017-01-24 02:48:22 +00:00
|
|
|
CT_DoStep INFO "Installing m4 for build"
|
2016-11-29 00:55:22 +00:00
|
|
|
CT_mkdir_pushd "${CT_BUILD_DIR}/build-m4-build"
|
|
|
|
do_m4_backend \
|
|
|
|
host=${CT_BUILD} \
|
|
|
|
prefix="${CT_BUILD_COMPTOOLS_DIR}" \
|
|
|
|
cflags="${CT_CFLAGS_FOR_BUILD}" \
|
|
|
|
ldflags="${CT_LDFLAGS_FOR_BUILD}"
|
|
|
|
CT_Popd
|
|
|
|
CT_EndStep
|
|
|
|
}
|
|
|
|
|
2018-11-19 23:17:37 +00:00
|
|
|
do_companion_tools_m4_for_host()
|
|
|
|
{
|
2017-01-24 02:48:22 +00:00
|
|
|
CT_DoStep INFO "Installing m4 for host"
|
2016-11-29 00:55:22 +00:00
|
|
|
CT_mkdir_pushd "${CT_BUILD_DIR}/build-m4-host"
|
|
|
|
do_m4_backend \
|
|
|
|
host=${CT_HOST} \
|
|
|
|
prefix="${CT_PREFIX_DIR}" \
|
|
|
|
cflags="${CT_CFLAGS_FOR_HOST}" \
|
|
|
|
ldflags="${CT_LDFLAGS_FOR_HOST}"
|
|
|
|
CT_Popd
|
|
|
|
CT_EndStep
|
|
|
|
}
|
|
|
|
|
2018-11-19 23:17:37 +00:00
|
|
|
do_m4_backend()
|
|
|
|
{
|
2016-11-29 00:55:22 +00:00
|
|
|
local host
|
|
|
|
local prefix
|
|
|
|
local cflags
|
|
|
|
local ldflags
|
2020-10-05 12:50:42 +00:00
|
|
|
local libs
|
2016-11-29 00:55:22 +00:00
|
|
|
|
|
|
|
for arg in "$@"; do
|
|
|
|
eval "${arg// /\\ }"
|
|
|
|
done
|
|
|
|
|
|
|
|
case "${host}" in
|
|
|
|
*-uclibc)
|
|
|
|
# uClibc has posix_spawn in librt, but m4 configure only
|
|
|
|
# searches in libc. This leads to a later failure when
|
|
|
|
# it includes system <spawn.h> but expects a locally-built
|
|
|
|
# posix_spawn().
|
|
|
|
ldflags="${ldflags} -lrt"
|
2020-10-05 12:50:42 +00:00
|
|
|
;;
|
|
|
|
*-mingw32)
|
|
|
|
# m4 is built with stack smashing protection enabled which
|
|
|
|
# is not part of mingw-w64 c library in v7.0.0 and later.
|
|
|
|
libs="${libs} -lssp"
|
|
|
|
;;
|
2016-11-29 00:55:22 +00:00
|
|
|
esac
|
|
|
|
|
2016-11-23 02:10:23 +00:00
|
|
|
CT_DoLog EXTRA "Configuring m4"
|
2010-10-22 20:02:57 +00:00
|
|
|
CT_DoExecLog CFG \
|
2016-11-29 00:55:22 +00:00
|
|
|
CFLAGS="${cflags}" \
|
|
|
|
LDFLAGS="${ldflags}" \
|
2020-10-05 12:50:42 +00:00
|
|
|
LIBS="${libs}" \
|
2017-01-25 08:06:28 +00:00
|
|
|
${CONFIG_SHELL} \
|
2017-05-30 05:32:38 +00:00
|
|
|
"${CT_SRC_DIR}/m4/configure" \
|
2016-11-29 00:55:22 +00:00
|
|
|
--host="${host}" \
|
|
|
|
--prefix="${prefix}"
|
2016-11-23 02:10:23 +00:00
|
|
|
|
|
|
|
CT_DoLog EXTRA "Building m4"
|
2016-11-21 07:50:17 +00:00
|
|
|
CT_DoExecLog ALL make
|
2016-11-23 02:10:23 +00:00
|
|
|
|
2016-11-29 00:55:22 +00:00
|
|
|
CT_DoLog EXTRA "Installing m4"
|
2016-11-21 07:50:17 +00:00
|
|
|
CT_DoExecLog ALL make install
|
2010-01-12 21:47:14 +00:00
|
|
|
}
|