Commit ffa693e8 authored by Sam Hocevar's avatar Sam Hocevar

 . should compile & run on Solaris with ./configure --disable-dsp
    (tested on puma)
 . removed most SYS_SOLARIS #ifdef's in favour of more generic tests
 . updated example ./configure line in INSTALL file
 . now we only load modules that end with ".so"
 . null module is compiled by default
parent 4542979c
......@@ -6,12 +6,12 @@ Building VideoLAN
A typical way to configure the vlc is :
./configure --prefix=/usr --enable-mmx --enable-gnome
./configure --prefix=/usr --enable-gnome --with-sdl
For a full compilation, you may try :
./configure --prefix=/usr --enable-mmx --enable-gnome --enable-fb \
--enable-glide --enable-ggi --enable-sdl --enable-esd --enable-alsa
./configure --prefix=/usr --enable-gnome --enable-fb \
--with-glide --with-ggi --with-sdl --enable-esd --enable-alsa
See `./configure --help' for more information.
......
......@@ -82,7 +82,7 @@ LIB += -lpthread -ldl
endif
ifneq (,$(findstring solaris,$(SYS)))
LIB += -ldl -lsocket -lnsl -lposix4 -lpthread
LIB += -ldl -lsocket -lnsl -lposix4 -lpthread -lresolv
endif
ifeq ($(SYS),beos)
......@@ -107,9 +107,9 @@ endif
# Optimizations : don't compile debug versions with them
ifeq ($(OPTIMS),1)
CFLAGS += -O6
CFLAGS += -ffast-math -funroll-loops -fargument-noalias-global
CFLAGS += -funroll-all-loops -fstrict-aliasing
CFLAGS += -ffast-math -funroll-loops -funroll-all-loops
CFLAGS += -fomit-frame-pointer
CFLAGS += @BIZARRE_OPTIMS@
# Optimizations for x86 familiy
ifneq (,$(findstring 86,$(ARCH)))
......@@ -438,7 +438,10 @@ snapshot:
mv /tmp/${SNAPSHOTDIR}.tar.bz2 ..
@echo "Sources are in ../${SNAPSHOTDIR}.tar.[gz,bz2]"
plugins: $(PLUGINS:%=lib/%.so)
plugins: lib $(PLUGINS:%=lib/%.so)
lib:
mkdir -p lib
FORCE:
......@@ -490,7 +493,7 @@ ifeq ($(SYS),beos)
rm -f ./plugins/_APP_
ln -s ../vlc ./plugins/_APP_
else
$(CC) $(CFLAGS) $(LCFLAGS) --export-dynamic -rdynamic -o $@ $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ)
$(CC) $(CFLAGS) $(LCFLAGS) --export-dynamic @DYNAMIC_FLAG@ -o $@ $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ)
endif
lib/beos.so: $(PLUGIN_BEOS)
......
This diff is collapsed.
......@@ -33,8 +33,8 @@ AC_CHECK_FUNC(gethostbyname,,[AC_CHECK_LIB(nsl,gethostbyname)])
AC_CHECK_FUNC(nanosleep,,[AC_CHECK_LIB(rt,nanosleep,,[AC_CHECK_LIB(posix4,nanosleep)])])
AC_CHECK_FUNCS(usleep)
AC_CHECK_FUNC(inet_aton,,[AC_CHECK_LIB(resolv,inet_aton)])
AC_CHECK_FUNCS(vasprintf)
AC_FUNC_MMAP
AC_FUNC_VPRINTF
AC_TYPE_SIGNAL
AC_CHECK_LIB(dl, dlopen)
AC_CHECK_LIB(gnugetopt, optarg)
......@@ -62,16 +62,41 @@ AC_CHECK_HEADERS(machine/param.h)
dnl Check for threads library
AC_CHECK_HEADERS(cthreads.h pthread.h kernel/scheduler.h kernel/OS.h)
dnl Check for ntohl, etc.
dnl Do a series of bizarre compilation tests
save_CFLAGS=$CFLAGS
dnl Check for ntohl, etc.
CFLAGS="${CFLAGS} -Wall -Werror"
AC_MSG_CHECKING([for ntohl in sys/param.h])
AC_TRY_COMPILE([#include <sys/param.h>
void foo() { int meuh; ntohl(meuh); }],,
AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Gabuzomeu)
AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if ntohl is in <sys/param.h>.)
AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
dnl Check for special optimization flags
CFLAGS="${CFLAGS} -fargument-noalias-global -fstrict-aliasing"
AC_MSG_CHECKING([if \$CC accepts -fargument-noalias-global -fstrict-aliasing])
AC_TRY_COMPILE([],,
BIZARRE_OPTIMS="-fargument-noalias-global -fstrict-aliasing"
AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
dnl Check for -rdynamic flag
CFLAGS="${CFLAGS} -rdynamic"
AC_MSG_CHECKING([if \$CC accepts -rdynamic])
AC_TRY_COMPILE([],,
DYNAMIC_FLAG="-rdynamic"
AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
dnl End of the bizarre compilation tests
CFLAGS=$save_CFLAGS
dnl Check for boolean_t in sys/types.h
AC_MSG_CHECKING([for boolean_t in sys/types.h])
AC_TRY_COMPILE([#include <sys/types.h>
void quux() { boolean_t foo; }],,
AC_DEFINE(BOOLEAN_T_IN_SYS_TYPES_H, 1, Define if <sys/types.h> defines boolean_t.)
AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
......@@ -104,7 +129,7 @@ SYS=${host_os}
# special cases
if test x$host_os = xbeos; then
PLUGINS=${PLUGINS}"dummy beos "
PLUGINS=${PLUGINS}"dummy null beos "
dnl default case
else
......@@ -112,6 +137,9 @@ else
AC_ARG_ENABLE(dummy,
[ --disable-dummy dummy audio and video support (default enabled)])
if test x$enable_dummy != xno; then PLUGINS=${PLUGINS}"dummy "; fi
AC_ARG_ENABLE(null,
[ --disable-null Null module (default enabled)])
if test x$enable_null != xno; then PLUGINS=${PLUGINS}"null "; fi
AC_ARG_ENABLE(dsp,
[ --disable-dsp Linux /dev/dsp support (default enabled)])
if test x$enable_dsp != xno; then PLUGINS=${PLUGINS}"dsp "; fi
......@@ -148,9 +176,6 @@ AC_ARG_WITH(glide,
else
LIB_GLIDE="-lglide2x"
fi ])
AC_ARG_ENABLE(null,
[ --enable-null Null plugin (default disabled)],
[if test x$enable_null = xyes; then PLUGINS=${PLUGINS}"null "; fi])
AC_ARG_ENABLE(gnome,
[ --enable-gnome Gnome support (default disabled)],
[if test x$enable_gnome = xyes; then PLUGINS=${PLUGINS}"gnome "; ALIASES=${ALIASES}"gvlc "; fi])
......@@ -170,6 +195,8 @@ AC_SUBST(ALIASES)
AC_SUBST(DEBUG)
AC_SUBST(STATS)
AC_SUBST(OPTIMS)
AC_SUBST(BIZARRE_OPTIMS)
AC_SUBST(DYNAMIC_FLAG)
AC_SUBST(LIB_SDL)
AC_SUBST(LIB_GLIDE)
AC_SUBST(LIB_GGI)
......
......@@ -3,7 +3,7 @@
* Collection of useful common types and macros definitions
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: common.h,v 1.20 2001/01/05 18:46:43 massiot Exp $
* $Id: common.h,v 1.21 2001/01/06 07:23:32 sam Exp $
*
* Authors: Samuel Hocevar <sam@via.ecp.fr>
* Vincent Seguin <seguin@via.ecp.fr>
......@@ -37,10 +37,10 @@
typedef u8 byte_t;
/* Boolean type */
#ifndef SYS_SOLARIS
typedef int boolean_t;
#else
#ifdef BOOLEAN_T_IN_SYS_TYPES_H
# include <sys/types.h>
#else
typedef int boolean_t;
#endif
#ifdef SYS_GNU
# define _MACH_I386_BOOLEAN_H_
......
......@@ -3,15 +3,9 @@
/* Define to empty if the keyword does not work. */
#undef const
/* Define if you don't have vprintf but do have _doprnt. */
#undef HAVE_DOPRNT
/* Define if you have a working `mmap' system call. */
#undef HAVE_MMAP
/* Define if you have the vprintf function. */
#undef HAVE_VPRINTF
/* Define as the return type of signal handlers (int or void). */
#undef RETSIGTYPE
......@@ -55,6 +49,9 @@
/* Define if you have the usleep function. */
#undef HAVE_USLEEP
/* Define if you have the vasprintf function. */
#undef HAVE_VASPRINTF
/* Define if you have the <arpa/inet.h> header file. */
#undef HAVE_ARPA_INET_H
......@@ -151,6 +148,9 @@
/* Define if you have the threads library (-lthreads). */
#undef HAVE_LIBTHREADS
/* Gabuzomeu */
/* Define if ntohl is in <sys/param.h>. */
#undef NTOHL_IN_SYS_PARAM_H
/* Define if <sys/types.h> defines boolean_t. */
#undef BOOLEAN_T_IN_SYS_TYPES_H
......@@ -383,11 +383,11 @@ static void QueueMsg( intf_msg_t *p_msg, int i_type, char *psz_format, va_list a
/*
* Convert message to string
*/
#if defined SYS_BEOS || defined SYS_SOLARIS
#ifdef HAVE_VASPRINTF
vasprintf( &psz_str, psz_format, ap );
#else
psz_str = (char*) malloc( strlen(psz_format) + INTF_MAX_MSG_SIZE );
vsprintf( psz_str, psz_format, ap );
#else
vasprintf( &psz_str, psz_format, ap );
#endif
if( psz_str == NULL )
{
......@@ -448,11 +448,11 @@ static void QueueDbgMsg(intf_msg_t *p_msg, char *psz_file, char *psz_function,
/*
* Convert message to string
*/
#if defined SYS_BEOS || defined SYS_SOLARIS
#ifdef HAVE_VASPRINTF
vasprintf( &psz_str, psz_format, ap );
#else
psz_str = (char*) malloc( INTF_MAX_MSG_SIZE );
vsprintf( psz_str, psz_format, ap );
#else
vasprintf( &psz_str, psz_format, ap );
#endif
if( psz_str == NULL )
{
......@@ -624,3 +624,4 @@ static void PrintMsg( intf_msg_item_t *p_msg )
}
#endif
......@@ -105,7 +105,11 @@ void module_InitBank( module_bank_t * p_bank )
/* Parse the directory and try to load all files it contains. */
while( (file = readdir( dir )) )
{
if( memcmp( file->d_name, ".", 1 ) )
int i_filelen = strlen( file->d_name );
/* We only load files ending with ".so" */
if( i_filelen > 3
&& !strcmp( file->d_name + i_filelen - 3, ".so" ) )
{
#ifdef SYS_BEOS
/* Under BeOS, we need to add beos_GetProgramPath() to
......@@ -113,7 +117,7 @@ void module_InitBank( module_bank_t * p_bank )
if( memcmp( file->d_name, "/", 1 ) )
{
psz_file = malloc( i_programlen + i_dirlen
+ strlen( file->d_name ) + 3 );
+ i_filelen + 3 );
if( psz_file == NULL )
{
continue;
......@@ -124,15 +128,13 @@ void module_InitBank( module_bank_t * p_bank )
else
#endif
{
psz_file = malloc( i_dirlen
+ strlen( file->d_name ) + 2 );
psz_file = malloc( i_dirlen + i_filelen + 2 );
if( psz_file == NULL )
{
continue;
}
sprintf( psz_file, "%s/%s", *ppsz_path, file->d_name );
}
/* We created a nice filename -- now we just try to load
* it as a dynamic module. */
AllocateDynModule( p_bank, psz_file );
......
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