Skip to content

Instantly share code, notes, and snippets.

@zeevro
Last active May 27, 2024 01:07
Show Gist options
  • Save zeevro/515e85fdebdd1168490e18f9014c1ddb to your computer and use it in GitHub Desktop.
Save zeevro/515e85fdebdd1168490e18f9014c1ddb to your computer and use it in GitHub Desktop.
Build grep for Windows
#!/bin/sh
latest=$(curl -sL https://ftpmirror.gnu.org/grep/ | grep -oE 'grep-[0-9]+\.[0-9]+(\.[0-9]+)?' | sort | tail -n 1)
wget "https://ftpmirror.gnu.org/grep/${latest}.tar.gz"
tar -xf "${latest}.tar.gz"
cd $latest
LDFLAGS=/usr/x86_64-w64-mingw32/lib/CRT_glob.o ./configure --target=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --build=x86_64-linux-gnu --enable-threads=windows
make -j$(nproc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment