Skip to content

Instantly share code, notes, and snippets.

@LAK132
Last active January 6, 2021 02:08
Show Gist options
  • Save LAK132/fcc946f848f9ed87dbef289f2d30096d to your computer and use it in GitHub Desktop.
Save LAK132/fcc946f848f9ed87dbef289f2d30096d to your computer and use it in GitHub Desktop.
Makefile DISPLAY example for when getting the IP address of the X11 server is required under WSL/cygwinX
ifneq ($(shell grep -a -h -i microsoft /proc/version),)
# // For use on Windows (WSL) with cygwinX
# // Requires xinit, xauth and xhost probably
# // Start the X11 server with `path\to\cygwin64\bin\run.exe --quote /usr/bin/bash.exe -l -c "cd; exec /usr/bin/startxwin -- +iglx -listen tcp"`
# // If you get "Authorization required, but no authorization protocol specified"
# // then try running `DISPLAY=:0.0 xhost +` in the cygwin terminal after
# // starting the X11 server.
DISPLAY = "`cat /etc/resolv.conf | grep nameserver | awk '{ print $$2 }'`:0.0"
LIBGLARGS = LIBGL_ALWAYS_INDIRECT=1 LIBGL_ALWAYS_SOFTWARE=1
endif
DISPLAYARGS = DISPLAY=$(DISPLAY) $(LIBGLARGS)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment