Honor KERNSRCDIR for 'make universe'

2011-02-15 Thread John Baldwin
This is useful when you want to run make universe against a custom kernel 
tree.  Specifically, if you keep a cross-compiled set of toolchains lying 
around in a stock HEAD checkout built using 'make toolchains' or 'make 
universe', then with this patch you can do:

make MAKE_JUST_KERNELS universe KERNSRCDIR=/path/to/test/kernel/sources

This sort of worked before because KERNSRCDIR was passed to 'make buildkernel' 
via MAKEOPTIONS.  What didn't work was generating LINT files or if you had 
kernel config files in your new tree that aren't in the stock tree, etc.

Index: Makefile
===
--- Makefile(revision 218554)
+++ Makefile(working copy)
@@ -336,6 +336,7 @@ MAKE_JUST_WORLDS=   YES
 .else
 UNIVERSE_TARGET?=  buildworld
 .endif
+KERNSRCDIR?=   ${.CURDIR}/sys
 
 targets:
@echo Supported TARGET/TARGET_ARCH pairs for world and kernel targets
@@ -383,8 +384,8 @@ universe_${target}_${target_arch}: universe_${targ
 .endfor
 .endif
 .if !defined(MAKE_JUST_WORLDS)
-.if exists(${.CURDIR}/sys/${target}/conf/NOTES)
-   @(cd ${.CURDIR}/sys/${target}/conf  env __MAKE_CONF=/dev/null \
+.if exists(${KERNSRCDIR}/${target}/conf/NOTES)
+   @(cd ${KERNSRCDIR}/${target}/conf  env __MAKE_CONF=/dev/null \
${MAKE} LINT  ${.CURDIR}/_.${target}.makeLINT 21 || \
(echo ${target} 'make LINT' failed, \
check _.${target}.makeLINT for details| ${MAKEFAIL}))
@@ -398,13 +399,13 @@ universe_kernels: universe_kernconfs
 .if !defined(TARGET)
 TARGET!=   uname -m
 .endif
-KERNCONFS!=cd ${.CURDIR}/sys/${TARGET}/conf  \
+KERNCONFS!=cd ${KERNSRCDIR}/${TARGET}/conf  \
find [A-Z0-9]*[A-Z0-9] -type f -maxdepth 0 \
! -name DEFAULTS ! -name NOTES
 universe_kernconfs:
 .for kernel in ${KERNCONFS}
-TARGET_ARCH_${kernel}!=cd ${.CURDIR}/sys/${TARGET}/conf  \
-   config -m ${.CURDIR}/sys/${TARGET}/conf/${kernel} 2 /dev/null | \
+TARGET_ARCH_${kernel}!=cd ${KERNSRCDIR}/${TARGET}/conf  \
+   config -m ${KERNSRCDIR}/${TARGET}/conf/${kernel} 2 /dev/null | \
grep -v WARNING: | cut -f 2
 .if empty(TARGET_ARCH_${kernel})
 .error Target architecture for ${TARGET}/conf/${kernel} unknown.  config(8) 
likely too old.

-- 
John Baldwin
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: cpufreq not working as module on i386/amd64

2011-02-15 Thread Andriy Gapon
on 29/01/2011 10:41 Alexander Best said the following:
 that's rather odd. for me neither the module nor the kernel code works, since
 my cpu isn't supported by sys/x86/cpufreq/est.c. actually only pentium mobile
 cpus seem to be supported.

That's a little bit of misinformation.
Primarily est uses ACPI interface to do its work.  Hardcoded MSR tables are only
the last resort mechanism, and indeed those support only a handful of models.

-- 
Andriy Gapon
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


$PATH and buildworld not getting along

2011-02-15 Thread Alexander Best
hi there,

i've run into an issue where $PATH doesn't get discarded during buildworld. is
this behavior to be expected? to reproduce do:

1) be sure /usr/local/bin comes *before* /usr/bin in your $PATH
2) ln -s /bin/cat /usr/local/bin/cc (some sh script would be better)
3) cd /usr/src ; make SRCCONF=/dev/null __MAKE_CONF=/dev/null buildworld
4) see how buildworld fails, because cat(1) gets invoked instead of cc(1).

