From 9446c2958edfebb28a603b7bc859149bbe2276ce Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Fri, 9 May 2003 05:26:02 +0000 Subject: [PATCH] Fixes that allow compilation under cygwin. --- Makefile.am | 5 +++-- acinclude.m4 | 24 ++++++++++++++++++++++++ avilib/avilib.h | 4 +++- common.cpp | 6 +++++- common.h | 4 +++- configure.in | 1 + 6 files changed, 39 insertions(+), 5 deletions(-) diff --git a/Makefile.am b/Makefile.am index 96e7dbde1..5130c216e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -33,9 +33,10 @@ mkvinfo_SOURCES = mkvinfo.cpp mkvinfo.h \ iso639.cpp iso639.h mkvmerge_LDADD = @AVILIB_LIBS@ @PROFILING_LIBS@ \ - @MATROSKA_LIBS@ @EBML_LIBS@ @OGG_LIBS@ @VORBIS_LIBS@ + @MATROSKA_LIBS@ @EBML_LIBS@ @VORBIS_LIBS@ @OGG_LIBS@ \ + @ICONV_LIBS@ -mkvinfo_LDADD = @PROFILING_LIBS@ @MATROSKA_LIBS@ @EBML_LIBS@ +mkvinfo_LDADD = @PROFILING_LIBS@ @MATROSKA_LIBS@ @EBML_LIBS@ @ICONV_LIBS@ man_MANS = mkvmerge.1 mkvinfo.1 diff --git a/acinclude.m4 b/acinclude.m4 index 8883e07dd..23091a1d7 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -309,6 +309,8 @@ AC_ARG_ENABLE(ebmltest, [ --disable-ebmltest Do not try to compile a fi if test "x$ebml_lib" != "x"; then EBML_LIBS="-L$ebml_lib" + else + EBML_LIBS="-L/usr/local/lib" fi fi @@ -430,6 +432,8 @@ AC_ARG_ENABLE(matroskatest, [ --disable-matroskatest Do not try to compi fi if test "x$matroska_lib" != "x"; then MATROSKA_LIBS="-L$matroska_lib" + else + MATROSKA_LIBS="-L/usr/local/lib" fi fi @@ -543,3 +547,23 @@ AC_DEFUN(PATH_CXXVERSION, esac AC_SUBST(CXXVER_CFLAGS) ]) + +dnl +dnl Check for cygwin +dnl +AC_DEFUN(PATH_CYGWIN, +[dnl + AC_MSG_CHECKING(if being compiled under cygwin) + CYGWIN="`uname -s`" + case "$CYGWIN" in + CYGWIN*) + ICONV_LIBS="-liconv" + AC_MSG_RESULT(yes) + ;; + *) + ICONV_LIBS="" + AC_MSG_RESULT(no) + ;; + esac + AC_SUBST(ICONV_LIBS) +]) diff --git a/avilib/avilib.h b/avilib/avilib.h index 54402af18..acf26a6a2 100644 --- a/avilib/avilib.h +++ b/avilib/avilib.h @@ -31,7 +31,9 @@ #include //SLM -#ifdef WIN32 +#ifdef __CYGWIN__ +#include +#elif defined WIN32 #define uint16_t unsigned __int16 #define uint32_t unsigned __int32 #define uint64_t unsigned __int64 diff --git a/common.cpp b/common.cpp index 0b885ee94..aeb44bbe1 100644 --- a/common.cpp +++ b/common.cpp @@ -13,7 +13,7 @@ /*! \file - \version \$Id: common.cpp,v 1.16 2003/05/08 18:42:18 mosu Exp $ + \version \$Id: common.cpp,v 1.17 2003/05/09 05:26:02 mosu Exp $ \brief helper functions, common variables \author Moritz Bunkus */ @@ -161,7 +161,11 @@ static char *convert_charset(iconv_t ict, char *src) { ldst = len; psrc = src; pdst = dst; +#ifdef __CYGWIN__ + iconv(ict, (const char **)&psrc, &lsrc, &pdst, &ldst); +#else iconv(ict, &psrc, &lsrc, &pdst, &ldst); +#endif return dst; } diff --git a/common.h b/common.h index f802e57b8..825bf636a 100644 --- a/common.h +++ b/common.h @@ -13,7 +13,7 @@ /*! \file - \version \$Id: common.h,v 1.17 2003/05/05 18:37:36 mosu Exp $ + \version \$Id: common.h,v 1.18 2003/05/09 05:26:02 mosu Exp $ \brief definitions used in all programs, helper functions \author Moritz Bunkus */ @@ -21,7 +21,9 @@ #ifndef __COMMON_H #define __COMMON_H +#ifndef __CYGWIN__ #include +#endif #include #ifdef WIN32 diff --git a/configure.in b/configure.in index 3bc47be16..759dc9317 100644 --- a/configure.in +++ b/configure.in @@ -10,6 +10,7 @@ AC_PROG_CPP AC_PROG_RANLIB PATH_CXXVERSION() +PATH_CYGWIN() XIPH_PATH_OGG() XIPH_PATH_VORBIS() PATH_AVILIB()