-
Notifications
You must be signed in to change notification settings - Fork 47
/
Makefile
101 lines (88 loc) · 2.9 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License, Version 1.0 only
# (the "License"). You may not use this file except in compliance
# with the License.
#
# You can obtain a copy of the license at COPYING
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at COPYING.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
# Copyright (c) 2012, Joyent, Inc. All rights reserved.
#
VER = ncurses-5.7
include ../Makefile.defs
BUILD64 = yes
AUTOCONF_PREFIX = /usr/gnu
AUTOCONF_OPTS += \
-C \
--with-shared \
--without-normal
AUTOCONF_OPTS.64 += \
--libdir=/usr/gnu/lib/amd64
LDFLAGS += -R/usr/gnu/lib
LDFLAGS.64 += -R/usr/gnu/lib/amd64
PATCHES = \
ncurses-01-widec.diff \
ncurses-02-rpath.diff
USRDIR = $(DESTDIR)/usr
include ../Makefile.targ
all: hack-curses all_autoconf
#
# This horrid mess is needed because the ncurses build process isn't smart
# enough to look in its own directories for libraries before those passed
# in via -Lwhatever in LDFLAGS. So we move any problematic ones out of the
# way before we build, then move them back after.
#
# You got a better idea?
#
.PHONY: hack-curses
hack-curses:
for l in form menu panel; do \
if [ -L $(DESTDIR)/usr/lib/lib$$l.so ]; then \
mv $(DESTDIR)/usr/lib/lib$$l.so \
$(DESTDIR)/usr/lib/lib$$l__curses.so; \
fi; \
if [ -L $(DESTDIR)/usr/lib/64/lib$$l.so ]; then \
mv $(DESTDIR)/usr/lib/64/lib$$l.so \
$(DESTDIR)/usr/lib/64/lib$$l__curses.so; \
fi; \
done
.PHONY: hack-curses
unhack-curses:
for l in form menu panel; do \
if [ -L $(DESTDIR)/usr/lib/lib$$l__curses.so ]; then \
mv $(DESTDIR)/usr/lib/lib$$l__curses.so \
$(DESTDIR)/usr/lib/lib$$l.so; \
fi; \
if [ -L $(DESTDIR)/usr/lib/64/lib$$l__curses.so ]; then \
mv $(DESTDIR)/usr/lib/64/lib$$l__curses.so \
$(DESTDIR)/usr/lib/64/lib$$l.so; \
fi; \
done
install: all unhack-curses
mkdir -p $(DESTDIR)
(cd $(VER.64); env - PATH=$(DESTDIR)/usr/bin:/usr/bin:$(PATH) \
gmake DESTDIR=$(DESTDIR) install)
(cd $(VER.32); env - PATH=$(DESTDIR)/usr/bin:/usr/bin:$(PATH) \
gmake DESTDIR=$(DESTDIR) install)
mv $(USRDIR)/gnu/bin/infocmp $(USRDIR)/bin/ginfocmp
mv $(USRDIR)/gnu/bin/tic $(USRDIR)/bin/gtic
mv $(USRDIR)/gnu/bin/toe $(USRDIR)/bin/gtoe
mv $(USRDIR)/gnu/bin/tput $(USRDIR)/bin/gtput
mv $(USRDIR)/gnu/bin/tset $(USRDIR)/bin/gtset
rm -rf $(USRDIR)/include/ncurses
mv $(USRDIR)/gnu/include/ncurses $(USRDIR)/include
mkdir -p $(USRDIR)/gnu/share/doc/ncurses
rm -f $(USRDIR)/gnu/share/doc/ncurses/README
cp $(VER.32)/README $(USRDIR)/gnu/share/doc/ncurses