Buildroot on MacOSX

From GumstixDocsWiki

Jump to: navigation, search

Contents

Info captured from list discussions

Overview

This how to is not meant to be a stand alone how to for MacOSX as the other build root pages are very helpful. This page just points out where the MacOSX build root building procedure "differs" from the main buildroot.

Trunk to use

svn co http://svn.gumstix.com/gumstix-buildroot/branches/users/osx/trunk/ osx

(username root password root)

Building

Build using the normal method of:

  make defconfig
  make

When using this trunk several fixes are required during the build to make it complete sucessfully. It is important to run make only at the top level of the buildroot, otherwise anomalous behaviour may result and it maynot build correctly. The changes are as follows:

If the error libc.so.0 can't be touched appears then do the following

  cd osx/build_arm_nofpu/root/lib
  mv lib/* . <this just moves all of the symblinks up one dir. This might be a problem in the make file or install script>
  cd osx
  make

If the S30bluetooth touch fails do the following

  cd osx/build_arm_nofpu/root/etc
  mkdir init.d
  cd osx
  make

If while installing zlib, "cp: Warning: the meaning of `-P' will change in the future to conform to POSIX." do the following

  cd osx/package/zlib
  change at least line 50 to the following: "cp -Rpf --no-dereference $(STAGING_DIR)/lib/libz.so* $(TARGET_DIR)/lib;"
  cd to osx
  make

If zlib.h can't be found by in any .c files do this (my example is for dropbear)

  cd osx/build_arm_nofpu/dropbear-0.47/
  change the zlib.h include in file includes.h from #include <zlib.h> to be #include "../zlib-1.2.3/zlib.h"
  cd to osx
  make 

If configure: error: C++ preprocessor "/lib/cpp" fails sanity check

  sudo mkdir /lib
  sudo ln -s /usr/bin/cpp /lib/cpp

Comments

This build process worked great for me on 11.27.06 on an MBP running 10.4.8. I only had to the last adjustment - the first three didn't happen to me. I also had to install wget (which Apple has stopped providing when new installs of the OS), which I built pretty easily from source available here: http://ftp.gnu.org/pub/gnu/wget/ . I sort of followed the instructions here (http://www.lifeofexile.com/wget_curl/how-to-install-curl-and-wget-on-mac-os-x/), but they're not great. Haven't actually used it yet (my gumstix are in the mail) but it looks okay. --Drew

I added a few things to buildroot (using menuconfig) on 19 January 2007, MBP running 10.4.8. Everything went OK until it was running "make" on the nano (text editor) directory. The current makefile tries to execute "install -D" (followed by a bunch of stuff). Unfortuantely Mac OSX doesn't support the -D option... I'm not a makefile guru, but the workaround that I did was to edit "nano.mk" in the package/nano directory. Just delete the "-D" option after the install command. All this line is doing is copying one file (the nano binary), so there is no need for the -D option, which (if I understand correctly) is only needed if the target directory tree is to be created. Presumably, the makefile has already created /root/bin, so it will be OK.

Later in the process, it bombed out trying to make openssl. I didn't have enough gumption to track it down; it is a bunch of errors about libcrypto.a being empty or something... i just disabled openssh (and openssl) in the menuconfig.

Patch to ntp is broken. I'm giving up and switching over to a Linux box...


I use Parallels to get Linux running on OSX, far easier than all this fiddling.

[18/3/2007] GJ running this for the first time (gumstix in the post) on 10.4.9: it seems the directory structure is wrong. The make crashes out in

make -j3  -C /Users/gjohnson/code/gumstix/osx/build_arm_nofpu/linux-2.6.15gum  
    CROSS_COMPILE=/Users/gjohnson/code/gumstix/osx/build_arm_nofpu/staging_dir/bin/arm-linux-uclibc- ARCH=arm 
    silentoldconfig

because there is no bin directory under staging_dir - just arm-linux-uclibc directly. Hmm..

3-19-07 Dgdimick - It works today, I did have to do "/lib/cpp" fails sanity check", other then that it worked, even ntp. Whoever fixed it, thanks!

[2007-06-03] I pulled fresh from the SVN today and did a defconfig. I had to make the lib.so.0, S50bluetooth, zlib, and dropbear/zlib fixes. In addition, I had to make a some similar zlib fixes in mtd_snapshot/util/. -Drew

 cd osx/build_arm_nofpu/mtd_snapshot/util/
 change four instances of #include <zlib.h> to #include "../../zlib-1.2.3/zlib.h"
 cd to osx
 make
Personal tools