pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bootstrapping pkgsrc on os/x



I use a small script to bootstrap pkgsrc on Mac OS X:


#!/bin/csh
cd your_path_to/pkgsrc/bootstrap
sudo env MANZ=yes \
MAKE_JOBS=`sysctl -n hw.ncpu` \
STRIPFLAG=-s \
CC=/Developer/usr/bin/clang \
CFLAGS="-O2 -pipe -march=core2 -fomit-frame-pointer -fno-stack-protector 
-fstrict-aliasing" \
CPPFLAGS="-isysroot /Developer/SDKs/MacOSX10.6.sdk" \
LDFLAGS="-Wl,-syslibroot,/Developer/SDKs/MacOSX10.6.sdk" \
./bootstrap --prefix=/usr/pkg --pkgdbdir=/usr/pkg/db --abi=64 --compiler=clang
sudo rm -rf work


As you can see, this one favours 'clang' as the compiler, but you can easily 
replace 'clang' with 'gcc'.


After bootstrapping, you'll need a proper mk.conf. Here's an excerpt from mine:


.ifdef BSD_PKG_MK
PKGSRC_COMPILER=clang
ABI=            64
XCODE_DIR=      /Developer
#CLANGBASE=     ${XCODE_DIR}/usr
CLANGBASE=      ${LOCALBASE}
F2C_F77_CPP=    ${XCODE_DIR}/usr/bin/cpp

CFLAGS+=        -march=core2
MACOSX_VER=     10.6
MACOSX_SDK=     ${XCODE_DIR}/SDKs/MacOSX${MACOSX_VER}.sdk
CFLAGS+=        -isysroot ${MACOSX_SDK}
CPPFLAGS+=      -isysroot ${MACOSX_SDK}
LDFLAGS+=       -Wl,-syslibroot,${MACOSX_SDK}

TOOLS_PLATFORM.byacc=   ${XCODE_DIR}/usr/bin/yacc
TOOLS_PLATFORM.flex=    ${XCODE_DIR}/usr/bin/flex
TOOLS_PLATFORM.gm4=     ${XCODE_DIR}/usr/bin/gm4
TOOLS_PLATFORM.gmake=   ${XCODE_DIR}/usr/bin/gnumake
TOOLS_PLATFORM.ident=   ${XCODE_DIR}/usr/bin/ident
TOOLS_PLATFORM.lex=     ${XCODE_DIR}/usr/bin/flex
TOOLS_PLATFORM.m4=      ${XCODE_DIR}/usr/bin/m4
TOOLS_PLATFORM.strip=   ${XCODE_DIR}/usr/bin/strip
TOOLS_PLATFORM.yacc=    ${XCODE_DIR}/usr/bin/yacc
.endif


Hoping that helps. 8-)

Kind regards,
Adam



Wiadomość napisana przez Todd Kover w dniu 14 wrz 2011, o godz. 21:52:

> 
> This is probably going to be a question with an obvious answer but I've
> wasted enough time on it and am hoping someone can point me in the right
> direction.
> 
> I'm trying to bootstrap pkgsrc on a Snow Leopard (10.6.8) OS/X mac with
> case sensitive filesystem.
> 
> Using the X/Code gcc:
> [transient:135 ~] gcc -v
> Using built-in specs.
> Target: i686-apple-darwin10
> Configured with: /var/tmp/gcc/gcc-5666.3~6/src/configure --disable-checking 
> --enable-werror --prefix=/usr --mandir=/share/man 
> --enable-languages=c,objc,c++,obj-c++ 
> --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib 
> --build=i686-apple-darwin10 --program-prefix=i686-apple-darwin10- 
> --host=x86_64-apple-darwin10 --target=i686-apple-darwin10 
> --with-gxx-include-dir=/include/c++/4.2.1
> Thread model: posix
> gcc version 4.2.1 (Apple Inc. build 5666) (dot 3)
> 
> 
> I'm running:
> 
> ./bootstrap --varbase=/private/pkg/var --pkgdbdir=/private/pkg/var/db
> 
> as root and its getting to the point of properly building bmake and
> failling with:
> 
> [ ... ]
> ===> Installing dependencies for bmake-20110606
> => Build dependency gcc3-c>=3.3.5nb1: NOT found
> => Verifying reinstall for ../../lang/gcc3-c
> ERROR: This package is not available for these platforms: Darwin-*-* 
> Interix-*-* DragonFly-*-*.
> ERROR: This package has set PKG_FAIL_REASON:
> ERROR: gcc3-c-3.3.6nb1 is not available for Darwin-10.8.0-x86_64
> *** Error code 1
> 
> I can't see why it doesn't like the gcc on the system and wants to build
> its own.  I've mucked with PKGSRC_COMPILER, CCPATH, and other things
> with no succes.
> 
> Its been this way for a while.  (I've been trying to build this off and on
> for some 6+ months but finally started taking apart the scripts for a bit
> and figured someone may just know the answer).
> 
> any hints?
> 
> thanks,
> -Todd



Home | Main Index | Thread Index | Old Index