• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Ubuntu 10.04-Android Open Source Make Error

Trust-No-1

Newbie
Jul 5, 2010
10
0
Hi,
I have followed the instructions to the letter and I have download the Android OS Source code as per instructions, and when says to run the "make" command, I get this output:
Code:
hamish@hamish-laptop:~/mydroid$ make
============================================
PLATFORM_VERSION_CODENAME=AOSP
PLATFORM_VERSION=AOSP
TARGET_PRODUCT=generic
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=OPENMASTER
============================================
Install: out/host/linux-x86/framework/apicheck.jar
Install: out/host/linux-x86/framework/clearsilver.jar
Install: out/host/linux-x86/framework/droiddoc.jar
host C: libclearsilver-jni <= external/clearsilver/java-jni/j_neo_util.c
In file included from /usr/include/features.h:378,
                 from /usr/include/string.h:26,
                 from external/clearsilver/java-jni/j_neo_util.c:1:
/usr/include/gnu/stubs.h:9:27: error: gnu/stubs-64.h: No such file or directory
make: *** [out/host/linux-x86/obj/SHARED_LIBRARIES/libclearsilver-jni_intermediates/j_neo_util.o] Error 1
Have I screwed up?
Regards,
Hamish

FOLLOW UPS:

I have tried a few more times with the same message

I tried "make clean" then "make" same result
I tried copying stubs-32.h and pasting it, then renaming it too stubs-64.h, it give this output:
Code:
amish@hamish-laptop:~/mydroid$ make
============================================
PLATFORM_VERSION_CODENAME=AOSP
PLATFORM_VERSION=AOSP
TARGET_PRODUCT=generic
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=OPENMASTER
============================================
Install: out/host/linux-x86/framework/apicheck.jar
Install: out/host/linux-x86/framework/clearsilver.jar
Install: out/host/linux-x86/framework/droiddoc.jar
host C: libclearsilver-jni <= external/clearsilver/java-jni/j_neo_util.c
target Generated: libclearsilver-jni <= out/host/common/obj/JAVA_LIBRARIES/clearsilver_intermediates/javalib.jar
host C: libclearsilver-jni <= external/clearsilver/java-jni/j_neo_cs.c
host C: libneo_util <= external/clearsilver/util/neo_err.c
host C: libneo_util <= external/clearsilver/util/neo_files.c
host C: libneo_util <= external/clearsilver/util/neo_misc.c
host C: libneo_util <= external/clearsilver/util/neo_rand.c
host C: libneo_util <= external/clearsilver/util/ulist.c
host C: libneo_util <= external/clearsilver/util/neo_hdf.c
host C: libneo_util <= external/clearsilver/util/neo_str.c
host C: libneo_util <= external/clearsilver/util/neo_date.c
host C: libneo_util <= external/clearsilver/util/wildmat.c
host C: libneo_util <= external/clearsilver/util/ulocks.c
host C: libneo_util <= external/clearsilver/util/neo_hash.c
host SharedLib: libneo_util (out/host/linux-x86/obj/lib/libneo_util.so)
/usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/libstdc++.so when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/libstdc++.a when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/libstdc++.so when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/libstdc++.a when searching for -lstdc++
/usr/bin/ld: cannot find -lstdc++
collect2: ld returned 1 exit status
make: *** [out/host/linux-x86/obj/lib/libneo_util.so] Error 1

Ok, so i ran:
Code:
hamish@hamish-laptop:~/mydroid$ sudo ln -s /usr/lib/libstdc++.so.5.0.7 /usr/lib/libstdc++.so
and got this output:
Code:
amish@hamish-laptop:~/mydroid$ make
============================================
PLATFORM_VERSION_CODENAME=AOSP
PLATFORM_VERSION=AOSP
TARGET_PRODUCT=generic
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=OPENMASTER
============================================
Install: out/host/linux-x86/framework/apicheck.jar
Install: out/host/linux-x86/framework/clearsilver.jar
Install: out/host/linux-x86/framework/droiddoc.jar
host SharedLib: libneo_util (out/host/linux-x86/obj/lib/libneo_util.so)
/usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/libstdc++.so when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/libstdc++.a when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/libstdc++.so when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/libstdc++.a when searching for -lstdc++
/usr/bin/ld: cannot find -lstdc++
collect2: ld returned 1 exit status
make: *** [out/host/linux-x86/obj/lib/libneo_util.so] Error 1

Im lost, any solutions?
 
It looks like you're building for 64-bit and are on a 32-bit system or vice versa, so you don't have the build libraries for the target architecture. Remove that stubs-64.h file you created; you don't want to mix the 32-bit libraries with the 64-bit ones. Try running

sudo aptitude install gcc-multilib

and then try make clean and then make.
 
  • Like
Reactions: Trust-No-1
Upvote 0
Hi,
Thanks heaps for your reply.
I did what you said, and got this output:
Code:
host C: acp <= build/tools/acp/acp.c
host C++: libhost <= build/libs/host/pseudolocalize.cpp
host C: libhost <= build/libs/host/CopyFile.c
host StaticLib: libhost (out/host/linux-x86/obj/STATIC_LIBRARIES/libhost_intermediates/libhost.a)
echo out/host/linux-x86/obj/STATIC_LIBRARIES/libhost_intermediates/pseudolocalize.o out/host/linux-x86/obj/STATIC_LIBRARIES/libhost_intermediates/CopyFile.o | xargs ar crsP  out/host/linux-x86/obj/STATIC_LIBRARIES/libhost_intermediates/libhost.a
host Executable: acp (out/host/linux-x86/obj/EXECUTABLES/acp_intermediates/acp)
true
Install: out/host/linux-x86/bin/acp
Install: out/host/linux-x86/framework/apicheck.jar
host Java: clearsilver (out/host/common/obj/JAVA_LIBRARIES/clearsilver_intermediates/classes)
Install: out/host/linux-x86/framework/clearsilver.jar
host Java: droiddoc (out/host/common/obj/JAVA_LIBRARIES/droiddoc_intermediates/classes)
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Install: out/host/linux-x86/framework/droiddoc.jar
target Generated: libclearsilver-jni <= out/host/common/obj/JAVA_LIBRARIES/clearsilver_intermediates/javalib.jar
host C: libclearsilver-jni <= external/clearsilver/java-jni/j_neo_util.c
target Generated: libclearsilver-jni <= out/host/common/obj/JAVA_LIBRARIES/clearsilver_intermediates/javalib.jar
host C: libclearsilver-jni <= external/clearsilver/java-jni/j_neo_cs.c
host C: libneo_util <= external/clearsilver/util/neo_err.c
host C: libneo_util <= external/clearsilver/util/neo_files.c
host C: libneo_util <= external/clearsilver/util/neo_misc.c
host C: libneo_util <= external/clearsilver/util/neo_rand.c
host C: libneo_util <= external/clearsilver/util/ulist.c
host C: libneo_util <= external/clearsilver/util/neo_hdf.c
host C: libneo_util <= external/clearsilver/util/neo_str.c
host C: libneo_util <= external/clearsilver/util/neo_date.c
host C: libneo_util <= external/clearsilver/util/wildmat.c
host C: libneo_util <= external/clearsilver/util/ulocks.c
host C: libneo_util <= external/clearsilver/util/neo_hash.c
host SharedLib: libneo_util (out/host/linux-x86/obj/lib/libneo_util.so)
/usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/libstdc++.so when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/libstdc++.a when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/libstdc++.so when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/libstdc++.a when searching for -lstdc++
/usr/bin/ld: cannot find -lstdc++
collect2: ld returned 1 exit status
make: *** [out/host/linux-x86/obj/lib/libneo_util.so] Error 1
Thats only the current view, not the whole text.
Regards,
Hamish
 
