Commit a3c6cd9a authored by Christophe Massiot's avatar Christophe Massiot

* Borrowed config.guess and config.sub from SDL [MacOS X port] ;

* Changed files so that the MacOS X port compiles & runs [MacOS X port] ;
* If SDL/GTK/DSP is not available, don't compile the associated module.
parent e281e731
......@@ -73,7 +73,7 @@ endif
#
# C headers directories
#
INCLUDE += -Iinclude -I/usr/local/include -I/usr/X11R6/include
INCLUDE += -Iinclude -I/usr/local/include
#
# Libraries
......@@ -95,6 +95,10 @@ ifneq (,$(findstring solaris,$(SYS)))
LIB += -ldl -lsocket -lnsl -lpthread
endif
ifneq (,$(findstring darwin,$(SYS)))
LIB += -ldl -dyn
endif
ifeq ($(SYS),beos)
LIB += -lbe -lroot -lgame
else
......@@ -114,6 +118,10 @@ ifeq ($(SYS),beos)
CFLAGS += -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual
endif
ifneq (,$(findstring darwin,$(SYS)))
CFLAGS += -traditional-cpp
endif
# Optimizations : don't compile debug versions with them
ifeq ($(OPTIMS),1)
CFLAGS += -O3
......@@ -132,12 +140,7 @@ endif
# Optimizations for PowerPC
ifneq (,$(findstring powerpc,$(ARCH)))
# 604e
CFLAGS += -mcpu=604e -mmultiple -mhard-float -mstring
# G3
#CFLAGS += -mcpu=750 -mmultiple -mhard-float -mstring
# G4
#CFLAGS += -mcpu=7400 -mmultiple -mhard-float -mstring
CFLAGS += -mmultiple -mhard-float -mstring
endif
# Optimizations for Sparc
......@@ -156,7 +159,12 @@ endif
#
# C compiler flags: plugin compilation
#
ifneq (,$(findstring darwin,$(SYS)))
PCFLAGS += -bundle -undefined suppress
else
PCFLAGS += -fPIC
PLCFLAGS += -shared
endif
#
# C compiler flags: dependancies
......@@ -414,7 +422,6 @@ STD_PLUGIN_OBJ = \
$(PLUGIN_PS) \
$(PLUGIN_SDL) \
$(PLUGIN_TS) \
$(PLUGIN_X11) \
$(PLUGIN_YUV) \
$(PLUGIN_YUVMMX)
......@@ -427,6 +434,7 @@ STD_PLUGIN_OBJ := $(filter-out $(STD_PLUGIN_COMMON), \
$(STD_PLUGIN_OBJ)) $(STD_PLUGIN_COMMON)
NONSTD_PLUGIN_OBJ = \
$(PLUGIN_X11) \
$(PLUGIN_GLIDE) \
$(PLUGIN_GTK) \
$(PLUGIN_GNOME)
......@@ -569,6 +577,11 @@ $(STD_PLUGIN_OBJ): %.o: .dep/%.d
$(STD_PLUGIN_OBJ): %.o: %.c
$(CC) $(CFLAGS) $(PCFLAGS) -c -o $@ $<
$(PLUGIN_X11): %.o: Makefile.dep
$(PLUGIN_X11): %.o: .dep/%.d
$(PLUGIN_X11): %.o: %.c
$(CC) $(CFLAGS) $(PCFLAGS) -I/usr/X11R6/include -c -o $@ $<
$(PLUGIN_GTK): %.o: Makefile.dep
$(PLUGIN_GTK): %.o: .dep/%.d
$(PLUGIN_GTK): %.o: %.c
......@@ -623,49 +636,49 @@ lib/beos.so: $(PLUGIN_BEOS)
lib/esd.so: $(PLUGIN_ESD)
ifneq (,$(findstring bsd,$(SYS)))
$(CC) $(PCFLAGS) -shared -o $@ $^ -lesd
$(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^ -lesd
else
$(CC) $(PCFLAGS) -shared -o $@ $^ -laudiofile -lesd
$(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^ -laudiofile -lesd
endif
lib/dsp.so: $(PLUGIN_DSP)
$(CC) $(PCFLAGS) -shared -o $@ $^
$(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^
lib/qt.so: $(PLUGIN_QT)
$(CC) $(PCFLAGS) -shared -o $@ $^ -lqt
$(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^ -lqt
lib/kde.so: $(PLUGIN_KDE)
$(CC) $(PCFLAGS) -shared -o $@ $^ -lkdeui -lkdecore -lqt -ldl
$(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^ -lkdeui -lkdecore -lqt -ldl
lib/alsa.so: $(PLUGIN_ALSA)
$(CC) $(PCFLAGS) -shared -o $@ $^ -lasound
$(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^ -lasound
lib/fb.so: $(PLUGIN_FB)
$(CC) $(PCFLAGS) -shared -o $@ $^
$(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^
lib/x11.so: $(PLUGIN_X11)
$(CC) $(PCFLAGS) -shared -o $@ $^ -L/usr/X11R6/lib -lX11 -lXext
$(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^ -L/usr/X11R6/lib -lX11 -lXext
lib/mga.so: $(PLUGIN_MGA)
$(CC) $(PCFLAGS) -shared -o $@ $^ -L/usr/X11R6/lib -lX11 -lXext
$(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^ -L/usr/X11R6/lib -lX11 -lXext
lib/gtk.so: $(PLUGIN_GTK)
$(CC) $(PCFLAGS) -shared -o $@ $^ `gtk-config --libs gtk | sed 's,-rdynamic,,'`
$(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^ `gtk-config --libs gtk | sed 's,-rdynamic,,'`
lib/gnome.so: $(PLUGIN_GNOME)
$(CC) $(PCFLAGS) -shared -o $@ $^ `gnome-config --libs gnomeui | sed 's,-rdynamic,,'`
$(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^ `gnome-config --libs gnomeui | sed 's,-rdynamic,,'`
lib/glide.so: $(PLUGIN_GLIDE)
$(CC) $(PCFLAGS) -shared -o $@ $^ $(LIB_GLIDE)
$(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^ $(LIB_GLIDE)
lib/ggi.so: $(PLUGIN_GGI)
$(CC) $(PCFLAGS) -shared -o $@ $^ $(LIB_GGI)
$(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^ $(LIB_GGI)
lib/sdl.so: $(PLUGIN_SDL)
$(CC) $(PCFLAGS) -shared -o $@ $^ $(LIB_SDL)
$(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^ $(LIB_SDL)
lib/ncurses.so: $(PLUGIN_NCURSES)
$(CC) $(PCFLAGS) -shared -o $@ $^ -lncurses
$(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^ -lncurses
ifeq ($(SYS),beos)
lib/null.so: $(PLUGIN_NULL)
......@@ -711,46 +724,46 @@ lib/idctmmxext.so: $(PLUGIN_IDCTMMXEXT)
$(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
else
lib/null.so: $(PLUGIN_NULL)
$(CC) $(PCFLAGS) -shared -o $@ $^
$(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^
lib/ps.so: $(PLUGIN_PS)
$(CC) $(PCFLAGS) -shared -o $@ $^
$(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^
lib/ts.so: $(PLUGIN_TS)
$(CC) $(PCFLAGS) -shared -o $@ $^
$(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^
lib/dvd.so: $(PLUGIN_DVD)
$(CC) $(PCFLAGS) -shared -o $@ $^
$(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^
lib/dummy.so: $(PLUGIN_DUMMY)
$(CC) $(PCFLAGS) -shared -o $@ $^
$(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^
lib/yuv.so: $(PLUGIN_YUV)
$(CC) $(PCFLAGS) -shared -o $@ $^
$(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^
lib/yuvmmx.so: $(PLUGIN_YUVMMX)
$(CC) $(PCFLAGS) -shared -o $@ $^
$(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^
lib/motion.so: $(PLUGIN_MOTION)
$(CC) $(PCFLAGS) -shared -o $@ $^
$(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^
lib/motionmmx.so: $(PLUGIN_MOTIONMMX)
$(CC) $(PCFLAGS) -shared -o $@ $^
$(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^
lib/motionmmxext.so: $(PLUGIN_MOTIONMMXEXT)
$(CC) $(PCFLAGS) -shared -o $@ $^
$(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^
lib/idct.so: $(PLUGIN_IDCT)
$(CC) $(PCFLAGS) -shared -o $@ $^
$(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^
lib/idctclassic.so: $(PLUGIN_IDCTCLASSIC)
$(CC) $(PCFLAGS) -shared -o $@ $^
$(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^
lib/idctmmx.so: $(PLUGIN_IDCTMMX)
$(CC) $(PCFLAGS) -shared -o $@ $^
$(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^
lib/idctmmxext.so: $(PLUGIN_IDCTMMXEXT)
$(CC) $(PCFLAGS) -shared -o $@ $^
$(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^
endif
################################################################################
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -25,11 +25,6 @@ dnl Check for compiler environment
AC_C_CONST
AC_C_BIGENDIAN
AC_MSG_CHECKING([whether compiler accepts bswap x86 instruction])
AC_TRY_COMPILE([unsigned int foo( unsigned int x )
{ __asm__("bswap %0" : "=r" (x) : "0" (x)); return x; }],,
AC_DEFINE(HAVE_X86_BSWAP, 1, Define if compiler accepts bswap x86 instruction.) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
dnl Check for system libs needed
AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol)
AC_CHECK_FUNCS(setenv putenv)
......@@ -79,7 +74,7 @@ void foo() { int meuh; ntohl(meuh); }],,
AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
dnl Check for -rdynamic flag
CFLAGS="${CFLAGS} -rdynamic"
CFLAGS="${CFLAGS} -rdynamic -Wall -Werror"
AC_MSG_CHECKING([if \$CC accepts -rdynamic])
AC_TRY_COMPILE([],,
DYNAMIC_FLAG="-rdynamic"
......@@ -88,12 +83,17 @@ AC_TRY_COMPILE([],,
dnl End of the bizarre compilation tests
CFLAGS=$save_CFLAGS
dnl Check for boolean_t in sys/types.h
dnl Check for boolean_t
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))
AC_MSG_CHECKING([for boolean_t in pthread.h])
AC_TRY_COMPILE([#include <pthread.h>
void quux() { boolean_t foo; }],,
AC_DEFINE(BOOLEAN_T_IN_PTHREAD_H, 1, Define if <pthread.h> defines boolean_t.)
AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
......@@ -157,7 +157,11 @@ AC_ARG_ENABLE(null,
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
if test x$enable_dsp != xno; then
if test -f /dev/dsp; then
PLUGINS=${PLUGINS}"dsp "
fi
fi
AC_ARG_ENABLE(esd,
[ --enable-esd Esound library support (default disabled)],
[if test x$enable_esd = xyes; then PLUGINS=${PLUGINS}"esd "; fi])
......@@ -185,13 +189,15 @@ AC_ARG_WITH(sdl,
then
LIB_SDL="L/usr/X11R6/lib -l"$withval
else
AC_CHECK_HEADERS(SDL/SDL.h, , [echo "Cannot find SDL headers !"; exit])
LIB_SDL="-L/usr/X11R6/lib -lSDL"
fi
fi ])
if test "x$withval" = "x";
then
PLUGINS=${PLUGINS}"sdl "
LIB_SDL="-L/usr/X11R6/lib -lSDL"
AC_CHECK_HEADERS(SDL/SDL.h,
[PLUGINS=${PLUGINS}"sdl "
LIB_SDL="-L/usr/X11R6/lib -lSDL"])
fi
AC_ARG_WITH(glide,
[ --with-glide[=name] Glide (3dfx) support (default disabled)],
......@@ -219,7 +225,12 @@ AC_ARG_ENABLE(gnome,
[if test x$enable_gnome = xyes; then PLUGINS=${PLUGINS}"gnome "; GVLC=1; fi])
AC_ARG_ENABLE(gtk,
[ --disable-gtk Gtk+ support (default enabled)])
if test x$enable_gtk != xno; then PLUGINS=${PLUGINS}"gtk "; GVLC=1; fi
if test x$enable_gtk != xno; then
if which gtk-config; then
PLUGINS=${PLUGINS}"gtk "
GVLC=1
fi
fi
AC_ARG_ENABLE(x11,
[ --disable-x11 X11 support (default enabled)])
if test x$enable_x11 != xno; then PLUGINS=${PLUGINS}"x11 "; fi
......
......@@ -3,7 +3,7 @@
* Collection of useful common types and macros definitions
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: common.h,v 1.28 2001/02/08 07:24:25 sam Exp $
* $Id: common.h,v 1.29 2001/03/16 22:37:06 massiot Exp $
*
* Authors: Samuel Hocevar <sam@via.ecp.fr>
* Vincent Seguin <seguin@via.ecp.fr>
......@@ -39,6 +39,8 @@ typedef u8 byte_t;
/* Boolean type */
#ifdef BOOLEAN_T_IN_SYS_TYPES_H
# include <sys/types.h>
#elif defined(BOOLEAN_T_IN_PTHREAD_H)
# include <pthread.h>
#else
typedef int boolean_t;
#endif
......
......@@ -52,6 +52,9 @@
/* Define if you have the vasprintf function. */
#undef HAVE_VASPRINTF
/* Define if you have the <SDL/SDL.h> header file. */
#undef HAVE_SDL_SDL_H
/* Define if you have the <arpa/inet.h> header file. */
#undef HAVE_ARPA_INET_H
......@@ -151,15 +154,15 @@
/* Define if you have the threads library (-lthreads). */
#undef HAVE_LIBTHREADS
/* Define if compiler accepts bswap x86 instruction. */
#undef HAVE_X86_BSWAP
/* 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
/* Define if <pthread.h> defines boolean_t. */
#undef BOOLEAN_T_IN_PTHREAD_H
/* DVD support for linux */
#undef LINUX_DVD
......
......@@ -40,6 +40,7 @@ module_load( char * psz_filename, module_handle_t * handle )
/* Do not open modules with RTLD_GLOBAL, or we are going to get namespace
* collisions when two modules have common public symbols */
*handle = dlopen( psz_filename, RTLD_NOW );
return( *handle == NULL );
#endif
}
......@@ -85,6 +86,20 @@ module_getsymbol( module_handle_t handle, char * psz_function )
{
return( NULL );
}
#elif defined(SYS_DARWIN1_3)
/* MacOS X dl library expects symbols to begin with "_". That's
* really lame, but hey, what can we do ? */
char * psz_call = malloc( strlen( psz_function ) + 2 );
void * p_return;
strcpy( psz_call + 1, psz_function );
psz_call[ 0 ] = '_';
p_return = dlsym( handle, psz_call );
free( psz_call );
return( p_return );
#else
return( dlsym( handle, psz_function ) );
#endif
......
......@@ -2,7 +2,7 @@
* vout_x11.c: X11 video output display method
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: vout_x11.c,v 1.15 2001/02/20 07:49:13 sam Exp $
* $Id: vout_x11.c,v 1.16 2001/03/16 22:37:06 massiot Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -234,6 +234,11 @@ static int vout_Init( vout_thread_t *p_vout )
{
int i_err;
#ifdef SYS_DARWIN1_3
/* FIXME : As of 2001-03-16, XFree4 for MacOS X does not support Xshm. */
p_vout->p_sys->b_shm = 0;
#endif
/* Create XImages using XShm extension - on failure, fall back to regular
* way (and destroy the first image if it was created successfully) */
if( p_vout->p_sys->b_shm )
......
......@@ -19,9 +19,9 @@
*/
#include "intf_urldecode.h"
#include <malloc.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
/* URL-decode a file: URL path, return NULL if it's not what we expect */
void urldecode_path(char *encoded_path)
......
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