Let tst-swscanf find its locale
[platform/upstream/glibc.git] / Makeconfig
index 04d7588..a3d3e70 100644 (file)
@@ -90,10 +90,14 @@ $(common-objpfx)config.status: $(..)version.h $(..)configure \
                                                    $(firstword $(wildcard \
  $(addprefix $(dir)/,configure configure.in))))) \
                               $(patsubst %.in,%,\
+ $(wildcard $(..)sysdeps/*/preconfigure $(..)sysdeps/*/preconfigure.in)) \
+                              $(patsubst %.in,%,\
                                          $(foreach add-on,$(add-ons),\
                                                    $(firstword $(wildcard \
  $(addprefix $(firstword $(filter /%,$(add-on)) $(..)$(add-on))/,\
-            configure configure.in)))))
+            configure configure.in))) \
+ $(wildcard $(addprefix $(firstword $(filter /%,$(add-on)) $(..)$(add-on))/,\
+                       sysdeps/*/preconfigure sysdeps/*/preconfigure.in))))
        @cd $(@D); if test -f $(@F); then exec $(SHELL) $(@F) --recheck; else \
         echo The GNU C library has not been configured. >&2; \
         echo Run \`configure\' to configure it before building. >&2; \
@@ -147,12 +151,18 @@ libdir = $(exec_prefix)/lib
 endif
 inst_libdir = $(install_root)$(libdir)
 
-# Where to install the shared library and dynamic linker.
+# Where to install the shared library.
 ifndef slibdir
 slibdir = $(exec_prefix)/lib
 endif
 inst_slibdir = $(install_root)$(slibdir)
 
+# Where to install the dynamic linker.
+ifndef rtlddir
+rtlddir = $(slibdir)
+endif
+inst_rtlddir = $(install_root)$(rtlddir)
+
 # Prefix to put on files installed in $(libdir).  For libraries `libNAME.a',
 # the prefix is spliced between `lib' and the name, so the linker switch
 # `-l$(libprefix)NAME' finds the library; for other files the prefix is
@@ -435,21 +445,9 @@ else
 +link-tests = $(+link-static-tests)
 endif
 endif
-# Command for statically linking bounded-pointer programs with the C library.
-ifndef +link-bounded
-+link-bounded = $(CC) -nostdlib -nostartfiles -static -fbounded-pointers -o $@ \
-             $(sysdep-LDFLAGS) $(LDFLAGS)  \
-             $(addprefix $(csu-objpfx),b$(static-start-installed-name)) \
-             $(+preinit) $(+prectorT) \
-             $(filter-out $(addprefix $(csu-objpfx),start.ob \
-                                                    $(start-installed-name))\
-                          $(+preinit) $(link-extra-libs-bounded) \
-                          $(common-objpfx)libc% $(+postinit),$^) \
-             $(link-extra-libs-bounded) $(link-libc-bounded) $(+postctorT) $(+postinit)
-endif
 ifeq (yes,$(build-shared))
 ifndef rtld-LDFLAGS
-rtld-LDFLAGS = -Wl,-dynamic-linker=$(slibdir)/$(rtld-installed-name)
+rtld-LDFLAGS = -Wl,-dynamic-linker=$(rtlddir)/$(rtld-installed-name)
 endif
 ifndef rtld-tests-LDFLAGS
 ifeq (yes,$(build-hardcoded-path-in-tests))
@@ -506,13 +504,11 @@ endif
 ifndef link-extra-libs
 link-extra-libs = $(LDLIBS-$(@F))
 link-extra-libs-static = $(link-extra-libs)
-link-extra-libs-bounded = $(link-extra-libs)
 endif
 
 # The static libraries.
 link-libc-static = -Wl,--start-group $(common-objpfx)libc.a $(static-gnulib) -Wl,--end-group
 link-libc-static-tests = -Wl,--start-group $(common-objpfx)libc.a $(static-gnulib-tests) -Wl,--end-group
-link-libc-bounded = $(common-objpfx)libc_b.a $(gnulib) $(common-objpfx)libc_b.a
 
 # How to link against libgcc.  Some libgcc functions, such as those
 # for "long long" arithmetic or software floating point, can always be
@@ -608,6 +604,9 @@ endif
 # How to run a program we just linked with our library.
 # The program binary is assumed to be $(word 2,$^).
 built-program-file = $(dir $(word 2,$^))$(notdir $(word 2,$^))
+rtld-prefix = $(elf-objpfx)$(rtld-installed-name)                            \
+             --library-path                                                  \
+             $(rpath-link)$(patsubst %,:%,$(sysdep-library-path))
 ifeq (yes,$(build-shared))
 comma = ,
 sysdep-library-path = \