Upvote 0
I tried running that, it didnt install anything, so I went into synaptic Package Manager, I got about 7 packages in a search for "libstdc++-dev" so I installed them all and got this error.
IM SICK OF ERRORS
Code:
/usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/libstdc++.so when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/libstdc++.a when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/libstdc++.so when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/libstdc++.a when searching for -lstdc++
/usr/bin/ld: cannot find -lstdc++
collect2: ld returned 1 exit status
make: *** [out/host/linux-x86/obj/lib/libneo_util.so] Error 1
 
Upvote 0
Hamish,
The compilation is not working because some folders in external/clearsilver are compiled with -m64. This is because of the following lines in the files:
external/clearsilver/cgi/Android.mk, external/clearsilver/java-jni/Android.mk,
external/clearsilver/util/Android.mk, external/clearsilver/cs/Android.mk

# This forces a 64-bit build for Java6
ifneq ($(filter 1.6%,$(java_version)),)
LOCAL_CFLAGS += -m64
LOCAL_LDFLAGS += -m64
endif

The new Android looks to be working with Java6 alone and as a result, it is trying to compile for 64 bit architecture. On 32-bit machines running Ubuntu, it is causing issues for that reason.

This looks to be due to some recent changes in Android. I could find the changes documented at the following link.

android.git.kernel.org Git - platform/external/clearsilver.git/commitdiff

If I revert back these changes, the compilation goes through.

I am also trying to figure what are all the libraries required to compile code for 64 bit (-m64 option) on a 32-bit machine running Ubuntu. Please provide the list of the libraries that need to be installed on 32-bit Ubuntu 9.10.
 
  • Like
Reactions: FullBandwidth
Upvote 0
Hi,
I dont really understand what you mean.
I think what you want is the required packages they say for the 32-bit machine.
Here is the list, original at: Get Android Source Code | Android Open Source
LIST:
Ubuntu Linux (32-bit x86)

To set up your Linux development environment, make sure you have the following:
Required Packages:
Git 1.5.4 or newer and the GNU Privacy Guard.
JDK 5.0, update 12 or higher.Java 6 is not supported, because of incompatibilities with @Override.
flex, bison, gperf, libsdl-dev, libesd0-dev, libwxgtk2.6-dev (optional), build-essential, zip, curl.
$ sudo apt-get install git-core gnupg sun-java5-jdk flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev
You might also want Valgrind, a tool that will help you find memory leaks, stack corruption, array bounds overflows, etc.
$ sudo apt-get install valgrind
Intrepid ( 8.10) users may need a newer version of libreadline:
$ sudo apt-get install lib32readline5-dev

It also states that compiling on 64-Bit has not been well tested.
Regards,
Hamish
 
Upvote 0
Hamish,
I tried something with some packages. Can you try this and see if your problem gets solved.
Use Synaptic Package manager in Ubuntu to install the packages gcc-multilib and g++-multilib. Please note that some more dependent packages might be upgraded because of that.
Let me know if the issue is fixed after you install these packages.
 
Upvote 0
Hamish,
Do you have 64bit Ubuntu running (desktop or server)? It seems that is your problem here. As you mentioned, 64bit development is not tested and basically a "at your own risk" endeavor. I would highly suggest you create a VM (I use VirtualBox). You may run into problems having a 32 bit image running under 64bit (I was unable to go the other route - 32bit OS running a 64bit VM) but you will have far less problems with 32 bit. If you follow everything correctly it should just "work out of the box". Just as a test I imaged a new Ubuntu vm and followed the steps exactly and ran into no issues - this was on a 32 bit OS.
 
Upvote 0
I am also running Ubuntu 10.04 (32-bit) in Sun Virtual Box. I have a few questions for you just to make sure that I did not do anything wrong.

i) Which version of Ubuntu are you using?

ii) Did you get the latest version of Android? I can see the following lines
in build/core/main.mk in android in my checked-out code. It looks to be looking for Java6. (1.6). What is it mentioned in the corresponding mk file for you?

# Check for the correct version of java
java_version := $(shell java -version 2>&1 | head -n 1 | grep '[ "]1\.6[\. "$$]')
ifeq ($(strip $(java_version)),)
$(info ************************************************************)
$(info You are attempting to build with the incorrect version)
$(info of java.)
$(info $(space))
$(info Your version is: $(shell java -version 2>&1 | head -n 1).)
$(info The correct version is: 1.6.)

$(info $(space))
$(info Please follow the machine setup instructions at)
$(info $(space)$(space)$(space)$(space)http://source.android.com/download)
$(info ************************************************************)
$(error stop)
endif

iii) What do you see on doing "java -version? I have Java 1.6 installed

java version "1.6.0_20"

As a result, the following mk files force a 64-bit build for Java6:
external/clearsilver/cgi/Android.mk, external/clearsilver/java-jni/Android.mk, external/clearsilver/util/Android.mk, external/clearsilver/cs/Android.mk

These are the lines in these mk files.
# This forces a 64-bit build for Java6
ifneq ($(filter 1.6%,$(java_version)),)
LOCAL_CFLAGS += -m64
LOCAL_LDFLAGS += -m64
endif

If you do not have these lines in the mentioned mk files, please get the latest Android code using repo sync and then do a "make -j2 showcommands". You will see that the compilation fails due to "-m64".
So, basically it is trying to compile for 64-bit even when I am running on a 32-bit platform. While trying to do this, it is unable to find the 64-bit libraries and so the build fails for me. I am using 32-bit Ubuntu but I am forced to pick up packages for 64-bit to get around this problem.

