summaryrefslogtreecommitdiffstats
path: root/MCONFIG
blob: 2823988ef4c6b5d373518b99859f759dd5c79db4 (plain) (blame)
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# MCONFIG -- Configuration stuff for util-linux
# Created: Sat Feb  4 15:50:30 1995
# Revised: Sun Nov 10 20:10:13 1996 by faith@cs.unc.edu
# Copyright 1995 Rickard E. Faith (faith@cs.unc.edu)

# Select for CPU one of intel, alpha, sparc, arm, m68k, mips
CPU=$(shell uname -m | sed s/i.86/intel/)

# if HAVE_LIBCRYPT is "yes" -lcrypt will be used
HAVE_LIBCRYPT=no
# HAVE_LIBCRYPT=yes

# If HAVE_PAM is set to "yes", then login, chfn, chsh, and newgrp
# will use PAM for authentication. Additionally, passwd will not be
# installed as it is not PAM aware.
HAVE_PAM=no
#HAVE_PAM=yes

# If HAVE_SHADOW is set to "yes", then login, chfn, chsh, newgrp, passwd,
# and vipw will not be built or installed from the login-utils
# subdirectory.  
HAVE_SHADOW=no
#HAVE_SHADOW=yes

# If HAVE_PASSWD is set to "yes", then passwd will not be built or
# installed from the login-utils subdirectory (but login, chfn, chsh,
# newgrp, and vipw *will* be installed).
HAVE_PASSWD=no
#HAVE_PASSWD=yes

# If you use chfn and chsh from this package, REQUIRE_PASSWORD will require
# non-root users to enter the account password before updating /etc/passwd.
REQUIRE_PASSWORD=yes
#REQUIRE_PASSWORD=no

# If you use chsh from this package, ONLY_LISTED_SHELLS will require that
# the selected shell be listed in /etc/shells -- otherwise only a warning is
# printed.  This prevents someone from setting their shell to /bin/false.
ONLY_LISTED_SHELLS=yes
#ONLY_LISTED_SHELLS=no


# If HAVE_SYSVINIT is set to "yes", then simpleinit and shutdown will not
# be built or installed from the login-utils subdirectory.  (The shutdown
# and halt that come with the SysVinit package should be used with the init
# found in that package.)
#HAVE_SYSVINIT=no
HAVE_SYSVINIT=yes

# If HAVE_SYSVINIT_UTILS is set to "yes", then last, mesg, and wall will
# not be built or installed from the login-utils subdirectory.  (The
# shutdown and init from the SysVinit package do not depend on the last,
# mesg, and wall from that package.)
#HAVE_SYSVINIT_UTILS=no
HAVE_SYSVINIT_UTILS=yes

# If HAVE_GETTY is set to "yes", then agetty will not be built or
# installed from the login-utils subdirectory.  Note that agetty can
# co-exist with other gettys, so this option should never be used.
HAVE_GETTY=no
#HAVE_GETTY=yes

# If USE_TTY_GROUP is set to "yes", then wall and write will be installed
# setgid to the "tty" group, and mesg will only set the group write bit.
# Note that this is only useful if login/xterm/etc. change the group of the
# user's tty to "tty" [The login in util-linux does this correctly, and
# xterm will do it correctly if X is compiled with USE_TTY_GROUP set
# properly.]
USE_TTY_GROUP=yes
#USE_TTY_GROUP=no

# If HAVE_STRINGS is set to "yes", then strings won't be installed.  This
# is the quick fix until the strings in GNU binutils is in wide use and has
# internationalization support.
#HAVE_STRINGS=no
HAVE_STRINGS=yes

# If HAVE_RESET is set to "yes", then reset won't be installed.  The version
# of reset that comes with the ncurses package is less aggressive.
#HAVE_RESET=no
HAVE_RESET=yes

# If HAVE_MOUNT is set to "yes", then mount won't be installed, since many
# folks grab mount independenty of util-linux
# When util-linux is released it always contains the very latest mount.
HAVE_MOUNT=no
# HAVE_MOUNT=yes

CC=		gcc

# Different optimizations for different cpus.
ifeq "$(CPU)" "intel"
  OPT=		-pipe -O3 -m486 -fomit-frame-pointer
else 
  ifeq "$(CPU)" "arm"
    OPT=	-O2 -m3 -fomit-frame-pointer
  else
    OPT=	-O3 -fomit-frame-pointer
  endif
endif

BSD= ../bsd

LDFLAGS   = -s
WARNFLAGS = -Wall
CFLAGS    = $(OPT) -I. -I$(BSD) $(WARNFLAGS) $(CURSESFLAGS) $(SLANGFLAGS) \
			$(EXTRACFLAGS) \
			-DSBINDIR=\"$(SBINDIR)\" \
			-DUSRSBINDIR=\"$(USRSBINDIR)\" \
			-DLOGDIR=\"$(LOGDIR)\" \
			-DVARPATH=\"$(VARPATH)\"

# Set HAVE_NCURSES to "yes" if you have ncurses
# (without it, more, ul and setterm are not made)
HAVE_NCURSES=yes

# ncurses appears to be installed in three major ways.
#
# There is a subdirectory /usr/include/ncurses, with curses.h in
#   CURSESFLAGS=-I/usr/include/ncurses -DNCH=0
# No such subdirectory, but ncurses/curses.h is installed as ncurses.h
#   CURSESFLAGS=-DNCH=1
# No such subdirectory - <curses.h> is the ncurses one.
#   CURSESFLAGS=-DNCH=0
# Pick your choice.
CURSESFLAGS=-DNCH=0
LIBCURSES=-lncurses

# Set HAVE_SLANG to yes if you have slang (and prefer to use that for cfdisk)
# (If neither HAVE_NCURSES nor HAVE_SLANG is defined, cfdisk is not made.)
# HAVE_SLANG=yes

# There is a subdirectory /usr/include/slang containing slcurses.h
# SLANGFLAGS=-I/usr/include/slang
# No such subdirectory - slcurses.h lives in /usr/include
#   (no extra definition required).
LIBSLANG=-lslang

DEVDIR=		$(DESTDIR)/dev
ETCDIR=		$(DESTDIR)/etc
SBINDIR=	$(DESTDIR)/sbin
USRSBINDIR=	$(DESTDIR)/usr/sbin
USRLIBDIR=      $(DESTDIR)/usr/lib
USRBINDIR=      $(DESTDIR)/usr/bin
USRGAMESDIR=    $(DESTDIR)/usr/games
BINDIR=         $(DESTDIR)/bin
VARPATH=	$(DESTDIR)/var
LOGDIR=		$(DESTDIR)/var/log
MANDIR=		$(DESTDIR)/usr/man
MAN1DIR=	$(DESTDIR)/usr/man/man1
MAN3DIR=	$(DESTDIR)/usr/man/man3
MAN5DIR=	$(DESTDIR)/usr/man/man5
MAN6DIR=	$(DESTDIR)/usr/man/man6
MAN8DIR=	$(DESTDIR)/usr/man/man8
INFODIR=	$(DESTDIR)/usr/info

# Directory for shutdown, halt, reboot, etc.
SHUTDOWNDIR=	$(SBINDIR)

# Directory for fsck
FSCKDIR=	$(SBINDIR)

# Directory for passwd
PASSWDDIR=	$(USRBINDIR)

# Modes
DIRMODE=	755
BINMODE=	755
MANMODE=	644
DATMODE=	644
INFOMODE=	644
SUIDMODE=      4711

CHMOD=		chmod
INSTALL=	install
INSTALLDIR=	$(INSTALL) -d -m $(DIRMODE)
INSTALLBIN=	$(INSTALL) -m $(BINMODE)
INSTALLMAN=	$(INSTALL) -m $(MANMODE)
INSTALLDAT=	$(INSTALL) -m $(DATMODE)
INSTALLSUID=    $(INSTALL) -m $(SUIDMODE) -o root

%.o: %.c
	$(CC) -c $(CFLAGS) $< -o $@

%: %.cc
	$(CXX) $(CFLAGS) $< -o $@