make it build with clang, give it a proper makefile, separate C from C++,

add the required extern C, and fix one strrchr...
This commit is contained in:
espie 2017-05-13 00:15:38 +00:00
parent 13ff626be5
commit 816f54ed0a
4 changed files with 60 additions and 9 deletions

View File

@ -1,9 +1,9 @@
# $OpenBSD: Makefile,v 1.9 2017/04/10 11:46:23 sthen Exp $
# $OpenBSD: Makefile,v 1.10 2017/05/13 00:15:38 espie Exp $
COMMENT= fast tool to backup video DVDs 'on the fly'
DISTNAME= streamdvd-0.4
REVISION= 0
REVISION= 1
CATEGORIES= multimedia
MASTER_SITES= http://www.badabum.de/down/

View File

@ -1,13 +1,28 @@
$OpenBSD: patch-Makefile,v 1.2 2006/02/19 18:29:32 espie Exp $
--- Makefile.orig Mon Mar 8 23:10:53 2004
+++ Makefile Sun Feb 19 18:55:36 2006
@@ -1,16 +1,16 @@
INSTALLDIR = /usr/local/bin/
$OpenBSD: patch-Makefile,v 1.3 2017/05/13 00:15:38 espie Exp $
Index: Makefile
--- Makefile.orig
+++ Makefile
@@ -1,16 +1,28 @@
-INSTALLDIR = /usr/local/bin/
+INSTALLDIR = /u.o/local/bin/
+OBJS = streamdvd.o requant.o ac3strm_in.o audiostrm_out.o bits.o \
+ buffer.o dtsstrm_in.o inputstrm.o interact.o lpcmstrm_in.o \
+ mjpeg_logging.o mpastrm_in.o mpegconsts.o mplex.o multiplexor.o \
+ padstrm.o stillsstream.o stream_params.o systems.o vector.o \
+ videostrm_in.o videostrm_out.o yuv4mpeg_ratio.o zalphastrm_in.o \
+ zalphastrm_out.o
+CPPFLAGS = -I. -Implex -I${LOCALBASE}/include
+CXXFLAGS += ${CPPFLAGS}
+CFLAGS += ${CPPFLAGS}
+VPATH = mplex
all:
-all:
- g++ -g -Wall -ldvdread -lm -o streamdvd -I. -Implex streamdvd.c requant.c mplex/*.c mplex/*.cpp
+ ${CXX} ${CXXFLAGS} -Wall -L${LOCALBASE}/lib -ldvdread -lm -o streamdvd -I. -Implex -I${LOCALBASE}/include streamdvd.c requant.c mplex/*.c mplex/*.cpp
+all: streamdvd
+streamdvd: ${OBJS}
+ ${CXX} ${CXXFLAGS} -L${LOCALBASE}/lib $(OBJS) -ldvdread -lm -o $@
+
addon:
- gcc -g -Wall -ldvdread -o streamanalyze contrib/StreamAnalyze/streamanalyze.c
- gcc -g -Wall -ldvdread -DVERSION=\"0.9\" -o lsdvd contrib/lsdvd/lsdvd.c

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-mplex_lpcmstrm_in_cpp,v 1.1 2017/05/13 00:15:38 espie Exp $
Index: mplex/lpcmstrm_in.cpp
--- mplex/lpcmstrm_in.cpp.orig
+++ mplex/lpcmstrm_in.cpp
@@ -52,7 +52,7 @@ LPCMStream::LPCMStream(IBitStream &ibs, LpcmParams *pa
bool LPCMStream::Probe(IBitStream &bs )
{
- char *last_dot = strrchr( bs.StreamName(), '.' );
+ const char *last_dot = strrchr( bs.StreamName(), '.' );
return
last_dot != NULL
&& strcmp( last_dot+1, "lpcm") == 0;

View File

@ -0,0 +1,22 @@
$OpenBSD: patch-mplex_mplex_cpp,v 1.1 2017/05/13 00:15:38 espie Exp $
Index: mplex/mplex.cpp
--- mplex/mplex.cpp.orig
+++ mplex/mplex.cpp
@@ -59,7 +59,7 @@
using std::auto_ptr;
-extern int read_from_buffer ( unsigned char, unsigned char *, int, int );
+extern "C" int read_from_buffer ( unsigned char, unsigned char *, int, int );
/*************************************************************************
@@ -324,6 +324,7 @@ void CmdLineMultiplexJob::InputStreamsFromCmdLine(int
}
+extern "C" int run_mplex(int, int *, int);
int run_mplex( int stream_count, int *stream_list, int av_delay ) {
CmdLineMultiplexJob job( stream_count, stream_list, av_delay );