I tried installing the packages gcc-multilib and g++-multilib. I got around the initial errors but then I am getting this new set of errors. I tried installing zlib1g-dev too but it did not help.

Copying: out/target/common/obj/JAVA_LIBRARIES/core_intermediates/classes-full-debug.jar
/usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/../../../libz.so when searching for -lz
/usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/../../../libz.a when searching for -lz
/usr/bin/ld: skipping incompatible /usr/lib/libz.so when searching for -lz
/usr/bin/ld: skipping incompatible /usr/lib/libz.a when searching for -lz
/usr/bin/ld: cannot find -lz
collect2: ld returned 1 exit status
make: *** [out/host/linux-x86/obj/lib/libneo_cgi.so] Error 1
 
Upvote 0
Hamish,
Do you have 64bit Ubuntu running (desktop or server)? It seems that is your problem here. As you mentioned, 64bit development is not tested and basically a "at your own risk" endeavor. I would highly suggest you create a VM (I use VirtualBox). You may run into problems having a 32 bit image running under 64bit (I was unable to go the other route - 32bit OS running a 64bit VM) but you will have far less problems with 32 bit. If you follow everything correctly it should just "work out of the box". Just as a test I imaged a new Ubuntu vm and followed the steps exactly and ran into no issues - this was on a 32 bit OS.
No, Im a 32-Bit Ubuntu 10.04

Hamish,
I tried something with some packages. Can you try this and see if your problem gets solved.
Use Synaptic Package manager in Ubuntu to install the packages gcc-multilib and g++-multilib. Please note that some more dependent packages might be upgraded because of that.
Let me know if the issue is fixed after you install these packages.

I am also running Ubuntu 10.04 (32-bit) in Sun Virtual Box. I have a few questions for you just to make sure that I did not do anything wrong.

i) Which version of Ubuntu are you using?

ii) Did you get the latest version of Android? I can see the following lines
in build/core/main.mk in android in my checked-out code. It looks to be looking for Java6. (1.6). What is it mentioned in the corresponding mk file for you?

# Check for the correct version of java
java_version := $(shell java -version 2>&1 | head -n 1 | grep '[ "]1\.6[\. "$$]')
ifeq ($(strip $(java_version)),)
$(info ************************************************************)
$(info You are attempting to build with the incorrect version)
$(info of java.)
$(info $(space))
$(info Your version is: $(shell java -version 2>&1 | head -n 1).)
$(info The correct version is: 1.6.)

$(info $(space))
$(info Please follow the machine setup instructions at)
$(info $(space)$(space)$(space)$(space)http://source.android.com/download)
$(info ************************************************************)
$(error stop)
endif

iii) What do you see on doing "java -version? I have Java 1.6 installed

java version "1.6.0_20"

As a result, the following mk files force a 64-bit build for Java6:
external/clearsilver/cgi/Android.mk, external/clearsilver/java-jni/Android.mk, external/clearsilver/util/Android.mk, external/clearsilver/cs/Android.mk

These are the lines in these mk files.
# This forces a 64-bit build for Java6
ifneq ($(filter 1.6%,$(java_version)),)
LOCAL_CFLAGS += -m64
LOCAL_LDFLAGS += -m64
endif

If you do not have these lines in the mentioned mk files, please get the latest Android code using repo sync and then do a "make -j2 showcommands". You will see that the compilation fails due to "-m64".
So, basically it is trying to compile for 64-bit even when I am running on a 32-bit platform. While trying to do this, it is unable to find the 64-bit libraries and so the build fails for me. I am using 32-bit Ubuntu but I am forced to pick up packages for 64-bit to get around this problem.

I tried installing the packages gcc-multilib and g++-multilib. I got around the initial errors but then I am getting this new set of errors. I tried installing zlib1g-dev too but it did not help.

Copying: out/target/common/obj/JAVA_LIBRARIES/core_intermediates/classes-full-debug.jar
/usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/../../../libz.so when searching for -lz
/usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/../../../libz.a when searching for -lz
/usr/bin/ld: skipping incompatible /usr/lib/libz.so when searching for -lz
/usr/bin/ld: skipping incompatible /usr/lib/libz.a when searching for -lz
/usr/bin/ld: cannot find -lz
collect2: ld returned 1 exit status
make: *** [out/host/linux-x86/obj/lib/libneo_cgi.so] Error 1

i) Ubuntu Desktop 10.04 32-bit
ii) Yes, I repo Synched, so, latest version
iii)Java Version:
Code:
hamish@hamish-laptop:~$ java -version
java version "1.6.0_18"
OpenJDK Runtime Environment (IcedTea6 1.8) (6b18-1.8-0ubuntu1)
OpenJDK Client VM (build 14.0-b16, mixed mode, sharing)
hamish@hamish-laptop:~$
Where do I find the mk file?
I also installed those packages and got this output:
Code:
host SharedLib: libneo_cgi (out/host/linux-x86/obj/lib/libneo_cgi.so)
/usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/../../../libz.so when searching for -lz
/usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/../../../libz.a when searching for -lz
/usr/bin/ld: skipping incompatible /usr/lib/libz.so when searching for -lz
/usr/bin/ld: skipping incompatible /usr/lib/libz.a when searching for -lz
/usr/bin/ld: cannot find -lz
collect2: ld returned 1 exit status
make: *** [out/host/linux-x86/obj/lib/libneo_cgi.so] Error 1
 
Upvote 0
There is an mk file build/core/main.m, which is invoked from the main makefile. It is checking for dependencies.
The following mk files are causing the build issue.
external/clearsilver/cgi/Android.mk, external/clearsilver/java-jni/Android.mk, external/clearsilver/util/Android.mk, external/clearsilver/cs/Android.mk.

These are the lines in those mk files which are causing the 64 bit
# This forces a 64-bit build for Java6
ifneq ($(filter 1.6%,$(java_version)),)
LOCAL_CFLAGS += -m64
LOCAL_LDFLAGS += -m64
endif

If you change the ifneq to ifeq, your Android build will go through till completion, even without the multilib packages. But I do not think that would be the right fix for this issue. I am also trying to figure out the right package.
 
