Skip to content
This repository has been archived by the owner on May 31, 2019. It is now read-only.

Commit

Permalink
Add support for compilation under mingw32
Browse files Browse the repository at this point in the history
  • Loading branch information
e2iplayer committed Jan 28, 2019
1 parent f96af2d commit be2e70c
Show file tree
Hide file tree
Showing 9 changed files with 1,756 additions and 1,727 deletions.
22 changes: 15 additions & 7 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,33 @@ CC?=gcc
PREFIX?=/usr/local
HLSDL=hlsdl
INSTALL_DIR=$(PREFIX)/bin
OSNAME=$(shell uname -s | sed -e 's/[-_].*//g' | tr A-Z a-z)

S_SRC= src/main.c src/aes_openssl.c src/curl.c src/hls.c src/misc.c src/msg.c src/mpegts.c
ifeq ("$(OSNAME)", "darwin")
CFLAGS+=-I/usr/local/include/
LDFLAGS+=-L/usr/local/lib
else ifeq ("$(OSNAME)", "linux")
CFLAGS+=-D_GNU_SOURCE=1 -std=gnu99
else ifeq ("$(OSNAME)", "mingw32")
CFLAGS+=-D_GNU_SOURCE=1 -std=gnu99
S_SRC+=msvc/win/memmem.c
else
endif
S_OBJS= $(S_SRC:.c=.o)

CFLAGS+=-Wall -Wstrict-prototypes -Wmissing-prototypes
CFLAGS+=-Wmissing-declarations -Wshadow -Wpointer-arith -Wcast-qual
CFLAGS+=-Wsign-compare -Iincludes
CFLAGS+=-DPREFIX='"$(PREFIX)"'
LDFLAGS+=-lpthread -lcurl -lcrypto

OSNAME=$(shell uname -s | sed -e 's/[-_].*//g' | tr A-Z a-z)
ifeq ("$(OSNAME)", "darwin")
CFLAGS+=-I/usr/local/include/
LDFLAGS+=-L/usr/local/lib
else ifeq ("$(OSNAME)", "linux")
CFLAGS+=-D_GNU_SOURCE=1 -std=gnu99
ifeq ("$(OSNAME)", "mingw32")
LDFLAGS+=-Wl,-Bstatic -lpthread -lcurl -lssl -lcrypto -lwsock32 -lws2_32 -lwldap32 -lz
else
LDFLAGS+=-lpthread -lcurl -lcrypto
endif


all: $(S_OBJS)
$(CC) $(S_OBJS) $(LDFLAGS) -o $(HLSDL)

Expand Down
2 changes: 2 additions & 0 deletions msvc/win/memmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
* http://www-igm.univ-mlv.fr/~lecroq/string/
*/
#include <string.h>
void *memmem(const void *haystack, size_t n, const void *needle, size_t m);

void *memmem(const void *haystack, size_t n, const void *needle, size_t m)
{
if (m > n || !m || !n)
Expand Down
Loading

0 comments on commit be2e70c

Please sign in to comment.