Commit Graph

60 Commits

Author SHA1 Message Date
David 'Digit' Turner
6b913ab885 Fix toolchain scripts for Darwin and Cygwin.
Only touches download-toolchain-sources.sh and build-toolchain.sh
This does not impact the NDK build scripts themselves and is only
needed to properly package NDK release packages.
2009-12-04 17:57:36 -08:00
David 'Digit' Turner
cb96cddc77 Cleanup installed binaries before the NDK build begins.
Ensures that no stale/obsolete shared libraries are left in the
application's project path before the build.

Also fix a minor typo that made the ABI selection process not
work properly in certain cases.
2009-11-23 16:12:12 -08:00
David 'Digit' Turner
f5862d8da6 Add support for armeabi-v7a to the NDK.
This patch modifies the NDK build scripts to support the 'armeabi-v7a' ABI.
(For the record, it corresponds to Thumb-2 + FPU support, to speed up native
code on certain devices like the Droid).

To build for this ABI, the Application.mk file should use a line like:

  APP_ABI := armeabi-v7a

It is also possible to build for both 'armeabi' and 'armeabi-v7a' by using:

  APP_ABI := armeabi armeabi-v7a

This will result in the generation of two distinct shared libraries that both
will be copied to the final application package.

This is dependent on having GCC 4.4.0 prebuilt binaries under
build/prebuilt/<host>/arm-eabi-4.4.0, since gcc 4.2.1 does not support
this new ABI.

Note that this also changes the NDK to use gcc 4.4.0 by default, unless
the user defines NDK_TOOLCHAIN to 'arm-eabi-4.2.1' in its environment to
switch back to the previous one.
2009-11-20 14:07:15 -08:00
David 'Digit' Turner
69eeb8a22f Update the build-toolchain.sh script.
This patch modifies the script to be able to build all prebuilt toolchain
binaries in a single call. I.e. if passed a recent toolchain source package
generated with download-toolchain-sources.sh, then it will build both
GCC 4.2.1 and GCC 4.4.0 and place them in the final prebuilt tarball.

We need this because, while we're going to switch to gcc 4.4.0 by default
in a new version of the NDK, the 4.4.0 C++ compiler is more strict about
various constructs and might refuse to build certain sources. An option
will be given to application developers to use 4.2.1 instead, to keep their
sources building.

Other changes include:

Move all builds into a random temporary directory under /tmp by default,
unless you use --build-out=<path>.

Cleanup the build out directory on succesful build

The generated tarball is now named android-ndk-prebuilt-<date>-<host>.tar.bz2
by default, unless you use the new --release=<name> option which will replace
<date> with <name> instead.

Removal of un-needed files (e.g. info or man pages, libiberty static library,
etc..) to reduce the size of the final tarball.
2009-11-19 13:43:11 -08:00
Android (Google) Code Review
e4df0ea14b Merge change I8d8b5816 into eclair
* changes:
  Update build-toolchain.sh to be able to build gcc 4.4.0
2009-11-16 14:53:57 -08:00
David 'Digit' Turner
37e84c2056 Update build-toolchain.sh to be able to build gcc 4.4.0
Update the script used to build the prebuilt toolchain binaries.
There are now two ways to use it:

1/ As usual, just invoke it and it will download the source tarball,
   uncompress it, configure the toolchain sources, build them, then
   package the result into a 'prebuilt' tarball.

2/ Generate a new source tarball with the 'download-toolchain-sources.sh'
   script, and invoke build-toolchain.sh with the --package=<tarball>
   option.

Additionally, you can now specify --gcc-version=4.4.0 to build GCC 4.4.0
(with ARMv7 / FPU support)

The option --gdb-version=6.8 has been added but the build doesn't seem
to work yet. This will probably be fixed in the toolchain git repository
though.

This will be used to refresh the NDK with gcc 4.4.0 prebuilts and support
for armeabi-v7a soon.
2009-11-16 12:41:33 -08:00
David 'Digit' Turner
af4040476e Add a script to download and package the toolchain sources.
download-toolchain-sources.sh will download the current toolchain sources
from our git repositories then finely package them into a compressed
tarball that will later be used to rebuild the prebuilt binaries properly.

