]> sourceware.org Git - glibc.git/blobdiff - Makeconfig
(moss): Fix previous change.
[glibc.git] / Makeconfig
index f0019824966dd920cf06fe17e73ade95a19ebb4b..6f2305e44a421a57adf46132a8d014bf128eb833 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
+# Copyright (C) 1991, 92, 93, 94, 95, 96 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
@@ -56,7 +56,7 @@ objdir = $(ARCH)
 endif
 endif
 
-# $(common-objdir) is the place to put objects and 
+# $(common-objdir) is the place to put objects and
 # such that are not specific to a single subdir.
 ifdef objdir
 objpfx = $(objdir)/
@@ -114,13 +114,19 @@ export sysdep_dir := $(sysdep_dir)
 ####
 
 
+# Set this to either `stdio' or `libio', to compile in either GNU stdio
+# or GNU libio.
+ifndef stdio
+stdio = stdio
+endif
+
 # Common prefix for machine-independent installation directories.
-ifndef prefix
+ifeq ($(origin prefix),undefined) # ifndef would override explicit empty value.
 prefix = /usr/local
 endif
 
 # Common prefix for machine-dependent installation directories.
-ifndef exec_prefix
+ifeq ($(origin exec_prefix),undefined)
 exec_prefix = $(prefix)
 endif
 
@@ -129,11 +135,16 @@ ifndef libdir
 libdir = $(exec_prefix)/lib
 endif
 
+# Where to install the shared library and dynamic linker.
+ifndef slibdir
+slibdir = $(exec_prefix)/lib
+endif
+
 # 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
 # just prepended to the whole file name.
-ifndef libprefix
+ifeq ($(origin libprefix),undefined)
 libprefix =
 endif
 
@@ -143,7 +154,7 @@ includedir = $(exec_prefix)/include
 endif
 
 # Where to install machine-independent data files.
-# These are the timezone database, and eventually the locale database.
+# These are the timezone database, and the locale database.
 ifndef datadir
 datadir = $(prefix)/share
 endif
@@ -153,6 +164,18 @@ ifndef zonedir
 zonedir = $(datadir)/zoneinfo
 endif
 
+# Where to install the locale and message catalog data files (which are
+# machine-independent).
+ifndef localedir
+localedir = $(datadir)/locale
+endif
+
+# Where to install the locale charmap source files.
+ifndef nlsdir
+nlsdir = $(datadir)/nls
+endif
+
+
 # Where to install programs.
 ifndef bindir
 bindir = $(exec_prefix)/bin
@@ -255,10 +278,31 @@ endif
 
 # Command for linking programs with the C library.
 ifndef +link
-+link = $(CC) -nostdlib $(LDFLAGS) -o $@ \
-       $(addprefix $(csu-objpfx),start.o $(+preinit)) \
-       $(^:lib=$(common-objpfx)libc.a) $(gnulib) $(common-objpfx)libc.a \
-       $(addprefix $(csu-objpfx),$(+postinit))
++link = $(CC) -nostdlib -nostartfiles -o $@ \
+             $(sysdep-LDFLAGS) $(config-LDFLAGS) $(LDFLAGS)  \
+             $(addprefix $(csu-objpfx),start.o $(+preinit)) \
+             $(filter-out $(common-objpfx)libc%,$^) $(link-libc) \
+             $(addprefix $(csu-objpfx),$(+postinit))
+endif
+ifndef config-LDFLAGS
+ifeq (yes,$(build-shared))
+config-LDFLAGS = -Wl,-dynamic-linker=$(slibdir)/$(rtld-installed-name)
+endif
+endif
+ifndef link-libc
+ifeq (yes,$(build-shared))
+link-libc = -Wl,-rpath-link=$(common-objdir) \
+           $(common-objpfx)libc.so$(libc.so-version) $(gnulib)
+# Choose the default search path for the dynamic linker based on
+# where we will install libraries.
+ifneq ($(libdir),$(slibdir))
+default-rpath = $(slibdir):$(libdir)
+else
+default-rpath = $(libdir)
+endif
+else
+link-libc = $(common-objpfx)libc.a $(gnulib) $(common-objpfx)libc.a
+endif
 endif
 ifndef gnulib
 gnulib := -lgcc
@@ -269,8 +313,31 @@ ifeq ($(elf),yes)
 endif
 ifdef objpfx
 csu-objpfx = $(objpfx)
+elf-objpfx = $(objpfx)
 else
 csu-objpfx = $(..)csu/
+elf-objpfx = $(..)elf/
+endif
+
+ifeq (yes,$(build-shared))
+ifndef rtld-installed-name
+rtld-installed-name = ld.so
+endif
+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,$^))
+ifneq (yes,$(build-shared))
+built-program-cmd = $(built-program-file)
+else
+comma = ,
+define built-program-cmd
+LD_LIBRARY_PATH=$(common-objdir)$(patsubst -Wl$(comma)-rpath-link=%,:%,\
+                                          $(filter -Wl$(comma)-rpath-link=%,\
+                                                   $(sysdep-LDFLAGS))) \
+$(elf-objpfx)ld.so $(built-program-file)
+endef
 endif
 
 ifndef LD
@@ -282,7 +349,7 @@ RANLIB = ranlib
 endif
 
 # Extra flags to pass to GCC.
-+gccwarn := -Wall -Wwrite-strings -Wno-parentheses -Winline
++gccwarn := -Wall -Wwrite-strings -Wno-parentheses -Winline -Wstrict-prototypes
 
 # This is the program that generates makefile
 # dependencies from C source files.
@@ -344,14 +411,18 @@ endif     # gcc
 # files (including ones given in angle brackets) in the current directory
 # and in the parent library source directory.
 # `+sysdep-includes' will be defined by Makerules.
-+includes = -I. $(filter-out -I,-I$(patsubst %/,%,$(..))) \
++includes = -I. $(filter-out -I,-I$(patsubst %/,%,$(..))) $($(stdio)-include) \
            $(includes) $(+sysdep-includes) $(last-includes)
 
+# Since libio has several internal header files, we use a -I instead
+# of many little headers in the top level source directory.
+libio-include = -I$(..)libio
 
 # These are the variables that the implicit compilation rules use.
 CPPFLAGS = $(+includes) $(defines) -include $(..)libc-symbols.h \
           $(sysdep-CPPFLAGS) $(CPPFLAGS-$(suffix $@))
-override CFLAGS        = $(+cflags) $(sysdep-CFLAGS) $(CFLAGS-$(suffix $@))
+override CFLAGS        = $(+cflags) $(sysdep-CFLAGS) $(CFLAGS-$(suffix $@)) \
+                 $(CFLAGS-$(<F))
 
 
 # This is the macro that the implicit linking rules use.
@@ -379,7 +450,8 @@ ifeq (yes,$(build-profile))
 # Under --enable-profile, we will build a static library of profiled objects.
 # The profiled object files are named foo.po.
 object-suffixes += .po
-CFLAGS-.po = -p
+CPPFLAGS-.po = -DPROF
+CFLAGS-.po = -pg
 libtype.po = lib%_p.a
 endif
 ifeq (yes,$(build-omitfp))
This page took 0.030373 seconds and 5 git commands to generate.