Changeset 994 in kBuild
- Timestamp:
- May 29, 2007 8:00:08 PM (18 years ago)
- Location:
- trunk/kBuild
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kBuild/env.sh
r993 r994 30 30 # Determin the kBuild path from the script location. 31 31 # 32 if [ -z "$PATH_KBUILD" ]; then32 if test -z "$PATH_KBUILD"; then 33 33 PATH_KBUILD=`dirname "$0"` 34 34 PATH_KBUILD=`cd "$PATH_KBUILD" ; /bin/pwd` 35 35 fi 36 if [ ! -f "$PATH_KBUILD/footer.kmk" -o ! -f "$PATH_KBUILD/header.kmk" -o ! -f "$PATH_KBUILD/rules.kmk" ]; then36 if test ! -f "$PATH_KBUILD/footer.kmk" -o ! -f "$PATH_KBUILD/header.kmk" -o ! -f "$PATH_KBUILD/rules.kmk"; then 37 37 echo "$0: error: PATH_KBUILD ($PATH_KBUILD) is not pointing to a popluated kBuild directory."; 38 38 sleep 1; … … 45 45 # Set default build type. 46 46 # 47 if [ -z "$BUILD_TYPE" ]; then47 if test -z "$BUILD_TYPE"; then 48 48 BUILD_TYPE=release 49 49 fi … … 58 58 # sure any new additions are unique. (See header.kmk, KBUILD_OSES/ARCHES.) 59 59 # 60 if [ -z "$BUILD_PLATFORM_ARCH" ]; then 60 if test -z "$BUILD_PLATFORM"; then 61 BUILD_PLATFORM=`uname` 62 case "$BUILD_PLATFORM" in 63 linux|Linux|GNU/Linux|LINUX) 64 BUILD_PLATFORM=linux 65 ;; 66 67 os2|OS/2|OS2) 68 BUILD_PLATFORM=os2 69 ;; 70 71 freebsd|FreeBSD|FREEBSD) 72 BUILD_PLATFORM=freebsd 73 ;; 74 75 openbsd|OpenBSD|OPENBSD) 76 BUILD_PLATFORM=openbsd 77 ;; 78 79 netbsd|NetBSD|NETBSD) 80 BUILD_PLATFORM=netbsd 81 ;; 82 83 Darwin|darwin) 84 BUILD_PLATFORM=darwin 85 ;; 86 87 SunOS) 88 BUILD_PLATFORM=solaris 89 ;; 90 91 WindowsNT|CYGWIN_NT-*) 92 BUILD_PLATFORM=win 93 ;; 94 95 *) 96 echo "$0: unknown os $BUILD_PLATFORM" 97 sleep 1 98 exit 1 99 ;; 100 esac 101 fi 102 export BUILD_PLATFORM 103 echo "dbg: BUILD_PLATFORM=$BUILD_PLATFORM" 104 105 if test -z "$BUILD_PLATFORM_ARCH"; then 61 106 # Try deduce it from the cpu if given. 62 if [ -s "$BUILD_PLATFORM_CPU" ]; then107 if test -s "$BUILD_PLATFORM_CPU"; then 63 108 case "$BUILD_PLATFORM_CPU" in 64 109 i[3456789]86) … … 71 116 fi 72 117 fi 73 if [ -z "$BUILD_PLATFORM_ARCH" ]; then118 if test -z "$BUILD_PLATFORM_ARCH"; then 74 119 # Use uname (lots of guesses here, please help clean this up...) 75 120 BUILD_PLATFORM_ARCH=`uname -m` … … 130 175 echo "dbg: BUILD_PLATFORM_ARCH=$BUILD_PLATFORM_ARCH" 131 176 132 if [ -z "$BUILD_PLATFORM_CPU" ]; then177 if test -z "$BUILD_PLATFORM_CPU"; then 133 178 BUILD_PLATFORM_CPU="blend" 134 179 fi … … 136 181 echo "dbg: BUILD_PLATFORM_CPU=$BUILD_PLATFORM_CPU" 137 182 138 if [ -z "$BUILD_PLATFORM" ]; then139 BUILD_PLATFORM=`uname`140 case "$BUILD_PLATFORM" in141 linux|Linux|GNU/Linux|LINUX)142 BUILD_PLATFORM=linux143 ;;144 145 os2|OS/2|OS2)146 BUILD_PLATFORM=os2147 ;;148 149 freebsd|FreeBSD|FREEBSD)150 BUILD_PLATFORM=freebsd151 ;;152 153 openbsd|OpenBSD|OPENBSD)154 BUILD_PLATFORM=openbsd155 ;;156 157 netbsd|NetBSD|NETBSD)158 BUILD_PLATFORM=netbsd159 ;;160 161 Darwin|darwin)162 BUILD_PLATFORM=darwin163 ;;164 165 SunOS)166 BUILD_PLATFORM=solaris167 ;;168 169 WindowsNT|CYGWIN_NT-*)170 BUILD_PLATFORM=win171 ;;172 173 *)174 echo "$0: unknown os $BUILD_PLATFORM"175 sleep 1176 exit 1177 ;;178 esac179 fi180 export BUILD_PLATFORM181 echo "dbg: BUILD_PLATFORM=$BUILD_PLATFORM"182 183 184 183 # 185 184 # The target platform. 186 185 # Defaults to the host when not specified. 187 186 # 188 if [ -z "$BUILD_TARGET_CPU" ]; then 189 BUILD_TARGET_CPU="$BUILD_PLATFORM_CPU" 187 if test -z "$BUILD_TARGET"; then 188 BUILD_TARGET="$BUILD_PLATFORM" 189 fi 190 export BUILD_TARGET 191 echo "dbg: BUILD_TARGET=$BUILD_TARGET" 192 193 if test -z "$BUILD_TARGET_ARCH"; then 194 BUILD_TARGET_ARCH="$BUILD_PLATFORM_ARCH" 195 fi 196 export BUILD_TARGET_ARCH 197 echo "dbg: BUILD_TARGET_ARCH=$BUILD_TARGET_ARCH" 198 199 if test -z "$BUILD_TARGET_CPU"; then 200 if test "$BUILD_TARGET_ARCH" = "$BUILD_PLATFORM_ARCH"; then 201 BUILD_TARGET_CPU="$BUILD_PLATFORM_CPU" 202 else 203 BUILD_TARGET_CPU="blend" 204 fi 190 205 fi 191 206 export BUILD_TARGET_CPU 192 207 echo "dbg: BUILD_TARGET_CPU=$BUILD_TARGET_CPU" 193 194 if [ -z "$BUILD_TARGET_ARCH" ]; then195 BUILD_TARGET_ARCH="$BUILD_PLATFORM_ARCH"196 fi197 export BUILD_TARGET_ARCH198 echo "dbg: BUILD_TARGET_ARCH=$BUILD_TARGET_ARCH"199 200 if [ -z "$BUILD_TARGET" ]; then201 BUILD_TARGET="$BUILD_PLATFORM"202 fi203 export BUILD_TARGET204 echo "dbg: BUILD_TARGET=$BUILD_TARGET"205 208 206 209 … … 227 230 228 231 # Sanity and x bits. 229 if [ ! -d "$PATH_KBUILD/bin/$BUILD_PLATFORM.$BUILD_PLATFORM_ARCH/" ]; then232 if test ! -d "$PATH_KBUILD/bin/$BUILD_PLATFORM.$BUILD_PLATFORM_ARCH/"; then 230 233 echo "$0: warning: The bin directory for this platform doesn't exists. ($PATH_KBUILD/bin/$BUILD_PLATFORM.$BUILD_PLATFORM_ARCH/)" 231 234 else … … 233 236 do 234 237 chmod a+x $PATH_KBUILD/bin/$BUILD_PLATFORM.$BUILD_PLATFORM_ARCH/${prog} > /dev/null 2>&1 235 if [ ! -f "$PATH_KBUILD/bin/$BUILD_PLATFORM.$BUILD_PLATFORM_ARCH/${prog}${_SUFF_EXE}" ]; then238 if test ! -f "$PATH_KBUILD/bin/$BUILD_PLATFORM.$BUILD_PLATFORM_ARCH/${prog}${_SUFF_EXE}"; then 236 239 echo "$0: warning: The ${prog} program doesn't exist for this platform. ($PATH_KBUILD/bin/$BUILD_PLATFORM.$BUILD_PLATFORM_ARCH/${prog}${_SUFF_EXE})" 237 240 fi … … 243 246 244 247 # Execute command or spawn shell. 245 if [ $# -eq 0 ]; then248 if test $# -eq 0; then 246 249 echo "$0: info: Spawning work shell..." 247 if [ "$TERM" != 'dumb' ] && [ -n "$BASH" ]; then250 if test "$TERM" != 'dumb' -a -n "$BASH"; then 248 251 export PS1='\[\033[01;32m\]\u@\h \[\033[01;34m\]\W \$ \[\033[00m\]' 249 252 fi -
trunk/kBuild/header.kmk
r992 r994 177 177 178 178 ifeq ($(strip $(BUILD_PLATFORM_CPU)),) 179 $(error kBuild: The BUILD_PLATFORM_CPU value is missing (should be set by kmk)!) 180 endif 181 ifneq (.$(words $(BUILD_PLATFORM_CPU)).$(BUILD_PLATFORM_CPU).,.1.$(strip $(BUILD_PLATFORM_CPU)).) 182 $(error kBuild: The BUILD_PLATFORM_CPU value '$(BUILD_PLATFORM_CPU)' contains spaces/tabs!) 183 endif 184 ifneq ($(filter $(BUILD_PLATFORM_CPU), $(KBUILD_OSES) $(BUILD_ARCHES)),) 185 $(error kBuild: The BUILD_PLATFORM_CPU value '$(BUILD_PLATFORM_CPU)' was found in the OS or architecture keywords!) 186 endif 187 ifeq ($(BUILD_PLATFORM_CPU),$(BUILD_TYPE)) 188 $(error kBuild: The BUILD_PLATFORM_CPU value '$(BUILD_PLATFORM_CPU)' is the same as the BUILD_TYPE!) 179 BUILD_PLATFORM_CPU := blend 180 else 181 ifneq (.$(words $(BUILD_PLATFORM_CPU)).$(BUILD_PLATFORM_CPU).,.1.$(strip $(BUILD_PLATFORM_CPU)).) 182 $(error kBuild: The BUILD_PLATFORM_CPU value '$(BUILD_PLATFORM_CPU)' contains spaces/tabs!) 183 endif 184 ifneq ($(filter $(BUILD_PLATFORM_CPU), $(KBUILD_OSES) $(BUILD_ARCHES)),) 185 $(error kBuild: The BUILD_PLATFORM_CPU value '$(BUILD_PLATFORM_CPU)' was found in the OS or architecture keywords!) 186 endif 187 ifeq ($(BUILD_PLATFORM_CPU),$(BUILD_TYPE)) 188 $(error kBuild: The BUILD_PLATFORM_CPU value '$(BUILD_PLATFORM_CPU)' is the same as the BUILD_TYPE!) 189 endif 189 190 endif 190 191 … … 218 219 ifndef BUILD_TARGET_CPU 219 220 BUILD_TARGET_CPU := $(BUILD_PLATFORM_CPU) 220 else 221 ifeq ($(strip $(BUILD_TARGET_CPU)),) 222 $(error kBuild: The BUILD_TARGET_CPU value is missing (should be set by kmk)!) 223 endif 221 else ifeq ($(strip $(BUILD_TARGET_CPU)),) 222 ifeq ($(BUILD_TARGET_ARCH),$(BUILD_PLATFORM_ARCH)) 223 BUILD_TARGET_CPU := $(BUILD_PLATFORM_CPU) 224 else 225 BUILD_TARGET_CPU := blend 226 endif 227 else 224 228 ifneq (.$(words $(BUILD_TARGET_CPU)).$(BUILD_TARGET_CPU).,.1.$(strip $(BUILD_TARGET_CPU)).) 225 229 $(error kBuild: The BUILD_TARGET_CPU value '$(BUILD_TARGET_CPU)' contains spaces/tabs!)
Note:
See TracChangeset
for help on using the changeset viewer.