Skip to content

Commit

Permalink
Allow compilation on both beta4 and nightlies with a fixed features.h
Browse files Browse the repository at this point in the history
  • Loading branch information
OscarL committed Mar 20, 2024
1 parent 1b669ce commit f2b13dc
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion etc/makefile.main
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,19 @@ FASTTRAX_DIR := FastTrax
OPTIMIZER = -O3

CC := gcc
CFLAGS = $(OPTIMIZER) -Wall -Wno-multichar -Wno-ctor-dtor-privacy -D__USE_GNU -DSTDC_HEADERS

# This is needed to be able to compile on either nightlies, or beta4.
# See https://dev.haiku-os.org/ticket/11818 (fixed for good in hrev57497).
# We can simplify this once the haikuports buildmasters switch to beta5.

HAIKU_HREV_NUM = $(shell uname -v | cut -d " " -f 1 | cut -d "+" -f 1 | sed s/hrev//)
HAS_FIXED_FEATURES_H = $(shell if [ $(strip $(HAIKU_HREV_NUM)) -ge 57497 ]; then echo "YES"; else echo "NO"; fi)

ifeq ($(strip $(HAS_FIXED_FEATURES_H)), YES)
CFLAGS = $(OPTIMIZER) -Wall -Wno-multichar -Wno-ctor-dtor-privacy -D_DEFAULT_SOURCE -DSTDC_HEADERS
else
CFLAGS = $(OPTIMIZER) -Wall -Wno-multichar -Wno-ctor-dtor-privacy -D__USE_GNU -DSTDC_HEADERS
endif

LD := gcc
LDFLAGS :=
Expand Down

0 comments on commit f2b13dc

Please sign in to comment.