xpcom/reflect/xptcall/src/md/unix/Makefile.in
author Benoit Girard <b56girard@gmail.com>
Fri, 12 Jul 2013 08:56:54 -0400
changeset 138293 e6ebdb6069c7542f779280487e3e6a7ee76d8cb1
parent 133053 6e45e9f62d2171419a8d8780ad4779ff0488ccb5
child 142613 8bf9c217ddd9e20aaffcf6e27b5f8cbd5b7c1e6c
permissions -rw-r--r--
Bug 892861 - Remove useless -D flags 'IMPL_THEBES,_IMPL_NS_GFX,...'. r=glandium

#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

DEPTH		= @DEPTH@
topsrcdir	= @top_srcdir@
srcdir		= @srcdir@
VPATH		= @srcdir@
NO_PROFILE_GUIDED_OPTIMIZE = 1

include $(DEPTH)/config/autoconf.mk

LIBRARY_NAME	= xptcmd
EXPORT_LIBRARY	= ../..
MOZILLA_INTERNAL_API = 1

#
# The default is this buildable, but non-functioning code.
#
ifeq ($(OS_ARCH),SunOS)
ifneq (86,$(findstring 86,$(OS_TEST)))
# disable PGO for this directory with Sun Studio on SPARC because
# compiling with xprofile=collect will insert code into nsXPTCStubBase::Stub##n
NO_PROFILE_GUIDED_OPTIMIZE = 1
endif
endif

include $(topsrcdir)/config/config.mk

######################################################################
# i386 and beyond
######################################################################
#
# Lots of Unixish x86 flavors
#

ifeq (Darwin,$(OS_ARCH))
ifeq (86,$(findstring 86,$(OS_TEST)))
ifeq (x86_64,$(OS_TEST))
else
DEFINES		+= -DMOZ_NEED_LEADING_UNDERSCORE
endif
endif
endif

# IA64 Linux
ifneq (,$(filter Linux FreeBSD,$(OS_ARCH)))
ifneq (,$(findstring ia64,$(OS_TEST)))
ASFILES		:= xptcstubs_asm_ipf64.s xptcinvoke_asm_ipf64.s
endif
endif
#
# Neutrino/Intel (uses the same unixish_x86 code)
#
ifeq ($(OS_TARGET),NTO)
ifeq ($(OS_TEST),sh)
ASFILES		:= xptcstubs_asm_shle.s
endif
endif


######################################################################
# Solaris/Intel
######################################################################
#
# Solaris/Intel
#
ifeq ($(OS_ARCH),SunOS)
ifeq (x86_64,$(OS_TEST))
ifndef GNU_CC
ASFILES		:= xptcstubs_asm_x86_64_solaris_SUNW.s
endif
else
ifeq (86,$(findstring 86,$(OS_TEST)))
# 28817: if Solaris Intel OS, and native compiler, always build optimised.
ifndef GNU_CC
ASFILES		:= xptcinvoke_asm_x86_solaris_SUNW.s xptcstubs_asm_x86_solaris_SUNW.s
endif
endif
endif
endif

######################################################################
# ARM
######################################################################
#
# Linux/ARM
#
ifeq ($(OS_ARCH),Linux)
ifneq (,$(filter arm% sa110,$(OS_TEST)))
CXXFLAGS += -O2
endif
endif

######################################################################
# HPPA
######################################################################
#
# HP-UX/PA32
#
# for gas and gcc, check comment in xptcinvoke_asm_pa32.s
ifeq ($(OS_ARCH),HP-UX)
ifneq ($(CC),gcc)
ifneq ($(OS_TEST),ia64)
ASFILES		:= xptcstubs_asm_pa32.s xptcinvoke_asm_pa32.s
else
ASFILES		:= xptcstubs_asm_ipf32.s xptcinvoke_asm_ipf32.s
endif

# #18875  Building the CPP's (CXX) optimized causes a crash
CXXFLAGS 	:=  $(filter-out $(MOZ_OPTIMIZE_FLAGS), $(CXXFLAGS))
endif
endif

#
# Linux/HPPA/gcc
#
ifeq ($(OS_ARCH),Linux)
ifneq (,$(filter hppa hppa2.0 hppa1.1,$(OS_TEST)))
ifndef GNU_CXX
else
ASFILES		:= xptcstubs_asm_parisc_linux.s xptcinvoke_asm_parisc_linux.s
# #434190 optimized builds crash
CXXFLAGS 	:=  $(filter-out $(MOZ_OPTIMIZE_FLAGS), $(CXXFLAGS))
endif
endif
endif


######################################################################
# M68k
######################################################################

ifeq ($(OS_ARCH),Linux)
ifneq (,$(findstring mips, $(OS_TEST)))
ifneq (,$(findstring mips64, $(OS_TEST)))
ASFILES		:= xptcinvoke_asm_mips64.s xptcstubs_asm_mips64.s
else
ASFILES		:= xptcinvoke_asm_mips.s xptcstubs_asm_mips.s
endif
ASFLAGS		+= -I$(DIST)/include -x assembler-with-cpp
endif
endif

