その他 /

bacon BASIC コンバータ パラメータ

  • -c: バイナリー(主に実行ファイル)を作成する C 言語コンパイラーを指定します。 デフォルト値は「gcc」です。
    例: ./bacon -c cc prog …… C コンパイラーに cc を呼びます。
  • -l: C 言語リンカーライブラリのパスを指定します。
  • -o: C 言語コンパイラのオプションを指定します。
  • -i: C 言語向けの挿入ファイルを指定します。一緒にコンパイルされます。
  • -d: 生成する C 言語ファイルの生成場所を指定します。デフォルトはカレントディレクトリです。
  • -x: C 言語ソースを元に GETTEXT 文字列を出力します。例えば LOCALE による多国語対応で用います。
  • -f: プログラムの静的オブジェクトを生成します。
  • -n: コンバート後の C 言語コンパイルを行わなくします。C 言語の中間コードが残されます。
  • -j: invoke C preprocessor to interpret C macros which were added to BaCon source code
  • -p: 生成時に用いた C 言語のファイルを削除しないようにします。通常は生成時の C 言語ファイルを実行ファイル生成後に削除します。
  • -b: コンパイル作業後に即実行します。 (実行ファイル化した bacon で使用可能)
  • -w: store commandline settings in a configurationfile. This file will be used in subsequent invocations of BaCon (not applicable for the GUI version)
  • -v: 実行している bacon のバージョンを表示します。
  • -h: プロンプトで使用できる全てのオプションを表示します。-? を使用する事も可能です。

So how to pass compiler and linker flags to the C compiler? Here are a few examples.

  • Convert and compile program with debug symbols: ./bacon -o -g yourprogram.bac
  • Convert and compile program , optimize and strip: ./bacon -o -O2 -o-s yourprogram.bac
  • Convert and compile program and export functions as symbols: ./bacon -o -export-dynamic yourprogram.bac
  • Convert and compile program using TCC and export functions as symbols: ./bacon -c tcc -o -rdynamic yourprogram.bac
  • Convert and compile program forcing 32bit and optimize for current platform: ./bacon -o -m32 -o -mtune=native yourprogram.bac
  • Convert and compile program linking to a particular library: ./bacon -l somelib yourprogram.bac
  • Convert and compile program including an additional C header file: ./bacon -i header.h yourprogram.bac