Skip to content

CommandLineOptions

Positron edited this page Aug 11, 2017 · 7 revisions

Usage

./bcc [options] source-file [object-file]

Options

Option Description
-acc-err On error, create an error file like one created by the acc compiler.
-acc-stats Show compilation statistics like those shown by the acc compiler.
-h Show help information.
-i directory Add a directory to search in for files.
-I directory
-one-column Start column position at 1. Default is 0.
-tab-size size Specify the width of the tab character.
-strip-asserts Do not include asserts in object file. (Asserts will not be executed at run-time.)
-E Do preprocessing only.
-D name Create a macro with the specified name. The macro will be defined as 1. The macro will only be available during the preprocessing of the main library.
-x language Specify the language of the source file. The language must be one of the following:
  • acs (ACS as defined by the latest version of acc)
  • acs95 (ACS as originally defined for Hexen)
  • bcs (See BCS section)
If a language is not explicitly specified, the compiler will determine the language based on the file extension of the source file. If the file extension is .bcs, the language will be bcs; otherwise, acs.
-l library Create a link to the specified library. This is the same as: #linklibrary "library"

Cache options

Option Description
-cache Enable caching of libraries. Only imported libraries are cached.
-cache-dir directory Store cache-related files in the specified directory. If one is not specified, a system-default temporary directory will be used.
-cache-lifetime
   duration
Keep a library cached for the specified duration. The duration is measured in hours.
-cache-print Show the contents of the cache.
-cache-clear Delete all cached library files.

Using BCC with SLADE

SLADE supports using BCC as an ACS compiler. The following sections describe how to make SLADE use BCC.

Prelude

Before we set up BCC with SLADE, we need to do a couple of things:

  1. Get the latest version of BCC

    Download the latest version of BCC. Create a new folder, naming it whatever you want. Then extract the contents of the ZIP file into the folder you just created.

  2. Set up the zcommon.acs files

    In your BCC folder, make sure the lib\acs\ folder contains the zcommon.acs files. You can get the latest version of the zcommon.acs files here:

Setting up BCC with SLADE

The following steps describe how to configure SLADE to use BCC:

  1. Start SLADE
  2. Open the SLADE Preferences window
  3. Open the Scripting page, then open the ACS page
  4. Press the Browse button, then go to your BCC folder and select the BCC executable file
  5. Press Apply

Compiling BCS code

By default, SLADE will execute BCC in ACS mode. At the time of this writing, using the latest available version of SLADE (3.1.2 beta 4), there is no proper way to pass command-line arguments to a compiler, which is needed in order to select the BCS mode. There is a hacky way of making SLADE compile BCS code. The following steps describe the procedure:

  1. Make sure SLADE is closed
  2. Open the SLADE configuration file

    On my Windows machine, the configuration file is located at the following path, where account is my account name:

    C:\Users\acount\AppData\Roaming\SLADE3\slade3.cfg
  3. In the configuration file, locate the line for the path_acc_libs configuration parameter

    The line will look similar to the following:

    path_acc_libs                    ""

    There might be data between the quotation marks. This is fine. You can proceed to the next step.

  4. Add .\" -x bcs -one-column -i \". between the quotation marks

    The line should now look like this:

    path_acc_libs                    ".\" -x bcs -one-column -i \"."

    If there is already data between the quotation marks, then go to the end of the data, add a ;, then add the above data. The line should then look like this:

    path_acc_libs                    "some_other_data;.\" -x bcs -one-column -i \"."

    Optional: if you want to pass more arguments to the compiler, add them after the -one-column argument.

  5. Save and close the configuration file
  6. Start SLADE
Removing the hack
  1. Start SLADE
  2. Open the SLADE Preferences window
  3. Open the Scripting page, then open the ACS page
  4. In the Include Paths section, select the entry which has the following value: ".\" -x bcs -one-column -i \"."
  5. Press Remove
  6. Press Apply
  7. Restart SLADE