Commit ea2f6d38 authored by Damien Lucas's avatar Damien Lucas

. Changed Makefile and configure.in for detection of getopt headers

          (Christophe, can you test it under MacOs X ?)

. Changed configure.in in order to be able to specify the path for
  dvb source files (--with-dvb=PATH)

. Added the patch by Michael Muller and Chen Xiaodong about the windows
  fileoutput bug
parent 50c778b8
......@@ -2,7 +2,7 @@
# vls (VideoLAN Server) main Makefile
#-------------------------------------------------------------------------------
# (c)1999-2001 VideoLAN
# $Id: Makefile,v 1.99 2002/10/19 12:28:26 massiot Exp $
# $Id: Makefile,v 1.100 2002/12/03 22:33:14 nitrox Exp $
################################################################################
......@@ -84,6 +84,11 @@ SRC+= src/mpeg/dvbpsi.cpp \
endif
ifeq ($(NEEDSRC_getopt),1)
SRC+= src/extras/getopt.c \
src/extras/getopt1.c \
endif
#
# Module libraries
......
This diff is collapsed.
......@@ -5,7 +5,7 @@ AC_CONFIG_HEADER(src/core/defs.h)
AC_CANONICAL_SYSTEM
VLS_VERSION=0.4.0
VLS_VERSION=0.5.0
AC_SUBST(VLS_VERSION)
dnl Main sources default
......@@ -28,8 +28,7 @@ AC_CHECK_TOOL(RANLIB, ranlib, :)
AC_CHECK_TOOL(AR, ar, :)
dnl Set default language
dnl Disabled because it makes detection of nanosleep fail on solaris --Meuuh
dnl AC_LANG(C++)
AC_LANG(C++)
dnl AM_PROG_LIBTOOL
AC_PROG_INSTALL
......@@ -120,12 +119,22 @@ AC_EGREP_HEADER(getprotobyname,netdb.h,[
dnl Check for headers
AC_CHECK_HEADERS(stdint.h inttypes.h)
AC_CHECK_HEADERS(stddef.h getopt.h strings.h)
AC_CHECK_HEADERS(stddef.h strings.h)
AC_CHECK_HEADERS(sys/sockio.h fcntl.h sys/time.h sys/times.h)
AC_CHECK_HEADERS(dlfcn.h)
AC_CHECK_HEADERS(arpa/inet.h net/if.h netinet/in.h sys/socket.h)
AC_CHECK_HEADERS(crypt.h)
dnl Check for getopt
need_getopt=false
AC_CHECK_FUNC(getopt_long,[AC_DEFINE(HAVE_GETOPT_LONG,1,long getopt support)],
[ # FreeBSD has a gnugetopt library for this:
AC_CHECK_LIB([gnugetopt],[getopt_long],
[AC_DEFINE(HAVE_GETOPT_LONG,1,getopt support) VLS_LIB="${LDFLAGS_vlc} -lgnugetopt"],
[need_getopt=:])])
dnl Check for socklen_t
AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t,
[AC_TRY_COMPILE(
......@@ -305,33 +314,47 @@ dnl
AC_ARG_ENABLE(dvb,
AC_HELP_STRING(--enable-dvb, DVB support (default disabled)))
AC_ARG_WITH(dvb,
AC_HELP_STRING(--with-dvb=[PATH], path to DVB driver header files
(no path is equivalent to --enable-dvb)))
if test x$enable_dvb = xyes || test x$with_dvb != x
AC_HELP_STRING(--with-dvb=[PATH], path to DVB driver header files))
if test x$enable_dvb = xyes
then
test_CFLAGS=""
if test x$with_dvb != x && test x$with_dvb != xyes
dnl Test for driver header files
AC_MSG_CHECKING(for dvbdriver headers in ${with_dvb})
if test "x$with_dvb" = x
then
test_CFLAGS="-I${with_dvb}"
test_CFLAGS=""
else
test_CFLAGS="-I${with_dvb}/include"
fi
save_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$save_CPPFLAGS $test_CFLAGS"
AC_CHECK_HEADER([dvb/channel.h],HAVE_DVB_LIB=1, HAVE_DVB_LIB=0)
if test ${HAVE_DVB_LIB}=1
then
PLUGINS="${PLUGINS} dvbinput dvbreader"
DVBINPUT_LIB="${DVBINPUT_LIB} -ldvb"
if test x${with_dvb} != x
AC_CHECK_HEADERS([linux/dvb/frontend.h],
[CCFLAGS="${CCFLAGS} ${test_CFLAGS}"],
[AC_MSG_ERROR([Could not find dvbdriver on your system: you may get it from http://www.linuxtv.org/])])
dnl Test for the libdvb library (depends on driver header)
AC_MSG_CHECKING(for libdvb headers in ${with_dvb}/libdvb)
if test "x$with_dvb" != x
then
CCFLAGS="${CCFLAGS} -I${with_dvb}"
DCFLAGS="${DCFLAGS} -I${with_dvb}"
test_CFLAGS="-I${with_dvb}/libdvb"
fi
save_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$save_CPPFLAGS $test_CFLAGS"
AC_CHECK_HEADERS([DVB.hh],[
CCFLAGS="${CCFLAGS} ${test_CFLAGS}"
],[
AC_MSG_ERROR([Could not find libdvb headers on your system: you may get it from http://www.linuxtv.org/])
])
CPPFLAGS="$save_CPPFLAGS"
dnl Test for the lib existence
if test -f "${with_dvb}/libdvb/libdvb.a"
then
VLS_LIB="${VLS_LIB} -ldvb"
DCFLAGS="${DCFLAGS} -L${with_dvb}/libdvb"
PLUGINS="${PLUGINS} dvbinput dvbreader"
else
AC_MSG_ERROR([cannot find ${with_dvb}/libdvb/libdvb.a, make sure you compiled libdvbpsi in ${with_dvb}/libdvb])
fi
NEEDSRC_mpegmux=1
else
AC_MSG_ERROR([The development library package for DVB is not installed.
Please install it and try again])
fi
CPPFLAGS=$save_CPPFLAGS
fi
dnl
......
......@@ -2,7 +2,7 @@
* fileoutput.cpp: file output
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: fileoutput.cpp,v 1.2 2002/08/09 13:42:32 tooney Exp $
* $Id: fileoutput.cpp,v 1.3 2002/12/03 22:33:14 nitrox Exp $
*
* Authors: James Courtier-Dutton <James@superbug.demon.co.uk>
* Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
......@@ -72,12 +72,19 @@ C_FileOutput::~C_FileOutput()
//------------------------------------------------------------------------------
void C_FileOutput::OnInit()
{
{
// Open the file
if(m_bAppend)
m_cFile.Open("a+");
else
#ifdef WIN32
m_cFile.Open("ab+");
#else
m_cFile.Open("a+");
#endif
else
#ifdef WIN32
m_cFile.Open("wb+");
#else
m_cFile.Open("w+");
#endif
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment