From e85c76771b5b391b0785db0067cfbdadb1cf6baa Mon Sep 17 00:00:00 2001
From: KO Myung-Hun <komh@chollian.net>
Date: Fri, 19 Jun 2015 13:40:21 +0900
Subject: [PATCH] src: fix fourcc_gen build on OS/2

---
 configure.ac    | 7 +++++++
 src/Makefile.am | 6 +++---
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index 5332221..ea1d08f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -71,6 +71,13 @@ AC_CHECK_PROGS(DESKTOP_FILE_VALIDATE, [${DESKTOP_FILE_VALIDATE} desktop-file-val
 AC_PATH_PROG(YASM, yasm)
 AC_ARG_VAR([BUILDCC], [Build system C99 compiler command])
 AC_PATH_PROGS(BUILDCC, [c99-gcc c99])
+case "${build_os}" in
+  os2*)
+    test -z "$BUILDCC" && BUILDCC="gcc -std=gnu99"
+    BUILDEXEEXT=.exe
+    AC_SUBST(BUILDEXEEXT)
+    ;;
+esac
 
 dnl Check for compiler properties
 AC_C_CONST
diff --git a/src/Makefile.am b/src/Makefile.am
index e608e4d..b3cf45e 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -518,13 +518,13 @@ SOURCES_libvlc = \
 # FourCC tables
 BUILT_SOURCES += fourcc_tables.h
 EXTRA_DIST += misc/fourcc_gen.c
-MOSTLYCLEANFILES = fourcc_gen
+MOSTLYCLEANFILES = fourcc_gen$(BUILDEXEEXT)
 
-fourcc_gen: misc/fourcc_gen.c misc/fourcc_list.h ../include/vlc_fourcc.h
+fourcc_gen$(BUILDEXEEXT): misc/fourcc_gen.c misc/fourcc_list.h ../include/vlc_fourcc.h
 	$(AM_V_at)rm -f -- $@
 	$(AM_V_CC)$(BUILDCC) -I$(srcdir) -o $@ $<
 
-fourcc_tables.h: fourcc_gen
+fourcc_tables.h: fourcc_gen$(BUILDEXEEXT)
 	$(AM_V_at)rm -f -- $@.tmp
 	$(AM_V_GEN)$(builddir)/fourcc_gen > $@.tmp
 	$(AM_V_at)mv -f -- $@.tmp $@
-- 
1.9.5

