diff --git a/configure b/configure index fdd8f23356..48ea29c8ea 100755 --- a/configure +++ b/configure @@ -6,6 +6,10 @@ # # Changes in reversed order: # +# 2001/07/03 by Nick Kurshev +# - added universal way of configuring SUBDIRS +# - moved configurable stuff of depended SUBDIRS to SUBDIRS +# # 2001/06/05 by Pontscho # - added alsa and esd detection # @@ -1284,70 +1288,48 @@ if [ "$system_name" = "FreeBSD" ]; then CFLAGS="$CFLAGS -D_THREAD_SAFE" fi -echo -echo "Creating $MCONF" -cat > $MCONF << EOF - -# -------- Generated by ./configure ----------- - -prefix = $_prefix -AR=ar -CC=$_cc -# OPTFLAGS=-O4 $_profile $_debug -march=$proc -mcpu=$proc -pipe -fomit-frame-pointer -ffast-math -OPTFLAGS=$CFLAGS -EXTRA_INC=$_extraincdir -WIN32_PATH=-DWIN32_PATH=\"$_win32libdir\" - -X11_INC=$_x11incdir -X11DIR=$_x11libdir -X_LIBS=$_x11libdir $_extralibdir $_gllib $_ggilib $_sdllib $_dgalib $_x11lib $_xvlib $_vmlib $_svgalib $_libpng $_socklib - -TERMCAP_LIB=$_libtermcap -XMM_LIBS = $_xmmplibs -LIRC_LIBS = $_lirclibs -CSS_LIB = $_csslib -CSS_INC = $_cssinc -SDL_INC = $_sdlcflags -DS_DEP = $_dshowdep -DS_LIB = $_dshowlib -ALSA_LIB = $_alsalib -ESD_LIB = $_esdlib -ARCH_LIBS = $_archlibs -STREAM_SRCS = $_streamingsrcs - -EOF # echo 'CFLAGS=$(OPTFLAGS) -Wall -DMPG12PLAY' >> config.mak echo "Creating $CCONF" if [ "$_mmx" = "yes" ]; then _mmx='#define HAVE_MMX' + _cfg_mmx='yes' else _mmx='#undef HAVE_MMX' + _cfg_mmx='no' fi if [ "$_mmx2" = "yes" ]; then _mmx2='#define HAVE_MMX2' + _cfg_mmx2='yes' else _mmx2='#undef HAVE_MMX2' + _cfg_mmx2='no' fi if [ $_3dnow = yes ]; then _3dnowm='#define HAVE_3DNOW' + _cfg_3dnow='yes' else _3dnowm='#undef HAVE_3DNOW' + _cfg_3dnow='no' fi if [ $_3dnowex = yes ]; then _3dnowexm='#define HAVE_3DNOWEX' + _cfg_3dnowex='yes' else _3dnowexm='#undef HAVE_3DNOWEX' + _cfg_3dnowex='no' fi if [ $_sse = yes ]; then _ssem='#define HAVE_SSE' + _cfg_sse='yes' else _ssem='#undef HAVE_SSE' + _cfg_sse='no' fi # --- @@ -1486,6 +1468,49 @@ else _gui='#undef HAVE_GUI' fi + +echo +echo "Creating $MCONF" +cat > $MCONF << EOF + +# -------- Generated by ./configure ----------- + +prefix = $_prefix +AR=ar +CC=$_cc +# OPTFLAGS=-O4 $_profile $_debug -march=$proc -mcpu=$proc -pipe -fomit-frame-pointer -ffast-math +OPTFLAGS=$CFLAGS +EXTRA_INC=$_extraincdir +WIN32_PATH=-DWIN32_PATH=\"$_win32libdir\" + +X11_INC=$_x11incdir +X11DIR=$_x11libdir +X_LIBS=$_x11libdir $_extralibdir $_gllib $_ggilib $_sdllib $_dgalib $_x11lib $_xvlib $_vmlib $_svgalib $_libpng $_socklib + +TERMCAP_LIB=$_libtermcap +XMM_LIBS = $_xmmplibs +LIRC_LIBS = $_lirclibs +CSS_LIB = $_csslib +CSS_INC = $_cssinc +SDL_INC = $_sdlcflags +DS_DEP = $_dshowdep +DS_LIB = $_dshowlib +ALSA_LIB = $_alsalib +ESD_LIB = $_esdlib +ARCH_LIBS = $_archlibs +STREAM_SRCS = $_streamingsrcs + +# --- Some stuff for autoconfigure ---- +TARGET_ARCH_X86=yes +TARGET_CPU=$iproc +TARGET_MMX=$_cfg_mmx +TARGET_MMX2=$_cfg_mmx2 +TARGET_3DNOW=$_cfg_3dnow +TARGET_3DNOWEX=$_cfg_3dnowex +TARGET_SSE=$_cfg_sse + +BINUTILS=$_binutils +EOF cat > $CCONF << EOF @@ -1655,69 +1680,6 @@ OPTIONAL_OBJS=$_aoobj EOF -echo "Creating libac3/config.mak" - -if [ $_sse = yes ]; then - _downmixc='downmix/downmix_kni.S' - _downmixo='downmix/downmix_kni.o' -else -if [ $_3dnow = yes ]; then - _downmixc='downmix/downmix_3dnow.S' - _downmixo='downmix/downmix_3dnow.o' -else -if [ $_binutils = yes ]; then - _downmixc='downmix/downmix_i386.S' - _downmixo='downmix/downmix_i386.o' -else -_downmixc='downmix/downmix.c' -_downmixo='downmix/downmix.o' -cat << EOF - -!!! Warning! fallback to slow downmix.c due the old binutils. -!!! Upgrade it for better AC3 audio decoding performance! - -EOF -fi -fi -fi -cat > libac3/config.mak << EOF - -include ../config.mak - -OPTIONAL_SRCS = $_downmixc -OPTIONAL_OBJS = $_downmixo - -EOF - -echo "Creating mp3lib/config.mak" - -if [ $_3dnowex = yes ]; then - _mp3libobjectsrcs='dct36_k7.s dct64_k7.s decode_k7.s dct36_3dnow.s dct64_3dnow.s decode_3dnow.s' - _mp3libobjectobjs='dct36_k7.o dct64_k7.o decode_k7.o dct36_3dnow.o dct64_3dnow.o decode_3dnow.o' -else -if [ $_3dnow = yes ]; then - _mp3libobjectsrcs='dct36_3dnow.s dct64_3dnow.s decode_3dnow.s' - _mp3libobjectobjs='dct36_3dnow.o dct64_3dnow.o decode_3dnow.o' -else -if [ $_sse = yes ]; then - _mp3libobjectsrcs='decode_sse.s' - _mp3libobjectobjs='decode_sse.o' -else - _mp3libobjectsrcs= - _mp3libobjectobjs= -fi -fi -fi - -cat > mp3lib/config.mak << EOF - -include ../config.mak - -OPTIONAL_SRCS = $_mp3libobjectsrcs -OPTIONAL_OBJS = $_mp3libobjectobjs - -EOF - cat << EOF Config files successfully generated by ./configure ! diff --git a/mp3lib/Makefile b/mp3lib/Makefile index 6aa93c4275..3b1845cc9b 100644 --- a/mp3lib/Makefile +++ b/mp3lib/Makefile @@ -1,12 +1,26 @@ -include config.mak +include ../config.mak -SRCS = sr1.c d_cpu.s decode_i586.s dct64_MMX.s decode_MMX.s tabinit_MMX.s\ -dct36_3dnow.s dct64_3dnow.s dct36_k7.s dct64_k7.s -OBJS = sr1.o d_cpu.o decode_i586.o dct64_MMX.o decode_MMX.o tabinit_MMX.o\ -dct36_3dnow.o dct64_3dnow.o dct36_k7.o dct64_k7.o +SRCS = sr1.c d_cpu.s +OBJS = sr1.o d_cpu.o # OBJS = $(SRCS:.c,.s=.o) CFLAGS = $(OPTFLAGS) $(EXTRA_INC) +ifeq ($(TARGET_ARCH_X86),yes) +SRCS += decode_i586.s +OBJS += decode_i586.o +ifeq ($(TARGET_MMX),yes) +SRCS += decode_MMX.s dct64_MMX.s tabinit_MMX.s +OBJS += decode_MMX.o dct64_MMX.o tabinit_MMX.o +endif +ifeq ($(TARGET_3DNOW),yes) +SRCS += dct36_3dnow.s dct64_3dnow.s +OBJS += dct36_3dnow.o dct64_3dnow.o +endif +ifeq ($(TARGET_3DNOWEX),yes) +SRCS += dct36_k7.s dct64_k7.s +OBJS += dct36_k7.o dct64_k7.o +endif +endif .SUFFIXES: .c .o diff --git a/mp3lib/decod386.c b/mp3lib/decod386.c index 9939886023..fc88ae2851 100644 --- a/mp3lib/decod386.c +++ b/mp3lib/decod386.c @@ -107,14 +107,15 @@ static int synth_1to1_r(real *bandPtr,int channel,unsigned char *out,int *pnt) synth_func_t synth_func; +#ifdef HAVE_MMX int synth_1to1_MMX( real *bandPtr,int channel,short * samples) { static short buffs[2][2][0x110]; static int bo = 1; synth_1to1_MMX_s(bandPtr, channel, samples, (short *) buffs, &bo); return 0; - } - +} +#endif static int synth_1to1(real *bandPtr,int channel,unsigned char *out,int *pnt) { static real buffs[2][2][0x110]; @@ -125,7 +126,7 @@ static int synth_1to1(real *bandPtr,int channel,unsigned char *out,int *pnt) real *b0,(*buf)[0x110]; int clip = 0; int bo1; - +#ifdef ARCH_X86 if ( synth_func ) { int ret; @@ -133,7 +134,7 @@ static int synth_1to1(real *bandPtr,int channel,unsigned char *out,int *pnt) *pnt+=128; return ret; } - +#endif if(!channel) { /* channel=0 */ bo--; bo &= 0xf; diff --git a/mp3lib/sr1.c b/mp3lib/sr1.c index b866bf29e3..ac5828740d 100644 --- a/mp3lib/sr1.c +++ b/mp3lib/sr1.c @@ -415,12 +415,15 @@ void MP3_Init(){ tables_done_flag=1; dct36_func=dct36; +#ifdef HAVE_SSE if(_isse) { synth_func=synth_1to1_MMX; dct64_MMX_func=dct64_MMX; } else +#endif +#ifdef HAVE_3DNOWEX if ( _3dnow > 1 ) { synth_func=synth_1to1_MMX; @@ -428,6 +431,8 @@ void MP3_Init(){ dct64_MMX_func=dct64_MMX_3dnowex; } else +#endif +#ifdef HAVE_3DNOW if ( _3dnow ) { synth_func=synth_1to1_MMX; @@ -435,17 +440,22 @@ void MP3_Init(){ dct64_MMX_func=dct64_MMX_3dnow; } else +#endif +#ifdef HAVE_MMX if ( _i586 > 1) { synth_func=synth_1to1_MMX; dct64_MMX_func=dct64_MMX; } else +#endif +#ifdef ARCH_X86 if ( _i586 ) { synth_func=synth_1to1_pent; } else +#endif { synth_func = NULL; }