// Copyright 2019 The Android Open Source Project // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. cc_binary_host { name: "m4", cflags: ["-Wno-unused-parameter"], stl: "none", local_include_dirs: [ "lib", "src", ], srcs: [ "src/m4.c", "src/builtin.c", "src/debug.c", "src/eval.c", "src/format.c", "src/freeze.c", "src/input.c", "src/macro.c", "src/output.c", "src/path.c", "src/symtab.c", "lib/gl_avltree_oset.c", "lib/binary-io.c", "lib/c-ctype.c", "lib/c-stack.c", "lib/c-strcasecmp.c", "lib/c-strncasecmp.c", "lib/clean-temp.c", "lib/cloexec.c", "lib/close-stream.c", "lib/closein.c", "lib/closeout.c", "lib/dirname.c", "lib/basename.c", "lib/dirname-lgpl.c", "lib/basename-lgpl.c", "lib/stripslash.c", "lib/execute.c", "lib/exitfail.c", "lib/fatal-signal.c", "lib/fd-hook.c", "lib/fd-safer-flag.c", "lib/dup-safer-flag.c", "lib/filenamecat.c", "lib/filenamecat-lgpl.c", "lib/fopen-safer.c", "lib/freading.c", "lib/getprogname.c", "lib/hard-locale.c", "lib/gl_linkedhash_list.c", "lib/gl_list.c", "lib/localcharset.c", "lib/glthread/lock.c", "lib/malloca.c", "lib/math.c", "lib/memchr2.c", "lib/gl_oset.c", "lib/pipe2.c", "lib/pipe2-safer.c", "lib/printf-frexp.c", "lib/printf-frexpl.c", "lib/progname.c", "lib/quotearg.c", "lib/sig-handler.c", "lib/spawn-pipe.c", "lib/mkstemp-safer.c", "lib/tempname.c", "lib/glthread/threadlib.c", "lib/glthread/tls.c", "lib/tmpdir.c", "lib/unistd.c", "lib/dup-safer.c", "lib/fd-safer.c", "lib/pipe-safer.c", "lib/verror.c", "lib/version-etc.c", "lib/version-etc-fsf.c", "lib/wait-process.c", "lib/wctype-h.c", "lib/xmalloc.c", "lib/xalloc-die.c", "lib/gl_xlist.c", "lib/xmalloca.c", "lib/gl_xoset.c", "lib/xprintf.c", "lib/xsize.c", "lib/xstrndup.c", "lib/xvasprintf.c", "lib/xasprintf.c", "lib/asnprintf.c", "lib/fclose.c", "lib/fflush.c", "lib/fpurge.c", "lib/fseek.c", "lib/obstack.c", "lib/printf-args.c", "lib/printf-parse.c", "lib/vasnprintf.c", ], target: { glibc: { local_include_dirs: ["soong/linux_glibc"], srcs: [ "lib/fcntl.c", "lib/freadahead.c", "lib/fseeko.c", "lib/mbrtowc.c", ], // TODO(b/131098715): remove static_libs: ["libcompiler_rt"], }, musl: { local_include_dirs: ["soong/linux_musl"], srcs: [ "lib/canonicalize-lgpl.c", "lib/error.c", "lib/fcntl.c", "lib/getopt1.c", "lib/getopt.c", "lib/isnanf.c", "lib/isnanl.c", "lib/mbrtowc.c", "lib/rawmemchr.c", "lib/regex.c", "lib/spawn_faction_addclose.c", "lib/spawn_faction_adddup2.c", "lib/spawn_faction_addopen.c", ], // TODO(b/131098715): remove static_libs: ["libcompiler_rt"], }, darwin: { local_include_dirs: ["soong/darwin"], srcs: [ "lib/asprintf.c", "lib/canonicalize-lgpl.c", "lib/error.c", "lib/fpending.c", "lib/freadahead.c", "lib/fseeko.c", "lib/getopt.c", "lib/getopt1.c", "lib/isnanf.c", "lib/isnanl.c", "lib/lstat.c", "lib/open.c", "lib/rawmemchr.c", "lib/readlink.c", "lib/regex.c", "lib/rename.c", "lib/secure_getenv.c", "lib/stat.c", "lib/strchrnul.c", "lib/strerror.c", "lib/strerror-override.c", "lib/strstr.c", "lib/vasprintf.c", ], }, }, }