######################################################################
# PowerPC
######################################################################
#
# AIX/PPC
#
ifeq ($(OS_ARCH),AIX)
ifdef HAVE_64BIT_OS
ASFILES		:= xptcinvoke_asm_ppc_aix64.s xptcstubs_asm_ppc_aix64.s
else
ifeq ($(AIX_OBJMODEL),ibm)
ASFILES		:= xptcinvoke_asm_ppc_ibmobj_aix.s xptcstubs_asm_ppc_aix.s
else
ASFILES		:= xptcinvoke_asm_ppc_aix.s xptcstubs_asm_ppc_aix.s
endif
endif

# #24617  Building the CPP's (CXX) optimized causes a crash
CXXFLAGS 	:=  $(filter-out $(MOZ_OPTIMIZE_FLAGS), $(CXXFLAGS))
endif

#
# Linux/PPC
#
ifneq (,$(filter Linuxpowerpc FreeBSDpowerpc,$(OS_ARCH)$(OS_TEST)))
ASFILES		:= xptcinvoke_asm_ppc_linux.s xptcstubs_asm_ppc_linux.s
AS		:= $(CC) -c -x assembler-with-cpp
endif

#
# Linux/PPC64
#
ifneq (,$(filter Linuxpowerpc64 FreeBSDpowerpc64,$(OS_ARCH)$(OS_TEST)))
ASFILES                := xptcinvoke_asm_ppc64_linux.s xptcstubs_asm_ppc64_linux.s
AS             := $(CC) -c -x assembler-with-cpp
endif

#
# NetBSD/PPC
#
ifneq (,$(filter NetBSDmacppc NetBSDbebox NetBSDofppc NetBSDprep NetBSDamigappc,$(OS_ARCH)$(OS_TEST)))                           
ASFILES		:= xptcinvoke_asm_ppc_netbsd.s xptcstubs_asm_ppc_netbsd.s
endif

#
# OpenBSD/PPC
#
ifeq ($(OS_ARCH)$(OS_TEST),OpenBSDpowerpc)
ASFILES		:= xptcinvoke_asm_ppc_openbsd.s xptcstubs_asm_ppc_openbsd.s
AS		:= $(CC) -c -x assembler-with-cpp
endif

#
# Darwin/PPC
#
ifeq ($(OS_ARCH),Darwin)
ifeq ($(TARGET_CPU), powerpc)
ASFLAGS		+= -x assembler-with-cpp   # assumes $(AS) == $(CC)
ASFILES		:= xptcinvoke_asm_ppc_rhapsody.s xptcstubs_asm_ppc_darwin.s
endif
endif

######################################################################
# SPARC
######################################################################
#
# Linux/SPARC
#
ifeq ($(OS_ARCH),Linux)
ifneq (,$(findstring sparc,$(OS_TEST)))
ASFILES		:= xptcinvoke_asm_sparc_linux_GCC3.s xptcstubs_asm_sparc_solaris.s
endif
endif
#
# NetBSD/SPARC
#
ifeq ($(OS_ARCH)$(OS_TEST),NetBSDsparc)
ASFILES		:= xptcinvoke_asm_sparc_netbsd.s xptcstubs_asm_sparc_netbsd.s
endif
#
# OpenBSD/SPARC
#
ifeq ($(OS_ARCH)$(OS_TEST),OpenBSDsparc)
ASFILES		:= xptcinvoke_asm_sparc_openbsd.s xptcstubs_asm_sparc_openbsd.s
endif
#
# OpenBSD/SPARC64
#
ifneq (,$(filter OpenBSDsparc64 FreeBSDsparc64,$(OS_ARCH)$(OS_TEST)))
ASFILES		:= xptcinvoke_asm_sparc64_openbsd.s xptcstubs_asm_sparc64_openbsd.s
endif
#
# Solaris/SPARC
#
ifeq ($(OS_ARCH),SunOS)
ifneq (86,$(findstring 86,$(OS_TEST)))
ifdef HAVE_64BIT_OS
ASFLAGS		+= -xarch=v9
endif

ifeq ($(GNU_CC),1)
ASFILES		:= xptcinvoke_asm_sparc_solaris_GCC3.s xptcstubs_asm_sparc_solaris.s
else

ifdef HAVE_64BIT_OS
ASFILES		:= xptcinvoke_asm_sparcv9_solaris_SUNW.s xptcstubs_asm_sparcv9_solaris.s
else
ASFILES		:= xptcinvoke_asm_sparc_solaris_SUNW.s xptcstubs_asm_sparc_solaris.s
endif
endif

endif
endif

