ports/games/mvdsv/files/patch-tools_qwdtools_source_Makefile.BSD
Alexey Dokuchaev b81865a580 Attempt to unbreak MVDSV and QWDtools on recent -CURRENT.
Reported by:	pkg-fallout
2021-04-16 12:08:39 +08:00

53 lines
1.7 KiB
Text

--- tools/qwdtools/source/Makefile.BSD.orig 2020-03-18 18:17:05 UTC
+++ tools/qwdtools/source/Makefile.BSD
@@ -12,24 +12,19 @@
#
MAINDIR = ../../..
-SV_DIR = $(MAINDIR)/source
+SV_DIR = $(MAINDIR)/src
QWDTOOLS_DIR = $(MAINDIR)/tools/qwdtools/source
# To compile qwdtools as 32bit on 64bit target platform use next:
# for gcc its like: make qwdtools FORCE32BITFLAGS=-m32
# configure script add FORCE32BITFLAGS=-m32
-DO_CFLAGS = ${CFLAGS} -Wall -pipe -pthread -funsigned-char -DUSE_PR2 -D${BYTE_ORDER}Q__ ${FORCE32BITFLAGS}
+BYTE_ORDER!= ${CC} -x c -dM -E /usr/include/machine/endian.h | sed -n 's,\#define __BYTE_ORDER__ __ORDER\(.*_ENDIAN__\),_\1,p'
+DO_CFLAGS = ${CFLAGS} -Wall -pipe -funsigned-char -DSERVERONLY -D${BYTE_ORDER}Q__ ${FORCE32BITFLAGS}
-.if !defined(NOKQUEUE) && (${UNAME} == "FreeBSD" || ${UNAME} == "DragonFly")
-DO_CFLAGS += -DKQUEUE
-.endif
-
-WITH_OPTIMIZED_CFLAGS = YES
-
USE_ASM=-Did386
.if defined(WITH_OPTIMIZED_CFLAGS)
-DO_CFLAGS += -O2 -fno-strict-aliasing -ffast-math -funroll-loops
+DO_CFLAGS += -ffast-math -funroll-loops
. if ${MACHINE_ARCH} == "i386" && !defined(WITHOUT_X86_ASM)
ASM=${USE_ASM}
DO_CFLAGS += ${ASM}
@@ -60,7 +55,7 @@ QWDTOOLS_OBJS = \
${QWDTOOLS_DIR}/sync.o \
${QWDTOOLS_DIR}/tools.o
-.if ${USE_ASM} == ${ASM}
+.if defined(ASM) && ${USE_ASM} == ${ASM}
QWDTOOLS_ASM_OBJS = \
${SV_DIR}/bothtoolsa.o
.endif
@@ -70,10 +65,10 @@ QWDTOOLS_ASM_OBJS = \
#############################################################################
.c.o:
- ${CC} ${DO_CFLAGS} -c $< -o $*.o
+ ${CC} ${DO_CFLAGS} -c $< -o $@
.s.o:
- ${CC} ${DO_CFLAGS} -DELF -x assembler-with-cpp -c $< -o $*.o
+ ${CC} ${DO_CFLAGS} -DELF -x assembler-with-cpp -c $< -o $@
all: qwdtools
${STRIP} ${STRIP_FLAGS} qwdtools