1 #*************************************************************************
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 # Copyright 2000, 2010 Oracle and/or its affiliates.
7 # OpenOffice.org - a multi-platform office productivity suite
9 # This file is part of OpenOffice.org.
11 # OpenOffice.org is free software: you can redistribute it and/or modify
12 # it under the terms of the GNU Lesser General Public License version 3
13 # only, as published by the Free Software Foundation.
15 # OpenOffice.org is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU Lesser General Public License version 3 for more details
19 # (a copy is included in the LICENSE file that accompanied this code).
21 # You should have received a copy of the GNU Lesser General Public License
22 # version 3 along with OpenOffice.org. If not, see
23 # <http://www.openoffice.org/license.html>
24 # for a copy of the LGPLv3 License.
26 #*************************************************************************
32 .INCLUDE
: settings.mk
34 .IF
"$(OS)$(COM)" == "WNTGCC"
36 .IF
"$(CROSS_COMPILING)" != "YES"
38 # Don't do any of this for now. We support WNTGCC (MinGW) only as
39 # cross-compiler. It is dubious whether it would be legal to copy
40 # stuff from the Windows SDK to a cross-compilation build host
41 # anyway. Some headers and/or import libraries missing in MinGW (or
42 # mingw-w64 actually) we have copied from Wine in ../wine.
44 MINGW_INCLUDE_DIR
=$(COMPATH
)$/include/
45 MINGW_W32API_INCLUDE_DIR
=$(COMPATH
)$/include/
46 MINGW_W32API_LIB_DIR
=$(COMPATH
)$/lib
/
48 SYS_INCLUDE_DIR
=$(MINGW_INCLUDE_DIR
)$/sys
/
50 PSDK_INCLUDE_DIR
=$(PSDK_HOME
)$/include$/
52 ATL_INCLUDE_DIR
=$(PSDK_HOME
)$/include$/atl
$/
54 DIRECTXSDK_INCLUDE_DIR
=$(DIRECTXSDK_HOME
)$/include$/
56 FILES_TO_COPY_FROM_MINGW
= \
60 FILES_TO_COPY_FROM_W32API
= \
72 FILES_TO_COPY_FROM_SYS
= \
75 FILES_TO_COPY_FROM_PSDK
= \
90 gdiplusimageattributes.h \
96 gdiplusstringformat.h \
137 .IF
"$(DISABLE_ATL)"==""
138 MINGWHEADER_ATL_PATCH_TARGET
=$(MISC
)$/mingwheader_atl_patch
139 MINGWHEADER_ATL_COPY_TARGET
=$(MISC
)$/mingwheader_atl_copy
140 FILES_TO_COPY_FROM_ATL
= \
149 FILES_TO_COPY_FROM_DIRECTXSDK
= \
157 $(MISC
)$/mingwheader_patch_all
: $(MISC
)$/mingwheader_patch
$(MINGWHEADER_ATL_PATCH_TARGET
) $(LB
)$/libmsvcrt.a
159 $(MISC
)$/mingwheader_patch
: $(MISC
)$/mingwheader_copy
160 patch
-bd
$(MISC
)$/mingw
-p0
-N
-f
-Z
<mingw_headers.patch
161 $(TOUCH
) $(MISC
)$/mingwheader_patch
163 .IF
"$(DISABLE_ATL)"==""
164 $(MINGWHEADER_ATL_PATCH_TARGET
) : $(MINGWHEADER_ATL_COPY_TARGET
)
165 patch
-bd
$(MISC
)$/mingw
-p0
-N
-f
-Z
<mingw_atl_headers.patch
166 $(TOUCH
) $(MINGWHEADER_ATL_PATCH_TARGET
)
169 $(MISC
)$/mingwheader_copy
:
170 $(MKDIRHIER
) $(MISC
)$/mingw
$/include
171 $(MKDIRHIER
) $(MISC
)$/mingw
$/include/sys
172 $(COPY
) $(FILES_TO_COPY_FROM_MINGW
:^
$(MINGW_INCLUDE_DIR
)) $(MISC
)$/mingw
$/include
173 $(COPY
) $(FILES_TO_COPY_FROM_W32API
:^
$(MINGW_W32API_INCLUDE_DIR
)) $(MISC
)$/mingw
$/include
174 $(COPY
) $(FILES_TO_COPY_FROM_SYS
:^
$(SYS_INCLUDE_DIR
)) $(MISC
)$/mingw
$/include$/sys
175 $(COPY
) $(FILES_TO_COPY_FROM_PSDK
:^
$(PSDK_INCLUDE_DIR
)) $(MISC
)$/mingw
$/include
176 $(COPY
) $(FILES_TO_COPY_FROM_DIRECTXSDK
:^
$(DIRECTXSDK_INCLUDE_DIR
)) $(MISC
)$/mingw
$/include
177 $(TOUCH
) $(MISC
)$/mingwheader_copy
179 .IF
"$(DISABLE_ATL)"==""
180 $(MINGWHEADER_ATL_COPY_TARGET
):
181 $(MKDIRHIER
) $(MISC
)$/mingw
$/include/atl
182 $(COPY
) $(FILES_TO_COPY_FROM_ATL
:^
$(ATL_INCLUDE_DIR
)) $(MISC
)$/mingw
$/include$/atl
183 $(TOUCH
) $(MINGWHEADER_ATL_COPY_TARGET
)
187 .IF
"$(USE_MINGW)" == "cygwin"
188 $(COPY
) $(COMPATH
)$/lib
/mingw
/libmsvcrt.a
$(LB
)$/libmsvcrt_orig.a
190 $(COPY
) $(COMPATH
)$/lib
/libmsvcrt.a
$(LB
)$/libmsvcrt_orig.a
192 cd
$(LB
) && ar -x libmsvcrt_orig.a ofmt_stub.o
193 ar -d
$(LB
)$/libmsvcrt_orig.a ofmt_stub.o
194 nm
-g
--defined-only
$(LB
)$/libmsvcrt_orig.a
> $(MISC
)$/msvcrt.nm
195 echo EXPORTS
> $(MISC
)$/msvcrt.def
196 sed
-ne
's/.* T _//p' $(MISC
)$/msvcrt.nm |
sort >> $(MISC
)$/msvcrt.def
197 -sed
-ne
's/.* I __imp__//p' $(MISC
)$/msvcrt.nm |
sort | diff
- $(MISC
)$/msvcrt.def | \
198 sed
-ne
's/^< \(.*\)$/\1 DATA/p' > $(MISC
)$/msvcrtdata.def
199 cat
$(MISC
)$/msvcrtdata.def
>> $(MISC
)$/msvcrt.def
200 dlltool
--dllname msvcrt.dll
--input-def
=$(MISC
)$/msvcrt.def
--kill-at
--output-lib
=$(LB
)$/libmsvcrt.a
201 cd
$(LB
) && ar -rs libmsvcrt.a ofmt_stub.o
204 -$(RM
) $(MISC
)$/mingw
$/include$/*.h
205 -$(RM
) $(MISC
)$/mingwheader_copy
206 -$(RM
) $(MISC
)$/mingwheader_patch