summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2013-08-20 09:15:26 +0300
committerCaolán McNamara <caolanm@redhat.com>2013-08-21 07:44:38 +0000
commitcabd23916f3057b2c5f40aae0df6360342b6ea46 (patch)
treed90eb089dfeba0309ce45d577f7f72809f92a821
parent654d97d3bb6e39c3c86ab3b338bb657985d36512 (diff)
We don't seem to actually need glibc getopt
Change-Id: I1f221533f5ea684d113bdc45c04bf84405140f9f Reviewed-on: https://gerrit.libreoffice.org/5539 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--config_host.mk.in1
-rw-r--r--configure.ac7
-rw-r--r--external/Module_external.mk9
-rw-r--r--external/StaticLibrary_gnu_getopt.mk31
-rw-r--r--external/UnpackedTarball_glibc.mk4
-rw-r--r--external/glibc/glibc-2.1.3.patch63
-rw-r--r--soltools/Executable_cpp.mk8
-rw-r--r--soltools/cpp/_unix.c4
8 files changed, 6 insertions, 121 deletions
diff --git a/config_host.mk.in b/config_host.mk.in
index a6f6b3d1ffb0..cdba821e5f80 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -231,7 +231,6 @@ export HAVE_GCC_NO_LONG_DOUBLE=@HAVE_GCC_NO_LONG_DOUBLE@
export HAVE_GCC_PRAGMA_OPERATOR=@HAVE_GCC_PRAGMA_OPERATOR@
export HAVE_GCC_VISIBILITY_BROKEN=@HAVE_GCC_VISIBILITY_BROKEN@
export HAVE_GCC_VISIBILITY_FEATURE=@HAVE_GCC_VISIBILITY_FEATURE@
-export HAVE_GETOPT=@HAVE_GETOPT@
export HAVE_GNUMAKE_FILE_FUNC=@HAVE_GNUMAKE_FILE_FUNC@
export HAVE_LD_BSYMBOLIC_FUNCTIONS=@HAVE_LD_BSYMBOLIC_FUNCTIONS@
export HAVE_LD_HASH_STYLE=@HAVE_LD_HASH_STYLE@
diff --git a/configure.ac b/configure.ac
index c9eaaa1acfe5..7ad502b01e0f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9359,22 +9359,19 @@ if test "$_os" = "Linux"; then
fi
if test "$_os" != "WINNT"; then
- AC_CHECK_FUNCS(getopt, HAVE_GETOPT=YES, [HAVE_GETOPT=NO])
AC_CHECK_FUNCS(readdir_r, HAVE_READDIR_R=YES, [HAVE_READDIR_R=NO])
- if test "$HAVE_GETOPT" = "YES" -a "$HAVE_READDIR_R" = "YES"; then
+ if test "$HAVE_READDIR_R" = "YES"; then
SYSTEM_LIBC=YES
fi
else
- HAVE_GETOPT=NO
HAVE_READDIR_R=NO
SYSTEM_LIBC=YES
fi
-if test "$HAVE_GETOPT" = NO -o "$HAVE_READDIR_R" = NO; then
+if test "$HAVE_READDIR_R" = NO; then
BUILD_TYPE="$BUILD_TYPE GLIBC"
fi
-AC_SUBST(HAVE_GETOPT)
AC_SUBST(HAVE_READDIR_R)
AC_SUBST(SYSTEM_LIBC)
diff --git a/external/Module_external.mk b/external/Module_external.mk
index 907b23b6ca28..70f583f5b02f 100644
--- a/external/Module_external.mk
+++ b/external/Module_external.mk
@@ -30,17 +30,10 @@ $(eval $(call gb_Module_add_targets,external,\
))
endif
-ifeq ($(HAVE_GETOPT),NO)
-$(eval $(call gb_Module_add_targets,external,\
- UnpackedTarball_glibc \
- StaticLibrary_gnu_getopt \
-))
-endif
-
ifeq ($(HAVE_READDIR_R),NO)
ifneq ($(OS),WNT)
$(eval $(call gb_Module_add_targets,external,\
- $(if $(filter YES,$(HAVE_GETOPT)),UnpackedTarball_glibc) \
+ UnpackedTarball_glibc \
StaticLibrary_gnu_readdir_r \
))
endif
diff --git a/external/StaticLibrary_gnu_getopt.mk b/external/StaticLibrary_gnu_getopt.mk
deleted file mode 100644
index 73b4df9efb5f..000000000000
--- a/external/StaticLibrary_gnu_getopt.mk
+++ /dev/null
@@ -1,31 +0,0 @@
-# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-
-$(eval $(call gb_StaticLibrary_StaticLibrary,gnu_getopt))
-
-$(eval $(call gb_StaticLibrary_set_warnings_not_errors,gnu_getopt))
-
-$(eval $(call gb_StaticLibrary_use_unpacked,gnu_getopt,glibc))
-
-$(eval $(call gb_StaticLibrary_set_include,gnu_getopt,\
- -I$(call gb_UnpackedTarball_get_dir,glibc) \
- $$(INCLUDE) \
-))
-
-$(eval $(call gb_StaticLibrary_add_defs,gnu_getopt,\
- -DHAVE_STRING_H \
- -DHAVE_CONFIG_H \
-))
-
-$(eval $(call gb_StaticLibrary_add_generated_cobjects,gnu_getopt,\
- UnpackedTarball/glibc/posix/getopt \
- UnpackedTarball/glibc/posix/getopt1 \
-))
-
-# vim: set noet sw=4 ts=4:
diff --git a/external/UnpackedTarball_glibc.mk b/external/UnpackedTarball_glibc.mk
index 40bd1f64aa75..3921d4da0240 100644
--- a/external/UnpackedTarball_glibc.mk
+++ b/external/UnpackedTarball_glibc.mk
@@ -16,8 +16,4 @@ $(eval $(call gb_UnpackedTarball_add_files,glibc,posix,\
external/glibc/readdir_r.c \
))
-$(eval $(call gb_UnpackedTarball_add_patches,glibc,\
- external/glibc/glibc-2.1.3.patch \
-))
-
# vim: set noet sw=4 ts=4:
diff --git a/external/glibc/glibc-2.1.3.patch b/external/glibc/glibc-2.1.3.patch
deleted file mode 100644
index a9feeccc4f67..000000000000
--- a/external/glibc/glibc-2.1.3.patch
+++ /dev/null
@@ -1,63 +0,0 @@
---- 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);
---- misc/glibc-2.1.3/posix/getopt1.c
-+++ misc/build/glibc-2.1.3/posix/getopt1.c
-@@ -62,6 +62,13 @@
- #ifndef NULL
- #define NULL 0
- #endif
-+
-+#ifdef _MSC_VER
-+// C4100: unreferenced formal parameter
-+#pragma warning (disable: 4100)
-+// C4131: uses old-style declarator
-+#pragma warning (disable: 4131)
-+#endif
-
- int
- getopt_long (argc, argv, options, long_options, opt_index)
-
---- misc/glibc-2.1.3/posix/getopt.c
-+++ misc/build/glibc-2.1.3/posix/getopt.c
-@@ -86,6 +86,13 @@
- # define _(msgid) (msgid)
- # endif
- #endif
-+
-+#ifdef _MSC_VER
-+// C4100: unreferenced formal parameter
-+#pragma warning (disable: 4100)
-+// C4131: uses old-style declarator
-+#pragma warning (disable: 4131)
-+#endif
-
- /* This version of `getopt' appears to the caller like standard Unix `getopt'
- but it behaves differently for the user, since it allows the user
-
diff --git a/soltools/Executable_cpp.mk b/soltools/Executable_cpp.mk
index 4225319ab462..21ede303fcb0 100644
--- a/soltools/Executable_cpp.mk
+++ b/soltools/Executable_cpp.mk
@@ -21,16 +21,10 @@ $(eval $(call gb_Executable_add_cobjects,cpp,\
soltools/cpp/_unix \
))
-ifneq ($(or $(filter AIX MACOSX,$(OS)),$(filter NO,$(HAVE_GETOPT))),)
+ifneq ($(filter AIX MACOSX WNT,$(OS)),)
$(eval $(call gb_Executable_add_cobjects,cpp,\
soltools/cpp/_getopt \
))
endif
-ifeq ($(HAVE_GETOPT),YES)
-$(eval $(call gb_Executable_add_defs,cpp,\
- -DHAVE_GETOPT \
-))
-endif
-
# vim:set noet sw=4 ts=4:
diff --git a/soltools/cpp/_unix.c b/soltools/cpp/_unix.c
index c3ba3dc176cb..d29970a450b3 100644
--- a/soltools/cpp/_unix.c
+++ b/soltools/cpp/_unix.c
@@ -31,7 +31,7 @@
#include "cpp.h"
-#if defined MACOSX || defined AIX || !defined HAVE_GETOPT
+#if defined MACOSX || defined AIX || defined WNT
extern int stgetopt(int, char *const *, const char *);
extern char *optarg;
extern int optind;
@@ -59,7 +59,7 @@ void
Tokenrow tr;
setup_kwtab();
-#if defined MACOSX || defined(AIX) || !defined HAVE_GETOPT
+#if defined MACOSX || defined(AIX) || defined WNT
while ((c = stgetopt(argc, argv, "NOPV:I:D:U:F:A:X:u:l:+")) != -1)
#else
while ((c = getopt(argc, argv, "NOPV:I:D:U:F:A:X:u:l:+")) != -1)