From ece6831d383afe54b9a005f4f83f3abf4653f445 Mon Sep 17 00:00:00 2001 From: Ruslan Ermilov Date: Thu, 16 Jun 2005 18:16:14 +0000 Subject: [PATCH] Provide 32-bit runtime support on amd64 as a separate distribution, lib32. Prodded by: obrien Nodded by: peter Approved by: re --- Makefile | 2 +- Makefile.inc1 | 21 ++++++++++++++------- release/Makefile | 13 +++++++++---- release/scripts/lib32-make.sh | 8 ++++++++ usr.sbin/sade/menus.c | 4 ++++ usr.sbin/sade/sade.8 | 5 ++++- usr.sbin/sysinstall/dist.c | 3 +++ usr.sbin/sysinstall/dist.h | 3 +++ usr.sbin/sysinstall/menus.c | 4 ++++ usr.sbin/sysinstall/sysinstall.8 | 5 ++++- 10 files changed, 54 insertions(+), 14 deletions(-) create mode 100644 release/scripts/lib32-make.sh diff --git a/Makefile b/Makefile index cdf55fef4c75..cede2760ce80 100644 --- a/Makefile +++ b/Makefile @@ -71,7 +71,7 @@ TGTS= all all-man buildenv buildkernel buildworld checkdpadd clean \ obj objlink regress rerelease tags toolchain update \ _worldtmp _legacy _bootstrap-tools _cleanobj _obj \ _build-tools _cross-tools _includes _libraries _depend \ - build32 install32 + build32 distribute32 install32 BITGTS= files includes BITGTS:=${BITGTS} ${BITGTS:S/^/build/} ${BITGTS:S/^/install/} diff --git a/Makefile.inc1 b/Makefile.inc1 index 612ed83cb5c4..e1f9ed5d3e1b 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -435,14 +435,18 @@ build32: PROG=ld-elf32.so.1 ${LIB32MAKE} DESTDIR=${LIB32TMP} ${_t} .endfor -install32: - mkdir -p ${DESTDIR}/usr/lib32 # XXX add to mtree - cd ${.CURDIR}/lib; ${LIB32MAKE} install - cd ${.CURDIR}/gnu/lib; ${LIB32MAKE} install -.if !defined(NO_CRYPT) - cd ${.CURDIR}/secure/lib; ${LIB32MAKE} install +distribute32 install32: +.if make(distribute32) + mkdir -p ${DISTDIR}/${DISTRIBUTION}/usr/lib32 # XXX add to mtree +.else + mkdir -p ${DESTDIR}/usr/lib32 # XXX add to mtree .endif - cd ${.CURDIR}/libexec/rtld-elf; PROG=ld-elf32.so.1 ${LIB32MAKE} install + cd ${.CURDIR}/lib; ${LIB32MAKE} ${.TARGET:S/32$//} + cd ${.CURDIR}/gnu/lib; ${LIB32MAKE} ${.TARGET:S/32$//} +.if !defined(NO_CRYPT) + cd ${.CURDIR}/secure/lib; ${LIB32MAKE} ${.TARGET:S/32$//} +.endif + cd ${.CURDIR}/libexec/rtld-elf; PROG=ld-elf32.so.1 ${LIB32MAKE} ${.TARGET:S/32$//} .endif @@ -550,6 +554,9 @@ redistribute: @echo ">>> Distributing everything" @echo "--------------------------------------------------------------" ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute +.if ${TARGET_ARCH} == "amd64" && !defined(NO_LIB32) + ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute32 DISTRIBUTION=lib32 +.endif distribution: cd ${.CURDIR}/etc; ${CROSSENV} PATH=${TMPPATH} ${MAKE} distribution diff --git a/release/Makefile b/release/Makefile index 67d81a373ff9..f8e462e5b9f0 100644 --- a/release/Makefile +++ b/release/Makefile @@ -162,8 +162,11 @@ DIST_DOCS_ARCH_DEP= installation relnotes hardware # Things which without too much trouble can be considered variables # BASE_DISTS are special in that they get full /etc installation sets. # -OTHER_DISTS?= catpages manpages games proflibs dict info doc +OTHER_DISTS?= catpages manpages games proflibs dict info doc ${ARCH_DISTS} BASE_DISTS?= base +.if ${TARGET_ARCH} == "amd64" +ARCH_DISTS?= lib32 +.endif DISTRIBUTIONS?= ${BASE_DISTS} ${OTHER_DISTS} # mountpoint for filesystems. @@ -351,8 +354,9 @@ release rerelease: .endif mkdir -p ${CHROOTDIR} @echo ">>> make release for ${TARGET} started on `LC_ALL=C TZ=GMT date`" - cd ${WORLDDIR} && ${NATIVEMAKE} -DNO_GAMES -DNO_HTML -DNO_INFO -DNO_MAN \ - -DNO_NLS -DNO_PROFILE installworld DESTDIR=${CHROOTDIR} + cd ${WORLDDIR} && ${NATIVEMAKE} -DNO_GAMES -DNO_HTML -DNO_INFO \ + -DNO_LIB32 -DNO_MAN -DNO_NLS -DNO_PROFILE installworld \ + DESTDIR=${CHROOTDIR} cd ${WORLDDIR} && ${NATIVEMAKE} distribution DESTDIR=${CHROOTDIR} if [ -f /etc/resolv.conf ]; then \ cp -p /etc/resolv.conf ${CHROOTDIR}/etc; \ @@ -623,7 +627,8 @@ release.5: # Remove all the directories we don't need. -cd ${RD}/trees && \ - find ${OTHER_DISTS} -depth -type d -print | xargs rmdir + (find ${OTHER_DISTS} -path '*/var/empty' | xargs chflags noschg; \ + find ${OTHER_DISTS} -depth -type d -print | xargs rmdir) touch ${.TARGET} # diff --git a/release/scripts/lib32-make.sh b/release/scripts/lib32-make.sh new file mode 100644 index 000000000000..37e16d4c719a --- /dev/null +++ b/release/scripts/lib32-make.sh @@ -0,0 +1,8 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# Clean the dust. +cd ${RD}/trees/lib32 && \ + find . ! -path '*/libexec/*' ! -path '*/usr/lib32/*' -delete diff --git a/usr.sbin/sade/menus.c b/usr.sbin/sade/menus.c index 8241876b0f93..1bfad6343855 100644 --- a/usr.sbin/sade/menus.c +++ b/usr.sbin/sade/menus.c @@ -969,6 +969,10 @@ DMenu MenuSubDistributions = { dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_GAMES }, { " info", "GNU info files", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_INFO }, +#ifdef __amd64__ + { " lib32", "32-bit runtime compatibility libraries", + dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_LIB32 }, +#endif { " man", "System manual pages - recommended", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_MANPAGES }, { " catman", "Preformatted system manual pages", diff --git a/usr.sbin/sade/sade.8 b/usr.sbin/sade/sade.8 index d21657915ff6..e75c673d6c63 100644 --- a/usr.sbin/sade/sade.8 +++ b/usr.sbin/sade/sade.8 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 9, 1997 +.Dd June 14, 2005 .Dt SYSINSTALL 8 .Os .Sh NAME @@ -419,6 +419,9 @@ Profiled libraries for developers. Dictionary information (for tools like spell). .It Li info GNU info files and other extra docs. +.It Li lib32 +(amd64 only) +32-bit runtime compatibility libraries. .It Li compat1x Compatibility with .Fx diff --git a/usr.sbin/sysinstall/dist.c b/usr.sbin/sysinstall/dist.c index 9847a05248b8..a6a8698b0756 100644 --- a/usr.sbin/sysinstall/dist.c +++ b/usr.sbin/sysinstall/dist.c @@ -81,6 +81,9 @@ static Distribution DistTable[] = { DTE_TARBALL("proflibs", &Dists, PROFLIBS, "/"), DTE_TARBALL("dict", &Dists, DICT, "/"), DTE_TARBALL("info", &Dists, INFO, "/"), +#ifdef __amd64__ + DTE_TARBALL("lib32", &Dists, LIB32, "/"), +#endif DTE_SUBDIST("src", &Dists, SRC, SrcDistTable), DTE_TARBALL("ports", &Dists, PORTS, "/usr"), DTE_TARBALL("local", &Dists, LOCAL, "/"), diff --git a/usr.sbin/sysinstall/dist.h b/usr.sbin/sysinstall/dist.h index ac3585a2a86f..3d052b960c7f 100644 --- a/usr.sbin/sysinstall/dist.h +++ b/usr.sbin/sysinstall/dist.h @@ -16,6 +16,9 @@ #define DIST_CATPAGES 0x00200 #define DIST_PORTS 0x00400 #define DIST_LOCAL 0x00800 +#ifdef __amd64__ +#define DIST_LIB32 0x01000 +#endif #define DIST_ALL 0xFFFFF /* Subtypes for SRC distribution */ diff --git a/usr.sbin/sysinstall/menus.c b/usr.sbin/sysinstall/menus.c index 8241876b0f93..1bfad6343855 100644 --- a/usr.sbin/sysinstall/menus.c +++ b/usr.sbin/sysinstall/menus.c @@ -969,6 +969,10 @@ DMenu MenuSubDistributions = { dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_GAMES }, { " info", "GNU info files", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_INFO }, +#ifdef __amd64__ + { " lib32", "32-bit runtime compatibility libraries", + dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_LIB32 }, +#endif { " man", "System manual pages - recommended", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_MANPAGES }, { " catman", "Preformatted system manual pages", diff --git a/usr.sbin/sysinstall/sysinstall.8 b/usr.sbin/sysinstall/sysinstall.8 index d21657915ff6..e75c673d6c63 100644 --- a/usr.sbin/sysinstall/sysinstall.8 +++ b/usr.sbin/sysinstall/sysinstall.8 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 9, 1997 +.Dd June 14, 2005 .Dt SYSINSTALL 8 .Os .Sh NAME @@ -419,6 +419,9 @@ Profiled libraries for developers. Dictionary information (for tools like spell). .It Li info GNU info files and other extra docs. +.It Li lib32 +(amd64 only) +32-bit runtime compatibility libraries. .It Li compat1x Compatibility with .Fx