Upvote 0
I csnt find that section, the bit that forces the 64-bit build.
Here is the contents of my mk file:
Code:
# Only use ANDROID_BUILD_SHELL to wrap around bash.
# DO NOT use other shells such as zsh.
ifdef ANDROID_BUILD_SHELL
SHELL := $(ANDROID_BUILD_SHELL)
else
# Use bash, not whatever shell somebody has installed as /bin/sh
# This is repeated in config.mk, since envsetup.sh runs that file
# directly.
SHELL := /bin/bash
endif

# this turns off the suffix rules built into make
.SUFFIXES:

# If a rule fails, delete $@.
.DELETE_ON_ERROR:

# Figure out where we are.
#TOP := $(dir $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)))
#TOP := $(patsubst %/,%,$(TOP))

# TOPDIR is the normal variable you should use, because
# if we are executing relative to the current directory
# it can be "", whereas TOP must be "." which causes
# pattern matching probles when make strips off the
# trailing "./" from paths in various places.
#ifeq ($(TOP),.)
#TOPDIR :=
#else
#TOPDIR := $(TOP)/
#endif

# check for broken versions of make
ifeq (0,$(shell expr $$(echo $(MAKE_VERSION) | sed "s/[^0-9\.].*//") \>= 3.81))
$(warning ********************************************************************************)
$(warning *  You are using version $(MAKE_VERSION) of make.)
$(warning *  You must upgrade to version 3.81 or greater.)
$(warning *  see http://source.android.com/download)
$(warning ********************************************************************************)
$(error stopping)
endif

TOP := .
TOPDIR :=

BUILD_SYSTEM := $(TOPDIR)build/core

# This is the default target.  It must be the first declared target.
.PHONY: droid
DEFAULT_GOAL := droid
$(DEFAULT_GOAL):

# Set up various standard variables based on configuration
# and host information.
include $(BUILD_SYSTEM)/config.mk

# This allows us to force a clean build - included after the config.make
# environment setup is done, but before we generate any dependencies.  This
# file does the rm -rf inline so the deps which are all done below will
# be generated correctly
include $(BUILD_SYSTEM)/cleanbuild.mk

VERSION_CHECK_SEQUENCE_NUMBER := 1
-include $(OUT_DIR)/versions_checked.mk
ifneq ($(VERSION_CHECK_SEQUENCE_NUMBER),$(VERSIONS_CHECKED))

$(info Checking build tools versions...)

ifneq ($(HOST_OS),windows)
ifneq ($(HOST_OS)-$(HOST_ARCH),darwin-ppc)
# check for a case sensitive file system
ifneq (a,$(shell mkdir -p $(OUT_DIR) ; \
                echo a > $(OUT_DIR)/casecheck.txt; \
                    echo B > $(OUT_DIR)/CaseCheck.txt; \
                cat $(OUT_DIR)/casecheck.txt))
$(warning ************************************************************)
$(warning You are building on a case-insensitive filesystem.)
$(warning Please move your source tree to a case-sensitive filesystem.)
$(warning ************************************************************)
$(error Case-insensitive filesystems not supported)
endif
endif
endif

# Make sure that there are no spaces in the absolute path; the
# build system can't deal with them.
ifneq ($(words $(shell pwd)),1)
$(warning ************************************************************)
$(warning You are building in a directory whose absolute path contains)
$(warning a space character:)
$(warning $(space))
$(warning "$(shell pwd)")
$(warning $(space))
$(warning Please move your source tree to a path that does not contain)
$(warning any spaces.)
$(warning ************************************************************)
$(error Directory names containing spaces not supported)
endif


# Check for the correct version of java
java_version := $(shell java -version 2>&1 | head -n 1 | grep '[ "]1\.6[\. "$$]')
ifeq ($(strip $(java_version)),)
$(info ************************************************************)
$(info You are attempting to build with the incorrect version)
$(info of java.)
$(info $(space))
$(info Your version is: $(shell java -version 2>&1 | head -n 1).)
$(info The correct version is: 1.6.)
$(info $(space))
$(info Please follow the machine setup instructions at)
$(info $(space)$(space)$(space)$(space)http://source.android.com/download)
$(info ************************************************************)
$(error stop)
endif

# Check for the correct version of javac
javac_version := $(shell javac -version 2>&1 | head -n 1 | grep '[ "]1\.6[\. "$$]')
ifeq ($(strip $(javac_version)),)
$(info ************************************************************)
$(info You are attempting to build with the incorrect version)
$(info of javac.)
$(info $(space))
$(info Your version is: $(shell javac -version 2>&1 | head -n 1).)
$(info The correct version is: 1.6.)
$(info $(space))
$(info Please follow the machine setup instructions at)
$(info $(space)$(space)$(space)$(space)http://source.android.com/download)
$(info ************************************************************)
$(error stop)
endif

$(shell echo 'VERSIONS_CHECKED := $(VERSION_CHECK_SEQUENCE_NUMBER)' \
        > $(OUT_DIR)/versions_checked.mk)
endif

# These are the modifier targets that don't do anything themselves, but
# change the behavior of the build.
# (must be defined before including definitions.make)
INTERNAL_MODIFIER_TARGETS := showcommands checkbuild

# Bring in standard build system definitions.
include $(BUILD_SYSTEM)/definitions.mk

ifneq ($(filter eng user userdebug tests,$(MAKECMDGOALS)),)
$(info ***************************************************************)
$(info ***************************************************************)
$(info Don't pass '$(filter eng user userdebug tests,$(MAKECMDGOALS))' on \
		the make command line.)
# XXX The single quote on this line fixes gvim's syntax highlighting.
# Without which, the rest of this file is impossible to read.
$(info Set TARGET_BUILD_VARIANT in buildspec.mk, or use lunch or)
$(info choosecombo.)
$(info ***************************************************************)
$(info ***************************************************************)
$(error stopping)
endif

ifneq ($(filter-out $(INTERNAL_VALID_VARIANTS),$(TARGET_BUILD_VARIANT)),)
$(info ***************************************************************)
$(info ***************************************************************)
$(info Invalid variant: $(TARGET_BUILD_VARIANT)
$(info Valid values are: $(INTERNAL_VALID_VARIANTS)
$(info ***************************************************************)
$(info ***************************************************************)
$(error stopping)
endif

###
### In this section we set up the things that are different
### between the build variants
###

is_sdk_build :=
ifneq ($(filter sdk,$(MAKECMDGOALS)),)
is_sdk_build := true
endif
ifneq ($(filter win_sdk,$(MAKECMDGOALS)),)
is_sdk_build := true
endif
ifneq ($(filter sdk_addon,$(MAKECMDGOALS)),)
is_sdk_build := true
endif


## user/userdebug ##

user_variant := $(filter userdebug user,$(TARGET_BUILD_VARIANT))
enable_target_debugging := true
ifneq (,$(user_variant))
  # Target is secure in user builds.
  ADDITIONAL_DEFAULT_PROPERTIES += ro.secure=1

  tags_to_install := user
  ifeq ($(user_variant),userdebug)
    # Pick up some extra useful tools
    tags_to_install += debug

    # Enable Dalvik lock contention logging for userdebug builds.
    ADDITIONAL_BUILD_PROPERTIES += dalvik.vm.lockprof.threshold=500
  else
    # Disable debugging in plain user builds.
    enable_target_debugging :=
  endif
 
  # TODO: Always set WITH_DEXPREOPT (for user builds) once it works on OSX.
  # Also, remove the corresponding block in config/product_config.make.
  ifeq ($(HOST_OS)-$(WITH_DEXPREOPT_buildbot),linux-true)
    WITH_DEXPREOPT := true
  endif
  
  # Disallow mock locations by default for user builds
  ADDITIONAL_DEFAULT_PROPERTIES += ro.allow.mock.location=0
  
else # !user_variant
  # Turn on checkjni for non-user builds.
  ADDITIONAL_BUILD_PROPERTIES += ro.kernel.android.checkjni=1
  # Set device insecure for non-user builds.
  ADDITIONAL_DEFAULT_PROPERTIES += ro.secure=0
  # Allow mock locations by default for non user builds
  ADDITIONAL_DEFAULT_PROPERTIES += ro.allow.mock.location=1
endif # !user_variant

ifeq (true,$(strip $(enable_target_debugging)))
  # Target is more debuggable and adbd is on by default
  ADDITIONAL_DEFAULT_PROPERTIES += ro.debuggable=1 persist.service.adb.enable=1
  # Include the debugging/testing OTA keys in this build.
  INCLUDE_TEST_OTA_KEYS := true
else # !enable_target_debugging
  # Target is less debuggable and adbd is off by default
  ADDITIONAL_DEFAULT_PROPERTIES += ro.debuggable=0 persist.service.adb.enable=0
endif # !enable_target_debugging

## eng ##

ifeq ($(TARGET_BUILD_VARIANT),eng)
tags_to_install := user debug eng
  # Don't require the setup wizard on eng builds
  ADDITIONAL_BUILD_PROPERTIES := $(filter-out ro.setupwizard.mode=%,\
          $(call collapse-pairs, $(ADDITIONAL_BUILD_PROPERTIES))) \
          ro.setupwizard.mode=OPTIONAL
endif

## tests ##

ifeq ($(TARGET_BUILD_VARIANT),tests)
tags_to_install := user debug eng tests
endif

## sdk ##

ifdef is_sdk_build
ifneq ($(words $(filter-out $(INTERNAL_MODIFIER_TARGETS),$(MAKECMDGOALS))),1)
$(error The 'sdk' target may not be specified with any other targets)
endif

# TODO: this should be eng I think.  Since the sdk is built from the eng
# variant.
tags_to_install := user debug eng
ADDITIONAL_BUILD_PROPERTIES += xmpp.auto-presence=true
ADDITIONAL_BUILD_PROPERTIES += ro.config.nocheckin=yes
else # !sdk
endif

# build the full stagefright library
ifneq ($(strip BUILD_WITH_FULL_STAGEFRIGHT),)
BUILD_WITH_FULL_STAGEFRIGHT := true
endif

## precise GC ##

ifneq ($(filter dalvik.gc.type-precise,$(PRODUCT_TAGS)),)
  # Enabling type-precise GC results in larger optimized DEX files.  The
  # additional storage requirements for ".odex" files can cause /system
  # to overflow on some devices, so this is configured separately for
  # each product.
  ADDITIONAL_BUILD_PROPERTIES += dalvik.vm.dexopt-flags=m=y
endif

# Install an apns-conf.xml file if one's not already being installed.
ifeq (,$(filter %:system/etc/apns-conf.xml, $(PRODUCT_COPY_FILES)))
  PRODUCT_COPY_FILES += \
        development/data/etc/apns-conf_sdk.xml:system/etc/apns-conf.xml
  ifeq ($(filter eng tests,$(TARGET_BUILD_VARIANT)),)
    $(warning implicitly installing apns-conf_sdk.xml)
  endif
endif
# If we're on an eng or tests build, but not on the sdk, and we have
# a better one, use that instead.
ifneq ($(filter eng tests,$(TARGET_BUILD_VARIANT)),)
  ifndef is_sdk_build
    apns_to_use := $(wildcard vendor/google/etc/apns-conf.xml)
    ifneq ($(strip $(apns_to_use)),)
      PRODUCT_COPY_FILES := \
            $(filter-out %:system/etc/apns-conf.xml,$(PRODUCT_COPY_FILES)) \
            $(strip $(apns_to_use)):system/etc/apns-conf.xml
    endif
  endif
endif

ADDITIONAL_BUILD_PROPERTIES += net.bt.name=Android

# enable vm tracing in files for now to help track
# the cause of ANRs in the content process
ADDITIONAL_BUILD_PROPERTIES += dalvik.vm.stack-trace-file=/data/anr/traces.txt

# ------------------------------------------------------------
# Define a function that, given a list of module tags, returns
# non-empty if that module should be installed in /system.

# For most goals, anything not tagged with the "tests" tag should
# be installed in /system.
define should-install-to-system
$(if $(filter tests,$(1)),,true)
endef

ifdef is_sdk_build
# For the sdk goal, anything with the "samples" tag should be
# installed in /data even if that module also has "eng"/"debug"/"user".
define should-install-to-system
$(if $(filter samples tests,$(1)),,true)
endef
endif


# If they only used the modifier goals (showcommands, checkbuild), we'll actually
# build the default target.
ifeq ($(filter-out $(INTERNAL_MODIFIER_TARGETS),$(MAKECMDGOALS)),)
.PHONY: $(INTERNAL_MODIFIER_TARGETS)
$(INTERNAL_MODIFIER_TARGETS): $(DEFAULT_GOAL)
endif

# These targets are going to delete stuff, don't bother including
# the whole directory tree if that's all we're going to do
ifeq ($(MAKECMDGOALS),clean)
dont_bother := true
endif
ifeq ($(MAKECMDGOALS),clobber)
dont_bother := true
endif
ifeq ($(MAKECMDGOALS),dataclean)
dont_bother := true
endif
ifeq ($(MAKECMDGOALS),installclean)
dont_bother := true
endif

# Bring in all modules that need to be built.
ifneq ($(dont_bother),true)

ifeq ($(HOST_OS)-$(HOST_ARCH),darwin-ppc)
SDK_ONLY := true
$(info Building the SDK under darwin-ppc is actually obsolete and unsupported.)
$(error stop)
endif

ifeq ($(HOST_OS),windows)
SDK_ONLY := true
endif

ifeq ($(SDK_ONLY),true)

# ----- SDK for Windows ------
# These configure the build targets that are available for the SDK under Windows.
# The first section defines all the C/C++ tools that can be compiled in C/C++,
# the second section defines all the Java ones (assuming javac is available.)

subdirs := \
	prebuilt \
	build/libs/host \
	build/tools/zipalign \
	dalvik/dexdump \
	dalvik/libdex \
	dalvik/tools/dmtracedump \
	dalvik/tools/hprof-conv \
	development/tools/line_endings \
	development/tools/etc1tool \
	sdk/emulator/mksdcard \
	sdk/sdklauncher \
	development/host \
	external/expat \
	external/libpng \
	external/qemu \
	external/sqlite/dist \
	external/zlib \
	frameworks/base \
	system/core/adb \
	system/core/fastboot \
	system/core/libcutils \
	system/core/liblog \
	system/core/libzipfile

# The following can only be built if "javac" is available.
# This check is used when building parts of the SDK under Cygwin.
ifneq (,$(shell which javac 2>/dev/null))
subdirs += \
	build/tools/signapk \
	dalvik/dx \
	libcore \
	sdk/archquery \
	sdk/androidprefs \
	sdk/apkbuilder \
	sdk/jarutils \
	sdk/layoutlib_api \
	sdk/layoutlib_utils \
	sdk/ninepatch \
	sdk/sdkstats \
	sdk/sdkmanager \
	sdk/layoutopt \
	sdk/ddms \
	development/apps \
	development/tools/mkstubs \
	packages
else
$(warning SDK_ONLY: javac not available.)
endif

# Exclude tools/acp when cross-compiling windows under linux
ifeq ($(findstring Linux,$(UNAME)),)
subdirs += build/tools/acp
endif

else	# !SDK_ONLY
ifeq ($(BUILD_TINY_ANDROID), true)

# TINY_ANDROID is a super-minimal build configuration, handy for board 
# bringup and very low level debugging

subdirs := \
	bionic \
	system/core \
	build/libs \
	build/target \
	build/tools/acp \
	build/tools/apriori \
	build/tools/kcm \
	build/tools/soslim \
	external/elfcopy \
	external/elfutils \
	external/yaffs2 \
	external/zlib
else	# !BUILD_TINY_ANDROID

#
# Typical build; include any Android.mk files we can find.
#
subdirs := $(TOP)

FULL_BUILD := true

endif	# !BUILD_TINY_ANDROID

endif	# !SDK_ONLY

ifneq ($(ONE_SHOT_MAKEFILE),)
# We've probably been invoked by the "mm" shell function
# with a subdirectory's makefile.
include $(ONE_SHOT_MAKEFILE)
# Change CUSTOM_MODULES to include only modules that were
# defined by this makefile; this will install all of those
# modules as a side-effect.  Do this after including ONE_SHOT_MAKEFILE
# so that the modules will be installed in the same place they
# would have been with a normal make.
CUSTOM_MODULES := $(sort $(call get-tagged-modules,$(ALL_MODULE_TAGS)))
FULL_BUILD :=
# Stub out the notice targets, which probably aren't defined
# when using ONE_SHOT_MAKEFILE.
NOTICE-HOST-%: ;
NOTICE-TARGET-%: ;

else # ONE_SHOT_MAKEFILE

#
# Include all of the makefiles in the system
#

# Can't use first-makefiles-under here because
# --mindepth=2 makes the prunes not work.
subdir_makefiles := \
	$(shell build/tools/findleaves.py --prune=out --prune=.repo --prune=.git $(subdirs) Android.mk)

include $(subdir_makefiles)
endif # ONE_SHOT_MAKEFILE

# -------------------------------------------------------------------
# All module makefiles have been included at this point.
# -------------------------------------------------------------------

# -------------------------------------------------------------------
# Include any makefiles that must happen after the module makefiles
# have been included.
# TODO: have these files register themselves via a global var rather
# than hard-coding the list here.
ifdef FULL_BUILD
  # Only include this during a full build, otherwise we can't be
  # guaranteed that any policies were included.
  -include frameworks/policies/base/PolicyConfig.mk
endif

# -------------------------------------------------------------------
# Fix up CUSTOM_MODULES to refer to installed files rather than
# just bare module names.  Leave unknown modules alone in case
# they're actually full paths to a particular file.
known_custom_modules := $(filter $(ALL_MODULES),$(CUSTOM_MODULES))
unknown_custom_modules := $(filter-out $(ALL_MODULES),$(CUSTOM_MODULES))
CUSTOM_MODULES := \
	$(call module-installed-files,$(known_custom_modules)) \
	$(unknown_custom_modules)

# -------------------------------------------------------------------
# Define dependencies for modules that require other modules.
# This can only happen now, after we've read in all module makefiles.
#
# TODO: deal with the fact that a bare module name isn't
# unambiguous enough.  Maybe declare short targets like
# APPS:Quake or HOST:SHARED_LIBRARIES:libutils.
# BUG: the system image won't know to depend on modules that are
# brought in as requirements of other modules.
define add-required-deps
$(1): $(2)
endef
$(foreach m,$(ALL_MODULES), \
  $(eval r := $(ALL_MODULES.$(m).REQUIRED)) \
  $(if $(r), \
    $(eval r := $(call module-installed-files,$(r))) \
    $(eval $(call add-required-deps,$(ALL_MODULES.$(m).INSTALLED),$(r))) \
   ) \
 )
m :=
r :=
add-required-deps :=

# -------------------------------------------------------------------
# Figure out our module sets.

# Of the modules defined by the component makefiles,
# determine what we actually want to build.
Default_MODULES := $(sort $(ALL_DEFAULT_INSTALLED_MODULES) \
                          $(CUSTOM_MODULES))
# TODO: Remove the 3 places in the tree that use
# ALL_DEFAULT_INSTALLED_MODULES and get rid of it from this list.

ifdef FULL_BUILD
  # The base list of modules to build for this product is specified
  # by the appropriate product definition file, which was included
  # by product_config.make.
  user_PACKAGES := $(call module-installed-files, \
                       $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES))
  ifeq (0,1)
    $(info user packages for $(TARGET_DEVICE) ($(INTERNAL_PRODUCT)):)
    $(foreach p,$(user_PACKAGES),$(info :   $(p)))
    $(error done)
  endif
else
  # We're not doing a full build, and are probably only including
  # a subset of the module makefiles.  Don't try to build any modules
  # requested by the product, because we probably won't have rules
  # to build them.
  user_PACKAGES :=
endif
# Use tags to get the non-APPS user modules.  Use the product
# definition files to get the APPS user modules.
user_MODULES := $(sort $(call get-tagged-modules,user))
user_MODULES := $(user_MODULES) $(user_PACKAGES)

eng_MODULES := $(sort $(call get-tagged-modules,eng))
debug_MODULES := $(sort $(call get-tagged-modules,debug))
tests_MODULES := $(sort $(call get-tagged-modules,tests))

ifeq ($(strip $(tags_to_install)),)
$(error ASSERTION FAILED: tags_to_install should not be empty)
endif
modules_to_install := $(sort $(Default_MODULES) \
          $(foreach tag,$(tags_to_install),$($(tag)_MODULES)))

# Some packages may override others using LOCAL_OVERRIDES_PACKAGES.
# Filter out (do not install) any overridden packages.
overridden_packages := $(call get-package-overrides,$(modules_to_install))
ifdef overridden_packages
#  old_modules_to_install := $(modules_to_install)
  modules_to_install := \
      $(filter-out $(foreach p,$(overridden_packages),$(p) %/$(p).apk), \
          $(modules_to_install))
endif
#$(error filtered out
#           $(filter-out $(modules_to_install),$(old_modules_to_install)))

# Don't include any GNU targets in the SDK.  It's ok (and necessary)
# to build the host tools, but nothing that's going to be installed
# on the target (including static libraries).
ifdef is_sdk_build
  target_gnu_MODULES := \
              $(filter \
                      $(TARGET_OUT_INTERMEDIATES)/% \
                      $(TARGET_OUT)/% \
                      $(TARGET_OUT_DATA)/%, \
                              $(sort $(call get-tagged-modules,gnu)))
  $(info Removing from sdk:)$(foreach d,$(target_gnu_MODULES),$(info : $(d)))
  modules_to_install := \
              $(filter-out $(target_gnu_MODULES),$(modules_to_install))
endif


# build/core/Makefile contains extra stuff that we don't want to pollute this
# top-level makefile with.  It expects that ALL_DEFAULT_INSTALLED_MODULES
# contains everything that's built during the current make, but it also further
# extends ALL_DEFAULT_INSTALLED_MODULES.
ALL_DEFAULT_INSTALLED_MODULES := $(modules_to_install)
include $(BUILD_SYSTEM)/Makefile
modules_to_install := $(sort $(ALL_DEFAULT_INSTALLED_MODULES))
ALL_DEFAULT_INSTALLED_MODULES :=

endif # dont_bother

# These are additional goals that we build, in order to make sure that there
# is as little code as possible in the tree that doesn't build.
modules_to_check := $(foreach m,$(ALL_MODULES),$(ALL_MODULES.$(m).CHECKED))

# If you would like to build all goals, and not skip any intermediate
# steps, you can pass the "all" modifier goal on the commandline.
ifneq ($(filter all,$(MAKECMDGOALS)),)
modules_to_check += $(foreach m,$(ALL_MODULES),$(ALL_MODULES.$(m).BUILT))
endif

# for easier debugging
modules_to_check := $(sort $(modules_to_check))
#$(error modules_to_check $(modules_to_check))

# -------------------------------------------------------------------
# This is used to to get the ordering right, you can also use these,
# but they're considered undocumented, so don't complain if their
# behavior changes.
.PHONY: prebuilt
prebuilt: $(ALL_PREBUILT)

# An internal target that depends on all copied headers
# (see copy_headers.make).  Other targets that need the
# headers to be copied first can depend on this target.
.PHONY: all_copied_headers
all_copied_headers: ;

$(ALL_C_CPP_ETC_OBJECTS): | all_copied_headers

# All the droid stuff, in directories
.PHONY: files
files: prebuilt \
        $(modules_to_install) \
        $(modules_to_check) \
        $(INSTALLED_ANDROID_INFO_TXT_TARGET)

# -------------------------------------------------------------------

.PHONY: checkbuild
checkbuild: $(modules_to_check)

.PHONY: ramdisk
ramdisk: $(INSTALLED_RAMDISK_TARGET)

.PHONY: systemtarball
systemtarball: $(INSTALLED_SYSTEMTARBALL_TARGET)

.PHONY: userdataimage
userdataimage: $(INSTALLED_USERDATAIMAGE_TARGET)

.PHONY: userdatatarball
userdatatarball: $(INSTALLED_USERDATATARBALL_TARGET)

.PHONY: bootimage
bootimage: $(INSTALLED_BOOTIMAGE_TARGET)

ifeq ($(BUILD_TINY_ANDROID), true)
INSTALLED_RECOVERYIMAGE_TARGET :=
endif

# Build files and then package it into the rom formats
.PHONY: droidcore
droidcore: files \
	systemimage \
	$(INSTALLED_BOOTIMAGE_TARGET) \
	$(INSTALLED_RECOVERYIMAGE_TARGET) \
	$(INSTALLED_USERDATAIMAGE_TARGET) \
	$(INSTALLED_FILES_FILE)

ifneq ($(TARGET_BUILD_APPS),)
  # If this build is just for apps, only build apps and not the full system by default.

  unbundled_build_modules :=
  ifneq ($(filter all,$(TARGET_BUILD_APPS)),)
    # If they used the magic goal "all" then build all apps in the source tree.
    unbundled_build_modules := $(foreach m,$(sort $(ALL_MODULES)),$(if $(filter APPS,$(ALL_MODULES.$(m).CLASS)),$(m)))
  else
    unbundled_build_modules := $(TARGET_BUILD_APPS)
  endif

  # dist the unbundled app.
  $(call dist-for-goals,apps_only, \
    $(foreach m,$(unbundled_build_modules),$(ALL_MODULES.$(m).INSTALLED)) \
  )

.PHONY: apps_only
apps_only: $(unbundled_build_modules)

droid: apps_only

else # TARGET_BUILD_APPS
  $(call dist-for-goals, droidcore, \
    $(INTERNAL_UPDATE_PACKAGE_TARGET) \
    $(INTERNAL_OTA_PACKAGE_TARGET) \
    $(SYMBOLS_ZIP) \
    $(APPS_ZIP) \
    $(INTERNAL_EMULATOR_PACKAGE_TARGET) \
    $(PACKAGE_STATS_FILE) \
    $(INSTALLED_FILES_FILE) \
    $(INSTALLED_BUILD_PROP_TARGET) \
    $(BUILT_TARGET_FILES_PACKAGE) \
    $(INSTALLED_ANDROID_INFO_TXT_TARGET) \
   )

  # Tests are installed in userdata.img.  If we're building the tests
  # variant, copy it for "make tests dist".  Also copy a zip of the
  # contents of userdata.img, so that people can easily extract a
  # single .apk.
  ifeq ($(TARGET_BUILD_VARIANT),tests)
  $(call dist-for-goals, droid, \
    $(INSTALLED_USERDATAIMAGE_TARGET) \
    $(BUILT_TESTS_ZIP_PACKAGE) \
   )
  endif

# Building a full system-- the default is to build droidcore
droid: droidcore

endif # TARGET_BUILD_APPS


.PHONY: droid tests
tests: droidcore

.PHONY: docs
docs: $(ALL_DOCS)

.PHONY: sdk
ALL_SDK_TARGETS := $(INTERNAL_SDK_TARGET)
sdk: $(ALL_SDK_TARGETS)
$(call dist-for-goals,sdk, \
	$(ALL_SDK_TARGETS) \
	$(SYMBOLS_ZIP) \
 )

.PHONY: findbugs
findbugs: $(INTERNAL_FINDBUGS_HTML_TARGET) $(INTERNAL_FINDBUGS_XML_TARGET)

.PHONY: clean
dirs_to_clean := \
	$(PRODUCT_OUT) \
	$(TARGET_COMMON_OUT_ROOT) \
	$(HOST_OUT) \
	$(HOST_COMMON_OUT_ROOT)
clean:
	@for dir in $(dirs_to_clean) ; do \
	    echo "Cleaning $$dir..."; \
	    rm -rf $$dir; \
	done
	@echo "Clean."; \

.PHONY: clobber
clobber:
	@rm -rf $(OUT_DIR)
	@echo "Entire build directory removed."

# The rules for dataclean and installclean are defined in cleanbuild.mk.

#xxx scrape this from ALL_MODULE_NAME_TAGS
.PHONY: modules
modules:
	@echo "Available sub-modules:"
	@echo "$(call module-names-for-tag-list,$(ALL_MODULE_TAGS))" | \
	      tr -s ' ' '\n' | sort -u | $(COLUMN)

.PHONY: showcommands
showcommands:
	@echo >/dev/null
 
Upvote 0
to fix this error just run below command

1.) in case you have sun-java5-jdk installed skip to step 4
add these 4 lines in /etc/apt/sources.list
Code:
deb http://archive.ubuntu.com/ubuntu/ jaunty multiverse
deb-src http://archive.ubuntu.com/ubuntu/ jaunty multiverse
deb http://archive.ubuntu.com/ubuntu/ jaunty-updates multiverse
deb-src http://archive.ubuntu.com/ubuntu/ jaunty-updates multiverse


2.) run
Code:
apt-get update

3.) run
Code:
apt-get install sun-java5-jdk

4.) run
Code:
sudo update-java-alternatives -s java-1.5.0-sun

5.) make sure you have all required libs to compile the latest source
flex, bison, gperf, libsdl-dev, libesd0-dev, libwxgtk2.6-dev (optional), build-essential, zip, curl.
just run :
Code:
sudo apt-get install git-core gnupg sun-java5-jdk flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev  zlib1g-dev
 
  • Like
