xref: /aoo41x/main/solenv/inc/unitools.mk (revision 2b25ddf3)
17871dc3eSAndrew Rist#**************************************************************
27871dc3eSAndrew Rist#
37871dc3eSAndrew Rist#  Licensed to the Apache Software Foundation (ASF) under one
47871dc3eSAndrew Rist#  or more contributor license agreements.  See the NOTICE file
57871dc3eSAndrew Rist#  distributed with this work for additional information
67871dc3eSAndrew Rist#  regarding copyright ownership.  The ASF licenses this file
77871dc3eSAndrew Rist#  to you under the Apache License, Version 2.0 (the
87871dc3eSAndrew Rist#  "License"); you may not use this file except in compliance
97871dc3eSAndrew Rist#  with the License.  You may obtain a copy of the License at
107871dc3eSAndrew Rist#
117871dc3eSAndrew Rist#    http://www.apache.org/licenses/LICENSE-2.0
127871dc3eSAndrew Rist#
137871dc3eSAndrew Rist#  Unless required by applicable law or agreed to in writing,
147871dc3eSAndrew Rist#  software distributed under the License is distributed on an
157871dc3eSAndrew Rist#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
167871dc3eSAndrew Rist#  KIND, either express or implied.  See the License for the
177871dc3eSAndrew Rist#  specific language governing permissions and limitations
187871dc3eSAndrew Rist#  under the License.
197871dc3eSAndrew Rist#
207871dc3eSAndrew Rist#**************************************************************
217871dc3eSAndrew Rist
227871dc3eSAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir# Common tools - move this to the end / consolidate
25cdf0e10cSrcweirTRANSEX*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/transex3
26cdf0e10cSrcweirULFEX*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/ulfex
27cdf0e10cSrcweirXMLEX*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/xmlex
28cdf0e10cSrcweirXRMEX*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/xrmex
29cdf0e10cSrcweirCFGEX*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/cfgex
30cdf0e10cSrcweirAUTODOC*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/autodoc
31cdf0e10cSrcweirLOCALIZE_SL*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/localize_sl
32cdf0e10cSrcweirGSICHECK*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/gsicheck
33cdf0e10cSrcweir
34cdf0e10cSrcweir.IF "$(SYSTEM_LIBXSLT)"!="YES"
35cdf0e10cSrcweirXSLTPROC*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/xsltproc
36cdf0e10cSrcweir.ELSE			# "$(SYSTEM_LIBXSLT)"!="YES"
37cdf0e10cSrcweirXSLTPROC*=$(AUGMENT_LIBRARY_PATH) xsltproc
38cdf0e10cSrcweir.ENDIF			# "$(SYSTEM_LIBXSLT)"!="YES"
39cdf0e10cSrcweir
40cdf0e10cSrcweirULFCONV*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/ulfconv
41cdf0e10cSrcweir
42cdf0e10cSrcweirMAKEDEPEND*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/makedepend
43cdf0e10cSrcweir
44cdf0e10cSrcweirSCP_CHECK_TOOL:=checkscp$E
45cdf0e10cSrcweir
46cdf0e10cSrcweir# iz32110: Calling a cygwin application from a non-cygwin shell requires
47cdf0e10cSrcweir# backslashes to be escaped by another backslash: EES .. extra escape slash
48cdf0e10cSrcweirEES:=
49cdf0e10cSrcweir
50cdf0e10cSrcweir# iz29675: 4nt must not quote special characters, but tcsh has to.
51cdf0e10cSrcweir# *NIX shells needs to use " quotes, but 4nt must not.
52cdf0e10cSrcweir# EMQ .. extra meta quote (\\ at line end is \)
53cdf0e10cSrcweir# USQ .. unix shell  quote
54cdf0e10cSrcweirEMQ:=\\
55cdf0e10cSrcweirUSQ:="
56cdf0e10cSrcweir
57534c536dSYuri Dario.IF "$(GUI)" == "OS2"
58534c536dSYuri DarioNULLDEV:=NUL
59534c536dSYuri Dario.ELSE
60cdf0e10cSrcweirNULLDEV:=/dev/null
61534c536dSYuri Dario.ENDIF
62cdf0e10cSrcweir
63cdf0e10cSrcweir
64cdf0e10cSrcweir# iz29609 helpmacro to check if file exists
65cdf0e10cSrcweirIFEXIST:=if [ -f
66cdf0e10cSrcweirIFNOTEXIST:= if ! test -f
67cdf0e10cSrcweirTHEN:= ] ; then
68cdf0e10cSrcweirFI:= ; fi
69cdf0e10cSrcweirPIPEERROR=2>&1 |
70cdf0e10cSrcweir
71cdf0e10cSrcweir# iz31658
72cdf0e10cSrcweirCHECKZIPRESULT:=|| ret=$$?; if [[ "$$ret" != "12" && "$$ret" != "1" ]] ; then exit $$ret ; fi && echo "Nothing to update for zip"
73cdf0e10cSrcweir
74cdf0e10cSrcweir# Platform specific
75cdf0e10cSrcweir.IF "$(GUI)"=="WNT"
76cdf0e10cSrcweirAWK*=awk
77cdf0e10cSrcweirSORT*=sort
78cdf0e10cSrcweirSED*=sed
79cdf0e10cSrcweirGNUPATCH*=patch
80cdf0e10cSrcweir# change drive and directory
81cdf0e10cSrcweirCDD=cd
82cdf0e10cSrcweir# expect cygwin tools to exist
83cdf0e10cSrcweirCOPY*=cp
84cdf0e10cSrcweirCOPYRECURSE=-r
85cdf0e10cSrcweirDEREFERENCE=-L
86cdf0e10cSrcweirCOPYUPDATE=-u
87cdf0e10cSrcweirECHON=echo -n
88cdf0e10cSrcweirECHONL=echo
89cdf0e10cSrcweirFIND*=find
90cdf0e10cSrcweirFLIPCMD*=$(PERL) $(SOLARENV)/bin/slfl.pl
91cdf0e10cSrcweirGNUCOPY*=cp
92cdf0e10cSrcweirGNUMAKE*=make
93cdf0e10cSrcweirGREP*=grep
94cdf0e10cSrcweirLS*=ls
95cdf0e10cSrcweirPERL*:=perl
96cdf0e10cSrcweir.EXPORT : PERL
97cdf0e10cSrcweirRENAME*=mv
98cdf0e10cSrcweirTOUCH*=touch
99cdf0e10cSrcweirTYPE*=cat
100cdf0e10cSrcweirDUMPBIN*=dumpbin
101cdf0e10cSrcweir
102cdf0e10cSrcweir.ELIF "$(GUI)"=="UNX"	# "$(GUI)"=="WNT"
103cdf0e10cSrcweirSED*=sed
104cdf0e10cSrcweirSORT*=sort
105cdf0e10cSrcweirPERL*=perl
106cdf0e10cSrcweir.EXPORT : PERL
107cdf0e10cSrcweirTYPE=cat
108cdf0e10cSrcweirCDD=cd
109cdf0e10cSrcweirCOPY=cp -f
11062840caaSPedro Giffuni.IF "$(OS)"=="MACOSX" || "$(OS)"=="FREEBSD"
111cdf0e10cSrcweirCOPYRECURSE=-R
11262840caaSPedro Giffuni.ELSE # Not BSD based
113cdf0e10cSrcweirCOPYRECURSE=-r
114cdf0e10cSrcweir.ENDIF
115cdf0e10cSrcweir.IF "$(OS)"=="SOLARIS"
116cdf0e10cSrcweirAWK*=nawk
117cdf0e10cSrcweirGNUCOPY*=gnucp
118cdf0e10cSrcweirGNUPATCH*=gnupatch
119cdf0e10cSrcweirGNUTAR*=/usr/sfw/bin/gtar
120cdf0e10cSrcweirDEREFERENCE=
121cdf0e10cSrcweir.ELSE			# "$(OS)"=="SOLARIS"
122cdf0e10cSrcweirAWK*=awk
123cdf0e10cSrcweir# this is not true, as BSD does not default to a GNU cp, but BSD cp
124cdf0e10cSrcweir# so in dmake makefiles one should be restricted to use the subset
125cdf0e10cSrcweir# of features that both BSD and GNU make support.
126cdf0e10cSrcweir# as the GNU make build system requires GNUCOPY to really be a GNU copy
127cdf0e10cSrcweir# we work around that for now by not setting GNUCOPY in sdev300.ini
128cdf0e10cSrcweir# for fbsd for now, but for all other platforms it is set.
129cdf0e10cSrcweirGNUCOPY*=cp
130cdf0e10cSrcweirGNUPATCH*=patch
13123ba173dSPedro GiffuniGPERF*=gperf
132cdf0e10cSrcweirDEREFERENCE=-L
133cdf0e10cSrcweir.ENDIF			# "$(OS)"=="SOLARIS"
134cdf0e10cSrcweir.IF "$(OS)"=="LINUX" || "$(OS)"=="MACOSX"
135cdf0e10cSrcweirGNUMAKE*=make
136cdf0e10cSrcweir.ELSE			# "$(OS)"=="LINUX" || "$(OS)"=="MACOSX"
137cdf0e10cSrcweirGNUMAKE*=gmake
138cdf0e10cSrcweir.ENDIF			# "$(OS)"=="LINUX" || "$(OS)"=="MACOSX"
139cdf0e10cSrcweirTOUCH=touch
140cdf0e10cSrcweirRENAME=mv
141cdf0e10cSrcweirGREP=grep
142cdf0e10cSrcweirFIND=find
143cdf0e10cSrcweirLS=ls
144cdf0e10cSrcweirECHON=echo -n
145cdf0e10cSrcweirECHONL=echo
146cdf0e10cSrcweir.ELIF "$(GUI)"=="OS2"
147dcefce6cSYuri DarioGPERF*=gperf
148cdf0e10cSrcweirSED*=sed
149cdf0e10cSrcweirSORT*=sort
150cdf0e10cSrcweirPERL*=perl
151cdf0e10cSrcweirTYPE=cat
152cdf0e10cSrcweirCDD=@cd
153534c536dSYuri DarioCOPY=cp -f
154534c536dSYuri DarioCOPYRECURSE=-r
155534c536dSYuri DarioCOPYUPDATE=-u
156cdf0e10cSrcweirDELAY=sleep
157*2b25ddf3SYuri DarioECHON*=echo -n
158534c536dSYuri DarioECHONL=echo
159cdf0e10cSrcweirAWK*=awk
160cdf0e10cSrcweirGNUCOPY*=cp
161cdf0e10cSrcweirGNUPATCH*=gnupatch
162cdf0e10cSrcweirGNUMAKE*=make
163534c536dSYuri DarioTOUCH=touch
164cdf0e10cSrcweir#YD rename doesn't work across different drives!
165cdf0e10cSrcweirRENAME=mv
166534c536dSYuri DarioMKDIR*=mkdir$E
167534c536dSYuri DarioMKDIRHIER*=mkdir$E -p
168cdf0e10cSrcweirGREP=grep
169cdf0e10cSrcweirFIND=find
170cdf0e10cSrcweirLS=ls
171cdf0e10cSrcweirDUMPBIN=echo
172cdf0e10cSrcweir
173cdf0e10cSrcweir.ENDIF			# "$(GUI)"=="UNX"
174cdf0e10cSrcweir
175cdf0e10cSrcweir# (Global) Set if not set before
176cdf0e10cSrcweirDELAY*=sleep
177cdf0e10cSrcweirMKDIR*=mkdir$E
178cdf0e10cSrcweirMKDIRHIER*=mkdir$E -p
179cdf0e10cSrcweirRMDIR*=rmdir
180cdf0e10cSrcweirXARGS*=xargs
181cdf0e10cSrcweirGNUTAR*:=tar
182cdf0e10cSrcweir
183cdf0e10cSrcweirRM+=$(RMFLAGS)
184cdf0e10cSrcweirADJUSTVISIBILITY*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/adjustvisibility
185cdf0e10cSrcweirCONVERT*:=$(PERL) $(SOLARENV)/bin/leconvert.pl
186cdf0e10cSrcweirEXECTEST := $(PERL) -w $(SOLARENV)/bin/exectest.pl
187cdf0e10cSrcweirGCCINSTLIB:=$(PERL) -w $(SOLARENV)/bin/gccinstlib.pl
188cdf0e10cSrcweir
189cdf0e10cSrcweir# The dmake $(PWD) apparantly produces paths with symlinks resolved, while the
190cdf0e10cSrcweir# bash pwd command by default produces paths with unresolved symlinks, so that
191cdf0e10cSrcweir# computing PATH_IN_MODULE in settings.mk would fail without the -P flag to the
192cdf0e10cSrcweir# bash pwd command:
193cdf0e10cSrcweirPWDFLAGS = -P
194