- fix makefiles to honor CXX and CXXFLAGS

- fix some C++ problems
- mark BROKEN on FreeBSD10, no gcc 4.2
This commit is contained in:
Dirk Meyer 2014-03-31 17:45:13 +00:00
parent e9d7496208
commit ce934b1967
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=349780
9 changed files with 99 additions and 32 deletions

View file

@ -14,6 +14,8 @@ MAINTAINER= dinoex@FreeBSD.org
COMMENT= Controller for ISDN TK-Anlage (PBX) made by Istec
USES= zip
USE_CSTD= gnu89
NO_WRKSUBDIR= yes
# Personal Preferences, Where to install.
@ -33,8 +35,16 @@ NO_OPTIONS_SORT=yes
DTR_OFF_DESC= use dtr-off patch
X11_USE= xorg=x11
FIXME= areacode estic spunk
.include <bsd.port.options.mk>
.if ${OSVERSION} > 1000000
.if ${CC} != gcc42
BROKEN= needs gcc4.2 to compile
.endif
.endif
.if ${PORT_OPTIONS:MX11}
X_OR_NOT=-x
PLIST_SUB+= WITHOUT_X="@comment "
@ -55,6 +65,11 @@ pre-patch:
# @${PATCH} -d ${PATCH_WRKSRC}/estic --forward --quiet -E -p0 --batch < ${WRKDIR}/estic.diff
do-configure:
.for i in ${FIXME}
${REINPLACE_CMD} -e 's|CC|CXX|' -e 's|CFLAGS|CXXFLAGS|' \
${WRKSRC}/${i}/make/freebsd.mak \
${WRKSRC}/${i}/make/freebsd-x.mak
.endfor
@cd ${WRKSRC}/spunk ; ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} dep
@cd ${WRKSRC}/areacode ; ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} dep
@cd ${ESTIC} ; ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} dep

View file

@ -1,5 +1,5 @@
--- areacode/make/freebsd.mak.orig Tue Sep 6 09:54:20 2005
+++ areacode/make/freebsd.mak Tue Sep 6 09:54:20 2005
--- areacode/make/freebsd.mak.orig 2014-03-28 16:39:11.000000000 +0100
+++ areacode/make/freebsd.mak 2014-03-28 16:39:50.000000000 +0100
@@ -0,0 +1,115 @@
+# *****************************************************************************
+# * *
@ -99,7 +99,7 @@
+
+depend dep:
+ @echo "Creating dependency information"
+ $(CC) -DFREEBSD -MM *.c > .depend
+ $(CC) $(CFLAGS) -MM *.c > .depend
+
+# ------------------------------------------------------------------------------
+# clean up

View file

@ -1,5 +1,5 @@
--- areacode/make/freebsd-x.mak.orig Tue Sep 6 09:54:20 2005
+++ areacode/make/freebsd-x.mak Tue Sep 6 09:54:20 2005
--- areacode/make/freebsd-x.mak.orig 2014-03-28 16:39:11.000000000 +0100
+++ areacode/make/freebsd-x.mak 2014-03-28 16:42:03.000000000 +0100
@@ -0,0 +1,115 @@
+# *****************************************************************************
+# * *
@ -99,7 +99,7 @@
+
+depend dep:
+ @echo "Creating dependency information"
+ $(CC) -DFREEBSD -MM *.c > .depend
+ $(CC) $(CFLAGS) -MM *.c > .depend
+
+# ------------------------------------------------------------------------------
+# clean up

View file

@ -0,0 +1,11 @@
--- areacode/areacode.c.orig 1997-02-16 11:24:50.000000000 +0100
+++ areacode/areacode.c 2014-03-31 19:07:27.000000000 +0200
@@ -352,7 +352,7 @@
/* Load a part of the table into memory */
{
u32 SpaceNeeded = (Desc->Last - Desc->First + 1) * sizeof (u32);
- Desc->Table = malloc (SpaceNeeded);
+ Desc->Table = (u32*) malloc (SpaceNeeded);
if (Desc->Table == 0) {
/* Out of memory. There is no problem with this now since we do
* not really need the table in core memory (it speeds things up,

View file

@ -1,12 +1,11 @@
--- estic/make/freebsd-x.mak.orig Fri Jan 31 03:57:24 1997
+++ estic/make/freebsd-x.mak Tue Sep 6 09:54:21 2005
@@ -27,12 +27,13 @@
--- estic/make/freebsd-x.mak.orig 1997-01-31 03:57:24.000000000 +0100
+++ estic/make/freebsd-x.mak 2014-03-28 17:00:36.000000000 +0100
@@ -27,12 +27,12 @@
AR = ar
LD = ld
ZIP = zip
-CC = g++
+CXX ?= g++
+CC = ${CXX}
+CC?= g++
LIB = ../spunk/spunk.a
INCDIR = ../spunk
@ -16,7 +15,7 @@
# ------------------------------------------------------------------------------
@@ -71,10 +72,10 @@
@@ -71,10 +71,10 @@
icintcon.o \
iclog.o \
icmsgwin.o \
@ -29,7 +28,7 @@
# ------------------------------------------------------------------------------
#
@@ -82,7 +83,7 @@
@@ -82,7 +82,7 @@
all: xestic
xestic: $(LIB) $(OBJS)
@ -38,7 +37,16 @@
# ------------------------------------------------------------------------------
@@ -114,10 +115,10 @@
@@ -90,7 +90,7 @@
depend dep:
@echo "Creating dependency information"
- $(CC) -I$(INCDIR) -DFREEBSD -MM *.cc > .depend
+ $(CC) $(CFLAGS) -MM *.cc > .depend
# ------------------------------------------------------------------------------
# Create a ZIP file
@@ -114,9 +114,10 @@
clean:
-rm -f *.bak *~
@ -48,6 +56,5 @@
zap: clean
- -rm -f *.o
-rm -f .depend
-

View file

@ -1,12 +1,11 @@
--- estic/make/freebsd.mak.orig Fri Jan 31 03:57:24 1997
+++ estic/make/freebsd.mak Tue Sep 6 09:54:21 2005
@@ -27,11 +27,12 @@
--- estic/make/freebsd.mak.orig 1997-01-31 03:57:24.000000000 +0100
+++ estic/make/freebsd.mak 2014-03-28 17:03:18.000000000 +0100
@@ -27,11 +27,11 @@
AR = ar
LD = ld
ZIP = zip
-CC = g++
+CXX ?= g++
+CC = ${CXX}
+CC?= g++
LIB = ../spunk/spunk.a
INCDIR = ../spunk
@ -15,7 +14,7 @@
# ------------------------------------------------------------------------------
@@ -70,10 +71,10 @@
@@ -70,10 +70,10 @@
icintcon.o \
iclog.o \
icmsgwin.o \
@ -28,7 +27,7 @@
# ------------------------------------------------------------------------------
#
@@ -81,7 +82,7 @@
@@ -81,14 +81,14 @@
all: estic
estic: $(LIB) $(OBJS)
@ -37,7 +36,15 @@
# ------------------------------------------------------------------------------
# Create a dependency file
@@ -112,9 +113,10 @@
depend dep:
@echo "Creating dependency information"
- $(CC) -I$(INCDIR) -DFREEBSD -MM *.cc > .depend
+ $(CC) $(CFLAGS) -MM *.cc > .depend
# ------------------------------------------------------------------------------
# Create a ZIP file
@@ -112,9 +112,10 @@
clean:
-rm -f *.bak *~

View file

@ -0,0 +1,11 @@
--- spunk/machine.h.orig 1997-02-18 14:41:50.000000000 +0100
+++ spunk/machine.h 2014-03-28 16:58:13.000000000 +0100
@@ -238,7 +238,7 @@
# define CPU_LITTLE_ENDIAN
#elif (BYTE_ORDER == BIG_ENDIAN)
# define CPU_BIG_ENDIAN
-#elif
+#else
# error Byte order not defined!
#endif

View file

@ -1,11 +1,11 @@
--- spunk/make/freebsd-x.mak.orig Sun Nov 24 22:33:26 1996
+++ spunk/make/freebsd-x.mak Tue Sep 6 09:54:21 2005
--- spunk/make/freebsd-x.mak.orig 1996-11-24 22:33:26.000000000 +0100
+++ spunk/make/freebsd-x.mak 2014-03-28 16:29:37.000000000 +0100
@@ -27,10 +27,10 @@
AR = ar
LD = ld
ZIP = zip
-CC = g++
+CC = $(CXX)
+CC?= g++
# Flags for the gnu compiler
-CFLAGS = -DFREEBSD -DUSE_OLD_TTY -g -Wall -x c++ -I /usr/X11R6/include -fno-implicit-templates -DEXPLICIT_TEMPLATES
@ -24,7 +24,16 @@
lib: $(LIB)
@@ -192,10 +192,12 @@
@@ -149,7 +149,7 @@
depend dep:
@echo "Creating dependency information"
- $(CC) -DFREEBSD -MM *.cc > .depend
+ $(CC) $(CFLAGS) -MM *.cc > .depend
# ------------------------------------------------------------------------------
# Target specific files
@@ -192,9 +192,10 @@
clean:
-rm -f *~ linuxsrc/*~ bsdsrc/*~ unixsrc/*~
@ -34,7 +43,5 @@
zap: clean
- -rm -f *.o
-rm -f .depend
+

View file

@ -1,11 +1,11 @@
--- spunk/make/freebsd.mak.orig Sun Nov 24 22:33:26 1996
+++ spunk/make/freebsd.mak Tue Sep 6 09:54:21 2005
--- spunk/make/freebsd.mak.orig 1996-11-24 22:33:26.000000000 +0100
+++ spunk/make/freebsd.mak 2014-03-28 16:25:12.000000000 +0100
@@ -27,10 +27,10 @@
AR = ar
LD = ld
ZIP = zip
-CC = g++
+CC = $(CXX)
+CC?= g++
# Flags for the gnu compiler
-CFLAGS = -DFREEBSD -DUSE_OLD_TTY -g -Wall -x c++ -fno-implicit-templates -DEXPLICIT_TEMPLATES
@ -22,6 +22,15 @@
lib: $(LIB)
@@ -150,7 +150,7 @@
depend dep:
@echo "Creating dependency information"
- $(CC) -DFREEBSD -MM *.cc > .depend
+ $(CC) ${CFLAGS} -MM *.cc > .depend
# ------------------------------------------------------------------------------
# Target specific files
@@ -196,9 +196,10 @@
clean: