├── .github ├── dependabot.yml └── workflows │ ├── build.yml │ └── sonar.yml ├── .gitignore ├── COPYING ├── Dockerfile ├── INSTALL ├── Makefile ├── README.md ├── README.win32.md ├── SECURITY.md ├── docs ├── doxygen.config ├── html │ ├── doxygen.css │ ├── pacparser.html │ └── pactester.1.html └── man │ ├── man1 │ └── pactester.1 │ └── man3 │ ├── pacparser.3 │ ├── pacparser_cleanup.3 │ ├── pacparser_enable_microsoft_extensions.3 │ ├── pacparser_error_printer.3 │ ├── pacparser_find_proxy.3 │ ├── pacparser_init.3 │ ├── pacparser_just_find_proxy.3 │ ├── pacparser_parse_pac.3 │ ├── pacparser_parse_pac_file.3 │ ├── pacparser_parse_pac_string.3 │ ├── pacparser_set_error_printer.3 │ ├── pacparser_setmyip.3 │ └── pacparser_version.3 ├── examples ├── fetchurl.py ├── pactest.c ├── pactest.py └── wpad.dat ├── sonar-project.properties ├── src ├── Makefile ├── Makefile.win32 ├── pac_utils.h ├── pacparser.c ├── pacparser.h ├── pactester.c ├── pymod │ ├── MANIFEST.in │ ├── install_win32.py │ ├── pacparser │ │ └── __init__.py │ ├── pacparser_py.c │ └── setup.py └── spidermonkey │ ├── Makefile │ ├── Makefile.win32 │ ├── README.md │ └── js │ ├── README │ └── src │ ├── .cvsignore │ ├── Makefile.in │ ├── Makefile.ref │ ├── README.html │ ├── SpiderMonkey.rsp │ ├── Y.js │ ├── config.mk │ ├── config │ ├── AIX4.1.mk │ ├── AIX4.2.mk │ ├── AIX4.3.mk │ ├── CVS │ │ ├── Entries │ │ ├── Repository │ │ ├── Root │ │ └── Tag │ ├── Darwin.mk │ ├── Darwin1.3.mk │ ├── Darwin1.4.mk │ ├── Darwin5.2.mk │ ├── Darwin5.3.mk │ ├── FreeBSD.mk │ ├── HP-UXB.10.10.mk │ ├── HP-UXB.10.20.mk │ ├── HP-UXB.11.00.mk │ ├── IRIX.mk │ ├── IRIX5.3.mk │ ├── IRIX6.1.mk │ ├── IRIX6.2.mk │ ├── IRIX6.3.mk │ ├── IRIX6.5.mk │ ├── Linux_All.mk │ ├── Mac_OS10.0.mk │ ├── OSF1V4.0.mk │ ├── OSF1V5.0.mk │ ├── SunOS4.1.4.mk │ ├── SunOS5.3.mk │ ├── SunOS5.4.mk │ ├── SunOS5.5.1.mk │ ├── SunOS5.5.mk │ ├── SunOS5.6.mk │ ├── SunOS5.7.mk │ ├── SunOS5.8.mk │ ├── SunOS5.9.mk │ ├── WINNT4.0.mk │ ├── WINNT5.0.mk │ ├── WINNT5.1.mk │ ├── WINNT5.2.mk │ └── dgux.mk │ ├── js.c │ ├── js.mak │ ├── js.mdp │ ├── js.msg │ ├── js.pkg │ ├── js3240.rc │ ├── jsOS240.def │ ├── jsapi.c │ ├── jsapi.h │ ├── jsarena.c │ ├── jsarena.h │ ├── jsarray.c │ ├── jsarray.h │ ├── jsatom.c │ ├── jsatom.h │ ├── jsbit.h │ ├── jsbool.c │ ├── jsbool.h │ ├── jsclist.h │ ├── jscntxt.c │ ├── jscntxt.h │ ├── jscompat.h │ ├── jsconfig.h │ ├── jsconfig.mk │ ├── jscpucfg.c │ ├── jscpucfg.h │ ├── jsdate.c │ ├── jsdate.h │ ├── jsdbgapi.c │ ├── jsdbgapi.h │ ├── jsdhash.c │ ├── jsdhash.h │ ├── jsdtoa.c │ ├── jsdtoa.h │ ├── jsemit.c │ ├── jsemit.h │ ├── jsexn.c │ ├── jsexn.h │ ├── jsfile.c │ ├── jsfile.h │ ├── jsfile.msg │ ├── jsfun.c │ ├── jsfun.h │ ├── jsgc.c │ ├── jsgc.h │ ├── jshash.c │ ├── jshash.h │ ├── jsify.pl │ ├── jsinterp.c │ ├── jsinterp.h │ ├── jsiter.c │ ├── jsiter.h │ ├── jskeyword.tbl │ ├── jskwgen.c │ ├── jslibmath.h │ ├── jslock.c │ ├── jslock.h │ ├── jslocko.asm │ ├── jslog2.c │ ├── jslong.c │ ├── jslong.h │ ├── jsmath.c │ ├── jsmath.h │ ├── jsnum.c │ ├── jsnum.h │ ├── jsobj.c │ ├── jsobj.h │ ├── jsopcode.c │ ├── jsopcode.h │ ├── jsopcode.tbl │ ├── jsosdep.h │ ├── jsotypes.h │ ├── jsparse.c │ ├── jsparse.h │ ├── jsprf.c │ ├── jsprf.h │ ├── jsproto.tbl │ ├── jsprvtd.h │ ├── jspubtd.h │ ├── jsregexp.c │ ├── jsregexp.h │ ├── jsscan.c │ ├── jsscan.h │ ├── jsscope.c │ ├── jsscope.h │ ├── jsscript.c │ ├── jsscript.h │ ├── jsshell.msg │ ├── jsstddef.h │ ├── jsstr.c │ ├── jsstr.h │ ├── jstypes.h │ ├── jsutil.c │ ├── jsutil.h │ ├── jsxdrapi.c │ ├── jsxdrapi.h │ ├── jsxml.c │ ├── jsxml.h │ ├── lock_SunOS.s │ ├── perfect.js │ ├── plify_jsdhash.sed │ ├── prmjtime.c │ ├── prmjtime.h │ ├── resource.h │ ├── rules.mk │ └── win32.order ├── tests ├── proxy.pac ├── runtests.py ├── runtests.sh └── testdata └── tools ├── buildmacpackage.sh ├── generatedocs.sh └── package /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "github-actions" 4 | directory: "/" 5 | schedule: 6 | interval: "monthly" 7 | groups: 8 | github-actions: 9 | patterns: 10 | - "*" 11 | -------------------------------------------------------------------------------- /.github/workflows/sonar.yml: -------------------------------------------------------------------------------- 1 | name: SonarCloud 2 | on: 3 | push: 4 | branches: 5 | - main 6 | pull_request: 7 | types: [opened, synchronize, reopened] 8 | permissions: read-all 9 | jobs: 10 | build: 11 | name: Analyze 12 | if: github.repository == 'manugarg/pacparser' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) 13 | runs-on: ubuntu-latest 14 | steps: 15 | - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 16 | with: 17 | fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis 18 | - name: Install sonar-scanner and build-wrapper 19 | uses: SonarSource/sonarcloud-github-c-cpp@44cc4d3d487fbc35e5c29b0a9d717be218d3a0e8 # v3.2.0 20 | - name: Run sonar-scanner 21 | env: 22 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 23 | SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} 24 | run: | 25 | sudo apt install -y bear 26 | make -C src clean 27 | bear -- make -C src 28 | sonar-scanner 29 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Object files 2 | *.o 3 | 4 | # Libraries 5 | *.lib 6 | *.a 7 | 8 | # Shared objects (inc. Windows DLLs) 9 | *.dll 10 | *.so 11 | *.so.* 12 | *.dylib 13 | *.dSYM 14 | 15 | # Executables 16 | *.exe 17 | *.out 18 | *.app 19 | 20 | # Packages 21 | tools/packages 22 | *.dmg 23 | *.pkg 24 | 25 | # Other build files 26 | *buildstamp 27 | src/spidermonkey/js 28 | src/pactester 29 | 30 | # OS specific files 31 | .DS_Store 32 | 33 | # build 34 | **build 35 | 36 | # Sonar scanner 37 | .scannerwork 38 | 39 | # .json config 40 | *.json 41 | pactester 42 | info.plist 43 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # Use Ubuntu as the base image 2 | FROM ubuntu:latest AS build-stage 3 | 4 | # Install build dependencies 5 | RUN apt-get update && apt-get install -y \ 6 | gcc \ 7 | git \ 8 | g++ \ 9 | bash \ 10 | make 11 | 12 | WORKDIR /build 13 | COPY src /build 14 | RUN make pactester 15 | 16 | # Final stage 17 | FROM ubuntu:latest 18 | 19 | WORKDIR /app 20 | COPY --from=build-stage /build/pactester /app/ 21 | 22 | # Metadata params 23 | ARG BUILD_DATE 24 | ARG VERSION 25 | ARG VCS_REF 26 | # Metadata 27 | LABEL org.label-schema.build-date=$BUILD_DATE \ 28 | org.label-schema.name="Pactester" \ 29 | org.label-schema.vcs-url="https://github.com/manugarg/pacparser" \ 30 | org.label-schema.vcs-ref=$VCS_REF \ 31 | org.label-schema.version=$VERSION \ 32 | com.microscaling.license="Apache-2.0" 33 | 34 | ENTRYPOINT ["/app/pactester"] -------------------------------------------------------------------------------- /INSTALL: -------------------------------------------------------------------------------- 1 | For Python module, it's recommended to use "pip" for the installation: 2 | pip install pacparser 3 | pip install pacparser==1.3.8.dev15 (specific version) 4 | 5 | For other pre-built binaries, download them from: 6 | https://github.com/manugarg/pacparser/releases 7 | 8 | You can also download the latest binaries from the Github actions artifacts: 9 | https://github.com/manugarg/pacparser/actions 10 | 11 | 12 | Compile From Source: 13 | ################### 14 | 15 | On Unix-like Systems: 16 | ==================== 17 | 18 | Get the latest source code from github (git) repository by following instructions at: 19 | https://github.com/manugarg/pacparser 20 | 21 | * pacparser C library and pactester: 22 | ---------------------------------- 23 | Compiling and installing pacparser is as easy as running the following 24 | commands: 25 | => make -C src 26 | => sudo make -C src install 27 | 28 | * pacparser python module: 29 | ------------------------------------------------ 30 | To compile and install pacparser python module: 31 | => make -C src pymod 32 | => sudo make -C src install-pymod 33 | 34 | If it failed while running runtests.py like this; 35 | ``` 36 | File "../tests/runtests.py", line 79, in runtests 37 | raise Exception('Tests failed. Got "%s", expected "%s"' % (result, expected_result)) 38 | Exception: Tests failed. Got "END-OF-SCRIPT", expected "isResolvable" 39 | ``` 40 | Please set an environment variable NO_INTERNET. Then it won't require internet and pass the test. 41 | ``` 42 | $ export NO_INTERNET=1 && make -C src install-pymod 43 | ``` 44 | 45 | On Win-32 Systems: 46 | ================= 47 | Compiling pacparser for Windows is a rather involved process and is documented 48 | in detail in README.win32 file included with this package. 49 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2024 Manu Garg. 2 | # Author: Manu Garg 3 | # 4 | # Makefile for pacparser docker image. 5 | -include version.mk 6 | 7 | VERSION ?= $(shell git describe --always --tags --candidate=100) 8 | 9 | GIT_TAG := $(shell git describe --exact-match --exclude tip --tags HEAD 2>/dev/null || /bin/true) 10 | GIT_COMMIT = $(strip $(shell git rev-parse --short HEAD)) 11 | 12 | DOCKER_IMAGE ?= manugarg/pactester 13 | ifeq "$(GIT_TAG)" "" 14 | DOCKER_TAGS := -t $(DOCKER_IMAGE):master -t $(DOCKER_IMAGE):main 15 | else 16 | DOCKER_TAGS := -t $(DOCKER_IMAGE):$(GIT_TAG) -t $(DOCKER_IMAGE):latest 17 | endif 18 | 19 | docker_multiarch: Dockerfile 20 | docker buildx build --push \ 21 | --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \ 22 | --build-arg VERSION=$(VERSION) \ 23 | --build-arg VCS_REF=$(GIT_COMMIT) \ 24 | --platform linux/amd64,linux/arm64,linux/arm/v7 \ 25 | $(DOCKER_TAGS) . 26 | 27 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://github.com/manugarg/pacparser/actions/workflows/build.yml/badge.svg)](https://github.com/manugarg/pacparser/actions/workflows/build.yml) 2 | [![PyPI version](https://badge.fury.io/py/pacparser.svg)](https://badge.fury.io/py/pacparser) 3 | [![PyPI Downloads](https://static.pepy.tech/badge/pacparser)](https://pepy.tech/project/pacparser) 4 | [![Packaging status](https://repology.org/badge/tiny-repos/pacparser.svg)](https://repology.org/project/pacparser/versions) 5 | 6 | # [Pacparser](http://pacparser.manugarg.com) 7 | ***[pacparser.manugarg.com](http://pacparser.manugarg.com)*** 8 | 9 | Pacparser is a library to parse proxy auto-config (PAC) files. Proxy auto-config 10 | files are a vastly used proxy configuration method these days. Web browsers can 11 | use a PAC file to determine which proxy server to use or whether to go direct 12 | for a given URL. PAC files are written in JavaScript and can be programmed to 13 | return different proxy methods (e.g., `"PROXY proxy1:port; DIRECT"`) depending 14 | upon URL, source IP address, protocol, time of the day etc. PAC files introduce 15 | a lot of possibilities. Please look at the wikipedia entry for Proxy auto-config 16 | () for more information. 17 | 18 | The idea behind pacparser is to make it easy to add PAC-file parsing capability 19 | to any program (C and python supported right now). It comes as a shared C library 20 | and a python module which can be used to make any C or python program PAC scripts 21 | aware. 22 | 23 | ### Implementation 24 | Pacparser makes use of the Mozilla's JavaScript interpreter SpiderMonkey to parse 25 | PAC files (which are nothing but javascripts). Apart from that, proxy 26 | auto-config standard assumes availability of some functions which are not 27 | part of the standard JavaScript. Pacparser uses Mozilla's PAC implementation to 28 | define all these functions except for a couple of dns functions which are defined by 29 | pacparser itself. As a result, pacparser is as close to standard as it gets :) 30 | 31 | ### Install 32 | 33 | For Python module, you can use pip. Pre-built module is available for `64-bit Linux, 34 | Windows, MacOS-Intel, and MacOS-ARM`, for Python `3.7, 3.8, 3.9, 3.10 and 3.11`. 35 | ``` 36 | python -m pip install pacparser 37 | python -m pip install pacparser==1.3.8.dev15 (specific version) 38 | ``` 39 | 40 | For other pre-built binaries, download them from the project's [releases]( 41 | https://github.com/manugarg/pacparser/releases) page. 42 | 43 | You can also download the latest binaries from the [Github actions]( 44 | https://github.com/manugarg/pacparser/actions) artifcacts. 45 | 46 | See [INSTALL](https://github.com/manugarg/pacparser/blob/master/INSTALL) for how 47 | to compile pacparser from the source. 48 | 49 | ### How to use it? 50 | Pacparser comes as a shared library (`libpacparser.so` on Linux, `libpacparser.dylib` 51 | on MacOS, and pacparser.dll on windows) as well as a python module. Using it is as 52 | easy compiling your C programs against it or importing pacparser module in your 53 | python programs. 54 | 55 | ### Usage Examples 56 | 57 | #### Python: 58 | ```python 59 | >>> import pacparser 60 | >>> pacparser.init() 61 | >>> pacparser.parse_pac('examples/wpad.dat') 62 | >>> pacparser.find_proxy('http://www.google.com', 'www.google.com') 63 | 'DIRECT' 64 | >>> pacparser.setmyip("192.168.1.134") 65 | >>> pacparser.find_proxy('http://www.google.com', 'www.google.com') 66 | 'PROXY proxy1.manugarg.com:3128; PROXY proxy2.manugarg.com:3128; DIRECT' 67 | >>> pacparser.find_proxy('http://www2.manugarg.com', 'www2.manugarg.com') 68 | 'DIRECT' 69 | >>> pacparser.cleanup() 70 | >>> 71 | ``` 72 | 73 | #### C 74 | ```C 75 | #include 76 | 77 | int pacparser_init(); 78 | int pacparser_parse_pac(char* pacfile); 79 | char *pacparser_find_proxy(char *url, char *host); 80 | void pacparser_cleanup(); 81 | 82 | int main(int argc, char* argv[]) 83 | { 84 | char *proxy; 85 | pacparser_init(); 86 | pacparser_parse_pac(argv[1]); 87 | proxy = pacparser_find_proxy(argv[2], argv[3]); 88 | printf("%s\n", proxy); 89 | pacparser_cleanup(); 90 | } 91 | ``` 92 | ``` 93 | manugarg@hobbiton:~$ gcc -o pactest pactest.c -lpacparser 94 | manugarg@hobbiton:~$ ./pactest wpad.dat http://www.google.com www.google.com 95 | PROXY proxy1.manugarg.com:3128; PROXY proxy2.manugarg.com:3128; DIRECT 96 | ``` 97 | 98 | #### Platforms 99 | pacparser has been tested to work on Linux (all architectures supported by 100 | Debian), FreeBSD, Mac OS X and Win32 systems. 101 | 102 | #### Homepage 103 | http://pacparser.manugarg.com 104 | 105 | Author: [Manu Garg](http://github.com/manugarg) 106 | 107 | -------------------------------------------------------------------------------- /README.win32.md: -------------------------------------------------------------------------------- 1 | This file is about the instructions to build (and use) pacparser on Windows. 2 | For general information on pacparser, please have a look at README in the same 3 | directory. 4 | 5 | Building pacparser on Windows: 6 | ----------------------------- 7 | * Install MinGW64 tools through [msys2]( 8 | https://github.com/msys2/msys2-installer/releases). 9 | 10 | * Rename mingw32-make.exe to make.exe. 11 | ``` 12 | rename C:\msys64\mingw64\bin\mingw32-make.exe C:\msys64\mingw64\bin\make.exe 13 | ``` 14 | 15 | * Add your MinGW directory's bin (`C:\msys64\mingw64\bin`) to your system path variable. 16 | 17 | * Install latest [python](http://www.python.org/). You'll need it to build the python module. 18 | 19 | 20 | * Git-clone the pacparser source code, or download the source code tarball from the [releases]( 21 | https://github.com/manugarg/pacparser/releases) page, and extract it somewhere, 22 | say `C:\workspace`. 23 | 24 | * Compile pacparser and create ditribution. 25 | ``` 26 | cd C:\workspace\pacparser-* 27 | make -C src -f Makefile.win32 dist 28 | ``` 29 | 30 | * Compile pacparser python module and copy required files to a directory (dist). 31 | ``` 32 | make -C src -f Makefile.win32 pymod-3.9 33 | ``` 34 | 35 | * Compile pacparser python module and copy required files to a directory (dist). 36 | ``` 37 | make -C src -f Makefile.win32 pymod-dist-3.9 38 | ``` 39 | 40 | ## Using pacparser on Windows: 41 | 42 | ### In C programs: 43 | 44 | Make sure that you have pacparser.dll in the sytem path somewhere 45 | (current directory would do just fine for testing purpose). 46 | ``` 47 | Change to your program's directory: 48 | => cd c:\workspace\pacparser-1.3.8\examples 49 | 50 | Copy pacparser.dll here and compile your program: 51 | => gcc -o pactest pactest.c -lpacparser -L. 52 | 53 | Run your program: 54 | => pactest wpad.dat http://www.google.com www.google.com 55 | 'PROXY proxy1.manugarg.com:3128; PROXY proxy2.manugarg.com:3128; DIRECT' 56 | ``` 57 | 58 | ### In python programs: 59 | 60 | Install pacparser python module by running install.py in the distribution 61 | folder. You'll then be able to use pacparser python module in the following 62 | manner: 63 | 64 | ```python 65 | => python 66 | >>> import pacparser 67 | >>> pacparser.init() 68 | >>> pacparser.parse_pac('examples/wpad.dat') 69 | >>> pacparser.find_proxy('http://www.google.com', 'www.google.com') 70 | 'PROXY proxy1.manugarg.com:3128; PROXY proxy2.manugarg.com:3128; DIRECT' 71 | >>> pacparser.cleanup() 72 | ``` 73 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | If you have discovered a security vulnerability in this project, please report it privately. **Do not disclose it as a public issue.** This gives us time to work with you to fix the issue before public exposure, reducing the chance that the exploit will be used before a patch is released. 4 | 5 | Please disclose it at [security advisory](https://github.com/manugarg/pacparser/security/advisories/new). 6 | 7 | This project is maintained by a team of volunteers on a reasonable-effort basis. As such, please give us at least 90 days to work on a fix before public exposure. 8 | -------------------------------------------------------------------------------- /docs/html/pactester.1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | "pactester"("1") manual page 7 | 8 | 9 | Table of Contents

10 | 11 |

Name

12 | pactester - Tool to test proxy auto-config (pac) files. 13 |

Synopsis

14 | pactester 15 | <-p pacfile> <-u url> [-h host] [-c client_ip] [-e]

16 | pactester <-p pacfile> <-f urlslist> 17 | [-c client_ip] [-e] 18 |

Description

19 | pactester is a tool to test proxy auto-config 20 | (pac) files. It returns the proxy config string for the given URL and the 21 | pac file. pactester uses pacparser C library for most of its functionality. 22 | 23 |

Options

24 | 25 |
26 | 27 |
-p pacfile
28 |
PAC file to test. Specify "-" to read from the standard 29 | input.
30 | 31 |
-u url
32 |
URL to test the PAC file for.
33 | 34 |
-h host
35 |
Host part of the URL. If 36 | not specified, it’s determined from the URL.
37 | 38 |
-c client_ip
39 |
Client’s IP address 40 | (as returned by the function myIpAddress() in PAC files). If not specified, 41 | it defaults to the IP address of the machine on which this tool is running. 42 |
43 | 44 |
-e
45 |
Enable Microsoft PAC extensions (dnsResolveEx, myIpAddressEx, isResolvableEx). 46 |
47 | 48 |
-f urlslist
49 |
A file containing the list of URLs to be tested. This is good 50 | for testing a PAC file against a set of URLs.
51 |
52 | 53 |

Examples

54 |

55 | To find out the proxy 56 | config string for the pac file "wpad.dat" and the URL "http://www.google.com 57 | ": 58 |

59 | $ pactester -p wpad.dat -u http://www.google.com 60 | 61 |

For a client with IP address 62 | 10.0.12.123:

63 | $ pactester -p wpad.dat -c 10.0.12.123 -u http://www.google.com 64 | 65 |

For a 66 | pac file hosted at http://wpad/wpad.dat: 67 |

68 | $ curl -s http://wpad/wpad.dat 69 | | pactester 70 | -p - -u http://google.com 71 | 72 |

Bugs

73 | If you have come across a bug in pactester, please 74 | submit a bug report at http://github.com/pacparser/pacparser/issues. 75 | 76 |

Author