Due to the way our sources are stored in the git repository, the sources
in the tarball are laid out slightly differently than in the original toolchain
source archive used for NDK 1.6.

An upcoming patch will modify build-toolchain.sh to deal with the difference
and also allow the build of gcc-4.4.0 and gdb-6.8.
2009-11-16 11:31:33 -08:00
David 'Digit' Turner
9eff6cbfaa Add OpenGL 2.0 headers and libraries to the NDK.
This is only available for platform android-5. A sample
application will be available in a next patch.
2009-10-21 14:43:09 -07:00
David 'Digit' Turner
975491c9eb Add android-5 platform to the NDK.
For now, this is an exact copy of android-4. Another patch will
provide additionnal headers and libraries for OpenGL 2.0 plus
the relevant documentation bits and a sample app.
2009-10-21 14:31:53 -07:00
David 'Digit' Turner
b48ab64028 Allow applications to target future API levels
E.g. if an application's default.properties targets android-10
then the build system will default it to the highest supported
API level found in build/platforms (e.g. android-4 currently).
2009-10-21 10:19:07 -07:00
David 'Digit' Turner
31f23a0b9f Remove build/platforms/android-*/common directories.
There is little point to use symlinks to point to them from
android-*/arch-arm/usr/include. Besides, the zip file format doesn't
support symlinks which meant that each file was essentially
duplicated in the final release package.
2009-10-20 15:53:42 -07:00
David 'Digit' Turner
f7aa22af3c Remove bash-ism from build-ndk-sysroot.sh 2009-10-20 15:33:40 -07:00
David 'Digit' Turner
898b43fedc Refresh NDK C library headers for all platforms 2009-10-20 15:25:40 -07:00
David 'Digit' Turner
1db4662e79 Remove bash-ism from build-toolchain.sh 2009-10-15 13:29:06 -07:00
David 'Digit' Turner
854f820c24 Add --prebuilt-ndk=FILE and --no-git options to build/tools/make-release.sh script.
This is used to help people easily package experimental versions of the NDK to
test and distribute fixes and improvements. The main idea is to allow external
contributors to play with it in interesting way and share the result easily.
2009-10-14 15:39:58 -07:00
David 'Digit' Turner
cc230ba07c Ensure the version of 'awk' detected by host-setup.sh is used during the build 2009-10-01 21:27:19 -07:00
David 'Digit' Turner
a78a775332 Remove bash-specific operator from build/host-setup.sh. 2009-10-01 16:38:44 -07:00
David 'Digit' Turner
1dbeeca5c4 Fix NDK usage of libgcc.a when building shared libraries
The main idea is that libgcc.a should appear after object files and
static libraries but before depending shared libraries. This willl
force the linker to copy the libgcc.a functions required by the
generated library into the target binary, instead of relying on
what's available in libc.so and others.

This ensures maximum portability, and prevent problems in the future
when we change the toolchain, which translates to different libgcc.a
functions embedded in libc.so and other exposed native libraries.

However, this will make also generated shared libraries bigger, because
the compiler insists on generating code that depends on a bunch of C++
support functions (even when building from C sources). An increase of
about 8KB per shared library is expected.
2009-09-28 10:41:32 -07:00
David 'Digit' Turner
902706ad0d Bump release version to android-1.6_r1 2009-08-14 20:51:58 +02:00
David 'Digit' Turner
eee1675aa4 Look for Android.mk in $(APP_PROJECT_PATH)/jni by default.
This gets rid of the 'sources' directory and allows all sources
of a given Android application to be in the same directory tree
without using a symlink trick.

Note that apps/<name>/Application.mk is still required though.
A later release of the NDK will get rid of it too, but the change
is too drastic for the upcoming release.

The change moves various source files from sources into their
app/<name>/project/jni directory as well.

