Author: luigi
Date: Wed Nov 23 12:05:39 2011
New Revision: 227878
URL: http://svn.freebsd.org/changeset/base/227878

Log:
  some tweaks to build picobsd for different architectures.

Modified:
  head/release/picobsd/build/Makefile.conf
  head/release/picobsd/build/picobsd

Modified: head/release/picobsd/build/Makefile.conf
==============================================================================
--- head/release/picobsd/build/Makefile.conf    Wed Nov 23 11:59:01 2011        
(r227877)
+++ head/release/picobsd/build/Makefile.conf    Wed Nov 23 12:05:39 2011        
(r227878)
@@ -19,9 +19,9 @@ MODULES?=-DNO_MODULES # do not build the
 
 # These 3 variables determine where the kernel is built.
 # If config were smart enough, we could place the config
-# file in some other place than ${SRC}/sys/i386/conf, but
+# file in some other place than ${SRC}/sys/${TARGET_ARCH}/conf, but
 # at the moment (Oct.2001) this is not possible yet.
-CONF=${SRC}/sys/i386/conf
+CONF=${SRC}/sys/${TARGET_ARCH}/conf
 #CONF=${BUILDDIR}/conf         # XXX does not work yet
 CONFFILE=PICOBSD-${name}
 

Modified: head/release/picobsd/build/picobsd
==============================================================================
--- head/release/picobsd/build/picobsd  Wed Nov 23 11:59:01 2011        
(r227877)
+++ head/release/picobsd/build/picobsd  Wed Nov 23 12:05:39 2011        
(r227878)
@@ -67,7 +67,7 @@
 # SRC points to your FreeBSD source tree.
 # l_usrtree points to the /usr subdir for the source tree.
 #     Normally /usr or ${SRC}/../usr
-# l_objtree points to the obj tree. Normally ${l_usrtree}/obj-pico
+# l_objtree points to the obj tree. Normally ${l_usrtree}/obj-pico-${o_arch}
 # c_label is either bsdlabel or disklabel
 # PICO_TREE is where standard picobsd stuff resides.
 #     Normally ${SRC}/release/picobsd
@@ -121,6 +121,7 @@ set_defaults() {    # no arguments
     o_no_devfs=                        # default is use devfs.
        # You should only set it when building 4.x images
     o_do_modules=""            # do not build modules
+    o_arch=`uname -m`          # default to amd64 or i386 ...
 
     SRC="/usr/src"             # default location for sources
     c_startdir=`pwd`           # directory where we start
@@ -451,6 +452,7 @@ do_kernel() {               # OK
     log "do_kernel() Preparing kernel \"$name\" in $MY_TREE"
     (cd $MY_TREE; export name SRC BUILDDIR # used in this makefile ;
        # export CONFIG
+       export WARNS CWARNFLAGS
        [ "${o_do_modules}" = "yes" ] && export MODULES=""
        ${BINMAKE} ${o_par} -v -f ${PICO_TREE}/build/Makefile.conf ) || \
        fail $? missing_kernel
@@ -973,7 +975,7 @@ set_build_parameters() {
     else
        l_usrtree=${USR:-${SRC}/../usr}
     fi
-    l_objtree=${l_usrtree}/obj-pico
+    l_objtree=${l_usrtree}/obj-pico-${o_arch}
 
     PICO_TREE=${PICO_TREE:-${SRC}/release/picobsd}
     set `grep "#define[\t ]__FreeBSD_version" ${SRC}/sys/sys/param.h`
@@ -981,7 +983,8 @@ set_build_parameters() {
     log "OSVERSION is ${OSVERSION}"
     if [ ${OSVERSION} -ge 500035 ] ; then
        export MAKEOBJDIRPREFIX=${l_objtree}
-       export TARGET_ARCH=i386 TARGET=i386
+       export TARGET_ARCH=${o_arch} TARGET=${o_arch}
+       # export CWARNFLAGS="-Wextra -Wno-sign-compare 
-Wno-missing-field-initializers"
        eval "export BINMAKE=\"`cd ${SRC}; make -f Makefile -V BINMAKE`\""
        eval export `cd ${SRC}; ${BINMAKE} -f Makefile.inc1 -V WMAKEENV`
     fi
@@ -1035,6 +1038,11 @@ while [ true ]; do
        o_init_src="YES"
        ;;
 
+    --arch)
+       o_arch=$2
+       shift
+       ;;
+
     --floppy_size)
        fd_size=$2
        shift
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to