home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / gnu / glibc-1.06 / Makeconfig < prev    next >
Encoding:
Text File  |  1993-05-22  |  9.2 KB  |  349 lines

  1. # Copyright (C) 1991, 1992, 1993 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. #
  22. ifneq (,)
  23. This makefile requires GNU Make.
  24. endif
  25.  
  26. ifneq "$(origin +included-Makeconfig)" "file"
  27.  
  28. +included-Makeconfig := yes
  29.  
  30. ifdef subdir
  31. .. := ../
  32. endif
  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.
  36. ifneq (,$(wildcard $(..)config.make))
  37. ARCH =
  38. machine =
  39. else    # Not configured.
  40. ifndef ARCH
  41. ifdef machine
  42. ARCH = $(machine)
  43. endif # machine
  44. endif # ARCH
  45. endif # 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).
  51. ifdef ARCH
  52. ifeq ($(filter /%,$(ARCH)),)
  53. objdir := $(..)$(ARCH)
  54. else
  55. objdir = $(ARCH)
  56. endif
  57. endif
  58.  
  59. # $(common-objdir) is the place to put objects and 
  60. # such that are not specific to a single subdir.
  61. ifdef objdir
  62. objpfx = $(objdir)/
  63. common-objpfx = $(objpfx)
  64. common-objdir = $(objdir)
  65. else
  66. objpfx :=
  67. ifdef ..
  68. common-objpfx = $(..)
  69. common-objdir = ..
  70. else
  71. # This is a kludge.  make wizards might grok.
  72. common-objpfx = sysdeps/../
  73. endif
  74. endif
  75.  
  76. libc.a = $(common-objpfx)libc.a
  77.  
  78.  
  79. # Get the values defined by options to `configure'.
  80. include $(common-objpfx)config.make
  81.  
  82. # Force the user to configure before making.
  83. $(common-objpfx)config.make:
  84.     @echo The GNU C library has not been configured. >&2
  85.     @echo Run \`configure\' to configure it before building. >&2
  86.     @exit 1
  87.  
  88. # Get the user's configuration parameters.
  89. ifneq ($(wildcard $(..)configparms),)
  90. include $(..)configparms
  91. endif
  92. ifneq ($(objpfx),)
  93. ifneq ($(wildcard $(objpfx)configparms),)
  94. include $(objpfx)configparms
  95. endif
  96. endif
  97.  
  98. ####
  99. ####    These are the configuration variables.  You can define values for
  100. ####    the variables below in the file `configparms'.
  101. ####    Do NOT edit this file.
  102. ####
  103.  
  104.  
  105. # Common prefix for machine-independent installation directories.
  106. ifndef prefix
  107. prefix = /usr/local
  108. endif
  109.  
  110. # Common prefix for machine-dependent installation directories.
  111. ifndef exec_prefix
  112. exec_prefix = $(prefix)
  113. endif
  114.  
  115. # Where to install the library and object files.
  116. ifndef libdir
  117. libdir = $(exec_prefix)/lib
  118. endif
  119.  
  120. # Where to install the header files.
  121. ifndef includedir
  122. includedir = $(exec_prefix)/include
  123. endif
  124.  
  125. # Define if the library should install its own <stddef.h>.
  126. # Do this unless you are using version 2.2 or later of GCC.
  127. ifndef stddef.h
  128. stddef.h = stddef.h
  129. endif
  130.  
  131. # Define if the library should install its own <stdarg.h>.
  132. # Do this unless you are using version 2.3 or later of GCC.
  133. ifndef stdarg.h
  134. stdarg.h := stdarg.h $(wildcard va-*.h)
  135. endif
  136.  
  137. # Where to install machine-independent data files.
  138. # These are the timezone database, and eventually the locale database.
  139. ifndef datadir
  140. datadir = $(prefix)/lib
  141. endif
  142.  
  143. # Where to install programs.
  144. ifndef bindir
  145. bindir = $(exec_prefix)/bin
  146. endif
  147.  
  148. # Where to install the Info files.
  149. ifndef infodir
  150. infodir = $(prefix)/info
  151. endif
  152.  
  153. # What timezone should be the installed default (e.g., US/Eastern).
  154. # Run `make -C time echo-zonenames' to see a list of available zone names.
  155. # The local timezone can be changed with `zic -l TIMEZONE' at any time.
  156. ifndef localtime
  157. localtime = Factory
  158. endif
  159.  
  160. # Where to install the "localtime" timezone file; this is the file whose
  161. # contents $(localtime) specifies.  If this is a relative pathname, it is
  162. # relative to $(datadir)/zoneinfo.  It is a good idea to put this somewhere
  163. # other than there, so the zoneinfo directory contains only universal data,
  164. # localizing the configuration data elsewhere.
  165. ifndef localtime-file
  166. localtime-file = $(prefix)/etc/localtime
  167. endif
  168.  
  169. # What timezone's DST rules should be used when a POSIX-style TZ
  170. # environment variable doesn't specify any rules.  For 1003.1 compliance
  171. # this timezone must use rules that are as U.S. federal law defines DST.
  172. # Run `make -C time echo-zonenames' to see a list of available zone names.
  173. # This setting can be changed with `zic -p TIMEZONE' at any time.
  174. ifndef posixrules
  175. posixrules = US/Eastern
  176. endif
  177.  
  178. # Where to install the "posixrules" timezone file; this is file
  179. # whose contents $(posixrules) specifies.  If this is a relative
  180. # pathname, it is relative to $(datadir)/zoneinfo.
  181. ifndef posixrules-file
  182. posixrules-file = posixrules
  183. endif
  184.  
  185.  
  186. # Directory where your system's native header files live.
  187. # This is used on Unix systems to generate some GNU libc header files.
  188. ifndef sysincludedir
  189. sysincludedir = /usr/include
  190. endif
  191.  
  192.  
  193. # Commands to install files.
  194. ifndef INSTALL_DATA
  195. INSTALL_DATA = $(INSTALL) -m 644
  196. endif
  197. ifndef INSTALL_PROGRAM
  198. INSTALL_PROGRAM = $(INSTALL)
  199. endif
  200. ifndef INSTALL
  201. INSTALL = install
  202. endif
  203.  
  204.  
  205. # The name of the C compiler.
  206. # If you've got GCC, and it works, use it.
  207. ifeq ($(origin CC),default)
  208. CC := gcc
  209. endif
  210.  
  211. # These are preprocessor macros we want to predefine.  Define HAVE_GNU_LD
  212. # if using GNU ld (which you should do if possible).  If you do this, you
  213. # may need the GNU assembler as well.  If you don't do this, your library
  214. # won't work as well (and won't be strictly compliant with the ANSI C
  215. # and POSIX.1 standards).
  216. +defines = $(config-defines) $(defines)
  217.  
  218. # Default flags to pass the C compiler.
  219. ifndef default_cflags
  220. default_cflags := -g
  221. endif
  222.  
  223. # Flags to pass the C compiler when assembling preprocessed assembly code
  224. # (`.S' files).  On some systems the assembler doesn't understand the `#' line
  225. # directives the preprocessor produces.  If you have troubling compiling
  226. # assembly code, try using -P here to suppress these directives.
  227. ifndef asm-CPPFLAGS
  228. asm-CPPFLAGS =
  229. endif
  230.  
  231. # Command for linking programs with the C library.
  232. ifndef +link
  233. +link = $(CC) -nostdlib $(LDFLAGS) -o $@ \
  234.     $(common-objpfx)start.o $(^:lib=$(libc.a)) $(gnulib) $(libc.a)
  235. endif
  236. ifndef gnulib
  237. gnulib := -lgcc
  238. endif
  239.  
  240. ifndef LD
  241. LD := ld -X
  242. endif
  243.  
  244. ifndef    RANLIB
  245. RANLIB = ranlib
  246. endif
  247.  
  248. # Define non-empty if the C compiler understands -v (print version).
  249. +cc_version = $(filter gcc,$(notdir $(firstword $(CC)))) # if using gcc
  250.  
  251. # Extra flags to pass to GCC.
  252. +gccwarn := -Wall -Wwrite-strings
  253. +gccopt := -fstrength-reduce
  254.  
  255. # This is the program that generates makefile
  256. # dependencies from C source files.
  257. ifndef +mkdep
  258. +mkdep = $(CC) -M
  259. endif
  260.  
  261. # The program that makes Emacs-style TAGS files.
  262. ETAGS    := etags -T
  263.  
  264. # The `m4' macro processor; this is used by sysdeps/sparc/Makefile (and
  265. # perhaps others) to preprocess assembly code in some cases.
  266. M4 = m4
  267.  
  268. ####
  269. #### End of configuration variables.
  270. ####
  271.  
  272. # This tells some versions of GNU make before 3.63 not to export all variables.
  273. .NOEXPORT:
  274.  
  275. # We want to echo the commands we're running without
  276. # umpteem zillion filenames along with it (we use `...' instead)
  277. # but we don't want this echoing done when the user has said
  278. # he doesn't want to see commands echoed by using -s.
  279. ifneq    "$(findstring s,$(MAKEFLAGS))" ""    # if -s
  280. +cmdecho    := echo >/dev/null
  281. else                        # not -s
  282. +cmdecho    := echo
  283. endif                           # -s
  284.  
  285. # These are the flags given to the compiler to tell
  286. # it what sort of optimization and/or debugging output to do.
  287. ifndef    +cflags
  288. # If `CFLAGS' was defined, use that.
  289. ifdef        CFLAGS
  290. +cflags    := $(filter-out -I%,$(CFLAGS))
  291. endif        # CFLAGS
  292. endif    # +cflags
  293.  
  294. # If none of the above worked, default to "-g".
  295. ifeq    "$(strip $(+cflags))" ""
  296. +cflags    := $(default_cflags)
  297. endif    # $(+cflags) == ""
  298.  
  299. # If using gcc, add flags that only it will grok.
  300. ifneq    "$(findstring gcc,$(CC))" ""
  301. +cflags := $(+cflags) $(+gccwarn)
  302. ifneq    "$(filter -O,$(+cflags))" ""
  303. +cflags := $(+cflags) $(+gccopt)
  304. +gcc-nowarn := -w
  305. endif
  306. else
  307. +gcc-nowarn :=
  308. endif    # gcc
  309.  
  310. # Don't duplicate options if we inherited variables from the parent.
  311. +cflags    := $(sort $(+cflags))
  312.  
  313.  
  314. ifneq    "$(findstring v,$(MAKEFLAGS))" ""    # if -v
  315. ifneq    "$(strip $(+cc_version))" ""
  316. # If Make is telling us version info, tell the compiler to do so as well.
  317. CC    := $(CC) -v
  318. endif    # +cc_version
  319. endif                        # -v
  320.  
  321. # These are flags given to the C compiler to
  322. # tell it to look for include files (including ones
  323. # given in angle brackets) in the current directory
  324. # and in the parent library source directory.
  325. ifneq "$(..)" ""
  326. +includes    = -I. -I$(patsubst %/,%,$(..)) $(includes)
  327. else
  328. +includes    = -I. $(includes)
  329. endif
  330.  
  331.  
  332. # These are the variables that the implicit compilation rules use.
  333. CPPFLAGS = $(+includes) $(+defines) -D_LIBC
  334. override CFLAGS    = $(+cflags)
  335.  
  336.  
  337. # This is the macro that the implicit linking rules use.
  338. ifneq "$(filter -g,$(+cflags))" "" # -g is in $(+cflags)
  339. LDFLAGS    := -g
  340. endif
  341.  
  342.  
  343. ifneq "$(filter -DHAVE_GNU_LD,$(CPPFLAGS))" ""
  344. +gnu-stabs := yes
  345. endif
  346.  
  347.  
  348. endif # Makeconfig not yet included
  349.