From d1ee3be7f4b966174d673876f961b44e37b4c85a Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Thu, 24 Oct 2013 14:59:22 +0200 Subject: add host build infrastructure; convert file, ncurses, glib and ruby to it. remove unneeded hacks for openldap and mesalib --- mk/host-bottom.mk | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ mk/host.mk | 56 ++++++++++++++++++++++++++++++++++++++++ mk/pkg-bottom.mk | 12 ++++----- 3 files changed, 139 insertions(+), 6 deletions(-) create mode 100644 mk/host-bottom.mk create mode 100644 mk/host.mk (limited to 'mk') diff --git a/mk/host-bottom.mk b/mk/host-bottom.mk new file mode 100644 index 000000000..072254087 --- /dev/null +++ b/mk/host-bottom.mk @@ -0,0 +1,77 @@ +# This file is part of the OpenADK project. OpenADK is copyrighted +# material, please see the LICENCE file in the top-level directory. + +host-extract: ${_HOST_PATCH_COOKIE} + +host-configure: +${_HOST_CONFIGURE_COOKIE}: ${_HOST_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} + @$(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 ${HOST_CONFIGURE_ENV} \ + ${BASH} ${WRKSRC}/${CONFIGURE_PROG} \ + --program-prefix= \ + --program-suffix= \ + --prefix=/usr \ + --bindir=/usr/bin \ + --datadir=/usr/share \ + --mandir=/usr/share/man \ + --libexecdir=/usr/libexec \ + --localstatedir=/var \ + --sysconfdir=/etc \ + --disable-dependency-tracking \ + --disable-libtool-lock \ + --disable-nls \ + ${HOST_CONFIGURE_ARGS} $(MAKE_TRACE) + touch $@ + +host-build: +${_HOST_BUILD_COOKIE}: ${_HOST_CONFIGURE_COOKIE} + @$(CMD_TRACE) "compiling... " + cd ${WRKBUILD} && env ${HOST_MAKE_ENV} ${MAKE} -f ${MAKE_FILE} \ + ${HOST_MAKE_FLAGS} ${HOST_ALL_TARGET} $(MAKE_TRACE) + touch $@ + +hpkg-install: ${ALL_HOSTINST} +host-install: +${_HOST_FAKE_COOKIE}: ${_HOST_BUILD_COOKIE} + cd ${WRKBUILD} && env ${HOST_MAKE_ENV} ${MAKE} -f ${MAKE_FILE} \ + DESTDIR='${HOST_WRKINST}' ${HOST_FAKE_FLAGS} ${HOST_INSTALL_TARGET} $(MAKE_TRACE) + env ${HOST_MAKE_ENV} ${MAKE} hpkg-install $(MAKE_TRACE) + rm -rf ${WRKBUILD} ${WRKDIST} ${WRKSRC} + exec ${MAKE} host-extract $(MAKE_TRACE) + touch $@ + +${_HOST_COOKIE}: + exec ${MAKE} hostpackage + +hostpackage: ${ALL_HOSTDIRS} + touch ${_HOST_COOKIE} + diff --git a/mk/host.mk b/mk/host.mk new file mode 100644 index 000000000..f9326da17 --- /dev/null +++ b/mk/host.mk @@ -0,0 +1,56 @@ +# This file is part of the OpenADK project. OpenADK is copyrighted +# material, please see the LICENCE file in the top-level directory. + +HOST_CONFIGURE_ENV+= CONFIG_SHELL='$(strip ${SHELL})' \ + CFLAGS='$(strip ${CFLAGS_FOR_BUILD})' \ + CXXFLAGS='$(strip ${CXXFLAGS_FOR_BUILD})' \ + CPPFLAGS='$(strip ${CPPFLAGS_FOR_BUILD})' \ + LDFLAGS='$(strip ${LDFLAGS_FOR_BUILD})' + +# this is environment for 'make all' and 'make install' +HOST_MAKE_ENV?= +# this is arguments for 'make all' and 'make install' +HOST_XAKE_FLAGS?= +# this is arguments for 'make all' ONLY +HOST_MAKE_FLAGS?= +# this is arguments for 'make install' ONLY +HOST_FAKE_FLAGS?= +HOST_ALL_TARGET?= all +HOST_INSTALL_TARGET?= install + +HOST_MAKE_FLAGS+= ${HOST_XAKE_FLAGS} V=1 +HOST_FAKE_FLAGS+= ${HOST_XAKE_FLAGS} + +HOST_WRKINST= ${WRKDIR}/host + +_HOST_EXTRACT_COOKIE= ${WRKDIST}/.extract_done +_HOST_PATCH_COOKIE= ${WRKDIST}/.prepared +_HOST_CONFIGURE_COOKIE= ${WRKBUILD}/.host_configure_done +_HOST_BUILD_COOKIE= ${WRKBUILD}/.host_build_done +_HOST_FAKE_COOKIE= ${HOST_WRKINST}/.host_fake_done +_HOST_COOKIE= ${PACKAGE_DIR}/.stamps/${PKG_NAME}${PKG_VERSION}-${PKG_RELEASE}-host + +hostextract: ${_HOST_EXTRACT_COOKIE} +hostpatch: ${_HOST_PATCH_COOKIE} +hostconfigure: ${_HOST_CONFIGURE_COOKIE} +hostbuild: ${_HOST_BUILD_COOKIE} +hostfake: ${_HOST_FAKE_COOKIE} + +# there are some parameters to the HOST_template function +# 1.) Config.in identifier ADK_PACKAGE_$(1) +# 2.) name of the package, for single package mostly $(PKG_NAME) +# 3.) package version (upstream version) and package release (adk version), +# always $(PKG_VERSION)-$(PKG_RELEASE) + +define HOST_template +ALL_PKGOPTS+= $(1) +PKGNAME_$(1)= $(2) +HOSTDIR_$(1)= $(WRKDIR)/host +ifneq (${ADK_PACKAGE_$(1)}${DEVELOPER},) +ALL_HOSTDIRS+= $${HOSTDIR_$(1)} +ALL_HOSTINST+= $(2)-hostinstall +endif + +$$(HOSTDIR_$(1)): ${_HOST_PATCH_COOKIE} ${_HOST_FAKE_COOKIE} + +endef diff --git a/mk/pkg-bottom.mk b/mk/pkg-bottom.mk index 1a35599fd..aaf3ff379 100644 --- a/mk/pkg-bottom.mk +++ b/mk/pkg-bottom.mk @@ -17,7 +17,7 @@ PKG_LIBNAME?= $(PKG_NAME) pre-configure: do-configure: post-configure: -${_CONFIGURE_COOKIE}: ${_PATCH_COOKIE} +${_CONFIGURE_COOKIE}: ${_HOST_COOKIE} ${_PATCH_COOKIE} @sed -e '/^#/d' ${REORDER_DEPENDENCIES} | \ tsort | while read f; do \ cd ${WRKSRC}; \ @@ -169,15 +169,15 @@ ifeq (,$(filter noremove,${PKG_OPTS})) endif @rm -f '${STAGING_PKG_DIR}/${PKG_NAME}' ifneq (,$(filter dev,${PKG_OPTS})) - mkdir -p $(WRKDIR)/fake-${CPU_ARCH}/pkg-$(PKG_LIBNAME)-dev/usr/include - test -d ${WRKINST}/usr/include && cd ${WRKINST}/usr/include; \ + @mkdir -p $(WRKDIR)/fake-${CPU_ARCH}/pkg-$(PKG_LIBNAME)-dev/usr/include + @test -d ${WRKINST}/usr/include && cd ${WRKINST}/usr/include; \ find . -name \*.h | \ $(TOOLS_DIR)/cpio -padlmu $(WRKDIR)/fake-${CPU_ARCH}/pkg-$(PKG_LIBNAME)-dev/usr/include - mkdir -p $(WRKDIR)/fake-${CPU_ARCH}/pkg-$(PKG_LIBNAME)-dev/usr/lib/pkgconfig - test -d ${WRKINST}/usr/lib/pkgconfig && cd ${WRKINST}/usr/lib/pkgconfig; \ + @mkdir -p $(WRKDIR)/fake-${CPU_ARCH}/pkg-$(PKG_LIBNAME)-dev/usr/lib/pkgconfig + @test -d ${WRKINST}/usr/lib/pkgconfig && cd ${WRKINST}/usr/lib/pkgconfig; \ find . -name \*.pc | \ $(TOOLS_DIR)/cpio -padlmu $(WRKDIR)/fake-${CPU_ARCH}/pkg-$(PKG_LIBNAME)-dev/usr/lib/pkgconfig - for a in ${WRKINST}/usr/bin/*-config*; do \ + @for a in ${WRKINST}/usr/bin/*-config*; do \ [[ -e $$a ]] || continue; \ mkdir -p $(WRKDIR)/fake-${CPU_ARCH}/pkg-$(PKG_LIBNAME)-dev/usr/bin; \ cp $$a $(WRKDIR)/fake-${CPU_ARCH}/pkg-$(PKG_LIBNAME)-dev/usr/bin; \ -- cgit v1.2.3