see https://github.com/festvox/flite/pull/94 --- configure.in.orig 2020-08-12 17:17:09 +++ configure.in 2023-04-20 05:11:37 @@ -239,6 +239,7 @@ AC_SUBST(HOST_CPU) SHFLAGS= +SHEXT="so" OTHERLIBS= dnl For OpenPandora and other (softfloat) ARMs with neon @@ -273,6 +274,10 @@ SHFLAGS="-fPIC" OTHERLIBS="-lsocket -ldl" ;; + darwin*) + SHFLAGS="-fPIC" + SHEXT="dylib" + ;; *) ;; esac @@ -290,6 +295,7 @@ AC_SUBST(OTHERLIBS) AC_SUBST(SHFLAGS) +AC_SUBST(SHEXT) AC_ARG_ENABLE( sockets, [ --disable-sockets without socket support], --- configure.orig 2020-08-12 17:17:09 +++ configure 2023-04-20 05:10:28 @@ -631,6 +631,7 @@ STDIOTYPE MMAPTYPE SHFLAGS +SHEXT OTHERLIBS HOST_CPU HOST_OS @@ -4183,6 +4184,7 @@ SHFLAGS= +SHEXT=".so" OTHERLIBS= if grep -q Pandora /proc/cpuinfo @@ -4220,6 +4222,10 @@ SHFLAGS="-fPIC" OTHERLIBS="-lsocket -ldl" ;; + darwin*) + SHFLAGS="-fPIC" + SHEXT="dylib" + ;; *) ;; esac --- config/config.in.orig 2020-08-12 17:17:09 +++ config/config.in 2023-04-20 05:13:33 @@ -12,6 +12,7 @@ CFLAGS = @CFLAGS@ @ENDIANDEFS@ CPPFLAGS = @CPPFLAGS@ SHFLAGS = @SHFLAGS@ +SHEXT = @SHEXT@ LDFLAGS = @LDFLAGS@ AR = @AR@ --- main/Makefile.orig 2020-08-12 17:17:09 +++ main/Makefile 2023-04-20 06:42:59 @@ -65,13 +65,18 @@ # We need to set these vars, even if we're not going to build them # so make clean can remove them SHAREDARLIBS= $(flite_LIBS:%=$(LIBDIR)/lib%.shared.a) -SHAREDLIBS = $(SHAREDARLIBS:%.shared.a=%.so) -SHAREDMODS = $(flite_MODS:%=$(LIBDIR)/lib%.so) -SHAREDusenMODS = $(LIBDIR)/libflite_cmu_time_awb.so $(LIBDIR)/libflite_cmu_us_awb.so $(LIBDIR)/libflite_cmu_us_kal16.so $(LIBDIR)/libflite_cmu_us_kal.so $(LIBDIR)/libflite_cmu_us_rms.so $(LIBDIR)/libflite_cmu_us_slt.so $(LIBDIR)/libflite_cmu_indic_lang.so -SHAREDcmulexMODS = $(LIBDIR)/libflite_cmu_time_awb.so $(LIBDIR)/libflite_cmu_us_awb.so $(LIBDIR)/libflite_cmu_us_kal16.so $(LIBDIR)/libflite_cmu_us_kal.so $(LIBDIR)/libflite_cmu_us_rms.so $(LIBDIR)/libflite_cmu_us_slt.so $(LIBDIR)/libflite_cmu_indic_lex.so -SHAREDindicMODS = $(LIBDIR)/libflite_cmu_indic_lex.so +SHAREDLIBS = $(SHAREDARLIBS:%.shared.a=%.$(SHEXT)) +SHAREDMODS = $(flite_MODS:%=$(LIBDIR)/lib%.$(SHEXT)) +SHAREDusenMODS = $(LIBDIR)/libflite_cmu_time_awb.$(SHEXT) $(LIBDIR)/libflite_cmu_us_awb.$(SHEXT) $(LIBDIR)/libflite_cmu_us_kal16.$(SHEXT) $(LIBDIR)/libflite_cmu_us_kal.$(SHEXT) $(LIBDIR)/libflite_cmu_us_rms.$(SHEXT) $(LIBDIR)/libflite_cmu_us_slt.$(SHEXT) $(LIBDIR)/libflite_cmu_indic_lang.$(SHEXT) +SHAREDcmulexMODS = $(LIBDIR)/libflite_cmu_time_awb.$(SHEXT) $(LIBDIR)/libflite_cmu_us_awb.$(SHEXT) $(LIBDIR)/libflite_cmu_us_kal16.$(SHEXT) $(LIBDIR)/libflite_cmu_us_kal.$(SHEXT) $(LIBDIR)/libflite_cmu_us_rms.$(SHEXT) $(LIBDIR)/libflite_cmu_us_slt.$(SHEXT) $(LIBDIR)/libflite_cmu_indic_lex.$(SHEXT) +SHAREDindicMODS = $(LIBDIR)/libflite_cmu_indic_lex.$(SHEXT) +ifneq ($(SHEXT),dylib) VERSIONSHAREDLIBS = $(SHAREDLIBS:%=%.${PROJECT_VERSION}) \ $(SHAREDLIBS:%=%.${PROJECT_SHLIB_VERSION}) +else +VERSIONSHAREDLIBS = $(SHAREDLIBS:%$(SHEXT)=%${PROJECT_VERSION}.$(SHEXT)) \ + $(SHAREDLIBS:%$(SHEXT)=%${PROJECT_SHLIB_VERSION}.$(SHEXT)) +endif flite_time_LIBS = flite_cmu_time_awb flite_usenglish flite_cmulex flite_time_LIBS_flags = -L$(LIBDIR) $(flite_time_LIBS:%=-l%) @@ -84,13 +89,13 @@ flite_voice_list.c ifdef SHFLAGS -$(SHAREDMODS): $(LIBDIR)/libflite.so +$(SHAREDMODS): $(LIBDIR)/libflite.$(SHEXT) $(SHAREDMODS): LDFLAGS+=-L../$(LIBDIR) -lflite -$(SHAREDusenMODS): $(LIBDIR)/libflite_usenglish.so +$(SHAREDusenMODS): $(LIBDIR)/libflite_usenglish.$(SHEXT) $(SHAREDusenMODS): LDFLAGS+=-L../$(LIBDIR) -lflite_usenglish -$(SHAREDcmulexMODS): $(LIBDIR)/libflite_cmulex.so +$(SHAREDcmulexMODS): $(LIBDIR)/libflite_cmulex.$(SHEXT) $(SHAREDcmulexMODS): LDFLAGS+=-L../$(LIBDIR) -lflite_cmulex -$(SHAREDindicMODS): $(LIBDIR)/libflite_cmu_indic_lang.so +$(SHAREDindicMODS): $(LIBDIR)/libflite_cmu_indic_lang.$(SHEXT) $(SHAREDindicMODS): LDFLAGS+=-L../$(LIBDIR) -lflite_cmu_indic_lang shared_libs: $(SHAREDLIBS) else --- config/common_make_rules.orig 2020-08-12 17:17:09 +++ config/common_make_rules 2023-04-19 13:47:12 @@ -128,6 +128,17 @@ @ (cd $(LIBDIR) && ln -s `basename $@.${PROJECT_SHLIB_VERSION}` `basename $@` ) @ rm -rf shared_os +# Used in the lib/ directory and in building new voices +$(LIBDIR)/%.dylib: $(LIBDIR)/%.shared.a + @ echo making $@ + @ rm -rf shared_os && mkdir shared_os + @ rm -f $@ $@.${PROJECT_VERSION} $@.${PROJECT_SHLIB_VERSION} + @ (cd shared_os && ar x ../$<) + @ (cd shared_os && $(CC) -dynamiclib -install_name ${INSTALLLIBDIR}/`basename $@ ${SHEXT}`${PROJECT_SHLIB_VERSION}.${SHEXT} -current_version ${PROJECT_VERSION} -compatibility_version ${PROJECT_SHLIB_VERSION} -o ../${@:${SHEXT}=${PROJECT_VERSION}.${SHEXT}} *.os $(LDFLAGS) $(addprefix ../,$(filter-out $<,${^:${SHEXT}=${PROJECT_VERSION}.${SHEXT}}))) + @ (cd $(LIBDIR) && ln -s `basename $@ ${SHEXT}`${PROJECT_VERSION}.${SHEXT} `basename $@ ${SHEXT}`${PROJECT_SHLIB_VERSION}.${SHEXT} ) + @ (cd $(LIBDIR) && ln -s `basename $@ ${SHEXT}`${PROJECT_SHLIB_VERSION}.${SHEXT} `basename $@` ) + @ rm -rf shared_os + $(OBJDIR)/.make_build_dirs: @ echo making in $(DIRNAME) ... ifdef BUILD_DIRS