]> sourceware.org Git - glibc.git/blame - Makeconfig
Mon Feb 20 04:04:57 1995 Roland McGrath <roland@duality.gnu.ai.mit.edu>
[glibc.git] / Makeconfig
CommitLineData
28f540f4
RM
1# Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
2# This file is part of the GNU C Library.
3
4# The GNU C Library is free software; you can redistribute it and/or
5# modify it under the terms of the GNU Library General Public License as
6# published by the Free Software Foundation; either version 2 of the
7# License, or (at your option) any later version.
8
9# The GNU C Library is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12# Library General Public License for more details.
13
14# You should have received a copy of the GNU Library General Public
15# License along with the GNU C Library; see the file COPYING.LIB. If
16# not, write to the Free Software Foundation, Inc., 675 Mass Ave,
17# Cambridge, MA 02139, USA.
18
19#
20# Makefile configuration options for the GNU C library.
21#
22ifneq (,)
23This makefile requires GNU Make.
24endif
25
26ifneq "$(origin +included-Makeconfig)" "file"
27
28+included-Makeconfig := yes
29
30ifdef subdir
31.. := ../
32endif
33
34# If config.make exists, the source directory was configured,
35# so don't try to be clever and find another directory to build in.
36ifneq (,$(wildcard $(..)config.make))
37ARCH =
38machine =
39else # Not configured.
40ifndef ARCH
41ifdef machine
42ARCH = $(machine)
43endif # machine
44endif # ARCH
45endif # config.make
46
47# Directory for object files and libc.a. If this is not defined, the
48# object files live in the subdirectories where their sources live, and
49# libc.a lives in the parent directory (this probably doesn't work any
50# more).
51ifdef ARCH
52ifeq ($(filter /%,$(ARCH)),)
53objdir := $(..)$(ARCH)
54else
55objdir = $(ARCH)
56endif
57endif
58
59# $(common-objdir) is the place to put objects and
60# such that are not specific to a single subdir.
61ifdef objdir
62objpfx = $(objdir)/
63common-objpfx = $(objpfx)
64common-objdir = $(objdir)
65else
66objpfx :=
67ifdef ..
68common-objpfx = $(..)
69common-objdir = ..
70else
71# This is a kludge. make wizards might grok.
72common-objpfx = sysdeps/../
73common-objdir = .
74endif
75endif
76
77libc.a = $(common-objpfx)libc.a
78
79
80# Get the values defined by options to `configure'.
81include $(common-objpfx)config.make
82
83# Force the user to configure before making.
84$(common-objpfx)config.make:
85 @echo The GNU C library has not been configured. >&2
86 @echo Run \`configure\' to configure it before building. >&2
87 @exit 1
88
89# Get the user's configuration parameters.
90ifneq ($(wildcard $(..)configparms),)
91include $(..)configparms
92endif
93ifneq ($(objpfx),)
94ifneq ($(wildcard $(objpfx)configparms),)
95include $(objpfx)configparms
96endif
97endif
98
99sysdep_dir := $(..)sysdeps
100export sysdep_dir := $(sysdep_dir)
101\f
102####
103#### These are the configuration variables. You can define values for
104#### the variables below in the file `configparms'.
105#### Do NOT edit this file.
106####
107
108
109# Common prefix for machine-independent installation directories.
110ifndef prefix
111prefix = /usr/local
112endif
113
114# Common prefix for machine-dependent installation directories.
115ifndef exec_prefix
116exec_prefix = $(prefix)
117endif
118
119# Where to install the library and object files.
120ifndef libdir
121libdir = $(exec_prefix)/lib
122endif
123
124# Prefix to put on files installed in $(libdir). For libraries `libNAME.a',
125# the prefix is spliced between `lib' and the name, so the linker switch
126# `-l$(libprefix)NAME' finds the library; for other files the prefix is
127# just prepended to the whole file name.
128ifndef libprefix
129libprefix =
130endif
131
132# Where to install the header files.
133ifndef includedir
134includedir = $(exec_prefix)/include
135endif
136
137# Define if the library should install its own <stddef.h>.
138# Do this unless you are using version 2.2 or later of GCC.
139ifndef stddef.h
140stddef.h = stddef.h
141endif
142
143# Where to install machine-independent data files.
144# These are the timezone database, and eventually the locale database.
145ifndef datadir
146datadir = $(prefix)/share
147endif
148
149# Where to install the timezone data files (which are machine-independent).
150ifndef zonedir
151zonedir = $(datadir)/zoneinfo
152endif
153
154# Where to install programs.
155ifndef bindir
156bindir = $(exec_prefix)/bin
157endif
158
159# Where to install administrative programs.
160ifndef sbindir
161sbindir = $(exec_prefix)/sbin
162endif
163
164# Where to install the Info files.
165ifndef infodir
166infodir = $(prefix)/info
167endif
168
169# Where to install default configuration files. These include the local
170# timezone specification and network data base files.
171ifndef sysconfdir
172sysconfdir = $(prefix)/etc
173endif
174
175# What timezone should be the installed default (e.g., US/Eastern).
176# Run `make -C time echo-zonenames' to see a list of available zone names.
177# The local timezone can be changed with `zic -l TIMEZONE' at any time.
178ifndef localtime
179localtime = Factory
180endif
181
182# Where to install the "localtime" timezone file; this is the file whose
183# contents $(localtime) specifies. If this is a relative pathname, it is
184# relative to $(zonedir). It is a good idea to put this somewhere
185# other than there, so the zoneinfo directory contains only universal data,
186# localizing the configuration data elsewhere.
187ifndef localtime-file
188localtime-file = $(sysconfdir)/localtime
189endif
190
191# What timezone's DST rules should be used when a POSIX-style TZ
192# environment variable doesn't specify any rules. For 1003.1 compliance
193# this timezone must use rules that are as U.S. federal law defines DST.
194# Run `make -C time echo-zonenames' to see a list of available zone names.
195# This setting can be changed with `zic -p TIMEZONE' at any time.
196# If you want POSIX.1 compatibility, use `America/New_York'.
197ifndef posixrules
198posixrules = America/New_York
199endif
200
201# Where to install the "posixrules" timezone file; this is file
202# whose contents $(posixrules) specifies. If this is a relative
203# pathname, it is relative to $(zonedir).
204ifndef posixrules-file
205posixrules-file = posixrules
206endif
207
208
209# Directory where your system's native header files live.
210# This is used on Unix systems to generate some GNU libc header files.
211ifndef sysincludedir
212sysincludedir = /usr/include
213endif
214
215
216# Commands to install files.
217ifndef INSTALL_DATA
218INSTALL_DATA = $(INSTALL) -m 644
219endif
220ifndef INSTALL_PROGRAM
221INSTALL_PROGRAM = $(INSTALL)
222endif
223ifndef INSTALL
224INSTALL = install
225endif
226
227
228# The name of the C compiler.
229# If you've got GCC, and it works, use it.
230ifeq ($(origin CC),default)
231CC := gcc
232endif
233
234# The name of the C compiler to use for compilations of programs to run on
235# the host that is building the library. If you set CC to a
236# cross-compiler, you must set this to the normal compiler.
237ifndef BUILD_CC
238BUILD_CC = $(CC)
239endif
240
241# Default flags to pass the C compiler.
242ifndef default_cflags
243default_cflags := -g
244endif
245
246# Flags to pass the C compiler when assembling preprocessed assembly code
247# (`.S' files). On some systems the assembler doesn't understand the `#' line
248# directives the preprocessor produces. If you have troubling compiling
249# assembly code, try using -P here to suppress these directives.
250ifndef asm-CPPFLAGS
251asm-CPPFLAGS =
252endif
253
254# Command for linking programs with the C library.
255ifndef +link
256+link = $(CC) -nostdlib $(LDFLAGS) -o $@ \
257 $(common-objpfx)start.o $(^:lib=$(libc.a)) $(gnulib) $(libc.a)
258endif
259ifndef gnulib
260gnulib := -lgcc
261endif
262
263ifndef LD
264LD := ld -X
265endif
266
267ifndef RANLIB
268RANLIB = ranlib
269endif
270
271# Extra flags to pass to GCC.
272+gccwarn := -Wall -Wwrite-strings -Wno-parentheses
273
274# This is the program that generates makefile
275# dependencies from C source files.
276ifndef +mkdep
277+mkdep = $(CC) -M
278endif
279
280# The program that makes Emacs-style TAGS files.
281ETAGS := etags -T
282
283# The `m4' macro processor; this is used by sysdeps/sparc/Makefile (and
284# perhaps others) to preprocess assembly code in some cases.
285M4 = m4
286
287####
288#### End of configuration variables.
289####
290\f
291# This tells some versions of GNU make before 3.63 not to export all variables.
292.NOEXPORT:
293
294# We want to echo the commands we're running without
295# umpteem zillion filenames along with it (we use `...' instead)
296# but we don't want this echoing done when the user has said
297# he doesn't want to see commands echoed by using -s.
298ifneq "$(findstring s,$(MAKEFLAGS))" "" # if -s
299+cmdecho := echo >/dev/null
300else # not -s
301+cmdecho := echo
302endif # -s
303
304# These are the flags given to the compiler to tell
305# it what sort of optimization and/or debugging output to do.
306ifndef +cflags
307# If `CFLAGS' was defined, use that.
308ifdef CFLAGS
309+cflags := $(filter-out -I%,$(CFLAGS))
310endif # CFLAGS
311endif # +cflags
312
313# If none of the above worked, default to "-g".
314ifeq "$(strip $(+cflags))" ""
315+cflags := $(default_cflags)
316endif # $(+cflags) == ""
317
318# If using gcc, add flags that only it will grok.
319ifneq "$(findstring gcc,$(CC))" ""
320+cflags := $(+cflags) $(+gccwarn)
321+gcc-nowarn := -w
322else
323+gcc-nowarn :=
324endif # gcc
325
326# Don't duplicate options if we inherited variables from the parent.
327+cflags := $(sort $(+cflags))
328
329
330# These are flags given to the C compiler to tell it to look for include
331# files (including ones given in angle brackets) in the current directory
332# and in the parent library source directory.
333# `+sysdep-includes' will be defined by Makerules.
334+includes = -I. $(filter-out -I,-I$(patsubst %/,%,$(..))) \
335 $(includes) $(+sysdep-includes) $(last-includes)
336
337
338# These are the variables that the implicit compilation rules use.
339CPPFLAGS = $(+includes) $(defines) -include $(..)libc-symbols.h \
340 $(sysdep-CPPFLAGS)
341override CFLAGS = $(+cflags) $(sysdep-CFLAGS)
342
343
344# This is the macro that the implicit linking rules use.
345ifneq "$(filter -g,$(+cflags))" "" # -g is in $(+cflags)
346LDFLAGS := -g
347endif
348
349+gnu-stabs = $(shell echo>&2 '*** BARF ON ME')
350
351ifneq ($(BUILD_CC),$(CC))
352cross-compiling := yes
353else
354cross-compiling := no
355endif
356
357
358endif # Makeconfig not yet included
This page took 0.058717 seconds and 5 git commands to generate.