From 7f64bcd6acbffcff63ab05fc5508e938169249f4 Mon Sep 17 00:00:00 2001 From: Giacomo Tesio Date: Thu, 7 Sep 2017 22:35:51 +0200 Subject: [PATCH] jehanne: let libposix define environ --- newlib/libc/sys/jehanne/Makefile.am | 2 +- newlib/libc/sys/jehanne/Makefile.in | 11 +++++++++-- newlib/libc/sys/jehanne/environ.c | 19 +++++++++++++++++++ 3 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 newlib/libc/sys/jehanne/environ.c diff --git a/newlib/libc/sys/jehanne/Makefile.am b/newlib/libc/sys/jehanne/Makefile.am index 295cc0c58..eef8b508e 100644 --- a/newlib/libc/sys/jehanne/Makefile.am +++ b/newlib/libc/sys/jehanne/Makefile.am @@ -12,7 +12,7 @@ extra_objs = endif lib_a_SOURCES = getenv_r.c getenv.c malloc.c mallocr.c free.c freer.c \ - calloc.c callocr.c realloc.c reallocr.c + calloc.c callocr.c realloc.c reallocr.c environ.c lib_a_LIBADD = $(extra_objs) EXTRA_lib_a_SOURCES = libposix_conf.c syscalls.c chown.c getrusage.c \ diff --git a/newlib/libc/sys/jehanne/Makefile.in b/newlib/libc/sys/jehanne/Makefile.in index 916f4a235..0414e9063 100644 --- a/newlib/libc/sys/jehanne/Makefile.in +++ b/newlib/libc/sys/jehanne/Makefile.in @@ -58,7 +58,8 @@ am_lib_a_OBJECTS = lib_a-getenv_r.$(OBJEXT) lib_a-getenv.$(OBJEXT) \ lib_a-malloc.$(OBJEXT) lib_a-mallocr.$(OBJEXT) \ lib_a-free.$(OBJEXT) lib_a-freer.$(OBJEXT) \ lib_a-calloc.$(OBJEXT) lib_a-callocr.$(OBJEXT) \ - lib_a-realloc.$(OBJEXT) lib_a-reallocr.$(OBJEXT) + lib_a-realloc.$(OBJEXT) lib_a-reallocr.$(OBJEXT) \ + lib_a-environ.$(OBJEXT) lib_a_OBJECTS = $(am_lib_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = @@ -182,7 +183,7 @@ noinst_LIBRARIES = lib.a @MAY_SUPPLY_SYSCALLS_TRUE@ chmod.o lib_a_SOURCES = getenv_r.c getenv.c malloc.c mallocr.c free.c freer.c \ - calloc.c callocr.c realloc.c reallocr.c + calloc.c callocr.c realloc.c reallocr.c environ.c lib_a_LIBADD = $(extra_objs) EXTRA_lib_a_SOURCES = libposix_conf.c syscalls.c chown.c getrusage.c \ @@ -315,6 +316,12 @@ lib_a-reallocr.o: reallocr.c lib_a-reallocr.obj: reallocr.c $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-reallocr.obj `if test -f 'reallocr.c'; then $(CYGPATH_W) 'reallocr.c'; else $(CYGPATH_W) '$(srcdir)/reallocr.c'; fi` +lib_a-environ.o: environ.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-environ.o `test -f 'environ.c' || echo '$(srcdir)/'`environ.c + +lib_a-environ.obj: environ.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-environ.obj `if test -f 'environ.c'; then $(CYGPATH_W) 'environ.c'; else $(CYGPATH_W) '$(srcdir)/environ.c'; fi` + lib_a-libposix_conf.o: libposix_conf.c $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-libposix_conf.o `test -f 'libposix_conf.c' || echo '$(srcdir)/'`libposix_conf.c diff --git a/newlib/libc/sys/jehanne/environ.c b/newlib/libc/sys/jehanne/environ.c new file mode 100644 index 000000000..353d137af --- /dev/null +++ b/newlib/libc/sys/jehanne/environ.c @@ -0,0 +1,19 @@ +/* + * This file is part of Jehanne. + * + * Copyright (C) 2017 Giacomo Tesio + * + * This is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, version 3 of the License. + * + * Jehanne is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with Jehanne. If not, see . + */ + +extern char **environ; /* let libposix define environ */