summaryrefslogtreecommitdiffhomepage
path: root/subr/pkg_autoconf.subr
blob: e8bf0572dc53518ad3e113298e17ef4eef1eef24 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#
# set -o errexit -o noglob are assumed.
#

pkg_autoconf() {
	local __;
	if [ -e "${WORKDIR}/${PKG_SUBDIR}/configure" -o						\
	     -e "${WORKDIR}/${PKG_SUBDIR}/configure.ac" -o					\
	     -e "${WORKDIR}/${PKG_SUBDIR}/configure.in" -o					\
	     -e "${WORKDIR}/${PKG_SUBDIR}/config.guess" ]; then
		find "${WORKDIR}/${PKG_SUBDIR}" -name config.sub				\
			-exec echo mv -- {} {}.orig \;						\
			-exec mv -- {} {}.orig \;						\
			-exec echo install -m 0700 "${MIDIPIX_BUILD_PWD}/etc/config.sub" {} \;	\
			-exec install -m 0700 "${MIDIPIX_BUILD_PWD}/etc/config.sub" {} \;;
		if [ -e "${WORKDIR}/${PKG_SUBDIR}/configure.ac" ]\
		&& [ ! -e "${WORKDIR}/${PKG_SUBDIR}/configure" ]; then
			for __ in bootstrap autogen.sh ""; do
				if [ -z "${__}" ]; then
					(build_fileop cd "${WORKDIR}/${PKG_SUBDIR}" && autoconf)\
						|| exit 1 && break;
				elif [ -e "${WORKDIR}/${PKG_SUBDIR}/${__}" ]; then
					for ___ in "${WORKDIR}/${PKG_SUBDIR}/build-aux" "${WORKDIR}/${PKG_SUBDIR}"; do
						if [ -e "${___}" ]; then
							echo install -m 0700				\
								"${MIDIPIX_BUILD_PWD}/etc/config.sub"	\
								"${___}/config.sub";
							install -m 0700					\
								"${MIDIPIX_BUILD_PWD}/etc/config.sub"	\
								"${___}/config.sub";
							break;
						fi;
					done;
					(build_fileop cd "${WORKDIR}/${PKG_SUBDIR}" && "${SHELL}" "${__}")\
						|| exit 1 && break;
				fi;
			done;
		fi;
		for __ in ${PKG_BUILD_DIR} ${PKG_CONFIG_CACHE_EXTRA}; do
			build_fileop cp "${MIDIPIX_BUILD_PWD}/etc/config.cache" "${WORKDIR}/${__}/";
		done;
	fi;
};

# vim:filetype=sh