diff options
author | Peter Foley <pefoley2@verizon.net> | 2012-12-17 17:48:00 -0500 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2012-12-25 09:39:47 +0100 |
commit | 5b0d2d02a51dcf6c4235124f7d92280877fbb3df (patch) | |
tree | 8e647659f49cda94467bcf934cf3f6ceee68b212 /external/glibc | |
parent | 2d8a50d3f8a5af914e2e184796bfab05df52c539 (diff) |
convert external to gbuild
Change-Id: I7127db6aad9e97a0f3e758aa83b22ac8465d3f43
Diffstat (limited to 'external/glibc')
-rw-r--r-- | external/glibc/config.h | 40 | ||||
-rw-r--r-- | external/glibc/glibc-2.1.3.patch | 29 | ||||
-rw-r--r-- | external/glibc/makefile.mk | 71 | ||||
-rw-r--r-- | external/glibc/readdir_r.c | 54 |
4 files changed, 123 insertions, 71 deletions
diff --git a/external/glibc/config.h b/external/glibc/config.h new file mode 100644 index 000000000000..c5df8d89e489 --- /dev/null +++ b/external/glibc/config.h @@ -0,0 +1,40 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifdef WNT +#include <stdlib.h> +#define getenv getenv +#endif + + +#if defined(MACOSX) +//Workaround for MACOS +#define getopt my_neues_getopt +#define opterr my_neues_opterr +#define optind my_neues_optind +#define optopt my_neues_optopt +#endif diff --git a/external/glibc/glibc-2.1.3.patch b/external/glibc/glibc-2.1.3.patch new file mode 100644 index 000000000000..bedaad06fac3 --- /dev/null +++ b/external/glibc/glibc-2.1.3.patch @@ -0,0 +1,29 @@ +--- misc/glibc-2.1.3/posix/getopt.h Sun Aug 27 16:11:33 2000 ++++ misc/build/glibc-2.1.3/posix/getopt.h Mon Mar 31 09:42:01 2008 +@@ -131,7 +131,7 @@ + /* Many other libraries have conflicting prototypes for getopt, with + differences in the consts, in stdlib.h. To avoid compilation + errors, only prototype getopt for the GNU C library. */ +-extern int getopt (int __argc, char *const *__argv, const char *__shortopts); ++extern int getopt (int argc, char *const *argv, const char *shortopts); + # else /* not __GNU_LIBRARY__ */ + extern int getopt (); + # endif /* __GNU_LIBRARY__ */ +@@ -137,14 +137,14 @@ + # endif /* __GNU_LIBRARY__ */ + + # ifndef __need_getopt +-extern int getopt_long (int __argc, char *const *__argv, const char *__shortopts, ++extern int getopt_long (int argc, char *const *argv, const char *shortopts, + const struct option *__longopts, int *__longind); +-extern int getopt_long_only (int __argc, char *const *__argv, ++extern int getopt_long_only (int argc, char *const *argv, + const char *__shortopts, + const struct option *__longopts, int *__longind); + + /* Internal only. Users should not call this directly. */ +-extern int _getopt_internal (int __argc, char *const *__argv, ++extern int _getopt_internal (int argc, char *const *argv, + const char *__shortopts, + const struct option *__longopts, int *__longind, + int __long_only); diff --git a/external/glibc/makefile.mk b/external/glibc/makefile.mk deleted file mode 100644 index 8eee6a523eed..000000000000 --- a/external/glibc/makefile.mk +++ /dev/null @@ -1,71 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org 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 Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=.. - -PRJNAME=external -TARGET=getopt - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk - -# --- Files -------------------------------------------------------- - -.IF "$(HAVE_GETOPT)" != "YES" || "$(HAVE_READDIR_R)" != "YES" -TARFILE_NAME=glibc-2.1.3-stub -TARFILE_MD5=4a660ce8466c9df01f19036435425c3a -TARFILE_ROOTDIR=glibc-2.1.3 -ADDITIONAL_FILES=posix$/makefile.mk posix$/config.h -.IF "$(HAVE_READDIR_R)" != "YES" -ADDITIONAL_FILES += posix$/readdir_r.c -.ENDIF - -PATCH_FILES=$(PRJ)$/glibc-2.1.3.patch - -CONFIGURE_ACTION= - -BUILD_DIR=posix -BUILD_ACTION=dmake $(MFLAGS) $(CALLMACROS) - -OUT2INC= \ - posix/getopt.h \ - posix/config.h - -.ELSE - -@all: -# nothing - -.ENDIF - -# --- Targets ------------------------------------------------------ - -.INCLUDE : set_ext.mk -.INCLUDE : target.mk -.INCLUDE : tg_ext.mk - diff --git a/external/glibc/readdir_r.c b/external/glibc/readdir_r.c new file mode 100644 index 000000000000..87b8c9dc4053 --- /dev/null +++ b/external/glibc/readdir_r.c @@ -0,0 +1,54 @@ +/* Copyright (C) 1991,92,93,94,95,96,97,98,99,2000 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include <errno.h> +#include <limits.h> +#include <stddef.h> +#include <string.h> +#include <dirent.h> +#include <unistd.h> +#include <sys/types.h> +#include <assert.h> + +#ifndef __READDIR_R +# define __READDIR_R readdir_r +# define DIRENT_TYPE struct dirent +#endif + +/* Read a directory entry from DIRP. */ +int +__READDIR_R (DIR *dirp, DIRENT_TYPE *entry, DIRENT_TYPE **result) +{ + DIRENT_TYPE *dp; + size_t reclen; + + errno = 0; + /* call our non-reentrant counterpart to get the information */ + dp = readdir(dirp); + + /* copy the result into entry */ + if (dp != NULL) { + reclen = dp->d_reclen; /* This might be NetBSD-specific + * Add #ifdef's if anything else needed */ + *result = memcpy(entry, dp, reclen); + } else { + *result = NULL; + } + + return dp != NULL ? 0 : errno ? errno : 0; +} |