diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..a380554 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,10 @@ +**/*.o +**/*.a +**/*.dSYM +.git +.github +.claude/ +CLAUDE.md +docs/ +devtools/ +*~ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f0dd1a8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +FROM ubuntu:24.04 + +RUN apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + make \ + bison \ + flex \ + libx11-dev \ + libxt-dev \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /build +COPY . . +RUN find . -name '*.o' -delete && find . -name '*.a' -delete +RUN cd ESPS/general && ./SETUP -p /usr/esps && ./ESPS_INSTALL diff --git a/ESPS/ATT/libsig/Makefile b/ESPS/ATT/libsig/Makefile index 7fb9d93..bef523d 100644 --- a/ESPS/ATT/libsig/Makefile +++ b/ESPS/ATT/libsig/Makefile @@ -18,7 +18,7 @@ INC = ../waves/src/h -CFLAGS = -g -I$(INC) -I$(XVIEW_INC) -DHEAD_STANDALONE -DFOR_XVIEW $(PROGCFLAGS) +CFLAGS = -g -I$(INC) -DHEAD_STANDALONE $(PROGCFLAGS) LPATH = $(SPSDIR) LBIN = $(BINDIR) LIB = $(WAVESDIR)/xlibsig.a diff --git a/ESPS/general/SETUP b/ESPS/general/SETUP index 659abb8..19d1f1f 100755 --- a/ESPS/general/SETUP +++ b/ESPS/general/SETUP @@ -398,13 +398,12 @@ here=`pwd` # if test $MACH = LINUX then - ANSI_CC="gcc -ansi" - ELM_CC="gcc -DANSI_C" + CC="gcc -fno-builtin -std=gnu89 -fcommon -D_FORTIFY_SOURCE=0 -Wno-implicit-function-declaration -Wno-implicit-int -Wno-return-type -Wno-int-conversion -Wno-incompatible-pointer-types -Wno-parentheses -Wno-dangling-else -Wno-format" + ANSI_CC="gcc -std=gnu89 -fcommon -DANSI_C -D_FORTIFY_SOURCE=0 -Wno-implicit-function-declaration -Wno-implicit-int -Wno-return-type -Wno-int-conversion" + ELM_CC="gcc -std=gnu89 -fcommon -DANSI_C -D_FORTIFY_SOURCE=0 -Wno-implicit-function-declaration -Wno-implicit-int -Wno-return-type -Wno-int-conversion" DEFINES="-DLINUX_OR_MAC" -#Xorg libraries that used to be in /usr/X11R6/lib are now in /usr/lib on -#Fedora Core 5. - X_LIB="-L/usr/X11R6/lib -L/usr/lib -lX11" - X_INC="/usr/X11R6/include" + X_LIB="-lX11" + X_INC="/usr/include" X_R7_LIBS="-lXdmcp -lXau" WINLIBS="$X_LIB -lpthread" X_UTIL="-lutil" @@ -417,15 +416,23 @@ if test $MACH = LINUX ln -s makefile.linux makefile chmod a+w makefile cd $here + # GNU ld processes archives left-to-right and only extracts objects that + # resolve currently-undefined symbols. The ESPS header and main libraries + # have circular dependencies, so repeat both to give the linker enough + # passes to resolve everything. + SPSLIB=${EXV_LIB}" "${LIBDIR}/${EHDRLIB}" "${LIBDIR}/${LIBNAME}" "${LIBDIR}/${EHDRLIB}" "${LIBDIR}/${LIBNAME} + WSPSLIB=${EXV_LIB}" "${LIBDIR}/${WHDRLIB}" "${LIBDIR}/${LIBNAME}" "${LIBDIR}/${WHDRLIB}" "${LIBDIR}/${LIBNAME} + NSPSLIB=${EXV_LIB}" "${LIBDIR}/${NHDRLIB}" "${LIBDIR}/${LIBNAME}" "${LIBDIR}/${NHDRLIB}" "${LIBDIR}/${LIBNAME} + SSPSLIB=${EXV_LIB}" "${LIBDIR}/${SHDRLIB}" "${LIBDIR}/${LIBNAME}" "${LIBDIR}/${SHDRLIB}" "${LIBDIR}/${LIBNAME} fi ################################################################################ # Machine dependent defines for MACOS-X: # if test $MACH = MACOS then - CC="gcc -fno-builtin" \ - ANSI_CC="gcc -ansi -DANSI_C" - ELM_CC="gcc -DANSI_C" + CC="gcc -fno-builtin -std=gnu89 -D_FORTIFY_SOURCE=0 -Wno-implicit-function-declaration -Wno-implicit-int -Wno-return-type -Wno-int-conversion -Wno-incompatible-pointer-types -Wno-parentheses -Wno-dangling-else -Wno-format" + ANSI_CC="gcc -std=gnu89 -DANSI_C -D_FORTIFY_SOURCE=0 -Wno-implicit-function-declaration -Wno-implicit-int -Wno-return-type -Wno-int-conversion" + ELM_CC="gcc -std=gnu89 -DANSI_C -D_FORTIFY_SOURCE=0 -Wno-implicit-function-declaration -Wno-implicit-int -Wno-return-type -Wno-int-conversion" DEFINES="-DLINUX_OR_MAC" X_LIB="-L/usr/X11R6/lib -L/usr/lib -lX11" X_INC="/usr/X11R6/include" @@ -1179,8 +1186,14 @@ export LIBMV AUDIOLIB if test $MACH = MACOS then # This is mostly for the MACOS installation to pick up the little Mplay and Mrecord scripts. - cp -f ./scripts/* $BINDIR - cp -f ../../macAudio/build/audioM $BINDIR + if test -d ./scripts; then + cp -f ./scripts/* $BINDIR + fi + if test -f ../../macAudio/build/audioM; then + cp -f ../../macAudio/build/audioM $BINDIR + else + echo "Warning: macAudio/build/audioM not found, skipping audio binary install." + fi fi SPSLIB2=$SPSLIB @@ -1223,16 +1236,20 @@ elif test $MACH = LINUX -o $MACH = MACOS; then XVIEW_LIB="-Wl,-Bstatic "$XVIEW_LIB" -Wl,-Bdynamic" fi else - echo "Error: Xview libraries not found in linker path."; exit 1 + echo "Warning: Xview libraries not found in linker path." + echo "GUI components (xwaves, etc.) will not be available." + XVIEW_LIB="" fi # [ -n "$XV_STAT_OR_DYN" ] -XVIEW_LIB="$XVIEW_LIB $X_UTIL $WINLIBS" +if [ -n "$XVIEW_LIB" ] ; then + XVIEW_LIB="$XVIEW_LIB $X_UTIL $WINLIBS" +fi echo XVIEW_LIB is $XVIEW_LIB # Is there an xview directory in the include path? if echo "#include " |cpp >/dev/null 2>&1 ; then echo "Xview include files present in include path, we don't need to add them" else - echo "Error: Xview include files not found in path,"; exit 1 - echo "include directory" + echo "Warning: Xview include files not found in path." + echo "GUI components (xwaves, etc.) will not be available." fi XVIEW_INC="$SINCP" else diff --git a/ESPS/general/other_includes/sphere/sphere.h b/ESPS/general/other_includes/sphere/sphere.h index ede0c1a..ac614c5 100644 --- a/ESPS/general/other_includes/sphere/sphere.h +++ b/ESPS/general/other_includes/sphere/sphere.h @@ -32,7 +32,7 @@ extern "C" { #include #include -#ifndef u_int +#if !defined(u_int) && !defined(__APPLE__) #define u_int unsigned int #endif diff --git a/ESPS/general/src/COMPILE b/ESPS/general/src/COMPILE index f92ffe8..47acdfd 100755 --- a/ESPS/general/src/COMPILE +++ b/ESPS/general/src/COMPILE @@ -7,6 +7,8 @@ if echo $ua | grep -q -s "[Ll]inux" ; then export ARCH=linux elif echo $ua | egrep -q -s "[Dd]arwin|[Mm]ac" ; then export ARCH=mac fi current_dir=`pwd` +# Ensure other_includes (sphere, pixrect headers) are in ESPS_BASE/include +cp -r $current_dir/../other_includes/* $ESPS_BASE/include/ 2>/dev/null cd $current_dir/../h; emake clean; emake install $CLEAN; cd $current_dir if test x$1 = xlibs then @@ -17,7 +19,14 @@ if test x$1 = xlibs cd $current_dir cd lib_header; emake clean; emake install $CLEAN; cd $current_dir cd lib_sp; emake clean; emake install $CLEAN; cd $current_dir - cd libxv; emake clean; emake install $CLEAN; cd $current_dir + #cd libxv; emake clean; emake install $CLEAN; cd $current_dir + # Create empty libexv.a so components that reference EXV_LIB can link. + # macOS ar rejects archives with no members, so compile a dummy object. + echo "void __libexv_dummy(void){}" > /tmp/libexv_dummy.c + ${CC:-gcc} -c /tmp/libexv_dummy.c -o /tmp/libexv_dummy.o + ar rc $ESPS_BASE/lib/libexv.a /tmp/libexv_dummy.o + ranlib $ESPS_BASE/lib/libexv.a + rm -f /tmp/libexv_dummy.c /tmp/libexv_dummy.o fi cd utils; emake clean; emake install $CLEAN; cd $current_dir cd $current_dir/../man; emake install @@ -30,8 +39,8 @@ case `mach_type` in SG) AUDIO=sgaudio ;; esac # HERE IS WHERE XWAVES, ETC. GET MADE.... -cd ../../ATT ; emake clean; emake install $CLEAN; cd $current_dir -cd ${ARCH}_audio; emake clean; emake install $CLEAN; cd $current_dir +#cd ../../ATT ; emake clean; emake install $CLEAN; cd $current_dir +#cd ${ARCH}_audio; emake clean; emake install $CLEAN; cd $current_dir cd acf; emake clean; emake install $CLEAN; cd $current_dir cd addclass; emake clean; emake install $CLEAN; cd $current_dir cd addfea; emake clean; emake install $CLEAN; cd $current_dir @@ -63,9 +72,9 @@ cd ereverse; emake clean; emake install $CLEAN; cd $current_dir cd erlsupport; emake clean; emake install $CLEAN; cd $current_dir cd esps2mu; emake clean; emake install $CLEAN; cd $current_dir cd eversion; emake clean; emake install $CLEAN; cd $current_dir -cd exprompt; emake clean; emake install $CLEAN; cd $current_dir -cd expromptrun; emake clean; emake install $CLEAN; cd $current_dir -cd fbuttons; emake clean; emake install $CLEAN; cd $current_dir +#cd exprompt; emake clean; emake install $CLEAN; cd $current_dir +#cd expromptrun; emake clean; emake install $CLEAN; cd $current_dir +#cd fbuttons; emake clean; emake install $CLEAN; cd $current_dir cd fea2mat; emake clean; emake install $CLEAN; cd $current_dir cd fea_deriv; emake clean; emake install $CLEAN; cd $current_dir cd fea_edit; emake clean; emake install $CLEAN; cd $current_dir @@ -87,13 +96,13 @@ cd frame; emake clean; emake install $CLEAN; cd $current_dir cd genplot; emake clean; emake install $CLEAN; cd $current_dir cd get_esps_base; emake clean; emake install $CLEAN; cd $current_dir cd getparam; emake clean; emake install $CLEAN; cd $current_dir -cd gpstohp; emake clean; emake install $CLEAN; cd $current_dir +#cd gpstohp; emake clean; emake install $CLEAN; cd $current_dir cd hditem; emake clean; emake install $CLEAN; cd $current_dir cd hdshrink; emake clean; emake install $CLEAN; cd $current_dir cd his; emake clean; emake install $CLEAN; cd $current_dir cd igenplot; emake clean; emake install $CLEAN; cd $current_dir cd iir_filt; emake clean; emake install $CLEAN; cd $current_dir -cd image; emake clean; emake install $CLEAN; cd $current_dir +#cd image; emake clean; emake install $CLEAN; cd $current_dir cd imlplot; emake clean; emake install $CLEAN; cd $current_dir cd impulse_rs; emake clean; emake install $CLEAN; cd $current_dir cd larcbk2rc; emake clean; emake install $CLEAN; cd $current_dir @@ -103,7 +112,7 @@ cd lpcsynt; emake clean; emake install $CLEAN; cd $current_dir cd make_sd; emake clean; emake install $CLEAN; cd $current_dir cd mat2fea; emake clean; emake install $CLEAN; cd $current_dir cd mbrot; emake clean; emake install $CLEAN; cd $current_dir -cd mbuttons; emake clean; emake install $CLEAN; cd $current_dir +#cd mbuttons; emake clean; emake install $CLEAN; cd $current_dir cd me_sgram; emake clean; emake install $CLEAN; cd $current_dir cd me_spec; emake clean; emake install $CLEAN; cd $current_dir cd mergefea; emake clean; emake install $CLEAN; cd $current_dir @@ -114,7 +123,7 @@ cd mux; emake clean; emake install $CLEAN; cd $current_dir cd notch_filt; emake clean; emake install $CLEAN; cd $current_dir cd pen; emake clean; emake install $CLEAN; cd $current_dir cd playtest; emake clean; emake install $CLEAN; cd $current_dir -cd plot3d; emake clean; emake install $CLEAN; cd $current_dir +#cd plot3d; emake clean; emake install $CLEAN; cd $current_dir cd plotfield; emake clean; emake install $CLEAN; cd $current_dir cd pplain; emake clean; emake install $CLEAN; cd $current_dir cd psps; emake clean; emake install $CLEAN; cd $current_dir @@ -125,7 +134,7 @@ cd rem_dc; emake clean; emake install $CLEAN; cd $current_dir cd sdcomp; emake clean; emake install $CLEAN; cd $current_dir cd sdtofea; emake clean; emake install $CLEAN; cd $current_dir # cd select; emake clean; emake install $CLEAN; cd $current_dir -cd send_xwaves; emake clean; emake install $CLEAN; cd $current_dir +#cd send_xwaves; emake clean; emake install $CLEAN; cd $current_dir cd setmax; emake clean; emake install $CLEAN; cd $current_dir cd setrange; emake clean; emake install $CLEAN; cd $current_dir cd sfconvert; emake clean; emake install $CLEAN; cd $current_dir @@ -146,18 +155,18 @@ cd vqclassify; emake clean; emake install $CLEAN; cd $current_dir cd vqdst; emake clean; emake install $CLEAN; cd $current_dir cd window; emake clean; emake install $CLEAN; cd $current_dir cd wmse_filt; emake clean; emake install $CLEAN; cd $current_dir -cd wsystem; emake clean; emake install $CLEAN; cd $current_dir -cd xacf; emake clean; emake install $CLEAN; cd $current_dir +#cd wsystem; emake clean; emake install $CLEAN; cd $current_dir +#cd xacf; emake clean; emake install $CLEAN; cd $current_dir #cd xpz; emake clean; emake install $CLEAN; cd $current_dir -cd xtext; emake clean; emake install $CLEAN; cd $current_dir +#cd xtext; emake clean; emake install $CLEAN; cd $current_dir cd zcross; emake clean; emake install $CLEAN; cd $current_dir cd zero_pole; emake clean; emake install $CLEAN; cd $current_dir cd zero_pad; emake clean; emake install $CLEAN; cd $current_dir cd e2sphere; emake clean; emake install $CLEAN; cd $current_dir cd filter2; emake clean; emake install $CLEAN; cd $current_dir -cd formsy; emake clean; emake install $CLEAN; cd $current_dir -cd ps_ana; emake clean; emake install $CLEAN; cd $current_dir -cd epochs; emake clean; emake install $CLEAN; cd $current_dir +#cd formsy; emake clean; emake install $CLEAN; cd $current_dir +#cd ps_ana; emake clean; emake install $CLEAN; cd $current_dir +#cd epochs; emake clean; emake install $CLEAN; cd $current_dir cd feaop; emake clean; emake install $CLEAN; cd $current_dir cd lp_syn; emake clean; emake install $CLEAN; cd $current_dir cd ps2frame; emake clean; emake install $CLEAN; cd $current_dir @@ -170,7 +179,7 @@ cd win_filt; emake clean; emake install $CLEAN; cd $current_dir # cd meter; emake clean; emake install $CLEAN; cd $current_dir cd get_resid; emake clean; emake install $CLEAN; cd $current_dir cd zst; emake clean; emake install $CLEAN; cd $current_dir -cd xfir_filt; emake clean; emake install $CLEAN; cd $current_dir +#cd xfir_filt; emake clean; emake install $CLEAN; cd $current_dir cd ebanner; emake clean; emake install $CLEAN; cd $current_dir # cd rasta_plp; emake clean; emake install $CLEAN; cd $current_dir cd cepsyn; emake clean; emake install $CLEAN; cd $current_dir diff --git a/ESPS/general/src/addfeahd/addfeahd.c b/ESPS/general/src/addfeahd/addfeahd.c index da98639..f1d6a44 100644 --- a/ESPS/general/src/addfeahd/addfeahd.c +++ b/ESPS/general/src/addfeahd/addfeahd.c @@ -378,7 +378,7 @@ char **argv; if(foreign_header) { *add_genhd_l("foreign_hd_length", (long *)NULL, 1, out_hd) = skip; -#if !defined(IBM_RS6000) && !defined(DS3100) && !defined(SG) && !defined(HP400) && !defined(M5600) && !defined(OS5) && !defined(LINUX) +#if !defined(IBM_RS6000) && !defined(DS3100) && !defined(SG) && !defined(HP400) && !defined(M5600) && !defined(OS5) && !defined(LINUX) && !defined(LINUX_OR_MAC) (char *)foreign_hd_ptr = malloc((unsigned)skip); #else foreign_hd_ptr = malloc((unsigned)skip); diff --git a/ESPS/general/src/btosps/btosps.c b/ESPS/general/src/btosps/btosps.c index bcc99ac..d45bc1f 100644 --- a/ESPS/general/src/btosps/btosps.c +++ b/ESPS/general/src/btosps/btosps.c @@ -279,7 +279,7 @@ char **argv; if(foreign_header) { *add_genhd_l("foreign_hd_length", (long *)NULL, 1, oh) = skip; -#if defined(IBM_RS6000) || defined(DS3100) || defined(SG) || defined(HP400) || defined(M5600) || defined(OS5) || defined(LINUX) +#if defined(IBM_RS6000) || defined(DS3100) || defined(SG) || defined(HP400) || defined(M5600) || defined(OS5) || defined(LINUX) || defined(LINUX_OR_MAC) foreign_hd_ptr = malloc((unsigned)skip); #else (char *)foreign_hd_ptr = malloc((unsigned)skip); diff --git a/ESPS/general/src/lib/makefile b/ESPS/general/src/lib/makefile index 51b3b8d..98b65bb 120000 --- a/ESPS/general/src/lib/makefile +++ b/ESPS/general/src/lib/makefile @@ -1 +1 @@ -makefile.linux \ No newline at end of file +makefile.mac \ No newline at end of file diff --git a/ESPS/general/src/lib/makefile.mac b/ESPS/general/src/lib/makefile.mac index b64af02..ffaf7fb 100644 --- a/ESPS/general/src/lib/makefile.mac +++ b/ESPS/general/src/lib/makefile.mac @@ -29,7 +29,7 @@ tmpfile.o typeconver.o uniq_name.o updatewave.o vqsupport.o \ execcom.o tempname.o feadstsupp.o isespsfile.o \ pr_farray.o typesiz.o findespsfi.o getespsbas.o sendwaves.o feafiltsupp.o \ buildespsp.o convertlab.o trngswitch.o malloc.o ereader.o wavesshow.o \ -is_numeric.o xsend.o audio_.o audio_mac.o usleep.o eddy.o +is_numeric.o audio_.o audio_mac.o usleep.o eddy.o SRCS = \ addstr.c anafeasupp.c atoarray.c atoh.c copy_fea_rec.c \ @@ -47,7 +47,7 @@ tmpfile.c typeconver.c uniq_name.c updatewave.c vqsupport.c \ pr_farray.c typesiz.c \ findespsfi.c getespsbas.c sendwaves.c feafiltsupp.c buildespsp.c \ convertlab.c trngswitch.c malloc.c ereader.c wavesshow.c \ -is_numeric.c xsend.c audio_.c usleep.c eddy.c +is_numeric.c audio_.c usleep.c eddy.c $(LIBDIR)/$(LIBNAME): $(OBJS) ar rv $(LIBDIR)/$(LIBNAME) $? @@ -79,10 +79,6 @@ updatewave.o: $(SINC)/esps.h $(SINC)/unix.h miio.o: $(SINC)/esps.h $(SINC)/header.h is_complex.o: $(SINC)/esps.h $(SINC)/fea.h fea_compat.o: $(SINC)/esps.h $(SINC)/fea.h -xsend.o: $(SINC)/xwaves_ipc.h - $(CC) -I$(X_INC) $(CFLAGS) -c xsend.c - - install: $(LIBDIR)/$(LIBNAME) rm -f $(SPSDIR)/src_examples/lib/feaspecsupp.c cp feaspecsupp.c $(SPSDIR)/src_examples/lib/feaspecsupp.c diff --git a/ESPS/general/src/lib_header/makefile b/ESPS/general/src/lib_header/makefile index 8684cf6..b19c7d8 100644 --- a/ESPS/general/src/lib_header/makefile +++ b/ESPS/general/src/lib_header/makefile @@ -61,6 +61,7 @@ esps/headers.o: license.c headers.o $(SINC)/header.h \ $(SINC)/esps.h sphere.o \ $(ESIGNAL_LIB)/libesignal.a esignal_fea.o pc_wav.o $(ELM_CC) -c $(CFLAGS) -DESPS_PROG $(NO_LIC) license.c + mkdir -p esps mv license.o esps ld -o esps/headers.o -r headers.o esps/license.o \ sphere.o \ @@ -71,6 +72,7 @@ waves/headers.o: license.c headers.o $(SINC)/header.h \ $(SINC)/esps.h sphere.o \ $(ESIGNAL_LIB)/libesignal.a esignal_fea.o pc_wav.o $(ELM_CC) -c $(OFLAGS) $(CFLAGS) -I$(XVIEW_INC) -DWAVES_PROG $(NO_LIC) license.c + mkdir -p waves mv license.o waves ld -o waves/headers.o -r headers.o waves/license.o \ sphere.o \ @@ -81,6 +83,7 @@ ers/headers.o: license.c headers.o $(SINC)/header.h \ $(SINC)/esps.h sphere.o \ $(ESIGNAL_LIB)/libesignal.a esignal_fea.o pc_wav.o $(ELM_CC) -c $(CFLAGS) -I$(XVIEW_INC) -DWAVES_PROG -DERS_PROG $(NO_LIC) license.c + mkdir -p ers mv license.o ers ld -o ers/headers.o -r headers.o ers/license.o \ sphere.o \ diff --git a/ESPS/general/src/lib_header/sphere2.6/include/sp/sphere.h b/ESPS/general/src/lib_header/sphere2.6/include/sp/sphere.h index ede0c1a..ac614c5 100644 --- a/ESPS/general/src/lib_header/sphere2.6/include/sp/sphere.h +++ b/ESPS/general/src/lib_header/sphere2.6/include/sp/sphere.h @@ -32,7 +32,7 @@ extern "C" { #include #include -#ifndef u_int +#if !defined(u_int) && !defined(__APPLE__) #define u_int unsigned int #endif diff --git a/ESPS/general/src/lib_header/sphere2.6/src/bin/Makefile b/ESPS/general/src/lib_header/sphere2.6/src/bin/Makefile index f8e80eb..8edba67 100644 --- a/ESPS/general/src/lib_header/sphere2.6/src/bin/Makefile +++ b/ESPS/general/src/lib_header/sphere2.6/src/bin/Makefile @@ -46,7 +46,7 @@ INCLUDE = $(PROJECT_ROOT)/include LIBDIR = $(LIBS) CFLAGS = -I$(INCLUDE) -L$(LIBDIR) $(LOCAL_CFLAGS) -CC = gcc -ansi +CC = gcc -std=gnu89 -D_FORTIFY_SOURCE=0 -Wno-implicit-function-declaration -Wno-implicit-int -Wno-return-type INSTALL = install -c -s -m 755 MAKEFILE = Makefile diff --git a/ESPS/general/src/lib_header/sphere2.6/src/lib/sp/Makefile b/ESPS/general/src/lib_header/sphere2.6/src/lib/sp/Makefile index 7a217a7..502cc1e 100644 --- a/ESPS/general/src/lib_header/sphere2.6/src/lib/sp/Makefile +++ b/ESPS/general/src/lib_header/sphere2.6/src/lib/sp/Makefile @@ -52,7 +52,7 @@ LIBRY = $(LIBRARY) CFLAGS = -I$(INCLUDE) $(PROGCFLAGS) $(LOCAL_CFLAGS) #CFLAGS = -I$(INCLUDE) $(LOCAL_CFLAGS) -override CC = gcc -ansi $(CFLAGS) +override CC = gcc -std=gnu89 -D_FORTIFY_SOURCE=0 -Wno-implicit-function-declaration -Wno-implicit-int -Wno-return-type $(CFLAGS) MAKEFILE = Makefile .PRECIOUS: $(MAKEFILE) diff --git a/ESPS/general/src/lib_header/sphere2.6/src/lib/sp/fixio.c b/ESPS/general/src/lib_header/sphere2.6/src/lib/sp/fixio.c index aeaf176..8d55e3e 100644 --- a/ESPS/general/src/lib_header/sphere2.6/src/lib/sp/fixio.c +++ b/ESPS/general/src/lib_header/sphere2.6/src/lib/sp/fixio.c @@ -8,6 +8,7 @@ # include # include +# include /* Changed by Jon Fiscus */ # include # include diff --git a/ESPS/general/src/lib_header/sphere2.6/src/lib/util/Makefile b/ESPS/general/src/lib_header/sphere2.6/src/lib/util/Makefile index 4033020..098a364 100644 --- a/ESPS/general/src/lib_header/sphere2.6/src/lib/util/Makefile +++ b/ESPS/general/src/lib_header/sphere2.6/src/lib/util/Makefile @@ -51,7 +51,7 @@ OBJ = cfg.o comments.o ds.o err_util.o fobops.o hist.o hsgetopt.o itoa.o maldie. LIBRY = $(LIBRARY) CFLAGS = -I$(INCLUDE) $(LOCAL_CFLAGS) -CC = gcc -ansi $(CFLAGS) +CC = gcc -std=gnu89 -D_FORTIFY_SOURCE=0 -Wno-implicit-function-declaration -Wno-implicit-int -Wno-return-type $(CFLAGS) MAKEFILE = Makefile .PRECIOUS: $(MAKEFILE) diff --git a/ESPS/general/src/lib_sp/vqdesign.c b/ESPS/general/src/lib_sp/vqdesign.c index e162c19..c40e523 100644 --- a/ESPS/general/src/lib_sp/vqdesign.c +++ b/ESPS/general/src/lib_sp/vqdesign.c @@ -14,6 +14,7 @@ * This function designs a full-search vector quantization codebook */ #include +#include #include #include #include @@ -476,7 +477,7 @@ int *error; */ { int i; - static first = 1; /*flag for first time through*/ + static int first = 1; /*flag for first time through*/ static float **newcodebook; /*storage for new codewords*/ long n_tosplit; /*number of codewords to split*/ long n_index; /*index for new codewords*/ diff --git a/ESPS/general/src/lib_sp/vqencode.c b/ESPS/general/src/lib_sp/vqencode.c index 968b505..9407e27 100644 --- a/ESPS/general/src/lib_sp/vqencode.c +++ b/ESPS/general/src/lib_sp/vqencode.c @@ -21,6 +21,7 @@ static char *sccs_id = "@(#)vqencode.c 1.6 8/11/91 EPI"; #endif #include +#include #include #include #define BIGDIST 1E20 diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..3d5b3f5 --- /dev/null +++ b/Makefile @@ -0,0 +1,7 @@ +# Build and test inside an Ubuntu 24.04 container (requires macOS container CLI) +CONTAINER_TAG = esps-test + +.PHONY: container-test +container-test: + container build --tag $(CONTAINER_TAG) --file Dockerfile . + container run --rm $(CONTAINER_TAG) diff --git a/README.md b/README.md index 0a9ed4d..0283fce 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,87 @@ This project stands on work from many contributors across academia and industry, - [HTK history (CUED/HTK project mirror)](https://spandh.dcs.shef.ac.uk/ed_arena/htk/history.html) - [Upstream mirror repository: jeremysalwen/ESPS](https://github.com/jeremysalwen/ESPS) +## Building on Modern macOS + +The ESPS codebase compiles on modern macOS (Apple clang 17, arm64) with minimal source changes. GUI/X11/audio components are excluded. + +### Quick Start + +```bash +cd ESPS/general +./SETUP # Generates emake, defaults install to /usr/esps +./ESPS_INSTALL # Builds and installs everything +``` + +Or to build into a custom directory: + +```bash +cd ESPS/general +./SETUP -p /path/to/install +./ESPS_INSTALL +``` + +### What Gets Built + +- **154 compiled CLI utilities** (fft, lpcana, get_f0, frame, sgram, etc.) plus 12 macOS-specific audio scripts/binaries +- **7 libraries**: `libespsg.a`, `libhdre.a`, `libhdrw.a`, `libhdrs.a`, `libhdrn.a`, `libesignal.a`, `libexv.a` + +### Excluded Components + +The following components require X11/XView/audio hardware not available on modern macOS and are skipped: + +libxv, xwaves (ATT), audio, image, formsy, ps_ana, gpstohp, exprompt, expromptrun, fbuttons, mbuttons, plot3d, send_xwaves, wsystem, xacf, xtext, epochs, xfir_filt, xpz + +### Changes Required for macOS Compilation + +All changes are minimal — only what the compiler requires: + +**Build system:** +- `SETUP` — C89 compatibility flags (`-std=gnu89`, `-Wno-implicit-*`), non-fatal XView detection, guarded macAudio copy +- `COMPILE` — Copy `other_includes` before build, comment out X11/GUI/HP components +- `lib/makefile` — Remove X11-dependent `xsend.o` from library objects +- `ATT/libsig/Makefile` — Remove XView dependency +- `lib_header/makefile` — Add `mkdir -p` for build subdirectories +- sphere2.6 Makefiles — Replace `gcc -ansi` with `gnu89` + warning suppression + +**Source code (6 files, compiler-required only):** +- `sphere.h` — Guard `u_int` macro with `__APPLE__` to avoid typedef conflict +- `fixio.c` — Add `#include ` for `swab()` declaration +- `vqdesign.c` — Add `#include `, fix implicit int declaration +- `vqencode.c` — Add `#include ` for `exit()` declaration +- `addfeahd.c`, `btosps.c` — Add `LINUX_OR_MAC` to platform guards for lvalue cast + +## Building on Linux (Ubuntu 24.04) + +ESPS also compiles on Ubuntu 24.04 (GCC 13, arm64/x86_64). A Dockerfile is provided for containerized builds. + +### Container Build (from macOS) + +Requires Apple's [`container`](https://github.com/apple/container) CLI: + +```bash +make container-test +``` + +This builds ESPS inside an Ubuntu 24.04 container and produces **154 CLI utilities** (the same compiled programs as macOS; the 12 extra on macOS are platform-specific audio shell scripts). + +### Native Linux Build + +```bash +# Install dependencies +sudo apt-get install gcc libc6-dev make bison flex libx11-dev libxt-dev + +cd ESPS/general +./SETUP -p /usr/esps +./ESPS_INSTALL +``` + +### Key Linux Adaptations + +- `SETUP` — GCC flags: `-std=gnu89 -fcommon`, warning suppressions for legacy C, architecture-agnostic X11 library path +- `SETUP` — Library link order repeats `libhdre.a`/`libespsg.a` to resolve circular dependencies with GNU ld (which processes archives in a single left-to-right pass, unlike macOS ld) +- `COMPILE` — Creates `libexv.a` stub (XView disabled) using a dummy object for cross-platform `ar` compatibility + ## Documentation - Live ESPS manual pages (upstream mirror): [jeremysalwen/ESPS `ESPS/general/man`](https://github.com/jeremysalwen/ESPS/tree/master/ESPS/general/man)