The whole documentation is updated to reflect the change.
2009-07-29 19:04:44 +02:00
David 'Digit' Turner
d7e5aaecd8 Add OpenGL ES headers to the android-4 platform/stable APIs. 2009-07-29 02:26:47 +02:00
David 'Digit' Turner
5c767bb977 Add android-4 sysroot and use project's default.properties to get the right target.
Note that for now, android-4 contains the same things than android-3.
Another patch will add OpenGL ES headers and libraries to it.
2009-07-29 02:26:31 +02:00
David 'Digit' Turner
73aaee4171 Add host check for nawk/gawk in build/host-setup.sh
Store the result as HOST_AWK in out/host/config.mk
2009-07-27 15:47:09 +02:00
David 'Digit' Turner
747294cc4a Fix LOCAL_CFLAGS/CPPFLAGS handling to match full Android build system.
Also improve BUILD_SYSTEM directory detection logic in build/core/main.mk
2009-07-27 12:24:58 +02:00
David 'Digit' Turner
fdc5ea243d Rename ndk/build/platforms/android-1.5 into android-3 to match API levels 2009-07-24 17:56:51 +02:00
David 'Digit' Turner
1715a1f877 Handle LOCAL_CPPFLAGS/CFLAGS/CXXFLAGS as claimed by the documentation.
The previous code did only use LOCAL_CFLAGS for both C and C++ sources.
2009-07-24 17:42:21 +02:00
David 'Digit' Turner
7ec528c5b0 Ensure LOCAL_LDLIBS is cleared by the $(CLEAR_VARS) script 2009-07-22 13:34:54 +02:00
David 'Digit' Turner
7f0688dd93 Fix compilation of assembly files (e.g. foo.S), by removing a typo. 2009-07-20 15:38:48 +02:00
David 'Digit' Turner
4f6f74019f Remove problematic case-insensitive duplicate files.
Add missing copyright/license disclaimer to build/tools/make-release.sh
Add a new tool: build/tools/find-case-duplicates.sh
2009-06-30 10:51:41 +02:00
David 'Digit' Turner
b968aa1c79 Bump release version number and speed up make-release.sh script 2009-06-29 18:00:56 +02:00
David 'Digit' Turner
6c01aba293 Add support for LOCAL_C_INCLUDES in Android.mk, to better match the Android build system. 2009-06-29 16:48:56 +02:00
David 'Digit' Turner
67d8edd65f Add support for LOCAL_ARM_MODE and .arm source file name suffix.
Also update docs/INSTALL.TXT to explain that MSys is not supported under Windows.
2009-06-29 16:44:31 +02:00
David 'Digit' Turner
a046aadf89 Fix several typos in the NDK build system that caused quite a few bugs:
- generate thumb code by default (type forced ARM generation)

- make the generation of unoptimized binaries with APP_OPTIM := debug actually work
  (the -O0 -g flags were placed before the -Os -mthumb flags for thumb binaries)

- factor common code from build-executable/shared-library/static-library into build-binary.mk
  and install-binary.mk

- properly add a -L$(SYSROOT)/usr/lib line to make LOCAL_LDLIBS := -lz work as advertized
  (in build-binary.mk)

- add a few missing variables from clear-vars.mk
2009-06-29 16:33:30 +02:00
David 'Digit' Turner
d6ec1729a1 Fix build/host-setup.sh to run as a Bourne shell script and add better host detection:
- add --help, --verbose options
- check for GNU Make availability and version by default, override with --no-make-check
- better traces
2009-06-29 16:13:25 +02:00
David 'Digit' Turner
fadee81099 Fix build/host-setup.sh in various ways
- run as bash script (since Debian's new 'dash' shell doesn't support it)
- remove obsolete host GCC requirement
- improve Windows support by using better heuristics for the executable suffix
- better NDK root directory auto-detection (avoids the need to define ANDROID_NDK_ROOT on some installs)
2009-06-29 12:28:04 +02:00
David 'Digit' Turner
d21c809912 Expose <android/log.h> which contains the declaration of /system/lib/liblog.so.
This allows native application code to send logs to the kernel. Alas !