77 | Written 78 | by Manu Garg (http://www.manugarg.com). 79 |

Resources

80 | Homepage: http://github.com/pacparser/pacparser. 81 | 82 | 83 |

84 | 85 |


86 | Table of Contents

87 |

97 | 98 | 99 | -------------------------------------------------------------------------------- /docs/man/man1/pactester.1: -------------------------------------------------------------------------------- 1 | .TH "pactester" "1" "" "" "" 2 | .SH "NAME" 3 | pactester \- Tool to test proxy auto\-config (pac) files. 4 | .SH "SYNOPSIS" 5 | .B pactester <\-p pacfile> <\-u url> [\-h host] [\-c client_ip] [\-e] 6 | .PP 7 | .B pactester <\-p pacfile> <\-f urlslist> [\-c client_ip] [\-e] 8 | .SH "DESCRIPTION" 9 | pactester is a tool to test proxy auto\-config (pac) files. It returns the 10 | proxy config string for the given URL and the pac file. pactester uses 11 | pacparser C library for most of its functionality. 12 | .SH "OPTIONS" 13 | .TP 14 | .B \-p pacfile 15 | PAC file to test. Specify "-" to read from the standard input. 16 | .TP 17 | .B \-u url 18 | URL to test the PAC file for. 19 | .TP 20 | .B \-h host 21 | Host part of the URL. If not specified, it's determined from the URL. 22 | .TP 23 | .B \-c client_ip 24 | Client's IP address (as returned by the function myIpAddress() in PAC files). 25 | If not specified, it defaults to the IP address of the machine on which 26 | this tool is running. 27 | .TP 28 | .B \-e 29 | Enable Microsoft PAC extensions (dnsResolveEx, myIpAddressEx, isResolvableEx). 30 | .TP 31 | .B \-f urlslist 32 | A file containing the list of URLs to be tested. This is good for testing a PAC file against a set of URLs. 33 | .SH "EXAMPLES" 34 | .PP 35 | To find out the proxy config string for the pac file "wpad.dat" and the URL 36 | "http://www.google.com": 37 | .PP 38 | $ pactester \-p wpad.dat \-u http://www.google.com 39 | 40 | For a client with IP address 10.0.12.123: 41 | .PP 42 | $ pactester \-p wpad.dat \-c 10.0.12.123 \-u http://www.google.com 43 | 44 | For a pac file hosted at http://wpad/wpad.dat: 45 | .PP 46 | $ curl \-s http://wpad/wpad.dat | pactester \-p \- \-u http://google.com 47 | .SH "BUGS" 48 | If you have come across a bug in pactester, please submit a bug report at 49 | http://github.com/pacparser/pacparser/issues. 50 | .SH "AUTHOR" 51 | Written by Manu Garg (http://www.manugarg.com). 52 | .SH "RESOURCES" 53 | Homepage: http://github.com/pacparser/pacparser. 54 | 55 | -------------------------------------------------------------------------------- /docs/man/man3/pacparser_cleanup.3: -------------------------------------------------------------------------------- 1 | .so man3/pacparser.3 2 | -------------------------------------------------------------------------------- /docs/man/man3/pacparser_enable_microsoft_extensions.3: -------------------------------------------------------------------------------- 1 | .so man3/pacparser.3 2 | -------------------------------------------------------------------------------- /docs/man/man3/pacparser_error_printer.3: -------------------------------------------------------------------------------- 1 | .so man3/pacparser.3 2 | -------------------------------------------------------------------------------- /docs/man/man3/pacparser_find_proxy.3: -------------------------------------------------------------------------------- 1 | .so man3/pacparser.3 2 | -------------------------------------------------------------------------------- /docs/man/man3/pacparser_init.3: -------------------------------------------------------------------------------- 1 | .so man3/pacparser.3 2 | -------------------------------------------------------------------------------- /docs/man/man3/pacparser_just_find_proxy.3: -------------------------------------------------------------------------------- 1 | .so man3/pacparser.3 2 | -------------------------------------------------------------------------------- /docs/man/man3/pacparser_parse_pac.3: -------------------------------------------------------------------------------- 1 | .so man3/pacparser.3 2 | -------------------------------------------------------------------------------- /docs/man/man3/pacparser_parse_pac_file.3: -------------------------------------------------------------------------------- 1 | .so man3/pacparser.3 2 | -------------------------------------------------------------------------------- /docs/man/man3/pacparser_parse_pac_string.3: -------------------------------------------------------------------------------- 1 | .so man3/pacparser.3 2 | -------------------------------------------------------------------------------- /docs/man/man3/pacparser_set_error_printer.3: -------------------------------------------------------------------------------- 1 | .so man3/pacparser.3 2 | -------------------------------------------------------------------------------- /docs/man/man3/pacparser_setmyip.3: -------------------------------------------------------------------------------- 1 | .so man3/pacparser.3 2 | -------------------------------------------------------------------------------- /docs/man/man3/pacparser_version.3: -------------------------------------------------------------------------------- 1 | .so man3/pacparser.3 2 | -------------------------------------------------------------------------------- /examples/fetchurl.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # Copyright (C) 2008 Manu Garg. 3 | # Author: Manu Garg 4 | # 5 | # pacparser is a library that provides methods to parse proxy auto-config 6 | # (PAC) files. Please read README file included with this package for more 7 | # information about this library. 8 | # 9 | # pacparser is free software; you can redistribute it and/or 10 | # modify it under the terms of the GNU Lesser General Public 11 | # License as published by the Free Software Foundation; either 12 | # version 2.1 of the License, or (at your option) any later version. 13 | 14 | # pacparser is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | # Lesser General Public License for more details. 18 | 19 | # You should have received a copy of the GNU Lesser General Public 20 | # License along with this library; if not, write to the Free Software 21 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 22 | # USA 23 | 24 | """ 25 | This script demonstrates how python web clients can use 26 | proxy auto-config (PAC) files for proxy configuration using pacparser. 27 | It take a PAC file and an url as arguments, fetches the URL using the 28 | proxy as determined by PAC file and URL and returns the retrieved webpage. 29 | """ 30 | 31 | __author__ = 'manugarg@gmail.com (Manu Garg)' 32 | __copyright__ = 'Copyright (C) 2008 Manu Garg' 33 | __license__ = 'LGPL' 34 | 35 | import pacparser 36 | import socket 37 | import sys 38 | import urllib 39 | 40 | def fetch_url_using_pac(pac, url): 41 | try: 42 | proxy_string = pacparser.just_find_proxy(pac, url) 43 | except: 44 | sys.stderr.write('could not determine proxy using Pacfile\n') 45 | return None 46 | proxylist = proxy_string.split(";") 47 | proxies = None # Dictionary to be passed to urlopen method of urllib 48 | while proxylist: 49 | proxy = proxylist.pop(0).strip() 50 | if 'DIRECT' in proxy: 51 | proxies = {} 52 | break 53 | if proxy[0:5].upper() == 'PROXY': 54 | proxy = proxy[6:].strip() 55 | if isproxyalive(proxy): 56 | proxies = {'http': 'http://%s' % proxy} 57 | break 58 | try: 59 | sys.stderr.write('trying to fetch the page using proxy %s\n' % proxy) 60 | response = urllib.urlopen(url, proxies=proxies) 61 | except Exception, e: 62 | sys.stderr.write('could not fetch webpage %s using proxy %s\n' % 63 | (url, proxies)) 64 | sys.stderr.write(str(e)+'\n') 65 | return None 66 | return response 67 | 68 | def isproxyalive(proxy): 69 | host_port = proxy.split(":") 70 | if len(host_port) != 2: 71 | sys.stderr.write('proxy host is not defined as host:port\n') 72 | return False 73 | s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 74 | s.settimeout(10) 75 | try: 76 | s.connect((host_port[0], int(host_port[1]))) 77 | except Exception, e: 78 | sys.stderr.write('proxy %s is not accessible\n' % proxy) 79 | sys.stderr.write(str(e)+'\n') 80 | return False 81 | s.close() 82 | return True 83 | 84 | def main(): 85 | if len(sys.argv) != 3: 86 | print('Not enough arguments') 87 | print('Usage:\n%s ' % sys.argv[0]) 88 | return None 89 | pacfile = sys.argv[1] 90 | url = sys.argv[2] 91 | response = fetch_url_using_pac(pacfile, url) 92 | if response: 93 | print(response.read()) 94 | else: 95 | sys.stderr.write('URL %s could not be retrieved using PAC file %s.' % 96 | (url, pacfile)) 97 | 98 | if __name__ == '__main__': 99 | main() 100 | -------------------------------------------------------------------------------- /examples/pactest.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int pacparser_init(); 4 | int pacparser_parse_pac(char* pacfile); 5 | char *pacparser_find_proxy(char *url, char *host); 6 | void pacparser_cleanup(); 7 | 8 | int main(int argc, char* argv[]) 9 | { 10 | char *proxy = NULL; 11 | pacparser_init(); 12 | pacparser_parse_pac(argv[1]); 13 | proxy = pacparser_find_proxy(argv[2], argv[3]); 14 | if(proxy) printf("%s\n", proxy); 15 | pacparser_cleanup(); 16 | } 17 | -------------------------------------------------------------------------------- /examples/pactest.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | import pacparser 4 | 5 | pacparser.init() 6 | pacparser.parse_pac("wpad.dat") 7 | proxy = pacparser.find_proxy("http://www.manugarg.com") 8 | print(proxy) 9 | pacparser.cleanup() 10 | 11 | # Or simply, 12 | print(pacparser.just_find_proxy("wpad.dat", "http://www2.manugarg.com")) 13 | -------------------------------------------------------------------------------- /examples/wpad.dat: -------------------------------------------------------------------------------- 1 | // Go direct for plain hostnames and any host in .manugarg.com domain except 2 | // for www and www.manugarg.com. 3 | // Go via proxy for all other hosts. 4 | 5 | function FindProxyForURL(url, host) 6 | { 7 | if ((isPlainHostName(host) || 8 | dnsDomainIs(host, ".manugarg.com")) && 9 | !localHostOrDomainIs(host, "www.manugarg.com")) 10 | return "DIRECT"; 11 | else 12 | return "PROXY proxy1.manugarg.com:3128; PROXY proxy2.manugarg.com:3128; DIRECT"; 13 | } 14 | -------------------------------------------------------------------------------- /sonar-project.properties: -------------------------------------------------------------------------------- 1 | sonar.projectKey=manugarg_pacparser 2 | sonar.organization=manugarg 3 | sonar.projectName=pacparser 4 | sonar.sources=src 5 | sonar.cfamily.compile-commands=compile_commands.json 6 | sonar.sourceEncoding=UTF-8 7 | sonar.host.url=https://sonarcloud.io -------------------------------------------------------------------------------- /src/Makefile.win32: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2007-2022 Manu Garg. 2 | # Author: Manu Garg 3 | # 4 | # Makefile for pacparser. Please read README file included with this package 5 | # for more information about pacparser. 6 | # 7 | # pacparser is free software; you can redistribute it and/or 8 | # modify it under the terms of the GNU Lesser General Public 9 | # License as published by the Free Software Foundation; either 10 | # version 3 of the License, or (at your option) any later version. 11 | 12 | # pacparser is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | # Lesser General Public License for more details. 16 | 17 | # You should have received a copy of the GNU Lesser General Public 18 | # License along with this library; if not, write to the Free Software 19 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 20 | 21 | # This file is not part of the source code repository. It's generated by the 22 | # packaging script. 23 | -include version.mk 24 | 25 | ifeq ($(OS),Windows_NT) 26 | RM = del /Q /F 27 | CP = copy /Y 28 | ifdef ComSpec 29 | SHELL := $(ComSpec) 30 | endif 31 | ifdef COMSPEC 32 | SHELL := $(COMSPEC) 33 | endif 34 | else 35 | RM = rm -rf 36 | CP = cp -f 37 | endif 38 | 39 | VERSION ?= $(shell git describe --always --tags --candidate=100) 40 | 41 | LIB_VER=1 42 | CFLAGS=-g -DXP_WIN -DWINVER=0x0501 -DVERSION=$(VERSION) -Ispidermonkey/js/src -Wall 43 | CC=gcc 44 | PYTHON ?= python 45 | 46 | .PHONY: clean pymod install-pymod 47 | 48 | all: pacparser.dll pactester 49 | 50 | pacparser.o: pacparser.c pac_utils.h js.lib 51 | $(CC) $(CFLAGS) -c pacparser.c -o pacparser.o 52 | 53 | js.lib: 54 | $(MAKE) -C spidermonkey -f Makefile.win32 55 | 56 | pacparser.dll: pacparser.o spidermonkey/js.lib 57 | $(CC) -shared -o pacparser.dll \ 58 | -Wl,--output-def,pacparser.def \ 59 | -Wl,--out-implib,libpacparser.a \ 60 | -Wl,--export-all-symbols \ 61 | pacparser.o -ljs -Lspidermonkey -lws2_32 62 | 63 | pacparser.lib: pacparser.dll pacparser.def 64 | lib /machine:i386 /def:pacparser.def 65 | 66 | pactester: pactester.c pacparser.h pacparser.o 67 | $(CC) pactester.c pacparser.o -o pactester -ljs -Lspidermonkey -lws2_32 68 | 69 | dist: pacparser.dll pactester pacparser.def 70 | if exist dist rmdir /s /q dist 71 | mkdir dist 72 | $(CP) pacparser.dll dist 73 | $(CP) pacparser.h dist 74 | $(CP) pactester.exe dist 75 | $(CP) pacparser.def dist 76 | if exist pacparser.lib $(CP) pacparser.lib dist 77 | $(CP) ..\README.md dist\README.txt 78 | $(CP) ..\COPYING dist\COPYING.txt 79 | $(CP) ..\INSTALL dist\INSTALL.txt 80 | mkdir dist\docs 81 | $(CP) ..\README.win32.md dist\docs 82 | if exist ..\docs\html xcopy ..\docs\html dist\docs 83 | 84 | # Targets to build python module 85 | pymod: pacparser.h pacparser.dll pacparser.o js.lib 86 | cd pymod && $(PYTHON) setup.py build --compiler=mingw32 87 | cd .. && $(PYTHON) tests/runtests.py 88 | 89 | pymod-dist: pacparser.h pacparser.dll pacparser.o js.lib 90 | cd pymod && $(PYTHON) setup.py build --compiler=mingw32 && $(PYTHON) setup.py dist 91 | cd .. && $(PYTHON) tests/runtests.py 92 | 93 | pymod-%: pacparser.h pacparser.dll pacparser.o js.lib 94 | cd pymod && py -$* setup.py build --compiler=mingw32 95 | cd .. && py -$* tests\runtests.py 96 | 97 | pymod-dist-%: 98 | cd pymod && py -$* setup.py dist 99 | 100 | clean: 101 | $(RM) pacparser.dll *.lib pacparser.def pacparser.exp pacparser.o pactester.exe libpacparser.a 102 | $(MAKE) -C spidermonkey -f Makefile.win32 clean 103 | cd pymod && $(PYTHON) setup.py clean --all 104 | $(RM) dist 105 | -------------------------------------------------------------------------------- /src/pymod/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include pacparser_py.c 2 | include pacparser/* 3 | -------------------------------------------------------------------------------- /src/pymod/install_win32.py: -------------------------------------------------------------------------------- 1 | import shutil 2 | import sys 3 | from distutils import sysconfig 4 | from __future__ import print_function 5 | 6 | def main(): 7 | if sys.platform == 'win32': 8 | shutil.rmtree('%s\\pacparser' % sysconfig.get_python_lib(), 9 | ignore_errors=True) 10 | shutil.copytree('pacparser', '%s\\pacparser' % sysconfig.get_python_lib()) 11 | else: 12 | print('This script should be used only on Win32 systems.') 13 | 14 | 15 | if __name__ == '__main__': 16 | main() 17 | -------------------------------------------------------------------------------- /src/pymod/pacparser/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2007 Manu Garg. 2 | # Author: Manu Garg 3 | # 4 | # pacparser is a library that provides methods to parse proxy auto-config 5 | # (PAC) files. Please read README file included with this package for more 6 | # information about this library. 7 | # 8 | # pacparser is free software; you can redistribute it and/or 9 | # modify it under the terms of the GNU Lesser General Public 10 | # License as published by the Free Software Foundation; either 11 | # version 2.1 of the License, or (at your option) any later version. 12 | 13 | # pacparser is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | # Lesser General Public License for more details. 17 | 18 | # You should have received a copy of the GNU Lesser General Public 19 | # License along with this library; if not, write to the Free Software 20 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 21 | 22 | """ 23 | Python module to parse pac files. Look at project's homepage 24 | http://github.com/pacparser/pacparser for more information. 25 | """ 26 | 27 | __author__ = 'manugarg@gmail.com (Manu Garg)' 28 | __copyright__ = 'Copyright (C) 2008 Manu Garg' 29 | __license__ = 'LGPL' 30 | 31 | from pacparser import _pacparser 32 | import os 33 | import re 34 | import sys 35 | 36 | _URL_REGEX = re.compile('^[^:]*:\/\/([^\/:]+)') 37 | 38 | class URLError(Exception): 39 | def __init__(self, url): 40 | super(URLError, self).__init__('URL: {} is not valid'.format(url)) 41 | self.url = url 42 | 43 | def init(): 44 | """ 45 | Initializes pacparser engine. 46 | """ 47 | _pacparser.init() 48 | 49 | def parse_pac(pacfile): 50 | """ 51 | (Deprecated) Same as parse_pac_file. 52 | """ 53 | parse_pac_file(pacfile) 54 | 55 | def parse_pac_file(pacfile): 56 | """ 57 | Reads the pacfile and evaluates it in the Javascript engine created by 58 | init(). 59 | """ 60 | try: 61 | with open(pacfile) as f: 62 | pac_script = f.read() 63 | _pacparser.parse_pac_string(pac_script) 64 | except IOError: 65 | raise IOError('Could not read the pacfile: {}'.format(pacfile)) 66 | 67 | def parse_pac_string(pac_script): 68 | """ 69 | Evaluates pac_script in the Javascript engine created by init(). 70 | """ 71 | _pacparser.parse_pac_string(pac_script) 72 | 73 | def find_proxy(url, host=None): 74 | """ 75 | Finds proxy string for the given url and host. If host is not 76 | defined, it's extracted from the url. 77 | """ 78 | if host is None: 79 | m = _URL_REGEX.match(url) 80 | if not m: 81 | raise URLError(url) 82 | if len(m.groups()) == 1: 83 | host = m.groups()[0] 84 | else: 85 | raise URLError(url) 86 | return _pacparser.find_proxy(url, host) 87 | 88 | def version(): 89 | """ 90 | Returns the compiled pacparser version. 91 | """ 92 | return _pacparser.version() 93 | 94 | def cleanup(): 95 | """ 96 | Destroys pacparser engine. 97 | """ 98 | _pacparser.cleanup() 99 | 100 | def just_find_proxy(pacfile, url, host=None): 101 | """ 102 | This function is a wrapper around init, parse_pac, find_proxy 103 | and cleanup. This is the function to call if you want to find 104 | proxy just for one url. 105 | """ 106 | if not os.path.isfile(pacfile): 107 | raise IOError('Pac file does not exist: {}'.format(pacfile)) 108 | init() 109 | parse_pac(pacfile) 110 | proxy = find_proxy(url,host) 111 | cleanup() 112 | return proxy 113 | 114 | def setmyip(ip_address): 115 | """ 116 | Set my ip address. This is the IP address returned by myIpAddress() 117 | """ 118 | _pacparser.setmyip(ip_address) 119 | 120 | def enable_microsoft_extensions(): 121 | """ 122 | Enables Microsoft PAC extensions (dnsResolveEx, isResolvableEx, 123 | myIpAddressEx). 124 | """ 125 | _pacparser.enable_microsoft_extensions() 126 | -------------------------------------------------------------------------------- /src/spidermonkey/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2007 Manu Garg. 2 | # Author: Manu Garg 3 | # 4 | # Makefile for pacparser. Please read README file included with this package 5 | # for more information about pacparser. 6 | # 7 | # pacparser is free software; you can redistribute it and/or 8 | # modify it under the terms of the GNU Lesser General Public 9 | # License as published by the Free Software Foundation; either 10 | # version 3 of the License, or (at your option) any later version. 11 | 12 | # pacparser is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | # Lesser General Public License for more details. 16 | 17 | # You should have received a copy of the GNU Lesser General Public 18 | # License along with this library; if not, write to the Free Software 19 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 20 | 21 | # Include config.mk to get the variable $(OBJDIR). 22 | # We need to create $(OBJDIR) first to be able to build libjs.a alone. 23 | 24 | DEPTH = js/src 25 | include js/src/config.mk 26 | 27 | jsapi: js-buildstamp 28 | 29 | jslib: js-buildstamp 30 | cd js/src 31 | find . -name "libjs.a" -exec cp {} . \; 32 | 33 | js-buildstamp: 34 | mkdir -p js/src/$(OBJDIR) 35 | CFLAGS="$(SMCFLAGS)" $(MAKE) -C js/src -f Makefile.ref libjs.a 36 | find js/src -name "jsautocfg.h" -exec cp {} js/src \; 37 | touch js-buildstamp 38 | 39 | clean: 40 | rm -rf js/src/$(OBJDIR) 41 | rm -f libjs.a js-buildstamp 42 | -------------------------------------------------------------------------------- /src/spidermonkey/Makefile.win32: -------------------------------------------------------------------------------- 1 | # Project: fdlibm 2 | 3 | ifeq ($(OS),Windows_NT) 4 | RM = del /Q /F 5 | CP = copy /Y 6 | ifdef ComSpec 7 | SHELL := $(ComSpec) 8 | endif 9 | ifdef COMSPEC 10 | SHELL := $(COMSPEC) 11 | endif 12 | else 13 | RM = rm -rf 14 | CP = cp -f 15 | endif 16 | 17 | CC = gcc.exe 18 | 19 | JS_SRCDIR = js/src 20 | 21 | JS_OBJECTS = \ 22 | $(JS_SRCDIR)/jsapi.o \ 23 | $(JS_SRCDIR)/jsarena.o \ 24 | $(JS_SRCDIR)/jsarray.o \ 25 | $(JS_SRCDIR)/jsatom.o \ 26 | $(JS_SRCDIR)/jsbool.o \ 27 | $(JS_SRCDIR)/jscntxt.o \ 28 | $(JS_SRCDIR)/jsdate.o \ 29 | $(JS_SRCDIR)/jsdbgapi.o \ 30 | $(JS_SRCDIR)/jsdhash.o \ 31 | $(JS_SRCDIR)/jsdtoa.o \ 32 | $(JS_SRCDIR)/jsemit.o \ 33 | $(JS_SRCDIR)/jsexn.o \ 34 | $(JS_SRCDIR)/jsfun.o \ 35 | $(JS_SRCDIR)/jsgc.o \ 36 | $(JS_SRCDIR)/jshash.o \ 37 | $(JS_SRCDIR)/jsiter.o \ 38 | $(JS_SRCDIR)/jsinterp.o \ 39 | $(JS_SRCDIR)/jslock.o \ 40 | $(JS_SRCDIR)/jslog2.o \ 41 | $(JS_SRCDIR)/jslong.o \ 42 | $(JS_SRCDIR)/jsmath.o \ 43 | $(JS_SRCDIR)/jsnum.o \ 44 | $(JS_SRCDIR)/jsobj.o \ 45 | $(JS_SRCDIR)/jsopcode.o \ 46 | $(JS_SRCDIR)/jsparse.o \ 47 | $(JS_SRCDIR)/jsprf.o \ 48 | $(JS_SRCDIR)/jsregexp.o \ 49 | $(JS_SRCDIR)/jsscan.o \ 50 | $(JS_SRCDIR)/jsscope.o \ 51 | $(JS_SRCDIR)/jsscript.o \ 52 | $(JS_SRCDIR)/jsstr.o \ 53 | $(JS_SRCDIR)/jsutil.o \ 54 | $(JS_SRCDIR)/jsxml.o \ 55 | $(JS_SRCDIR)/jsxdrapi.o \ 56 | $(JS_SRCDIR)/prmjtime.o 57 | 58 | CFLAGS = -D_IEEE_LIBM -DEXPORT_JS_API -DWIN32 -D_MINGW -D_WINDOWS -DXP_WIN -s 59 | 60 | all: js.lib 61 | 62 | %.o: %.c js/src/jsautokw.h 63 | $(CC) -c $(CFLAGS) -o $@ $< 64 | 65 | js/src/jsautokw.h: 66 | ifeq ($(wildcard js),) 67 | $(error JS source directory not found. Extract $(wildcard js-*.tar.gz) tarball using tool of your choice. Possible options are 7z, WinRAR, WinZip.) 68 | endif 69 | $(CC) -o jskwgen js/src/jskwgen.c 70 | jskwgen > js/src/jsautokw.h 71 | $(RM) jskwgen.exe 72 | 73 | js.lib: $(JS_OBJECTS) 74 | ar r js.lib $(JS_OBJECTS) 75 | ranlib js.lib 76 | 77 | clean: 78 | $(RM) js\src\*.o 79 | $(RM) js\src\jsautokw.h 80 | $(RM) *.lib 81 | -------------------------------------------------------------------------------- /src/spidermonkey/README.md: -------------------------------------------------------------------------------- 1 | This directory contains a trimmed down version of Mozilla SpiderMonkey library version 1.7. 2 | -------------------------------------------------------------------------------- /src/spidermonkey/js/README: -------------------------------------------------------------------------------- 1 | 1. The latest release notes for SpiderMonkey can be found at: 2 | 3 | http://www.mozilla.org/js/spidermonkey/release-notes/ 4 | 5 | 6 | 2. js/jsd contains code for debugging support for the C-based JavaScript engine in js/src. 7 | 8 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/.cvsignore: -------------------------------------------------------------------------------- 1 | *.pdb 2 | *.ncb 3 | *.opt 4 | *.plg 5 | Debug 6 | Release 7 | Makefile 8 | jscpucfg 9 | jsautocfg.h 10 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/SpiderMonkey.rsp: -------------------------------------------------------------------------------- 1 | mozilla/js/src/* 2 | mozilla/js/src/config/* 3 | mozilla/js/src/fdlibm/* 4 | mozilla/js/src/liveconnect/* 5 | mozilla/js/src/liveconnect/_jni/* 6 | mozilla/js/src/liveconnect/classes/* 7 | mozilla/js/src/liveconnect/classes/netscape/* 8 | mozilla/js/src/liveconnect/classes/netscape/javascript/* 9 | mozilla/js/src/liveconnect/config/* 10 | mozilla/js/src/liveconnect/macbuild/* 11 | mozilla/js/src/liveconnect/macbuild/JavaSession/* 12 | mozilla/js/src/macbuild/* 13 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/Y.js: -------------------------------------------------------------------------------- 1 | // The Y combinator, applied to the factorial function 2 | 3 | function factorial(proc) { 4 | return function (n) { 5 | return (n <= 1) ? 1 : n * proc(n-1); 6 | } 7 | } 8 | 9 | function Y(outer) { 10 | function inner(proc) { 11 | function apply(arg) { 12 | return proc(proc)(arg); 13 | } 14 | return outer(apply); 15 | } 16 | return inner(inner); 17 | } 18 | 19 | print("5! is " + Y(factorial)(5)); 20 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/config/AIX4.1.mk: -------------------------------------------------------------------------------- 1 | # -*- Mode: makefile -*- 2 | # 3 | # ***** BEGIN LICENSE BLOCK ***** 4 | # Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | # 6 | # The contents of this file are subject to the Mozilla Public License Version 7 | # 1.1 (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # http://www.mozilla.org/MPL/ 10 | # 11 | # Software distributed under the License is distributed on an "AS IS" basis, 12 | # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | # for the specific language governing rights and limitations under the 14 | # License. 15 | # 16 | # The Original Code is Mozilla Communicator client code, released 17 | # March 31, 1998. 18 | # 19 | # The Initial Developer of the Original Code is 20 | # Netscape Communications Corporation. 21 | # Portions created by the Initial Developer are Copyright (C) 1998 22 | # the Initial Developer. All Rights Reserved. 23 | # 24 | # Contributor(s): 25 | # 26 | # Alternatively, the contents of this file may be used under the terms of 27 | # either the GNU General Public License Version 2 or later (the "GPL"), or 28 | # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 29 | # in which case the provisions of the GPL or the LGPL are applicable instead 30 | # of those above. If you wish to allow use of your version of this file only 31 | # under the terms of either the GPL or the LGPL, and not to allow others to 32 | # use your version of this file under the terms of the MPL, indicate your 33 | # decision by deleting the provisions above and replace them with the notice 34 | # and other provisions required by the GPL or the LGPL. If you do not delete 35 | # the provisions above, a recipient may use your version of this file under 36 | # the terms of any one of the MPL, the GPL or the LGPL. 37 | # 38 | # ***** END LICENSE BLOCK ***** 39 | 40 | # 41 | # Config stuff for AIX 42 | # 43 | 44 | CC = xlC_r 45 | CCC = xlC_r 46 | 47 | RANLIB = ranlib 48 | 49 | #.c.o: 50 | # $(CC) -c -MD $*.d $(CFLAGS) $< 51 | ARCH := aix 52 | CPU_ARCH = rs6000 53 | GFX_ARCH = x 54 | INLINES = js_compare_and_swap:js_fast_lock1:js_fast_unlock1:js_lock_get_slot:js_lock_set_slot:js_lock_scope1 55 | 56 | OS_CFLAGS = -qarch=com -qinline+$(INLINES) -DXP_UNIX -DAIX -DAIXV3 -DSYSV -DHAVE_LOCALTIME_R 57 | OS_LIBS = -lbsd -lsvld -lm 58 | #-lpthreads -lc_r 59 | 60 | MKSHLIB = $(LD) -bM:SRE -bh:4 -bnoentry -berok 61 | XLDFLAGS += -lc 62 | 63 | ifdef JS_THREADSAFE 64 | XLDFLAGS += -lsvld 65 | endif 66 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/config/AIX4.2.mk: -------------------------------------------------------------------------------- 1 | # -*- Mode: makefile -*- 2 | # 3 | # ***** BEGIN LICENSE BLOCK ***** 4 | # Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | # 6 | # The contents of this file are subject to the Mozilla Public License Version 7 | # 1.1 (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # http://www.mozilla.org/MPL/ 10 | # 11 | # Software distributed under the License is distributed on an "AS IS" basis, 12 | # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | # for the specific language governing rights and limitations under the 14 | # License. 15 | # 16 | # The Original Code is Mozilla Communicator client code, released 17 | # March 31, 1998. 18 | # 19 | # The Initial Developer of the Original Code is 20 | # Netscape Communications Corporation. 21 | # Portions created by the Initial Developer are Copyright (C) 1998 22 | # the Initial Developer. All Rights Reserved. 23 | # 24 | # Contributor(s): 25 | # 26 | # Alternatively, the contents of this file may be used under the terms of 27 | # either the GNU General Public License Version 2 or later (the "GPL"), or 28 | # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 29 | # in which case the provisions of the GPL or the LGPL are applicable instead 30 | # of those above. If you wish to allow use of your version of this file only 31 | # under the terms of either the GPL or the LGPL, and not to allow others to 32 | # use your version of this file under the terms of the MPL, indicate your 33 | # decision by deleting the provisions above and replace them with the notice 34 | # and other provisions required by the GPL or the LGPL. If you do not delete 35 | # the provisions above, a recipient may use your version of this file under 36 | # the terms of any one of the MPL, the GPL or the LGPL. 37 | # 38 | # ***** END LICENSE BLOCK ***** 39 | 40 | # 41 | # Config stuff for AIX 42 | # 43 | 44 | CC = xlC_r 45 | CCC = xlC_r 46 | CFLAGS += -qarch=com -qnoansialias -qinline+$(INLINES) -DXP_UNIX -DAIX -DAIXV3 -DSYSV -DHAVE_LOCALTIME_R 47 | 48 | RANLIB = ranlib 49 | 50 | #.c.o: 51 | # $(CC) -c -MD $*.d $(CFLAGS) $< 52 | ARCH := aix 53 | CPU_ARCH = rs6000 54 | GFX_ARCH = x 55 | INLINES = js_compare_and_swap:js_fast_lock1:js_fast_unlock1:js_lock_get_slot:js_lock_set_slot:js_lock_scope1 56 | 57 | #-lpthreads -lc_r 58 | 59 | MKSHLIB = /usr/lpp/xlC/bin/makeC++SharedLib_r -p 0 -G -berok 60 | 61 | ifdef JS_THREADSAFE 62 | XLDFLAGS += -ldl 63 | endif 64 | 65 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/config/AIX4.3.mk: -------------------------------------------------------------------------------- 1 | # -*- Mode: makefile -*- 2 | # 3 | # ***** BEGIN LICENSE BLOCK ***** 4 | # Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | # 6 | # The contents of this file are subject to the Mozilla Public License Version 7 | # 1.1 (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # http://www.mozilla.org/MPL/ 10 | # 11 | # Software distributed under the License is distributed on an "AS IS" basis, 12 | # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | # for the specific language governing rights and limitations under the 14 | # License. 15 | # 16 | # The Original Code is Mozilla Communicator client code, released 17 | # March 31, 1998. 18 | # 19 | # The Initial Developer of the Original Code is 20 | # Netscape Communications Corporation. 21 | # Portions created by the Initial Developer are Copyright (C) 1998 22 | # the Initial Developer. All Rights Reserved. 23 | # 24 | # Contributor(s): 25 | # 26 | # Alternatively, the contents of this file may be used under the terms of 27 | # either the GNU General Public License Version 2 or later (the "GPL"), or 28 | # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 29 | # in which case the provisions of the GPL or the LGPL are applicable instead 30 | # of those above. If you wish to allow use of your version of this file only 31 | # under the terms of either the GPL or the LGPL, and not to allow others to 32 | # use your version of this file under the terms of the MPL, indicate your 33 | # decision by deleting the provisions above and replace them with the notice 34 | # and other provisions required by the GPL or the LGPL. If you do not delete 35 | # the provisions above, a recipient may use your version of this file under 36 | # the terms of any one of the MPL, the GPL or the LGPL. 37 | # 38 | # ***** END LICENSE BLOCK ***** 39 | 40 | # 41 | # Config stuff for AIX 42 | # 43 | 44 | CC = xlC_r 45 | CCC = xlC_r 46 | CFLAGS += -qarch=com -qnoansialias -qinline+$(INLINES) -DXP_UNIX -DAIX -DAIXV3 -DSYSV -DAIX4_3 -DHAVE_LOCALTIME_R 47 | 48 | RANLIB = ranlib 49 | 50 | #.c.o: 51 | # $(CC) -c -MD $*.d $(CFLAGS) $< 52 | ARCH := aix 53 | CPU_ARCH = rs6000 54 | GFX_ARCH = x 55 | INLINES = js_compare_and_swap:js_fast_lock1:js_fast_unlock1:js_lock_get_slot:js_lock_set_slot:js_lock_scope1 56 | 57 | #-lpthreads -lc_r 58 | 59 | MKSHLIB_BIN = /usr/ibmcxx/bin/makeC++SharedLib_r 60 | MKSHLIB = $(MKSHLIB_BIN) -p 0 -G -berok -bM:UR 61 | 62 | ifdef JS_THREADSAFE 63 | XLDFLAGS += -ldl 64 | endif 65 | 66 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/config/CVS/Entries: -------------------------------------------------------------------------------- 1 | /AIX4.1.mk/1.7/Sat Feb 12 20:10:33 2005//TJS_170 2 | /AIX4.2.mk/1.9/Sat Feb 12 20:10:33 2005//TJS_170 3 | /AIX4.3.mk/1.9/Sat Feb 12 20:10:33 2005//TJS_170 4 | /Darwin.mk/1.6/Mon Feb 5 16:24:49 2007//TJS_170 5 | /Darwin1.3.mk/1.3/Sat Feb 12 20:10:33 2005//TJS_170 6 | /Darwin1.4.mk/1.3/Sat Feb 12 20:10:33 2005//TJS_170 7 | /Darwin5.2.mk/1.3/Sat Feb 12 20:10:33 2005//TJS_170 8 | /Darwin5.3.mk/1.3/Sat Feb 12 20:10:33 2005//TJS_170 9 | /HP-UXB.10.10.mk/1.9/Sat Feb 12 20:10:33 2005//TJS_170 10 | /HP-UXB.10.20.mk/1.8/Sat Feb 12 20:10:33 2005//TJS_170 11 | /HP-UXB.11.00.mk/1.9/Sat Feb 12 20:10:33 2005//TJS_170 12 | /IRIX.mk/1.9/Sat Feb 12 20:10:33 2005//TJS_170 13 | /IRIX5.3.mk/1.7/Sat Feb 12 20:10:33 2005//TJS_170 14 | /IRIX6.1.mk/1.7/Sat Feb 12 20:10:33 2005//TJS_170 15 | /IRIX6.2.mk/1.6/Sat Feb 12 20:10:33 2005//TJS_170 16 | /IRIX6.3.mk/1.6/Sat Feb 12 20:10:33 2005//TJS_170 17 | /IRIX6.5.mk/1.6/Sat Feb 12 20:10:33 2005//TJS_170 18 | /Linux_All.mk/1.14/Tue May 10 19:53:44 2005//TJS_170 19 | /Mac_OS10.0.mk/1.4/Sat Feb 12 20:10:33 2005//TJS_170 20 | /OSF1V4.0.mk/1.9/Sat Feb 12 20:10:33 2005//TJS_170 21 | /OSF1V5.0.mk/1.5/Sat Feb 12 20:10:33 2005//TJS_170 22 | /SunOS4.1.4.mk/1.6/Sat Feb 12 20:10:33 2005//TJS_170 23 | /SunOS5.3.mk/1.7/Sat Feb 12 20:10:33 2005//TJS_170 24 | /SunOS5.4.mk/1.7/Sat Feb 12 20:10:33 2005//TJS_170 25 | /SunOS5.5.1.mk/1.8/Sat Feb 12 20:10:33 2005//TJS_170 26 | /SunOS5.5.mk/1.10/Sat Feb 12 20:10:33 2005//TJS_170 27 | /SunOS5.6.mk/1.13/Sat Feb 12 20:10:33 2005//TJS_170 28 | /SunOS5.7.mk/1.6/Sat Feb 12 20:10:33 2005//TJS_170 29 | /SunOS5.8.mk/1.4/Sat Feb 12 20:10:33 2005//TJS_170 30 | /SunOS5.9.mk/1.2/Sat Feb 12 20:10:33 2005//TJS_170 31 | /WINNT4.0.mk/1.15/Wed Jul 18 19:55:15 2007//TJS_170 32 | /WINNT5.0.mk/1.10/Fri Aug 10 23:23:38 2007//TJS_170 33 | /WINNT5.1.mk/1.6/Fri Aug 10 23:23:38 2007//TJS_170 34 | /WINNT5.2.mk/1.5/Fri Aug 10 23:23:38 2007//TJS_170 35 | /dgux.mk/1.7/Sat Feb 12 20:10:33 2005//TJS_170 36 | D 37 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/config/CVS/Repository: -------------------------------------------------------------------------------- 1 | mozilla/js/src/config 2 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/config/CVS/Root: -------------------------------------------------------------------------------- 1 | :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot 2 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/config/CVS/Tag: -------------------------------------------------------------------------------- 1 | NJS_170 2 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/config/Darwin.mk: -------------------------------------------------------------------------------- 1 | # -*- Mode: makefile -*- 2 | # 3 | # ***** BEGIN LICENSE BLOCK ***** 4 | # Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | # 6 | # The contents of this file are subject to the Mozilla Public License Version 7 | # 1.1 (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # http://www.mozilla.org/MPL/ 10 | # 11 | # Software distributed under the License is distributed on an "AS IS" basis, 12 | # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | # for the specific language governing rights and limitations under the 14 | # License. 15 | # 16 | # The Original Code is Mozilla Communicator client code, released 17 | # March 31, 1998. 18 | # 19 | # The Initial Developer of the Original Code is 20 | # Netscape Communications Corporation. 21 | # Portions created by the Initial Developer are Copyright (C) 1998 22 | # the Initial Developer. All Rights Reserved. 23 | # 24 | # Contributor(s): 25 | # Steve Zellers (zellers@apple.com) 26 | # 27 | # Alternatively, the contents of this file may be used under the terms of 28 | # either the GNU General Public License Version 2 or later (the "GPL"), or 29 | # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 30 | # in which case the provisions of the GPL or the LGPL are applicable instead 31 | # of those above. If you wish to allow use of your version of this file only 32 | # under the terms of either the GPL or the LGPL, and not to allow others to 33 | # use your version of this file under the terms of the MPL, indicate your 34 | # decision by deleting the provisions above and replace them with the notice 35 | # and other provisions required by the GPL or the LGPL. If you do not delete 36 | # the provisions above, a recipient may use your version of this file under 37 | # the terms of any one of the MPL, the GPL or the LGPL. 38 | # 39 | # ***** END LICENSE BLOCK ***** 40 | 41 | # 42 | # Config for Mac OS X as of PR3 43 | # Just ripped from Linux config 44 | # 45 | 46 | CC = cc 47 | CCC = g++ 48 | CFLAGS += -Wall -Wno-format 49 | OS_CFLAGS = -DXP_UNIX -DSVR4 -DSYSV -D_BSD_SOURCE -DPOSIX_SOURCE -DDARWIN 50 | 51 | RANLIB = ranlib 52 | MKSHLIB = $(CC) -dynamiclib $(XMKSHLIBOPTS) -framework System 53 | 54 | SO_SUFFIX = dylib 55 | 56 | #.c.o: 57 | # $(CC) -c -MD $*.d $(CFLAGS) $< 58 | 59 | CPU_ARCH = $(shell uname -m) 60 | ifeq (86,$(findstring 86,$(CPU_ARCH))) 61 | CPU_ARCH = x86 62 | OS_CFLAGS+= -DX86_LINUX 63 | endif 64 | GFX_ARCH = x 65 | 66 | OS_LIBS = -lc -framework System 67 | 68 | ASFLAGS += -x assembler-with-cpp 69 | 70 | ifeq ($(CPU_ARCH),alpha) 71 | 72 | # Ask the C compiler on alpha linux to let us work with denormalized 73 | # double values, which are required by the ECMA spec. 74 | 75 | OS_CFLAGS += -mieee 76 | endif 77 | 78 | # Use the editline library to provide line-editing support. 79 | JS_EDITLINE = 1 80 | 81 | # Don't allow Makefile.ref to use libmath 82 | NO_LIBM = 1 83 | 84 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/config/Darwin1.3.mk: -------------------------------------------------------------------------------- 1 | # -*- Mode: makefile -*- 2 | # 3 | # ***** BEGIN LICENSE BLOCK ***** 4 | # Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | # 6 | # The contents of this file are subject to the Mozilla Public License Version 7 | # 1.1 (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # http://www.mozilla.org/MPL/ 10 | # 11 | # Software distributed under the License is distributed on an "AS IS" basis, 12 | # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | # for the specific language governing rights and limitations under the 14 | # License. 15 | # 16 | # The Original Code is Mozilla Communicator client code, released 17 | # March 31, 1998. 18 | # 19 | # The Initial Developer of the Original Code is 20 | # Netscape Communications Corporation. 21 | # Portions created by the Initial Developer are Copyright (C) 1998 22 | # the Initial Developer. All Rights Reserved. 23 | # 24 | # Contributor(s): 25 | # Steve Zellers (zellers@apple.com) 26 | # 27 | # Alternatively, the contents of this file may be used under the terms of 28 | # either the GNU General Public License Version 2 or later (the "GPL"), or 29 | # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 30 | # in which case the provisions of the GPL or the LGPL are applicable instead 31 | # of those above. If you wish to allow use of your version of this file only 32 | # under the terms of either the GPL or the LGPL, and not to allow others to 33 | # use your version of this file under the terms of the MPL, indicate your 34 | # decision by deleting the provisions above and replace them with the notice 35 | # and other provisions required by the GPL or the LGPL. If you do not delete 36 | # the provisions above, a recipient may use your version of this file under 37 | # the terms of any one of the MPL, the GPL or the LGPL. 38 | # 39 | # ***** END LICENSE BLOCK ***** 40 | 41 | # 42 | # Config for Mac OS X as of PR3 43 | # Just ripped from Linux config 44 | # 45 | 46 | CC = cc 47 | CCC = g++ 48 | CFLAGS += -Wall -Wno-format 49 | OS_CFLAGS = -DXP_UNIX -DSVR4 -DSYSV -D_BSD_SOURCE -DPOSIX_SOURCE -DRHAPSODY 50 | 51 | RANLIB = ranlib 52 | MKSHLIB = libtool $(XMKSHLIBOPTS) -framework System 53 | 54 | #.c.o: 55 | # $(CC) -c -MD $*.d $(CFLAGS) $< 56 | 57 | CPU_ARCH = $(shell uname -m) 58 | ifeq (86,$(findstring 86,$(CPU_ARCH))) 59 | CPU_ARCH = x86 60 | OS_CFLAGS+= -DX86_LINUX 61 | endif 62 | GFX_ARCH = x 63 | 64 | OS_LIBS = -lc -framework System 65 | 66 | ASFLAGS += -x assembler-with-cpp 67 | 68 | ifeq ($(CPU_ARCH),alpha) 69 | 70 | # Ask the C compiler on alpha linux to let us work with denormalized 71 | # double values, which are required by the ECMA spec. 72 | 73 | OS_CFLAGS += -mieee 74 | endif 75 | 76 | # Use the editline library to provide line-editing support. 77 | JS_EDITLINE = 1 78 | 79 | # Don't allow Makefile.ref to use libmath 80 | NO_LIBM = 1 81 | 82 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/config/Darwin1.4.mk: -------------------------------------------------------------------------------- 1 | # -*- Mode: makefile -*- 2 | # 3 | # ***** BEGIN LICENSE BLOCK ***** 4 | # Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | # 6 | # The contents of this file are subject to the Mozilla Public License Version 7 | # 1.1 (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # http://www.mozilla.org/MPL/ 10 | # 11 | # Software distributed under the License is distributed on an "AS IS" basis, 12 | # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | # for the specific language governing rights and limitations under the 14 | # License. 15 | # 16 | # The Original Code is Mozilla Communicator client code, released 17 | # March 31, 1998. 18 | # 19 | # The Initial Developer of the Original Code is 20 | # Netscape Communications Corporation. 21 | # Portions created by the Initial Developer are Copyright (C) 1998 22 | # the Initial Developer. All Rights Reserved. 23 | # 24 | # Contributor(s): 25 | # Mike McCabe 26 | # 27 | # Alternatively, the contents of this file may be used under the terms of 28 | # either the GNU General Public License Version 2 or later (the "GPL"), or 29 | # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 30 | # in which case the provisions of the GPL or the LGPL are applicable instead 31 | # of those above. If you wish to allow use of your version of this file only 32 | # under the terms of either the GPL or the LGPL, and not to allow others to 33 | # use your version of this file under the terms of the MPL, indicate your 34 | # decision by deleting the provisions above and replace them with the notice 35 | # and other provisions required by the GPL or the LGPL. If you do not delete 36 | # the provisions above, a recipient may use your version of this file under 37 | # the terms of any one of the MPL, the GPL or the LGPL. 38 | # 39 | # ***** END LICENSE BLOCK ***** 40 | 41 | include $(DEPTH)/config/Darwin1.3.mk 42 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/config/Darwin5.2.mk: -------------------------------------------------------------------------------- 1 | # -*- Mode: makefile -*- 2 | # 3 | # ***** BEGIN LICENSE BLOCK ***** 4 | # Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | # 6 | # The contents of this file are subject to the Mozilla Public License Version 7 | # 1.1 (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # http://www.mozilla.org/MPL/ 10 | # 11 | # Software distributed under the License is distributed on an "AS IS" basis, 12 | # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | # for the specific language governing rights and limitations under the 14 | # License. 15 | # 16 | # The Original Code is Mozilla Communicator client code, released 17 | # March 31, 1998. 18 | # 19 | # The Initial Developer of the Original Code is 20 | # Netscape Communications Corporation. 21 | # Portions created by the Initial Developer are Copyright (C) 1998 22 | # the Initial Developer. All Rights Reserved. 23 | # 24 | # Contributor(s): 25 | # Steve Zellers (zellers@apple.com) 26 | # 27 | # Alternatively, the contents of this file may be used under the terms of 28 | # either the GNU General Public License Version 2 or later (the "GPL"), or 29 | # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 30 | # in which case the provisions of the GPL or the LGPL are applicable instead 31 | # of those above. If you wish to allow use of your version of this file only 32 | # under the terms of either the GPL or the LGPL, and not to allow others to 33 | # use your version of this file under the terms of the MPL, indicate your 34 | # decision by deleting the provisions above and replace them with the notice 35 | # and other provisions required by the GPL or the LGPL. If you do not delete 36 | # the provisions above, a recipient may use your version of this file under 37 | # the terms of any one of the MPL, the GPL or the LGPL. 38 | # 39 | # ***** END LICENSE BLOCK ***** 40 | 41 | # 42 | # Config for Mac OS X as of PR3 43 | # Just ripped from Linux config 44 | # 45 | 46 | CC = cc 47 | CCC = g++ 48 | CFLAGS += -Wall -Wno-format 49 | OS_CFLAGS = -DXP_UNIX -DSVR4 -DSYSV -D_BSD_SOURCE -DPOSIX_SOURCE -DDARWIN 50 | 51 | RANLIB = ranlib 52 | MKSHLIB = libtool $(XMKSHLIBOPTS) -framework System 53 | 54 | #.c.o: 55 | # $(CC) -c -MD $*.d $(CFLAGS) $< 56 | 57 | CPU_ARCH = $(shell uname -m) 58 | ifeq (86,$(findstring 86,$(CPU_ARCH))) 59 | CPU_ARCH = x86 60 | OS_CFLAGS+= -DX86_LINUX 61 | endif 62 | GFX_ARCH = x 63 | 64 | OS_LIBS = -lc -framework System 65 | 66 | ASFLAGS += -x assembler-with-cpp 67 | 68 | ifeq ($(CPU_ARCH),alpha) 69 | 70 | # Ask the C compiler on alpha linux to let us work with denormalized 71 | # double values, which are required by the ECMA spec. 72 | 73 | OS_CFLAGS += -mieee 74 | endif 75 | 76 | # Use the editline library to provide line-editing support. 77 | JS_EDITLINE = 1 78 | 79 | # Don't allow Makefile.ref to use libmath 80 | NO_LIBM = 1 81 | 82 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/config/Darwin5.3.mk: -------------------------------------------------------------------------------- 1 | # -*- Mode: makefile -*- 2 | # 3 | # ***** BEGIN LICENSE BLOCK ***** 4 | # Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | # 6 | # The contents of this file are subject to the Mozilla Public License Version 7 | # 1.1 (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # http://www.mozilla.org/MPL/ 10 | # 11 | # Software distributed under the License is distributed on an "AS IS" basis, 12 | # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | # for the specific language governing rights and limitations under the 14 | # License. 15 | # 16 | # The Original Code is Mozilla Communicator client code, released 17 | # March 31, 1998. 18 | # 19 | # The Initial Developer of the Original Code is 20 | # Netscape Communications Corporation. 21 | # Portions created by the Initial Developer are Copyright (C) 1998 22 | # the Initial Developer. All Rights Reserved. 23 | # 24 | # Contributor(s): 25 | # Steve Zellers (zellers@apple.com) 26 | # 27 | # Alternatively, the contents of this file may be used under the terms of 28 | # either the GNU General Public License Version 2 or later (the "GPL"), or 29 | # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 30 | # in which case the provisions of the GPL or the LGPL are applicable instead 31 | # of those above. If you wish to allow use of your version of this file only 32 | # under the terms of either the GPL or the LGPL, and not to allow others to 33 | # use your version of this file under the terms of the MPL, indicate your 34 | # decision by deleting the provisions above and replace them with the notice 35 | # and other provisions required by the GPL or the LGPL. If you do not delete 36 | # the provisions above, a recipient may use your version of this file under 37 | # the terms of any one of the MPL, the GPL or the LGPL. 38 | # 39 | # ***** END LICENSE BLOCK ***** 40 | 41 | # 42 | # Config for Mac OS X as of PR3 43 | # Just ripped from Linux config 44 | # 45 | 46 | CC = cc 47 | CCC = g++ 48 | CFLAGS += -Wall -Wno-format 49 | OS_CFLAGS = -DXP_UNIX -DSVR4 -DSYSV -D_BSD_SOURCE -DPOSIX_SOURCE -DDARWIN 50 | 51 | RANLIB = ranlib 52 | MKSHLIB = libtool $(XMKSHLIBOPTS) -framework System 53 | 54 | #.c.o: 55 | # $(CC) -c -MD $*.d $(CFLAGS) $< 56 | 57 | CPU_ARCH = $(shell uname -m) 58 | ifeq (86,$(findstring 86,$(CPU_ARCH))) 59 | CPU_ARCH = x86 60 | OS_CFLAGS+= -DX86_LINUX 61 | endif 62 | GFX_ARCH = x 63 | 64 | OS_LIBS = -lc -framework System 65 | 66 | ASFLAGS += -x assembler-with-cpp 67 | 68 | ifeq ($(CPU_ARCH),alpha) 69 | 70 | # Ask the C compiler on alpha linux to let us work with denormalized 71 | # double values, which are required by the ECMA spec. 72 | 73 | OS_CFLAGS += -mieee 74 | endif 75 | 76 | # Use the editline library to provide line-editing support. 77 | JS_EDITLINE = 1 78 | 79 | # Don't allow Makefile.ref to use libmath 80 | NO_LIBM = 1 81 | 82 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/config/FreeBSD.mk: -------------------------------------------------------------------------------- 1 | # -*- Mode: makefile -*- 2 | # 3 | # ***** BEGIN LICENSE BLOCK ***** 4 | # Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | # 6 | # The contents of this file are subject to the Mozilla Public License Version 7 | # 1.1 (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # http://www.mozilla.org/MPL/ 10 | # 11 | # Software distributed under the License is distributed on an "AS IS" basis, 12 | # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | # for the specific language governing rights and limitations under the 14 | # License. 15 | # 16 | # The Original Code is Mozilla Communicator client code, released 17 | # March 31, 1998. 18 | # 19 | # The Initial Developer of the Original Code is 20 | # Netscape Communications Corporation. 21 | # Portions created by the Initial Developer are Copyright (C) 1998 22 | # the Initial Developer. All Rights Reserved. 23 | # 24 | # Contributor(s): 25 | # 26 | # Alternatively, the contents of this file may be used under the terms of 27 | # either the GNU General Public License Version 2 or later (the "GPL"), or 28 | # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 29 | # in which case the provisions of the GPL or the LGPL are applicable instead 30 | # of those above. If you wish to allow use of your version of this file only 31 | # under the terms of either the GPL or the LGPL, and not to allow others to 32 | # use your version of this file under the terms of the MPL, indicate your 33 | # decision by deleting the provisions above and replace them with the notice 34 | # and other provisions required by the GPL or the LGPL. If you do not delete 35 | # the provisions above, a recipient may use your version of this file under 36 | # the terms of any one of the MPL, the GPL or the LGPL. 37 | # 38 | # ***** END LICENSE BLOCK ***** 39 | 40 | # 41 | # Config for all versions of FreeBSD 42 | # 43 | 44 | CC ?= gcc 45 | CCC ?= g++ 46 | CFLAGS += -Wall -Wno-format 47 | OS_CFLAGS = -DXP_UNIX -DSVR4 -DSYSV -D_BSD_SOURCE -DPOSIX_SOURCE -DHAVE_LOCALTIME_R 48 | 49 | RANLIB = echo 50 | MKSHLIB = $(LD) -shared $(XMKSHLIBOPTS) 51 | 52 | #.c.o: 53 | # $(CC) -c -MD $*.d $(CFLAGS) $< 54 | 55 | CPU_ARCH = $(shell uname -m) 56 | # don't filter in x86-64 architecture 57 | ifneq (amd64,$(CPU_ARCH)) 58 | ifeq (86,$(findstring 86,$(CPU_ARCH))) 59 | CPU_ARCH = x86 60 | OS_CFLAGS+= -DX86_LINUX 61 | 62 | ifeq (gcc, $(CC)) 63 | # if using gcc on x86, check version for opt bug 64 | # (http://bugzilla.mozilla.org/show_bug.cgi?id=24892) 65 | GCC_VERSION := $(shell gcc -v 2>&1 | grep version | awk '{ print $$3 }') 66 | GCC_LIST:=$(sort 2.91.66 $(GCC_VERSION) ) 67 | 68 | ifeq (2.91.66, $(firstword $(GCC_LIST))) 69 | CFLAGS+= -DGCC_OPT_BUG 70 | endif 71 | endif 72 | endif 73 | endif 74 | 75 | GFX_ARCH = x 76 | 77 | OS_LIBS = -lm -lc 78 | 79 | ASFLAGS += -x assembler-with-cpp 80 | 81 | 82 | # Use the editline library to provide line-editing support. 83 | JS_EDITLINE = 1 84 | 85 | ifeq ($(CPU_ARCH),amd64) 86 | # Use VA_COPY() standard macro on x86-64 87 | # FIXME: better use it everywhere 88 | OS_CFLAGS += -DHAVE_VA_COPY -DVA_COPY=va_copy 89 | endif 90 | 91 | ifeq ($(CPU_ARCH),amd64) 92 | # We need PIC code for shared libraries 93 | # FIXME: better patch rules.mk & fdlibm/Makefile* 94 | OS_CFLAGS += -DPIC -fPIC 95 | endif 96 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/config/HP-UXB.10.10.mk: -------------------------------------------------------------------------------- 1 | # -*- Mode: makefile -*- 2 | # 3 | # ***** BEGIN LICENSE BLOCK ***** 4 | # Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | # 6 | # The contents of this file are subject to the Mozilla Public License Version 7 | # 1.1 (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # http://www.mozilla.org/MPL/ 10 | # 11 | # Software distributed under the License is distributed on an "AS IS" basis, 12 | # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | # for the specific language governing rights and limitations under the 14 | # License. 15 | # 16 | # The Original Code is Mozilla Communicator client code, released 17 | # March 31, 1998. 18 | # 19 | # The Initial Developer of the Original Code is 20 | # Netscape Communications Corporation. 21 | # Portions created by the Initial Developer are Copyright (C) 1998 22 | # the Initial Developer. All Rights Reserved. 23 | # 24 | # Contributor(s): 25 | # 26 | # Alternatively, the contents of this file may be used under the terms of 27 | # either the GNU General Public License Version 2 or later (the "GPL"), or 28 | # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 29 | # in which case the provisions of the GPL or the LGPL are applicable instead 30 | # of those above. If you wish to allow use of your version of this file only 31 | # under the terms of either the GPL or the LGPL, and not to allow others to 32 | # use your version of this file under the terms of the MPL, indicate your 33 | # decision by deleting the provisions above and replace them with the notice 34 | # and other provisions required by the GPL or the LGPL. If you do not delete 35 | # the provisions above, a recipient may use your version of this file under 36 | # the terms of any one of the MPL, the GPL or the LGPL. 37 | # 38 | # ***** END LICENSE BLOCK ***** 39 | 40 | # 41 | # Config stuff for HPUX 42 | # 43 | 44 | # CC = gcc 45 | # CCC = g++ 46 | # CFLAGS += -Wall -Wno-format -fPIC 47 | 48 | CC = cc -Ae +Z 49 | CCC = CC -Ae +a1 +eh +Z 50 | 51 | RANLIB = echo 52 | MKSHLIB = $(LD) -b 53 | 54 | SO_SUFFIX = sl 55 | 56 | #.c.o: 57 | # $(CC) -c -MD $*.d $(CFLAGS) $< 58 | 59 | CPU_ARCH = hppa 60 | GFX_ARCH = x 61 | 62 | OS_CFLAGS = -DXP_UNIX -DHPUX -DSYSV -DHAVE_LOCALTIME_R 63 | OS_LIBS = -ldld 64 | 65 | ifeq ($(OS_RELEASE),B.10) 66 | PLATFORM_FLAGS += -DHPUX10 -Dhpux10 67 | PORT_FLAGS += -DRW_NO_OVERLOAD_SCHAR -DHAVE_MODEL_H 68 | ifeq ($(OS_VERSION),.10) 69 | PLATFORM_FLAGS += -DHPUX10_10 70 | endif 71 | ifeq ($(OS_VERSION),.20) 72 | PLATFORM_FLAGS += -DHPUX10_20 73 | endif 74 | ifeq ($(OS_VERSION),.30) 75 | PLATFORM_FLAGS += -DHPUX10_30 76 | endif 77 | endif 78 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/config/HP-UXB.10.20.mk: -------------------------------------------------------------------------------- 1 | # -*- Mode: makefile -*- 2 | # 3 | # ***** BEGIN LICENSE BLOCK ***** 4 | # Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | # 6 | # The contents of this file are subject to the Mozilla Public License Version 7 | # 1.1 (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # http://www.mozilla.org/MPL/ 10 | # 11 | # Software distributed under the License is distributed on an "AS IS" basis, 12 | # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | # for the specific language governing rights and limitations under the 14 | # License. 15 | # 16 | # The Original Code is Mozilla Communicator client code, released 17 | # March 31, 1998. 18 | # 19 | # The Initial Developer of the Original Code is 20 | # Netscape Communications Corporation. 21 | # Portions created by the Initial Developer are Copyright (C) 1998 22 | # the Initial Developer. All Rights Reserved. 23 | # 24 | # Contributor(s): 25 | # 26 | # Alternatively, the contents of this file may be used under the terms of 27 | # either the GNU General Public License Version 2 or later (the "GPL"), or 28 | # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 29 | # in which case the provisions of the GPL or the LGPL are applicable instead 30 | # of those above. If you wish to allow use of your version of this file only 31 | # under the terms of either the GPL or the LGPL, and not to allow others to 32 | # use your version of this file under the terms of the MPL, indicate your 33 | # decision by deleting the provisions above and replace them with the notice 34 | # and other provisions required by the GPL or the LGPL. If you do not delete 35 | # the provisions above, a recipient may use your version of this file under 36 | # the terms of any one of the MPL, the GPL or the LGPL. 37 | # 38 | # ***** END LICENSE BLOCK ***** 39 | 40 | # 41 | # Config stuff for HPUX 42 | # 43 | 44 | # CC = gcc 45 | # CCC = g++ 46 | # CFLAGS += -Wall -Wno-format -fPIC 47 | 48 | CC = cc -Ae +Z 49 | CCC = CC -Ae +a1 +eh +Z 50 | 51 | RANLIB = echo 52 | MKSHLIB = $(LD) -b 53 | 54 | SO_SUFFIX = sl 55 | 56 | #.c.o: 57 | # $(CC) -c -MD $*.d $(CFLAGS) $< 58 | 59 | CPU_ARCH = hppa 60 | GFX_ARCH = x 61 | 62 | OS_CFLAGS = -DXP_UNIX -DHPUX -DSYSV -DHAVE_LOCALTIME_R 63 | OS_LIBS = -ldld 64 | 65 | ifeq ($(OS_RELEASE),B.10) 66 | PLATFORM_FLAGS += -DHPUX10 -Dhpux10 67 | PORT_FLAGS += -DRW_NO_OVERLOAD_SCHAR -DHAVE_MODEL_H 68 | ifeq ($(OS_VERSION),.10) 69 | PLATFORM_FLAGS += -DHPUX10_10 70 | endif 71 | ifeq ($(OS_VERSION),.20) 72 | PLATFORM_FLAGS += -DHPUX10_20 73 | endif 74 | ifeq ($(OS_VERSION),.30) 75 | PLATFORM_FLAGS += -DHPUX10_30 76 | endif 77 | endif 78 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/config/HP-UXB.11.00.mk: -------------------------------------------------------------------------------- 1 | # -*- Mode: makefile -*- 2 | # 3 | # ***** BEGIN LICENSE BLOCK ***** 4 | # Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | # 6 | # The contents of this file are subject to the Mozilla Public License Version 7 | # 1.1 (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # http://www.mozilla.org/MPL/ 10 | # 11 | # Software distributed under the License is distributed on an "AS IS" basis, 12 | # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | # for the specific language governing rights and limitations under the 14 | # License. 15 | # 16 | # The Original Code is Mozilla Communicator client code, released 17 | # March 31, 1998. 18 | # 19 | # The Initial Developer of the Original Code is 20 | # Netscape Communications Corporation. 21 | # Portions created by the Initial Developer are Copyright (C) 1998 22 | # the Initial Developer. All Rights Reserved. 23 | # 24 | # Contributor(s): 25 | # 26 | # Alternatively, the contents of this file may be used under the terms of 27 | # either the GNU General Public License Version 2 or later (the "GPL"), or 28 | # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 29 | # in which case the provisions of the GPL or the LGPL are applicable instead 30 | # of those above. If you wish to allow use of your version of this file only 31 | # under the terms of either the GPL or the LGPL, and not to allow others to 32 | # use your version of this file under the terms of the MPL, indicate your 33 | # decision by deleting the provisions above and replace them with the notice 34 | # and other provisions required by the GPL or the LGPL. If you do not delete 35 | # the provisions above, a recipient may use your version of this file under 36 | # the terms of any one of the MPL, the GPL or the LGPL. 37 | # 38 | # ***** END LICENSE BLOCK ***** 39 | 40 | # 41 | # Config stuff for HPUX 42 | # 43 | 44 | ifdef NS_USE_NATIVE 45 | CC = cc +Z +DAportable +DS2.0 +u4 46 | # LD = aCC +Z -b -Wl,+s -Wl,-B,symbolic 47 | else 48 | CC = gcc -Wall -Wno-format -fPIC 49 | CCC = g++ -Wall -Wno-format -fPIC 50 | endif 51 | 52 | RANLIB = echo 53 | MKSHLIB = $(LD) -b 54 | 55 | SO_SUFFIX = sl 56 | 57 | #.c.o: 58 | # $(CC) -c -MD $*.d $(CFLAGS) $< 59 | 60 | CPU_ARCH = hppa 61 | GFX_ARCH = x 62 | 63 | OS_CFLAGS = -DXP_UNIX -DHPUX -DSYSV -D_HPUX -DNATIVE -D_POSIX_C_SOURCE=199506L -DHAVE_LOCALTIME_R 64 | OS_LIBS = -ldld 65 | 66 | XLDFLAGS = -lpthread 67 | 68 | ifeq ($(OS_RELEASE),B.10) 69 | PLATFORM_FLAGS += -DHPUX10 -Dhpux10 70 | PORT_FLAGS += -DRW_NO_OVERLOAD_SCHAR -DHAVE_MODEL_H 71 | ifeq ($(OS_VERSION),.10) 72 | PLATFORM_FLAGS += -DHPUX10_10 73 | endif 74 | ifeq ($(OS_VERSION),.20) 75 | PLATFORM_FLAGS += -DHPUX10_20 76 | endif 77 | ifeq ($(OS_VERSION),.30) 78 | PLATFORM_FLAGS += -DHPUX10_30 79 | endif 80 | endif 81 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/config/IRIX.mk: -------------------------------------------------------------------------------- 1 | # -*- Mode: makefile -*- 2 | # 3 | # ***** BEGIN LICENSE BLOCK ***** 4 | # Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | # 6 | # The contents of this file are subject to the Mozilla Public License Version 7 | # 1.1 (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # http://www.mozilla.org/MPL/ 10 | # 11 | # Software distributed under the License is distributed on an "AS IS" basis, 12 | # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | # for the specific language governing rights and limitations under the 14 | # License. 15 | # 16 | # The Original Code is Mozilla Communicator client code, released 17 | # March 31, 1998. 18 | # 19 | # The Initial Developer of the Original Code is 20 | # Netscape Communications Corporation. 21 | # Portions created by the Initial Developer are Copyright (C) 1998 22 | # the Initial Developer. All Rights Reserved. 23 | # 24 | # Contributor(s): 25 | # 26 | # Alternatively, the contents of this file may be used under the terms of 27 | # either the GNU General Public License Version 2 or later (the "GPL"), or 28 | # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 29 | # in which case the provisions of the GPL or the LGPL are applicable instead 30 | # of those above. If you wish to allow use of your version of this file only 31 | # under the terms of either the GPL or the LGPL, and not to allow others to 32 | # use your version of this file under the terms of the MPL, indicate your 33 | # decision by deleting the provisions above and replace them with the notice 34 | # and other provisions required by the GPL or the LGPL. If you do not delete 35 | # the provisions above, a recipient may use your version of this file under 36 | # the terms of any one of the MPL, the GPL or the LGPL. 37 | # 38 | # ***** END LICENSE BLOCK ***** 39 | 40 | # 41 | # Config stuff for IRIX 42 | # 43 | 44 | CPU_ARCH = mips 45 | GFX_ARCH = x 46 | 47 | RANLIB = /bin/true 48 | 49 | #NS_USE_GCC = 1 50 | 51 | ifndef NS_USE_NATIVE 52 | CC = gcc 53 | CCC = g++ 54 | AS = $(CC) -x assembler-with-cpp 55 | ODD_CFLAGS = -Wall -Wno-format 56 | ifdef BUILD_OPT 57 | OPTIMIZER = -O6 58 | endif 59 | else 60 | ifeq ($(OS_RELEASE),6.2) 61 | CC = cc -n32 -DIRIX6_2 62 | endif 63 | ifeq ($(OS_RELEASE),6.3) 64 | CC = cc -n32 -DIRIX6_3 65 | endif 66 | ifeq ($(OS_RELEASE),6.5) 67 | CC = cc -n32 -DIRIX6_5 68 | endif 69 | CCC = CC 70 | # LD = CC 71 | ODD_CFLAGS = -fullwarn -xansi 72 | ifdef BUILD_OPT 73 | OPTIMIZER += -Olimit 4000 74 | endif 75 | endif 76 | 77 | # For purify 78 | HAVE_PURIFY = 1 79 | PURE_OS_CFLAGS = $(ODD_CFLAGS) -DXP_UNIX -DSVR4 -DSW_THREADS -DIRIX -DHAVE_LOCALTIME_R 80 | 81 | OS_CFLAGS = $(PURE_OS_CFLAGS) -MDupdate $(DEPENDENCIES) 82 | 83 | BSDECHO = echo 84 | MKSHLIB = $(LD) -n32 -shared 85 | 86 | # Use the editline library to provide line-editing support. 87 | JS_EDITLINE = 1 88 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/config/IRIX5.3.mk: -------------------------------------------------------------------------------- 1 | # -*- Mode: makefile -*- 2 | # 3 | # ***** BEGIN LICENSE BLOCK ***** 4 | # Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | # 6 | # The contents of this file are subject to the Mozilla Public License Version 7 | # 1.1 (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # http://www.mozilla.org/MPL/ 10 | # 11 | # Software distributed under the License is distributed on an "AS IS" basis, 12 | # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | # for the specific language governing rights and limitations under the 14 | # License. 15 | # 16 | # The Original Code is Mozilla Communicator client code, released 17 | # March 31, 1998. 18 | # 19 | # The Initial Developer of the Original Code is 20 | # Netscape Communications Corporation. 21 | # Portions created by the Initial Developer are Copyright (C) 1998 22 | # the Initial Developer. All Rights Reserved. 23 | # 24 | # Contributor(s): 25 | # 26 | # Alternatively, the contents of this file may be used under the terms of 27 | # either the GNU General Public License Version 2 or later (the "GPL"), or 28 | # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 29 | # in which case the provisions of the GPL or the LGPL are applicable instead 30 | # of those above. If you wish to allow use of your version of this file only 31 | # under the terms of either the GPL or the LGPL, and not to allow others to 32 | # use your version of this file under the terms of the MPL, indicate your 33 | # decision by deleting the provisions above and replace them with the notice 34 | # and other provisions required by the GPL or the LGPL. If you do not delete 35 | # the provisions above, a recipient may use your version of this file under 36 | # the terms of any one of the MPL, the GPL or the LGPL. 37 | # 38 | # ***** END LICENSE BLOCK ***** 39 | 40 | # 41 | # Config stuff for IRIX5.3 42 | # 43 | 44 | include $(DEPTH)/config/IRIX.mk 45 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/config/IRIX6.1.mk: -------------------------------------------------------------------------------- 1 | # -*- Mode: makefile -*- 2 | # 3 | # ***** BEGIN LICENSE BLOCK ***** 4 | # Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | # 6 | # The contents of this file are subject to the Mozilla Public License Version 7 | # 1.1 (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # http://www.mozilla.org/MPL/ 10 | # 11 | # Software distributed under the License is distributed on an "AS IS" basis, 12 | # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | # for the specific language governing rights and limitations under the 14 | # License. 15 | # 16 | # The Original Code is Mozilla Communicator client code, released 17 | # March 31, 1998. 18 | # 19 | # The Initial Developer of the Original Code is 20 | # Netscape Communications Corporation. 21 | # Portions created by the Initial Developer are Copyright (C) 1998 22 | # the Initial Developer. All Rights Reserved. 23 | # 24 | # Contributor(s): 25 | # 26 | # Alternatively, the contents of this file may be used under the terms of 27 | # either the GNU General Public License Version 2 or later (the "GPL"), or 28 | # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 29 | # in which case the provisions of the GPL or the LGPL are applicable instead 30 | # of those above. If you wish to allow use of your version of this file only 31 | # under the terms of either the GPL or the LGPL, and not to allow others to 32 | # use your version of this file under the terms of the MPL, indicate your 33 | # decision by deleting the provisions above and replace them with the notice 34 | # and other provisions required by the GPL or the LGPL. If you do not delete 35 | # the provisions above, a recipient may use your version of this file under 36 | # the terms of any one of the MPL, the GPL or the LGPL. 37 | # 38 | # ***** END LICENSE BLOCK ***** 39 | 40 | # 41 | # Config stuff for IRIX6.3 42 | # 43 | 44 | include $(DEPTH)/config/IRIX.mk 45 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/config/IRIX6.2.mk: -------------------------------------------------------------------------------- 1 | # -*- Mode: makefile -*- 2 | # 3 | # ***** BEGIN LICENSE BLOCK ***** 4 | # Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | # 6 | # The contents of this file are subject to the Mozilla Public License Version 7 | # 1.1 (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # http://www.mozilla.org/MPL/ 10 | # 11 | # Software distributed under the License is distributed on an "AS IS" basis, 12 | # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | # for the specific language governing rights and limitations under the 14 | # License. 15 | # 16 | # The Original Code is Mozilla Communicator client code, released 17 | # March 31, 1998. 18 | # 19 | # The Initial Developer of the Original Code is 20 | # Netscape Communications Corporation. 21 | # Portions created by the Initial Developer are Copyright (C) 1998 22 | # the Initial Developer. All Rights Reserved. 23 | # 24 | # Contributor(s): 25 | # 26 | # Alternatively, the contents of this file may be used under the terms of 27 | # either the GNU General Public License Version 2 or later (the "GPL"), or 28 | # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 29 | # in which case the provisions of the GPL or the LGPL are applicable instead 30 | # of those above. If you wish to allow use of your version of this file only 31 | # under the terms of either the GPL or the LGPL, and not to allow others to 32 | # use your version of this file under the terms of the MPL, indicate your 33 | # decision by deleting the provisions above and replace them with the notice 34 | # and other provisions required by the GPL or the LGPL. If you do not delete 35 | # the provisions above, a recipient may use your version of this file under 36 | # the terms of any one of the MPL, the GPL or the LGPL. 37 | # 38 | # ***** END LICENSE BLOCK ***** 39 | 40 | # 41 | # Config stuff for IRIX6.3 42 | # 43 | 44 | include $(DEPTH)/config/IRIX.mk 45 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/config/IRIX6.3.mk: -------------------------------------------------------------------------------- 1 | # -*- Mode: makefile -*- 2 | # 3 | # ***** BEGIN LICENSE BLOCK ***** 4 | # Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | # 6 | # The contents of this file are subject to the Mozilla Public License Version 7 | # 1.1 (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # http://www.mozilla.org/MPL/ 10 | # 11 | # Software distributed under the License is distributed on an "AS IS" basis, 12 | # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | # for the specific language governing rights and limitations under the 14 | # License. 15 | # 16 | # The Original Code is Mozilla Communicator client code, released 17 | # March 31, 1998. 18 | # 19 | # The Initial Developer of the Original Code is 20 | # Netscape Communications Corporation. 21 | # Portions created by the Initial Developer are Copyright (C) 1998 22 | # the Initial Developer. All Rights Reserved. 23 | # 24 | # Contributor(s): 25 | # 26 | # Alternatively, the contents of this file may be used under the terms of 27 | # either the GNU General Public License Version 2 or later (the "GPL"), or 28 | # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 29 | # in which case the provisions of the GPL or the LGPL are applicable instead 30 | # of those above. If you wish to allow use of your version of this file only 31 | # under the terms of either the GPL or the LGPL, and not to allow others to 32 | # use your version of this file under the terms of the MPL, indicate your 33 | # decision by deleting the provisions above and replace them with the notice 34 | # and other provisions required by the GPL or the LGPL. If you do not delete 35 | # the provisions above, a recipient may use your version of this file under 36 | # the terms of any one of the MPL, the GPL or the LGPL. 37 | # 38 | # ***** END LICENSE BLOCK ***** 39 | 40 | # 41 | # Config stuff for IRIX6.3 42 | # 43 | 44 | include $(DEPTH)/config/IRIX.mk 45 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/config/IRIX6.5.mk: -------------------------------------------------------------------------------- 1 | # -*- Mode: makefile -*- 2 | # 3 | # ***** BEGIN LICENSE BLOCK ***** 4 | # Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | # 6 | # The contents of this file are subject to the Mozilla Public License Version 7 | # 1.1 (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # http://www.mozilla.org/MPL/ 10 | # 11 | # Software distributed under the License is distributed on an "AS IS" basis, 12 | # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | # for the specific language governing rights and limitations under the 14 | # License. 15 | # 16 | # The Original Code is Mozilla Communicator client code, released 17 | # March 31, 1998. 18 | # 19 | # The Initial Developer of the Original Code is 20 | # Netscape Communications Corporation. 21 | # Portions created by the Initial Developer are Copyright (C) 1998 22 | # the Initial Developer. All Rights Reserved. 23 | # 24 | # Contributor(s): 25 | # 26 | # Alternatively, the contents of this file may be used under the terms of 27 | # either the GNU General Public License Version 2 or later (the "GPL"), or 28 | # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 29 | # in which case the provisions of the GPL or the LGPL are applicable instead 30 | # of those above. If you wish to allow use of your version of this file only 31 | # under the terms of either the GPL or the LGPL, and not to allow others to 32 | # use your version of this file under the terms of the MPL, indicate your 33 | # decision by deleting the provisions above and replace them with the notice 34 | # and other provisions required by the GPL or the LGPL. If you do not delete 35 | # the provisions above, a recipient may use your version of this file under 36 | # the terms of any one of the MPL, the GPL or the LGPL. 37 | # 38 | # ***** END LICENSE BLOCK ***** 39 | 40 | # 41 | # Config stuff for IRIX6.3 42 | # 43 | 44 | include $(DEPTH)/config/IRIX.mk 45 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/config/Linux_All.mk: -------------------------------------------------------------------------------- 1 | # -*- Mode: makefile -*- 2 | # 3 | # ***** BEGIN LICENSE BLOCK ***** 4 | # Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | # 6 | # The contents of this file are subject to the Mozilla Public License Version 7 | # 1.1 (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # http://www.mozilla.org/MPL/ 10 | # 11 | # Software distributed under the License is distributed on an "AS IS" basis, 12 | # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | # for the specific language governing rights and limitations under the 14 | # License. 15 | # 16 | # The Original Code is Mozilla Communicator client code, released 17 | # March 31, 1998. 18 | # 19 | # The Initial Developer of the Original Code is 20 | # Netscape Communications Corporation. 21 | # Portions created by the Initial Developer are Copyright (C) 1998 22 | # the Initial Developer. All Rights Reserved. 23 | # 24 | # Contributor(s): 25 | # 26 | # Alternatively, the contents of this file may be used under the terms of 27 | # either the GNU General Public License Version 2 or later (the "GPL"), or 28 | # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 29 | # in which case the provisions of the GPL or the LGPL are applicable instead 30 | # of those above. If you wish to allow use of your version of this file only 31 | # under the terms of either the GPL or the LGPL, and not to allow others to 32 | # use your version of this file under the terms of the MPL, indicate your 33 | # decision by deleting the provisions above and replace them with the notice 34 | # and other provisions required by the GPL or the LGPL. If you do not delete 35 | # the provisions above, a recipient may use your version of this file under 36 | # the terms of any one of the MPL, the GPL or the LGPL. 37 | # 38 | # ***** END LICENSE BLOCK ***** 39 | 40 | # 41 | # Config for all versions of Linux 42 | # 43 | 44 | CC = gcc 45 | CCC = g++ 46 | CFLAGS += -Wall -Wno-format 47 | OS_CFLAGS = -DXP_UNIX -DSVR4 -DSYSV -D_BSD_SOURCE -DPOSIX_SOURCE -DHAVE_LOCALTIME_R 48 | 49 | RANLIB = echo 50 | MKSHLIB = $(LD) -shared $(XMKSHLIBOPTS) 51 | 52 | #.c.o: 53 | # $(CC) -c -MD $*.d $(CFLAGS) $< 54 | 55 | CPU_ARCH = $(shell uname -m) 56 | # don't filter in x86-64 architecture 57 | ifneq (x86_64,$(CPU_ARCH)) 58 | ifeq (86,$(findstring 86,$(CPU_ARCH))) 59 | CPU_ARCH = x86 60 | OS_CFLAGS+= -DX86_LINUX 61 | 62 | ifeq (gcc, $(CC)) 63 | # if using gcc on x86, check version for opt bug 64 | # (http://bugzilla.mozilla.org/show_bug.cgi?id=24892) 65 | GCC_VERSION := $(shell gcc -v 2>&1 | grep version | awk '{ print $$3 }') 66 | GCC_LIST:=$(sort 2.91.66 $(GCC_VERSION) ) 67 | 68 | ifeq (2.91.66, $(firstword $(GCC_LIST))) 69 | CFLAGS+= -DGCC_OPT_BUG 70 | endif 71 | endif 72 | endif 73 | endif 74 | 75 | GFX_ARCH = x 76 | 77 | OS_LIBS = -lm -lc 78 | 79 | ASFLAGS += -x assembler-with-cpp 80 | 81 | 82 | ifeq ($(CPU_ARCH),alpha) 83 | 84 | # Ask the C compiler on alpha linux to let us work with denormalized 85 | # double values, which are required by the ECMA spec. 86 | 87 | OS_CFLAGS += -mieee 88 | endif 89 | 90 | # Use the editline library to provide line-editing support. 91 | JS_EDITLINE = 1 92 | 93 | ifeq ($(CPU_ARCH),x86_64) 94 | # Use VA_COPY() standard macro on x86-64 95 | # FIXME: better use it everywhere 96 | OS_CFLAGS += -DHAVE_VA_COPY -DVA_COPY=va_copy 97 | endif 98 | 99 | ifeq ($(CPU_ARCH),x86_64) 100 | # We need PIC code for shared libraries 101 | # FIXME: better patch rules.mk & fdlibm/Makefile* 102 | OS_CFLAGS += -DPIC -fPIC 103 | endif 104 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/config/Mac_OS10.0.mk: -------------------------------------------------------------------------------- 1 | # -*- Mode: makefile -*- 2 | # 3 | # ***** BEGIN LICENSE BLOCK ***** 4 | # Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | # 6 | # The contents of this file are subject to the Mozilla Public License Version 7 | # 1.1 (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # http://www.mozilla.org/MPL/ 10 | # 11 | # Software distributed under the License is distributed on an "AS IS" basis, 12 | # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | # for the specific language governing rights and limitations under the 14 | # License. 15 | # 16 | # The Original Code is Mozilla Communicator client code, released 17 | # March 31, 1998. 18 | # 19 | # The Initial Developer of the Original Code is 20 | # Netscape Communications Corporation. 21 | # Portions created by the Initial Developer are Copyright (C) 1998 22 | # the Initial Developer. All Rights Reserved. 23 | # 24 | # Contributor(s): 25 | # Steve Zellers (zellers@apple.com) 26 | # 27 | # Alternatively, the contents of this file may be used under the terms of 28 | # either the GNU General Public License Version 2 or later (the "GPL"), or 29 | # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 30 | # in which case the provisions of the GPL or the LGPL are applicable instead 31 | # of those above. If you wish to allow use of your version of this file only 32 | # under the terms of either the GPL or the LGPL, and not to allow others to 33 | # use your version of this file under the terms of the MPL, indicate your 34 | # decision by deleting the provisions above and replace them with the notice 35 | # and other provisions required by the GPL or the LGPL. If you do not delete 36 | # the provisions above, a recipient may use your version of this file under 37 | # the terms of any one of the MPL, the GPL or the LGPL. 38 | # 39 | # ***** END LICENSE BLOCK ***** 40 | 41 | # 42 | # Config for Mac OS X as of PR3 43 | # Just ripped from Linux config 44 | # 45 | 46 | CC = cc 47 | CCC = g++ 48 | CFLAGS += -Wall -Wno-format 49 | OS_CFLAGS = -DXP_UNIX -DSVR4 -DSYSV -D_BSD_SOURCE -DPOSIX_SOURCE 50 | -DRHAPSODY 51 | 52 | RANLIB = ranlib 53 | MKSHLIB = libtool -dynamic $(XMKSHLIBOPTS) -framework System 54 | 55 | #.c.o: 56 | # $(CC) -c -MD $*.d $(CFLAGS) $< 57 | 58 | CPU_ARCH = $(shell uname -m) 59 | ifeq (86,$(findstring 86,$(CPU_ARCH))) 60 | CPU_ARCH = x86 61 | OS_CFLAGS+= -DX86_LINUX 62 | endif 63 | GFX_ARCH = x 64 | 65 | OS_LIBS = -lc -framework System 66 | 67 | ASFLAGS += -x assembler-with-cpp 68 | 69 | ifeq ($(CPU_ARCH),alpha) 70 | 71 | # Ask the C compiler on alpha linux to let us work with denormalized 72 | # double values, which are required by the ECMA spec. 73 | 74 | OS_CFLAGS += -mieee 75 | endif 76 | 77 | # Use the editline library to provide line-editing support. 78 | JS_EDITLINE = 1 79 | 80 | # Don't allow Makefile.ref to use libmath 81 | NO_LIBM = 1 82 | 83 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/config/OSF1V4.0.mk: -------------------------------------------------------------------------------- 1 | # -*- Mode: makefile -*- 2 | # 3 | # ***** BEGIN LICENSE BLOCK ***** 4 | # Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | # 6 | # The contents of this file are subject to the Mozilla Public License Version 7 | # 1.1 (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # http://www.mozilla.org/MPL/ 10 | # 11 | # Software distributed under the License is distributed on an "AS IS" basis, 12 | # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | # for the specific language governing rights and limitations under the 14 | # License. 15 | # 16 | # The Original Code is Mozilla Communicator client code, released 17 | # March 31, 1998. 18 | # 19 | # The Initial Developer of the Original Code is 20 | # Netscape Communications Corporation. 21 | # Portions created by the Initial Developer are Copyright (C) 1998 22 | # the Initial Developer. All Rights Reserved. 23 | # 24 | # Contributor(s): 25 | # 26 | # Alternatively, the contents of this file may be used under the terms of 27 | # either the GNU General Public License Version 2 or later (the "GPL"), or 28 | # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 29 | # in which case the provisions of the GPL or the LGPL are applicable instead 30 | # of those above. If you wish to allow use of your version of this file only 31 | # under the terms of either the GPL or the LGPL, and not to allow others to 32 | # use your version of this file under the terms of the MPL, indicate your 33 | # decision by deleting the provisions above and replace them with the notice 34 | # and other provisions required by the GPL or the LGPL. If you do not delete 35 | # the provisions above, a recipient may use your version of this file under 36 | # the terms of any one of the MPL, the GPL or the LGPL. 37 | # 38 | # ***** END LICENSE BLOCK ***** 39 | 40 | # 41 | # Config stuff for Data General DG/UX 42 | # 43 | 44 | # 45 | # Initial DG/UX port by Marc Fraioli (fraioli@dg-rtp.dg.com) 46 | # 47 | 48 | ifndef NS_USE_NATIVE 49 | CC = gcc 50 | CCC = g++ 51 | CFLAGS += -mieee -Wall -Wno-format 52 | else 53 | CC = cc 54 | CCC = cxx 55 | CFLAGS += -ieee -std 56 | # LD = cxx 57 | endif 58 | 59 | RANLIB = echo 60 | MKSHLIB = $(LD) -shared -taso -all -expect_unresolved "*" 61 | 62 | # 63 | # _DGUX_SOURCE is needed to turn on a lot of stuff in the headers if 64 | # you're not using DG's compiler. It shouldn't hurt if you are. 65 | # 66 | # _POSIX4A_DRAFT10_SOURCE is needed to pick up localtime_r, used in 67 | # prtime.c 68 | # 69 | OS_CFLAGS = -DXP_UNIX -DSVR4 -DSYSV -DDGUX -D_DGUX_SOURCE -D_POSIX4A_DRAFT10_SOURCE -DOSF1 -DHAVE_LOCALTIME_R 70 | OS_LIBS = -lsocket -lnsl 71 | 72 | NOSUCHFILE = /no-such-file 73 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/config/OSF1V5.0.mk: -------------------------------------------------------------------------------- 1 | # -*- Mode: makefile -*- 2 | # 3 | # ***** BEGIN LICENSE BLOCK ***** 4 | # Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | # 6 | # The contents of this file are subject to the Mozilla Public License Version 7 | # 1.1 (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # http://www.mozilla.org/MPL/ 10 | # 11 | # Software distributed under the License is distributed on an "AS IS" basis, 12 | # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | # for the specific language governing rights and limitations under the 14 | # License. 15 | # 16 | # The Original Code is Mozilla Communicator client code, released 17 | # March 31, 1998. 18 | # 19 | # The Initial Developer of the Original Code is 20 | # Netscape Communications Corporation. 21 | # Portions created by the Initial Developer are Copyright (C) 1998 22 | # the Initial Developer. All Rights Reserved. 23 | # 24 | # Contributor(s): 25 | # 26 | # Alternatively, the contents of this file may be used under the terms of 27 | # either the GNU General Public License Version 2 or later (the "GPL"), or 28 | # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 29 | # in which case the provisions of the GPL or the LGPL are applicable instead 30 | # of those above. If you wish to allow use of your version of this file only 31 | # under the terms of either the GPL or the LGPL, and not to allow others to 32 | # use your version of this file under the terms of the MPL, indicate your 33 | # decision by deleting the provisions above and replace them with the notice 34 | # and other provisions required by the GPL or the LGPL. If you do not delete 35 | # the provisions above, a recipient may use your version of this file under 36 | # the terms of any one of the MPL, the GPL or the LGPL. 37 | # 38 | # ***** END LICENSE BLOCK ***** 39 | 40 | # 41 | # Config stuff for Tru64 Unix 5.0 42 | # 43 | 44 | # 45 | # Initial DG/UX port by Marc Fraioli (fraioli@dg-rtp.dg.com) 46 | # 47 | 48 | ifndef NS_USE_NATIVE 49 | CC = gcc 50 | CCC = g++ 51 | CFLAGS += -mieee -Wall -Wno-format 52 | else 53 | CC = cc 54 | CCC = cxx 55 | CFLAGS += -ieee -std -pthread 56 | # LD = cxx 57 | endif 58 | 59 | RANLIB = echo 60 | MKSHLIB = $(LD) -shared -all -expect_unresolved "*" 61 | 62 | # 63 | # _POSIX4A_DRAFT10_SOURCE is needed to pick up localtime_r, used in 64 | # prtime.c 65 | # 66 | OS_CFLAGS = -DXP_UNIX -DSVR4 -DSYSV -D_POSIX4A_DRAFT10_SOURCE -DOSF1 -DHAVE_LOCALTIME_R 67 | OS_LIBS = -lsocket -lnsl 68 | 69 | NOSUCHFILE = /no-such-file 70 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/config/SunOS4.1.4.mk: -------------------------------------------------------------------------------- 1 | # -*- Mode: makefile -*- 2 | # 3 | # ***** BEGIN LICENSE BLOCK ***** 4 | # Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | # 6 | # The contents of this file are subject to the Mozilla Public License Version 7 | # 1.1 (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # http://www.mozilla.org/MPL/ 10 | # 11 | # Software distributed under the License is distributed on an "AS IS" basis, 12 | # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | # for the specific language governing rights and limitations under the 14 | # License. 15 | # 16 | # The Original Code is Mozilla Communicator client code, released 17 | # March 31, 1998. 18 | # 19 | # The Initial Developer of the Original Code is 20 | # Netscape Communications Corporation. 21 | # Portions created by the Initial Developer are Copyright (C) 1998 22 | # the Initial Developer. All Rights Reserved. 23 | # 24 | # Contributor(s): 25 | # 26 | # Alternatively, the contents of this file may be used under the terms of 27 | # either the GNU General Public License Version 2 or later (the "GPL"), or 28 | # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 29 | # in which case the provisions of the GPL or the LGPL are applicable instead 30 | # of those above. If you wish to allow use of your version of this file only 31 | # under the terms of either the GPL or the LGPL, and not to allow others to 32 | # use your version of this file under the terms of the MPL, indicate your 33 | # decision by deleting the provisions above and replace them with the notice 34 | # and other provisions required by the GPL or the LGPL. If you do not delete 35 | # the provisions above, a recipient may use your version of this file under 36 | # the terms of any one of the MPL, the GPL or the LGPL. 37 | # 38 | # ***** END LICENSE BLOCK ***** 39 | 40 | # 41 | # Config stuff for SunOS4.1 42 | # 43 | 44 | CC = gcc 45 | CCC = g++ 46 | RANLIB = ranlib 47 | 48 | #.c.o: 49 | # $(CC) -c -MD $*.d $(CFLAGS) $< 50 | 51 | CPU_ARCH = sparc 52 | GFX_ARCH = x 53 | 54 | # A pile of -D's to build xfe on sunos 55 | MOZ_CFLAGS = -DSTRINGS_ALIGNED -DNO_REGEX -DNO_ISDIR -DUSE_RE_COMP \ 56 | -DNO_REGCOMP -DUSE_GETWD -DNO_MEMMOVE -DNO_ALLOCA \ 57 | -DBOGUS_MB_MAX -DNO_CONST 58 | 59 | # Purify doesn't like -MDupdate 60 | NOMD_OS_CFLAGS = -DXP_UNIX -Wall -Wno-format -DSW_THREADS -DSUNOS4 -DNEED_SYSCALL \ 61 | $(MOZ_CFLAGS) 62 | 63 | OS_CFLAGS = $(NOMD_OS_CFLAGS) -MDupdate $(DEPENDENCIES) 64 | OS_LIBS = -ldl -lm 65 | 66 | MKSHLIB = $(LD) -L$(MOTIF)/lib 67 | 68 | HAVE_PURIFY = 1 69 | MOTIF = /home/motif/usr 70 | MOTIFLIB = -L$(MOTIF)/lib -lXm 71 | INCLUDES += -I/usr/X11R5/include -I$(MOTIF)/include 72 | 73 | NOSUCHFILE = /solaris-rm-f-sucks 74 | 75 | LOCALE_MAP = $(DEPTH)/cmd/xfe/intl/sunos.lm 76 | 77 | EN_LOCALE = en_US 78 | DE_LOCALE = de 79 | FR_LOCALE = fr 80 | JP_LOCALE = ja 81 | SJIS_LOCALE = ja_JP.SJIS 82 | KR_LOCALE = ko 83 | CN_LOCALE = zh 84 | TW_LOCALE = zh_TW 85 | I2_LOCALE = i2 86 | IT_LOCALE = it 87 | SV_LOCALE = sv 88 | ES_LOCALE = es 89 | NL_LOCALE = nl 90 | PT_LOCALE = pt 91 | 92 | LOC_LIB_DIR = /usr/openwin/lib/locale 93 | 94 | BSDECHO = echo 95 | 96 | # 97 | # These defines are for building unix plugins 98 | # 99 | BUILD_UNIX_PLUGINS = 1 100 | DSO_LDOPTS = 101 | DSO_LDFLAGS = 102 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/config/SunOS5.3.mk: -------------------------------------------------------------------------------- 1 | # -*- Mode: makefile -*- 2 | # 3 | # ***** BEGIN LICENSE BLOCK ***** 4 | # Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | # 6 | # The contents of this file are subject to the Mozilla Public License Version 7 | # 1.1 (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # http://www.mozilla.org/MPL/ 10 | # 11 | # Software distributed under the License is distributed on an "AS IS" basis, 12 | # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | # for the specific language governing rights and limitations under the 14 | # License. 15 | # 16 | # The Original Code is Mozilla Communicator client code, released 17 | # March 31, 1998. 18 | # 19 | # The Initial Developer of the Original Code is 20 | # Netscape Communications Corporation. 21 | # Portions created by the Initial Developer are Copyright (C) 1998 22 | # the Initial Developer. All Rights Reserved. 23 | # 24 | # Contributor(s): 25 | # 26 | # Alternatively, the contents of this file may be used under the terms of 27 | # either the GNU General Public License Version 2 or later (the "GPL"), or 28 | # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 29 | # in which case the provisions of the GPL or the LGPL are applicable instead 30 | # of those above. If you wish to allow use of your version of this file only 31 | # under the terms of either the GPL or the LGPL, and not to allow others to 32 | # use your version of this file under the terms of the MPL, indicate your 33 | # decision by deleting the provisions above and replace them with the notice 34 | # and other provisions required by the GPL or the LGPL. If you do not delete 35 | # the provisions above, a recipient may use your version of this file under 36 | # the terms of any one of the MPL, the GPL or the LGPL. 37 | # 38 | # ***** END LICENSE BLOCK ***** 39 | 40 | # 41 | # Config stuff for SunOS5.3 42 | # 43 | 44 | CC = gcc 45 | CCC = g++ 46 | CFLAGS += -Wall -Wno-format 47 | 48 | #CC = /opt/SUNWspro/SC3.0.1/bin/cc 49 | RANLIB = echo 50 | 51 | #.c.o: 52 | # $(CC) -c -MD $*.d $(CFLAGS) $< 53 | 54 | CPU_ARCH = sparc 55 | GFX_ARCH = x 56 | 57 | OS_CFLAGS = -DXP_UNIX -DSVR4 -DSYSV -DSOLARIS -DHAVE_LOCALTIME_R 58 | OS_LIBS = -lsocket -lnsl -ldl 59 | 60 | ASFLAGS += -P -L -K PIC -D_ASM -D__STDC__=0 61 | 62 | HAVE_PURIFY = 1 63 | 64 | NOSUCHFILE = /solaris-rm-f-sucks 65 | 66 | ifndef JS_NO_ULTRA 67 | ULTRA_OPTIONS := -xarch=v8plus 68 | ULTRA_OPTIONSD := -DULTRA_SPARC 69 | else 70 | ULTRA_OPTIONS := -xarch=v8 71 | ULTRA_OPTIONSD := 72 | endif 73 | 74 | ifeq ($(OS_CPUARCH),sun4u) 75 | DEFINES += $(ULTRA_OPTIONSD) 76 | ifeq ($(findstring gcc,$(CC)),gcc) 77 | DEFINES += -Wa,$(ULTRA_OPTIONS),$(ULTRA_OPTIONSD) 78 | else 79 | ASFLAGS += $(ULTRA_OPTIONS) $(ULTRA_OPTIONSD) 80 | endif 81 | endif 82 | 83 | ifeq ($(OS_CPUARCH),sun4m) 84 | ifeq ($(findstring gcc,$(CC)),gcc) 85 | DEFINES += -Wa,-xarch=v8 86 | else 87 | ASFLAGS += -xarch=v8 88 | endif 89 | endif 90 | 91 | MKSHLIB = $(LD) -G 92 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/config/SunOS5.4.mk: -------------------------------------------------------------------------------- 1 | # -*- Mode: makefile -*- 2 | # 3 | # ***** BEGIN LICENSE BLOCK ***** 4 | # Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | # 6 | # The contents of this file are subject to the Mozilla Public License Version 7 | # 1.1 (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # http://www.mozilla.org/MPL/ 10 | # 11 | # Software distributed under the License is distributed on an "AS IS" basis, 12 | # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | # for the specific language governing rights and limitations under the 14 | # License. 15 | # 16 | # The Original Code is Mozilla Communicator client code, released 17 | # March 31, 1998. 18 | # 19 | # The Initial Developer of the Original Code is 20 | # Netscape Communications Corporation. 21 | # Portions created by the Initial Developer are Copyright (C) 1998 22 | # the Initial Developer. All Rights Reserved. 23 | # 24 | # Contributor(s): 25 | # 26 | # Alternatively, the contents of this file may be used under the terms of 27 | # either the GNU General Public License Version 2 or later (the "GPL"), or 28 | # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 29 | # in which case the provisions of the GPL or the LGPL are applicable instead 30 | # of those above. If you wish to allow use of your version of this file only 31 | # under the terms of either the GPL or the LGPL, and not to allow others to 32 | # use your version of this file under the terms of the MPL, indicate your 33 | # decision by deleting the provisions above and replace them with the notice 34 | # and other provisions required by the GPL or the LGPL. If you do not delete 35 | # the provisions above, a recipient may use your version of this file under 36 | # the terms of any one of the MPL, the GPL or the LGPL. 37 | # 38 | # ***** END LICENSE BLOCK ***** 39 | 40 | # 41 | # Config stuff for SunOS5.4 42 | # 43 | 44 | ifdef NS_USE_NATIVE 45 | CC = cc 46 | CCC = CC 47 | else 48 | CC = gcc 49 | CCC = g++ 50 | CFLAGS += -Wall -Wno-format 51 | endif 52 | 53 | RANLIB = echo 54 | 55 | CPU_ARCH = sparc 56 | GFX_ARCH = x 57 | 58 | OS_CFLAGS = -DXP_UNIX -DSVR4 -DSYSV -D__svr4 -DSOLARIS -DHAVE_LOCALTIME_R 59 | OS_LIBS = -lsocket -lnsl -ldl 60 | 61 | ASFLAGS += -P -L -K PIC -D_ASM -D__STDC__=0 62 | 63 | HAVE_PURIFY = 1 64 | 65 | NOSUCHFILE = /solaris-rm-f-sucks 66 | 67 | ifndef JS_NO_ULTRA 68 | ULTRA_OPTIONS := -xarch=v8plus 69 | ULTRA_OPTIONSD := -DULTRA_SPARC 70 | else 71 | ULTRA_OPTIONS := -xarch=v8 72 | ULTRA_OPTIONSD := 73 | endif 74 | 75 | ifeq ($(OS_CPUARCH),sun4u) 76 | DEFINES += $(ULTRA_OPTIONSD) 77 | ifeq ($(findstring gcc,$(CC)),gcc) 78 | DEFINES += -Wa,$(ULTRA_OPTIONS),$(ULTRA_OPTIONSD) 79 | else 80 | ASFLAGS += $(ULTRA_OPTIONS) $(ULTRA_OPTIONSD) 81 | endif 82 | endif 83 | 84 | ifeq ($(OS_CPUARCH),sun4m) 85 | ifeq ($(findstring gcc,$(CC)),gcc) 86 | DEFINES += -Wa,-xarch=v8 87 | else 88 | ASFLAGS += -xarch=v8 89 | endif 90 | endif 91 | 92 | MKSHLIB = $(LD) -G 93 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/config/SunOS5.5.1.mk: -------------------------------------------------------------------------------- 1 | # -*- Mode: makefile -*- 2 | # 3 | # ***** BEGIN LICENSE BLOCK ***** 4 | # Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | # 6 | # The contents of this file are subject to the Mozilla Public License Version 7 | # 1.1 (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # http://www.mozilla.org/MPL/ 10 | # 11 | # Software distributed under the License is distributed on an "AS IS" basis, 12 | # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | # for the specific language governing rights and limitations under the 14 | # License. 15 | # 16 | # The Original Code is Mozilla Communicator client code, released 17 | # March 31, 1998. 18 | # 19 | # The Initial Developer of the Original Code is 20 | # Netscape Communications Corporation. 21 | # Portions created by the Initial Developer are Copyright (C) 1998 22 | # the Initial Developer. All Rights Reserved. 23 | # 24 | # Contributor(s): 25 | # 26 | # Alternatively, the contents of this file may be used under the terms of 27 | # either the GNU General Public License Version 2 or later (the "GPL"), or 28 | # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 29 | # in which case the provisions of the GPL or the LGPL are applicable instead 30 | # of those above. If you wish to allow use of your version of this file only 31 | # under the terms of either the GPL or the LGPL, and not to allow others to 32 | # use your version of this file under the terms of the MPL, indicate your 33 | # decision by deleting the provisions above and replace them with the notice 34 | # and other provisions required by the GPL or the LGPL. If you do not delete 35 | # the provisions above, a recipient may use your version of this file under 36 | # the terms of any one of the MPL, the GPL or the LGPL. 37 | # 38 | # ***** END LICENSE BLOCK ***** 39 | 40 | # 41 | # Config stuff for SunOS5.5.1 42 | # 43 | 44 | include $(DEPTH)/config/SunOS5.5.mk 45 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/config/SunOS5.5.mk: -------------------------------------------------------------------------------- 1 | # -*- Mode: makefile -*- 2 | # 3 | # ***** BEGIN LICENSE BLOCK ***** 4 | # Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | # 6 | # The contents of this file are subject to the Mozilla Public License Version 7 | # 1.1 (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # http://www.mozilla.org/MPL/ 10 | # 11 | # Software distributed under the License is distributed on an "AS IS" basis, 12 | # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | # for the specific language governing rights and limitations under the 14 | # License. 15 | # 16 | # The Original Code is Mozilla Communicator client code, released 17 | # March 31, 1998. 18 | # 19 | # The Initial Developer of the Original Code is 20 | # Netscape Communications Corporation. 21 | # Portions created by the Initial Developer are Copyright (C) 1998 22 | # the Initial Developer. All Rights Reserved. 23 | # 24 | # Contributor(s): 25 | # 26 | # Alternatively, the contents of this file may be used under the terms of 27 | # either the GNU General Public License Version 2 or later (the "GPL"), or 28 | # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 29 | # in which case the provisions of the GPL or the LGPL are applicable instead 30 | # of those above. If you wish to allow use of your version of this file only 31 | # under the terms of either the GPL or the LGPL, and not to allow others to 32 | # use your version of this file under the terms of the MPL, indicate your 33 | # decision by deleting the provisions above and replace them with the notice 34 | # and other provisions required by the GPL or the LGPL. If you do not delete 35 | # the provisions above, a recipient may use your version of this file under 36 | # the terms of any one of the MPL, the GPL or the LGPL. 37 | # 38 | # ***** END LICENSE BLOCK ***** 39 | 40 | # 41 | # Config stuff for SunOS5.5 42 | # 43 | 44 | AS = /usr/ccs/bin/as 45 | ifndef NS_USE_NATIVE 46 | CC = gcc 47 | CCC = g++ 48 | CFLAGS += -Wall -Wno-format 49 | else 50 | CC = cc 51 | CCC = CC 52 | endif 53 | 54 | RANLIB = echo 55 | 56 | #.c.o: 57 | # $(CC) -c -MD $*.d $(CFLAGS) $< 58 | 59 | CPU_ARCH = sparc 60 | GFX_ARCH = x 61 | 62 | OS_CFLAGS = -DXP_UNIX -DSVR4 -DSYSV -DSOLARIS -DHAVE_LOCALTIME_R 63 | OS_LIBS = -lsocket -lnsl -ldl 64 | 65 | ASFLAGS += -P -L -K PIC -D_ASM -D__STDC__=0 66 | 67 | HAVE_PURIFY = 1 68 | 69 | NOSUCHFILE = /solaris-rm-f-sucks 70 | 71 | ifeq ($(OS_CPUARCH),sun4u) # ultra sparc? 72 | ifeq ($(CC),gcc) # using gcc? 73 | ifndef JS_NO_ULTRA # do we want ultra? 74 | ifdef JS_THREADSAFE # only in thread-safe mode 75 | DEFINES += -DULTRA_SPARC 76 | DEFINES += -Wa,-xarch=v8plus,-DULTRA_SPARC 77 | else 78 | ASFLAGS += -xarch=v8plus -DULTRA_SPARC 79 | endif 80 | endif 81 | endif 82 | endif 83 | 84 | MKSHLIB = $(LD) -G 85 | 86 | # Use the editline library to provide line-editing support. 87 | JS_EDITLINE = 1 88 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/config/SunOS5.6.mk: -------------------------------------------------------------------------------- 1 | # -*- Mode: makefile -*- 2 | # 3 | # ***** BEGIN LICENSE BLOCK ***** 4 | # Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | # 6 | # The contents of this file are subject to the Mozilla Public License Version 7 | # 1.1 (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # http://www.mozilla.org/MPL/ 10 | # 11 | # Software distributed under the License is distributed on an "AS IS" basis, 12 | # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | # for the specific language governing rights and limitations under the 14 | # License. 15 | # 16 | # The Original Code is Mozilla Communicator client code, released 17 | # March 31, 1998. 18 | # 19 | # The Initial Developer of the Original Code is 20 | # Netscape Communications Corporation. 21 | # Portions created by the Initial Developer are Copyright (C) 1998 22 | # the Initial Developer. All Rights Reserved. 23 | # 24 | # Contributor(s): 25 | # 26 | # Alternatively, the contents of this file may be used under the terms of 27 | # either the GNU General Public License Version 2 or later (the "GPL"), or 28 | # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 29 | # in which case the provisions of the GPL or the LGPL are applicable instead 30 | # of those above. If you wish to allow use of your version of this file only 31 | # under the terms of either the GPL or the LGPL, and not to allow others to 32 | # use your version of this file under the terms of the MPL, indicate your 33 | # decision by deleting the provisions above and replace them with the notice 34 | # and other provisions required by the GPL or the LGPL. If you do not delete 35 | # the provisions above, a recipient may use your version of this file under 36 | # the terms of any one of the MPL, the GPL or the LGPL. 37 | # 38 | # ***** END LICENSE BLOCK ***** 39 | 40 | # 41 | # Config stuff for SunOS5.5 42 | # 43 | 44 | AS = /usr/ccs/bin/as 45 | ifndef NS_USE_NATIVE 46 | CC = gcc 47 | CCC = g++ 48 | CFLAGS += -Wall -Wno-format 49 | else 50 | CC = cc 51 | CCC = CC 52 | CFLAGS += -mt -KPIC 53 | # LD = CC 54 | endif 55 | 56 | RANLIB = echo 57 | 58 | #.c.o: 59 | # $(CC) -c -MD $*.d $(CFLAGS) $< 60 | 61 | CPU_ARCH = sparc 62 | GFX_ARCH = x 63 | 64 | OS_CFLAGS = -DXP_UNIX -DSVR4 -DSYSV -DSOLARIS -DHAVE_LOCALTIME_R 65 | OS_LIBS = -lsocket -lnsl -ldl 66 | 67 | ASFLAGS += -P -L -K PIC -D_ASM -D__STDC__=0 68 | 69 | HAVE_PURIFY = 1 70 | 71 | NOSUCHFILE = /solaris-rm-f-sucks 72 | 73 | ifeq ($(OS_CPUARCH),sun4u) # ultra sparc? 74 | ifeq ($(CC),gcc) # using gcc? 75 | ifndef JS_NO_ULTRA # do we want ultra? 76 | ifdef JS_THREADSAFE # only in thread-safe mode 77 | DEFINES += -DULTRA_SPARC 78 | DEFINES += -Wa,-xarch=v8plus,-DULTRA_SPARC 79 | else 80 | ASFLAGS += -xarch=v8plus -DULTRA_SPARC 81 | endif 82 | endif 83 | endif 84 | endif 85 | 86 | MKSHLIB = $(LD) -G 87 | 88 | # Use the editline library to provide line-editing support. 89 | JS_EDITLINE = 1 90 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/config/SunOS5.7.mk: -------------------------------------------------------------------------------- 1 | # -*- Mode: makefile -*- 2 | # 3 | # ***** BEGIN LICENSE BLOCK ***** 4 | # Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | # 6 | # The contents of this file are subject to the Mozilla Public License Version 7 | # 1.1 (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # http://www.mozilla.org/MPL/ 10 | # 11 | # Software distributed under the License is distributed on an "AS IS" basis, 12 | # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | # for the specific language governing rights and limitations under the 14 | # License. 15 | # 16 | # The Original Code is Mozilla Communicator client code, released 17 | # March 31, 1998. 18 | # 19 | # The Initial Developer of the Original Code is 20 | # Netscape Communications Corporation. 21 | # Portions created by the Initial Developer are Copyright (C) 1999 22 | # the Initial Developer. All Rights Reserved. 23 | # 24 | # Contributor(s): 25 | # 26 | # Alternatively, the contents of this file may be used under the terms of 27 | # either the GNU General Public License Version 2 or later (the "GPL"), or 28 | # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 29 | # in which case the provisions of the GPL or the LGPL are applicable instead 30 | # of those above. If you wish to allow use of your version of this file only 31 | # under the terms of either the GPL or the LGPL, and not to allow others to 32 | # use your version of this file under the terms of the MPL, indicate your 33 | # decision by deleting the provisions above and replace them with the notice 34 | # and other provisions required by the GPL or the LGPL. If you do not delete 35 | # the provisions above, a recipient may use your version of this file under 36 | # the terms of any one of the MPL, the GPL or the LGPL. 37 | # 38 | # ***** END LICENSE BLOCK ***** 39 | 40 | # 41 | # Config stuff for SunOS5.7 42 | # 43 | 44 | include $(DEPTH)/config/SunOS5.5.mk 45 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/config/SunOS5.8.mk: -------------------------------------------------------------------------------- 1 | # -*- Mode: makefile -*- 2 | # 3 | # ***** BEGIN LICENSE BLOCK ***** 4 | # Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | # 6 | # The contents of this file are subject to the Mozilla Public License Version 7 | # 1.1 (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # http://www.mozilla.org/MPL/ 10 | # 11 | # Software distributed under the License is distributed on an "AS IS" basis, 12 | # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | # for the specific language governing rights and limitations under the 14 | # License. 15 | # 16 | # The Original Code is Mozilla Communicator client code, released 17 | # March 31, 1998. 18 | # 19 | # The Initial Developer of the Original Code is 20 | # Netscape Communications Corporation. 21 | # Portions created by the Initial Developer are Copyright (C) 1999 22 | # the Initial Developer. All Rights Reserved. 23 | # 24 | # Contributor(s): 25 | # 26 | # Alternatively, the contents of this file may be used under the terms of 27 | # either the GNU General Public License Version 2 or later (the "GPL"), or 28 | # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 29 | # in which case the provisions of the GPL or the LGPL are applicable instead 30 | # of those above. If you wish to allow use of your version of this file only 31 | # under the terms of either the GPL or the LGPL, and not to allow others to 32 | # use your version of this file under the terms of the MPL, indicate your 33 | # decision by deleting the provisions above and replace them with the notice 34 | # and other provisions required by the GPL or the LGPL. If you do not delete 35 | # the provisions above, a recipient may use your version of this file under 36 | # the terms of any one of the MPL, the GPL or the LGPL. 37 | # 38 | # ***** END LICENSE BLOCK ***** 39 | 40 | # 41 | # Config stuff for SunOS5.8 42 | # 43 | 44 | include $(DEPTH)/config/SunOS5.5.mk 45 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/config/SunOS5.9.mk: -------------------------------------------------------------------------------- 1 | # -*- Mode: makefile -*- 2 | # 3 | # ***** BEGIN LICENSE BLOCK ***** 4 | # Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | # 6 | # The contents of this file are subject to the Mozilla Public License Version 7 | # 1.1 (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # http://www.mozilla.org/MPL/ 10 | # 11 | # Software distributed under the License is distributed on an "AS IS" basis, 12 | # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | # for the specific language governing rights and limitations under the 14 | # License. 15 | # 16 | # The Original Code is Mozilla Communicator client code, released 17 | # March 31, 1998. 18 | # 19 | # The Initial Developer of the Original Code is 20 | # Netscape Communications Corporation. 21 | # Portions created by the Initial Developer are Copyright (C) 1999 22 | # the Initial Developer. All Rights Reserved. 23 | # 24 | # Contributor(s): 25 | # 26 | # Alternatively, the contents of this file may be used under the terms of 27 | # either the GNU General Public License Version 2 or later (the "GPL"), or 28 | # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 29 | # in which case the provisions of the GPL or the LGPL are applicable instead 30 | # of those above. If you wish to allow use of your version of this file only 31 | # under the terms of either the GPL or the LGPL, and not to allow others to 32 | # use your version of this file under the terms of the MPL, indicate your 33 | # decision by deleting the provisions above and replace them with the notice 34 | # and other provisions required by the GPL or the LGPL. If you do not delete 35 | # the provisions above, a recipient may use your version of this file under 36 | # the terms of any one of the MPL, the GPL or the LGPL. 37 | # 38 | # ***** END LICENSE BLOCK ***** 39 | 40 | # 41 | # Config stuff for SunOS5.9 42 | # 43 | 44 | include $(DEPTH)/config/SunOS5.5.mk 45 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/config/WINNT4.0.mk: -------------------------------------------------------------------------------- 1 | # -*- Mode: makefile -*- 2 | # 3 | # ***** BEGIN LICENSE BLOCK ***** 4 | # Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | # 6 | # The contents of this file are subject to the Mozilla Public License Version 7 | # 1.1 (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # http://www.mozilla.org/MPL/ 10 | # 11 | # Software distributed under the License is distributed on an "AS IS" basis, 12 | # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | # for the specific language governing rights and limitations under the 14 | # License. 15 | # 16 | # The Original Code is Mozilla Communicator client code, released 17 | # March 31, 1998. 18 | # 19 | # The Initial Developer of the Original Code is 20 | # Netscape Communications Corporation. 21 | # Portions created by the Initial Developer are Copyright (C) 1998 22 | # the Initial Developer. All Rights Reserved. 23 | # 24 | # Contributor(s): 25 | # 26 | # Alternatively, the contents of this file may be used under the terms of 27 | # either the GNU General Public License Version 2 or later (the "GPL"), or 28 | # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 29 | # in which case the provisions of the GPL or the LGPL are applicable instead 30 | # of those above. If you wish to allow use of your version of this file only 31 | # under the terms of either the GPL or the LGPL, and not to allow others to 32 | # use your version of this file under the terms of the MPL, indicate your 33 | # decision by deleting the provisions above and replace them with the notice 34 | # and other provisions required by the GPL or the LGPL. If you do not delete 35 | # the provisions above, a recipient may use your version of this file under 36 | # the terms of any one of the MPL, the GPL or the LGPL. 37 | # 38 | # ***** END LICENSE BLOCK ***** 39 | 40 | # 41 | # Config for Windows NT using MS Visual C++ (version?) 42 | # 43 | 44 | CC = cl 45 | 46 | RANLIB = echo 47 | 48 | PDBFILE = $(basename $(@F)).pdb 49 | 50 | #.c.o: 51 | # $(CC) -c -MD $*.d $(CFLAGS) $< 52 | 53 | CPU_ARCH = x86 # XXX fixme 54 | GFX_ARCH = win32 55 | 56 | # MSVC compiler options for both debug/optimize 57 | # -nologo - suppress copyright message 58 | # -W3 - Warning level 3 59 | # -Gm - enable minimal rebuild 60 | # -Z7 - put debug info into the executable, not in .pdb file 61 | # -Zi - put debug info into .pdb file 62 | # -YX - automatic precompiled headers 63 | # -GX - enable C++ exception support 64 | WIN_CFLAGS = -nologo -W3 65 | 66 | # MSVC compiler options for debug builds linked to MSVCRTD.DLL 67 | # -MDd - link with MSVCRTD.LIB (Dynamically-linked, multi-threaded, debug C-runtime) 68 | # -Od - minimal optimization 69 | WIN_IDG_CFLAGS = -MDd -Od -Z7 70 | 71 | # MSVC compiler options for debug builds linked to MSVCRT.DLL 72 | # -MD - link with MSVCRT.LIB (Dynamically-linked, multi-threaded, debug C-runtime) 73 | # -Od - minimal optimization 74 | WIN_DEBUG_CFLAGS = -MD -Od -Zi -Fd$(OBJDIR)/$(PDBFILE) 75 | 76 | # MSVC compiler options for release (optimized) builds 77 | # -MD - link with MSVCRT.LIB (Dynamically-linked, multi-threaded, C-runtime) 78 | # -O2 - Optimize for speed 79 | # -G5 - Optimize for Pentium 80 | WIN_OPT_CFLAGS = -MD -O2 81 | 82 | ifdef BUILD_OPT 83 | OPTIMIZER = $(WIN_OPT_CFLAGS) 84 | else 85 | ifdef BUILD_IDG 86 | OPTIMIZER = $(WIN_IDG_CFLAGS) 87 | else 88 | OPTIMIZER = $(WIN_DEBUG_CFLAGS) 89 | endif 90 | endif 91 | 92 | OS_CFLAGS = -D_X86_=1 -DXP_WIN -DXP_WIN32 -DWIN32 -D_WINDOWS -D_WIN32 $(WIN_CFLAGS) 93 | JSDLL_CFLAGS = -DEXPORT_JS_API 94 | OS_LIBS = -lm -lc 95 | 96 | PREBUILT_CPUCFG = 1 97 | USE_MSVC = 1 98 | 99 | LIB_LINK_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\ 100 | advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib oldnames.lib \ 101 | winmm.lib \ 102 | -nologo\ 103 | -subsystem:windows -dll -debug -pdb:$(OBJDIR)/$(PDBFILE)\ 104 | -machine:I386\ 105 | -opt:ref -opt:noicf 106 | 107 | EXE_LINK_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\ 108 | advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib oldnames.lib -nologo\ 109 | -subsystem:console -debug -pdb:$(OBJDIR)/$(PDBFILE)\ 110 | -machine:I386\ 111 | -opt:ref -opt:noicf 112 | 113 | # CAFEDIR = t:/cafe 114 | # JCLASSPATH = $(CAFEDIR)/Java/Lib/classes.zip 115 | # JAVAC = $(CAFEDIR)/Bin/sj.exe 116 | # JAVAH = $(CAFEDIR)/Java/Bin/javah.exe 117 | # JCFLAGS = -I$(CAFEDIR)/Java/Include -I$(CAFEDIR)/Java/Include/win32 118 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/config/WINNT5.0.mk: -------------------------------------------------------------------------------- 1 | # -*- Mode: makefile -*- 2 | # 3 | # ***** BEGIN LICENSE BLOCK ***** 4 | # Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | # 6 | # The contents of this file are subject to the Mozilla Public License Version 7 | # 1.1 (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # http://www.mozilla.org/MPL/ 10 | # 11 | # Software distributed under the License is distributed on an "AS IS" basis, 12 | # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | # for the specific language governing rights and limitations under the 14 | # License. 15 | # 16 | # The Original Code is Mozilla Communicator client code, released 17 | # March 31, 1998. 18 | # 19 | # The Initial Developer of the Original Code is 20 | # Netscape Communications Corporation. 21 | # Portions created by the Initial Developer are Copyright (C) 1998 22 | # the Initial Developer. All Rights Reserved. 23 | # 24 | # Contributor(s): 25 | # 26 | # Alternatively, the contents of this file may be used under the terms of 27 | # either the GNU General Public License Version 2 or later (the "GPL"), or 28 | # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 29 | # in which case the provisions of the GPL or the LGPL are applicable instead 30 | # of those above. If you wish to allow use of your version of this file only 31 | # under the terms of either the GPL or the LGPL, and not to allow others to 32 | # use your version of this file under the terms of the MPL, indicate your 33 | # decision by deleting the provisions above and replace them with the notice 34 | # and other provisions required by the GPL or the LGPL. If you do not delete 35 | # the provisions above, a recipient may use your version of this file under 36 | # the terms of any one of the MPL, the GPL or the LGPL. 37 | # 38 | # ***** END LICENSE BLOCK ***** 39 | 40 | # 41 | # Config for Windows NT using MS Visual C++ (version?) 42 | # 43 | 44 | CC = cl 45 | 46 | RANLIB = echo 47 | 48 | PDBFILE = $(basename $(@F)).pdb 49 | 50 | #.c.o: 51 | # $(CC) -c -MD $*.d $(CFLAGS) $< 52 | 53 | CPU_ARCH = x86 # XXX fixme 54 | GFX_ARCH = win32 55 | 56 | # MSVC compiler options for both debug/optimize 57 | # -nologo - suppress copyright message 58 | # -W3 - Warning level 3 59 | # -Gm - enable minimal rebuild 60 | # -Z7 - put debug info into the executable, not in .pdb file 61 | # -Zi - put debug info into .pdb file 62 | # -YX - automatic precompiled headers 63 | # -GX - enable C++ exception support 64 | WIN_CFLAGS = -nologo -W3 65 | 66 | # MSVC compiler options for debug builds linked to MSVCRTD.DLL 67 | # -MDd - link with MSVCRTD.LIB (Dynamically-linked, multi-threaded, debug C-runtime) 68 | # -Od - minimal optimization 69 | WIN_IDG_CFLAGS = -MDd -Od -Z7 70 | 71 | # MSVC compiler options for debug builds linked to MSVCRT.DLL 72 | # -MD - link with MSVCRT.LIB (Dynamically-linked, multi-threaded, debug C-runtime) 73 | # -Od - minimal optimization 74 | WIN_DEBUG_CFLAGS = -MD -Od -Zi -Fd$(OBJDIR)/$(PDBFILE) 75 | 76 | # MSVC compiler options for release (optimized) builds 77 | # -MD - link with MSVCRT.LIB (Dynamically-linked, multi-threaded, C-runtime) 78 | # -O2 - Optimize for speed 79 | # -G5 - Optimize for Pentium 80 | WIN_OPT_CFLAGS = -MD -O2 81 | 82 | ifdef BUILD_OPT 83 | OPTIMIZER = $(WIN_OPT_CFLAGS) 84 | else 85 | ifdef BUILD_IDG 86 | OPTIMIZER = $(WIN_IDG_CFLAGS) 87 | else 88 | OPTIMIZER = $(WIN_DEBUG_CFLAGS) 89 | endif 90 | endif 91 | 92 | OS_CFLAGS = -D_X86_=1 -DXP_WIN -DXP_WIN32 -DWIN32 -D_WINDOWS -D_WIN32 -DWINVER=0x500 -D_WIN32_WINNT=0x500 $(WIN_CFLAGS) 93 | JSDLL_CFLAGS = -DEXPORT_JS_API 94 | OS_LIBS = -lm -lc 95 | 96 | PREBUILT_CPUCFG = 1 97 | USE_MSVC = 1 98 | 99 | LIB_LINK_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\ 100 | advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib oldnames.lib \ 101 | winmm.lib \ 102 | -nologo\ 103 | -subsystem:windows -dll -debug -pdb:$(OBJDIR)/$(PDBFILE)\ 104 | -machine:I386\ 105 | -opt:ref -opt:noicf 106 | 107 | EXE_LINK_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\ 108 | advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib oldnames.lib -nologo\ 109 | -subsystem:console -debug -pdb:$(OBJDIR)/$(PDBFILE)\ 110 | -machine:I386\ 111 | -opt:ref -opt:noicf 112 | 113 | # CAFEDIR = t:/cafe 114 | # JCLASSPATH = $(CAFEDIR)/Java/Lib/classes.zip 115 | # JAVAC = $(CAFEDIR)/Bin/sj.exe 116 | # JAVAH = $(CAFEDIR)/Java/Bin/javah.exe 117 | # JCFLAGS = -I$(CAFEDIR)/Java/Include -I$(CAFEDIR)/Java/Include/win32 118 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/config/WINNT5.1.mk: -------------------------------------------------------------------------------- 1 | # -*- Mode: makefile -*- 2 | # 3 | # ***** BEGIN LICENSE BLOCK ***** 4 | # Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | # 6 | # The contents of this file are subject to the Mozilla Public License Version 7 | # 1.1 (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # http://www.mozilla.org/MPL/ 10 | # 11 | # Software distributed under the License is distributed on an "AS IS" basis, 12 | # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | # for the specific language governing rights and limitations under the 14 | # License. 15 | # 16 | # The Original Code is Mozilla Communicator client code, released 17 | # March 31, 1998. 18 | # 19 | # The Initial Developer of the Original Code is 20 | # Netscape Communications Corporation. 21 | # Portions created by the Initial Developer are Copyright (C) 1998 22 | # the Initial Developer. All Rights Reserved. 23 | # 24 | # Contributor(s): 25 | # 26 | # Alternatively, the contents of this file may be used under the terms of 27 | # either the GNU General Public License Version 2 or later (the "GPL"), or 28 | # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 29 | # in which case the provisions of the GPL or the LGPL are applicable instead 30 | # of those above. If you wish to allow use of your version of this file only 31 | # under the terms of either the GPL or the LGPL, and not to allow others to 32 | # use your version of this file under the terms of the MPL, indicate your 33 | # decision by deleting the provisions above and replace them with the notice 34 | # and other provisions required by the GPL or the LGPL. If you do not delete 35 | # the provisions above, a recipient may use your version of this file under 36 | # the terms of any one of the MPL, the GPL or the LGPL. 37 | # 38 | # ***** END LICENSE BLOCK ***** 39 | 40 | # 41 | # Config for Windows NT using MS Visual C++ (version?) 42 | # 43 | 44 | CC = cl 45 | 46 | RANLIB = echo 47 | 48 | PDBFILE = $(basename $(@F)).pdb 49 | 50 | #.c.o: 51 | # $(CC) -c -MD $*.d $(CFLAGS) $< 52 | 53 | CPU_ARCH = x86 # XXX fixme 54 | GFX_ARCH = win32 55 | 56 | # MSVC compiler options for both debug/optimize 57 | # -nologo - suppress copyright message 58 | # -W3 - Warning level 3 59 | # -Gm - enable minimal rebuild 60 | # -Z7 - put debug info into the executable, not in .pdb file 61 | # -Zi - put debug info into .pdb file 62 | # -YX - automatic precompiled headers 63 | # -GX - enable C++ exception support 64 | WIN_CFLAGS = -nologo -W3 65 | 66 | # MSVC compiler options for debug builds linked to MSVCRTD.DLL 67 | # -MDd - link with MSVCRTD.LIB (Dynamically-linked, multi-threaded, debug C-runtime) 68 | # -Od - minimal optimization 69 | WIN_IDG_CFLAGS = -MDd -Od -Z7 70 | 71 | # MSVC compiler options for debug builds linked to MSVCRT.DLL 72 | # -MD - link with MSVCRT.LIB (Dynamically-linked, multi-threaded, debug C-runtime) 73 | # -Od - minimal optimization 74 | WIN_DEBUG_CFLAGS = -MD -Od -Zi -Fd$(OBJDIR)/$(PDBFILE) 75 | 76 | # MSVC compiler options for release (optimized) builds 77 | # -MD - link with MSVCRT.LIB (Dynamically-linked, multi-threaded, C-runtime) 78 | # -O2 - Optimize for speed 79 | # -G5 - Optimize for Pentium 80 | WIN_OPT_CFLAGS = -MD -O2 81 | 82 | ifdef BUILD_OPT 83 | OPTIMIZER = $(WIN_OPT_CFLAGS) 84 | else 85 | ifdef BUILD_IDG 86 | OPTIMIZER = $(WIN_IDG_CFLAGS) 87 | else 88 | OPTIMIZER = $(WIN_DEBUG_CFLAGS) 89 | endif 90 | endif 91 | 92 | OS_CFLAGS = -D_X86_=1 -DXP_WIN -DXP_WIN32 -DWIN32 -D_WINDOWS -D_WIN32 -DWINVER=0x500 -D_WIN32_WINNT=0x500 $(WIN_CFLAGS) 93 | JSDLL_CFLAGS = -DEXPORT_JS_API 94 | OS_LIBS = -lm -lc 95 | 96 | PREBUILT_CPUCFG = 1 97 | USE_MSVC = 1 98 | 99 | LIB_LINK_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\ 100 | advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib oldnames.lib \ 101 | winmm.lib \ 102 | -nologo\ 103 | -subsystem:windows -dll -debug -pdb:$(OBJDIR)/$(PDBFILE)\ 104 | -machine:I386\ 105 | -opt:ref -opt:noicf 106 | 107 | EXE_LINK_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\ 108 | advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib oldnames.lib -nologo\ 109 | -subsystem:console -debug -pdb:$(OBJDIR)/$(PDBFILE)\ 110 | -machine:I386\ 111 | -opt:ref -opt:noicf 112 | 113 | # CAFEDIR = t:/cafe 114 | # JCLASSPATH = $(CAFEDIR)/Java/Lib/classes.zip 115 | # JAVAC = $(CAFEDIR)/Bin/sj.exe 116 | # JAVAH = $(CAFEDIR)/Java/Bin/javah.exe 117 | # JCFLAGS = -I$(CAFEDIR)/Java/Include -I$(CAFEDIR)/Java/Include/win32 118 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/config/WINNT5.2.mk: -------------------------------------------------------------------------------- 1 | # -*- Mode: makefile -*- 2 | # 3 | # ***** BEGIN LICENSE BLOCK ***** 4 | # Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | # 6 | # The contents of this file are subject to the Mozilla Public License Version 7 | # 1.1 (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # http://www.mozilla.org/MPL/ 10 | # 11 | # Software distributed under the License is distributed on an "AS IS" basis, 12 | # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | # for the specific language governing rights and limitations under the 14 | # License. 15 | # 16 | # The Original Code is Mozilla Communicator client code, released 17 | # March 31, 1998. 18 | # 19 | # The Initial Developer of the Original Code is 20 | # Netscape Communications Corporation. 21 | # Portions created by the Initial Developer are Copyright (C) 1998 22 | # the Initial Developer. All Rights Reserved. 23 | # 24 | # Contributor(s): 25 | # 26 | # Alternatively, the contents of this file may be used under the terms of 27 | # either the GNU General Public License Version 2 or later (the "GPL"), or 28 | # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 29 | # in which case the provisions of the GPL or the LGPL are applicable instead 30 | # of those above. If you wish to allow use of your version of this file only 31 | # under the terms of either the GPL or the LGPL, and not to allow others to 32 | # use your version of this file under the terms of the MPL, indicate your 33 | # decision by deleting the provisions above and replace them with the notice 34 | # and other provisions required by the GPL or the LGPL. If you do not delete 35 | # the provisions above, a recipient may use your version of this file under 36 | # the terms of any one of the MPL, the GPL or the LGPL. 37 | # 38 | # ***** END LICENSE BLOCK ***** 39 | 40 | # 41 | # Config for Windows NT using MS Visual C++ (version?) 42 | # 43 | 44 | CC = cl 45 | 46 | RANLIB = echo 47 | 48 | PDBFILE = $(basename $(@F)).pdb 49 | 50 | #.c.o: 51 | # $(CC) -c -MD $*.d $(CFLAGS) $< 52 | 53 | CPU_ARCH = x86 # XXX fixme 54 | GFX_ARCH = win32 55 | 56 | # MSVC compiler options for both debug/optimize 57 | # -nologo - suppress copyright message 58 | # -W3 - Warning level 3 59 | # -Gm - enable minimal rebuild 60 | # -Z7 - put debug info into the executable, not in .pdb file 61 | # -Zi - put debug info into .pdb file 62 | # -YX - automatic precompiled headers 63 | # -GX - enable C++ exception support 64 | WIN_CFLAGS = -nologo -W3 65 | 66 | # MSVC compiler options for debug builds linked to MSVCRTD.DLL 67 | # -MDd - link with MSVCRTD.LIB (Dynamically-linked, multi-threaded, debug C-runtime) 68 | # -Od - minimal optimization 69 | WIN_IDG_CFLAGS = -MDd -Od -Z7 70 | 71 | # MSVC compiler options for debug builds linked to MSVCRT.DLL 72 | # -MD - link with MSVCRT.LIB (Dynamically-linked, multi-threaded, debug C-runtime) 73 | # -Od - minimal optimization 74 | WIN_DEBUG_CFLAGS = -MD -Od -Zi -Fd$(OBJDIR)/$(PDBFILE) 75 | 76 | # MSVC compiler options for release (optimized) builds 77 | # -MD - link with MSVCRT.LIB (Dynamically-linked, multi-threaded, C-runtime) 78 | # -O2 - Optimize for speed 79 | # -G5 - Optimize for Pentium 80 | WIN_OPT_CFLAGS = -MD -O2 81 | 82 | ifdef BUILD_OPT 83 | OPTIMIZER = $(WIN_OPT_CFLAGS) 84 | else 85 | ifdef BUILD_IDG 86 | OPTIMIZER = $(WIN_IDG_CFLAGS) 87 | else 88 | OPTIMIZER = $(WIN_DEBUG_CFLAGS) 89 | endif 90 | endif 91 | 92 | OS_CFLAGS = -D_X86_=1 -DXP_WIN -DXP_WIN32 -DWIN32 -D_WINDOWS -D_WIN32 -DWINVER=0x500 -D_WIN32_WINNT=0x500 $(WIN_CFLAGS) 93 | JSDLL_CFLAGS = -DEXPORT_JS_API 94 | OS_LIBS = -lm -lc 95 | 96 | PREBUILT_CPUCFG = 1 97 | USE_MSVC = 1 98 | 99 | LIB_LINK_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\ 100 | advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib oldnames.lib \ 101 | winmm.lib \ 102 | -nologo\ 103 | -subsystem:windows -dll -debug -pdb:$(OBJDIR)/$(PDBFILE)\ 104 | -machine:I386\ 105 | -opt:ref -opt:noicf 106 | 107 | EXE_LINK_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\ 108 | advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib oldnames.lib -nologo\ 109 | -subsystem:console -debug -pdb:$(OBJDIR)/$(PDBFILE)\ 110 | -machine:I386\ 111 | -opt:ref -opt:noicf 112 | 113 | # CAFEDIR = t:/cafe 114 | # JCLASSPATH = $(CAFEDIR)/Java/Lib/classes.zip 115 | # JAVAC = $(CAFEDIR)/Bin/sj.exe 116 | # JAVAH = $(CAFEDIR)/Java/Bin/javah.exe 117 | # JCFLAGS = -I$(CAFEDIR)/Java/Include -I$(CAFEDIR)/Java/Include/win32 118 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/config/dgux.mk: -------------------------------------------------------------------------------- 1 | # -*- Mode: makefile -*- 2 | # 3 | # ***** BEGIN LICENSE BLOCK ***** 4 | # Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | # 6 | # The contents of this file are subject to the Mozilla Public License Version 7 | # 1.1 (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # http://www.mozilla.org/MPL/ 10 | # 11 | # Software distributed under the License is distributed on an "AS IS" basis, 12 | # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | # for the specific language governing rights and limitations under the 14 | # License. 15 | # 16 | # The Original Code is Mozilla Communicator client code, released 17 | # March 31, 1998. 18 | # 19 | # The Initial Developer of the Original Code is 20 | # Netscape Communications Corporation. 21 | # Portions created by the Initial Developer are Copyright (C) 1998 22 | # the Initial Developer. All Rights Reserved. 23 | # 24 | # Contributor(s): 25 | # 26 | # Alternatively, the contents of this file may be used under the terms of 27 | # either the GNU General Public License Version 2 or later (the "GPL"), or 28 | # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 29 | # in which case the provisions of the GPL or the LGPL are applicable instead 30 | # of those above. If you wish to allow use of your version of this file only 31 | # under the terms of either the GPL or the LGPL, and not to allow others to 32 | # use your version of this file under the terms of the MPL, indicate your 33 | # decision by deleting the provisions above and replace them with the notice 34 | # and other provisions required by the GPL or the LGPL. If you do not delete 35 | # the provisions above, a recipient may use your version of this file under 36 | # the terms of any one of the MPL, the GPL or the LGPL. 37 | # 38 | # ***** END LICENSE BLOCK ***** 39 | 40 | # 41 | # Config stuff for Data General DG/UX 42 | # 43 | 44 | # 45 | # Initial DG/UX port by Marc Fraioli (fraioli@dg-rtp.dg.com) 46 | # 47 | 48 | AS = as 49 | CC = gcc 50 | CCC = g++ 51 | 52 | RANLIB = echo 53 | 54 | # 55 | # _DGUX_SOURCE is needed to turn on a lot of stuff in the headers if 56 | # you're not using DG's compiler. It shouldn't hurt if you are. 57 | # 58 | # _POSIX4A_DRAFT10_SOURCE is needed to pick up localtime_r, used in 59 | # prtime.c 60 | # 61 | OS_CFLAGS = -DXP_UNIX -DSVR4 -DSYSV -DDGUX -D_DGUX_SOURCE -D_POSIX4A_DRAFT10_SOURCE -DHAVE_LOCALTIME_R 62 | OS_LIBS = -lsocket -lnsl 63 | 64 | NOSUCHFILE = /no-such-file 65 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/js.mdp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manugarg/pacparser/198ccdb23b9f0c84e58d9d5864ccffbe80a52506/src/spidermonkey/js/src/js.mdp -------------------------------------------------------------------------------- /src/spidermonkey/js/src/js.pkg: -------------------------------------------------------------------------------- 1 | [gecko xpi-bootstrap] 2 | dist/bin/@SHARED_LIBRARY@ 3 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/js3240.rc: -------------------------------------------------------------------------------- 1 | //Microsoft Developer Studio generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #include "winver.h" 11 | 12 | ///////////////////////////////////////////////////////////////////////////// 13 | #undef APSTUDIO_READONLY_SYMBOLS 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // 17 | // Version 18 | // 19 | 20 | VS_VERSION_INFO VERSIONINFO 21 | FILEVERSION 4,0,0,0 22 | PRODUCTVERSION 4,0,0,0 23 | FILEFLAGSMASK 0x3fL 24 | #ifdef _DEBUG 25 | FILEFLAGS 0x1L 26 | #else 27 | FILEFLAGS 0x0L 28 | #endif 29 | FILEOS 0x10004L 30 | FILETYPE 0x2L 31 | FILESUBTYPE 0x0L 32 | BEGIN 33 | BLOCK "StringFileInfo" 34 | BEGIN 35 | BLOCK "040904e4" 36 | BEGIN 37 | VALUE "CompanyName", "Netscape Communications Corporation\0" 38 | VALUE "FileDescription", "Netscape 32-bit JavaScript Module\0" 39 | VALUE "FileVersion", "4.0\0" 40 | VALUE "InternalName", "JS3240\0" 41 | VALUE "LegalCopyright", "Copyright Netscape Communications. 1994-96\0" 42 | VALUE "LegalTrademarks", "Netscape, Mozilla\0" 43 | VALUE "OriginalFilename", "js3240.dll\0" 44 | VALUE "ProductName", "NETSCAPE\0" 45 | VALUE "ProductVersion", "4.0\0" 46 | END 47 | END 48 | BLOCK "VarFileInfo" 49 | BEGIN 50 | VALUE "Translation", 0x409, 1252 51 | END 52 | END 53 | 54 | #ifdef APSTUDIO_INVOKED 55 | ///////////////////////////////////////////////////////////////////////////// 56 | // 57 | // TEXTINCLUDE 58 | // 59 | 60 | 1 TEXTINCLUDE DISCARDABLE 61 | BEGIN 62 | "resource.h\0" 63 | END 64 | 65 | 2 TEXTINCLUDE DISCARDABLE 66 | BEGIN 67 | "#include ""winver.h""\r\n" 68 | "\0" 69 | END 70 | 71 | 3 TEXTINCLUDE DISCARDABLE 72 | BEGIN 73 | "\r\n" 74 | "\0" 75 | END 76 | 77 | #endif // APSTUDIO_INVOKED 78 | 79 | ///////////////////////////////////////////////////////////////////////////// -------------------------------------------------------------------------------- /src/spidermonkey/js/src/jsarray.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * ***** BEGIN LICENSE BLOCK ***** 4 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | * 6 | * The contents of this file are subject to the Mozilla Public License Version 7 | * 1.1 (the "License"); you may not use this file except in compliance with 8 | * the License. You may obtain a copy of the License at 9 | * http://www.mozilla.org/MPL/ 10 | * 11 | * Software distributed under the License is distributed on an "AS IS" basis, 12 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | * for the specific language governing rights and limitations under the 14 | * License. 15 | * 16 | * The Original Code is Mozilla Communicator client code, released 17 | * March 31, 1998. 18 | * 19 | * The Initial Developer of the Original Code is 20 | * Netscape Communications Corporation. 21 | * Portions created by the Initial Developer are Copyright (C) 1998 22 | * the Initial Developer. All Rights Reserved. 23 | * 24 | * Contributor(s): 25 | * 26 | * Alternatively, the contents of this file may be used under the terms of 27 | * either of the GNU General Public License Version 2 or later (the "GPL"), 28 | * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 29 | * in which case the provisions of the GPL or the LGPL are applicable instead 30 | * of those above. If you wish to allow use of your version of this file only 31 | * under the terms of either the GPL or the LGPL, and not to allow others to 32 | * use your version of this file under the terms of the MPL, indicate your 33 | * decision by deleting the provisions above and replace them with the notice 34 | * and other provisions required by the GPL or the LGPL. If you do not delete 35 | * the provisions above, a recipient may use your version of this file under 36 | * the terms of any one of the MPL, the GPL or the LGPL. 37 | * 38 | * ***** END LICENSE BLOCK ***** */ 39 | 40 | #ifndef jsarray_h___ 41 | #define jsarray_h___ 42 | /* 43 | * JS Array interface. 44 | */ 45 | #include "jsprvtd.h" 46 | #include "jspubtd.h" 47 | 48 | JS_BEGIN_EXTERN_C 49 | 50 | /* Generous sanity-bound on length (in elements) of array initialiser. */ 51 | #define ARRAY_INIT_LIMIT JS_BIT(24) 52 | 53 | extern JSBool 54 | js_IdIsIndex(jsval id, jsuint *indexp); 55 | 56 | extern JSClass js_ArrayClass; 57 | 58 | extern JSObject * 59 | js_InitArrayClass(JSContext *cx, JSObject *obj); 60 | 61 | extern JSObject * 62 | js_NewArrayObject(JSContext *cx, jsuint length, jsval *vector); 63 | 64 | extern JSBool 65 | js_GetLengthProperty(JSContext *cx, JSObject *obj, jsuint *lengthp); 66 | 67 | extern JSBool 68 | js_SetLengthProperty(JSContext *cx, JSObject *obj, jsuint length); 69 | 70 | extern JSBool 71 | js_HasLengthProperty(JSContext *cx, JSObject *obj, jsuint *lengthp); 72 | 73 | /* 74 | * Test whether an object is "array-like". Currently this means whether obj 75 | * is an Array or an arguments object. We would like an API, and probably a 76 | * way in the language, to bless other objects as array-like: having indexed 77 | * properties, and a 'length' property of uint32 value equal to one more than 78 | * the greatest index. 79 | */ 80 | extern JSBool 81 | js_IsArrayLike(JSContext *cx, JSObject *obj, JSBool *answerp, jsuint *lengthp); 82 | 83 | /* 84 | * JS-specific heap sort function. 85 | */ 86 | typedef JSBool (*JSComparator)(void *arg, const void *a, const void *b, 87 | int *result); 88 | 89 | extern JSBool 90 | js_HeapSort(void *vec, size_t nel, void *pivot, size_t elsize, 91 | JSComparator cmp, void *arg); 92 | 93 | JS_END_EXTERN_C 94 | 95 | #endif /* jsarray_h___ */ 96 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/jsbool.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * ***** BEGIN LICENSE BLOCK ***** 4 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | * 6 | * The contents of this file are subject to the Mozilla Public License Version 7 | * 1.1 (the "License"); you may not use this file except in compliance with 8 | * the License. You may obtain a copy of the License at 9 | * http://www.mozilla.org/MPL/ 10 | * 11 | * Software distributed under the License is distributed on an "AS IS" basis, 12 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | * for the specific language governing rights and limitations under the 14 | * License. 15 | * 16 | * The Original Code is Mozilla Communicator client code, released 17 | * March 31, 1998. 18 | * 19 | * The Initial Developer of the Original Code is 20 | * Netscape Communications Corporation. 21 | * Portions created by the Initial Developer are Copyright (C) 1998 22 | * the Initial Developer. All Rights Reserved. 23 | * 24 | * Contributor(s): 25 | * 26 | * Alternatively, the contents of this file may be used under the terms of 27 | * either of the GNU General Public License Version 2 or later (the "GPL"), 28 | * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 29 | * in which case the provisions of the GPL or the LGPL are applicable instead 30 | * of those above. If you wish to allow use of your version of this file only 31 | * under the terms of either the GPL or the LGPL, and not to allow others to 32 | * use your version of this file under the terms of the MPL, indicate your 33 | * decision by deleting the provisions above and replace them with the notice 34 | * and other provisions required by the GPL or the LGPL. If you do not delete 35 | * the provisions above, a recipient may use your version of this file under 36 | * the terms of any one of the MPL, the GPL or the LGPL. 37 | * 38 | * ***** END LICENSE BLOCK ***** */ 39 | 40 | #ifndef jsbool_h___ 41 | #define jsbool_h___ 42 | /* 43 | * JS boolean interface. 44 | */ 45 | 46 | JS_BEGIN_EXTERN_C 47 | 48 | /* 49 | * Crypto-booleans, not visible to script but used internally by the engine. 50 | * 51 | * JSVAL_HOLE is a useful value for identifying a hole in an array. It's also 52 | * used in the interpreter to represent "no exception pending". In general it 53 | * can be used to represent "no value". 54 | * 55 | * JSVAL_ARETURN is used to throw asynchronous return for generator.close(). 56 | */ 57 | #define JSVAL_HOLE BOOLEAN_TO_JSVAL(2) 58 | #define JSVAL_ARETURN BOOLEAN_TO_JSVAL(3) 59 | 60 | extern JSClass js_BooleanClass; 61 | 62 | extern JSObject * 63 | js_InitBooleanClass(JSContext *cx, JSObject *obj); 64 | 65 | extern JSObject * 66 | js_BooleanToObject(JSContext *cx, JSBool b); 67 | 68 | extern JSString * 69 | js_BooleanToString(JSContext *cx, JSBool b); 70 | 71 | extern JSBool 72 | js_ValueToBoolean(JSContext *cx, jsval v, JSBool *bp); 73 | 74 | JS_END_EXTERN_C 75 | 76 | #endif /* jsbool_h___ */ 77 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/jsclist.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is Mozilla Communicator client code, released 16 | * March 31, 1998. 17 | * 18 | * The Initial Developer of the Original Code is 19 | * Netscape Communications Corporation. 20 | * Portions created by the Initial Developer are Copyright (C) 1998 21 | * the Initial Developer. All Rights Reserved. 22 | * 23 | * Contributor(s): 24 | * 25 | * Alternatively, the contents of this file may be used under the terms of 26 | * either of the GNU General Public License Version 2 or later (the "GPL"), 27 | * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 28 | * in which case the provisions of the GPL or the LGPL are applicable instead 29 | * of those above. If you wish to allow use of your version of this file only 30 | * under the terms of either the GPL or the LGPL, and not to allow others to 31 | * use your version of this file under the terms of the MPL, indicate your 32 | * decision by deleting the provisions above and replace them with the notice 33 | * and other provisions required by the GPL or the LGPL. If you do not delete 34 | * the provisions above, a recipient may use your version of this file under 35 | * the terms of any one of the MPL, the GPL or the LGPL. 36 | * 37 | * ***** END LICENSE BLOCK ***** */ 38 | 39 | #ifndef jsclist_h___ 40 | #define jsclist_h___ 41 | 42 | #include "jstypes.h" 43 | 44 | /* 45 | ** Circular linked list 46 | */ 47 | typedef struct JSCListStr { 48 | struct JSCListStr *next; 49 | struct JSCListStr *prev; 50 | } JSCList; 51 | 52 | /* 53 | ** Insert element "_e" into the list, before "_l". 54 | */ 55 | #define JS_INSERT_BEFORE(_e,_l) \ 56 | JS_BEGIN_MACRO \ 57 | (_e)->next = (_l); \ 58 | (_e)->prev = (_l)->prev; \ 59 | (_l)->prev->next = (_e); \ 60 | (_l)->prev = (_e); \ 61 | JS_END_MACRO 62 | 63 | /* 64 | ** Insert element "_e" into the list, after "_l". 65 | */ 66 | #define JS_INSERT_AFTER(_e,_l) \ 67 | JS_BEGIN_MACRO \ 68 | (_e)->next = (_l)->next; \ 69 | (_e)->prev = (_l); \ 70 | (_l)->next->prev = (_e); \ 71 | (_l)->next = (_e); \ 72 | JS_END_MACRO 73 | 74 | /* 75 | ** Return the element following element "_e" 76 | */ 77 | #define JS_NEXT_LINK(_e) \ 78 | ((_e)->next) 79 | /* 80 | ** Return the element preceding element "_e" 81 | */ 82 | #define JS_PREV_LINK(_e) \ 83 | ((_e)->prev) 84 | 85 | /* 86 | ** Append an element "_e" to the end of the list "_l" 87 | */ 88 | #define JS_APPEND_LINK(_e,_l) JS_INSERT_BEFORE(_e,_l) 89 | 90 | /* 91 | ** Insert an element "_e" at the head of the list "_l" 92 | */ 93 | #define JS_INSERT_LINK(_e,_l) JS_INSERT_AFTER(_e,_l) 94 | 95 | /* Return the head/tail of the list */ 96 | #define JS_LIST_HEAD(_l) (_l)->next 97 | #define JS_LIST_TAIL(_l) (_l)->prev 98 | 99 | /* 100 | ** Remove the element "_e" from it's circular list. 101 | */ 102 | #define JS_REMOVE_LINK(_e) \ 103 | JS_BEGIN_MACRO \ 104 | (_e)->prev->next = (_e)->next; \ 105 | (_e)->next->prev = (_e)->prev; \ 106 | JS_END_MACRO 107 | 108 | /* 109 | ** Remove the element "_e" from it's circular list. Also initializes the 110 | ** linkage. 111 | */ 112 | #define JS_REMOVE_AND_INIT_LINK(_e) \ 113 | JS_BEGIN_MACRO \ 114 | (_e)->prev->next = (_e)->next; \ 115 | (_e)->next->prev = (_e)->prev; \ 116 | (_e)->next = (_e); \ 117 | (_e)->prev = (_e); \ 118 | JS_END_MACRO 119 | 120 | /* 121 | ** Return non-zero if the given circular list "_l" is empty, zero if the 122 | ** circular list is not empty 123 | */ 124 | #define JS_CLIST_IS_EMPTY(_l) \ 125 | ((_l)->next == (_l)) 126 | 127 | /* 128 | ** Initialize a circular list 129 | */ 130 | #define JS_INIT_CLIST(_l) \ 131 | JS_BEGIN_MACRO \ 132 | (_l)->next = (_l); \ 133 | (_l)->prev = (_l); \ 134 | JS_END_MACRO 135 | 136 | #define JS_INIT_STATIC_CLIST(_l) \ 137 | {(_l), (_l)} 138 | 139 | #endif /* jsclist_h___ */ 140 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/jscompat.h: -------------------------------------------------------------------------------- 1 | /* ***** BEGIN LICENSE BLOCK ***** 2 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 3 | * 4 | * The contents of this file are subject to the Mozilla Public License Version 5 | * 1.1 (the "License"); you may not use this file except in compliance with 6 | * the License. You may obtain a copy of the License at 7 | * http://www.mozilla.org/MPL/ 8 | * 9 | * Software distributed under the License is distributed on an "AS IS" basis, 10 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing rights and limitations under the 12 | * License. 13 | * 14 | * The Original Code is Mozilla Communicator client code, released 15 | * March 31, 1998. 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Netscape Communications Corporation. 19 | * Portions created by the Initial Developer are Copyright (C) 1998-1999 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): 23 | * 24 | * Alternatively, the contents of this file may be used under the terms of 25 | * either of the GNU General Public License Version 2 or later (the "GPL"), 26 | * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 27 | * in which case the provisions of the GPL or the LGPL are applicable instead 28 | * of those above. If you wish to allow use of your version of this file only 29 | * under the terms of either the GPL or the LGPL, and not to allow others to 30 | * use your version of this file under the terms of the MPL, indicate your 31 | * decision by deleting the provisions above and replace them with the notice 32 | * and other provisions required by the GPL or the LGPL. If you do not delete 33 | * the provisions above, a recipient may use your version of this file under 34 | * the terms of any one of the MPL, the GPL or the LGPL. 35 | * 36 | * ***** END LICENSE BLOCK ***** */ 37 | 38 | /* -*- Mode: C; tab-width: 8 -*- 39 | * Copyright (C) 1996-1999 Netscape Communications Corporation, All Rights Reserved. 40 | */ 41 | #ifndef jscompat_h___ 42 | #define jscompat_h___ 43 | /* 44 | * Compatibility glue for various NSPR versions. We must always define int8, 45 | * int16, jsword, and so on to minimize differences with js/ref, no matter what 46 | * the NSPR typedef names may be. 47 | */ 48 | #include "jstypes.h" 49 | #include "jslong.h" 50 | 51 | typedef JSIntn intN; 52 | typedef JSUintn uintN; 53 | typedef JSUword jsuword; 54 | typedef JSWord jsword; 55 | typedef float float32; 56 | #define allocPriv allocPool 57 | #endif /* jscompat_h___ */ 58 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/jsdate.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * ***** BEGIN LICENSE BLOCK ***** 4 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | * 6 | * The contents of this file are subject to the Mozilla Public License Version 7 | * 1.1 (the "License"); you may not use this file except in compliance with 8 | * the License. You may obtain a copy of the License at 9 | * http://www.mozilla.org/MPL/ 10 | * 11 | * Software distributed under the License is distributed on an "AS IS" basis, 12 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | * for the specific language governing rights and limitations under the 14 | * License. 15 | * 16 | * The Original Code is Mozilla Communicator client code, released 17 | * March 31, 1998. 18 | * 19 | * The Initial Developer of the Original Code is 20 | * Netscape Communications Corporation. 21 | * Portions created by the Initial Developer are Copyright (C) 1998 22 | * the Initial Developer. All Rights Reserved. 23 | * 24 | * Contributor(s): 25 | * 26 | * Alternatively, the contents of this file may be used under the terms of 27 | * either of the GNU General Public License Version 2 or later (the "GPL"), 28 | * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 29 | * in which case the provisions of the GPL or the LGPL are applicable instead 30 | * of those above. If you wish to allow use of your version of this file only 31 | * under the terms of either the GPL or the LGPL, and not to allow others to 32 | * use your version of this file under the terms of the MPL, indicate your 33 | * decision by deleting the provisions above and replace them with the notice 34 | * and other provisions required by the GPL or the LGPL. If you do not delete 35 | * the provisions above, a recipient may use your version of this file under 36 | * the terms of any one of the MPL, the GPL or the LGPL. 37 | * 38 | * ***** END LICENSE BLOCK ***** */ 39 | 40 | /* 41 | * JS Date class interface. 42 | */ 43 | 44 | #ifndef jsdate_h___ 45 | #define jsdate_h___ 46 | 47 | JS_BEGIN_EXTERN_C 48 | 49 | extern JSClass js_DateClass; 50 | 51 | extern JSObject * 52 | js_InitDateClass(JSContext *cx, JSObject *obj); 53 | 54 | /* 55 | * These functions provide a C interface to the date/time object 56 | */ 57 | 58 | /* 59 | * Construct a new Date Object from a time value given in milliseconds UTC 60 | * since the epoch. 61 | */ 62 | extern JS_FRIEND_API(JSObject*) 63 | js_NewDateObjectMsec(JSContext* cx, jsdouble msec_time); 64 | 65 | /* 66 | * Construct a new Date Object from an exploded local time value. 67 | */ 68 | extern JS_FRIEND_API(JSObject*) 69 | js_NewDateObject(JSContext* cx, int year, int mon, int mday, 70 | int hour, int min, int sec); 71 | 72 | /* 73 | * Detect whether the internal date value is NaN. (Because failure is 74 | * out-of-band for js_DateGet*) 75 | */ 76 | extern JS_FRIEND_API(JSBool) 77 | js_DateIsValid(JSContext *cx, JSObject* obj); 78 | 79 | extern JS_FRIEND_API(int) 80 | js_DateGetYear(JSContext *cx, JSObject* obj); 81 | 82 | extern JS_FRIEND_API(int) 83 | js_DateGetMonth(JSContext *cx, JSObject* obj); 84 | 85 | extern JS_FRIEND_API(int) 86 | js_DateGetDate(JSContext *cx, JSObject* obj); 87 | 88 | extern JS_FRIEND_API(int) 89 | js_DateGetHours(JSContext *cx, JSObject* obj); 90 | 91 | extern JS_FRIEND_API(int) 92 | js_DateGetMinutes(JSContext *cx, JSObject* obj); 93 | 94 | extern JS_FRIEND_API(int) 95 | js_DateGetSeconds(JSContext *cx, JSObject* obj); 96 | 97 | extern JS_FRIEND_API(void) 98 | js_DateSetYear(JSContext *cx, JSObject *obj, int year); 99 | 100 | extern JS_FRIEND_API(void) 101 | js_DateSetMonth(JSContext *cx, JSObject *obj, int year); 102 | 103 | extern JS_FRIEND_API(void) 104 | js_DateSetDate(JSContext *cx, JSObject *obj, int date); 105 | 106 | extern JS_FRIEND_API(void) 107 | js_DateSetHours(JSContext *cx, JSObject *obj, int hours); 108 | 109 | extern JS_FRIEND_API(void) 110 | js_DateSetMinutes(JSContext *cx, JSObject *obj, int minutes); 111 | 112 | extern JS_FRIEND_API(void) 113 | js_DateSetSeconds(JSContext *cx, JSObject *obj, int seconds); 114 | 115 | extern JS_FRIEND_API(jsdouble) 116 | js_DateGetMsecSinceEpoch(JSContext *cx, JSObject *obj); 117 | 118 | JS_END_EXTERN_C 119 | 120 | #endif /* jsdate_h___ */ 121 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/jsexn.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * ***** BEGIN LICENSE BLOCK ***** 4 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | * 6 | * The contents of this file are subject to the Mozilla Public License Version 7 | * 1.1 (the "License"); you may not use this file except in compliance with 8 | * the License. You may obtain a copy of the License at 9 | * http://www.mozilla.org/MPL/ 10 | * 11 | * Software distributed under the License is distributed on an "AS IS" basis, 12 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | * for the specific language governing rights and limitations under the 14 | * License. 15 | * 16 | * The Original Code is Mozilla Communicator client code, released 17 | * March 31, 1998. 18 | * 19 | * The Initial Developer of the Original Code is 20 | * Netscape Communications Corporation. 21 | * Portions created by the Initial Developer are Copyright (C) 1998 22 | * the Initial Developer. All Rights Reserved. 23 | * 24 | * Contributor(s): 25 | * 26 | * Alternatively, the contents of this file may be used under the terms of 27 | * either of the GNU General Public License Version 2 or later (the "GPL"), 28 | * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 29 | * in which case the provisions of the GPL or the LGPL are applicable instead 30 | * of those above. If you wish to allow use of your version of this file only 31 | * under the terms of either the GPL or the LGPL, and not to allow others to 32 | * use your version of this file under the terms of the MPL, indicate your 33 | * decision by deleting the provisions above and replace them with the notice 34 | * and other provisions required by the GPL or the LGPL. If you do not delete 35 | * the provisions above, a recipient may use your version of this file under 36 | * the terms of any one of the MPL, the GPL or the LGPL. 37 | * 38 | * ***** END LICENSE BLOCK ***** */ 39 | 40 | /* 41 | * JS runtime exception classes. 42 | */ 43 | 44 | #ifndef jsexn_h___ 45 | #define jsexn_h___ 46 | 47 | JS_BEGIN_EXTERN_C 48 | 49 | extern JSClass js_ErrorClass; 50 | 51 | /* 52 | * Initialize the exception constructor/prototype hierarchy. 53 | */ 54 | extern JSObject * 55 | js_InitExceptionClasses(JSContext *cx, JSObject *obj); 56 | 57 | /* 58 | * Given a JSErrorReport, check to see if there is an exception associated with 59 | * the error number. If there is, then create an appropriate exception object, 60 | * set it as the pending exception, and set the JSREPORT_EXCEPTION flag on the 61 | * error report. Exception-aware host error reporters should probably ignore 62 | * error reports so flagged. Returns JS_TRUE if an associated exception is 63 | * found and set, JS_FALSE otherwise.. 64 | */ 65 | extern JSBool 66 | js_ErrorToException(JSContext *cx, const char *message, JSErrorReport *reportp); 67 | 68 | /* 69 | * Called if a JS API call to js_Execute or js_InternalCall fails; calls the 70 | * error reporter with the error report associated with any uncaught exception 71 | * that has been raised. Returns true if there was an exception pending, and 72 | * the error reporter was actually called. 73 | * 74 | * The JSErrorReport * that the error reporter is called with is currently 75 | * associated with a JavaScript object, and is not guaranteed to persist after 76 | * the object is collected. Any persistent uses of the JSErrorReport contents 77 | * should make their own copy. 78 | * 79 | * The flags field of the JSErrorReport will have the JSREPORT_EXCEPTION flag 80 | * set; embeddings that want to silently propagate JavaScript exceptions to 81 | * other contexts may want to use an error reporter that ignores errors with 82 | * this flag. 83 | */ 84 | extern JSBool 85 | js_ReportUncaughtException(JSContext *cx); 86 | 87 | extern JSErrorReport * 88 | js_ErrorFromException(JSContext *cx, jsval exn); 89 | 90 | extern const JSErrorFormatString * 91 | js_GetLocalizedErrorMessage(JSContext* cx, void *userRef, const char *locale, 92 | const uintN errorNumber); 93 | 94 | JS_END_EXTERN_C 95 | 96 | #endif /* jsexn_h___ */ 97 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/jsfile.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * ***** BEGIN LICENSE BLOCK ***** 4 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | * 6 | * The contents of this file are subject to the Mozilla Public License Version 7 | * 1.1 (the "License"); you may not use this file except in compliance with 8 | * the License. You may obtain a copy of the License at 9 | * http://www.mozilla.org/MPL/ 10 | * 11 | * Software distributed under the License is distributed on an "AS IS" basis, 12 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | * for the specific language governing rights and limitations under the 14 | * License. 15 | * 16 | * The Original Code is Mozilla Communicator client code, released 17 | * March 31, 1998. 18 | * 19 | * The Initial Developer of the Original Code is 20 | * Netscape Communications Corporation. 21 | * Portions created by the Initial Developer are Copyright (C) 1998 22 | * the Initial Developer. All Rights Reserved. 23 | * 24 | * Contributor(s): 25 | * 26 | * Alternatively, the contents of this file may be used under the terms of 27 | * either of the GNU General Public License Version 2 or later (the "GPL"), 28 | * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 29 | * in which case the provisions of the GPL or the LGPL are applicable instead 30 | * of those above. If you wish to allow use of your version of this file only 31 | * under the terms of either the GPL or the LGPL, and not to allow others to 32 | * use your version of this file under the terms of the MPL, indicate your 33 | * decision by deleting the provisions above and replace them with the notice 34 | * and other provisions required by the GPL or the LGPL. If you do not delete 35 | * the provisions above, a recipient may use your version of this file under 36 | * the terms of any one of the MPL, the GPL or the LGPL. 37 | * 38 | * ***** END LICENSE BLOCK ***** */ 39 | 40 | #ifndef _jsfile_h__ 41 | #define _jsfile_h__ 42 | 43 | #if JS_HAS_FILE_OBJECT 44 | 45 | #include "jsobj.h" 46 | 47 | extern JS_PUBLIC_API(JSObject*) 48 | js_InitFileClass(JSContext *cx, JSObject* obj); 49 | 50 | extern JS_PUBLIC_API(JSObject*) 51 | js_NewFileObject(JSContext *cx, char *bytes); 52 | 53 | extern JSClass js_FileClass; 54 | 55 | #endif /* JS_HAS_FILE_OBJECT */ 56 | #endif /* _jsfile_h__ */ 57 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/jsiter.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * vim: set ts=8 sw=4 et tw=78: 3 | * 4 | * ***** BEGIN LICENSE BLOCK ***** 5 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * 6 | * The contents of this file are subject to the Mozilla Public License Version 7 | * 1.1 (the "License"); you may not use this file except in compliance with 8 | * the License. You may obtain a copy of the License at 9 | * http://www.mozilla.org/MPL/ 10 | * 11 | * Software distributed under the License is distributed on an "AS IS" basis, 12 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | * for the specific language governing rights and limitations under the 14 | * License. 15 | * 16 | * The Original Code is Mozilla Communicator client code, released 17 | * March 31, 1998. 18 | * 19 | * The Initial Developer of the Original Code is 20 | * Netscape Communications Corporation. 21 | * Portions created by the Initial Developer are Copyright (C) 1998 22 | * the Initial Developer. All Rights Reserved. 23 | * 24 | * Contributor(s): 25 | * 26 | * Alternatively, the contents of this file may be used under the terms of 27 | * either of the GNU General Public License Version 2 or later (the "GPL"), 28 | * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 29 | * in which case the provisions of the GPL or the LGPL are applicable instead 30 | * of those above. If you wish to allow use of your version of this file only 31 | * under the terms of either the GPL or the LGPL, and not to allow others to 32 | * use your version of this file under the terms of the MPL, indicate your 33 | * decision by deleting the provisions above and replace them with the notice 34 | * and other provisions required by the GPL or the LGPL. If you do not delete 35 | * the provisions above, a recipient may use your version of this file under 36 | * the terms of any one of the MPL, the GPL or the LGPL. 37 | * 38 | * ***** END LICENSE BLOCK ***** */ 39 | 40 | #ifndef jsiter_h___ 41 | #define jsiter_h___ 42 | /* 43 | * JavaScript iterators. 44 | */ 45 | #include "jsprvtd.h" 46 | #include "jspubtd.h" 47 | 48 | #define JSITER_ENUMERATE 0x1 /* for-in compatible hidden default iterator */ 49 | #define JSITER_FOREACH 0x2 /* return [key, value] pair rather than key */ 50 | #define JSITER_KEYVALUE 0x4 /* destructuring for-in wants [key, value] */ 51 | 52 | extern void 53 | js_CloseNativeIterator(JSContext *cx, JSObject *iterobj); 54 | 55 | extern void 56 | js_CloseIteratorState(JSContext *cx, JSObject *iterobj); 57 | 58 | /* 59 | * Convert the value stored in *vp to its iteration object. The flags should 60 | * contain JSITER_ENUMERATE if js_ValueToIterator is called when enumerating 61 | * for-in semantics are required, and when the caller can guarantee that the 62 | * iterator will never be exposed to scripts. 63 | */ 64 | extern JSBool 65 | js_ValueToIterator(JSContext *cx, uintN flags, jsval *vp); 66 | 67 | /* 68 | * Given iterobj, call iterobj.next(). If the iterator stopped, set *rval to 69 | * JSVAL_HOLE. Otherwise set it to the result of the next call. 70 | */ 71 | extern JSBool 72 | js_CallIteratorNext(JSContext *cx, JSObject *iterobj, jsval *rval); 73 | 74 | #if JS_HAS_GENERATORS 75 | 76 | /* 77 | * Generator state codes. 78 | */ 79 | typedef enum JSGeneratorState { 80 | JSGEN_NEWBORN, /* not yet started */ 81 | JSGEN_OPEN, /* started by a .next() or .send(undefined) call */ 82 | JSGEN_RUNNING, /* currently executing via .next(), etc., call */ 83 | JSGEN_CLOSING, /* close method is doing asynchronous return */ 84 | JSGEN_CLOSED /* closed, cannot be started or closed again */ 85 | } JSGeneratorState; 86 | 87 | struct JSGenerator { 88 | JSGenerator *next; 89 | JSObject *obj; 90 | JSGeneratorState state; 91 | JSStackFrame frame; 92 | JSArena arena; 93 | jsval stack[1]; 94 | }; 95 | 96 | #define FRAME_TO_GENERATOR(fp) \ 97 | ((JSGenerator *) ((uint8 *)(fp) - offsetof(JSGenerator, frame))) 98 | 99 | extern JSObject * 100 | js_NewGenerator(JSContext *cx, JSStackFrame *fp); 101 | 102 | extern JSBool 103 | js_CloseGeneratorObject(JSContext *cx, JSGenerator *gen); 104 | 105 | #endif 106 | 107 | extern JSClass js_GeneratorClass; 108 | extern JSClass js_IteratorClass; 109 | extern JSClass js_StopIterationClass; 110 | 111 | extern JSObject * 112 | js_InitIteratorClasses(JSContext *cx, JSObject *obj); 113 | 114 | #endif /* jsiter_h___ */ 115 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/jslocko.asm: -------------------------------------------------------------------------------- 1 | ; -*- Mode: asm; tab-width: 8; c-basic-offset: 4 -*- 2 | 3 | ; ***** BEGIN LICENSE BLOCK ***** 4 | ; Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | ; 6 | ; The contents of this file are subject to the Mozilla Public License Version 7 | ; 1.1 (the "License"); you may not use this file except in compliance with 8 | ; the License. You may obtain a copy of the License at 9 | ; http://www.mozilla.org/MPL/ 10 | ; 11 | ; Software distributed under the License is distributed on an "AS IS" basis, 12 | ; WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | ; for the specific language governing rights and limitations under the 14 | ; License. 15 | ; 16 | ; The Original Code is an OS/2 implementation of js_CompareAndSwap in assembly. 17 | ; 18 | ; The Initial Developer of the Original Code is 19 | ; IBM Corporation. 20 | ; Portions created by the Initial Developer are Copyright (C) 2001 21 | ; the Initial Developer. All Rights Reserved. 22 | ; 23 | ; Contributor(s): 24 | ; 25 | ; Alternatively, the contents of this file may be used under the terms of 26 | ; either the GNU General Public License Version 2 or later (the "GPL"), or 27 | ; the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 28 | ; in which case the provisions of the GPL or the LGPL are applicable instead 29 | ; of those above. If you wish to allow use of your version of this file only 30 | ; under the terms of either the GPL or the LGPL, and not to allow others to 31 | ; use your version of this file under the terms of the MPL, indicate your 32 | ; decision by deleting the provisions above and replace them with the notice 33 | ; and other provisions required by the GPL or the LGPL. If you do not delete 34 | ; the provisions above, a recipient may use your version of this file under 35 | ; the terms of any one of the MPL, the GPL or the LGPL. 36 | ; 37 | ; ***** END LICENSE BLOCK ***** 38 | 39 | .486P 40 | .MODEL FLAT, OPTLINK 41 | .STACK 42 | 43 | .CODE 44 | 45 | ;;;--------------------------------------------------------------------- 46 | ;;; int _Optlink js_CompareAndSwap(jsword *w, jsword ov, jsword nv) 47 | ;;;--------------------------------------------------------------------- 48 | js_CompareAndSwap PROC OPTLINK EXPORT 49 | push ebx 50 | mov ebx, eax 51 | mov eax, edx 52 | mov edx, ebx 53 | lock cmpxchg [ebx], ecx 54 | sete al 55 | and eax, 1h 56 | pop ebx 57 | ret 58 | js_CompareAndSwap endp 59 | 60 | END 61 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/jslog2.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is Mozilla Communicator client code, released 16 | * March 31, 1998. 17 | * 18 | * The Initial Developer of the Original Code is 19 | * Netscape Communications Corporation. 20 | * Portions created by the Initial Developer are Copyright (C) 1998 21 | * the Initial Developer. All Rights Reserved. 22 | * 23 | * Contributor(s): 24 | * 25 | * Alternatively, the contents of this file may be used under the terms of 26 | * either of the GNU General Public License Version 2 or later (the "GPL"), 27 | * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 28 | * in which case the provisions of the GPL or the LGPL are applicable instead 29 | * of those above. If you wish to allow use of your version of this file only 30 | * under the terms of either the GPL or the LGPL, and not to allow others to 31 | * use your version of this file under the terms of the MPL, indicate your 32 | * decision by deleting the provisions above and replace them with the notice 33 | * and other provisions required by the GPL or the LGPL. If you do not delete 34 | * the provisions above, a recipient may use your version of this file under 35 | * the terms of any one of the MPL, the GPL or the LGPL. 36 | * 37 | * ***** END LICENSE BLOCK ***** */ 38 | 39 | #include "jsstddef.h" 40 | #include "jsbit.h" 41 | #include "jsutil.h" 42 | 43 | /* 44 | ** Compute the log of the least power of 2 greater than or equal to n 45 | */ 46 | JS_PUBLIC_API(JSIntn) JS_CeilingLog2(JSUint32 n) 47 | { 48 | JSIntn log2; 49 | 50 | JS_CEILING_LOG2(log2, n); 51 | return log2; 52 | } 53 | 54 | /* 55 | ** Compute the log of the greatest power of 2 less than or equal to n. 56 | ** This really just finds the highest set bit in the word. 57 | */ 58 | JS_PUBLIC_API(JSIntn) JS_FloorLog2(JSUint32 n) 59 | { 60 | JSIntn log2; 61 | 62 | JS_FLOOR_LOG2(log2, n); 63 | return log2; 64 | } 65 | 66 | /* 67 | * js_FloorLog2wImpl has to be defined only for 64-bit non-GCC case. 68 | */ 69 | #if !defined(JS_HAS_GCC_BUILTIN_CLZ) && JS_BYTES_PER_WORD == 8 70 | 71 | JSUword 72 | js_FloorLog2wImpl(JSUword n) 73 | { 74 | JSUword log2, m; 75 | 76 | JS_ASSERT(n != 0); 77 | 78 | log2 = 0; 79 | m = n >> 32; 80 | if (m != 0) { n = m; log2 = 32; } 81 | m = n >> 16; 82 | if (m != 0) { n = m; log2 |= 16; } 83 | m = n >> 8; 84 | if (m != 0) { n = m; log2 |= 8; } 85 | m = n >> 4; 86 | if (m != 0) { n = m; log2 |= 4; } 87 | m = n >> 2; 88 | if (m != 0) { n = m; log2 |= 2; } 89 | log2 |= (n >> 1); 90 | 91 | return log2; 92 | } 93 | 94 | #endif 95 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/jsmath.h: -------------------------------------------------------------------------------- 1 | /* ***** BEGIN LICENSE BLOCK ***** 2 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 3 | * 4 | * The contents of this file are subject to the Mozilla Public License Version 5 | * 1.1 (the "License"); you may not use this file except in compliance with 6 | * the License. You may obtain a copy of the License at 7 | * http://www.mozilla.org/MPL/ 8 | * 9 | * Software distributed under the License is distributed on an "AS IS" basis, 10 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing rights and limitations under the 12 | * License. 13 | * 14 | * The Original Code is Mozilla Communicator client code, released 15 | * March 31, 1998. 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Netscape Communications Corporation. 19 | * Portions created by the Initial Developer are Copyright (C) 1998-1999 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): 23 | * 24 | * Alternatively, the contents of this file may be used under the terms of 25 | * either of the GNU General Public License Version 2 or later (the "GPL"), 26 | * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 27 | * in which case the provisions of the GPL or the LGPL are applicable instead 28 | * of those above. If you wish to allow use of your version of this file only 29 | * under the terms of either the GPL or the LGPL, and not to allow others to 30 | * use your version of this file under the terms of the MPL, indicate your 31 | * decision by deleting the provisions above and replace them with the notice 32 | * and other provisions required by the GPL or the LGPL. If you do not delete 33 | * the provisions above, a recipient may use your version of this file under 34 | * the terms of any one of the MPL, the GPL or the LGPL. 35 | * 36 | * ***** END LICENSE BLOCK ***** */ 37 | 38 | /* -*- Mode: C; tab-width: 8 -*- 39 | * Copyright (C) 1998-1999 Netscape Communications Corporation, All Rights Reserved. 40 | */ 41 | 42 | #ifndef jsmath_h___ 43 | #define jsmath_h___ 44 | /* 45 | * JS math functions. 46 | */ 47 | 48 | JS_BEGIN_EXTERN_C 49 | 50 | extern JSClass js_MathClass; 51 | 52 | extern JSObject * 53 | js_InitMathClass(JSContext *cx, JSObject *obj); 54 | 55 | JS_END_EXTERN_C 56 | 57 | #endif /* jsmath_h___ */ 58 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/jsosdep.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * ***** BEGIN LICENSE BLOCK ***** 4 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | * 6 | * The contents of this file are subject to the Mozilla Public License Version 7 | * 1.1 (the "License"); you may not use this file except in compliance with 8 | * the License. You may obtain a copy of the License at 9 | * http://www.mozilla.org/MPL/ 10 | * 11 | * Software distributed under the License is distributed on an "AS IS" basis, 12 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | * for the specific language governing rights and limitations under the 14 | * License. 15 | * 16 | * The Original Code is Mozilla Communicator client code, released 17 | * March 31, 1998. 18 | * 19 | * The Initial Developer of the Original Code is 20 | * Netscape Communications Corporation. 21 | * Portions created by the Initial Developer are Copyright (C) 1998 22 | * the Initial Developer. All Rights Reserved. 23 | * 24 | * Contributor(s): 25 | * 26 | * Alternatively, the contents of this file may be used under the terms of 27 | * either of the GNU General Public License Version 2 or later (the "GPL"), 28 | * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 29 | * in which case the provisions of the GPL or the LGPL are applicable instead 30 | * of those above. If you wish to allow use of your version of this file only 31 | * under the terms of either the GPL or the LGPL, and not to allow others to 32 | * use your version of this file under the terms of the MPL, indicate your 33 | * decision by deleting the provisions above and replace them with the notice 34 | * and other provisions required by the GPL or the LGPL. If you do not delete 35 | * the provisions above, a recipient may use your version of this file under 36 | * the terms of any one of the MPL, the GPL or the LGPL. 37 | * 38 | * ***** END LICENSE BLOCK ***** */ 39 | 40 | #ifndef jsosdep_h___ 41 | #define jsosdep_h___ 42 | /* 43 | * OS (and machine, and compiler XXX) dependent information. 44 | */ 45 | 46 | #if defined(XP_WIN) || defined(XP_OS2) 47 | 48 | #if defined(_WIN32) || defined (XP_OS2) 49 | #define JS_HAVE_LONG_LONG 50 | #else 51 | #undef JS_HAVE_LONG_LONG 52 | #endif 53 | #endif /* XP_WIN || XP_OS2 */ 54 | 55 | #ifdef XP_BEOS 56 | #define JS_HAVE_LONG_LONG 57 | #endif 58 | 59 | 60 | #ifdef XP_UNIX 61 | 62 | /* 63 | * Get OS specific header information. 64 | */ 65 | #if defined(XP_MACOSX) || defined(DARWIN) 66 | #define JS_HAVE_LONG_LONG 67 | 68 | #elif defined(AIXV3) || defined(AIX) 69 | #define JS_HAVE_LONG_LONG 70 | 71 | #elif defined(BSDI) 72 | #define JS_HAVE_LONG_LONG 73 | 74 | #elif defined(HPUX) 75 | #define JS_HAVE_LONG_LONG 76 | 77 | #elif defined(IRIX) 78 | #define JS_HAVE_LONG_LONG 79 | 80 | #elif defined(linux) 81 | #define JS_HAVE_LONG_LONG 82 | 83 | #elif defined(OSF1) 84 | #define JS_HAVE_LONG_LONG 85 | 86 | #elif defined(_SCO_DS) 87 | #undef JS_HAVE_LONG_LONG 88 | 89 | #elif defined(SOLARIS) 90 | #define JS_HAVE_LONG_LONG 91 | 92 | #elif defined(FREEBSD) 93 | #define JS_HAVE_LONG_LONG 94 | 95 | #elif defined(SUNOS4) 96 | #undef JS_HAVE_LONG_LONG 97 | 98 | /* 99 | ** Missing function prototypes 100 | */ 101 | 102 | extern void *sbrk(int); 103 | 104 | #elif defined(UNIXWARE) 105 | #undef JS_HAVE_LONG_LONG 106 | 107 | #elif defined(VMS) && defined(__ALPHA) 108 | #define JS_HAVE_LONG_LONG 109 | 110 | #endif 111 | 112 | #endif /* XP_UNIX */ 113 | 114 | #endif /* jsosdep_h___ */ 115 | 116 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/jsshell.msg: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * ***** BEGIN LICENSE BLOCK ***** 4 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | * 6 | * The contents of this file are subject to the Mozilla Public License Version 7 | * 1.1 (the "License"); you may not use this file except in compliance with 8 | * the License. You may obtain a copy of the License at 9 | * http://www.mozilla.org/MPL/ 10 | * 11 | * Software distributed under the License is distributed on an "AS IS" basis, 12 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | * for the specific language governing rights and limitations under the 14 | * License. 15 | * 16 | * The Original Code is Mozilla Communicator client code, released 17 | * March 31, 1998. 18 | * 19 | * The Initial Developer of the Original Code is 20 | * Netscape Communications Corporation. 21 | * Portions created by the Initial Developer are Copyright (C) 1998 22 | * the Initial Developer. All Rights Reserved. 23 | * 24 | * Contributor(s): 25 | * 26 | * Alternatively, the contents of this file may be used under the terms of 27 | * either of the GNU General Public License Version 2 or later (the "GPL"), 28 | * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 29 | * in which case the provisions of the GPL or the LGPL are applicable instead 30 | * of those above. If you wish to allow use of your version of this file only 31 | * under the terms of either the GPL or the LGPL, and not to allow others to 32 | * use your version of this file under the terms of the MPL, indicate your 33 | * decision by deleting the provisions above and replace them with the notice 34 | * and other provisions required by the GPL or the LGPL. If you do not delete 35 | * the provisions above, a recipient may use your version of this file under 36 | * the terms of any one of the MPL, the GPL or the LGPL. 37 | * 38 | * ***** END LICENSE BLOCK ***** */ 39 | 40 | /* 41 | Error messages for JSShell. See js.msg for format. 42 | */ 43 | 44 | MSG_DEF(JSSMSG_NOT_AN_ERROR, 0, 0, JSEXN_NONE, "") 45 | MSG_DEF(JSSMSG_CANT_OPEN, 1, 2, JSEXN_NONE, "can't open {0}: {1}") 46 | MSG_DEF(JSSMSG_TRAP_USAGE, 2, 0, JSEXN_NONE, "usage: trap [fun] [pc] expr") 47 | MSG_DEF(JSSMSG_LINE2PC_USAGE, 3, 0, JSEXN_NONE, "usage: line2pc [fun] line") 48 | MSG_DEF(JSSMSG_FILE_SCRIPTS_ONLY, 4, 0, JSEXN_NONE, "only works on JS scripts read from files") 49 | MSG_DEF(JSSMSG_UNEXPECTED_EOF, 5, 1, JSEXN_NONE, "unexpected EOF in {0}") 50 | MSG_DEF(JSSMSG_DOEXP_USAGE, 6, 0, JSEXN_NONE, "usage: doexp obj id") 51 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/jsstddef.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * ***** BEGIN LICENSE BLOCK ***** 4 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | * 6 | * The contents of this file are subject to the Mozilla Public License Version 7 | * 1.1 (the "License"); you may not use this file except in compliance with 8 | * the License. You may obtain a copy of the License at 9 | * http://www.mozilla.org/MPL/ 10 | * 11 | * Software distributed under the License is distributed on an "AS IS" basis, 12 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | * for the specific language governing rights and limitations under the 14 | * License. 15 | * 16 | * The Original Code is Mozilla Communicator client code, released 17 | * March 31, 1998. 18 | * 19 | * The Initial Developer of the Original Code is 20 | * Netscape Communications Corporation. 21 | * Portions created by the Initial Developer are Copyright (C) 1998 22 | * the Initial Developer. All Rights Reserved. 23 | * 24 | * Contributor(s): 25 | * 26 | * Alternatively, the contents of this file may be used under the terms of 27 | * either of the GNU General Public License Version 2 or later (the "GPL"), 28 | * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 29 | * in which case the provisions of the GPL or the LGPL are applicable instead 30 | * of those above. If you wish to allow use of your version of this file only 31 | * under the terms of either the GPL or the LGPL, and not to allow others to 32 | * use your version of this file under the terms of the MPL, indicate your 33 | * decision by deleting the provisions above and replace them with the notice 34 | * and other provisions required by the GPL or the LGPL. If you do not delete 35 | * the provisions above, a recipient may use your version of this file under 36 | * the terms of any one of the MPL, the GPL or the LGPL. 37 | * 38 | * ***** END LICENSE BLOCK ***** */ 39 | 40 | /* 41 | * stddef inclusion here to first declare ptrdif as a signed long instead of a 42 | * signed int. 43 | */ 44 | 45 | #ifdef _WINDOWS 46 | # ifndef XP_WIN 47 | # define XP_WIN 48 | # endif 49 | #if defined(_WIN32) || defined(WIN32) 50 | # ifndef XP_WIN32 51 | # define XP_WIN32 52 | # endif 53 | #else 54 | # ifndef XP_WIN16 55 | # define XP_WIN16 56 | # endif 57 | #endif 58 | #endif 59 | 60 | #ifdef XP_WIN16 61 | #ifndef _PTRDIFF_T_DEFINED 62 | typedef long ptrdiff_t; 63 | 64 | /* 65 | * The Win16 compiler treats pointer differences as 16-bit signed values. 66 | * This macro allows us to treat them as 17-bit signed values, stored in 67 | * a 32-bit type. 68 | */ 69 | #define PTRDIFF(p1, p2, type) \ 70 | ((((unsigned long)(p1)) - ((unsigned long)(p2))) / sizeof(type)) 71 | 72 | #define _PTRDIFF_T_DEFINED 73 | #endif /*_PTRDIFF_T_DEFINED*/ 74 | #else /*WIN16*/ 75 | 76 | #define PTRDIFF(p1, p2, type) \ 77 | ((p1) - (p2)) 78 | 79 | #endif 80 | 81 | #include 82 | 83 | 84 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/jsutil.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * ***** BEGIN LICENSE BLOCK ***** 4 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | * 6 | * The contents of this file are subject to the Mozilla Public License Version 7 | * 1.1 (the "License"); you may not use this file except in compliance with 8 | * the License. You may obtain a copy of the License at 9 | * http://www.mozilla.org/MPL/ 10 | * 11 | * Software distributed under the License is distributed on an "AS IS" basis, 12 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | * for the specific language governing rights and limitations under the 14 | * License. 15 | * 16 | * The Original Code is Mozilla Communicator client code, released 17 | * March 31, 1998. 18 | * 19 | * The Initial Developer of the Original Code is 20 | * Netscape Communications Corporation. 21 | * Portions created by the Initial Developer are Copyright (C) 1998 22 | * the Initial Developer. All Rights Reserved. 23 | * 24 | * Contributor(s): 25 | * 26 | * Alternatively, the contents of this file may be used under the terms of 27 | * either of the GNU General Public License Version 2 or later (the "GPL"), 28 | * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 29 | * in which case the provisions of the GPL or the LGPL are applicable instead 30 | * of those above. If you wish to allow use of your version of this file only 31 | * under the terms of either the GPL or the LGPL, and not to allow others to 32 | * use your version of this file under the terms of the MPL, indicate your 33 | * decision by deleting the provisions above and replace them with the notice 34 | * and other provisions required by the GPL or the LGPL. If you do not delete 35 | * the provisions above, a recipient may use your version of this file under 36 | * the terms of any one of the MPL, the GPL or the LGPL. 37 | * 38 | * ***** END LICENSE BLOCK ***** */ 39 | 40 | /* 41 | * PR assertion checker. 42 | */ 43 | 44 | #ifndef jsutil_h___ 45 | #define jsutil_h___ 46 | 47 | JS_BEGIN_EXTERN_C 48 | 49 | #ifdef DEBUG 50 | 51 | extern JS_PUBLIC_API(void) 52 | JS_Assert(const char *s, const char *file, JSIntn ln); 53 | #define JS_ASSERT(_expr) \ 54 | ((_expr)?((void)0):JS_Assert(# _expr,__FILE__,__LINE__)) 55 | 56 | #define JS_NOT_REACHED(_reasonStr) \ 57 | JS_Assert(_reasonStr,__FILE__,__LINE__) 58 | 59 | #else 60 | 61 | #define JS_ASSERT(expr) ((void) 0) 62 | #define JS_NOT_REACHED(reasonStr) 63 | 64 | #endif /* defined(DEBUG) */ 65 | 66 | /* 67 | * Compile-time assert. "condition" must be a constant expression. 68 | * The macro should be used only once per source line in places where 69 | * a "typedef" declaration is allowed. 70 | */ 71 | #define JS_STATIC_ASSERT(condition) \ 72 | JS_STATIC_ASSERT_IMPL(condition, __LINE__) 73 | #define JS_STATIC_ASSERT_IMPL(condition, line) \ 74 | JS_STATIC_ASSERT_IMPL2(condition, line) 75 | #define JS_STATIC_ASSERT_IMPL2(condition, line) \ 76 | typedef int js_static_assert_line_##line[(condition) ? 1 : -1] 77 | 78 | /* 79 | ** Abort the process in a non-graceful manner. This will cause a core file, 80 | ** call to the debugger or other moral equivalent as well as causing the 81 | ** entire process to stop. 82 | */ 83 | extern JS_PUBLIC_API(void) JS_Abort(void); 84 | 85 | #ifdef XP_UNIX 86 | 87 | typedef struct JSCallsite JSCallsite; 88 | 89 | struct JSCallsite { 90 | uint32 pc; 91 | char *name; 92 | const char *library; 93 | int offset; 94 | JSCallsite *parent; 95 | JSCallsite *siblings; 96 | JSCallsite *kids; 97 | void *handy; 98 | }; 99 | 100 | extern JSCallsite *JS_Backtrace(int skip); 101 | 102 | #endif 103 | 104 | JS_END_EXTERN_C 105 | 106 | #endif /* jsutil_h___ */ 107 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/lock_SunOS.s: -------------------------------------------------------------------------------- 1 | ! 2 | ! The contents of this file are subject to the Netscape Public 3 | ! License Version 1.1 (the "License"); you may not use this file 4 | ! except in compliance with the License. You may obtain a copy of 5 | ! the License at http://www.mozilla.org/NPL/ 6 | ! 7 | ! Software distributed under the License is distributed on an "AS 8 | ! IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 9 | ! implied. See the License for the specific language governing 10 | ! rights and limitations under the License. 11 | ! 12 | ! The Original Code is Mozilla Communicator client code, released 13 | ! March 31, 1998. 14 | ! 15 | ! The Initial Developer of the Original Code is Netscape 16 | ! Communications Corporation. Portions created by Netscape are 17 | ! Copyright (C) 1998-1999 Netscape Communications Corporation. All 18 | ! Rights Reserved. 19 | ! 20 | ! Contributor(s): 21 | ! 22 | ! Alternatively, the contents of this file may be used under the 23 | ! terms of the GNU Public License (the "GPL"), in which case the 24 | ! provisions of the GPL are applicable instead of those above. 25 | ! If you wish to allow use of your version of this file only 26 | ! under the terms of the GPL and not to allow others to use your 27 | ! version of this file under the NPL, indicate your decision by 28 | ! deleting the provisions above and replace them with the notice 29 | ! and other provisions required by the GPL. If you do not delete 30 | ! the provisions above, a recipient may use your version of this 31 | ! file under either the NPL or the GPL. 32 | ! 33 | 34 | ! 35 | ! atomic compare-and-swap routines for V8 sparc 36 | ! and for V8+ (ultrasparc) 37 | ! 38 | ! 39 | ! standard asm linkage macros; this module must be compiled 40 | ! with the -P option (use C preprocessor) 41 | 42 | #include 43 | 44 | ! ====================================================================== 45 | ! 46 | ! Perform the sequence *a = b atomically with respect to previous value 47 | ! of a (a0). If *a==a0 then assign *a to b, all in one atomic operation. 48 | ! Returns 1 if assignment happened, and 0 otherwise. 49 | ! 50 | ! usage : old_val = compare_and_swap(address, oldval, newval) 51 | ! 52 | ! ----------------------- 53 | ! Note on REGISTER USAGE: 54 | ! as this is a LEAF procedure, a new stack frame is not created; 55 | ! we use the caller stack frame so what would normally be %i (input) 56 | ! registers are actually %o (output registers). Also, we must not 57 | ! overwrite the contents of %l (local) registers as they are not 58 | ! assumed to be volatile during calls. 59 | ! 60 | ! So, the registers used are: 61 | ! %o0 [input] - the address of the value to increment 62 | ! %o1 [input] - the old value to compare with 63 | ! %o2 [input] - the new value to set for [%o0] 64 | ! %o3 [local] - work register 65 | ! ----------------------- 66 | #ifndef ULTRA_SPARC 67 | ! v8 68 | 69 | ENTRY(compare_and_swap) ! standard assembler/ELF prologue 70 | 71 | stbar 72 | mov -1,%o3 ! busy flag 73 | swap [%o0],%o3 ! get current value 74 | l1: cmp %o3,-1 ! busy? 75 | be,a l1 ! if so, spin 76 | swap [%o0],%o3 ! using branch-delay to swap back value 77 | cmp %o1,%o3 ! compare old with current 78 | be,a l2 ! if equal then swap in new value 79 | swap [%o0],%o2 ! done. 80 | swap [%o0],%o3 ! otherwise, swap back current value 81 | retl 82 | mov 0,%o0 ! return false 83 | l2: retl 84 | mov 1,%o0 ! return true 85 | 86 | SET_SIZE(compare_and_swap) ! standard assembler/ELF epilogue 87 | 88 | ! 89 | ! end 90 | ! 91 | #else /* ULTRA_SPARC */ 92 | ! ====================================================================== 93 | ! 94 | ! v9 95 | 96 | ENTRY(compare_and_swap) ! standard assembler/ELF prologue 97 | 98 | stbar 99 | cas [%o0],%o1,%o2 ! compare *w with old value and set to new if equal 100 | cmp %o1,%o2 ! did we succeed? 101 | be,a m1 ! yes 102 | mov 1,%o0 ! return true (annulled when no jump) 103 | mov 0,%o0 ! return false 104 | m1: retl 105 | nop 106 | 107 | SET_SIZE(compare_and_swap) ! standard assembler/ELF epilogue 108 | 109 | ! 110 | ! end 111 | ! 112 | ! ====================================================================== 113 | ! 114 | #endif 115 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/perfect.js: -------------------------------------------------------------------------------- 1 | // Some simple testing of new, eval and some string stuff. 2 | 3 | // constructor -- expression array initialization 4 | function ExprArray(n,v) 5 | { 6 | // Initializes n values to v coerced to a string. 7 | for (var i = 0; i < n; i++) { 8 | this[i] = "" + v; 9 | } 10 | } 11 | 12 | 13 | // Print the perfect numbers up to n and the sum expression for n's divisors. 14 | function perfect(n) 15 | { 16 | print("The perfect numbers up to " + n + " are:"); 17 | 18 | // We build sumOfDivisors[i] to hold a string expression for 19 | // the sum of the divisors of i, excluding i itself. 20 | var sumOfDivisors = new ExprArray(n+1,1); 21 | for (var divisor = 2; divisor <= n; divisor++) { 22 | for (var j = divisor + divisor; j <= n; j += divisor) { 23 | sumOfDivisors[j] += " + " + divisor; 24 | } 25 | // At this point everything up to 'divisor' has its sumOfDivisors 26 | // expression calculated, so we can determine whether it's perfect 27 | // already by evaluating. 28 | if (eval(sumOfDivisors[divisor]) == divisor) { 29 | print("" + divisor + " = " + sumOfDivisors[divisor]); 30 | } 31 | } 32 | print("That's all."); 33 | } 34 | 35 | 36 | print("\nA number is 'perfect' if it is equal to the sum of its") 37 | print("divisors (excluding itself).\n"); 38 | perfect(500); 39 | 40 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/plify_jsdhash.sed: -------------------------------------------------------------------------------- 1 | / * Double hashing implementation./a\ 2 | * GENERATED BY js/src/plify_jsdhash.sed -- DO NOT EDIT!!! 3 | / * Double hashing, a la Knuth 6./a\ 4 | * GENERATED BY js/src/plify_jsdhash.sed -- DO NOT EDIT!!! 5 | s/jsdhash_h___/pldhash_h___/ 6 | s/jsdhash\.bigdump/pldhash.bigdump/ 7 | s/jstypes\.h/nscore.h/ 8 | s/jsbit\.h/prbit.h/ 9 | s/jsdhash\.h/pldhash.h/ 10 | s/jsdhash\.c/pldhash.c/ 11 | s/jsdhash:/pldhash:/ 12 | s/jsutil\.h/nsDebug.h/ 13 | s/JS_DHASH/PL_DHASH/g 14 | s/JS_DHash/PL_DHash/g 15 | s/JSDHash/PLDHash/g 16 | s/JSHash/PLHash/g 17 | s/uint32 /PRUint32/g 18 | s/\([^U]\)int32 /\1PRInt32/g 19 | s/uint16 /PRUint16/g 20 | s/\([^U]\)int16 /\1PRInt16/g 21 | s/uint32/PRUint32/g 22 | s/\([^U]\)int32/\1PRInt32/g 23 | s/uint16/PRUint16/g 24 | s/\([^U]\)int16/\1PRInt16/g 25 | s/JSBool/PRBool/g 26 | s/extern JS_PUBLIC_API(\([^()]*\))/NS_COM_GLUE \1/ 27 | s/JS_PUBLIC_API(\([^()]*\))/\1/ 28 | s/JS_DLL_CALLBACK/PR_CALLBACK/ 29 | s/JS_STATIC_DLL_CALLBACK/PR_STATIC_CALLBACK/ 30 | s/JS_NewDHashTable/PL_NewDHashTable/ 31 | s/JS_ASSERT(0)/NS_NOTREACHED("0")/ 32 | s/\( *\)JS_ASSERT(\(.*\));/\1NS_ASSERTION(\2,\n\1 "\2");/ 33 | s/JS_/PR_/g 34 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/prmjtime.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * ***** BEGIN LICENSE BLOCK ***** 4 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | * 6 | * The contents of this file are subject to the Mozilla Public License Version 7 | * 1.1 (the "License"); you may not use this file except in compliance with 8 | * the License. You may obtain a copy of the License at 9 | * http://www.mozilla.org/MPL/ 10 | * 11 | * Software distributed under the License is distributed on an "AS IS" basis, 12 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | * for the specific language governing rights and limitations under the 14 | * License. 15 | * 16 | * The Original Code is Mozilla Communicator client code, released 17 | * March 31, 1998. 18 | * 19 | * The Initial Developer of the Original Code is 20 | * Netscape Communications Corporation. 21 | * Portions created by the Initial Developer are Copyright (C) 1998 22 | * the Initial Developer. All Rights Reserved. 23 | * 24 | * Contributor(s): 25 | * 26 | * Alternatively, the contents of this file may be used under the terms of 27 | * either of the GNU General Public License Version 2 or later (the "GPL"), 28 | * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 29 | * in which case the provisions of the GPL or the LGPL are applicable instead 30 | * of those above. If you wish to allow use of your version of this file only 31 | * under the terms of either the GPL or the LGPL, and not to allow others to 32 | * use your version of this file under the terms of the MPL, indicate your 33 | * decision by deleting the provisions above and replace them with the notice 34 | * and other provisions required by the GPL or the LGPL. If you do not delete 35 | * the provisions above, a recipient may use your version of this file under 36 | * the terms of any one of the MPL, the GPL or the LGPL. 37 | * 38 | * ***** END LICENSE BLOCK ***** */ 39 | 40 | #ifndef prmjtime_h___ 41 | #define prmjtime_h___ 42 | /* 43 | * PR date stuff for mocha and java. Placed here temporarily not to break 44 | * Navigator and localize changes to mocha. 45 | */ 46 | #include 47 | #include "jslong.h" 48 | #ifdef MOZILLA_CLIENT 49 | #include "jscompat.h" 50 | #endif 51 | 52 | JS_BEGIN_EXTERN_C 53 | 54 | typedef struct PRMJTime PRMJTime; 55 | 56 | /* 57 | * Broken down form of 64 bit time value. 58 | */ 59 | struct PRMJTime { 60 | JSInt32 tm_usec; /* microseconds of second (0-999999) */ 61 | JSInt8 tm_sec; /* seconds of minute (0-59) */ 62 | JSInt8 tm_min; /* minutes of hour (0-59) */ 63 | JSInt8 tm_hour; /* hour of day (0-23) */ 64 | JSInt8 tm_mday; /* day of month (1-31) */ 65 | JSInt8 tm_mon; /* month of year (0-11) */ 66 | JSInt8 tm_wday; /* 0=sunday, 1=monday, ... */ 67 | JSInt16 tm_year; /* absolute year, AD */ 68 | JSInt16 tm_yday; /* day of year (0 to 365) */ 69 | JSInt8 tm_isdst; /* non-zero if DST in effect */ 70 | }; 71 | 72 | /* Some handy constants */ 73 | #define PRMJ_USEC_PER_SEC 1000000L 74 | #define PRMJ_USEC_PER_MSEC 1000L 75 | 76 | /* Return the current local time in micro-seconds */ 77 | extern JSInt64 78 | PRMJ_Now(void); 79 | 80 | /* get the difference between this time zone and gmt timezone in seconds */ 81 | extern JSInt32 82 | PRMJ_LocalGMTDifference(void); 83 | 84 | /* Format a time value into a buffer. Same semantics as strftime() */ 85 | extern size_t 86 | PRMJ_FormatTime(char *buf, int buflen, char *fmt, PRMJTime *tm); 87 | 88 | /* Get the DST offset for the local time passed in */ 89 | extern JSInt64 90 | PRMJ_DSTOffset(JSInt64 local_time); 91 | 92 | JS_END_EXTERN_C 93 | 94 | #endif /* prmjtime_h___ */ 95 | 96 | -------------------------------------------------------------------------------- /src/spidermonkey/js/src/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by js3240.rc 4 | // 5 | 6 | // Next default values for new objects 7 | // 8 | #ifdef APSTUDIO_INVOKED 9 | #ifndef APSTUDIO_READONLY_SYMBOLS 10 | #define _APS_NEXT_RESOURCE_VALUE 101 11 | #define _APS_NEXT_COMMAND_VALUE 40001 12 | #define _APS_NEXT_CONTROL_VALUE 1000 13 | #define _APS_NEXT_SYMED_VALUE 101 14 | #endif 15 | #endif 16 | -------------------------------------------------------------------------------- /tests/proxy.pac: -------------------------------------------------------------------------------- 1 | // Go direct for plain hostnames and any host in .manugarg.com domain except 2 | // for www and www.manugarg.com. 3 | // Go via proxy for all other hosts. 4 | 5 | function FindProxyForURL(url, host) { 6 | if ( 7 | (isPlainHostName(host) || dnsDomainIs(host, '.manugarg.com')) && 8 | !localHostOrDomainIs(host, 'www.manugarg.com') 9 | ) 10 | return 'plainhost/.manugarg.com'; 11 | 12 | // Test single quote handling in URL. 13 | if (/'/.test(url)) { 14 | return 'URLHasQuotes'; 15 | } 16 | 17 | // Return externaldomain if host matches .*\.externaldomain\.com 18 | if (/.*\.externaldomain\.com/.test(host)) return 'externaldomain'; 19 | 20 | // Test if DNS resolving is working as intended 21 | if (dnsDomainIs(host, '.google.com') && isResolvable(host)) 22 | return 'isResolvable'; 23 | 24 | // Test if DNS resolving is working as intended 25 | if (dnsDomainIs(host, '.notresolvabledomainXXX.com') && !isResolvable(host)) 26 | return 'isNotResolvable'; 27 | 28 | if (/^https:\/\/.*$/.test(url)) return 'secureUrl'; 29 | 30 | if (isInNet(myIpAddress(), '10.10.0.0', '255.255.0.0')) return '10.10.0.0'; 31 | 32 | if ( 33 | typeof myIpAddressEx == 'function' && 34 | isInNetEx(myIpAddressEx(), '3ffe:8311:ffff/48') 35 | ) 36 | return '3ffe:8311:ffff'; 37 | else return 'END-OF-SCRIPT'; 38 | } 39 | -------------------------------------------------------------------------------- /tests/runtests.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2007 Manu Garg. 2 | # Author: Manu Garg 3 | # 4 | # pacparser is a library that provides methods to parse proxy auto-config 5 | # (PAC) files. Please read README file included with this package for more 6 | # information about this library. 7 | # 8 | # pacparser is free software; you can redistribute it and/or 9 | # modify it under the terms of the GNU Lesser General Public 10 | # License as published by the Free Software Foundation; either 11 | # version 2.1 of the License, or (at your option) any later version. 12 | 13 | # pacparser is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | # Lesser General Public License for more details. 17 | 18 | # You should have received a copy of the GNU Lesser General Public 19 | # License along with this library; if not, write to the Free Software 20 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 21 | # USA. 22 | 23 | import getopt 24 | import glob 25 | import os 26 | import sys 27 | 28 | def module_path(tests_dir): 29 | py_ver = '*'.join([str(x) for x in sys.version_info[0:2]]) 30 | 31 | builddir = os.path.join(tests_dir, '..', 'src', 'pymod', 'build') 32 | print('Build dir: %s', builddir) 33 | print(os.listdir(builddir)) 34 | 35 | return glob.glob(os.path.join(builddir, 'lib*%s' % py_ver))[0] 36 | 37 | def runtests(pacfile, testdata, tests_dir): 38 | try: 39 | pacparser_module_path = module_path(tests_dir) 40 | except Exception: 41 | raise Exception('Tests failed. Could not determine pacparser path.') 42 | if 'DEBUG' in os.environ: print('Pacparser module path: %s' % 43 | pacparser_module_path) 44 | sys.path.insert(0, pacparser_module_path) 45 | 46 | try: 47 | import pacparser 48 | except ImportError: 49 | raise Exception('Tests failed. Could not import pacparser.') 50 | 51 | if 'DEBUG' in os.environ: print('Imported pacparser module: %s' % 52 | sys.modules['pacparser']) 53 | 54 | f = open(testdata) 55 | for line in f: 56 | comment = '' 57 | if '#' in line: 58 | comment = line.split('#', 1)[1] 59 | line = line.split('#', 1)[0].strip() 60 | if not line: 61 | continue 62 | if ('NO_INTERNET' in os.environ and os.environ['NO_INTERNET'] and 63 | 'INTERNET_REQUIRED' in comment): 64 | continue 65 | if 'DEBUG' in os.environ: print(line) 66 | (params, expected_result) = line.strip().split('|') 67 | args = dict(getopt.getopt(params.split(), 'eu:c:')[0]) 68 | if '-e' in args: 69 | pacparser.enable_microsoft_extensions() 70 | if '-c' in args: 71 | pacparser.setmyip(args['-c']) 72 | pacparser.init() 73 | pacparser.parse_pac_file(pacfile) 74 | result = pacparser.find_proxy(args['-u']) 75 | pacparser.cleanup() 76 | if result != expected_result: 77 | raise Exception('Tests failed. Got "%s", expected "%s"' % (result, expected_result)) 78 | print('All tests were successful.') 79 | 80 | 81 | def main(): 82 | tests_dir = os.path.dirname(os.path.join(os.getcwd(), sys.argv[0])) 83 | pacfile = os.path.join(tests_dir, 'proxy.pac') 84 | testdata = os.path.join(tests_dir, 'testdata') 85 | runtests(pacfile, testdata, tests_dir) 86 | 87 | if __name__ == '__main__': 88 | main() 89 | -------------------------------------------------------------------------------- /tests/runtests.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | pushd $(dirname $0) > /dev/null; script_dir=$PWD; popd > /dev/null 4 | 5 | pactester=$script_dir/../src/pactester 6 | pacfile=$script_dir/proxy.pac 7 | testdata=$script_dir/testdata 8 | library_path=$script_dir/../src 9 | export DYLD_LIBRARY_PATH=$library_path:$DYLD_LIBRARY_PATH 10 | export LD_LIBRARY_PATH=$library_path:$LD_LIBRARY_PATH 11 | 12 | lib=$library_path/libpacparser.so.1 13 | 14 | os_arch=$(uname -s | sed /\ /s//_/) 15 | if [ "$os_arch" = "Darwin" ]; then 16 | lib=$library_path/libpacparser.1.dylib 17 | fi 18 | 19 | if test ! -f "$lib"; then 20 | echo "Test failed. pacparser library not found." 21 | exit 1 22 | fi 23 | 24 | while read line 25 | do 26 | comment="${line#*#}" 27 | line="${line%%#*}" 28 | line=${line%"${line##*[^[:space:]]}"} 29 | test -z "$line" && continue 30 | # If machine is not connected to the internet and a test requires internet 31 | # just skip that test. 32 | test ! -z $NO_INTERNET && \ 33 | test "${comment/INTERNET_REQUIRED/}" != "${comment}" && \ 34 | continue 35 | params=${line%%|*} 36 | expected_result=${line##*|} 37 | result=$($pactester -p $pacfile $params) 38 | if [ $? != 0 ]; then 39 | echo "pactester execution failed." 40 | echo "Command tried: $pactester -p $pacfile $params" 41 | echo "Running with debug mode on..." 42 | echo "DEBUG=1 $pactester -p $pacfile $params" 43 | DEBUG=1 $pactester -p $pacfile $params 44 | exit 1 45 | fi 46 | [ $DEBUG ] && echo "Test line: $line" 47 | [ $DEBUG ] && echo "Params: $params" 48 | if [ "$result" != "$expected_result" ]; then 49 | echo "Test failed: got \"$result\", expected \"$expected_result\"" 50 | echo "Command tried: $pactester -p $pacfile $params" 51 | echo "Running with debug mode on..." 52 | echo "DEBUG=1 $pactester -p $pacfile $params" 53 | DEBUG=1 $pactester -p $pacfile $params 54 | exit 1; 55 | fi 56 | done < $testdata 57 | 58 | echo "All tests were successful." 59 | -------------------------------------------------------------------------------- /tests/testdata: -------------------------------------------------------------------------------- 1 | # Command Line Parameters|Expected Result 2 | -c 3ffe:8311:ffff:1:0:0:0:0 -u http://www.somehost.com|3ffe:8311:ffff 3 | -c 0.0.0.0 -u http://www.google.co.in|END-OF-SCRIPT 4 | -u http://host1|plainhost/.manugarg.com 5 | -u http://www1.manugarg.com|plainhost/.manugarg.com 6 | -u http://www.manugarg.org/test'o'rama|URLHasQuotes 7 | -u http://manugarg.externaldomain.com|externaldomain 8 | -u http://www.google.com|isResolvable # INTERNET_REQUIRED 9 | -u http://www.notresolvabledomainXXX.com|isNotResolvable 10 | -u https://www.somehost.com|secureUrl 11 | -c 10.10.100.112 -u http://www.somehost.com|10.10.0.0 12 | -------------------------------------------------------------------------------- /tools/buildmacpackage.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | # 3 | # This script creates a Mac package, that can be directly installed by 4 | # Installer on Mac. 5 | 6 | ver=$1 7 | [ -z $ver ] && echo "Please specify package version." && exit 8 | 9 | # $stage_dir is where we'll install our package files. 10 | stage_dir=/tmp/pacparser_$RANDOM 11 | sudo rm -rf /tmp/pacparser* 12 | mkdir -p $stage_dir 13 | 14 | if [ ! -e src/Makefile ]; then 15 | echo "Call this script from the root of the source directory" 16 | exit 1 17 | fi 18 | 19 | # Build pactester and pacparser library and install in $stage_dir 20 | make -C src 21 | DESTDIR=$stage_dir make -C src install 22 | # Build python module and install it in $stage_dir 23 | make -C src pymod 24 | DESTDIR=$stage_dir make -C src install-pymod 25 | 26 | sudo chown -R root:wheel ${stage_dir} 27 | 28 | pkgbuild --root ${stage_dir} --identifier pacparser --version ${ver} pacparser.pkg 29 | 30 | sudo rm -rf $stage_dir 31 | 32 | # Build disk image 33 | tmp_dir=/tmp/pacparser-$ver-$RANDOM 34 | disk_image=pacparser-$ver.dmg 35 | rm -rf $tmp_dir $disk_image 36 | mkdir $tmp_dir 37 | mv pacparser.pkg $tmp_dir 38 | hdiutil create -srcfolder $tmp_dir pacparser-$ver.dmg 39 | rm -rf $tmp_dir 40 | -------------------------------------------------------------------------------- /tools/generatedocs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | tools_dir=$(dirname $0) 4 | if [ "${tools_dir:0:1}" != "/" ]; then 5 | tools_dir=$PWD/$tools_dir 6 | fi 7 | 8 | docs_dir=$tools_dir/../docs 9 | src_dir=$tools_dir/../src 10 | 11 | tmpdir=$TMPDIR/pacparser_doxygen_temp_$$ 12 | mkdir -p $tmpdir 13 | 14 | cd $tmpdir 15 | 16 | cp $src_dir/pacparser.h . 17 | doxygen $docs_dir/doxygen.config 18 | if [ $? != 0 ]; then 19 | echo "Doxygen returned error. Not continuing." 20 | exit 21 | fi 22 | 23 | mkdir -p $docs_dir/html 24 | 25 | # Fix HTMLs. 26 | mv html/group__pacparser.html $docs_dir/html/pacparser.html 27 | mv html/doxygen.css $docs_dir/html/ 28 | sed -i '' -e 's/group__pacparser.html//g' $docs_dir/html/pacparser.html 29 | # Remove Doxygen logo. 30 | sed -i '' -e '/doxygen\.png/s/^.*$/Doxygen/g' $docs_dir/html/pacparser.html 31 | 32 | mkdir -p $docs_dir/man/man3 33 | mv man/man3/* $docs_dir/man/man3/ 34 | # Remove unnecessary and bad file deprecated.3 35 | rm -f $docs_dir/man/man3/deprecated.3 36 | # Fix man page. 37 | sed -i '' -e 's/pacparser \\\-/pacparser - Library to parse proxy auto-confg (PAC) files./g' $docs_dir/man/man3/*.3 38 | cd - 39 | 40 | echo $tmpdir 41 | # Cleanup temp dir 42 | rm -rf $tmpdir 43 | -------------------------------------------------------------------------------- /tools/package: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | USAGE=" 4 | Usage: $0 [-n] [-v version]\n 5 | -n : Create a new release. Tag the current repository revision as version\n 6 | -v version: Specify the version. If not specified, the latest hg tag is used. \n 7 | This option is required for a new release.\n 8 | " 9 | 10 | while getopts "nv:" flag 11 | do 12 | if [ "$flag" = "n" ]; then 13 | newrelease="yes" 14 | elif [ "$flag" = "v" ]; then 15 | ver=$OPTARG 16 | elif [ "$flag" = "?" ]; then 17 | echo -e $USAGE 18 | exit 2 19 | fi 20 | done 21 | 22 | if [ "$newrelease" = "yes" ]; then 23 | if [ -z "$ver" ];then 24 | echo "Version should be specified while creating a new release." 25 | echo -e $USAGE 26 | exit 2 27 | else 28 | echo -n "Are you sure you want to create a new release and tag the current " 29 | echo -n "repository revision as $ver (y/n): " 30 | read response 31 | if [ $response != "y" ]; then 32 | echo "You said no. Not moving ahead." 33 | exit 0 34 | fi 35 | git tag $ver 36 | fi 37 | fi 38 | 39 | if [ -z "$ver" ]; then 40 | ver=$(git describe --always --tags --candidate=100 |\ 41 | awk -F- 'NR == 1 {print $1 "-" $2}') 42 | fi 43 | 44 | cd $(dirname $0); tools_dir=$PWD; cd - > /dev/null 45 | 46 | pkgdir=$tools_dir/packages/pacparser-$ver; rm -rf $pkgdir*; mkdir -p $pkgdir 47 | pkg=pacparser-${ver}.tar.gz 48 | 49 | mkdir -p $tools_dir/packages 50 | pushd $tools_dir/.. > /dev/null 51 | git archive --format=tar HEAD | (cd $pkgdir && tar xf - --exclude debian) 52 | 53 | # Create a version string. This is used at the time of build. 54 | echo "VERSION=$ver" > $pkgdir/src/version.mk 55 | 56 | # Create the tarball. 57 | pushd $tools_dir/packages > /dev/null 58 | tar czf $(basename $pkg) $(basename $pkgdir) 59 | rm -rf $pkgdir; mkdir -p $pkgdir 60 | popd > /dev/null 61 | 62 | # Create the directory to be used for debian package. 63 | git archive --format=tar HEAD | (cd $pkgdir && tar xf -) 64 | echo "VERSION=$ver" > $pkgdir/src/version.mk 65 | 66 | popd > /dev/null 67 | --------------------------------------------------------------------------------