2 # ***** BEGIN LICENSE BLOCK *****
3 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 # The contents of this file are subject to the Mozilla Public License Version
6 # 1.1 (the "License"); you may not use this file except in compliance with
7 # the License. You may obtain a copy of the License at
8 # http://www.mozilla.org/MPL/
10 # Software distributed under the License is distributed on an "AS IS" basis,
11 # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 # for the specific language governing rights and limitations under the
15 # The Original Code is mozilla.org code.
17 # The Initial Developer of the Original Code is
18 # Netscape Communications Corporation.
19 # Portions created by the Initial Developer are Copyright (C) 1998
20 # the Initial Developer. All Rights Reserved.
24 # Alternatively, the contents of this file may be used under the terms of
25 # either the GNU General Public License Version 2 or later (the "GPL"), or
26 # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 # in which case the provisions of the GPL or the LGPL are applicable instead
28 # of those above. If you wish to allow use of your version of this file only
29 # under the terms of either the GPL or the LGPL, and not to allow others to
30 # use your version of this file under the terms of the MPL, indicate your
31 # decision by deleting the provisions above and replace them with the notice
32 # and other provisions required by the GPL or the LGPL. If you do not delete
33 # the provisions above, a recipient may use your version of this file under
34 # the terms of any one of the MPL, the GPL or the LGPL.
36 # ***** END LICENSE BLOCK *****
39 topsrcdir
= @top_srcdir@
43 include $(DEPTH
)/config
/autoconf.mk
48 # Sadly, the code here is too smart for the WinCE compiler's brain
49 PROGRAM
= xpidl
$(BIN_SUFFIX
)
50 SDK_BINARY
= $(PROGRAM
)
55 # glib and libIDL link against the non-debug msvcrt
69 HOST_PROGRAM
= host_xpidl
$(HOST_BIN_SUFFIX
)
72 HOST_LDFLAGS
+= -ladvapi32.lib
80 ifeq ($(OS_ARCH
),Darwin
)
81 # The only reason to not always strip the SDK out is that the libraries
82 # in / on ppc currently aren't fat, preventing the target xpidl from linking
83 # on a ppc->x86 build. The SDK, presumably 10.4u, must be included in that
84 # case in order to successfully link. Because the target xpidl isn't
85 # currently built in a cross compile, though, this point is moot for the
89 # When doing a native build, don't build xpidl against the SDK. libIDL
90 # was most likely configured for the system headers, and bringing in the
91 # SDK's headers instead will cause problems.
97 # Don't build xpidl for the target. This is not intended to be a permanent
98 # solution. It's necessary because it is presently difficult to build
99 # xpidl's prerequisites (libIDL and glib) as fat and suitable for a cross.
100 # This will be fixed. -mm
103 # Since only host_xpidl will be built for now, always strip out the SDK
107 # When fat xpidl prerequisites are available, the PROGRAM= and _STRIP_SDK=1
108 # above are expected to disappear, and be replaced with the following
111 # ifeq (86_powerpc,$(findstring 86,$(host_cpu))_$(TARGET_CPU))
112 # # When cross-compiling from x86 to ppc, an old (10.2-ish) SDK might be in
113 # # use, and libIDL will have been configured for new (10.4-ish) headers.
117 endif # CROSS_COMPILE
119 ifneq (,$(_STRIP_SDK
)$(MACOS_SDK_DIR
))
120 # libIDL is configured for the system's headers, with no SDK involved.
121 # There may be header conflicts if the SDK used for the Mozilla build
122 # is used here. There are very few specific cases where the SDK needs to
123 # remain set to build xpidl.
125 OS_CFLAGS
:= $(shell echo
$(OS_CFLAGS
)|sed
-E
-e
"s%((-I|-isystem )$(MACOS_SDK_DIR)/usr/(include|lib/gcc)[^ ]*)|-F$(MACOS_SDK_DIR)(/System)?/Library/Frameworks[^ ]*|-nostdinc[^ ]*|-isysroot $(MACOS_SDK_DIR)%%g")
126 OS_CFLAGS
:= $(patsubst -I
$(MACOS_SDK_DIR
)%,-I
%,$(OS_CFLAGS
))
127 OS_LIBS
:= $(patsubst -L
$(MACOS_SDK_DIR
)/usr
/lib
%,,$(OS_LIBS
))
128 LDFLAGS
:= $(shell echo
$(LDFLAGS
)|sed
-E
-e
"s%-Wl,-syslibroot,$(MACOS_SDK_DIR)%%g")
133 include $(topsrcdir
)/config
/rules.mk
135 CFLAGS
+= $(LIBIDL_CFLAGS
)
137 # Do not link to jemalloc
138 ifeq ($(OS_ARCH
),SunOS
)
139 SOLARIS_JEMALLOC_LDFLAGS
=
142 # Compile directly against the static lib, so we can use xpidl during the build
143 # without the shared library path being set.
144 ifneq (,$(filter WINNT WINCE OS2
,$(OS_ARCH
)))
145 DEFINES
+= -DEXPORT_XPT_API
149 -NODEFAULTLIB
:MSVCRTD \
153 ifneq (,$(filter-out 1700 1710,$(_MSC_VER
)))
154 LDFLAGS
+= -SAFESEH
:NO
158 LDFLAGS
+= -NODEFAULTLIB
:MSVCRT
164 # Tell the $(PROGRAM) target that we need to be recompiled when libxpt changes.
165 LIBS
= $(DIST
)/lib
/$(LIB_PREFIX
)xpt.
$(LIB_SUFFIX
) $(LIBIDL_LIBS
)
166 EXTRA_DEPS
= $(wildcard $(DIST
)/lib
/$(LIB_PREFIX
)xpt.
*)
171 HOST_CFLAGS
+= $(HOST_LIBIDL_CFLAGS
)
172 HOST_LIBS
= $(DIST
)/host
/lib
/$(LIB_PREFIX
)hostxpt.
$(LIB_SUFFIX
) $(HOST_LIBIDL_LIBS
)
173 HOST_EXTRA_DEPS
= $(wildcard $(DIST
)/host
/lib
/$(LIB_PREFIX
)hostxpt.
*)
175 ifdef HOST_NSPR_MDCPUCFG
176 HOST_CFLAGS
+= -DMDCPUCFG
=$(HOST_NSPR_MDCPUCFG
)
180 # Compile directly against the static lib, so we can use the tools
181 # during the build without the shared library path being set.
182 HOST_CFLAGS
+= -DEXPORT_XPT_API
183 # Force MOZ_NO_DEBUG_RTL=1
185 LDFLAGS
+= -NODEFAULTLIB
:MSVCRT
186 HOST_LIBS
+= Advapi32.lib
187 HOST_CFLAGS
+=-D_X86_