NOTE: This *is* valid for Cupcake
2009-05-29 21:54:19 +02:00
David 'Digit' Turner
5ad95c577a Force the use of 32-bit toolchain binaries on 64-bit systems.
This is used to reduce the number of distributable prebuilt packages
(i.e. linux-x86_64 is not needed anymore).

Also fix build/tools/build-toolchain.sh to properly copy the GPL and LGPL
license files into the generated prebuilt packages.

Also add a .gitignore files to get less spew from 'git status'
2009-05-27 16:04:25 +02:00
David 'Digit' Turner
93a4147f12 This fixes the build to always define the ANDROID macro, and remove an empty -I from the compiler options.
The latter had the effect of removing the benefit of optimization settings, i.e. a typical compiler
command would look like:

   <toolchain-compiler> .... -Isources/<module-path> -I -O2 -g

The "-I -O2" was interpreted literally as "search in '-O2' directory, and the optimization was
never set to 2 (or 0 in case of debug mode).
2009-05-20 18:37:31 +02:00
Android (Google) Code Review
1e4498ad17 Merge change 1951 into donut
* changes:
  Expose the Zlib headers (<zlib.h> and <zconf.h>) in the android-1.5 NDK sysroot.
2009-05-20 02:45:00 -07:00
Android (Google) Code Review
e0b505d438 Merge change 1958 into donut
* changes:
  Force --no-undefined at link time to generate an error when trying to generate a shared library that references undefined symbols. This can be overriden by defining LOCAL_ALLOW_UNDEFINED_SYMBOLS in your Android.mk to 'true'
2009-05-19 12:00:42 -07:00
David 'Digit' Turner
3caffcfaf8 Force --no-undefined at link time to generate an error when trying to generate a shared library that references undefined symbols.
This can be overriden by defining LOCAL_ALLOW_UNDEFINED_SYMBOLS in your Android.mk to 'true'
2009-05-19 14:58:45 +02:00
David 'Digit' Turner
0b96565afe Fix typo which prevented APP_CFLAGS, APP_CXXFLAGS and others to work properly in the NDK build system. 2009-05-19 13:04:07 +02:00
David 'Digit' Turner
985338c05c Expose the Zlib headers (<zlib.h> and <zconf.h>) in the android-1.5 NDK sysroot.
This is OK because the Zlib ABI is fixed and stable.

Also get rid of the sample zlib sources since we don't need the static library anymore.
2009-05-19 12:10:09 +02:00
David 'Digit' Turner
c39a26b6f5 Fix bad automatic dependency computations 2009-05-15 00:14:00 +02:00
Android (Google) Code Review
cb2d6ae202 Merge change 1653 into donut
* changes:
  Fix bad dependency between generated shared libraries and the corresponding installed module. Also fixes the "make clean" target by the way.
2009-05-14 14:55:55 -07:00
David 'Digit' Turner
0d2d3b95ec Fix bad dependency between generated shared libraries and the corresponding installed module.
Also fixes the "make clean" target by the way.
2009-05-14 17:23:35 +02:00
David 'Digit' Turner
498455c79f Fix the build-toolchain.sh script which doesn't work due to the new download location of the NDK sources
and a small typo when using wget. Also make --force-download actually work.
2009-05-14 16:43:03 +02:00
Xavier Ducrohet
60b2fc90b7 Update the NDK packaging script to generate zip archives for all platforms. 2009-05-11 13:58:02 -07:00
Android (Google) Code Review
ebcb72611b Merge change 1361 into donut
* changes:
  Remove hard-coded path to my home directory in build/tools/make-release.sh. Now you need to use the --prebuilt-path=<path> option to specify where to pick up the prebuilt toolchain tarballs instead, for example:
2009-05-11 11:54:41 -07:00
David 'Digit' Turner
56266b2d59 Remove hard-coded path to my home directory in build/tools/make-release.sh.
Now you need to use the --prebuilt-path=<path> option to specify where to pick up
the prebuilt toolchain tarballs instead, for example:

   build/tools/make-release.sh --prebuilt-path=/home/digit/android/ndk

Add also some other options to change the package prefix / release number / etc
2009-05-11 17:20:26 +02:00