Patch the source Makefile to no longer require gmake. Teach it to

translate i386 into x86 for yasm. This unbreaks the port on i386.

Fix the few warnings while I'm here.
This commit is contained in:
Mikhail Teterin 2013-02-07 17:40:34 +00:00
parent b0eb7f6123
commit 036d5601fc
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=311878
3 changed files with 52 additions and 18 deletions

View file

@ -19,7 +19,6 @@ NOMAN= defined
USE_BZIP2= yes
USE_GCC= 4.2+
USE_GMAKE= yes
USE_XORG= x11 xv
USE_GL= yes
USE_LDCONFIG= yes
@ -29,10 +28,6 @@ USE_LDCONFIG= yes
ONLY_FOR_ARCHS= i386 amd64
ONLY_FOR_ARCHS_REASON= "not yet ported to anything other than i386 and amd64"
.if ${ARCH} == "i386"
BROKEN= does not build
.endif
.if ${ARCH} == "i386" || ${ARCH} == "amd64"
BUILD_DEPENDS= ${LOCALBASE}/bin/yasm:${PORTSDIR}/devel/yasm
.endif

View file

@ -1,8 +1,8 @@
Index: Makefile
===================================================================
--- Makefile (revision 196)
+++ Makefile (working copy)
@@ -2,8 +2,11 @@
--- Makefile 2007-03-27 15:23:25.000000000 -0400
+++ Makefile 2013-02-07 12:32:37.000000000 -0500
@@ -1,20 +1,27 @@
+.SUFFIXES: .c .o .asm
MAJOR = 0
LIBRARY = libseom.so
@ -15,20 +15,34 @@ Index: Makefile
CC = gcc
ASM = yasm
@@ -11,8 +14,11 @@
CFLAGS = -Iinclude -std=c99
-CFLAGS = -Iinclude -std=c99
+CFLAGS += -Iinclude -std=c99
LDFLAGS = -Wl,--as-needed
-include config.make
+###include config.make
+
+ARCH = C
+CFLAGS += -I${LOCALBASE}/include -L${LOCALBASE}/lib
+
OBJS = src/buffer.o src/client.o src/codec.o src/frame.o src/opengl.o \
src/server.o src/stream.o src/arch/$(ARCH)/frame.o
@@ -29,7 +35,7 @@
OBJS = src/buffer.o src/client.o src/codec.o src/frame.o src/opengl.o \
- src/server.o src/stream.o src/arch/$(ARCH)/frame.o
+ src/server.o src/stream.o src/arch/${ARCH:S/i386/x86/g}/frame.o
APPS = filter player server
playerLIBS = -lX11 -lXv
@@ -22,14 +29,14 @@
.PHONY: all clean install
all: $(LIBRARY) $(APPS)
-%.o: %.asm
- $(ASM) -m $(ARCH) -f elf -o $@ $<
+.asm.o:
+ $(ASM) -m ${ARCH:S/i386/x86/g} -f elf -o $@ $<
-%.o: %.c
+.c.o:
$(CC) $(CFLAGS) -fPIC -c -o $@ $<
$(LIBRARY): $(OBJS)
@ -37,7 +51,7 @@ Index: Makefile
$(APPS): $(LIBRARY)
$(CC) $(CFLAGS) $(LDFLAGS) -L. -o $@ src/$@/main.c -lseom $($@LIBS)
@@ -39,11 +45,11 @@
@@ -39,11 +46,11 @@
inst = install -m 755 -d $(DESTDIR)$(3); install -m $(1) $(2) $(DESTDIR)$(3)$(if $(4),/$(4));
install: $(LIBRARY) $(APPS) seom.pc

View file

@ -0,0 +1,25 @@
--- src/stream.c 2007-03-27 15:23:25.000000000 -0400
+++ src/stream.c 2013-02-07 12:35:18.000000000 -0500
@@ -43,5 +43,5 @@
stream->fd = socket(AF_INET, SOCK_STREAM, 0);
- connect(stream->fd, &addr, sizeof(addr));
+ connect(stream->fd, (struct sockaddr *)&addr, sizeof(addr));
} else if (strncmp(spec, "ipv6://", 7) == 0) {
fprintf(stderr, "IPv6 unsupported !\n");
--- src/server.c 2006-10-17 07:12:15.000000000 -0400
+++ src/server.c 2013-02-07 12:36:56.000000000 -0500
@@ -64,5 +64,5 @@
addr.sin_addr.s_addr = htonl(INADDR_ANY);
- bind(server->socket, &addr, sizeof(addr));
+ bind(server->socket, (struct sockaddr *)&addr, sizeof(addr));
listen(server->socket, 1);
@@ -80,5 +80,5 @@
socklen_t len = sizeof(addr);
- int sockfd = accept(server->socket, &addr, &len);
+ int sockfd = accept(server->socket, (struct sockaddr *)&addr, &len);
if (sockfd < 0) {
return;