summaryrefslogtreecommitdiffhomepage
path: root/subr/pkg_fetch_subdirs.subr
blob: 7d097d034dc7a23484783702a4341fa76f0ea6c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#
# set -o errexit -o noglob are assumed.
#

pkg_fetch_subdirs() {
	if [ -z "${PKG_BUILD_DIR}" ]; then
		if [ -e "${PKG_BASE_DIR}/${PKG_SUBDIR}/configure" ]\
		|| [ -e "${PKG_BASE_DIR}/${PKG_SUBDIR}/configure.ac" ]\
		|| [ -e "${PKG_BASE_DIR}/${PKG_SUBDIR}/configure.in" ]; then
			PKG_BUILD_DIR="${PKG_BASE_DIR}/obj";
		else
			PKG_BUILD_DIR="${PKG_BASE_DIR}/${PKG_SUBDIR}";
		fi;
	else
		PKG_BUILD_DIR="${PKG_BASE_DIR}/${PKG_BUILD_DIR}";
	fi;
	if [ ! -d "${PKG_BUILD_DIR}" ]; then
		ex_build_fileop mkdir "${PKG_BUILD_DIR}";
	fi;
	ex_build_fileop cd "${PKG_BUILD_DIR}";
};

# vim:filetype=sh