debuggers.hg

view config/SunOS.mk @ 16988:0faf620bc749

build: Make PREFIX work by fixing LIBDIR

In the current tree, setting PREFIX does not work very well. This is
because of confusion about the meaning of LIBDIR. In some places it
is the pathname tail of directories containing libraries (lib, lib64
or lib/amd64). But in other places it is a destination pathname
(implicitly, including any PREFIX). This can result in PREFIX or /usr
being added the wrong number of times.

This patch splits LIBDIR into two variables, LIBLEAFDIR and
LIBDIR. LIBDIR is the directory into which Xen libraries and other
similar code is to be placed, and includes any PREFIX. LIBLEAFDIR is
just the library tail and can be appended to various different
prefixes; for example, to construct the X11 library directory for -L.

Neither variable contains the value of DESTDIR, which is of course
used only to redirect the results of `make install' when desired.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Jan 31 09:38:34 2008 +0000 (2008-01-31)
parents 221b867ee084
children f3b418afc6be
line source
1 AS = $(CROSS_COMPILE)gas
2 LD = $(CROSS_COMPILE)gld
3 CC = $(CROSS_COMPILE)gcc
4 CPP = $(CROSS_COMPILE)gcc -E
5 AR = $(CROSS_COMPILE)gar
6 RANLIB = $(CROSS_COMPILE)granlib
7 NM = $(CROSS_COMPILE)gnm
8 STRIP = $(CROSS_COMPILE)gstrip
9 OBJCOPY = $(CROSS_COMPILE)gobjcopy
10 OBJDUMP = $(CROSS_COMPILE)gobjdump
12 MSGFMT = gmsgfmt
14 SHELL = bash
16 INSTALL = ginstall
17 INSTALL_DIR = $(INSTALL) -d -m0755 -p
18 INSTALL_DATA = $(INSTALL) -m0644 -p
19 INSTALL_PROG = $(INSTALL) -m0755 -p
21 PREFIX ?= /usr
22 BINDIR = $(PREFIX)/bin
23 INCLUDEDIR = $(PREFIX)/include
24 LIBLEAFDIR = lib
25 LIBLEAFDIR_x86_64 = lib/amd64
26 LIBDIR = $(PREFIX)/$(LIBLEAFDIR)
27 LIBDIR_x86_64 = $(PREFIX)/$(LIBLEAFDIR_x86_64)
28 MANDIR = $(PREFIX)/share/man
29 MAN1DIR = $(MANDIR)/man1
30 MAN8DIR = $(MANDIR)/man8
31 SBINDIR = $(PREFIX)/sbin
33 PRIVATE_PREFIX = $(LIBDIR)/xen
34 PRIVATE_BINDIR = $(PRIVATE_PREFIX)/bin
36 SunOS_LIBDIR = /usr/sfw/lib
37 SunOS_LIBDIR_x86_64 = /usr/sfw/lib/amd64
39 SOCKET_LIBS = -lsocket
40 CURSES_LIBS = -lcurses
41 UTIL_LIBS =
42 SONAME_LDFLAG = -h
43 SHLIB_CFLAGS = -R $(SunOS_LIBDIR) -shared
45 ifneq ($(debug),y)
46 # Optimisation flags are overridable
47 CFLAGS ?= -O2 -fno-omit-frame-pointer
48 else
49 # Less than -O1 produces bad code and large stack frames
50 CFLAGS ?= -O1 -fno-omit-frame-pointer
51 endif
53 CFLAGS += -Wa,--divide -D_POSIX_C_SOURCE=200112L -D__EXTENSIONS__