[arch-commits] Commit in android-tools/trunk (5 files)
Anatol Pomozov
anatolik at archlinux.org
Wed Jan 13 06:27:34 UTC 2016
Date: Wednesday, January 13, 2016 @ 07:27:34
Author: anatolik
Revision: 156290
Redo build system for the package
Android does build system refactoring and cleanup and a lot of thing
has changed since 5 rtelease. Create a script to generate build instrcutions.
It reduces maintanence to keep build instructions up-to-date.
Added:
android-tools/trunk/build.sh
android-tools/trunk/fix_build.patch
android-tools/trunk/generate_build.rb
Modified:
android-tools/trunk/PKGBUILD
Deleted:
android-tools/trunk/Makefile
-------------------+
Makefile | 101 ------------------------------
PKGBUILD | 17 ++---
build.sh | 77 +++++++++++++++++++++++
fix_build.patch | 31 +++++++++
generate_build.rb | 171 ++++++++++++++++++++++++++++++++++++++++++++++++++++
5 files changed, 288 insertions(+), 109 deletions(-)
Deleted: Makefile
===================================================================
--- Makefile 2016-01-13 04:48:44 UTC (rev 156289)
+++ Makefile 2016-01-13 06:27:34 UTC (rev 156290)
@@ -1,101 +0,0 @@
-all: mkbootimg fastboot adb
-
-install:
- install -m755 -d $(DESTDIR)/usr/bin
- install -m755 -t $(DESTDIR)/usr/bin mkbootimg fastboot adb
-
-clean:
- rm -f **/*.o
-
-.PHONY: clean
-
-
-
-
-MKBOOTIMG_SRCS += $(wildcard core/libmincrypt/*.c)
-MKBOOTIMG_SRCS += core/mkbootimg/mkbootimg.c
-
-MKBOOTIMG_CFLAGS += -Icore/include
-
-mkbootimg: $(MKBOOTIMG_SRCS)
- $(CC) -o $@ $(CFLAGS) $(MKBOOTIMG_CFLAGS) $(LDFLAGS) $(MKBOOTIMG_LIBS) $(MKBOOTIMG_SRCS)
-
-
-
-
-ADB_SRCS += core/adb/adb.c
-ADB_SRCS += core/adb/adb_auth_host.c
-ADB_SRCS += core/adb/adb_client.c
-ADB_SRCS += core/adb/commandline.c
-ADB_SRCS += core/adb/console.c
-ADB_SRCS += core/adb/fdevent.c
-ADB_SRCS += core/adb/file_sync_client.c
-ADB_SRCS += core/adb/get_my_path_linux.c
-ADB_SRCS += core/adb/services.c
-ADB_SRCS += core/adb/sockets.c
-ADB_SRCS += core/adb/transport.c
-ADB_SRCS += core/adb/transport_local.c
-ADB_SRCS += core/adb/transport_usb.c
-ADB_SRCS += core/adb/usb_linux.c
-ADB_SRCS += core/adb/usb_vendors.c
-ADB_SRCS += core/libcutils/load_file.c
-ADB_SRCS += core/libcutils/socket_inaddr_any_server.c
-ADB_SRCS += core/libcutils/socket_local_client.c
-ADB_SRCS += core/libcutils/socket_local_server.c
-ADB_SRCS += core/libcutils/socket_loopback_client.c
-ADB_SRCS += core/libcutils/socket_loopback_server.c
-ADB_SRCS += core/libcutils/socket_network_client.c
-ADB_SRCS += core/libzipfile/centraldir.c
-ADB_SRCS += core/libzipfile/zipfile.c
-
-ADB_CFLAGS += -DADB_HOST=1 -DHAVE_FORKEXEC=1 -DHAVE_OFF64_T=1 -DHAVE_TERMIO_H -I core/include -I core/adb
-ADB_LIBS += -lcrypto -lpthread -lz
-
-adb: $(ADB_SRCS)
- $(CC) -o $@ $(CFLAGS) $(ADB_CFLAGS) $(LDFLAGS) $(ADB_SRCS) $(ADB_LIBS)
-
-
-
-FASTBOOT_SRCS += core/fastboot/bootimg.c
-FASTBOOT_SRCS += core/fastboot/engine.c
-FASTBOOT_SRCS += core/fastboot/fastboot.c
-FASTBOOT_SRCS += core/fastboot/protocol.c
-FASTBOOT_SRCS += core/fastboot/usb_linux.c
-FASTBOOT_SRCS += core/fastboot/util_linux.c
-FASTBOOT_SRCS += core/fastboot/util.c
-FASTBOOT_SRCS += core/fastboot/fs.c
-FASTBOOT_SRCS += core/libsparse/backed_block.c
-FASTBOOT_SRCS += core/libsparse/output_file.c
-FASTBOOT_SRCS += core/libsparse/sparse.c
-FASTBOOT_SRCS += core/libsparse/sparse_crc32.c
-FASTBOOT_SRCS += core/libsparse/sparse_err.c
-FASTBOOT_SRCS += core/libsparse/sparse_read.c
-FASTBOOT_SRCS += core/libzipfile/centraldir.c
-FASTBOOT_SRCS += core/libzipfile/zipfile.c
-FASTBOOT_SRCS += extras/ext4_utils/allocate.c
-FASTBOOT_SRCS += extras/ext4_utils/contents.c
-FASTBOOT_SRCS += extras/ext4_utils/crc16.c
-FASTBOOT_SRCS += extras/ext4_utils/ext4_utils.c
-FASTBOOT_SRCS += extras/ext4_utils/ext4_sb.c
-FASTBOOT_SRCS += extras/ext4_utils/extent.c
-FASTBOOT_SRCS += extras/ext4_utils/indirect.c
-FASTBOOT_SRCS += extras/ext4_utils/make_ext4fs.c
-FASTBOOT_SRCS += extras/ext4_utils/sha1.c
-FASTBOOT_SRCS += extras/ext4_utils/uuid.c
-FASTBOOT_SRCS += extras/ext4_utils/wipe.c
-FASTBOOT_SRCS += extras/f2fs_utils/f2fs_utils.c
-FASTBOOT_SRCS += extras/f2fs_utils/f2fs_dlutils.c
-FASTBOOT_SRCS += extras/f2fs_utils/f2fs_ioutils.c
-FASTBOOT_SRCS += libselinux/src/callbacks.c
-FASTBOOT_SRCS += libselinux/src/check_context.c
-FASTBOOT_SRCS += libselinux/src/freecon.c
-FASTBOOT_SRCS += libselinux/src/init.c
-FASTBOOT_SRCS += libselinux/src/label.c
-FASTBOOT_SRCS += libselinux/src/label_android_property.c
-FASTBOOT_SRCS += libselinux/src/label_file.c
-
-FASTBOOT_CFLAGS += -DHAVE_OFF64_T=1 -std=gnu99 -I core/mkbootimg -I core/libsparse/include -I core/include -I extras/ext4_utils -I extras/f2fs_utils -I libselinux/include -I f2fs-tools/include -I f2fs-tools/mkfs
-FASTBOOT_LIBS += -lz -ldl -lpcre
-
-fastboot: $(FASTBOOT_SRCS)
- $(CC) -o $@ $(CFLAGS) $(FASTBOOT_CFLAGS) $(LDFLAGS) $(FASTBOOT_SRCS) $(FASTBOOT_LIBS)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2016-01-13 04:48:44 UTC (rev 156289)
+++ PKGBUILD 2016-01-13 06:27:34 UTC (rev 156290)
@@ -4,7 +4,7 @@
# Contributor: Alucryd <alucryd at gmail dot com>
pkgname=android-tools
-pkgver=5.1.1_r33
+pkgver=6.0.1_r10
pkgrel=1
pkgdesc='Android platform tools'
arch=(i686 x86_64)
@@ -16,26 +16,27 @@
git+https://android.googlesource.com/platform/system/extras#tag=android-$pkgver
git+https://android.googlesource.com/platform/external/libselinux#tag=android-$pkgver
git+https://android.googlesource.com/platform/external/f2fs-tools#tag=android-$pkgver
- Makefile
+ build.sh
+ fix_build.patch
bash_completion) # Bash completion file was taken from https://github.com/mbrubeck/android-completion
sha1sums=('SKIP'
'SKIP'
'SKIP'
'SKIP'
- '67baba7465ba6a65c206e8373656e5fe1d85f188'
+ '2bf75e141d4dbbc04ad23c19b3d5e67300de3edd'
+ '40a978209b6d1bbf99e04b8bd5fca6429b97f1b1'
'e1bd94fd4dd260af3c068496071d67738d431aec')
prepare() {
- # another way to fix the compilation error is to add #include <stddef.h>
- sed -e 's/f2fs_sparse_file = NULL/f2fs_sparse_file = 0/g' -i extras/f2fs_utils/f2fs_utils.c
+ patch -p1 < ../fix_build.patch
}
build() {
- make
+ PKGVER=$pkgver bash build.sh
}
package(){
- make DESTDIR="$pkgdir" install
-
+ install -m755 -d "$pkgdir"/usr/bin
+ install -m755 -t "$pkgdir"/usr/bin mkbootimg fastboot adb
install -Dm 644 bash_completion "$pkgdir"/usr/share/bash-completion/completions/$pkgname
}
Added: build.sh
===================================================================
--- build.sh (rev 0)
+++ build.sh 2016-01-13 06:27:34 UTC (rev 156290)
@@ -0,0 +1,77 @@
+gcc -o core/libmincrypt/dsa_sig.c.o -std=gnu11 $CFLAGS $CPPFLAGS -Icore/include -c core/libmincrypt/dsa_sig.c
+gcc -o core/libmincrypt/p256_ec.c.o -std=gnu11 $CFLAGS $CPPFLAGS -Icore/include -c core/libmincrypt/p256_ec.c
+gcc -o core/libmincrypt/rsa.c.o -std=gnu11 $CFLAGS $CPPFLAGS -Icore/include -c core/libmincrypt/rsa.c
+gcc -o core/libmincrypt/sha.c.o -std=gnu11 $CFLAGS $CPPFLAGS -Icore/include -c core/libmincrypt/sha.c
+gcc -o core/libmincrypt/p256.c.o -std=gnu11 $CFLAGS $CPPFLAGS -Icore/include -c core/libmincrypt/p256.c
+gcc -o core/libmincrypt/p256_ecdsa.c.o -std=gnu11 $CFLAGS $CPPFLAGS -Icore/include -c core/libmincrypt/p256_ecdsa.c
+gcc -o core/libmincrypt/sha256.c.o -std=gnu11 $CFLAGS $CPPFLAGS -Icore/include -c core/libmincrypt/sha256.c
+gcc -o core/mkbootimg/mkbootimg.c.o -std=gnu11 $CFLAGS $CPPFLAGS -Icore/include -c core/mkbootimg/mkbootimg.c
+g++ -o mkbootimg "$LDFLAGS" core/libmincrypt/dsa_sig.c.o core/libmincrypt/p256_ec.c.o core/libmincrypt/rsa.c.o core/libmincrypt/sha.c.o core/libmincrypt/p256.c.o core/libmincrypt/p256_ecdsa.c.o core/libmincrypt/sha256.c.o core/mkbootimg/mkbootimg.c.o
+g++ -o core/adb/adb.cpp.o -std=gnu++11 $CXXFLAGS $CPPFLAGS -DADB_HOST=1 -fpermissive -Icore/include -Icore/base/include -c core/adb/adb.cpp
+g++ -o core/adb/adb_auth.cpp.o -std=gnu++11 $CXXFLAGS $CPPFLAGS -DADB_HOST=1 -fpermissive -Icore/include -Icore/base/include -c core/adb/adb_auth.cpp
+g++ -o core/adb/adb_io.cpp.o -std=gnu++11 $CXXFLAGS $CPPFLAGS -DADB_HOST=1 -fpermissive -Icore/include -Icore/base/include -c core/adb/adb_io.cpp
+g++ -o core/adb/adb_listeners.cpp.o -std=gnu++11 $CXXFLAGS $CPPFLAGS -DADB_HOST=1 -fpermissive -Icore/include -Icore/base/include -c core/adb/adb_listeners.cpp
+g++ -o core/adb/adb_utils.cpp.o -std=gnu++11 $CXXFLAGS $CPPFLAGS -DADB_HOST=1 -fpermissive -Icore/include -Icore/base/include -c core/adb/adb_utils.cpp
+g++ -o core/adb/sockets.cpp.o -std=gnu++11 $CXXFLAGS $CPPFLAGS -DADB_HOST=1 -fpermissive -Icore/include -Icore/base/include -c core/adb/sockets.cpp
+g++ -o core/adb/transport.cpp.o -std=gnu++11 $CXXFLAGS $CPPFLAGS -DADB_HOST=1 -fpermissive -Icore/include -Icore/base/include -c core/adb/transport.cpp
+g++ -o core/adb/transport_local.cpp.o -std=gnu++11 $CXXFLAGS $CPPFLAGS -DADB_HOST=1 -fpermissive -Icore/include -Icore/base/include -c core/adb/transport_local.cpp
+g++ -o core/adb/transport_usb.cpp.o -std=gnu++11 $CXXFLAGS $CPPFLAGS -DADB_HOST=1 -fpermissive -Icore/include -Icore/base/include -c core/adb/transport_usb.cpp
+g++ -o core/adb/fdevent.cpp.o -std=gnu++11 $CXXFLAGS $CPPFLAGS -DADB_HOST=1 -fpermissive -Icore/include -Icore/base/include -c core/adb/fdevent.cpp
+g++ -o core/adb/get_my_path_linux.cpp.o -std=gnu++11 $CXXFLAGS $CPPFLAGS -DADB_HOST=1 -fpermissive -Icore/include -Icore/base/include -c core/adb/get_my_path_linux.cpp
+g++ -o core/adb/usb_linux.cpp.o -std=gnu++11 $CXXFLAGS $CPPFLAGS -DADB_HOST=1 -fpermissive -Icore/include -Icore/base/include -c core/adb/usb_linux.cpp
+g++ -o core/adb/adb_auth_host.cpp.o -std=gnu++11 $CXXFLAGS $CPPFLAGS -DADB_HOST=1 -fpermissive -Icore/include -Icore/base/include -c core/adb/adb_auth_host.cpp
+g++ -o core/adb/adb_main.cpp.o -std=gnu++11 $CXXFLAGS $CPPFLAGS -DADB_REVISION=\"$PKGVER\" -D_GNU_SOURCE -DADB_HOST=1 -DWORKAROUND_BUG6558362 -fpermissive -Icore/include -Icore/base/include -c core/adb/adb_main.cpp
+g++ -o core/adb/console.cpp.o -std=gnu++11 $CXXFLAGS $CPPFLAGS -DADB_REVISION=\"$PKGVER\" -D_GNU_SOURCE -DADB_HOST=1 -DWORKAROUND_BUG6558362 -fpermissive -Icore/include -Icore/base/include -c core/adb/console.cpp
+g++ -o core/adb/commandline.cpp.o -std=gnu++11 $CXXFLAGS $CPPFLAGS -DADB_REVISION=\"$PKGVER\" -D_GNU_SOURCE -DADB_HOST=1 -DWORKAROUND_BUG6558362 -fpermissive -Icore/include -Icore/base/include -c core/adb/commandline.cpp
+g++ -o core/adb/adb_client.cpp.o -std=gnu++11 $CXXFLAGS $CPPFLAGS -DADB_REVISION=\"$PKGVER\" -D_GNU_SOURCE -DADB_HOST=1 -DWORKAROUND_BUG6558362 -fpermissive -Icore/include -Icore/base/include -c core/adb/adb_client.cpp
+g++ -o core/adb/services.cpp.o -std=gnu++11 $CXXFLAGS $CPPFLAGS -DADB_REVISION=\"$PKGVER\" -D_GNU_SOURCE -DADB_HOST=1 -DWORKAROUND_BUG6558362 -fpermissive -Icore/include -Icore/base/include -c core/adb/services.cpp
+g++ -o core/adb/file_sync_client.cpp.o -std=gnu++11 $CXXFLAGS $CPPFLAGS -DADB_REVISION=\"$PKGVER\" -D_GNU_SOURCE -DADB_HOST=1 -DWORKAROUND_BUG6558362 -fpermissive -Icore/include -Icore/base/include -c core/adb/file_sync_client.cpp
+g++ -o core/base/file.cpp.o -std=gnu++11 $CXXFLAGS $CPPFLAGS -DADB_HOST=1 -Icore/base/include -Icore/include -c core/base/file.cpp
+g++ -o core/base/stringprintf.cpp.o -std=gnu++11 $CXXFLAGS $CPPFLAGS -DADB_HOST=1 -Icore/base/include -Icore/include -c core/base/stringprintf.cpp
+g++ -o core/base/strings.cpp.o -std=gnu++11 $CXXFLAGS $CPPFLAGS -DADB_HOST=1 -Icore/base/include -Icore/include -c core/base/strings.cpp
+gcc -o core/liblog/logd_write.c.o -std=gnu11 $CFLAGS $CPPFLAGS -DLIBLOG_LOG_TAG=1005 -DFAKE_LOG_DEVICE=1 -D_GNU_SOURCE -Icore/log/include -Icore/include -c core/liblog/logd_write.c
+gcc -o core/liblog/log_event_write.c.o -std=gnu11 $CFLAGS $CPPFLAGS -DLIBLOG_LOG_TAG=1005 -DFAKE_LOG_DEVICE=1 -D_GNU_SOURCE -Icore/log/include -Icore/include -c core/liblog/log_event_write.c
+gcc -o core/liblog/fake_log_device.c.o -std=gnu11 $CFLAGS $CPPFLAGS -DLIBLOG_LOG_TAG=1005 -DFAKE_LOG_DEVICE=1 -D_GNU_SOURCE -Icore/log/include -Icore/include -c core/liblog/fake_log_device.c
+gcc -o core/libcutils/load_file.c.o -std=gnu11 $CFLAGS $CPPFLAGS -D_GNU_SOURCE -Icore/include -c core/libcutils/load_file.c
+gcc -o core/libcutils/socket_inaddr_any_server.c.o -std=gnu11 $CFLAGS $CPPFLAGS -D_GNU_SOURCE -Icore/include -c core/libcutils/socket_inaddr_any_server.c
+gcc -o core/libcutils/socket_local_client.c.o -std=gnu11 $CFLAGS $CPPFLAGS -D_GNU_SOURCE -Icore/include -c core/libcutils/socket_local_client.c
+gcc -o core/libcutils/socket_local_server.c.o -std=gnu11 $CFLAGS $CPPFLAGS -D_GNU_SOURCE -Icore/include -c core/libcutils/socket_local_server.c
+gcc -o core/libcutils/socket_loopback_client.c.o -std=gnu11 $CFLAGS $CPPFLAGS -D_GNU_SOURCE -Icore/include -c core/libcutils/socket_loopback_client.c
+gcc -o core/libcutils/socket_loopback_server.c.o -std=gnu11 $CFLAGS $CPPFLAGS -D_GNU_SOURCE -Icore/include -c core/libcutils/socket_loopback_server.c
+gcc -o core/libcutils/socket_network_client.c.o -std=gnu11 $CFLAGS $CPPFLAGS -D_GNU_SOURCE -Icore/include -c core/libcutils/socket_network_client.c
+g++ -o adb -lrt -ldl -lpthread -lcrypto "$LDFLAGS" core/base/file.cpp.o core/base/stringprintf.cpp.o core/base/strings.cpp.o core/liblog/logd_write.c.o core/liblog/log_event_write.c.o core/liblog/fake_log_device.c.o core/libcutils/load_file.c.o core/libcutils/socket_inaddr_any_server.c.o core/libcutils/socket_local_client.c.o core/libcutils/socket_local_server.c.o core/libcutils/socket_loopback_client.c.o core/libcutils/socket_loopback_server.c.o core/libcutils/socket_network_client.c.o core/adb/adb.cpp.o core/adb/adb_auth.cpp.o core/adb/adb_io.cpp.o core/adb/adb_listeners.cpp.o core/adb/adb_utils.cpp.o core/adb/sockets.cpp.o core/adb/transport.cpp.o core/adb/transport_local.cpp.o core/adb/transport_usb.cpp.o core/adb/fdevent.cpp.o core/adb/get_my_path_linux.cpp.o core/adb/usb_linux.cpp.o core/adb/adb_auth_host.cpp.o core/adb/adb_main.cpp.o core/adb/console.cpp.o core/adb/commandline.cpp.o core/adb/adb_client.cpp.o core/adb/services.cpp.o core/adb/file_sync_client.cpp.o
+gcc -o core/fastboot/protocol.c.o -std=gnu11 $CFLAGS $CPPFLAGS -DFASTBOOT_REVISION=\"$PKGVER\" -D_GNU_SOURCE -Icore/include -Icore/libsparse/include -Icore/mkbootimg -Iextras/ext4_utils -Iextras/f2fs_utils -c core/fastboot/protocol.c
+gcc -o core/fastboot/engine.c.o -std=gnu11 $CFLAGS $CPPFLAGS -DFASTBOOT_REVISION=\"$PKGVER\" -D_GNU_SOURCE -Icore/include -Icore/libsparse/include -Icore/mkbootimg -Iextras/ext4_utils -Iextras/f2fs_utils -c core/fastboot/engine.c
+g++ -o core/fastboot/bootimg_utils.cpp.o -std=gnu++11 $CXXFLAGS $CPPFLAGS -DFASTBOOT_REVISION=\"$PKGVER\" -D_GNU_SOURCE -Icore/include -Icore/libsparse/include -Icore/mkbootimg -Iextras/ext4_utils -Iextras/f2fs_utils -c core/fastboot/bootimg_utils.cpp
+g++ -o core/fastboot/fastboot.cpp.o -std=gnu++11 $CXXFLAGS $CPPFLAGS -DFASTBOOT_REVISION=\"$PKGVER\" -D_GNU_SOURCE -Icore/include -Icore/libsparse/include -Icore/mkbootimg -Iextras/ext4_utils -Iextras/f2fs_utils -c core/fastboot/fastboot.cpp
+gcc -o core/fastboot/util.c.o -std=gnu11 $CFLAGS $CPPFLAGS -DFASTBOOT_REVISION=\"$PKGVER\" -D_GNU_SOURCE -Icore/include -Icore/libsparse/include -Icore/mkbootimg -Iextras/ext4_utils -Iextras/f2fs_utils -c core/fastboot/util.c
+gcc -o core/fastboot/fs.c.o -std=gnu11 $CFLAGS $CPPFLAGS -DFASTBOOT_REVISION=\"$PKGVER\" -D_GNU_SOURCE -Icore/include -Icore/libsparse/include -Icore/mkbootimg -Iextras/ext4_utils -Iextras/f2fs_utils -c core/fastboot/fs.c
+gcc -o core/fastboot/usb_linux.c.o -std=gnu11 $CFLAGS $CPPFLAGS -DFASTBOOT_REVISION=\"$PKGVER\" -D_GNU_SOURCE -Icore/include -Icore/libsparse/include -Icore/mkbootimg -Iextras/ext4_utils -Iextras/f2fs_utils -c core/fastboot/usb_linux.c
+gcc -o core/fastboot/util_linux.c.o -std=gnu11 $CFLAGS $CPPFLAGS -DFASTBOOT_REVISION=\"$PKGVER\" -D_GNU_SOURCE -Icore/include -Icore/libsparse/include -Icore/mkbootimg -Iextras/ext4_utils -Iextras/f2fs_utils -c core/fastboot/util_linux.c
+gcc -o core/libsparse/backed_block.c.o -std=gnu11 $CFLAGS $CPPFLAGS -Icore/libsparse/include -c core/libsparse/backed_block.c
+gcc -o core/libsparse/output_file.c.o -std=gnu11 $CFLAGS $CPPFLAGS -Icore/libsparse/include -c core/libsparse/output_file.c
+gcc -o core/libsparse/sparse.c.o -std=gnu11 $CFLAGS $CPPFLAGS -Icore/libsparse/include -c core/libsparse/sparse.c
+gcc -o core/libsparse/sparse_crc32.c.o -std=gnu11 $CFLAGS $CPPFLAGS -Icore/libsparse/include -c core/libsparse/sparse_crc32.c
+gcc -o core/libsparse/sparse_err.c.o -std=gnu11 $CFLAGS $CPPFLAGS -Icore/libsparse/include -c core/libsparse/sparse_err.c
+gcc -o core/libsparse/sparse_read.c.o -std=gnu11 $CFLAGS $CPPFLAGS -Icore/libsparse/include -c core/libsparse/sparse_read.c
+g++ -o core/libziparchive/zip_archive.cc.o -std=gnu++11 $CXXFLAGS $CPPFLAGS -Icore/base/include -Icore/include -c core/libziparchive/zip_archive.cc
+g++ -o core/libutils/FileMap.cpp.o -std=gnu++11 $CXXFLAGS $CPPFLAGS -Icore/include -c core/libutils/FileMap.cpp
+gcc -o extras/ext4_utils/make_ext4fs.c.o -std=gnu11 $CFLAGS $CPPFLAGS -Icore/libsparse/include -Icore/include -c extras/ext4_utils/make_ext4fs.c
+gcc -o extras/ext4_utils/ext4fixup.c.o -std=gnu11 $CFLAGS $CPPFLAGS -Icore/libsparse/include -Icore/include -c extras/ext4_utils/ext4fixup.c
+gcc -o extras/ext4_utils/ext4_utils.c.o -std=gnu11 $CFLAGS $CPPFLAGS -Icore/libsparse/include -Icore/include -c extras/ext4_utils/ext4_utils.c
+gcc -o extras/ext4_utils/allocate.c.o -std=gnu11 $CFLAGS $CPPFLAGS -Icore/libsparse/include -Icore/include -c extras/ext4_utils/allocate.c
+gcc -o extras/ext4_utils/contents.c.o -std=gnu11 $CFLAGS $CPPFLAGS -Icore/libsparse/include -Icore/include -c extras/ext4_utils/contents.c
+gcc -o extras/ext4_utils/extent.c.o -std=gnu11 $CFLAGS $CPPFLAGS -Icore/libsparse/include -Icore/include -c extras/ext4_utils/extent.c
+gcc -o extras/ext4_utils/indirect.c.o -std=gnu11 $CFLAGS $CPPFLAGS -Icore/libsparse/include -Icore/include -c extras/ext4_utils/indirect.c
+gcc -o extras/ext4_utils/sha1.c.o -std=gnu11 $CFLAGS $CPPFLAGS -Icore/libsparse/include -Icore/include -c extras/ext4_utils/sha1.c
+gcc -o extras/ext4_utils/wipe.c.o -std=gnu11 $CFLAGS $CPPFLAGS -Icore/libsparse/include -Icore/include -c extras/ext4_utils/wipe.c
+gcc -o extras/ext4_utils/crc16.c.o -std=gnu11 $CFLAGS $CPPFLAGS -Icore/libsparse/include -Icore/include -c extras/ext4_utils/crc16.c
+gcc -o extras/ext4_utils/ext4_sb.c.o -std=gnu11 $CFLAGS $CPPFLAGS -Icore/libsparse/include -Icore/include -c extras/ext4_utils/ext4_sb.c
+gcc -o libselinux/src/callbacks.c.o -std=gnu11 $CFLAGS $CPPFLAGS -DAUDITD_LOG_TAG=1003 -D_GNU_SOURCE -DHOST -Ilibselinux/include -c libselinux/src/callbacks.c
+gcc -o libselinux/src/check_context.c.o -std=gnu11 $CFLAGS $CPPFLAGS -DAUDITD_LOG_TAG=1003 -D_GNU_SOURCE -DHOST -Ilibselinux/include -c libselinux/src/check_context.c
+gcc -o libselinux/src/freecon.c.o -std=gnu11 $CFLAGS $CPPFLAGS -DAUDITD_LOG_TAG=1003 -D_GNU_SOURCE -DHOST -Ilibselinux/include -c libselinux/src/freecon.c
+gcc -o libselinux/src/init.c.o -std=gnu11 $CFLAGS $CPPFLAGS -DAUDITD_LOG_TAG=1003 -D_GNU_SOURCE -DHOST -Ilibselinux/include -c libselinux/src/init.c
+gcc -o libselinux/src/label.c.o -std=gnu11 $CFLAGS $CPPFLAGS -DAUDITD_LOG_TAG=1003 -D_GNU_SOURCE -DHOST -Ilibselinux/include -c libselinux/src/label.c
+gcc -o libselinux/src/label_file.c.o -std=gnu11 $CFLAGS $CPPFLAGS -DAUDITD_LOG_TAG=1003 -D_GNU_SOURCE -DHOST -Ilibselinux/include -c libselinux/src/label_file.c
+gcc -o libselinux/src/label_android_property.c.o -std=gnu11 $CFLAGS $CPPFLAGS -DAUDITD_LOG_TAG=1003 -D_GNU_SOURCE -DHOST -Ilibselinux/include -c libselinux/src/label_android_property.c
+g++ -o fastboot -lz -lpcre "$LDFLAGS" core/libsparse/backed_block.c.o core/libsparse/output_file.c.o core/libsparse/sparse.c.o core/libsparse/sparse_crc32.c.o core/libsparse/sparse_err.c.o core/libsparse/sparse_read.c.o core/libziparchive/zip_archive.cc.o core/liblog/logd_write.c.o core/liblog/log_event_write.c.o core/liblog/fake_log_device.c.o core/libutils/FileMap.cpp.o core/base/file.cpp.o core/base/stringprintf.cpp.o core/base/strings.cpp.o extras/ext4_utils/make_ext4fs.c.o extras/ext4_utils/ext4fixup.c.o extras/ext4_utils/ext4_utils.c.o extras/ext4_utils/allocate.c.o extras/ext4_utils/contents.c.o extras/ext4_utils/extent.c.o extras/ext4_utils/indirect.c.o extras/ext4_utils/sha1.c.o extras/ext4_utils/wipe.c.o extras/ext4_utils/crc16.c.o extras/ext4_utils/ext4_sb.c.o libselinux/src/callbacks.c.o libselinux/src/check_context.c.o libselinux/src/freecon.c.o libselinux/src/init.c.o libselinux/src/label.c.o libselinux/src/label_file.c.o libselinux/src/label_android_property.c.o core/
fastboot/protocol.c.o core/fastboot/engine.c.o core/fastboot/bootimg_utils.cpp.o core/fastboot/fastboot.cpp.o core/fastboot/util.c.o core/fastboot/fs.c.o core/fastboot/usb_linux.c.o core/fastboot/util_linux.c.o
Added: fix_build.patch
===================================================================
--- fix_build.patch (rev 0)
+++ fix_build.patch 2016-01-13 06:27:34 UTC (rev 156290)
@@ -0,0 +1,31 @@
+--- a/core/base/file.cpp
++++ b/core/base/file.cpp
+@@ -20,6 +20,7 @@
+ #include <fcntl.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
++#include <string.h>
+
+ #include <string>
+
+--- a/core/liblog/log_read.c
++++ b/core/liblog/log_read.c
+@@ -26,6 +26,7 @@
+ #include <string.h>
+ #include <sys/cdefs.h>
+ #include <unistd.h>
++#include <sys/user.h>
+
+ #include <cutils/list.h>
+ #include <cutils/sockets.h>
+
+--- a/libselinux/src/label_internal.h
++++ b/libselinux/src/label_internal.h
+@@ -10,6 +10,7 @@
+
+ #include <stdlib.h>
+ #include <stdarg.h>
++#include <stdbool.h>
+ #include <selinux/selinux.h>
+ #include <selinux/label.h>
+ #include "dso.h"
Added: generate_build.rb
===================================================================
--- generate_build.rb (rev 0)
+++ generate_build.rb 2016-01-13 06:27:34 UTC (rev 156290)
@@ -0,0 +1,171 @@
+#!/usr/bin/ruby
+
+# Android build system is complicated and does not allow to build
+# separate parts easily.
+# This script tries to mimic Android build for toolset.
+
+def expand(dir, files)
+ files.map{|f| File.join(dir,f)}
+end
+
+# Compile sources to *.o files. One *.o file per input.
+# Returns array of *.o filenames
+def compile(sources, cflags)
+ outputs = []
+ for s in sources
+ ext = File.extname(s)
+
+ case ext
+ when '.c'
+ cc = 'gcc'
+ lang_flags = '-std=gnu11 $CFLAGS $CPPFLAGS'
+ when '.cpp', '.cc'
+ cc = 'g++'
+ lang_flags = '-std=gnu++11 $CXXFLAGS $CPPFLAGS'
+ else
+ raise "Unknown extension #{ext}"
+ end
+
+ output = s + '.o'
+ outputs << output
+ puts "#{cc} -o #{output} #{lang_flags} #{cflags} -c #{s}\n"
+ end
+
+ return outputs
+end
+
+# compiles and link
+def link(output, objects, ldflags)
+ puts "g++ -o #{output} #{ldflags} \"$LDFLAGS\" #{objects.join(' ')}"
+end
+
+minicryptfiles = %w(
+ dsa_sig.c
+ p256_ec.c
+ rsa.c
+ sha.c
+ p256.c
+ p256_ecdsa.c
+ sha256.c
+)
+libminicrypt = compile(expand('core/libmincrypt', minicryptfiles), '-Icore/include')
+libmkbootimg = compile(['core/mkbootimg/mkbootimg.c'], '-Icore/include')
+link('mkbootimg', libminicrypt + libmkbootimg, nil)
+
+
+adbdfiles = %w(
+ adb.cpp
+ adb_auth.cpp
+ adb_io.cpp
+ adb_listeners.cpp
+ adb_utils.cpp
+ sockets.cpp
+ transport.cpp
+ transport_local.cpp
+ transport_usb.cpp
+
+ fdevent.cpp
+ get_my_path_linux.cpp
+ usb_linux.cpp
+
+ adb_auth_host.cpp
+)
+libadbd = compile(expand('core/adb', adbdfiles), '-DADB_HOST=1 -fpermissive -Icore/include -Icore/base/include')
+
+adbfiles = %w(
+ adb_main.cpp
+ console.cpp
+ commandline.cpp
+ adb_client.cpp
+ services.cpp
+ file_sync_client.cpp
+)
+libadb = compile(expand('core/adb', adbfiles), '-DADB_REVISION=\"$PKGVER\" -D_GNU_SOURCE -DADB_HOST=1 -DWORKAROUND_BUG6558362 -fpermissive -Icore/include -Icore/base/include')
+
+basefiles = %w(
+ file.cpp
+ stringprintf.cpp
+ strings.cpp
+)
+libbase = compile(expand('core/base', basefiles), '-DADB_HOST=1 -Icore/base/include -Icore/include')
+
+logfiles = %w(
+ logd_write.c
+ log_event_write.c
+ fake_log_device.c
+)
+liblog = compile(expand('core/liblog', logfiles), '-DLIBLOG_LOG_TAG=1005 -DFAKE_LOG_DEVICE=1 -D_GNU_SOURCE -Icore/log/include -Icore/include')
+
+cutilsfiles = %w(
+ load_file.c
+ socket_inaddr_any_server.c
+ socket_local_client.c
+ socket_local_server.c
+ socket_loopback_client.c
+ socket_loopback_server.c
+ socket_network_client.c
+)
+libcutils = compile(expand('core/libcutils', cutilsfiles), '-D_GNU_SOURCE -Icore/include')
+
+link('adb', libbase + liblog + libcutils + libadbd + libadb, '-lrt -ldl -lpthread -lcrypto')
+
+
+fastbootfiles = %w(
+ protocol.c
+ engine.c
+ bootimg_utils.cpp
+ fastboot.cpp
+ util.c
+ fs.c
+ usb_linux.c
+ util_linux.c
+)
+libfastboot = compile(expand('core/fastboot', fastbootfiles), '-DFASTBOOT_REVISION=\"$PKGVER\" -D_GNU_SOURCE -Icore/include -Icore/libsparse/include -Icore/mkbootimg -Iextras/ext4_utils -Iextras/f2fs_utils')
+
+sparsefiles = %w(
+ backed_block.c
+ output_file.c
+ sparse.c
+ sparse_crc32.c
+ sparse_err.c
+ sparse_read.c
+)
+libsparse = compile(expand('core/libsparse', sparsefiles), '-Icore/libsparse/include')
+
+zipfiles = %w(
+ zip_archive.cc
+)
+libzip = compile(expand('core/libziparchive', zipfiles), '-Icore/base/include -Icore/include')
+
+utilfiles = %w(
+ FileMap.cpp
+)
+libutil = compile(expand('core/libutils', utilfiles), '-Icore/include')
+
+ext4files = %w(
+ make_ext4fs.c
+ ext4fixup.c
+ ext4_utils.c
+ allocate.c
+ contents.c
+ extent.c
+ indirect.c
+ sha1.c
+ wipe.c
+ crc16.c
+ ext4_sb.c
+)
+libext4 = compile(expand('extras/ext4_utils', ext4files), '-Icore/libsparse/include -Icore/include')
+
+selinuxfiles = %w(
+ src/callbacks.c
+ src/check_context.c
+ src/freecon.c
+ src/init.c
+ src/label.c
+ src/label_file.c
+ src/label_android_property.c
+)
+libselinux = compile(expand('libselinux', selinuxfiles), '-DAUDITD_LOG_TAG=1003 -D_GNU_SOURCE -DHOST -Ilibselinux/include')
+
+link('fastboot', libsparse + libzip + liblog + libutil + libbase + libext4 + libselinux + libfastboot, '-lz -lpcre')
Property changes on: android-tools/trunk/generate_build.rb
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
More information about the arch-commits
mailing list