On x86 compilers without fastcall, simulate it when invoking traces and un-simulate...
[wine-gecko.git] / xpcom / typelib / xpidl / Makefile.in
blob865fe2bd23dc804312a0c9d184faa06f92a885d7
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
13 # License.
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.
22 # Contributor(s):
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 *****
38 DEPTH = ../../..
39 topsrcdir = @top_srcdir@
40 srcdir = @srcdir@
41 VPATH = @srcdir@
43 include $(DEPTH)/config/autoconf.mk
45 MODULE = xpcom
47 ifndef WINCE
48 # Sadly, the code here is too smart for the WinCE compiler's brain
49 PROGRAM = xpidl$(BIN_SUFFIX)
50 SDK_BINARY = $(PROGRAM)
51 endif
53 INTERNAL_TOOLS = 1
55 # glib and libIDL link against the non-debug msvcrt
56 MOZ_NO_DEBUG_RTL=1
58 CSRCS = \
59 xpidl.c \
60 xpidl_idl.c \
61 xpidl_util.c \
62 xpidl_header.c \
63 xpidl_typelib.c \
64 xpidl_doc.c \
65 xpidl_java.c \
66 $(NULL)
68 ifdef CROSS_COMPILE
69 HOST_PROGRAM = host_xpidl$(HOST_BIN_SUFFIX)
70 HOST_CSRCS = $(CSRCS)
71 ifdef WINCE
72 HOST_LDFLAGS += -ladvapi32.lib
73 endif
74 endif
76 ifdef STATIC_LIBIDL
77 USE_STATIC_LIBS = 1
78 endif
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
86 # time being.
88 ifndef CROSS_COMPILE
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.
92 _STRIP_SDK = 1
93 else
95 # Cross-compiling
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
101 PROGRAM=
103 # Since only host_xpidl will be built for now, always strip out the SDK
104 # (as above).
105 _STRIP_SDK=1
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
109 # conditonal.
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.
114 # _STRIP_SDK = 1
115 # endif
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.
124 NEXT_ROOT=
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")
129 endif # _STRIP_SDK
131 endif # Darwin
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 =
140 endif
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
146 ifndef GNU_CC
147 LDFLAGS += \
148 -SUBSYSTEM:CONSOLE \
149 -NODEFAULTLIB:MSVCRTD \
150 -NODEFAULTLIB:LIBC \
151 $(NULL)
153 ifneq (,$(filter-out 1700 1710,$(_MSC_VER)))
154 LDFLAGS += -SAFESEH:NO
155 endif
157 ifdef STATIC_LIBIDL
158 LDFLAGS += -NODEFAULTLIB:MSVCRT
159 endif
161 endif
162 endif
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.*)
168 ifdef CROSS_COMPILE
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)
177 endif
179 ifdef WINCE
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
184 # HOST_CFLAGS += /MD
185 LDFLAGS += -NODEFAULTLIB:MSVCRT
186 HOST_LIBS += Advapi32.lib
187 HOST_CFLAGS +=-D_X86_
188 endif
190 endif
192 export::
193 @$(MAKE) libs