diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/Makefile.in | 137 | ||||
| -rw-r--r-- | lib/faccessat.c | 4 | ||||
| -rw-r--r-- | lib/fpending.c | 6 | ||||
| -rw-r--r-- | lib/open.c | 4 | ||||
| -rw-r--r-- | lib/unistd.c | 2 |
5 files changed, 148 insertions, 5 deletions
diff --git a/lib/Makefile.in b/lib/Makefile.in index 8b950136241..caf8e0fbec3 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in | |||
| @@ -20,6 +20,130 @@ | |||
| 20 | srcdir = @srcdir@ | 20 | srcdir = @srcdir@ |
| 21 | VPATH = @srcdir@ | 21 | VPATH = @srcdir@ |
| 22 | 22 | ||
| 23 | # This is not empty if this is a Makefile that will be copied to | ||
| 24 | # xcompile/lib. | ||
| 25 | XCONFIGURE = @XCONFIGURE@ | ||
| 26 | |||
| 27 | # This is required to make sure symbol visibility is correct and | ||
| 28 | # functions like readlinkat do not end up replacing their OS | ||
| 29 | # counterparts. | ||
| 30 | ANDROID_CFLAGS = @ANDROID_CFLAGS@ | ||
| 31 | |||
| 32 | ifneq ($(XCONFIGURE),) | ||
| 33 | |||
| 34 | # Set vpath. Only look for C files and some headers in srcdir: | ||
| 35 | # Headers that are generated by gnulib must be spared, or otherwise | ||
| 36 | # the versions previously built on the host will be used, if builddir | ||
| 37 | # is the same as srcdir. Following this is a list of files in lib/ | ||
| 38 | # that are not generated during the gnulib build process. Please keep | ||
| 39 | # it up to date! | ||
| 40 | |||
| 41 | vpath _Noreturn.h $(srcdir) | ||
| 42 | vpath acl-internal.h $(srcdir) | ||
| 43 | vpath acl.h $(srcdir) | ||
| 44 | vpath af_alg.h $(srcdir) | ||
| 45 | vpath alloca.in.h $(srcdir) | ||
| 46 | vpath allocator.h $(srcdir) | ||
| 47 | vpath arg-nonnull.h $(srcdir) | ||
| 48 | vpath assert.in.h $(srcdir) | ||
| 49 | vpath attribute.h $(srcdir) | ||
| 50 | vpath binary-io.h $(srcdir) | ||
| 51 | vpath byteswap.in.h $(srcdir) | ||
| 52 | vpath c++defs.h $(srcdir) | ||
| 53 | vpath c-ctype.h $(srcdir) | ||
| 54 | vpath c-strcase.h $(srcdir) | ||
| 55 | vpath careadlinkat.h $(srcdir) | ||
| 56 | vpath cdefs.h $(srcdir) | ||
| 57 | vpath cloexec.h $(srcdir) | ||
| 58 | vpath close-stream.h $(srcdir) | ||
| 59 | vpath count-leading-zeros.h $(srcdir) | ||
| 60 | vpath count-one-bits.h $(srcdir) | ||
| 61 | vpath count-trailing-zeros.h $(srcdir) | ||
| 62 | vpath diffseq.h $(srcdir) | ||
| 63 | vpath dirent.h $(srcdir) | ||
| 64 | vpath dirent.in.h $(srcdir) | ||
| 65 | vpath dynarray.h $(srcdir) | ||
| 66 | vpath eloop-threshold.h $(srcdir) | ||
| 67 | vpath errno.in.h $(srcdir) | ||
| 68 | vpath execinfo.in.h $(srcdir) | ||
| 69 | vpath fcntl.in.h $(srcdir) | ||
| 70 | vpath filemode.h $(srcdir) | ||
| 71 | vpath filename.h $(srcdir) | ||
| 72 | vpath filevercmp.h $(srcdir) | ||
| 73 | vpath fingerprint.h $(srcdir) | ||
| 74 | vpath flexmember.h $(srcdir) | ||
| 75 | vpath fpending.h $(srcdir) | ||
| 76 | vpath fsusage.h $(srcdir) | ||
| 77 | vpath ftoastr.h $(srcdir) | ||
| 78 | vpath getopt-cdefs.in.h $(srcdir) | ||
| 79 | vpath getopt-core.h $(srcdir) | ||
| 80 | vpath getopt-ext.h $(srcdir) | ||
| 81 | vpath getopt-pfx-core.h $(srcdir) | ||
| 82 | vpath getopt-pfx-ext.h $(srcdir) | ||
| 83 | vpath getopt.in.h $(srcdir) | ||
| 84 | vpath getopt_int.h $(srcdir) | ||
| 85 | vpath gettext.h $(srcdir) | ||
| 86 | vpath idx.h $(srcdir) | ||
| 87 | vpath ieee754.in.h $(srcdir) | ||
| 88 | vpath ignore-value.h $(srcdir) | ||
| 89 | vpath intprops-internal.h $(srcdir) | ||
| 90 | vpath intprops.h $(srcdir) | ||
| 91 | vpath inttypes.in.h $(srcdir) | ||
| 92 | vpath libc-config.h $(srcdir) | ||
| 93 | vpath limits.in.h $(srcdir) | ||
| 94 | vpath malloc/dynarray.h $(srcdir) | ||
| 95 | vpath malloc/scratch_buffer.h $(srcdir) | ||
| 96 | vpath md5.h $(srcdir) | ||
| 97 | vpath min-max.h $(srcdir) | ||
| 98 | vpath mini-gmp.h $(srcdir) | ||
| 99 | vpath minmax.h $(srcdir) | ||
| 100 | vpath mktime-internal.h $(srcdir) | ||
| 101 | vpath nproc.h $(srcdir) | ||
| 102 | vpath openat-priv.h $(srcdir) | ||
| 103 | vpath openat.h $(srcdir) | ||
| 104 | vpath pathmax.h $(srcdir) | ||
| 105 | vpath regex.h $(srcdir) | ||
| 106 | vpath regex_internal.h $(srcdir) | ||
| 107 | vpath root-uid.h $(srcdir) | ||
| 108 | vpath save-cwd.h $(srcdir) | ||
| 109 | vpath scratch_buffer.h $(srcdir) | ||
| 110 | vpath sha1.h $(srcdir) | ||
| 111 | vpath sha256.h $(srcdir) | ||
| 112 | vpath sha512.h $(srcdir) | ||
| 113 | vpath sig2str.h $(srcdir) | ||
| 114 | vpath signal.in.h $(srcdir) | ||
| 115 | vpath stat-time.h $(srcdir) | ||
| 116 | vpath stdalign.in.h $(srcdir) | ||
| 117 | vpath stdckdint.in.h $(srcdir) | ||
| 118 | vpath stddef.in.h $(srcdir) | ||
| 119 | vpath stdint.in.h $(srcdir) | ||
| 120 | vpath stdio-impl.h $(srcdir) | ||
| 121 | vpath stdio.h $(srcdir) | ||
| 122 | vpath stdio.in.h $(srcdir) | ||
| 123 | vpath stdlib.in.h $(srcdir) | ||
| 124 | vpath str-two-way.h $(srcdir) | ||
| 125 | vpath strftime.h $(srcdir) | ||
| 126 | vpath string.in.h $(srcdir) | ||
| 127 | vpath sys_random.in.h $(srcdir) | ||
| 128 | vpath sys_select.in.h $(srcdir) | ||
| 129 | vpath sys_stat.in.h $(srcdir) | ||
| 130 | vpath sys_time.in.h $(srcdir) | ||
| 131 | vpath sys_types.in.h $(srcdir) | ||
| 132 | vpath tempname.h $(srcdir) | ||
| 133 | vpath time-internal.h $(srcdir) | ||
| 134 | vpath time.in.h $(srcdir) | ||
| 135 | vpath timespec.h $(srcdir) | ||
| 136 | vpath u64.h $(srcdir) | ||
| 137 | vpath unistd.in.h $(srcdir) | ||
| 138 | vpath unlocked-io.h $(srcdir) | ||
| 139 | vpath utimens.h $(srcdir) | ||
| 140 | vpath verify.h $(srcdir) | ||
| 141 | vpath vla.h $(srcdir) | ||
| 142 | vpath warn-on-use.h $(srcdir) | ||
| 143 | vpath xalloc-oversized.h $(srcdir) | ||
| 144 | vpath %.c $(srcdir) | ||
| 145 | endif | ||
| 146 | |||
| 23 | # Variables substituted by 'configure', and not autogenerated in gnulib.mk, | 147 | # Variables substituted by 'configure', and not autogenerated in gnulib.mk, |
| 24 | # or needed before gnulib.mk is included. | 148 | # or needed before gnulib.mk is included. |
| 25 | abs_top_srcdir = @abs_top_srcdir@ | 149 | abs_top_srcdir = @abs_top_srcdir@ |
| @@ -33,11 +157,11 @@ all: | |||
| 33 | 157 | ||
| 34 | HAVE_NATIVE_COMP = @HAVE_NATIVE_COMP@ | 158 | HAVE_NATIVE_COMP = @HAVE_NATIVE_COMP@ |
| 35 | 159 | ||
| 36 | ALL_CFLAGS= \ | 160 | ALL_CFLAGS = \ |
| 37 | $(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) $(DEPFLAGS) \ | 161 | $(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) $(DEPFLAGS) \ |
| 38 | $(GNULIB_WARN_CFLAGS) $(WERROR_CFLAGS) $(PROFILING_CFLAGS) $(CFLAGS) \ | 162 | $(GNULIB_WARN_CFLAGS) $(WERROR_CFLAGS) $(PROFILING_CFLAGS) $(CFLAGS) \ |
| 39 | -I. -I../src -I$(srcdir) -I$(srcdir)/../src \ | 163 | -I. -I../src -I$(srcdir) -I$(srcdir)/../src \ |
| 40 | $(if $(patsubst e-%,,$(notdir $<)),,-Demacs) | 164 | $(if $(patsubst e-%,,$(notdir $<)),,-Demacs) $(ANDROID_CFLAGS) |
| 41 | 165 | ||
| 42 | ifeq ($(HAVE_NATIVE_COMP),yes) | 166 | ifeq ($(HAVE_NATIVE_COMP),yes) |
| 43 | ALL_CFLAGS += -DGL_COMPILE_CRYPTO_STREAM | 167 | ALL_CFLAGS += -DGL_COMPILE_CRYPTO_STREAM |
| @@ -52,6 +176,12 @@ ifneq ($(SYSTEM_TYPE),windows-nt) | |||
| 52 | libgnu_a_SOURCES += openat-die.c save-cwd.c | 176 | libgnu_a_SOURCES += openat-die.c save-cwd.c |
| 53 | endif | 177 | endif |
| 54 | 178 | ||
| 179 | ifeq ($(XCONFIGURE),android) | ||
| 180 | # The next line is necessary to override -I$(srcdir), which will end | ||
| 181 | # up pulling in lots of headers from the host. | ||
| 182 | ALL_CFLAGS += -I$(top_srcdir)/xcompile -I. | ||
| 183 | endif | ||
| 184 | |||
| 55 | DEPDIR = deps | 185 | DEPDIR = deps |
| 56 | ifeq ($(AUTO_DEPEND),yes) | 186 | ifeq ($(AUTO_DEPEND),yes) |
| 57 | DEPFLAGS = -MMD -MF $(DEPDIR)/$*.d -MP | 187 | DEPFLAGS = -MMD -MF $(DEPDIR)/$*.d -MP |
| @@ -60,11 +190,14 @@ else | |||
| 60 | DEPFLAGS = | 190 | DEPFLAGS = |
| 61 | endif | 191 | endif |
| 62 | 192 | ||
| 193 | # This piece of code interferes with cross compilation | ||
| 194 | ifeq ($(XCONFIGURE),) | ||
| 63 | .PRECIOUS: ../config.status Makefile | 195 | .PRECIOUS: ../config.status Makefile |
| 64 | ../config.status: $(top_srcdir)/configure.ac $(top_srcdir)/m4/*.m4 | 196 | ../config.status: $(top_srcdir)/configure.ac $(top_srcdir)/m4/*.m4 |
| 65 | $(MAKE) -C .. $(notdir $@) | 197 | $(MAKE) -C .. $(notdir $@) |
| 66 | Makefile: ../config.status $(srcdir)/Makefile.in | 198 | Makefile: ../config.status $(srcdir)/Makefile.in |
| 67 | $(MAKE) -C .. lib/$@ | 199 | $(MAKE) -C .. lib/$@ |
| 200 | endif | ||
| 68 | 201 | ||
| 69 | # Object modules that need not be built for Emacs. | 202 | # Object modules that need not be built for Emacs. |
| 70 | # Emacs does not need e-regex.o (it has its own regex-emacs.c), | 203 | # Emacs does not need e-regex.o (it has its own regex-emacs.c), |
diff --git a/lib/faccessat.c b/lib/faccessat.c index c1737d03a10..30a22da7eb1 100644 --- a/lib/faccessat.c +++ b/lib/faccessat.c | |||
| @@ -43,7 +43,11 @@ orig_faccessat (int fd, char const *name, int mode, int flag) | |||
| 43 | /* Write "unistd.h" here, not <unistd.h>, otherwise OSF/1 5.1 DTK cc | 43 | /* Write "unistd.h" here, not <unistd.h>, otherwise OSF/1 5.1 DTK cc |
| 44 | eliminates this include because of the preliminary #include <unistd.h> | 44 | eliminates this include because of the preliminary #include <unistd.h> |
| 45 | above. */ | 45 | above. */ |
| 46 | #ifdef __ANROID__ | ||
| 47 | #include <unistd.h> | ||
| 48 | #else | ||
| 46 | #include "unistd.h" | 49 | #include "unistd.h" |
| 50 | #endif | ||
| 47 | 51 | ||
| 48 | #ifndef HAVE_ACCESS | 52 | #ifndef HAVE_ACCESS |
| 49 | /* Mingw lacks access, but it also lacks real vs. effective ids, so | 53 | /* Mingw lacks access, but it also lacks real vs. effective ids, so |
diff --git a/lib/fpending.c b/lib/fpending.c index 6408cff4647..45daa2586a0 100644 --- a/lib/fpending.c +++ b/lib/fpending.c | |||
| @@ -33,13 +33,15 @@ | |||
| 33 | size_t | 33 | size_t |
| 34 | __fpending (FILE *fp) | 34 | __fpending (FILE *fp) |
| 35 | { | 35 | { |
| 36 | #if defined __ANDROID__ | ||
| 37 | return 0; | ||
| 36 | /* Most systems provide FILE as a struct and the necessary bitmask in | 38 | /* Most systems provide FILE as a struct and the necessary bitmask in |
| 37 | <stdio.h>, because they need it for implementing getc() and putc() as | 39 | <stdio.h>, because they need it for implementing getc() and putc() as |
| 38 | fast macros. */ | 40 | fast macros. */ |
| 39 | #if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 | 41 | #elif defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 |
| 40 | /* GNU libc, BeOS, Haiku, Linux libc5 */ | 42 | /* GNU libc, BeOS, Haiku, Linux libc5 */ |
| 41 | return fp->_IO_write_ptr - fp->_IO_write_base; | 43 | return fp->_IO_write_ptr - fp->_IO_write_base; |
| 42 | #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__ | 44 | #elif defined __sferror || defined __DragonFly__ |
| 43 | /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin < 1.7.34, Minix 3, Android */ | 45 | /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin < 1.7.34, Minix 3, Android */ |
| 44 | return fp->_p - fp->_bf._base; | 46 | return fp->_p - fp->_bf._base; |
| 45 | #elif defined __EMX__ /* emx+gcc */ | 47 | #elif defined __EMX__ /* emx+gcc */ |
diff --git a/lib/open.c b/lib/open.c index 170bff108e3..dd7c90b3bd6 100644 --- a/lib/open.c +++ b/lib/open.c | |||
| @@ -40,7 +40,11 @@ orig_open (const char *filename, int flags, mode_t mode) | |||
| 40 | /* Specification. */ | 40 | /* Specification. */ |
| 41 | /* Write "fcntl.h" here, not <fcntl.h>, otherwise OSF/1 5.1 DTK cc eliminates | 41 | /* Write "fcntl.h" here, not <fcntl.h>, otherwise OSF/1 5.1 DTK cc eliminates |
| 42 | this include because of the preliminary #include <fcntl.h> above. */ | 42 | this include because of the preliminary #include <fcntl.h> above. */ |
| 43 | #ifdef __ANDROID__ | ||
| 44 | #include <fnctl.h> | ||
| 45 | #else | ||
| 43 | #include "fcntl.h" | 46 | #include "fcntl.h" |
| 47 | #endif | ||
| 44 | 48 | ||
| 45 | #include "cloexec.h" | 49 | #include "cloexec.h" |
| 46 | 50 | ||
diff --git a/lib/unistd.c b/lib/unistd.c index 95978e6ad0a..dcc70091155 100644 --- a/lib/unistd.c +++ b/lib/unistd.c | |||
| @@ -18,5 +18,5 @@ | |||
| 18 | #include <config.h> | 18 | #include <config.h> |
| 19 | 19 | ||
| 20 | #define _GL_UNISTD_INLINE _GL_EXTERN_INLINE | 20 | #define _GL_UNISTD_INLINE _GL_EXTERN_INLINE |
| 21 | #include "unistd.h" | 21 | #include <unistd.h> |
| 22 | typedef int dummy; | 22 | typedef int dummy; |