aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Makefile.in137
-rw-r--r--lib/faccessat.c4
-rw-r--r--lib/fpending.c6
-rw-r--r--lib/open.c4
-rw-r--r--lib/unistd.c2
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 @@
20srcdir = @srcdir@ 20srcdir = @srcdir@
21VPATH = @srcdir@ 21VPATH = @srcdir@
22 22
23# This is not empty if this is a Makefile that will be copied to
24# xcompile/lib.
25XCONFIGURE = @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.
30ANDROID_CFLAGS = @ANDROID_CFLAGS@
31
32ifneq ($(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
41vpath _Noreturn.h $(srcdir)
42vpath acl-internal.h $(srcdir)
43vpath acl.h $(srcdir)
44vpath af_alg.h $(srcdir)
45vpath alloca.in.h $(srcdir)
46vpath allocator.h $(srcdir)
47vpath arg-nonnull.h $(srcdir)
48vpath assert.in.h $(srcdir)
49vpath attribute.h $(srcdir)
50vpath binary-io.h $(srcdir)
51vpath byteswap.in.h $(srcdir)
52vpath c++defs.h $(srcdir)
53vpath c-ctype.h $(srcdir)
54vpath c-strcase.h $(srcdir)
55vpath careadlinkat.h $(srcdir)
56vpath cdefs.h $(srcdir)
57vpath cloexec.h $(srcdir)
58vpath close-stream.h $(srcdir)
59vpath count-leading-zeros.h $(srcdir)
60vpath count-one-bits.h $(srcdir)
61vpath count-trailing-zeros.h $(srcdir)
62vpath diffseq.h $(srcdir)
63vpath dirent.h $(srcdir)
64vpath dirent.in.h $(srcdir)
65vpath dynarray.h $(srcdir)
66vpath eloop-threshold.h $(srcdir)
67vpath errno.in.h $(srcdir)
68vpath execinfo.in.h $(srcdir)
69vpath fcntl.in.h $(srcdir)
70vpath filemode.h $(srcdir)
71vpath filename.h $(srcdir)
72vpath filevercmp.h $(srcdir)
73vpath fingerprint.h $(srcdir)
74vpath flexmember.h $(srcdir)
75vpath fpending.h $(srcdir)
76vpath fsusage.h $(srcdir)
77vpath ftoastr.h $(srcdir)
78vpath getopt-cdefs.in.h $(srcdir)
79vpath getopt-core.h $(srcdir)
80vpath getopt-ext.h $(srcdir)
81vpath getopt-pfx-core.h $(srcdir)
82vpath getopt-pfx-ext.h $(srcdir)
83vpath getopt.in.h $(srcdir)
84vpath getopt_int.h $(srcdir)
85vpath gettext.h $(srcdir)
86vpath idx.h $(srcdir)
87vpath ieee754.in.h $(srcdir)
88vpath ignore-value.h $(srcdir)
89vpath intprops-internal.h $(srcdir)
90vpath intprops.h $(srcdir)
91vpath inttypes.in.h $(srcdir)
92vpath libc-config.h $(srcdir)
93vpath limits.in.h $(srcdir)
94vpath malloc/dynarray.h $(srcdir)
95vpath malloc/scratch_buffer.h $(srcdir)
96vpath md5.h $(srcdir)
97vpath min-max.h $(srcdir)
98vpath mini-gmp.h $(srcdir)
99vpath minmax.h $(srcdir)
100vpath mktime-internal.h $(srcdir)
101vpath nproc.h $(srcdir)
102vpath openat-priv.h $(srcdir)
103vpath openat.h $(srcdir)
104vpath pathmax.h $(srcdir)
105vpath regex.h $(srcdir)
106vpath regex_internal.h $(srcdir)
107vpath root-uid.h $(srcdir)
108vpath save-cwd.h $(srcdir)
109vpath scratch_buffer.h $(srcdir)
110vpath sha1.h $(srcdir)
111vpath sha256.h $(srcdir)
112vpath sha512.h $(srcdir)
113vpath sig2str.h $(srcdir)
114vpath signal.in.h $(srcdir)
115vpath stat-time.h $(srcdir)
116vpath stdalign.in.h $(srcdir)
117vpath stdckdint.in.h $(srcdir)
118vpath stddef.in.h $(srcdir)
119vpath stdint.in.h $(srcdir)
120vpath stdio-impl.h $(srcdir)
121vpath stdio.h $(srcdir)
122vpath stdio.in.h $(srcdir)
123vpath stdlib.in.h $(srcdir)
124vpath str-two-way.h $(srcdir)
125vpath strftime.h $(srcdir)
126vpath string.in.h $(srcdir)
127vpath sys_random.in.h $(srcdir)
128vpath sys_select.in.h $(srcdir)
129vpath sys_stat.in.h $(srcdir)
130vpath sys_time.in.h $(srcdir)
131vpath sys_types.in.h $(srcdir)
132vpath tempname.h $(srcdir)
133vpath time-internal.h $(srcdir)
134vpath time.in.h $(srcdir)
135vpath timespec.h $(srcdir)
136vpath u64.h $(srcdir)
137vpath unistd.in.h $(srcdir)
138vpath unlocked-io.h $(srcdir)
139vpath utimens.h $(srcdir)
140vpath verify.h $(srcdir)
141vpath vla.h $(srcdir)
142vpath warn-on-use.h $(srcdir)
143vpath xalloc-oversized.h $(srcdir)
144vpath %.c $(srcdir)
145endif
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.
25abs_top_srcdir = @abs_top_srcdir@ 149abs_top_srcdir = @abs_top_srcdir@
@@ -33,11 +157,11 @@ all:
33 157
34HAVE_NATIVE_COMP = @HAVE_NATIVE_COMP@ 158HAVE_NATIVE_COMP = @HAVE_NATIVE_COMP@
35 159
36ALL_CFLAGS= \ 160ALL_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
42ifeq ($(HAVE_NATIVE_COMP),yes) 166ifeq ($(HAVE_NATIVE_COMP),yes)
43ALL_CFLAGS += -DGL_COMPILE_CRYPTO_STREAM 167ALL_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
53endif 177endif
54 178
179ifeq ($(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.
182ALL_CFLAGS += -I$(top_srcdir)/xcompile -I.
183endif
184
55DEPDIR = deps 185DEPDIR = deps
56ifeq ($(AUTO_DEPEND),yes) 186ifeq ($(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 =
61endif 191endif
62 192
193# This piece of code interferes with cross compilation
194ifeq ($(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 $@)
66Makefile: ../config.status $(srcdir)/Makefile.in 198Makefile: ../config.status $(srcdir)/Makefile.in
67 $(MAKE) -C .. lib/$@ 199 $(MAKE) -C .. lib/$@
200endif
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 @@
33size_t 33size_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>
22typedef int dummy; 22typedef int dummy;