Ubuntu 10.04-Android Open Source Make Error


Last Updated:

  1. Trust-No-1

    Trust-No-1 Member This Topic's Starter

    Joined:
    Jul 5, 2010
    Messages:
    10
    Likes Received:
    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 (Text):
    1. hamish@hamish-laptop:~/mydroid$ make
    2. ============================================
    3. PLATFORM_VERSION_CODENAME=AOSP
    4. PLATFORM_VERSION=AOSP
    5. TARGET_PRODUCT=generic
    6. TARGET_BUILD_VARIANT=eng
    7. TARGET_SIMULATOR=
    8. TARGET_BUILD_TYPE=release
    9. TARGET_BUILD_APPS=
    10. TARGET_ARCH=arm
    11. HOST_ARCH=x86
    12. HOST_OS=linux
    13. HOST_BUILD_TYPE=release
    14. BUILD_ID=OPENMASTER
    15. ============================================
    16. Install: out/host/linux-x86/framework/apicheck.jar
    17. Install: out/host/linux-x86/framework/clearsilver.jar
    18. Install: out/host/linux-x86/framework/droiddoc.jar
    19. host C: libclearsilver-jni <= external/clearsilver/java-jni/j_neo_util.c
    20. In file included from /usr/include/features.h:378,
    21.                  from /usr/include/string.h:26,
    22.                  from external/clearsilver/java-jni/j_neo_util.c:1:
    23. /usr/include/gnu/stubs.h:9:27: error: gnu/stubs-64.h: No such file or directory
    24. 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 (Text):
    1. amish@hamish-laptop:~/mydroid$ make
    2. ============================================
    3. PLATFORM_VERSION_CODENAME=AOSP
    4. PLATFORM_VERSION=AOSP
    5. TARGET_PRODUCT=generic
    6. TARGET_BUILD_VARIANT=eng
    7. TARGET_SIMULATOR=
    8. TARGET_BUILD_TYPE=release
    9. TARGET_BUILD_APPS=
    10. TARGET_ARCH=arm
    11. HOST_ARCH=x86
    12. HOST_OS=linux
    13. HOST_BUILD_TYPE=release
    14. BUILD_ID=OPENMASTER
    15. ============================================
    16. Install: out/host/linux-x86/framework/apicheck.jar
    17. Install: out/host/linux-x86/framework/clearsilver.jar
    18. Install: out/host/linux-x86/framework/droiddoc.jar
    19. host C: libclearsilver-jni <= external/clearsilver/java-jni/j_neo_util.c
    20. target Generated: libclearsilver-jni <= out/host/common/obj/JAVA_LIBRARIES/clearsilver_intermediates/javalib.jar
    21. host C: libclearsilver-jni <= external/clearsilver/java-jni/j_neo_cs.c
    22. host C: libneo_util <= external/clearsilver/util/neo_err.c
    23. host C: libneo_util <= external/clearsilver/util/neo_files.c
    24. host C: libneo_util <= external/clearsilver/util/neo_misc.c
    25. host C: libneo_util <= external/clearsilver/util/neo_rand.c
    26. host C: libneo_util <= external/clearsilver/util/ulist.c
    27. host C: libneo_util <= external/clearsilver/util/neo_hdf.c
    28. host C: libneo_util <= external/clearsilver/util/neo_str.c
    29. host C: libneo_util <= external/clearsilver/util/neo_date.c
    30. host C: libneo_util <= external/clearsilver/util/wildmat.c
    31. host C: libneo_util <= external/clearsilver/util/ulocks.c
    32. host C: libneo_util <= external/clearsilver/util/neo_hash.c
    33. host SharedLib: libneo_util (out/host/linux-x86/obj/lib/libneo_util.so)
    34. /usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/libstdc++.so when searching for -lstdc++
    35. /usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/libstdc++.a when searching for -lstdc++
    36. /usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/libstdc++.so when searching for -lstdc++
    37. /usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/libstdc++.a when searching for -lstdc++
    38. /usr/bin/ld: cannot find -lstdc++
    39. collect2: ld returned 1 exit status
    40. make: *** [out/host/linux-x86/obj/lib/libneo_util.so] Error 1
    Ok, so i ran:
    Code (Text):
    1. hamish@hamish-laptop:~/mydroid$ sudo ln -s /usr/lib/libstdc++.so.5.0.7 /usr/lib/libstdc++.so
    and got this output:
    Code (Text):
    1. amish@hamish-laptop:~/mydroid$ make
    2. ============================================
    3. PLATFORM_VERSION_CODENAME=AOSP
    4. PLATFORM_VERSION=AOSP
    5. TARGET_PRODUCT=generic
    6. TARGET_BUILD_VARIANT=eng
    7. TARGET_SIMULATOR=
    8. TARGET_BUILD_TYPE=release
    9. TARGET_BUILD_APPS=
    10. TARGET_ARCH=arm
    11. HOST_ARCH=x86
    12. HOST_OS=linux
    13. HOST_BUILD_TYPE=release
    14. BUILD_ID=OPENMASTER
    15. ============================================
    16. Install: out/host/linux-x86/framework/apicheck.jar
    17. Install: out/host/linux-x86/framework/clearsilver.jar
    18. Install: out/host/linux-x86/framework/droiddoc.jar
    19. host SharedLib: libneo_util (out/host/linux-x86/obj/lib/libneo_util.so)
    20. /usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/libstdc++.so when searching for -lstdc++
    21. /usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/libstdc++.a when searching for -lstdc++
    22. /usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/libstdc++.so when searching for -lstdc++
    23. /usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/libstdc++.a when searching for -lstdc++
    24. /usr/bin/ld: cannot find -lstdc++
    25. collect2: ld returned 1 exit status
    26. make: *** [out/host/linux-x86/obj/lib/libneo_util.so] Error 1
    Im lost, any solutions?
     

    Advertisement
  2. IanGClifton

    IanGClifton Well-Known Member

    Joined:
    Feb 7, 2010
    Messages:
    111
    Likes Received:
    19
    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.
     
    Trust-No-1 likes this.
  3. Trust-No-1

    Trust-No-1 Member This Topic's Starter

    Joined:
    Jul 5, 2010
    Messages:
    10
    Likes Received:
    0
    Hi,
    Thanks heaps for your reply.
    I did what you said, and got this output:
    Code (Text):
    1. host C: acp <= build/tools/acp/acp.c
    2. host C++: libhost <= build/libs/host/pseudolocalize.cpp
    3. host C: libhost <= build/libs/host/CopyFile.c
    4. host StaticLib: libhost (out/host/linux-x86/obj/STATIC_LIBRARIES/libhost_intermediates/libhost.a)
    5. 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
    6. host Executable: acp (out/host/linux-x86/obj/EXECUTABLES/acp_intermediates/acp)
    7. true
    8. Install: out/host/linux-x86/bin/acp
    9. Install: out/host/linux-x86/framework/apicheck.jar
    10. host Java: clearsilver (out/host/common/obj/JAVA_LIBRARIES/clearsilver_intermediates/classes)
    11. Install: out/host/linux-x86/framework/clearsilver.jar
    12. host Java: droiddoc (out/host/common/obj/JAVA_LIBRARIES/droiddoc_intermediates/classes)
    13. Note: Some input files use unchecked or unsafe operations.
    14. Note: Recompile with -Xlint:unchecked for details.
    15. Install: out/host/linux-x86/framework/droiddoc.jar
    16. target Generated: libclearsilver-jni <= out/host/common/obj/JAVA_LIBRARIES/clearsilver_intermediates/javalib.jar
    17. host C: libclearsilver-jni <= external/clearsilver/java-jni/j_neo_util.c
    18. target Generated: libclearsilver-jni <= out/host/common/obj/JAVA_LIBRARIES/clearsilver_intermediates/javalib.jar
    19. host C: libclearsilver-jni <= external/clearsilver/java-jni/j_neo_cs.c
    20. host C: libneo_util <= external/clearsilver/util/neo_err.c
    21. host C: libneo_util <= external/clearsilver/util/neo_files.c
    22. host C: libneo_util <= external/clearsilver/util/neo_misc.c
    23. host C: libneo_util <= external/clearsilver/util/neo_rand.c
    24. host C: libneo_util <= external/clearsilver/util/ulist.c
    25. host C: libneo_util <= external/clearsilver/util/neo_hdf.c
    26. host C: libneo_util <= external/clearsilver/util/neo_str.c
    27. host C: libneo_util <= external/clearsilver/util/neo_date.c
    28. host C: libneo_util <= external/clearsilver/util/wildmat.c
    29. host C: libneo_util <= external/clearsilver/util/ulocks.c
    30. host C: libneo_util <= external/clearsilver/util/neo_hash.c
    31. host SharedLib: libneo_util (out/host/linux-x86/obj/lib/libneo_util.so)
    32. /usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/libstdc++.so when searching for -lstdc++
    33. /usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/libstdc++.a when searching for -lstdc++
    34. /usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/libstdc++.so when searching for -lstdc++
    35. /usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/libstdc++.a when searching for -lstdc++
    36. /usr/bin/ld: cannot find -lstdc++
    37. collect2: ld returned 1 exit status
    38. make: *** [out/host/linux-x86/obj/lib/libneo_util.so] Error 1
    39.  
    Thats only the current view, not the whole text.
    Regards,
    Hamish
     
  4. IanGClifton

    IanGClifton Well-Known Member

    Joined:
    Feb 7, 2010
    Messages:
    111
    Likes Received:
    19
    Okay, now try running sudo aptitude install libstdc++-dev

    That should install the missing file.
     
  5. Trust-No-1

    Trust-No-1 Member This Topic's Starter

    Joined:
    Jul 5, 2010
    Messages:
    10
    Likes Received:
    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 (Text):
    1. /usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/libstdc++.so when searching for -lstdc++
    2. /usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/libstdc++.a when searching for -lstdc++
    3. /usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/libstdc++.so when searching for -lstdc++
    4. /usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/libstdc++.a when searching for -lstdc++
    5. /usr/bin/ld: cannot find -lstdc++
    6. collect2: ld returned 1 exit status
    7. make: *** [out/host/linux-x86/obj/lib/libneo_util.so] Error 1
    8.  
     
  6. rajd

    rajd Member

    Joined:
    Jul 7, 2010
    Messages:
    5
    Likes Received:
    4
    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.
     
    FullBandwidth likes this.
  7. rajd

    rajd Member

    Joined:
    Jul 7, 2010
    Messages:
    5
    Likes Received:
    4
    Just pasting the URL for the code again.
    android.git.kernel.org Git - platform/external/clearsilver.git/log

    Please let me know of the packages that need to be used for compiling with -m64.
    Basically what all packages are required to compile any C program when compiled with -m64 option with GCC (gcc -m64). The compilation is done on a 32 bit Ubuntu machine.
     
  8. Trust-No-1

    Trust-No-1 Member This Topic's Starter

    Joined:
    Jul 5, 2010
    Messages:
    10
    Likes Received:
    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 *************.
    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
     
  9. Trust-No-1

    Trust-No-1 Member This Topic's Starter

    Joined:
    Jul 5, 2010
    Messages:
    10
    Likes Received:
    0
    Sorry for double post, Is it possible for me to get a copy of the code before the change you mentioned, if so, how? Im new with GIT, so yeah :)
    Regards,
    Hamish
     
  10. rajd

    rajd Member

    Joined:
    Jul 7, 2010
    Messages:
    5
    Likes Received:
    4
    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.
     
  11. Scottmc

    Scottmc Well-Known Member

    Joined:
    Jun 21, 2010
    Messages:
    84
    Likes Received:
    29
    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.
     
  12. rajd

    rajd Member

    Joined:
    Jul 7, 2010
    Messages:
    5
    Likes Received:
    4
    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
     
  13. Trust-No-1

    Trust-No-1 Member This Topic's Starter

    Joined:
    Jul 5, 2010
    Messages:
    10
    Likes Received:
    0
    No, Im a 32-Bit Ubuntu 10.04

    i) Ubuntu Desktop 10.04 32-bit
    ii) Yes, I repo Synched, so, latest version
    iii)Java Version:
    Code (Text):
    1. hamish@hamish-laptop:~$ java -version
    2. java version "1.6.0_18"
    3. OpenJDK Runtime Environment (IcedTea6 1.8) (6b18-1.8-0ubuntu1)
    4. OpenJDK Client VM (build 14.0-b16, mixed mode, sharing)
    5. hamish@hamish-laptop:~$
    Where do I find the mk file?
    I also installed those packages and got this output:
    Code (Text):
    1. host SharedLib: libneo_cgi (out/host/linux-x86/obj/lib/libneo_cgi.so)
    2. /usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/../../../libz.so when searching for -lz
    3. /usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/../../../libz.a when searching for -lz
    4. /usr/bin/ld: skipping incompatible /usr/lib/libz.so when searching for -lz
    5. /usr/bin/ld: skipping incompatible /usr/lib/libz.a when searching for -lz
    6. /usr/bin/ld: cannot find -lz
    7. collect2: ld returned 1 exit status
    8. make: *** [out/host/linux-x86/obj/lib/libneo_cgi.so] Error 1
    9.  
     
  14. rajd

    rajd Member

    Joined:
    Jul 7, 2010
    Messages:
    5
    Likes Received:
    4
    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.
     
    FullBandwidth, grennis and Trust-No-1 like this.
  15. Trust-No-1

    Trust-No-1 Member This Topic's Starter

    Joined:
    Jul 5, 2010
    Messages:
    10
    Likes Received:
    0
    I csnt find that section, the bit that forces the 64-bit build.
    Here is the contents of my mk file:
    Code (Text):
    1.  
    2. # Only use ANDROID_BUILD_SHELL to wrap around bash.
    3. # DO NOT use other shells such as zsh.
    4. ifdef ANDROID_BUILD_SHELL
    5. SHELL := $(ANDROID_BUILD_SHELL)
    6. else
    7. # Use bash, not whatever shell somebody has installed as /bin/sh
    8. # This is repeated in config.mk, since envsetup.sh runs that file
    9. # directly.
    10. SHELL := /bin/bash
    11. endif
    12.  
    13. # this turns off the suffix rules built into make
    14. .SUFFIXES:
    15.  
    16. # If a rule fails, delete $@.
    17. .DELETE_ON_ERROR:
    18.  
    19. # Figure out where we are.
    20. #TOP := $(dir $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)))
    21. #TOP := $(patsubst %/,%,$(TOP))
    22.  
    23. # TOPDIR is the normal variable you should use, because
    24. # if we are executing relative to the current directory
    25. # it can be "", whereas TOP must be "." which causes
    26. # pattern matching probles when make strips off the
    27. # trailing "./" from paths in various places.
    28. #ifeq ($(TOP),.)
    29. #TOPDIR :=
    30. #else
    31. #TOPDIR := $(TOP)/
    32. #endif
    33.  
    34. # check for broken versions of make
    35. ifeq (0,$(shell expr $$(echo $(MAKE_VERSION) | sed "s/[^0-9\.].*//") \>= 3.81))
    36. $(warning ********************************************************************************)
    37. $(warning *  You are using version $(MAKE_VERSION) of make.)
    38. $(warning *  You must upgrade to version 3.81 or greater.)
    39. $(warning *  see http://source.android.com/download)
    40. $(warning ********************************************************************************)
    41. $(error stopping)
    42. endif
    43.  
    44. TOP := .
    45. TOPDIR :=
    46.  
    47. BUILD_SYSTEM := $(TOPDIR)build/core
    48.  
    49. # This is the default target.  It must be the first declared target.
    50. .PHONY: droid
    51. DEFAULT_GOAL := droid
    52. $(DEFAULT_GOAL):
    53.  
    54. # Set up various standard variables based on configuration
    55. # and host information.
    56. include $(BUILD_SYSTEM)/config.mk
    57.  
    58. # This allows us to force a clean build - included after the config.make
    59. # environment setup is done, but before we generate any dependencies.  This
    60. # file does the rm -rf inline so the deps which are all done below will
    61. # be generated correctly
    62. include $(BUILD_SYSTEM)/cleanbuild.mk
    63.  
    64. VERSION_CHECK_SEQUENCE_NUMBER := 1
    65. -include $(OUT_DIR)/versions_checked.mk
    66. ifneq ($(VERSION_CHECK_SEQUENCE_NUMBER),$(VERSIONS_CHECKED))
    67.  
    68. $(info Checking build tools versions...)
    69.  
    70. ifneq ($(HOST_OS),windows)
    71. ifneq ($(HOST_OS)-$(HOST_ARCH),darwin-ppc)
    72. # check for a case sensitive file system
    73. ifneq (a,$(shell mkdir -p $(OUT_DIR) ; \
    74.                 echo a > $(OUT_DIR)/casecheck.txt; \
    75.                     echo B > $(OUT_DIR)/CaseCheck.txt; \
    76.                 cat $(OUT_DIR)/casecheck.txt))
    77. $(warning ************************************************************)
    78. $(warning You are building on a case-insensitive filesystem.)
    79. $(warning Please move your source tree to a case-sensitive filesystem.)
    80. $(warning ************************************************************)
    81. $(error Case-insensitive filesystems not supported)
    82. endif
    83. endif
    84. endif
    85.  
    86. # Make sure that there are no spaces in the absolute path; the
    87. # build system can't deal with them.
    88. ifneq ($(words $(shell pwd)),1)
    89. $(warning ************************************************************)
    90. $(warning You are building in a directory whose absolute path contains)
    91. $(warning a space character:)
    92. $(warning $(space))
    93. $(warning "$(shell pwd)")
    94. $(warning $(space))
    95. $(warning Please move your source tree to a path that does not contain)
    96. $(warning any spaces.)
    97. $(warning ************************************************************)
    98. $(error Directory names containing spaces not supported)
    99. endif
    100.  
    101.  
    102. # Check for the correct version of java
    103. java_version := $(shell java -version 2>&1 | head -n 1 | grep '[ "]1\.6[\. "$$]')
    104. ifeq ($(strip $(java_version)),)
    105. $(info ************************************************************)
    106. $(info You are attempting to build with the incorrect version)
    107. $(info of java.)
    108. $(info $(space))
    109. $(info Your version is: $(shell java -version 2>&1 | head -n 1).)
    110. $(info The correct version is: 1.6.)
    111. $(info $(space))
    112. $(info Please follow the machine setup instructions at)
    113. $(info $(space)$(space)$(space)$(space)http://source.android.com/download)
    114. $(info ************************************************************)
    115. $(error stop)
    116. endif
    117.  
    118. # Check for the correct version of javac
    119. javac_version := $(shell javac -version 2>&1 | head -n 1 | grep '[ "]1\.6[\. "$$]')
    120. ifeq ($(strip $(javac_version)),)
    121. $(info ************************************************************)
    122. $(info You are attempting to build with the incorrect version)
    123. $(info of javac.)
    124. $(info $(space))
    125. $(info Your version is: $(shell javac -version 2>&1 | head -n 1).)
    126. $(info The correct version is: 1.6.)
    127. $(info $(space))
    128. $(info Please follow the machine setup instructions at)
    129. $(info $(space)$(space)$(space)$(space)http://source.android.com/download)
    130. $(info ************************************************************)
    131. $(error stop)
    132. endif
    133.  
    134. $(shell echo 'VERSIONS_CHECKED := $(VERSION_CHECK_SEQUENCE_NUMBER)' \
    135.         > $(OUT_DIR)/versions_checked.mk)
    136. endif
    137.  
    138. # These are the modifier targets that don't do anything themselves, but
    139. # change the behavior of the build.
    140. # (must be defined before including definitions.make)
    141. INTERNAL_MODIFIER_TARGETS := showcommands checkbuild
    142.  
    143. # Bring in standard build system definitions.
    144. include $(BUILD_SYSTEM)/definitions.mk
    145.  
    146. ifneq ($(filter eng user userdebug tests,$(MAKECMDGOALS)),)
    147. $(info ***************************************************************)
    148. $(info ***************************************************************)
    149. $(info Don't pass '$(filter eng user userdebug tests,$(MAKECMDGOALS))' on \
    150.         the make command line.)
    151. # XXX The single quote on this line fixes gvim's syntax highlighting.
    152. # Without which, the rest of this file is impossible to read.
    153. $(info Set TARGET_BUILD_VARIANT in buildspec.mk, or use lunch or)
    154. $(info choosecombo.)
    155. $(info ***************************************************************)
    156. $(info ***************************************************************)
    157. $(error stopping)
    158. endif
    159.  
    160. ifneq ($(filter-out $(INTERNAL_VALID_VARIANTS),$(TARGET_BUILD_VARIANT)),)
    161. $(info ***************************************************************)
    162. $(info ***************************************************************)
    163. $(info Invalid variant: $(TARGET_BUILD_VARIANT)
    164. $(info Valid values are: $(INTERNAL_VALID_VARIANTS)
    165. $(info ***************************************************************)
    166. $(info ***************************************************************)
    167. $(error stopping)
    168. endif
    169.  
    170. ###
    171. ### In this section we set up the things that are different
    172. ### between the build variants
    173. ###
    174.  
    175. is_sdk_build :=
    176. ifneq ($(filter sdk,$(MAKECMDGOALS)),)
    177. is_sdk_build := true
    178. endif
    179. ifneq ($(filter win_sdk,$(MAKECMDGOALS)),)
    180. is_sdk_build := true
    181. endif
    182. ifneq ($(filter sdk_addon,$(MAKECMDGOALS)),)
    183. is_sdk_build := true
    184. endif
    185.  
    186.  
    187. ## user/userdebug ##
    188.  
    189. user_variant := $(filter userdebug user,$(TARGET_BUILD_VARIANT))
    190. enable_target_debugging := true
    191. ifneq (,$(user_variant))
    192.   # Target is secure in user builds.
    193.   ADDITIONAL_DEFAULT_PROPERTIES += ro.secure=1
    194.  
    195.   tags_to_install := user
    196.   ifeq ($(user_variant),userdebug)
    197.     # Pick up some extra useful tools
    198.     tags_to_install += debug
    199.  
    200.     # Enable Dalvik lock contention logging for userdebug builds.
    201.     ADDITIONAL_BUILD_PROPERTIES += dalvik.vm.lockprof.threshold=500
    202.   else
    203.     # Disable debugging in plain user builds.
    204.     enable_target_debugging :=
    205.   endif
    206.  
    207.   # TODO: Always set WITH_DEXPREOPT (for user builds) once it works on OSX.
    208.   # Also, remove the corresponding block in config/product_config.make.
    209.   ifeq ($(HOST_OS)-$(WITH_DEXPREOPT_buildbot),linux-true)
    210.     WITH_DEXPREOPT := true
    211.   endif
    212.  
    213.   # Disallow mock locations by default for user builds
    214.   ADDITIONAL_DEFAULT_PROPERTIES += ro.allow.mock.location=0
    215.  
    216. else # !user_variant
    217.   # Turn on checkjni for non-user builds.
    218.   ADDITIONAL_BUILD_PROPERTIES += ro.kernel.android.checkjni=1
    219.   # Set device insecure for non-user builds.
    220.   ADDITIONAL_DEFAULT_PROPERTIES += ro.secure=0
    221.   # Allow mock locations by default for non user builds
    222.   ADDITIONAL_DEFAULT_PROPERTIES += ro.allow.mock.location=1
    223. endif # !user_variant
    224.  
    225. ifeq (true,$(strip $(enable_target_debugging)))
    226.   # Target is more debuggable and adbd is on by default
    227.   ADDITIONAL_DEFAULT_PROPERTIES += ro.debuggable=1 persist.service.adb.enable=1
    228.   # Include the debugging/testing OTA keys in this build.
    229.   INCLUDE_TEST_OTA_KEYS := true
    230. else # !enable_target_debugging
    231.   # Target is less debuggable and adbd is off by default
    232.   ADDITIONAL_DEFAULT_PROPERTIES += ro.debuggable=0 persist.service.adb.enable=0
    233. endif # !enable_target_debugging
    234.  
    235. ## eng ##
    236.  
    237. ifeq ($(TARGET_BUILD_VARIANT),eng)
    238. tags_to_install := user debug eng
    239.   # Don't require the setup wizard on eng builds
    240.   ADDITIONAL_BUILD_PROPERTIES := $(filter-out ro.setupwizard.mode=%,\
    241.           $(call collapse-pairs, $(ADDITIONAL_BUILD_PROPERTIES))) \
    242.           ro.setupwizard.mode=OPTIONAL
    243. endif
    244.  
    245. ## tests ##
    246.  
    247. ifeq ($(TARGET_BUILD_VARIANT),tests)
    248. tags_to_install := user debug eng tests
    249. endif
    250.  
    251. ## sdk ##
    252.  
    253. ifdef is_sdk_build
    254. ifneq ($(words $(filter-out $(INTERNAL_MODIFIER_TARGETS),$(MAKECMDGOALS))),1)
    255. $(error The 'sdk' target may not be specified with any other targets)
    256. endif
    257.  
    258. # TODO: this should be eng I think.  Since the sdk is built from the eng
    259. # variant.
    260. tags_to_install := user debug eng
    261. ADDITIONAL_BUILD_PROPERTIES += xmpp.auto-presence=true
    262. ADDITIONAL_BUILD_PROPERTIES += ro.config.nocheckin=yes
    263. else # !sdk
    264. endif
    265.  
    266. # build the full stagefright library
    267. ifneq ($(strip BUILD_WITH_FULL_STAGEFRIGHT),)
    268. BUILD_WITH_FULL_STAGEFRIGHT := true
    269. endif
    270.  
    271. ## precise GC ##
    272.  
    273. ifneq ($(filter dalvik.gc.type-precise,$(PRODUCT_TAGS)),)
    274.   # Enabling type-precise GC results in larger optimized DEX files.  The
    275.   # additional storage requirements for ".odex" files can cause /system
    276.   # to overflow on some devices, so this is configured separately for
    277.   # each product.
    278.   ADDITIONAL_BUILD_PROPERTIES += dalvik.vm.dexopt-flags=m=y
    279. endif
    280.  
    281. # Install an apns-conf.xml file if one's not already being installed.
    282. ifeq (,$(filter %:system/etc/apns-conf.xml, $(PRODUCT_COPY_FILES)))
    283.   PRODUCT_COPY_FILES += \
    284.         development/data/etc/apns-conf_sdk.xml:system/etc/apns-conf.xml
    285.   ifeq ($(filter eng tests,$(TARGET_BUILD_VARIANT)),)
    286.     $(warning implicitly installing apns-conf_sdk.xml)
    287.   endif
    288. endif
    289. # If we're on an eng or tests build, but not on the sdk, and we have
    290. # a better one, use that instead.
    291. ifneq ($(filter eng tests,$(TARGET_BUILD_VARIANT)),)
    292.   ifndef is_sdk_build
    293.     apns_to_use := $(wildcard vendor/google/etc/apns-conf.xml)
    294.     ifneq ($(strip $(apns_to_use)),)
    295.       PRODUCT_COPY_FILES := \
    296.             $(filter-out %:system/etc/apns-conf.xml,$(PRODUCT_COPY_FILES)) \
    297.             $(strip $(apns_to_use)):system/etc/apns-conf.xml
    298.     endif
    299.   endif
    300. endif
    301.  
    302. ADDITIONAL_BUILD_PROPERTIES += net.bt.name=Android
    303.  
    304. # enable vm tracing in files for now to help track
    305. # the cause of ANRs in the content process
    306. ADDITIONAL_BUILD_PROPERTIES += dalvik.vm.stack-trace-file=/data/anr/traces.txt
    307.  
    308. # ------------------------------------------------------------
    309. # Define a function that, given a list of module tags, returns
    310. # non-empty if that module should be installed in /system.
    311.  
    312. # For most goals, anything not tagged with the "tests" tag should
    313. # be installed in /system.
    314. define should-install-to-system
    315. $(if $(filter tests,$(1)),,true)
    316. endef
    317.  
    318. ifdef is_sdk_build
    319. # For the sdk goal, anything with the "samples" tag should be
    320. # installed in /data even if that module also has "eng"/"debug"/"user".
    321. define should-install-to-system
    322. $(if $(filter samples tests,$(1)),,true)
    323. endef
    324. endif
    325.  
    326.  
    327. # If they only used the modifier goals (showcommands, checkbuild), we'll actually
    328. # build the default target.
    329. ifeq ($(filter-out $(INTERNAL_MODIFIER_TARGETS),$(MAKECMDGOALS)),)
    330. .PHONY: $(INTERNAL_MODIFIER_TARGETS)
    331. $(INTERNAL_MODIFIER_TARGETS): $(DEFAULT_GOAL)
    332. endif
    333.  
    334. # These targets are going to delete stuff, don't bother including
    335. # the whole directory tree if that's all we're going to do
    336. ifeq ($(MAKECMDGOALS),clean)
    337. dont_bother := true
    338. endif
    339. ifeq ($(MAKECMDGOALS),clobber)
    340. dont_bother := true
    341. endif
    342. ifeq ($(MAKECMDGOALS),dataclean)
    343. dont_bother := true
    344. endif
    345. ifeq ($(MAKECMDGOALS),installclean)
    346. dont_bother := true
    347. endif
    348.  
    349. # Bring in all modules that need to be built.
    350. ifneq ($(dont_bother),true)
    351.  
    352. ifeq ($(HOST_OS)-$(HOST_ARCH),darwin-ppc)
    353. SDK_ONLY := true
    354. $(info Building the SDK under darwin-ppc is actually obsolete and unsupported.)
    355. $(error stop)
    356. endif
    357.  
    358. ifeq ($(HOST_OS),windows)
    359. SDK_ONLY := true
    360. endif
    361.  
    362. ifeq ($(SDK_ONLY),true)
    363.  
    364. # ----- SDK for Windows ------
    365. # These configure the build targets that are available for the SDK under Windows.
    366. # The first section defines all the C/C++ tools that can be compiled in C/C++,
    367. # the second section defines all the Java ones (assuming javac is available.)
    368.  
    369. subdirs := \
    370.     prebuilt \
    371.     build/libs/host \
    372.     build/tools/zipalign \
    373.     dalvik/dexdump \
    374.     dalvik/libdex \
    375.     dalvik/tools/dmtracedump \
    376.     dalvik/tools/hprof-conv \
    377.     development/tools/line_endings \
    378.     development/tools/etc1tool \
    379.     sdk/emulator/mksdcard \
    380.     sdk/sdklauncher \
    381.     development/host \
    382.     external/expat \
    383.     external/libpng \
    384.     external/qemu \
    385.     external/sqlite/dist \
    386.     external/zlib \
    387.     frameworks/base \
    388.     system/core/adb \
    389.     system/core/fastboot \
    390.     system/core/libcutils \
    391.     system/core/liblog \
    392.     system/core/libzipfile
    393.  
    394. # The following can only be built if "javac" is available.
    395. # This check is used when building parts of the SDK under Cygwin.
    396. ifneq (,$(shell which javac 2>/dev/null))
    397. subdirs += \
    398.     build/tools/signapk \
    399.     dalvik/dx \
    400.     libcore \
    401.     sdk/archquery \
    402.     sdk/androidprefs \
    403.     sdk/apkbuilder \
    404.     sdk/jarutils \
    405.     sdk/layoutlib_api \
    406.     sdk/layoutlib_utils \
    407.     sdk/ninepatch \
    408.     sdk/sdkstats \
    409.     sdk/sdkmanager \
    410.     sdk/layoutopt \
    411.     sdk/ddms \
    412.     development/apps \
    413.     development/tools/mkstubs \
    414.     packages
    415. else
    416. $(warning SDK_ONLY: javac not available.)
    417. endif
    418.  
    419. # Exclude tools/acp when cross-compiling windows under linux
    420. ifeq ($(findstring Linux,$(UNAME)),)
    421. subdirs += build/tools/acp
    422. endif
    423.  
    424. else    # !SDK_ONLY
    425. ifeq ($(BUILD_TINY_ANDROID), true)
    426.  
    427. # TINY_ANDROID is a super-minimal build configuration, handy for board
    428. # bringup and very low level debugging
    429.  
    430. subdirs := \
    431.     bionic \
    432.     system/core \
    433.     build/libs \
    434.     build/target \
    435.     build/tools/acp \
    436.     build/tools/apriori \
    437.     build/tools/kcm \
    438.     build/tools/soslim \
    439.     external/elfcopy \
    440.     external/elfutils \
    441.     external/yaffs2 \
    442.     external/zlib
    443. else    # !BUILD_TINY_ANDROID
    444.  
    445. #
    446. # Typical build; include any Android.mk files we can find.
    447. #
    448. subdirs := $(TOP)
    449.  
    450. FULL_BUILD := true
    451.  
    452. endif   # !BUILD_TINY_ANDROID
    453.  
    454. endif   # !SDK_ONLY
    455.  
    456. ifneq ($(ONE_SHOT_MAKEFILE),)
    457. # We've probably been invoked by the "mm" shell function
    458. # with a subdirectory's makefile.
    459. include $(ONE_SHOT_MAKEFILE)
    460. # Change CUSTOM_MODULES to include only modules that were
    461. # defined by this makefile; this will install all of those
    462. # modules as a side-effect.  Do this after including ONE_SHOT_MAKEFILE
    463. # so that the modules will be installed in the same place they
    464. # would have been with a normal make.
    465. CUSTOM_MODULES := $(sort $(call get-tagged-modules,$(ALL_MODULE_TAGS)))
    466. FULL_BUILD :=
    467. # Stub out the notice targets, which probably aren't defined
    468. # when using ONE_SHOT_MAKEFILE.
    469. NOTICE-HOST-%: ;
    470. NOTICE-TARGET-%: ;
    471.  
    472. else # ONE_SHOT_MAKEFILE
    473.  
    474. #
    475. # Include all of the makefiles in the system
    476. #
    477.  
    478. # Can't use first-makefiles-under here because
    479. # --mindepth=2 makes the prunes not work.
    480. subdir_makefiles := \
    481.     $(shell build/tools/findleaves.py --prune=out --prune=.repo --prune=.git $(subdirs) Android.mk)
    482.  
    483. include $(subdir_makefiles)
    484. endif # ONE_SHOT_MAKEFILE
    485.  
    486. # -------------------------------------------------------------------
    487. # All module makefiles have been included at this point.
    488. # -------------------------------------------------------------------
    489.  
    490. # -------------------------------------------------------------------
    491. # Include any makefiles that must happen after the module makefiles
    492. # have been included.
    493. # TODO: have these files register themselves via a global var rather
    494. # than hard-coding the list here.
    495. ifdef FULL_BUILD
    496.   # Only include this during a full build, otherwise we can't be
    497.   # guaranteed that any policies were included.
    498.   -include frameworks/policies/base/PolicyConfig.mk
    499. endif
    500.  
    501. # -------------------------------------------------------------------
    502. # Fix up CUSTOM_MODULES to refer to installed files rather than
    503. # just bare module names.  Leave unknown modules alone in case
    504. # they're actually full paths to a particular file.
    505. known_custom_modules := $(filter $(ALL_MODULES),$(CUSTOM_MODULES))
    506. unknown_custom_modules := $(filter-out $(ALL_MODULES),$(CUSTOM_MODULES))
    507. CUSTOM_MODULES := \
    508.     $(call module-installed-files,$(known_custom_modules)) \
    509.     $(unknown_custom_modules)
    510.  
    511. # -------------------------------------------------------------------
    512. # Define dependencies for modules that require other modules.
    513. # This can only happen now, after we've read in all module makefiles.
    514. #
    515. # TODO: deal with the fact that a bare module name isn't
    516. # unambiguous enough.  Maybe declare short targets like
    517. # APPS:Quake or HOST:SHARED_LIBRARIES:libutils.
    518. # BUG: the system image won't know to depend on modules that are
    519. # brought in as requirements of other modules.
    520. define add-required-deps
    521. $(1): $(2)
    522. endef
    523. $(foreach m,$(ALL_MODULES), \
    524.   $(eval r := $(ALL_MODULES.$(m).REQUIRED)) \
    525.   $(if $(r), \
    526.     $(eval r := $(call module-installed-files,$(r))) \
    527.     $(eval $(call add-required-deps,$(ALL_MODULES.$(m).INSTALLED),$(r))) \
    528.    ) \
    529.  )
    530. m :=
    531. r :=
    532. add-required-deps :=
    533.  
    534. # -------------------------------------------------------------------
    535. # Figure out our module sets.
    536.  
    537. # Of the modules defined by the component makefiles,
    538. # determine what we actually want to build.
    539. Default_MODULES := $(sort $(ALL_DEFAULT_INSTALLED_MODULES) \
    540.                           $(CUSTOM_MODULES))
    541. # TODO: Remove the 3 places in the tree that use
    542. # ALL_DEFAULT_INSTALLED_MODULES and get rid of it from this list.
    543.  
    544. ifdef FULL_BUILD
    545.   # The base list of modules to build for this product is specified
    546.   # by the appropriate product definition file, which was included
    547.   # by product_config.make.
    548.   user_PACKAGES := $(call module-installed-files, \
    549.                        $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES))
    550.   ifeq (0,1)
    551.     $(info user packages for $(TARGET_DEVICE) ($(INTERNAL_PRODUCT)):)
    552.     $(foreach p,$(user_PACKAGES),$(info :   $(p)))
    553.     $(error done)
    554.   endif
    555. else
    556.   # We're not doing a full build, and are probably only including
    557.   # a subset of the module makefiles.  Don't try to build any modules
    558.   # requested by the product, because we probably won't have rules
    559.   # to build them.
    560.   user_PACKAGES :=
    561. endif
    562. # Use tags to get the non-APPS user modules.  Use the product
    563. # definition files to get the APPS user modules.
    564. user_MODULES := $(sort $(call get-tagged-modules,user))
    565. user_MODULES := $(user_MODULES) $(user_PACKAGES)
    566.  
    567. eng_MODULES := $(sort $(call get-tagged-modules,eng))
    568. debug_MODULES := $(sort $(call get-tagged-modules,debug))
    569. tests_MODULES := $(sort $(call get-tagged-modules,tests))
    570.  
    571. ifeq ($(strip $(tags_to_install)),)
    572. $(error ASSERTION FAILED: tags_to_install should not be empty)
    573. endif
    574. modules_to_install := $(sort $(Default_MODULES) \
    575.           $(foreach tag,$(tags_to_install),$($(tag)_MODULES)))
    576.  
    577. # Some packages may override others using LOCAL_OVERRIDES_PACKAGES.
    578. # Filter out (do not install) any overridden packages.
    579. overridden_packages := $(call get-package-overrides,$(modules_to_install))
    580. ifdef overridden_packages
    581. #  old_modules_to_install := $(modules_to_install)
    582.   modules_to_install := \
    583.       $(filter-out $(foreach p,$(overridden_packages),$(p) %/$(p).apk), \
    584.           $(modules_to_install))
    585. endif
    586. #$(error filtered out
    587. #           $(filter-out $(modules_to_install),$(old_modules_to_install)))
    588.  
    589. # Don't include any GNU targets in the SDK.  It's ok (and necessary)
    590. # to build the host tools, but nothing that's going to be installed
    591. # on the target (including static libraries).
    592. ifdef is_sdk_build
    593.   target_gnu_MODULES := \
    594.               $(filter \
    595.                       $(TARGET_OUT_INTERMEDIATES)/% \
    596.                       $(TARGET_OUT)/% \
    597.                       $(TARGET_OUT_DATA)/%, \
    598.                               $(sort $(call get-tagged-modules,gnu)))
    599.   $(info Removing from sdk:)$(foreach d,$(target_gnu_MODULES),$(info : $(d)))
    600.   modules_to_install := \
    601.               $(filter-out $(target_gnu_MODULES),$(modules_to_install))
    602. endif
    603.  
    604.  
    605. # build/core/Makefile contains extra stuff that we don't want to pollute this
    606. # top-level makefile with.  It expects that ALL_DEFAULT_INSTALLED_MODULES
    607. # contains everything that's built during the current make, but it also further
    608. # extends ALL_DEFAULT_INSTALLED_MODULES.
    609. ALL_DEFAULT_INSTALLED_MODULES := $(modules_to_install)
    610. include $(BUILD_SYSTEM)/Makefile
    611. modules_to_install := $(sort $(ALL_DEFAULT_INSTALLED_MODULES))
    612. ALL_DEFAULT_INSTALLED_MODULES :=
    613.  
    614. endif # dont_bother
    615.  
    616. # These are additional goals that we build, in order to make sure that there
    617. # is as little code as possible in the tree that doesn't build.
    618. modules_to_check := $(foreach m,$(ALL_MODULES),$(ALL_MODULES.$(m).CHECKED))
    619.  
    620. # If you would like to build all goals, and not skip any intermediate
    621. # steps, you can pass the "all" modifier goal on the commandline.
    622. ifneq ($(filter all,$(MAKECMDGOALS)),)
    623. modules_to_check += $(foreach m,$(ALL_MODULES),$(ALL_MODULES.$(m).BUILT))
    624. endif
    625.  
    626. # for easier debugging
    627. modules_to_check := $(sort $(modules_to_check))
    628. #$(error modules_to_check $(modules_to_check))
    629.  
    630. # -------------------------------------------------------------------
    631. # This is used to to get the ordering right, you can also use these,
    632. # but they're considered undocumented, so don't complain if their
    633. # behavior changes.
    634. .PHONY: prebuilt
    635. prebuilt: $(ALL_PREBUILT)
    636.  
    637. # An internal target that depends on all copied headers
    638. # (see copy_headers.make).  Other targets that need the
    639. # headers to be copied first can depend on this target.
    640. .PHONY: all_copied_headers
    641. all_copied_headers: ;
    642.  
    643. $(ALL_C_CPP_ETC_OBJECTS): | all_copied_headers
    644.  
    645. # All the droid stuff, in directories
    646. .PHONY: files
    647. files: prebuilt \
    648.         $(modules_to_install) \
    649.         $(modules_to_check) \
    650.         $(INSTALLED_ANDROID_INFO_TXT_TARGET)
    651.  
    652. # -------------------------------------------------------------------
    653.  
    654. .PHONY: checkbuild
    655. checkbuild: $(modules_to_check)
    656.  
    657. .PHONY: ramdisk
    658. ramdisk: $(INSTALLED_RAMDISK_TARGET)
    659.  
    660. .PHONY: systemtarball
    661. systemtarball: $(INSTALLED_SYSTEMTARBALL_TARGET)
    662.  
    663. .PHONY: userdataimage
    664. userdataimage: $(INSTALLED_USERDATAIMAGE_TARGET)
    665.  
    666. .PHONY: userdatatarball
    667. userdatatarball: $(INSTALLED_USERDATATARBALL_TARGET)
    668.  
    669. .PHONY: bootimage
    670. bootimage: $(INSTALLED_BOOTIMAGE_TARGET)
    671.  
    672. ifeq ($(BUILD_TINY_ANDROID), true)
    673. INSTALLED_RECOVERYIMAGE_TARGET :=
    674. endif
    675.  
    676. # Build files and then package it into the rom formats
    677. .PHONY: droidcore
    678. droidcore: files \
    679.     systemimage \
    680.     $(INSTALLED_BOOTIMAGE_TARGET) \
    681.     $(INSTALLED_RECOVERYIMAGE_TARGET) \
    682.     $(INSTALLED_USERDATAIMAGE_TARGET) \
    683.     $(INSTALLED_FILES_FILE)
    684.  
    685. ifneq ($(TARGET_BUILD_APPS),)
    686.   # If this build is just for apps, only build apps and not the full system by default.
    687.  
    688.   unbundled_build_modules :=
    689.   ifneq ($(filter all,$(TARGET_BUILD_APPS)),)
    690.     # If they used the magic goal "all" then build all apps in the source tree.
    691.     unbundled_build_modules := $(foreach m,$(sort $(ALL_MODULES)),$(if $(filter APPS,$(ALL_MODULES.$(m).CLASS)),$(m)))
    692.   else
    693.     unbundled_build_modules := $(TARGET_BUILD_APPS)
    694.   endif
    695.  
    696.   # dist the unbundled app.
    697.   $(call dist-for-goals,apps_only, \
    698.     $(foreach m,$(unbundled_build_modules),$(ALL_MODULES.$(m).INSTALLED)) \
    699.   )
    700.  
    701. .PHONY: apps_only
    702. apps_only: $(unbundled_build_modules)
    703.  
    704. droid: apps_only
    705.  
    706. else # TARGET_BUILD_APPS
    707.   $(call dist-for-goals, droidcore, \
    708.     $(INTERNAL_UPDATE_PACKAGE_TARGET) \
    709.     $(INTERNAL_OTA_PACKAGE_TARGET) \
    710.     $(SYMBOLS_ZIP) \
    711.     $(APPS_ZIP) \
    712.     $(INTERNAL_EMULATOR_PACKAGE_TARGET) \
    713.     $(PACKAGE_STATS_FILE) \
    714.     $(INSTALLED_FILES_FILE) \
    715.     $(INSTALLED_BUILD_PROP_TARGET) \
    716.     $(BUILT_TARGET_FILES_PACKAGE) \
    717.     $(INSTALLED_ANDROID_INFO_TXT_TARGET) \
    718.    )
    719.  
    720.   # Tests are installed in userdata.img.  If we're building the tests
    721.   # variant, copy it for "make tests dist".  Also copy a zip of the
    722.   # contents of userdata.img, so that people can easily extract a
    723.   # single .apk.
    724.   ifeq ($(TARGET_BUILD_VARIANT),tests)
    725.   $(call dist-for-goals, droid, \
    726.     $(INSTALLED_USERDATAIMAGE_TARGET) \
    727.     $(BUILT_TESTS_ZIP_PACKAGE) \
    728.    )
    729.   endif
    730.  
    731. # Building a full system-- the default is to build droidcore
    732. droid: droidcore
    733.  
    734. endif # TARGET_BUILD_APPS
    735.  
    736.  
    737. .PHONY: droid tests
    738. tests: droidcore
    739.  
    740. .PHONY: docs
    741. docs: $(ALL_DOCS)
    742.  
    743. .PHONY: sdk
    744. ALL_SDK_TARGETS := $(INTERNAL_SDK_TARGET)
    745. sdk: $(ALL_SDK_TARGETS)
    746. $(call dist-for-goals,sdk, \
    747.     $(ALL_SDK_TARGETS) \
    748.     $(SYMBOLS_ZIP) \
    749.  )
    750.  
    751. .PHONY: findbugs
    752. findbugs: $(INTERNAL_FINDBUGS_HTML_TARGET) $(INTERNAL_FINDBUGS_XML_TARGET)
    753.  
    754. .PHONY: clean
    755. dirs_to_clean := \
    756.     $(PRODUCT_OUT) \
    757.     $(TARGET_COMMON_OUT_ROOT) \
    758.     $(HOST_OUT) \
    759.     $(HOST_COMMON_OUT_ROOT)
    760. clean:
    761.     @for dir in $(dirs_to_clean) ; do \
    762.         echo "Cleaning $$dir..."; \
    763.         rm -rf $$dir; \
    764.     done
    765.     @echo "Clean."; \
    766.  
    767. .PHONY: clobber
    768. clobber:
    769.     @rm -rf $(OUT_DIR)
    770.     @echo "Entire build directory removed."
    771.  
    772. # The rules for dataclean and installclean are defined in cleanbuild.mk.
    773.  
    774. #xxx scrape this from ALL_MODULE_NAME_TAGS
    775. .PHONY: modules
    776. modules:
    777.     @echo "Available sub-modules:"
    778.     @echo "$(call module-names-for-tag-list,$(ALL_MODULE_TAGS))" | \
    779.           tr -s ' ' '\n' | sort -u | $(COLUMN)
    780.  
    781. .PHONY: showcommands
    782. showcommands:
    783.     @echo >/dev/null
    784.  
     
  16. grennis

    grennis Well-Known Member

    Joined:
    Apr 9, 2010
    Messages:
    69
    Likes Received:
    4
    I am also getting this error!

    I applied the fix that rajd has suggested and it worked (edited the makefiles)

    However, this is pathetic. Why does this *&#*($ always happen on linux? I ALWAYS have this &#^%*$ even when it should be so simple.

    PATHETIC
     
  17. Trust-No-1

    Trust-No-1 Member This Topic's Starter

    Joined:
    Jul 5, 2010
    Messages:
    10
    Likes Received:
    0
    Where is that bit in the makefile, I cant find it
     
  18. Trust-No-1

    Trust-No-1 Member This Topic's Starter

    Joined:
    Jul 5, 2010
    Messages:
    10
    Likes Received:
    0
    I am trying 64-bit in VBox
     
  19. visarya

    visarya New Member

    Joined:
    Jul 11, 2010
    Messages:
    2
    Likes Received:
    1
    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 (Text):
    1.  
    2. deb http://archive.ubuntu.com/ubuntu/ jaunty multiverse
    3. deb-src http://archive.ubuntu.com/ubuntu/ jaunty multiverse
    4. deb http://archive.ubuntu.com/ubuntu/ jaunty-updates multiverse
    5. deb-src http://archive.ubuntu.com/ubuntu/ jaunty-updates multiverse
    6.  

    2.) run
    Code (Text):
    1. apt-get update
    3.) run
    Code (Text):
    1. apt-get install sun-java5-jdk
    4.) run
    Code (Text):
    1. 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 (Text):
    1. 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
     
    FullBandwidth likes this.
  20. Trust-No-1

    Trust-No-1 Member This Topic's Starter

    Joined:
    Jul 5, 2010
    Messages:
    10
    Likes Received:
    0
    Thanks, I dont know what you did, but it worked.
    Thanks you all for your help
     
  21. visarya

    visarya New Member

    Joined:
    Jul 11, 2010
    Messages:
    2
    Likes Received:
    1

    so did you run the steps i gave
     
  22. grennis

    grennis Well-Known Member

    Joined:
    Apr 9, 2010
    Messages:
    69
    Likes Received:
    4
    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.
     
  23. jelford

    jelford Guest

    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 (Text):
    1.  
    2. [james@sam]android:$ make
    3. ============================================
    4. PLATFORM_VERSION_CODENAME=AOSP
    5. PLATFORM_VERSION=AOSP
    6. TARGET_PRODUCT=generic
    7. TARGET_BUILD_VARIANT=eng
    8. TARGET_SIMULATOR=
    9. TARGET_BUILD_TYPE=release
    10. TARGET_BUILD_APPS=
    11. TARGET_ARCH=arm
    12. HOST_ARCH=x86
    13. HOST_OS=linux
    14. HOST_BUILD_TYPE=release
    15. BUILD_ID=OPENMASTER
    16. ============================================
    17. Docs droiddoc: out/target/common/docs/api-stubs
    18. Could not load 'clearsilver-jni'
    19. java.library.path = out/host/linux-x86/lib
    20. make: *** [out/target/common/docs/api-stubs-timestamp] Error 45
    21. [james@sam]android:$
    22.  
    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 (Text):
    1.  
    2. [james@sam]android:$ java -version
    3. java version "1.5.0_19"
    4. Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_19-b02)
    5. Java HotSpot(TM) Server VM (build 1.5.0_19-b02, mixed mode)
    6. [james@sam]android:$ javac -version
    7. javac 1.5.0_19
    8. javac: no source files
    9. Usage: javac <options> <source files> ...
    10.  
    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 (Text):
    1.  
    2. [james@sam]android:$ uname -m
    3. i686
    4.  
    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
     
  24. androidmod

    androidmod New Member

    Joined:
    Jul 28, 2010
    Messages:
    4
    Likes Received:
    0
    hey visarya..
    i tried what u said....no luck....didnt find package sun-java5.jdk..
    i am using ubuntu 10.04..64 bit...
     
  25. androidmod

    androidmod New Member

    Joined:
    Jul 28, 2010
    Messages:
    4
    Likes Received:
    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.
     

Share This Page

Loading...