Compare commits

..

326 Commits

Author SHA1 Message Date
(no author)
fb0ae83aca This commit was manufactured by cvs2svn to create tag 'JS14_981030'.
git-svn-id: svn://10.0.0.236/tags/JS14_981030@13713 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-30 04:05:51 +00:00
norris%netscape.com
b9f4c69e12 Update release string format.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13687 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-29 23:31:24 +00:00
bjorn%netscape.com
5f6a0b9c3a Patch which fixes a problem in the alignment code. I wasn't taking sizeof(JSString)
properly.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13683 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-29 22:38:41 +00:00
fur%netscape.com
f68735a6bb wtc sez': Get rid of use of obsolete NSPR20 build var.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13676 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-29 21:59:30 +00:00
fur%netscape.com
8616bd54f5 Removing obsolete file
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13675 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-29 21:51:46 +00:00
fur%netscape.com
09e0785f68 Removing obsolete/unused files.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13674 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-29 21:50:22 +00:00
fur%netscape.com
dd8953010a Removed uses of obsolete NSPR20 build variable
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13673 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-29 21:43:17 +00:00
fur%netscape.com
a67d8ed2fe + Updated build directions for all platforms.
+ Added table of contents.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13663 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-29 20:00:58 +00:00
shaver%netscape.com
935f0e5ac8 need to poke the GC when hitting the cache on a set
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13645 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-29 03:55:53 +00:00
fur%netscape.com
97aa1f7699 Ignore generated files
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13643 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-29 02:15:23 +00:00
fur%netscape.com
f399e21216 Reporting of uncaught exceptions should occur when JS_HAS_EXCEPTIONS is set,
even if JS_HAS_ERROR_EXCEPTIONS is not.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13642 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-29 02:09:34 +00:00
coop%netscape.com
823cb6e29e Made constructor for wrappedException private and removed deprecation warning.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13638 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-29 00:43:38 +00:00
fur%netscape.com
84e135cd01 Restore build prosperity for Mac LiveConnect after ref/src merge.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13637 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-29 00:24:05 +00:00
fur%netscape.com
ac3516411a No real change: Reorganized a few .c files that had fallen out of their folder.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13636 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-29 00:23:02 +00:00
mang%netscape.com
db237360fa Added section for AIX, thus fixing several bugs.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13634 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-29 00:16:38 +00:00
fur%netscape.com
92e443d317 Restore Mac-specific Java file, lost in the ref/src transition
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13633 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-29 00:12:41 +00:00
rogerl%netscape.com
87c9e8ae4d Changed references to stdout and stderr to generic file handles so that all
output can be redirected to a file. This is needed for the mac where shell
redirection is not an option.
Added MAC_TEST_HACK that uses this redirection and also parses a text file
to build the argv/argc values.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13632 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-28 22:12:01 +00:00
fur%netscape.com
3fa38c1d6a Added a workaround for a bug in AIX JDK1.1.6 (See #331620), in which
static initializers are not run when a static field is referenced from
native code.  The problem does not manifest itself if the field is
accessed from Java code, so we first call some Java code to access
the fields of interest before attempting to read them from native code.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13621 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-28 20:22:22 +00:00
norris%netscape.com
ce487f127c Fix 331720 Continue to label in for..in doesn't work
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13612 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-28 20:13:50 +00:00
fur%netscape.com
cc1651828e We allow conversion from NaN numbers to Java integral types, but not when
the NaN is the result of conversion from a non-number, e.g. a string.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13609 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-28 17:59:10 +00:00
fur%netscape.com
22f7fd9b4a Fixed two related bugs in overloaded method resolution:
+ The precedence of java.lang.String was higher than it should have been
  + When an ambiguous method match was reported, the best-matching method
    was being left off the list.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13605 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-28 17:06:01 +00:00
mccabe%netscape.com
ad72e12927 Added proposed methods Object.prototype.hasOwnProperty,
Object.prototype.propertyIsEnumerable,
Object.prototype.isPrototypeOf... all turned off for v140 in
jsconfig.h.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13603 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-28 06:31:55 +00:00
fur%netscape.com
b6ada3318c Fix for #331634: Inability to invoke Java method when a method and field have
the same name.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13598 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-28 05:26:58 +00:00
bjorn%netscape.com
82ac5c4e2f Fixes for AIX and SunOS. AIX now compiles and runs in optimized mode as well,
and SunOS now compiles for common architecture when JS_THREADSAFE is not set.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13595 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-28 04:07:35 +00:00
wynholds%netscape.com
5430e4b688 for use with creating source jar file. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13586 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-28 02:25:31 +00:00
wynholds%netscape.com
33219cbcb1 adding shipSource target which will, yep, you guessed it, ship the source. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13582 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-28 02:03:45 +00:00
mang%netscape.com
e10c7eb54b Replace native exp on Linux opt build.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13578 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-28 00:39:25 +00:00
mang%netscape.com
70bd48b576 Math.toSource() == 'Math'
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13577 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-27 23:56:19 +00:00
bjorn%netscape.com
6bc17963c7 *** empty log message ***
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13576 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-27 23:53:01 +00:00
mang%netscape.com
168c0f6f50 Want to use some fdlibm functions but fdlibm broken on OSF1/alpha.
See bugsplat bugs 331500, 332038


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13572 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-27 23:07:40 +00:00
fur%netscape.com
eef72a91bc More LC3 features:
+ The __proto__ property of JavaObjects can be assigned and the
  prototype chain of these objects is searched, just as the engine's
  built-in js_ObjectOps routines do.  This is a featurette for the
  NGLayout DOM.

+ Static Java methods and fields can now be accessed via LiveConnect
  through an instance of a Java class, just as in Java itself.

+ Instances of java.lang.String "inherit" the standard ECMA string
  methods of String.prototype.  (All of the ECMA string methods
  convert the Java string to a JS string before operating on it.)

+ Similarly, instances of Java arrays "inherit" the standard ECMA
  array methods of Array.prototype.  (Not all of these methods work
  properly on JavaArray objects, however, since the 'length' property
  is read-only.)


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13571 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-27 22:28:03 +00:00
rogerl%netscape.com
76e06e7e4d Bug from field - unicode handling messed up with 2 or more unicode literal
characters ("i" only) - missing multiply and endian problem.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13570 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-27 21:57:10 +00:00
rogerl%netscape.com
6d03a825d3 Bug #331349, previous fix to disallow object to function conversion was too
sweeping, screwing up closures. Now we proceed with the convert if a call op
exists in the class.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13567 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-27 18:45:54 +00:00
shaver%netscape.com
9a0cc72a2d quell (spurious) warnings
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13565 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-27 16:57:19 +00:00
norris%netscape.com
6139484b7e Fix warnings.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13548 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-27 04:53:40 +00:00
fur%netscape.com
b576db0575 Eliminated gcc warnings, some spurious, some indicative of real bugs:
Spurious warnings:
jsobj.c: In function `js_EnterSharpObject':
    jsobj.c: In function `js_obj_toSource':
    jsobj.c:365: warning: `nchars' might be used uninitialized in this function
    jsobj.c: In function `obj_eval':
    jsobj.c:588: warning: `implicitWith' might be used uninitialized in this function
    jsobj.c: In function `js_DefineProperty':
    jsobj.c:1323: warning: `_c' might be used uninitialized in this function
    jsobj.c: In function `js_LookupProperty':
    jsobj.c:1394: warning: `_c' might be used uninitialized in this function
    jsobj.c: In function `js_FindProperty':
    jsobj.c:1472: warning: `lastobj' might be used uninitialized in this function
    jsobj.c: In function `js_GetProperty':
    jsobj.c:1599: warning: `_c' might be used uninitialized in this function
    jsobj.c: In function `js_SetProperty':
    jsobj.c:1645: warning: `protoid' might be used uninitialized in this function
    jsobj.c:1646: warning: `protogetter' might be used uninitialized in this function
    jsobj.c:1646: warning: `protosetter' might be used uninitialized in this function
    jsobj.c:1647: warning: `protoattrs' might be used uninitialized in this function
    jsobj.c:1665: warning: `_c' might be used uninitialized in this function
    jsobj.c: In function `js_DeleteProperty':
    jsobj.c:1939: warning: `_c' might be used uninitialized in this function

Warnings indicating real bugs:
jsobj.c: In function `js_EnterSharpObject':
    jsobj.c:252: warning: `sharpid' might be used uninitialized in this function


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13547 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-27 04:35:50 +00:00
fur%netscape.com
1858d69e49 Fixed gcc warnings (and real bugs indicated by warnings)
Spurious warnings:
jsdtoa.c: In function `JS_strtod':
    jsdtoa.c:1210: warning: `bb' might be used uninitialized in this function
    jsdtoa.c:1210: warning: `bd' might be used uninitialized in this function
    jsdtoa.c:1210: warning: `bs' might be used uninitialized in this function
    jsdtoa.c:1210: warning: `delta' might be used uninitialized in this function
    jsdtoa.c: In function `JS_dtoa':
    jsdtoa.c:1913: warning: `ilim1' might be used uninitialized in this function

Real errors:
    jsdtoa.c: In function `JS_dtoa':
    jsdtoa.c:1913: warning: `ilim' might be used uninitialized in this function
    jsdtoa.c:1915: warning: `spec_case' might be used uninitialized in this function
    jsdtoa.c:1921: warning: `mlo' might be used uninitialized in this function


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13539 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-27 03:10:55 +00:00
mccabe%netscape.com
76326b2efb Warning fix to 331245.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13536 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-27 02:53:22 +00:00
fur%netscape.com
06a7abeacf Fix allocation bug caused by use of initialized variable, discovered via gcc warning
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13531 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-27 01:21:16 +00:00
mang%netscape.com
2ae04afc70 Added section for OSF1. Fixes lots of ecma math bugs.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13526 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-27 00:18:43 +00:00
norris%netscape.com
754415d2a7 Fix "js -f x.js" for Christine.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13496 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-26 22:59:10 +00:00
norris%netscape.com
d719a6f851 Fix warnings, and clean up memory leak.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13482 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-26 21:23:56 +00:00
waldemar%netscape.com
cdcef88024 Fixed Mac warnings
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13479 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-26 21:16:28 +00:00
jband%netscape.com
34fd322859 adding READMEs
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13478 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-26 21:09:49 +00:00
jband%netscape.com
d848312079 adding a doc
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13475 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-26 20:45:49 +00:00
mccabe%netscape.com
cdc32c49b5 Fix warnings:
jsstr.c: In function `str_escape':
jsstr.c💯 warning: `mask' might be used uninitialized in this function
jsstr.c: In function `str_split':
jsstr.c:1415: warning: `limit' might be used uninitialized in this function
jsstr.c: In function `tagify':
jsstr.c:1746: warning: `parlen' might be used uninitialized in this function


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13473 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-26 20:22:17 +00:00
jband%netscape.com
93a992bb20 fixed compile error when JS_THREADSAFE used
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13470 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-26 20:13:52 +00:00
mccabe%netscape.com
256ad44f6c Quiet these warnings:
jsarray.c: In function `IdIsIndex':
jsarray.c:81: warning: `c' might be used uninitialized in this function
jsarray.c: In function `array_splice':
jsarray.c:948: warning: `obj2' might be used uninitialized in this function


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13469 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-26 20:10:29 +00:00
jband%netscape.com
c76f45fb75 adding two helper batchfiles
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13468 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-26 20:09:33 +00:00
norris%netscape.com
a7a3555cc8 Fix warnings.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13466 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-26 19:39:13 +00:00
rogerl%netscape.com
3140821cd1 #318482, recursive death arising from defining valueOf to be the this object
is now a version 1.2 feature only.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13462 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-26 19:16:08 +00:00
rogerl%netscape.com
befd55d8ba #318482, recursive death arising from defining valueOf to be the this object
is now only a version 1.2 feature, but the error mechanism needed to be
protected from failure even so.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13460 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-26 19:15:01 +00:00
norris%netscape.com
3962bfda99 Fix warnings under gcc.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13458 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-26 18:39:01 +00:00
norris%netscape.com
faca6b626e "js -f foo.js" wasn't working correctly.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13455 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-26 18:13:40 +00:00
fur%netscape.com
8c1af11605 Eliminate gcc warnings
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13452 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-26 17:41:35 +00:00
fur%netscape.com
6c8f42225c + Eliminated unused JavaMemberVal struct/type
+ Tweaked JS->Java method overload resolution
   + Don't allow JavaArrays to be passed as arguments to Java methods
     that accept scalar numeric types, since there's no meaningful
     conversion available.
   + Permit JavaObjects and JavaArrays to be passed to Java methods
     that accept a boolean argument for backward-compatibility.

+ Added explicit overload-method resolution to override ambiguous cases, e.g.
  m = java.lang.String["valueOf(char[],int,int)"]
  return m(myCharArray, 3, 7);


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13443 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-26 07:03:41 +00:00
norris%netscape.com
847bebb065 Implement X.Y.Z implementation version.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13442 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-26 05:44:04 +00:00
norris%netscape.com
2c9b897958 Fix 330840 monkey - assertion failure in import expression decompilation
Wrong length for JSOP_IMPORTELEM.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13440 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-26 05:38:22 +00:00
bjorn%netscape.com
b01cc3080f Added volatile to avoid bug in gcc
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13434 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-25 22:45:22 +00:00
bjorn%netscape.com
9cd7750dd1 move_sym_to_front avoids aliasing problem on AIX
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13432 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-25 22:17:57 +00:00
mang%netscape.com
ed9c4d7ee1 Don't use fdlibm by default.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13408 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-24 01:49:17 +00:00
bjorn%netscape.com
ceb34941c8 Changed the typedef of JSCList to work around what seems to be a bug in gcc and xlc (AIX).
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13407 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-23 23:56:29 +00:00
mang%netscape.com
f20e53875b Don't use fdlibm by default.
There can be problems with endian-ness.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13406 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-23 23:53:45 +00:00
norris%netscape.com
7c8275aae3 Use %p to print out pointer values: works better on 64 bit machines.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13405 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-23 21:35:56 +00:00
jband%netscape.com
30e0d801a7 fix default target - msdev bug in writing out .mak file!
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13397 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-23 20:34:18 +00:00
fur%netscape.com
a899984e09 Added fdlibm
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13393 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-23 19:43:52 +00:00
coop%netscape.com
54e5a64304 Constructors are once again public, but have been marked as deprecated so
that people won't get too fond of using them.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13392 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-23 19:23:36 +00:00
fur%netscape.com
4016979d0d Added fdlibm
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13391 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-23 19:16:28 +00:00
fur%netscape.com
663693cafe Ignore .pdb files
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13388 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-23 18:24:44 +00:00
wynholds%netscape.com
aed4dd4310 fixing NT build with new fdlibm stuff and an old error gone unnoticed until now. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13379 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-23 17:30:41 +00:00
norris%netscape.com
6c7c73d822 Fix 330845 digital unix: arithmetic exception in string stuff:
Expression "argv[argc-1]", where argc == 0 and argc was a 32 bit unsigned quantity,
was causing a memory exception on the 64 bit machine because it was evaluating as
argv[0xffffffff] rather than argv[-1].


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13376 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-23 16:51:08 +00:00
wynholds%netscape.com
28c93d2218 fixing fdlibm stuff. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13374 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-23 16:35:58 +00:00
norris%netscape.com
ca95b9b63a Add patch number.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13373 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-23 15:35:41 +00:00
mang%netscape.com
67d738630a Landing of MANG_MATH_10231998
Replaces many system math routines with ECMA/IEEE compliant routines
from fdlibm.
These new routines are big and slow, so there are platform specific
defines in jslibmath.h that determine which fdlibm routines to use.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13372 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-23 10:16:50 +00:00
(no author)
f018a06aa7 This commit was manufactured by cvs2svn to create branch
'SpiderMonkey140_BRANCH'.

git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13371 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-23 09:14:03 +00:00
norris%netscape.com
eb89b3d136 Fix 330071 Remove catch condition support from 1.4
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13364 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-23 05:51:29 +00:00
wynholds%netscape.com
6c156d7134 fixed ship target to correctly take into account any variation of JS_THREADSAFE and JS_LIVECONNECT. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13354 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-23 01:20:32 +00:00
mccabe%netscape.com
7f123a804d Sigh. Turn of reflection of runtime errors as exceptions.
Because the immediate demand for it in the client seems to have
lessened somewhat, and because it makes our cross-engine story make
more sense for external customers if we wait 'till it's implemented
for both engines.

Also, attempting to make exceptions work cleanly in a cross-context way
turned out to be difficult; it probably makes sense to take a step
back and look at how to find the best solution for the long term
development of the language.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13353 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-23 00:37:15 +00:00
wynholds%netscape.com
ec0edbcba0 adding HPUX 10.20 config makefiles. they are just copies of HPUX 10.10 makefiles. hope they work. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13351 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-23 00:30:46 +00:00
norris%netscape.com
2687debc8e Fix bug 330462 monkey: decompilation of comma op causes ASSERT/script failure
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13347 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-22 23:55:09 +00:00
mccabe%netscape.com
5fb184d473 Another fix to 329807.
Rather than nulling out the error reporter during the execution of
'load', replace it with a new error reporter that ignores all error
reports with the JSREPORT_EXCEPTION flag set.

Also fix a bug in jsexn.c where I was failing to actually set that
flag, and Eich-ify a few curly-brace placements.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13313 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-22 19:55:11 +00:00
mccabe%netscape.com
4885772ba8 Fix to 330589. Back out a tree-rewriting of foo[0] -> foo.0 because
the resulting code decompiles to foo.0.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13301 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-22 03:44:56 +00:00
rogerl%netscape.com
3d0da2df12 Bug #310514 - for eror report on calling toString on a not-function, was
calling toString to get the name of the object. Duh. Now calls getTypeName.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13290 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-22 00:05:16 +00:00
rogerl%netscape.com
030655be79 Bug #324451 - eval was bailing out early if the arg was not a string, and
so skipping the indirect-eval check.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13289 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-22 00:01:49 +00:00
fur%netscape.com
c21e3de07e Match changes in Makefile for auto-generating jsautocfg.h
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13279 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-21 21:43:59 +00:00
mccabe%netscape.com
f654a47a49 Fix to 329807.
'load' in the shell makes 'toplevel' calls to the js interpreter, so
the mechanism for detecting and reporting uncaught exceptions at the
top level kicks in prematurely.  To work around this problem, I set
the error reporter to NULL.  A better fix might be to use a custom
error reporter for load that knew to ignore exception error reports,
expecting that the javascript context calling load would catch or
report them.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13276 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-21 20:52:43 +00:00
norris%netscape.com
c11ef38890 Fix 330074 arguments object uses Array.prototype.toString
Unfortunately, I can see no way to version this behavior.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13275 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-21 20:45:41 +00:00
norris%netscape.com
d8f121d794 Better debugging code for printing objects.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13273 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-21 20:19:46 +00:00
rogerl%netscape.com
47f4088f27 Bug #330051 - previous fix for end of string with empty sep. should have
been 1.2 only and should have set the sep->length to 1 in order to break
out of the split loop.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13264 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-21 18:02:24 +00:00
rogerl%netscape.com
9d8444be44 Plugging a memory leak whenever an error is reported.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13261 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-21 17:54:30 +00:00
wynholds%netscape.com
0bd94e4384 CFLAGS needs to be +='ed, not ='ed. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13206 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-20 17:02:13 +00:00
wynholds%netscape.com
e0a486e300 need another include directory in liveconnect directory. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13205 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-20 16:47:16 +00:00
fur%netscape.com
4bf9c6a227 Fixed INCLUDES problem when JS_THREADSAFE is set
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13199 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-20 15:32:46 +00:00
fur%netscape.com
3277bdac18 Auto-generate jsautocfg.h instead of using checked-in jscpucfg.h file
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13192 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-20 07:32:26 +00:00
fur%netscape.com
87c868ffbe Improve clobber rule
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13191 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-20 07:31:21 +00:00
fur%netscape.com
5f6bbab561 Eliminate dependency on jscpucfg.h for Windows
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13186 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-20 05:00:16 +00:00
fur%netscape.com
55cebfe0cb It turns out that even though we were generating jscpucfg.h, we weren't
using it.  Rather the static, checked-in version was being used.  Fixed, now.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13185 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-20 04:42:33 +00:00
fur%netscape.com
26c815ff77 Generate jscpucfg.h on Unix platforms rather than relying on per-platform
static definitions.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13181 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-20 03:24:47 +00:00
fur%netscape.com
facfc365cb Ignore generated files
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13143 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-20 00:09:26 +00:00
fur%netscape.com
63ace590d6 Get rid of -D_SVID_GETTOD
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13142 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-19 23:59:29 +00:00
mccabe%netscape.com
31c250eee9 Fix from Joe Keane to avoid reiniting the scanner except when
necessary.  Thanks!

From: Joe Keane <jgk@jgk.org>  Fri 19:11
Subject:                       Re: JS_SetVersion not
To:                            Mike McCabe <mccabe@netscape.com>

The main caller i saw was libmocha.  In `win_run_timeout', it calls
`JS_SetVersion' twice every time there's a JavaScript timeout; it sets
the version before running the expression, then it sets it back when
it's done.  It looks like a couple times per second, not the worst
thing in the world, but nice to get rid of if it's easy enough.

I had some question about whether it's doing something dumb and it can
be improved.  This may be true, but there are some other callers, for
example it gets called indirectly by `PL_HandleEvent'.  Overall it
seems like a simple and pretty right thing to do anyway.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13134 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-19 22:15:39 +00:00
jband%netscape.com
60b5308f58 Added JSD support for DebugErrorHook
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13069 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-17 06:18:16 +00:00
jband%netscape.com
d2b9c6a168 - added 'DebugErrorHook' which (when present) is called before the ErrorReporter. And in cases where an error exception is raised but the ErrorReporter is not called. This allows for the debugger catching errors when they happen that the ErrorReporter will not now see until they become uncaught errors. This also simplifies the debugger by not having it try to track an ErrorReporter chain. This now works more like the Rhino system.
- #if 0'd js_ReportCompileError which is no longer used (replaced by js_ReportCompileErrorNumber). I'm all for cutting this out of the codebase. Shall we just do that?


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13061 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-17 02:26:19 +00:00
jband%netscape.com
b6525cde8b fix script leakage if !JS_HAS_ERROR_EXCEPTIONS
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13060 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-17 02:11:27 +00:00
bjorn%netscape.com
c4741a81fe Made cc be the default.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13022 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-16 21:47:52 +00:00
bjorn%netscape.com
0649a670ac Moved declaration of FAR to satisfy 'cc' on Dec Unix.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13020 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-16 21:45:44 +00:00
bjorn%netscape.com
d418df2eb7 Extra config stuff for cc on OSF.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12998 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-16 18:16:26 +00:00
bjorn%netscape.com
e86bd6fd57 switch for OSF1.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12997 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-16 18:13:53 +00:00
jband%netscape.com
6d79b5ec64 fix 'typedef struct' redefinition - problem for jsd too before it becomes a build issue
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12992 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-16 10:36:20 +00:00
jband%netscape.com
46800959c2 fix build bustage on Unix due to 'typedef struct' redefinition - the Windows compiler didn't mind
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12991 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-16 10:26:22 +00:00
mccabe%netscape.com
e29596b37b Fix the javascript-visible Exception constructor to make objects of
jsclass Exception.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12987 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-16 09:34:29 +00:00
mccabe%netscape.com
1419ca574a Make the toSource stuff #if JS_HAS_TOSOURCE
Viva jsconfig.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12985 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-16 09:21:22 +00:00
jband%netscape.com
e5892b8370 Added support for throw hook. Added locals() and args() to jsdb to demonstrate/test JSDValue/JSDProperty stuff
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12972 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-16 04:07:41 +00:00
jband%netscape.com
60fe37f18d added save/restore/drop of JSExceptionState. This allows opaque scheme for doing evals and stuff on a context without screwing up the state of the exception information. This helps now with rooting the saved exception and will help more later if additional hidden exception information is added to the context; e.g. source location of thrown exception, etc. Also added throw hook. This is necessary since the relationship between the exceptions and error reporter changed
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12971 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-16 04:03:46 +00:00
fur%netscape.com
98c0f47746 Fix AIX build bustage
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12970 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-16 03:58:25 +00:00
fur%netscape.com
55a926e2c4 Fix gcc warning
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12969 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-16 03:58:07 +00:00
fur%netscape.com
f7387ecdae Fix gettimeofday() on Solaris for the umpteenth time
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12968 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-16 03:51:56 +00:00
fur%netscape.com
ecf83e4f36 + HAVE_LONG_LONG ==> JS_HAVE_LONG_LONG, so as to avoid conflict with NSPR
macro of the same name.
+ Changed JS_HAVE_LONG_LONG to be defined on Linux, since we compile with
  gcc on that platform.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12963 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-16 03:42:06 +00:00
bjorn%netscape.com
7d02cdd1c2 changed from int to unsigned int in alignment code.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12921 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-15 21:06:57 +00:00
mang%netscape.com
0bd5df16b7 Include jsfile.h only when building with JS_HAS_FILE_OBJECT
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12917 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-15 20:55:02 +00:00
mccabe%netscape.com
145eb6f922 Toss the cx->exceptionProtos vector and go to looking up exception
prototypes by using the the constructor names in the current context.
This has some failure modes if users have overwritten the
constructors, but they seem tolerable:

js> sil
1: ReferenceError: sil is not defined
js> ReferenceError = 'foo'
foo
js> sil
3: Exception: sil is not defined
js> Exception = 'bar'
bar
js> sil
5: [object Exception]


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12878 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-15 08:46:59 +00:00
mccabe%netscape.com
f98b15d6d3 Update js.c from the previous behavior of ignoring errors tagged as
exceptions - this caused toplevel compile errors to be ignored.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12877 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-15 08:35:03 +00:00
fur%netscape.com
da9f65325b Propagated changes from JS_STABLE_10131998_BRANCH, required to build mozilla.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12861 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-15 03:07:09 +00:00
mang%netscape.com
25bbd958a9 Now duplicate string instead of trying to modify read-only memory on Unix
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12860 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-15 02:58:12 +00:00
bjorn%netscape.com
3e8f4b2074 Change so that the local structure used to represent a JS pointer is aligned
modulo 8 rather than 4.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12852 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-15 01:22:15 +00:00
mang%netscape.com
6547ff01ff Added NPL
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12834 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-14 22:04:23 +00:00
wynholds%netscape.com
dd55af2615 xlC_r on AIX seems to not be able to hand C++ comments. seems kinds stupid, but what the hell? so i changed it to a C-style comment. no hard no foul.
-mw


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12831 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-14 21:42:37 +00:00
wynholds%netscape.com
619f867c2d ship target now supports JS_LIVECONNECT to be defined or undefined. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12829 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-14 21:36:29 +00:00
rogerl%netscape.com
2ffc6eb8cf Bug #315139 - for character split and empty separator, return string length
for end of string.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12828 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-14 21:32:11 +00:00
rogerl%netscape.com
444ed356ed Fix precedence issue (inappropriate distributive use)
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12826 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-14 20:58:31 +00:00
mccabe%netscape.com
ad709b1cfa GC_MARK the pending exception as a GCTHING rather than as a jsval
during garbage collection.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12794 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-14 07:13:34 +00:00
mccabe%netscape.com
90dc42fec0 Fix warnings.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12714 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-13 19:44:39 +00:00
mccabe%netscape.com
7b3a25dde6 Further work on errors as exceptions -
Changes to js.c back out much of the error-checking code of the
previous checkin; proper exception handling now requires fewer changes
to the host.

Exception prototypes are per-context, with no way (yet) to have
instanceof work properly with exceptions from other contexts.
Per-runtime prototypes (to make instanceof work naturally) worked OK,
but sealing these objects to prevent leaking information between
threads turned out to be hairy.  (Because Exception.prototype.toString
needed sealing too...)

Errors for which a corresponding exception is thrown are suppressed,
and compile errors are always suppressed except at the top level.
Entry functions in jsapi.c now detect failure of calls to the
interpreter and call the error reporter if an exception was raised;
exception-savvy hosts may provide an error reporter that ignores these
reports by checking JSREPORT_EXCEPTION in the report flags.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12686 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-13 09:58:28 +00:00
mang%netscape.com
3b086e1130 JS File Object (not fully implemented yet)
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12662 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-13 03:20:37 +00:00
jband%netscape.com
43ea6c73ea Added reflection of JSDValue, JSDProperty, and JSDObject stuff to jsdb. Initial support for this in debugger.js
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12646 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-13 01:02:25 +00:00
jband%netscape.com
8b37303301 added a comment
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12644 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-13 00:57:53 +00:00
bjorn%netscape.com
a9d4091b08 Updated js_list_scope_lookup() to use void pointers for casting, instead
of JSSymbol. This removed a problem on AIX where the compiler shuffled
code around, thinking that it was safe to do so. Waldemar helped me
track this one down.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12638 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-13 00:17:36 +00:00
fur%netscape.com
0e74fd5849 Merge changes from trunk
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12621 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-12 22:32:49 +00:00
fur%netscape.com
9bbc9990a2 Fix JS_FRIEND_DATA for Mac
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12614 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-12 22:12:08 +00:00
fur%netscape.com
5cea729be2 Updated file for JS1.4
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12606 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-12 21:01:57 +00:00
fur%netscape.com
c7838f766a Get rid of obsolete files
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12588 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-12 18:40:42 +00:00
norris%netscape.com
d6adc823ec Fix bug 299903 Inheriting from a Date object causes crash
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12582 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-12 17:54:44 +00:00
fur%netscape.com
65fea2e956 Remove out-of-date MSVC5 project files
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12580 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-12 17:37:11 +00:00
fur%netscape.com
bc6d33a86b Get rid of isatty() warning on Windows
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12577 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-12 16:43:17 +00:00
(no author)
f9446c3323 This commit was manufactured by cvs2svn to create branch
'SpiderMonkey140_BRANCH'.

git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12554 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-12 08:05:38 +00:00
fur%netscape.com
f2dde02af9 1) Fixed bug in which incorrect netscape.javascript.JSException constructor
was being called when wrapping JavaScript exception objects thrown as
   a result of evaluating JavaScript from Java.

2) Implemented improved LiveConnect overloaded method resolution as described
   in the spec: http://www.mozilla.org/js/liveconnect/lc3_method_overloading.html
   (Explicit method specification not yet implemented, however).


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12551 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-12 07:32:14 +00:00
jband%netscape.com
41ebf8c0e0 Added type info to handles to support automatic 'dropping' of JSDValues (to be supported soon). Added name prop to handles to avoid toString having to repeatedly create the name on the fly. Also misc cleanup.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12545 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-12 02:39:27 +00:00
fur%netscape.com
ab971b977f Changed files for building JS for Mac after js ref/src merge
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12499 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-10 03:17:19 +00:00
fur%netscape.com
9c77f182aa Fix use of uninitialized variable.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12498 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-10 03:16:23 +00:00
fur%netscape.com
b25aef6c55 Privatize some names that conflict with NSPR identifiers missed in the first round of js ref/src merging.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12497 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-10 03:13:38 +00:00
fur%netscape.com
a82b563a25 Kill Mac warnings
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12496 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-10 03:11:30 +00:00
jband%netscape.com
02314c78f6 turn off debug tracing output
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12490 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-10 02:23:56 +00:00
jband%netscape.com
425d07341a added JSObject tracking system that supports iterating all JSObjects with info about the source line that created them and the source line and name of their constructors
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12488 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-10 02:10:07 +00:00
fur%netscape.com
268dfb88cb Fix to make JSObject native methods load on unix
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12485 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-10 00:53:33 +00:00
fur%netscape.com
bc2ec58a7b Get rid of outdated Java implementation of JSObject.equals(). It was replaced by native code a long time ago.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12483 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-10 00:53:05 +00:00
fur%netscape.com
cf373daa53 Don't use deprecated PrintStream API
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12482 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-10 00:52:03 +00:00
coop%netscape.com
7fe8465ded Changed constructor JSException(Object) to public so that Java users can
throw exceptions to JS cleanly.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12427 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-09 15:38:08 +00:00
mccabe%netscape.com
37ec2963c9 Added NPL.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12421 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-09 08:11:32 +00:00
fur%netscape.com
5ea0bc5e25 Revert to my non-standard, but more tabular white-space formatting
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12385 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-09 01:17:24 +00:00
fur%netscape.com
a492c3a964 Fix for #328274 (Unable to pass JS objects to Java)
Thanks to coop for noticing the problem.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12384 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-09 01:16:45 +00:00
rogerl%netscape.com
a256793772 #324451 - disallow indirect calls to eval
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12367 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-08 23:51:18 +00:00
rogerl%netscape.com
fa7759865b #324451 - if eval not invoked with CALLSPECIAL, then complain that it was
called indirectly, not allowed for new ECMA.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12366 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-08 23:50:06 +00:00
rogerl%netscape.com
7a57c4b47a #324451 - CALLSPECIAL opcode for detecting indirect calls to eval
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12365 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-08 23:48:57 +00:00
rogerl%netscape.com
a2ebae060e #324451 - detect direct call of eval and use CALLSPECIAl opcode instead
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12364 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-08 23:48:14 +00:00
rogerl%netscape.com
a8dc44aaa9 #324451 - Added callSpecial opcode to identify indirect eval calls
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12363 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-08 23:46:29 +00:00
rogerl%netscape.com
3c18b0c3ba #324451 Added eval to atomState so that we can detect indirect calls to eval
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12362 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-08 23:42:03 +00:00
coop%netscape.com
c122de69b8 Made all constructors private.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12347 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-08 21:57:30 +00:00
coop%netscape.com
4a3d57e324 Changed references to JSWrappedException to point to JSException instead.
Fixed nesting for vreport_java_error that prevented pending exception from
being set or cleared properly.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12306 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-08 20:16:51 +00:00
coop%netscape.com
a3f846bbf0 Changed references to JSWrappedException to point to JSException instead.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12305 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-08 20:12:36 +00:00
coop%netscape.com
189fd42355 JSWrappedException: removed
JSException: now extends RuntimeException
	     added Object wrappedException
	     added new constructor that takes an Object
	     added instance method getWrappedException(), returns wrappedException.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12304 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-08 20:08:01 +00:00
jband%netscape.com
63410ef469 added debug hook for notification of JSObject new and finalize
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12229 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-07 22:07:37 +00:00
norris%netscape.com
7f25afca90 Sigh. Back out fix that caused regressions.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12224 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-07 21:34:44 +00:00
jband%netscape.com
81d08cb271 support for resume with returnVal or throwVal
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12148 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-07 01:55:53 +00:00
jband%netscape.com
deefcc6b8d support for throwing from hook, prep for client checkin: fix locks, mods to makefile.win
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12147 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-07 01:52:25 +00:00
jband%netscape.com
e9b1c82736 added JSTRAP_THROW -- support for throwing an exception from any of the three kinds of interpreter hooks: interrupt, pc trap, debugger keyword
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12146 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-07 01:39:30 +00:00
wynholds%netscape.com
27a80cf6d2 some hacky stuff to get NT building right with gmake -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12141 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-07 01:15:11 +00:00
mccabe%netscape.com
1022f9e0ce Initialize cx->throwing to JS_FALSE #if JS_HAS_EXCEPTIONS!
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12139 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-07 00:54:26 +00:00
jband%netscape.com
c9bb9195dd only call JS_DestroyScript on non-NULL script in shell Load
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12138 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-07 00:43:20 +00:00
wynholds%netscape.com
095999e32b getting NT stuff build build EXEs correctly/at all -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12136 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-07 00:40:51 +00:00
wynholds%netscape.com
d76a5a9080 oops, typo for HP package. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12127 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-06 23:52:55 +00:00
wynholds%netscape.com
a70e9a2aaa NT executables end in .exe ! -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12126 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-06 23:51:33 +00:00
wynholds%netscape.com
e359fd71fc HP uses libnspr21.sl -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12124 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-06 23:47:50 +00:00
wynholds%netscape.com
04e1b5c3d1 NT uses a different nsinstall (built into shmsdos.exe) -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12122 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-06 23:44:53 +00:00
wynholds%netscape.com
fa2407ee2e don't forget this header file. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12121 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-06 23:32:06 +00:00
wynholds%netscape.com
49bb4bd95c package the right files on NT. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12120 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-06 23:30:18 +00:00
wynholds%netscape.com
3c49adc57b packaging libnspr21.so now. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12116 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-06 23:26:34 +00:00
wynholds%netscape.com
3f7cdf786b only use EXPORT_JS_API while building libjs.dll -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12113 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-06 23:07:41 +00:00
wynholds%netscape.com
78fba657bd LOOP_OVER_DIRS now can go only one level deep at a time -m
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12112 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-06 23:05:04 +00:00
wynholds%netscape.com
5b6a656e48 now NT's link line will create the right .lib and .pdb -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12091 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-06 21:42:00 +00:00
wynholds%netscape.com
fbbe5d2674 we need to use a JDK built especially for HP-UX10 (not 11) because on 11 it links with libm.sl.2, and on 10 it links with libm.sl.1. anyway, on 10, we don't have libm.2 so we obviously need the right one. i put it in /share/builds/components/jdk/1.1.5/HP-UX10/... -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12086 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-06 21:23:42 +00:00
wynholds%netscape.com
d9d717001f using cc instead of gcc (stupid gcc on HP). -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12085 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-06 21:21:08 +00:00
wynholds%netscape.com
1dde42d623 HP has to use native c compiler now, but hey, gcc just wasn't cutting it. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12049 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-06 19:39:46 +00:00
wynholds%netscape.com
1ed0446da5 get the link line right for NT. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12046 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-06 16:29:47 +00:00
wynholds%netscape.com
3fd73fdffd jsref_opt.jar and jsref_dbg.jar -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12045 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-06 16:18:16 +00:00
wynholds%netscape.com
cfa1a86909 a fix for UNIX on LOOP_OVER_DIRS -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12044 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-06 15:53:36 +00:00
coop%netscape.com
6b78529f1f Removed references to getWrappedException java method.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12043 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-06 14:46:50 +00:00
norris%netscape.com
4fd0fc55ca Fix bug 327540 "monkey: crash in some negative tests"
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12025 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-06 04:08:25 +00:00
norris%netscape.com
b1e460a74a Fix 325843 "function f(a){var a,b;} asserts/crashes"
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11980 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-06 00:26:15 +00:00
wynholds%netscape.com
a5a20628a0 HP 10.10 stuff -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11977 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-06 00:19:22 +00:00
wynholds%netscape.com
d9eb58cdec need this to get HP linking. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11976 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-06 00:18:34 +00:00
wynholds%netscape.com
037c43596e uses reltools now
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11974 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 23:59:25 +00:00
wynholds%netscape.com
79b38ca130 get liveconnect building on NT
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11973 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 23:52:02 +00:00
wynholds%netscape.com
2f59039158 NT specific stuff
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11972 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 23:50:12 +00:00
wynholds%netscape.com
d32e31eda5 make DIRS NT friendly
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11971 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 23:49:23 +00:00
wynholds%netscape.com
ccf4b130af links correctly with NSPR on NT
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11970 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 23:46:20 +00:00
coop%netscape.com
c66acfa187 JSWrappedException wraps a JavaScript exception in a java.lang.Object wrapper.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11968 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 23:39:09 +00:00
coop%netscape.com
89d32f85be Removed "if 0"s referencing JSWrappedException code.
Changed references to JSWrappedException to reflect changes to that objects
structure, ie. JSWrappedException now contains a java.lang.Object instead
of an integer.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11967 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 23:35:22 +00:00
coop%netscape.com
0f8d890868 Removed "if 0"s referencing JSWrappedException code.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11966 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 23:32:28 +00:00
coop%netscape.com
3c8ae5aafe Removed "if 0"s referencing JSWrapped exception code.
Changed throw_any_pending_js_error_as_a_java_exception to reflect the
new make-up/construction of JSWrappedException (contains an java.lang.Object
instead of an integer).


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11965 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 23:31:35 +00:00
coop%netscape.com
f909920e91 Removed "if 0"s for references to JSWrappedException.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11963 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 23:27:26 +00:00
wynholds%netscape.com
ad73f38c85 installing programs to dist/bin directory now, and giving the owner write permissions. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11945 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 21:58:28 +00:00
wynholds%netscape.com
e18fa8a56f added ship target for packaging. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11944 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 21:57:50 +00:00
wynholds%netscape.com
e81b4d3657 this is the right config file for DEC, not dgux.mk. i dunno what version of uname that comes from. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11940 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 21:23:13 +00:00
wynholds%netscape.com
19c49a56be get DEC building -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11939 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 21:22:33 +00:00
wynholds%netscape.com
3e2489f92c point to java stuff for HP. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11934 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 20:55:29 +00:00
wynholds%netscape.com
b9e217c7e8 get HP 11 to link shared libraries. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11933 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 20:53:57 +00:00
wynholds%netscape.com
940ee6966f using /share/builds/components/jdk/1.1.6/IRIX instead of /usr/java so everybody can use it!. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11925 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 19:30:18 +00:00
wynholds%netscape.com
13337f0a89 using /share/builds/components/jdk/1.1.6/IRIX instead of /usr/java so we can all use it! -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11924 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 19:29:04 +00:00
wynholds%netscape.com
aabb8920ae need to hack AIX 4.1 to grab 4.2 because 4.1 doesn't exist. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11918 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 19:15:11 +00:00
wynholds%netscape.com
bd32e33753 trying to get AIX 4.1 to build, but no real luck yet. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11917 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 19:13:14 +00:00
wynholds%netscape.com
c68e984b99 link with libdl.a when doing threadsafe builds (NSPR needs it). -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11912 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 18:34:01 +00:00
wynholds%netscape.com
35b4a8183d get AIX 4.1.5 building. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11911 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 18:33:22 +00:00
wynholds%netscape.com
f746d5d6c5 added SunOS5.6.mk file to get it building. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11910 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 18:07:21 +00:00
wynholds%netscape.com
dccd95eeaa new target to grab NSPR from /share/builds/components. for use with JS_THREADSAFE standalone builds. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11909 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 17:46:30 +00:00
mccabe%netscape.com
0dc9a5a868 Be more paranoid in various ways about properly handling exceptions,
from compilation or execution.  Load is now somewhat more exception-savvy.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11899 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 09:56:06 +00:00
mccabe%netscape.com
f46f66eea8 Change some engine semantics to propagate exceptions better.
js_DefaultValue and a few other places used js_TryMethod,
js_TryValueOf.  The return value of these functions was always ignored
(well, was void) even if they found a method to call and that method
raised an exception.  As a result, functions like valueOf which might
have been user-defined to throw an exception didn't end up propagating
the exception.

I changed js_TryMethod, js_TryValueOf, and JS_ConvertStub (which calls
js_TryValueOf) to propagate failure.  Note that they'll still succeed
if they fail to find an appropriate method value to call.  (so 'Try'
still means something in this context.)  js_DefaultValue now uses
these return values to decide how to proceed.

As a result js_DefaultValue and obj->convert now may fail in a few
places where they previously did not.  I think that this is best in
terms of making the engine interpret a consistent language, but it
might trip us up on old code.  Fingers now crossed.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11898 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 09:40:59 +00:00
mccabe%netscape.com
8ade5f78d3 If compiletime errors are already reflected as exceptions, suppress
any compiletime errors that don't occur at the top level.  The intent
is to retain as much as possible the existing behavior of giving
multiple compile error messages for toplevel compiles.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11897 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 09:16:07 +00:00
mccabe%netscape.com
58a8a3d984 Only look for enclosing try/catch statements on abrupt frame exit when
returning failure with a pending exception, not just when there's a
pending exception.  (The pending exception could have been an
uncleared exception another script in the same context.)


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11896 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 09:07:48 +00:00
mccabe%netscape.com
e539af4e6f Fix to 318250. Disable an assert that was firing for a
default-value-throws-exn object used in an expression.  Code exists to
handle the case for which the assertion failed, but it was effectively
disabled in debug builds.  Anybody know the history of this one?


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11895 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 08:17:48 +00:00
norris%netscape.com
27e172913a Fix 299903 Inheriting from a Date object causes crash
and Actra global regexp problem (Function clone of regexp object because
it is of type Function).


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11894 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 06:32:34 +00:00
fur%netscape.com
b54505be31 Changed PR_* to JS_* names
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11890 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-04 23:18:51 +00:00
fur%netscape.com
2433dae015 Propagating README from js/ref
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11889 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-04 23:16:44 +00:00
mccabe%netscape.com
c2bcde8466 Only raise an exception for the first syntax error that's reported on
any given compile.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11843 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-03 03:27:13 +00:00
mccabe%netscape.com
90fb1dfb90 Comment fix.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11842 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-03 03:23:08 +00:00
val4%cornell.edu
132d1f5b26 Minor modification to readme reflecting the changes in the directory structure.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11791 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-02 19:42:37 +00:00
val4%cornell.edu
4c69c950da Looks like CRs on this file were scred up, which didn't allow MSDEV to
open them properly. Hopefully, it will work now.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11781 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-02 18:35:59 +00:00
coop%netscape.com
d5329cfd00 Added NPL.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11772 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-02 15:30:56 +00:00
coop%netscape.com
83cb0cf419 Added code to vreport_java_error that reports, sets and clears JS exceptions
based on the type of java exception encountered. Parts referencing
JSWrappedException are currently commented out.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11771 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-02 15:30:11 +00:00
coop%netscape.com
d3eee3f5c6 Added extern references for class JSWrappedException. Currently commented out.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11770 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-02 15:27:48 +00:00
coop%netscape.com
c78787a61a Added code to throw_any_pending_js_error_as_a_java_exception which
wraps an exception in a JSWrappedException wrapper. Currently commented
out.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11769 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-02 15:26:18 +00:00
coop%netscape.com
fd99e42a1e Added references (jclass, jmethodID, etc.) for JSWrappedException class.
Class does not currently exist, so references are commented out.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11768 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-02 15:23:46 +00:00
coop%netscape.com
f536714915 Added NPL for all classes.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11767 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-02 15:21:41 +00:00
shaver%netscape.com
16977a5881 fix Linux build of shared JS
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11740 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-02 02:02:23 +00:00
(no author)
d58d92ba30 This commit was manufactured by cvs2svn to create branch
'SpiderMonkey140_BRANCH'.

git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11725 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-01 23:57:01 +00:00
bjorn%netscape.com
70aa311f1a Some final touches to the make system, just when you thought they
were all over... I got rid of the silly JS_STATIC. More pain than
pleasure, really.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11713 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-01 22:11:21 +00:00
wynholds%netscape.com
d6d4547e60 adding nsinstall-target target which will build the nsinstall executable needed for gmake export. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11678 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-01 19:32:00 +00:00
bjorn%netscape.com
cddb4bee49 Changed environment flag from JS_THREADSAFE to USE_NSPR.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11670 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-01 17:53:22 +00:00
bjorn%netscape.com
215e4f521a Added '+' to CFLAGS definition.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11649 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-01 04:52:28 +00:00
bjorn%netscape.com
b374ece734 Added JS_STATIC flag which, when set, links LiveConnect statically with JS.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11648 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-01 04:47:20 +00:00
bjorn%netscape.com
db88d15e60 IRIX 6.2 support for LiveConnect.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11620 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-30 23:30:52 +00:00
bjorn%netscape.com
17a3a3fede IRIX6.2 support.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11619 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-30 23:30:14 +00:00
bjorn%netscape.com
802ea94da2 Changes to make export work from inside liveconnect.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11618 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-30 23:28:20 +00:00
bjorn%netscape.com
87987c22eb LC support for IRIX.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11617 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-30 23:24:05 +00:00
mccabe%netscape.com
92e75b047c Fix to 320443. Restructure jsinterp.c to always check a raised
exception against any enclosing try statement within the current frame
before attempting to return from the frame.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11612 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-30 22:34:13 +00:00
bjorn%netscape.com
d72d172d7a Fixes to properly generate the executable 'jsj'.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11611 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-30 22:33:44 +00:00
rogerl%netscape.com
8e7b173eef ErrorNumber handling changes to support UC
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11607 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-30 21:51:59 +00:00
rogerl%netscape.com
d898e8430d Fixed bug #104766. DecompileFunctionBody needs to set the scope in its
JSPrinter arg.
Changed error number handling code to support UC version as well.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11606 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-30 21:50:52 +00:00
rogerl%netscape.com
55edce6a15 Fixed bug #104766. DecompileFunctionBody needs to set the scope in its
JSPrinter arg.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11603 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-30 21:48:00 +00:00
rogerl%netscape.com
f962f59ccc Fixing bugs #310514, 310502 - calling function.toString, .call & .apply
on non-function objects now results in a runtime error.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11599 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-30 21:30:26 +00:00
bjorn%netscape.com
75187e5e57 DIST is now a variable set in Makefile.ref so that the export rule
can be made to export to a chosen directory.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11572 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-30 18:13:50 +00:00
bjorn%netscape.com
3522f2112e Removed JDK include.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11566 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-30 17:14:29 +00:00
bjorn%netscape.com
b2bc5afac7 New support for AIX.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11565 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-30 17:14:12 +00:00
bjorn%netscape.com
1b857628d4 AIX 4.2 make support.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11564 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-30 16:59:47 +00:00
fur%netscape.com
4034d6af4c Added MKSHLIB macro
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11528 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-30 03:45:54 +00:00
bjorn%netscape.com
1d5e647e2c Added includes.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11527 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-30 03:10:19 +00:00
bjorn%netscape.com
2aabababd7 New support for standalone make system.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11526 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-30 03:08:00 +00:00
fur%netscape.com
024311a2ab Fixed an incorrect assertion that I believe was intended to confirm that
all JS roots pointed into the GC'able JS arena, but which wasn't coded correctly.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11525 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-30 03:03:15 +00:00
mccabe%netscape.com
55fcddec90 Changed some remaining messages from js_ReportCompileError(<hardcoded
string>) to js_ReportCompileErrorNumber(<error number>).  To make
runtime exceptions work for lexical errors, because the mechanism
piggybacks off of js_ReportCompileErrorNumber.

Also propagated a free->JS_free change.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11522 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-30 01:53:45 +00:00
bjorn%netscape.com
0c95c94909 Fixes to the assembly for SPARC v8, and to accommodate for new source
tree.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11478 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-29 23:32:29 +00:00
bjorn%netscape.com
8da98334c6 Fixed the test when the pointer is busy (tst -> cmp)
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11474 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-29 23:18:26 +00:00
shaver%netscape.com
defa10fc43 added Linux config file
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11469 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-29 22:54:37 +00:00
bjorn%netscape.com
f0cdddb20c Changed assertion in CompareAndSwap to look for nv != -1.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11465 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-29 22:47:27 +00:00
fur%netscape.com
a17e03c381 Re-fixed comment
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11419 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-29 20:35:44 +00:00
shaver%netscape.com
595794ecfe don't overwrite catchall jump with rethrow address
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11414 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-29 19:14:36 +00:00
shaver%netscape.com
1a0b1b8a29 fix catchall-after-catchguard spurious error
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11347 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-29 09:50:04 +00:00
fur%netscape.com
670d4d69fa Moved from js/ref to js/src
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11326 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-29 05:56:30 +00:00
fur%netscape.com
c5a6bb1af7 Migrated LiveConnect from js/ref to js/src.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11325 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-29 05:55:25 +00:00
jband%netscape.com
00a574acf2 added call to new JSD unicode function JSD_AppendUCSourceText to simplify shell and remove truncation hackery (which really just got pushed into JSD)
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11257 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-28 20:37:22 +00:00
jband%netscape.com
68900225d1 - removed MY_XP junk, abandon Win16, assume that realloc works
- removed HACK_FOR_OLD_JS
- made JS_LOWLEVEL_SOURCE work in jsdb
- added Unicode JSD_AppendUCSourceText to simplify shells
- some gratuitous whitespace reformatting


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11256 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-28 20:34:46 +00:00
mccabe%netscape.com
97a1eacae2 Propagate mcafee fix: Added Rhapsody to the long list of OS's that
can't handle localtime_r().


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11235 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-28 19:41:17 +00:00
jband%netscape.com
1061a7961a Source notes for line numbers are generated at the top of js_EmitTree. The code generation in the TOK_TRY case was bypassing this code (i.e. emitting code for source lines before recursing into js_EmitTree). So, I brokeout that linenumber code into a macro to be inlined at the top of js_EmitTree and also into a static function that can be called elsewhere -- I didn't want to force an extra (and often unneeded) function call at the top of each invocation of js_EmitTree, nor inline 15 lines of code in a bunch of places, so this seemed a good compromise. This substantially fixes lineno errors in try/catch/finally code. There are still non-lineno problems in that code that shaver and coop are looking at - so this code in not final.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11210 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-28 08:02:43 +00:00
jband%netscape.com
95f197f31a function mis-declared as JS_FRIEND_DATA. changed to JS_FRIEND_API
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11209 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-28 07:51:21 +00:00
jband%netscape.com
aeb19b804e fix CompileTokenStream to always call js_CloseTokenStream. It was not doing so on syntax errors. This caused .js files loaded in the shell to be left open and would also fail to have JSPRINCIPALS_DROP be called in cases where principles are used.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11069 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-25 21:15:49 +00:00
norris%netscape.com
22b83ef992 Back out breaking change.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11017 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-25 04:36:13 +00:00
mccabe%netscape.com
cf89f9dbea Fix to xp problem on solaris. Use 1-argument form of gettimeofday #if
defined( SOLARIS ) - hack borrowed from ref/prtime.c.  Why wasn't it
needed in src/prmjtime.c previously?


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11006 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-25 00:58:26 +00:00
norris%netscape.com
b9f52d961c Fix bug 299903 Inheriting from a Date object causes crash.
The test code is

     function MyDate() { this.foo = "bar"; }
     MyDate.prototype = new Date();
     x = new MyDate();
     print(x.toString())

The problem is that object x is created with an associated class of date_class, but with an undefined value in the private slot. Then when
date_getProlog is called on x, the JS_InstanceOf test passes since the class of the object is date_class, but then a bogus pointer is returned
since there isn't really a double in the private data slot.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10983 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-24 23:30:36 +00:00
jband%netscape.com
b9b66713eb added build() to js.c to display date/time of build in shell. Uses __DATE__ and __TIME__ which are supposed to be ansi C -- tested on Windows and Linux
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10975 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-24 22:52:07 +00:00
fur%netscape.com
3287009b56 Added/deleted files to accomodate ref/src merge.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10903 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-24 07:44:22 +00:00
jband%netscape.com
d0ad9c946c last automatic conversion of js/ref/jsd to js/jsd based on fur's conversion system of js/ref to js/src
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10900 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-24 07:22:17 +00:00
jband%netscape.com
b3c707fd61 removed NETSCAPE_INTERNAL. Made JS_IsAssigning a JS_FRIEND_API with a warning in jsapi.h that the function might be removed in the future
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10899 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-24 07:17:59 +00:00
fur%netscape.com
03332fd3ac Final changes merged from js/ref
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10897 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-24 05:40:16 +00:00
fur%netscape.com
ef97812295 + Make JS1.4 build in Mozilla
+ Get rid of all uses of NSPR20 macro


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10893 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-24 04:16:35 +00:00
fur%netscape.com
ca0614a7b6 Converted README to README.html
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10892 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-24 04:15:15 +00:00
fur%netscape.com
4c1594b677 Changes for merged js ref/src.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10886 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-24 03:55:11 +00:00
fur%netscape.com
914637bd3e Fixed JS_FRIEND_* macros
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10882 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-24 03:18:10 +00:00
fur%netscape.com
91dbe3c171 Added extern C declarations for inclusion into C++
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10881 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-24 03:17:55 +00:00
fur%netscape.com
c3bd0c5f7d Fix PR_EXTERN
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10878 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-24 02:41:11 +00:00
jband%netscape.com
cff140c431 adding a PR_PUBLIC_XXX conversions back in
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10809 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-23 18:45:12 +00:00
fur%netscape.com
923990dd99 Updated dependencies
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10785 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-23 07:44:40 +00:00
fur%netscape.com
45291c870a More name substitutions for ref/src merge
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10784 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-23 07:40:51 +00:00
jband%netscape.com
33d0d8a72b improved makefiles. added javawrap
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10768 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-23 04:01:03 +00:00
fur%netscape.com
2066c6b9ce Got rid of OS-dependent header files. Everything is in jsosdep.h now
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10765 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-23 02:37:53 +00:00
jband%netscape.com
46e77ac0e1 change path make standalone debugger work
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10735 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-23 01:42:03 +00:00
jband%netscape.com
7507e060b5 moved from ref/samples. work with ref/src merged js. ripped out jsd and jsdebugger build stuff
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10734 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-23 01:23:33 +00:00
jband%netscape.com
1cc86f1b54 jsd to go with ref/src merge. first checkin of new java stuff and jsdb
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10733 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-23 01:22:09 +00:00
fur%netscape.com
a4156ea8c1 Fix windows compilation error
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10727 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-22 23:39:13 +00:00
fur%netscape.com
4e17e7d0b6 Updated dependencies
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10723 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-22 23:27:41 +00:00
fur%netscape.com
0b9f4a6066 Make it build on the Mac
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10669 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-22 02:57:17 +00:00
fur%netscape.com
88e2efb86c Make it build on the Mac
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10668 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-22 02:47:25 +00:00
fur%netscape.com
f70c006cd2 Strange...some initialization of prmjtime.c is actually done in NSPR.
I had to copy the routines out of prtime.c so that prmjtime.c would
not be dependent on NSPR.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10666 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-22 02:37:06 +00:00
fur%netscape.com
2d43318eeb Replace PR_snprintf's
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10655 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-22 02:07:32 +00:00
fur%netscape.com
464cfb0128 + Added missing conversion of PR_*printf functions to JS_*printf.
+ Changed jsopcode.def to jsopcode.tbl


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10653 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-22 01:52:52 +00:00
fur%netscape.com
ccd9fea75c *** empty log message ***
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10633 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-21 23:28:00 +00:00
fur%netscape.com
adbbf081d4 Changes to build ref/src merged files on Win32 platform.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10607 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-21 20:04:13 +00:00
fur%netscape.com
087895e0d4 Standalone makefiles for js ref/src merge
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10606 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-21 20:03:11 +00:00
fur%netscape.com
f53236bbe5 Replaced with js*.h
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10598 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-21 18:58:46 +00:00
fur%netscape.com
4525a93346 Replaced with jsdtoa.c
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10597 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-21 18:57:51 +00:00
fur%netscape.com
92ce8e0953 This check-in is a first attempt at reducing JavaScript's dependency
on NSPR.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10589 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-21 17:54:36 +00:00
fur%netscape.com
4f506cbcbc prarena.c is now jsarena.c
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10586 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-21 17:47:37 +00:00
fur%netscape.com
53fed9d6ad This check-in is a first attempt at reducing JavaScript's dependency
on NSPR.  In fact, the JS C-engine no longer depends on NSPR at all in
a single-threaded environment and the multi-threaded version relies on
NSPR strictly for its threading primitives.  This change was made for
several reasons:

 + To merge the js/src and js/ref directories, which differ only in that
   the former is designed to link with NSPR2, but the latter makes use of
   an NSPR1 subset.  The automatic generation of src from ref often led
   to confusion and sometimes to merge-related errors.

 + To avoid the requirement to link against multiple versions of NSPR
   when delivering JS binaries. (Different internal customers of JS have
   standardized upon different NSPR releases.)

 + To shield JS from incompatible changes to NSPR.

Most of the changes involved simple renaming of types, macros,
identifiers and file names, i.e. from pr* to js*.  In some cases, this
transformation resulted in name collisions and a different name was
chosen.  One place where renaming was *not* performed was in the
definition of simple scalar types, i.e. int32, uint16, etc.  The
jsotypes.h header file was specially handled so as to avoid typename
collision with NSPR types of the same name.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10585 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-21 17:45:48 +00:00
fur%netscape.com
a7fb2e53b5 Removing dependency on NSPR
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10579 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-21 17:21:23 +00:00
(no author)
cddacc3fc7 This commit was manufactured by cvs2svn to create branch
'SpiderMonkey140_BRANCH'.

git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10431 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-18 19:56:46 +00:00
fur%netscape.com
6f925ed79a We decided not to do mini-nspr
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10422 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-18 18:21:58 +00:00
fur%netscape.com
91ff9d9174 Checkpoint mini-nspr files, even though we're probably not going to use mini-nspr
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10292 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-17 18:55:29 +00:00
fur%netscape.com
cb5c11135f Make it build on unix
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@9520 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-08 19:58:23 +00:00
(no author)
d02f29a398 This commit was manufactured by cvs2svn to create branch
'SpiderMonkey140_BRANCH'.

git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@9511 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-08 19:08:10 +00:00
467 changed files with 119136 additions and 881 deletions

125
mozilla/config/AIX.mk Normal file
View File

@@ -0,0 +1,125 @@
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
######################################################################
# Config stuff for IBM AIX for RS/6000 and PPC
######################################################################
#
######################################################################
# Version-independent
######################################################################
ARCH := aix
CPU_ARCH := rs6000 # How can I determine this?
GFX_ARCH := x
OS_INCLUDES =
G++INCLUDES =
LOC_LIB_DIR = /usr/lib/X11
MOTIF =
MOTIFLIB = -lXm
OS_LIBS = -lm -lbsd
PLATFORM_FLAGS = -qarch=com -qmaxmem=65536 -DAIX -Daix -DAIX$(subst .,_,$(OS_RELEASE))
MOVEMAIL_FLAGS =
PORT_FLAGS = -DSYSV -DNEED_CDEFS_H -DNEED_SELECT_H -DNEED_IOCTL_H -DSYS_MACHINE_H -DUSE_NODL_TABS -DHAVE_SIGNED_CHAR -DHAVE_SYS_SELECT_H -DNEED_SYS_WAIT_H -DHAVE_INT32_T -DNEED_H_ERRNO
PDJAVA_FLAGS =
ifdef USE_AUTOCONF
OS_CFLAGS =
else
OS_CFLAGS = $(PLATFORM_FLAGS) $(PORT_FLAGS) $(MOVEMAIL_FLAGS)
endif
LOCALE_MAP = $(DEPTH)/cmd/xfe/intl/aix.lm
EN_LOCALE = en_US.ISO8859-1
DE_LOCALE = de_DE.ISO8859-1
FR_LOCALE = fr_FR.ISO8859-1
JP_LOCALE = ja_JP.IBM-eucJP
SJIS_LOCALE = Ja_JP.IBM-932
KR_LOCALE = ko_KR.IBM-eucKR
CN_LOCALE = zh_CN
TW_LOCALE = zh_TW.IBM-eucTW
I2_LOCALE = iso88592
######################################################################
# Version-specific stuff
######################################################################
ifeq ($(OS_RELEASE),3.2)
PLATFORM_FLAGS += -qtune=601 -DAIXV3 -DAIX3_2_5
else
PLATFORM_FLAGS += -qtune=604 -qnosom -DAIXV4
endif
ifeq ($(OS_RELEASE),4.1)
OS_LIBS += -lsvld
DSO_LDOPTS = -bM:SRE -bh:4 -bnoentry
AIX_NSPR = $(DIST)/bin/libnspr_shr.a
LIBNSPR = $(AIX_NSPR)
AIX_NSPR_LINK = -L$(DIST)/bin -lnspr_shr -blibpath:/usr/local/lib/netscape:/usr/lib:/lib:.
#
# Used to link java, javah. Include 3 relative paths since we're guessing
# at runtime where the hell the library is. LIBPATH can be set, but
# setting this will be hell for release people, _AND_ I couldn't get it to
# work. Sigh. -mcafee
#
AIX_NSPR_DIST_LINK = -L$(DIST)/bin -lnspr_shr -blibpath:.:../dist/$(OBJDIR)/bin:../../dist/$(OBJDIR)/bin:../../../dist/$(OBJDIR)/bin:/usr/lib:/lib
endif
ifneq (,$(filter 4.2 4.3,$(OS_RELEASE)))
PORT_FLAGS += -DHAVE_SNPRINTF
OS_LIBS += -ldl
MKSHLIB = $(LD) $(DSO_LDOPTS)
DSO_LDOPTS = -brtl -bM:SRE -bnoentry -bexpall -berok
endif
######################################################################
# Overrides for defaults in config.mk (or wherever)
######################################################################
ifeq ($(USE_PTHREADS),1)
CC = xlC_r
CCC = xlC_r
else
CC = cc
CCC = xlC
endif
BSDECHO = $(DIST)/bin/bsdecho
RANLIB = /usr/ccs/bin/ranlib
WHOAMI = /bin/whoami
ifneq ($(OS_RELEASE),3.2)
UNZIP_PROG = $(CONTRIB_BIN)unzip
ZIP_PROG = $(CONTRIB_BIN)zip
else
ifdef NETSCAPE_HIERARCHY
PERL = perl5
endif
endif
######################################################################
# Other
######################################################################
ifneq ($(USE_PTHREADS),1)
PORT_FLAGS += -DSW_THREADS
endif
MUST_BOOTLEG_ALLOCA = 1
BUILD_UNIX_PLUGINS = 1
DSO_LDFLAGS = -lXm -lXt -lX11
EXTRA_DSO_LDOPTS = -lc

95
mozilla/config/BSD_OS.mk Normal file
View File

@@ -0,0 +1,95 @@
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
######################################################################
# Config stuff for BSDI BSD/386 and BSD/OS for x86
######################################################################
#
######################################################################
# Version-independent
######################################################################
ARCH := bsdi
CPU_ARCH := x86
GFX_ARCH := x
OS_INCLUDES = -I/usr/X11/include
G++INCLUDES = -I/usr/include/g++
LOC_LIB_DIR = /usr/X11/lib
MOTIF = $(NS_LIB)/Xm
MOTIFLIB = -lXm
OS_LIBS = -lcompat
PLATFORM_FLAGS = -Wall -Wno-format -DBSDI -D__386BSD__ -Di386
MOVEMAIL_FLAGS = -DHAVE_STRERROR
PORT_FLAGS = -DSW_THREADS -DNEED_BSDREGEX -DNTOHL_ENDIAN_H -DUSE_NODL_TABS -DNEED_SYS_WAIT_H -DNO_TZNAME -DHAVE_NETINET_IN_H -DNO_INT64_T -DNEED_UINT_T -DHAVE_SYS_SELECT_H -DHAVE_SNPRINTF
PDJAVA_FLAGS =
ifdef USE_AUTOCONF
OS_CFLAGS =
else
OS_CFLAGS = $(PLATFORM_FLAGS) $(PORT_FLAGS) $(MOVEMAIL_FLAGS)
endif
LOCALE_MAP = $(DEPTH)/cmd/xfe/intl/bsd386.lm
EN_LOCALE = C
DE_LOCALE = de_DE.ISO8859-1
FR_LOCALE = fr_FR.ISO8859-1
JP_LOCALE = ja
SJIS_LOCALE = ja_JP.SJIS
KR_LOCALE = ko_KR.EUC
CN_LOCALE = zh
TW_LOCALE = zh
I2_LOCALE = i2
######################################################################
# Version-specific stuff
######################################################################
ifeq ($(OS_RELEASE),1.1)
PLATFORM_FLAGS += -DBSDI_1
PORT_FLAGS += -DNEED_UINT -DNEED_IOCTL_H -DNEED_REALPATH
endif
ifeq ($(OS_RELEASE),2.1)
PLATFORM_FLAGS += -DBSDI_2
PORT_FLAGS += -DHAVE_FILIO_H
OS_LIBS += -ldl
UNZIP_PROG = $(CONTRIB_BIN)unzip
endif
ifeq ($(OS_RELEASE),3.1)
PLATFORM_FLAGS += -DBSDI_2 -DBSDI_3
PORT_FLAGS += -DHAVE_FILIO_H
OS_INCLUDES += -I/usr/motif/include/X11
OS_LIBS += -ldl
endif
######################################################################
# Overrides for defaults in config.mk (or wherever)
######################################################################
EMACS = /usr/bin/true
PERL = /usr/bin/perl
RANLIB = /usr/bin/ranlib
ifdef NETSCAPE_HIERARCHY
PERL = perl5
endif
######################################################################
# Other
######################################################################

76
mozilla/config/DGUX.mk Normal file
View File

@@ -0,0 +1,76 @@
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
######################################################################
# Config stuff for Data General DG/UX
######################################################################
#
# Initial DG/UX port by Marc Fraioli <fraioli@dg-rtp.dg.com>
#
######################################################################
# Version-independent
######################################################################
ARCH := dgux
CPU_ARCH := x86
GFX_ARCH := x
OS_INCLUDES =
G++INCLUDES =
LOC_LIB_DIR =
MOTIF =
MOTIFLIB = -lXm -lXt -lXmu -lX11
OS_LIBS = -lgen -lresolv -lsocket -lnsl
PLATFORM_FLAGS = -DDGUX -Di386 -D_DGUX_SOURCE -D_POSIX4A_DRAFT6_SOURCE
MOVEMAIL_FLAGS = -DUSG -DHAVE_STRERROR
PORT_FLAGS = -DSVR4 -DSYSV -DNO_CDEFS_H -DNEED_S_ISSOCK -DSYS_BYTEORDER_H -DUSE_NODL_TABS -DMOTIF_WARNINGS_UPSET_JAVA -DMITSHM -DNO_MULTICAST -DHAVE_NETINET_IN_H -DHAVE_REMAINDER
PDJAVA_FLAGS =
OS_CFLAGS = $(PLATFORM_FLAGS) $(PORT_FLAGS) $(MOVEMAIL_FLAGS)
LOCALE_MAP = $(DEPTH)/cmd/xfe/intl/dgux.lm
EN_LOCALE = C
DE_LOCALE = de_DE.ISO8859-1
FR_LOCALE = fr_FR.ISO8859-1
JP_LOCALE = ja
SJIS_LOCALE = ja_JP.SJIS
KR_LOCALE = ko_KR.EUC
CN_LOCALE = zh
TW_LOCALE = zh
I2_LOCALE = i2
######################################################################
# Version-specific stuff
######################################################################
######################################################################
# Overrides for defaults in config.mk (or wherever)
######################################################################
EMACS = /bin/true
PERL = /usr/bin/perl
ifdef BUILD_OPT
OPTIMIZER = -O2
else
OPTIMIZER =
endif
######################################################################
# Other
######################################################################

97
mozilla/config/FreeBSD.mk Normal file
View File

@@ -0,0 +1,97 @@
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
######################################################################
# Config stuff for FreeBSD
######################################################################
#
######################################################################
# Version-independent
######################################################################
ARCH := freebsd
CPU_ARCH := x86
GFX_ARCH := x
OS_INCLUDES = -I/usr/X11R6/include
G++INCLUDES = -I/usr/include/g++
LOC_LIB_DIR =
MOTIF =
MOTIFLIB =
OS_LIBS =
# Don't define BSD, because it's already defined in /usr/include/sys/param.h.
PLATFORM_FLAGS = -DFREEBSD -DBSDI -DBSDI_2 -D__386BSD__ -Di386 $(DSO_CFLAGS)
MOVEMAIL_FLAGS = -DHAVE_STRERROR
PORT_FLAGS = -DSW_THREADS -DNEED_UINT -DHAVE_LCHOWN -DNTOHL_ENDIAN_H -DHAVE_FILIO_H -DNEED_SYS_TIME_H -DNEED_UINT_T -DHAVE_BSD_FLOCK -DHAVE_SYSERRLIST -DHAVE_SNPRINTF
PDJAVA_FLAGS = -mx128m
OS_GPROF_FLAGS = -pg
LD_FLAGS = -L/usr/X11R6/lib -lXm
ifdef USE_AUTOCONF
OS_CFLAGS =
else
OS_CFLAGS = $(PLATFORM_FLAGS) $(PORT_FLAGS) $(MOVEMAIL_FLAGS)
endif
LOCALE_MAP = $(DEPTH)/cmd/xfe/intl/bsd386.lm
EN_LOCALE = C
DE_LOCALE = de_DE.ISO8859-1
FR_LOCALE = fr_FR.ISO8859-1
JP_LOCALE = ja
SJIS_LOCALE = ja_JP.SJIS
KR_LOCALE = ko_KR.EUC
CN_LOCALE = zh
TW_LOCALE = zh
I2_LOCALE = i2
######################################################################
# Version-specific stuff
######################################################################
######################################################################
# Overrides for defaults in config.mk (or wherever)
######################################################################
DLL_SUFFIX = so.1.0
EMACS = /usr/bin/true
JAVA_PROG = $(JAVA_BIN)java
RANLIB = /usr/bin/ranlib
ifdef NETSCAPE_HIERARCHY
PERL = perl5
endif
######################################################################
# Other
######################################################################
ifeq ($(USE_PTHREADS),1)
OS_LIBS = -lc_r
PORT_FLAGS += -D_PR_NEED_FAKE_POLL
else
OS_LIBS = -lc
PORT_FLAGS += -D_PR_LOCAL_THREADS_ONLY
endif
BUILD_UNIX_PLUGINS = 1
MKSHLIB = $(LD) $(DSO_LDOPTS)
DSO_CFLAGS = -fpic
DSO_LDFLAGS =
DSO_LDOPTS = -Bshareable

142
mozilla/config/HP-UX.mk Normal file
View File

@@ -0,0 +1,142 @@
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
######################################################################
# Config stuff for HP-UX
######################################################################
#
######################################################################
# Version-independent
######################################################################
ARCH := hpux
CPU_ARCH := hppa
GFX_ARCH := x
OS_INCLUDES = -I/usr/include/X11R$(X11_REV) -I/usr/contrib/X11R$(X11_REV)/include -I/usr/include/Motif$(MOTIF_REV)_R$(X11_REV) -I/usr/include/Motif$(MOTIF_REV)
G++INCLUDES =
LOC_LIB_DIR = /usr/lib/X11
MOTIF =
MOTIFLIB =
MOTIF_REV = 1.2
OS_LIBS = -ldld
PLATFORM_FLAGS = $(DSO_CFLAGS) -DHPUX -Dhpux -DHPUX$(subst .,,$(subst .0,,$(suffix $(OS_RELEASE)))) -DHPUX$(subst .,,$(subst .0,,$(suffix $(OS_RELEASE))))$(subst .,_,$(OS_VERSION)) -D$(CPU_ARCH) $(ADDITIONAL_CFLAGS)
MOVEMAIL_FLAGS = -DHAVE_STRERROR
PORT_FLAGS = -D_HPUX_SOURCE -DSW_THREADS -DNO_SIGNED -DNO_FNDELAY -DHAVE_ODD_SELECT -DNO_CDEFS_H -DNEED_IOCTL_H -DNEED_MATH_H -DUSE_NODL_TABS -DMITSHM -DNEED_SYS_WAIT_H -DHAVE_INT32_T -DNEED_UINT_T -DNEED_H_ERRNO
PDJAVA_FLAGS =
OS_CFLAGS = $(PLATFORM_FLAGS) $(PORT_FLAGS) $(MOVEMAIL_FLAGS)
LOCALE_MAP = $(DEPTH)/cmd/xfe/intl/hpux.lm
EN_LOCALE = american.iso88591
DE_LOCALE = german.iso88591
FR_LOCALE = french.iso88591
JP_LOCALE = japanese.euc
SJIS_LOCALE = japanese
KR_LOCALE = korean
CN_LOCALE = chinese-s
TW_LOCALE = chinese-t.big5
I2_LOCALE = i2
IT_LOCALE = it
SV_LOCALE = sv
ES_LOCALE = es
NL_LOCALE = nl
PT_LOCALE = pt
######################################################################
# Version-specific stuff
######################################################################
ifeq ($(OS_RELEASE),A.09)
OS_LIBS += -L/lib/pa1.1 -lm
ifndef NS_USE_GCC
NO_INLINE = +d
endif
else
PORT_FLAGS += -DHAVE_SNPRINTF
OS_LIBS += -lm
endif
ifeq ($(OS_RELEASE),B.10)
PORT_FLAGS += -DRW_NO_OVERLOAD_SCHAR -DHAVE_MODEL_H
JAVA_PROG = $(CONTRIB_BIN)java
endif
ifeq ($(OS_RELEASE),B.11)
PLATFORM_FLAGS += -DHPUX10
MOTIF_REV = 2.1
endif
######################################################################
# Overrides for defaults in config.mk (or wherever)
######################################################################
ifndef NS_USE_GCC
CC = cc -Ae
CCC = CC -Aa +a1 $(NO_INLINE)
endif
BSDECHO = $(DIST)/bin/bsdecho
DLL_SUFFIX = sl
EMACS = /bin/true
ifdef NETSCAPE_HIERARCHY
PERL = perl5
endif
ifdef BUILD_OPT
ifdef NS_USE_GCC
OPTIMIZER = -O
else
OPTIMIZER = -O +Onolimit
endif
endif
######################################################################
# Other
######################################################################
ifdef MOZ_USE_X11R6
X11_REV = 6
else
X11_REV = 5
endif
ifdef SERVER_BUILD
ifndef NS_USE_GCC
PLATFORM_FLAGS += +DA1.0
endif
PLATFORM_FLAGS += -Wl,-E
endif
ELIBS_CFLAGS = -g -DHAVE_STRERROR
HAVE_PURIFY = 1
MUST_BOOTLEG_ALLOCA = 1
BUILD_UNIX_PLUGINS = 1
MKSHLIB = $(LD) $(DSO_LDOPTS)
DSO_LDOPTS = -b
DSO_LDFLAGS =
ifdef NS_USE_GCC
DSO_CFLAGS = -fPIC
else
DSO_CFLAGS = +Z
endif

185
mozilla/config/IRIX.mk Normal file
View File

@@ -0,0 +1,185 @@
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
######################################################################
# Config stuff for IRIX
######################################################################
#
######################################################################
# Version-independent
######################################################################
ARCH := irix
CPU_ARCH := mips
GFX_ARCH := x
OS_INCLUDES =
G++INCLUDES =
LOC_LIB_DIR = /usr/lib/X11
MOTIF =
MOTIFLIB =
OS_LIBS =
PLATFORM_FLAGS = -DIRIX -DIRIX$(OS_RELEASE)$(subst .,_,$(OS_VERSION))
MOVEMAIL_FLAGS =
PORT_FLAGS = -DSVR4 -DHAVE_LCHOWN -DHAVE_SIGNED_CHAR -DHAVE_FILIO_H -DHAS_PGNO_T -DMITSHM -DHAVE_WAITID -DNEED_VBASE -DNEED_SYS_TIME_H -DHAVE_SYSTEMINFO_H -DNO_JNI_STUBS -D_MIPS_SIM_ABI32
PDJAVA_FLAGS =
ifdef USE_AUTOCONF
OS_CFLAGS =
else
OS_CFLAGS = $(PLATFORM_FLAGS) $(PORT_FLAGS) $(MOVEMAIL_FLAGS)
endif
LOCALE_MAP = $(DEPTH)/cmd/xfe/intl/irix.lm
EN_LOCALE = en_US
DE_LOCALE = de
FR_LOCALE = fr
JP_LOCALE = ja_JP.EUC
SJIS_LOCALE = ja_JP.SJIS
KR_LOCALE = ko_KR.euc
CN_LOCALE = zh_CN.ugb
TW_LOCALE = zh_TW.ucns
I2_LOCALE = i2
IT_LOCALE = it
SV_LOCALE = sv
ES_LOCALE = es
NL_LOCALE = nl
PT_LOCALE = pt
######################################################################
# Version-specific stuff
######################################################################
ifeq ($(OS_RELEASE),6)
#
# The "-woff 131" silences the really noisy 6.x ld's warnings about
# having multiply defined weak symbols.
#
# The "-woff 3247" silences complaints about the "#pragma segment"
# stuff strewn all over db (apparently for Macintoshes).
#
NO_NOISE = -woff 131
ifndef NS_USE_GCC
PLATFORM_FLAGS += -multigot -Wl,-nltgot,170
endif
PORT_FLAGS += -DNO_UINT32_T -DNO_INT64_T -DNEED_BSD_TYPES
SHLIB_LD_OPTS = -no_unresolved
ifeq ($(AWT_11),1)
JAVAC_ZIP = $(NS_LIB)/rt.jar:$(NS_LIB)/dev.jar:$(NS_LIB)/i18n.jar:$(NS_LIB)/tiny.jar
endif
endif
ifndef NS_USE_GCC
CC = cc
CCC = CC -woff 3247
endif
ifeq ($(OS_RELEASE)$(OS_VERSION),5.3)
ifndef NS_USE_GCC
XGOT_FLAG = -xgot
#
# Use gtscc to unbloat the C++ global count.
#
ifdef USE_GTSCC
ifndef NO_GTSCC
XGOT_FLAG =
CCC = $(DIST)/bin/gtscc $(GTSCC_CC_OPTIONS) -gtsfile $(DEPTH)/config/$(OBJDIR)/db.gts -gtsrootdir $(DEPTH)
ifeq ($(findstring modules/,$(SRCDIR)),modules/)
CC = $(DIST)/bin/gtscc $(GTSCC_CC_OPTIONS) -gtsfile $(DEPTH)/config/$(OBJDIR)/db.gts -gtsrootdir $(DEPTH)
endif
ifeq ($(findstring sun-java/,$(SRCDIR)),sun-java/)
CC = $(DIST)/bin/gtscc $(GTSCC_CC_OPTIONS) -gtsfile $(DEPTH)/config/$(OBJDIR)/db.gts -gtsrootdir $(DEPTH)
endif
endif
endif
endif
PLATFORM_FLAGS += $(XGOT_FLAG)
endif
######################################################################
# Overrides for defaults in config.mk (or wherever)
######################################################################
WHOAMI = /bin/whoami
UNZIP_PROG = $(NS_BIN)unzip
ZIP_PROG = $(NS_BIN)zip
ifdef NETSCAPE_HIERARCHY
PERL = perl5
endif
######################################################################
# Other
######################################################################
ifdef NS_USE_GCC
PLATFORM_FLAGS += -Wall -Wno-format
ASFLAGS += -x assembler-with-cpp
ifdef BUILD_OPT
OPTIMIZER = -O6
endif
else
PLATFORM_FLAGS += -32 -fullwarn -xansi -DIRIX_STARTUP_SPEEDUPS
ifdef BUILD_OPT
OPTIMIZER = -O -Olimit 4000
endif
endif
ifndef NO_MDUPDATE
MDUPDATE_FLAGS = -MDupdate $(DEPENDENCIES)
endif
ifeq ($(USE_KERNEL_THREADS),1)
PORT_FLAGS += -DHW_THREADS -D_SGI_MP_SOURCE
else
PORT_FLAGS += -DSW_THREADS
endif
#
# The "o32" calling convention is the default for 5.3 and 6.2.
# According to the SGI dudes, they will migrate to "n32" for 6.5.
# What will we do then?
# If we want to do the same, simply uncomment the line below ..
#
#PORT_FLAGS += -D_MIPS_SIM_NABI32
#
# To get around SGI's problems with the Asian input method.
#
MAIL_IM_HACK = *Mail*preeditType:none
NEWS_IM_HACK = *News*preeditType:none
#
# An nm command which generates an output like:
# archive.a:object.o: 0000003 T symbol
#
NM_PO = nm -Bpo
HAVE_PURIFY = 1
MUST_BOOTLEG_ALLOCA = 1
BUILD_UNIX_PLUGINS = 1
MKSHLIB = $(LD) $(NO_NOISE) $(SHLIB_LD_OPTS) -shared -soname $(@:$(OBJDIR)/%.so=%.so)
DSO_LDOPTS = -elf -shared -all
DSO_LDFLAGS = -nostdlib -L/lib -L/usr/lib -L/usr/lib -lXm -lXt -lX11 -lgen
ifdef DSO_BACKEND
DSO_LDOPTS += -soname $(DSO_NAME)
endif

166
mozilla/config/Linux.mk Normal file
View File

@@ -0,0 +1,166 @@
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
######################################################################
# Config stuff for Linux (all architectures)
######################################################################
#
######################################################################
# Version-independent
######################################################################
ARCH := linux
ifeq (86,$(findstring 86,$(OS_TEST)))
CPU_ARCH := x86
else
ifeq (,$(filter-out sa110,$(OS_TEST)))
CPU_ARCH := arm
else
CPU_ARCH := $(OS_TEST)
endif
endif
GFX_ARCH := x
# Dont do the detect hackery for autoconf builds. It makes them painfully
# slow and its not needed anyway, since autoconf does it much better.
ifndef USE_AUTOCONF
# Include the automagically generated makefile. This generated makefile
# should contain lots of magic paths and flags.
-include $(MOZILLA_DETECT_GEN)
endif # USE_AUTOCONF
OS_INCLUDES = $(MOZILLA_XFE_MOTIF_INCLUDE_FLAGS) $(MOZILLA_XFE_X11_INCLUDE_FLAGS)
G++INCLUDES = -I/usr/include/g++
LOC_LIB_DIR = /usr/lib/X11
MOTIF =
MOTIFLIB =
OS_LIBS = -L/lib -ldl -lc
PLATFORM_FLAGS = -ansi -Wall $(DASH_PIPE) $(DSO_CFLAGS) -DLINUX -Dlinux
MOVEMAIL_FLAGS = -DHAVE_STRERROR
PORT_FLAGS = -D_POSIX_SOURCE -D_BSD_SOURCE -DNEED_ENDIAN_H -DNEED_GETOPT_H -DNEED_IOCTL_H -DUSE_NODL_TABS -DHAVE_SIGNED_CHAR -DNEED_SYS_TIME_H -DHAVE_SYS_BITYPES_H -DNEED_UINT_T -DHAVE_SNPRINTF
PDJAVA_FLAGS = -mx128m
#
# Some systems can't handle -pipe. They can override DASH_PIPE in
# the version-specific section below.
#
DASH_PIPE = -pipe
ifdef USE_AUTOCONF
OS_CFLAGS = #-include $(DEPTH)/include/config.h
else
OS_CFLAGS = $(PLATFORM_FLAGS) $(PORT_FLAGS) $(MOVEMAIL_FLAGS)
endif
LOCALE_MAP = $(topsrcdir)/cmd/xfe/intl/linux.lm
EN_LOCALE = C
DE_LOCALE = de_DE.ISO8859-1
FR_LOCALE = fr_FR.ISO8859-1
JP_LOCALE = ja
SJIS_LOCALE = ja_JP.SJIS
KR_LOCALE = ko_KR.EUC
CN_LOCALE = zh
TW_LOCALE = zh
I2_LOCALE = i2
######################################################################
# Version-specific stuff
######################################################################
ifeq ($(CPU_ARCH),alpha)
PLATFORM_FLAGS += -D__$(CPU_ARCH) -D_ALPHA_ -mieee
PORT_FLAGS += -DNEED_TIME_R -DMITSHM -D_XOPEN_SOURCE
endif
ifeq ($(CPU_ARCH),arm)
DASH_PIPE =
endif
ifeq ($(CPU_ARCH),m68k)
PLATFORM_FLAGS += -m68020-40 -D$(CPU_ARCH)
PORT_FLAGS += -DNEED_TIME_R -DMITSHM -D_XOPEN_SOURCE
endif
ifeq ($(CPU_ARCH),ppc)
PLATFORM_FLAGS += -D$(CPU_ARCH)
PORT_FLAGS += -DNEED_TIME_R -DMITSHM -D_XOPEN_SOURCE
endif
ifeq ($(CPU_ARCH),sparc)
PLATFORM_FLAGS += -D$(CPU_ARCH)
endif
ifeq ($(CPU_ARCH),x86)
PLATFORM_FLAGS += -mno-486 -Di386
PORT_FLAGS += -DNEED_TIME_R -DMITSHM -D_XOPEN_SOURCE
ifdef MOZ_FULLCIRCLE
FC_PLATFORM = LinuxIntel
FC_PLATFORM_DIR = Linux2_x86
endif
endif # x86
# These are CPU_ARCH independent
ifeq ($(OS_RELEASE),1.2)
PORT_FLAGS += -DNEED_SYS_WAIT_H
endif
# Linux 2.x
ifneq (,$(filter 2.0 2.1 2.2,$(OS_RELEASE)))
PORT_FLAGS += -DNO_INT64_T
BUILD_UNIX_PLUGINS = 1
MKSHLIB = $(CC) -shared -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so)
DSO_BIND_REFERENCES = -Wl,-Bsymbolic
ifdef BUILD_OPT
OPTIMIZER = -O2
endif
endif
######################################################################
# Overrides for defaults in config.mk (or wherever)
######################################################################
EMACS = /bin/true
JAVA_PROG = $(JAVA_BIN)java
PERL = /usr/bin/perl
PROCESSOR_ARCHITECTURE = _$(CPU_ARCH)
RANLIB = /usr/bin/ranlib
UNZIP_PROG = /usr/bin/unzip
ZIP_PROG = /usr/bin/zip
######################################################################
# Other
######################################################################
ifeq ($(USE_PTHREADS),1)
PORT_FLAGS += -D_REENTRANT
OS_LIBS += -lpthread
else
PORT_FLAGS += -DSW_THREADS
endif
NEED_XMOS = 1
DSO_CFLAGS = -fPIC
DSO_LDOPTS = -shared
DSO_LDFLAGS =
ifeq ($(USE_JDK11),1)
JAVA_HOME = /usr/local/java
JAVAC_ZIP = $(JAVA_HOME)/lib/classes.zip
endif
ASFLAGS += -x assembler-with-cpp

124
mozilla/config/Makefile Normal file
View File

@@ -0,0 +1,124 @@
# -*- Mode: Makefile -*-
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
DEPTH = ..
HSRCS = pathsub.h
CSRCS = nsinstall.c pathsub.c
ifeq ($(subst /,_,$(shell uname -s)),OS2)
DIRS = os2
LOCAL_INCLUDES += -Ios2
HSRCS += dirent.h getopt.h
endif
PLSRCS = nfspwd.pl revdepth.pl
TARGETS = $(PROGRAM) $(PLSRCS:.pl=)
# Generate the build number on the fly.
ifneq ($(origin BUILD_OFFICIAL)_$(origin MOZILLA_OFFICIAL),undefined_undefined)
TARGETS += $(DEPTH)/build/build_number
endif
# If this is an "official mozilla build" make them shortlived.
ifdef MOZILLA_OFFICIAL
TARGETS += $(DEPTH)/modules/libpref/src/init/all.js
endif
ifneq ($(subst /,_,$(shell uname -s)),WINNT)
PROGRAM = nsinstall$(BIN_SUFFIX)
TARGETS += $(OBJDIR)/bsdecho$(BIN_SUFFIX)
endif
# IMPORTANT: Disable NSBUILDROOT for this directory only, otherwise we have
# a recursive rule for finding nsinstall and the perl scripts
ifdef NSBUILDROOT
override NSBUILDROOT :=
endif
include $(DEPTH)/config/rules.mk
ifeq ($(OS_ARCH)$(OS_RELEASE),SunOS4.1)
INCLUDES += -I../nsprpub/pr/include/md
endif
ifeq ($(OS_ARCH)$(OS_RELEASE),IRIX5)
TARGETS += $(OBJDIR)/gtscc$(BIN_SUFFIX)
endif
# Redefine MAKE_OBJDIR for just this directory
define MAKE_OBJDIR
if test ! -d $(@D); then rm -rf $(@D); mkdir $(@D); else true; fi
endef
export:: $(TARGETS)
ifeq ($(OS_ARCH),OS2)
# could not get bsdecho rules to work implicitly, so here is explicit ones
$(OBJDIR)/bsdecho.o: bsdecho.c
@$(MAKE_OBJDIR)
$(CC) -Fo$@ $(CFLAGS) -c $<
$(OBJDIR)/bsdecho$(BIN_SUFFIX): $(OBJDIR)/bsdecho.o
@$(MAKE_OBJDIR)
$(LINK_EXE) -OUT:$@ $< $(LDFLAGS)
$(INSTALL) -m 444 $@ $(DIST)/bin
else
$(OBJDIR)/bsdecho$(BIN_SUFFIX): $(OBJDIR)/bsdecho.o
@$(MAKE_OBJDIR)
$(CCF) $(LDFLAGS) -o $@ $<
$(INSTALL) -m 444 $@ $(DIST)/bin
endif
$(OBJDIR)/gtscc$(BIN_SUFFIX): $(OBJDIR)/gtscc.o
@$(MAKE_OBJDIR)
$(CCF) $(LDFLAGS) -o $@ $< -lelf
$(INSTALL) -m 444 $@ $(DIST)/bin
#update build number from within make script
$(DEPTH)/build/build_number: FORCE
$(RM) $@
$(PERL) bdate.pl > $@
$(PERL) aboutime.pl $(DEPTH)/l10n/us/xp/about-all.html $@
$(DEPTH)/modules/libpref/src/init/all.js: FORCE
$(PERL) set-timebomb.pl 0 30
$(OBJDIR)/bdate$(BIN_SUFFIX): $(OBJDIR)/bdate.o
@$(MAKE_OBJDIR)
$(CCF) $(LDFLAGS) -o $@ $<
$(INSTALL) -m 444 $@ $(DIST)/bin
FORCE:
ifdef MKDEPEND_DIR
clean clobber realclean clobber_all::
cd $(MKDEPEND_DIR); $(MAKE) $@
endif
ifdef MOZILLA_DETECT
clean clobber realclean clobber_all::
cd $(MOZILLA_DETECT_DIR); $(MAKE) $@
endif
# For the continuous build scripts.
show_objname:
@echo $(OBJDIR)
.PHONY: show_objname

134
mozilla/config/Makefile.in Normal file
View File

@@ -0,0 +1,134 @@
# -*- Mode: Makefile -*-
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
DEPTH = ..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
HSRCS = pathsub.h
CSRCS = nsinstall.c pathsub.c
ifeq ($(subst /,_,$(shell uname -s)),OS2)
DIRS = os2
LOCAL_INCLUDES += -Ios2
HSRCS += dirent.h getopt.h
endif
PLSRCS = nfspwd.pl revdepth.pl
TARGETS = $(PROGRAM) $(PLSRCS:.pl=)
# Generate the build number on the fly.
ifneq ($(origin BUILD_OFFICIAL)_$(origin MOZILLA_OFFICIAL),undefined_undefined)
TARGETS += $(DEPTH)/build/build_number
endif
# If this is an "official mozilla build" make them shortlived.
ifdef MOZILLA_OFFICIAL
TARGETS += $(DEPTH)/modules/libpref/src/init/all.js
endif
ifneq ($(subst /,_,$(shell uname -s)),WINNT)
PROGRAM = nsinstall$(BIN_SUFFIX)
TARGETS += $(OBJDIR)/bsdecho$(BIN_SUFFIX)
endif
DISTTARGETS = $(DIST)/bin/bsdecho$(BINSUFFIX)
# IMPORTANT: Disable NSBUILDROOT for this directory only, otherwise we have
# a recursive rule for finding nsinstall and the perl scripts
ifdef NSBUILDROOT
override NSBUILDROOT :=
endif
include $(topsrcdir)/config/rules.mk
ifeq ($(OS_ARCH)$(OS_RELEASE),SunOS4.1)
INCLUDES += -I$(srcdir)/../nsprpub/pr/include/md
endif
ifeq ($(OS_ARCH)$(OS_RELEASE),IRIX5)
TARGETS += $(OBJDIR)/gtscc$(BIN_SUFFIX)
endif
# Redefine MAKE_OBJDIR for just this directory
define MAKE_OBJDIR
if test ! -d $(@D); then rm -rf $(@D); mkdir $(@D); fi
endef
export:: $(TARGETS) $(DISTTARGETS)
ifeq ($(OS_ARCH),OS2)
# could not get bsdecho rules to work implicitly, so here is explicit ones
$(OBJDIR)/bsdecho.o: bsdecho.c
@$(MAKE_OBJDIR)
$(CC) -Fo$@ $(CFLAGS) -c $<
$(OBJDIR)/bsdecho$(BIN_SUFFIX): $(OBJDIR)/bsdecho.o
@$(MAKE_OBJDIR)
$(LINK_EXE) -OUT:$@ $< $(LDFLAGS)
else
$(OBJDIR)/bsdecho$(BIN_SUFFIX): $(OBJDIR)/bsdecho.o
@$(MAKE_OBJDIR)
$(CCF) $(LDFLAGS) -o $@ $<
endif
# Artificial target to make parallel builds play nice
$(DIST)/bin/bsdecho$(BIN_SUFFIX): $(OBJDIR)/nsinstall$(BINSUFFIX) $(OBJDIR)/bsdecho$(BINSUFFIX)
$(INSTALL) -m 444 $@ $(DIST)/bin
$(OBJDIR)/gtscc$(BIN_SUFFIX): $(OBJDIR)/gtscc.o
@$(MAKE_OBJDIR)
$(CCF) $(LDFLAGS) -o $@ $< -lelf
$(INSTALL) -m 444 $@ $(DIST)/bin
#update build number from within make script
$(DEPTH)/build/build_number: FORCE
@$(MAKE_OBJDIR)
$(RM) $@
$(PERL) $(srcdir)/bdate.pl > $@
$(PERL) $(srcdir)/aboutime.pl $(topsrcdir)/l10n/us/xp/about-all.html $@
$(DEPTH)/modules/libpref/src/init/all.js: FORCE
$(PERL) $(srcdir)/set-timebomb.pl 0 30
$(OBJDIR)/bdate$(BIN_SUFFIX): $(OBJDIR)/bdate.o
@$(MAKE_OBJDIR)
$(CCF) $(LDFLAGS) -o $@ $<
$(INSTALL) -m 444 $@ $(DIST)/bin
FORCE:
ifdef MKDEPEND_DIR
clean clobber realclean clobber_all::
cd $(MKDEPEND_DIR); $(MAKE) $@
endif
ifdef MOZILLA_DETECT
clean clobber realclean clobber_all::
cd $(MOZILLA_DETECT_DIR); $(MAKE) $@
endif
# For the continuous build scripts.
show_objname:
@echo $(OBJDIR)
.PHONY: show_objname

90
mozilla/config/NCR.mk Normal file
View File

@@ -0,0 +1,90 @@
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
######################################################################
# Config stuff for NCR SVR4 MP-RAS
######################################################################
#
######################################################################
# Version-independent
######################################################################
ARCH := ncr
CPU_ARCH := x86
GFX_ARCH := x
OS_INCLUDES = -I/usr/X/include
G++INCLUDES =
LOC_LIB_DIR = /usr/X/lib
MOTIF =
MOTIFLIB = -lXm
OS_LIBS =
PLATFORM_FLAGS = -DNCR -D_ATT4 -Di386
MOVEMAIL_FLAGS = -DUSG -DHAVE_STRERROR
PORT_FLAGS = -DSVR4 -DSYSV -DSW_THREADS -DHAVE_FILIO_H -DHAVE_LCHOWN -DNEED_S_ISLNK -DNEED_S_ISSOCK -DSYS_ENDIAN_H -DSYS_BYTEORDER_H -DUSE_NODL_TABS -DMITSHM -DHAVE_WAITID -DHAVE_NETINET_IN_H -DHAVE_REMAINDER -DHAVE_SYS_BITYPES_H -DPRFSTREAMS_BROKEN
PDJAVA_FLAGS =
ifdef USE_AUTOCONF
OS_CFLAGS =
else
OS_CFLAGS = $(PLATFORM_FLAGS) $(PORT_FLAGS) $(MOVEMAIL_FLAGS)
endif
LOCALE_MAP =
EN_LOCALE = C
DE_LOCALE = de_DE.ISO8859-1
FR_LOCALE = fr_FR.ISO8859-1
JP_LOCALE = ja
SJIS_LOCALE = ja_JP.SJIS
KR_LOCALE = ko_KR.EUC
CN_LOCALE = zh
TW_LOCALE = zh
I2_LOCALE = i2
######################################################################
# Version-specific stuff
######################################################################
######################################################################
# Overrides for defaults in config.mk (or wherever)
######################################################################
EMACS = /bin/true
PERL = $(LOCAL_BIN)perl
WHOAMI = /usr/ucb/whoami
######################################################################
# Other
######################################################################
ifdef NS_USE_NATIVE
CC = cc
CCC = ncc
PLATFORM_FLAGS += -Hnocopyr
OS_LIBS += -L/opt/ncc/lib
else
PLATFORM_FLAGS += -Wall
OS_LIBS += -lsocket -lnsl -lresolv -ldl
endif
BUILD_UNIX_PLUGINS = 1
MKSHLIB = $(LD) $(DSO_LDOPTS)
DSO_LDOPTS = -G
DSO_LDFLAGS = -lXm -lXt -lX11 -lsocket -lnsl -lgen

85
mozilla/config/NEC.mk Normal file
View File

@@ -0,0 +1,85 @@
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
######################################################################
# Config stuff for NEC EWS-UX/V
######################################################################
#
######################################################################
# Version-independent
######################################################################
ARCH := nec
CPU_ARCH := mips
GFX_ARCH := x
OS_INCLUDES =
G++INCLUDES =
LOC_LIB_DIR = /usr/lib/X11
MOTIF =
MOTIFLIB = -L/usr/lib -lXm
OS_LIBS = -lsocket -lnsl -ldl -L/usr/ucblib -lc -lucb
PLATFORM_FLAGS = -DNEC -Dnec_ews -DNECSVR4 -D__SVR4
MOVEMAIL_FLAGS = -DUSG -DHAVE_STRERROR
PORT_FLAGS = -DSVR4 -DSW_THREADS -DHAVE_FILIO_H -DHAVE_LCHOWN -DNEED_S_ISLNK -DNEED_CDEFS_H -DNO_LONG_LONG -DSYS_BYTEORDER_H -DMITSHM -DHAVE_NETINET_IN_H -DHAVE_ARPA_NAMESER_H
PDJAVA_FLAGS =
ifdef USE_AUTOCONF
OS_CFLAGS =
else
OS_CFLAGS = $(PLATFORM_FLAGS) $(PORT_FLAGS) $(MOVEMAIL_FLAGS)
endif
LOCALE_MAP = $(DEPTH)/cmd/xfe/intl/nec.lm
EN_LOCALE = C
DE_LOCALE = de_DE.ISO8859-1
FR_LOCALE = fr_FR.ISO8859-1
JP_LOCALE = ja_JP.EUC
SJIS_LOCALE = ja_JP.SJIS
KR_LOCALE = ko_KR.EUC
CN_LOCALE = zh_CN.ugb
TW_LOCALE = zh_TW.ucns
I2_LOCALE = i2
######################################################################
# Version-specific stuff
######################################################################
######################################################################
# Overrides for defaults in config.mk (or wherever)
######################################################################
ifndef NS_USE_GCC
CC = $(DEPTH)/build/hcc -Xa -KGnum=0 -KOlimit=4000
endif
BSDECHO = /usr/ucb/echo
EMACS = /bin/true
PERL = $(LOCAL_BIN)perl
WHOAMI = /usr/ucb/whoami
######################################################################
# Other
######################################################################
BUILD_UNIX_PLUGINS = 1
MKSHLIB = $(LD) $(DSO_LDOPTS)
DSO_LDOPTS = -G
DSO_LDFLAGS =

82
mozilla/config/NEWS-OS.mk Normal file
View File

@@ -0,0 +1,82 @@
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
######################################################################
# Config stuff for Sony NEWS-OS
######################################################################
#
######################################################################
# Version-independent
######################################################################
ARCH := sony
CPU_ARCH := mips
GFX_ARCH := x
OS_INCLUDES = -I/usr/include
G++INCLUDES =
LOC_LIB_DIR = /usr/lib/X11
MOTIF =
MOTIFLIB = -L/usr/lib -lXm
OS_LIBS = -lsocket -lnsl -lgen -lresolv
PLATFORM_FLAGS = -Xa -fullwarn -DSONY
MOVEMAIL_FLAGS = -DHAVE_STRERROR
PORT_FLAGS = -DSYSV -DSVR4 -D__svr4 -D__svr4__ -DSW_THREADS -DHAVE_INT32_T -DHAVE_STDDEF_H -DHAVE_STDLIB_H -DHAVE_FILIO_H -DSYS_BYTEORDER_H -DNO_CDEFS_H -DHAVE_LCHOWN -DHAS_PGNO_T -DNO_MULTICAST
PDJAVA_FLAGS =
ifdef USE_AUTOCONF
OS_CFLAGS =
else
OS_CFLAGS = $(PLATFORM_FLAGS) $(PORT_FLAGS) $(MOVEMAIL_FLAGS)
endif
LOCALE_MAP =
EN_LOCALE = C
DE_LOCALE = de_DE.ISO8859-1
FR_LOCALE = fr_FR.ISO8859-1
JP_LOCALE = ja.JP.EUC
SJIS_LOCALE = ja_JP.SJIS
KR_LOCALE = ko_KR.EUC
CN_LOCALE = zh_CN.ugb
TW_LOCALE = zh_TW.ucns
I2_LOCALE = i2
######################################################################
# Version-specific stuff
######################################################################
######################################################################
# Overrides for defaults in config.mk (or wherever)
######################################################################
BSDECHO = /usr/ucb/echo
CC = cc
CCC = CC
EMACS = /bin/true
PERL = /bin/true
######################################################################
# Other
######################################################################
BUILD_UNIX_PLUGINS = 1
MKSHLIB = $(LD) $(DSO_LDOPTS)
DSO_LDOPTS = -G
DSO_LDFLAGS =

View File

@@ -0,0 +1,67 @@
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
######################################################################
# Config stuff for NEXTSTEP
######################################################################
#
######################################################################
# Version-independent
######################################################################
ARCH := nextstep
CPU_ARCH := m68k
GFX_ARCH := x
OS_INCLUDES =
G++INCLUDES =
LOC_LIB_DIR =
MOTIF =
MOTIFLIB =
OS_LIBS =
PLATFORM_FLAGS = -Wall -Wno-format -DNEXTSTEP -DNEXTSTEP$(basename $(OS_RELEASE)) -DNEXTSTEP$(subst .,,$(OS_RELEASE)) -DRHAPSODY -D_NEXT_SOURCE
MOVEMAIL_FLAGS = -DHAVE_STRERROR
PORT_FLAGS = -DSW_THREADS -DNO_CDEFS_H -DNO_REGEX -DNEED_BSDREGEX -DNO_REGCOMP -DHAS_PGNO_T -DNO_MULTICAST -DNO_TZNAME -D_POSIX_SOURCE -DNEED_S_ISLNK -DNEEDS_GETCWD -DNO_X11
PDJAVA_FLAGS =
ifdef USE_AUTOCONF
OS_CFLAGS =
else
OS_CFLAGS = $(PLATFORM_FLAGS) $(PORT_FLAGS) $(MOVEMAIL_FLAGS)
endif
######################################################################
# Version-specific stuff
######################################################################
######################################################################
# Overrides for defaults in config.mk (or wherever)
######################################################################
CC = cc
CCC = c++
EMACS = /bin/true
PERL = /usr/bin/perl
AR = /bin/libtool -static -o $@
RANLIB = /bin/true
WHOAMI = /usr/ucb/whoami
######################################################################
# Other
######################################################################

104
mozilla/config/NetBSD.mk Normal file
View File

@@ -0,0 +1,104 @@
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
######################################################################
# Config stuff for NetBSD
######################################################################
#
######################################################################
# Version-independent
######################################################################
ARCH := netbsd
ifeq (86,$(findstring 86,$(OS_TEST)))
CPU_ARCH := x86
else
CPU_ARCH := $(OS_TEST)
endif
GFX_ARCH := x
OS_INCLUDES = -I/usr/X11R6/include
G++INCLUDES = -I/usr/include/g++
LOC_LIB_DIR =
MOTIF =
MOTIFLIB =
OS_LIBS =
# Don't define BSD, because it's already defined in /usr/include/sys/param.h.
PLATFORM_FLAGS = -DNETBSD $(DSO_CFLAGS)
MOVEMAIL_FLAGS = -DHAVE_STRERROR
PORT_FLAGS = -DSW_THREADS -DNEED_UINT -DHAVE_LCHOWN -DNTOHL_ENDIAN_H -DHAVE_FILIO_H -DNEED_SYS_TIME_H -DNEED_UINT_T -DHAVE_BSD_FLOCK
PDJAVA_FLAGS = -mx128m
OS_GPROF_FLAGS = -pg
LD_FLAGS = -L/usr/X11R6/lib -lXm
ifdef USE_AUTOCONF
OS_CFLAGS =
else
OS_CFLAGS = $(PLATFORM_FLAGS) $(PORT_FLAGS) $(MOVEMAIL_FLAGS)
endif
LOCALE_MAP = $(DEPTH)/cmd/xfe/intl/bsd386.lm
EN_LOCALE = C
DE_LOCALE = de_DE.ISO8859-1
FR_LOCALE = fr_FR.ISO8859-1
JP_LOCALE = ja
SJIS_LOCALE = ja_JP.SJIS
KR_LOCALE = ko_KR.EUC
CN_LOCALE = zh
TW_LOCALE = zh
I2_LOCALE = i2
######################################################################
# Version-specific stuff
######################################################################
######################################################################
# Overrides for defaults in config.mk (or wherever)
######################################################################
DLL_SUFFIX = so.1.0
EMACS = /usr/bin/true
JAVA_PROG = $(JAVA_BIN)java
RANLIB = /usr/bin/ranlib
######################################################################
# Other
######################################################################
ifeq ($(USE_PTHREADS),1)
OS_LIBS = -lc_r
else
OS_LIBS = -lc
PORT_FLAGS += -D_PR_LOCAL_THREADS_ONLY
endif
BUILD_UNIX_PLUGINS = 1
MKSHLIB = $(LD) $(DSO_LDOPTS)
DSO_CFLAGS = -fPIC
DSO_LDFLAGS =
#
# For NetBSD > 1.3, this can all be -shared.
#
ifneq (,$(filter alpha mips pmax,$(CPU_ARCH)))
DSO_LDOPTS = -shared
else
DSO_LDOPTS = -Bshareable
endif

111
mozilla/config/OSF1.mk Normal file
View File

@@ -0,0 +1,111 @@
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
######################################################################
# Config stuff for DEC OSF/1 (Digital UNIX)
######################################################################
#
######################################################################
# Version-independent
######################################################################
ARCH := dec
CPU_ARCH := alpha
GFX_ARCH := x
OS_INCLUDES =
G++INCLUDES =
LOC_LIB_DIR = /usr/lib/X11
MOTIF =
MOTIFLIB =
OS_LIBS =
PLATFORM_FLAGS = $(MOZ_TASO) -D_ALPHA_ -DIS_64 -DOSF1 -DOSF1$(OS_RELEASE)
MOVEMAIL_FLAGS =
PORT_FLAGS = -D_REENTRANT -DHAVE_LCHOWN -DNEED_CDEFS_H -DNTOHL_ENDIAN_H -DNEED_IOCTL_H -DMACHINE_ENDIAN_H -DHAVE_VA_LIST_STRUCT -DNEED_BYTE_ALIGNMENT -DMITSHM -DNEED_REALPATH -DHAVE_WAITID -DNEED_H_ERRNO -DNEED_SYS_TIME_H -DHAVE_SYSTEMINFO_H -DNEED_SYS_PARAM_H -DHAVE_INT32_T -DODD_VA_START -DHAVE_REMAINDER
PDJAVA_FLAGS = -mx32m
ifdef USE_AUTOCONF
OS_CFLAGS =
else
OS_CFLAGS = $(PLATFORM_FLAGS) $(PORT_FLAGS) $(MOVEMAIL_FLAGS)
endif
LOCALE_MAP = $(DEPTH)/cmd/xfe/intl/osf1.lm
EN_LOCALE = en_US.ISO8859-1
DE_LOCALE = de_DE.ISO8859-1
FR_LOCALE = fr_FR.ISO8859-1
JP_LOCALE = ja_JP.eucJP
SJIS_LOCALE = ja_JP.SJIS
KR_LOCALE = ko_KR.eucKR
CN_LOCALE = zh_CN
TW_LOCALE = zh_TW.eucTW
I2_LOCALE = i2
IT_LOCALE = it
SV_LOCALE = sv
ES_LOCALE = es
NL_LOCALE = nl
PT_LOCALE = pt
######################################################################
# Version-specific stuff
######################################################################
ifeq ($(OS_RELEASE),V2)
PORT_FLAGS += -DNEED_TIME_R
else
OS_LIBS += -lrt -lc_r
endif
######################################################################
# Overrides for defaults in config.mk (or wherever)
######################################################################
AR = ar rcl $@
CC = cc -ieee_with_inexact -std1
CCC = cxx -ieee_with_inexact -msg_quiet
SHELL = /usr/bin/ksh
WHOAMI = /bin/whoami
UNZIP_PROG = $(NS_BIN)unzip
ZIP_PROG = $(NS_BIN)zip
######################################################################
# Other
######################################################################
ifdef BUILD_OPT
OPTIMIZER += -Olimit 4000
endif
# Only needed when building the Netscape commercial version.
ifdef NETSCAPE_HIERARCHY
MOZ_TASO = -taso
endif
ifeq ($(USE_PTHREADS),1)
PLATFORM_FLAGS += -pthread
OS_LIBS += -lpthread
else
PORT_FLAGS += -DSW_THREADS
endif
BUILD_UNIX_PLUGINS = 1
MKSHLIB = $(LD) $(DSO_LDOPTS)
DSO_LDOPTS = -shared -all -expect_unresolved "*"
DSO_LDFLAGS = -lXm -lXt -lX11 -lc

98
mozilla/config/OpenBSD.mk Normal file
View File

@@ -0,0 +1,98 @@
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
######################################################################
# Config stuff for OpenBSD
######################################################################
#
######################################################################
# Version-independent
######################################################################
ARCH := openbsd
ifeq (86,$(findstring 86,$(OS_TEST)))
CPU_ARCH := x86
else
CPU_ARCH := $(OS_TEST)
endif
GFX_ARCH := x
OS_INCLUDES = -I/usr/X11R6/include
G++INCLUDES = -I/usr/include/g++
LOC_LIB_DIR =
MOTIF =
MOTIFLIB =
OS_LIBS =
PLATFORM_FLAGS = -DOPENBSD $(DSO_CFLAGS)
MOVEMAIL_FLAGS = -DHAVE_STRERROR
PORT_FLAGS = -DSW_THREADS -DNEED_UINT -DHAVE_LCHOWN -DNTOHL_ENDIAN_H -DHAVE_FILIO_H -DNEED_SYS_TIME_H -DNEED_UINT_T -DHAVE_BSD_FLOCK
PDJAVA_FLAGS = -mx128m
OS_GPROF_FLAGS = -pg
LD_FLAGS = -L/usr/X11R6/lib -lXm
OS_CFLAGS = $(PLATFORM_FLAGS) $(PORT_FLAGS) $(MOVEMAIL_FLAGS)
LOCALE_MAP = $(DEPTH)/cmd/xfe/intl/bsd386.lm
EN_LOCALE = C
DE_LOCALE = de_DE.ISO8859-1
FR_LOCALE = fr_FR.ISO8859-1
JP_LOCALE = ja
SJIS_LOCALE = ja_JP.SJIS
KR_LOCALE = ko_KR.EUC
CN_LOCALE = zh
TW_LOCALE = zh
I2_LOCALE = i2
######################################################################
# Version-specific stuff
######################################################################
######################################################################
# Overrides for defaults in config.mk (or wherever)
######################################################################
DLL_SUFFIX = so.1.0
EMACS = /usr/bin/true
JAVA_PROG = $(JAVA_BIN)java
RANLIB = /usr/bin/ranlib
######################################################################
# Other
######################################################################
ifeq ($(USE_PTHREADS),1)
OS_LIBS = -lc_r
else
OS_LIBS = -lc
PORT_FLAGS += -D_PR_LOCAL_THREADS_ONLY
endif
BUILD_UNIX_PLUGINS = 1
MKSHLIB = $(LD) $(DSO_LDOPTS)
DSO_CFLAGS = -fPIC
DSO_LDFLAGS =
# not all arch's support shared libs
#
ifneq (,$(filter alpha mips pmax,$(CPU_ARCH)))
DSO_LDOPTS = -shared
else
DSO_LDOPTS = -Bshareable
endif

66
mozilla/config/QNX.mk Normal file
View File

@@ -0,0 +1,66 @@
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
######################################################################
# Config stuff for QNX.
######################################################################
######################################################################
# Version-independent
######################################################################
ARCH := qnx
CPU_ARCH := x86
GFX_ARCH := x
ifndef NS_USE_GCC
CC = cc
CCC = cc
endif
BSDECHO = echo
EMACS = true
RANLIB = true
OS_INCLUDES = -I/usr/X11/include
G++INCLUDES =
LOC_LIB_DIR =
MOTIF =
MOTIFLIB = -lXm
OS_LIBS =
PLATFORM_FLAGS = -DQNX -Di386
MOVEMAIL_FLAGS = -DHAVE_STRERROR
PORT_FLAGS = -DSW_THREADS -DHAVE_STDDEF_H -DHAVE_STDLIB_H -DNO_CDEFS_H -DNO_LONG_LONG -DNO_ALLOCA -DNO_REGEX -DNO_REGCOMP -DHAS_PGNO_T -DNEED_REALPATH
PDJAVA_FLAGS =
OS_CFLAGS = $(PLATFORM_FLAGS) $(PORT_FLAGS) $(MOVEMAIL_FLAGS)
######################################################################
# Version-specific stuff
######################################################################
######################################################################
# Overrides for defaults in config.mk (or wherever)
######################################################################
######################################################################
# Other
######################################################################
ifdef SERVER_BUILD
STATIC_JAVA = yes
endif

111
mozilla/config/Rhapsody.mk Normal file
View File

@@ -0,0 +1,111 @@
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
######################################################################
# Config stuff for Rhapsody
######################################################################
#
######################################################################
# Version-independent
######################################################################
ARCH := rhapsody
ifeq (86,$(findstring 86,$(OS_TEST)))
CPU_ARCH := i386
else
CPU_ARCH := ppc
endif
GFX_ARCH :=
OS_INCLUDES =
G++INCLUDES = -I/usr/include/g++
LOC_LIB_DIR =
MOTIF =
MOTIFLIB =
OS_LIBS = -lstdc++
PLATFORM_FLAGS = -Wall -pipe -DRHAPSODY -D$(CPU_ARCH)
MOVEMAIL_FLAGS = -DHAVE_STRERROR
PORT_FLAGS = -DSW_THREADS -DHAVE_STDDEF_H -DHAVE_STDLIB_H -DHAVE_FILIO_H -DNTOHL_ENDIAN_H -DMACHINE_ENDIAN_H -DNO_REGEX -DNO_REGCOMP -DHAS_PGNO_T -DNO_TZNAME -DNEEDS_GETCWD -DHAVE_SYSERRLIST
PDJAVA_FLAGS =
# "Commons" are tentative definitions in a global scope, like this:
# int x;
# The meaning of a common is ambiguous. It may be a true definition:
# int x = 0;
# or it may be a declaration of a symbol defined in another file:
# extern int x;
# Use the -fno-common option to force all commons to become true
# definitions so that the linker can catch multiply-defined symbols.
# Also, common symbols are not allowed with Rhapsody dynamic libraries.
DSO_FLAGS = -fno-common
# Build Mozilla/X11 version, else build NGLayout/ybfe.
ifdef HAVE_X11
OS_INCLUDES += -I/usr/X11R6/include
OS_LIBS += -L/usr/X11R6/lib -lXm -lXt -lXext -lX11
PORT_FLAGS +=
else
PORT_FLAGS += -DNO_X11
NO_X11 = 1
endif
ifdef USE_AUTOCONF
OS_CFLAGS = $(DSO_FLAGS)
else
OS_CFLAGS = $(PLATFORM_FLAGS) $(DSO_FLAGS) $(PORT_FLAGS) $(MOVEMAIL_FLAGS)
endif
######################################################################
# Version-specific stuff
######################################################################
ifeq ($(CPU_ARCH),i386)
PLATFORM_FLAGS += -mno-486
endif
######################################################################
# Overrides for defaults in config.mk (or wherever)
######################################################################
# 5.1 renamed cc++ to c++.
ifeq ($(OS_RELEASE),5.0)
CCC = cc++
else
CCC = c++
endif
CC = cc
AR = libtool -static -o $@
EMACS = /usr/bin/emacs
PERL = /usr/bin/perl
RANLIB = ranlib
LDFLAGS =
# -nostdlib gets around the missing -lm problem.
DSO_LDFLAGS = -arch $(CPU_ARCH) -dynamiclib -nostdlib -lstdc++ -lcc_dynamic -compatibility_version 1 -current_version 1 -all_load -undefined suppress
# Comment out MKSHLIB to build only static libraries.
MKSHLIB = $(CC) $(DSO_LDFLAGS)
DLL_SUFFIX = dylib
######################################################################
# Other
######################################################################

98
mozilla/config/SCOOS.mk Normal file
View File

@@ -0,0 +1,98 @@
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
######################################################################
# Config stuff for SCO OpenServer
######################################################################
#
######################################################################
# Version-independent
######################################################################
ARCH := sco_os
CPU_ARCH := x86
GFX_ARCH := x
OS_INCLUDES = -I/usr/include/X11
G++INCLUDES =
LOC_LIB_DIR = /usr/lib/X11
MOTIF =
MOTIFLIB = -lXm
OS_LIBS = -lpmapi -lsocket
PLATFORM_FLAGS = -DSCO -Dsco -DSCO_SV -Di386
MOVEMAIL_FLAGS = -DUSG -DHAVE_STRERROR
PORT_FLAGS = -DSYSV -DSW_THREADS -DNO_SIGNED -DNEED_SOCKET_H -DNEED_S_ISLNK -DNO_LONG_LONG -DNEED_S_ISSOCK -DNEED_MATH_H -DSYS_BYTEORDER_H -DHAVE_BITYPES_H -DUSE_NODL_TABS -DMOTIF_WARNINGS_UPSET_JAVA -DMITSHM -DNO_ID_T -DHAVE_WAITID -DHAVE_SYS_NETINET_IN_H -DHAVE_REMAINDER -DNEED_SYS_SELECT_H -DHAVE_SYS_BITYPES_H -DNEED_H_ERRNO -DHAVE_SNPRINTF
PDJAVA_FLAGS =
ifdef USE_AUTOCONF
OS_CFLAGS =
else
OS_CFLAGS = $(PLATFORM_FLAGS) $(PORT_FLAGS) $(MOVEMAIL_FLAGS)
endif
LOCALE_MAP = $(DEPTH)/cmd/xfe/intl/sco.lm
EN_LOCALE = C
DE_LOCALE = de_DE.ISO8859-1
FR_LOCALE = fr_FR.ISO8859-1
JP_LOCALE = ja
SJIS_LOCALE = ja_JP.SJIS
KR_LOCALE = ko_KR.EUC
CN_LOCALE = zh
TW_LOCALE = zh
I2_LOCALE = i2
######################################################################
# Version-specific stuff
######################################################################
######################################################################
# Overrides for defaults in config.mk (or wherever)
######################################################################
BSDECHO = /bin/echo
CC = cc -b elf -K pic
CCC = $(DEPTH)/build/hcpp +.cpp +d
EMACS = /bin/true
WHOAMI = $(LOCAL_BIN)whoami
UNZIP_PROG = $(CONTRIB_BIN)unzip
ZIP_PROG = $(CONTRIB_BIN)zip
######################################################################
# Other
######################################################################
#
# -DSCO_PM - Policy Manager AKA: SCO Licensing
# Only (supposedly) needed for the RTM builds.
#
ifdef NEED_SCO_PM
PLATFORM_FLAGS += -DSCO_PM
endif
ifeq ($(USE_PTHREADS),1)
#PORT_FLAGS += -D_PR_NEED_FAKE_POLL
else
PORT_FLAGS += -D_PR_LOCAL_THREADS_ONLY
endif
BUILD_UNIX_PLUGINS = 1
MKSHLIB = $(LD) $(DSO_LDOPTS)
DSO_LDOPTS = -G -b elf -d y
DSO_LDFLAGS =

122
mozilla/config/SINIX.mk Normal file
View File

@@ -0,0 +1,122 @@
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
######################################################################
# Config stuff for SNI SINIX (aka ReliantUNIX)
######################################################################
#
######################################################################
# Version-independent
######################################################################
ARCH := sinix
ifeq (86,$(findstring 86,$(OS_TEST)))
CPU_ARCH := x86
else
CPU_ARCH := mips
endif
GFX_ARCH := x
OS_INCLUDES =
G++INCLUDES =
LOC_LIB_DIR = /usr/lib/locale
MOTIF =
MOTIFLIB = -lXm
OS_LIBS = -lsocket -lnsl -lgen -lm -ldl -lresolv -lc -L/usr/ucblib -lucb
PLATFORM_FLAGS = -DSNI -Dsinix
MOVEMAIL_FLAGS = -DUSG
PORT_FLAGS = -DSVR4 -DHAVE_FILIO_H -DNEED_S_ISSOCK -DNEED_TIMEVAL -DNEED_SELECT_H -DHAVE_LCHOWN -DNEED_S_ISLNK -DNEED_FCHMOD_PROTO -DNO_CDEFS_H -DSYS_BYTEORDER_H -DUSE_NODL_TABS -DMITSHM -DNO_MULTICAST -DHAVE_NETINET_IN_H -DHAVE_INT32_T
PDJAVA_FLAGS =
ifdef USE_AUTOCONF
OS_CFLAGS =
else
OS_CFLAGS = $(PLATFORM_FLAGS) $(PORT_FLAGS) $(MOVEMAIL_FLAGS)
endif
LOCALE_MAP = $(DEPTH)/cmd/xfe/intl/sinix.lm
EN_LOCALE = en_US.88591
DE_LOCALE = de_DE.88591
FR_LOCALE = fr_FR.88591
JP_LOCALE = ja_JP.EUC
SJIS_LOCALE = ja_JP.SJIS
KR_LOCALE = ko_KR.euc
CN_LOCALE = zh_CN.ugb
TW_LOCALE = zh_TW.ucns
I2_LOCALE = i2
IT_LOCALE = it_IT.88591
SV_LOCALE = sv_SV.88591
ES_LOCALE = es_ES.88591
NL_LOCALE = nl_NL.88591
PT_LOCALE = pt_PT.88591
######################################################################
# Version-specific stuff
######################################################################
ifeq ($(CPU_ARCH),x86)
PLATFORM_FLAGS += -Di386
endif
######################################################################
# Overrides for defaults in config.mk (or wherever)
######################################################################
BSDECHO = /usr/ucb/echo
EMACS = /bin/true
WHOAMI = /usr/ucb/whoami
PERL = $(LOCAL_BIN)perl
PROCESSOR_ARCHITECTURE = _$(CPU_ARCH)
######################################################################
# Other
######################################################################
ifdef NS_USE_NATIVE
CC = cc
CCC = CC
ifneq ($(CPU_ARCH),x86)
PLATFORM_FLAGS += -fullwarn -xansi
endif
ifdef BUILD_OPT
OPTIMIZER = -Olimit 4000
endif
else
PLATFORM_FLAGS += -Wall -Wno-format
ifneq ($(CPU_ARCH),x86)
PLATFORM_FLAGS += -pipe
endif
ASFLAGS += -x assembler-with-cpp
ifdef BUILD_OPT
OPTIMIZER = -O
else
OPTIMIZER = -gdwarf
JAVA_OPTIMIZER = -gdwarf
endif
endif
ifneq ($(USE_KERNEL_THREADS),1)
PORT_FLAGS += -DSW_THREADS
endif
BUILD_UNIX_PLUGINS = 1
MKSHLIB = $(LD) $(DSO_LDOPTS)
DSO_LDOPTS = -G
DSO_LDFLAGS = $(MOTIFLIB) -lXt -lX11 $(OS_LIBS)

25
mozilla/config/SunOS.mk Normal file
View File

@@ -0,0 +1,25 @@
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
#
# Config stuff for SunOS. 4 and 5 are vastly different, so we use 2 different files.
#
ifeq ($(OS_RELEASE),4.1)
include $(topsrcdir)/config/SunOS4.mk
else
include $(topsrcdir)/config/SunOS5.mk
endif

98
mozilla/config/SunOS4.mk Normal file
View File

@@ -0,0 +1,98 @@
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
######################################################################
# Config stuff for SunOS4.1.x
######################################################################
#
######################################################################
# Version-independent
######################################################################
ARCH := sunos
CPU_ARCH := sparc
GFX_ARCH := x
OS_INCLUDES = -I/usr/X11R5/include -I$(MOTIF)/include
G++INCLUDES =
LOC_LIB_DIR = /usr/openwin/lib/locale
MOTIF = /home/motif/usr
MOTIFLIB = -L$(MOTIF)/lib -lXm
OS_LIBS = -ldl -lm
PLATFORM_FLAGS = -Wall -Wno-format -DSUNOS4
MOVEMAIL_FLAGS =
PORT_FLAGS = -DSW_THREADS -DNEED_SYSCALL -DSTRINGS_ALIGNED -DNO_REGEX -DNO_ISDIR -DUSE_RE_COMP -DNO_REGCOMP -DUSE_GETWD -DNO_MEMMOVE -DNO_ALLOCA -DBOGUS_MB_MAX -DNO_CONST -DHAVE_ODD_SEND -DHAVE_ODD_IOCTL -DHAVE_FILIO_H -DMITSHM -DNEED_SYS_WAIT_H -DNO_TZNAME -DNEED_SYS_TIME_H -DNO_MULTICAST -DHAVE_INT32_T -DNEED_UINT_T -DUSE_ODD_SSCANF -DUSE_ODD_SPRINTF -DNO_IOSTREAM_H
PDJAVA_FLAGS =
ifdef USE_AUTOCONF
OS_CFLAGS =
else
OS_CFLAGS = $(PLATFORM_FLAGS) $(PORT_FLAGS) $(MOVEMAIL_FLAGS)
endif
LOCALE_MAP = $(DEPTH)/cmd/xfe/intl/sunos.lm
EN_LOCALE = en_US
DE_LOCALE = de
FR_LOCALE = fr
JP_LOCALE = ja
SJIS_LOCALE = ja_JP.SJIS
KR_LOCALE = ko
CN_LOCALE = zh
TW_LOCALE = zh_TW
I2_LOCALE = i2
IT_LOCALE = it
SV_LOCALE = sv
ES_LOCALE = es
NL_LOCALE = nl
PT_LOCALE = pt
######################################################################
# Version-specific stuff
######################################################################
######################################################################
# Overrides for defaults in config.mk (or wherever)
######################################################################
DLL_SUFFIX = so.1.0
RANLIB = /bin/ranlib
TAR = /usr/bin/tar
WHOAMI = /usr/ucb/whoami
UNZIP_PROG = $(NS_BIN)unzip
ZIP_PROG = $(NS_BIN)zip
ifdef NETSCAPE_HIERARCHY
PERL = perl5
endif
######################################################################
# Other
######################################################################
ifndef NO_MDUPDATE
MDUPDATE_FLAGS = -MDupdate $(DEPENDENCIES)
endif
HAVE_PURIFY = 1
MUST_BOOTLEG_ALLOCA = 1
BUILD_UNIX_PLUGINS = 1
MKSHLIB = $(LD) -L$(MOTIF)/lib
DSO_LDOPTS =
DSO_LDFLAGS =

186
mozilla/config/SunOS5.mk Normal file
View File

@@ -0,0 +1,186 @@
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
######################################################################
# Config stuff for SunOS 5.x for SPARC and x86
######################################################################
#
######################################################################
# Version-independent
######################################################################
ARCH := solaris
ifeq ($(OS_TEST),i86pc)
CPU_ARCH := x86
else
CPU_ARCH := sparc
endif
GFX_ARCH := x
OS_INCLUDES = -I$(MOTIF)/include -I/usr/openwin/include
G++INCLUDES =
LOC_LIB_DIR = /usr/openwin/lib/locale
MOTIF = /usr/dt
MOTIFLIB = -lXm
OS_LIBS = $(THREAD_LIB) -lposix4 $(RESOLV_LIB) -lsocket -lnsl -ldl
PLATFORM_FLAGS = $(DSO_CFLAGS) -DSOLARIS -D__svr4 -D__svr4__
MOVEMAIL_FLAGS = -DUSG
PORT_FLAGS = -DSVR4 -DSYSV -DHAVE_WEAK_IO_SYMBOLS -DHAVE_FILIO_H -DHAVE_LCHOWN -DNEED_CDEFS_H -DMITSHM -DHAVE_WAITID -DHAVE_FORK1 -DHAVE_REMAINDER -DHAVE_SYSTEMINFO_H -DHAVE_INT32_T -DNO_JNI_STUBS -DHAVE_QSORT -DBROKEN_QSORT
PDJAVA_FLAGS =
ifdef USE_AUTOCONF
OS_CFLAGS = $(DSO_CFLAGS) #-DSOLARIS
else
OS_CFLAGS = $(PLATFORM_FLAGS) $(PORT_FLAGS) $(MOVEMAIL_FLAGS)
endif
LOCALE_MAP = $(DEPTH)/cmd/xfe/intl/sunos.lm
EN_LOCALE = en_US
DE_LOCALE = de
FR_LOCALE = fr
JP_LOCALE = ja
SJIS_LOCALE = ja_JP.SJIS
KR_LOCALE = ko
CN_LOCALE = zh
TW_LOCALE = zh_TW
I2_LOCALE = i2
IT_LOCALE = it
SV_LOCALE = sv
ES_LOCALE = es
NL_LOCALE = nl
PT_LOCALE = pt
######################################################################
# Version-specific stuff
######################################################################
ifeq ($(CPU_ARCH),x86)
EMACS = /bin/true
PLATFORM_FLAGS += -Di386
PORT_FLAGS += -DNEED_INET_TCP_H
else
PLATFORM_FLAGS += -D$(CPU_ARCH)
endif
ifeq ($(OS_VERSION),.3)
MOTIF = /usr/local/Motif/opt/ICS/Motif/usr
MOTIFLIB = $(MOTIF)/lib/libXm.a
EMACS = /bin/true
endif
ifeq ($(OS_VERSION),.4)
PLATFORM_FLAGS += -DSOLARIS_24
endif
ifeq ($(OS_VERSION),.5)
PLATFORM_FLAGS += -DSOLARIS2_5 -DSOLARIS_55_OR_GREATER
endif
ifeq ($(OS_RELEASE)$(OS_VERSION),5.5.1)
PLATFORM_FLAGS += -DSOLARIS2_5 -DSOLARIS_55_OR_GREATER
RESOLV_LIB = -lresolv
endif
ifeq ($(OS_VERSION),.6)
PLATFORM_FLAGS += -DSOLARIS2_6 -DSOLARIS_55_OR_GREATER -DSOLARIS_56_OR_GREATER
PORT_FLAGS += -DHAVE_SNPRINTF
RESOLV_LIB = -lresolv
else
PORT_FLAGS += -DNEED_INET_TCP_H
endif
######################################################################
# Overrides for defaults in config.mk (or wherever)
######################################################################
BSDECHO = /usr/ucb/echo
WHOAMI = /usr/ucb/whoami
PROCESSOR_ARCHITECTURE = _$(CPU_ARCH)
UNZIP_PROG = $(NS_BIN)unzip
ZIP_PROG = $(NS_BIN)zip
ifdef NETSCAPE_HIERARCHY
PERL = perl5
endif
######################################################################
# Other
######################################################################
ifdef NS_USE_NATIVE
CC = cc
CCC = CC
NO_MDUPDATE = 1
PORT_FLAGS += -DNS_USE_NATIVE
ASFLAGS += -Wa,-P
ifdef SERVER_BUILD
ifndef BUILD_OPT
PLATFORM_FLAGS += -xs
endif
endif
# -z gets around _sbrk multiple define.
OS_GPROF_FLAGS = -xpg -z muldefs
DSO_CFLAGS = -KPIC
else
PLATFORM_FLAGS += -Wall -Wno-format
OS_LIBS += -L$(NS_LIB)
ifneq ($(CPU_ARCH),x86)
ASFLAGS += -x assembler-with-cpp
else
ifndef BUILD_OPT
ifndef USE_AUTOCONF
OPTIMIZER = -Wa,-s -gstabs
endif
endif
endif
OS_GPROF_FLAGS = -pg
DSO_CFLAGS = -fPIC
endif
ifndef NO_MDUPDATE
MDUPDATE_FLAGS = -MDupdate $(DEPENDENCIES)
endif
ifeq ($(USE_PTHREADS),1)
ifdef NS_USE_NATIVE
CCC += -mt
endif
PORT_FLAGS += -D_REENTRANT
THREAD_LIB = -lpthread
else
PORT_FLAGS += -DSW_THREADS
endif
#
# An nm command which generates an output like:
# archive.a:object.o: 0000003 T symbol
#
NM_PO = nm -Ap
HAVE_PURIFY = 1
MUST_BOOTLEG_ALLOCA = 1
BUILD_UNIX_PLUGINS = 1
# Turn on FULLCIRCLE crash reporting for 2.5.1 & up.
ifdef MOZ_FULLCIRCLE
FC_PLATFORM = SolarisSparc
FC_PLATFORM_DIR = SunOS5_sparc
endif
MKSHLIB = $(LD) $(DSO_LDOPTS)
DSO_BIND_REFERENCES = -Bsymbolic
DSO_LDOPTS = -G -L$(MOTIF)/lib -L/usr/openwin/lib
DSO_LDFLAGS =

View File

@@ -0,0 +1,96 @@
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
######################################################################
# Config stuff for SCO UnixWare
######################################################################
#
######################################################################
# Version-independent
######################################################################
ARCH := sco_uw
CPU_ARCH := x86
GFX_ARCH := x
OS_INCLUDES = -I/usr/X/include
G++INCLUDES =
LOC_LIB_DIR = /usr/lib/X11
MOTIF =
MOTIFLIB = -lXm
OS_LIBS = -lsocket -lc /usr/ucblib/libucb.a
PLATFORM_FLAGS = -DUNIXWARE -Di386
MOVEMAIL_FLAGS = -DUSG -DHAVE_STRERROR
PORT_FLAGS = -DSVR4 -DSYSV -DSW_THREADS -DHAVE_FILIO_H -DHAVE_ODD_ACCEPT -DNEED_S_ISLNK -DLAME_READDIR -DNO_CDEFS_H -DNO_LONG_LONG -DNEED_S_ISSOCK -DSYS_BYTEORDER_H -DUSE_NODL_TABS -DMOTIF_WARNINGS_UPSET_JAVA -DMITSHM -DNEED_SYS_TIME_H -DNO_MULTICAST -DHAVE_NETINET_IN_H -DHAVE_REMAINDER -DHAVE_INT32_T -DHAVE_SNPRINTF
PDJAVA_FLAGS =
ifdef USE_AUTOCONF
OS_CFLAGS =
else
OS_CFLAGS = $(PLATFORM_FLAGS) $(PORT_FLAGS) $(MOVEMAIL_FLAGS)
endif
LOCALE_MAP = $(DEPTH)/cmd/xfe/intl/unixware.lm
EN_LOCALE = C
DE_LOCALE = de_DE.ISO8859-1
FR_LOCALE = fr_FR.ISO8859-1
JP_LOCALE = ja
SJIS_LOCALE = ja_JP.SJIS
KR_LOCALE = ko_KR.EUC
CN_LOCALE = zh
TW_LOCALE = zh
I2_LOCALE = i2
######################################################################
# Version-specific stuff
######################################################################
ifeq ($(OS_RELEASE),7)
PLATFORM_FLAGS += -DUnixWare -DUNIXWARE7
PORT_FLAGS += -DSVR5 -D_SIMPLE_R
BUILD_UNIX_PLUGINS = 1
MKSHLIB = $(LD) $(DSO_LDOPTS)
DSO_LDOPTS = -G
DSO_LDFLAGS = -nostdlib -L/lib -L/usr/lib -L/usr/X/lib -lXm -lXt -lX11 -lgen
endif
######################################################################
# Overrides for defaults in config.mk (or wherever)
######################################################################
EMACS = /bin/true
WHOAMI = /usr/ucb/whoami
ifeq ($(OS_RELEASE),2.1)
CC = $(DEPTH)/build/hcc
CCC = $(DEPTH)/build/hcpp
else
CC = cc
CCC = CC
endif
ifdef NETSCAPE_HIERARCHY
PERL = perl5
endif
######################################################################
# Other
######################################################################

BIN
mozilla/config/W95MAKE.EXE Executable file

Binary file not shown.

BIN
mozilla/config/W95MKDIR.EXE Executable file

Binary file not shown.

79
mozilla/config/W95make.c Normal file
View File

@@ -0,0 +1,79 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <process.h>
/*
* A feeble attempt at recursive make on win95 - spider 1/98
*
* argv[1] == target
* argv[2] == end directory (full)
* argv[3...n] == list of source directories
*
*/
void main(int argc, char **argv)
{
char *args[6];
int n = 0 ;
int rc = 0 ;
/* Set up parameters to be sent: Sorry for the hardcode!*/
args[0] = "-nologo";
args[1] = "-nologo";
args[2] = "-S";
args[3] = "-f";
args[4] = "makefile.win";
args[5] = argv[1] ;
args[6] = NULL ;
if (argc < 3) {
fprintf(stderr, "w95make: Not enough arguments, you figure it out\n");
exit (666) ;
}
while(argv[n+3] != NULL) {
if (_chdir(argv[n+3]) != 0) {
fprintf(stderr, "w95make: Could not change to directory %s ... skipping\n", argv[n+3]);
} else {
fprintf(stdout, "w95make: Entering Directory %s\\%s with target %s\n", argv[2], argv[n+3], argv[1]);
if ((rc = _spawnvp(_P_WAIT,"nmake", args)) != 0) {
fprintf(stderr, "w95make: nmake failed in directory %s with error code %d\n", argv[n+3], rc);
exit(rc);
}
if (_chdir(argv[2]) != 0) {
fprintf(stderr, "w95make: Could not change back to directory %s\n", argv[2]);
exit (666) ;
}
fprintf(stdout, "w95make: Leaving Directory %s\\%s with target %s\n", argv[2], argv[n+3], argv[1]);
}
n++;
}
exit(0);
}

38
mozilla/config/W95mkdir.c Normal file
View File

@@ -0,0 +1,38 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <process.h>
/*
* win95 mkdir that responds nicely if the directory already exists - spider 1/98
*
*/
void main(int argc, char **argv)
{
if (argc < 1) {
fprintf(stderr, "w95mkdir: Not enough arguments, you figure it out\n");
exit (666) ;
}
_mkdir(argv[1]);
}

113
mozilla/config/WIN16 Normal file
View File

@@ -0,0 +1,113 @@
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#//------------------------------------------------------------------------
#//
#// Win16 Configuration file
#//
#//------------------------------------------------------------------------
#//------------------------------------------------------------------------
#//
#// Define the OS dependent commands used by MAKE
#//
#//------------------------------------------------------------------------
CC=cl
LD=$(MOZ_TOOLS)\bin\optlinks.exe
AR=$(DEPTH)\CONFIG\TLIB.EXE /P64 /C
#AR=lib /NOLOGO /BATCH /NOIGNORECASE
RC=rc
#RM=del /F /Q
#RM_R=del /F /S /Q
RM=rm -f
RM_R=rm -fr
CP=cp
AWK=$(MOZ_TOOLS)\bin\gawk.exe
RANLIB=$(DEPTH)\config\true.bat
!ifndef MOZ_DEBUG
JAVAH_PROG=$(DEPTH)\dist\$(DIST_PREFIX)32_o.obj\bin\javah.exe
!else
JAVAH_PROG=$(DEPTH)\dist\$(DIST_PREFIX)32_d.obj\bin\javah.exe
!endif
#//------------------------------------------------------------------------
#//
#// Define Debug and optimization flags
#//
#//------------------------------------------------------------------------
!ifndef MOZ_DEBUG
!ifndef OPTIMIZER
OPTIMIZER=-Ox -Os -DDEVELOPER_DEBUG
!endif
OS_LFLAGS=
!else
!if defined(MOZ_FULL_DEBUG_INFO) || ("$(MAKE_OBJ_TYPE)" == "DLL")
OPTIMIZER=-Z7
!else if defined(MOZ_DEBUG_FLAG)
OPTIMIZER=$(MOZ_DEBUG_FLAG)
!else
OPTIMIZER=-Zd
!endif
OPTIMIZER=$(OPTIMIZER) -Od -DDEBUG -UNDEBUG
OS_LFLAGS=/CO
!endif
!if defined (MOZ_LITE)
OPTIMIZER=$(OPTIMIZER) -DMOZ_LITE
!endif
#//------------------------------------------------------------------------
#//
#// Specify the OS dependent compiler flags, linker flags and libraries
#//
#//------------------------------------------------------------------------
!ifdef 286_INSTRUCTIONS
INSTRUCTIONS=-G2
!else
INSTRUCTIONS=-G3
!endif
OS_CFLAGS=$(INSTRUCTIONS) -AL -Gx- -Gf -Gd -Gs -W3 -nologo \
!ifdef MOZ_JAVA
-DSEG_ARRAY \
!endif
-D_X86_ -D_WINDOWS -DXP_PC -DSW_THREADS
OS_LFLAGS=$(OS_LFLAGS) /NOE /NOD /NOI /XNOI \
/ALIGN:16 /BYORDINAL /FARCALL \
/PACKC:61440 /PACKD /REORDERSEGMENTS \
/DETAILEDMAP /XREF /ONERROR:NOEXE /NOLOGO /WARNDUPS
OS_LIBS=LIBW.LIB TOOLHELP.LIB
#//------------------------------------------------------------------------
#//
#// Specify the special flags for creating EXEs
#//
#//------------------------------------------------------------------------
EXE_CFLAGS=/GA /Gt3
EXE_LFLAGS=/STACK:20000
EXE_LIBS=OLDNAMES.LIB LLIBCEW.LIB
#//------------------------------------------------------------------------
#//
#// Specify the special flags for creating DLLs
#//
#//------------------------------------------------------------------------
!ifndef DLL_CFLAGS
DLL_CFLAGS=/GD /D "_WINDLL"
!endif
DLL_LFLAGS=
DLL_LIBS=OLDNAMES.LIB LDLLCEW.LIB

144
mozilla/config/WIN32 Normal file
View File

@@ -0,0 +1,144 @@
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#//------------------------------------------------------------------------
#//
#// Win32 Configuration file
#//
#//------------------------------------------------------------------------
#//------------------------------------------------------------------------
#//
#// Define the OS dependent commands used by MAKE
#//
#//------------------------------------------------------------------------
CC=cl
LD=link
AR=lib
RC=rc
#RM=del /F /Q
#RM_R=del /F /S /Q
RM=rm -f
RM_R=rm -fr
CP=cp
AWK=$(MOZ_TOOLS)\bin\gawk.exe
RANLIB=$(DEPTH)\config\true.bat
JAVAH=$(DIST)\bin\javah.exe
JAVA=$(MOZ_TOOLS)\bin\java.exe
!ifndef JAVAH_IN_JAVA
JAVAH_PROG = $(DIST)\bin\javah.exe
!else
JAVAH_PROG = $(JAVA) netscape.tools.jric.Main
!endif
#//------------------------------------------------------------------------
#//
#// Define Debug and optimization flags
#//
#//------------------------------------------------------------------------
!ifdef MOZ_PROF
#
# compile with debug symbols, but without DEBUG code and ASSERTs
#
OPTIMIZER=-Z7 -O1 -UDEBUG -DNDEBUG -U_DEBUG
OS_LFLAGS=/DEBUG /DEBUGTYPE:CV /PDB:NONE
!else
!ifdef MOZ_DEBUG
#
# Uncomment for MSVC debug malloc logging...
#
#OPTIMIZER=-Z7 -DDEBUG -UNDEBUG -D_DEBUG -D_CRTDBG_MAP_ALLOC
OPTIMIZER=-Z7 -DDEBUG -UNDEBUG -D_DEBUG
!if defined(GLOWCODE) && "$(MOZ_BITS)"=="32"
OS_LFLAGS=/DEBUG /DEBUGTYPE:BOTH /INCLUDE:_GlowCode /PDB:NONE
!else
OS_LFLAGS=/DEBUG /DEBUGTYPE:CV /PDB:NONE
!endif
!else
#
# optimize it
#
OPTIMIZER=-O1 -UDEBUG -DNDEBUG
OS_LFLAGS=
!endif
!endif
#//------------------------------------------------------------------------
#//
#// Select the correct RTL to link...
#//
#// Currently, unless USE_STATIC_LIBS is defined, the multithreaded
#// DLL version of the RTL is used...
#//
#//------------------------------------------------------------------------
!ifdef USE_STATIC_LIBS
RTL_FLAGS=-MT # Statically linked multithreaded RTL
!ifdef MOZ_DEBUG
RTL_FLAGS=-MTd # Statically linked multithreaded MSVC4.0 debug RTL
!endif
!else
RTL_FLAGS=-MD # Dynamically linked, multithreaded RTL
!ifdef MOZ_DEBUG
!ifndef MOZ_NO_DEBUG_RTL
RTL_FLAGS=-MDd # Dynamically linked, multithreaded MSVC4.0 debug RTL
!endif
!endif
!endif
#//------------------------------------------------------------------------
#//
#// Specify the OS dependent compiler flags, linker flags and libraries
#//
#//------------------------------------------------------------------------
OS_CFLAGS=$(OPTIMIZER) $(RTL_FLAGS) -W3 -nologo -D_X86_ -D_WINDOWS -DWIN32 \
-DXP_PC -DHW_THREADS
OS_CFLAGS=$(OS_CFLAGS) -DMSVC4
## Removed MOZ_LITE/MOZ_MEDIUM stuff from OS_CFLAGS
OS_LFLAGS=$(OS_LFLAGS)
OS_LIBS=kernel32.lib user32.lib gdi32.lib winmm.lib wsock32.lib advapi32.lib
#//------------------------------------------------------------------------
#//
#// Specify the special flags for creating EXEs
#//
#//------------------------------------------------------------------------
!if defined(SWAPTUNER) || (defined(GLOWCODE) && defined(GLOWPROF) && "$(MOZ_BITS)"=="32")
# this seems to get lost
EXE_CFLAGS=/Gh
!else
EXE_CFLAGS=/Gy
!endif
EXE_LFLAGS=
EXE_LIBS=
#//------------------------------------------------------------------------
#//
#// Specify the special flags for creating DLLs
#//
#//------------------------------------------------------------------------
DLL_CFLAGS=
DLL_LFLAGS=/SUBSYSTEM:WINDOWS
DLL_LIBS=

18
mozilla/config/aboutime.pl Executable file
View File

@@ -0,0 +1,18 @@
open INFILE, "<$ARGV[1]";
$build = <INFILE>;
close INFILE;
chop $build;
open INFILE, "<$ARGV[0]";
open OUTFILE, ">$ARGV[0].old";
while (<INFILE>) {
if (/<TITLE>Version/) {
s/-[0-9]+/-$build/;
}
print OUTFILE $_;
}
close INFILE;
close OUTFILE;
rename "$ARGV[0].old", "$ARGV[0]";

View File

@@ -0,0 +1,114 @@
# The contents of this file are subject to the Mozilla Public License
# Version 1.0 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License
# at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and
# limitations under the License.
#
# The Original Code is this file as it was released upon August 6, 1998.
#
# The Initial Developer of this code under the MPL is Christopher
# Seawood, <cls@seawood.org>. Portions created by Christopher Seawood
# are Copyright (C) 1998 Christopher Seawood. All Rights Reserved.
# A netscape style .mk file for autoconf builds
USE_AUTOCONF = 1
MOZILLA_CLIENT = 1
NO_MDUPDATE = 1
USE_NGLAYOUT = @USE_NGLAYOUT@
MOZ_FE = @MOZ_FE@
MOZ_SECURITY = @MOZ_SECURITY@
MOZ_JAVA = @MOZ_JAVA@
MOZ_OJI = @MOZ_OJI@
MOZ_NETCAST = @MOZ_NETCAST@
MOZ_DEBUG = @MOZ_DEBUG@
MOZILLA_GPROF = @MOZILLA_GPROF@
BUILD_PROFILE = @MOZILLA_GPROF@
MOZ_DARK = @MOZ_DARK@
MOZ_EDITOR = @MOZ_EDITOR@
UNIX_SKIP_ASSERTS = @UNIX_SKIP_ASSERTS@
NO_UNIX_ASYNC_DNS = @NO_UNIX_ASYNC_DNS@
NO_SHARED_LIB = @NO_SHARED_LIB@
NO_NETSCAPE_SHARED = @NO_SHARED_LIB@
NO_STATIC_LIB = @NO_STATIC_LIB@
NO_NETSCAPE_STATIC = @NO_STATIC_LIB@
ENABLE_TESTS = @ENABLE_TESTS@
MOZ_USER_DIR = @MOZ_USER_DIR@
SMART_MAIL = @MOZ_SMART_MAIL@
DOM = @MOZ_DOM@
USE_PTHREADS = @USE_PTHREADS@
MOZ_MAIL_COMPOSE = @MOZ_MAIL_COMPOSE@
FULL_STATIC_BUILD = @FULL_STATIC_BUILD@
NO_UNIX_LDAP = @NO_UNIX_LDAP@
MOZ_NATIVE_ZLIB = @SYSTEM_ZLIB@
MOZ_NATIVE_JPEG = @SYSTEM_JPEG@
MOZ_NATIVE_PNG = @SYSTEM_PNG@
# Should the extra CFLAGS only be added in Makefile.ins that need them?
OS_CFLAGS = @CFLAGS@ $(DSO_CFLAGS)
OS_INCLUDES = $(NSPR_CFLAGS) $(JPEG_CFLAGS) $(PNG_CFLAGS) $(ZLIB_CFLAGS)
OS_LIBS = @LDFLAGS@ @LIBS@
DEFINES = @DEFS@
XCFLAGS = @XCFLAGS@
XLDFLAGS = @XLDFLAGS@
XLIBS = @XLIBS@
CC = @CC@
CXX = @CXX@
GNU_CC = @GNU_CC@
GNU_CXX = @GNU_CXX@
ACEMACS = @EMACS@
ACPERL = @PERL@
ACRANLIB = @RANLIB@
ACWHOAMI = @WHOAMI@
ACUNZIP = @UNZIP@
ACZIP = @ZIP@
MOC = @MOC@
OBJDIR_TAG = _AC
OBJDIR_NAME = .
JPEG_CFLAGS = @JPEG_CFLAGS@
JPEG_LIBS = @JPEG_LIBS@
ZLIB_CFLAGS = @ZLIB_CFLAGS@
ZLIB_LIBS = @ZLIB_LIBS@
PNG_CFLAGS = @PNG_CFLAGS@
PNG_LIBS = @PNG_LIBS@
NSPR_CFLAGS = @NSPR_CFLAGS@
NSPR_LIBS = @NSPR_LIBS@
ifndef NO_SHARED_LIB
BUILD_UNIX_PLUGINS = 1
DSO_CFLAGS = -fPIC
MKSHLIB = @MKSHLIB@
DSO_LDOPTS = @DSO_LDOPTS@
endif
FE_X_CFLAGS = @FE_X_CFLAGS@
FE_X_LIBS = @FE_X_LIBS@
FE_QT_CFLAGS = @FE_QT_CFLAGS@
FE_QT_LIBS = @FE_QT_LIBS@
FE_GNOME_CFLAGS = @FE_GNOME_CFLAGS@
FE_GNOME_LIBS = @FE_GNOME_LIBS@
FE_GTK_CFLAGS = @FE_GTK_CFLAGS@
FE_GTK_LIBS = @FE_GTK_LIBS@
ifdef USE_NGLAYOUT
NGLAYOUT_PLUGINS=1
CM_BLDTYPE=dbg
AWT_11=1
MODULAR_NETLIB=1
MOZ_BITS=32
MOZ_GOLD=1
OS_TARGET=@OS_TARGET@
STANDALONE_IMAGE_LIB=1
endif # USE_NGYLAYOUT

44
mozilla/config/bdate.c Normal file
View File

@@ -0,0 +1,44 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
**
** bdate.c: Possibly cross-platform date-based build number
** generator. Output is YYJJJ, where YY == 2-digit
** year, and JJJ is the Julian date (day of the year).
**
** Author: briano@netscape.com
**
*/
#include <stdio.h>
#include <time.h>
#ifdef SUNOS4
#include "sunos4.h"
#endif
void main(void)
{
time_t t = time(NULL);
struct tm *tms;
tms = localtime(&t);
printf("500%02d%03d%02d\n", tms->tm_year, 1+tms->tm_yday, tms->tm_hour);
exit(0);
}

21
mozilla/config/bdate.pl Executable file
View File

@@ -0,0 +1,21 @@
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
# XP way of doing the build date.
# 98091509 = 1998, September, 15th, 9am local time zone
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime;
printf("%02d%02d%02d%02d\n", $year, 1+$mon, $mday, $hour);

114
mozilla/config/bin2rc.c Normal file
View File

@@ -0,0 +1,114 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include <stdio.h>
#include <sys\stat.h>
int main(int iArgc, char **ppArgv) {
int iRetval = 1;
/* First argument, the filename to convert.
* Output to stdout, redirect to save.
*/
char *pFileName = ppArgv[1];
if(pFileName) {
FILE *pFile = fopen(pFileName, "rb");
if(pFile) {
struct stat sInfo;
/* Stat the file for size.
*/
if(!fstat(fileno(pFile), &sInfo)) {
int iChar;
int iX = 0;
int iFirsttime = 1;
/* Begin RCDATA
*/
printf("BEGIN\n");
/* First string identifies created via bin2rc.
* Users of the RCDATA must check for this to
* assume the format of the remainder of
* the data.
*/
printf("\t\"bin2rc generated resource\\0\",\t// bin2rc identity string\n");
/* Next string is optional parameter on command
* line. If not present, an empty string.
* Users of the RCDATA must understand this is
* the optional string that can be used for
* about any purpose they desire.
*/
printf("\t\"%s\\0\",\t// optional command line string\n", ppArgv[2] ? ppArgv[2] : "");
/* Next string is the size of the original file.
* Users of the RCDATA must understand that this
* is the size of the file's actual contents.
*/
printf("\t\"%ld\\0\"\t// data size header\n", sInfo.st_size);
while(EOF != (iChar = fgetc(pFile))) {
/* Comma?
*/
if(0 == iFirsttime) {
iX += printf(",");
}
else {
iFirsttime = 0;
}
/* Newline?
*/
if(iX >= 72) {
printf("\n");
iX = 0;
}
/* Tab?
*/
if(0 == iX) {
printf("\t");
iX += 8;
}
/* Octal byte.
*/
iX += printf("\"\\%.3o\"", iChar);
}
/* End RCDATA
*/
if(0 != iX) {
printf("\n");
}
printf("END\n");
/* All is well.
*/
iRetval = 0;
}
fclose(pFile);
pFile = NULL;
}
}
return(iRetval);
}

BIN
mozilla/config/bin2rc.exe Executable file

Binary file not shown.

77
mozilla/config/bsdecho.c Normal file
View File

@@ -0,0 +1,77 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
** This is a feeble attempt at creating a BSD-style echo command
** for use on platforms that have only a Sys-V echo. This version
** supports the '-n' flag, and will not interpret '\c', etc. As
** of this writing this is only needed on HP-UX and AIX 4.1.
** --briano.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#if !defined(XP_OS2)
#include <unistd.h>
#endif
#ifdef SUNOS4
#include "sunos4.h"
#endif
void main(int argc, char **argv)
{
short numargs = argc;
short newline = 1;
if (numargs == 1)
{
exit(0);
}
if (strcmp(*++argv, "-n") == 0)
{
if (numargs == 2)
{
exit(0);
}
else
{
newline = 0;
numargs--;
argv++;
}
}
while (numargs > 1)
{
fprintf(stdout, "%s", *argv++);
numargs--;
if (numargs > 1)
{
fprintf(stdout, " ");
}
}
if (newline == 1)
{
fprintf(stdout, "\n");
}
exit(0);
}

View File

@@ -0,0 +1,41 @@
@echo off
rem The contents of this file are subject to the Netscape Public License
rem Version 1.0 (the "NPL"); you may not use this file except in
rem compliance with the NPL. You may obtain a copy of the NPL at
rem http://www.mozilla.org/NPL/
rem
rem Software distributed under the NPL is distributed on an "AS IS" basis,
rem WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
rem for the specific language governing rights and limitations under the
rem NPL.
rem
rem The Initial Developer of this code under the NPL is Netscape
rem Communications Corporation. Portions created by Netscape are
rem Copyright (C) 1998 Netscape Communications Corporation. All Rights
rem Reserved.
@echo on
@echo off
if not exist %2 echo Warning: %2 does not exist! (you may need to check it out)
if not exist %2 exit 1
pushd %2
goto NO_CAFE
if "%MOZ_CAFE%"=="" goto NO_CAFE
mkdir %MOZ_SRC%\ns\dist\classes\%2
%MOZ_TOOLS%\bin\sj.exe -classpath %MOZ_SRC%\ns\dist\classes;%MOZ_SRC%\ns\sun-java\classsrc -d %MOZ_SRC%\ns\dist\classes *.java
goto END
:NO_CAFE
%MOZ_TOOLS%\perl5\perl.exe %MOZ_SRC%\ns\config\outofdate.pl -d %MOZ_SRC%\ns\dist\classes\%2 *.java >> %1
%MOZ_TOOLS%\bin\java.exe -argfile %1
:END
popd

121
mozilla/config/clobber_miss.pl Executable file
View File

@@ -0,0 +1,121 @@
#!perl5
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
#
# Searches the tree for unclobbered files
# should be relatively cross platform
#
$start_dir = $ENV{"MOZ_SRC"};
@ignore_list = ("make.dep","manifest.mnw");
$missed = 0;
print "\n\nChecking for unclobbered files\n" .
"------------------------------\n";
GoDir("ns");
if( $missed ){
die "\nError: $missed files or directories unclobbered\n";
}
else {
print "No unclobbered files found\n";
}
sub GoDir {
local($dir) = @_;
local(%filelist,$iscvsdir);
local($k,$v,$d,$fn,$rev, $mod_time);
local($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
$atime,$mtime,$ctime,$blksize,$blocks);
if(! chdir "$start_dir/$dir" ){
return;
}
while(<*.*> ){
if( $_ ne '.' && $_ ne '..' && $_ ne 'CVS'
&& $_ ne 'nuke' ){
$filelist{$_} = 1;
}
}
if( -r "CVS/Entries" ){
$iscvsdir=1;
open(ENT, "CVS/Entries" ) ||
die "Cannot open CVS/Entries for reading\n";
while(<ENT>){
chop;
($d,$fn,$rev,$mod_time) = split(/\//);
if( $fn ne "" ){
if( $d eq "D" ){
$filelist{$fn} = 3;
}
else {
$filelist{$fn} = 2;
}
}
}
close(ENT);
}
while( ($k,$v) = each %filelist ){
if( $v == 1 && $iscvsdir && !IgnoreFile( $k ) ){
if( ! -d $k ){
print " file: $dir/$k\n";
$missed++;
}
else {
if( ! -r "$k/CVS/Entries" ){
print "directory: $dir/$k\n";
$missed++;
}
else {
$filelist{$k} = 3;
}
}
}
}
while( ($k,$v) = each %filelist ){
if( $v == 3 ){
GoDir("$dir/$k");
}
}
# while( ($k,$v) = each %filelist ){
# print "$k: $v\n";
# }
}
sub IgnoreFile {
local($fn) = @_;
local($i);
for $i (@ignore_list){
if( $fn eq $i ){
return 1;
}
}
return 0;
}

135
mozilla/config/common.mk Normal file
View File

@@ -0,0 +1,135 @@
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
######################################################################
# Cross-platform defines used on all platforms (in theory)
######################################################################
#
# The VERSION_NUMBER is suffixed onto the end of the DLLs we ship.
# Since the longest of these is 5 characters without the suffix,
# be sure to not set VERSION_NUMBER to anything longer than 3
# characters for Win16's sake.
#
# Also... If you change this value, there are several other places
# you'll need to change (because they're not reached by this
# variable):
# sun-java/nsjava/nsjava32.def
# sun-java/nsjava/nsjava16.def
# sun-java/classsrc/sun/audio/AudioDevice.java
# sun-java/classsrc/sun/awt/windows/WToolkit.java
#
VERSION_NUMBER = 50
# jar for core java classes:
JAR_NAME = java$(VERSION_NUMBER).jar
# jar for navigator-specific java code:
NAV_JAR_NAME = nav$(VERSION_NUMBER).jar
######################################################################
# Cross-Platform Java Stuff
######################################################################
# java interpreter
# get class files from the directory they are compiled to
JAVA_CLASSPATH = $(JAVAC_ZIP)$(PATH_SEPARATOR)$(JAVA_DESTPATH)
JAVA_FLAGS = -classpath $(JAVA_CLASSPATH) -ms8m
JAVA = $(JAVA_PROG) $(JAVA_FLAGS)
#
# NOTE: If a new DLL is being added to this define you will have to update
# ns/sun-java/include/javadefs.h in order not to break win16.
#
JAVA_DEFINES = -DJAR_NAME=\"$(JAR_NAME)\" -DJRTDLL=\"$(JRTDLL)\" -DMMDLL=\"$(MMDLL)\" \
-DAWTDLL=\"$(AWTDLL)\" -DJITDLL=\"$(JITDLL)\" -DJPWDLL=\"$(JPWDLL)\"
######################################################################
# javac
#
# java wants '-ms8m' and kaffe wants '-ms 8m', so this needs to be
# overridable.
#
JINT_FLAGS = -ms8m
# to run the compiler in the interpreter
JAVAC_PROG = $(JINT_FLAGS) $(PDJAVA_FLAGS) -classpath $(JAVAC_ZIP) sun.tools.javac.Main
JAVAC = $(JAVA_PROG) $(JAVAC_PROG) $(JAVAC_FLAGS)
# std set of options passed to the compiler
JAVAC_FLAGS = -classpath $(JAVAC_CLASSPATH) $(JAVAC_OPTIMIZER) -d $(JAVA_DESTPATH)
#
# The canonical Java classpath is:
# JAVA_DESTPATH, JAVA_SOURCEPATH, JAVA_LIBS
#
# appropriately delimited, in that order
#
JAVAC_CLASSPATH = $(JAVA_DESTPATH)$(PATH_SEPARATOR)$(JAVA_SOURCEPATH)
######################################################################
# javadoc
# Rules to build java .html files from java source files
JAVADOC_PROG = $(JAVA) sun.tools.javadoc.Main
JAVADOC_FLAGS = -classpath $(JAVAC_CLASSPATH)
JAVADOC = $(JAVADOC_PROG) $(JAVADOC_FLAGS)
######################################################################
# javah
JAVAH_FLAGS = -classpath $(JAVA_DESTPATH)
JAVAH = $(JAVAH_PROG) $(JAVAH_FLAGS)
######################################################################
# jmc
JMCSRCDIR = $(XPDIST)/_jmc
JMC_PROG = $(JAVA) netscape.tools.jmc.Main
JMC_CLASSPATH = $(JMCSRCDIR)$(PATH_SEPARATOR)$(JAVAC_CLASSPATH)
JMC_FLAGS = -classpath $(JMC_CLASSPATH) -verbose
JMC = $(JMC_PROG) $(JMC_FLAGS)
######################################################################
# zip
ZIP = $(ZIP_PROG) $(ZIP_FLAGS)
######################################################################
# idl2java
ORBTOOLS = $(DEPTH)/modules/iiop/tools/orbtools.zip
ORB_CLASSPATH = $(ORBTOOLS)$(PATH_SEPARATOR)$(JAVA_CLASSPATH)
IDL2JAVA_PROG = $(JAVA_PROG)
IDL2JAVA_FLAGS = -classpath $(ORB_CLASSPATH) pomoco.tools.idl2java
IDL2JAVA = $(IDL2JAVA_PROG) $(IDL2JAVA_FLAGS)
######################################################################
# lex and yacc
JAVALEX_PROG = $(JAVA_PROG) -classpath $(ORB_CLASSPATH) sbktech.tools.jax.driver
JAVALEX_FLAGS =
JAVALEX = $(JAVALEX_PROG) $(JAVALEX_FLAGS)
JAVACUP_PROG = $(JAVA_PROG) -classpath $(ORB_CLASSPATH) java_cup.Main
JAVACUP_FLAGS =
JAVACUP = $(JAVACUP_PROG) $(JAVACUP_FLAGS)

383
mozilla/config/config.guess vendored Executable file
View File

@@ -0,0 +1,383 @@
#!/bin/sh
# This script attempts to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#
# This script attempts to guess a canonical system name similar to
# config.sub. If it succeeds, it prints the system name on stdout, and
# exits with 0. Otherwise, it exits with 1.
#
# The plan is that this can be called by configure scripts if you
# don't specify an explicit system type (host/target name).
#
# Only a few systems have been added to this list; please add others
# (but try to keep the structure clean).
#
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
# Note: order is significant - the case branches are not exclusive.
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
alpha:OSF1:1.*:*)
# 1.2 uses "1.2" for uname -r.
echo alpha-dec-osf${UNAME_RELEASE}
exit 0 ;;
# lemacs change from Dirk Grunwald <grunwald@foobar.cs.colorado.edu>
alpha:OSF1:V[123].*:*)
# 1.3 uses "V1.3" for uname -r.
echo alpha-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^V//'`
exit 0 ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
exit 0;;
sun4*:SunOS:5.*:*)
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
sun4*:SunOS:6*:*)
# According to config.sub, this is the proper way to canonicalize
# SunOS6. Hard to guess exactly what SunOS6 will be like, but
# it's likely to be more like Solaris than SunOS4.
echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
i86pc*:SunOS:5.*:*)
echo x86-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
sun4*:SunOS:*:*)
echo sparc-sun-sunos${UNAME_RELEASE}
exit 0 ;;
sun3*:SunOS:*:*)
echo m68k-sun-sunos${UNAME_RELEASE}
exit 0 ;;
RISC*:ULTRIX:*:*)
echo mips-dec-ultrix${UNAME_RELEASE}
exit 0 ;;
VAX*:ULTRIX*:*:*)
echo vax-dec-ultrix${UNAME_RELEASE}
exit 0 ;;
mips:*:5*:RISCos)
echo mips-mips-riscos${UNAME_RELEASE}
exit 0 ;;
m88k:*:4*:R4*)
echo m88k-motorola-sysv4
exit 0 ;;
m88k:*:3*:R3*)
echo m88k-motorola-sysv3
exit 0 ;;
AViiON:dgux:*:*)
echo m88k-dg-dgux${UNAME_RELEASE}
exit 0 ;;
M88*:*:R3*:*)
# Delta 88k system running SVR3
echo m88k-motorola-sysv3
exit 0 ;;
XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
echo m88k-tektronix-sysv3
exit 0 ;;
Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
echo m68k-tektronix-bsd
exit 0 ;;
*:IRIX*:*:*)
echo mips-sgi-irix${UNAME_RELEASE}
exit 0 ;;
i[3456]86:AIX:*:*)
echo i386-ibm-aix
exit 0 ;;
*:AIX:2:3)
test -x /usr/bin/oslevel && test `/usr/bin/oslevel` = '=3240' \
&& echo rs6000-ibm-aix3.2.4 && exit 0
test -x /usr/bin/oslevel && test `/usr/bin/oslevel` = '=3250' \
&& echo rs6000-ibm-aix3.2.5 && exit 0
test -x /usr/bin/oslevel && test `/usr/bin/oslevel` = '<>3250' \
&& echo rs6000-ibm-aix3.2.5 && exit 0
echo rs6000-ibm-aix3.2
exit 0 ;;
*:AIX:*:4)
echo rs6000-ibm-aix4
exit 0 ;;
*:AIX:*:*)
echo rs6000-ibm-aix
exit 0 ;;
*:BOSX:*:*)
echo rs6000-bull-bosx
exit 0 ;;
DPX/2?00:B.O.S.:*:*)
echo m68k-bull-sysv3
exit 0 ;;
9000/31?:HP-UX:*:*)
echo m68000-hp-hpux
exit 0 ;;
9000/[34]??:HP-UX:*:*)
echo m68k-hp-hpux
exit 0 ;;
9000/[34]??:4.3bsd:1.*:*)
echo m68k-hp-bsd
exit 0 ;;
hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
echo m68k-hp-bsd4.4
exit 0 ;;
9000/7??:HP-UX:*:* | 9000/8?7:HP-UX:*:* )
echo hppa1.1-hp-hpux
exit 0 ;;
9000/8??:HP-UX:*:*)
echo hppa1.0-hp-hpux
exit 0 ;;
3050*:HI-UX:*:*)
sed 's/^ //' << EOF >dummy.c
#include <unistd.h>
int
main ()
{
long cpu = sysconf (_SC_CPU_VERSION);
if (CPU_IS_HP_MC68K (cpu))
puts ("m68k-hitachi-hiuxwe2");
else if (CPU_IS_PA_RISC (cpu))
{
switch (cpu)
{
case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
default: puts ("hppa-hitachi-hiuxwe2"); break;
}
}
else puts ("unknown-hitachi-hiuxwe2");
exit (0);
}
EOF
${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
rm -f dummy.c dummy
echo unknown-hitachi-hiuxwe2
exit 0 ;;
9000/7??:4.3bsd:*:* | 9000/8?7:4.3bsd:*:* )
echo hppa1.1-hp-bsd
exit 0 ;;
9000/8??:4.3bsd:*:*)
echo hppa1.0-hp-bsd
exit 0 ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1:*)
echo c1-convex-bsd
exit 0 ;;
C2*:ConvexOS:*:* | convex:ConvexOS:C2:*)
echo c2-convex-bsd
exit 0 ;;
CRAY*X-MP:UNICOS:*:*)
echo xmp-cray-unicos
exit 0 ;;
CRAY*Y-MP:UNICOS:*:*)
echo ymp-cray-unicos
exit 0 ;;
CRAY-2:UNICOS:*:*)
echo cray2-cray-unicos
exit 0 ;;
i[3456]86:FreeBSD:*:*)
echo ${UNAME_MACHINE}-unknown-freebsd
exit 0 ;;
*:NetBSD:*:*)
test ! -z "`echo ${UNAME_MACHINE} | grep hp3`" && echo m68k-unknown-netbsd${UNAME_RELEASE} && exit 0
echo ${UNAME_MACHINE}-unknown-netbsd${UNAME_RELEASE}
exit 0 ;;
*:OpenBSD:*:*)
test ! -z "`echo ${UNAME_MACHINE} | grep hp3`" && echo m68k-unknown-openbsd${UNAME_RELEASE} && exit 0
echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux
exit 0 ;;
i[3456]86:UnixWare:*:*)
echo ${UNAME_MACHINE}-sco-unixware${UNAME_VERSION}
exit 0 ;;
i[3456]86:UNIX_SV:4.*:* | i[3456]86:SYSTEM_V:4.*:*)
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
UNAME_REL=`(/bin/uname -v)`
echo ${UNAME_MACHINE}-sco-unixware${UNAME_REL}
else
echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}
fi
exit 0 ;;
i[3456]86:*:3.2:*)
if /bin/uname -X 2>/dev/null >/dev/null ; then
UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= .*v//')`
(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
echo ${UNAME_MACHINE}-sco-opensv${UNAME_REL}
else
echo ${UNAME_MACHINE}-unknown-sysv32
fi
exit 0 ;;
mini*:CTIX:SYS*5:*)
# "miniframe"
echo m68010-convergent-sysv
exit 0 ;;
M680[234]0:*:R3V[567]*:*)
test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
3[3456]??*:*:4.0:*)
uname -p 2>/dev/null | egrep 'Pentium|86' >/dev/null && echo x86-ncr-sysv4 && exit 0 ;;
m680[234]0:LynxOS:2.2*:*)
echo m68k-lynx-lynxos${UNAME_RELEASE}
exit 0 ;;
i[3456]86:LynxOS:2.2*:*)
echo x86-lynx-lynxos${UNAME_RELEASE}
exit 0 ;;
TSUNAMI:LynxOS:2.2*:*)
echo sparc-lynx-lynxos${UNAME_RELEASE}
exit 0 ;;
*:SINIX*:5.4[23]:* | *:Reliant*:5.4[23]:*)
if test "`uname -p`" = "i386"; then
echo x86-sni-sinix
else
echo mips-sni-sinix
fi
exit 0 ;;
*:Rhapsody:*:*)
test ! -z "`echo ${UNAME_MACHINE} | grep Power`" && echo ppc-apple-rhapsody${UNAME_RELEASE} && exit 0
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
exit 0 ;;
*:QNX:*:*)
echo x86-qnx-qnx`echo ${UNAME_VERSION} | sed 's/^\([0-9]\)\([0-9]*\)$/\1.\2/'`
exit 0 ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
cat >dummy.c <<EOF
main()
{
#if defined (sony)
#if defined (MIPSEB)
#if defined (__svr4)
printf ("mips-sony-sysv\n"); exit (0);
#else
/* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
I don't know.... */
printf ("mips-sony-bsd\n"); exit (0);
#endif
#else
printf("m68k-sony-newsos\n"); exit(0);
#endif
#endif
#if defined (_nec_ews)
printf("mips-nec-uxv4.2\n"); exit(0);
#endif
#if defined (__arm) && defined (__acorn) && defined (__unix)
printf("arm-acorn-riscix"); exit (0);
#endif
#if defined(hp300) && !defined(hpux)
printf("m68k-hp-bsd\n"); exit(0);
#endif
#if defined(NeXT)
#if !defined(__ARCHITECTURE__)
#define __ARCHITECTURE__ "m68k"
#endif
int version;
version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
if (version==2)
{
printf("%s-next-ns2\n", __ARCHITECTURE__);
exit(0);
}
else
{
printf("%s-next-ns3\n", __ARCHITECTURE__);
exit(0);
}
#endif
#if defined (MACH)
#if defined (vax)
printf("vax-dec-mach\n"); exit(0);
#else
#if defined (sun3)
printf("mc68000-sun-mach\n"); exit(0);
#else
#if defined (sparc)
printf("sparc-sun-mach\n"); exit(0);
#else
#if defined (mips)
printf("mips-dec-mach\n"); exit(0);
#else
#if defined (ibmrt)
printf("romp-ibm-mach\n"); exit(0);
#else
#if defined (i386)
printf("i386-unknown-mach\n"); exit(0);
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#if defined (MULTIMAX) || defined (n16)
#if defined (UMAXV)
printf("ns32k-encore-sysv\n"); exit(0);
#else
#if defined (CMU)
printf("ns32k-encore-mach\n"); exit(0);
#else
printf("ns32k-encore-bsd\n"); exit(0);
#endif
#endif
#endif
#if defined(__386BSD__) || (defined(__bsdi__) && defined(__i386__))
printf("i386-bsdi-bsd\n"); exit(0);
#endif
#if defined(sequent)
#if defined(i386)
printf("i386-sequent-dynix\n"); exit(0);
#endif
#if defined (ns32000)
printf("ns32k-sequent-dynix\n"); exit(0);
#endif
#endif
#if defined(_SEQUENT_)
printf("i386-sequent-ptx\n"); exit(0);
#endif
#if defined(vax)
#if !defined(ultrix)
printf("vax-dec-bsd\n"); exit(0);
#else
printf("vax-dec-ultrix\n"); exit(0);
#endif
#endif
exit (1);
}
EOF
${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0
rm -f dummy.c dummy
# Apollos put the system type in the environment.
test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
#echo '(Unable to guess system type)' 1>&2
exit 1

431
mozilla/config/config.mak Normal file
View File

@@ -0,0 +1,431 @@
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
!if !defined(CONFIG_CONFIG_MAK)
CONFIG_CONFIG_MAK=1
#//------------------------------------------------------------------------
#//
#// Define public make variables:
#//
#// OBJDIR - Specifies the location of intermediate files (ie. objs...)
#// Currently, the names are WINxx_O.OBJ or WINxx_D.OBJ for
#// optimized and debug builds respectively.
#//
#// DIST - Specifies the location of the distribution directory where
#// all targets are delivered.
#//
#// CFGFILE - Specifies the name of the temporary configuration file
#// containing the arguments to the current command.
#//
#// INCS - Default include paths.
#//
#// CFLAGS - Default compiler options.
#//
#// LFLAGS - Default linker options.
#//
#//------------------------------------------------------------------------
!if [$(MOZ_TOOLS)\bin\uname > osuname.inc]
!endif
WINOS=\
!include "osuname.inc"
WINOS=$(WINOS: =)^
!if [del osuname.inc]
!endif
# need this everywhere jsapi.h might be included
LCFLAGS=$(LCFLAGS) -DJS_THREADSAFE
!if "$(STAND_ALONE_JAVA)" == "1"
LCFLAGS=$(LCFLAGS) -DSTAND_ALONE_JAVA
!endif
!ifndef MOZ_JAVA
MOZ_OJI = 1 # on by default now
!endif
!ifdef MOZ_LIBTEST
MOZ_LIBTEST = 1
LCFLAGS=$(LCFLAGS) -DLAYPROBE_API
!endif
!ifdef MOZ_JAVA
MOZ_JAVA_FLAG=-DJAVA
!ifdef MOZ_OJI
!error You can't define both MOZ_JAVA and MOZ_OJI anymore.
!endif
JAVA_OR_OJI = 1
JAVA_OR_NSJVM = 1
!endif
!ifdef NSJVM
JAVA_OR_NSJVM = 1
AWT_11 = 1 # always build awt 1.1 with nsjvm now
!endif
!ifdef MOZ_OJI
LCFLAGS=$(LCFLAGS) -DOJI
JAVA_OR_OJI=1
!endif
!ifdef SMART_MAIL
LCFLAGS=$(LCFLAGS) -DSMART_MAIL
!endif
!ifdef MOZ_TRACE_XPCOM_REFCNT
LCFLAGS=$(LCFLAGS) -DMOZ_TRACE_XPCOM_REFCNT
!endif
!ifdef MOZ_SMOOTH_PROGRESS
LCFLAGS=$(LCFLAGS) -DSMOOTH_PROGRESS
!endif
## Include support for MOZ_LITE/MOZ_MEDIUM
include <$(DEPTH)/config/liteness.mak>
!if "$(MOZ_BITS)" == "16"
!if "$(MAKE_OBJ_TYPE)" == "DLL"
OBJTYPE=D
!else
OBJTYPE=E
!endif
!else
OBJTYPE=
!endif
XPDIST=$(DEPTH)\dist
PUBLIC=$(XPDIST)\public
#//-----------------------------------------------------------------------
#// OBJDIR is NOT the same as DIST for Win16. The Win16 dist stuff can
#// be built with EXE or DLL compiler flags, but the DIST directory
#// has the same name no matter what
#//-----------------------------------------------------------------------
!ifdef NGLAYOUT_BUILD_PREFIX
DIST_PREFIX=NGL
!else
!ifdef MOZ_NAV_BUILD_PREFIX
DIST_PREFIX=NAV
!else
DIST_PREFIX=WIN
!endif
!endif
!ifndef MOZ_DEBUG
OBJDIR=$(DIST_PREFIX)$(MOZ_BITS)$(OBJTYPE)_O.OBJ
JAVA_OPTIMIZER = -O
!ifdef NO_CAFE
JAVAC_OPTIMIZER =
!else
#JAVAC_OPTIMIZER= -O -noinline
JAVAC_OPTIMIZER =
!endif
!else
OBJDIR=$(DIST_PREFIX)$(MOZ_BITS)$(OBJTYPE)_D.OBJ
JAVA_OPTIMIZER = -g
JAVAC_OPTIMIZER = -g
!endif
#//
#// DIST DEFINES SHOULD NEVER BE COMPONENT SPECIFIC.
#//
!ifndef MOZ_DEBUG
DIST=$(XPDIST)\$(DIST_PREFIX)$(MOZ_BITS)_O.OBJ
!else
DIST=$(XPDIST)\$(DIST_PREFIX)$(MOZ_BITS)_D.OBJ
!endif
# This will always give the location of NGLayout's dist, even if "NGLAYOUT_BUILD_PREFIX" is not defined.
!if defined(MOZ_NGLAYOUT)
!ifndef MOZ_DEBUG
NGLAYOUT_DIST=$(XPDIST)\NGL$(MOZ_BITS)_O.OBJ
!else
NGLAYOUT_DIST=$(XPDIST)\NGL$(MOZ_BITS)_D.OBJ
!endif
!endif
CFGFILE=$(OBJDIR)\cmd.cfg
!if "$(MOZ_BITS)" == "16"
INCS=-I$(XPDIST)\public\win16 $(INCS) -I$(DEPTH)\include -I$(DIST)\include -I..\include
!else
INCS=$(INCS) -I$(DEPTH)\include -I$(DIST)\include \
-I$(XPDIST)\public\img -I$(XPDIST)\public\util \
-I$(XPDIST)\public\coreincl
!endif # 16
!ifndef NO_LAYERS
INCS=$(INCS) -I$(DEPTH)\lib\liblayer\include
!endif
# Perhaps we should add MOZ_LITENESS_FLAGS to 16 bit build
!if "$(MOZ_BITS)" == "16"
CFLAGS=$(MOZ_JAVA_FLAG) -DLAYERS -DEDITOR $(OS_CFLAGS) $(MOZ_CFLAGS)
!else
CFLAGS=$(MOZ_JAVA_FLAG) -DLAYERS $(OS_CFLAGS) $(MOZ_CFLAGS) $(MOZ_LITENESS_FLAGS)
!endif
LFLAGS=$(OS_LFLAGS) $(LLFLAGS) $(MOZ_LFLAGS)
# This compiles in heap dumping utilities and other good stuff
# for developers -- maybe we only want it in for a special SDK
# nspr/java runtime(?):
!if "$(MOZ_BITS)"=="32" || defined(MOZ_DEBUG)
CFLAGS = $(CFLAGS) -DDEVELOPER_DEBUG
!endif
!ifdef STANDALONE_IMAGE_LIB
CFLAGS=$(CFLAGS) -DSTANDALONE_IMAGE_LIB
!endif
!ifdef MODULAR_NETLIB
CFLAGS=$(CFLAGS) -DMODULAR_NETLIB -DNS_MT_SUPPORTED -DNETLIB_THREAD
!else
# Defines for new cookie management...
CFLAGS=$(CFLAGS) -DCookieManagement -DSingleSignon
!endif
# Defines for new privacy features...
!ifdef MOZ_TRANSACTION_RECEIPTS
CFLAGS=$(CFLAGS) -DTRANSACTION_RECEIPTS
!endif
# TODO Cleanup later -Gagan
!ifdef NU_CACHE
CFLAGS=$(CFLAGS) -DNU_CACHE
!endif
# always need these:
CFLAGS = $(CFLAGS) -DNETSCAPE
# Specify that we are building a client.
# This will instruct the cross platform libraries to
# include all the client specific cruft.
!if defined(SERVER_BUILD)
CFLAGS = $(CFLAGS) -DSERVER_BUILD
!elseif defined(LIVEWIRE)
CFLAGS = $(CFLAGS) -DLIVEWIRE
!else
CFLAGS = $(CFLAGS) -DMOZILLA_CLIENT
!endif
PERL= $(MOZ_TOOLS)\perl5\bin\perl.exe
MASM = $(MOZ_TOOLS)\bin\ml.exe
!if "$(WINOS)" == "WIN95"
MKDIR = $(DEPTH)\config\w95mkdir
QUIET =
!else
MKDIR = mkdir
QUIET=@
!endif
#//------------------------------------------------------------------------
#//
#// Include the OS dependent configuration information
#//
#//------------------------------------------------------------------------
include <$(DEPTH)/config/WIN$(MOZ_BITS)>
!ifdef MOZ_DEBUG
!ifdef USERNAME
CFLAGS = $(CFLAGS) -DDEBUG_$(USERNAME)
!endif
!if defined(GLOWCODE) && defined(GLOWPROF) && "$(MOZ_BITS)"=="32"
CFLAGS = $(CFLAGS) -Gh
!endif
!endif
#//------------------------------------------------------------------------
#//
#// Define the global make commands.
#//
#// MAKE_INSTALL - Copy a target to the distribution directory.
#//
#// MAKE_OBJDIRS - Create an object directory (if necessary).
#//
#// MAKE_MANGLE - Convert all long filenames into 8.3 names
#//
#// MAKE_UNMANGLE - Restore all long filenames
#//
#//------------------------------------------------------------------------
!if !defined(MOZ_SRC)
#enable builds on any drive if defined.
MOZ_SRC=y:
!endif
MAKE_INSTALL=$(QUIET)$(DEPTH)\config\makecopy.exe
MAKE_MANGLE=$(DEPTH)\config\mangle.exe
MAKE_UNMANGLE=if exist unmangle.bat call unmangle.bat
#//------------------------------------------------------------------------
#//
#// Common Libraries
#//
#//------------------------------------------------------------------------
!if "$(MOZ_BITS)" == "16"
LIBNSPR=$(DIST)\lib\nspr21.lib
LIBNSPR=$(LIBNSPR) $(DIST)\lib\plds21.lib
!else
LIBNSPR=$(DIST)\lib\libnspr21.lib
LIBNSPR=$(LIBNSPR) $(DIST)\lib\libplds21.lib
!endif
NSPRDIR = nsprpub
CFLAGS = $(CFLAGS) -DNSPR20
LIBJPEG=$(DIST)\lib\jpeg$(MOZ_BITS)$(VERSION_NUMBER).lib
######################################################################
### Windows-Specific Java Stuff
PATH_SEPARATOR = ;
# where the bytecode will go
!if "$(AWT_11)" == "1"
JAVA_DESTPATH = $(DEPTH)\dist\classes11
!else
JAVA_DESTPATH = $(DEPTH)\dist\classes
!endif
# where the source are
DEFAULT_JAVA_SOURCEPATH = $(DEPTH)\sun-java\classsrc
!ifndef JAVA_SOURCEPATH
!if "$(AWT_11)" == "1"
JAVA_SOURCEPATH = $(DEPTH)\sun-java\classsrc11;$(DEFAULT_JAVA_SOURCEPATH)
!else
JAVA_SOURCEPATH = $(DEFAULT_JAVA_SOURCEPATH)
!endif
!endif
JAVA_PROG=$(MOZ_TOOLS)\bin\java.exe
#JAVA_PROG=$(DIST)\bin\java
JAVAC_ZIP=$(MOZ_TOOLS)/lib/javac.zip
ZIP_PROG = $(MOZ_TOOLS)\bin\zip
UNZIP_PROG = $(MOZ_TOOLS)\bin\unzip
ZIP_COMPR = 9
ZIP_FLAGS = -$(ZIP_COMPR)r
CFLAGS = $(CFLAGS) -DOS_HAS_DLL
DLL_SUFFIX = dll
LIB_SUFFIX = lib
!if "$(STAND_ALONE_JAVA)" == "1"
STAND_ALONE_JAVA_DLL_SUFFIX=s
!else
STAND_ALONE_JAVA_DLL_SUFFIX=
!endif
MOD_JRT=jrt$(MOZ_BITS)$(VERSION_NUMBER)
MOD_MM =mm$(MOZ_BITS)$(VERSION_NUMBER)
MOD_AWT=awt$(MOZ_BITS)$(VERSION_NUMBER)
MOD_AWTS=awt$(MOZ_BITS)$(VERSION_NUMBER)$(STAND_ALONE_JAVA_DLL_SUFFIX)
MOD_JIT=jit$(MOZ_BITS)$(VERSION_NUMBER)
MOD_JSJ=jsj$(MOZ_BITS)$(VERSION_NUMBER)
MOD_NET=net$(MOZ_BITS)$(VERSION_NUMBER)
MOD_JBN=jbn$(MOZ_BITS)$(VERSION_NUMBER)
MOD_NSC=nsc$(MOZ_BITS)$(VERSION_NUMBER)
MOD_JPW=jpw$(MOZ_BITS)$(VERSION_NUMBER)
MOD_JDB=jdb$(MOZ_BITS)$(VERSION_NUMBER)
MOD_ZIP=zip$(MOZ_BITS)$(VERSION_NUMBER)
MOD_ZPW=zpw$(MOZ_BITS)$(VERSION_NUMBER)
MOD_CON=con$(MOZ_BITS)$(VERSION_NUMBER)
MOD_NPJ=npj$(MOZ_BITS)$(VERSION_NUMBER)
JRTDLL=$(MOD_JRT).$(DLL_SUFFIX)
MMDLL =$(MOD_MM).$(DLL_SUFFIX)
AWTDLL=$(MOD_AWT).$(DLL_SUFFIX)
AWTSDLL=$(MOD_AWT)$(STAND_ALONE_JAVA_DLL_SUFFIX).$(DLL_SUFFIX)
JITDLL=$(MOD_JIT).$(DLL_SUFFIX)
JSJDLL=$(MOD_JSJ).$(DLL_SUFFIX)
NETDLL=$(MOD_NET).$(DLL_SUFFIX)
JBNDLL=$(MOD_JBN).$(DLL_SUFFIX)
NSCDLL=$(MOD_NSC).$(DLL_SUFFIX)
JPWDLL=$(MOD_JPW).$(DLL_SUFFIX)
JDBDLL=$(MOD_JDB).$(DLL_SUFFIX)
ZIPDLL=$(MOD_ZIP).$(DLL_SUFFIX)
ZPWDLL=$(MOD_ZPW).$(DLL_SUFFIX)
CONDLL=$(MOD_CON).$(DLL_SUFFIX)
NPJDLL=$(MOD_NPJ).$(DLL_SUFFIX)
ZIPLIB=$(DIST)\lib\$(MOD_ZIP).$(LIB_SUFFIX)
AWTLIB=$(DIST)\lib\$(MOD_AWT).$(LIB_SUFFIX)
######################################################################
include <$(DEPTH)/config/common.mk>
JAVA_DEFINES = \
-DJAR_NAME=\"$(JAR_NAME)\" \
-DJRTDLL=\"$(JRTDLL)\" \
-DMMDLL=\"$(MMDLL)\" \
-DAWTDLL=\"$(AWTDLL)\" \
-DAWTSDLL=\"$(AWTSDLL)\" \
-DJSJDLL=\"$(JSJDLL)\" \
-DJITDLL=\"$(JITDLL)\" \
-DNETDLL=\"$(NETDLL)\" \
-DJBNDLL=\"$(JBNDLL)\" \
-DNSCDLL=\"$(NSCDLL)\" \
-DJDBDLL=\"$(JDBDLL)\" \
-DJPWDLL=\"$(JPWDLL)\" \
-DZPWDLL=\"$(ZPWDLL)\" \
-DCONDLL=\"$(CONDLL)\"
!if "$(MOZ_BITS)" == "16"
# Override JAVA_DEFINES to make command line short for win16.
# Put any new defines into javadefs.h in ns/sun-java/include.
# This is to shorten the command line in order not to break Win16.
JAVA_DEFINES = -DJAR_NAME=\"$(JAR_NAME)\" -DMOZ_BITS=\"$(MOZ_BITS)\" -DVERSION_NUMBER=\"$(VERSION_NUMBER)\" -DDLL_SUFFIX=\".$(DLL_SUFFIX)\"
!endif
!if "$(AWT_11)" == "1"
JAVA_DEFINES = $(JAVA_DEFINES) -DAWT_11
!else
JAVA_DEFINES = $(JAVA_DEFINES) -DAWT_102
!endif
#JAVA_CLASSPATH = $(JAVA_CLASSPATH:/=\)
JMCSRCDIR = $(JMCSRCDIR:/=\)
JAVA_BOOT_CLASSPATH = $(JAVA_BOOT_CLASSPATH:/=\)
NMAKE=nmake -nologo -$(MAKEFLAGS)
########
# Get the cwd to prepend to all compiled source
# files. Will allow debugger to automatically find sources
# instead of asking for the path info.
# Win16 will break if enabled, guess we continue to live in pain
# therein.
########
!if "$(MOZ_BITS)" == "32"
CURDIR=$(MAKEDIR)^\
!endif
!endif # CONFIG_CONFIG_MAK

754
mozilla/config/config.mk Normal file
View File

@@ -0,0 +1,754 @@
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
#
# config.mk
#
# Determines the platform and builds the macros needed to load the
# appropriate platform-specific .mk file, then defines all (most?)
# of the generic macros.
#
ifndef topsrcdir
topsrcdir = $(DEPTH)
endif
# This wastes time.
include $(topsrcdir)/config/common.mk
#
# Important internal static macros
#
OS_ARCH := $(subst /,_,$(shell uname -s))
OS_RELEASE := $(shell uname -r)
OS_TEST := $(shell uname -m)
#
# Tweak the default OS_ARCH and OS_RELEASE macros as needed.
#
ifeq ($(OS_ARCH),AIX)
OS_RELEASE := $(shell uname -v).$(shell uname -r)
endif
ifeq ($(OS_ARCH),BSD_386)
OS_ARCH := BSD_OS
endif
ifeq ($(OS_ARCH),dgux)
OS_ARCH := DGUX
endif
ifeq ($(OS_ARCH),IRIX64)
OS_ARCH := IRIX
endif
ifeq ($(OS_ARCH),UNIX_SV)
ifneq ($(findstring NCR,$(shell grep NCR /etc/bcheckrc | head -1 )),)
OS_ARCH := NCR
else
OS_ARCH := UNIXWARE
OS_RELEASE := $(shell uname -v)
endif
endif
ifeq ($(OS_ARCH),ncr)
OS_ARCH := NCR
endif
# This is the only way to correctly determine the actual OS version on NCR boxes.
ifeq ($(OS_ARCH),NCR)
OS_RELEASE := $(shell awk '{print $$3}' /etc/.relid | sed 's/^\([0-9]\)\(.\)\(..\)\(.*\)$$/\2.\3/')
endif
ifeq ($(OS_ARCH),UNIX_System_V)
OS_ARCH := NEC
endif
ifeq ($(OS_ARCH),QNX)
OS_RELEASE := $(shell uname -v | sed 's/^\([0-9]\)\([0-9]*\)$$/\1.\2/')
endif
ifeq ($(OS_ARCH),SCO_SV)
OS_ARCH := SCOOS
OS_RELEASE := 5.0
endif
ifneq (,$(filter SINIX-N SINIX-Y SINIX-Z ReliantUNIX-M,$(OS_ARCH)))
OS_ARCH := SINIX
OS_TEST := $(shell uname -p)
endif
ifeq ($(OS_ARCH),UnixWare)
OS_ARCH := UNIXWARE
OS_RELEASE := $(shell uname -v)
endif
#
# Strip off the excessively long version numbers on these platforms,
# but save the version to allow multiple versions of the same base
# platform to be built in the same tree.
#
ifneq (,$(filter FreeBSD HP-UX IRIX Linux NetBSD OpenBSD OSF1 SunOS,$(OS_ARCH)))
OS_VERS := $(suffix $(OS_RELEASE))
OS_RELEASE := $(basename $(OS_RELEASE))
# Allow the user to ignore the OS_VERSION, which is usually irrelevant.
ifndef MOZILLA_CONFIG_IGNORE_OS_VERSION
OS_VERSION := $(shell echo $(OS_VERS) | sed 's/-.*//')
endif
endif
OS_CONFIG := $(OS_ARCH)$(OS_RELEASE)
#
# Personal makefile customizations go in these optional make include files.
#
MY_CONFIG := $(DEPTH)/config/myconfig.mk
MY_RULES := $(DEPTH)/config/myrules.mk
#
# Relative pathname from top-of-tree to current source directory
#
ifneq (,$(filter-out OS2 WINNT,$(OS_ARCH)))
REVDEPTH := $(topsrcdir)/config/revdepth
SRCDIR = $(shell $(PERL) $(REVDEPTH).pl $(DEPTH))
endif
#
# Define an include-at-most-once flag
#
NS_CONFIG_MK = 1
#
# Provide the means to easily override our tool directory locations.
#
ifdef NETSCAPE_HIERARCHY
CONTRIB_BIN := /tools/contrib/bin/
JAVA_BIN := /usr/local/java/bin/
LOCAL_BIN := /usr/local/bin/
LOCAL_SUN4 := /usr/local/sun4/bin/
NS_BIN := /tools/ns/bin/
NS_LIB := /tools/ns/lib
JAVA_LIB := /usr/local/netscape/java/lib
else
NS_LIB := .
JAVA_LIB := .
endif
# Allow NETSCAPE_COMMERCIAL to include XFEPRIVDIR
ifdef NETSCAPE_COMMERCIAL
XFEPRIVDIR := $(DEPTH)/../ns/cmd/xfe/
endif
#
# Default command macros; can be overridden in <arch>.mk.
#
AS = $(CC)
ASFLAGS = $(CFLAGS)
BSDECHO = echo
ifdef USE_AUTOCONF
CCC = $(CXX)
else
CC = gcc
CCC = g++
endif
CCF = $(CC) $(CFLAGS)
LINK_EXE = $(LINK) $(OS_LFLAGS) $(LFLAGS)
LINK_DLL = $(LINK) $(OS_DLLFLAGS) $(DLLFLAGS)
NFSPWD = $(DEPTH)/config/nfspwd
PURIFY = purify $(PURIFYOPTIONS)
QUANTIFY = quantify $(QUANTIFYOPTIONS)
RANLIB = /bin/true
SDKINSTALL = $(NSINSTALL) -t
UNZIP_PROG = $(LOCAL_BIN)/unzip
ZIP_PROG = $(LOCAL_BIN)/zip
ZIP_COMPR = 9
ZIP_FLAGS = -$(ZIP_COMPR)r
ifeq ($(OS_ARCH),OS2)
EMPTY :=
SLASH := /$(EMPTY)
BSLASH := \$(EMPTY)
SEMICOLON := ;$(EMPTY)
SPACE := $(EMPTY) $(EMPTY)
PATH_SEPARATOR := \;
RC = flipper rc$(BIN_SUFFIX)
XP_DEFINE = -DXP_PC
LIB_SUFFIX = lib
DLL_SUFFIX = dll
MAP_SUFFIX = map
BIN_SUFFIX = .exe
AR = flipper ILibo //noignorecase //nologo $@
IMPLIB = flipper ILibo //noignorecase //nologo $@
DLLFLAGS = -DLL -OUT:$@ $(XLFLAGS) -MAP:$(@:.dll=.map)
LFLAGS = $(OBJS) -OUT:$@ $(XLFLAGS) $(DEPLIBS) $(EXTRA_LIBS) -MAP:$(@:.dll=.map) $(DEF_FILE)
NSINSTALL = nsinstall
INSTALL = $(NSINSTALL)
JAVA_PROG = flipper java -norestart
JAVAC_ZIP = $(subst $(BSLASH),$(SLASH),$(JAVA_HOME))/lib/classes.zip
else
ifeq ($(OS_ARCH),WINNT)
PATH_SEPARATOR := :
RC = rc$(BIN_SUFFIX)
XP_DEFINE = -DXP_PC
LIB_SUFFIX = lib
DLL_SUFFIX = dll
BIN_SUFFIX = .exe
AR = lib -NOLOGO -OUT:"$@"
DLLFLAGS = $(XLFLAGS) -OUT:"$@"
LFLAGS = $(OBJS) $(DEPLIBS) $(EXTRA_LIBS) -OUT:"$@"
NSINSTALL = nsinstall
INSTALL = $(NSINSTALL)
JAVA_PROG = java
else
PATH_SEPARATOR := :
XP_DEFINE = -DXP_UNIX
AR = ar cr $@
DLL_SUFFIX = so
LIB_SUFFIX = a
ifeq ($(AWT_11),1)
JAVA_PROG = $(NS_BIN)java
JAVAC_ZIP = $(NS_LIB)/classes.zip
else
JAVA_PROG = $(LOCAL_BIN)java
JAVAC_ZIP = $(JAVA_LIB)/javac.zip
endif
PERL = perl
TAR = tar
EMACS = xemacs
WHOAMI = /usr/bin/whoami
endif
endif
ifdef USE_AUTOCONF
OPTIMIZER =
DEFINES += -UDEBUG -DNDEBUG -DTRIMMED
XBCFLAGS =
else
#
# Debug by default.
#
OBJDIR_TAG = _DBG
OPTIMIZER = -g
JAVA_OPTIMIZER = -g
XBCFLAGS = -FR$*
XCFLAGS = $(LCFLAGS)
XLFLAGS = $(LLFLAGS)
ifeq ($(OS_ARCH),OS2)
OPTIMIZER = -Ti+
XLFLAGS += -DEBUG
ifdef BUILD_PROFILE
OPTIMIZER += -Gh+
OBJDIR_TAG = _PRF
else
OPTIMIZER += -DDEBUG
ifdef BUILD_MEMDBG
OPTIMIZER += -Tm+ -DXP_OS2_MEMDEBUG=1
OBJDIR_TAG = _MEM
endif
endif
else
ifeq ($(OS_ARCH),WINNT)
OPTIMIZER = -Od -Z7
JAVA_OPTIMIZER = $(OPTIMIZER)
XLFLAGS += -DEBUG
else
DEFINES = -DDEBUG -UNDEBUG -DDEBUG_$(shell $(WHOAMI)) -DTRACING
endif
endif
ifdef BUILD_OPT
OBJDIR_TAG = _OPT
XBCFLAGS =
ifeq ($(OS_ARCH),OS2)
OPTIMIZER = -O+ -Oi -DNDEBUG
else
ifeq ($(OS_ARCH),WINNT)
OPTIMIZER = -O2
else
OPTIMIZER = -O
DEFINES = -UDEBUG -DNDEBUG -DTRIMMED
endif
endif
endif
endif # !USE_AUTOCONF
ifdef MOZ_DEBUG
ifdef USE_AUTOCONF
OPTIMIZER =
DEFINES += -DDEBUG -UNDEBUG -DDEBUG_$(shell $(WHOAMI)) -DTRACING
else
OPTIMIZER = -g
DEFINES = -DDEBUG -UNDEBUG -DDEBUG_$(shell $(WHOAMI)) -DTRACING
endif
JAVA_OPTIMIZER = -g
XBCFLAGS = -FR$*
endif
#
# XXX For now, we're including $(DEPTH)/include directly instead of
# getting this stuff from dist. This stuff is old and will eventually
# be put in the library directories where it belongs so that it can
# get exported to dist properly.
#
INCLUDES = $(LOCAL_INCLUDES) -I$(DIST)/include -I$(XPDIST)/include -I$(topsrcdir)/include $(OS_INCLUDES) $(G++INCLUDES)
LIBNT = $(DIST)/lib/libnt.$(LIB_SUFFIX)
LIBAWT = $(DIST)/lib/libawt.$(LIB_SUFFIX)
LIBMMEDIA = $(DIST)/lib/libmmedia.$(LIB_SUFFIX)
NSPRDIR = nsprpub
LIBNSPR = $(DIST)/lib/libplds21.$(LIB_SUFFIX) $(DIST)/lib/libnspr21.$(LIB_SUFFIX)
PURELIBNSPR = $(DIST)/lib/purelibplds21.$(LIB_SUFFIX) $(DIST)/lib/purelibnspr21.$(LIB_SUFFIX)
ifdef DBMALLOC
LIBNSPR += $(DIST)/lib/libdbmalloc.$(LIB_SUFFIX)
endif
ifeq ($(OS_ARCH),OS2)
LIBNSJAVA = $(DIST)/lib/jrt$(MOZ_BITS)$(VERSION_NUMBER).$(LIB_SUFFIX)
LIBMD = $(DIST)/lib/libjmd.$(LIB_SUFFIX)
LIBJAVA = $(DIST)/lib/libjrt.$(LIB_SUFFIX)
LIBNSPR = $(DIST)/lib/pr$(MOZ_BITS)$(VERSION_NUMBER).$(LIB_SUFFIX)
LIBXP = $(DIST)/lib/libxp.$(LIB_SUFFIX)
else
ifeq ($(OS_ARCH),WINNT)
LIBNSJAVA = $(DIST)/lib/jrt3221.$(LIB_SUFFIX)
else
LIBNSJAVA = $(DIST)/lib/nsjava32.$(LIB_SUFFIX)
endif
endif
CFLAGS = $(XP_DEFINE) $(OPTIMIZER) $(OS_CFLAGS) $(MDUPDATE_FLAGS) $(DEFINES) $(INCLUDES) $(XCFLAGS) $(PROF_FLAGS)
NOMD_CFLAGS = $(XP_DEFINE) $(OPTIMIZER) $(OS_CFLAGS) $(DEFINES) $(INCLUDES) $(XCFLAGS)
#
# Include the binary distrib stuff, if necessary.
#
ifdef NS_BUILD_CORE
include $(topsrcdir)/config/coreconf.mk
endif
#
# The following platforms support detection of paths and libraries.
#
# Need to define these before include the $ARCH.mk makefile
#
ifneq (,$(filter Linux,$(OS_ARCH)))
MOZILLA_DETECT = 1
MOZILLA_DETECT_DIR = $(DEPTH)/config/mkdetect
# A uniq identifier that describes this host
ifdef MOZILLA_CONFIG_HOST_IDENT
MOZILLA_DETECT_UNIQ_IDENT = $(MOZILLA_CONFIG_HOST_IDENT)
else
MOZILLA_DETECT_UNIQ_IDENT = $(shell $(topsrcdir)/config/mkdetect/detect_hostident.sh)
endif
MOZILLA_DETECT_NAME = detect_$(MOZILLA_DETECT_UNIQ_IDENT)_gen.mk
MOZILLA_DETECT_GEN = $(MOZILLA_DETECT_DIR)/$(MOZILLA_DETECT_NAME)
endif
ifndef USE_AUTOCONF
#
# Now include the platform-specific stuff.
#
include $(topsrcdir)/config/$(OS_ARCH).mk
endif # !USE_AUTOCONF
#
# Some platforms (Solaris) might require builds using either
# (or both) compiler(s).
#
ifdef SHOW_CC_TYPE
COMPILER = _$(notdir $(CC))
endif
#
# Name of the binary code directories
#
ifndef USE_AUTOCONF
ifeq ($(OS_ARCH)_$(PROCESSOR_ARCHITECTURE),WINNT_x86)
OBJDIR_NAME = $(OS_CONFIG)$(OS_VERSION)$(OBJDIR_TAG).OBJ
else
OBJDIR_NAME = $(OS_CONFIG)$(OS_VERSION)$(PROCESSOR_ARCHITECTURE)$(COMPILER)$(IMPL_STRATEGY)$(OBJDIR_TAG).OBJ
endif
else
# We're autoconf freaks here
# Override defaults
EMACS = $(ACEMACS)
PERL = $(ACPERL)
RANLIB = $(ACRANLIB)
UNZIP_PROG = $(ACUNZIP)
WHOAMI = $(ACWHOAMI)
ZIP_PROG = $(ACZIP)
endif
# Figure out where the binary code lives. It either lives in the src
# tree (NSBUILDROOT is undefined) or somewhere else.
ifdef NSBUILDROOT
BUILD = $(NSBUILDROOT)/$(OBJDIR_NAME)/build
OBJDIR = $(BUILD)/$(SRCDIR)
XPDIST = $(NSBUILDROOT)
DIST = $(NSBUILDROOT)/$(OBJDIR_NAME)/dist
else
BUILD = $(OBJDIR_NAME)
OBJDIR = $(OBJDIR_NAME)
XPDIST = $(DEPTH)/dist
DIST = $(DEPTH)/dist/$(OBJDIR_NAME)
endif
# all public include files go in subdirectories of PUBLIC:
PUBLIC = $(XPDIST)/public
ifdef USE_AUTOCONF
DEPENDENCIES = .md
else
VPATH = $(OBJDIR)
DEPENDENCIES = $(OBJDIR)/.md
endif
ifneq ($(OS_ARCH),WINNT)
MKDEPEND_DIR = $(DEPTH)/config/mkdepend
MKDEPEND = $(MKDEPEND_DIR)/$(OBJDIR_NAME)/mkdepend
MKDEPENDENCIES = $(OBJDIR)/depend.mk
endif
#
# Include any personal overrides the user might think are needed.
#
-include $(MY_CONFIG)
######################################################################
# Now test variables that might have been set or overridden by $(MY_CONFIG).
DEFINES += -DNETSCAPE -DOSTYPE=\"$(OS_CONFIG)\"
# Specify that we are building a client.
# This will instruct the cross platform libraries to
# include all the client specific cruft.
ifdef SERVER_BUILD
DEFINES += -DSERVER_BUILD
ifdef LIVEWIRE
DEFINES += -DLIVEWIRE
endif
STATIC_JAVA = yes
else
MOZILLA_CLIENT = 1
MOZ_JSD = 1
DEFINES += -DMOZILLA_CLIENT
endif
ifndef MODULAR_NETLIB
MOZ_COOKIEMANAGE = 1
endif
ifndef USE_AUTOCONF
ifdef MOZ_LITE
NO_UNIX_LDAP = 1
MOZ_NAV_BUILD_PREFIX = 1
else
DEFINES += -DMOZ_COMMUNICATOR_IIDS
MOZ_COMMUNICATOR_IIDS = 1
MOZ_COMMUNICATOR_CONFIG_JS = 1
MOZ_COPY_ALL_JARS = 1
MOZ_EDITOR = 1
endif
ifdef MOZ_MEDIUM
ifndef MODULAR_NETLIB
MOZ_MAIL_COMPOSE = 1
MOZ_SINGLESIGNON = 1
endif
endif
endif # ! USE_AUTOCONF
ifdef MOZ_MAIL_COMPOSE
DEFINES += -DMOZ_MAIL_COMPOSE
endif
ifdef MOZ_DARK
DEFINES += -DMOZ_LDAP -DMOZ_MAIL_NEWS -DMOZ_NEO -DMOZ_OFFLINE -DMOZ_TASKBAR
MOZ_LDAP = 1
MOZ_MAIL_NEWS = 1
MOZ_NEO = 1
MOZ_OFFLINE = 1
MOZ_TASKBAR = 1
endif
ifdef MOZ_SINGLESIGNON
DEFINES += -DSingleSignon
endif
ifdef MOZ_COOKIEMANAGE
DEFINES += -DCookieManagement
endif
ifdef MOZ_SMOOTH_PROGRESS
DEFINES += -DSMOOTH_PROGRESS
endif
ifdef MOZ_EDITOR
#
# Enable HTMLArea form element support.
#
DEFINES += -DENDER -DMOZ_ENDER_MIME
endif
ifdef MOZ_SECURITY
DEFINES += -DMOZ_SECURITY
endif
# Crash-reporting system
ifdef MOZ_FULLCIRCLE
DEFINES += -DMOZ_FULLCIRCLE
endif
ifdef MOZ_EDITOR
DEFINES += -DEDITOR -DEDITOR_UI
BUILD_EDITOR = 1
BUILD_EDITOR_UI = 1
BUILD_EDT = 1
endif
# Build layers by default
ifndef NO_LAYERS
DEFINES += -DLAYERS
endif
ifdef BUILD_DEBUG_GC
DEFINES += -DDEBUG_GC
endif
ifdef BUILD_UNIX_PLUGINS
# UNIX_EMBED Should not be needed. For now these two defines go
# together until I talk with jg. --dp
DEFINES += -DUNIX_EMBED -DX_PLUGINS
endif
ifndef NO_UNIX_LDAP
DEFINES += -DUNIX_LDAP
endif
ifdef MOZ_MEDIUM
ifndef MODULAR_NETLIB
SMART_MAIL = 1
endif
endif
# i'm not sure if SHACK and ENDER still need to be defined explicitly
# but I will just to be on the safe side. -skinny
ifdef SMART_MAIL
DEFINES += -DSMART_MAIL -DENDER -DMOZ_ENDER_MIME -DSHACK
endif
#
# Platform dependent switching off of JAVA
#
ifndef MOZ_JAVA
ifndef USE_AUTOCONF
MOZ_OJI = 1 # on by default now
endif
endif
ifdef MOZ_LIBTEST
DEFINES += -DLAYPROBE_API
MOZ_LIBTEST = 1
endif
ifdef MOZ_JAVA
DEFINES += -DJAVA
ifdef MOZ_OJI
error You can't define both MOZ_JAVA and MOZ_OJI anymore.
endif
JAVA_OR_OJI = 1
JAVA_OR_NSJVM = 1
endif
ifdef NSJVM
JAVA_OR_NSJVM = 1
endif
ifdef MOZ_OJI
DEFINES += -DOJI
JAVA_OR_OJI = 1
endif
ifdef JAVA_OR_NSJVM # XXX fix -- su can't depend on java
MOZ_SMARTUPDATE = 1
endif
DEFINES += -DJS_THREADSAFE
ifdef FORTEZZA
DEFINES += -DFORTEZZA
endif
ifdef UNIX_SKIP_ASSERTS
DEFINES += -DUNIX_SKIP_ASSERTS
endif
ifdef SHACK
DEFINES += -DSHACK
endif
ifdef MOZ_DOM
DEFINES += -DDOM
endif
ifndef NO_UNIX_ASYNC_DNS
DEFINES += -DUNIX_ASYNC_DNS
endif
ifdef MOZ_TRANSACTION_RECEIPTS
DEFINES += -DTRANSACTION_RECEIPTS
endif
# For profiling
ifdef MOZILLA_GPROF
# Don't want profiling on build tools..
ifneq ($(SRCDIR),config)
PROF_FLAGS = $(OS_GPROF_FLAGS) -DMOZILLA_GPROF
endif
endif
# This compiles in heap dumping utilities and other good stuff
# for developers -- maybe we only want it in for a special SDK
# nspr/java runtime(?):
ifndef USE_AUTOCONF
DEFINES += -DDEVELOPER_DEBUG
endif
#
# For the standalone image lib
#
ifdef STANDALONE_IMAGE_LIB
DEFINES += -DSTANDALONE_IMAGE_LIB
endif
ifdef MODULAR_NETLIB
DEFINES += -DMODULAR_NETLIB
endif
ifndef MOZ_FE
MOZ_FE = x
endif
ifndef MOZ_USER_DIR
MOZ_USER_DIR = \".netscape\"
endif
DEFINES += -DMOZ_USER_DIR=$(MOZ_USER_DIR)
######################################################################
GARBAGE = $(DEPENDENCIES) core $(wildcard core.[0-9]*) $(wildcard *.err)
ifndef SDK
SDK = $(DEPTH)/dist/sdk
endif
ifneq ($(OS_ARCH),WINNT)
NSINSTALL = $(DEPTH)/config/$(OBJDIR_NAME)/nsinstall
ifeq ($(NSDISTMODE),copy)
# copy files, but preserve source mtime
INSTALL = $(NSINSTALL) -t
else
ifeq ($(NSDISTMODE),absolute_symlink)
# install using absolute symbolic links
INSTALL = $(NSINSTALL) -L `$(NFSPWD)`
else
# install using relative symbolic links
INSTALL = $(NSINSTALL) -R
endif
endif
endif
######################################################################
### Java Stuff - see common.mk
######################################################################
# where the bytecode will go
JAVA_DESTPATH = $(XPDIST)/classes
# where the sources for the module you are compiling are
# default is sun-java/classsrc, override for other modules
ifndef JAVA_SOURCEPATH
JAVA_SOURCEPATH = $(DEPTH)/sun-java/classsrc
endif
ifndef JAVAH_IN_JAVA
ifeq ($(OS_ARCH),OS2)
JAVAH_PROG = flipper $(DIST)/bin/javah
else
JAVAH_PROG = $(DIST)/bin/javah
endif
else
JAVAH_PROG = $(JAVA) netscape.tools.jric.Main
endif
ifeq ($(STAND_ALONE_JAVA),1)
STAND_ALONE_JAVA_DLL_SUFFIX = s
endif
ifeq ($(OS_ARCH),OS2)
AWTDLL = awt$(MOZ_BITS)$(VERSION_NUMBER).$(DLL_SUFFIX)
AWTSDLL = awt$(MOZ_BITS)$(VERSION_NUMBER)$(STAND_ALONE_JAVA_DLL_SUFFIX).$(DLL_SUFFIX)
CONDLL = con.$(MOZ_BITS)$(VERSION_NUMBER)(DLL_SUFFIX)
JBNDLL = jbn.$(MOZ_BITS)$(VERSION_NUMBER)(DLL_SUFFIX)
JDBCDLL = jdb.$(MOZ_BITS)$(VERSION_NUMBER)(DLL_SUFFIX)
JITDLL = jit.$(MOZ_BITS)$(VERSION_NUMBER)(DLL_SUFFIX)
JPWDLL = jpw.$(MOZ_BITS)$(VERSION_NUMBER)(DLL_SUFFIX)
JRTDLL = jrt$(MOZ_BITS)$(VERSION_NUMBER).$(DLL_SUFFIX)
JSJDLL = jsj.$(MOZ_BITS)$(VERSION_NUMBER)(DLL_SUFFIX)
MMDLL = mm$(MOZ_BITS)$(VERSION_NUMBER).$(DLL_SUFFIX)
NETDLL = net.$(MOZ_BITS)$(VERSION_NUMBER)(DLL_SUFFIX)
NSCDLL = nsc.$(MOZ_BITS)$(VERSION_NUMBER)(DLL_SUFFIX)
ZIPDLL = zip.$(MOZ_BITS)$(VERSION_NUMBER)(DLL_SUFFIX)
ZPWDLL = zpw.$(MOZ_BITS)$(VERSION_NUMBER)(DLL_SUFFIX)
else
AWTDLL = libawt.$(DLL_SUFFIX)
AWTSDLL = libawt$(STAND_ALONE_JAVA_DLL_SUFFIX).$(DLL_SUFFIX)
CONDLL = libcon.$(DLL_SUFFIX)
JBNDLL = libjbn.$(DLL_SUFFIX)
JDBCDLL = libjdb.$(DLL_SUFFIX)
JITDLL = libjit.$(DLL_SUFFIX)
JPWDLL = libjpw.$(DLL_SUFFIX)
JRTDLL = libjrt.$(DLL_SUFFIX)
JSJDLL = libjsj.$(DLL_SUFFIX)
MMDLL = libmm.$(DLL_SUFFIX)
NETDLL = libnet.$(DLL_SUFFIX)
NSCDLL = libnsc.$(DLL_SUFFIX)
ZIPDLL = libzip.$(DLL_SUFFIX)
ZPWDLL = libzpw.$(DLL_SUFFIX)
endif
JAVA_DEFINES += -DAWTSDLL=\"$(AWTSDLL)\" -DCONDLL=\"$(CONDLL)\" -DJBNDLL=\"$(JBNDLL)\" -DJDBDLL=\"$(JDBDLL)\" \
-DJSJDLL=\"$(JSJDLL)\" -DNETDLL=\"$(NETDLL)\" -DNSCDLL=\"$(NSCDLL)\" -DZPWDLL=\"$(ZPWDLL)\" \
-DJAR_NAME=\"$(JAR_NAME)\"
ifeq ($(AWT_11),1)
JAVA_DEFINES += -DAWT_11
else
JAVA_DEFINES += -DAWT_102
endif
# I don't believe this is still true -cls
ifndef USE_AUTOCONF
# From nsprpub/config/config.mk, mozilla/jpeg needs to know
# about USE_PTHREADS. This fixes platforms like SparcLinux. -mcafee
ifeq ($(USE_PTHREADS), 1)
OS_CFLAGS += -D_PR_PTHREADS -UHAVE_CVAR_BUILT_ON_SEM
endif
endif #!USE_AUTOCONF

View File

@@ -0,0 +1,44 @@
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
#
# coreconf.mk
#
# Defines the macro definitions for the modules that do binary
# distributions into /m/dist.
#
#
# Are we building the client?
#
ifndef SERVER_BUILD
ifeq ($(OS_ARCH),SunOS)
IMPL_STRATEGY = _LOCAL
else
IMPL_STRATEGY = _CLASSIC
else
ifeq ($(PTHREADS_USER),1)
USE_PTHREADS =
IMPL_STRATEGY = _PTH_USER
endif
ifeq ($(USE_PTHREADS),1)
IMPL_STRATEGY = _PTH
endif
endif

25
mozilla/config/cvsco.pl Executable file
View File

@@ -0,0 +1,25 @@
#!perl
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
chdir($ENV{'MOZ_SRC'});
$cmd = "cvs -q co ".$ARGV[0]." ".$ARGV[1];
print "Excecuting ".$cmd."...\n";
system($cmd);

90
mozilla/config/dll.inc Normal file
View File

@@ -0,0 +1,90 @@
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
!if !defined(VERBOSE)
.SILENT:
!endif
#//------------------------------------------------------------------------
#//
#// This makefile contains all of the rules necessary to build 16 and 32 bit
#// DLLs.
#//
#//------------------------------------------------------------------------
!if defined(DLL) && !defined(CONFIG_DLL_INC)
CONFIG_DLL_INC=1
!if "$(MOZ_BITS)" == "16"
#//------------------------------------------------------------------------
#//
#// Rule to build a 16-bit DLL using the DLL target
#//
#//------------------------------------------------------------------------
$(DLL): $(OBJDIR) $(OBJS) $(RESFILE) $(DEFFILE) $(MISCDEP)
echo +++ make: Creating DLL: $@
# //
# // create response file for the command. The format is:
# // Object files, Output file, Map file, Libraries, DEF file, RES file
# //
echo $(LFLAGS) > $(CFGFILE)
echo /implib:$*.lib >> $(CFGFILE)
for %%d in ($(OBJS)) do echo %%d + >> $(CFGFILE)
echo. >> $(CFGFILE)
echo $(OBJDIR)\$(*B).dll, >> $(CFGFILE)
!ifdef MAPFILE
echo $(MAPFILE), >> $(CFGFILE)
!endif
echo $(LLIBS) $(OS_LIBS) >> $(CFGFILE)
!ifdef DEFFILE
echo $(DEFFILE), >> $(CFGFILE)
!else
echo. >> $(CFGFILE)
!endif
!ifdef RESFILE
echo $(RESFILE), >> $(CFGFILE)
!else
echo. >> $(CFGFILE)
!endif
# //
# // execute the commands
# //
$(LD) @$(CFGFILE)
!else
#//------------------------------------------------------------------------
#//
#// Rule to build a 32-bit DLL using the DLL target
#//
#//------------------------------------------------------------------------
$(DLL): $(OBJDIR) $(OBJS) $(RESFILE) $(DEFFILE) $(MISCDEP)
echo +++ make: Creating DLL: $@
$(LD) @<<$(CFGFILE)
/NOLOGO /DLL /OUT:$@
/PDB:$(PDBFILE)
!ifdef DEFFILE
/DEF:$(DEFFILE)
!endif
!ifdef MAPFILE
/MAP:$(MAPFILE)
!endif
$(LFLAGS)
$(OBJS)
$(RESFILE)
$(LLIBS) $(OS_LIBS)
<<KEEP
!endif
!endif # DLL && ! CONFIG_DLL_INC

87
mozilla/config/exe.inc Normal file
View File

@@ -0,0 +1,87 @@
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
!if !defined(VERBOSE)
.SILENT:
!endif
#//------------------------------------------------------------------------
#//
#// This makefile contains all of the rules necessary to build 16 and 32 bit
#// executables.
#//
#//------------------------------------------------------------------------
!if defined(PROGRAM) && !defined(CONFIG_EXE_INC)
CONFIG_EXE_INC=1
!if "$(MOZ_BITS)" == "16"
#//------------------------------------------------------------------------
#//
#// Rule to build a 16-bit executable using the PROGRAM target
#//
#//------------------------------------------------------------------------
$(PROGRAM):: $(OBJDIR) $(OBJS) $(RESFILE) $(DEFFILE) $(MISCDEP)
echo +++ make: Creating EXE: $@
# //
# // create response file for the command. The format is:
# // Object files, Output file, Map file, Libraries, DEF file, RES file
# //
echo $(LFLAGS) > $(CFGFILE)
for %%d in ($(OBJS)) do echo %%d + >> $(CFGFILE)
echo. >> $(CFGFILE)
echo $(OBJDIR)\$(*B).exe, >> $(CFGFILE)
echo $(MAPFILE), >> $(CFGFILE)
echo $(LLIBS) $(OS_LIBS) >> $(CFGFILE)
!ifdef DEFFILE
echo $(DEFFILE), >> $(CFGFILE)
!else
echo. >> $(CFGFILE)
!endif
!ifdef RESFILE
echo $(RESFILE), >> $(CFGFILE)
!else
echo. >> $(CFGFILE)
!endif
# //
# // execute the command
# //
$(LD) /ST:8192 @$(CFGFILE)
!else
#//------------------------------------------------------------------------
#//
#// Rule to build a 32-bit executable using the PROGRAM target
#//
#//------------------------------------------------------------------------
$(PROGRAM):: $(OBJDIR) $(OBJS) $(RESFILE) $(DEFFILE) $(MISCDEP)
echo +++ make: Creating EXE: $@
$(LD) @<<$(CFGFILE)
/NOLOGO /OUT:$@
/PDB:$(PDBFILE)
!ifdef DEFFILE
/DEF:$(DEFFILE)
!endif
!ifdef MAPFILE
/MAP:$(MAPFILE)
!endif
$(LFLAGS)
$(OBJS)
$(RESFILE)
$(LLIBS) $(OS_LIBS)
<<
!endif
!endif # PROGRAM && ! CONFIG_EXE_INC

53
mozilla/config/fastcwd.pl Normal file
View File

@@ -0,0 +1,53 @@
#!perl5
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
# By John Bazik
#
# Usage: $cwd = &fastcwd;
#
# This is a faster version of getcwd. It's also more dangerous because
# you might chdir out of a directory that you can't chdir back into.
#
sub fastcwd {
local($odev, $oino, $cdev, $cino, $tdev, $tino);
local(@path, $path);
local(*DIR);
($cdev, $cino) = stat('.');
for (;;) {
($odev, $oino) = ($cdev, $cino);
chdir('..');
($cdev, $cino) = stat('.');
last if $odev == $cdev && $oino == $cino;
opendir(DIR, '.');
for (;;) {
$_ = readdir(DIR);
next if $_ eq '.';
next if $_ eq '..';
last unless $_;
($tdev, $tino) = lstat($_);
last unless $tdev != $odev || $tino != $oino;
}
closedir(DIR);
unshift(@path, $_);
}
chdir($path = '/' . join('/', @path));
$path;
}
1;

214
mozilla/config/glibcversion.sh Executable file
View File

@@ -0,0 +1,214 @@
#!/bin/sh
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
##############################################################################
##
## Name: glibcversion.sh - Print __GLIBC__ version if gnu libc 2 is
## found.
##
## Description: This script is needed by the mozilla build system. It needs
## to determine whether the current platform (mostly the
## various linux "platforms") are based on the gnu libc2. This
## information is later used in mozilla to determine whether
## gnu libc 2 specific "features" need to be handled, such
## as broken locales.
##
## Author: Ramiro Estrugo <ramiro@netscape.com>
##
##############################################################################
##
## Command Line Flags Supported:
##
## -g | --is-glibc2: Print True/False if detected __GLIBC__.
##
## -v | --print-version: Print value of __GLIBC__ if found, or none.
##
## -o | --set-object-name: Set object name for current system.
## -cc | --set-compiler: Set compiler for building test program.
##
##
## Constants
##
GLIBC_PROG_PREFIX=./get_glibc_info
##
## Defaults
##
GLIBC_PRINT_IS_GLIBC2=False
GLIBC_PRINT_VERSION=False
GLIBC_OBJECT_NAME=`uname`-`uname -r`
GLIBC_CC=cc
function glibc_usage()
{
echo
echo "Usage: `basename $0` [options]"
echo
echo " -g, --is-glibc2: Print True/False if detected __GLIBC__."
echo
echo " -v, --print-version: Print value of __GLIBC__ if found, or none."
echo
echo " -o, --set-object-name: Set object name for current system."
echo " -cc, --set-compiler: Set compiler for building test program."
echo
echo " -h, --help: Print this blurb."
echo
echo "The default is '-v' if no options are given."
echo
}
##
## Parse the command line
##
while [ "$*" ]; do
case $1 in
-h | --help)
shift
glibc_usage
exit 0
;;
-g | --is-glibc2)
shift
GLIBC_PRINT_IS_GLIBC2=True
;;
-v | --print-version)
shift
GLIBC_PRINT_VERSION=True
;;
-o | --set-object-name)
shift
GLIBC_OBJECT_NAME="$1"
shift
;;
-cc | --set-compiler)
shift
GLIBC_CC="$1"
shift
;;
-*)
echo "`basename $0`: invalid option '$1'"
shift
glibc_usage
exit 0
;;
esac
done
##
## Motif info program name
##
GLIBC_PROG="$GLIBC_PROG_PREFIX"_"$GLIBC_OBJECT_NAME"
GLIBC_SRC="$GLIBC_PROG_PREFIX"_"$GLIBC_OBJECT_NAME.c"
##
## Cleanup the dummy test source/program
##
function glibc_cleanup()
{
true
# rm -f $GLIBC_PROG
# rm -f $GLIBC_SRC
}
glibc_cleanup
if [ ! -f $GLIBC_SRC ]
then
cat << EOF > $GLIBC_SRC
#include <stdio.h>
int main(int argc,char ** argv)
{
#ifdef __GLIBC__
fprintf(stdout,"%d\n",__GLIBC__);
#else
fprintf(stdout,"none\n");
#endif
return 0;
}
EOF
fi
if [ ! -f $GLIBC_SRC ]
then
echo
echo "Could not create test program source $GLIBC_SRC."
echo
glibc_cleanup
exit
fi
##
## Compile the dummy test program if needed
##
if [ ! -x $GLIBC_PROG ]
then
$GLIBC_CC -o $GLIBC_PROG $GLIBC_SRC
fi
if [ ! -x $GLIBC_PROG ]
then
echo
echo "Could not create test program $GLIBC_PROG."
echo
glibc_cleanup
exit
fi
##
## Execute the dummy test program
##
GLIBC_PROG_OUTPUT=`$GLIBC_PROG`
##
## -g | --is-glibc2
##
if [ "$GLIBC_PRINT_IS_GLIBC2" = "True" ]
then
if [ "$GLIBC_PROG_OUTPUT" = "2" ]
then
echo True
else
echo False
fi
glibc_cleanup
exit 0
fi
echo $GLIBC_PROG_OUTPUT
glibc_cleanup

2790
mozilla/config/gtscc.c Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,20 @@
@echo off
rem The contents of this file are subject to the Netscape Public License
rem Version 1.0 (the "NPL"); you may not use this file except in
rem compliance with the NPL. You may obtain a copy of the NPL at
rem http://www.mozilla.org/NPL/
rem
rem Software distributed under the NPL is distributed on an "AS IS" basis,
rem WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
rem for the specific language governing rights and limitations under the
rem NPL.
rem
rem The Initial Developer of this code under the NPL is Netscape
rem Communications Corporation. Portions created by Netscape are
rem Copyright (C) 1998 Netscape Communications Corporation. All Rights
rem Reserved.
@echo on
@if not exist %2\nul mkdir %2
@rm -f %2\%1
@cp %1 %2

234
mozilla/config/java.inc Normal file
View File

@@ -0,0 +1,234 @@
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
!if !defined(VERBOSE)
.SILENT:
!endif
#//------------------------------------------------------------------------
#//
#// This makefile contains all of the rules necessary to build Java Header
#// and Stub files
#//
#//------------------------------------------------------------------------
!if !defined(CONFIG_JAVA_INC)
CONFIG_JAVA_INC=1
#//------------------------------------------------------------------------
#// Setup to generate Mac java headers (checkout ns/lib/mac/Java
#//------------------------------------------------------------------------
!ifdef MOZ_GENMAC
MAC_JAVA_HEADERS_DIR = $(DEPTH)/lib/mac/Java
#//------------------------------------------------------------------------
#// Figure out how to do the pull.
#//------------------------------------------------------------------------
!if "$(MOZ_BRANCH)" != ""
CVS_BRANCH=-r $(MOZ_BRANCH)
HAVE_BRANCH=1
!else
HAVE_BRANCH=0
!endif
!if "$(MOZ_TIP)" != ""
CVS_BRANCH=-A
!endif
!if "$(MOZ_DATE)" != ""
CVS_BRANCH=-D "$(MOZ_DATE)"
HAVE_DATE=1
!else
HAVE_DATE=0
!endif
!if $(HAVE_DATE) && $(HAVE_BRANCH)
ERR_MESSAGE=$(ERR_MESSAGE)^
Cannot specify both MOZ_BRANCH and MOZ_DATE
!endif
$(MAC_JAVA_HEADERS_DIR):
@echo +++ Checking out $(MAC_JAVA_HEADERS_DIR) +++
$(PERL) $(DEPTH)/config/cvsco.pl $(CVS_BRANCH) ns/lib/mac/Java
@echo +++ Done Checking out $(MAC_JAVA_HEADERS_DIR) +++
!endif
!ifdef JDK_GEN
!ifdef JAVA_OR_OJI
#//------------------------------------------------------------------------
#//
#// Rule to generate Java header files using javah.
#//
#//------------------------------------------------------------------------
$(JDK_GEN):: display_java_header_msg
!$(JAVAH) -d _gen $@
!ifdef NSBUILDROOT
LINCS = $(LINCS) -I$(JDK_GEN_DIR) -I$(XPDIST)
!else
LINCS = $(LINCS) -I$(JDK_GEN_DIR)
!endif
display_java_header_msg:
echo +++ make: Generating java header files...
!ifdef MOZ_GENMAC
$(JDK_GEN)::display_java_header_msg_mac $(MAC_JAVA_HEADERS_DIR)
echo +++ make: creating JDK header for $@
!$(JAVAH) -mac -d $(MAC_JAVA_HEADERS_DIR)/_gen $@
display_java_header_msg_mac:
echo +++ make: Generating Macintosh JDK header files +++
!endif
!endif # JAVA_OR_OJI
!endif
!ifdef JDK_GEN
!ifdef JAVA_OR_OJI
#//------------------------------------------------------------------------
#//
#// Rules to generate Java stub files using javah.
#//
#//------------------------------------------------------------------------
$(JDK_GEN)::display_java_stub_msg
!$(JAVAH) -stubs -d _stubs $@
display_java_stub_msg:
echo +++ make: Generating java stub files...
!ifdef MOZ_GENMAC
$(JDK_GEN)::display_java_stub_msg_mac $(MAC_JAVA_HEADERS_DIR)
echo +++ make: creating JDK stub for $@
!$(JAVAH) -mac -stubs -d $(MAC_JAVA_HEADERS_DIR)/_stubs $@
display_java_stub_msg_mac:
echo +++ make: Generating Macintosh JDK stub files +++
!endif
export:: $(JDK_GEN)
!endif # JAVA_OR_OJI
!endif
!ifdef JAVA_LIBSTUB_FILES
!ifdef JAVA_OR_OJI
#//------------------------------------------------------------------------
#//
#// Rules to generate libstubs.c using javah.
#//
#//------------------------------------------------------------------------
libstubs.c::$(JAVA_LIBSTUB_FILES)
echo +++ make: Generating libstubs.c...
$(JAVAH) -o libstubs.c -stubs $**
stubs$(MOZ_BITS).c::$(JAVA_LIBSTUB_FILES)
echo +++ make: Generating stubs$(MOZ_BITS).c...
$(JAVAH) -o stubs$(MOZ_BITS).c -stubs $**
!endif # JAVA_OR_OJI
!endif
!ifdef JRI_GEN
!ifdef JAVA_OR_OJI
#//------------------------------------------------------------------------
#//
#// Rule to generate JRI header files using javah.
#//
#//------------------------------------------------------------------------
$(JRI_GEN):: display_jri_header_msg
!$(JAVAH) -jri -d _jri $@
!ifdef NSBUILDROOT
LINCS = $(LINCS) -I$(JRI_GEN_DIR) -I$(XPDIST)
!else
LINCS = $(LINCS) -I$(JRI_GEN_DIR)
!endif
display_jri_header_msg:
echo +++ make: Generating JRI header files...
!ifdef MOZ_GENMAC
$(JRI_GEN)::display_jri_header_msg_mac $(MAC_JAVA_HEADERS_DIR)
echo +++ make: creating JRI header for $@
!$(JAVAH) -mac -jri -d $(MAC_JAVA_HEADERS_DIR)/_jri $@
display_jri_header_msg_mac:
echo +++ make: Generating Macintosh java JRI header files +++
!endif
!endif # JAVA_OR_OJI
!endif
!ifdef JRI_GEN
!ifdef JAVA_OR_OJI
#//------------------------------------------------------------------------
#//
#// Rules to generate JRI stub files using javah.
#//
#//------------------------------------------------------------------------
$(JRI_GEN)::display_jri_stub_msg
!$(JAVAH) -stubs -jri -d _jri $@
display_jri_stub_msg:
echo +++ make: Generating JRI stub files...
!ifdef MOZ_GENMAC
$(JRI_GEN)::display_jri_stub_msg_mac $(MAC_JAVA_HEADERS_DIR)
echo +++ make: creating JRI stub for $@
!$(JAVAH) -mac -jri -stubs -d $(MAC_JAVA_HEADERS_DIR)/_jri $@
display_jri_stub_msg_mac:
echo +++ make: Generating Macintosh java JRI stub files +++
!endif
export:: $(JRI_GEN)
!endif # JAVA_OR_OJI
!endif
!ifdef JNI_GEN
!ifdef JAVA_OR_OJI
#//------------------------------------------------------------------------
#//
#// Rule to generate JNI header files using javah.
#//
#//------------------------------------------------------------------------
$(JNI_GEN):: display_jni_header_msg
!echo $(JAVAH) -jni -d _jni $@
!$(JAVAH) -jni -d _jni $@
!ifdef NSBUILDROOT
LINCS = $(LINCS) -I$(JNI_GEN_DIR) -I$(XPDIST)
!else
LINCS = $(LINCS) -I$(JNI_GEN_DIR)
!endif
display_jni_header_msg:
echo +++ make: Generating JNI header files...
!ifdef MOZ_GENMAC
$(JNI_GEN)::display_jni_header_msg_mac $(MAC_JAVA_HEADERS_DIR)
echo +++ make: creating JRI header for $@
!$(JAVAH) -mac -jni -d $(MAC_JAVA_HEADERS_DIR)/_jni $@
display_jni_header_msg_mac:
echo +++ make: Generating Macintosh java JNI header files +++
!endif
!endif # JAVA_OR_OJI
export:: $(JNI_GEN)
!endif # JNI_GEN
!endif # CONFIG_JAVA_INC

67
mozilla/config/lib.inc Normal file
View File

@@ -0,0 +1,67 @@
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
!if !defined(VERBOSE)
.SILENT:
!endif
#//------------------------------------------------------------------------
#//
#// This makefile contains all of the rules necessary to build 16 and 32 bit
#// libraries.
#//
#//------------------------------------------------------------------------
!if defined(LIBRARY) && !defined(CONFIG_LIB_INC)
CONFIG_LIB_INC=1
!if "$(MOZ_BITS)" == "16"
#//------------------------------------------------------------------------
#//
#// Rule to build a 16-bit Library
#//
#//------------------------------------------------------------------------
$(LIBRARY):: $(OBJDIR) $(OBJS)
# //
# // create response file for the command. The format is:
# // LIBNAME, -+foo.obj -+bar.obj , LISTFILE, NEWLIB
# //
rm -f $(CFGFILE)
!if "$(OS)" == "Windows_NT"
for %%d in ($(OBJS)) do echo -+%%d ^& >> $(CFGFILE)
!else
for %%d in ($(OBJS)) do echo -+%%d & >> $(CFGFILE)
!endif
echo * >> $(CFGFILE)
# //
# // execute the commands
# //
$(RM) $@
$(AR) $@ @$(CFGFILE)
$(RANLIB) $@
!else
#//------------------------------------------------------------------------
#//
#// Rule to build a 32-bit Library
#//
#//------------------------------------------------------------------------
$(LIBRARY):: $(OBJDIR) $(OBJS)
$(RM) $@ 2> NUL
$(AR) @<<$(CFGFILE)
-NOLOGO -OUT:$@
$(OBJS)
<<
$(RANLIB) $@
!endif
!endif # LIBRARY && ! CONFIG_LIB_INC

190
mozilla/config/liteness.mak Normal file
View File

@@ -0,0 +1,190 @@
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
################################################################################
#
# MOZ_LITE and MOZ_MEDIUM stuff
#
# Does two things 1) Sets environment variables for use by other build scripts.
# 2) Sets MOZ_LITENESS_FLAGS to be appended to the command lines
# for calling the compilers/tools, CFLAGS, RCFLAGS, etc.
#
################################################################################
# Under the new system for MOZ_LITE, MOZ_MEDIUM. There should be no references to
# MOZ_LITE or MOZ_MEDIUM in the code, either as an #ifdef, or as some other conditional
# if in the build scripts. Instead, all #ifdefs, !if, etc. should be based on the
# module-specific tag. E.g. #ifdef MOZ_MAIL_NEWS, #ifdef MOZ_LDAP, etc.
# The reason for this is that we can decide what goes into the LITE and MEDIUM
# builds by just tweaking this file (and the appropriate file for MAC and UNIX).
#
# Originally, I planned on defining MOZ_MEDIUM as being the same as MOZ_LITE + EDITOR,
# but there were still many cases in the code and build scripts where I would have had
# to do something ugly like "#if !defined(MOZ_LITE) || defined(MOZ_MEDIUM)". This
# would be very error prone and difficult to maintain. I believe defining and
# using a bunch of new symbols reduces the total amount of pain in both the short and
# long term.
#
# IMPORTANT!! The method of running a build has not changed. You define
# MOZ_LITE or MOZ_MEDIUM (not both) in your environment, and start the build.
# You do not have to define the symbols for every module. E.g. you should never
# have to define EDITOR, or MOZ_MAIL_NEWS in your environment. The build scripts
# will do this for you, via the file you are looking at right now.
### Here is the list of all possible modules under control of MOZ_LITE/MOZ_MEDIUM,
### Some only affect the build scripts, so are only set as environment variables, and
### not added to MOZ_LITENESS_FLAGS
#
# MOZ_MAIL_NEWS
# Enables mail and news.
#
# EDITOR
# Enables the editor
#
# MOZ_OFFLINE
# Enables go offline/go online
#
# MOZ_LOC_INDEP
# Location independence
#
# MOZ_TASKBAR
# The "taskbar" or "component bar"
#
# MOZ_LDAP
# Enable LDAP, MOZ_NO_LDAP has been depreciated
#
# MOZ_ADMIN_LIB
# Mission Control
#
# MOZ_COMMUNICATOR_NAME
# Use "Communicator" as opposed to "Navigator" in strings,
# Use the Communicator icon, splash screen, etc. instead of the Navigator one.
# *** IMPORTANT *** This also controls whether the user agent string has " ;Nav"
# appended to it. i.e. only append " ;Nav" if MOZ_COMMUNICATOR_NAME is not set.
#
# MOZ_JSD
# Build JS debug code, needs to be turned off when we remove java from build.
#
# MOZ_IFC_TOOLS
# Build ns/ifc/tools. Should this be the same as MOZ_JSD??
#
# MOZ_NETCAST
# Build netcaster.
#
# MOZ_COMMUNICATOR_IIDS
# For windows, use the COM IIDs for Communicator, as opposed to those for the
# Navigator-only version. We must have a different set so that multiple versions can
# be installed on the same machine. We need a more general solution to the problem of
# multiple versions of the interface IDs.
#
# MOZ_COMMUNICATOR_ABOUT
# Use the about: information from Communicator, as opposed to that for the Navigator-only
# version. We will probably have to make another one for the source-only release.
#
# MOZ_NAV_BUILD_PREFIX
# For building multiple versions with varying degree of LITEness in the same tree.
# If true, use "Nav" as the prefix for the directory under ns/dist, else use "WIN".
# Also, if true, build client in, say, NavDbg as oppposed to x86Dbg.
#
# MOZ_COMMUNICATOR_CONFIG_JS
# Use "config.js" instead of the one specific to the Navigator-only version.
#
# MOZ_COPY_ALL_JARS
# Copy all JAR files to the destination directory, else just copy the JARS appropriate for the
# Navigator-only version.
#
# MOZ_SPELLCHK
# Enable the spellchecker.
### MOZ_LITE ###
# NOTE: Doesn't need -DMOZ_LITE anymore.
!if defined(MOZ_LITE)
MOZ_LITENESS_FLAGS=
MOZ_JSD=1
MOZ_NAV_BUILD_PREFIX=1
### MOZ_MEDIUM ###
!elseif defined(MOZ_MEDIUM)
MOZ_LITENESS_FLAGS=-DEDITOR -DMOZ_COMMUNICATOR_IIDS
EDITOR=1
MOZ_JSD=1
MOZ_COMMUNICATOR_IIDS=1
MOZ_COMMUNICATOR_CONFIG_JS=1
MOZ_COPY_ALL_JARS=1
### MOZ_DARK ###
!elseif defined(MOZ_DARK)
MOZ_LITENESS_FLAGS=-DEDITOR -DMOZ_COMMUNICATOR_IIDS -DMOZ_MAIL_NEWS \
-DMOZ_OFFLINE -DMOZ_TASKBAR -DMOZ_LDAP
#-DMOZ_CALENDAR
MOZ_MAIL_NEWS=1
EDITOR=1
MOZ_JSD=1
MOZ_COMMUNICATOR_IIDS=1
MOZ_COMMUNICATOR_CONFIG_JS=1
MOZ_COPY_ALL_JARS=1
MOZ_OFFLINE=1
MOZ_TASKBAR=1
MOZ_LDAP=1
#MOZ_CALENDAR=1
### Full build ###
!else
MOZ_LITENESS_FLAGS=-DMOZ_MAIL_NEWS -DEDITOR -DMOZ_OFFLINE -DMOZ_LOC_INDEP \
-DMOZ_TASKBAR -DMOZ_LDAP -DMOZ_ADMIN_LIB \
-DMOZ_COMMUNICATOR_NAME -DMOZ_COMMUNICATOR_IIDS \
-DMOZ_NETCAST -DMOZ_COMMUNICATOR_ABOUT -DMOZ_SPELLCHK \
-DMOZ_CALENDAR
MOZ_MAIL_NEWS=1
EDITOR=1
MOZ_OFFLINE=1
MOZ_LOC_INDEP=1
MOZ_TASKBAR=1
MOZ_LDAP=1
MOZ_ADMIN_LIB=1
MOZ_COMMUNICATOR_NAME=1
MOZ_JSD=1
MOZ_IFC_TOOLS=1
MOZ_NETCAST=1
MOZ_COMMUNICATOR_IIDS=1
MOZ_COMMUNICATOR_ABOUT=1
MOZ_COMMUNICATOR_CONFIG_JS=1
MOZ_COPY_ALL_JARS=1
MOZ_SPELLCHK=1
!endif
!ifdef MOZ_JAVA
MOZ_SMARTUPDATE=1
MOZ_LITENESS_FLAGS=$(MOZ_LITENESS_FLAGS) -DMOZ_SMARTUPDATE
!endif
!ifdef JAVA_OR_NSJVM # fix -- su can't depend on java
MOZ_SMARTUPDATE=1
MOZ_LITENESS_FLAGS=$(MOZ_LITENESS_FLAGS) -DMOZ_SMARTUPDATE
!endif
### This probably isn't the best place to put this.
!if defined(MOZ_NGLAYOUT)
MOZ_LITENESS_FLAGS=$(MOZ_LITENESS_FLAGS) -DMOZ_NGLAYOUT
!endif
!ifdef MOZ_SMARTUPDATE
MOZ_LITENESS_FLAGS=$(MOZ_LITENESS_FLAGS) -DMOZ_SMARTUPDATE
!endif

View File

@@ -0,0 +1,167 @@
#!/usr/local/bin/perl5 -w
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
# http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and limitations
# under the License.
#
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are Copyright (C) 1998
# Netscape Communications Corporation. All Rights Reserved.
#
# set-timebomb.pl --- set the timebomb to N days from today's date.
#
# Modified: Chris Yeh <cyeh@netscape.com>, 31-Aug-98
# Created: Jamie Zawinski <jwz@mozilla.org>, 24-Aug-98.
my $progname = $0;
my $contents;
# This is the preferences file that gets read and written.
# So run this script with src/mozilla/build/ as the current directory.
#
my $prefs = ":mozilla:modules:libpref:src:init:all.js";
# from noah, who should be shot
sub ctime {
local (@weekday, @month, $time, $TZ);
local ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst);
@weekday = ("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat");
@month = ("Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
$time = (length (@_) > 0)? $_[0] : time() ;
$TZ = defined($ENV{'TZ'}) ? ( $ENV{'TZ'} ? $ENV{'TZ'} : 'UTC' ) : '';
($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) =
($TZ eq 'UTC') ? gmtime($time) : localtime($time);
if ($TZ =~ /^([^:\d+\-,]{3,})([+-]?\d{1,2}(:\d{1,2}){0,2})([^\d+\-,]{3,})?/o)
{
$TZ = $isdst ? $4 : $1;
}
if ($TZ ne "") { $TZ .= " "; }
$year += ($year < 70) ? 2000 : 1900;
return sprintf ("%s %s %02d %02d:%02d:%02d %s%4d",
$weekday[$wday], $month[$mon], $mday, $hour, $min, $sec,
$TZ, $year);
}
sub read_file {
$contents = "";
open(IN, "<$prefs");
while (<IN>) {
$contents .= $_;
}
close(IN);
}
sub write_file {
open(OUT, ">$prefs");
print OUT $contents;
close(OUT);
# print STDERR "$progname: wrote $prefs\n";
}
sub get_pref {
my ($lvalue) = @_;
$_ = $contents;
die ("$lvalue unset?\n") unless m@^config\("$lvalue","(.*)"\);@m;
return $1;
}
sub set_pref {
my ($lvalue,$rvalue) = @_;
$_ = $contents;
# die("$lvalue unset?\n") unless (m@^(pref|config)\("$lvalue",@m);
die("$lvalue unset?\n")
unless s@^(pref|config)(\("$lvalue",)(.*)(\).*)$@$1$2$rvalue$4@m;
$contents = $_;
}
# no longer used?
sub set_indirected_bomb {
my ($bomb) = @_;
my ($secret) = get_pref("timebomb.relative_timebomb_secret_name");
set_pref($secret, $bomb);
}
sub time_diff {
use Time::Local;
my($time, $result) = @_;
my $diff = 2082830400 - (timegm(localtime) - time);
return $result =~ /mac/ ?
$time + $diff : $time - $diff;
}
sub set_bomb {
my ($warning_days, $bomb_days) = @_;
# die("warning_days ($warning_days) must be greater than 0.")
# unless ($warning_days > 0);
die("bomb_days ($bomb_days) must be greater than 0.")
unless ($bomb_days > 0);
die("warning_days ($warning_days) must be less than " .
"bomb_days ($bomb_days)\n")
unless ($warning_days < $bomb_days);
my $mactime = time;
# MacPerl stores date and times from 1904 instead of 1970
# Conversion routine thanks to Chris Nandor (pudge@pobox.com)
$now = time_diff($mactime, 'unix');
my $bomb = $now + ($bomb_days * 24 * 60 * 60);
my $warn = $now + ($warning_days * 24 * 60 * 60);
set_pref("timebomb.expiration_time", $bomb);
set_pref("timebomb.warning_time", $warn);
set_pref("timebomb.relative_timebomb_days", -1);
set_pref("timebomb.relative_timebomb_warning_days", -1);
set_indirected_bomb(0);
# print STDERR sprintf("%s: timebomb goes off in %2d days (%s)\n",
# $progname, $bomb_days, ctime($bomb));
# print STDERR sprintf("%s: warning goes off in %2d days (%s)\n",
# $progname, $warning_days, ctime($warn));
}
sub main {
my ($warning_days, $bomb_days) = @_;
die ("usage: $progname [ days-until-warning [ days-until-timebomb ]]\n")
if ($#_ >= 2);
if ($#_ == 0) {
$bomb_days = $warning_days;
$warning_days = -1;
}
if (!$bomb_days || $bomb_days <= 0) {
$bomb_days = 30;
}
if ($warning_days < 0) {
$warning_days = $bomb_days - int($bomb_days / 3);
if ($warning_days < $bomb_days - 10) {
$warning_days = $bomb_days - 10;
}
}
read_file();
set_bomb($warning_days, $bomb_days);
write_file();
return 0;
}
exit(&main(@ARGV));

View File

@@ -0,0 +1,50 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
* ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
* Component_Config.h
* ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
* This file is the Mac equivalent to ns/config/liteness.mak on Windows.
* Set different #define's to control what components get built.
*/
#if defined(MOZ_LITE) /* Nav-only */
#define MOZ_JSD
#define MOZ_NAV_BUILD_PREFIX
#elif defined(MOZ_MEDIUM) /* Nav + Composer */
#define EDITOR
#define MOZ_JSD
#define MOZ_COMMUNICATOR_CONFIG_JS
#define MOZ_SPELLCHK
#else /* The WHOLE enchilada */
#define MOZ_MAIL_NEWS
#define EDITOR
#define MOZ_OFFLINE
#define MOZ_LOC_INDEP
#define MOZ_TASKBAR
#define MOZ_LDAP
#define MOZ_ADMIN_LIB
#define MOZ_COMMUNICATOR_NAME
#define MOZ_JSD
#define MOZ_IFC_TOOLS
#define MOZ_NETCAST
#define MOZ_COMMUNICATOR_ABOUT
#define MOZ_COMMUNICATOR_CONFIG_JS
#define MOZ_SPELLCHK
#endif

View File

@@ -0,0 +1,56 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
This is a common prefix file, included for both projects like
NSStdLib and Mozilla.
*/
/* start building for Carbon */
#define TARGET_CARBON 0
/* Some build-wide Mac-related defines */
#define macintosh /* macintosh is defined for GUSI */
#define XP_MAC 1
/* We have to do this here because ConditionalMacros.h will be included from
* within OpenTptInternet.h and will stupidly define these to 1 if they
* have not been previously defined. The new PowerPlant (CWPro1) requires that
* this be set to 0. (pinkerton)
*/
#define OLDROUTINENAMES 0
#ifndef OLDROUTINELOCATIONS
#define OLDROUTINELOCATIONS 0
#endif
/* OpenTransport.h has changed to not include the error messages we need from
* it unless this is defined. Why? dunnno...(pinkerton)
*/
#define OTUNIXERRORS 1
#ifdef DEBUG
#define DEVELOPER_DEBUG 1
#else
#define NDEBUG
#endif
/* Some other random defines */
#define _NO_FAST_STRING_INLINES_ 1
#define _PR_NO_PREEMPT 1
///#define HAVE_BOOLEAN 1 // used by JPEG lib

View File

@@ -0,0 +1,76 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
// ÑÑÑ Security
//#define NADA_VERSION
//#define EXPORT_VERSION
#define US_VERSION
// ÑÑÑ Misc
//#define NO_DBM // define this to kill DBM
#define NEW_BOOKMARKS
// Enables us to switch profiling from project preferences
// ÑÑÑ Version
//#define ALPHA
//#define BETA
// Comment out both ALPHA and BETA for the final version
// 98-06-03 pinkerton -- temorary defines to turn on features before they fully land.
#define CookieManagement 1
#define SingleSignon 1
// 98-07-29 pinnkerton -- defines to turn on feature. REMOVE WHEN THIS LANDS.
#define PRIVACY_POLICIES 1
// 98-08-10 joe -- temporary item to turn on ENDER (html textareas) before it fully lands
#define ENDER 1
// 98-09-25 mlm - turn on javascript thread safety
#define JS_THREADSAFE 1
// 98-10-14 joe -- temporary item to turn on ENDER MIME support before it fully lands
#define MOZ_ENDER_MIME 1
// ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
// ¥ You typically will not need to change things below here
// ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
#define MOCHA
#define MOZILLA_CLIENT 1
#ifndef NETSCAPE
#define NETSCAPE 1
#endif
// #define JAVA 1
#define OJI 1
#ifdef JAVA
#define UNICODE_FONTLIST 1
#endif
#define LAYERS 1
#define CASTED_READ_OBJECT(stream, type, reference) (reference = NULL)
/* Defined in javaStubs prefix files
#define VERSION_NUMBER "4_0b0"
#define ZIP_NAME "java"##VERSION_NUMBER
*/

View File

@@ -0,0 +1,25 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/* This file is included from the nav-java and sun-java projects */
#define MOCHAFILE 1
#define COMPILER 0
#define VERSION_NUMBER "40"
#define JAR_NAME "java"##VERSION_NUMBER##".jar"

View File

@@ -0,0 +1,16 @@
#
# This is a list of local files which get copied to the mozilla:dist directory
#
DefinesMac.h
DefinesMozilla.h
JavaDefines.h
MacConfigInclude.h
MacPrefix.h
MacPrefix_debug.h
#//MacConfig.h // moved to MANIFEST_config
ComponentConfig.h

View File

@@ -0,0 +1,6 @@
#
# This is a list of local files which get copied to the mozilla:dist directory
#
MacConfig.h

View File

@@ -0,0 +1,20 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#define MOZ_MEDIUM

View File

@@ -0,0 +1,42 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
This is included as a prefix file in all Mac projects. It ensures that
the correct #defines are set up for this build.
Since this is included from C files, comments should be C-style.
Order below does matter.
*/
/* Read compiler options */
#include "IDE_Options.h"
/* Read file of defines global to the Mac build */
#include "DefinesMac.h"
/* Read the configuration options (which build we are doing) */
#include "MacConfig.h"
/* Read component defines */
#include "ComponentConfig.h"
/* Read build-wide defines (e.g. MOZILLA_CLIENT) */
#include "DefinesMozilla.h"

View File

@@ -0,0 +1,25 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#undef DEBUG
#undef Debug_Throw
#undef Debug_Signal
#undef txtnDebug
/* Read the common configuration file */
#include "MacConfigInclude.h"

View File

@@ -0,0 +1,25 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#define DEBUG 1
#define Debug_Throw
#define Debug_Signal
#define txtnDebug
/* Read the common configuration file */
#include "MacConfigInclude.h"

View File

@@ -0,0 +1,51 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
This is included as a prefix file in all Mac projects. It ensures that
the correct #defines are set up for this build.
Since this is included from C files, comments should be C-style.
Order below does matter.
*/
/* Read compiler options */
#include "IDE_Options.h"
/* Read file of defines global to the Mac build */
#include "DefinesMac.h"
/* Read the configuration options (which build we are doing) */
#include "MacConfig.h"
/* Read component defines */
/* #include "ComponentConfig.h" */
/* Read build-wide defines (e.g. MOZILLA_CLIENT) */
#include "DefinesMozilla.h"
/* ...then undefine the Mozilla specific stuff */
#undef CookieManagement
#undef SingleSignon
#undef PRIVACY_POLICIES
/* ...and define the Raptor specific things */
#define STANDALONE_IMAGE_LIB /* libimg */
#define MODULAR_NETLIB /* network */
#define MOZ_NGLAYOUT

167
mozilla/config/makecopy.c Normal file
View File

@@ -0,0 +1,167 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <direct.h>
#include <sys/stat.h>
#include <io.h>
#include <fcntl.h>
static const char *prog;
void Usage(void)
{
fprintf(stderr, "makecopy: <file> <dir-path>\n");
}
void FlipSlashes(char *name)
{
int i;
/*
** Flip any "unix style slashes" into "dos style backslashes"
*/
for( i=0; name[i]; i++ ) {
if( name[i] == '/' ) name[i] = '\\';
}
}
int MakeDir( char *path )
{
char *cp, *pstr;
struct stat sb;
pstr = path;
while( cp = strchr(pstr, '\\') ) {
*cp = '\0';
if( stat(path, &sb) == 0 && (sb.st_mode & _S_IFDIR) ) {
/* sub-directory already exists.... */
} else {
/* create the new sub-directory */
printf("+++ makecopy: creating directory %s\n", path);
if( mkdir(path) < 0 ) {
return -1;
}
}
*cp = '\\';
pstr = cp+1;
}
}
int CopyIfNecessary(char *oldFile, char *newFile)
{
BY_HANDLE_FILE_INFORMATION hNewInfo;
BY_HANDLE_FILE_INFORMATION hOldInfo;
HANDLE hFile;
/* Try to open the destination file */
if ( (hFile = CreateFile(newFile, GENERIC_READ, FILE_SHARE_WRITE, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,
NULL)) != INVALID_HANDLE_VALUE ) {
if (GetFileInformationByHandle(hFile, &hNewInfo) == FALSE) {
goto copy_file;
}
CloseHandle(hFile);
/* Try to open the source file */
if ( (hFile = CreateFile(oldFile, GENERIC_READ, FILE_SHARE_WRITE, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,
NULL)) != INVALID_HANDLE_VALUE ) {
if (GetFileInformationByHandle(hFile, &hOldInfo) == FALSE) {
goto copy_file;
}
}
CloseHandle(hFile);
/*
** If both the source and destination were created at the same time
** and have the same size then do not copy...
*/
if ((hOldInfo.ftLastWriteTime.dwLowDateTime == hNewInfo.ftLastWriteTime.dwLowDateTime) &&
(hOldInfo.ftLastWriteTime.dwHighDateTime == hNewInfo.ftLastWriteTime.dwHighDateTime) &&
(hOldInfo.nFileSizeLow == hNewInfo.nFileSizeLow) &&
(hOldInfo.nFileSizeHigh == hNewInfo.nFileSizeHigh)) {
return 0;
}
}
copy_file:
if( ! CopyFile(oldFile, newFile, FALSE) ) {
return 1;
}
return 0;
}
int main( int argc, char *argv[] )
{
char old_path[4096];
char new_path[4096];
char *oldFileName; /* points to where file name starts in old_path */
char *newFileName; /* points to where file name starts in new_path */
WIN32_FIND_DATA findFileData;
HANDLE hFindFile;
int rv;
if( argc != 3 ) {
Usage();
return 2;
}
strcpy(old_path, argv[1]);
FlipSlashes(old_path);
oldFileName = strrchr(old_path, '\\');
if (oldFileName) {
oldFileName++;
} else {
oldFileName = old_path;
}
sprintf(new_path, "%s\\", argv[2]);
FlipSlashes(new_path);
newFileName = new_path + strlen(new_path);
if( MakeDir(new_path) < 0 ) {
fprintf(stderr, "\n+++ makecopy: unable to create directory %s\n", new_path);
return 1;
}
hFindFile = FindFirstFile(old_path, &findFileData);
if (hFindFile == INVALID_HANDLE_VALUE) {
fprintf(stderr, "\n+++ makecopy: no such file: %s\n", argv[1]);
return 1;
}
printf("+++ makecopy: Installing %s into directory %s\n", argv[1], argv[2]);
do {
strcpy(oldFileName, findFileData.cFileName);
strcpy(newFileName, findFileData.cFileName);
rv = CopyIfNecessary(old_path, new_path);
if (rv != 0) {
break;
}
} while (FindNextFile(hFindFile, &findFileData) != 0);
FindClose(hFindFile);
return rv;
}

BIN
mozilla/config/makecopy.exe Executable file

Binary file not shown.

View File

@@ -0,0 +1,72 @@
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#//------------------------------------------------------------------------
#//
#// Makefile fo NS/CONFIG - various commands used by other makefiles
#//
#//------------------------------------------------------------------------
!if "$(MOZ_BITS)" == "16"
!error This makefile must be build using 32-bit tools
!endif
#//------------------------------------------------------------------------
#//
#// Specify the depth of the current directory relative to the
#// root of NS
#//
#//------------------------------------------------------------------------
DEPTH = ..
#//------------------------------------------------------------------------
#//
#// Include the common makefile rules
#//
#//------------------------------------------------------------------------
include <$(DEPTH)/config/rules.mak>
#// Rule to set the timebomb on official mozilla builds
!ifdef MOZILLA_OFFICIAL
export:: $(DEPTH)/build/build_number
$(PERL) set-timebomb.pl 0 30
!endif
#//
#// Rule to build makedir.exe
#//
makecopy.exe:: makecopy.c
$(CC) -O2 -MD makecopy.c
mangle.exe:: mangle.c
$(CC) -O2 -MD mangle.c
mantomak.exe:: mantomak.c
$(CC) -O2 -MD mantomak.c
bin2rc.exe:: bin2rc.c
$(CC) -O2 -MD bin2rc.c
export:: makecopy.exe mangle.exe mantomak.exe bin2rc.exe $(DEPTH)/build/build_number
#update build number from within make script
$(DEPTH)/build/build_number:: FORCE
$(RM) $@
$(PERL) bdate.pl > $@
$(PERL) aboutime.pl $(DEPTH)/l10n/us/xp/about-all.html $@
install:: export
FORCE:

120
mozilla/config/mangle.c Normal file
View File

@@ -0,0 +1,120 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
HANDLE hMangleFile;
void Usage(void)
{
fprintf(stderr, "MANGLE: <file>\n");
}
BOOL MangleFile( const char *real_name, const char *mangle_name )
{
int len;
DWORD dwWritten;
char buffer[2048];
if( mangle_name && *mangle_name && strcmpi(real_name, mangle_name) ) {
printf("Mangle: renaming %s to %s\n", real_name, mangle_name);
if( ! MoveFile(real_name, "X_MANGLE.TMP") ) {
fprintf(stderr, "MANGLE: cannot rename %s to X_MANGLE.TMP\n",
real_name);
return FALSE;
}
if( ! MoveFile("X_MANGLE.TMP", mangle_name) ) {
MoveFile("X_MANGLE.TMP", real_name);
fprintf(stderr, "MANGLE: cannot rename X_MANGLE.TMP to %s\n",
mangle_name);
return FALSE;
}
len = sprintf(buffer, "mv %s %s\r\n", mangle_name, real_name);
if( (WriteFile( hMangleFile, buffer, len, &dwWritten, NULL ) == FALSE) ||
(dwWritten != len) ) {
fprintf(stderr, "MANGLE: error writing to UNMANGLE.BAT\n");
return FALSE;
}
}
return TRUE;
}
int main( int argc, char *argv[] )
{
WIN32_FIND_DATA find_data;
HANDLE hFoundFile;
if( argc != 1 ) {
Usage();
return 2;
}
hMangleFile = CreateFile("unmangle.bat", /* name */
GENERIC_READ|GENERIC_WRITE, /* access mode */
0, /* share mode */
NULL, /* security descriptor */
CREATE_NEW, /* how to create */
FILE_ATTRIBUTE_NORMAL, /* file attributes */
NULL ); /* template file */
if( hMangleFile == INVALID_HANDLE_VALUE ) {
if( GetLastError() == ERROR_FILE_EXISTS ) {
fprintf(stderr, "MANGLE: UNMANGLE.BAT already exists\n");
} else {
fprintf(stderr, "MANGLE: cannot open UNMANGLE.BAT\n");
}
return 1;
}
if( (hFoundFile = FindFirstFile("*.*", &find_data)) == INVALID_HANDLE_VALUE ) {
fprintf(stderr, "MANGLE: cannot read directory\n");
return 1;
}
do {
if( !MangleFile(find_data.cFileName, find_data.cAlternateFileName) ) {
fprintf(stderr, "MANGLE: cannot rename %s to %s\n",
find_data.cFileName, find_data.cAlternateFileName );
FindClose( hFoundFile );
CloseHandle( hMangleFile );
return 1;
}
} while( FindNextFile(hFoundFile, &find_data) );
FindClose( hFoundFile );
{
int len;
DWORD dwWritten;
char buffer[255];
len = sprintf(buffer, "del unmangle.bat\r\n");
WriteFile ( hMangleFile, buffer, len, &dwWritten, NULL );
}
CloseHandle( hMangleFile );
return 0;
}

BIN
mozilla/config/mangle.exe Executable file

Binary file not shown.

990
mozilla/config/mantomak.c Normal file
View File

@@ -0,0 +1,990 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#define DEFAULT_MANIFEST_EXT ".mn"
#define DEFAULT_MAKEFILE_EXT ".win"
typedef struct char_list_struct {
char *m_pString;
struct char_list_struct *m_pNext;
} char_list;
typedef struct macro_list_struct {
char *m_pMacro;
char_list *m_pValue;
struct macro_list_struct *m_pNext;
} macro_list;
void help(void);
char *input_filename(const char *);
char *output_filename(const char *, const char *);
int input_to_output(FILE *, FILE *);
int output_rules(FILE *);
int output_end(FILE *);
int buffer_to_output(char *, FILE *);
macro_list *extract_macros(char *);
char *find_macro(char *, char **);
void add_macro(char *, macro_list **);
int macro_length(char *);
int value_length(char *);
void add_values(char *, char_list **);
char *skip_white(char *);
int write_macros(macro_list *, FILE *);
int write_values(char_list *, FILE *, int);
void free_macro_list(macro_list *);
void free_char_list(char_list *);
void morph_macro(macro_list **, char *, char *, char *);
void slash_convert(macro_list *, char *);
int explicit_rules(macro_list *, char *, FILE *);
void create_classroot(macro_list **ppList );
int main(int argc, char *argv[])
{
int iOS = 0;
char *pInputFile = NULL;
char *pOutputFile = NULL;
/* Figure out arguments.
* [REQUIRED] First argument is input file.
* [OPTIONAL] Second argument is output file.
*/
if(argc > 1) {
FILE *pInputStream = NULL;
FILE *pOutputStream = NULL;
/* Form respective filenames.
*/
pInputFile = input_filename(argv[1]);
pOutputFile = output_filename(pInputFile, argc > 2 ? argv[2] : NULL);
if(pInputFile == NULL) {
fprintf(stderr, "MANTOMAK: Unable to form input filename\n");
iOS = 1;
}
else {
pInputStream = fopen(pInputFile, "rb");
if(pInputStream == NULL) {
fprintf(stderr, "MANTOMAK: Unable to open input file %s\n", pInputFile);
iOS = 1;
}
}
if(pOutputFile == NULL) {
fprintf(stderr, "MANTOMAK: Unable to form output filename\n");
iOS = 1;
}
else if(pInputStream != NULL) {
pOutputStream = fopen(pOutputFile, "wt");
if(pOutputStream == NULL) {
fprintf(stderr, "MANTOMAK: Unable to open output file %s\n", pOutputFile);
iOS = 1;
}
}
/* Only do the real processing if our error code is not
* already set.
*/
if(iOS == 0) {
iOS = input_to_output(pInputStream, pOutputStream);
}
if(pInputStream != NULL) {
fclose(pInputStream);
pInputStream = NULL;
}
if(pOutputStream != NULL) {
fclose(pOutputStream);
pOutputStream = NULL;
}
}
else {
help();
iOS = 1;
}
if(pInputFile) {
free(pInputFile);
pInputFile = NULL;
}
if(pOutputFile) {
free(pOutputFile);
pOutputFile = NULL;
}
return(iOS);
}
void help(void)
{
fprintf(stderr, "USAGE:\tmantomak.exe InputFile [OutputFile]\n\n");
fprintf(stderr, "InputFile:\tManifest file. If without extension, \"%s\" assumed.\n", DEFAULT_MANIFEST_EXT);
fprintf(stderr, "OutputFile:\tNMake file. If not present, \"InputFile%s\" assumed.\n", DEFAULT_MAKEFILE_EXT);
}
char *input_filename(const char *pInputFile)
{
char aResult[_MAX_PATH];
char aDrive[_MAX_DRIVE];
char aDir[_MAX_DIR];
char aName[_MAX_FNAME];
char aExt[_MAX_EXT];
if(pInputFile == NULL) {
return(NULL);
}
_splitpath(pInputFile, aDrive, aDir, aName, aExt);
if(aExt[0] == '\0') {
/* No extension provided.
* Use the default.
*/
strcpy(aExt, DEFAULT_MANIFEST_EXT);
}
aResult[0] = '\0';
_makepath(aResult, aDrive, aDir, aName, aExt);
if(aResult[0] == '\0') {
return(NULL);
}
else {
return(strdup(aResult));
}
}
char *output_filename(const char *pInputFile, const char *pOutputFile)
{
char aResult[_MAX_PATH];
char aDrive[_MAX_DRIVE];
char aDir[_MAX_DIR];
char aName[_MAX_FNAME];
char aExt[_MAX_EXT];
if(pOutputFile != NULL) {
return(strdup(pOutputFile));
}
/* From here on out, we have to create our own filename,
* implied from the input file name.
*/
if(pInputFile == NULL) {
return(NULL);
}
_splitpath(pInputFile, aDrive, aDir, aName, aExt);
strcpy(aExt, DEFAULT_MAKEFILE_EXT);
aResult[0] = '\0';
_makepath(aResult, aDrive, aDir, aName, aExt);
if(aResult[0] == '\0') {
return(NULL);
}
else {
return(strdup(aResult));
}
}
int input_to_output(FILE *pInput, FILE *pOutput)
{
char *pHog = NULL;
long lSize = 0;
int iRetval = 0;
/* Read the entire file into memory.
*/
fseek(pInput, 0, SEEK_END);
lSize = ftell(pInput);
fseek(pInput, 0, SEEK_SET);
pHog = (char *)malloc(lSize + 1);
if(pHog) {
*(pHog + lSize) = '\0';
fread(pHog, lSize, 1, pInput);
iRetval = buffer_to_output(pHog, pOutput);
free(pHog);
pHog = NULL;
}
else {
fprintf(stderr, "MANTOMAK: Out of Memory....\n");
iRetval = 1;
}
return(iRetval);
}
int output_rules(FILE *pOutput)
{
int iRetval = 0;
if(EOF ==
fputs("\n"
"!if \"$(MANIFEST_LEVEL)\"==\"RULES\""
"\n",
pOutput))
{
fprintf(stderr, "MANTOMAK: Error writing to file....\n");
iRetval = 1;
}
return(iRetval);
}
int output_end(FILE *pOutput)
{
int iRetval = 0;
if(EOF ==
fputs("\n"
"!endif"
"\n",
pOutput))
{
fprintf(stderr, "MANTOMAK: Error writing to file....\n");
iRetval = 1;
}
return(iRetval);
}
int buffer_to_output(char *pBuffer, FILE *pOutput)
{
int iRetval = 0;
macro_list *pMacros = NULL;
/* Tokenize the macros and their corresponding values.
*/
pMacros = extract_macros(pBuffer);
if(pMacros != NULL) {
/* Perform forward to backslash conversion on those macros known to be
* path information only.
*/
slash_convert(pMacros, "JBOOTDIRS");
slash_convert(pMacros, "JDIRS");
slash_convert(pMacros, "DEPTH");
slash_convert(pMacros, "NS_DEPTH");
slash_convert(pMacros, "PACKAGE");
slash_convert(pMacros, "JMC_GEN_DIR");
slash_convert(pMacros, "DIST_PUBLIC");
/* Process some of the macros, and convert them
* into different macros with different data.
*/
morph_macro(&pMacros, "JMC_GEN", "JMC_HEADERS", "$(JMC_GEN_DIR)\\%s.h");
morph_macro(&pMacros, "JMC_GEN", "JMC_STUBS", "$(JMC_GEN_DIR)\\%s.c");
morph_macro(&pMacros, "JMC_GEN", "JMC_OBJS", ".\\$(OBJDIR)\\%s.obj");
morph_macro(&pMacros, "CSRCS", "C_OBJS", ".\\$(OBJDIR)\\%s.obj");
morph_macro(&pMacros, "CPPSRCS", "CPP_OBJS", ".\\$(OBJDIR)\\%s.obj");
morph_macro(&pMacros, "REQUIRES", "LINCS", "-I$(XPDIST)\\public\\%s");
create_classroot( &pMacros );
/* Output the Macros and the corresponding values.
*/
iRetval = write_macros(pMacros, pOutput);
/* Output rule file inclusion
*/
if(iRetval == 0) {
iRetval = output_rules(pOutput);
}
/* Output explicit build rules/dependencies for JMC_GEN.
*/
if(iRetval == 0) {
iRetval = explicit_rules(pMacros, "JMC_GEN", pOutput);
}
if(iRetval == 0) {
iRetval = output_end(pOutput);
}
/* Free off the macro list.
*/
free_macro_list(pMacros);
pMacros = NULL;
}
return(iRetval);
}
int explicit_rules(macro_list *pList, char *pMacro, FILE *pOutput)
{
int iRetval = 0;
macro_list *pEntry = NULL;
if(pList == NULL || pMacro == NULL || pOutput == NULL) {
return(0);
}
/* Find macro of said name.
* Case insensitive.
*/
pEntry = pList;
while(pEntry) {
if(stricmp(pEntry->m_pMacro, pMacro) == 0) {
break;
}
pEntry = pEntry->m_pNext;
}
if(pEntry) {
/* Decide style of rule depending on macro name.
*/
if(stricmp(pEntry->m_pMacro, "JMC_GEN") == 0) {
char_list *pNames = NULL;
char *pModuleName = NULL;
char *pClassName = NULL;
pNames = pEntry->m_pValue;
while(pNames) {
pModuleName = pNames->m_pString;
pClassName = pModuleName + 1;
fprintf(pOutput, "$(JMC_GEN_DIR)\\%s.h", pModuleName);
fprintf(pOutput, ": ");
fprintf(pOutput, "$(JMCSRCDIR)\\%s.class", pClassName);
fprintf(pOutput, "\n ");
fprintf(pOutput, "$(JMC) -d $(JMC_GEN_DIR) -interface $(JMC_GEN_FLAGS) $(?F:.class=)");
fprintf(pOutput, "\n");
fprintf(pOutput, "$(JMC_GEN_DIR)\\%s.c", pModuleName);
fprintf(pOutput, ": ");
fprintf(pOutput, "$(JMCSRCDIR)\\%s.class", pClassName);
fprintf(pOutput, "\n ");
fprintf(pOutput, "$(JMC) -d $(JMC_GEN_DIR) -module $(JMC_GEN_FLAGS) $(?F:.class=)");
fprintf(pOutput, "\n");
pNames = pNames->m_pNext;
}
}
else {
/* Don't know how to format macro.
*/
iRetval = 69;
}
}
return(iRetval);
}
void slash_convert(macro_list *pList, char *pMacro)
{
macro_list *pEntry = NULL;
if(pList == NULL || pMacro == NULL) {
return;
}
/* Find macro of said name.
* Case insensitive.
*/
pEntry = pList;
while(pEntry) {
if(stricmp(pEntry->m_pMacro, pMacro) == 0) {
break;
}
pEntry = pEntry->m_pNext;
}
if(pEntry) {
char *pConvert = NULL;
char_list *pValue = pEntry->m_pValue;
while(pValue) {
pConvert = pValue->m_pString;
while(pConvert && *pConvert) {
if(*pConvert == '/') {
*pConvert = '\\';
}
pConvert++;
}
pValue = pValue->m_pNext;
}
}
}
void morph_macro(macro_list **ppList, char *pMacro, char *pMorph, char *pPrintf)
{
macro_list *pEntry = NULL;
if(ppList == NULL || pMacro == NULL || pMorph == NULL || pPrintf == NULL) {
return;
}
/* Find macro of said name.
* Case insensitive.
*/
pEntry = *ppList;
while(pEntry) {
if(stricmp(pEntry->m_pMacro, pMacro) == 0) {
break;
}
pEntry = pEntry->m_pNext;
}
if(pEntry) {
char_list *pFilename = NULL;
char aPath[_MAX_PATH];
char aDrive[_MAX_DRIVE];
char aDir[_MAX_DIR];
char aFName[_MAX_FNAME];
char aExt[_MAX_EXT];
char *pBuffer = NULL;
/* Start with buffer size needed.
* We expand this as we go along if needed.
*/
pBuffer = (char *)malloc(strlen(pMorph) + 2);
strcpy(pBuffer, pMorph);
strcat(pBuffer, "=");
/* Go through each value, converting over to new macro.
*/
pFilename = pEntry->m_pValue;
while(pFilename) {
_splitpath(pFilename->m_pString, aDrive, aDir, aFName, aExt);
/* Expand buffer by required amount.
*/
sprintf(aPath, pPrintf, aFName);
strcat(aPath, " ");
pBuffer = (char *)realloc(pBuffer, _msize(pBuffer) + strlen(aPath));
strcat(pBuffer, aPath);
pFilename = pFilename->m_pNext;
}
/* Add the macro.
*/
add_macro(pBuffer, ppList);
free(pBuffer);
pBuffer = NULL;
}
}
void create_classroot(macro_list **ppList )
{
char cwd[512];
int i, i2;
macro_list *pEntry = NULL;
macro_list *pE;
/* Find macro of said name.
* Case insensitive.
*/
pEntry = *ppList;
while(pEntry) {
if(stricmp(pEntry->m_pMacro, "PACKAGE") == 0) {
break;
}
pEntry = pEntry->m_pNext;
}
if(pEntry == 0 || pEntry->m_pValue == 0 || pEntry->m_pValue->m_pString == 0) {
return;
}
_getcwd( cwd, 512 );
i = strlen( pEntry->m_pValue->m_pString );
i2 = strlen( cwd );
cwd[i2-i-1] = 0;
pE = NULL;
pE = (macro_list *)calloc(sizeof(macro_list),1);
pE->m_pMacro = strdup("CLASSROOT");
pE->m_pValue = (char_list *)calloc(sizeof(char_list),1);
pE->m_pValue->m_pString = strdup(cwd);
while(*ppList) {
ppList = &((*ppList)->m_pNext);
}
*ppList = pE;
}
int write_macros(macro_list *pList, FILE *pOutput)
{
int iRetval = 0;
int iLineLength = 0;
if(pList == NULL || pOutput == NULL) {
return(0);
}
if(EOF ==
fputs("\n"
"!if \"$(MANIFEST_LEVEL)\"==\"MACROS\""
"\n",
pOutput))
{
fprintf(stderr, "MANTOMAK: Error writing to file....\n");
return(1);
}
while(pList) {
int bIgnoreForWin16 = 0;
/* The following macros should not be emitted for Win16 */
if (0 == strcmp(pList->m_pMacro, "LINCS")) {
bIgnoreForWin16 = 1;
}
if (bIgnoreForWin16) {
if(0 > fprintf(pOutput, "!if \"$(MOZ_BITS)\" != \"16\"\n")) {
fprintf(stderr, "MANTOMAK: Error writing to file....\n");
iRetval = 1;
break;
}
}
if(0 > fprintf(pOutput, "%s=", pList->m_pMacro)) {
fprintf(stderr, "MANTOMAK: Error writing to file....\n");
iRetval = 1;
break;
}
iLineLength += strlen(pList->m_pMacro) + 1;
iRetval = write_values(pList->m_pValue, pOutput, iLineLength);
if(iRetval) {
break;
}
if(EOF == fputc('\n', pOutput)) {
fprintf(stderr, "MANTOMAK: Error writing to file....\n");
iRetval = 1;
break;
}
iLineLength = 0;
pList = pList->m_pNext;
if (bIgnoreForWin16) {
if(0 > fprintf(pOutput, "!endif\n")) {
fprintf(stderr, "MANTOMAK: Error writing to file....\n");
iRetval = 1;
break;
}
bIgnoreForWin16 = 0;
}
}
if(EOF ==
fputs("\n"
"!endif"
"\n",
pOutput))
{
fprintf(stderr, "MANTOMAK: Error writing to file....\n");
return(1);
}
return(iRetval);
}
int write_values(char_list *pList, FILE *pOutput, int iLineLength)
{
int iRetval = 0;
if(pList == NULL || pOutput == NULL) {
return(0);
}
while(pList) {
if(iLineLength == 0) {
if(EOF == fputs(" ", pOutput)) {
fprintf(stderr, "MANTOMAK: Error writing to file....\n");
iRetval = 1;
break;
}
iLineLength += 4;
if(0 > fprintf(pOutput, "%s ", pList->m_pString)) {
fprintf(stderr, "MANTOMAK: Error writing to file....\n");
iRetval = 1;
break;
}
iLineLength += strlen(pList->m_pString) + 1;
}
else if(iLineLength + strlen(pList->m_pString) > 72) {
if(EOF == fputs("\\\n", pOutput)) {
fprintf(stderr, "MANTOMAK: Error writing to file....\n");
iRetval = 1;
break;
}
iLineLength = 0;
continue;
}
else {
if(0 > fprintf(pOutput, "%s ", pList->m_pString)) {
fprintf(stderr, "MANTOMAK: Error writing to file....\n");
iRetval = 1;
break;
}
iLineLength += strlen(pList->m_pString) + 1;
}
pList = pList->m_pNext;
}
return(iRetval);
}
macro_list *extract_macros(char *pBuffer)
{
macro_list *pRetval = NULL;
char *pTraverse = NULL;
char *pMacro = NULL;
pTraverse = pBuffer;
while(pTraverse) {
pMacro = NULL;
pTraverse = find_macro(pTraverse, &pMacro);
if(pMacro) {
add_macro(pMacro, &pRetval);
}
}
return(pRetval);
}
void add_macro(char *pString, macro_list **ppList)
{
macro_list *pEntry = NULL;
int iLength = 0;
if(pString == NULL || *pString == '\0' || ppList == NULL) {
return;
}
/* Allocate a new list entry for the macro.
*/
pEntry = (macro_list *)malloc(sizeof(macro_list));
memset(pEntry, 0, sizeof(macro_list));
/* Very first part of the string is the macro name.
* How long is it?
*/
iLength = macro_length(pString);
pEntry->m_pMacro = (char *)malloc(iLength + 1);
memset(pEntry->m_pMacro, 0, iLength + 1);
strncpy(pEntry->m_pMacro, pString, iLength);
/* Skip to the values.
* These are always on the right side of an '='
*/
pString = strchr(pString, '=');
if(pString) {
pString++;
}
add_values(pString, &(pEntry->m_pValue));
/* Add the macro to the end of the macro list.
*/
while(*ppList) {
ppList = &((*ppList)->m_pNext);
}
*ppList = pEntry;
}
void add_values(char *pString, char_list **ppList)
{
char_list **ppTraverse = NULL;
char_list *pEntry = NULL;
int iLength = 0;
int iBackslash = 0;
if(pString == NULL || *pString == '\0' || ppList == NULL) {
return;
}
while(pString) {
/* Find start of value.
*/
iBackslash = 0;
while(*pString) {
if(*pString == '\\') {
iBackslash++;
}
else if(*pString == '\n') {
if(iBackslash == 0) {
/* End of values.
* Setting to NULL gets out of all loops.
*/
pString = NULL;
break;
}
iBackslash = 0;
}
else if(!isspace(*pString)) {
/* Backslashes part of string.
* This screws up if a backslash is in the middle of the string.
*/
pString -= iBackslash;
break;
}
pString++;
}
if(pString == NULL || *pString == '\0') {
break;
}
/* Do not honor anything beginning with a #
*/
if(*pString == '#') {
/* End of line.
*/
while(*pString && *pString != '\n') {
pString++;
}
continue;
}
/* Very first part of the string is value name.
* How long is it?
*/
iLength = value_length(pString);
/* Do not honor $(NULL)
*/
if(_strnicmp(pString, "$(NULL)", 7) == 0) {
pString += iLength;
continue;
}
/* Allocate a new list entry for the next value.
*/
pEntry = (char_list *)malloc(sizeof(char_list));
memset(pEntry, 0, sizeof(char_list));
pEntry->m_pString = (char *)malloc(iLength + 1);
memset(pEntry->m_pString, 0, iLength + 1);
strncpy(pEntry->m_pString, pString, iLength);
/* Add new value entry to the end of the list.
*/
ppTraverse = ppList;
while(*ppTraverse) {
ppTraverse = &((*ppTraverse)->m_pNext);
}
*ppTraverse = pEntry;
/* Go on to next value.
*/
pString += iLength;
}
}
char *find_macro(char *pBuffer, char **ppMacro)
{
char *pRetval = NULL;
int iBackslash = 0;
if(pBuffer == NULL || ppMacro == NULL) {
return(NULL);
}
/* Skip any whitespace in the buffer.
* If comments need to be skipped also, this is the place.
*/
while(1) {
while(*pBuffer && isspace(*pBuffer)) {
pBuffer++;
}
if(*pBuffer == '#') {
/* Go to the end of the line, it's a comment.
*/
while(*pBuffer && *pBuffer != '\n') {
pBuffer++;
}
continue;
}
break;
}
if(*pBuffer) {
/* Should be at the start of a macro.
*/
*ppMacro = pBuffer;
}
/* Find the end of the macro for the return value.
* This is the end of a line which does not contain a backslash at the end.
*/
while(*pBuffer) {
if(*pBuffer == '\\') {
iBackslash++;
}
else if(*pBuffer == '\n') {
if(iBackslash == 0) {
pRetval = pBuffer + 1;
break;
}
iBackslash = 0;
}
else if(!isspace(*pBuffer)) {
iBackslash = 0;
}
pBuffer++;
}
return(pRetval);
}
int macro_length(char *pMacro)
{
int iRetval = 0;
if(pMacro == NULL) {
return(0);
}
/* Length is no big deal.
* Problem is finding the end:
* whitespace
* '='
*/
while(*pMacro) {
if(*pMacro == '=') {
break;
}
else if(isspace(*pMacro)) {
break;
}
pMacro++;
iRetval++;
}
return(iRetval);
}
int value_length(char *pValue)
{
int iRetval = 0;
if(pValue == NULL) {
return(0);
}
/* Length is no big deal.
* Problem is finding the end:
* whitespace
* '\\'whitespace
*/
while(*pValue) {
if(*pValue == '\\') {
char *pFindNewline = pValue + 1;
/* If whitespace to end of line, break here.
*/
while(isspace(*pFindNewline)) {
if(*pFindNewline == '\n') {
break;
}
pFindNewline++;
}
if(*pFindNewline == '\n') {
break;
}
}
else if(isspace(*pValue)) {
break;
}
pValue++;
iRetval++;
}
return(iRetval);
}
char *skip_white(char *pString)
{
if(pString == NULL) {
return(NULL);
}
while(*pString && isspace(*pString)) {
pString++;
}
return(pString);
}
void free_macro_list(macro_list *pList)
{
macro_list *pFree = NULL;
if(pList == NULL) {
return;
}
while(pList) {
pFree = pList;
pList = pList->m_pNext;
pFree->m_pNext = NULL;
free_char_list(pFree->m_pValue);
pFree->m_pValue = NULL;
free(pFree->m_pMacro);
pFree->m_pMacro = NULL;
free(pFree);
pFree = NULL;
}
}
void free_char_list(char_list *pList)
{
char_list *pFree = NULL;
if(pList == NULL) {
return;
}
while(pList) {
pFree = pList;
pList = pList->m_pNext;
pFree->m_pNext = NULL;
free(pFree->m_pString);
pFree->m_pString = NULL;
free(pFree);
pFree = NULL;
}
}

BIN
mozilla/config/mantomak.exe Executable file

Binary file not shown.

View File

@@ -0,0 +1,32 @@
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
DEPTH = ../..
MODULE = mkdepend
PROGRAM = mkdepend
CSRCS = cppsetup.c \
ifparser.c \
include.c \
main.c \
parse.c \
pr.c
include $(DEPTH)/config/rules.mk
DEFINES += -DINCLUDEDIR=\"/usr/include\" -DOBJSUFFIX=\".o\"

View File

@@ -0,0 +1,37 @@
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
DEPTH = ../..
topsrcdir = @top_srcdir@
VPATH = @srcdir@
srcdir = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = mkdepend
PROGRAM = mkdepend
CSRCS = cppsetup.c \
ifparser.c \
include.c \
main.c \
parse.c \
pr.c
include $(topsrcdir)/config/rules.mk
DEFINES += -DINCLUDEDIR=\"/usr/include\" -DOBJSUFFIX=\".o\"

View File

@@ -0,0 +1,244 @@
/* $XConsortium: cppsetup.c,v 1.13 94/04/17 20:10:32 gildea Exp $ */
/*
Copyright (c) 1993, 1994 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of the X Consortium shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from the X Consortium.
*/
#include "def.h"
#ifdef CPP
/*
* This file is strictly for the sake of cpy.y and yylex.c (if
* you indeed have the source for cpp).
*/
#define IB 1
#define SB 2
#define NB 4
#define CB 8
#define QB 16
#define WB 32
#define SALT '#'
#if pdp11 | vax | ns16000 | mc68000 | ibm032
#define COFF 128
#else
#define COFF 0
#endif
/*
* These variables used by cpy.y and yylex.c
*/
extern char *outp, *inp, *newp, *pend;
extern char *ptrtab;
extern char fastab[];
extern char slotab[];
/*
* cppsetup
*/
struct filepointer *currentfile;
struct inclist *currentinc;
cppsetup(line, filep, inc)
register char *line;
register struct filepointer *filep;
register struct inclist *inc;
{
register char *p, savec;
static boolean setupdone = FALSE;
boolean value;
if (!setupdone) {
cpp_varsetup();
setupdone = TRUE;
}
currentfile = filep;
currentinc = inc;
inp = newp = line;
for (p=newp; *p; p++)
;
/*
* put a newline back on the end, and set up pend, etc.
*/
*p++ = '\n';
savec = *p;
*p = '\0';
pend = p;
ptrtab = slotab+COFF;
*--inp = SALT;
outp=inp;
value = yyparse();
*p = savec;
return(value);
}
struct symtab *lookup(symbol)
char *symbol;
{
static struct symtab undefined;
struct symtab *sp;
sp = isdefined(symbol, currentinc, NULL);
if (sp == NULL) {
sp = &undefined;
sp->s_value = NULL;
}
return (sp);
}
pperror(tag, x0,x1,x2,x3,x4)
int tag,x0,x1,x2,x3,x4;
{
warning("\"%s\", line %d: ", currentinc->i_file, currentfile->f_line);
warning(x0,x1,x2,x3,x4);
}
yyerror(s)
register char *s;
{
fatalerr("Fatal error: %s\n", s);
}
#else /* not CPP */
#include "ifparser.h"
struct _parse_data {
struct filepointer *filep;
struct inclist *inc;
const char *line;
};
static const char *
_my_if_errors (ip, cp, expecting)
IfParser *ip;
const char *cp;
const char *expecting;
{
#ifdef DEBUG_MKDEPEND
struct _parse_data *pd = (struct _parse_data *) ip->data;
int lineno = pd->filep->f_line;
char *filename = pd->inc->i_file;
char prefix[300];
int prefixlen;
int i;
sprintf (prefix, "\"%s\":%d", filename, lineno);
prefixlen = strlen(prefix);
fprintf (stderr, "%s: %s", prefix, pd->line);
i = cp - pd->line;
if (i > 0 && pd->line[i-1] != '\n') {
putc ('\n', stderr);
}
for (i += prefixlen + 3; i > 0; i--) {
putc (' ', stderr);
}
fprintf (stderr, "^--- expecting %s\n", expecting);
#endif /* DEBUG_MKDEPEND */
return NULL;
}
#define MAXNAMELEN 256
static struct symtab *
_lookup_variable (ip, var, len)
IfParser *ip;
const char *var;
int len;
{
char tmpbuf[MAXNAMELEN + 1];
struct _parse_data *pd = (struct _parse_data *) ip->data;
if (len > MAXNAMELEN)
return 0;
strncpy (tmpbuf, var, len);
tmpbuf[len] = '\0';
return isdefined (tmpbuf, pd->inc, NULL);
}
static int
_my_eval_defined (ip, var, len)
IfParser *ip;
const char *var;
int len;
{
if (_lookup_variable (ip, var, len))
return 1;
else
return 0;
}
#define isvarfirstletter(ccc) (isalpha(ccc) || (ccc) == '_')
static int
_my_eval_variable (ip, var, len)
IfParser *ip;
const char *var;
int len;
{
struct symtab *s;
s = _lookup_variable (ip, var, len);
if (!s)
return 0;
do {
var = s->s_value;
if (!isvarfirstletter(*var))
break;
s = _lookup_variable (ip, var, strlen(var));
} while (s);
return atoi(var);
}
cppsetup(line, filep, inc)
register char *line;
register struct filepointer *filep;
register struct inclist *inc;
{
IfParser ip;
struct _parse_data pd;
int val = 0;
pd.filep = filep;
pd.inc = inc;
pd.line = line;
ip.funcs.handle_error = _my_if_errors;
ip.funcs.eval_defined = _my_eval_defined;
ip.funcs.eval_variable = _my_eval_variable;
ip.data = (char *) &pd;
(void) ParseIfExpression (&ip, line, &val);
if (val)
return IF;
else
return IFFALSE;
}
#endif /* CPP */

View File

@@ -0,0 +1,150 @@
/* $XConsortium: def.h,v 1.25 94/04/17 20:10:33 gildea Exp $ */
/*
Copyright (c) 1993, 1994 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of the X Consortium shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from the X Consortium.
*/
#ifndef NO_X11
#include <X11/Xosdefs.h>
#ifdef WIN32
#include <X11/Xw32defs.h>
#endif
#ifndef SUNOS4
#include <X11/Xfuncproto.h>
#endif /* SUNOS4 */
#endif /* NO_X11 */
#include <stdio.h>
#include <ctype.h>
#ifndef X_NOT_POSIX
#ifndef _POSIX_SOURCE
#define _POSIX_SOURCE
#endif
#endif
#include <sys/types.h>
#include <fcntl.h>
#include <sys/stat.h>
#define MAXDEFINES 512
#define MAXFILES 1024 /* Increased from 512. -mcafee */
#define MAXDIRS 64
#define SYMTABINC 10 /* must be > 1 for define() to work right */
#define TRUE 1
#define FALSE 0
/* the following must match the directives table in main.c */
#define IF 0
#define IFDEF 1
#define IFNDEF 2
#define ELSE 3
#define ENDIF 4
#define DEFINE 5
#define UNDEF 6
#define INCLUDE 7
#define LINE 8
#define PRAGMA 9
#define ERROR 10
#define IDENT 11
#define SCCS 12
#define ELIF 13
#define EJECT 14
#define IFFALSE 15 /* pseudo value --- never matched */
#define ELIFFALSE 16 /* pseudo value --- never matched */
#define INCLUDEDOT 17 /* pseudo value --- never matched */
#define IFGUESSFALSE 18 /* pseudo value --- never matched */
#define ELIFGUESSFALSE 19 /* pseudo value --- never matched */
#ifdef DEBUG
extern int _debugmask;
/*
* debug levels are:
*
* 0 show ifn*(def)*,endif
* 1 trace defined/!defined
* 2 show #include
* 3 show #include SYMBOL
* 4-6 unused
*/
#define debug(level,arg) { if (_debugmask & (1 << level)) warning arg; }
#else
#define debug(level,arg) /**/
#endif /* DEBUG */
typedef unsigned char boolean;
struct symtab {
char *s_name;
char *s_value;
};
struct inclist {
char *i_incstring; /* string from #include line */
char *i_file; /* path name of the include file */
struct inclist **i_list; /* list of files it itself includes */
int i_listlen; /* length of i_list */
struct symtab *i_defs; /* symbol table for this file */
int i_ndefs; /* current # defines */
int i_deflen; /* amount of space in table */
boolean i_defchecked; /* whether defines have been checked */
boolean i_notified; /* whether we have revealed includes */
boolean i_marked; /* whether it's in the makefile */
boolean i_searched; /* whether we have read this */
boolean i_included_sym; /* whether #include SYMBOL was found */
/* Can't use i_list if TRUE */
};
struct filepointer {
char *f_p;
char *f_base;
char *f_end;
long f_len;
long f_line;
};
#ifndef X_NOT_STDC_ENV
#include <stdlib.h>
#if defined(macII) && !defined(__STDC__) /* stdlib.h fails to define these */
char *malloc(), *realloc();
#endif /* macII */
#else
char *malloc();
char *realloc();
#endif
char *copy();
char *base_name();
char *getline();
struct symtab *slookup();
struct symtab *isdefined();
struct symtab *fdefined();
struct filepointer *getfile();
struct inclist *newinclude();
struct inclist *inc_path();
#if NeedVarargsPrototypes
extern fatalerr(char *, ...);
extern warning(char *, ...);
extern warning1(char *, ...);
#endif

View File

@@ -0,0 +1,458 @@
/*
* $XConsortium: ifparser.c,v 1.8 95/06/03 00:01:41 gildea Exp $
*
* Copyright 1992 Network Computing Devices, Inc.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose and without fee is hereby granted, provided
* that the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of Network Computing Devices may not be
* used in advertising or publicity pertaining to distribution of the software
* without specific, written prior permission. Network Computing Devices makes
* no representations about the suitability of this software for any purpose.
* It is provided ``as is'' without express or implied warranty.
*
* NETWORK COMPUTING DEVICES DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
* IN NO EVENT SHALL NETWORK COMPUTING DEVICES BE LIABLE FOR ANY SPECIAL,
* INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*
* Author: Jim Fulton
* Network Computing Devices, Inc.
*
* Simple if statement processor
*
* This module can be used to evaluate string representations of C language
* if constructs. It accepts the following grammar:
*
* EXPRESSION := VALUE
* | VALUE BINOP EXPRESSION
*
* VALUE := '(' EXPRESSION ')'
* | '!' VALUE
* | '-' VALUE
* | 'defined' '(' variable ')'
* | 'defined' variable
* | # variable '(' variable-list ')'
* | variable
* | number
*
* BINOP := '*' | '/' | '%'
* | '+' | '-'
* | '<<' | '>>'
* | '<' | '>' | '<=' | '>='
* | '==' | '!='
* | '&' | '|'
* | '&&' | '||'
*
* The normal C order of precidence is supported.
*
*
* External Entry Points:
*
* ParseIfExpression parse a string for #if
*/
#include "ifparser.h"
#include <ctype.h>
/****************************************************************************
Internal Macros and Utilities for Parser
****************************************************************************/
#define DO(val) if (!(val)) return NULL
#define CALLFUNC(ggg,fff) (*((ggg)->funcs.fff))
#define SKIPSPACE(ccc) while (isspace(*ccc)) ccc++
#define isvarfirstletter(ccc) (isalpha(ccc) || (ccc) == '_')
static const char *
parse_variable (g, cp, varp)
IfParser *g;
const char *cp;
const char **varp;
{
SKIPSPACE (cp);
if (!isvarfirstletter (*cp))
return CALLFUNC(g, handle_error) (g, cp, "variable name");
*varp = cp;
/* EMPTY */
for (cp++; isalnum(*cp) || *cp == '_'; cp++) ;
return cp;
}
static const char *
parse_number (g, cp, valp)
IfParser *g;
const char *cp;
int *valp;
{
SKIPSPACE (cp);
if (!isdigit(*cp))
return CALLFUNC(g, handle_error) (g, cp, "number");
#ifdef WIN32
*valp = strtol(cp, &cp, 0);
#else
*valp = atoi (cp);
/* EMPTY */
for (cp++; isdigit(*cp); cp++) ;
#endif
return cp;
}
static const char *
parse_value (g, cp, valp)
IfParser *g;
const char *cp;
int *valp;
{
const char *var;
*valp = 0;
SKIPSPACE (cp);
if (!*cp)
return cp;
switch (*cp) {
case '(':
DO (cp = ParseIfExpression (g, cp + 1, valp));
SKIPSPACE (cp);
if (*cp != ')')
return CALLFUNC(g, handle_error) (g, cp, ")");
return cp + 1; /* skip the right paren */
case '!':
DO (cp = parse_value (g, cp + 1, valp));
*valp = !(*valp);
return cp;
case '-':
DO (cp = parse_value (g, cp + 1, valp));
*valp = -(*valp);
return cp;
case '#':
DO (cp = parse_variable (g, cp + 1, &var));
SKIPSPACE (cp);
if (*cp != '(')
return CALLFUNC(g, handle_error) (g, cp, "(");
do {
DO (cp = parse_variable (g, cp + 1, &var));
SKIPSPACE (cp);
} while (*cp && *cp != ')');
if (*cp != ')')
return CALLFUNC(g, handle_error) (g, cp, ")");
*valp = 1; /* XXX */
return cp + 1;
case 'd':
if (strncmp (cp, "defined", 7) == 0 && !isalnum(cp[7])) {
int paren = 0;
int len;
cp += 7;
SKIPSPACE (cp);
if (*cp == '(') {
paren = 1;
cp++;
}
DO (cp = parse_variable (g, cp, &var));
len = cp - var;
SKIPSPACE (cp);
if (paren && *cp != ')')
return CALLFUNC(g, handle_error) (g, cp, ")");
*valp = (*(g->funcs.eval_defined)) (g, var, len);
return cp + paren; /* skip the right paren */
}
/* fall out */
}
if (isdigit(*cp)) {
DO (cp = parse_number (g, cp, valp));
} else if (!isvarfirstletter(*cp))
return CALLFUNC(g, handle_error) (g, cp, "variable or number");
else {
DO (cp = parse_variable (g, cp, &var));
*valp = (*(g->funcs.eval_variable)) (g, var, cp - var);
}
return cp;
}
static const char *
parse_product (g, cp, valp)
IfParser *g;
const char *cp;
int *valp;
{
int rightval;
DO (cp = parse_value (g, cp, valp));
SKIPSPACE (cp);
switch (*cp) {
case '*':
DO (cp = parse_product (g, cp + 1, &rightval));
*valp = (*valp * rightval);
break;
case '/':
DO (cp = parse_product (g, cp + 1, &rightval));
/* Do nothing in the divide-by-zero case. */
if (rightval) {
*valp = (*valp / rightval);
}
break;
case '%':
DO (cp = parse_product (g, cp + 1, &rightval));
*valp = (*valp % rightval);
break;
}
return cp;
}
static const char *
parse_sum (g, cp, valp)
IfParser *g;
const char *cp;
int *valp;
{
int rightval;
DO (cp = parse_product (g, cp, valp));
SKIPSPACE (cp);
switch (*cp) {
case '+':
DO (cp = parse_sum (g, cp + 1, &rightval));
*valp = (*valp + rightval);
break;
case '-':
DO (cp = parse_sum (g, cp + 1, &rightval));
*valp = (*valp - rightval);
break;
}
return cp;
}
static const char *
parse_shift (g, cp, valp)
IfParser *g;
const char *cp;
int *valp;
{
int rightval;
DO (cp = parse_sum (g, cp, valp));
SKIPSPACE (cp);
switch (*cp) {
case '<':
if (cp[1] == '<') {
DO (cp = parse_shift (g, cp + 2, &rightval));
*valp = (*valp << rightval);
}
break;
case '>':
if (cp[1] == '>') {
DO (cp = parse_shift (g, cp + 2, &rightval));
*valp = (*valp >> rightval);
}
break;
}
return cp;
}
static const char *
parse_inequality (g, cp, valp)
IfParser *g;
const char *cp;
int *valp;
{
int rightval;
DO (cp = parse_shift (g, cp, valp));
SKIPSPACE (cp);
switch (*cp) {
case '<':
if (cp[1] == '=') {
DO (cp = parse_inequality (g, cp + 2, &rightval));
*valp = (*valp <= rightval);
} else {
DO (cp = parse_inequality (g, cp + 1, &rightval));
*valp = (*valp < rightval);
}
break;
case '>':
if (cp[1] == '=') {
DO (cp = parse_inequality (g, cp + 2, &rightval));
*valp = (*valp >= rightval);
} else {
DO (cp = parse_inequality (g, cp + 1, &rightval));
*valp = (*valp > rightval);
}
break;
}
return cp;
}
static const char *
parse_equality (g, cp, valp)
IfParser *g;
const char *cp;
int *valp;
{
int rightval;
DO (cp = parse_inequality (g, cp, valp));
SKIPSPACE (cp);
switch (*cp) {
case '=':
if (cp[1] == '=')
cp++;
DO (cp = parse_equality (g, cp + 1, &rightval));
*valp = (*valp == rightval);
break;
case '!':
if (cp[1] != '=')
break;
DO (cp = parse_equality (g, cp + 2, &rightval));
*valp = (*valp != rightval);
break;
}
return cp;
}
static const char *
parse_band (g, cp, valp)
IfParser *g;
const char *cp;
int *valp;
{
int rightval;
DO (cp = parse_equality (g, cp, valp));
SKIPSPACE (cp);
switch (*cp) {
case '&':
if (cp[1] != '&') {
DO (cp = parse_band (g, cp + 1, &rightval));
*valp = (*valp & rightval);
}
break;
}
return cp;
}
static const char *
parse_bor (g, cp, valp)
IfParser *g;
const char *cp;
int *valp;
{
int rightval;
DO (cp = parse_band (g, cp, valp));
SKIPSPACE (cp);
switch (*cp) {
case '|':
if (cp[1] != '|') {
DO (cp = parse_bor (g, cp + 1, &rightval));
*valp = (*valp | rightval);
}
break;
}
return cp;
}
static const char *
parse_land (g, cp, valp)
IfParser *g;
const char *cp;
int *valp;
{
int rightval;
DO (cp = parse_bor (g, cp, valp));
SKIPSPACE (cp);
switch (*cp) {
case '&':
if (cp[1] != '&')
return CALLFUNC(g, handle_error) (g, cp, "&&");
DO (cp = parse_land (g, cp + 2, &rightval));
*valp = (*valp && rightval);
break;
}
return cp;
}
static const char *
parse_lor (g, cp, valp)
IfParser *g;
const char *cp;
int *valp;
{
int rightval;
DO (cp = parse_land (g, cp, valp));
SKIPSPACE (cp);
switch (*cp) {
case '|':
if (cp[1] != '|')
return CALLFUNC(g, handle_error) (g, cp, "||");
DO (cp = parse_lor (g, cp + 2, &rightval));
*valp = (*valp || rightval);
break;
}
return cp;
}
/****************************************************************************
External Entry Points
****************************************************************************/
const char *
ParseIfExpression (g, cp, valp)
IfParser *g;
const char *cp;
int *valp;
{
return parse_lor (g, cp, valp);
}

View File

@@ -0,0 +1,76 @@
/*
* $XConsortium: ifparser.h,v 1.1 92/08/22 13:05:39 rws Exp $
*
* Copyright 1992 Network Computing Devices, Inc.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose and without fee is hereby granted, provided
* that the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of Network Computing Devices may not be
* used in advertising or publicity pertaining to distribution of the software
* without specific, written prior permission. Network Computing Devices makes
* no representations about the suitability of this software for any purpose.
* It is provided ``as is'' without express or implied warranty.
*
* NETWORK COMPUTING DEVICES DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
* IN NO EVENT SHALL NETWORK COMPUTING DEVICES BE LIABLE FOR ANY SPECIAL,
* INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*
* Author: Jim Fulton
* Network Computing Devices, Inc.
*
* Simple if statement processor
*
* This module can be used to evaluate string representations of C language
* if constructs. It accepts the following grammar:
*
* EXPRESSION := VALUE
* | VALUE BINOP EXPRESSION
*
* VALUE := '(' EXPRESSION ')'
* | '!' VALUE
* | '-' VALUE
* | 'defined' '(' variable ')'
* | variable
* | number
*
* BINOP := '*' | '/' | '%'
* | '+' | '-'
* | '<<' | '>>'
* | '<' | '>' | '<=' | '>='
* | '==' | '!='
* | '&' | '|'
* | '&&' | '||'
*
* The normal C order of precidence is supported.
*
*
* External Entry Points:
*
* ParseIfExpression parse a string for #if
*/
#include <stdio.h>
#define const /**/
typedef int Bool;
#define False 0
#define True 1
typedef struct _if_parser {
struct { /* functions */
char *(*handle_error) (/* struct _if_parser *, const char *,
const char * */);
int (*eval_variable) (/* struct _if_parser *, const char *, int */);
int (*eval_defined) (/* struct _if_parser *, const char *, int */);
} funcs;
char *data;
} IfParser;
char *ParseIfExpression (/* IfParser *, const char *, int * */);

View File

@@ -0,0 +1,730 @@
/* $XConsortium: imakemdep.h,v 1.83 95/04/07 19:47:46 kaleb Exp $ */
/* $XFree86: xc/config/imake/imakemdep.h,v 3.12 1995/07/08 10:22:17 dawes Exp $ */
/*
Copyright (c) 1993, 1994 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of the X Consortium shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from the X Consortium.
*/
/*
* This file contains machine-dependent constants for the imake utility.
* When porting imake, read each of the steps below and add in any necessary
* definitions. In general you should *not* edit ccimake.c or imake.c!
*/
#ifdef CCIMAKE
/*
* Step 1: imake_ccflags
* Define any special flags that will be needed to get imake.c to compile.
* These will be passed to the compile along with the contents of the
* make variable BOOTSTRAPCFLAGS.
*/
#ifdef hpux
#ifdef hp9000s800
#define imake_ccflags "-DSYSV"
#else
#define imake_ccflags "-Wc,-Nd4000,-Ns3000 -DSYSV"
#endif
#endif
#if defined(macII) || defined(_AUX_SOURCE)
#define imake_ccflags "-DmacII -DSYSV"
#endif
#ifdef stellar
#define imake_ccflags "-DSYSV"
#endif
#if defined(USL) || defined(Oki) || defined(NCR)
#define imake_ccflags "-Xc -DSVR4"
#endif
#ifdef sony
#if defined(SYSTYPE_SYSV) || defined(_SYSTYPE_SYSV)
#define imake_ccflags "-DSVR4"
#else
#include <sys/param.h>
#if NEWSOS < 41
#define imake_ccflags "-Dbsd43 -DNOSTDHDRS"
#else
#if NEWSOS < 42
#define imake_ccflags "-Dbsd43"
#endif
#endif
#endif
#endif
#ifdef _CRAY
#define imake_ccflags "-DSYSV -DUSG"
#endif
#if defined(_IBMR2) || defined(aix)
#define imake_ccflags "-Daix -DSYSV"
#endif
#ifdef Mips
# if defined(SYSTYPE_BSD) || defined(BSD) || defined(BSD43)
# define imake_ccflags "-DBSD43"
# else
# define imake_ccflags "-DSYSV"
# endif
#endif
#ifdef is68k
#define imake_ccflags "-Dluna -Duniosb"
#endif
#ifdef SYSV386
# ifdef SVR4
# define imake_ccflags "-Xc -DSVR4"
# else
# define imake_ccflags "-DSYSV"
# endif
#endif
#ifdef SVR4
# ifdef i386
# define imake_ccflags "-Xc -DSVR4"
# endif
#endif
#ifdef SYSV
# ifdef i386
# define imake_ccflags "-DSYSV"
# endif
#endif
#ifdef __convex__
#define imake_ccflags "-fn -tm c1"
#endif
#ifdef apollo
#define imake_ccflags "-DX_NOT_POSIX"
#endif
#ifdef WIN32
#define imake_ccflags "-nologo -batch -D__STDC__"
#endif
#ifdef __uxp__
#define imake_ccflags "-DSVR4 -DANSICPP"
#endif
#ifdef __sxg__
#define imake_ccflags "-DSYSV -DUSG -DNOSTDHDRS"
#endif
#ifdef sequent
#define imake_ccflags "-DX_NOT_STDC_ENV -DX_NOT_POSIX"
#endif
#ifdef _SEQUENT_
#define imake_ccflags "-DSYSV -DUSG"
#endif
#if defined(SX) || defined(PC_UX)
#define imake_ccflags "-DSYSV"
#endif
#ifdef nec_ews_svr2
#define imake_ccflags "-DUSG"
#endif
#if defined(nec_ews_svr4) || defined(_nec_ews_svr4) || defined(_nec_up) || defined(_nec_ft)
#define imake_ccflags "-DSVR4"
#endif
#ifdef MACH
#define imake_ccflags "-DNOSTDHDRS"
#endif
/* this is for OS/2 under EMX. This won't work with DOS */
#if defined(__EMX__)
#define imake_ccflags "-DBSD43"
#endif
#else /* not CCIMAKE */
#ifndef MAKEDEPEND
/*
* Step 2: dup2
* If your OS doesn't have a dup2() system call to duplicate one file
* descriptor onto another, define such a mechanism here (if you don't
* already fall under the existing category(ies).
*/
#if defined(SYSV) && !defined(_CRAY) && !defined(Mips) && !defined(_SEQUENT_)
#define dup2(fd1,fd2) ((fd1 == fd2) ? fd1 : (close(fd2), \
fcntl(fd1, F_DUPFD, fd2)))
#endif
/*
* Step 3: FIXUP_CPP_WHITESPACE
* If your cpp collapses tabs macro expansions into a single space and
* replaces escaped newlines with a space, define this symbol. This will
* cause imake to attempt to patch up the generated Makefile by looking
* for lines that have colons in them (this is why the rules file escapes
* all colons). One way to tell if you need this is to see whether or not
* your Makefiles have no tabs in them and lots of @@ strings.
*/
#if defined(sun) || defined(SYSV) || defined(SVR4) || defined(hcx) || defined(WIN32) || (defined(AMOEBA) && defined(CROSS_COMPILE))
#define FIXUP_CPP_WHITESPACE
#endif
#ifdef WIN32
#define REMOVE_CPP_LEADSPACE
#define INLINE_SYNTAX
#define MAGIC_MAKE_VARS
#endif
#ifdef __minix_vmd
#define FIXUP_CPP_WHITESPACE
#endif
/*
* Step 4: USE_CC_E, DEFAULT_CC, DEFAULT_CPP
* If you want to use cc -E instead of cpp, define USE_CC_E.
* If use cc -E but want a different compiler, define DEFAULT_CC.
* If the cpp you need is not in /lib/cpp, define DEFAULT_CPP.
*/
#ifdef hpux
#define USE_CC_E
#endif
#ifdef WIN32
#define USE_CC_E
#define DEFAULT_CC "cl"
#endif
#ifdef apollo
#define DEFAULT_CPP "/usr/lib/cpp"
#endif
#if defined(_IBMR2) && !defined(DEFAULT_CPP)
#define DEFAULT_CPP "/usr/lpp/X11/Xamples/util/cpp/cpp"
#endif
#if defined(sun) && defined(SVR4)
#define DEFAULT_CPP "/usr/ccs/lib/cpp"
#endif
#ifdef __bsdi__
#define DEFAULT_CPP "/usr/bin/cpp"
#endif
#ifdef __uxp__
#define DEFAULT_CPP "/usr/ccs/lib/cpp"
#endif
#ifdef __sxg__
#define DEFAULT_CPP "/usr/lib/cpp"
#endif
#ifdef _CRAY
#define DEFAULT_CPP "/lib/pcpp"
#endif
#if defined(__386BSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)
#define DEFAULT_CPP "/usr/libexec/cpp"
#endif
#ifdef MACH
#define USE_CC_E
#endif
#ifdef __minix_vmd
#define DEFAULT_CPP "/usr/lib/cpp"
#endif
#if defined(__EMX__)
/* expects cpp in PATH */
#define DEFAULT_CPP "cpp"
#endif
/*
* Step 5: cpp_argv
* The following table contains the flags that should be passed
* whenever a Makefile is being generated. If your preprocessor
* doesn't predefine any unique symbols, choose one and add it to the
* end of this table. Then, do the following:
*
* a. Use this symbol in Imake.tmpl when setting MacroFile.
* b. Put this symbol in the definition of BootstrapCFlags in your
* <platform>.cf file.
* c. When doing a make World, always add "BOOTSTRAPCFLAGS=-Dsymbol"
* to the end of the command line.
*
* Note that you may define more than one symbol (useful for platforms
* that support multiple operating systems).
*/
#define ARGUMENTS 50 /* number of arguments in various arrays */
char *cpp_argv[ARGUMENTS] = {
"cc", /* replaced by the actual program to exec */
"-I.", /* add current directory to include path */
#ifdef unix
"-Uunix", /* remove unix symbol so that filename unix.c okay */
#endif
#if defined(__386BSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(MACH)
# ifdef __i386__
"-D__i386__",
# endif
# ifdef __GNUC__
"-traditional",
# endif
#endif
#ifdef M4330
"-DM4330", /* Tektronix */
#endif
#ifdef M4310
"-DM4310", /* Tektronix */
#endif
#if defined(macII) || defined(_AUX_SOURCE)
"-DmacII", /* Apple A/UX */
#endif
#ifdef USL
"-DUSL", /* USL */
#endif
#ifdef sony
"-Dsony", /* Sony */
#if !defined(SYSTYPE_SYSV) && !defined(_SYSTYPE_SYSV) && NEWSOS < 42
"-Dbsd43",
#endif
#endif
#ifdef _IBMR2
"-D_IBMR2", /* IBM RS-6000 (we ensured that aix is defined above */
#ifndef aix
#define aix /* allow BOOTSTRAPCFLAGS="-D_IBMR2" */
#endif
#endif /* _IBMR2 */
#ifdef aix
"-Daix", /* AIX instead of AOS */
#ifndef ibm
#define ibm /* allow BOOTSTRAPCFLAGS="-Daix" */
#endif
#endif /* aix */
#ifdef ibm
"-Dibm", /* IBM PS/2 and RT under both AOS and AIX */
#endif
#ifdef luna
"-Dluna", /* OMRON luna 68K and 88K */
#ifdef luna1
"-Dluna1",
#endif
#ifdef luna88k /* need not on UniOS-Mach Vers. 1.13 */
"-traditional", /* for some older version */
#endif /* instead of "-DXCOMM=\\#" */
#ifdef uniosb
"-Duniosb",
#endif
#ifdef uniosu
"-Duniosu",
#endif
#endif /* luna */
#ifdef _CRAY /* Cray */
"-Ucray",
#endif
#ifdef Mips
"-DMips", /* Define and use Mips for Mips Co. OS/mach. */
# if defined(SYSTYPE_BSD) || defined(BSD) || defined(BSD43)
"-DBSD43", /* Mips RISCOS supports two environments */
# else
"-DSYSV", /* System V environment is the default */
# endif
#endif /* Mips */
#ifdef MOTOROLA
"-DMOTOROLA", /* Motorola Delta Systems */
# ifdef SYSV
"-DSYSV",
# endif
# ifdef SVR4
"-DSVR4",
# endif
#endif /* MOTOROLA */
#ifdef i386
"-Di386",
# ifdef SVR4
"-DSVR4",
# endif
# ifdef SYSV
"-DSYSV",
# ifdef ISC
"-DISC",
# ifdef ISC40
"-DISC40", /* ISC 4.0 */
# else
# ifdef ISC202
"-DISC202", /* ISC 2.0.2 */
# else
# ifdef ISC30
"-DISC30", /* ISC 3.0 */
# else
"-DISC22", /* ISC 2.2.1 */
# endif
# endif
# endif
# endif
# ifdef SCO
"-DSCO",
# ifdef SCO324
"-DSCO324",
# endif
# endif
# endif
# ifdef ESIX
"-DESIX",
# endif
# ifdef ATT
"-DATT",
# endif
# ifdef DELL
"-DDELL",
# endif
#endif
#ifdef SYSV386 /* System V/386 folks, obsolete */
"-Di386",
# ifdef SVR4
"-DSVR4",
# endif
# ifdef ISC
"-DISC",
# ifdef ISC40
"-DISC40", /* ISC 4.0 */
# else
# ifdef ISC202
"-DISC202", /* ISC 2.0.2 */
# else
# ifdef ISC30
"-DISC30", /* ISC 3.0 */
# else
"-DISC22", /* ISC 2.2.1 */
# endif
# endif
# endif
# endif
# ifdef SCO
"-DSCO",
# ifdef SCO324
"-DSCO324",
# endif
# endif
# ifdef ESIX
"-DESIX",
# endif
# ifdef ATT
"-DATT",
# endif
# ifdef DELL
"-DDELL",
# endif
#endif
#ifdef __osf__
"-D__osf__",
# ifdef __mips__
"-D__mips__",
# endif
# ifdef __alpha
"-D__alpha",
# endif
# ifdef __i386__
"-D__i386__",
# endif
# ifdef __GNUC__
"-traditional",
# endif
#endif
#ifdef Oki
"-DOki",
#endif
#ifdef sun
#ifdef SVR4
"-DSVR4",
#endif
#endif
#ifdef WIN32
"-DWIN32",
"-nologo",
"-batch",
"-D__STDC__",
#endif
#ifdef NCR
"-DNCR", /* NCR */
#endif
#ifdef linux
"-traditional",
"-Dlinux",
#endif
#ifdef __uxp__
"-D__uxp__",
#endif
#ifdef __sxg__
"-D__sxg__",
#endif
#ifdef nec_ews_svr2
"-Dnec_ews_svr2",
#endif
#ifdef AMOEBA
"-DAMOEBA",
# ifdef CROSS_COMPILE
"-DCROSS_COMPILE",
# ifdef CROSS_i80386
"-Di80386",
# endif
# ifdef CROSS_sparc
"-Dsparc",
# endif
# ifdef CROSS_mc68000
"-Dmc68000",
# endif
# else
# ifdef i80386
"-Di80386",
# endif
# ifdef sparc
"-Dsparc",
# endif
# ifdef mc68000
"-Dmc68000",
# endif
# endif
#endif
#ifdef __minix_vmd
"-Dminix",
#endif
#if defined(__EMX__)
"-traditional",
"-Demxos2",
#endif
};
#else /* else MAKEDEPEND */
/*
* Step 6: predefs
* If your compiler and/or preprocessor define any specific symbols, add
* them to the the following table. The definition of struct symtab is
* in util/makedepend/def.h.
*/
struct symtab predefs[] = {
#ifdef apollo
{"apollo", "1"},
#endif
#ifdef ibm032
{"ibm032", "1"},
#endif
#ifdef ibm
{"ibm", "1"},
#endif
#ifdef aix
{"aix", "1"},
#endif
#ifdef sun
{"sun", "1"},
#endif
#ifdef sun2
{"sun2", "1"},
#endif
#ifdef sun3
{"sun3", "1"},
#endif
#ifdef sun4
{"sun4", "1"},
#endif
#ifdef sparc
{"sparc", "1"},
#endif
#ifdef __sparc__
{"__sparc__", "1"},
#endif
#ifdef hpux
{"hpux", "1"},
#endif
#ifdef __hpux
{"__hpux", "1"},
#endif
#ifdef __hp9000s800
{"__hp9000s800", "1"},
#endif
#ifdef __hp9000s700
{"__hp9000s700", "1"},
#endif
#ifdef vax
{"vax", "1"},
#endif
#ifdef VMS
{"VMS", "1"},
#endif
#ifdef cray
{"cray", "1"},
#endif
#ifdef CRAY
{"CRAY", "1"},
#endif
#ifdef _CRAY
{"_CRAY", "1"},
#endif
#ifdef att
{"att", "1"},
#endif
#ifdef mips
{"mips", "1"},
#endif
#ifdef __mips__
{"__mips__", "1"},
#endif
#ifdef ultrix
{"ultrix", "1"},
#endif
#ifdef stellar
{"stellar", "1"},
#endif
#ifdef mc68000
{"mc68000", "1"},
#endif
#ifdef mc68020
{"mc68020", "1"},
#endif
#ifdef __GNUC__
{"__GNUC__", "1"},
#endif
#if __STDC__
{"__STDC__", "1"},
#endif
#ifdef __HIGHC__
{"__HIGHC__", "1"},
#endif
#ifdef CMU
{"CMU", "1"},
#endif
#ifdef luna
{"luna", "1"},
#ifdef luna1
{"luna1", "1"},
#endif
#ifdef luna2
{"luna2", "1"},
#endif
#ifdef luna88k
{"luna88k", "1"},
#endif
#ifdef uniosb
{"uniosb", "1"},
#endif
#ifdef uniosu
{"uniosu", "1"},
#endif
#endif
#ifdef ieeep754
{"ieeep754", "1"},
#endif
#ifdef is68k
{"is68k", "1"},
#endif
#ifdef m68k
{"m68k", "1"},
#endif
#ifdef m88k
{"m88k", "1"},
#endif
#ifdef __m88k__
{"__m88k__", "1"},
#endif
#ifdef bsd43
{"bsd43", "1"},
#endif
#ifdef hcx
{"hcx", "1"},
#endif
#ifdef sony
{"sony", "1"},
#ifdef SYSTYPE_SYSV
{"SYSTYPE_SYSV", "1"},
#endif
#ifdef _SYSTYPE_SYSV
{"_SYSTYPE_SYSV", "1"},
#endif
#endif
#ifdef __OSF__
{"__OSF__", "1"},
#endif
#ifdef __osf__
{"__osf__", "1"},
#endif
#ifdef __alpha
{"__alpha", "1"},
#endif
#ifdef __DECC
{"__DECC", "1"},
#endif
#ifdef __decc
{"__decc", "1"},
#endif
#ifdef __uxp__
{"__uxp__", "1"},
#endif
#ifdef __sxg__
{"__sxg__", "1"},
#endif
#ifdef _SEQUENT_
{"_SEQUENT_", "1"},
{"__STDC__", "1"},
#endif
#ifdef __bsdi__
{"__bsdi__", "1"},
#endif
#ifdef nec_ews_svr2
{"nec_ews_svr2", "1"},
#endif
#ifdef nec_ews_svr4
{"nec_ews_svr4", "1"},
#endif
#ifdef _nec_ews_svr4
{"_nec_ews_svr4", "1"},
#endif
#ifdef _nec_up
{"_nec_up", "1"},
#endif
#ifdef SX
{"SX", "1"},
#endif
#ifdef nec
{"nec", "1"},
#endif
#ifdef _nec_ft
{"_nec_ft", "1"},
#endif
#ifdef PC_UX
{"PC_UX", "1"},
#endif
#ifdef sgi
{"sgi", "1"},
#endif
#ifdef __sgi
{"__sgi", "1"},
#endif
#ifdef __FreeBSD__
{"__FreeBSD__", "1"},
#endif
#ifdef __NetBSD__
{"__NetBSD__", "1"},
#endif
#ifdef __OpenBSD__
{"__OpenBSD__", "1"},
#endif
#ifdef __EMX__
{"__EMX__", "1"},
#endif
/* add any additional symbols before this line */
{NULL, NULL}
};
#endif /* MAKEDEPEND */
#endif /* CCIMAKE */

View File

@@ -0,0 +1,308 @@
/* $XConsortium: include.c,v 1.17 94/12/05 19:33:08 gildea Exp $ */
/*
Copyright (c) 1993, 1994 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of the X Consortium shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from the X Consortium.
*/
#include "def.h"
extern struct inclist inclist[ MAXFILES ],
*inclistp;
extern char *includedirs[ ];
extern char *notdotdot[ ];
extern boolean show_where_not;
extern boolean warn_multiple;
struct inclist *inc_path(file, include, dot)
register char *file,
*include;
boolean dot;
{
static char path[ BUFSIZ ];
register char **pp, *p;
register struct inclist *ip;
struct stat st;
boolean found = FALSE;
/*
* Check all previously found include files for a path that
* has already been expanded.
*/
for (ip = inclist; ip->i_file; ip++)
if ((strcmp(ip->i_incstring, include) == 0) && !ip->i_included_sym)
{
found = TRUE;
break;
}
/*
* If the path was surrounded by "" or is an absolute path,
* then check the exact path provided.
*/
if (!found && (dot || *include == '/')) {
if (stat(include, &st) == 0) {
ip = newinclude(include, include);
found = TRUE;
}
else if (show_where_not)
warning1("\tnot in %s\n", include);
}
/*
* See if this include file is in the directory of the
* file being compiled.
*/
if (!found) {
for (p=file+strlen(file); p>file; p--)
if (*p == '/')
break;
if (p == file)
strcpy(path, include);
else {
strncpy(path, file, (p-file) + 1);
path[ (p-file) + 1 ] = '\0';
strcpy(path + (p-file) + 1, include);
}
remove_dotdot(path);
if (stat(path, &st) == 0) {
ip = newinclude(path, include);
found = TRUE;
}
else if (show_where_not)
warning1("\tnot in %s\n", path);
}
/*
* Check the include directories specified. (standard include dir
* should be at the end.)
*/
if (!found)
for (pp = includedirs; *pp; pp++) {
sprintf(path, "%s/%s", *pp, include);
remove_dotdot(path);
if (stat(path, &st) == 0) {
ip = newinclude(path, include);
found = TRUE;
break;
}
else if (show_where_not)
warning1("\tnot in %s\n", path);
}
if (!found)
ip = NULL;
return(ip);
}
/*
* Occasionally, pathnames are created that look like .../x/../y
* Any of the 'x/..' sequences within the name can be eliminated.
* (but only if 'x' is not a symbolic link!!)
*/
remove_dotdot(path)
char *path;
{
register char *end, *from, *to, **cp;
char *components[ MAXFILES ],
newpath[ BUFSIZ ];
boolean component_copied;
/*
* slice path up into components.
*/
to = newpath;
if (*path == '/')
*to++ = '/';
*to = '\0';
cp = components;
for (from=end=path; *end; end++)
if (*end == '/') {
while (*end == '/')
*end++ = '\0';
if (*from)
*cp++ = from;
from = end;
}
*cp++ = from;
*cp = NULL;
/*
* Recursively remove all 'x/..' component pairs.
*/
cp = components;
while(*cp) {
if (!isdot(*cp) && !isdotdot(*cp) && isdotdot(*(cp+1))
&& !issymbolic(newpath, *cp))
{
char **fp = cp + 2;
char **tp = cp;
do
*tp++ = *fp; /* move all the pointers down */
while (*fp++);
if (cp != components)
cp--; /* go back and check for nested ".." */
} else {
cp++;
}
}
/*
* Concatenate the remaining path elements.
*/
cp = components;
component_copied = FALSE;
while(*cp) {
if (component_copied)
*to++ = '/';
component_copied = TRUE;
for (from = *cp; *from; )
*to++ = *from++;
*to = '\0';
cp++;
}
*to++ = '\0';
/*
* copy the reconstituted path back to our pointer.
*/
strcpy(path, newpath);
}
isdot(p)
register char *p;
{
if(p && *p++ == '.' && *p++ == '\0')
return(TRUE);
return(FALSE);
}
isdotdot(p)
register char *p;
{
if(p && *p++ == '.' && *p++ == '.' && *p++ == '\0')
return(TRUE);
return(FALSE);
}
issymbolic(dir, component)
register char *dir, *component;
{
#ifdef S_IFLNK
struct stat st;
char buf[ BUFSIZ ], **pp;
sprintf(buf, "%s%s%s", dir, *dir ? "/" : "", component);
for (pp=notdotdot; *pp; pp++)
if (strcmp(*pp, buf) == 0)
return (TRUE);
if (lstat(buf, &st) == 0
&& (st.st_mode & S_IFMT) == S_IFLNK) {
*pp++ = copy(buf);
if (pp >= &notdotdot[ MAXDIRS ])
fatalerr("out of .. dirs, increase MAXDIRS\n");
return(TRUE);
}
#endif
return(FALSE);
}
/*
* Add an include file to the list of those included by 'file'.
*/
struct inclist *newinclude(newfile, incstring)
register char *newfile, *incstring;
{
register struct inclist *ip;
/*
* First, put this file on the global list of include files.
*/
ip = inclistp++;
if (inclistp == inclist + MAXFILES - 1)
fatalerr("out of space: increase MAXFILES\n");
ip->i_file = copy(newfile);
ip->i_included_sym = FALSE;
if (incstring == NULL)
ip->i_incstring = ip->i_file;
else
ip->i_incstring = copy(incstring);
return(ip);
}
included_by(ip, newfile)
register struct inclist *ip, *newfile;
{
register i;
if (ip == NULL)
return;
/*
* Put this include file (newfile) on the list of files included
* by 'file'. If 'file' is NULL, then it is not an include
* file itself (i.e. was probably mentioned on the command line).
* If it is already on the list, don't stick it on again.
*/
if (ip->i_list == NULL)
ip->i_list = (struct inclist **)
malloc(sizeof(struct inclist *) * ++ip->i_listlen);
else {
for (i=0; i<ip->i_listlen; i++)
if (ip->i_list[ i ] == newfile) {
i = strlen(newfile->i_file);
if (!ip->i_included_sym &&
!(i > 2 &&
newfile->i_file[i-1] == 'c' &&
newfile->i_file[i-2] == '.'))
{
/* only complain if ip has */
/* no #include SYMBOL lines */
/* and is not a .c file */
if (warn_multiple)
{
warning("%s includes %s more than once!\n",
ip->i_file, newfile->i_file);
warning1("Already have\n");
for (i=0; i<ip->i_listlen; i++)
warning1("\t%s\n", ip->i_list[i]->i_file);
}
}
return;
}
ip->i_list = (struct inclist **) realloc(ip->i_list,
sizeof(struct inclist *) * ++ip->i_listlen);
}
ip->i_list[ ip->i_listlen-1 ] = newfile;
}
inc_clean ()
{
register struct inclist *ip;
for (ip = inclist; ip < inclistp; ip++) {
ip->i_marked = FALSE;
}
}

View File

@@ -0,0 +1,710 @@
/* $XConsortium: main.c,v 1.84 94/11/30 16:10:44 kaleb Exp $ */
/* $XFree86: xc/config/makedepend/main.c,v 3.4 1995/07/15 14:53:49 dawes Exp $ */
/*
Copyright (c) 1993, 1994 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of the X Consortium shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from the X Consortium.
*/
#include "def.h"
#ifdef hpux
#define sigvec sigvector
#endif /* hpux */
#ifdef X_POSIX_C_SOURCE
#define _POSIX_C_SOURCE X_POSIX_C_SOURCE
#include <signal.h>
#undef _POSIX_C_SOURCE
#else
#if defined(X_NOT_POSIX) || defined(_POSIX_SOURCE)
#include <signal.h>
#else
#define _POSIX_SOURCE
#include <signal.h>
#undef _POSIX_SOURCE
#endif
#endif
#if NeedVarargsPrototypes
#include <stdarg.h>
#endif
#ifdef MINIX
#define USE_CHMOD 1
#endif
#ifdef DEBUG
int _debugmask;
#endif
char *ProgramName;
char *directives[] = {
"if",
"ifdef",
"ifndef",
"else",
"endif",
"define",
"undef",
"include",
"line",
"pragma",
"error",
"ident",
"sccs",
"elif",
"eject",
NULL
};
#define MAKEDEPEND
#include "imakemdep.h" /* from config sources */
#undef MAKEDEPEND
struct inclist inclist[ MAXFILES ],
*inclistp = inclist,
maininclist;
char *filelist[ MAXFILES ];
char *includedirs[ MAXDIRS + 1 ];
char *notdotdot[ MAXDIRS ];
char *objprefix = "";
char *objsuffix = OBJSUFFIX;
char *startat = "# DO NOT DELETE";
int width = 78;
boolean append = FALSE;
boolean printed = FALSE;
boolean verbose = FALSE;
boolean show_where_not = FALSE;
boolean warn_multiple = FALSE; /* Warn on multiple includes of same file */
static
#ifdef SIGNALRETURNSINT
int
#else
void
#endif
catch (sig)
int sig;
{
fflush (stdout);
fatalerr ("got signal %d\n", sig);
}
#if defined(USG) || (defined(i386) && defined(SYSV)) || defined(WIN32) || defined(__EMX__) || defined(Lynx_22)
#define USGISH
#endif
#ifndef USGISH
#ifndef _POSIX_SOURCE
#define sigaction sigvec
#define sa_handler sv_handler
#define sa_mask sv_mask
#define sa_flags sv_flags
#endif
struct sigaction sig_act;
#endif /* USGISH */
main(argc, argv)
int argc;
char **argv;
{
register char **fp = filelist;
register char **incp = includedirs;
register char *p;
register struct inclist *ip;
char *makefile = NULL;
struct filepointer *filecontent;
struct symtab *psymp = predefs;
char *endmarker = NULL;
char *defincdir = NULL;
ProgramName = argv[0];
while (psymp->s_name)
{
define2(psymp->s_name, psymp->s_value, &maininclist);
psymp++;
}
if (argc == 2 && argv[1][0] == '@') {
struct stat ast;
int afd;
char *args;
char **nargv;
int nargc;
char quotechar = '\0';
nargc = 1;
if ((afd = open(argv[1]+1, O_RDONLY)) < 0)
fatalerr("cannot open \"%s\"\n", argv[1]+1);
fstat(afd, &ast);
args = (char *)malloc(ast.st_size + 1);
if ((ast.st_size = read(afd, args, ast.st_size)) < 0)
fatalerr("failed to read %s\n", argv[1]+1);
args[ast.st_size] = '\0';
close(afd);
for (p = args; *p; p++) {
if (quotechar) {
if (quotechar == '\\' ||
(*p == quotechar && p[-1] != '\\'))
quotechar = '\0';
continue;
}
switch (*p) {
case '\\':
case '"':
case '\'':
quotechar = *p;
break;
case ' ':
case '\n':
*p = '\0';
if (p > args && p[-1])
nargc++;
break;
}
}
if (p[-1])
nargc++;
nargv = (char **)malloc(nargc * sizeof(char *));
nargv[0] = argv[0];
argc = 1;
for (p = args; argc < nargc; p += strlen(p) + 1)
if (*p) nargv[argc++] = p;
argv = nargv;
}
for(argc--, argv++; argc; argc--, argv++) {
/* if looking for endmarker then check before parsing */
if (endmarker && strcmp (endmarker, *argv) == 0) {
endmarker = NULL;
continue;
}
if (**argv != '-') {
/* treat +thing as an option for C++ */
if (endmarker && **argv == '+')
continue;
*fp++ = argv[0];
continue;
}
switch(argv[0][1]) {
case '-':
endmarker = &argv[0][2];
if (endmarker[0] == '\0') endmarker = "--";
break;
case 'D':
if (argv[0][2] == '\0') {
argv++;
argc--;
}
for (p=argv[0] + 2; *p ; p++)
if (*p == '=') {
*p = ' ';
break;
}
define(argv[0] + 2, &maininclist);
break;
case 'I':
if (incp >= includedirs + MAXDIRS)
fatalerr("Too many -I flags.\n");
*incp++ = argv[0]+2;
if (**(incp-1) == '\0') {
*(incp-1) = *(++argv);
argc--;
}
break;
case 'Y':
defincdir = argv[0]+2;
break;
/* do not use if endmarker processing */
case 'a':
if (endmarker) break;
append = TRUE;
break;
case 'w':
if (endmarker) break;
if (argv[0][2] == '\0') {
argv++;
argc--;
width = atoi(argv[0]);
} else
width = atoi(argv[0]+2);
break;
case 'o':
if (endmarker) break;
if (argv[0][2] == '\0') {
argv++;
argc--;
objsuffix = argv[0];
} else
objsuffix = argv[0]+2;
break;
case 'p':
if (endmarker) break;
if (argv[0][2] == '\0') {
argv++;
argc--;
objprefix = argv[0];
} else
objprefix = argv[0]+2;
break;
case 'v':
if (endmarker) break;
verbose = TRUE;
#ifdef DEBUG
if (argv[0][2])
_debugmask = atoi(argv[0]+2);
#endif
break;
case 's':
if (endmarker) break;
startat = argv[0]+2;
if (*startat == '\0') {
startat = *(++argv);
argc--;
}
if (*startat != '#')
fatalerr("-s flag's value should start %s\n",
"with '#'.");
break;
case 'f':
if (endmarker) break;
makefile = argv[0]+2;
if (*makefile == '\0') {
makefile = *(++argv);
argc--;
}
break;
case 'm':
warn_multiple = TRUE;
break;
/* Ignore -O, -g so we can just pass ${CFLAGS} to
makedepend
*/
case 'O':
case 'g':
break;
default:
if (endmarker) break;
/* fatalerr("unknown opt = %s\n", argv[0]); */
warning("ignoring option %s\n", argv[0]);
}
}
if (!defincdir) {
#ifdef PREINCDIR
if (incp >= includedirs + MAXDIRS)
fatalerr("Too many -I flags.\n");
*incp++ = PREINCDIR;
#endif
if (incp >= includedirs + MAXDIRS)
fatalerr("Too many -I flags.\n");
*incp++ = INCLUDEDIR;
#ifdef POSTINCDIR
if (incp >= includedirs + MAXDIRS)
fatalerr("Too many -I flags.\n");
*incp++ = POSTINCDIR;
#endif
} else if (*defincdir) {
if (incp >= includedirs + MAXDIRS)
fatalerr("Too many -I flags.\n");
*incp++ = defincdir;
}
redirect(startat, makefile);
/*
* catch signals.
*/
#ifdef USGISH
/* should really reset SIGINT to SIG_IGN if it was. */
#ifdef SIGHUP
signal (SIGHUP, catch);
#endif
signal (SIGINT, catch);
#ifdef SIGQUIT
signal (SIGQUIT, catch);
#endif
signal (SIGILL, catch);
#ifdef SIGBUS
signal (SIGBUS, catch);
#endif
signal (SIGSEGV, catch);
#ifdef SIGSYS
signal (SIGSYS, catch);
#endif
signal (SIGFPE, catch);
#else
sig_act.sa_handler = catch;
#ifdef _POSIX_SOURCE
sigemptyset(&sig_act.sa_mask);
sigaddset(&sig_act.sa_mask, SIGINT);
sigaddset(&sig_act.sa_mask, SIGQUIT);
#ifdef SIGBUS
sigaddset(&sig_act.sa_mask, SIGBUS);
#endif
sigaddset(&sig_act.sa_mask, SIGILL);
sigaddset(&sig_act.sa_mask, SIGSEGV);
sigaddset(&sig_act.sa_mask, SIGHUP);
sigaddset(&sig_act.sa_mask, SIGPIPE);
#ifdef SIGSYS
sigaddset(&sig_act.sa_mask, SIGSYS);
#endif
#else
sig_act.sa_mask = ((1<<(SIGINT -1))
|(1<<(SIGQUIT-1))
#ifdef SIGBUS
|(1<<(SIGBUS-1))
#endif
|(1<<(SIGILL-1))
|(1<<(SIGSEGV-1))
|(1<<(SIGHUP-1))
|(1<<(SIGPIPE-1))
#ifdef SIGSYS
|(1<<(SIGSYS-1))
#endif
);
#endif /* _POSIX_SOURCE */
sig_act.sa_flags = 0;
sigaction(SIGHUP, &sig_act, (struct sigaction *)0);
sigaction(SIGINT, &sig_act, (struct sigaction *)0);
sigaction(SIGQUIT, &sig_act, (struct sigaction *)0);
sigaction(SIGILL, &sig_act, (struct sigaction *)0);
#ifdef SIGBUS
sigaction(SIGBUS, &sig_act, (struct sigaction *)0);
#endif
sigaction(SIGSEGV, &sig_act, (struct sigaction *)0);
#ifdef SIGSYS
sigaction(SIGSYS, &sig_act, (struct sigaction *)0);
#endif
#endif /* USGISH */
/*
* now peruse through the list of files.
*/
for(fp=filelist; *fp; fp++) {
filecontent = getfile(*fp);
ip = newinclude(*fp, (char *)NULL);
find_includes(filecontent, ip, ip, 0, FALSE);
freefile(filecontent);
recursive_pr_include(ip, ip->i_file, base_name(*fp));
inc_clean();
}
if (printed)
printf("\n");
exit(0);
}
struct filepointer *getfile(file)
char *file;
{
register int fd;
struct filepointer *content;
struct stat st;
content = (struct filepointer *)malloc(sizeof(struct filepointer));
if ((fd = open(file, O_RDONLY)) < 0) {
warning("cannot open \"%s\"\n", file);
content->f_p = content->f_base = content->f_end = (char *)malloc(1);
*content->f_p = '\0';
return(content);
}
fstat(fd, &st);
content->f_base = (char *)malloc(st.st_size+1);
if (content->f_base == NULL)
fatalerr("cannot allocate mem\n");
if ((st.st_size = read(fd, content->f_base, st.st_size)) < 0)
fatalerr("failed to read %s\n", file);
close(fd);
content->f_len = st.st_size+1;
content->f_p = content->f_base;
content->f_end = content->f_base + st.st_size;
*content->f_end = '\0';
content->f_line = 0;
return(content);
}
freefile(fp)
struct filepointer *fp;
{
free(fp->f_base);
free(fp);
}
char *copy(str)
register char *str;
{
register char *p = (char *)malloc(strlen(str) + 1);
strcpy(p, str);
return(p);
}
match(str, list)
register char *str, **list;
{
register int i;
for (i=0; *list; i++, list++)
if (strcmp(str, *list) == 0)
return(i);
return(-1);
}
/*
* Get the next line. We only return lines beginning with '#' since that
* is all this program is ever interested in.
*/
char *getline(filep)
register struct filepointer *filep;
{
register char *p, /* walking pointer */
*eof, /* end of file pointer */
*bol; /* beginning of line pointer */
register lineno; /* line number */
p = filep->f_p;
eof = filep->f_end;
if (p >= eof)
return((char *)NULL);
lineno = filep->f_line;
for(bol = p--; ++p < eof; ) {
if (*p == '/' && *(p+1) == '*') { /* consume comments */
*p++ = ' ', *p++ = ' ';
while (*p) {
if (*p == '*' && *(p+1) == '/') {
*p++ = ' ', *p = ' ';
break;
}
else if (*p == '\n')
lineno++;
*p++ = ' ';
}
continue;
}
#ifdef WIN32
else if (*p == '/' && *(p+1) == '/') { /* consume comments */
*p++ = ' ', *p++ = ' ';
while (*p && *p != '\n')
*p++ = ' ';
lineno++;
continue;
}
#endif
else if (*p == '\\') {
if (*(p+1) == '\n') {
*p = ' ';
*(p+1) = ' ';
lineno++;
}
}
else if (*p == '\n') {
lineno++;
if (*bol == '#') {
register char *cp;
*p++ = '\0';
/* punt lines with just # (yacc generated) */
for (cp = bol+1;
*cp && (*cp == ' ' || *cp == '\t'); cp++);
if (*cp) goto done;
}
bol = p+1;
}
}
if (*bol != '#')
bol = NULL;
done:
filep->f_p = p;
filep->f_line = lineno;
return(bol);
}
/*
* Strip the file name down to what we want to see in the Makefile.
* It will have objprefix and objsuffix around it.
*/
char *base_name(file)
register char *file;
{
register char *p;
file = copy(file);
for(p=file+strlen(file); p>file && *p != '.'; p--) ;
if (*p == '.')
*p = '\0';
return(file);
}
#if defined(USG) && !defined(CRAY) && !defined(SVR4) && !defined(__EMX__)
int rename (from, to)
char *from, *to;
{
(void) unlink (to);
if (link (from, to) == 0) {
unlink (from);
return 0;
} else {
return -1;
}
}
#endif /* USGISH */
redirect(line, makefile)
char *line,
*makefile;
{
struct stat st;
FILE *fdin, *fdout;
char backup[ BUFSIZ ],
buf[ BUFSIZ ];
boolean found = FALSE;
int len;
/*
* if makefile is "-" then let it pour onto stdout.
*/
if (makefile && *makefile == '-' && *(makefile+1) == '\0')
return;
/*
* use a default makefile is not specified.
*/
if (!makefile) {
if (stat("Makefile", &st) == 0)
makefile = "Makefile";
else if (stat("makefile", &st) == 0)
makefile = "makefile";
else
fatalerr("[mM]akefile is not present\n");
}
else
stat(makefile, &st);
if ((fdin = fopen(makefile, "r")) == NULL)
fatalerr("cannot open \"%s\"\n", makefile);
sprintf(backup, "%s.bak", makefile);
unlink(backup);
#if defined(WIN32) || defined(__EMX__)
fclose(fdin);
#endif
if (rename(makefile, backup) < 0)
fatalerr("cannot rename %s to %s\n", makefile, backup);
#if defined(WIN32) || defined(__EMX__)
if ((fdin = fopen(backup, "r")) == NULL)
fatalerr("cannot open \"%s\"\n", backup);
#endif
if ((fdout = freopen(makefile, "w", stdout)) == NULL)
fatalerr("cannot open \"%s\"\n", backup);
len = strlen(line);
while (!found && fgets(buf, BUFSIZ, fdin)) {
if (*buf == '#' && strncmp(line, buf, len) == 0)
found = TRUE;
fputs(buf, fdout);
}
if (!found) {
if (verbose)
warning("Adding new delimiting line \"%s\" and dependencies...\n",
line);
puts(line); /* same as fputs(fdout); but with newline */
} else if (append) {
while (fgets(buf, BUFSIZ, fdin)) {
fputs(buf, fdout);
}
}
fflush(fdout);
#if defined(USGISH) || defined(_SEQUENT_) || defined(USE_CHMOD)
chmod(makefile, st.st_mode);
#else
fchmod(fileno(fdout), st.st_mode);
#endif /* USGISH */
}
#if NeedVarargsPrototypes
fatalerr(char *msg, ...)
#else
/*VARARGS*/
fatalerr(msg,x1,x2,x3,x4,x5,x6,x7,x8,x9)
char *msg;
#endif
{
#if NeedVarargsPrototypes
va_list args;
#endif
fprintf(stderr, "%s: error: ", ProgramName);
#if NeedVarargsPrototypes
va_start(args, msg);
vfprintf(stderr, msg, args);
va_end(args);
#else
fprintf(stderr, msg,x1,x2,x3,x4,x5,x6,x7,x8,x9);
#endif
exit (1);
}
#if NeedVarargsPrototypes
warning(char *msg, ...)
#else
/*VARARGS0*/
warning(msg,x1,x2,x3,x4,x5,x6,x7,x8,x9)
char *msg;
#endif
{
#ifdef DEBUG_MKDEPEND
#if NeedVarargsPrototypes
va_list args;
#endif
fprintf(stderr, "%s: warning: ", ProgramName);
#if NeedVarargsPrototypes
va_start(args, msg);
vfprintf(stderr, msg, args);
va_end(args);
#else
fprintf(stderr, msg,x1,x2,x3,x4,x5,x6,x7,x8,x9);
#endif
#endif /* DEBUG_MKDEPEND */
}
#if NeedVarargsPrototypes
warning1(char *msg, ...)
#else
/*VARARGS0*/
warning1(msg,x1,x2,x3,x4,x5,x6,x7,x8,x9)
char *msg;
#endif
{
#ifdef DEBUG_MKDEPEND
#if NeedVarargsPrototypes
va_list args;
va_start(args, msg);
vfprintf(stderr, msg, args);
va_end(args);
#else
fprintf(stderr, msg,x1,x2,x3,x4,x5,x6,x7,x8,x9);
#endif
#endif /* DEBUG_MKDEPEND */
}

View File

@@ -0,0 +1,368 @@
.\" $XConsortium: mkdepend.man,v 1.15 94/04/17 20:10:37 gildea Exp $
.\" Copyright (c) 1993, 1994 X Consortium
.\"
.\" Permission is hereby granted, free of charge, to any person obtaining a
.\" copy of this software and associated documentation files (the "Software"),
.\" to deal in the Software without restriction, including without limitation
.\" the rights to use, copy, modify, merge, publish, distribute, sublicense,
.\" and/or sell copies of the Software, and to permit persons to whom the
.\" Software furnished to do so, subject to the following conditions:
.\"
.\" The above copyright notice and this permission notice shall be included in
.\" all copies or substantial portions of the Software.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
.\" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
.\" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
.\" THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
.\" WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
.\" OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
.\" SOFTWARE.
.\"
.\" Except as contained in this notice, the name of the X Consortium shall not
.\" be used in advertising or otherwise to promote the sale, use or other
.\" dealing in this Software without prior written authorization from the
.\" X Consortium.
.TH MAKEDEPEND 1 "Release 6" "X Version 11"
.UC 4
.SH NAME
makedepend \- create dependencies in makefiles
.SH SYNOPSIS
.B makedepend
[
.B \-Dname=def
] [
.B \-Dname
] [
.B \-Iincludedir
] [
.B \-Yincludedir
] [
.B \-a
] [
.B \-fmakefile
] [
.B \-oobjsuffix
] [
.B \-pobjprefix
] [
.B \-sstring
] [
.B \-wwidth
] [
.B \-v
] [
.B \-m
] [
\-\^\-
.B otheroptions
\-\^\-
]
sourcefile .\|.\|.
.br
.SH DESCRIPTION
.B Makedepend
reads each
.I sourcefile
in sequence and parses it like a C-preprocessor,
processing all
.I #include,
.I #define,
.I #undef,
.I #ifdef,
.I #ifndef,
.I #endif,
.I #if
and
.I #else
directives so that it can correctly tell which
.I #include,
directives would be used in a compilation.
Any
.I #include,
directives can reference files having other
.I #include
directives, and parsing will occur in these files as well.
.PP
Every file that a
.I sourcefile
includes,
directly or indirectly,
is what
.B makedepend
calls a "dependency".
These dependencies are then written to a
.I makefile
in such a way that
.B make(1)
will know which object files must be recompiled when a dependency has changed.
.PP
By default,
.B makedepend
places its output in the file named
.I makefile
if it exists, otherwise
.I Makefile.
An alternate makefile may be specified with the
.B \-f
option.
It first searches the makefile for
the line
.sp
# DO NOT DELETE THIS LINE \-\^\- make depend depends on it.
.sp
or one provided with the
.B \-s
option,
as a delimiter for the dependency output.
If it finds it, it will delete everything
following this to the end of the makefile
and put the output after this line.
If it doesn't find it, the program
will append the string to the end of the makefile
and place the output following that.
For each
.I sourcefile
appearing on the command line,
.B makedepend
puts lines in the makefile of the form
.sp
sourcefile.o:\0dfile .\|.\|.
.sp
Where "sourcefile.o" is the name from the command
line with its suffix replaced with ".o",
and "dfile" is a dependency discovered in a
.I #include
directive while parsing
.I sourcefile
or one of the files it included.
.SH EXAMPLE
Normally,
.B makedepend
will be used in a makefile target so that typing "make depend" will
bring the dependencies up to date for the makefile.
For example,
.nf
SRCS\0=\0file1.c\0file2.c\0.\|.\|.
CFLAGS\0=\0\-O\0\-DHACK\0\-I\^.\^.\^/foobar\0\-xyz
depend:
makedepend\0\-\^\-\0$(CFLAGS)\0\-\^\-\0$(SRCS)
.fi
.SH OPTIONS
.B Makedepend
will ignore any option that it does not understand so that you may use
the same arguments that you would for
.B cc(1).
.TP 5
.B \-Dname=def or \-Dname
Define.
This places a definition for
.I name
in
.B makedepend's
symbol table.
Without
.I =def
the symbol becomes defined as "1".
.TP 5
.B \-Iincludedir
Include directory.
This option tells
.B makedepend
to prepend
.I includedir
to its list of directories to search when it encounters
a
.I #include
directive.
By default,
.B makedepend
only searches the standard include directories (usually /usr/include
and possibly a compiler-dependent directory).
.TP 5
.B \-Yincludedir
Replace all of the standard include directories with the single specified
include directory; you can omit the
.I includedir
to simply prevent searching the standard include directories.
.TP 5
.B \-a
Append the dependencies to the end of the file instead of replacing them.
.TP 5
.B \-fmakefile
Filename.
This allows you to specify an alternate makefile in which
.B makedepend
can place its output.
.TP 5
.B \-oobjsuffix
Object file suffix.
Some systems may have object files whose suffix is something other
than ".o".
This option allows you to specify another suffix, such as
".b" with
.I -o.b
or ":obj"
with
.I -o:obj
and so forth.
.TP 5
.B \-pobjprefix
Object file prefix.
The prefix is prepended to the name of the object file. This is
usually used to designate a different directory for the object file.
The default is the empty string.
.TP 5
.B \-sstring
Starting string delimiter.
This option permits you to specify
a different string for
.B makedepend
to look for in the makefile.
.TP 5
.B \-wwidth
Line width.
Normally,
.B makedepend
will ensure that every output line that it writes will be no wider than
78 characters for the sake of readability.
This option enables you to change this width.
.TP 5
.B \-v
Verbose operation.
This option causes
.B makedepend
to emit the list of files included by each input file on standard output.
.TP 5
.B \-m
Warn about multiple inclusion.
This option causes
.B makedepend
to produce a warning if any input file includes another file more than
once. In previous versions of
.B makedepend
this was the default behavior; the default has been changed to better
match the behavior of the C compiler, which does not consider multiple
inclusion to be an error. This option is provided for backward
compatibility, and to aid in debugging problems related to multiple
inclusion.
.TP 5
.B "\-\^\- options \-\^\-"
If
.B makedepend
encounters a double hyphen (\-\^\-) in the argument list,
then any unrecognized argument following it
will be silently ignored; a second double hyphen terminates this
special treatment.
In this way,
.B makedepend
can be made to safely ignore esoteric compiler arguments that might
normally be found in a CFLAGS
.B make
macro (see the
.B EXAMPLE
section above).
All options that
.B makedepend
recognizes and appear between the pair of double hyphens
are processed normally.
.SH ALGORITHM
The approach used in this program enables it to run an order of magnitude
faster than any other "dependency generator" I have ever seen.
Central to this performance are two assumptions:
that all files compiled by a single
makefile will be compiled with roughly the same
.I -I
and
.I -D
options;
and that most files in a single directory will include largely the
same files.
.PP
Given these assumptions,
.B makedepend
expects to be called once for each makefile, with
all source files that are maintained by the
makefile appearing on the command line.
It parses each source and include
file exactly once, maintaining an internal symbol table
for each.
Thus, the first file on the command line will take an amount of time
proportional to the amount of time that a normal C preprocessor takes.
But on subsequent files, if it encounter's an include file
that it has already parsed, it does not parse it again.
.PP
For example,
imagine you are compiling two files,
.I file1.c
and
.I file2.c,
they each include the header file
.I header.h,
and the file
.I header.h
in turn includes the files
.I def1.h
and
.I def2.h.
When you run the command
.sp
makedepend\0file1.c\0file2.c
.sp
.B makedepend
will parse
.I file1.c
and consequently,
.I header.h
and then
.I def1.h
and
.I def2.h.
It then decides that the dependencies for this file are
.sp
file1.o:\0header.h\0def1.h\0def2.h
.sp
But when the program parses
.I file2.c
and discovers that it, too, includes
.I header.h,
it does not parse the file,
but simply adds
.I header.h,
.I def1.h
and
.I def2.h
to the list of dependencies for
.I file2.o.
.SH "SEE ALSO"
cc(1), make(1)
.SH BUGS
.B makedepend
parses, but does not currently evaluate, the SVR4
#predicate(token-list) preprocessor expression;
such expressions are simply assumed to be true.
This may cause the wrong
.I #include
directives to be evaluated.
.PP
Imagine you are parsing two files,
say
.I file1.c
and
.I file2.c,
each includes the file
.I def.h.
The list of files that
.I def.h
includes might truly be different when
.I def.h
is included by
.I file1.c
than when it is included by
.I file2.c.
But once
.B makedepend
arrives at a list of dependencies for a file,
it is cast in concrete.
.SH AUTHOR
Todd Brunhoff, Tektronix, Inc. and MIT Project Athena

View File

@@ -0,0 +1,567 @@
/* $XConsortium: parse.c,v 1.30 94/04/17 20:10:38 gildea Exp $ */
/*
Copyright (c) 1993, 1994 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of the X Consortium shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from the X Consortium.
*/
#include "def.h"
extern char *directives[];
extern struct inclist maininclist;
find_includes(filep, file, file_red, recursion, failOK)
struct filepointer *filep;
struct inclist *file, *file_red;
int recursion;
boolean failOK;
{
register char *line;
register int type;
boolean recfailOK;
while (line = getline(filep)) {
switch(type = deftype(line, filep, file_red, file, TRUE)) {
case IF:
doif:
type = find_includes(filep, file,
file_red, recursion+1, failOK);
while ((type == ELIF) || (type == ELIFFALSE) ||
(type == ELIFGUESSFALSE))
type = gobble(filep, file, file_red);
if (type == ELSE)
gobble(filep, file, file_red);
break;
case IFFALSE:
case IFGUESSFALSE:
doiffalse:
if (type == IFGUESSFALSE || type == ELIFGUESSFALSE)
recfailOK = TRUE;
else
recfailOK = failOK;
type = gobble(filep, file, file_red);
if (type == ELSE)
find_includes(filep, file,
file_red, recursion+1, recfailOK);
else
if (type == ELIF)
goto doif;
else
if ((type == ELIFFALSE) || (type == ELIFGUESSFALSE))
goto doiffalse;
break;
case IFDEF:
case IFNDEF:
if ((type == IFDEF && isdefined(line, file_red, NULL))
|| (type == IFNDEF && !isdefined(line, file_red, NULL))) {
debug(1,(type == IFNDEF ?
"line %d: %s !def'd in %s via %s%s\n" : "",
filep->f_line, line,
file->i_file, file_red->i_file, ": doit"));
type = find_includes(filep, file,
file_red, recursion+1, failOK);
while (type == ELIF || type == ELIFFALSE || type == ELIFGUESSFALSE)
type = gobble(filep, file, file_red);
if (type == ELSE)
gobble(filep, file, file_red);
}
else {
debug(1,(type == IFDEF ?
"line %d: %s !def'd in %s via %s%s\n" : "",
filep->f_line, line,
file->i_file, file_red->i_file, ": gobble"));
type = gobble(filep, file, file_red);
if (type == ELSE)
find_includes(filep, file,
file_red, recursion+1, failOK);
else if (type == ELIF)
goto doif;
else if (type == ELIFFALSE || type == ELIFGUESSFALSE)
goto doiffalse;
}
break;
case ELSE:
case ELIFFALSE:
case ELIFGUESSFALSE:
case ELIF:
if (!recursion)
gobble(filep, file, file_red);
case ENDIF:
if (recursion)
return(type);
case DEFINE:
define(line, file);
break;
case UNDEF:
if (!*line) {
warning("%s, line %d: incomplete undef == \"%s\"\n",
file_red->i_file, filep->f_line, line);
break;
}
undefine(line, file_red);
break;
case INCLUDE:
add_include(filep, file, file_red, line, FALSE, failOK);
break;
case INCLUDEDOT:
add_include(filep, file, file_red, line, TRUE, failOK);
break;
case ERROR:
warning("%s: %d: %s\n", file_red->i_file,
filep->f_line, line);
break;
case PRAGMA:
case IDENT:
case SCCS:
case EJECT:
break;
case -1:
warning("%s", file_red->i_file);
if (file_red != file)
warning1(" (reading %s)", file->i_file);
warning1(", line %d: unknown directive == \"%s\"\n",
filep->f_line, line);
break;
case -2:
warning("%s", file_red->i_file);
if (file_red != file)
warning1(" (reading %s)", file->i_file);
warning1(", line %d: incomplete include == \"%s\"\n",
filep->f_line, line);
break;
}
}
return(-1);
}
gobble(filep, file, file_red)
register struct filepointer *filep;
struct inclist *file, *file_red;
{
register char *line;
register int type;
while (line = getline(filep)) {
switch(type = deftype(line, filep, file_red, file, FALSE)) {
case IF:
case IFFALSE:
case IFGUESSFALSE:
case IFDEF:
case IFNDEF:
type = gobble(filep, file, file_red);
while ((type == ELIF) || (type == ELIFFALSE) ||
(type == ELIFGUESSFALSE))
type = gobble(filep, file, file_red);
if (type == ELSE)
(void)gobble(filep, file, file_red);
break;
case ELSE:
case ENDIF:
debug(0,("%s, line %d: #%s\n",
file->i_file, filep->f_line,
directives[type]));
return(type);
case DEFINE:
case UNDEF:
case INCLUDE:
case INCLUDEDOT:
case PRAGMA:
case ERROR:
case IDENT:
case SCCS:
case EJECT:
break;
case ELIF:
case ELIFFALSE:
case ELIFGUESSFALSE:
return(type);
case -1:
warning("%s, line %d: unknown directive == \"%s\"\n",
file_red->i_file, filep->f_line, line);
break;
}
}
return(-1);
}
/*
* Decide what type of # directive this line is.
*/
int deftype (line, filep, file_red, file, parse_it)
register char *line;
register struct filepointer *filep;
register struct inclist *file_red, *file;
int parse_it;
{
register char *p;
char *directive, savechar;
register int ret;
/*
* Parse the directive...
*/
directive=line+1;
while (*directive == ' ' || *directive == '\t')
directive++;
p = directive;
while (*p >= 'a' && *p <= 'z')
p++;
savechar = *p;
*p = '\0';
ret = match(directive, directives);
*p = savechar;
/* If we don't recognize this compiler directive or we happen to just
* be gobbling up text while waiting for an #endif or #elif or #else
* in the case of an #elif we must check the zero_value and return an
* ELIF or an ELIFFALSE.
*/
if (ret == ELIF && !parse_it)
{
while (*p == ' ' || *p == '\t')
p++;
/*
* parse an expression.
*/
debug(0,("%s, line %d: #elif %s ",
file->i_file, filep->f_line, p));
ret = zero_value(p, filep, file_red);
if (ret != IF)
{
debug(0,("false...\n"));
if (ret == IFFALSE)
return(ELIFFALSE);
else
return(ELIFGUESSFALSE);
}
else
{
debug(0,("true...\n"));
return(ELIF);
}
}
if (ret < 0 || ! parse_it)
return(ret);
/*
* now decide how to parse the directive, and do it.
*/
while (*p == ' ' || *p == '\t')
p++;
switch (ret) {
case IF:
/*
* parse an expression.
*/
ret = zero_value(p, filep, file_red);
debug(0,("%s, line %d: %s #if %s\n",
file->i_file, filep->f_line, ret?"false":"true", p));
break;
case IFDEF:
case IFNDEF:
debug(0,("%s, line %d: #%s %s\n",
file->i_file, filep->f_line, directives[ret], p));
case UNDEF:
/*
* separate the name of a single symbol.
*/
while (isalnum(*p) || *p == '_')
*line++ = *p++;
*line = '\0';
break;
case INCLUDE:
debug(2,("%s, line %d: #include %s\n",
file->i_file, filep->f_line, p));
/* Support ANSI macro substitution */
{
struct symtab *sym = isdefined(p, file_red, NULL);
while (sym) {
p = sym->s_value;
debug(3,("%s : #includes SYMBOL %s = %s\n",
file->i_incstring,
sym -> s_name,
sym -> s_value));
/* mark file as having included a 'soft include' */
file->i_included_sym = TRUE;
sym = isdefined(p, file_red, NULL);
}
}
/*
* Separate the name of the include file.
*/
while (*p && *p != '"' && *p != '<')
p++;
if (! *p)
return(-2);
if (*p++ == '"') {
ret = INCLUDEDOT;
while (*p && *p != '"')
*line++ = *p++;
} else
while (*p && *p != '>')
*line++ = *p++;
*line = '\0';
break;
case DEFINE:
/*
* copy the definition back to the beginning of the line.
*/
strcpy (line, p);
break;
case ELSE:
case ENDIF:
case ELIF:
case PRAGMA:
case ERROR:
case IDENT:
case SCCS:
case EJECT:
debug(0,("%s, line %d: #%s\n",
file->i_file, filep->f_line, directives[ret]));
/*
* nothing to do.
*/
break;
}
return(ret);
}
struct symtab *isdefined(symbol, file, srcfile)
register char *symbol;
struct inclist *file;
struct inclist **srcfile;
{
register struct symtab *val;
if (val = slookup(symbol, &maininclist)) {
debug(1,("%s defined on command line\n", symbol));
if (srcfile != NULL) *srcfile = &maininclist;
return(val);
}
if (val = fdefined(symbol, file, srcfile))
return(val);
debug(1,("%s not defined in %s\n", symbol, file->i_file));
return(NULL);
}
struct symtab *fdefined(symbol, file, srcfile)
register char *symbol;
struct inclist *file;
struct inclist **srcfile;
{
register struct inclist **ip;
register struct symtab *val;
register int i;
static int recurse_lvl = 0;
if (file->i_defchecked)
return(NULL);
file->i_defchecked = TRUE;
if (val = slookup(symbol, file))
debug(1,("%s defined in %s as %s\n", symbol, file->i_file, val->s_value));
if (val == NULL && file->i_list)
{
for (ip = file->i_list, i=0; i < file->i_listlen; i++, ip++)
if (val = fdefined(symbol, *ip, srcfile)) {
break;
}
}
else if (val != NULL && srcfile != NULL) *srcfile = file;
recurse_lvl--;
file->i_defchecked = FALSE;
return(val);
}
/*
* Return type based on if the #if expression evaluates to 0
*/
zero_value(exp, filep, file_red)
register char *exp;
register struct filepointer *filep;
register struct inclist *file_red;
{
if (cppsetup(exp, filep, file_red))
return(IFFALSE);
else
return(IF);
}
define(def, file)
char *def;
struct inclist *file;
{
char *val;
/* Separate symbol name and its value */
val = def;
while (isalnum(*val) || *val == '_')
val++;
if (*val)
*val++ = '\0';
while (*val == ' ' || *val == '\t')
val++;
if (!*val)
val = "1";
define2(def, val, file);
}
define2(name, val, file)
char *name, *val;
struct inclist *file;
{
int first, last, below;
register struct symtab *sp = NULL, *dest;
/* Make space if it's needed */
if (file->i_defs == NULL)
{
file->i_defs = (struct symtab *)
malloc(sizeof (struct symtab) * SYMTABINC);
file->i_deflen = SYMTABINC;
file->i_ndefs = 0;
}
else if (file->i_ndefs == file->i_deflen)
file->i_defs = (struct symtab *)
realloc(file->i_defs,
sizeof(struct symtab)*(file->i_deflen+=SYMTABINC));
if (file->i_defs == NULL)
fatalerr("malloc()/realloc() failure in insert_defn()\n");
below = first = 0;
last = file->i_ndefs - 1;
while (last >= first)
{
/* Fast inline binary search */
register char *s1;
register char *s2;
register int middle = (first + last) / 2;
/* Fast inline strchr() */
s1 = name;
s2 = file->i_defs[middle].s_name;
while (*s1++ == *s2++)
if (s2[-1] == '\0') break;
/* If exact match, set sp and break */
if (*--s1 == *--s2)
{
sp = file->i_defs + middle;
break;
}
/* If name > i_defs[middle] ... */
if (*s1 > *s2)
{
below = first;
first = middle + 1;
}
/* else ... */
else
{
below = last = middle - 1;
}
}
/* Search is done. If we found an exact match to the symbol name,
just replace its s_value */
if (sp != NULL)
{
free(sp->s_value);
sp->s_value = copy(val);
return;
}
sp = file->i_defs + file->i_ndefs++;
dest = file->i_defs + below + 1;
while (sp > dest)
{
*sp = sp[-1];
sp--;
}
sp->s_name = copy(name);
sp->s_value = copy(val);
}
struct symtab *slookup(symbol, file)
register char *symbol;
register struct inclist *file;
{
register int first = 0;
register int last = file->i_ndefs - 1;
if (file) while (last >= first)
{
/* Fast inline binary search */
register char *s1;
register char *s2;
register int middle = (first + last) / 2;
/* Fast inline strchr() */
s1 = symbol;
s2 = file->i_defs[middle].s_name;
while (*s1++ == *s2++)
if (s2[-1] == '\0') break;
/* If exact match, we're done */
if (*--s1 == *--s2)
{
return file->i_defs + middle;
}
/* If symbol > i_defs[middle] ... */
if (*s1 > *s2)
{
first = middle + 1;
}
/* else ... */
else
{
last = middle - 1;
}
}
return(NULL);
}
undefine(symbol, file)
char *symbol;
register struct inclist *file;
{
register struct symtab *ptr;
struct inclist *srcfile;
while ((ptr = isdefined(symbol, file, &srcfile)) != NULL)
{
srcfile->i_ndefs--;
for (; ptr < srcfile->i_defs + srcfile->i_ndefs; ptr++)
*ptr = ptr[1];
}
}

View File

@@ -0,0 +1,132 @@
/* $XConsortium: pr.c,v 1.17 94/04/17 20:10:38 gildea Exp $ */
/*
Copyright (c) 1993, 1994 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of the X Consortium shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from the X Consortium.
*/
#include "def.h"
extern struct inclist inclist[ MAXFILES ],
*inclistp;
extern char *objprefix;
extern char *objsuffix;
extern int width;
extern boolean printed;
extern boolean verbose;
extern boolean show_where_not;
add_include(filep, file, file_red, include, dot, failOK)
struct filepointer *filep;
struct inclist *file, *file_red;
char *include;
boolean dot;
{
register struct inclist *newfile;
register struct filepointer *content;
/*
* First decide what the pathname of this include file really is.
*/
newfile = inc_path(file->i_file, include, dot);
if (newfile == NULL) {
if (failOK)
return;
if (file != file_red)
warning("%s (reading %s, line %d): ",
file_red->i_file, file->i_file, filep->f_line);
else
warning("%s, line %d: ", file->i_file, filep->f_line);
warning1("cannot find include file \"%s\"\n", include);
show_where_not = TRUE;
newfile = inc_path(file->i_file, include, dot);
show_where_not = FALSE;
}
if (newfile) {
/* Only add new dependency files if they don't have "/usr/include" in them. */
if (!(newfile && newfile->i_file && strstr(newfile->i_file, "/usr/"))) {
included_by(file, newfile);
}
if (!newfile->i_searched) {
newfile->i_searched = TRUE;
content = getfile(newfile->i_file);
find_includes(content, newfile, file_red, 0, failOK);
freefile(content);
}
}
}
recursive_pr_include(head, file, base)
register struct inclist *head;
register char *file, *base;
{
register int i;
if (head->i_marked)
return;
head->i_marked = TRUE;
if (head->i_file != file)
pr(head, file, base);
for (i=0; i<head->i_listlen; i++)
recursive_pr_include(head->i_list[ i ], file, base);
}
pr(ip, file, base)
register struct inclist *ip;
char *file, *base;
{
static char *lastfile;
static int current_len;
register int len, i;
char buf[ BUFSIZ ];
printed = TRUE;
len = strlen(ip->i_file)+1;
if (current_len + len > width || file != lastfile) {
lastfile = file;
sprintf(buf, "\n%s%s%s: %s", objprefix, base, objsuffix,
ip->i_file);
len = current_len = strlen(buf);
}
else {
buf[0] = ' ';
strcpy(buf+1, ip->i_file);
current_len += len;
}
fwrite(buf, len, 1, stdout);
/*
* If verbose is set, then print out what this file includes.
*/
if (! verbose || ip->i_list == NULL || ip->i_notified)
return;
ip->i_notified = TRUE;
lastfile = NULL;
printf("\n# %s includes:", ip->i_file);
for (i=0; i<ip->i_listlen; i++)
printf("\n#\t%s", ip->i_list[ i ]->i_incstring);
}

View File

@@ -0,0 +1,203 @@
# -*- Mode: Makefile -*-
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
DEPTH = ../..
# A uniq identifier that describes this host
ifdef MOZILLA_CONFIG_HOST_IDENT
DETECT_UNIQ_IDENT = $(MOZILLA_CONFIG_HOST_IDENT)
else
DETECT_UNIQ_IDENT = $(shell $(DETECT_DIR)/detect_hostident.sh)
endif
# Where we live
DETECT_DIR = $(DEPTH)/config/mkdetect
# Name of genereated makefile
DETECT_NAME = detect_$(DETECT_UNIQ_IDENT)_gen.mk
# The glibc detection script
DETECT_GLIBC = $(DETECT_DIR)/detect_glibc.sh -o $(DETECT_UNIQ_IDENT)
# The motif detection script
DETECT_MOTIF =\
$(DETECT_DIR)/detect_motif.sh -o $(DETECT_UNIQ_IDENT) \
-xif $(X11_INCLUDE_FLAGS)
# The X11 detection script
DETECT_X11 = $(DETECT_DIR)/detect_x11.sh -o $(DETECT_UNIQ_IDENT)
# The following macros are generated:
#
# MOZILLA_XFE_GLIBC_BROKEN_LOCALE_FLAGS
# Needed because of currently broken locale support when mixing gnu
# libc2 with any version of motif.
#
#
# MOZILLA_XFE_MOTIF_PRINT_SHELL_FLAGS
# X Print Shell Extension (available starting with X11R6.3) needed
# by motif 2.1.
#
#
# MOZILLA_XFE_USE_WINNING_FILE_SELECTION
# Hacks to the motif file selection code to "fix" it. Where "fix"
# means "make the motif fsb not suck as hell". Motif source code
# is needed for this hack (it breaks with lesstif)
#
#
# Questions about any of these flags or this wacky scheme in general, should
# go to ramiro@netscape.com.
#
all: export
export: $(DETECT_NAME)
detect: $(DETECT_NAME)
realclean clobber clobber_all clean:
@rm -f $(DETECT_NAME) *_motif_$(DETECT_UNIQ_IDENT)* *_glibc_$(DETECT_UNIQ_IDENT)* *_x11_$(DETECT_UNIQ_IDENT)*
# This is needed for DETECT_MOTIF to work
X11_INCLUDE_FLAGS=$(shell $(DETECT_X11) -if)
$(DETECT_NAME):
@echo "Generating $(DETECT_NAME)."
@rm -f $@
@touch $@
@echo "#" >> $@
@echo "# Do Not edit." >> $@
@echo "# Automagically generated file." >> $@
@echo "#" >> $@
@echo >> $@
@echo >> $@
##
## GLIBC
##
##
## In theory, you can use glibc2 in many platforms. Right now only Linux
## seems to be using it, though.
##
## Test whether -lBrokenLocale is needed. Locale support is broken
## when using motif (any version) with gnu libc2.
##
ifeq ($(shell $(DETECT_GLIBC)),2)
@echo "# GLIBC2" >> $@
@echo "MOZILLA_XFE_USING_GLIBC2 = 1" >> $@
@echo >> $@
@echo "# Broken Locale" >> $@
@echo "MOZILLA_XFE_GLIBC_BROKEN_LOCALE_FLAGS = -lBrokenLocale" >> $@
endif
##
## X11
##
##
## Set the x11 include flags
##
@echo >> $@
@echo "# X11" >> $@
@echo "MOZILLA_XFE_X11_INCLUDE_FLAGS = `$(DETECT_X11) -if`" >> $@
##
## Determine if we have static x11 libs and set static flags.
##
ifneq ($(shell $(DETECT_X11) -sl),unknown)
@echo "MOZILLA_XFE_X11_HAVE_STATIC_LIB = 1" >> $@
@echo "MOZILLA_XFE_X11_STATIC_FLAGS = `$(DETECT_X11) -sf`" >> $@
endif
##
## Determine if we have dynamic x11 libs and set dynamic flags.
##
ifneq ($(shell $(DETECT_X11) -dl),unknown)
@echo "MOZILLA_XFE_X11_HAVE_DYNAMIC_LIB = 1" >> $@
@echo "MOZILLA_XFE_X11_DYNAMIC_PATHS = `$(DETECT_X11) -dp`" >> $@
@echo "MOZILLA_XFE_X11_DYNAMIC_FLAGS = `$(DETECT_X11) -df`" >> $@
endif
##
## Test whether -lSM -lICE are needed. These libs are need for session
## management in X11R6.
##
ifeq ($(shell $(DETECT_X11)),6)
@echo "MOZILLA_XFE_X11_SM_FLAGS = -lSM -lICE" >> $@
endif
##
## Motif
##
##
## Set the motif include flags
##
@echo >> $@
@echo "# Motif" >> $@
@echo "MOZILLA_XFE_MOTIF_INCLUDE_FLAGS = `$(DETECT_MOTIF) -if`" >> $@
##
## Determine if we have static motif libs and set static flags.
##
ifneq ($(shell $(DETECT_MOTIF) -sl),unknown)
@echo "MOZILLA_XFE_MOTIF_HAVE_STATIC_LIB = 1" >> $@
@echo "MOZILLA_XFE_MOTIF_STATIC_FLAGS = `$(DETECT_MOTIF) -sf`" >> $@
endif
##
## Determine if we have dynamic motif libs and set dynamic flags.
##
ifneq ($(shell $(DETECT_MOTIF) -dl),unknown)
@echo "MOZILLA_XFE_MOTIF_HAVE_DYNAMIC_LIB = 1" >> $@
@echo "MOZILLA_XFE_MOTIF_DYNAMIC_PATHS = `$(DETECT_MOTIF) -dp`" >> $@
@echo "MOZILLA_XFE_MOTIF_DYNAMIC_FLAGS = `$(DETECT_MOTIF) -df`" >> $@
endif
##
## Test whether -lXp is needed. The -lXp (Print Shell Extensions)
## are needed only with motif 2.1.
##
ifeq ($(shell $(DETECT_MOTIF)),2.1)
@echo "MOZILLA_XFE_MOTIF_PRINT_SHELL_FLAGS = -lXp" >> $@
endif
##
## Test whether -lXpm is needed. The -lXpm (X Pixmap Libary) is needed
## by some versions of motif. Some vendors try to do their customers
## favours by hacking the stock motif libs to include Xpm support.
##
ifeq ($(shell $(DETECT_MOTIF) -xpm),True)
@echo "MOZILLA_XFE_MOTIF_XPM_FLAGS = -lXpm" >> $@
endif
##
## Test whether we are using "real" motif libraries. If we are, then
## we can turn on the file selection hack which only works with motif
## (not lesstif)
##
ifneq ($(shell $(DETECT_MOTIF) -l),True)
@echo >> $@
@echo "# Winning File Selection" >> $@
@echo "MOZILLA_XFE_USE_WINNING_FILE_SELECTION = 1" >> $@
endif
##
## Lots of other magical things can be detected here.
##

View File

@@ -0,0 +1,217 @@
# -*- Mode: Makefile -*-
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
DEPTH = ../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
# A uniq identifier that describes this host
ifdef MOZILLA_CONFIG_HOST_IDENT
DETECT_UNIQ_IDENT = $(MOZILLA_CONFIG_HOST_IDENT)
else
DETECT_UNIQ_IDENT = $(shell $(DETECT_DIR)/detect_hostident.sh)
endif
# Where we live
DETECT_DIR = $(topsrcdir)/config/mkdetect
# Name of genereated makefile
DETECT_NAME = detect_$(DETECT_UNIQ_IDENT)_gen.mk
# The glibc detection script
DETECT_GLIBC = $(DETECT_DIR)/detect_glibc.sh -o $(DETECT_UNIQ_IDENT) \
-cc $(CC)
# The motif detection script
DETECT_MOTIF =\
$(DETECT_DIR)/detect_motif.sh -o $(DETECT_UNIQ_IDENT) \
-xif $(X11_INCLUDE_FLAGS) \
-cc $(CC)
# The X11 detection script
DETECT_X11 = $(DETECT_DIR)/detect_x11.sh -o $(DETECT_UNIQ_IDENT) \
-cc $(CC)
# The following macros are generated:
#
# MOZILLA_XFE_GLIBC_BROKEN_LOCALE_FLAGS
# Needed because of currently broken locale support when mixing gnu
# libc2 with any version of motif.
#
#
# MOZILLA_XFE_MOTIF_PRINT_SHELL_FLAGS
# X Print Shell Extension (available starting with X11R6.3) needed
# by motif 2.1.
#
#
# MOZILLA_XFE_USE_WINNING_FILE_SELECTION
# Hacks to the motif file selection code to "fix" it. Where "fix"
# means "make the motif fsb not suck as hell". Motif source code
# is needed for this hack (it breaks with lesstif)
#
#
# Questions about any of these flags or this wacky scheme in general, should
# go to ramiro@netscape.com.
#
all: export
export: $(DETECT_NAME)
detect: $(DETECT_NAME)
realclean clobber clobber_all clean:
@rm -f $(DETECT_NAME) *_motif_$(DETECT_UNIQ_IDENT)* *_glibc_$(DETECT_UNIQ_IDENT)* *_x11_$(DETECT_UNIQ_IDENT)*
# This is needed for DETECT_MOTIF to work
X11_INCLUDE_FLAGS=$(shell $(DETECT_X11) -if)
$(DETECT_NAME):
@echo "Generating $(DETECT_NAME)."
@rm -f $@
@touch $@
@echo "#" >> $@
@echo "# Do Not edit." >> $@
@echo "# Automagically generated file." >> $@
@echo "#" >> $@
@echo >> $@
@echo >> $@
##
## GLIBC
##
##
## In theory, you can use glibc2 in many platforms. Right now only Linux
## seems to be using it, though.
##
## Test whether -lBrokenLocale is needed. Locale support is broken
## when using motif (any version) with gnu libc2.
##
ifeq ($(shell $(DETECT_GLIBC)),2)
@echo "# GLIBC2" >> $@
@echo "MOZILLA_XFE_USING_GLIBC2 = 1" >> $@
@echo >> $@
@echo "# Broken Locale" >> $@
@echo "MOZILLA_XFE_GLIBC_BROKEN_LOCALE_FLAGS = -lBrokenLocale" >> $@
endif
##
## X11
##
##
## Set the x11 include flags
##
@echo >> $@
@echo "# X11" >> $@
@echo "MOZILLA_XFE_X11_INCLUDE_FLAGS = `$(DETECT_X11) -if`" >> $@
##
## Determine if we have static x11 libs and set static flags.
##
ifneq ($(shell $(DETECT_X11) -sl),unknown)
@echo "MOZILLA_XFE_X11_HAVE_STATIC_LIB = 1" >> $@
@echo "MOZILLA_XFE_X11_STATIC_FLAGS = `$(DETECT_X11) -sf`" >> $@
endif
##
## Determine if we have dynamic x11 libs and set dynamic flags.
##
ifneq ($(shell $(DETECT_X11) -dl),unknown)
@echo "MOZILLA_XFE_X11_HAVE_DYNAMIC_LIB = 1" >> $@
@echo "MOZILLA_XFE_X11_DYNAMIC_PATHS = `$(DETECT_X11) -dp`" >> $@
@echo "MOZILLA_XFE_X11_DYNAMIC_FLAGS = `$(DETECT_X11) -df`" >> $@
endif
##
## Test whether -lSM -lICE are needed. These libs are need for session
## management in X11R6.
##
ifeq ($(shell $(DETECT_X11)),6)
@echo "MOZILLA_XFE_X11_SM_FLAGS = -lSM -lICE" >> $@
endif
##
## Motif
##
ifdef FE_X_LIBS
##
## Set the motif include flags
##
@echo >> $@
@echo "# Motif" >> $@
@echo "MOZILLA_XFE_MOTIF_INCLUDE_FLAGS = `$(DETECT_MOTIF) -if`" >> $@
##
## Determine if we have static motif libs and set static flags.
##
ifneq ($(shell $(DETECT_MOTIF) -sl),unknown)
@echo "MOZILLA_XFE_MOTIF_HAVE_STATIC_LIB = 1" >> $@
@echo "MOZILLA_XFE_MOTIF_STATIC_FLAGS = `$(DETECT_MOTIF) -sf`" >> $@
endif
##
## Determine if we have dynamic motif libs and set dynamic flags.
##
ifneq ($(shell $(DETECT_MOTIF) -dl),unknown)
@echo "MOZILLA_XFE_MOTIF_HAVE_DYNAMIC_LIB = 1" >> $@
@echo "MOZILLA_XFE_MOTIF_DYNAMIC_PATHS = `$(DETECT_MOTIF) -dp`" >> $@
@echo "MOZILLA_XFE_MOTIF_DYNAMIC_FLAGS = `$(DETECT_MOTIF) -df`" >> $@
endif
##
## Test whether -lXp is needed. The -lXp (Print Shell Extensions)
## are needed only with motif 2.1.
##
ifeq ($(shell $(DETECT_MOTIF)),2.1)
@echo "MOZILLA_XFE_MOTIF_PRINT_SHELL_FLAGS = -lXp" >> $@
endif
##
## Test whether -lXpm is needed. The -lXpm (X Pixmap Libary) is needed
## by some versions of motif. Some vendors try to do their customers
## favours by hacking the stock motif libs to include Xpm support.
##
ifeq ($(shell $(DETECT_MOTIF) -xpm),True)
@echo "MOZILLA_XFE_MOTIF_XPM_FLAGS = -lXpm" >> $@
endif
##
## Test whether we are using "real" motif libraries. If we are, then
## we can turn on the file selection hack which only works with motif
## (not lesstif)
##
ifneq ($(shell $(DETECT_MOTIF) -l),True)
@echo >> $@
@echo "# Winning File Selection" >> $@
@echo "MOZILLA_XFE_USE_WINNING_FILE_SELECTION = 1" >> $@
endif
# This is the endif for including motif
endif
##
## Lots of other magical things can be detected here.
##

View File

@@ -0,0 +1,221 @@
#!/bin/sh
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
##############################################################################
##
## Name: detect_glibc.sh - Print __GLIBC__ version if gnu libc 2 is found.
##
## Description: This script is needed by the mozilla build system. It needs
## to determine whether the current platform (mostly the
## various linux "platforms") are based on the gnu libc2. This
## information is later used in mozilla to determine whether
## gnu libc 2 specific "features" need to be handled, such
## as broken locales.
##
## Author: Ramiro Estrugo <ramiro@netscape.com>
##
##############################################################################
##
## Command Line Flags Supported:
##
## -g | --is-glibc2: Print True/False if detected __GLIBC__.
##
## -v | --print-version: Print value of __GLIBC__ if found, or none.
##
## -o | --set-object-name: Set object name for current system.
## -cc | --set-compiler: Set compiler for building test program.
##
## -c | --cleanup: Clean up any generated files.
##
##
## Constants
##
GLIBC_PROG_PREFIX=./detect_glibc
##
## Defaults
##
GLIBC_PRINT_IS_GLIBC2=False
GLIBC_PRINT_VERSION=False
GLIBC_OBJECT_NAME=`uname`-`uname -r`
GLIBC_CC=cc
GLIBC_CLEANUP=False
glibc_usage()
{
echo
echo "Usage: `basename $0` [options]"
echo
echo " -g, --is-glibc2: Print True/False if detected __GLIBC__."
echo
echo " -v, --print-version: Print value of __GLIBC__ if found, or none."
echo
echo " -o, --set-object-name: Set object name for current system."
echo " -cc, --set-compiler: Set compiler for building test program."
echo
echo " -c, --cleanup: Clean up any generated files."
echo
echo " -h, --help: Print this blurb."
echo
echo "The default is '-v' if no options are given."
echo
}
##
## Parse the command line
##
while [ "$*" ]; do
case $1 in
-h | --help)
shift
glibc_usage
exit 0
;;
-g | --is-glibc2)
shift
GLIBC_PRINT_IS_GLIBC2=True
;;
-v | --print-version)
shift
GLIBC_PRINT_VERSION=True
;;
-o | --set-object-name)
shift
GLIBC_OBJECT_NAME="$1"
shift
;;
-cc | --set-compiler)
shift
GLIBC_CC="$1"
shift
;;
-c | --cleanup)
shift
GLIBC_CLEANUP=True
;;
-*)
echo "`basename $0`: invalid option '$1'"
shift
glibc_usage
exit 0
;;
esac
done
##
## Glibc info program name
##
GLIBC_PROG="$GLIBC_PROG_PREFIX"_"$GLIBC_OBJECT_NAME"
GLIBC_SRC="$GLIBC_PROG_PREFIX"_"$GLIBC_OBJECT_NAME.c"
##
## Cleanup the dummy test source/program
##
glibc_cleanup()
{
rm -f $GLIBC_PROG $GLIBC_SRC
}
##
## -c | --cleanup
##
if [ "$GLIBC_CLEANUP" = "True" ]
then
glibc_cleanup
exit 0
fi
if [ ! -f $GLIBC_SRC ]
then
cat << EOF > $GLIBC_SRC
#include <stdio.h>
int main(int argc,char ** argv)
{
#ifdef __GLIBC__
fprintf(stdout,"%d\n",__GLIBC__);
#else
fprintf(stdout,"none\n");
#endif
return 0;
}
EOF
fi
if [ ! -f $GLIBC_SRC ]
then
echo
echo "Could not create test program source $GLIBC_SRC."
echo
exit
fi
##
## Compile the dummy test program if needed
##
if [ ! -x $GLIBC_PROG ]
then
$GLIBC_CC -o $GLIBC_PROG $GLIBC_SRC
fi
if [ ! -x $GLIBC_PROG ]
then
echo
echo "Could not create test program $GLIBC_PROG."
echo
exit
fi
##
## Execute the dummy test program
##
GLIBC_PROG_OUTPUT=`$GLIBC_PROG`
##
## -g | --is-glibc2
##
if [ "$GLIBC_PRINT_IS_GLIBC2" = "True" ]
then
if [ "$GLIBC_PROG_OUTPUT" = "2" ]
then
echo True
else
echo False
fi
exit 0
fi
echo $GLIBC_PROG_OUTPUT

View File

@@ -0,0 +1,41 @@
#!/bin/sh
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
##############################################################################
##
## Name: detect_hostident.sh - Print a uniq ident that describes this host
##
## Description: Used by other scripts/makefiles. Its simple, but will get
## complicated when new platforms are added.
##
## Author: Ramiro Estrugo <ramiro@netscape.com>
##
##############################################################################
HOSTIDENT_ARCH=`uname -s`
# Determine the host name
if [ "$HOSTIDENT_ARCH" = "Linux" ]
then
HOSTIDENT_HOSTNAME=`hostname -s`
else
HOSTIDENT_HOSTNAME=`hostname`
fi
# A uniq hostidentifier that describes this host
echo $HOSTIDENT_HOSTNAME

View File

@@ -0,0 +1,845 @@
#!/bin/sh
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
##############################################################################
##
## Name: detect_motif.sh - Get motif lib location, version and other info.
##
## Description: Artificial intelligence to figure out:
##
## + Where the motif headers/lib are located.
## + Whether lesstif is being used.
## + The version of motif being used.
## + The compile and link flags needed to build motif apps.
##
## Author: Ramiro Estrugo <ramiro@netscape.com>
##
##############################################################################
## This script looks in the space sepeared list of directories
## (MOTIF_SEARCH_PATH) for motif headers and libraries.
##
## The search path can be overrided by the user by setting:
##
## MOZILLA_MOTIF_SEARCH_PATH
##
## To a space delimeted list of directories to search for motif paths.
##
## For example, if you have many different versions of motif installed,
## and you want the current build to use headers in /foo/motif/include
## and libraries in /foo/motif/lib, then do this:
##
## export MOZILLA_MOTIF_SEARCH_PATH="/foo/motif"
##
## The script also generates and builds a program 'detect_motif-OBJECT_NAME'
## which prints out info on the motif detected on the system.
##
## This information is munged into useful strings that can be printed
## through the various command line flags decribed bellow. This script
## can be invoked from Makefiles or other scripts in order to set
## flags needed to build motif program.
##
## The 'detect_motif-OBJECT_NAME' program is generated/built only
## once and reused. Because of the OBJECT_NAME suffix, it will work on
## multiple platforms at the same time.
##
## The generated files can be wiped by the --cleanup flag.
##
##
## Command Line Flags Supported:
##
## -l | --is-lesstif: Print True/False if usign lesstif.
##
## -v | --print-version: Print XmVERSION.
## -r | --print-revision: Print XmREVISION.
## -u | --print-update-level: Print XmUPDATE_LEVEL.
## -s | --print-version-string: Print XmVERSION_STRING.
##
## -id | --print-include-dir: Print dir of motif includes.
## -sd | --print-static-dir: Print dir of motif static libs.
## -dd | --print-dynamic-dir: Print dir of motif dynamic libs.
##
## -sl | --print-static-lib: Print static lib.
## -dl | --print-dynamic-lib: Print dynamic lib.
##
## -if | --print-include-flags: Print cc flags needed to build motif apps.
## -sf | --print-static-flags: Print ld flags for linking statically.
## -df | --print-dynamic-flags: Print ld flags for linking dynamically.
## -dp | --print-dynamic-paths: Print ld paths for linking dynamically.
##
## -de | --dynamic-ext: Set extension used on dynamic libs.
## -se | --static-ext: Set extension used on static libs.
##
## -o | --set-object-name: Set object name for current system.
## -cc | --set-compiler: Set compiler for building test program.
##
## -xif | --set-x11-include-flags: Set X11 include flags.
##
## -xpm | --requires-xpm: Print {True,False} if we need libXpm.
##
## -c | --cleanup: Clean up any generated files.
##
##
## Look for motif headers in the following places:
##
DEFAULT_MOTIF_INCLUDE_SEARCH_PATH="\
/usr/lesstif/include \
/usr/local/include \
/usr/dt/include \
/usr/X11R6/include \
/usr/X/include \
/usr/include \
/usr/include/Motif1.2 \
"
##
## Look for motif libraries in the following places:
##
DEFAULT_MOTIF_LIB_SEARCH_PATH="\
/usr/lesstif/lib \
/usr/local/lib \
/usr/dt/lib \
/usr/X11R6/lib \
/usr/X/lib \
/usr/lib \
/usr/lib/Motif1.2 \
/usr/lib/Motif1.2_R6 \
"
##
## The user can override the default share path by setting MOZILLA_MOTIF_SEARCH
##
if [ -n "$MOZILLA_MOTIF_INCLUDE_SEARCH_PATH" ]
then
MOTIF_INCLUDE_SEARCH_PATH=$MOZILLA_MOTIF_INCLUDE_SEARCH_PATH
else
MOTIF_INCLUDE_SEARCH_PATH=$DEFAULT_MOTIF_INCLUDE_SEARCH_PATH
fi
if [ -n "$MOZILLA_MOTIF_LIB_SEARCH_PATH" ]
then
MOTIF_LIB_SEARCH_PATH=$MOZILLA_MOTIF_LIB_SEARCH_PATH
else
MOTIF_LIB_SEARCH_PATH=$DEFAULT_MOTIF_LIB_SEARCH_PATH
fi
##
## Constants
##
MOTIF_PROG_PREFIX=./detect_motif
##
## Defaults
##
MOTIF_DYNAMIC_EXT=so
MOTIF_STATIC_EXT=a
MOTIF_PRINT_IS_LESSTIF=False
MOTIF_PRINT_VERSION=False
MOTIF_PRINT_REVISION=False
MOTIF_PRINT_UPDATE_LEVEL=False
MOTIF_PRINT_INCLUDE_DIR=False
MOTIF_PRINT_STATIC_DIR=False
MOTIF_PRINT_DYNAMIC_DIR=False
MOTIF_PRINT_STATIC_LIB=False
MOTIF_PRINT_DYNAMIC_LIB=False
MOTIF_PRINT_INCLUDE_FLAGS=False
MOTIF_PRINT_STATIC_FLAGS=False
MOTIF_PRINT_DYNAMIC_FLAGS=False
MOTIF_PRINT_DYNAMIC_PATHS=False
MOTIF_PRINT_EVERYTHING=False
MOTIF_OBJECT_NAME=`uname`-`uname -r`
MOTIF_OBJECT_NAME=`echo $MOTIF_OBJECT_NAME|sed -e 's:/:_:g'`
MOTIF_CC=cc
MOTIF_X11_INCLUDE_FLAGS=
MOTIF_CLEANUP=False
MOTIF_CHECK_XPM=False
##
## Stuff we need to figure out
##
MOTIF_VERSION_RESULT=unknown
MOTIF_REVISION_RESULT=unknown
MOTIF_UPDATE_RESULT=unknown
MOTIF_VERSION_REVISION_RESULT=unknown
MOTIF_VERSION_REVISION_UPDATE_RESULT=unknown
MOTIF_VERSION_STRING_RESULT=unknown
MOTIF_IS_LESSTIF_RESULT=unknown
MOTIF_INCLUDE_DIR=unknown
MOTIF_STATIC_LIB=unknown
MOTIF_DYNAMIC_LIB=unknown
MOTIF_STATIC_DIR=unknown
MOTIF_DYNAMIC_DIR=unknown
MOTIF_INCLUDE_FLAGS=unknown
MOTIF_STATIC_FLAGS=unknown
MOTIF_DYNAMIC_FLAGS=unknown
MOTIF_DYNAMIC_PATHS=unknown
motif_usage()
{
echo
echo "Usage: `basename $0` [options]"
echo
echo " -l, --is-lesstif: Print {True,False} if using lesstif."
echo
echo " -v, --print-version: Print XmVERSION."
echo " -r, --print-revision: Print XmREVISION."
echo " -u, --print-update-level: Print XmUPDATE_LEVEL."
echo " -s, --print-version-string: Print XmVERSION_STRING."
echo
echo " -id, --print-include-dir: Print dir of motif includes."
echo " -sd, --print-static-dir: Print dir of motif static libs."
echo " -dd, --print-dynamic-dir: Print dir of motif dynamic libs."
echo
echo " -sl, --print-static-lib: Print static lib."
echo " -dl --print-dynamic-lib: Print dynamic lib."
echo
echo " -if, --print-include-flags: Print cc flags needed to compile."
echo " -sf, --print-static-flags: Print ld flags for linking statically."
echo " -df, --print-dynamic-flags: Print ld flags for linking dynamically."
echo " -dp, --print-dynamic-paths: Print ld paths for linking dynamically."
echo
echo " -e, --print-everything: Print everything that is known."
echo
echo " -de, --dynamic-ext: Set extension used on dynamic libs."
echo " -se, --static-ext: Set extension used on static libs."
echo
echo " -o, --set-object-name: Set object name for current system."
echo " -cc, --set-compiler: Set compiler for building test program."
echo
echo " -xif, --set-x11-include-flags: Set X11 include flags."
echo
echo " -xpm, --requires-xpm: Print {True,False} if we need libXpm."
echo
echo " -h, --help: Print this blurb."
echo
echo " -c, --cleanup: Clean up any generated files."
echo
echo "The default is '-v -r' if no options are given."
echo
}
##
## Parse the command line
##
while [ "$*" ]; do
case $1 in
-h | --help)
shift
motif_usage
exit 0
;;
-l | --is-lesstif)
shift
MOTIF_PRINT_IS_LESSTIF=True
;;
-v | --print-version)
shift
MOTIF_PRINT_VERSION=True
;;
-r | --print-revision)
shift
MOTIF_PRINT_REVISION=True
;;
-u | --print-update-level)
shift
MOTIF_PRINT_UPDATE_LEVEL=True
;;
-s | --print-version-string)
shift
MOTIF_PRINT_VERSION_STRING=True
;;
-id | --print-include-dir)
shift
MOTIF_PRINT_INCLUDE_DIR=True
;;
-sd | --print-static-dir)
shift
MOTIF_PRINT_STATIC_DIR=True
;;
-dd | --print-dynamic-dir)
shift
MOTIF_PRINT_DYNAMIC_DIR=True
;;
-sl | --print-static-lib)
shift
MOTIF_PRINT_STATIC_LIB=True
;;
-dl | --print-dynamic-lib)
shift
MOTIF_PRINT_DYNAMIC_LIB=True
;;
-if | --print-include-flags)
shift
MOTIF_PRINT_INCLUDE_FLAGS=True
;;
-sf | --print-static-flags)
shift
MOTIF_PRINT_STATIC_FLAGS=True
;;
-df | --print-dynamic-flags)
shift
MOTIF_PRINT_DYNAMIC_FLAGS=True
;;
-dp | --print-dynamic-paths)
shift
MOTIF_PRINT_DYNAMIC_PATHS=True
;;
-e | --print-everything)
shift
MOTIF_PRINT_EVERYTHING=True
;;
-de | --dynamic-ext)
shift
MOTIF_DYNAMIC_EXT="$1"
shift
;;
-se | --static-ext)
shift
MOTIF_STATIC_EXT="$1"
shift
;;
-o | --set-object-name)
shift
MOTIF_OBJECT_NAME="$1"
shift
;;
-cc | --set-compiler)
shift
MOTIF_CC="$1"
shift
;;
-xif | --set-x11-include-flags)
shift
MOTIF_X11_INCLUDE_FLAGS="$1"
shift
;;
-c | --cleanup)
shift
MOTIF_CLEANUP=True
;;
-xpm | --requires-xpm)
shift
MOTIF_CHECK_XPM=True
;;
-*)
echo "`basename $0`: invalid option '$1'"
shift
motif_usage
exit 0
;;
esac
done
##
## Motif info program name
##
MOTIF_PROG="$MOTIF_PROG_PREFIX"_"$MOTIF_OBJECT_NAME"
MOTIF_SRC="$MOTIF_PROG_PREFIX"_"$MOTIF_OBJECT_NAME.c"
##
## The library names
##
MOTIF_DYNAMIC_LIB_NAME=libXm.$MOTIF_DYNAMIC_EXT
MOTIF_STATIC_LIB_NAME=libXm.$MOTIF_STATIC_EXT
##
## Cleanup the dummy test source/program
##
motif_cleanup()
{
rm -f $MOTIF_PROG $MOTIF_SRC
}
##
## Check whether the motif libs need Xpm
##
motif_check_xpm()
{
_lib=
_count=0
if [ -f $MOTIF_DYNAMIC_LIB ]
then
_lib=$MOTIF_DYNAMIC_LIB
else
if [ -f $MOTIF_STATIC_LIB ]
then
_lib=$MOTIF_STATIC_LIB
fi
fi
if [ -n "$_lib" ]
then
if [ -f $_lib ]
then
# Solaris 2.6's motif has builtin Xpm support.
# Its a dumbass hack... Why not ship libXpm to avoid
# the confusion ? Anyway, do 'grep -v XmXpm' to catch this
# problem. In this case Xpm is not needed, since the symbols
# are builtin to the libXm library.
_count=`strings $_lib | grep Xpm | grep -v XmXpm | wc -l`
fi
fi
if [ $_count -gt 0 ]
then
echo True
else
echo False
fi
unset _count
unset _lib
}
##
## -c | --cleanup
##
if [ "$MOTIF_CLEANUP" = "True" ]
then
motif_cleanup
exit 0
fi
##
## Look for <Xm/Xm.h>
##
for d in $MOTIF_INCLUDE_SEARCH_PATH
do
# Check for $d that exists and is readable
if [ -d $d -a -r $d ]
then
if [ -d $d/Xm -a -f $d/Xm/Xm.h ]
then
MOTIF_INCLUDE_DIR=$d
break;
fi
fi
done
##
## Make sure the <Xm/Xm.h> header was found.
##
if [ "$MOTIF_INCLUDE_DIR" = "unknown" ]
then
echo
echo "Could not find <Xm/Xm.h> anywhere on your system."
echo
exit 1
fi
##
## Generate the dummy test program if needed
##
if [ ! -f $MOTIF_SRC ]
then
cat << EOF > $MOTIF_SRC
#include <stdio.h>
#include <Xm/Xm.h>
int
main(int argc,char ** argv)
{
char * lesstif =
#ifdef LESSTIF_VERSION
"True"
#else
"False"
#endif
;
/* XmVERSION:XmREVISION:XmUPDATE_LEVEL:XmVERSION_STRING:IsLesstif */
fprintf(stdout,"%d:%d:%d:%s:%s\n",
XmVERSION,
XmREVISION,
XmUPDATE_LEVEL,
XmVERSION_STRING,
lesstif);
return 0;
}
EOF
fi
##
## Make sure code was created
##
if [ ! -f $MOTIF_SRC ]
then
echo
echo "Could not create or read test program source $MOTIF_SRC."
echo
exit 1
fi
##
## Set flags needed to Compile the dummy test program
##
MOTIF_INCLUDE_FLAGS=-I$MOTIF_INCLUDE_DIR
##
## Compile the dummy test program if needed
##
if [ ! -x $MOTIF_PROG ]
then
$MOTIF_CC $MOTIF_INCLUDE_FLAGS $MOTIF_X11_INCLUDE_FLAGS -o $MOTIF_PROG $MOTIF_SRC
fi
##
## Make sure it compiled
##
if [ ! -x $MOTIF_PROG ]
then
echo
echo "Could not create or execute test program $MOTIF_PROG."
echo
exit 1
fi
##
## Execute the dummy test program
##
MOTIF_PROG_OUTPUT=`$MOTIF_PROG`
##
## Output has the following format:
##
## 1 2 3 4 5
## XmVERSION:XmREVISION:XmUPDATE_LEVEL:XmVERSION_STRING:IsLesstif
##
MOTIF_VERSION_RESULT=`echo $MOTIF_PROG_OUTPUT | awk -F":" '{ print $1; }'`
MOTIF_REVISION_RESULT=`echo $MOTIF_PROG_OUTPUT | awk -F":" '{ print $2; }'`
MOTIF_UPDATE_RESULT=`echo $MOTIF_PROG_OUTPUT | awk -F":" '{ print $3; }'`
MOTIF_VERSION_REVISION_RESULT=$MOTIF_VERSION_RESULT.$MOTIF_REVISION_RESULT
MOTIF_VERSION_REVISION_UPDATE_RESULT=$MOTIF_VERSION_REVISION_RESULT.$MOTIF_UPDATE_RESULT
MOTIF_VERSION_STRING_RESULT=`echo $MOTIF_PROG_OUTPUT | awk -F":" '{ print $4; }'`
MOTIF_IS_LESSTIF_RESULT=`echo $MOTIF_PROG_OUTPUT | awk -F":" '{ print $5; }'`
##
## There could be up to 4 dyanmic libs and/or links.
##
## libXm.so
## libXm.so.1
## libXm.so.1.2
## libXm.so.1.2.4
##
MOTIF_DYNAMIC_SEARCH_PATH="\
$MOTIF_DYNAMIC_LIB_NAME \
$MOTIF_DYNAMIC_LIB_NAME.$MOTIF_VERSION_RESULT \
$MOTIF_DYNAMIC_LIB_NAME.$MOTIF_VERSION_REVISION_RESULT \
$MOTIF_DYNAMIC_LIB_NAME.$MOTIF_VERSION_REVISION_UPDATE_RESULT \
"
##
## Look for static library
##
for d in $MOTIF_LIB_SEARCH_PATH
do
if [ -f $d/$MOTIF_STATIC_LIB_NAME ]
then
MOTIF_STATIC_DIR=$d
MOTIF_STATIC_LIB=$MOTIF_STATIC_DIR/$MOTIF_STATIC_LIB_NAME
MOTIF_STATIC_FLAGS=$MOTIF_STATIC_LIB
break
fi
done
##
## Look for dyanmic libraries
##
for d in $MOTIF_LIB_SEARCH_PATH
do
for l in $MOTIF_DYNAMIC_SEARCH_PATH
do
if [ -r $d/$l ]
then
MOTIF_DYNAMIC_DIR=$d
MOTIF_DYNAMIC_LIB=$d/$l
MOTIF_DYNAMIC_PATHS="-L$MOTIF_DYNAMIC_DIR"
MOTIF_DYNAMIC_FLAGS="-lXm"
break 2
fi
done
done
##
## If the static library directory is different than the dynamic one, it
## is possible that the system contains two incompatible installations of
## motif/lesstif. For example, lesstif could be installed in /usr/lesstif
## and the real motif could be installed in /usr/X11R6. This would cause
## outofwhackage later in the build.
##
## Need to handle this one. Maybe we should just ignore the motif static
## libs and just use the lesstif ones ? This is probably what the "user"
## wants anyway. For instance, a "user" could be testing whether mozilla
## works with lesstif without erasing the real motif libs.
##
## Also, by default the lesstif build system only creates dynamic libraries.
## So this problem will always exist when both motif and lesstif are installed
## in the system.
##
if [ "$MOTIF_STATIC_DIR" != "$MOTIF_DYNAMIC_DIR" ]
then
MOTIF_STATIC_DIR=unknown
MOTIF_STATIC_LIB=unknown
MOTIF_STATIC_FLAGS=unknown
fi
##
## -l | --is-lesstif
##
if [ "$MOTIF_PRINT_IS_LESSTIF" = "True" ]
then
echo $MOTIF_IS_LESSTIF_RESULT
exit 0
fi
##
## -e | --print-everything
##
if [ "$MOTIF_PRINT_EVERYTHING" = "True" ]
then
echo
echo "XmVERSION: $MOTIF_VERSION_RESULT"
echo "XmREVISION: $MOTIF_REVISION_RESULT"
echo "XmUPDATE_LEVEL: $MOTIF_UPDATE_RESULT"
echo "XmVERSION_STRING: $MOTIF_VERSION_STRING_RESULT"
echo
echo "Lesstif ?: $MOTIF_IS_LESSTIF_RESULT"
echo
echo "Include dir: $MOTIF_INCLUDE_DIR"
echo "Static lib dir: $MOTIF_STATIC_DIR"
echo "Dynamic lib dir: $MOTIF_DYNAMIC_DIR"
echo
echo "Static lib: $MOTIF_STATIC_LIB"
echo "Dynamic lib: $MOTIF_DYNAMIC_LIB"
echo
echo "Include flags: $MOTIF_INCLUDE_FLAGS"
echo "Static fags: $MOTIF_STATIC_FLAGS"
echo "Dynamic paths: $MOTIF_DYNAMIC_PATHS"
echo "Dynamic flags: $MOTIF_DYNAMIC_FLAGS"
echo
echo "OBJECT_NAME: $MOTIF_OBJECT_NAME"
echo "Test program: $MOTIF_PROG"
echo
exit 0
fi
##
## -xpm | --requires-xpm
##
if [ "$MOTIF_CHECK_XPM" = "True" ]
then
motif_check_xpm
exit 0
fi
##
## -id | --print-include-dir
##
if [ "$MOTIF_PRINT_INCLUDE_DIR" = "True" ]
then
echo $MOTIF_INCLUDE_DIR
exit 0
fi
##
## -dd | --print-dynamic-dir
##
if [ "$MOTIF_PRINT_DYNAMIC_DIR" = "True" ]
then
echo $MOTIF_DYNAMIC_DIR
exit 0
fi
##
## -sd | --print-static-dir
##
if [ "$MOTIF_PRINT_STATIC_DIR" = "True" ]
then
echo $MOTIF_STATIC_DIR
exit 0
fi
##
## -dl | --print-dynamic-lib
##
if [ "$MOTIF_PRINT_DYNAMIC_LIB" = "True" ]
then
echo $MOTIF_DYNAMIC_LIB
exit 0
fi
##
## -sl | --print-static-lib
##
if [ "$MOTIF_PRINT_STATIC_LIB" = "True" ]
then
echo $MOTIF_STATIC_LIB
exit 0
fi
##
## -if | --print-include-flags
##
if [ "$MOTIF_PRINT_INCLUDE_FLAGS" = "True" ]
then
echo $MOTIF_INCLUDE_FLAGS
exit 0
fi
##
## -df | --print-dynamic-flags
##
if [ "$MOTIF_PRINT_DYNAMIC_FLAGS" = "True" ]
then
echo $MOTIF_DYNAMIC_FLAGS
exit 0
fi
##
## -dp | --print-dynamic-paths
##
if [ "$MOTIF_PRINT_DYNAMIC_PATHS" = "True" ]
then
echo $MOTIF_DYNAMIC_PATHS
exit 0
fi
##
## -sf | --print-static-flags
##
if [ "$MOTIF_PRINT_STATIC_FLAGS" = "True" ]
then
echo $MOTIF_STATIC_FLAGS
exit 0
fi
num=
##
## -v | --print-version
##
if [ "$MOTIF_PRINT_VERSION" = "True" ]
then
num=$MOTIF_VERSION_RESULT
##
## -r | --print-revision
##
if [ "$MOTIF_PRINT_REVISION" = "True" ]
then
num="$num".
num="$num"$MOTIF_REVISION_RESULT
##
## -u | --print-update-level
##
if [ "$MOTIF_PRINT_UPDATE_LEVEL" = "True" ]
then
num="$num".
num="$num"$MOTIF_UPDATE_RESULT
fi
fi
echo $num
exit 0
fi
##
## -s | --print-version-string
##
if [ "$MOTIF_PRINT_VERSION_STRING" = "True" ]
then
echo $MOTIF_VERSION_STRING_RESULT
exit 0
fi
##
## Default: Print XmVERSION.XmREVISION
##
echo $MOTIF_VERSION_RESULT.$MOTIF_REVISION_RESULT
exit 0

View File

@@ -0,0 +1,702 @@
#!/bin/sh
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
##############################################################################
##
## Name: detect_x11.sh - Get X11 lib location, version and other info.
##
## Description: Artificial intelligence to figure out:
##
## + Where the X11 headers/lib are located.
## + The version of X11 being used.
## + The compile and link flags needed to build X11 apps.
##
## Author: Ramiro Estrugo <ramiro@netscape.com>
##
##############################################################################
## This script looks in the space sepeared list of directories
## (X11_SEARCH_PATH) for x11 headers and libraries.
##
## The search path can be overrided by the user by setting:
##
## MOZILLA_X11_SEARCH_PATH
##
## To a space delimeted list of directories to search for x11 paths.
##
## For example, if you have many different versions of x11 installed,
## and you want the current build to use headers in /foo/x11/include
## and libraries in /foo/x11/lib, then do this:
##
## export MOZILLA_X11_SEARCH_PATH="/foo/x11"
##
## The script also generates and builds a program 'detect_x11-OBJECT_NAME'
## which prints out info on the x11 detected on the system.
##
## This information is munged into useful strings that can be printed
## through the various command line flags decribed bellow. This script
## can be invoked from Makefiles or other scripts in order to set
## flags needed to build x11 program.
##
## The get 'detect_x11-OBJECT_NAME' program is generated/built only
## once and reused. Because of the OBJECT_NAME suffix, it will work on
## multiple platforms at the same time.
##
## The generated files can be wiped by the --cleanup flag.
##
##
## Command Line Flags Supported:
##
## -v | --print-version: Print XlibSpecificationRelease.
## -r | --print-revision: Print XmREVISION.
## -u | --print-update-level: Print XmUPDATE_LEVEL.
## -s | --print-version-string: Print XmVERSION_STRING.
##
## -id | --print-include-dir: Print dir of x11 includes.
## -sd | --print-static-dir: Print dir of x11 static libs.
## -dd | --print-dynamic-dir: Print dir of x11 dynamic libs.
##
## -sl | --print-static-lib: Print static lib.
## -dl | --print-dynamic-lib: Print dynamic lib.
##
## -if | --print-include-flags: Print cc flags needed to build x11 apps.
## -sf | --print-static-flags: Print ld flags for linking statically.
## -df | --print-dynamic-flags: Print ld flags for linking dynamically.
## -dp | --print-dynamic-paths: Print ld paths for linking dynamically.
##
## -de | --dynamic-ext: Set extension used on dynamic libs.
## -se | --static-ext: Set extension used on static libs.
##
## -o | --set-object-name: Set object name for current system.
## -cc | --set-compiler: Set compiler for building test program.
##
## -c | --cleanup: Clean up any generated files.
##
##
## Look for x11 stuff in the following places:
##
DEFAULT_X11_SEARCH_PATH="\
/usr/local \
/usr/openwin \
/usr/X11R6 \
/usr \
"
##
## The user can override the default share path by setting MOZILLA_X11_SEARCH
##
if [ -n "$MOZILLA_X11_SEARCH_PATH" ]
then
X11_SEARCH_PATH=$MOZILLA_X11_SEARCH_PATH
else
X11_SEARCH_PATH=$DEFAULT_X11_SEARCH_PATH
fi
##
## Constants
##
X11_PROG_PREFIX=./detect_x11
##
## Defaults
##
X11_DYNAMIC_EXT=so
X11_STATIC_EXT=a
X11_PRINT_VERSION=False
X11_PRINT_REVISION=False
X11_PRINT_UPDATE_LEVEL=False
X11_PRINT_INCLUDE_DIR=False
X11_PRINT_STATIC_DIR=False
X11_PRINT_DYNAMIC_DIR=False
X11_PRINT_STATIC_LIB=False
X11_PRINT_DYNAMIC_LIB=False
X11_PRINT_INCLUDE_FLAGS=False
X11_PRINT_STATIC_FLAGS=False
X11_PRINT_DYNAMIC_FLAGS=False
X11_PRINT_DYNAMIC_PATHS=False
X11_PRINT_EVERYTHING=False
X11_OBJECT_NAME=`uname`-`uname -r`
X11_CC=cc
X11_CLEANUP=False
##
## Stuff we need to figure out
##
X11_VERSION_RESULT=unknown
X11_REVISION_RESULT=unknown
X11_UPDATE_RESULT=unknown
X11_VERSION_REVISION_RESULT=unknown
X11_VERSION_REVISION_UPDATE_RESULT=unknown
X11_VERSION_STRING_RESULT=unknown
X11_INCLUDE_DIR=unknown
X11_STATIC_LIB=unknown
X11_DYNAMIC_LIB=unknown
X11_STATIC_DIR=unknown
X11_DYNAMIC_DIR=unknown
X11_INCLUDE_FLAGS=unknown
X11_STATIC_FLAGS=unknown
X11_DYNAMIC_FLAGS=unknown
X11_DYNAMIC_PATHS=unknown
x11_usage()
{
echo
echo "Usage: `basename $0` [options]"
echo
echo " -v, --print-version: Print XlibSpecificationRelease."
echo " -r, --print-revision: Print XmREVISION."
echo " -u, --print-update-level: Print XmUPDATE_LEVEL."
echo " -s, --print-version-string: Print XmVERSION_STRING."
echo
echo " -id, --print-include-dir: Print dir of x11 includes."
echo " -sd, --print-static-dir: Print dir of x11 static libs."
echo " -dd, --print-dynamic-dir: Print dir of x11 dynamic libs."
echo
echo " -sl, --print-static-lib: Print static lib."
echo " -dl --print-dynamic-lib: Print dynamic lib."
echo
echo " -if, --print-include-flags: Print cc flags needed to compile."
echo " -sf, --print-static-flags: Print ld flags for linking statically."
echo " -df, --print-dynamic-flags: Print ld flags for linking dynamically."
echo " -dp, --print-dynamic-paths: Print ld paths for linking dynamically."
echo
echo " -e, --print-everything: Print everything that is known."
echo
echo " -de, --dynamic-ext: Set extension used on dynamic libs."
echo " -se, --static-ext: Set extension used on static libs."
echo
echo " -o, --set-object-name: Set object name for current system."
echo " -cc, --set-compiler: Set compiler for building test program."
echo
echo " -h, --help: Print this blurb."
echo
echo " -c, --cleanup: Clean up any generated files."
echo
echo "The default is '-v' if no options are given."
echo
}
##
## Parse the command line
##
while [ "$*" ]; do
case $1 in
-h | --help)
shift
x11_usage
exit 0
;;
-v | --print-version)
shift
X11_PRINT_VERSION=True
;;
-r | --print-revision)
shift
X11_PRINT_REVISION=True
;;
-u | --print-update-level)
shift
X11_PRINT_UPDATE_LEVEL=True
;;
-s | --print-version-string)
shift
X11_PRINT_VERSION_STRING=True
;;
-id | --print-include-dir)
shift
X11_PRINT_INCLUDE_DIR=True
;;
-sd | --print-static-dir)
shift
X11_PRINT_STATIC_DIR=True
;;
-dd | --print-dynamic-dir)
shift
X11_PRINT_DYNAMIC_DIR=True
;;
-sl | --print-static-lib)
shift
X11_PRINT_STATIC_LIB=True
;;
-dl | --print-dynamic-lib)
shift
X11_PRINT_DYNAMIC_LIB=True
;;
-if | --print-include-flags)
shift
X11_PRINT_INCLUDE_FLAGS=True
;;
-sf | --print-static-flags)
shift
X11_PRINT_STATIC_FLAGS=True
;;
-df | --print-dynamic-flags)
shift
X11_PRINT_DYNAMIC_FLAGS=True
;;
-dp | --print-dynamic-paths)
shift
X11_PRINT_DYNAMIC_PATHS=True
;;
-e | --print-everything)
shift
X11_PRINT_EVERYTHING=True
;;
-de | --dynamic-ext)
shift
X11_DYNAMIC_EXT="$1"
shift
;;
-se | --static-ext)
shift
X11_STATIC_EXT="$1"
shift
;;
-o | --set-object-name)
shift
X11_OBJECT_NAME="$1"
shift
;;
-cc | --set-compiler)
shift
X11_CC="$1"
shift
;;
-c | --cleanup)
shift
X11_CLEANUP=True
;;
-*)
echo "`basename $0`: invalid option '$1'"
shift
x11_usage
exit 0
;;
esac
done
##
## X11 info program name
##
X11_PROG="$X11_PROG_PREFIX"_"$X11_OBJECT_NAME"
X11_SRC="$X11_PROG_PREFIX"_"$X11_OBJECT_NAME.c"
##
## The library names
##
X11_DYNAMIC_LIB_NAME=libX11.$X11_DYNAMIC_EXT
X11_STATIC_LIB_NAME=libX11.$X11_STATIC_EXT
##
## Cleanup the dummy test source/program
##
x11_cleanup()
{
rm -f $X11_PROG $X11_SRC
}
##
## -c | --cleanup
##
if [ "$X11_CLEANUP" = "True" ]
then
x11_cleanup
exit 0
fi
##
## Look for <X11/Xlib.h>
##
for d in $X11_SEARCH_PATH
do
if [ -d $d/include/X11 -a -f $d/include/X11/Xlib.h ]
then
X11_INCLUDE_DIR=$d/include
break;
fi
done
##
## Make sure the <X11/Xlib.h> header was found.
##
if [ -z $X11_INCLUDE_DIR ]
then
echo
echo "Could not find <X11/Xlib.h> anywhere on your system."
echo
exit 1
fi
##
## Generate the dummy test program if needed
##
if [ ! -f $X11_SRC ]
then
cat << EOF > $X11_SRC
#include <stdio.h>
#include <X11/Xlib.h>
int
main(int argc,char ** argv)
{
#if 0
/* XmVERSION:XmREVISION:XmUPDATE_LEVEL:XmVERSION_STRING:IsLesstif */
fprintf(stdout,"%d:%d:%d:%s:%s\n",
XmVERSION,
XmREVISION,
XmUPDATE_LEVEL,
XmVERSION_STRING,
lesstif);
#else
/* XlibSpecificationRelease */
fprintf(stdout,"%d\n",
XlibSpecificationRelease);
#endif
return 0;
}
EOF
fi
##
## Make sure code was created
##
if [ ! -f $X11_SRC ]
then
echo
echo "Could not create or read test program source $X11_SRC."
echo
exit 1
fi
##
## Set flags needed to Compile the dummy test program
##
X11_INCLUDE_FLAGS=-I$X11_INCLUDE_DIR
##
## Compile the dummy test program if needed
##
if [ ! -x $X11_PROG ]
then
$X11_CC $X11_INCLUDE_FLAGS -o $X11_PROG $X11_SRC
fi
##
## Make sure it compiled
##
if [ ! -x $X11_PROG ]
then
echo
echo "Could not create or execute test program $X11_PROG."
echo
exit 1
fi
##
## Execute the dummy test program
##
X11_PROG_OUTPUT=`$X11_PROG`
##
## Output has the following format:
##
## 1 2 3 4 5
## XlibSpecificationRelease
##
X11_VERSION_RESULT=`echo $X11_PROG_OUTPUT | awk -F":" '{ print $1; }'`
#X11_REVISION_RESULT=`echo $X11_PROG_OUTPUT | awk -F":" '{ print $2; }'`
#X11_UPDATE_RESULT=`echo $X11_PROG_OUTPUT | awk -F":" '{ print $3; }'`
#X11_VERSION_REVISION_RESULT=$X11_VERSION_RESULT.$X11_REVISION_RESULT
#X11_VERSION_REVISION_UPDATE_RESULT=$X11_VERSION_REVISION_RESULT.$X11_UPDATE_RESULT
#X11_VERSION_STRING_RESULT=`echo $X11_PROG_OUTPUT | awk -F":" '{ print $4; }'`
##
## There could be up to 4 dyanmic libs and/or links.
##
## libX11.so
## libX11.so.6
## libX11.so.6.1
## libX11.so.6.1.x
##
X11_DYNAMIC_SEARCH_PATH="\
$X11_DYNAMIC_LIB_NAME \
$X11_DYNAMIC_LIB_NAME.$X11_VERSION_RESULT \
$X11_DYNAMIC_LIB_NAME.$X11_VERSION_REVISION_RESULT \
$X11_DYNAMIC_LIB_NAME.$X11_VERSION_REVISION_UPDATE_RESULT \
"
##
## Look for static library
##
for d in $X11_SEARCH_PATH
do
if [ -f $d/lib/$X11_STATIC_LIB_NAME ]
then
X11_STATIC_DIR=$d/lib
X11_STATIC_LIB=$X11_STATIC_DIR/$X11_STATIC_LIB_NAME
X11_STATIC_FLAGS=$X11_STATIC_LIB
break
fi
done
##
## Look for dyanmic libraries
##
for d in $X11_SEARCH_PATH
do
for l in $X11_DYNAMIC_SEARCH_PATH
do
if [ -r $d/lib/$l ]
then
X11_DYNAMIC_DIR=$d/lib
X11_DYNAMIC_LIB=$d/lib/$l
X11_DYNAMIC_PATHS="-L$X11_DYNAMIC_DIR"
X11_DYNAMIC_FLAGS="-lX11"
break 2
fi
done
done
##
## If the static library directory is different than the dynamic one, it
## is possible that the system contains two incompatible installations of
## x11. For example, a hacked x11 could be installed in /foo/X11.HACKED
## and the real x11 could be installed in /usr/X11R6. This would cause
## outofwhackage later in the build.
##
## Need to handle this one. Maybe we should just ignore the x11 static
## libs and just use the hacked ones ? This is probably what the "user"
## wants anyway. For instance, a "user" could be testing whether mozilla
## works with X11.HACKED without erasing the real x11 libs.
##
## Also, some x11 installations only have dynamic libraries.
##
## -e | --print-everything
##
if [ "$X11_PRINT_EVERYTHING" = "True" ]
then
echo
echo "XlibSpecificationRelease: $X11_VERSION_RESULT"
# echo "XmREVISION: $X11_REVISION_RESULT"
# echo "XmUPDATE_LEVEL: $X11_UPDATE_RESULT"
# echo "XmVERSION_STRING: $X11_VERSION_STRING_RESULT"
# echo
echo "Include dir: $X11_INCLUDE_DIR"
echo "Static lib dir: $X11_STATIC_DIR"
echo "Dynamic lib dir: $X11_DYNAMIC_DIR"
echo
echo "Static lib: $X11_STATIC_LIB"
echo "Dynamic lib: $X11_DYNAMIC_LIB"
echo
echo "Include flags: $X11_INCLUDE_FLAGS"
echo "Static flags: $X11_STATIC_FLAGS"
echo "dynamic paths: $X11_DYNAMIC_PATHS"
echo "dynamic flags: $X11_DYNAMIC_FLAGS"
echo
echo "OBJECT_NAME: $X11_OBJECT_NAME"
echo "Test program: $X11_PROG"
echo
exit 0
fi
##
## -id | --print-include-dir
##
if [ "$X11_PRINT_INCLUDE_DIR" = "True" ]
then
echo $X11_INCLUDE_DIR
exit 0
fi
##
## -dd | --print-dynamic-dir
##
if [ "$X11_PRINT_DYNAMIC_DIR" = "True" ]
then
echo $X11_DYNAMIC_DIR
exit 0
fi
##
## -sd | --print-static-dir
##
if [ "$X11_PRINT_STATIC_DIR" = "True" ]
then
echo $X11_STATIC_DIR
exit 0
fi
##
## -dl | --print-dynamic-lib
##
if [ "$X11_PRINT_DYNAMIC_LIB" = "True" ]
then
echo $X11_DYNAMIC_LIB
exit 0
fi
##
## -sl | --print-static-lib
##
if [ "$X11_PRINT_STATIC_LIB" = "True" ]
then
echo $X11_STATIC_LIB
exit 0
fi
##
## -if | --print-include-flags
##
if [ "$X11_PRINT_INCLUDE_FLAGS" = "True" ]
then
echo $X11_INCLUDE_FLAGS
exit 0
fi
##
## -df | --print-dynamic-flags
##
if [ "$X11_PRINT_DYNAMIC_FLAGS" = "True" ]
then
echo $X11_DYNAMIC_FLAGS
exit 0
fi
##
## -dp | --print-dynamic-paths
##
if [ "$X11_PRINT_DYNAMIC_PATHS" = "True" ]
then
echo $X11_DYNAMIC_PATHS
exit 0
fi
##
## -sf | --print-static-flags
##
if [ "$X11_PRINT_STATIC_FLAGS" = "True" ]
then
echo $X11_STATIC_FLAGS
exit 0
fi
num=
##
## -v | --print-version
##
if [ "$X11_PRINT_VERSION" = "True" ]
then
num=$X11_VERSION_RESULT
##
## -r | --print-revision
##
if [ "$X11_PRINT_REVISION" = "True" ]
then
num="$num".
num="$num"$X11_REVISION_RESULT
##
## -u | --print-update-level
##
if [ "$X11_PRINT_UPDATE_LEVEL" = "True" ]
then
num="$num".
num="$num"$X11_UPDATE_RESULT
fi
fi
echo $num
exit 0
fi
##
## -s | --print-version-string
##
if [ "$X11_PRINT_VERSION_STRING" = "True" ]
then
echo $X11_VERSION_STRING_RESULT
exit 0
fi
##
## Default: Print XmVERSION
##
echo $X11_VERSION_RESULT
exit 0

30
mozilla/config/nfspwd.pl Normal file
View File

@@ -0,0 +1,30 @@
#! perl
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
require "fastcwd.pl";
$_ = &fastcwd;
if (m@^/[uh]/@o || s@^/tmp_mnt/@/@o) {
print("$_\n");
} elsif ((($user, $rest) = m@^/usr/people/(\w+)/(.*)@o)
&& readlink("/u/$user") eq "/usr/people/$user") {
print("/u/$user/$rest\n");
} else {
chop($host = `hostname`);
print("/h/$host$_\n");
}

42
mozilla/config/nodl.pl Normal file
View File

@@ -0,0 +1,42 @@
#! perl
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
#
# Print out the nodltab.
# Usage: nodl.pl table-name sym1 sym2 ... symN
#
$table = $ARGV[0];
shift(@ARGV);
print "/* Automatically generated file; do not edit */\n\n";
print "#include \"prtypes.h\"\n\n";
print "#include \"prlink.h\"\n\n";
foreach $symbol (@ARGV) {
print "extern void ",$symbol,"();\n";
}
print "\n";
print "PRStaticLinkTable ",$table,"[] = {\n";
foreach $symbol (@ARGV) {
print " { \"",$symbol,"\", ",$symbol," },\n";
}
print " { 0, 0, },\n";
print "};\n";

411
mozilla/config/nsinstall.c Normal file
View File

@@ -0,0 +1,411 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
** Netscape portable install command.
**
** Brendan Eich, 7/20/95
*/
#include <stdio.h> /* OSF/1 requires this before grp.h, so put it first */
#include <assert.h>
#include <fcntl.h>
#include <errno.h>
#ifndef XP_OS2
#include <grp.h>
#include <pwd.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifndef XP_OS2
#include <unistd.h>
#include <utime.h>
#endif
#include <sys/types.h>
#include <sys/stat.h>
#include "pathsub.h"
#ifdef NEED_GETOPT_H
#include <getopt.h>
#endif
#ifdef XP_OS2
#include <dirent.h>
#include <direct.h>
#include <io.h>
#include <sys\utime.h>
#include <sys\types.h>
#include "getopt.h" /*yes... we had to build this...*/
#endif
#ifdef SUNOS4
#include "sunos4.h"
#endif
#ifdef NEXTSTEP
#include <bsd/libc.h>
#endif
#ifdef QNX
#include <unix.h>
#endif
#ifdef NEED_S_ISLNK
#if !defined(S_ISLNK) && defined(S_IFLNK)
#define S_ISLNK(a) (((a) & S_IFMT) == S_IFLNK)
#endif
#endif
#ifdef NEED_FCHMOD_PROTO
extern int fchmod(int fildes, mode_t mode);
#endif
#ifdef XP_OS2
/*Note: OS/2 has no concept of users or groups, or symbolic links...*/
#define lstat stat
/*looks reasonably safe based on OS/2's stat.h...*/
#define S_ISLNK(mode) 0 /*no way in hell on a file system that doesn't support it*/
typedef unsigned short mode_t;
typedef unsigned short uid_t;
typedef unsigned short gid_t;
#define mkdir(path, mode) mkdir(path)
#define W_OK 1
#define touid(spam) 0
#define togid(spam) 0
#define access(spam, spam2) 0
#define chown(spam1, spam2, spam3) 0
#define lchown(spam1, spam2, spam3) 0
#define fchown(spam1, spam2, spam3) 0
#define readlink(spam1, spam2, spam3) -1
#define symlink(spam1, spam2) -1
unsigned long _System DosSetFileSize(int, int);
#define ftruncate(spam1, spam2) DosSetFileSize(spam1, spam2)
#endif
static void
usage(void)
{
fprintf(stderr,
"usage: %s [-C cwd] [-L linkprefix] [-m mode] [-o owner] [-g group]\n"
" %*s [-DdltR] file [file ...] directory\n",
program, (int) strlen(program), "");
exit(2);
}
static int
mkdirs(char *path, mode_t mode)
{
char *cp;
struct stat sb;
int res;
while (*path == '/' && path[1] == '/')
path++;
while ((cp = strrchr(path, '/')) && cp[1] == '\0')
*cp = '\0';
if (cp && cp != path) {
*cp = '\0';
if ((lstat(path, &sb) < 0 || !S_ISDIR(sb.st_mode)) &&
mkdirs(path, mode) < 0) {
return -1;
}
*cp = '/';
}
res = mkdir(path, mode);
if ((res != 0) && (errno == EEXIST))
return 0;
else
return res;
}
#ifndef XP_OS2
static uid_t
touid(char *owner)
{
struct passwd *pw;
uid_t uid;
char *cp;
pw = getpwnam(owner);
if (pw)
return pw->pw_uid;
uid = strtol(owner, &cp, 0);
if (uid == 0 && cp == owner)
fail("cannot find uid for %s", owner);
return uid;
}
static gid_t
togid(char *group)
{
struct group *gr;
gid_t gid;
char *cp;
gr = getgrnam(group);
if (gr)
return gr->gr_gid;
gid = strtol(group, &cp, 0);
if (gid == 0 && cp == group)
fail("cannot find gid for %s", group);
return gid;
}
#endif
int
main(int argc, char **argv)
{
int onlydir, dodir, dolink, dorelsymlink, dotimes, opt, len, lplen, tdlen, bnlen, exists, fromfd, tofd, cc, wc;
mode_t mode = 0755;
char *linkprefix, *owner, *group, *cp, *cwd, *todir, *toname, *name, *base, *linkname, *bp, buf[BUFSIZ];
uid_t uid;
gid_t gid;
struct stat sb, tosb, fromsb;
struct utimbuf utb;
program = argv[0];
cwd = linkname = linkprefix = owner = group = 0;
onlydir = dodir = dolink = dorelsymlink = dotimes = lplen = 0;
while ((opt = getopt(argc, argv, "C:DdlL:Rm:o:g:t")) != EOF) {
switch (opt) {
case 'C':
cwd = optarg;
break;
case 'D':
onlydir = 1;
break;
case 'd':
dodir = 1;
break;
case 'l':
dolink = 1;
break;
case 'L':
linkprefix = optarg;
lplen = strlen(linkprefix);
dolink = 1;
break;
case 'R':
#ifdef XP_OS2
/* treat like -t since no symbolic links on OS2 */
dotimes = 1;
#else
dolink = dorelsymlink = 1;
#endif
break;
case 'm':
mode = strtoul(optarg, &cp, 8);
if (mode == 0 && cp == optarg)
usage();
break;
case 'o':
owner = optarg;
break;
case 'g':
group = optarg;
break;
case 't':
dotimes = 1;
break;
default:
usage();
}
}
argc -= optind;
argv += optind;
if (argc < 2 - onlydir)
usage();
todir = argv[argc-1];
if ((stat(todir, &sb) < 0 || !S_ISDIR(sb.st_mode)) &&
mkdirs(todir, 0777) < 0) {
fail("cannot make directory %s", todir);
}
if (onlydir)
return 0;
if (!cwd) {
#ifndef NEEDS_GETCWD
cwd = getcwd(0, PATH_MAX);
#else
cwd = malloc(PATH_MAX + 1);
cwd = getwd(cwd);
#endif
}
xchdir(todir);
#ifndef NEEDS_GETCWD
todir = getcwd(0, PATH_MAX);
#else
todir = malloc(PATH_MAX + 1);
todir = getwd(todir);
#endif
tdlen = strlen(todir);
xchdir(cwd);
tdlen = strlen(todir);
uid = owner ? touid(owner) : -1;
gid = group ? togid(group) : -1;
while (--argc > 0) {
name = *argv++;
len = strlen(name);
base = xbasename(name);
bnlen = strlen(base);
toname = xmalloc(tdlen + 1 + bnlen + 1);
sprintf(toname, "%s/%s", todir, base);
exists = (lstat(toname, &tosb) == 0);
if (dodir) {
/* -d means create a directory, always */
if (exists && !S_ISDIR(tosb.st_mode)) {
(void) unlink(toname);
exists = 0;
}
if (!exists && mkdir(toname, mode) < 0)
fail("cannot make directory %s", toname);
if ((owner || group) && chown(toname, uid, gid) < 0)
fail("cannot change owner of %s", toname);
} else if (dolink) {
if (*name == '/') {
/* source is absolute pathname, link to it directly */
linkname = 0;
} else {
if (linkprefix) {
/* -L implies -l and prefixes names with a $cwd arg. */
len += lplen + 1;
linkname = xmalloc(len + 1);
sprintf(linkname, "%s/%s", linkprefix, name);
} else if (dorelsymlink) {
/* Symlink the relative path from todir to source name. */
linkname = xmalloc(PATH_MAX);
if (*todir == '/') {
/* todir is absolute: skip over common prefix. */
lplen = relatepaths(todir, cwd, linkname);
strcpy(linkname + lplen, name);
} else {
/* todir is named by a relative path: reverse it. */
reversepath(todir, name, len, linkname);
xchdir(cwd);
}
len = strlen(linkname);
}
name = linkname;
}
/* Check for a pre-existing symlink with identical content. */
if ((exists && (!S_ISLNK(tosb.st_mode) ||
readlink(toname, buf, sizeof buf) != len ||
strncmp(buf, name, len) != 0)) ||
((stat(name, &fromsb) == 0) &&
(fromsb.st_mtime > tosb.st_mtime))) {
(void) (S_ISDIR(tosb.st_mode) ? rmdir : unlink)(toname);
exists = 0;
}
if (!exists && symlink(name, toname) < 0)
fail("cannot make symbolic link %s", toname);
#ifdef HAVE_LCHOWN
if ((owner || group) && lchown(toname, uid, gid) < 0)
fail("cannot change owner of %s", toname);
#endif
if (linkname) {
free(linkname);
linkname = 0;
}
} else {
/* Copy from name to toname, which might be the same file. */
#ifdef XP_OS2_FIX
fromfd = open(name, O_RDONLY | O_BINARY);
#else
fromfd = open(name, O_RDONLY);
#endif
if (fromfd < 0 || fstat(fromfd, &sb) < 0)
fail("cannot access %s", name);
if (exists && (!S_ISREG(tosb.st_mode) || access(toname, W_OK) < 0))
(void) (S_ISDIR(tosb.st_mode) ? rmdir : unlink)(toname);
#ifdef XP_OS2
chmod(toname, S_IREAD | S_IWRITE);
#endif
#ifdef XP_OS2_FIX
tofd = open(toname, O_CREAT | O_WRONLY | O_BINARY, 0666);
#else
tofd = open(toname, O_CREAT | O_WRONLY, 0666);
#endif
if (tofd < 0)
fail("cannot create %s", toname);
bp = buf;
while ((cc = read(fromfd, bp, sizeof buf)) > 0) {
while ((wc = write(tofd, bp, cc)) > 0) {
if ((cc -= wc) == 0)
break;
bp += wc;
}
if (wc < 0)
fail("cannot write to %s", toname);
}
if (cc < 0)
fail("cannot read from %s", name);
if (ftruncate(tofd, sb.st_size) < 0)
fail("cannot truncate %s", toname);
#ifndef XP_OS2
if (dotimes) {
utb.actime = sb.st_atime;
utb.modtime = sb.st_mtime;
if (utime(toname, &utb) < 0)
fail("cannot set times of %s", toname);
}
if (fchmod(tofd, mode) < 0)
fail("cannot change mode of %s", toname);
#endif
if ((owner || group) && fchown(tofd, uid, gid) < 0)
fail("cannot change owner of %s", toname);
/* Must check for delayed (NFS) write errors on close. */
if (close(tofd) < 0)
fail("cannot write to %s", toname);
close(fromfd);
#ifdef XP_OS2
if (dotimes) {
utb.actime = sb.st_atime;
utb.modtime = sb.st_mtime;
if (utime(toname, &utb) < 0)
fail("cannot set times of %s", toname);
}
if (chmod(toname, (mode & (S_IREAD | S_IWRITE))) < 0)
fail("cannot change mode of %s", toname);
#endif
}
free(toname);
}
free(cwd);
free(todir);
return 0;
}

236
mozilla/config/obj.inc Normal file
View File

@@ -0,0 +1,236 @@
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
!if !defined(VERBOSE)
.SILENT:
!endif
## Include support for MOZ_LITE/MOZ_MEDIUM
include <$(DEPTH)/config/liteness.mak>
RCFLAGS=$(RCFLAGS) $(MOZ_LITENESS_FLAGS)
#//------------------------------------------------------------------------
#//
#// This makefile contains all of the rules necessary to build 16 and 32 bit
#// object files.
#//
#//------------------------------------------------------------------------
!if !defined(CONFIG_OBJ_INC)
CONFIG_OBJ_INC=1
#//------------------------------------------------------------------------
#//
#// Rules for compiling 16/32 bit object files from either c or c++ source
#//
#//------------------------------------------------------------------------
.c.obj:
@$(CC) @<<$(CFGFILE)
-nologo -c $(OPTIMIZER)
$(CFLAGS)
$(LCFLAGS)
$(LINCS)
$(LINCS_1)
$(INCS)
-Fd$(PDBFILE)
$(CURDIR)$(*B).c
<<KEEP
.c{.\$(OBJDIR)\}.obj:
@$(CC) @<<$(CFGFILE)
-nologo -c $(OPTIMIZER)
$(CFLAGS)
$(LCFLAGS)
$(LINCS)
$(LINCS_1)
$(INCS)
-Fd$(PDBFILE)
-Fo.\$(OBJDIR)\
$(CURDIR)$(*B).c
<<KEEP
{.\_jmc\}.c{.\$(OBJDIR)\}.obj:
@$(CC) @<<$(CFGFILE)
-nologo -c $(OPTIMIZER)
$(CFLAGS)
$(LCFLAGS)
$(LINCS)
$(LINCS_1)
$(INCS)
-Fd$(PDBFILE)
-Fo.\$(OBJDIR)\
$(CURDIR)_jmc\$(*B).c
<<KEEP
.cpp.obj:
@$(CC) @<<$(CFGFILE)
-nologo -c $(OPTIMIZER)
$(CFLAGS)
$(LCFLAGS)
$(LINCS)
$(LINCS_1)
$(INCS)
-Fd$(PDBFILE)
$(CURDIR)$(*B).cpp
<<KEEP
.cpp{.\$(OBJDIR)\}.obj:
@$(CC) @<<$(CFGFILE)
-nologo -c $(OPTIMIZER)
$(CFLAGS)
$(LCFLAGS)
$(LINCS)
$(LINCS_1)
$(INCS)
-Fd$(PDBFILE)
-Fo.\$(OBJDIR)\
$(CURDIR)$(*B).cpp
<<KEEP
{.\_jmc\}.cpp{.\$(OBJDIR)\}.obj:
@$(CC) @<<$(CFGFILE)
-nologo -c $(OPTIMIZER)
$(CFLAGS)
$(LCFLAGS)
$(LINCS)
$(LINCS_1)
$(INCS)
-Fd$(PDBFILE)
-Fo.\$(OBJDIR)\
$(CURDIR)_jmc\$(*B).cpp
<<KEEP
#//------------------------------------------------------------------------
#//
#// Rule for compiling resource files
#//
#//------------------------------------------------------------------------
.rc{.\$(OBJDIR)\}.res:
# //
# // execute the command
# //
echo Creating Resource file: $*.res
$(RC) $(RCFLAGS) -r -Fo.\$(OBJDIR)\$(*B).res $(*B).rc
!if "$(MOZ_BITS)" == "16"
#//------------------------------------------------------------------------
#//
#// Rule for building simple 16 bit executables
#//
#//------------------------------------------------------------------------
.c{.\$(OBJDIR)\}.exe:
$(CC) @<<$(CFGFILE)
-c
$(OPTIMIZER)
$(CFLAGS)
$(LCFLAGS)
$(LINCS)
$(LINCS_1)
$(INCS)
-Fd$(PBDFILE)
-Fo.\$(OBJDIR)\
$(CURDIR)$(*B).c
<<
$(LD) @<<$(CFGFILE)
$(LFLAGS)
$(OBJDIR)\$(*B).obj,
$(OBJDIR)\$(*B).exe,
$(MAPFILE),
$(LLIBS) $(OS_LIBS),
$(DEFFILE),
$(RESFILE),
<<
!else
#//------------------------------------------------------------------------
#//
#// Rule for building simple 32 bit executables
#//
#//------------------------------------------------------------------------
.c{.\$(OBJDIR)\}.exe:
$(CC) @<<$(CFGFILE)
$(CFLAGS)
$(LCFLAGS)
$(LINCS)
$(LINCS_1)
$(INCS)
-Fd$(PBDFILE)
-Fe.\$(OBJDIR)\
$(CURDIR)$(*B).c
<<
!endif
#//------------------------------------------------------------------------
#//
#// Rule for creating .i file containing c preprocessor output
#//
#//------------------------------------------------------------------------
.c.i:
@$(CC) @<<$(CFGFILE)
/P -c
$(OPTIMIZER)
$(CFLAGS)
$(LCFLAGS)
$(LINCS)
$(LINCS_1)
$(INCS)
-Fd$(PDBFILE)
$(CURDIR)$(*B).c
<<KEEP
.c{.\$(OBJDIR)\}.i:
@$(CC) @<<$(CFGFILE)
/P -c
$(OPTIMIZER)
$(CFLAGS)
$(LCFLAGS)
$(LINCS)
$(LINCS_1)
$(INCS)
-Fd$(PDBFILE)
-Fo.\$(OBJDIR)\
$(CURDIR)$(*B).c
<<KEEP
.cpp.i:
@$(CC) @<<$(CFGFILE)
/P -c
$(OPTIMIZER)
$(CFLAGS)
$(LCFLAGS)
$(LINCS)
$(LINCS_1)
$(INCS)
-Fd$(PDBFILE)
$(CURDIR)$(*B).cpp
<<KEEP
.cpp{.\$(OBJDIR)\}.i:
@$(CC) @<<$(CFGFILE)
/P -c
$(OPTIMIZER)
$(CFLAGS)
$(LCFLAGS)
$(LINCS)
$(LINCS_1)
$(INCS)
-Fd$(PDBFILE)
-Fo.\$(OBJDIR)\
$(CURDIR)$(*B).cpp
<<KEEP
!endif # CONFIG_OBJ_INC

View File

@@ -0,0 +1,63 @@
#!perl
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
#
#Input: [-d dir] foo1.java foo2.java
#Compares with: foo1.class foo2.class (if -d specified, checks in 'dir',
# otherwise assumes .class files in same directory as .java files)
#Returns: list of input arguments which are newer than corresponding class
#files (non-existant class files are considered to be real old :-)
#
$found = 1;
if ($ARGV[0] eq '-d') {
$classdir = $ARGV[1];
$classdir .= "/";
shift;
shift;
} else {
$classdir = "./";
}
foreach $filename (@ARGV) {
$classfilename = $classdir;
$classfilename .= $filename;
$classfilename =~ s/.java$/.class/;
# workaround to only build sun/io/* classes when necessary
# change the pathname of target file to be consistent
# with sun/io subdirectories
#
# sun/io was always getting rebuilt because the java files
# were split into subdirectories, but the package names
# remained the same. This was confusing outofdate.pl
#
$classfilename =~ s/sun\/io\/extended.\//sun\/io\//;
$classfilename =~ s/\.\.\/\.\.\/sun-java\/classsrc\///;
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,
$ctime,$blksize,$blocks) = stat($filename);
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$classmtime,
$ctime,$blksize,$blocks) = stat($classfilename);
# print $filename, " ", $mtime, ", ", $classfilename, " ", $classmtime, "\n";
if ($mtime > $classmtime) {
print $filename, " ";
$found = 0;
}
}
print "\n";

238
mozilla/config/pathsub.c Normal file
View File

@@ -0,0 +1,238 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
** Pathname subroutines.
**
** Brendan Eich, 8/29/95
*/
#include <assert.h>
#include <sys/types.h>
#include <dirent.h>
#include <errno.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifndef XP_OS2
#include <unistd.h>
#endif
#include <sys/stat.h>
#include "pathsub.h"
#ifdef USE_REENTRANT_LIBC
#include <libc_r.h>
#endif
#ifdef XP_OS2
#include <direct.h>
#include <io.h>
#include <sys\utime.h>
#include <sys\types.h>
#endif
#ifdef SUNOS4
#include "sunos4.h"
#endif
#ifdef QNX
#define D_INO d_stat.st_ino
#else
#define D_INO d_ino
#endif
char *program;
void
fail(char *format, ...)
{
int error;
va_list ap;
#ifdef USE_REENTRANT_LIBC
R_STRERROR_INIT_R();
#endif
error = errno;
fprintf(stderr, "%s: ", program);
va_start(ap, format);
vfprintf(stderr, format, ap);
va_end(ap);
if (error)
#ifdef USE_REENTRANT_LIBC
R_STRERROR_R(errno);
fprintf(stderr, ": %s", r_strerror_r);
#else
fprintf(stderr, ": %s", strerror(errno));
#endif
putc('\n', stderr);
exit(1);
}
char *
getcomponent(char *path, char *name)
{
if (*path == '\0')
return 0;
if (*path == '/') {
*name++ = '/';
} else {
do {
*name++ = *path++;
} while (*path != '/' && *path != '\0');
}
*name = '\0';
while (*path == '/')
path++;
return path;
}
#ifdef LAME_READDIR
#include <sys/param.h>
/*
** The static buffer in Unixware's readdir is too small.
*/
struct dirent *readdir(DIR *d)
{
static struct dirent *buf = NULL;
if(buf == NULL)
buf = (struct dirent *) malloc(sizeof(struct dirent) + MAXPATHLEN);
return(readdir_r(d, buf));
}
#endif
char *
ino2name(ino_t ino, char *dir)
{
DIR *dp;
struct dirent *ep;
char *name;
dp = opendir("..");
if (!dp)
fail("cannot read parent directory");
for (;;) {
if (!(ep = readdir(dp)))
fail("cannot find current directory");
if (ep->D_INO == ino)
break;
}
name = xstrdup(ep->d_name);
closedir(dp);
return name;
}
void *
xmalloc(size_t size)
{
void *p = malloc(size);
if (!p)
fail("cannot allocate %u bytes", size);
return p;
}
char *
xstrdup(char *s)
{
return strcpy(xmalloc(strlen(s) + 1), s);
}
char *
xbasename(char *path)
{
char *cp;
while ((cp = strrchr(path, '/')) && cp[1] == '\0')
*cp = '\0';
if (!cp) return path;
return cp + 1;
}
void
xchdir(char *dir)
{
if (chdir(dir) < 0)
fail("cannot change directory to %s", dir);
}
int
relatepaths(char *from, char *to, char *outpath)
{
char *cp, *cp2;
int len;
char buf[NAME_MAX];
assert(*from == '/' && *to == '/');
for (cp = to, cp2 = from; *cp == *cp2; cp++, cp2++)
if (*cp == '\0')
break;
while (cp[-1] != '/')
cp--, cp2--;
if (cp - 1 == to) {
/* closest common ancestor is /, so use full pathname */
len = strlen(strcpy(outpath, to));
if (outpath[len] != '/') {
outpath[len++] = '/';
outpath[len] = '\0';
}
} else {
len = 0;
while ((cp2 = getcomponent(cp2, buf)) != 0) {
strcpy(outpath + len, "../");
len += 3;
}
while ((cp = getcomponent(cp, buf)) != 0) {
sprintf(outpath + len, "%s/", buf);
len += strlen(outpath + len);
}
}
return len;
}
void
reversepath(char *inpath, char *name, int len, char *outpath)
{
char *cp, *cp2;
char buf[NAME_MAX];
struct stat sb;
cp = strcpy(outpath + PATH_MAX - (len + 1), name);
cp2 = inpath;
while ((cp2 = getcomponent(cp2, buf)) != 0) {
if (strcmp(buf, ".") == 0)
continue;
if (strcmp(buf, "..") == 0) {
if (stat(".", &sb) < 0)
fail("cannot stat current directory");
name = ino2name(sb.st_ino, "..");
len = strlen(name);
cp -= len + 1;
strcpy(cp, name);
cp[len] = '/';
free(name);
xchdir("..");
} else {
cp -= 3;
strncpy(cp, "../", 3);
xchdir(buf);
}
}
strcpy(outpath, cp);
}

55
mozilla/config/pathsub.h Normal file
View File

@@ -0,0 +1,55 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef pathsub_h___
#define pathsub_h___
/*
** Pathname subroutines.
**
** Brendan Eich, 8/29/95
*/
#include <limits.h>
#include <sys/types.h>
#ifndef PATH_MAX
#define PATH_MAX 1024
#endif
/*
* Just prevent stupidity
*/
#undef NAME_MAX
#define NAME_MAX 256
extern char *program;
extern void fail(char *format, ...);
extern char *getcomponent(char *path, char *name);
extern char *ino2name(ino_t ino, char *dir);
extern void *xmalloc(size_t size);
extern char *xstrdup(char *s);
extern char *xbasename(char *path);
extern void xchdir(char *dir);
/* Relate absolute pathnames from and to returning the result in outpath. */
extern int relatepaths(char *from, char *to, char *outpath);
/* XXX changes current working directory -- caveat emptor */
extern void reversepath(char *inpath, char *name, int len, char *outpath);
#endif /* pathsub_h___ */

27
mozilla/config/pkg2dpth.pl Executable file
View File

@@ -0,0 +1,27 @@
#!perl
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
#
# Transform package paths to depths:
# foo/bar ==> ../..
#
# Why don't we need .. here?
$ARGV[0] =~ s@[^/\\]+@..@g;
print $ARGV[0]

View File

@@ -0,0 +1,34 @@
# -*- Mode: Makefile -*-
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
#
# A pitifully inadequate tool for starting a port to a new platform.
#
OS_ARCH := $(subst /,_,$(shell uname -s))
OS_RELEASE := $(shell uname -r)
MK_FILE = $(OS_ARCH)$(OS_RELEASE).mk
all: $(MK_FILE)
$(MK_FILE): configure.sh
@rm -f $@
@$< $(OS_ARCH) $(OS_RELEASE) $@
clean:
rm -f $(MK_FILE) $(wildcard *.add)

Some files were not shown because too many files have changed in this diff Show More