diff --git a/daemon/Makefile b/daemon/Makefile index 83ae644e9..ab62c1afa 100644 --- a/daemon/Makefile +++ b/daemon/Makefile @@ -74,6 +74,8 @@ endif CFLAGS += $(CFLAGS_MQTT) LDLIBS += $(LDLIBS_MQTT) +CC_ARCH := $(firstword $(subst -, ,$(shell $(CC) -dumpmachine 2>/dev/null))) + SRCS := main.c kernel.c helpers.c control_tcp.c call.c control_udp.c redis.c \ cookie_cache.c udp_listener.c control_ng_flags_parser.c control_ng.c sdp.strhash.c stun.c rtcp.c \ crypto.c rtp.c call_interfaces.c dtls.c log.c cli.strhash.c graphite.c ice.c \ @@ -87,8 +89,10 @@ LIBSRCS := loglib.c auxlib.c rtplib.c str.c socket.c streambuf.c ssllib.c dtmfli bufferpool.c bencode.c netfilter_api.c ifeq ($(with_transcoding),yes) LIBSRCS += codeclib.strhash.c resample.c +ifeq ($(CC_ARCH),x86_64) LIBASM := mvr2s_x64_avx2.S mvr2s_x64_avx512.S mix_in_x64_avx2.S mix_in_x64_avx512bw.S mix_in_x64_sse2.S endif +endif ifneq ($(have_liburing),yes) LIBSRCS += uring.c endif diff --git a/lib/Makefile b/lib/Makefile index 67636d7d9..988322694 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -17,7 +17,11 @@ SRCS += netfilter_api.c oauth.c poller.c resample.c SRCS += rtplib.c s3utils.c socket.c SRCS += ssllib.c str.c streambuf.c uring.c +CC_ARCH := $(firstword $(subst -, ,$(shell $(CC) -dumpmachine 2>/dev/null))) + +ifeq ($(CC_ARCH),x86_64) ASM := mix_in_x64_avx2.S mix_in_x64_avx512bw.S mix_in_x64_sse2.S mvr2s_x64_avx2.S mvr2s_x64_avx512.S +endif include common.Makefile