diff options
Diffstat (limited to 'mk/pkg-bottom.mk')
| -rw-r--r-- | mk/pkg-bottom.mk | 92 |
1 files changed, 60 insertions, 32 deletions
diff --git a/mk/pkg-bottom.mk b/mk/pkg-bottom.mk index 64baf190c..466a4c398 100644 --- a/mk/pkg-bottom.mk +++ b/mk/pkg-bottom.mk @@ -5,28 +5,38 @@ # that we can call it (BSD make has .if target(foo) but GNU not) # and it won't error out. # * ${_foo_COOKIE} are the actual targets -# * default is "manual" -> define a do-foo: target in the Makefile +# * default is "auto" +# * define "manual" if you need your own method +# -> define a do-foo: target in the Makefile # * if you have a style -> define a pre-foo: and post-foo: if they # are required, but the do-foo: magic is done here -# * we want to use styles (configure:gnu, build/install:auto), for -# making the Makefiles of the packages more clear + +REORDER_DEPENDENCIES= ${TOPDIR}/scripts/automake.dep pre-configure: do-configure: post-configure: ${_CONFIGURE_COOKIE}: ${_PATCH_COOKIE} + @sed -e '/^#/d' ${REORDER_DEPENDENCIES} | \ + tsort | while read f; do \ + cd ${WRKSRC}; \ + case $$f in \ + /*) \ + find . -name "$${f#/}" -print | while read i; do \ + touch "$$i"; \ + done;; \ + *) \ + if test -e "$$f" ; then \ + touch "$$f"; \ + fi;; \ + esac; \ + done mkdir -p ${WRKBUILD} @${MAKE} pre-configure $(MAKE_TRACE) -ifneq ($(filter autotool,${CONFIGURE_STYLE}),) - cd ${WRKBUILD}; \ - autoreconf -vif $(MAKE_TRACE) -endif -ifneq ($(filter autoconf,${CONFIGURE_STYLE}),) - cd ${WRKBUILD}; \ - autoconf $(MAKE_TRACE) -endif -ifneq ($(filter gnu,${CONFIGURE_STYLE}),) +ifneq ($(filter manual,${CONFIG_STYLE}),) + env ${CONFIGURE_ENV} ${MAKE} do-configure $(MAKE_TRACE) +else ifneq ($(filter minimal,${CONFIG_STYLE}),) @$(CMD_TRACE) "configuring... " @cd ${WRKBUILD}; \ for i in $$(find . -name config.sub);do \ @@ -43,7 +53,26 @@ ifneq ($(filter gnu,${CONFIGURE_STYLE}),) done; cd ${WRKBUILD}; rm -f config.{cache,status}; \ env ${CONFIGURE_ENV} \ - ${BASH} ${WRKSRC}/configure \ + ${BASH} ${WRKSRC}/${CONFIGURE_PROG} \ + ${CONFIGURE_ARGS} $(MAKE_TRACE) +else ifeq ($(strip ${CONFIG_STYLE}),) + @$(CMD_TRACE) "configuring... " + @cd ${WRKBUILD}; \ + for i in $$(find . -name config.sub);do \ + if [ -f $$i ]; then \ + ${CP} $$i $$i.bak; \ + ${CP} ${SCRIPT_DIR}/config.sub $$i; \ + fi; \ + done; \ + for i in $$(find . -name config.guess);do \ + if [ -f $$i ]; then \ + ${CP} $$i $$i.bak; \ + ${CP} ${SCRIPT_DIR}/config.guess $$i; \ + fi; \ + done; + cd ${WRKBUILD}; rm -f config.{cache,status}; \ + env ${CONFIGURE_ENV} \ + ${BASH} ${WRKSRC}/${CONFIGURE_PROG} \ --build=${GNU_HOST_NAME} \ --host=${GNU_TARGET_NAME} \ --target=${GNU_TARGET_NAME} \ @@ -52,7 +81,7 @@ ifneq ($(filter gnu,${CONFIGURE_STYLE}),) --prefix=/usr \ --datadir=/usr/share \ --mandir=/usr/share/man \ - --libexecdir=/usr/sbin \ + --libexecdir=/usr/libexec \ --localstatedir=/var \ --sysconfdir=/etc \ --disable-nls \ @@ -61,17 +90,15 @@ ifneq ($(filter gnu,${CONFIGURE_STYLE}),) --disable-dependency-tracking \ --disable-libtool-lock \ ${CONFIGURE_ARGS} $(MAKE_TRACE) -else ifeq ($(filter-out manual,${CONFIGURE_STYLE}),) - env ${CONFIGURE_ENV} ${MAKE} do-configure $(MAKE_TRACE) else - @echo "Invalid CONFIGURE_STYLE '${CONFIGURE_STYLE}'" >&2 + @echo "Invalid CONFIG_STYLE '${CONFIG_STYLE}'" >&2 @exit 1 endif @${MAKE} post-configure $(MAKE_TRACE) touch $@ # do a parallel build if requested && package doesn't force disable it -ifeq (${PKG_BUILD_PARALLEL},y) +ifeq (${ADK_MAKE_PARALLEL},y) ifeq ($(strip ${PKG_NOPARALLEL}),) MAKE_FLAGS+= -j${ADK_MAKE_JOBS} endif @@ -83,13 +110,12 @@ post-build: ${_BUILD_COOKIE}: ${_CONFIGURE_COOKIE} @env ${MAKE_ENV} ${MAKE} pre-build $(MAKE_TRACE) @$(CMD_TRACE) "compiling... " -ifneq ($(filter auto,${BUILD_STYLE}),) - cd ${WRKBUILD} && env ${MAKE_ENV} ${MAKE} -f ${MAKE_FILE} \ - ${MAKE_FLAGS} ${ALL_TARGET} $(MAKE_TRACE) -else ifneq ($(filter manual,${BUILD_STYLE}),) + +ifneq ($(filter manual,${BUILD_STYLE}),) env ${MAKE_ENV} ${MAKE} do-build $(MAKE_TRACE) else ifeq ($(strip ${BUILD_STYLE}),) - env ${MAKE_ENV} ${MAKE} do-build $(MAKE_TRACE) + cd ${WRKBUILD} && env ${MAKE_ENV} ${MAKE} -f ${MAKE_FILE} \ + ${MAKE_FLAGS} ${ALL_TARGET} $(MAKE_TRACE) else @echo "Invalid BUILD_STYLE '${BUILD_STYLE}'" >&2 @exit 1 @@ -103,15 +129,18 @@ post-install: ${_FAKE_COOKIE}: ${_BUILD_COOKIE} -rm -f ${_ALL_CONTROLS} @mkdir -p '${STAGING_PARENT}/pkg' ${WRKINST} '${STAGING_DIR}/scripts' + @mkdir -p ${WRKINST}/{sbin,bin,etc,lib} + @mkdir -p ${WRKINST}/usr/{sbin,bin,etc,lib} @${MAKE} ${_ALL_CONTROLS} $(MAKE_TRACE) @env ${MAKE_ENV} ${MAKE} pre-install $(MAKE_TRACE) -ifneq ($(filter auto,${INSTALL_STYLE}),) - cd ${WRKBUILD} && env ${MAKE_ENV} ${MAKE} -f ${MAKE_FILE} \ - DESTDIR='${WRKINST}' ${FAKE_FLAGS} ${INSTALL_TARGET} $(MAKE_TRACE) -else ifneq ($(filter manual,${INSTALL_STYLE}),) +ifneq ($(filter manual,${INSTALL_STYLE}),) env ${MAKE_ENV} ${MAKE} do-install $(MAKE_TRACE) else ifeq ($(strip ${INSTALL_STYLE}),) - env ${MAKE_ENV} ${MAKE} do-install $(MAKE_TRACE) + cd ${WRKBUILD} && env ${MAKE_ENV} ${MAKE} -f ${MAKE_FILE} \ + DESTDIR='${WRKINST}' ${FAKE_FLAGS} ${INSTALL_TARGET} $(MAKE_TRACE) +ifeq (,$(filter libonly,${PKG_OPTS})) + env ${MAKE_ENV} ${MAKE} post-install $(MAKE_TRACE) +endif else @echo "Invalid INSTALL_STYLE '${INSTALL_STYLE}'" >&2 @exit 1 @@ -120,7 +149,6 @@ endif [[ -e $$a ]] || continue; \ $(SED) "s,^prefix=.*,prefix=${STAGING_DIR}/usr," $$a; \ done - @env ${MAKE_ENV} ${MAKE} post-install $(MAKE_TRACE) ifeq (,$(filter noremove,${PKG_OPTS})) @if test -s '${STAGING_PARENT}/pkg/${PKG_NAME}'; then \ cd '${STAGING_DIR}'; \ @@ -130,15 +158,15 @@ ifeq (,$(filter noremove,${PKG_OPTS})) fi endif @rm -f '${STAGING_PARENT}/pkg/${PKG_NAME}' - @cd ${WRKINST}; \ + @-cd ${WRKINST}; \ if [ "${PKG_NAME}" != "uClibc" -a "${PKG_NAME}" != "eglibc" -a "${PKG_NAME}" != "glibc" -a "${PKG_NAME}" != "libpthread" -a "${PKG_NAME}" != "libstdcxx" -a "${PKG_NAME}" != "libthread-db" ];then \ find lib \( -name lib\*.so\* -o -name lib\*.a \) \ -exec echo 'WARNING: ${PKG_NAME} installs files in /lib -' \ ' fix this!' >&2 \; -quit 2>/dev/null; fi;\ find usr ! -type d 2>/dev/null | \ - grep -v -e '^usr/share' -e '^usr/man' -e '^usr/info' | \ + grep -v -e '^usr/share' -e '^usr/man' -e '^usr/info' -e '^usr/lib/libc.so' | \ tee '${STAGING_PARENT}/pkg/${PKG_NAME}' | \ - cpio -apdlmu --quiet '${STAGING_DIR}' + cpio -padlmu '${STAGING_DIR}' @cd '${STAGING_DIR}'; grep 'usr/lib/.*\.la$$' \ '${STAGING_PARENT}/pkg/${PKG_NAME}' | while read fn; do \ chmod u+w $$fn; \ |
