Skip to content

Commit 06709fb

Browse files
committed
Fix compiling for Linux
1 parent 0275641 commit 06709fb

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

Makefile.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
SHELL = /bin/sh
2-
CFLAGS = -g -Wall -pedantic -std=c99 @PKGS_CFLAGS@
2+
CFLAGS = -g -Wall -pedantic -std=c99 @PKGS_CFLAGS@ @SYSTEM_CFLAGS@
33
LDFLAGS = @PKGS_LDFLAGS@
44

55
prefix = @prefix@

configure

+15
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,20 @@ prefix=/usr/local
2525
if [ "$#" -eq 1 ] ; then prefix=$1 ; fi
2626
echo "prefix=${prefix}"
2727

28+
SYSTEM_CFLAGS=
29+
case $(uname) in
30+
Linux )
31+
SYSTEM_CFLAGS=-D_POSIX_C_SOURCE=200809L
32+
SYSTEM_LDFLAGS=
33+
;;
34+
OpenBSD )
35+
SYSTEM_CFLAGS=
36+
SYSTEM_LDFLAGS=
37+
;;
38+
esac
39+
echo "system: $(uname)"
40+
echo "SYSTEM_CFLAGS=" ${SYSTEM_CFLAGS}
41+
2842
PKGS="x11 xinerama xft"
2943
for a in ${PKGS} ; do
3044
check_pkg $a
@@ -42,6 +56,7 @@ sed \
4256
-e "s|@prefix@|${prefix}|g" \
4357
-e "s|@PKGS_CFLAGS@|${PKGS_CFLAGS}|g" \
4458
-e "s|@PKGS_LDFLAGS@|${PKGS_LDFLAGS}|g" \
59+
-e "s|@SYSTEM_CFLAGS@|${SYSTEM_CFLAGS}|g" \
4560
Makefile.in >>Makefile
4661
SRCS=$(sed -n '/SRCS=/,/[^ ]/p' Makefile.in | sed -e 's/SRCS=//' -e 's/\\//')
4762
for a in ${SRCS} ; do

0 commit comments

Comments
 (0)