1 From 5184289b9f453b1e160fbfd2f0922e5ed586d910 Mon Sep 17 00:00:00 2001
2 From: Max Filippov <jcmvbkbc@gmail.com>
3 Date: Tue, 17 Mar 2015 02:06:52 +0300
4 Subject: [PATCH] Fix getopt implementations conditional compilation
6 Currently there's no way to disable getsubopt: either GNU or SUSv3
7 getsubopt is always built.
9 Properly exclude SUSv3 getsubopt implementation when GNU getopt is
11 Exclude GNU getsubopt when SUSv3 getopt is selected. Honor getopt_long
14 This brings UCLIBC_HAS_GNU_GETOPT, UCLIBC_HAS_GNU_GETSUBOPT and
15 UCLIBC_HAS_GETOPT_LONG handling in sync with uClibc and uClibc-ng tips.
17 Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
19 libc/unistd/Makefile.in | 22 +++++++++++-----------
20 1 file changed, 11 insertions(+), 11 deletions(-)
22 diff --git a/libc/unistd/Makefile.in b/libc/unistd/Makefile.in
23 index 2704177..ec51631 100644
24 --- a/libc/unistd/Makefile.in
25 +++ b/libc/unistd/Makefile.in
26 @@ -19,18 +19,18 @@ CSRC := $(filter-out __exec_alloc.c,$(CSRC))
29 ifeq ($(UCLIBC_HAS_GNU_GETOPT),y)
30 -CSRC := $(filter-out getopt-susv3.c getopt_long-simple.c,$(CSRC))
31 + CSRC := $(filter-out getopt-susv3.c getsubopt-susv3.c getopt_long-simple.c,$(CSRC))
32 + ifneq ($(UCLIBC_HAS_GNU_GETSUBOPT),y)
33 + CSRC := $(filter-out getsubopt.c,$(CSRC))
36 -CSRC := $(filter-out getopt.c,$(CSRC))
37 -ifneq ($(UCLIBC_HAS_GETOPT_LONG),y)
38 -CSRC := $(filter-out getopt_long-simple.c,$(CSRC))
42 -ifeq ($(UCLIBC_HAS_GNU_GETSUBOPT),y)
43 -CSRC := $(filter-out getsubopt-susv3.c,$(CSRC))
45 -CSRC := $(filter-out getsubopt.c,$(CSRC))
46 + CSRC := $(filter-out getopt.c getsubopt.c,$(CSRC))
47 + ifneq ($(UCLIBC_HAS_GETOPT_LONG),y)
48 + CSRC := $(filter-out getopt_long-simple.c,$(CSRC))
50 + ifneq ($(UCLIBC_HAS_GNU_GETSUBOPT),y)
51 + CSRC := $(filter-out getsubopt-susv3.c,$(CSRC))
55 ifneq ($(UCLIBC_SUSV3_LEGACY),y)