@@ -617,14 +616,11 @@ $(subst $(empty) ,:,$(strip $(patsubst -Wl$(comma)-rpath-link=%, %,\
 # $(run-via-rtld-prefix) is a command that, when prepended to the name
 # of a program built with the newly built library, produces a command
 # that, executed on the host for which the library is built, runs that
-# program.  For the statically-linked %-bp test programs, and for
-# tests listed in tests-static or xtests-static, it is empty.
+# program.  For tests listed in tests-static or xtests-static, it is
+# empty.
 run-via-rtld-prefix =                                                        \
   $(if $(strip $(filter $(notdir $(built-program-file)),                     \
-                       $(tests-static) $(xtests-static))                     \
-              $(filter %-bp,$(built-program-file))),,                        \
-       $(elf-objpfx)$(rtld-installed-name)                                   \
-        --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)))
+                       $(tests-static) $(xtests-static))),, $(rtld-prefix))
 else
 run-via-rtld-prefix =
 endif
@@ -652,9 +648,9 @@ endif
 # $(test-via-rtld-prefix) is a command that, when prepended to the name
 # of a test program built with the newly built library, produces a command
 # that, executed on the host for which the library is built, runs that
-# program.  For the statically-linked %-bp test programs, and for
-# tests listed in tests-static or xtests-static as well as when test
-# programs are hardcoded to the newly built libraries, it is empty.
+# program.  For tests listed in tests-static or xtests-static as well
+# as when test programs are hardcoded to the newly built libraries, it
+# is empty.
 
 # $(test-program-prefix) is a command that, when prepended to the name
 # of a test program built with the newly built library, produces a command
@@ -765,11 +761,18 @@ endif     # $(+cflags) == ""
 # Don't duplicate options if we inherited variables from the parent.
 +cflags        := $(sort $(+cflags))
 
+# Each sysdeps directory can contain header files that both will be
+# used to compile and will be installed.  Each can also contain an
+# include/ subdirectory, whose header files will be used to compile
+# but will not be installed, and will take precedence over the
+# installed files.  This mirrors the top-level include/ subdirectory.
++sysdep-includes := $(foreach dir,$(+sysdep_dirs),\
+                             $(addprefix -I,$(wildcard $(dir)/include) $(dir)))
+
 # These are flags given to the C compiler to tell it to look for
 # include files (including ones given in angle brackets) in the parent
 # library source directory, in the include directory, and in the
 # current directory.
-+sysdep-includes = $(addprefix -I,$(+sysdep_dirs))
 +includes = -I$(..)include $(if $(subdir),$(objpfx:%/=-I%)) \
            $(+sysdep-includes) $(includes) \
            $(patsubst %/,-I%,$(..)) $(libio-include) -I. $(sysincludes)
@@ -810,7 +813,7 @@ endif
 # The compilation rules use $(CPPFLAGS-${SUFFIX}) and $(CFLAGS-${SUFFIX})
 # to pass different flags for each flavor.
 libtypes = $(foreach o,$(object-suffixes-for-libc),$(libtype$o))
-all-object-suffixes := .o .os .op .og .ob .oS
+all-object-suffixes := .o .os .op .og .oS
 object-suffixes :=
 CPPFLAGS-.o = $(pic-default)
 CFLAGS-.o = $(filter %frame-pointer,$(+cflags))
@@ -845,18 +848,6 @@ endif
 # differently from the rest.
 object-suffixes-noshared := $(filter-out .os,$(object-suffixes))
 
-bppfx = BP-
-ifeq (yes,$(build-bounded))
-# Under --enable-bounded, we build the library with `-fbounded-pointers -g'
-# to runtime bounds checking.  The bounded-pointer objects are named foo.ob.
-# We disable sibling-call optimizations so that stack traces will be complete
-# and thus aid debugging, since after all, BPs are a debugging tool.
-object-suffixes += .ob
-CPPFLAGS-.ob = -fbounded-pointers $(pic-default)
-CFLAGS-.ob = -g -O2 -fno-optimize-sibling-calls -fno-strict-aliasing
-libtype.ob = lib%_b.a
-endif
-
 object-suffixes-for-libc := $(object-suffixes)
 
 ifeq (yes,$(build-shared))
@@ -888,8 +879,6 @@ subdirs = $(sorted-subdirs)
 subdir-srcdirs = $(foreach dir,$(subdirs),\
                           $(firstword $($(dir)-srcdir) $(..)$(dir)))
 
-ifeq (yes, $(build-shared))
-
 # This is a pair of implicit rules to preprocess a file with # comments,
 # %ifdef et al, based on config.h settings or other %include'd files.
 # We use chained rules instead of a pipeline here so that we can properly
@@ -908,6 +897,8 @@ ifeq (yes, $(build-shared))
        sed '/^[        ]*#/d;/^[       ]*$$/d' $< > $@T
        mv -f $@T $@
 
+ifeq (yes, $(build-shared))
+
 # To generate a header to support more than one ABI for different
 # architecture variants, the CPU/Makefile defines abi-variants to be a
 # list of names for those variants (e.g. 32 64), and, for each variant,