Update build system

- build-aux.py:
  - Remove commented line
  - Expose '-' for stdin/stdout in setvars (it was implemented but not exposed)

- Makefile:
  - Default to gcpp as preprocessor instead of mcpp.

- BUILD_GUIDE.md:
  - Now both Python 2 and 3 can be used, so remove the version requirement.
  - mcpp is not available in precompiled form for newer Mac processors, so indicate cpp instead.
  - Explain how to modify Makefile for mcpp.
  - Other minor changes
This commit is contained in:
Sei Lisa 2021-12-20 18:36:34 +01:00
parent 071b19d160
commit 0040fbea18
3 changed files with 18 additions and 16 deletions

View file

@ -7,27 +7,29 @@ To create a release version like the ones available for download, you need to ha
### For Linux ### For Linux
- **zip**. It comes in most distributions, e.g. for Debian or Ubuntu use `sudo apt-get install zip`; if it isn't available in yours, try this link: <http://www.info-zip.org/Zip.html#Downloads> - **zip**. It comes in most distributions, e.g. for Debian or Ubuntu use `sudo apt-get install zip`; if it isn't available in yours, try this link: <http://www.info-zip.org/Zip.html#Downloads>
- **Python 2.7**. It comes in most distributions, e.g. for Debian or Ubuntu use `sudo apt-get install python`; if it isn't available in yours, try this link: <https://www.python.org/downloads/>. **Important:** Python 3.x won't work; only Python 2.x will. Usually Python 2 and Python 3 can be installed side-by-side. - **Python**. It comes in most distributions, e.g. for Debian or Ubuntu use `sudo apt-get install python`; if it isn't available in yours, try this link: <https://www.python.org/downloads/>.
- **make**. It comes in most distributions, e.g. for Debian or Ubuntu use `sudo apt-get install make`; if it isn't available in yours, try this link: <https://www.gnu.org/software/make/#download> - **make**. It comes in most distributions, e.g. for Debian or Ubuntu use `sudo apt-get install make`; if it isn't available in yours, try this link: <https://www.gnu.org/software/make/#download>.
- **GNU cpp**. It comes in most distributions, e.g. for Debian or Ubuntu use `sudo apt-get install cpp`. If it isn't available in yours, or you have trouble installing it, you can instead use **mcpp**, which is much more lightweight and is included in most distributions. It is also available at this link: <http://mcpp.sourceforge.net/download.html>. - **GNU cpp**. It comes in most distributions, e.g. for Debian or Ubuntu use `sudo apt-get install cpp`. If it isn't available in yours, or you have trouble installing it, you can instead use **mcpp**, which is much more lightweight and is included in most distributions. It is also available at this link: <http://mcpp.sourceforge.net/download.html>. **gcpp** comes preconfigured by default in Makefile. For **mcpp**, you need to set `PREPROC_KIND=mcpp` and `PREPROC_PATH=mcpp` in the Makefile.
- [**LSL-PyOptimizer**](https://github.com/Sei-Lisa/LSL-PyOptimizer). Currently the latest master branch is used to create the releases, which you can download by clicking on the `Code` button near the top right of the linked page. - [**LSL-PyOptimizer**](https://github.com/Sei-Lisa/LSL-PyOptimizer). Currently the latest master branch is used to create the releases, which you can download by clicking on the `Code` button near the top right of the linked page.
### For Mac OS/X ### For Mac OS/X
- **zip** (comes preinstalled) - **zip** (comes preinstalled)
- **Python 2.7** (comes preinstalled) **Important:** Python 3.x won't work; only Python 2.x will. - **Python** (comes preinstalled)
- **make** - It comes as part of **Xcode** which you can get for free from the App Store. - **make** - It comes as part of the command line develompent tools (Xcode) which you can install for free. Open a terminal and type `make`; if you don't have it installed, it will prompt you to install it. Xcode can also be installed manually from <https://developer.apple.com/>.
- [**mcpp**](http://mcpp.sourceforge.net/download.html). There's a DMG for download. - **cpp** - Should come as part of the command line development tools where **make** is.
- [**LSL-PyOptimizer**](https://github.com/Sei-Lisa/LSL-PyOptimizer). Currently the latest master branch is used to create the releases, which you can download by clicking on the `Code` button near the top right of the linked page. - [**LSL-PyOptimizer**](https://github.com/Sei-Lisa/LSL-PyOptimizer). Currently the latest master branch is used to create the releases, which you can download by clicking on the `Code` button near the top right of the linked page.
### For Windows ### For Windows (x86)
- [**zip**](http://www.info-zip.org/Zip.html#Downloads) - [**zip**](http://www.info-zip.org/Zip.html#Downloads)
- [**Python 2.7**](https://www.python.org/downloads/) **Important:** Python 3.x won't work; only Python 2.x will. - [**Python**](https://www.python.org/downloads/)
- [**make**](http://gnuwin32.sourceforge.net/packages/make.htm#download) - [**make**](http://gnuwin32.sourceforge.net/packages/make.htm#download)
- [**mcpp**](http://mcpp.sourceforge.net/download.html) - [**mcpp**](http://mcpp.sourceforge.net/download.html). `Makefile` comes preconfigured for **gcpp**, therefore you need to edit it by setting `PREPROC_KIND=mcpp` and `PREPROC_PATH=\full\path\to\mcpp`.
- [**LSL-PyOptimizer**](https://github.com/Sei-Lisa/LSL-PyOptimizer). Currently the latest master branch is used to create the releases, which you can download by clicking on the `Code` button near the top right of the linked page. - [**LSL-PyOptimizer**](https://github.com/Sei-Lisa/LSL-PyOptimizer). Currently the latest master branch is used to create the releases, which you can download by clicking on the `Code` button near the top right of the linked page.
For processors other than x86, you need to find the above utilities for your processor.
## Creating the release ## Creating the release
Once you have the required tools, edit the Makefile in the AVsitter2 folder to suit your needs, then using a terminal (also called command interpreter, shell, console... depending on the operating system) change to that folder using `cd <path-to-folder>` and type `make`. That should generate a file called `AVsitter2.zip` with the packaged version for SL, and another file called `AVsitter2-oss.zip` with the packaged version for OpenSim. Once you have the required tools, edit the Makefile in the AVsitter2 folder to suit your needs, then using a terminal (also called command interpreter, shell, console... depending on the operating system) change to that folder using `cd <path-to-folder>` and type `make`. That should generate a file called `AVsitter2.zip` with the packaged version for SL, and another file called `AVsitter2-oss.zip` with the packaged version for OpenSim.

View file

@ -2,18 +2,18 @@
# Full path to Python. For Windows this is typically # Full path to Python. For Windows this is typically
# C:\Python27\python.exe; if it is in your path you don't need to change it. # C:\Python27\python.exe; if it is in your path you don't need to change it.
PYTHON=python PYTHON=python3
# Full path to main.py in the optimizer. Depends on where it was unpacked. # Full path to main.py in the optimizer. Depends on where it was unpacked.
OPTIMIZER=/l/pyoptimizer/main.py OPTIMIZER=/l/pyoptimizer/main.py
# Which preprocessor to use. Use 'gcpp' for GNU cpp (typical on Linux); # Which preprocessor to use. Use 'gcpp' for GNU cpp (typical on Linux/OSX);
# use 'mcpp' for mcpp. # use 'mcpp' for mcpp.
PREPROC_KIND=mcpp PREPROC_KIND=gcpp
# Full path to the preprocessor. Depends on where you have downloaded it. # Full path to the preprocessor. Depends on where you have downloaded it.
# If the preprocessor is mcpp and it is in your path, you can leave it as is. # If the preprocessor is GNU cpp and it is in your path, leave it as cpp.
PREPROC_PATH=mcpp PREPROC_PATH=cpp
# Full path to the zip program (zip.exe for Windows). Depends on where you # Full path to the zip program (zip.exe for Windows). Depends on where you
# have downloaded it. If it is in your path you don't need to change it. # have downloaded it. If it is in your path you don't need to change it.

View file

@ -101,7 +101,6 @@ def setvars(filename, *settings):
return 1 return 1
values[match.group(1)] = match.group(2) values[match.group(1)] = match.group(2)
#sys.stderr.write(filename + '\n')
if filename is not None: if filename is not None:
f = open(filename, "r") f = open(filename, "r")
else: else:
@ -167,7 +166,8 @@ def main(argc, argv):
return rm(argv[2:]) return rm(argv[2:])
if cmd == 'setvars': if cmd == 'setvars':
return setvars(argv[2], *argv[3:]) filename = None if argv[2] == '-' else argv[2]
return setvars(filename, *argv[3:])
if cmd == 'oss-process': if cmd == 'oss-process':
if argc > 3: if argc > 3: