From owner-svn-src-projects@FreeBSD.ORG Tue Feb 5 02:33:02 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 49983F7A; Tue, 5 Feb 2013 02:33:02 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 38E4CF30; Tue, 5 Feb 2013 02:33:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r152X22h088529; Tue, 5 Feb 2013 02:33:02 GMT (envelope-from benno@svn.freebsd.org) Received: (from benno@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r152Ww9X088469; Tue, 5 Feb 2013 02:32:58 GMT (envelope-from benno@svn.freebsd.org) Message-Id: <201302050232.r152Ww9X088469@svn.freebsd.org> From: Benno Rice Date: Tue, 5 Feb 2013 02:32:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r246343 - in projects/uefi: . bin/sh contrib/binutils/include/elf contrib/bmake contrib/bmake/mk contrib/bmake/unit-tests contrib/gcc/config/arm contrib/gdb/gdb contrib/ipfilter/ipsend ... X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 02:33:02 -0000 Author: benno Date: Tue Feb 5 02:32:58 2013 New Revision: 246343 URL: http://svnweb.freebsd.org/changeset/base/246343 Log: MFC Added: projects/uefi/contrib/bmake/Makefile - copied unchanged from r246342, head/contrib/bmake/Makefile projects/uefi/contrib/bmake/Makefile.config.in - copied unchanged from r246342, head/contrib/bmake/Makefile.config.in projects/uefi/contrib/bmake/makefile.in - copied unchanged from r246342, head/contrib/bmake/makefile.in projects/uefi/contrib/bmake/mk/ - copied from r246342, head/contrib/bmake/mk/ projects/uefi/lib/libpmc/pmc.ivybridgexeon.3 - copied unchanged from r246342, head/lib/libpmc/pmc.ivybridgexeon.3 projects/uefi/sys/arm/allwinner/a10_gpio.c - copied unchanged from r246342, head/sys/arm/allwinner/a10_gpio.c projects/uefi/sys/boot/usb/ - copied from r246342, head/sys/boot/usb/ projects/uefi/tools/build/options/WITHOUT_CLANG_FULL - copied unchanged from r246342, head/tools/build/options/WITHOUT_CLANG_FULL projects/uefi/tools/build/options/WITHOUT_LIBCPLUSPLUS - copied unchanged from r246342, head/tools/build/options/WITHOUT_LIBCPLUSPLUS projects/uefi/tools/build/options/WITH_CLANG_FULL - copied unchanged from r246342, head/tools/build/options/WITH_CLANG_FULL projects/uefi/tools/build/options/WITH_GPL_DTC - copied unchanged from r246342, head/tools/build/options/WITH_GPL_DTC projects/uefi/usr.bin/bmake/Makefile.config - copied unchanged from r246342, head/usr.bin/bmake/Makefile.config Deleted: projects/uefi/contrib/bmake/Makefile.in projects/uefi/sys/dev/blackhole/ projects/uefi/sys/modules/blackhole/ Modified: projects/uefi/Makefile.inc1 projects/uefi/bin/sh/eval.c projects/uefi/bin/sh/expand.c projects/uefi/bin/sh/expand.h projects/uefi/bin/sh/jobs.c projects/uefi/bin/sh/miscbltin.c projects/uefi/bin/sh/mksyntax.c projects/uefi/bin/sh/nodetypes projects/uefi/bin/sh/redir.c projects/uefi/contrib/binutils/include/elf/common.h projects/uefi/contrib/bmake/ChangeLog projects/uefi/contrib/bmake/FILES projects/uefi/contrib/bmake/bmake.1 projects/uefi/contrib/bmake/bmake.cat1 projects/uefi/contrib/bmake/boot-strap projects/uefi/contrib/bmake/bsd.after-import.mk projects/uefi/contrib/bmake/compat.c projects/uefi/contrib/bmake/configure projects/uefi/contrib/bmake/configure.in projects/uefi/contrib/bmake/job.c projects/uefi/contrib/bmake/main.c projects/uefi/contrib/bmake/make-bootstrap.sh.in projects/uefi/contrib/bmake/make.1 projects/uefi/contrib/bmake/meta.c projects/uefi/contrib/bmake/realpath.c projects/uefi/contrib/bmake/unit-tests/Makefile.in projects/uefi/contrib/bmake/var.c projects/uefi/contrib/gcc/config/arm/freebsd.h projects/uefi/contrib/gcc/config/arm/unwind-arm.h projects/uefi/contrib/gdb/gdb/osabi.c projects/uefi/contrib/ipfilter/ipsend/44arp.c projects/uefi/contrib/libarchive/libarchive/archive_getdate.c projects/uefi/contrib/libarchive/libarchive/test/test_archive_getdate.c projects/uefi/contrib/libstdc++/libsupc++/unwind-cxx.h projects/uefi/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticFrontendKinds.td projects/uefi/contrib/llvm/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp projects/uefi/etc/rc.d/ip6addrctl projects/uefi/lib/Makefile projects/uefi/lib/clang/Makefile projects/uefi/lib/clang/clang.build.mk projects/uefi/lib/clang/libclanganalysis/Makefile projects/uefi/lib/clang/libclangarcmigrate/Makefile projects/uefi/lib/clang/libclangast/Makefile projects/uefi/lib/clang/libclangbasic/Makefile projects/uefi/lib/clang/libclangcodegen/Makefile projects/uefi/lib/clang/libclangdriver/Makefile projects/uefi/lib/clang/libclangedit/Makefile projects/uefi/lib/clang/libclangfrontend/Makefile projects/uefi/lib/clang/libclangfrontendtool/Makefile projects/uefi/lib/clang/libclanglex/Makefile projects/uefi/lib/clang/libclangparse/Makefile projects/uefi/lib/clang/libclangrewritecore/Makefile projects/uefi/lib/clang/libclangrewritefrontend/Makefile projects/uefi/lib/clang/libclangsema/Makefile projects/uefi/lib/clang/libclangserialization/Makefile projects/uefi/lib/clang/libclangstaticanalyzercheckers/Makefile projects/uefi/lib/clang/libclangstaticanalyzercore/Makefile projects/uefi/lib/clang/libclangstaticanalyzerfrontend/Makefile projects/uefi/lib/clang/libllvmarchive/Makefile projects/uefi/lib/clang/libllvmarmasmparser/Makefile projects/uefi/lib/clang/libllvmarmcodegen/Makefile projects/uefi/lib/clang/libllvmarmdesc/Makefile projects/uefi/lib/clang/libllvmarmdisassembler/Makefile projects/uefi/lib/clang/libllvmarminfo/Makefile projects/uefi/lib/clang/libllvmarminstprinter/Makefile projects/uefi/lib/clang/libllvmasmparser/Makefile projects/uefi/lib/clang/libllvmasmprinter/Makefile projects/uefi/lib/clang/libllvmbitreader/Makefile projects/uefi/lib/clang/libllvmbitwriter/Makefile projects/uefi/lib/clang/libllvmcodegen/Makefile projects/uefi/lib/clang/libllvmcore/Makefile projects/uefi/lib/clang/libllvmdebuginfo/Makefile projects/uefi/lib/clang/libllvmexecutionengine/Makefile projects/uefi/lib/clang/libllvminstcombine/Makefile projects/uefi/lib/clang/libllvminstrumentation/Makefile projects/uefi/lib/clang/libllvminterpreter/Makefile projects/uefi/lib/clang/libllvmjit/Makefile projects/uefi/lib/clang/libllvmlinker/Makefile projects/uefi/lib/clang/libllvmmcdisassembler/Makefile projects/uefi/lib/clang/libllvmmcparser/Makefile projects/uefi/lib/clang/libllvmmipsasmparser/Makefile projects/uefi/lib/clang/libllvmmipscodegen/Makefile projects/uefi/lib/clang/libllvmmipsdesc/Makefile projects/uefi/lib/clang/libllvmmipsdisassembler/Makefile projects/uefi/lib/clang/libllvmmipsinfo/Makefile projects/uefi/lib/clang/libllvmmipsinstprinter/Makefile projects/uefi/lib/clang/libllvmobject/Makefile projects/uefi/lib/clang/libllvmpowerpccodegen/Makefile projects/uefi/lib/clang/libllvmpowerpcdesc/Makefile projects/uefi/lib/clang/libllvmpowerpcinfo/Makefile projects/uefi/lib/clang/libllvmpowerpcinstprinter/Makefile projects/uefi/lib/clang/libllvmruntimedyld/Makefile projects/uefi/lib/clang/libllvmselectiondag/Makefile projects/uefi/lib/clang/libllvmtablegen/Makefile projects/uefi/lib/clang/libllvmtarget/Makefile projects/uefi/lib/clang/libllvmvectorize/Makefile projects/uefi/lib/clang/libllvmx86asmparser/Makefile projects/uefi/lib/clang/libllvmx86codegen/Makefile projects/uefi/lib/clang/libllvmx86desc/Makefile projects/uefi/lib/clang/libllvmx86info/Makefile projects/uefi/lib/clang/libllvmx86instprinter/Makefile projects/uefi/lib/clang/libllvmx86utils/Makefile projects/uefi/lib/libc/stdio/fmemopen.c projects/uefi/lib/libc/stdio/fopen.3 projects/uefi/lib/libcxxrt/Version.map projects/uefi/lib/libpmc/Makefile projects/uefi/lib/libpmc/libpmc.c projects/uefi/lib/libpmc/pmc.ivybridge.3 projects/uefi/lib/libpmc/pmc.sandybridge.3 projects/uefi/lib/libpmc/pmc.sandybridgexeon.3 projects/uefi/libexec/bootpd/rtmsg.c projects/uefi/libexec/tftpd/tftp-io.c projects/uefi/libexec/tftpd/tftp-options.c projects/uefi/libexec/tftpd/tftp-utils.h projects/uefi/libexec/tftpd/tftpd.c projects/uefi/release/Makefile projects/uefi/release/amd64/mkisoimages.sh projects/uefi/release/generate-release.sh projects/uefi/release/i386/mkisoimages.sh projects/uefi/release/ia64/mkisoimages.sh projects/uefi/release/pc98/mkisoimages.sh projects/uefi/release/powerpc/mkisoimages.sh projects/uefi/release/sparc64/mkisoimages.sh projects/uefi/sbin/devd/devd.cc projects/uefi/sbin/devd/devd.hh projects/uefi/sbin/recoverdisk/recoverdisk.c projects/uefi/sbin/route/route.c projects/uefi/share/man/man5/src.conf.5 projects/uefi/share/man/man7/release.7 projects/uefi/share/mk/bsd.own.mk projects/uefi/sys/amd64/amd64/mp_machdep.c projects/uefi/sys/amd64/conf/GENERIC projects/uefi/sys/amd64/include/intr_machdep.h projects/uefi/sys/amd64/vmm/io/ppt.c projects/uefi/sys/amd64/vmm/vmm.c projects/uefi/sys/arm/allwinner/files.a10 projects/uefi/sys/arm/arm/busdma_machdep.c projects/uefi/sys/arm/arm/vm_machdep.c projects/uefi/sys/arm/conf/BEAGLEBONE projects/uefi/sys/arm/conf/CUBIEBOARD projects/uefi/sys/arm/include/vmparam.h projects/uefi/sys/arm/ti/cpsw/if_cpsw.c projects/uefi/sys/arm/ti/cpsw/if_cpswreg.h projects/uefi/sys/arm/ti/cpsw/if_cpswvar.h projects/uefi/sys/boot/fdt/dts/cubieboard.dts projects/uefi/sys/boot/uboot/common/metadata.c projects/uefi/sys/cam/scsi/scsi_all.c projects/uefi/sys/cddl/compat/opensolaris/sys/kmem.h projects/uefi/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c projects/uefi/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c projects/uefi/sys/cddl/dev/dtrace/powerpc/dtrace_asm.S projects/uefi/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c projects/uefi/sys/conf/NOTES projects/uefi/sys/conf/newvers.sh projects/uefi/sys/conf/options projects/uefi/sys/dev/acpica/acpi.c projects/uefi/sys/dev/age/if_age.c projects/uefi/sys/dev/age/if_agevar.h projects/uefi/sys/dev/ata/ata-all.h projects/uefi/sys/dev/ata/ata-lowlevel.c projects/uefi/sys/dev/ath/if_ath_rx.c projects/uefi/sys/dev/hwpmc/hwpmc_core.c projects/uefi/sys/dev/hwpmc/hwpmc_intel.c projects/uefi/sys/dev/hwpmc/pmc_events.h projects/uefi/sys/dev/uart/uart_bus.h projects/uefi/sys/dev/uart/uart_bus_acpi.c projects/uefi/sys/dev/uart/uart_bus_isa.c projects/uefi/sys/dev/uart/uart_bus_pci.c projects/uefi/sys/dev/uart/uart_core.c projects/uefi/sys/dev/usb/net/if_smsc.c projects/uefi/sys/dev/usb/usb_freebsd.h projects/uefi/sys/dev/usb/usb_freebsd_loader.h projects/uefi/sys/dev/usb/usb_lookup.c projects/uefi/sys/dev/usb/usbdi.h projects/uefi/sys/fs/ext2fs/ext2_alloc.c projects/uefi/sys/fs/ext2fs/ext2_dir.h projects/uefi/sys/fs/ext2fs/ext2_inode.c projects/uefi/sys/fs/ext2fs/ext2_lookup.c projects/uefi/sys/fs/ext2fs/ext2_vfsops.c projects/uefi/sys/fs/ext2fs/ext2fs.h projects/uefi/sys/fs/ext2fs/fs.h projects/uefi/sys/fs/msdosfs/msdosfs_fat.c projects/uefi/sys/fs/msdosfs/msdosfs_vfsops.c projects/uefi/sys/fs/msdosfs/msdosfs_vnops.c projects/uefi/sys/fs/nfs/nfs_commonsubs.c projects/uefi/sys/i386/conf/GENERIC projects/uefi/sys/i386/i386/mp_machdep.c projects/uefi/sys/i386/include/intr_machdep.h projects/uefi/sys/i386/include/vmparam.h projects/uefi/sys/kern/init_main.c projects/uefi/sys/kern/kern_clocksource.c projects/uefi/sys/kern/kern_descrip.c projects/uefi/sys/kern/kern_ktr.c projects/uefi/sys/kern/kern_malloc.c projects/uefi/sys/kern/kern_mib.c projects/uefi/sys/kern/vfs_syscalls.c projects/uefi/sys/kern/vfs_vnops.c projects/uefi/sys/modules/Makefile projects/uefi/sys/modules/usb/Makefile projects/uefi/sys/modules/usb/smsc/Makefile projects/uefi/sys/modules/wlan/Makefile projects/uefi/sys/net/if_llatbl.c projects/uefi/sys/net/if_llatbl.h projects/uefi/sys/net80211/ieee80211_superg.c projects/uefi/sys/netgraph/ng_ether.c projects/uefi/sys/netinet/if_ether.h projects/uefi/sys/netinet/in.c projects/uefi/sys/netinet/libalias/libalias.3 projects/uefi/sys/netinet/tcp.h projects/uefi/sys/netinet/tcp_reass.c projects/uefi/sys/netinet/tcp_syncache.c projects/uefi/sys/netinet/udp.h projects/uefi/sys/pc98/conf/GENERIC projects/uefi/sys/sparc64/conf/GENERIC projects/uefi/sys/sys/pmc.h projects/uefi/sys/sys/socket.h projects/uefi/sys/sys/systm.h projects/uefi/sys/sys/un.h projects/uefi/sys/ufs/ffs/ffs_inode.c projects/uefi/sys/ufs/ufs/ufs_lookup.c projects/uefi/sys/vm/vm_kern.c projects/uefi/sys/x86/x86/intr_machdep.c projects/uefi/sys/x86/x86/local_apic.c projects/uefi/sys/x86/x86/tsc.c projects/uefi/tools/regression/lib/libc/stdio/test-fmemopen.c projects/uefi/usr.bin/bmake/Makefile projects/uefi/usr.bin/bmake/config.h projects/uefi/usr.bin/bmake/unit-tests/Makefile projects/uefi/usr.bin/clang/clang/Makefile projects/uefi/usr.bin/join/join.c projects/uefi/usr.bin/xinstall/xinstall.c projects/uefi/usr.sbin/arp/arp.8 projects/uefi/usr.sbin/arp/arp.c projects/uefi/usr.sbin/bhyve/pci_emul.c projects/uefi/usr.sbin/bhyve/pci_emul.h projects/uefi/usr.sbin/bhyve/pci_passthru.c projects/uefi/usr.sbin/bhyve/pci_virtio_block.c projects/uefi/usr.sbin/bhyve/pci_virtio_net.c projects/uefi/usr.sbin/crunch/crunchgen/crunchgen.c projects/uefi/usr.sbin/crunch/crunchide/exec_elf32.c projects/uefi/usr.sbin/crunch/examples/really-big.conf projects/uefi/usr.sbin/ndp/ndp.c projects/uefi/usr.sbin/pciconf/cap.c projects/uefi/usr.sbin/ppp/arp.c projects/uefi/usr.sbin/pw/pw_user.c projects/uefi/usr.sbin/rarpd/rarpd.c projects/uefi/usr.sbin/timed/timed/acksend.c projects/uefi/usr.sbin/timed/timed/byteorder.c projects/uefi/usr.sbin/timed/timed/candidate.c projects/uefi/usr.sbin/timed/timed/cksum.c projects/uefi/usr.sbin/timed/timed/correct.c projects/uefi/usr.sbin/timed/timed/master.c projects/uefi/usr.sbin/timed/timed/measure.c projects/uefi/usr.sbin/timed/timed/networkdelta.c projects/uefi/usr.sbin/timed/timed/readmsg.c projects/uefi/usr.sbin/timed/timed/slave.c projects/uefi/usr.sbin/timed/timed/timed.c projects/uefi/usr.sbin/timed/timedc/cmds.c projects/uefi/usr.sbin/timed/timedc/timedc.c Directory Properties: projects/uefi/ (props changed) projects/uefi/contrib/binutils/ (props changed) projects/uefi/contrib/bmake/ (props changed) projects/uefi/contrib/gcc/ (props changed) projects/uefi/contrib/gdb/ (props changed) projects/uefi/contrib/libarchive/ (props changed) projects/uefi/contrib/libarchive/libarchive/ (props changed) projects/uefi/contrib/libstdc++/ (props changed) projects/uefi/contrib/llvm/ (props changed) projects/uefi/contrib/llvm/tools/clang/ (props changed) projects/uefi/lib/libc/ (props changed) projects/uefi/sbin/ (props changed) projects/uefi/sys/ (props changed) projects/uefi/sys/amd64/vmm/ (props changed) projects/uefi/sys/boot/ (props changed) projects/uefi/sys/cddl/contrib/opensolaris/ (props changed) projects/uefi/sys/conf/ (props changed) projects/uefi/usr.sbin/bhyve/ (props changed) Modified: projects/uefi/Makefile.inc1 ============================================================================== --- projects/uefi/Makefile.inc1 Tue Feb 5 02:25:13 2013 (r246342) +++ projects/uefi/Makefile.inc1 Tue Feb 5 02:32:58 2013 (r246343) @@ -27,6 +27,8 @@ # TARGET="machine" to crossbuild world for a different machine type # TARGET_ARCH= may be required when a TARGET supports multiple endians # BUILDENV_SHELL= shell to launch for the buildenv target (def:/bin/sh) +# WORLD_FLAGS= additional flags to pass to make(1) during buildworld +# KERNEL_FLAGS= additional flags to pass to make(1) during buildkernel # # The intended user-driven targets are: @@ -245,7 +247,7 @@ BMAKEENV= INSTALL="sh ${.CURDIR}/tools/i MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" \ COMPILER_TYPE=${COMPILER_TYPE} BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \ - ${BMAKEENV} ${MAKE} -f Makefile.inc1 \ + ${BMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \ DESTDIR= \ BOOTSTRAPPING=${OSRELDATE} \ SSP_CFLAGS= \ @@ -255,7 +257,7 @@ BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \ # build-tools stage TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \ - ${BMAKEENV} ${MAKE} -f Makefile.inc1 \ + ${BMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \ TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ DESTDIR= \ BOOTSTRAPPING=${OSRELDATE} \ @@ -288,7 +290,7 @@ WMAKE_COMPILER_TYPE= gcc WMAKE_COMPILER_TYPE= clang .endif WMAKEENV+= COMPILER_TYPE=${WMAKE_COMPILER_TYPE} -WMAKE= ${WMAKEENV} ${MAKE} -f Makefile.inc1 DESTDIR=${WORLDTMP} +WMAKE= ${WMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 DESTDIR=${WORLDTMP} .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64" # 32 bit world @@ -378,7 +380,7 @@ IMAKE_MTREE= MTREE_CMD="nmtree ${MTREEFL # kernel stage KMAKEENV= ${WMAKEENV} -KMAKE= ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} +KMAKE= ${KMAKEENV} ${MAKE} ${KERNEL_FLAGS} KERNEL=${INSTKERNNAME} # # buildworld @@ -1731,7 +1733,8 @@ NOFUN=-DNO_FSCHG -DWITHOUT_HTML -DWITHOU XDDIR=${XDEV_ARCH}-freebsd XDTP=/usr/${XDDIR} -CDBENV=MAKEOBJDIRPREFIX=${MAKEOBJDIRPREFIX}/${XDDIR} +CDBENV=MAKEOBJDIRPREFIX=${MAKEOBJDIRPREFIX}/${XDDIR} \ + INSTALL="sh ${.CURDIR}/tools/install.sh" CDENV= ${CDBENV} \ _SHLIBDIRPREFIX=${XDTP} \ TOOLS_PREFIX=${XDTP} Modified: projects/uefi/bin/sh/eval.c ============================================================================== --- projects/uefi/bin/sh/eval.c Tue Feb 5 02:25:13 2013 (r246342) +++ projects/uefi/bin/sh/eval.c Tue Feb 5 02:32:58 2013 (r246343) @@ -92,6 +92,7 @@ static void evalfor(union node *, int); static union node *evalcase(union node *); static void evalsubshell(union node *, int); static void evalredir(union node *, int); +static void exphere(union node *, struct arglist *); static void expredir(union node *); static void evalpipe(union node *); static int is_valid_fast_cmdsubst(union node *n); @@ -488,6 +489,37 @@ evalredir(union node *n, int flags) } +static void +exphere(union node *redir, struct arglist *fn) +{ + struct jmploc jmploc; + struct jmploc *savehandler; + struct localvar *savelocalvars; + int need_longjmp = 0; + + redir->nhere.expdoc = nullstr; + savelocalvars = localvars; + localvars = NULL; + forcelocal++; + savehandler = handler; + if (setjmp(jmploc.loc)) + need_longjmp = exception != EXERROR && exception != EXEXEC; + else { + handler = &jmploc; + expandarg(redir->nhere.doc, fn, 0); + redir->nhere.expdoc = fn->list->text; + INTOFF; + } + handler = savehandler; + forcelocal--; + poplocalvars(); + localvars = savelocalvars; + if (need_longjmp) + longjmp(handler->loc, 1); + INTON; +} + + /* * Compute the names of the files in a redirection list. */ @@ -516,6 +548,9 @@ expredir(union node *n) fixredir(redir, fn.list->text, 1); } break; + case NXHERE: + exphere(redir, &fn); + break; } } } Modified: projects/uefi/bin/sh/expand.c ============================================================================== --- projects/uefi/bin/sh/expand.c Tue Feb 5 02:25:13 2013 (r246342) +++ projects/uefi/bin/sh/expand.c Tue Feb 5 02:32:58 2013 (r246343) @@ -127,19 +127,6 @@ collate_range_cmp(wchar_t c1, wchar_t c2 return (wcscoll(s1, s2)); } -/* - * Expand shell variables and backquotes inside a here document. - * union node *arg the document - * int fd; where to write the expanded version - */ - -void -expandhere(union node *arg, int fd) -{ - expandarg(arg, (struct arglist *)NULL, 0); - xwrite(fd, stackblock(), expdest - stackblock()); -} - static char * stputs_quotes(const char *data, const char *syntax, char *p) { Modified: projects/uefi/bin/sh/expand.h ============================================================================== --- projects/uefi/bin/sh/expand.h Tue Feb 5 02:25:13 2013 (r246342) +++ projects/uefi/bin/sh/expand.h Tue Feb 5 02:32:58 2013 (r246343) @@ -57,7 +57,6 @@ struct arglist { union node; -void expandhere(union node *, int); void expandarg(union node *, struct arglist *, int); void expari(int); void rmescapes(char *); Modified: projects/uefi/bin/sh/jobs.c ============================================================================== --- projects/uefi/bin/sh/jobs.c Tue Feb 5 02:25:13 2013 (r246342) +++ projects/uefi/bin/sh/jobs.c Tue Feb 5 02:32:58 2013 (r246343) @@ -1298,6 +1298,10 @@ until: cmdputs(n->narg.text); cmdputs("() ..."); break; + case NNOT: + cmdputs("! "); + cmdtxt(n->nnot.com); + break; case NCMD: for (np = n->ncmd.args ; np ; np = np->narg.next) { cmdtxt(np); Modified: projects/uefi/bin/sh/miscbltin.c ============================================================================== --- projects/uefi/bin/sh/miscbltin.c Tue Feb 5 02:25:13 2013 (r246342) +++ projects/uefi/bin/sh/miscbltin.c Tue Feb 5 02:32:58 2013 (r246343) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -60,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include "memalloc.h" #include "error.h" #include "mystring.h" +#include "syntax.h" #undef eflag @@ -307,7 +307,7 @@ umaskcmd(int argc __unused, char **argv out1fmt("%.4o\n", mask); } } else { - if (isdigit(*ap)) { + if (is_digit(*ap)) { mask = 0; do { if (*ap >= '8' || *ap < '0') Modified: projects/uefi/bin/sh/mksyntax.c ============================================================================== --- projects/uefi/bin/sh/mksyntax.c Tue Feb 5 02:25:13 2013 (r246342) +++ projects/uefi/bin/sh/mksyntax.c Tue Feb 5 02:32:58 2013 (r246343) @@ -165,7 +165,6 @@ main(int argc __unused, char **argv __un } fputs("#include \n", hfile); - fputs("#include \n", hfile); /* Generate the #define statements in the header file */ fputs("/* Syntax classes */\n", hfile); Modified: projects/uefi/bin/sh/nodetypes ============================================================================== --- projects/uefi/bin/sh/nodetypes Tue Feb 5 02:25:13 2013 (r246342) +++ projects/uefi/bin/sh/nodetypes Tue Feb 5 02:32:58 2013 (r246343) @@ -138,6 +138,7 @@ NXHERE nhere # fd<type == NHERE) { - len = strlen(redir->nhere.doc->narg.text); - if (len <= PIPESIZE) { - xwrite(pip[1], redir->nhere.doc->narg.text, len); - goto out; - } + + if (redir->type == NXHERE) + p = redir->nhere.expdoc; + else + p = redir->nhere.doc->narg.text; + len = strlen(p); + if (len <= PIPESIZE) { + xwrite(pip[1], p, len); + goto out; } + if (forkshell((struct job *)NULL, (union node *)NULL, FORK_NOJOB) == 0) { close(pip[0]); signal(SIGINT, SIG_IGN); @@ -270,10 +275,7 @@ openhere(union node *redir) signal(SIGHUP, SIG_IGN); signal(SIGTSTP, SIG_IGN); signal(SIGPIPE, SIG_DFL); - if (redir->type == NHERE) - xwrite(pip[1], redir->nhere.doc->narg.text, len); - else - expandhere(redir->nhere.doc, pip[1]); + xwrite(pip[1], p, len); _exit(0); } out: Modified: projects/uefi/contrib/binutils/include/elf/common.h ============================================================================== --- projects/uefi/contrib/binutils/include/elf/common.h Tue Feb 5 02:25:13 2013 (r246342) +++ projects/uefi/contrib/binutils/include/elf/common.h Tue Feb 5 02:32:58 2013 (r246343) @@ -435,6 +435,10 @@ #define NT_FREEBSD_ABI_TAG 1 +/* Values for FreeBSD .note.tag notes. Note name is "FreeBSD". */ + +#define NT_FREEBSD_TAG 2 + /* These three macros disassemble and assemble a symbol table st_info field, which contains the symbol binding and symbol type. The STB_ and STT_ defines identify the binding and type. */ Modified: projects/uefi/contrib/bmake/ChangeLog ============================================================================== --- projects/uefi/contrib/bmake/ChangeLog Tue Feb 5 02:25:13 2013 (r246342) +++ projects/uefi/contrib/bmake/ChangeLog Tue Feb 5 02:32:58 2013 (r246343) @@ -1,3 +1,35 @@ +2013-01-27 Simon J. Gerraty + + * Merge with NetBSD make, pick up + o make.1: more info on how shell commands are handled. + o job.c,main.c: detect write errors to job pipes. + +2013-01-25 Simon J. Gerraty + + * Makefile (MAKE_VERSION): 20130123 + Merge with NetBSD make, pick up + o meta.c: if script uses .OODATE and meta_oodate() decides + rebuild is needed, .OODATE will be empty - set it to .ALLSRC. + o var.c: in debug output indicate which variabale modifiers + apply to. + o remove Check_Cwd logic the makefiles have been fixed. + +2012-12-12 Simon J. Gerraty + + * makefile.in: add a simple makefile for folk who insist on + ./configure; make; make install + it just runs boot-strap + * include mk/* to accommodate the above + * boot-strap: re-work to accommodate the above + mksrc defaults to $Mydir/mk + allow op={configure,build,install,clean,all} + add options to facilitate install + * Makefile.config.in: just the bits set by configure + * Makefile: bump version to 20121212 + abandon Makefile.in (NetBSD Makefile) + leverage mk/* instead + * configure.in: ensure srcdir is absolute + 2012-11-11 Simon J. Gerraty * Makefile.in (MAKE_VERSION): 20121111 Modified: projects/uefi/contrib/bmake/FILES ============================================================================== --- projects/uefi/contrib/bmake/FILES Tue Feb 5 02:25:13 2013 (r246342) +++ projects/uefi/contrib/bmake/FILES Tue Feb 5 02:32:58 2013 (r246343) @@ -4,7 +4,9 @@ bmake.cat1 boot-strap bsd.after-import.mk os.sh -Makefile.in +makefile.in +Makefile +Makefile.config.in PSD.doc/Makefile PSD.doc/tutorial.ms README @@ -120,3 +122,63 @@ unit-tests/test.exp unit-tests/unexport unit-tests/unexport-env unit-tests/varcmd +mk/ChangeLog +mk/FILES +mk/README +mk/auto.obj.mk +mk/autoconf.mk +mk/autodep.mk +mk/auto.dep.mk +mk/dep.mk +mk/doc.mk +mk/dpadd.mk +mk/final.mk +mk/host-target.mk +mk/host.libnames.mk +mk/inc.mk +mk/init.mk +mk/install-mk +mk/java.mk +mk/lib.mk +mk/libnames.mk +mk/libs.mk +mk/links.mk +mk/man.mk +mk/mk-files.txt +mk/nls.mk +mk/obj.mk +mk/options.mk +mk/own.mk +mk/prlist.mk +mk/prog.mk +mk/progs.mk +mk/rst2htm.mk +mk/scripts.mk +mk/srctop.mk +mk/subdir.mk +mk/sys.mk +mk/sys.clean-env.mk +mk/sys.dependfile.mk +mk/sys/AIX.mk +mk/sys/Darwin.mk +mk/sys/Generic.mk +mk/sys/HP-UX.mk +mk/sys/IRIX.mk +mk/sys/Linux.mk +mk/sys/NetBSD.mk +mk/sys/OSF1.mk +mk/sys/OpenBSD.mk +mk/sys/SunOS.mk +mk/sys/UnixWare.mk +mk/target-flags.mk +mk/warnings.mk +mk/yacc.mk +mk/dirdeps.mk +mk/gendirdeps.mk +mk/install-new.mk +mk/meta2deps.py +mk/meta2deps.sh +mk/meta.sys.mk +mk/meta.autodep.mk +mk/meta.stage.mk +mk/meta.subdir.mk Copied: projects/uefi/contrib/bmake/Makefile (from r246342, head/contrib/bmake/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/uefi/contrib/bmake/Makefile Tue Feb 5 02:32:58 2013 (r246343, copy of r246342, head/contrib/bmake/Makefile) @@ -0,0 +1,221 @@ +# $Id: Makefile,v 1.5 2013/01/28 19:31:58 sjg Exp $ + +# Base version on src date +MAKE_VERSION= 20130123 + +PROG= bmake + +SRCS= \ + arch.c \ + buf.c \ + compat.c \ + cond.c \ + dir.c \ + for.c \ + hash.c \ + job.c \ + main.c \ + make.c \ + make_malloc.c \ + meta.c \ + parse.c \ + str.c \ + strlist.c \ + suff.c \ + targ.c \ + trace.c \ + util.c \ + var.c + +# from lst.lib/ +SRCS+= \ + lstAppend.c \ + lstAtEnd.c \ + lstAtFront.c \ + lstClose.c \ + lstConcat.c \ + lstDatum.c \ + lstDeQueue.c \ + lstDestroy.c \ + lstDupl.c \ + lstEnQueue.c \ + lstFind.c \ + lstFindFrom.c \ + lstFirst.c \ + lstForEach.c \ + lstForEachFrom.c \ + lstInit.c \ + lstInsert.c \ + lstIsAtEnd.c \ + lstIsEmpty.c \ + lstLast.c \ + lstMember.c \ + lstNext.c \ + lstOpen.c \ + lstPrev.c \ + lstRemove.c \ + lstReplace.c \ + lstSucc.c + +# this file gets generated by configure +.-include "Makefile.config" + +.if !empty(LIBOBJS) +SRCS+= ${LIBOBJS:T:.o=.c} +.endif + +# just in case +prefix?= /usr +srcdir?= ${.CURDIR} + +DEFAULT_SYS_PATH?= .../share/mk:${prefix}/share/mk + +CPPFLAGS+= -DUSE_META +CFLAGS+= ${CPPFLAGS} +CFLAGS+= -D_PATH_DEFSYSPATH=\"${DEFAULT_SYS_PATH}\" +CFLAGS+= -I. -I${srcdir} ${XDEFS} -DMAKE_NATIVE +CFLAGS+= ${COPTS.${.ALLSRC:M*.c:T:u}} +COPTS.main.c+= "-DMAKE_VERSION=\"${MAKE_VERSION}\"" + +# meta mode can be useful even without filemon +FILEMON_H ?= /usr/include/dev/filemon/filemon.h +.if exists(${FILEMON_H}) && ${FILEMON_H:T} == "filemon.h" +COPTS.meta.c += -DHAVE_FILEMON_H -I${FILEMON_H:H} +.endif + +.PATH: ${srcdir} +.PATH: ${srcdir}/lst.lib + +.if make(obj) || make(clean) +SUBDIR+= unit-tests +.endif + +# start-delete1 for bsd.after-import.mk +# we skip a lot of this when building as part of FreeBSD etc. + +# list of OS's which are derrived from BSD4.4 +BSD44_LIST= NetBSD FreeBSD OpenBSD DragonFly +# we are... +OS!= uname -s +# are we 4.4BSD ? +isBSD44:=${BSD44_LIST:M${OS}} + +.if ${isBSD44} == "" +MANTARGET= cat +INSTALL?=${srcdir}/install-sh +.if (${MACHINE} == "sun386") +# even I don't have one of these anymore :-) +CFLAGS+= -DPORTAR +.elif (${MACHINE} != "sunos") +SRCS+= sigcompat.c +CFLAGS+= -DSIGNAL_FLAGS=SA_RESTART +.endif +.else +MANTARGET?= man +.endif + +# turn this on by default - ignored if we are root +WITH_INSTALL_AS_USER= + +# supress with -DWITHOUT_* +OPTIONS_DEFAULT_YES+= \ + AUTOCONF_MK \ + INSTALL_MK \ + PROG_LINK + +OPTIONS_DEFAULT_NO+= \ + PROG_VERSION + +# process options now +.include + +.if ${MK_PROG_VERSION} == "yes" +PROG_NAME= ${PROG}-${MAKE_VERSION} +.if ${MK_PROG_LINK} == "yes" +SYMLINKS+= ${PROG}-${MAKE_VERSION} ${BINDIR}/${PROG} +.endif +.endif + +EXTRACT_MAN=no +# end-delete1 + +MAN= ${PROG}.1 +MAN1= ${MAN} + +.if (${PROG} != "make") +CLEANFILES+= my.history +.if make(${MAN}) || !exists(${srcdir}/${MAN}) +my.history: ${MAKEFILE} + @(echo ".Nm"; \ + echo "is derived from NetBSD"; \ + echo ".Xr make 1 ."; \ + echo "It uses autoconf to facilitate portability to other platforms."; \ + echo ".Pp") > $@ + +.NOPATH: ${MAN} +${MAN}: make.1 my.history + @echo making $@ + @sed -e 's/^.Nx/NetBSD/' -e '/^.Nm/s/make/${PROG}/' \ + -e '/^.Sh HISTORY/rmy.history' \ + -e '/^.Sh HISTORY/,$$s,^.Nm,make,' ${srcdir}/make.1 > $@ + +all beforeinstall: ${MAN} +_mfromdir=. +.endif +.endif + +MANTARGET?= cat +MANDEST?= ${MANDIR}/${MANTARGET}1 + +.if ${MANTARGET} == "cat" +_mfromdir=${srcdir} +.endif + +.include + +CPPFLAGS+= -DMAKE_NATIVE -DHAVE_CONFIG_H +COPTS.var.c += -Wno-cast-qual +COPTS.job.c += -Wno-format-nonliteral +COPTS.parse.c += -Wno-format-nonliteral +COPTS.var.c += -Wno-format-nonliteral + +# Force these +SHAREDIR= ${prefix}/share +BINDIR= ${prefix}/bin +MANDIR= ${SHAREDIR}/man + +.if !exists(.depend) +${OBJS}: config.h +.endif +.if ${MK_AUTOCONF_MK} == "yes" +.include +.endif + +# make sure that MAKE_VERSION gets updated. +main.o: ${SRCS} ${MAKEFILE} + +# start-delete2 for bsd.after-import.mk +SHARE_MK?=${SHAREDIR}/mk +MKSRC=${srcdir}/mk +INSTALL?=${srcdir}/install-sh + +.if ${MK_INSTALL_MK} == "yes" +install: install-mk +.endif + +beforeinstall: + test -d ${DESTDIR}${BINDIR} || ${INSTALL} -m 775 -d ${DESTDIR}${BINDIR} + test -d ${DESTDIR}${MANDEST} || ${INSTALL} -m 775 -d ${DESTDIR}${MANDEST} + +install-mk: +.if exists(${MKSRC}/install-mk) + test -d ${DESTDIR}${SHARE_MK} || ${INSTALL} -m 775 -d ${DESTDIR}${SHARE_MK} + sh ${MKSRC}/install-mk -v -m 644 ${DESTDIR}${SHARE_MK} +.else + @echo need to unpack mk.tar.gz under ${srcdir} or set MKSRC; false +.endif +# end-delete2 + +# A simple unit-test driver to help catch regressions +accept test: + cd ${.CURDIR}/unit-tests && MAKEFLAGS= ${.MAKE} -r -m / TEST_MAKE=${TEST_MAKE:U${.OBJDIR}/${PROG:T}} ${.TARGET} Copied: projects/uefi/contrib/bmake/Makefile.config.in (from r246342, head/contrib/bmake/Makefile.config.in) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/uefi/contrib/bmake/Makefile.config.in Tue Feb 5 02:32:58 2013 (r246343, copy of r246342, head/contrib/bmake/Makefile.config.in) @@ -0,0 +1,16 @@ +# things set by configure + +prefix= @prefix@ +srcdir= @srcdir@ +CC?= @CC@ +MACHINE= @machine@ +MACHINE_ARCH= @machine_arch@ +DEFAULT_SYS_PATH= @default_sys_path@ + +CPPFLAGS+= @CPPFLAGS@ +CFLAGS+= ${CPPFLAGS} @DEFS@ +LDFLAGS= @LDFLAGS@ +LIBOBJS= @LIBOBJS@ +LDADD= @LIBS@ +USE_META= @use_meta@ +FILEMON_H= @filemon_h@ Modified: projects/uefi/contrib/bmake/bmake.1 ============================================================================== --- projects/uefi/contrib/bmake/bmake.1 Tue Feb 5 02:25:13 2013 (r246342) +++ projects/uefi/contrib/bmake/bmake.1 Tue Feb 5 02:32:58 2013 (r246343) @@ -1,4 +1,4 @@ -.\" $NetBSD: make.1,v 1.209 2012/10/08 15:09:48 christos Exp $ +.\" $NetBSD: make.1,v 1.210 2013/01/27 18:52:01 sjg Exp $ .\" .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" from: @(#)make.1 8.4 (Berkeley) 3/19/94 .\" -.Dd October 8, 2012 +.Dd January 23, 2013 .Dt MAKE 1 .Os .Sh NAME @@ -468,6 +468,50 @@ except that the effect can be limited to A .Ql Ic \- causes any non-zero exit status of the command line to be ignored. +.Pp +When +.Nm +is run in jobs mode with +.Fl j Ar max_jobs , +the entire script for the target is fed to a +single instance of the shell. +.Pp +In compatibility (non-jobs) mode, each command is run in a separate process. +If the command contains any shell meta characters +.Pq Ql #=|^(){};&<>*?[]:$`\e\en +it will be passed to the shell, otherwise +.Nm +will attempt direct execution. +.Pp +Since +.Nm +will +.Xr chdir 2 +to +.Ql Va .OBJDIR +before executing any targets, each child process +starts with that as its current working directory. +.Pp +Makefiles should be written so that the mode of +.Nm +operation does not change their behavior. +For example, any command which needs to use +.Dq cd +or +.Dq chdir , +without side-effect should be put in parenthesis: +.Bd -literal -offset indent + +avoid-chdir-side-effects: + @echo Building $@ in `pwd` + @(cd ${.CURDIR} && ${.MAKE} $@) + @echo Back in `pwd` + +ensure-one-shell-regardless-of-mode: + @echo Building $@ in `pwd`; \\ + (cd ${.CURDIR} && ${.MAKE} $@); \\ + echo Back in `pwd` +.Ed .Sh VARIABLE ASSIGNMENTS Variables in make are much like variables in the shell, and, by tradition, consist of all upper-case letters. @@ -2027,28 +2071,6 @@ NetBSD 5.0 so that they still appear to be variable expansions. In particular this stops them being treated as syntax, and removes some obscure problems using them in .if statements. -.Pp -Unlike other -.Nm -programs, this implementation by default executes all commands for a given -target using a single shell invocation. -This is done for both efficiency and to simplify error handling in remote -command invocations. -Typically this is transparent to the user, unless the target commands change -the current working directory using -.Dq cd -or -.Dq chdir . -To be compatible with Makefiles that do this, one can use -.Fl B -to disable this behavior. -.Pp -In compatibility mode, each command is run in a separate process. -If the command contains any shell meta characters -.Pq Ql #=|^(){};&<>*?[]:$`\e\en -it will be passed to the shell, otherwise -.Nm -will attempt direct execution. .Sh SEE ALSO .Xr mkdep 1 .Sh HISTORY Modified: projects/uefi/contrib/bmake/bmake.cat1 ============================================================================== --- projects/uefi/contrib/bmake/bmake.cat1 Tue Feb 5 02:25:13 2013 (r246342) +++ projects/uefi/contrib/bmake/bmake.cat1 Tue Feb 5 02:32:58 2013 (r246343) @@ -284,6 +284,32 @@ SSHHEELLLL CCOOMMMMAANNDDSS line of a script. A `--' causes any non-zero exit status of the command line to be ignored. + When bbmmaakkee is run in jobs mode with --jj _m_a_x___j_o_b_s, the entire script for + the target is fed to a single instance of the shell. + + In compatibility (non-jobs) mode, each command is run in a separate + process. If the command contains any shell meta characters + (`#=|^(){};&<>*?[]:$`\\n') it will be passed to the shell, otherwise + bbmmaakkee will attempt direct execution. + + Since bbmmaakkee will chdir(2) to `_._O_B_J_D_I_R' before executing any targets, each + child process starts with that as its current working directory. + + Makefiles should be written so that the mode of bbmmaakkee operation does not + change their behavior. For example, any command which needs to use + ``cd'' or ``chdir'', without side-effect should be put in parenthesis: + + + avoid-chdir-side-effects: + @echo Building $@ in `pwd` + @(cd ${.CURDIR} && ${.MAKE} $@) + @echo Back in `pwd` + + ensure-one-shell-regardless-of-mode: + @echo Building $@ in `pwd`; \ + (cd ${.CURDIR} && ${.MAKE} $@); \ + echo Back in `pwd` + VVAARRIIAABBLLEE AASSSSIIGGNNMMEENNTTSS Variables in make are much like variables in the shell, and, by tradi- tion, consist of all upper-case letters. @@ -1293,19 +1319,6 @@ CCOOMMPPAATTIIBBIILLIITTYY stops them being treated as syntax, and removes some obscure problems using them in .if statements. - Unlike other bbmmaakkee programs, this implementation by default executes all - commands for a given target using a single shell invocation. This is - done for both efficiency and to simplify error handling in remote command - invocations. Typically this is transparent to the user, unless the tar- - get commands change the current working directory using ``cd'' or - ``chdir''. To be compatible with Makefiles that do this, one can use --BB - to disable this behavior. - - In compatibility mode, each command is run in a separate process. If the - command contains any shell meta characters (`#=|^(){};&<>*?[]:$`\\n') it - will be passed to the shell, otherwise bbmmaakkee will attempt direct execu- - tion. - SSEEEE AALLSSOO mkdep(1) @@ -1327,4 +1340,4 @@ BBUUGGSS There is no way of escaping a space character in a filename. -NetBSD 5.1 October 8, 2012 NetBSD 5.1 +NetBSD 5.1 January 23, 2013 NetBSD 5.1 Modified: projects/uefi/contrib/bmake/boot-strap ============================================================================== --- projects/uefi/contrib/bmake/boot-strap Tue Feb 5 02:25:13 2013 (r246342) +++ projects/uefi/contrib/bmake/boot-strap Tue Feb 5 02:32:58 2013 (r246343) @@ -3,23 +3,52 @@ # boot-strap # # SYNOPSIS: -# boot-strap [--"configure_arg" ... ][-s "srcdir"][-m "mksrc"]\\ -# ["prefix" ["bmakesrc" ["mksrc"]]] +# boot-strap ["options"] +# boot-strap --prefix=/opt --install +# boot-strap --prefix=$HOME --install-host-target -DWITH_PROG_VERSION +# boot-strap ["options"] op=build +# boot-strap ["options"] op=install # # DESCRIPTION: # This script is used to configure/build bmake it builds for -# each OS in a subdir to keep the src clean. -# On successful completion it echos commands to put the new -# bmake binary into the /configs tree (if it exists) -# (http://www.crufty.net/FreeWare/configs.html), $prefix/bin -# and a suitable ~/*bin directory. +# each host-target in a different subdir to keep the src clean. +# There is no requirement for an existing make(1). # +# On successful completion if no '--install' flag is given, +# it echos a command to do installation. +# +# The variable "op" defaults to 'all', and is affected by +# '--install' flag as above. +# Other values include: +# +# configure +# Just run 'configure' +# +# build +# If 'configure' has not been done, do it, then +# run the build script, and finally 'test'. +# +# install +# If 'build' has not been done, do it, 'test' then +# install. +# +# clean +# attempt to clean up +# +# test +# run the unit-tests. Done automatically after 'build' +# and before 'install'. +# +# The above are leveraged by a trivial makefile for the benefit +# of those that have './configure; make; make install' baked +# into them. +# # Options: # # -c "rc" # Pick up settings from "rc". # We look for '.bmake-boot-strap.rc' before processing -# options. +# options (unless SKIP_RC is set in environment). # # --share "share_dir" # Where to put man pages and mk files. @@ -28,9 +57,28 @@ # # --mksrc "mksrc" # Indicate where the mk files can be found. -# Default is ./mk or ../mk, set to 'none' to force -# building without "mksrc" but in that case a sys.mk -# needs to exist in the default syspath ($share_dir/mk) +# Default is $Mydir/mk +# +# --install +# If build and test work, run bmake install. +# BINDIR=$prefix/bin +# SHAREDIR=$prefix/share +# +# --install-host-target +# As for '--install' but BINDIR=$prefix/$HOST_TARGET/bin +# This is useful when $prefix/ is shared by multiple +# machines. +# +# Flags relevant when installing: +# +# -DWITHOUT_INSTALL_MK +# Skip installing mk files. +# By default they will be installed to $prefix/share/mk +# +# -DWITH_PROG_VERSION +# Install 'bmake' as 'bmake-$MAKE_VERSION' +# A symlink will be made as 'bmake' unless +# -DWITHOUT_PROG_LINK is set. # # Possibly useful configure_args: # @@ -63,7 +111,7 @@ # Simon J. Gerraty # RCSid: -# $Id: boot-strap,v 1.39 2012/03/26 17:08:22 sjg Exp $ +# $Id: boot-strap,v 1.42 2013/01/25 20:20:33 sjg Exp $ # # @(#) Copyright (c) 2001 Simon J. Gerraty # @@ -85,11 +133,10 @@ case "$Mydir" in *) Mydir=`cd "$Mydir" && 'pwd'`;; esac - Usage() { [ "$1" ] && echo "ERROR: $@" >&2 echo "Usage:" >&2 - echo "$0 [-- ...][-s ][-m ][ [[] []]]" >&2 + echo "$0 [-- ...][][--install]" >&2 exit 1 } @@ -110,28 +157,55 @@ source_rc() { done } +cmd_args="$@" + +# --install[-host-target] will set this +INSTALL_PREFIX= +# other things we pass to install step +INSTALL_ARGS= CONFIGURE_ARGS= MAKESYSPATH= # pick a useful default prefix (for me at least ;-) for prefix in /opt/$HOST_TARGET "$HOME/$HOST_TARGET" /usr/pkg /usr/local "" do - [ -d "${prefix:-.}" ] && break + [ -d "${prefix:-.}" ] || continue + case "$prefix" in + */$HOST_TARGET) + p=`dirname $prefix` + if [ -d $p/share ]; then + INSTALL_BIN=$HOST_TARGET/bin + prefix=$p + fi + ;; + esac + echo "NOTE: default prefix=$prefix ${INSTALL_BIN:+INSTALL_BIN=$INSTALL_BIN}" + break done -srcdir= -mksrc= +srcdir=$Mydir +mksrc=$Mydir/mk objdir= quiet=: -source_rc .bmake-boot-strap.rc . "$Mydir/.." "$HOME" +${SKIP_RC:+:} source_rc .bmake-boot-strap.rc . "$Mydir/.." "$HOME" get_optarg() { expr "x$1" : "x[^=]*=\\(.*\\)" } +here=`'pwd'` +if [ $here = $Mydir ]; then + # avoid polution + OBJROOT=../ +fi + +op=all +BMAKE= + while : do case "$1" in --) shift; break;; + --help) sed -n -e "1d;/RCSid/,\$d" -e '/^#\.[a-z]/d' -e '/^#/s,^# *,,p' $0; exit 0;; --prefix) prefix="$2"; shift;; --prefix=*) prefix=`get_optarg "$1"`;; --src=*) srcdir=`get_optarg "$1"`;; @@ -144,6 +218,13 @@ do --with-default-sys-path) CONFIGURE_ARGS="$1 $2" MAKESYSPATH="$2"; shift;; + --install) INSTALL_PREFIX=${INSTALL_PREFIX:-$prefix};; + --install-host-target) + INSTALL_PREFIX=${INSTALL_PREFIX:-$prefix} + INSTALL_BIN=$HOST_TARGET/bin;; + --install-destdir=*) INSTALL_DESTDIR=`get_optarg "$1"`;; + --install-prefix=*) INSTALL_PREFIX=`get_optarg "$1"`;; + -DWITH*) INSTALL_ARGS="$INSTALL_ARGS $1";; -s|--src) srcdir="$2"; shift;; -m|--mksrc) mksrc="$2"; shift;; -o|--objdir) objdir="$2"; shift;; @@ -261,7 +342,7 @@ none|-) # we don't want it esac # Ok, get to work... -objdir="${objdir:-$OS}" +objdir="${objdir:-$OBJROOT$HOST_TARGET}" [ -d "$objdir" ] || mkdir -p "$objdir" [ -d "$objdir" ] || mkdir "$objdir" cd "$objdir" || exit 1 @@ -301,88 +382,80 @@ if [ "$mksrc" ]; then export CFLAGS_MF CFLAGS_MD fi -$srcdir/configure $CONFIGURE_ARGS || exit 1 -chmod 755 make-bootstrap.sh || exit 1 -./make-bootstrap.sh || exit 1 -if [ -z "$MAKESYSPATH" ]; then - add_path "${share_dir:-...}/mk" MAKESYSPATH - case "$HOST_TARGET" in - netbsd*) add_path /usr/share/mk MAKESYSPATH;; - esac -fi -if [ -s "${mksrc:-/dev/null}/install-mk" ]; then - sh "${mksrc}/install-mk" "$objdir/mk" - case "$MAKESYSPATH" in - .../mk*) ;; - *) MAKESYSPATH=".../mk:${MAKESYSPATH}";; - esac -fi *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***