... buildkernel on the other hand seems to be immune to such an issue.

cheers.
alex

-- 
a13x
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Use meaningful directory prefixes in lib32 build

2011-02-15 Thread John Baldwin
This patch adjusts the various lib32 targets to use a suitable DIRPRFX so that 
when lib32 builds certain areas of the tree the full path to those areas shows 
up in the make output:

Index: Makefile.inc1
===
--- Makefile.inc1   (revision 218554)
+++ Makefile.inc1   (working copy)
@@ -457,36 +457,38 @@ build32:
 .for _t in obj depend all
cd ${.CURDIR}/kerberos5/tools; \
MAKEOBJDIRPREFIX=${OBJTREE}/lib32 ${MAKE} SSP_CFLAGS= DESTDIR= \
-   ${_t}
+   DIRPRFX=kerberos5/tools/ ${_t}
 .endfor
 .endif
 .for _t in obj includes
-   cd ${.CURDIR}/include; ${LIB32WMAKE} ${_t}
-   cd ${.CURDIR}/lib; ${LIB32WMAKE} ${_t}
+   cd ${.CURDIR}/include; ${LIB32WMAKE} DIRPRFX=include/ ${_t}
+   cd ${.CURDIR}/lib; ${LIB32WMAKE} DIRPRFX=lib/ ${_t}
 .if ${MK_CDDL} != no
-   cd ${.CURDIR}/cddl/lib; ${LIB32WMAKE} ${_t}
+   cd ${.CURDIR}/cddl/lib; ${LIB32WMAKE} DIRPRFX=cddl/lib/ ${_t}
 .endif
-   cd ${.CURDIR}/gnu/lib; ${LIB32WMAKE} ${_t}
+   cd ${.CURDIR}/gnu/lib; ${LIB32WMAKE} DIRPRFX=gnu/lib/ ${_t}
 .if ${MK_CRYPT} != no
-   cd ${.CURDIR}/secure/lib; ${LIB32WMAKE} ${_t}
+   cd ${.CURDIR}/secure/lib; ${LIB32WMAKE} DIRPRFX=secure/lib/ ${_t}
 .endif
 .if ${MK_KERBEROS} != no
-   cd ${.CURDIR}/kerberos5/lib; ${LIB32WMAKE} ${_t}
+   cd ${.CURDIR}/kerberos5/lib; ${LIB32WMAKE} DIRPRFX=kerberos5/lib ${_t}
 .endif
 .endfor
 .for _dir in usr.bin/lex/lib
-   cd ${.CURDIR}/${_dir}; ${LIB32WMAKE} obj
+   cd ${.CURDIR}/${_dir}; ${LIB32WMAKE} DIRPRFX=${_dir}/ obj
 .endfor
 .for _dir in lib/ncurses/ncurses lib/ncurses/ncursesw lib/libmagic
cd ${.CURDIR}/${_dir}; \
MAKEOBJDIRPREFIX=${OBJTREE}/lib32 ${MAKE} SSP_CFLAGS= DESTDIR= \
-   build-tools
+   DIRPRFX=${_dir}/ build-tools
 .endfor
cd ${.CURDIR}; \
${LIB32WMAKE} -f Makefile.inc1 libraries
 .for _t in obj depend all
-   cd ${.CURDIR}/libexec/rtld-elf; PROG=ld-elf32.so.1 ${LIB32WMAKE} ${_t}
-   cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIB32WMAKE} ${_t}
+   cd ${.CURDIR}/libexec/rtld-elf; PROG=ld-elf32.so.1 ${LIB32WMAKE} \
+   DIRPRFX=libexec/rtld-elf/ ${_t}
+   cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIB32WMAKE} \
+   DIRPRFX=usr.bin/ldd ${_t}
 .endfor
 
 distribute32 install32:

-- 
John Baldwin
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org