Reactions: FullBandwidth
Upvote 0
I followed the steps listed by visarya and it had no effect. Which is not surprising, since I don't see why installing jdk5 would have any impact on this if you already have jdk6.

The only way I can see to do this for now is to edit the makefiles by hand. I assume that breaks the "clearsilver", whatever that is.

How can google leave their build broken for so long? Something is not right here. Also when is google going to update the build instructions for froyo? The build instructions are out of date.
 
Upvote 0
So I tried everything I could find on getting this to compile when I type make, but to no avail. Perhaps someone can help me (and tell me I'm stupid if there's something already in this thread that solves it, because it looks like there ought to be, but so far nothing has worked).

Here's my output when I type make:

Code:
[james@sam]android:$ make
============================================
PLATFORM_VERSION_CODENAME=AOSP
PLATFORM_VERSION=AOSP
TARGET_PRODUCT=generic
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=OPENMASTER
============================================
Docs droiddoc: out/target/common/docs/api-stubs
Could not load 'clearsilver-jni'
java.library.path = out/host/linux-x86/lib
make: *** [out/target/common/docs/api-stubs-timestamp] Error 45
[james@sam]android:$
This looks familiar to me, from the thread above. I've included a few other bits, so you can have a better idea of what's going on here:
Code:
[james@sam]android:$ java -version
java version "1.5.0_19"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_19-b02)
Java HotSpot(TM) Server VM (build 1.5.0_19-b02, mixed mode)
[james@sam]android:$ javac -version
javac 1.5.0_19
javac: no source files
Usage: javac <options> <source files> ...
As far as I can tell, this is how things should be, no? Everything seems to point to needing Sun's jdk 1.5 - let me know if this has changed?

