xref: /trunk/main/solenv/inc/unitools.mk (revision cdf0e10c)
1*cdf0e10cSrcweir#*************************************************************************
2*cdf0e10cSrcweir#
3*cdf0e10cSrcweir# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir#
5*cdf0e10cSrcweir# Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir#
7*cdf0e10cSrcweir# OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir#
9*cdf0e10cSrcweir# This file is part of OpenOffice.org.
10*cdf0e10cSrcweir#
11*cdf0e10cSrcweir# OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir# it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir# only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir#
15*cdf0e10cSrcweir# OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir# but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir# GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir# (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir#
21*cdf0e10cSrcweir# You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir# version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir# <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir# for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir#
26*cdf0e10cSrcweir#*************************************************************************
27*cdf0e10cSrcweir
28*cdf0e10cSrcweir# Common tools - move this to the end / consolidate
29*cdf0e10cSrcweirTRANSEX*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/transex3
30*cdf0e10cSrcweirULFEX*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/ulfex
31*cdf0e10cSrcweirXMLEX*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/xmlex
32*cdf0e10cSrcweirXRMEX*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/xrmex
33*cdf0e10cSrcweirCFGEX*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/cfgex
34*cdf0e10cSrcweirAUTODOC*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/autodoc
35*cdf0e10cSrcweirLOCALIZE_SL*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/localize_sl
36*cdf0e10cSrcweirGSICHECK*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/gsicheck
37*cdf0e10cSrcweir
38*cdf0e10cSrcweir.IF "$(SYSTEM_LIBXSLT)"!="YES"
39*cdf0e10cSrcweirXSLTPROC*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/xsltproc
40*cdf0e10cSrcweir.ELSE			# "$(SYSTEM_LIBXSLT)"!="YES"
41*cdf0e10cSrcweirXSLTPROC*=$(AUGMENT_LIBRARY_PATH) xsltproc
42*cdf0e10cSrcweir.ENDIF			# "$(SYSTEM_LIBXSLT)"!="YES"
43*cdf0e10cSrcweir
44*cdf0e10cSrcweirULFCONV*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/ulfconv
45*cdf0e10cSrcweir
46*cdf0e10cSrcweirMAKEDEPEND*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/makedepend
47*cdf0e10cSrcweir
48*cdf0e10cSrcweirSCP_CHECK_TOOL:=checkscp$E
49*cdf0e10cSrcweir
50*cdf0e10cSrcweir# iz32110: Calling a cygwin application from a non-cygwin shell requires
51*cdf0e10cSrcweir# backslashes to be escaped by another backslash: EES .. extra escape slash
52*cdf0e10cSrcweirEES:=
53*cdf0e10cSrcweir
54*cdf0e10cSrcweir# iz29675: 4nt must not quote special characters, but tcsh has to.
55*cdf0e10cSrcweir# *NIX shells needs to use " quotes, but 4nt must not.
56*cdf0e10cSrcweir# EMQ .. extra meta quote (\\ at line end is \)
57*cdf0e10cSrcweir# USQ .. unix shell  quote
58*cdf0e10cSrcweirEMQ:=\\
59*cdf0e10cSrcweirUSQ:="
60*cdf0e10cSrcweir
61*cdf0e10cSrcweirNULLDEV:=/dev/null
62*cdf0e10cSrcweir
63*cdf0e10cSrcweir
64*cdf0e10cSrcweir# iz29609 helpmacro to check if file exists
65*cdf0e10cSrcweirIFEXIST:=if [ -f
66*cdf0e10cSrcweirIFNOTEXIST:= if ! test -f
67*cdf0e10cSrcweirTHEN:= ] ; then
68*cdf0e10cSrcweirFI:= ; fi
69*cdf0e10cSrcweirPIPEERROR=2>&1 |
70*cdf0e10cSrcweir
71*cdf0e10cSrcweir# iz31658
72*cdf0e10cSrcweirCHECKZIPRESULT:=|| ret=$$?; if [[ "$$ret" != "12" && "$$ret" != "1" ]] ; then exit $$ret ; fi && echo "Nothing to update for zip"
73*cdf0e10cSrcweir
74*cdf0e10cSrcweir# Platform specific
75*cdf0e10cSrcweir.IF "$(GUI)"=="WNT"
76*cdf0e10cSrcweirAWK*=awk
77*cdf0e10cSrcweirSORT*=sort
78*cdf0e10cSrcweirSED*=sed
79*cdf0e10cSrcweirGNUPATCH*=patch
80*cdf0e10cSrcweir# change drive and directory
81*cdf0e10cSrcweirCDD=cd
82*cdf0e10cSrcweir# expect cygwin tools to exist
83*cdf0e10cSrcweirCOPY*=cp
84*cdf0e10cSrcweirCOPYRECURSE=-r
85*cdf0e10cSrcweirDEREFERENCE=-L
86*cdf0e10cSrcweirCOPYUPDATE=-u
87*cdf0e10cSrcweirECHON=echo -n
88*cdf0e10cSrcweirECHONL=echo
89*cdf0e10cSrcweirFIND*=find
90*cdf0e10cSrcweirFLIPCMD*=$(PERL) $(SOLARENV)/bin/slfl.pl
91*cdf0e10cSrcweirGNUCOPY*=cp
92*cdf0e10cSrcweirGNUMAKE*=make
93*cdf0e10cSrcweirGREP*=grep
94*cdf0e10cSrcweirLS*=ls
95*cdf0e10cSrcweirPERL*:=perl
96*cdf0e10cSrcweir.EXPORT : PERL
97*cdf0e10cSrcweirRENAME*=mv
98*cdf0e10cSrcweirTOUCH*=touch
99*cdf0e10cSrcweirTYPE*=cat
100*cdf0e10cSrcweirDUMPBIN*=dumpbin
101*cdf0e10cSrcweir
102*cdf0e10cSrcweir.ELIF "$(GUI)"=="UNX"	# "$(GUI)"=="WNT"
103*cdf0e10cSrcweirSED*=sed
104*cdf0e10cSrcweirSORT*=sort
105*cdf0e10cSrcweirPERL*=perl
106*cdf0e10cSrcweir.EXPORT : PERL
107*cdf0e10cSrcweirTYPE=cat
108*cdf0e10cSrcweirCDD=cd
109*cdf0e10cSrcweirCOPY=cp -f
110*cdf0e10cSrcweir.IF "$(OS)"=="MACOSX"
111*cdf0e10cSrcweirCOPYRECURSE=-R
112*cdf0e10cSrcweir.ELSE #"$(OS)"=="MACOSX"
113*cdf0e10cSrcweirCOPYRECURSE=-r
114*cdf0e10cSrcweir.ENDIF
115*cdf0e10cSrcweir.IF "$(OS)"=="SOLARIS"
116*cdf0e10cSrcweirAWK*=nawk
117*cdf0e10cSrcweirGNUCOPY*=gnucp
118*cdf0e10cSrcweirGNUPATCH*=gnupatch
119*cdf0e10cSrcweirGNUTAR*=/usr/sfw/bin/gtar
120*cdf0e10cSrcweirDEREFERENCE=
121*cdf0e10cSrcweir.ELSE			# "$(OS)"=="SOLARIS"
122*cdf0e10cSrcweirAWK*=awk
123*cdf0e10cSrcweir# this is not true, as BSD does not default to a GNU cp, but BSD cp
124*cdf0e10cSrcweir# so in dmake makefiles one should be restricted to use the subset
125*cdf0e10cSrcweir# of features that both BSD and GNU make support.
126*cdf0e10cSrcweir# as the GNU make build system requires GNUCOPY to really be a GNU copy
127*cdf0e10cSrcweir# we work around that for now by not setting GNUCOPY in sdev300.ini
128*cdf0e10cSrcweir# for fbsd for now, but for all other platforms it is set.
129*cdf0e10cSrcweirGNUCOPY*=cp
130*cdf0e10cSrcweirGNUPATCH*=patch
131*cdf0e10cSrcweirDEREFERENCE=-L
132*cdf0e10cSrcweir.ENDIF			# "$(OS)"=="SOLARIS"
133*cdf0e10cSrcweir.IF "$(OS)"=="LINUX" || "$(OS)"=="MACOSX"
134*cdf0e10cSrcweirGNUMAKE*=make
135*cdf0e10cSrcweir.ELSE			# "$(OS)"=="LINUX" || "$(OS)"=="MACOSX"
136*cdf0e10cSrcweirGNUMAKE*=gmake
137*cdf0e10cSrcweir.ENDIF			# "$(OS)"=="LINUX" || "$(OS)"=="MACOSX"
138*cdf0e10cSrcweirTOUCH=touch
139*cdf0e10cSrcweirRENAME=mv
140*cdf0e10cSrcweirGREP=grep
141*cdf0e10cSrcweirFIND=find
142*cdf0e10cSrcweirLS=ls
143*cdf0e10cSrcweirECHON=echo -n
144*cdf0e10cSrcweirECHONL=echo
145*cdf0e10cSrcweir.ELIF "$(GUI)"=="OS2"
146*cdf0e10cSrcweirSED*=sed
147*cdf0e10cSrcweirSORT*=sort
148*cdf0e10cSrcweirPERL*=perl
149*cdf0e10cSrcweirTYPE=cat
150*cdf0e10cSrcweirCDD=@cd
151*cdf0e10cSrcweirCOPY*=$(SHELL) /c copy /b
152*cdf0e10cSrcweirCOPYRECURSE=/s
153*cdf0e10cSrcweirCOPYUPDATE=/u
154*cdf0e10cSrcweirDELAY=sleep
155*cdf0e10cSrcweirECHON*=echos
156*cdf0e10cSrcweirECHONL=+echo.
157*cdf0e10cSrcweirAWK*=awk
158*cdf0e10cSrcweirGNUCOPY*=cp
159*cdf0e10cSrcweirGNUPATCH*=gnupatch
160*cdf0e10cSrcweirGNUMAKE*=make
161*cdf0e10cSrcweirTOUCH=touch /c
162*cdf0e10cSrcweir#YD rename doesn't work across different drives!
163*cdf0e10cSrcweirRENAME=mv
164*cdf0e10cSrcweirMKDIR=+md
165*cdf0e10cSrcweirMKDIRHIER=+md /s
166*cdf0e10cSrcweirGREP=grep
167*cdf0e10cSrcweirFIND=find
168*cdf0e10cSrcweirLS=ls
169*cdf0e10cSrcweirDUMPBIN=echo
170*cdf0e10cSrcweir4nt_force_shell:=+
171*cdf0e10cSrcweir
172*cdf0e10cSrcweir.ENDIF			# "$(GUI)"=="UNX"
173*cdf0e10cSrcweir
174*cdf0e10cSrcweir# (Global) Set if not set before
175*cdf0e10cSrcweirDELAY*=sleep
176*cdf0e10cSrcweirMKDIR*=mkdir$E
177*cdf0e10cSrcweirMKDIRHIER*=mkdir$E -p
178*cdf0e10cSrcweirRMDIR*=rmdir
179*cdf0e10cSrcweirXARGS*=xargs
180*cdf0e10cSrcweirGNUTAR*:=tar
181*cdf0e10cSrcweir
182*cdf0e10cSrcweirRM+=$(RMFLAGS)
183*cdf0e10cSrcweirADJUSTVISIBILITY*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/adjustvisibility
184*cdf0e10cSrcweirCONVERT*:=$(PERL) $(SOLARENV)/bin/leconvert.pl
185*cdf0e10cSrcweirEXECTEST := $(PERL) -w $(SOLARENV)/bin/exectest.pl
186*cdf0e10cSrcweirGCCINSTLIB:=$(PERL) -w $(SOLARENV)/bin/gccinstlib.pl
187*cdf0e10cSrcweir
188*cdf0e10cSrcweir# The dmake $(PWD) apparantly produces paths with symlinks resolved, while the
189*cdf0e10cSrcweir# bash pwd command by default produces paths with unresolved symlinks, so that
190*cdf0e10cSrcweir# computing PATH_IN_MODULE in settings.mk would fail without the -P flag to the
191*cdf0e10cSrcweir# bash pwd command:
192*cdf0e10cSrcweirPWDFLAGS = -P
193