本記事では「 base-devel 及び mingw-w64-x86_64-toolchain 導入済みの MSYS2 」に類似のクロス開発環境の構築をもきゅ目標としています。
# 無 保 証 で す
当方執筆の技術情報に関するライセンス、免責事項、禁止事項
3行でまとめられず申し訳ない、つきましては今少し時間と予算をいただければ……
ArchWSL
https://github.com/yuk7/ArchWSL/blob/master/README.ja.md
yay
https://github.com/Jguer/yay
Mingw-w64 - GCC for Windows 64 & 32 bits[mingw-w64]
http://mingw-w64.org/doku.php
MinGW パッケージガイドライン - ArchWiki
https://wiki.archlinux.org/index.php/MinGW_package_guidelines
https://wiki.archlinux.jp/index.php/MinGW_%E3%83%91%E3%83%83%E3%82%B1%E3%83%BC%E3%82%B8%E3%82%AC%E3%82%A4%E3%83%89%E3%83%A9%E3%82%A4%E3%83%B3
```$HOME/.bashrc``` に書き加えて使用して下さい
# cross-compiling environment
deactivate-mingw64 () {
unset CC
unset CFLAGS
unset CXX
unset CXXFLAGS
unset CPP
unset CPPFLAGS
unset LDFLAGS
unset PKG_CONFIG
unset PKG_CONFIG_PATH
export PATH=$(echo $PATH | sed 's/\/usr\/x86_64-w64-mingw32\/bin://')
export PS1=$(echo $PS1 | sed -e 's/(MinGW64) //' -e 's/ $//')" "
}
activate-mingw64 () {
export CC=/usr/sbin/x86_64-w64-mingw32-gcc
export CFLAGS="-O2 -pipe -fno-plt -fexceptions --param=ssp-buffer-size=4 -static"
export CXX=/usr/sbin/x86_64-w64-mingw32-g++
export CXXFLAGS="-O2 -pipe -fno-plt -fexceptions --param=ssp-buffer-size=4 -static"
export CPP=/usr/sbin/x86_64-w64-mingw32-cpp
export CPPFLAGS="-D_FORTIFY_SOURCE=2 -I/usr/x86_64-w64-mingw32/include"
export LDFLAGS="-Wl,-O1,--sort-common,--as-needed -L/usr/x86_64-w64-mingw32/lib"
export PKG_CONFIG=/usr/sbin/x86_64-w64-mingw32-pkg-config
export PKG_CONFIG_PATH=/usr/x86_64-w64-mingw32/lib/pkgconfig
export PATH="/usr/x86_64-w64-mingw32/bin:$PATH"
export PS1='(MinGW64) '"$PS1"
echo
echo "SYSTEM INFORMATION:"
uname -a
echo
echo "VERSION OF C COMPILER:"
$CC --version
echo
echo "VERSION OF C++ COMPILER:"
$CXX --version
echo
}
参考とした文献
参考とした文献
概要
MSYS2 はその基盤として Cygwin を POSIX 互換機能の提供に1、pacman をパッケージ管理機能の提供に2用いていますが、そこを ArchWSL と yay で差し替えてみるのが本記事の趣旨です。
なお、WSL1(及び 2)は POSIX 互換機能と呼ぶよりも Linux 互換機能と呼ぶ方が自然かもしれません。もしかすると Android-x86 も行けるかな?
ところで、MinGW-w64 公式サイトのダウンロードページの記述を見ると、パッケージの充実度は一位が MSYS2 で二位が Arch Linux(の AUR)のようでした(many > 305)。
2019 年 11 月現在 AUR の "Mingw-w64" で始まるパッケージを簡単に数取りしたところ、614 を数えました。順調に増えているようです。
AUR (en) - Search Criteria: mingw-w64
https://aur.archlinux.org/packages/?K=mingw-w64
yay -Ss mingw-w64 | grep "aur/" | wc -l
614
MAN/INFOPAGE
MSYS2 の場合、https://github.com/msys2/MINGW-packages の mingw-w64-<ソフトウェア名> であるフォルダを数えたところ 1470 ありました。
Search results for "mingw-w64" - Base Packages - MSYS2 Packages
https://packages.msys2.org/search?t=pkg&q=mingw-w64
git clone https://github.com/msys2/MINGW-packages.git
cd MINGW-packages
ls -l | grep mingw-w64 | wc -l
1470
MAN/INFOPAGE
参考とした文献
参考とした文献
POSIX 互換レイヤーを噛ませない場合
MinGW-W64 の Online Installer による環境構築
- MinGW-W64 Online Installer で MinGW-W64 をインストール
- cmake の Windows 版を公式サイトからダウンロード&インストール
- ninja の Windows 版を公式サイトからダウンロード&解凍& PATH を通す
MinGW-W64 の使い方
GNU Autotools 系を導入する場合、GnuWin32 等からダウンロードする、MSYS2 の MinGW64 サブシステムから拝借する等します。
環境の立ち上げは、mingw-w64.bat
の実行によって行います。インストール時の選択次第ですが、C:\Program Files\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw-w64.bat
等として存在します。
CMake は cmake -G "MinGW Makefiles" -D CMAKE_BUILD_TYPE=Release ..
等で実行、make
は MinGW-W64 Online Installer により導入され、 mingw32-make
コマンドとして存在します。必要なら make.exe
としてシンボリックリンクを作成しても良いかもしれません 3 4 5 6 。
Ninja を使う場合は mingw-w64.bat
を編集し ninja.exe
が存在するフォルダをパスに追加するか、もしくは mingw-w64.bat
で開いた端末から where mingw32-make
を実行、 表示された mingw32-make.exe
が存在するのと同じフォルダに ninja.exe
をコピー&ペーストしておきます。
利点と課題
このようにして構築した環境はシステム構成が単純化されることでエラー発生時の問題の切り分けが容易くなることが期待出来る反面、UNIX シェルを含まないため configure スクリプトの実行に支障があります。もしもシェルスクリプトを PowerShell が理解出来る、ないし configure スクリプトを PowerShell スクリプトに変換出来るならば簡単で良いのですが。
※ その後アヒルさんに尋ねたところ、Autotools to CMake なコンバータ7 8 が引っ掛かりました。
参考とした文献
参考とした文献
Mingw-w64 以外のアプローチ
Linux 上で exe ファイルを生成する場合、Mingw-w64 以外では .NET を用いるやり方が考えられます。後者を扱う場合の選択肢として Mono や .NET Core があります。
Home | Mono
https://www.mono-project.com/
.NET | Free. Cross-platform. Open Source.
https://dotnet.microsoft.com/
参考とした文献
参考とした文献
ArchWSL の導入
公式サイト
https://git.io/archwsl
日本語README
https://github.com/yuk7/ArchWSL/blob/master/README.ja.md
1. Known issues を読む
Known issues · yuk7/ArchWSL Wiki · GitHub
https://github.com/yuk7/ArchWSL/wiki/Known-issues
Known issues · yuk7/wsldl Wiki · GitHub
https://github.com/yuk7/wsldl/wiki/Known-issues
2. GitHub のリリースページから ArchWSL-AppX_<バージョン>_x64.appx 及び ArchWSL-AppX_<バージョン>_x64.cer をダウンロードする
3. ArchWSL-AppX_<バージョン>_x64.cer をインポートする
-
ArchWSL-AppX_<バージョン>_x64.cer を右クリックし、「証明書のインストール(I)」
-
「開いているファイル - セキュリティの警告」ダイアログで[開く(O)]
-
「証明書のインポートウィザード」が起動するので以下の手順で証明書をインポート
-
保存場所 => ローカル コンピュータ(L)=> [次へ(N)]
-
証明書ストア => 証明書をすべて次のストアに配置する(P)=> [参照(R)]
-
証明書ストアの選択 => 信頼されたルート証明機関 => [OK]
-
証明書ストア => [次へ(N)]=> [完了(F)]
-
正しくインポートされました => [OK]
スクリーンショット
出典:
4. ArchWSL-AppX_<バージョン>_x64.appx をインストールする
ArchWSL-AppX_<バージョン>_x64.appx をダブルクリックし、App Installer でインストールする。
5. ArchWSL を立ち上げ、基本的な環境の構築作業を行う
passwd # ルートパスワードを設定する
EDITOR=nano visudo # 用途に応じたアンコメントを行い sudo を設定する
useradd -m -G wheel -s /bin/bash hogefuga # ユーザーを追加する(hogefuga は使いたいユーザー名に置き換える)
passwd hogefuga # ユーザー hogefuga に新規パスワードを付与する
exit
MAN/INFOPAGE
@REM hogefuga を通常使うユーザーに指定する。
Arch.exe config --default-user hogefuga
exit
MAN/INFOPAGE
EXIT
EXIT /?
CMD.EXE プログラム (コマンド インタープリター) またはバッチ スクリプトを終了
します。
EXIT [/B] [終了コード]
/B CMD.EXE ではなく、現在のバッチ スクリプトを終了するように指定
します。バッチ スクリプトの外から実行された場合、CMD.EXE を終
了させます。
終了コード 数値を指定します。/B が指定されている場合、ERRORLEVEL にその
数値を設定します。CMD.EXE 終了をする場合、プロセス終了コードに
その数値を設定します。
# pacman を使うための準備を行う
sudo pacman-key --init
sudo pacman-key --populate
sudo pacman -Syuu
MAN/INFOPAGE
ArchWSL における systemd や systemctl
systemd/systemctl - Known issues · yuk7/ArchWSL Wiki · GitHub
https://github.com/yuk7/ArchWSL/wiki/Known-issues#systemdsystemctl
備考
-
この節の内容は、ほぼ How To Setup そのままです。
-
wheel グループは sudo の許可・不許可に関わるグループ名です。
-
自分が躓いた部分:useradd ではユーザー名に大文字が使えません(Windows や MSYS2 だと大文字のユーザー名も O.K.)。初歩的なことで暫く悩んでしまったよワトソン君。
関連する文献
関連する文献
初期化
ArchWSL のインストール直後の状態への初期化はコマンドプロンプトや PowerShell から、Arch.exe clean
です。これを実行してしまうとバックアップを取っていないデータは失われてしまい元に戻せません。よって事前に Arch.exe backup
しておくと良いでしょう。詳細は公式サイト及び Arch.exe help
で確認して下さい。
※ Arch.exe clean
実行後に再度 Arch.exe
を実行することで ArchWSL 環境が再構築されます。
参考とした文献
参考とした文献
REM /?
おまけ
sudo ln -s /mnt/c /c
MAN/INFOPAGE
※ FHS に叱られる……(´・ω・`)
/etc/sudoers の編集とパスワードなしの sudo の許可
yay による基本的なパッケージ群のビルド&インストール作業が終わるまで、sudo でパスワードを要求しないよう変更しておきます。作業終了後に元に戻すのを忘れずに。
su -l -c "EDITOR=nano visudo"
MAN/INFOPAGE
## Same thing without a password
# %wheel ALL=(ALL) NOPASSWD: ALL
## Uncomment to allow members of group wheel to execute any command
# %wheel ALL=(ALL) ALL
関連する文献
関連する文献
基本的な開発パッケージ群の導入
sudo pacman -Syu
sudo pacman -S autoconf automake binutils bison file findutils flex gawk gcc gettext grep groff gzip libtool m4 make pacman patch pkgconf sed sudo texinfo util-linux which
MAN/INFOPAGE
sudo pacman -S base-devel
で一括インストールしても良いのですが、その場合バージョン固定された fakeroot(fakeroot-tcp)をアップデートしないように気を付けて下さい。
```sudo pacman -S base-devel```
$ sudo pacman -S base-devel
:: fakeroot is in IgnorePkg/IgnoreGroup. Install anyway? [Y/n] n
:: There are 24 members in group base-devel:
:: Repository core
1) autoconf 2) automake 3) binutils 4) bison 5) file 6) findutils 7) flex 8) gawk 9) gcc 10) gettext
11) grep 12) groff 13) gzip 14) libtool 15) m4 16) make 17) pacman 18) patch 19) pkgconf 20) sed 21) sudo
22) texinfo 23) util-linux 24) which
Enter a selection (default=all):
warning: file-5.37-3 is up to date -- reinstalling
warning: findutils-4.7.0-1 is up to date -- reinstalling
warning: gawk-5.0.1-1 is up to date -- reinstalling
warning: gettext-0.20.1-2 is up to date -- reinstalling
warning: grep-3.3-2 is up to date -- reinstalling
warning: groff-1.22.4-1 is up to date -- reinstalling
warning: gzip-1.10-2 is up to date -- reinstalling
warning: pacman-5.2.0-2 is up to date -- reinstalling
warning: sed-4.7-2 is up to date -- reinstalling
warning: sudo-1.8.29-1 is up to date -- reinstalling
warning: util-linux-2.34-3 is up to date -- reinstalling
warning: which-2.21-4 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...
Packages (28) gc-8.0.4-2 guile-2.2.6-1 libatomic_ops-7.6.10-1 libmpc-1.1.0-1 autoconf-2.69-5 automake-1.16.1-1
binutils-2.33.1-1 bison-3.4.2-1 file-5.37-3 findutils-4.7.0-1 flex-2.6.4-2 gawk-5.0.1-1 gcc-9.2.0-3
gettext-0.20.1-2 grep-3.3-2 groff-1.22.4-1 gzip-1.10-2 libtool-2.4.6+42+gb88cebd5-6 m4-1.4.18-2
make-4.2.1-3 pacman-5.2.0-2 patch-2.7.6-7 pkgconf-1.6.3-2 sed-4.7-2 sudo-1.8.29-1 texinfo-6.7-1
util-linux-2.34-3 which-2.21-4
Total Download Size: 57.13 MiB
Total Installed Size: 282.46 MiB
Net Upgrade Size: 234.00 MiB
:: Proceed with installation? [Y/n]
nano には “nano-syntax-highlighting” が便利です。
sudo pacman -S nano-syntax-highlighting
MAN/INFOPAGE
# nano-syntax-highlighting-git の導入後メッセージより引用
==> IMPORTANT!!!
==> To prevent overwriting your existing configuration, nanorc
==> was installed to /usr/share/nano-syntax-highlighting/nanorc.sample
==>
==> To install you should add the languages you want to your nano configuration file, system-wide or user-specific
==> system-wide: $ echo "include /usr/share/nano-syntax-highlighting/*.nanorc" >> /etc/nanorc
==> user-specific: $ echo "include /usr/share/nano-syntax-highlighting/*.nanorc" >> ~/.nanorc
ArchWSL にプリインストールされている fakeroot-tcp について
Known Issues の fakeroot セクションより引用
fakeroot
fakeroot is using SYSV IPC by default. but WSL does not support it now.
You can use fakeroot-tcp package instead.
Download fakeroot-tcp-1.23-1-x86_64.pkg.tar.xz and run pacman -U fakeroot-tcp-1.23-1-x86_64.pkg.tar.xz to install.
プリインストール版 fakeroot-tcp の情報
$ pacman -Qi fakeroot-tcp
Name : fakeroot-tcp
Version : 1.23-1
Description : Tool for simulating superuser privileges,with tcp ipc
Architecture : x86_64
URL : http://packages.debian.org/fakeroot
Licenses : GPL
Groups : None
Provides : fakeroot=1.23-1
Depends On : glibc filesystem sed util-linux sh
Optional Deps : None
Required By : None
Optional For : None
Conflicts With : fakeroot
Replaces : None
Installed Size : 234.00 KiB
Packager : Unknown Packager
Build Date : Tue 21 Aug 2018 12:06:49 AM JST
Install Date : Fri 11 Oct 2019 01:21:57 AM JST
Install Reason : Explicitly installed
Install Script : Yes
Validated By : None
※ fakeroot が正常動作しない場合、yay が動作不良を起こすものと思われます。
関連する文献
関連する文献
yay の導入
sudo pacman -Syu
sudo pacman -S git go
cd
mkdir Downloads
cd Downloads
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si
MAN/INFOPAGE
yay は一般ユーザーとして実行します。root として実行しようとすると Please avoid running yay as root/sudo.
と警告を発します。また、yay では AUR のリポジトリも Arch 標準のリポジトリも両方共に扱えます。
また、プレコンパイルドバージョンがあるので、そちらの PKGBUILD をローカルに落として buildpkg -si
makepkg -si
しても良いかもしれません9。
出典
関連する文献
関連する文献
基本的な Mingw-w64 開発パッケージ群の導入
yay
yay -S mingw-w64-crt-bin mingw-w64-binutils-bin mingw-w64-winpthreads-bin mingw-w64-headers-bin mingw-w64-gcc-bin mingw-w64-pkg-config mingw-w64-pdcurses-win32a mingw-w64-gdb mingw-w64-tools mingw-w64-libtool mingw-w64-configure mingw-w64-gc mingw-w64-flex-wrapper mingw-w64-gettext
MAN/INFOPAGE
ビルドエラーについて
現在は修正されています。
2019年11月11日15時現在、mingw-w64-tools が sha256sum エラーを起こします。MinGW-W64 の公式がリビジョンを上げずに同じ名前でファイルを更新してしまったっぽい?(ないとは思うけどクラッキングだったら嫌だなぁ)
一応の回避策として、mingw-w64-tools の構築依存を全部入れた上で AUR から PKGBUILD を落として sha256sum を書き換えることでなんとかなりそうです。
~~mingw-w64-tools のビルドエラー~~
$ git clone https://aur.archlinux.org/mingw-w64-tools.git
$ cd mingw-w64-tools
$ makepkg -si
==> Making package: mingw-w64-tools 7.0.0-1 (Mon 11 Nov 2019 02:30:39 PM JST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
-> Downloading mingw-w64-v7.0.0.tar.bz2...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 18014 100 18014 0 0 13284 0 0:00:01 0:00:01 --:--:-- 13274
100 18001 100 18001 0 0 10676 0 0:00:01 0:00:01 --:--:-- 10676
100 18076 100 18076 0 0 9533 0 0:00:01 0:00:01 --:--:-- 9533
100 389 100 389 0 0 126 0 0:00:03 0:00:03 --:--:-- 428
100 8858k 100 8858k 0 0 1187k 0 0:00:07 0:00:07 --:--:-- 2070k
-> Downloading mingw-w64-v7.0.0.tar.bz2.sig...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 18021 100 18021 0 0 13672 0 0:00:01 0:00:01 --:--:-- 13683
100 18008 100 18008 0 0 12069 0 0:00:01 0:00:01 --:--:-- 12069
100 18084 100 18084 0 0 10893 0 0:00:01 0:00:01 --:--:-- 0
100 397 100 397 0 0 140 0 0:00:02 0:00:02 --:--:-- 1464
100 148 100 148 0 0 41 0 0:00:03 0:00:03 --:--:-- 4933
==> Validating source files with sha256sums...
mingw-w64-v7.0.0.tar.bz2 ... FAILED
mingw-w64-v7.0.0.tar.bz2.sig ... Skipped
==> ERROR: One or more files did not pass the validity check!
$ sha1sum mingw-w64-v7.0.0.tar.bz2
25940043c4541e3e59608dead9b6f75b5596d606 mingw-w64-v7.0.0.tar.bz2
$ md5sum mingw-w64-v7.0.0.tar.bz2
7cd9b09be0b2c658ce200c4c43b59b27 mingw-w64-v7.0.0.tar.bz2
$ sha256sum mingw-w64-v7.0.0.tar.bz2
aa20dfff3596f08a7f427aab74315a6cb80c2b086b4a107ed35af02f9496b628 mingw-w64-v7.0.0.tar.bz2
$ cat PKGBUILD | grep sha256sums
sha256sums=('f5c9a04e1a6c02c9ef2ec19b3906ec4613606d1b5450d34bbd3c4d94ac696b3b'
sha256sum の他に PKGBUILD 中の v6.0.0 も v7.0.0 に書き換えるとビルドが通りました。
備考
- **mingw-w64-libiconv の選択肢について:**mingw-w64-win-iconv は現在メンテナ不在のため、mingw-w64-libiconv を選択するのが良さそうです。
```$ yay -Ss mingw-w64-libiconv; yay -Ss mingw-w64-win-iconv```
$ yay -Ss mingw-w64-libiconv
aur/mingw-w64-libiconv 1.16-1 (+32 0.22%)
Provides GNU libiconv.so and libcharset.so (mingw-w64)
$ yay -Ss mingw-w64-win-iconv
aur/mingw-w64-win-iconv 0.0.8-1 (+3 0.00%) (Orphaned)
Iconv implementation using Win32 API (mingw-w64)
-
mingw-w64-x86_64-toolchain に所属するパッケージのリスト
https://packages.msys2.org/group/mingw-w64-x86_64-toolchain -
-bin で終わっているものはコンパイル済みバイナリのパッケージであり、これらを選択することで yay の実行時間の短縮が期待できます。一方でソースからビルドする場合はビルドオプションを柔軟に指定出来るものもありますし、どちらが優れているかは求めるものによると思います。
AUR に見つからなかったパッケージ(2019年11月時点)
mingw-w64-x86_64-libmangle-git
mingw-w64-x86_64-winstorecompat-git
リストに +α したパッケージ
base-devel インストール時に導入されるパッケージに対応する Mingw-w64 版パッケージ
mingw-w64-libtool
mingw-w64-configure
mingw-w64-gc
mingw-w64-flex-wrapper
mingw-w64-gettext
※ mingw-w64-libmpc は wine 関連の大量の依存関係を引き連れるのでリストへの採用を見送りました。
clang
mingw-w64-clang-git
MinGW clang wrapper (wclang)
yay
yay -S mingw-w64-clang-git
MAN/INFOPAGE
$HOME/.bashrc 用環境設定関数
activate-mingw64 で MinGW64 環境の立ち上げ、deactivate-mingw64 で MinGW64 環境の終了です。主に configure や cmake が使えないソフトウェア用。
MinGW64 環境を立ち上げた状態から yay を実行しないで下さい。ビルドの失敗や、生成されるバイナリの変質が起こるかもしれません。
# cross-compiling environment
deactivate-mingw64 () {
unset CC
unset CFLAGS
unset CXX
unset CXXFLAGS
unset CPP
unset CPPFLAGS
unset LDFLAGS
unset PKG_CONFIG
unset PKG_CONFIG_PATH
export PATH=$(echo $PATH | sed 's/\/usr\/x86_64-w64-mingw32\/bin://')
export PS1=$(echo $PS1 | sed -e 's/(MinGW64) //' -e 's/ $//')" "
}
activate-mingw64 () {
export CC=/usr/sbin/x86_64-w64-mingw32-gcc
export CFLAGS="-O2 -pipe -fno-plt -fexceptions --param=ssp-buffer-size=4 -static"
export CXX=/usr/sbin/x86_64-w64-mingw32-g++
export CXXFLAGS="-O2 -pipe -fno-plt -fexceptions --param=ssp-buffer-size=4 -static"
export CPP=/usr/sbin/x86_64-w64-mingw32-cpp
export CPPFLAGS="-D_FORTIFY_SOURCE=2 -I/usr/x86_64-w64-mingw32/include"
export LDFLAGS="-Wl,-O1,--sort-common,--as-needed -L/usr/x86_64-w64-mingw32/lib"
export PKG_CONFIG=/usr/sbin/x86_64-w64-mingw32-pkg-config
export PKG_CONFIG_PATH=/usr/x86_64-w64-mingw32/lib/pkgconfig
export PATH="/usr/x86_64-w64-mingw32/bin:$PATH"
export PS1='(MinGW64) '"$PS1"
echo
echo "SYSTEM INFORMATION:"
uname -a
echo
echo "VERSION OF C COMPILER:"
$CC --version
echo
echo "VERSION OF C++ COMPILER:"
$CXX --version
echo
}
MAN/INFOPAGE
参考とした文献
mpg123 と midnightcommander 及び zangband の ./configure --help より
System types:
--build=BUILD configure for building on BUILD [guessed]
--host=HOST cross-compile to build programs to run on HOST [BUILD]
Some influential environment variables:
CC C compiler command
CFLAGS C compiler flags
LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
nonstandard directory <lib dir>
LIBS libraries to pass to the linker, e.g. -l<library>
CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
you have headers in a nonstandard directory <include dir>
CPP C preprocessor
PKG_CONFIG path to pkg-config utility
PKG_CONFIG_PATH
directories to add to pkg-config's search path
PKG_CONFIG_LIBDIR
path overriding pkg-config's built-in search path
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
cat /usr/bin/x86_64-w64-mingw32-configure
#!/bin/sh
# check if last arg is a path to configure, else use parent
for last; do true; done
if test -x "${last}/configure"; then
config_path="$last"
else
config_path=".."
fi
default_mingw_pp_flags="-D_FORTIFY_SOURCE=2"
default_mingw_compiler_flags="-O2 -pipe -fno-plt -fexceptions --param=ssp-buffer-size=4"
default_mingw_linker_flags="-Wl,-O1,--sort-common,--as-needed"
export CPPFLAGS="${MINGW_CPPFLAGS:-$default_mingw_pp_flags $CPPFLAGS}"
export CFLAGS="${MINGW_CFLAGS:-$default_mingw_compiler_flags $CFLAGS}"
export CXXFLAGS="${MINGW_CXXFLAGS:-$default_mingw_compiler_flags $CXXFLAGS}"
export LDFLAGS="${MINGW_LDFLAGS:-$default_mingw_linker_flags $LDFLAGS}"
${config_path}/configure \
--host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --build="$CHOST" \
--prefix=/usr/x86_64-w64-mingw32 --libdir=/usr/x86_64-w64-mingw32/lib --includedir=/usr/x86_64-w64-mingw32/include \
--enable-shared --enable-static "$@"
コンパイラオプションについて
主に JM Project の Man page of GCC 及び Using the GNU Compiler Collection (GCC) より引用しています。
CFLAGS,CXXFLAGS で指定したもの
CFLAGS,CXXFLAGS で指定したもの
-O2
-O1
最適化を行います。最適化コンパイルは幾分長めの処理時間と、大きな関数に対 する非常に多くのメモリを必要とします。
`-O' が指定されなかった場合は、コンパイラの目標はコンパイルのコストを 低減することや、目的の結果を得るためのデバッグを可能とすることに置かれ ます。それぞれの文は独立しています。つまり、ブレークポイントでプログラムを 停止させることによって、任意の変数に新し い値を代入したり、プログラムカウンタを他の文へと変更することを可能とし、 そのソースコードにプログラマが望む正しい結果を得ることを可能にします。
`-O' を指定しなかった場合は、register と宣言した変数のみがレジスタへと割り当てられます。コンパイルの結果と して得られるコードは、PCC を `-O' なしで使用した場合と比較して若干良くないものとなります。
`-O' が指定されると、コンパイラはコードのサイズと実行時間を減少させる ことを試みます。
`-O' を指定することによって、 `-fthread-jumps' と `-fdefer-pop' のフラグが指定されます。遅延スロットをもつマシンでは `-fdelayed-branch' が指定されます。フレームポインタを使わないデバッグをサポートしている マシンでは、`-fomit-frame-pointer' も指定されます。マシンによってはさらにその他のフラグが 指定されることもあります。
https://linuxjm.osdn.jp/html/GNU_gcc/man1/gcc.1.html
-O2
さらに最適化を行います。サポートされている最適化手段のうち、 空間と速度のトレードオフを含まないものはほとんどの全て使用されます。 例えばループのアンローリングや関数のインライン化は行われません。 -O と比較して、このオプションはコンパイル時間と生成コードの性能の双方を増加 させます。
https://linuxjm.osdn.jp/html/GNU_gcc/man1/gcc.1.html
-pipe
-pipe
コンパイル時のステージの間のデータの受け渡しに、テンポラリファイルではなく パイプを使用します。いくつかのシステムではアセンブラがパイプからの入力を受け 付けることができないために、このオプションを指定すると失敗します。 GNU アセンブラでは問題なく使用できます。
https://linuxjm.osdn.jp/html/GNU_gcc/man1/gcc.1.html
-fno-plt
-fno-plt
Do not use the PLT for external function calls in position-independent code. Instead, load the callee address at call sites from the GOT and branch to it. This leads to more efficient code by eliminating PLT stubs and exposing GOT loads to optimizations. On architectures such as 32-bit x86 where PLT stubs expect the GOT pointer in a specific register, this gives more register allocation freedom to the compiler. Lazy binding requires use of the PLT; with -fno-plt all external symbols are resolved at load time.
Alternatively, the function attribute noplt can be used to avoid calls through the PLT for specific external functions.
In position-dependent code, a few targets also convert calls to functions that are marked to not use the PLT to use the GOT instead.
https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html
-fexceptions
-fexceptions
Enable exception handling. Generates extra code needed to propagate exceptions. For some targets, this implies GCC generates frame unwind information for all functions, which can produce significant data size overhead, although it does not affect execution. If you do not specify this option, GCC enables it by default for languages like C++ that normally require exception handling, and disables it for languages like C that do not normally require it. However, you may need to enable this option when compiling C code that needs to interoperate properly with exception handlers written in C++. You may also wish to disable this option if you are compiling older C++ programs that don’t use exception handling.
https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html
--param=ssp-buffer-size=4
ssp-buffer-size
The minimum size of buffers (i.e. arrays) that receive stack smashing protection when -fstack-protection is used.
https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
-static
-static
ダイナミックリンクをサポートするシステムにおいて、このオプションは共有 ライブラリとのリンクを抑制します。それ以外のシステムではこのオプションは 意味を持ちません。
https://linuxjm.osdn.jp/html/GNU_gcc/man1/gcc.1.html
CPPFLAGS で指定したもの
CPPFLAGS で指定したもの
-D_FORTIFY_SOURCE=2
FORTIFY_SOURCE — Idea of the day
https://idea.popcount.org/2013-08-15-fortify_source/
※ アセンブラ言語や BrainFu*k の持ってる剥き出しのチューリングマシン感だけでご飯3杯はいけます(何
IPA ISEC セキュア・プログラミング講座:C/C++言語編 第10章 著名な脆弱性対策:バッファオーバーフロー: #4 あふれを検出するデバッグ
https://www.ipa.go.jp/security/awareness/vendor/programmingv2/contents/c904.html
GCC にコンパイルオプション -D_FORTIFY_SOURCE=1 あるいは =2 を指定すると、あふれを起こしやすい strcpy() のような関数がマクロ展開によって同様な処理を行うが領域あふれを検査するよう対策された別の関数 __strcpy_chk() に置き換わる。
プログラム実行時にあふれ等の問題が検出されたときは、プロセスの実行が abort()によって中止される。
この方法を使うと、ソースコードを変更する必要がなく、コンパイルのし直しのみであふれ検出機能をはたらかせることができる。
GCCに指定するオプション: -O1 -D_FORTIFY_SOURCE=1 または =2
この機能を使用するときは、コンパイラの最適化オプションを -O1 またはそれ以上のレベルで指定する必要がある。
-I/usr/x86_64-w64-mingw32/include
-Idir
ディレクトリ dir を、インクルードファイルの検索するディレクトリのリスト中に追加します。
https://linuxjm.osdn.jp/html/GNU_gcc/man1/gcc.1.html
LDFLAGS で指定したもの
LDFLAGS で指定したもの
-Wl,-O1,--sort-common,--as-needed
-Wl,option
オプション option をリンカに渡します。option がコンマを含む場合は、それらのコンマで複数のオプションとして分割されます。
https://linuxjm.osdn.jp/html/GNU_gcc/man1/gcc.1.html-O level
If level is a numeric values greater than zero ld optimizes the output. This might take significantly longer and therefore probably should only be enabled for the final binary. At the moment this option only affects ELF shared library generation. Future releases of the linker may make more use of this option. Also currently there is no difference in the linker's behaviour for different non-zero values of this option. Again this may change with future releases.
https://linux.die.net/man/1/ld
-sort-common
通常 ld がグローバルな共通シンボルをそれぞれの出力セクションに配置するにあたっ ては、それらはサイズによってソートされる。まず 1 バイト変数のシンボル、 ついで 2 バイト、 4 バイト変数のシンボル、最後にそれ以外のものが並ぶ。 このオプションはアラインメントによって生じてしまうシンボル間のギャップ を防止する。このオプションはソートを行わないようにする。
https://linuxjm.osdn.jp/html/GNU_binutils/man1/ld.1.html
--as-needed
--no-as-needed
This option affects ELF DT_NEEDED tags for dynamic libraries mentioned on the command line after the --as-needed option. Normally the linker will add a DT_NEEDED tag for each dynamic library mentioned on the command line, regardless of whether the library is actually needed or not. --as-needed causes a DT_NEEDED tag to only be emitted for a library that satisfies an undefined symbol reference from a regular object file or, if the library is not found in the DT_NEEDED lists of other libraries linked up to that point, an undefined symbol reference from another dynamic library. --no-as-needed restores the default behaviour.
https://linux.die.net/man/1/ld
-L/usr/x86_64-w64-mingw32/lib
-Ldir
ディレクトリdir を `-l' による検索が行なわれるディレクトリのリストに加えます。
https://linuxjm.osdn.jp/html/GNU_gcc/man1/gcc.1.html
-llibrary
名前が library であるライブラリをリンク時に使用します。
リンカは、標準のライブラリ用ディレクトリのリスト中から、 実際のファイル名が `liblibrary.a' であるファイルを検索します。リンカはこのファイルを、ファイル 名で直接指定した場合と同様に使用します。
検索するディレクトリには、いくつかの標準システムディレクトリと、`-L' によって指定したディレクトリが含まれます。
通常、この方法で発見されるファイルはライブラリファイル、つまりいくつかの オブジェクトファイルをメンバとして含むアーカイブファイルです。 リンカは、アーカイブファイルの中を検索して、 参照されているが定義されていないシンボルを定義しているメンバを 探し出します。 しかし、もしリンカがライブラリでなく通常のオブジェクトファイルを発見した 場合は、そのオブジェクトファイルを通常の方法でリンクします。`-l' オプションを使用する場合とファイル名を直接指定する場合の違いは、`-l' の場合が library を `lib' と `.a' で囲み、いくつものディレクトリを検索することだけです。
https://linuxjm.osdn.jp/html/GNU_gcc/man1/gcc.1.html
実際の運用
直接ソースコードをコンパイルする場合
###手順:
1. activate-mingw64
する
2. 必要に応じたオプションを渡しコンパイルする
$CC $CFLAGS -o hoge.exe hoge.c $CPPFLAGS $LDFLAGS
MAN/INFOPAGE
参考とした文献
参考とした文献
3. 生成物をCドライブにコピーする
mkdir -p /mnt/c/Users/Public/fuga
cp hoge.exe /mnt/c/Users/Public/fuga/
MAN/INFOPAGE
4. deactivate-mingw64
する
参考とした文献
参考とした文献
例:
例:sl
sl
https://github.com/mtoyoda/sl
構築依存のインストール
yay
yay -S mingw-w64-ncurses
依存パッケージは mingw-w64-libiconv を指定。mingw-w64-win-iconv は現在メンテナ不在(Orphaned)。
ソースのダウンロードと展開
mkdir -p $HOME/Downloads/sl
cd $HOME/Downloads/sl
curl -LO https://github.com/mtoyoda/sl/archive/5.02.tar.gz
tar zxf 5.02.tar.gz
cd sl-5.02
ビルド
activate-mingw64
$CC $CFLAGS -o sl sl.c -lncurses $CPPFLAGS
deactivate-mingw64
Cドライブにコピー
mkdir -p /mnt/c/Users/Public/sl
cp -a ../sl-5.02 /mnt/c/Users/Public/sl/
./configure, make, make install, の場合
手順:
1. 必要に応じたオプションを渡し mingw-w64-configure
する
1-a
ダウンロードし展開したソースで以下を実行します。
mkdir build && cd build
x86_64-w64-mingw32-configure
MAN/INFOPAGE
cat /usr/bin/x86_64-w64-mingw32-configure
#!/bin/sh
# check if last arg is a path to configure, else use parent
for last; do true; done
if test -x "${last}/configure"; then
config_path="$last"
else
config_path=".."
fi
default_mingw_pp_flags="-D_FORTIFY_SOURCE=2"
default_mingw_compiler_flags="-O2 -pipe -fno-plt -fexceptions --param=ssp-buffer-size=4"
default_mingw_linker_flags="-Wl,-O1,--sort-common,--as-needed"
export CPPFLAGS="${MINGW_CPPFLAGS:-$default_mingw_pp_flags $CPPFLAGS}"
export CFLAGS="${MINGW_CFLAGS:-$default_mingw_compiler_flags $CFLAGS}"
export CXXFLAGS="${MINGW_CXXFLAGS:-$default_mingw_compiler_flags $CXXFLAGS}"
export LDFLAGS="${MINGW_LDFLAGS:-$default_mingw_linker_flags $LDFLAGS}"
${config_path}/configure \
--host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --build="$CHOST" \
--prefix=/usr/x86_64-w64-mingw32 --libdir=/usr/x86_64-w64-mingw32/lib --includedir=/usr/x86_64-w64-mingw32/include \
--enable-shared --enable-static "$@"
1-b
build ディレクトリから x86_64-w64-mingw32-configure
出来ないもの(../configure でエラーを起こすもの)については展開したソースのルートディレクトリで以下を実行します。
x86_64-w64-mingw32-configure ./configure
MAN/INFOPAGE
cat /usr/bin/x86_64-w64-mingw32-configure
#!/bin/sh
# check if last arg is a path to configure, else use parent
for last; do true; done
if test -x "${last}/configure"; then
config_path="$last"
else
config_path=".."
fi
default_mingw_pp_flags="-D_FORTIFY_SOURCE=2"
default_mingw_compiler_flags="-O2 -pipe -fno-plt -fexceptions --param=ssp-buffer-size=4"
default_mingw_linker_flags="-Wl,-O1,--sort-common,--as-needed"
export CPPFLAGS="${MINGW_CPPFLAGS:-$default_mingw_pp_flags $CPPFLAGS}"
export CFLAGS="${MINGW_CFLAGS:-$default_mingw_compiler_flags $CFLAGS}"
export CXXFLAGS="${MINGW_CXXFLAGS:-$default_mingw_compiler_flags $CXXFLAGS}"
export LDFLAGS="${MINGW_LDFLAGS:-$default_mingw_linker_flags $LDFLAGS}"
${config_path}/configure \
--host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --build="$CHOST" \
--prefix=/usr/x86_64-w64-mingw32 --libdir=/usr/x86_64-w64-mingw32/lib --includedir=/usr/x86_64-w64-mingw32/include \
--enable-shared --enable-static "$@"
1-c
configure スクリプトが --enable-shared や --enable-static を受け付けず x86_64-w64-mingw32-configure
が動作しない場合は activate-mingw64 を実行し、その後
./configure --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --build="$CHOST" --prefix=/usr/x86_64-w64-mingw32 --libdir=/usr/x86_64-w64-mingw32/lib --includedir=/usr/x86_64-w64-mingw32/include
等、x86_64-w64-mingw32-configure の記述から問題となるオプションを抜いて configure スクリプトを実行します。
host/target の詳細についてはこちらを参照ください
3.make
する
make -j$(grep processor /proc/cpuinfo | wc -l)
MAN/INFOPAGE
※ mingw32-make に -j$(nproc)
や -j$(grep processor /proc/cpuinfo | wc -l)
を渡すことで、構築時間の短縮を期待できます。
4.make install
する
#カレントディレクトリに "install" ディレクトリを作り、そこにインストールする。
make DESTDIR=$(pwd)/install install
MAN/INFOPAGE
5. 生成物をCドライブにコピーする
Windows の各ドライブは WSL 側で /mnt 以下からアクセス可能です。
6.(activate-mingw64
した場合)忘れずにdeactivate-mingw64
する
参考とした文献
参考とした文献
例:
例:wxWidgets
ソースのダウンロードと展開
mkdir -p $HOME/Downloads/wxWidgets
cd $HOME/Downloads/wxWidgets
curl -LO https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.2/wxWidgets-3.1.2.tar.bz2
tar jxf wxWidgets-3.1.2.tar.bz2
cd wxWidgets-3.1.2
mkdir build_win && cd build_win
ビルド
activate-mingw64
../configure --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --build="$CHOST" --prefix=/usr/x86_64-w64-mingw32 --libdir=/usr/x86_64-w64-mingw32/lib --includedir=/usr/x86_64-w64-mingw32/include --with-msw --disable-shared
make -j$(grep processor /proc/cpuinfo | wc -l)
make DESTDIR=$(pwd)/install install
deactivate-mingw64
Cドライブにコピー
mkdir -p /mnt/c/Users/Public/wxWidgets
cp -a ../../wxWidgets-3.1.2 /mnt/c/Users/Public/wxWidgets/
※ 生成済みバイナリの動作検証は行っていません。ごめんなさい。
cmake, ninja, ninja install, の場合
手順:
1. cmake 及び ninja を導入する
yay
yay -S mingw-w64-cmake ninja
MAN/INFOPAGE
2. x86_64-w64-mingw32-cmake の実行
展開したソースで以下を実行します。
mkdir build && cd build
x86_64-w64-mingw32-cmake -G "Ninja" -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=$(pwd)/install ..
# CMAKE_INSTALL_PREFIX でカレントディレクトリの install 以下にインストールよう指定
MAN/INFOPAGE
※ 環境変数 CFLAGS や CXXFLAGS で指定する値は CMake の場合 CMAKE_<LANG>_FLAGS で指定します。例えば -D CMAKE_C_FLAGS="-static -m64"
-D CMAKE_CXX_FLAGS="-static -m64"
などとします。
3. ninja の実行
ninja
MAN/INFOPAGE
make とは異なり、ninja は標準でマルチスレッド動作です。場合によっては ninja -j(grep processor /proc/cpuinfo | wc -l)
で ninja のスレッド数と論理 CPU の数を一致させても良いかもしれません。
4. ninja install
の実行
ninja install
MAN/INFOPAGE
5. 生成物をCドライブにコピーする
Windows の各ドライブは WSL 側で /mnt 以下からアクセス可能です。
参考とした文献
参考とした文献
cmake -E help
$ cmake -E help
CMake Error: cmake version 3.15.5
Usage: cmake -E <command> [arguments...]
Available commands:
capabilities - Report capabilities built into cmake in JSON format
chdir dir cmd [args...] - run command in a given directory
compare_files [--ignore-eol] file1 file2
- check if file1 is same as file2
copy <file>... destination - copy files to destination (either file or directory)
copy_directory <dir>... destination - copy content of <dir>... directories to 'destination' directory
copy_if_different <file>... destination - copy files if it has changed
echo [<string>...] - displays arguments as text
echo_append [<string>...] - displays arguments as text but no new line
env [--unset=NAME]... [NAME=VALUE]... COMMAND [ARG]...
- run command in a modified environment
environment - display the current environment
make_directory <dir>... - create parent and <dir> directories
md5sum <file>... - create MD5 checksum of files
sha1sum <file>... - create SHA1 checksum of files
sha224sum <file>... - create SHA224 checksum of files
sha256sum <file>... - create SHA256 checksum of files
sha384sum <file>... - create SHA384 checksum of files
sha512sum <file>... - create SHA512 checksum of files
remove [-f] <file>... - remove the file(s), use -f to force it
remove_directory <dir>... - remove directories and their contents
rename oldname newname - rename a file or directory (on one volume)
server - start cmake in server mode
sleep <number>... - sleep for given number of seconds
tar [cxt][vf][zjJ] file.tar [file/dir1 file/dir2 ...]
- create or extract a tar or zip archive
time command [args...] - run command and display elapsed time
touch <file>... - touch a <file>.
touch_nocreate <file>... - touch a <file> but do not create it.
create_symlink old new - create a symbolic link new -> old
例:
例:OpenCV
構築依存のインストール
yay
yay -S mingw-w64-cmake ninja
※ mingw-w64-freeglut を導入し、CMake のオプションに -D WITH_OPENGL=ON
を渡すことで、OpenGL 対応ビルドが可能でした。
ソースのダウンロードと展開
mkdir -p $HOME/Downloads/OpenCV
cd $HOME/Downloads/OpenCV
curl -LO https://github.com/opencv/opencv/archive/4.1.2.tar.gz
tar zxf 4.1.2.tar.gz
cd opencv-4.1.2
mkdir build && cd build
ビルド
x86_64-w64-mingw32-cmake -G "Ninja" -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=$(pwd)/install ..
ninja -j$(grep processor /proc/cpuinfo | wc -l)
ninja install
Cドライブにコピー
mkdir -p /mnt/c/Users/Public/OpenCV
cp -a ../../opencv-4.1.2 /mnt/c/Users/Public/OpenCV/
QMake(Qt系)
mingw-w64-qt5-base や mingw-w64-qt4 の QMake を使用する。
WSLtty
公式 GitHub
https://github.com/mintty/wsltty/
README
https://github.com/mintty/wsltty/blob/master/README.md
Release ページ
https://github.com/mintty/wsltty/releases
何かと高機能で便利です。しかも Sixel Graphics を表示可能だったりします。
※ フォント指定によっては画像表示が化けました。手元の環境では Noto Mono の 10pt 以上で問題なく表示出来ました。
参考とした文献
参考とした文献
WSLのコンソールを便利で高機能な「wsltty」に置き換える:Tech TIPS - @IT
https://www.atmarkit.co.jp/ait/articles/1812/13/news031.html
The Rest of the Lenna Story
http://www.lenna.org/
SIXEL - Qiita
https://qiita.com/tags/sixel
libsixel | The new standard of SIXEL development
https://saitoha.github.io/libsixel/
Mintty and use case examples · Issue #50 · saitoha/libsixel · GitHub
https://github.com/saitoha/libsixel/issues/50
AUR (en) - libsixel
https://aur.archlinux.org/packages/libsixel/
長編まとめ・Sixel Graphics復活への動き(1) - Togetter
https://togetter.com/li/375434
余談
あとがき
オープンソースソフトウェアのファンのひとりとして WSL2 の盛り上がりは嬉しいのですが(WSL2 の Linux カーネルはオープンソースであることですし)、その一方で、Cygwin のユーザー層が食われてしまうと、cygwin1.dll から msys-2.0.dll を作っている MSYS2 や、MSYS2 を使っていると思われる Git BASH にも影響がありそうで不安です(バグレポが減少することになれば開発にとって痛手かと)。この不安は本記事の執筆動機のひとつでもあります。
ところで、システムコール翻訳型からハイパーバイザー+ネイティブカーネル型にすることで性能や互換性の向上が見込めるなら、例えば ReactOS を KVM で動かしてアプリケーション側に Windows API を提供すれば、Linux で Wine を超える使い勝手を狙えたりするのでしょうか。興味は尽きません。
欲を言えば、WSL1 がオープンソースになるとインパクトが大きそう(MSYS2 や Cygwin が活気付きそう)で楽しいのですが、これについては期待を抱くに留めておきます。
本稿執筆時の BGM
執筆時 BGM
関連する文献
関連する文献
yay でインストール可能な Pac-Man 風ゲーム+α
Pac-Man 風ゲーム+α
Curses 系のゲームをインストールすれば WSL を軽量レトロゲームコンソールとして活用出来そうです。
-
description: Full-featured cross-platform pacman-like game
-
description: Pacman clone with an ncurses and a graphic interface
-
description: not pacman with physics
-
作者様のサイトには他にもぶっ飛んだ発想のゲームが盛りだくさんでした。まずサイトのロゴからしておかしい。
-
description: Pacman clone using SDL. Guide Pacman through a maze and collect pac-dots while avoiding ghosts.
-
description: A 9 level ncurses pacman game with editor, patched not to disturb our package manager and to have nice ghosts
-
description: pacmantheme - play the pacman theme song with the motherboard buzzer
-
マザボのブザーで鳴らすので、ブザー機能付きマザボに Arch を実機インストールする必要がありそうです。
-
description: game combining pong, pacman and space invaders
Orphaned(メンテナ不在)
-
description: X pacman game (use z x / ' q keys)
-
description: another X pacman game
-
description: Pacman clone using SDL. Guide Pacman through a maze and collect pac-dots while avoiding ghosts. (ebuc99 fork)
-
https://github.com/msys2/msys2/wiki/How-does-MSYS2-differ-from-Cygwin ↩
-
https://docs.microsoft.com/en-us/windows/win32/fileio/symbolic-links ↩
-
https://stackoverflow.com/questions/894430/creating-hard-and-soft-links-using-powershell ↩
-
https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/new-item?view=powershell-6 ↩
-
GitHub - fritzone/autocmake: Convert an autotools project to CMake ↩
-
sudo pacman -S git; git clone https://aur.archlinux.org/yay-bin.git; cd yay-bin; makepkg -si
↩