jbarnette-johnson 1.0.0.20090326161333 → 1.0.0.20090402144841

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -728,7 +728,8 @@ js_IsXMLName(JSContext *cx, jsval v)
728
728
  }
729
729
 
730
730
  static JSBool
731
- Namespace(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
731
+ NamespaceHelper(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
732
+ jsval *rval)
732
733
  {
733
734
  jsval urival, prefixval;
734
735
  JSObject *uriobj;
@@ -750,7 +751,7 @@ Namespace(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
750
751
  else uriobj = NULL;
751
752
  #endif
752
753
 
753
- if (!(cx->fp->flags & JSFRAME_CONSTRUCTING)) {
754
+ if (!obj) {
754
755
  /* Namespace called as function. */
755
756
  if (argc == 1 && isNamespace) {
756
757
  /* Namespace called with one Namespace argument is identity. */
@@ -837,22 +838,32 @@ Namespace(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
837
838
  }
838
839
 
839
840
  static JSBool
840
- QName(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
841
+ Namespace(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
842
+ {
843
+ return NamespaceHelper(cx,
844
+ (cx->fp->flags & JSFRAME_CONSTRUCTING) ? obj : NULL,
845
+ argc, argv, rval);
846
+ }
847
+
848
+ static JSBool
849
+ QNameHelper(JSContext *cx, JSObject *obj, JSClass *clasp, uintN argc,
850
+ jsval *argv, jsval *rval)
841
851
  {
842
852
  jsval nameval, nsval;
843
853
  JSBool isQName, isNamespace;
844
854
  JSXMLQName *qn;
845
855
  JSString *uri, *prefix, *name;
846
856
  JSObject *nsobj;
847
- JSClass *clasp;
848
857
  JSXMLNamespace *ns;
849
858
 
859
+ JS_ASSERT(clasp == &js_QNameClass.base ||
860
+ clasp == &js_AttributeNameClass);
850
861
  nameval = argv[argc > 1];
851
862
  isQName =
852
863
  !JSVAL_IS_PRIMITIVE(nameval) &&
853
864
  OBJ_GET_CLASS(cx, JSVAL_TO_OBJECT(nameval)) == &js_QNameClass.base;
854
865
 
855
- if (!(cx->fp->flags & JSFRAME_CONSTRUCTING)) {
866
+ if (!obj) {
856
867
  /* QName called as function. */
857
868
  if (argc == 1 && isQName) {
858
869
  /* QName called with one QName argument is identity. */
@@ -861,13 +872,10 @@ QName(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
861
872
  }
862
873
 
863
874
  /*
864
- * Create and return a new QName object exactly as if constructed.
865
- * Use the constructor's clasp so we can be shared by AttributeName
866
- * (see below after this function).
875
+ * Create and return a new QName or AttributeName object exactly as if
876
+ * constructed.
867
877
  */
868
- obj = js_NewObject(cx,
869
- JS_ValueToFunction(cx, argv[-2])->u.n.clasp,
870
- NULL, NULL, 0);
878
+ obj = js_NewObject(cx, clasp, NULL, NULL, 0);
871
879
  if (!obj)
872
880
  return JS_FALSE;
873
881
  *rval = OBJECT_TO_JSVAL(obj);
@@ -961,15 +969,19 @@ out:
961
969
  return JS_TRUE;
962
970
  }
963
971
 
972
+ static JSBool
973
+ QName(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
974
+ {
975
+ return QNameHelper(cx, (cx->fp->flags & JSFRAME_CONSTRUCTING) ? obj : NULL,
976
+ &js_QNameClass.base, argc, argv, rval);
977
+ }
978
+
964
979
  static JSBool
965
980
  AttributeName(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
966
981
  jsval *rval)
967
982
  {
968
- /*
969
- * Since js_AttributeNameClass was initialized, obj will have that as its
970
- * class, not js_QNameClass.
971
- */
972
- return QName(cx, obj, argc, argv, rval);
983
+ return QNameHelper(cx, (cx->fp->flags & JSFRAME_CONSTRUCTING) ? obj : NULL,
984
+ &js_AttributeNameClass, argc, argv, rval);
973
985
  }
974
986
 
975
987
  /*
@@ -1963,6 +1975,7 @@ ParseXMLSource(JSContext *cx, JSString *src)
1963
1975
  {
1964
1976
  jsval nsval;
1965
1977
  JSXMLNamespace *ns;
1978
+ JSString *uri;
1966
1979
  size_t urilen, srclen, length, offset, dstlen;
1967
1980
  jschar *chars;
1968
1981
  const jschar *srcp, *endp;
@@ -1976,8 +1989,8 @@ ParseXMLSource(JSContext *cx, JSString *src)
1976
1989
  JSXMLArray nsarray;
1977
1990
  uintN flags;
1978
1991
 
1979
- static const char prefix[] = "<parent xmlns='";
1980
- static const char middle[] = "'>";
1992
+ static const char prefix[] = "<parent xmlns=\"";
1993
+ static const char middle[] = "\">";
1981
1994
  static const char suffix[] = "</parent>";
1982
1995
 
1983
1996
  #define constrlen(constr) (sizeof(constr) - 1)
@@ -1985,8 +1998,9 @@ ParseXMLSource(JSContext *cx, JSString *src)
1985
1998
  if (!js_GetDefaultXMLNamespace(cx, &nsval))
1986
1999
  return NULL;
1987
2000
  ns = (JSXMLNamespace *) JS_GetPrivate(cx, JSVAL_TO_OBJECT(nsval));
2001
+ uri = js_EscapeAttributeValue(cx, ns->uri, JS_FALSE);
1988
2002
 
1989
- urilen = JSSTRING_LENGTH(ns->uri);
2003
+ urilen = JSSTRING_LENGTH(uri);
1990
2004
  srclen = JSSTRING_LENGTH(src);
1991
2005
  length = constrlen(prefix) + urilen + constrlen(middle) + srclen +
1992
2006
  constrlen(suffix);
@@ -1998,7 +2012,7 @@ ParseXMLSource(JSContext *cx, JSString *src)
1998
2012
  dstlen = length;
1999
2013
  js_InflateStringToBuffer(cx, prefix, constrlen(prefix), chars, &dstlen);
2000
2014
  offset = dstlen;
2001
- js_strncpy(chars + offset, JSSTRING_CHARS(ns->uri), urilen);
2015
+ js_strncpy(chars + offset, JSSTRING_CHARS(uri), urilen);
2002
2016
  offset += urilen;
2003
2017
  dstlen = length - offset + 1;
2004
2018
  js_InflateStringToBuffer(cx, middle, constrlen(middle), chars + offset,
@@ -5587,21 +5601,6 @@ JS_FRIEND_DATA(JSClass) js_XMLClass = {
5587
5601
  NULL, NULL, JS_CLASS_TRACE(xml_trace), NULL
5588
5602
  };
5589
5603
 
5590
- static JSObject *
5591
- CallConstructorFunction(JSContext *cx, JSObject *obj, JSClass *clasp,
5592
- uintN argc, jsval *argv)
5593
- {
5594
- JSObject *tmp;
5595
- jsval rval;
5596
-
5597
- while ((tmp = OBJ_GET_PARENT(cx, obj)) != NULL)
5598
- obj = tmp;
5599
- if (!JS_CallFunctionName(cx, obj, clasp->name, argc, argv, &rval))
5600
- return NULL;
5601
- JS_ASSERT(!JSVAL_IS_PRIMITIVE(rval));
5602
- return JSVAL_TO_OBJECT(rval);
5603
- }
5604
-
5605
5604
  static JSXML *
5606
5605
  StartNonListXMLMethod(JSContext *cx, jsval *vp, JSObject **objp)
5607
5606
  {
@@ -5652,26 +5651,25 @@ StartNonListXMLMethod(JSContext *cx, jsval *vp, JSObject **objp)
5652
5651
  static JSBool
5653
5652
  xml_addNamespace(JSContext *cx, uintN argc, jsval *vp)
5654
5653
  {
5655
- JSObject *nsobj;
5656
5654
  JSXMLNamespace *ns;
5657
5655
 
5658
5656
  NON_LIST_XML_METHOD_PROLOG;
5659
5657
  if (xml->xml_class != JSXML_CLASS_ELEMENT)
5660
- return JS_TRUE;
5658
+ goto done;
5661
5659
  xml = CHECK_COPY_ON_WRITE(cx, xml, obj);
5662
5660
  if (!xml)
5663
5661
  return JS_FALSE;
5664
5662
 
5665
- nsobj = CallConstructorFunction(cx, obj, &js_NamespaceClass.base, 1,
5666
- vp + 2);
5667
- if (!nsobj)
5663
+ if (!NamespaceHelper(cx, NULL, 1, vp + 2, vp))
5668
5664
  return JS_FALSE;
5669
- vp[2] = OBJECT_TO_JSVAL(nsobj);
5670
-
5671
- ns = (JSXMLNamespace *) JS_GetPrivate(cx, nsobj);
5665
+ JS_ASSERT(!JSVAL_IS_PRIMITIVE(*vp));
5666
+
5667
+ ns = (JSXMLNamespace *) JS_GetPrivate(cx, JSVAL_TO_OBJECT(*vp));
5672
5668
  if (!AddInScopeNamespace(cx, xml, ns))
5673
5669
  return JS_FALSE;
5674
5670
  ns->declared = JS_TRUE;
5671
+
5672
+ done:
5675
5673
  *vp = OBJECT_TO_JSVAL(obj);
5676
5674
  return JS_TRUE;
5677
5675
  }
@@ -6791,40 +6789,39 @@ xml_removeNamespace_helper(JSContext *cx, JSXML *xml, JSXMLNamespace *ns)
6791
6789
  static JSBool
6792
6790
  xml_removeNamespace(JSContext *cx, uintN argc, jsval *vp)
6793
6791
  {
6794
- JSObject *nsobj;
6795
6792
  JSXMLNamespace *ns;
6796
6793
 
6797
6794
  NON_LIST_XML_METHOD_PROLOG;
6798
- *vp = OBJECT_TO_JSVAL(obj);
6799
6795
  if (xml->xml_class != JSXML_CLASS_ELEMENT)
6800
- return JS_TRUE;
6796
+ goto done;
6801
6797
  xml = CHECK_COPY_ON_WRITE(cx, xml, obj);
6802
6798
  if (!xml)
6803
6799
  return JS_FALSE;
6804
6800
 
6805
- nsobj = CallConstructorFunction(cx, obj, &js_NamespaceClass.base, 1, vp + 2);
6806
- if (!nsobj)
6801
+ if (!NamespaceHelper(cx, NULL, 1, vp + 2, vp))
6807
6802
  return JS_FALSE;
6808
- vp[2] = OBJECT_TO_JSVAL(nsobj);
6809
- ns = (JSXMLNamespace *) JS_GetPrivate(cx, nsobj);
6803
+ JS_ASSERT(!JSVAL_IS_PRIMITIVE(*vp));
6804
+ ns = (JSXMLNamespace *) JS_GetPrivate(cx, JSVAL_TO_OBJECT(*vp));
6810
6805
 
6811
6806
  /* NOTE: remove ns from each ancestor if not used by that ancestor. */
6812
- return xml_removeNamespace_helper(cx, xml, ns);
6807
+ if (!xml_removeNamespace_helper(cx, xml, ns))
6808
+ return JS_FALSE;
6809
+ done:
6810
+ *vp = OBJECT_TO_JSVAL(obj);
6811
+ return JS_TRUE;
6813
6812
  }
6814
6813
 
6815
6814
  static JSBool
6816
6815
  xml_replace(JSContext *cx, uintN argc, jsval *vp)
6817
6816
  {
6818
- jsval name, value;
6817
+ jsval value;
6819
6818
  JSXML *vxml, *kid;
6820
- uint32 index, matchIndex;
6821
- JSObject *nameobj;
6819
+ uint32 index, i;
6822
6820
  JSXMLQName *nameqn;
6823
6821
 
6824
6822
  NON_LIST_XML_METHOD_PROLOG;
6825
- *vp = OBJECT_TO_JSVAL(obj);
6826
6823
  if (xml->xml_class != JSXML_CLASS_ELEMENT)
6827
- return JS_TRUE;
6824
+ goto done;
6828
6825
 
6829
6826
  value = vp[3];
6830
6827
  vxml = VALUE_IS_XML(cx, value)
@@ -6845,30 +6842,38 @@ xml_replace(JSContext *cx, uintN argc, jsval *vp)
6845
6842
  if (!xml)
6846
6843
  return JS_FALSE;
6847
6844
 
6848
- name = vp[2];
6849
- if (js_IdIsIndex(name, &index))
6850
- return Replace(cx, xml, index, value);
6851
-
6852
- /* Call function QName per spec, not ToXMLName, to avoid attribute names. */
6853
- nameobj = CallConstructorFunction(cx, obj, &js_QNameClass.base, 1, &name);
6854
- if (!nameobj)
6855
- return JS_FALSE;
6856
- vp[2] = OBJECT_TO_JSVAL(nameobj);
6857
- nameqn = (JSXMLQName *) JS_GetPrivate(cx, nameobj);
6858
-
6859
- index = xml->xml_kids.length;
6860
- matchIndex = XML_NOT_FOUND;
6861
- while (index != 0) {
6862
- --index;
6863
- kid = XMLARRAY_MEMBER(&xml->xml_kids, index, JSXML);
6864
- if (kid && MatchElemName(nameqn, kid)) {
6865
- if (matchIndex != XML_NOT_FOUND)
6866
- DeleteByIndex(cx, xml, matchIndex);
6867
- matchIndex = index;
6845
+ if (!js_IdIsIndex(vp[2], &index)) {
6846
+ /*
6847
+ * Call function QName per spec, not ToXMLName, to avoid attribute
6848
+ * names.
6849
+ */
6850
+ if (!QNameHelper(cx, NULL, &js_QNameClass.base, 1, vp + 2, vp))
6851
+ return JS_FALSE;
6852
+ JS_ASSERT(!JSVAL_IS_PRIMITIVE(*vp));
6853
+ nameqn = (JSXMLQName *) JS_GetPrivate(cx, JSVAL_TO_OBJECT(*vp));
6854
+
6855
+ i = xml->xml_kids.length;
6856
+ index = XML_NOT_FOUND;
6857
+ while (i != 0) {
6858
+ --i;
6859
+ kid = XMLARRAY_MEMBER(&xml->xml_kids, i, JSXML);
6860
+ if (kid && MatchElemName(nameqn, kid)) {
6861
+ if (i != XML_NOT_FOUND)
6862
+ DeleteByIndex(cx, xml, i);
6863
+ index = i;
6864
+ }
6868
6865
  }
6866
+
6867
+ if (index == XML_NOT_FOUND)
6868
+ goto done;
6869
6869
  }
6870
6870
 
6871
- return matchIndex == XML_NOT_FOUND || Replace(cx, xml, matchIndex, value);
6871
+ if (!Replace(cx, xml, index, value))
6872
+ return JS_FALSE;
6873
+
6874
+ done:
6875
+ *vp = OBJECT_TO_JSVAL(obj);
6876
+ return JS_TRUE;
6872
6877
  }
6873
6878
 
6874
6879
  static JSBool
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jbarnette-johnson
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.20090326161333
4
+ version: 1.0.0.20090402144841
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Barnette
@@ -12,7 +12,7 @@ autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
14
 
15
- date: 2009-03-26 00:00:00 -07:00
15
+ date: 2009-04-02 00:00:00 -07:00
16
16
  default_executable: johnson
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
@@ -43,7 +43,7 @@ dependencies:
43
43
  requirements:
44
44
  - - ">="
45
45
  - !ruby/object:Gem::Version
46
- version: 1.11.0
46
+ version: 1.12.1
47
47
  version:
48
48
  description: ""
49
49
  email:
data/MINGW32.mk DELETED
@@ -1,124 +0,0 @@
1
- # -*- Mode: makefile -*-
2
- #
3
- #
4
- # Based on patch submitted to mozilla.dev.tech.js-engine by 'Andy':
5
- # http://groups.google.com/group/mozilla.dev.tech.js-engine/browse_thread/thread/16972946bf7df82e
6
- #
7
- #
8
- # ***** BEGIN LICENSE BLOCK *****
9
- # Version: MPL 1.1/GPL 2.0/LGPL 2.1
10
- #
11
- # The contents of this file are subject to the Mozilla Public License Version
12
- # 1.1 (the "License"); you may not use this file except in compliance with
13
- # the License. You may obtain a copy of the License at
14
- # http://www.mozilla.org/MPL/
15
- #
16
- # Software distributed under the License is distributed on an "AS IS" basis,
17
- # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
18
- # for the specific language governing rights and limitations under the
19
- # License.
20
- #
21
- # The Original Code is Mozilla Communicator client code, released
22
- # March 31, 1998.
23
- #
24
- # The Initial Developer of the Original Code is
25
- # Netscape Communications Corporation.
26
- # Portions created by the Initial Developer are Copyright (C) 1998
27
- # the Initial Developer. All Rights Reserved.
28
- #
29
- # Contributor(s):
30
- #
31
- # Alternatively, the contents of this file may be used under the terms of
32
- # either the GNU General Public License Version 2 or later (the "GPL"), or
33
- # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
34
- # in which case the provisions of the GPL or the LGPL are applicable instead
35
- # of those above. If you wish to allow use of your version of this file only
36
- # under the terms of either the GPL or the LGPL, and not to allow others to
37
- # use your version of this file under the terms of the MPL, indicate your
38
- # decision by deleting the provisions above and replace them with the notice
39
- # and other provisions required by the GPL or the LGPL. If you do not delete
40
- # the provisions above, a recipient may use your version of this file under
41
- # the terms of any one of the MPL, the GPL or the LGPL.
42
- #
43
- # ***** END LICENSE BLOCK *****
44
-
45
- #
46
- # Config for all versions of Mingw (copy and modified from Linux)
47
- #
48
-
49
- AR = i586-mingw32msvc-ar
50
- CC = i586-mingw32msvc-gcc
51
- LD = i586-mingw32msvc-ld
52
- CCC = i586-mingw32msvc-g++
53
-
54
- CFLAGS += -Wall -Wno-format
55
- #OS_CFLAGS = -DXP_UNIX -DSVR4 -DSYSV -D_BSD_SOURCE -DPOSIX_SOURCE -DHAVE_LOCALTIME_R -DEXPORT_JS_API
56
- OS_CFLAGS = -D_X86_=1 -DXP_WIN -DXP_WIN32 -DWIN32 -D_WINDOWS -D_WIN32 $(WIN_CFLAGS) -DEXPORT_JS_API
57
- JSDLL_CFLAGS = -DEXPORT_JS_API # not work, dunno why?
58
- SO_SUFFIX = dll
59
- # libgcc.a:__divdi3 kernel32:DebugBreak,GetSystemTimeAsFileTime
60
- # winmm:timeBeginPeriod,timeEndPeriod
61
- WINLIBS = -lmsvcrt -lm -lkernel32 -lwinmm /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/libgcc.a
62
- #LDFLAGS += $(WINLIBS) # dont work. rewrite by Makefile.ref
63
- OTHER_LIBS += $(WINLIBS)
64
-
65
- RANLIB = echo
66
- MKSHLIB = $(LD) -shared $(XMKSHLIBOPTS)
67
-
68
- # These don't work :(
69
- LIBRARY = $(OBJDIR)/js32.lib
70
- SHARED_LIBRARY = $(OBJDIR)/js32.dll
71
- PROGRAM = $(OBJDIR)/js.exe
72
-
73
- #.c.o:
74
- # $(CC) -c -MD $*.d $(CFLAGS) $<
75
-
76
- CPU_ARCH = $(shell uname -m)
77
- # don't filter in x86-64 architecture
78
- ifneq (x86_64,$(CPU_ARCH))
79
- ifeq (86,$(findstring 86,$(CPU_ARCH)))
80
- CPU_ARCH = x86
81
- OS_CFLAGS+= -DX86_LINUX
82
-
83
- ifeq (gcc, $(CC))
84
- # if using gcc on x86, check version for opt bug
85
- # (http://bugzilla.mozilla.org/show_bug.cgi?id=24892)
86
- GCC_VERSION := $(shell gcc -v 2>&1 | grep version | awk '{ print $$3 }')
87
- GCC_LIST:=$(sort 2.91.66 $(GCC_VERSION) )
88
-
89
- ifeq (2.91.66, $(firstword $(GCC_LIST)))
90
- CFLAGS+= -DGCC_OPT_BUG
91
- endif
92
- endif
93
- endif
94
- endif
95
-
96
- GFX_ARCH = x
97
-
98
- OS_LIBS = -lm -lc
99
-
100
- ASFLAGS += -x assembler-with-cpp
101
-
102
-
103
- ifeq ($(CPU_ARCH),alpha)
104
-
105
- # Ask the C compiler on alpha linux to let us work with denormalized
106
- # double values, which are required by the ECMA spec.
107
-
108
- OS_CFLAGS += -mieee
109
- endif
110
-
111
- # Use the editline library to provide line-editing support.
112
- #JS_EDITLINE = 1 // not support by Mingw
113
-
114
- ifeq ($(CPU_ARCH),x86_64)
115
- # Use VA_COPY() standard macro on x86-64
116
- # FIXME: better use it everywhere
117
- OS_CFLAGS += -DHAVE_VA_COPY
118
- endif
119
-
120
- ifeq ($(CPU_ARCH),x86_64)
121
- # We need PIC code for shared libraries
122
- # FIXME: better patch rules.mk & fdlibm/Makefile*
123
- OS_CFLAGS += -DPIC -fPIC
124
- endif
@@ -1,103 +0,0 @@
1
- # -*- Mode: makefile -*-
2
- #
3
- # ***** BEGIN LICENSE BLOCK *****
4
- # Version: MPL 1.1/GPL 2.0/LGPL 2.1
5
- #
6
- # The contents of this file are subject to the Mozilla Public License Version
7
- # 1.1 (the "License"); you may not use this file except in compliance with
8
- # the License. You may obtain a copy of the License at
9
- # http://www.mozilla.org/MPL/
10
- #
11
- # Software distributed under the License is distributed on an "AS IS" basis,
12
- # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13
- # for the specific language governing rights and limitations under the
14
- # License.
15
- #
16
- # The Original Code is Mozilla Communicator client code, released
17
- # March 31, 1998.
18
- #
19
- # The Initial Developer of the Original Code is
20
- # Netscape Communications Corporation.
21
- # Portions created by the Initial Developer are Copyright (C) 1998
22
- # the Initial Developer. All Rights Reserved.
23
- #
24
- # Contributor(s):
25
- #
26
- # Alternatively, the contents of this file may be used under the terms of
27
- # either the GNU General Public License Version 2 or later (the "GPL"), or
28
- # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
29
- # in which case the provisions of the GPL or the LGPL are applicable instead
30
- # of those above. If you wish to allow use of your version of this file only
31
- # under the terms of either the GPL or the LGPL, and not to allow others to
32
- # use your version of this file under the terms of the MPL, indicate your
33
- # decision by deleting the provisions above and replace them with the notice
34
- # and other provisions required by the GPL or the LGPL. If you do not delete
35
- # the provisions above, a recipient may use your version of this file under
36
- # the terms of any one of the MPL, the GPL or the LGPL.
37
- #
38
- # ***** END LICENSE BLOCK *****
39
-
40
- #
41
- # Config for all versions of Linux
42
- #
43
-
44
- CC = gcc
45
- CCC = g++
46
- CFLAGS += -Wall -Wno-format -MMD
47
- OS_CFLAGS = -DXP_UNIX -DSVR4 -DSYSV -D_BSD_SOURCE -DPOSIX_SOURCE -DHAVE_LOCALTIME_R
48
-
49
- RANLIB = echo
50
- MKSHLIB = $(LD) -shared $(XMKSHLIBOPTS)
51
-
52
- #.c.o:
53
- # $(CC) -c -MD $*.d $(CFLAGS) $<
54
-
55
- CPU_ARCH = $(shell uname -m)
56
- # don't filter in x86-64 architecture
57
- ifneq (x86_64,$(CPU_ARCH))
58
- ifeq (86,$(findstring 86,$(CPU_ARCH)))
59
- CPU_ARCH = x86
60
- OS_CFLAGS+= -DX86_LINUX
61
-
62
- ifeq (gcc, $(CC))
63
- # if using gcc on x86, check version for opt bug
64
- # (http://bugzilla.mozilla.org/show_bug.cgi?id=24892)
65
- GCC_VERSION := $(shell gcc -v 2>&1 | grep version | awk '{ print $$3 }')
66
- GCC_LIST:=$(sort 2.91.66 $(GCC_VERSION) )
67
-
68
- ifeq (2.91.66, $(firstword $(GCC_LIST)))
69
- CFLAGS+= -DGCC_OPT_BUG
70
- endif
71
- endif
72
- endif
73
- endif
74
-
75
- GFX_ARCH = x
76
-
77
- OS_LIBS = -lm -lc
78
-
79
- ASFLAGS += -x assembler-with-cpp
80
-
81
-
82
- ifeq ($(CPU_ARCH),alpha)
83
-
84
- # Ask the C compiler on alpha linux to let us work with denormalized
85
- # double values, which are required by the ECMA spec.
86
-
87
- OS_CFLAGS += -mieee
88
- endif
89
-
90
- # Use the editline library to provide line-editing support.
91
- JS_EDITLINE = 1
92
-
93
- ifeq ($(CPU_ARCH),x86_64)
94
- # Use VA_COPY() standard macro on x86-64
95
- # FIXME: better use it everywhere
96
- OS_CFLAGS += -DHAVE_VA_COPY -DVA_COPY=va_copy
97
- endif
98
-
99
- ifeq ($(CPU_ARCH),x86_64)
100
- # We need PIC code for shared libraries
101
- # FIXME: better patch rules.mk & fdlibm/Makefile*
102
- OS_CFLAGS += -DPIC -fPIC
103
- endif