Also, just in case it's important:

Code:
[james@sam]android:$ uname -m
i686
So I'm sure I'm running 32-bit.

I really hope there's something obvious I'm missing? (I appreciate people for even reading this, let alone helping!)

Cheers
 
Upvote 0
i tried what u said....i reached till here....

akilesh@akilesh-laptop:~$ sudo update-java-alternatives -s java-1.5.0-sun
update-alternatives: error: no alternatives for firefox-javaplugin.so.
update-alternatives: error: no alternatives for iceape-javaplugin.so.
update-alternatives: error: no alternatives for iceweasel-javaplugin.so.
update-alternatives: error: no alternatives for midbrowser-javaplugin.so.
update-alternatives: error: no alternatives for mozilla-javaplugin.so.
update-alternatives: error: no alternatives for xulrunner-1.9-javaplugin.so.
update-alternatives: error: no alternatives for xulrunner-javaplugin.so.
update-alternatives: error: no alternatives for firefox-javaplugin.so.
update-alternatives: error: no alternatives for iceape-javaplugin.so.
update-alternatives: error: no alternatives for iceweasel-javaplugin.so.
update-alternatives: error: no alternatives for midbrowser-javaplugin.so.
update-alternatives: error: no alternatives for mozilla-javaplugin.so.
update-alternatives: error: no alternatives for xulrunner-1.9-javaplugin.so.
update-alternatives: error: no alternatives for xulrunner-javaplugin.so.
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones