Catch up with Perl version.
[dragonfly.git] / share / mk / bsd.port.mk
CommitLineData
984263bc 1# $FreeBSD: src/share/mk/bsd.port.mk,v 1.303.2.2 2002/07/17 19:08:23 ru Exp $
2517e789 2# $DragonFly: src/share/mk/Attic/bsd.port.mk,v 1.36 2005/07/09 20:51:04 joerg Exp $
984263bc
MD
3
4PORTSDIR?= /usr/ports
a7dd4e91 5DFPORTSDIR?= /usr/dfports
96e28b0c 6PORTPATH!= /usr/bin/relpath ${PORTSDIR} ${.CURDIR}
984263bc 7
93507077
JS
8.if !defined(DFOSVERSION)
9DFOSVERSION!= /sbin/sysctl -n kern.osreldate
10.endif
11
d77e8324
MD
12# Temporary Hack
13#
14OSVERSION ?= 480102
15UNAME_s?= FreeBSD
16UNAME_v?=FreeBSD 4.8-CURRENT
17UNAME_r?=4.8-CURRENT
18
7390a98e 19# override for bsd.port.mk
2517e789
JS
20PERL_VERSION?= 5.8.7
21PERL_VER?= 5.8.7
7390a98e 22
d77e8324
MD
23.makeenv UNAME_s
24.makeenv UNAME_v
25.makeenv UNAME_r
d77e8324 26
5176e47f
JS
27# handle both native and override ports
28.undef USE_GETOPT_LONG
f582b0e2 29
aca618a3
JS
30.if defined(USE_RCORDER)
31_DF_USE_RCORDER:= ${USE_RCORDER}
32.endif
7f65d5da 33.if defined(USE_RC_SUBR)
aca618a3
JS
34_DF_USE_RC_SUBR:= ${USE_RC_SUBR}
35.endif
36
893f5efa 37.if !target(install-rc-script) && !defined(BEFOREPORTMK)
aca618a3
JS
38install-rc-script:
39.if defined(USE_RCORDER) || defined(USE_RC_SUBR) && ${USE_RC_SUBR:U} != "YES"
40.if defined(USE_RCORDER)
41 @${ECHO_CMD} "===> Installing early rcNG startup script(s)"
42 @${ECHO_CMD} "@cwd /" >> ${TMPPLIST}
43 @for i in ${_DF_USE_RCORDER}; do \
44 ${INSTALL_SCRIPT} ${WRKDIR}/$${i} /etc/rc.d/$${i%.sh}; \
45 ${ECHO_CMD} "etc/rc.d/$${i%.sh}" >> ${TMPPLIST}; \
46 done
47 @${ECHO_CMD} "@cwd ${PREFIX}" >> ${TMPPLIST}
48.endif
49.if defined(USE_RC_SUBR) && ${USE_RC_SUBR:U} != "YES"
50 @${ECHO_CMD} "===> Installing rcNG startup script(s)"
51 @${ECHO_CMD} "@cwd ${PREFIX}" >> ${TMPPLIST}
52 @for i in ${_DF_USE_RC_SUBR}; do \
53 ${INSTALL_SCRIPT} ${WRKDIR}/$${i} ${PREFIX}/etc/rc.d/$${i%.sh}.sh; \
54 ${ECHO_CMD} "etc/rc.d/$${i%.sh}.sh" >> ${TMPPLIST}; \
55 done
56.endif
57.else
58 @${DO_NADA}
59.endif
60.endif
61
62.if defined(USE_RC_SUBR) || defined(USE_RCORDER)
7f65d5da 63RC_SUBR= /etc/rc.subr
aca618a3
JS
64SUB_LIST+= RC_SUBR=${RC_SUBR}
65.if defined(USE_RC_SUBR) && ${USE_RC_SUBR:U} != "YES"
66SUB_FILES+= ${_DF_USE_RC_SUBR}
67.endif
68.if defined(USE_RCORDER)
69SUB_FILES+= ${_DF_USE_RCORDER}
7f65d5da 70.endif
aca618a3
JS
71.endif
72
73.undef USE_RC_SUBR
74.undef USE_RCORDER
7f65d5da 75
5176e47f
JS
76.if !exists(${DFPORTSDIR}/${PORTPATH}/Makefile)
77
4d961846 78.if defined(USE_GCC)
c50c6611 79_USE_GCC:= ${USE_GCC:S/+//}
b4682d60 80_OR_LATER:= 999
c50c6611
YT
81. if ${_USE_GCC} != ${USE_GCC}
82_OR_LATER:= ${_USE_GCC}
83. endif
84. if ${USE_GCC} == 3.4 || ${_OR_LATER} <= 3.4
4d961846
JS
85.undef USE_GCC
86CCVER= gcc34
87.makeenv CCVER
88. endif
89.endif
90
f0411e11
MD
91# If the port does not exist in /usr/dfports/<portpath> use the original
92# FreeBSD port. Also process as per normal if BEFOREPORTMK is set so
93# any expected variables are set.
96e28b0c 94#
984263bc
MD
95.include <bsd.own.mk>
96.include "${PORTSDIR}/Mk/bsd.port.mk"
96e28b0c
MD
97
98.else
99
64f10e40
JS
100.if !defined(BEFOREPORTMK)
101.undef PORTSDIR
102.endif
103
f0411e11
MD
104.undef BEFOREPORTMK
105.undef AFTERPORTMK
106
96e28b0c
MD
107# Otherwise retarget to the DragonFly override port.
108#
109
110TARGETS+= all
111TARGETS+= build
112TARGETS+= checksum
113TARGETS+= clean
114TARGETS+= clean-for-cdrom
115TARGETS+= clean-for-cdrom-list
116TARGETS+= clean-restricted
117TARGETS+= clean-restricted-list
118TARGETS+= configure
119TARGETS+= deinstall
120TARGETS+= depend
121TARGETS+= depends
122TARGETS+= describe
123TARGETS+= distclean
124TARGETS+= extract
125TARGETS+= fetch
126TARGETS+= fetch-list
127TARGETS+= ignorelist
128TARGETS+= makesum
129TARGETS+= maintainer
130TARGETS+= package
131TARGETS+= realinstall
132TARGETS+= reinstall
133TARGETS+= install
134TARGETS+= tags
135
ab30ef17
MD
136# WARNING! Do not use the -B option. This appears to propogate to the
137# gmake (probably because both use the same environment variable, MAKEFLAGS,
138# to pass make options) where as of version 3.80 -B means 'always-make',
139# which forces all targets, which blows up gnu builds in the ports system
140# because it appears to cause the configure.status target to loop.
141#
64f10e40
JS
142.if !defined(_DFPORTS_REDIRECT)
143_DFPORTS_REDIRECT=
7586422e 144.if !make(package-depends-list) && !make(all-depends-list) && \
2396cb50 145 !make(run-depends-list) && !make(build-depends-list) && \
f6d2b4cb 146 !make(describe) && !make(package-name)
f0411e11 147.BEGIN:
a7dd4e91 148 @echo "WARNING, USING DRAGONFLY OVERRIDE ${DFPORTSDIR}/${PORTPATH}"
ab30ef17 149 cd ${DFPORTSDIR}/${PORTPATH} && ${MAKE} ${.TARGETS}
64f10e40
JS
150.else
151.BEGIN:
ab30ef17 152 @cd ${DFPORTSDIR}/${PORTPATH} && ${MAKE} ${.TARGETS}
64f10e40 153.endif
f582b0e2 154.endif
96e28b0c 155
6e4cd754 156.if !empty(.TARGETS)
f72ca75d 157${.TARGETS}:
6e4cd754
JS
158.else
159all:
160.MAIN: all
161.endif
f72ca75d 162
2ab9f607
JS
163# Hack to get Makefiles with conditional statements working
164XFREE86_VERSION?= 4
165ARCH?= i386
166MACHINE_ARCH?= i386
167HAVE_GNOME?=
831eabcd 168FILESDIR?= ${.CURDIR}/files
dcc96d7a 169X_WINDOW_SYSTEM?= xfree86-4
2396cb50
JS
170CAT?= cat
171PREFIX?= /usr
172PERL_LEVEL?= 5
64f10e40
JS
173LOCALBASE?= /usr/local
174SED?= /usr/bin/sed
175ECHO_CMD?= echo
176GREP?= /usr/bin/grep
177AWK?= /usr/bin/awk
178UNAME?= /usr/bin/uname
179EXPR?= /bin/expr
180HAVE_SDL?=
2ab9f607 181
f6d2b4cb
JS
182PKG_SUFX?= .tgz
183PKGNAME!= cd ${DFPORTSDIR}/${PORTPATH}; ${MAKE} -V PKGNAME
7e6a9974
JS
184.for _CATEGORY in ${CATEGORIES}
185PKGCATEGORY?= ${_CATEGORY}
186.endfor
187_PORTDIRNAME= ${.CURDIR:T}
188PORTDIRNAME?= ${_PORTDIRNAME}
189PKGORIGIN?= ${PKGCATEGORY}/${PORTDIRNAME}
4ac34bb7 190PLIST_SUB!= cd ${DFPORTSDIR}/${PORTPATH}; ${MAKE} -V PLIST_SUB
7e6a9974 191
f6d2b4cb
JS
192PKGREPOSITORYSUBDIR?= All
193PKGREPOSITORY?= ${PACKAGES}/${PKGREPOSITORYSUBDIR}
194.if exists(${PACKAGES})
195PKGFILE?= ${PKGREPOSITORY}/${PKGNAME}${PKG_SUFX}
196.else
197PKGFILE?= ${.CURDIR}/${PKGNAME}${PKG_SUFX}
5246c1ac
HP
198.endif
199
96e28b0c
MD
200.endif
201