0
+# -*- Mode: makefile -*-
0
+# Based on patch submitted to mozilla.dev.tech.js-engine by 'Andy':
0
+# http://groups.google.com/group/mozilla.dev.tech.js-engine/browse_thread/thread/16972946bf7df82e
0
+# ***** BEGIN LICENSE BLOCK *****
0
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
0
+# The contents of this file are subject to the Mozilla Public License Version
0
+# 1.1 (the "License"); you may not use this file except in compliance with
0
+# the License. You may obtain a copy of the License at
0
+# http://www.mozilla.org/MPL/
0
+# Software distributed under the License is distributed on an "AS IS" basis,
0
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
0
+# for the specific language governing rights and limitations under the
0
+# The Original Code is Mozilla Communicator client code, released
0
+# The Initial Developer of the Original Code is
0
+# Netscape Communications Corporation.
0
+# Portions created by the Initial Developer are Copyright (C) 1998
0
+# the Initial Developer. All Rights Reserved.
0
+# Alternatively, the contents of this file may be used under the terms of
0
+# either the GNU General Public License Version 2 or later (the "GPL"), or
0
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
0
+# in which case the provisions of the GPL or the LGPL are applicable instead
0
+# of those above. If you wish to allow use of your version of this file only
0
+# under the terms of either the GPL or the LGPL, and not to allow others to
0
+# use your version of this file under the terms of the MPL, indicate your
0
+# decision by deleting the provisions above and replace them with the notice
0
+# and other provisions required by the GPL or the LGPL. If you do not delete
0
+# the provisions above, a recipient may use your version of this file under
0
+# the terms of any one of the MPL, the GPL or the LGPL.
0
+# ***** END LICENSE BLOCK *****
0
+# Config for all versions of Mingw (copy and modified from Linux)
0
+AR = i586-mingw32msvc-ar
0
+CC = i586-mingw32msvc-gcc
0
+LD = i586-mingw32msvc-ld
0
+CCC = i586-mingw32msvc-g++
0
+CFLAGS += -Wall -Wno-format
0
+#OS_CFLAGS = -DXP_UNIX -DSVR4 -DSYSV -D_BSD_SOURCE -DPOSIX_SOURCE -DHAVE_LOCALTIME_R -DEXPORT_JS_API
0
+OS_CFLAGS = -D_X86_=1 -DXP_WIN -DXP_WIN32 -DWIN32 -D_WINDOWS -D_WIN32 $(WIN_CFLAGS) -DEXPORT_JS_API
0
+JSDLL_CFLAGS = -DEXPORT_JS_API # not work, dunno why?
0
+# libgcc.a:__divdi3 kernel32:DebugBreak,GetSystemTimeAsFileTime
0
+# winmm:timeBeginPeriod,timeEndPeriod
0
+WINLIBS = -lmsvcrt -lm -lkernel32 -lwinmm /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/libgcc.a
0
+#LDFLAGS += $(WINLIBS) # dont work. rewrite by Makefile.ref
0
+OTHER_LIBS += $(WINLIBS)
0
+MKSHLIB = $(LD) -shared $(XMKSHLIBOPTS)
0
+LIBRARY = $(OBJDIR)/js32.lib
0
+SHARED_LIBRARY = $(OBJDIR)/js32.dll
0
+PROGRAM = $(OBJDIR)/js.exe
0
+# $(CC) -c -MD $*.d $(CFLAGS) $<
0
+CPU_ARCH = $(shell uname -m)
0
+# don't filter in x86-64 architecture
0
+ifneq (x86_64,$(CPU_ARCH))
0
+ifeq (86,$(findstring 86,$(CPU_ARCH)))
0
+OS_CFLAGS+= -DX86_LINUX
0
+# if using gcc on x86, check version for opt bug
0
+# (http://bugzilla.mozilla.org/show_bug.cgi?id=24892)
0
+GCC_VERSION := $(shell gcc -v 2>&1 | grep version | awk '{ print $$3 }')
0
+GCC_LIST:=$(sort 2.91.66 $(GCC_VERSION) )
0
+ifeq (2.91.66, $(firstword $(GCC_LIST)))
0
+ASFLAGS += -x assembler-with-cpp
0
+ifeq ($(CPU_ARCH),alpha)
0
+# Ask the C compiler on alpha linux to let us work with denormalized
0
+# double values, which are required by the ECMA spec.
0
+# Use the editline library to provide line-editing support.
0
+#JS_EDITLINE = 1 // not support by Mingw
0
+ifeq ($(CPU_ARCH),x86_64)
0
+# Use VA_COPY() standard macro on x86-64
0
+# FIXME: better use it everywhere
0
+OS_CFLAGS += -DHAVE_VA_COPY
0
+ifeq ($(CPU_ARCH),x86_64)
0
+# We need PIC code for shared libraries
0
+# FIXME: better patch rules.mk & fdlibm/Makefile*
0
+OS_CFLAGS += -DPIC -fPIC
Comments
No one has commented yet.