From ffa693e8bdac429c229fa679e64a8bd6cd6af15f Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Sat, 6 Jan 2001 07:23:32 +0000 Subject: [PATCH] . 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 --- INSTALL | 6 +- Makefile.in | 13 +- configure | 437 +++++++++++++++++++++------------------ configure.in | 41 +++- include/common.h | 8 +- include/defs.h.in | 14 +- src/interface/intf_msg.c | 13 +- src/misc/modules.c | 12 +- 8 files changed, 303 insertions(+), 241 deletions(-) diff --git a/INSTALL b/INSTALL index e9a1285a3d..0b4232896e 100644 --- a/INSTALL +++ b/INSTALL @@ -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. diff --git a/Makefile.in b/Makefile.in index cdd81337a8..c99e955b18 100644 --- a/Makefile.in +++ b/Makefile.in @@ -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) diff --git a/configure b/configure index 50fa933765..9d27717934 100755 --- a/configure +++ b/configure @@ -23,6 +23,8 @@ ac_help="$ac_help --disable-optimizations Disable compiler optimizations (default enabled)" ac_help="$ac_help --disable-dummy dummy audio and video support (default enabled)" +ac_help="$ac_help + --disable-null Null module (default enabled)" ac_help="$ac_help --disable-dsp Linux /dev/dsp support (default enabled)" ac_help="$ac_help @@ -35,8 +37,6 @@ ac_help="$ac_help --with-sdl[=name] SDL support (default disabled)" ac_help="$ac_help --with-glide[=name] Glide (3dfx) support (default disabled)" -ac_help="$ac_help - --enable-null Null plugin (default disabled)" ac_help="$ac_help --enable-gnome Gnome support (default disabled)" ac_help="$ac_help @@ -1764,21 +1764,76 @@ fi fi +for ac_func in vasprintf +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:1771: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:1799: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1772: checking for $ac_hdr" >&5 +echo "configure:1827: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1782: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1837: \"$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* @@ -1807,12 +1862,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1811: checking for $ac_func" >&5 +echo "configure:1866: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1894: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1860,7 +1915,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:1864: checking for working mmap" >&5 +echo "configure:1919: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1868,7 +1923,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -2033,118 +2088,13 @@ EOF fi -echo $ac_n "checking for vprintf""... $ac_c" 1>&6 -echo "configure:2038: checking for vprintf" >&5 -if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char vprintf(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_vprintf) || defined (__stub___vprintf) -choke me -#else -vprintf(); -#endif - -; return 0; } -EOF -if { (eval echo configure:2066: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_vprintf=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_vprintf=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then - echo "$ac_t""yes" 1>&6 - cat >> confdefs.h <<\EOF -#define HAVE_VPRINTF 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi - -if test "$ac_cv_func_vprintf" != yes; then -echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 -echo "configure:2090: checking for _doprnt" >&5 -if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char _doprnt(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub__doprnt) || defined (__stub____doprnt) -choke me -#else -_doprnt(); -#endif - -; return 0; } -EOF -if { (eval echo configure:2118: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func__doprnt=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func__doprnt=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then - echo "$ac_t""yes" 1>&6 - cat >> confdefs.h <<\EOF -#define HAVE_DOPRNT 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi - -fi - echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:2143: checking return type of signal handlers" >&5 +echo "configure:2093: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2161,7 +2111,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:2165: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2115: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -2180,7 +2130,7 @@ EOF echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:2184: checking for dlopen in -ldl" >&5 +echo "configure:2134: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2188,7 +2138,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2153: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2227,7 +2177,7 @@ else fi echo $ac_n "checking for optarg in -lgnugetopt""... $ac_c" 1>&6 -echo "configure:2231: checking for optarg in -lgnugetopt" >&5 +echo "configure:2181: checking for optarg in -lgnugetopt" >&5 ac_lib_var=`echo gnugetopt'_'optarg | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2235,7 +2185,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lgnugetopt $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2200: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2274,7 +2224,7 @@ else fi echo $ac_n "checking for _ in -lbe""... $ac_c" 1>&6 -echo "configure:2278: checking for _ in -lbe" >&5 +echo "configure:2228: checking for _ in -lbe" >&5 ac_lib_var=`echo be'_'_ | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2282,7 +2232,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lbe $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2247: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2321,7 +2271,7 @@ else fi echo $ac_n "checking for _ in -lgame""... $ac_c" 1>&6 -echo "configure:2325: checking for _ in -lgame" >&5 +echo "configure:2275: checking for _ in -lgame" >&5 ac_lib_var=`echo game'_'_ | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2329,7 +2279,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lgame $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2294: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2368,7 +2318,7 @@ else fi echo $ac_n "checking for _ in -lroot""... $ac_c" 1>&6 -echo "configure:2372: checking for _ in -lroot" >&5 +echo "configure:2322: checking for _ in -lroot" >&5 ac_lib_var=`echo root'_'_ | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2376,7 +2326,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lroot $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2341: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2415,7 +2365,7 @@ else fi echo $ac_n "checking for powl in -lm""... $ac_c" 1>&6 -echo "configure:2419: checking for powl in -lm" >&5 +echo "configure:2369: checking for powl in -lm" >&5 ac_lib_var=`echo m'_'powl | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2423,7 +2373,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2388: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2462,7 +2412,7 @@ else fi echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6 -echo "configure:2466: checking for pthread_create in -lpthread" >&5 +echo "configure:2416: checking for pthread_create in -lpthread" >&5 ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2470,7 +2420,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpthread $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2435: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2509,7 +2459,7 @@ else fi echo $ac_n "checking for thread_create in -lthreads""... $ac_c" 1>&6 -echo "configure:2513: checking for thread_create in -lthreads" >&5 +echo "configure:2463: checking for thread_create in -lthreads" >&5 ac_lib_var=`echo threads'_'thread_create | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2517,7 +2467,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lthreads $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2482: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2557,12 +2507,12 @@ fi echo $ac_n "checking for getopt_long""... $ac_c" 1>&6 -echo "configure:2561: checking for getopt_long" >&5 +echo "configure:2511: checking for getopt_long" >&5 if eval "test \"`echo '$''{'ac_cv_func_getopt_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2539: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_getopt_long=yes" else @@ -2612,17 +2562,17 @@ for ac_hdr in stddef.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2616: checking for $ac_hdr" >&5 +echo "configure:2566: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2626: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2576: \"$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* @@ -2652,17 +2602,17 @@ for ac_hdr in getopt.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2656: checking for $ac_hdr" >&5 +echo "configure:2606: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2666: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2616: \"$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* @@ -2692,17 +2642,17 @@ for ac_hdr in sys/sockio.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2696: checking for $ac_hdr" >&5 +echo "configure:2646: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2706: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2656: \"$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* @@ -2732,17 +2682,17 @@ for ac_hdr in fcntl.h sys/ioctl.h sys/time.h unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2736: checking for $ac_hdr" >&5 +echo "configure:2686: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2746: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2696: \"$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* @@ -2772,17 +2722,17 @@ for ac_hdr in sys/soundcard.h machine/soundcard.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2776: checking for $ac_hdr" >&5 +echo "configure:2726: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2786: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2736: \"$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* @@ -2812,17 +2762,17 @@ 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:2816: checking for $ac_hdr" >&5 +echo "configure:2766: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2826: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2776: \"$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* @@ -2852,17 +2802,17 @@ 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:2856: checking for $ac_hdr" >&5 +echo "configure:2806: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2866: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2816: \"$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* @@ -2892,17 +2842,17 @@ for ac_hdr in machine/param.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2896: checking for $ac_hdr" >&5 +echo "configure:2846: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2906: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2856: \"$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* @@ -2933,17 +2883,17 @@ for ac_hdr in cthreads.h pthread.h kernel/scheduler.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:2937: checking for $ac_hdr" >&5 +echo "configure:2887: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2947: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2897: \"$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* @@ -2971,11 +2921,12 @@ done save_CFLAGS=$CFLAGS + CFLAGS="${CFLAGS} -Wall -Werror" echo $ac_n "checking for ntohl in sys/param.h""... $ac_c" 1>&6 -echo "configure:2977: checking for ntohl in sys/param.h" >&5 +echo "configure:2928: checking for ntohl in sys/param.h" >&5 cat > conftest.$ac_ext < void foo() { int meuh; ntohl(meuh); } @@ -2983,7 +2934,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:2987: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2938: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define NTOHL_IN_SYS_PARAM_H 1 @@ -2997,15 +2948,88 @@ else echo "$ac_t""no" 1>&6 fi rm -f conftest* + +CFLAGS="${CFLAGS} -fargument-noalias-global -fstrict-aliasing" +echo $ac_n "checking if \$CC accepts -fargument-noalias-global -fstrict-aliasing""... $ac_c" 1>&6 +echo "configure:2955: checking if \$CC accepts -fargument-noalias-global -fstrict-aliasing" >&5 +cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + BIZARRE_OPTIMS="-fargument-noalias-global -fstrict-aliasing" + echo "$ac_t""yes" 1>&6 +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + echo "$ac_t""no" 1>&6 +fi +rm -f conftest* + +CFLAGS="${CFLAGS} -rdynamic" +echo $ac_n "checking if \$CC accepts -rdynamic""... $ac_c" 1>&6 +echo "configure:2978: checking if \$CC accepts -rdynamic" >&5 +cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + DYNAMIC_FLAG="-rdynamic" + echo "$ac_t""yes" 1>&6 +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + echo "$ac_t""no" 1>&6 +fi +rm -f conftest* + CFLAGS=$save_CFLAGS +echo $ac_n "checking for boolean_t in sys/types.h""... $ac_c" 1>&6 +echo "configure:3002: checking for boolean_t in sys/types.h" >&5 +cat > conftest.$ac_ext < +void quux() { boolean_t foo; } +int main() { + +; return 0; } +EOF +if { (eval echo configure:3012: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + cat >> confdefs.h <<\EOF +#define BOOLEAN_T_IN_SYS_TYPES_H 1 +EOF + + echo "$ac_t""yes" 1>&6 +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + echo "$ac_t""no" 1>&6 +fi +rm -f conftest* + echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:3004: checking for working const" >&5 +echo "configure:3028: 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 <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3082: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -3075,12 +3099,12 @@ EOF fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:3079: checking for ANSI C header files" >&5 +echo "configure:3103: 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 < #include @@ -3088,7 +3112,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3092: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3116: \"$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* @@ -3105,7 +3129,7 @@ rm -f 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 @@ -3123,7 +3147,7 @@ fi 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 @@ -3144,7 +3168,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -3155,7 +3179,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:3159: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -3179,12 +3203,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:3183: checking for size_t" >&5 +echo "configure:3207: 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 < #if STDC_HEADERS @@ -3212,12 +3236,12 @@ EOF fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:3216: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:3240: 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 < #include @@ -3226,7 +3250,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:3230: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3254: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -3291,7 +3315,7 @@ SYS=${host_os} # special cases if test x$host_os = xbeos; then - PLUGINS=${PLUGINS}"dummy beos " + PLUGINS=${PLUGINS}"dummy null beos " else @@ -3302,6 +3326,13 @@ if test "${enable_dummy+set}" = set; then fi if test x$enable_dummy != xno; then PLUGINS=${PLUGINS}"dummy "; fi +# Check whether --enable-null or --disable-null was given. +if test "${enable_null+set}" = set; then + enableval="$enable_null" + : +fi + +if test x$enable_null != xno; then PLUGINS=${PLUGINS}"null "; fi # Check whether --enable-dsp or --disable-dsp was given. if test "${enable_dsp+set}" = set; then enableval="$enable_dsp" @@ -3357,12 +3388,6 @@ if test "${with_glide+set}" = set; then fi fi -# Check whether --enable-null or --disable-null was given. -if test "${enable_null+set}" = set; then - enableval="$enable_null" - if test x$enable_null = xyes; then PLUGINS=${PLUGINS}"null "; fi -fi - # Check whether --enable-gnome or --disable-gnome was given. if test "${enable_gnome+set}" = set; then enableval="$enable_gnome" @@ -3381,17 +3406,17 @@ if test "${enable_alsa+set}" = set; then enableval="$enable_alsa" if test x$enable_alsa = xyes; then ac_safe=`echo "sys/asoundlib.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for sys/asoundlib.h""... $ac_c" 1>&6 -echo "configure:3385: checking for sys/asoundlib.h" >&5 +echo "configure:3410: checking for sys/asoundlib.h" >&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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3395: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3420: \"$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* @@ -3408,7 +3433,7 @@ fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for main in -lasound""... $ac_c" 1>&6 -echo "configure:3412: checking for main in -lasound" >&5 +echo "configure:3437: checking for main in -lasound" >&5 ac_lib_var=`echo asound'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3416,14 +3441,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lasound $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3452: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3465,6 +3490,8 @@ fi + + trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure @@ -3619,6 +3646,8 @@ s%@ALIASES@%$ALIASES%g s%@DEBUG@%$DEBUG%g s%@STATS@%$STATS%g s%@OPTIMS@%$OPTIMS%g +s%@BIZARRE_OPTIMS@%$BIZARRE_OPTIMS%g +s%@DYNAMIC_FLAG@%$DYNAMIC_FLAG%g s%@LIB_SDL@%$LIB_SDL%g s%@LIB_GLIDE@%$LIB_GLIDE%g s%@LIB_GGI@%$LIB_GGI%g diff --git a/configure.in b/configure.in index b9a86c0ca5..247d06d8f2 100644 --- a/configure.in +++ b/configure.in @@ -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 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 .) + 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 +void quux() { boolean_t foo; }],, + AC_DEFINE(BOOLEAN_T_IN_SYS_TYPES_H, 1, Define if 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) diff --git a/include/common.h b/include/common.h index bebf59a0cc..3004ec791a 100644 --- a/include/common.h +++ b/include/common.h @@ -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 * Vincent Seguin @@ -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 +#else +typedef int boolean_t; #endif #ifdef SYS_GNU # define _MACH_I386_BOOLEAN_H_ diff --git a/include/defs.h.in b/include/defs.h.in index 4cba38dc78..85ebfecc71 100644 --- a/include/defs.h.in +++ b/include/defs.h.in @@ -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 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 . */ #undef NTOHL_IN_SYS_PARAM_H +/* Define if defines boolean_t. */ +#undef BOOLEAN_T_IN_SYS_TYPES_H + diff --git a/src/interface/intf_msg.c b/src/interface/intf_msg.c index 1e06e83aea..dcb5b92ea2 100644 --- a/src/interface/intf_msg.c +++ b/src/interface/intf_msg.c @@ -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 + diff --git a/src/misc/modules.c b/src/misc/modules.c index d684b24c9e..334e3a0cf9 100644 --- a/src/misc/modules.c +++ b/src/misc/modules.c @@ -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 ); -- 2.39.2