summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2013-03-30 12:24:03 (EDT)
committer P. J. McDermott <pjm@nac.net>2013-03-30 12:24:03 (EDT)
commit04a055afcc4cb2512c2399949311903a0f547deb (patch)
tree81ea61c5034f9af7ddcd905248d470d38c50aab8 /build
parent28f8024211f0e2f3180cc1541cc978388115e445 (diff)
Update to SPF 2.0, etc.
* Refactor build makefile. * Use multiarch library directories. * Install locales. * Move changelogs into libc.6. * Don't install manual.
Diffstat (limited to 'build')
-rwxr-xr-xbuild204
1 files changed, 101 insertions, 103 deletions
diff --git a/build b/build
index 05dc928..e49f753 100755
--- a/build
+++ b/build
@@ -1,123 +1,121 @@
#! /usr/bin/make -f
-PKGS = libc.6 libc.6-dev \
- libc-bin libc-dev-bin nscd \
- locales zoneinfo \
- eglibc-doc \
-
prefix = /usr
-bindir = $(prefix)/bin
-sbindir = $(prefix)/sbin
-libexecdir = $(prefix)/lib
-sysconfdir = /etc
-libdir = /usr/lib
-includedir = $(prefix)/include
datarootdir = $(prefix)/share
datadir = $(prefix)/share
-infodir = $(prefix)/share/info
localedir = $(prefix)/lib/locale
-mandir = $(prefix)/share/man
docdir = $(prefix)/share/doc
-$(PKGS): eglibc.stamp
+SUPPORTED_LOCALES = \
+ de_DE.UTF-8/UTF-8 de_DE/ISO-8859-1 de_DE@euro/ISO-8859-15 \
+ en_HK.UTF-8/UTF-8 en_HK/ISO-8859-1 \
+ en_PH.UTF-8/UTF-8 en_PH/ISO-8859-1 \
+ en_US.UTF-8/UTF-8 en_US/ISO-8859-1 \
+ es_MX.UTF-8/UTF-8 es_MX/ISO-8859-1 \
+ fa_IR/UTF-8 \
+ fr_FR.UTF-8/UTF-8 fr_FR/ISO-8859-1 fr_FR@euro/ISO-8859-15 \
+ it_IT.UTF-8/UTF-8 it_IT/ISO-8859-1 \
+ ja_JP.EUC-JP/EUC-JP ja_JP.UTF-8/UTF-8
+
+nop:
+ @:
+
+configure-libc:
+ # TODO: Remove manual from upstream source.
+ #rm -Rf src/libc/manual
+ [ ! -d libcbuild ] && mkdir libcbuild || true
+ rm -f libcbuild/config.cache
+ echo 'libc_cv_forced_unwind=yes' >>libcbuild/config.cache
+ echo 'libc_cv_c_cleanup=yes' >>libcbuild/config.cache
+ echo 'libc_cv_gnu89_inline=yes' >>libcbuild/config.cache
+ echo 'libc_cv_ssp=no' >>libcbuild/config.cache
+ echo 'libc_cv_slibdir=/lib/'"$${OPK_HOST_ARCH}" \
+ >>libcbuild/config.cache
+ if [ -n "$${TOOLS_PREFIX}" ]; then \
+ BINUTILS="--with-binutils=$${TOOLS_PREFIX}/bin"; \
+ else \
+ BINUTILS=; \
+ fi && \
+ if [ -n "$${HEADERS_PREFIX}" ]; then \
+ HEADERS="--with-headers=$${HEADERS_PREFIX}/usr/include"; \
+ else \
+ HEADERS=; \
+ fi && \
+ BUILD_CC=gcc BUILD_CXX=g++ oh-autoconfigure \
+ -s "$${PWD}/src/libc" -B libcbuild -- \
+ --datarootdir=$(datarootdir) --datadir=$(datadir) \
+ --localedir=$(localedir) --docdir=$(docdir) \
+ --disable-profile \
+ --enable-add-ons=../ports,nptl,libidn \
+ --enable-kernel=3.2.0 \
+ --with-tls --with-__thread --without-cvs \
+ --without-selinux --without-gd \
+ $${BINUTILS} \
+ $${HEADERS} \
+ --cache-file=config.cache
+ touch $@
+
+configure-locales:
+ [ ! -d localesbuild ] && mkdir localesbuild || true
+ CPPFLAGS=-DNOT_IN_libc oh-autoconfigure \
+ -s "$${PWD}/src/localedef" -B localesbuild -- \
+ --libdir='$${prefix}/lib' \
+ --with-glibc=../src/libc
+ touch $@
+
+configure: configure-libc configure-locales
+ touch $@
-.SILENT: eglibc.setup.stamp
-eglibc.setup.stamp:
- cd src/libc && \
- ln -s ../ports ports
- mkdir libcbuild
- touch eglibc.setup.stamp
+build-libc: configure
+ oh-autobuild -s "$${PWD}/src/libc" -B libcbuild -- -j $${JOBS:-1}
+ touch $@
-.SILENT: eglibc.configure.stamp
-eglibc.configure.stamp: eglibc.setup.stamp
- cd libcbuild && \
- rm -f config.cache && \
- echo 'libc_cv_forced_unwind=yes' >> config.cache && \
- echo 'libc_cv_c_cleanup=yes' >> config.cache && \
- echo 'libc_cv_gnu89_inline=yes' >> config.cache && \
- echo 'libc_cv_ssp=no' >> config.cache && \
- if [ -n "$${TOOLS_PREFIX}" ]; then \
- BINUTILS=--with-binutils=$${TOOLS_PREFIX}/bin; \
- else \
- BINUTILS=; \
- fi && \
- BUILD_CC=gcc BUILD_CXX=g++ ../src/libc/configure \
- --prefix=$(prefix) \
- --bindir=$(bindir) --sbindir=$(sbindir) \
- --libexecdir=$(libexecdir) --sysconfdir=$(sysconfdir) \
- --libdir=$(libdir) --includedir=$(includedir) \
- --datarootdir=$(datarootdir) --datadir=$(datadir) \
- --infodir=$(infodir) --localedir=$(localedir) \
- --mandir=$(mandir) --docdir=$(docdir) \
- --build=$${OH_BUILD_ARCH_GNU} --host=$${OH_HOST_ARCH_GNU} \
- --disable-profile --enable-add-ons \
- --enable-kernel=3.2.0 \
- --with-tls --with-__thread --without-cvs \
- --without-selinux --without-gd \
- $${BINUTILS} \
- --with-headers=$${HEADERS_PREFIX}/usr/include \
- --cache-file=config.cache
- touch eglibc.configure.stamp
+build-locales: configure
+ oh-autobuild -s "$${PWD}/src/localedef" -B localesbuild -- \
+ -j $${JOBS:-1}
+ touch $@
-.SILENT: eglibc.build.stamp
-eglibc.build.stamp: eglibc.configure.stamp
- cd libcbuild && \
- make -j $${JOBS:-1}
- touch eglibc.build.stamp
+build: build-libc build-locales
+ touch $@
-.SILENT: eglibc.install.stamp
-eglibc.install.stamp: eglibc.build.stamp
- cd libcbuild && \
- make install_root=$$(pwd)/../dest install
- rm dest/var/db/Makefile \
+install-libc: build
+ # Install /etc/ld.so.conf early to silence a warning from ldconfig.
+ cp ../ld.so.conf dest/etc
+ oh-autoinstall -s "$${PWD}/src/libc" -B libcbuild
+ rm -f dest/var/db/Makefile \
dest/sbin/sln \
dest/usr/bin/makedb \
dest/usr/bin/pcprofiledump \
dest/usr/bin/xtrace
- rm -Rf dest/usr/lib/*_pic*
- mkdir -p dest/usr/share/doc/eglibc-doc && \
- cp -Rp src/libc/ChangeLog* \
- dest/usr/share/doc/eglibc-doc
- mkdir -p dest/usr/share/doc/eglibc-doc/libidn && \
- cp -Rp src/libc/libidn/ChangeLog* \
- dest/usr/share/doc/eglibc-doc/libidn
- mkdir -p dest/usr/share/doc/eglibc-doc/localedata && \
- cp -Rp src/libc/localedata/ChangeLog* \
- dest/usr/share/doc/eglibc-doc/localedata
- mkdir -p dest/usr/share/doc/eglibc-doc/nptl && \
- cp -Rp src/libc/nptl/ChangeLog* \
- dest/usr/share/doc/eglibc-doc/nptl
- mkdir -p dest/usr/share/doc/eglibc-doc/nptl_db && \
- cp -Rp src/libc/nptl_db/ChangeLog* \
- dest/usr/share/doc/eglibc-doc/nptl_db
- cp ../ld.so.conf dest/etc
+ # TODO: PIC package?
+ rm -Rf dest/usr/lib/*/*_pic.*
+ rm -Rf dest/usr/lib/*/libc_pic/
+ # pt_chown isn't necessary with Linux's devptsfs.
+ [ "x${OPK_HOST_ARCH_KERNEL}" = 'xlinux' ] && \
+ rm -f dest/usr/lib/*/pt_chown
cp ../nsswitch.conf dest/etc
- touch eglibc.install.stamp
+ rm -f dest/etc/ld.so.cache
+ # TODO: Remove manual from upstream source.
+ rm -Rf dest/usr/share/info
+
+install-locales: build
+ oh-autoinstall -s "$${PWD}/src/localedef" -B localesbuild \
+ -T install-locales \
+ SUPPORTED-LOCALES='$(SUPPORTED_LOCALES)'
+
+install: install-libc install-locales
+ oh-fixperms
+ oh-strip #-k
+ oh-installfiles
- #mkdir localesbuild
- #cd localesbuild && \
- # CPPFLAGS=-DNOT_IN_libc ../src/localedef/configure \
- # --prefix=$$(pwd)/../dest/usr \
- # --with-glibc=../src/libc && \
- # make && \
- # make SUPPORTED-LOCALES='\
- # de_DE.UTF-8/UTF-8 de_DE/ISO-8859-1 de_DE@euro/ISO-8859-15 \
- # en_HK.UTF-8/UTF-8 en_HK/ISO-8859-1 \
- # en_PH.UTF-8/UTF-8 en_PH/ISO-8859-1 \
- # en_US.UTF-8/UTF-8 en_US/ISO-8859-1 \
- # es_MX.UTF-8/UTF-8 es_MX/ISO-8859-1 \
- # fa_IR/UTF-8 \
- # fr_FR.UTF-8/UTF-8 fr_FR/ISO-8859-1 fr_FR@euro/ISO-8859-15 \
- # it_IT.UTF-8/UTF-8 it_IT/ISO-8859-1 \
- # ja_JP.EUC-JP/EUC-JP ja_JP.UTF-8/UTF-8' install-locales
+clean-libc:
+ oh-autoclean -s "$${PWD}/src/libc" -B libcbuild
+ rm -f configure-libc build-libc
- # We're skipping the debug package for now...
- #oh-strip -gl /usr/bin /usr/lib/*
+clean-locales:
+ oh-autoclean -s "$${PWD}/src/localedef" -B localesbuild
+ rm -f configure-locales build-locales
-.SILENT: eglibc.stamp
-eglibc.stamp: eglibc.install.stamp
- oh-installfiles $(PKGS)
- oh-installdocs libc.6
- oh-gencontrol $(PKGS)
- oh-buildopk $(PKGS)
- touch eglibc.stamp
+clean: clean-libc clean-locales
+ rm -f configure build
+ rm -Rf *.data