fi
done
+for ac_hdr in dlfcn.h image.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:2658: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2663 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2668: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+for ac_hdr in arpa/inet.h net/if.h netinet/in.h sys/socket.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:2698: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2703 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2708: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
for ac_hdr in cthreads.h pthread.h kernel/sheduler.h kernel/OS.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2659: checking for $ac_hdr" >&5
+echo "configure:2739: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2664 "configure"
+#line 2744 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2669: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2749: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:2697: checking for working const" >&5
+echo "configure:2777: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2702 "configure"
+#line 2782 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:2751: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2831: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
fi
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:2772: checking for ANSI C header files" >&5
+echo "configure:2852: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2777 "configure"
+#line 2857 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2785: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2865: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 2802 "configure"
+#line 2882 "configure"
#include "confdefs.h"
#include <string.h>
EOF
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 2820 "configure"
+#line 2900 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
:
else
cat > conftest.$ac_ext <<EOF
-#line 2841 "configure"
+#line 2921 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
exit (0); }
EOF
-if { (eval echo configure:2852: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:2876: checking for size_t" >&5
+echo "configure:2956: checking for size_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2881 "configure"
+#line 2961 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
fi
echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:2909: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:2989: checking whether time.h and sys/time.h may both be included" >&5
if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2914 "configure"
+#line 2994 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
struct tm *tp;
; return 0; }
EOF
-if { (eval echo configure:2923: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3003: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_time=yes
else
ac_given_srcdir=$srcdir
ac_given_INSTALL="$INSTALL"
-trap 'rm -fr `echo "Makefile include/defs.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+trap 'rm -fr `echo "Makefile include/config.h include/defs.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
EOF
cat >> $CONFIG_STATUS <<EOF
cat >> $CONFIG_STATUS <<EOF
-CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
+CONFIG_FILES=\${CONFIG_FILES-"Makefile include/config.h"}
EOF
cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
AC_CHECK_HEADERS(fcntl.h sys/ioctl.h sys/time.h unistd.h)
AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h)
+AC_CHECK_HEADERS(dlfcn.h image.h)
+AC_CHECK_HEADERS(arpa/inet.h net/if.h netinet/in.h sys/socket.h)
dnl Check for threads library
AC_CHECK_HEADERS(cthreads.h pthread.h kernel/sheduler.h kernel/OS.h)
AC_TYPE_SIZE_T
AC_HEADER_TIME
-AC_OUTPUT([Makefile])
+AC_OUTPUT([Makefile include/config.h])
*****************************************************************************/
/* Program version and copyright message */
-#define COPYRIGHT_MESSAGE "VideoLAN Client - version " PROGRAM_VERSION \
- " " PROGRAM_CODENAME " - (c)1996-2000 VideoLAN"
+#define COPYRIGHT_MESSAGE "VideoLAN Client - version " @VLC_VERSION@ \
+ " " @VLC_CODENAME@ " - (c)1996-2000 VideoLAN"
/*****************************************************************************
* General compilation options
#define VOUT_GAMMA 0.
/* Default fonts */
-#define VOUT_DEFAULT_FONT "Resources/default8x9.psf"
-#define VOUT_LARGE_FONT "Resources/default8x16.psf"
+#define VOUT_DEFAULT_FONT "lib/default8x9.psf"
+#define VOUT_LARGE_FONT "lib/default8x16.psf"
/*
* Time settings
/* Define if you have the usleep function. */
#undef HAVE_USLEEP
+/* Define if you have the <arpa/inet.h> header file. */
+#undef HAVE_ARPA_INET_H
+
/* Define if you have the <cthreads.h> header file. */
#undef HAVE_CTHREADS_H
+/* Define if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
/* Define if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
+/* Define if you have the <image.h> header file. */
+#undef HAVE_IMAGE_H
+
/* Define if you have the <kernel/OS.h> header file. */
#undef HAVE_KERNEL_OS_H
/* Define if you have the <machine/soundcard.h> header file. */
#undef HAVE_MACHINE_SOUNDCARD_H
+/* Define if you have the <net/if.h> header file. */
+#undef HAVE_NET_IF_H
+
+/* Define if you have the <netinet/in.h> header file. */
+#undef HAVE_NETINET_IN_H
+
/* Define if you have the <pthread.h> header file. */
#undef HAVE_PTHREAD_H
/* Define if you have the <sys/ioctl.h> header file. */
#undef HAVE_SYS_IOCTL_H
+/* Define if you have the <sys/socket.h> header file. */
+#undef HAVE_SYS_SOCKET_H
+
/* Define if you have the <sys/soundcard.h> header file. */
#undef HAVE_SYS_SOUNDCARD_H
#if defined(HAVE_PTHREAD_H) /* pthreads (Linux & BSD for example) */
#include <pthread.h>
+
#elif defined(HAVE_CTHREADS_H) /* GNUMach */
#include <cthreads.h>
+
#elif defined(HAVE_KERNEL_SHEDULER_H) && defined(HAVE_KERNEL_OS_H) /* BeOS */
#include <kernel/OS.h>
#include <kernel/scheduler.h>
+
#else
#error no threads available on your system !
#endif
static __inline__ void lazy_init_mutex(vlc_mutex_t* p_mutex)
{
int32 v = atomic_or( &p_mutex->init, 1 );
- if( 2000 == v ) // we're the first, so do the init
+ if( 2000 == v ) /* we're the first, so do the init */
{
vlc_mutex_init( p_mutex );
}
- else // we're not the first, so wait until the init is finished
+ else /* we're not the first, so wait until the init is finished */
{
while( p_mutex->init != 9999 ) snooze( 10000 );
}
static __inline__ void lazy_init_cond( vlc_cond_t* p_condvar )
{
int32 v = atomic_or( &p_condvar->init, 1 );
- if( 2000 == v ) // we're the first, so do the init
+ if( 2000 == v ) /* we're the first, so do the init */
{
vlc_cond_init( p_condvar );
}
- else // we're not the first, so wait until the init is finished
+ else /* we're not the first, so wait until the init is finished */
{
while( p_condvar->init != 9999 ) snooze( 10000 );
}
static int TestMMX( void )
{
/* FIXME: under beos, gcc does not support the foolowing inline assembly */
-#ifndef SYS_BEOS
+#ifdef SYS_BEOS
+ return( 1 );
+#else
int i_reg, i_dummy = 0;
return( 1 );
-#else /* SYS_BEOS */
- return( 1 );
-#endif /* SYS_BEOS */
+#endif
}
#endif
#include <unistd.h> /* select() */
#include <sys/time.h>
-#ifdef SYS_BEOS
+#ifdef HAVE_KERNEL_OS_H
#include <kernel/OS.h>
#endif
*****************************************************************************/
mtime_t mdate( void )
{
-#ifdef SYS_BEOS
+#ifdef HAVE_KERNEL_OS_H
return( real_time_clock_usecs() );
+
#else
struct timeval tv_date;
* here, since tv is a local variable. */
gettimeofday( &tv_date, NULL );
return( (mtime_t) tv_date.tv_sec * 1000000 + (mtime_t) tv_date.tv_usec );
+
#endif
}
*****************************************************************************/
void mwait( mtime_t date )
{
-#ifdef SYS_BEOS
+#ifdef HAVE_KERNEL_OS_H
+
mtime_t delay;
delay = date - real_time_clock_usecs();
return;
}
snooze( delay );
-#else /* SYS_BEOS */
+#else
struct timeval tv_date, tv_delay;
mtime_t delay; /* delay in msec, signed to detect errors */
{
return;
}
-#ifndef usleep
+
+#ifdef HAVE_USLEEP
+ usleep( delay );
+#else
tv_delay.tv_sec = delay / 1000000;
tv_delay.tv_usec = delay % 1000000;
/* see msleep() about select() errors */
select( 0, NULL, NULL, NULL, &tv_delay );
-#else
- usleep( delay );
#endif
-#endif /* SYS_BEOS */
+#endif /* HAVE_KERNEL_OS_H */
}
/*****************************************************************************
*****************************************************************************/
void msleep( mtime_t delay )
{
-#ifdef SYS_BEOS
+#ifdef HAVE_KERNEL_OS_H
snooze( delay );
-#else /* SYS_BEOS */
+#else
-#ifndef usleep
+#ifdef HAVE_USLEEP
+ usleep( delay );
+#else
struct timeval tv_delay;
tv_delay.tv_sec = delay / 1000000;
* (i.e. when a signal is sent to the thread, or when memory is full), and
* can be ingnored. */
select( 0, NULL, NULL, NULL, &tv_delay );
-#else
- usleep( delay );
#endif
-#endif /* SYS_BEOS */
+#endif /* HAVE_KERNEL_OS_H */
}
#include <errno.h> /* errno() */
#include <string.h> /* bzero(), bcopy() */
-#ifdef SYS_BSD
-#include <netinet/in.h> /* struct in_addr */
-#include <sys/socket.h> /* struct sockaddr */
-#endif
-
-#if defined(SYS_LINUX) || defined(SYS_BSD) || defined(SYS_GNU)
+#include <netinet/in.h> /* BSD: struct in_addr */
+#include <sys/socket.h> /* BSD: struct sockaddr */
+#ifdef (HAVE_ARPA_INET_H)
#include <arpa/inet.h> /* inet_ntoa(), inet_aton() */
#endif
-
-#ifdef SYS_LINUX
+#if defined (HAVE_SYS_IOCTL_H) && defined(HAVE_NET_IF_H)
#include <sys/ioctl.h> /* ioctl() */
#include <net/if.h> /* interface (arch-dependent) */
#endif
}
/* Try to convert address directly from in_addr - this will work if
* psz_in_addr is dotted decimal. */
-#ifdef SYS_BEOS
- else if( (p_sa_in->sin_addr.s_addr = inet_addr( psz_in_addr )) == -1 )
-#else
+#ifdef HAVE_ARPA_INET_H
else if( !inet_aton( psz_in_addr, &p_sa_in->sin_addr) )
+#else
+ else if( (p_sa_in->sin_addr.s_addr = inet_addr( psz_in_addr )) == -1 )
#endif
{
/* The convertion failed: the address is an host name, which needs
int ReadIfConf(int i_sockfd, if_descr_t* p_ifdescr, char* psz_name)
{
int i_rc = 0;
-#ifdef SYS_LINUX
+#if defined (HAVE_SYS_IOCTL_H) && defined(HAVE_NET_IF_H)
struct ifreq ifr_config;
ASSERT(p_ifdescr);
psz_name, strerror(errno));
return -1;
}
-#endif /* SYS_LINUX */
+#endif
return i_rc;
}
*****************************************************************************/
int ReadNetConf(int i_sockfd, net_descr_t* p_net_descr)
{
-#ifdef SYS_LINUX
+#if defined (HAVE_SYS_IOCTL_H) && defined(HAVE_NET_IF_H)
struct ifreq* a_ifr_ifconf = NULL;
struct ifreq* p_ifr_current_if;
struct ifconf ifc_netconf;
int i_if_number;
int i_remaining;
-#endif /* SYS_LINUX */
+#endif
int i_rc = 0;
-#ifdef SYS_LINUX
+#if defined (HAVE_SYS_IOCTL_H) && defined(HAVE_NET_IF_H)
ASSERT(p_net_descr);
/* Start by assuming we have few than 3 interfaces (i_if_number will
/* Don't need the a_ifr_ifconf anymore */
free( a_ifr_ifconf );
-#endif /* SYS_LINUX */
+#endif
return i_rc;
}
#include <stdlib.h> /* free(), strtol() */
#include <stdio.h> /* sprintf() */
-#if defined(SYS_LINUX) || defined(SYS_BSD) || defined(SYS_GNU)
+#if defined(HAVE_DLFCN_H) /* Linux, BSD, Hurd */
#include <dlfcn.h> /* dlopen(), dlsym(), dlclose() */
-#endif
-#ifdef SYS_BEOS
+#elif defined(HAVE_IMAGE_H) /* BeOS */
#include <image.h>
+
+#else
+#error no dynamic plugins available on your system !
#endif
#include "plugins.h"
{
psz_plugin = malloc( strlen(psz_plugin_path[i_count]) + i_length + 6 );
sprintf( psz_plugin, "%s/%s_%s.so", psz_plugin_path[i_count], psz_mask, psz_name );
-#ifdef SYS_BEOS
- *p_plugin = load_addon_image( psz_plugin );
-#else /* SYS_BEOS */
+
+#if defined(HAVE_DLFCN_H)
*p_plugin = dlopen( psz_plugin, RTLD_NOW | RTLD_GLOBAL );
-#endif /* SYS_BEOS */
+
+#elif defined(HAVE_IMAGE_H)
+ *p_plugin = load_addon_image( psz_plugin );
+
+#endif
+
free( psz_plugin );
-#ifdef SYS_BEOS
- if( *p_plugin >= 0 )
+#if defined(HAVE_DLFCN_H)
+ if( *p_plugin != NULL )
return( 0 );
-#else
- if( *p_plugin != NULL )
+
+#elif defined(HAVE_IMAGE_H)
+ if( *p_plugin >= 0 )
return( 0 );
+
#endif
}
void TrashPlugin ( plugin_id_t plugin )
{
-#ifdef SYS_BEOS
- unload_add_on( plugin );
-#else
+#if defined(HAVE_DLFCN_H)
dlclose( plugin );
+
+#elif defined(HAVE_IMAGE_H)
+ unload_add_on( plugin );
+
#endif
}
void * GetPluginFunction ( plugin_id_t plugin, char *psz_name )
{
-#ifdef SYS_BEOS
+#if defined(HAVE_DLFCN_H)
+ return( dlsym(plugin, psz_name) );
+
+#elif defined(HAVE_IMAGE_H)
void * p_func;
if( get_image_symbol( plugin, psz_name, B_SYMBOL_TYPE_TEXT, &p_func ) )
return( NULL );
else
return( p_func );
-#else
- return( dlsym(plugin, psz_name) );
+
#endif
}