summaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/build.sh b/build.sh
index 6746c49..6157307 100755
--- a/build.sh
+++ b/build.sh
@@ -44,6 +44,17 @@ case $platform in
linux|bsd)
LDLIBS="-lX11 -lXext -lXrandr -lm"
DEFS="-D_POSIX_C_SOURCE=200809L"
+ # the BSDs keep X11 out of the default paths
+ case $(uname -s) in
+ NetBSD) x11=/usr/X11R7 ;;
+ OpenBSD) x11=/usr/X11R6 ;;
+ FreeBSD|DragonFly) x11=/usr/local ;;
+ *) x11= ;;
+ esac
+ if [ -n "$x11" ]; then
+ DEFS="$DEFS -I$x11/include"
+ LDLIBS="-L$x11/lib -Wl,-R$x11/lib $LDLIBS"
+ fi
;;
windows)
CC=${CC:-x86_64-w64-mingw32-gcc}