summaryrefslogtreecommitdiffhomepage
path: root/subr/pkg_fetch_subdirs.subr
diff options
context:
space:
mode:
authorLucio Andrés Illanes Albornoz (arab, vxp) <lucio@lucioillanes.de>2017-11-20 21:45:21 +0000
committerLucio Andrés Illanes Albornoz (arab, vxp) <lucio@lucioillanes.de>2017-11-21 00:51:43 +0000
commitc27beab66023847435fb88cd5cc75916dca37057 (patch)
treec43c23133f5b837925785d5501aa4cff14980415 /subr/pkg_fetch_subdirs.subr
parentd01c0269b8e5e467f82cd28392579c4c43fe63bc (diff)
downloadmidipix_build-c27beab66023847435fb88cd5cc75916dca37057.tar.bz2
midipix_build-c27beab66023847435fb88cd5cc75916dca37057.tar.xz
Refactors build steps along the sequence {setup,fetch,configure,build,install}.
subr/mode_check_updates.subr: seperated into check_updates.sh. subr/post_{copy_etc,sha256sums,tarballs}.subr: absorbed into `dist' target.
Diffstat (limited to 'subr/pkg_fetch_subdirs.subr')
-rw-r--r--subr/pkg_fetch_subdirs.subr23
1 files changed, 23 insertions, 0 deletions
diff --git a/subr/pkg_fetch_subdirs.subr b/subr/pkg_fetch_subdirs.subr
new file mode 100644
index 00000000..680871e2
--- /dev/null
+++ b/subr/pkg_fetch_subdirs.subr
@@ -0,0 +1,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
+ build_fileop mkdir "${PKG_BUILD_DIR}";
+ fi;
+ build_fileop cd "${PKG_BUILD_DIR}";
+};
+
+# vim:filetype=sh