Elliott Hughes | 858a5c7 | 2014-02-28 15:58:12 -0800 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2006 The Android Open Source Project |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | # |
The Android Open Source Project | 34d6eab | 2009-03-03 19:30:45 -0800 | [diff] [blame] | 16 | |
Elliott Hughes | 858a5c7 | 2014-02-28 15:58:12 -0800 | [diff] [blame] | 17 | LOCAL_PATH := $(call my-dir) |
Elliott Hughes | 7c53832 | 2014-02-28 10:32:04 -0800 | [diff] [blame] | 18 | |
Elliott Hughes | 4e779b4 | 2014-05-07 09:10:38 -0700 | [diff] [blame] | 19 | # |
| 20 | # To update: |
| 21 | # |
| 22 | |
Elliott Hughes | 60b6d90 | 2014-06-06 22:42:41 -0700 | [diff] [blame] | 23 | # git remote add strace git://git.code.sf.net/p/strace/code |
Elliott Hughes | 4e779b4 | 2014-05-07 09:10:38 -0700 | [diff] [blame] | 24 | # git fetch strace |
| 25 | # git merge strace/master |
| 26 | # mm -j32 |
| 27 | # # (Make any necessary Android.mk changes and test the new strace.) |
Elliott Hughes | 60b6d90 | 2014-06-06 22:42:41 -0700 | [diff] [blame] | 28 | # git push aosp HEAD:master # Push directly, avoiding gerrit. |
| 29 | # git push aosp HEAD:refs/for/master # Push to gerrit. |
Elliott Hughes | 4e779b4 | 2014-05-07 09:10:38 -0700 | [diff] [blame] | 30 | # |
| 31 | # # Now commit any necessary Android.mk changes like normal: |
| 32 | # repo start post-sync . |
| 33 | # git commit -a |
| 34 | # |
| 35 | |
Elliott Hughes | 9e25f2c | 2014-10-03 11:01:13 -0700 | [diff] [blame] | 36 | # We don't currently have a good solution for the 'configure' side of things. |
| 37 | # You can get a list of the HAVE_* variables in use and manually go through it: |
| 38 | # |
| 39 | # find . -name "*.[ch]" | xargs grep HAVE_ | sed 's/.*\(HAVE_[A-Z0-9_]*\).*/\1/p' | sort | uniq -d |
| 40 | |
Elliott Hughes | 7c53832 | 2014-02-28 10:32:04 -0800 | [diff] [blame] | 41 | # ------------------------------------------------------------------------- |
| 42 | |
The Android Open Source Project | 34d6eab | 2009-03-03 19:30:45 -0800 | [diff] [blame] | 43 | include $(CLEAR_VARS) |
| 44 | |
Elliott Hughes | 15fc6a2 | 2014-01-09 10:30:06 -0800 | [diff] [blame] | 45 | strace_version := $(shell grep Version $(LOCAL_PATH)/strace.spec | cut -d " " -f 2) |
The Android Open Source Project | 34d6eab | 2009-03-03 19:30:45 -0800 | [diff] [blame] | 46 | |
Elliott Hughes | bb0c2d5 | 2014-01-07 17:34:14 -0800 | [diff] [blame] | 47 | LOCAL_SRC_FILES := \ |
Elliott Hughes | caca6ee | 2015-01-06 12:18:17 -0800 | [diff] [blame] | 48 | access.c \ |
| 49 | affinity.c \ |
Elliott Hughes | 5dec78d | 2014-02-26 15:56:23 -0800 | [diff] [blame] | 50 | aio.c \ |
Elliott Hughes | bb0c2d5 | 2014-01-07 17:34:14 -0800 | [diff] [blame] | 51 | bjm.c \ |
| 52 | block.c \ |
Elliott Hughes | caca6ee | 2015-01-06 12:18:17 -0800 | [diff] [blame] | 53 | cacheflush.c \ |
| 54 | capability.c \ |
| 55 | chdir.c \ |
| 56 | chmod.c \ |
| 57 | clone.c \ |
Elliott Hughes | bb0c2d5 | 2014-01-07 17:34:14 -0800 | [diff] [blame] | 58 | count.c \ |
| 59 | desc.c \ |
Elliott Hughes | 1f72dc7 | 2014-09-22 10:04:17 -0700 | [diff] [blame] | 60 | dirent.c \ |
Elliott Hughes | caca6ee | 2015-01-06 12:18:17 -0800 | [diff] [blame] | 61 | execve.c \ |
| 62 | exit.c \ |
| 63 | fadvise.c \ |
| 64 | fallocate.c \ |
Elliott Hughes | 5dec78d | 2014-02-26 15:56:23 -0800 | [diff] [blame] | 65 | fanotify.c \ |
Elliott Hughes | caca6ee | 2015-01-06 12:18:17 -0800 | [diff] [blame] | 66 | fchownat.c \ |
Elliott Hughes | bb0c2d5 | 2014-01-07 17:34:14 -0800 | [diff] [blame] | 67 | file.c \ |
Elliott Hughes | caca6ee | 2015-01-06 12:18:17 -0800 | [diff] [blame] | 68 | futex.c \ |
| 69 | getcpu.c \ |
| 70 | getcwd.c \ |
Elliott Hughes | 0328d0a | 2015-03-18 11:18:43 -0700 | [diff] [blame] | 71 | getrandom.c \ |
Elliott Hughes | caca6ee | 2015-01-06 12:18:17 -0800 | [diff] [blame] | 72 | get_robust_list.c \ |
| 73 | hostname.c \ |
Elliott Hughes | 5dec78d | 2014-02-26 15:56:23 -0800 | [diff] [blame] | 74 | inotify.c \ |
Elliott Hughes | bb0c2d5 | 2014-01-07 17:34:14 -0800 | [diff] [blame] | 75 | io.c \ |
| 76 | ioctl.c \ |
Elliott Hughes | 5dec78d | 2014-02-26 15:56:23 -0800 | [diff] [blame] | 77 | ioprio.c \ |
Elliott Hughes | bb0c2d5 | 2014-01-07 17:34:14 -0800 | [diff] [blame] | 78 | ipc.c \ |
Elliott Hughes | 5dec78d | 2014-02-26 15:56:23 -0800 | [diff] [blame] | 79 | kexec.c \ |
| 80 | keyctl.c \ |
Elliott Hughes | 5150567 | 2014-04-10 11:06:16 -0700 | [diff] [blame] | 81 | ldt.c \ |
Elliott Hughes | caca6ee | 2015-01-06 12:18:17 -0800 | [diff] [blame] | 82 | link.c \ |
Elliott Hughes | bb0c2d5 | 2014-01-07 17:34:14 -0800 | [diff] [blame] | 83 | loop.c \ |
Elliott Hughes | caca6ee | 2015-01-06 12:18:17 -0800 | [diff] [blame] | 84 | lseek.c \ |
Elliott Hughes | bb0c2d5 | 2014-01-07 17:34:14 -0800 | [diff] [blame] | 85 | mem.c \ |
Elliott Hughes | caca6ee | 2015-01-06 12:18:17 -0800 | [diff] [blame] | 86 | mknod.c \ |
| 87 | mount.c \ |
Elliott Hughes | bb0c2d5 | 2014-01-07 17:34:14 -0800 | [diff] [blame] | 88 | mtd.c \ |
| 89 | net.c \ |
Elliott Hughes | caca6ee | 2015-01-06 12:18:17 -0800 | [diff] [blame] | 90 | open.c \ |
Elliott Hughes | bb0c2d5 | 2014-01-07 17:34:14 -0800 | [diff] [blame] | 91 | pathtrace.c \ |
Elliott Hughes | caca6ee | 2015-01-06 12:18:17 -0800 | [diff] [blame] | 92 | personality.c \ |
| 93 | prctl.c \ |
| 94 | printmode.c \ |
Elliott Hughes | c3d4308 | 2015-04-06 17:00:50 -0700 | [diff] [blame] | 95 | printsiginfo.c \ |
Elliott Hughes | bb0c2d5 | 2014-01-07 17:34:14 -0800 | [diff] [blame] | 96 | process.c \ |
Elliott Hughes | caca6ee | 2015-01-06 12:18:17 -0800 | [diff] [blame] | 97 | process_vm.c \ |
Elliott Hughes | 5dec78d | 2014-02-26 15:56:23 -0800 | [diff] [blame] | 98 | ptp.c \ |
Elliott Hughes | bb0c2d5 | 2014-01-07 17:34:14 -0800 | [diff] [blame] | 99 | quota.c \ |
Elliott Hughes | caca6ee | 2015-01-06 12:18:17 -0800 | [diff] [blame] | 100 | readahead.c \ |
| 101 | readlink.c \ |
Elliott Hughes | 5dec78d | 2014-02-26 15:56:23 -0800 | [diff] [blame] | 102 | reboot.c \ |
Elliott Hughes | caca6ee | 2015-01-06 12:18:17 -0800 | [diff] [blame] | 103 | renameat.c \ |
Elliott Hughes | bb0c2d5 | 2014-01-07 17:34:14 -0800 | [diff] [blame] | 104 | resource.c \ |
Elliott Hughes | caca6ee | 2015-01-06 12:18:17 -0800 | [diff] [blame] | 105 | sched.c \ |
Elliott Hughes | 5dec78d | 2014-02-26 15:56:23 -0800 | [diff] [blame] | 106 | scsi.c \ |
Elliott Hughes | 0328d0a | 2015-03-18 11:18:43 -0700 | [diff] [blame] | 107 | seccomp.c \ |
Elliott Hughes | c3d4308 | 2015-04-06 17:00:50 -0700 | [diff] [blame] | 108 | sigaltstack.c \ |
Elliott Hughes | bb0c2d5 | 2014-01-07 17:34:14 -0800 | [diff] [blame] | 109 | signal.c \ |
Elliott Hughes | 0328d0a | 2015-03-18 11:18:43 -0700 | [diff] [blame] | 110 | sigreturn.c \ |
Elliott Hughes | bb0c2d5 | 2014-01-07 17:34:14 -0800 | [diff] [blame] | 111 | sock.c \ |
Elliott Hughes | 1f72dc7 | 2014-09-22 10:04:17 -0700 | [diff] [blame] | 112 | socketutils.c \ |
Elliott Hughes | caca6ee | 2015-01-06 12:18:17 -0800 | [diff] [blame] | 113 | sram_alloc.c \ |
Elliott Hughes | 1f72dc7 | 2014-09-22 10:04:17 -0700 | [diff] [blame] | 114 | statfs.c \ |
Elliott Hughes | bb0c2d5 | 2014-01-07 17:34:14 -0800 | [diff] [blame] | 115 | strace.c \ |
| 116 | stream.c \ |
Elliott Hughes | caca6ee | 2015-01-06 12:18:17 -0800 | [diff] [blame] | 117 | swapon.c \ |
| 118 | sync_file_range.c \ |
Elliott Hughes | bb0c2d5 | 2014-01-07 17:34:14 -0800 | [diff] [blame] | 119 | syscall.c \ |
Elliott Hughes | caca6ee | 2015-01-06 12:18:17 -0800 | [diff] [blame] | 120 | sysctl.c \ |
Elliott Hughes | 5a9d3b9 | 2014-10-03 09:50:14 -0700 | [diff] [blame] | 121 | sysinfo.c \ |
Elliott Hughes | caca6ee | 2015-01-06 12:18:17 -0800 | [diff] [blame] | 122 | syslog.c \ |
| 123 | sysmips.c \ |
Elliott Hughes | bb0c2d5 | 2014-01-07 17:34:14 -0800 | [diff] [blame] | 124 | term.c \ |
| 125 | time.c \ |
Elliott Hughes | caca6ee | 2015-01-06 12:18:17 -0800 | [diff] [blame] | 126 | truncate.c \ |
| 127 | uid16.c \ |
| 128 | uid.c \ |
| 129 | umask.c \ |
| 130 | umount.c \ |
| 131 | uname.c \ |
Elliott Hughes | bb0c2d5 | 2014-01-07 17:34:14 -0800 | [diff] [blame] | 132 | util.c \ |
Elliott Hughes | caca6ee | 2015-01-06 12:18:17 -0800 | [diff] [blame] | 133 | utime.c \ |
| 134 | utimes.c \ |
| 135 | v4l2.c \ |
Elliott Hughes | 5dec78d | 2014-02-26 15:56:23 -0800 | [diff] [blame] | 136 | vsprintf.c \ |
Elliott Hughes | caca6ee | 2015-01-06 12:18:17 -0800 | [diff] [blame] | 137 | wait.c \ |
| 138 | xattr.c \ |
The Android Open Source Project | 34d6eab | 2009-03-03 19:30:45 -0800 | [diff] [blame] | 139 | |
| 140 | LOCAL_SHARED_LIBRARIES := |
| 141 | |
Elliott Hughes | 15fc6a2 | 2014-01-09 10:30:06 -0800 | [diff] [blame] | 142 | LOCAL_CFLAGS := \ |
| 143 | -DGETGROUPS_T=gid_t \ |
| 144 | -DHAVE_ASM_SIGCONTEXT_H=1 \ |
| 145 | -DHAVE_DECL_PTRACE_EVENT_FORK=1 \ |
| 146 | -DHAVE_DECL_PTRACE_EVENT_VFORK=1 \ |
| 147 | -DHAVE_DECL_PTRACE_EVENT_CLONE=1 \ |
| 148 | -DHAVE_DECL_PTRACE_EVENT_EXEC=1 \ |
| 149 | -DHAVE_DECL_PTRACE_EVENT_VFORK_DONE=1 \ |
| 150 | -DHAVE_DECL_PTRACE_EVENT_EXIT=1 \ |
| 151 | -DHAVE_DECL_PTRACE_GETEVENTMSG=1 \ |
| 152 | -DHAVE_DECL_PTRACE_GETSIGINFO=1 \ |
| 153 | -DHAVE_DECL_PTRACE_O_TRACECLONE=1 \ |
| 154 | -DHAVE_DECL_PTRACE_O_TRACEEXEC=1 \ |
| 155 | -DHAVE_DECL_PTRACE_O_TRACEEXIT=1 \ |
| 156 | -DHAVE_DECL_PTRACE_O_TRACEFORK=1 \ |
| 157 | -DHAVE_DECL_PTRACE_O_TRACESYSGOOD=1 \ |
| 158 | -DHAVE_DECL_PTRACE_O_TRACEVFORK=1 \ |
| 159 | -DHAVE_DECL_PTRACE_SETOPTIONS=1 \ |
| 160 | -UHAVE_DECL_IO_CMD_PWRITE \ |
| 161 | -UHAVE_DECL_IO_CMD_PWRITEV \ |
| 162 | -UHAVE_DECL_LO_FLAGS_AUTOCLEAR \ |
| 163 | -UHAVE_DECL_LO_FLAGS_PARTSCAN \ |
| 164 | -DHAVE_DECL_SYS_ERRLIST=1 \ |
Elliott Hughes | a7f5555 | 2014-01-09 16:07:59 -0800 | [diff] [blame] | 165 | -DHAVE_ELF_H=1 \ |
Elliott Hughes | 9e25f2c | 2014-10-03 11:01:13 -0700 | [diff] [blame] | 166 | -DHAVE_FOPEN64=1 \ |
Elliott Hughes | 15fc6a2 | 2014-01-09 10:30:06 -0800 | [diff] [blame] | 167 | -DHAVE_FORK=1 \ |
| 168 | -DHAVE_IF_INDEXTONAME=1 \ |
| 169 | -DHAVE_INET_NTOP=1 \ |
| 170 | -DHAVE_LINUX_CAPABILITY_H=1 \ |
Elliott Hughes | caca6ee | 2015-01-06 12:18:17 -0800 | [diff] [blame] | 171 | -DHAVE_LINUX_FALLOC_H=1 \ |
Elliott Hughes | 0328d0a | 2015-03-18 11:18:43 -0700 | [diff] [blame] | 172 | -DHAVE_LINUX_FILTER_H=1 \ |
Elliott Hughes | 9e25f2c | 2014-10-03 11:01:13 -0700 | [diff] [blame] | 173 | -DHAVE_LINUX_FUTEX_H=1 \ |
Elliott Hughes | 15fc6a2 | 2014-01-09 10:30:06 -0800 | [diff] [blame] | 174 | -DHAVE_LINUX_ICMP_H=1 \ |
| 175 | -DHAVE_LINUX_IF_PACKET_H=1 \ |
| 176 | -DHAVE_LINUX_IN6_H=1 \ |
| 177 | -DHAVE_LINUX_NETLINK_H=1 \ |
Elliott Hughes | 9e25f2c | 2014-10-03 11:01:13 -0700 | [diff] [blame] | 178 | -DHAVE_LINUX_PERF_EVENT_H=1 \ |
Elliott Hughes | 15fc6a2 | 2014-01-09 10:30:06 -0800 | [diff] [blame] | 179 | -DHAVE_LITTLE_ENDIAN_LONG_LONG=1 \ |
| 180 | -DHAVE_LONG_LONG=1 \ |
| 181 | -DHAVE_NETINET_TCP_H=1 \ |
| 182 | -DHAVE_NETINET_UDP_H=1 \ |
| 183 | -DHAVE_POLL_H=1 \ |
| 184 | -DHAVE_PRCTL=1 \ |
Elliott Hughes | 9e25f2c | 2014-10-03 11:01:13 -0700 | [diff] [blame] | 185 | -DHAVE_PWRITEV=1 \ |
Elliott Hughes | 15fc6a2 | 2014-01-09 10:30:06 -0800 | [diff] [blame] | 186 | -DHAVE_SENDMSG=1 \ |
| 187 | -DHAVE_SIGACTION=1 \ |
Elliott Hughes | 15fc6a2 | 2014-01-09 10:30:06 -0800 | [diff] [blame] | 188 | -DHAVE_SIG_ATOMIC_T=1 \ |
Elliott Hughes | 9e25f2c | 2014-10-03 11:01:13 -0700 | [diff] [blame] | 189 | -DHAVE_SIGINFO_T=1 \ |
Elliott Hughes | 0328d0a | 2015-03-18 11:18:43 -0700 | [diff] [blame] | 190 | -DHAVE_SIGINFO_T_SI_OVERRUN=1 \ |
Elliott Hughes | 9e25f2c | 2014-10-03 11:01:13 -0700 | [diff] [blame] | 191 | -DHAVE_SIGINFO_T_SI_SYSCALL=1 \ |
Elliott Hughes | 0328d0a | 2015-03-18 11:18:43 -0700 | [diff] [blame] | 192 | -DHAVE_SIGINFO_T_SI_TIMERID=1 \ |
Elliott Hughes | ad8fa13 | 2014-10-03 11:56:40 -0700 | [diff] [blame] | 193 | -UHAVE_STAT64 \ |
Elliott Hughes | 15fc6a2 | 2014-01-09 10:30:06 -0800 | [diff] [blame] | 194 | -DHAVE_STATFS64=1 \ |
| 195 | -DHAVE_STDBOOL_H=1 \ |
| 196 | -DHAVE_STRERROR=1 \ |
Elliott Hughes | 5dec78d | 2014-02-26 15:56:23 -0800 | [diff] [blame] | 197 | -DHAVE_STRUCT_FLOCK64=1 \ |
Elliott Hughes | caca6ee | 2015-01-06 12:18:17 -0800 | [diff] [blame] | 198 | -DHAVE_STRUCT_MMSGHDR=1 \ |
Elliott Hughes | 15fc6a2 | 2014-01-09 10:30:06 -0800 | [diff] [blame] | 199 | -DHAVE_STRUCT_MSGHDR_MSG_CONTROL=1 \ |
Elliott Hughes | 4e779b4 | 2014-05-07 09:10:38 -0700 | [diff] [blame] | 200 | -DHAVE_STRUCT_SIGCONTEXT=1 \ |
| 201 | -DHAVE_STRUCT_SIGEVENT__SIGEV_UN__PAD=1 \ |
Elliott Hughes | 15fc6a2 | 2014-01-09 10:30:06 -0800 | [diff] [blame] | 202 | -DHAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID=1 \ |
Elliott Hughes | 0328d0a | 2015-03-18 11:18:43 -0700 | [diff] [blame] | 203 | -DHAVE_STRUCT_STATFS64=1 \ |
Elliott Hughes | 9e25f2c | 2014-10-03 11:01:13 -0700 | [diff] [blame] | 204 | -DHAVE_STRUCT_STAT_ST_ACLCNT=0 \ |
Elliott Hughes | 15fc6a2 | 2014-01-09 10:30:06 -0800 | [diff] [blame] | 205 | -DHAVE_STRUCT_STAT_ST_BLKSIZE=1 \ |
| 206 | -DHAVE_STRUCT_STAT_ST_BLOCKS=1 \ |
Elliott Hughes | 9e25f2c | 2014-10-03 11:01:13 -0700 | [diff] [blame] | 207 | -DHAVE_STRUCT_STAT_ST_FLAGS=0 \ |
| 208 | -DHAVE_STRUCT_STAT_ST_FSTYPE=0 \ |
| 209 | -DHAVE_STRUCT_STAT_ST_GEN=0 \ |
| 210 | -DHAVE_STRUCT_STAT_ST_LEVEL=0 \ |
Elliott Hughes | 15fc6a2 | 2014-01-09 10:30:06 -0800 | [diff] [blame] | 211 | -DHAVE_STRUCT_STAT_ST_RDEV=1 \ |
Elliott Hughes | 37be67d | 2014-10-03 09:58:58 -0700 | [diff] [blame] | 212 | -DHAVE_STRUCT_SYSINFO_FREEHIGH=1 \ |
| 213 | -DHAVE_STRUCT_SYSINFO_MEM_UNIT=1 \ |
| 214 | -DHAVE_STRUCT_SYSINFO_TOTALHIGH=1 \ |
Elliott Hughes | 9e25f2c | 2014-10-03 11:01:13 -0700 | [diff] [blame] | 215 | -DHAVE_STRUCT_UTSNAME_DOMAINNAME=1 \ |
Elliott Hughes | 15fc6a2 | 2014-01-09 10:30:06 -0800 | [diff] [blame] | 216 | -DHAVE_SYS_EPOLL_H=1 \ |
| 217 | -DHAVE_SYS_IOCTL_H=1 \ |
| 218 | -DHAVE_SYS_POLL_H=1 \ |
| 219 | -DHAVE_SYS_REG_H=1 \ |
| 220 | -DHAVE_SYS_VFS_H=1 \ |
Elliott Hughes | 0328d0a | 2015-03-18 11:18:43 -0700 | [diff] [blame] | 221 | -DHAVE_SYS_XATTR_H=1 \ |
Elliott Hughes | 15fc6a2 | 2014-01-09 10:30:06 -0800 | [diff] [blame] | 222 | -DMAJOR_IN_SYSMACROS \ |
| 223 | -DPACKAGE_NAME='"strace"' \ |
| 224 | -DVERSION='"$(strace_version)"' \ |
Elliott Hughes | 556f9ae | 2014-03-03 16:08:32 -0800 | [diff] [blame] | 225 | -DSIZEOF_OFF_T=SIZEOF_LONG \ |
Elliott Hughes | 15fc6a2 | 2014-01-09 10:30:06 -0800 | [diff] [blame] | 226 | -DSIZEOF_LONG_LONG=8 \ |
| 227 | -DSTDC_HEADERS=1 \ |
Elliott Hughes | 5dec78d | 2014-02-26 15:56:23 -0800 | [diff] [blame] | 228 | -DSTRACE_KNOWS_ONLY_EABI=1 \ |
Elliott Hughes | 15fc6a2 | 2014-01-09 10:30:06 -0800 | [diff] [blame] | 229 | -D_LFS64_LARGEFILE=1 \ |
| 230 | |
| 231 | LOCAL_CFLAGS += -D_GNU_SOURCE=1 -D_POSIX_SOURCE=1 |
Elliott Hughes | bb0c2d5 | 2014-01-07 17:34:14 -0800 | [diff] [blame] | 232 | |
Elliott Hughes | 4ce18c8 | 2014-04-09 19:23:30 -0700 | [diff] [blame] | 233 | LOCAL_CFLAGS_32 += -DSIZEOF_LONG=4 -DSIZEOF_RLIM_T=4 -DHAVE_STAT64=1 |
Colin Cross | d6b039c | 2014-01-29 18:09:48 -0800 | [diff] [blame] | 234 | LOCAL_CFLAGS_64 += -DSIZEOF_LONG=8 -DSIZEOF_RLIM_T=8 |
Jeff Brown | f76f96e | 2012-03-02 16:23:23 -0800 | [diff] [blame] | 235 | |
Colin Cross | d6b039c | 2014-01-29 18:09:48 -0800 | [diff] [blame] | 236 | LOCAL_CFLAGS_arm += -DARM=1 |
| 237 | LOCAL_CFLAGS_arm += -DHAVE_STRUCT___OLD_KERNEL_STAT=1 |
| 238 | |
| 239 | LOCAL_CFLAGS_arm64 += -DAARCH64=1 |
| 240 | |
Elliott Hughes | 8bcd52d | 2015-03-18 17:07:34 -0700 | [diff] [blame] | 241 | LOCAL_CFLAGS_mips += -DMIPS=1 -DLINUX_MIPSO32=1 |
Colin Cross | d6b039c | 2014-01-29 18:09:48 -0800 | [diff] [blame] | 242 | LOCAL_CFLAGS_mips += -DHAVE_ASM_SYSMIPS_H=1 |
| 243 | |
Elliott Hughes | 2bde1f7 | 2015-03-18 18:00:24 -0700 | [diff] [blame] | 244 | LOCAL_CFLAGS_mips64 += -DMIPS=1 -DLINUX_MIPSN64=1 |
Raghu Gandham | 5577601 | 2014-08-29 12:20:30 -0700 | [diff] [blame] | 245 | LOCAL_CFLAGS_mips64 += -DHAVE_ASM_SYSMIPS_H=1 |
| 246 | |
Colin Cross | d6b039c | 2014-01-29 18:09:48 -0800 | [diff] [blame] | 247 | LOCAL_CFLAGS_x86 += -DI386=1 |
| 248 | LOCAL_CFLAGS_x86 += -DHAVE_STRUCT___OLD_KERNEL_STAT=1 |
| 249 | |
Elliott Hughes | 4ce18c8 | 2014-04-09 19:23:30 -0700 | [diff] [blame] | 250 | LOCAL_CFLAGS_x86_64 += -DX86_64=1 |
Lorenzo Colitti | a0b125c | 2009-08-20 15:06:43 -0700 | [diff] [blame] | 251 | |
Elliott Hughes | bb0c2d5 | 2014-01-07 17:34:14 -0800 | [diff] [blame] | 252 | LOCAL_CFLAGS += \ |
Elliott Hughes | 10bd42d | 2014-01-08 16:34:09 -0800 | [diff] [blame] | 253 | -Wall \ |
Elliott Hughes | 1f72dc7 | 2014-09-22 10:04:17 -0700 | [diff] [blame] | 254 | -Wwrite-strings \ |
| 255 | -Wsign-compare \ |
Elliott Hughes | bb0c2d5 | 2014-01-07 17:34:14 -0800 | [diff] [blame] | 256 | -Wno-missing-field-initializers \ |
| 257 | -Wno-unused-parameter \ |
| 258 | -Wno-sign-compare \ |
Jeff Brown | f76f96e | 2012-03-02 16:23:23 -0800 | [diff] [blame] | 259 | |
Elliott Hughes | 0328d0a | 2015-03-18 11:18:43 -0700 | [diff] [blame] | 260 | LOCAL_C_INCLUDES_arm := $(LOCAL_PATH)/linux/arm $(LOCAL_PATH)/linux |
| 261 | LOCAL_C_INCLUDES_arm64 := $(LOCAL_PATH)/linux/aarch64 $(LOCAL_PATH)/linux |
| 262 | LOCAL_C_INCLUDES_mips := $(LOCAL_PATH)/linux/mips $(LOCAL_PATH)/linux |
| 263 | LOCAL_C_INCLUDES_mips64 := $(LOCAL_PATH)/linux/mips $(LOCAL_PATH)/linux |
| 264 | LOCAL_C_INCLUDES_x86 := $(LOCAL_PATH)/linux/i386 $(LOCAL_PATH)/linux |
| 265 | LOCAL_C_INCLUDES_x86_64 := $(LOCAL_PATH)/linux/x86_64 $(LOCAL_PATH)/linux |
Colin Cross | d6b039c | 2014-01-29 18:09:48 -0800 | [diff] [blame] | 266 | |
The Android Open Source Project | 34d6eab | 2009-03-03 19:30:45 -0800 | [diff] [blame] | 267 | LOCAL_MODULE := strace |
| 268 | |
| 269 | LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES) |
| 270 | |
| 271 | LOCAL_MODULE_TAGS := debug |
| 272 | |
Elliott Hughes | bb0c2d5 | 2014-01-07 17:34:14 -0800 | [diff] [blame] | 273 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
| 274 | |
The Android Open Source Project | 34d6eab | 2009-03-03 19:30:45 -0800 | [diff] [blame] | 275 | include $(BUILD_EXECUTABLE) |
Elliott Hughes | 7c53832 | 2014-02-28 10:32:04 -0800 | [diff] [blame] | 276 | |
Elliott Hughes | 858a5c7 | 2014-02-28 15:58:12 -0800 | [diff] [blame] | 277 | |
Elliott Hughes | 7c53832 | 2014-02-28 10:32:04 -0800 | [diff] [blame] | 278 | # ------------------------------------------------------------------------- |
| 279 | |
Elliott Hughes | 0328d0a | 2015-03-18 11:18:43 -0700 | [diff] [blame] | 280 | # TODO: this is currently broken; the checked in ioctlent*.h files are from the 4.10 release. |
| 281 | |
Elliott Hughes | 7c53832 | 2014-02-28 10:32:04 -0800 | [diff] [blame] | 282 | .PHONY: update-ioctls |
| 283 | update-ioctls: |
| 284 | # Build the generated .h files needed by ioctlsort from the current bionic uapi headers. |
| 285 | cd external/strace; ./linux/ioctlent.sh ../../bionic/libc/kernel/uapi/ |
| 286 | # Build the ioctlsort tool. |
Elliott Hughes | 992aba7 | 2015-01-22 22:44:54 -0800 | [diff] [blame] | 287 | ONE_SHOT_MAKEFILE=external/strace/Android.mk make -f build/core/main.mk $(HOST_OUT_EXECUTABLES)/ioctlsort |
Elliott Hughes | 7c53832 | 2014-02-28 10:32:04 -0800 | [diff] [blame] | 288 | # Remove the generated .h files now we've built ioctlsort. |
| 289 | rm external/strace/ioctls.h external/strace/ioctldefs.h |
Elliott Hughes | 992aba7 | 2015-01-22 22:44:54 -0800 | [diff] [blame] | 290 | # Run the ioctlsort tool to generate the one file we do want to check in. |
| 291 | ioctlsort | tr -d '\r' | sed 's/^\([[:space:]]*{\)"[^"]\+",[[:space:]]*/\1/' | sort -u -k2,2 -k1,1 > external/strace/linux/ioctlent.h |
Elliott Hughes | 7c53832 | 2014-02-28 10:32:04 -0800 | [diff] [blame] | 292 | # Rebuild strace with the new "ioctlent.h". |
Elliott Hughes | 992aba7 | 2015-01-22 22:44:54 -0800 | [diff] [blame] | 293 | ONE_SHOT_MAKEFILE=external/strace/Android.mk make -f build/core/main.mk $(TARGET_OUT_OPTIONAL_EXECUTABLES)/strace |
Elliott Hughes | 7c53832 | 2014-02-28 10:32:04 -0800 | [diff] [blame] | 294 | |
| 295 | # We don't build ioctlsort unless really necessary, because we don't check |
| 296 | # in the temporary files needed to build it. This tool is only necessary |
| 297 | # when updating strace's list of ioctls. |
Elliott Hughes | 992aba7 | 2015-01-22 22:44:54 -0800 | [diff] [blame] | 298 | ifneq (,$(filter $(HOST_OUT_EXECUTABLES)/ioctlsort,$(MAKECMDGOALS))) |
Elliott Hughes | 7c53832 | 2014-02-28 10:32:04 -0800 | [diff] [blame] | 299 | include $(CLEAR_VARS) |
Elliott Hughes | caca6ee | 2015-01-06 12:18:17 -0800 | [diff] [blame] | 300 | LOCAL_SRC_FILES := ioctlsort.c |
Elliott Hughes | 992aba7 | 2015-01-22 22:44:54 -0800 | [diff] [blame] | 301 | # As long as ashmem isn't in glibc, we need the bionic header. |
| 302 | # Unfortunately, it uses __u32 without pulling in a definition, so we need asm/types.h too. |
| 303 | LOCAL_CFLAGS += -include asm/types.h -include bionic/libc/kernel/uapi/linux/ashmem.h |
Elliott Hughes | 7c53832 | 2014-02-28 10:32:04 -0800 | [diff] [blame] | 304 | LOCAL_CFLAGS += -Wno-unused-parameter |
| 305 | LOCAL_MODULE := ioctlsort |
| 306 | LOCAL_MODULE_TAGS := optional |
| 307 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
Elliott Hughes | 992aba7 | 2015-01-22 22:44:54 -0800 | [diff] [blame] | 308 | include $(BUILD_HOST_EXECUTABLE) |
Elliott Hughes | 7c53832 | 2014-02-28 10:32:04 -0800 | [diff] [blame] | 309 | endif |
| 310 | |
| 311 | # ------------------------------------------------------------------------- |