Browse Source

config: UCLIBC_HAS_OBSTACK to optionally enable obstack support

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Anthony G. Basile 11 years ago
parent
commit
f143f92069
4 changed files with 15 additions and 2 deletions
  1. 1 0
      Makefile.in
  2. 9 0
      extra/Configs/Config.in
  3. 1 2
      libc/misc/gnu/Makefile.in
  4. 4 0
      test/malloc/Makefile.in

+ 1 - 0
Makefile.in

@@ -281,6 +281,7 @@ HEADERS_RM-$(UCLIBC_HAS_THREADS)             += *thread*.h semaphore.h \
 	bits/*thread*.h \
 	bits/initspin.h
 HEADERS_RM-$(UCLIBC_HAS_THREADS_NATIVE)      += atomic.h bits/atomic.h
+HEADERS_RM-$(UCLIBC_HAS_OBSTACK)             += obstack.h
 HEADERS_RM-$(UCLIBC_HAS_UTMPX)               += bits/utmpx.h utmpx.h
 HEADERS_RM-$(UCLIBC_HAS_WCHAR)               += wchar.h wctype.h
 HEADERS_RM-$(UCLIBC_HAS_WORDEXP)             += wordexp.h

+ 9 - 0
extra/Configs/Config.in

@@ -648,6 +648,15 @@ config MALLOC_GLIBC_COMPAT
 	  does not detect glibc style returning-a-valid-pointer-for-malloc(0)
 	  behavior).  Most people can safely answer N.
 
+config UCLIBC_HAS_OBSTACK
+	bool "Obstack Support (gnu extension)"
+	help
+	  When this option is enabled, uClibc will provide support for obstacks.
+	  An obstack is a structure in which memory can be dynamically allocated
+	  as a 'stack of objects'.  Many programs need this GNU extention and
+	  you should say Y if you are using any.  Otherwise, say N to save some
+	  space.
+
 config UCLIBC_DYNAMIC_ATEXIT
 	bool "Dynamic atexit() Support"
 	default y

+ 1 - 2
libc/misc/gnu/Makefile.in

@@ -7,8 +7,7 @@
 
 subdirs += libc/misc/gnu
 
-#XXX: add UCLIBC_HAS_OBSTACK
-CSRC-y := obstack.c
+CSRC-$(UCLIBC_HAS_OBSTACK) := obstack.c
 
 MISC_GNU_DIR := $(top_srcdir)libc/misc/gnu
 MISC_GNU_OUT := $(top_builddir)libc/misc/gnu

+ 4 - 0
test/malloc/Makefile.in

@@ -6,3 +6,7 @@ TESTS_DISABLED := time_malloc
 ifneq ($(UCLIBC_SUSV2_LEGACY),y)
 TESTS_DISABLED += tst-valloc
 endif
+
+ifneq ($(UCLIBC_HAS_OBSTACK),y)
+TESTS_DISABLED += tst-obstack
+endif