######################################################################
# S/390
######################################################################
#
# Linux for S/390
#
ifeq ($(OS_ARCH)$(OS_TEST),Linuxs390)
CXXFLAGS	+= -fno-strict-aliasing -fno-inline -fomit-frame-pointer -mbackchain
endif

ifeq ($(OS_ARCH)$(OS_TEST),Linuxs390x)
CXXFLAGS	+= -fno-strict-aliasing -fno-inline -fomit-frame-pointer -mbackchain
endif


# we don't want the shared lib, but we want to force the creation of a static lib.
FORCE_STATIC_LIB = 1

include $(topsrcdir)/config/rules.mk

DEFINES		+= -DIMPL_LIBXUL

LOCAL_INCLUDES += \
	-I$(srcdir)/../.. \
	-I$(srcdir)/../../../../xptinfo/src \
	$(NULL)

ifeq ($(OS_ARCH),Linux)
ifneq (,$(findstring mips, $(OS_TEST)))
xptcstubs_asm_mips.o: $(DIST)/include/xptcstubsdef.inc
endif
endif

ifeq ($(OS_ARCH),Darwin)
xptcstubs_asm_ppc_darwin.o: xptcstubs_asm_ppc_darwin.s.m4 $(DIST)/include/xptcstubsdef.inc Makefile
	gm4 $(INCLUDES) $< > ./xptcstubs_asm_ppc_darwin.s && \
	$(AS) -o $@ $(ASFLAGS) $(AS_DASH_C_FLAG) ./xptcstubs_asm_ppc_darwin.s
	$(RM) -f ./xptcstubs_asm_ppc_darwin.s
endif

ifeq ($(OS_ARCH),AIX)
ifdef HAVE_64BIT_OS
xptcstubs_asm_ppc_aix64.o: xptcstubs_asm_ppc_aix64.s.m4 $(DIST)/include/xptcstubsdef.inc Makefile
	m4 -DAIX_OBJMODEL=$(AIX_OBJMODEL) $(INCLUDES) -I. $< > ./xptcstubs_asm_ppc_aix64.s && \
	$(AS) -o $@ $(ASFLAGS) $(AS_DASH_C_FLAG) ./xptcstubs_asm_ppc_aix64.s
	$(RM) ./xptcstubs_asm_ppc_aix64.s
else
xptcstubs_asm_ppc_aix.o: xptcstubs_asm_ppc_aix.s.m4 $(DIST)/include/xptcstubsdef.inc Makefile
	m4 -DAIX_OBJMODEL=$(AIX_OBJMODEL) $(INCLUDES) -I. $< > ./xptcstubs_asm_ppc_aix.s && \
	$(AS) -o $@ $(ASFLAGS) $(AS_DASH_C_FLAG) ./xptcstubs_asm_ppc_aix.s
	$(RM) ./xptcstubs_asm_ppc_aix.s
endif
endif

ifeq ($(OS_ARCH),SunOS)
ifeq (86,$(findstring 86,$(OS_TEST)))
ifndef GNU_CC
ifeq (x86_64,$(OS_TEST))
xptcstubs_asm_x86_64_solaris_SUNW.o: $(DIST)/include/xptcstubsdef.inc $(srcdir)/xptcstubs_asm_x86_64_solaris_SUNW.s
	sed \
	  -e 's/^\(STUB_ENTRY\)(\([0-9]\))/\11\(\2\)/' \
	  -e 's/^\(STUB_ENTRY\)(\([0-9][0-9]\))/\12\(\2\)/' \
	  -e 's/^\(STUB_ENTRY\)(\([0-9][0-9][0-9]\))/\13\(\2\)/' \
	$(DIST)/include/xptcstubsdef.inc > ./xptcstubsdef_asm.solx86
	$(AS) -o $@ -xarch=amd64 $(ASFLAGS) $(AS_DASH_C_FLAG) -I./ $(srcdir)/xptcstubs_asm_x86_64_solaris_SUNW.s
else
xptcstubs_asm_x86_solaris_SUNW.o: $(DIST)/include/xptcstubsdef.inc $(srcdir)/xptcstubs_asm_x86_solaris_SUNW.s
	sed \
	  -e 's/^\(STUB_ENTRY\)(\([0-9]\))/\11\(\2\)/' \
	  -e 's/^\(STUB_ENTRY\)(\([0-9][0-9]\))/\12\(\2\)/' \
	  -e 's/^\(STUB_ENTRY\)(\([0-9][0-9][0-9]\))/\13\(\2\)/' \
	$(DIST)/include/xptcstubsdef.inc > ./xptcstubsdef_asm.solx86
	$(AS) -o $@ $(ASFLAGS) $(AS_DASH_C_FLAG) -I./ $(srcdir)/xptcstubs_asm_x86_solaris_SUNW.s
endif
	@rm -f ./xptcstubsdef_asm.solx86
endif
endif
endif