--- a/Makefile.am
+++ b/Makefile.am
-@@ -1,3 +1,8 @@
+@@ -1,3 +1,7 @@
+BASE=.
+
-+include $(BASE)/../../../rules.mk
-+include $(BASE)/../../../include/package.mk
++include $(BASE)/build/openwrt_rules.mk
+
EXTRA_DIST =
SUBDIRS = . src
AUTOMAKE_OPTS = foreign
-@@ -61,7 +66,7 @@ cd-moh-install: uhd-moh-install sounds-m
+@@ -61,7 +65,7 @@ cd-moh-install: uhd-moh-install sounds-m
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
clean-recusive: clean_core
install-recursive: install-libLTLIBRARIES install-binPROGRAMS
$(RECURSIVE_TARGETS):
-@@ -299,7 +304,7 @@ endif
+@@ -299,7 +303,7 @@ endif
##
fs_encode_SOURCES = src/fs_encode.c
fs_encode_CFLAGS = $(AM_CFLAGS)
fs_encode_LDADD = libfreeswitch.la -lcrypt -lrt
##
-@@ -307,7 +312,7 @@ fs_encode_LDADD = libfreeswitch.la -lcry
+@@ -307,7 +311,7 @@ fs_encode_LDADD = libfreeswitch.la -lcry
##
tone2wav_SOURCES = src/tone2wav.c
tone2wav_CFLAGS = $(AM_CFLAGS)
tone2wav_LDADD = libfreeswitch.la -lcrypt -lrt
##
-@@ -586,10 +591,13 @@ speex-reconf:
+@@ -586,10 +590,13 @@ speex-reconf:
tiff-reconf:
cd libs/tiff-3.8.2 && autoreconf -fi
python-reconf:
rm -f src/mod/languages/mod_python/Makefile
-@@ -612,12 +620,6 @@ iks-reconf:
+@@ -612,12 +619,6 @@ iks-reconf:
cd libs/iksemel && sh ./configure.gnu --prefix=$(prefix)
$(MAKE) mod_dingaling-clean
--- a/src/mod/codecs/mod_opus/Makefile
+++ b/src/mod/codecs/mod_opus/Makefile
-@@ -1,29 +1,41 @@
- BASE=../../../..
-
--OPUS=opus-0.9.0
--
--OPUS_DIR=$(switch_srcdir)/libs/$(OPUS)
--OPUS_BUILDDIR=$(switch_builddir)/libs/$(OPUS)
--LOCAL_CFLAGS=-I$(OPUS_DIR)/src -g -O2
--
--IETF_LA=$(OPUS_BUILDDIR)/src/libietfcodec.la
--CELT_LA=$(OPUS_BUILDDIR)/celt/libcelt/libcelt0.la
--SILK_LA=$(OPUS_BUILDDIR)/silk/libSKP_SILK_SDK.la
-+PKG_NAME=opus
-+PKG_VERSION=0.9.0
-+PKG_SOURCE_SUBDIR=$(PKG_NAME)-$(PKG_VERSION)
-+PKG_SOURCE=$(PKG_SOURCE_SUBDIR).tar.gz
-+PKG_BUILD_DIR=$(switch_builddir)/libs/$(PKG_SOURCE_SUBDIR)
-+PKG_SOURCE_DIR=$(switch_srcdir)/libs/$(PKG_SOURCE_SUBDIR)
-+
-+PKG_FIXUP:=libtool autoreconf
-+PKG_BUILD_PARALLEL:=1
-+
-+LOCAL_CFLAGS=-I$(PKG_SOURCE_DIR)/src -g -O2
-+
-+IETF_LA=$(PKG_BUILD_DIR)/src/libietfcodec.la
-+CELT_LA=$(PKG_BUILD_DIR)/celt/libcelt/libcelt0.la
-+SILK_LA=$(PKG_BUILD_DIR)/silk/libSKP_SILK_SDK.la
-
+@@ -13,13 +13,14 @@ SILK_LA=$(OPUS_BUILDDIR)/silk/libSKP_SIL
LOCAL_LIBADD=$(IETF_LA) $(CELT_LA) $(SILK_LA) -lm -lz
include $(BASE)/build/modmake.rules
-+include $(BASE)/../../../rules.mk
-+include $(BASE)/../../../include/package.mk
++include $(BASE)/build/openwrt_rules.mk
--$(OPUS_DIR):
-- $(GETLIB) $(OPUS).tar.gz
-+MY_DEFAULT_ARGS:=--host=$(GNU_TARGET_NAME) --disable-shared --with-pic --srcdir=$(PKG_SOURCE_DIR)
+ $(OPUS_DIR):
+ $(GETLIB) $(OPUS).tar.gz
--$(OPUS_BUILDDIR)/Makefile: $(OPUS_DIR)
-- mkdir -p $(OPUS_BUILDDIR)
+ $(OPUS_BUILDDIR)/Makefile: $(OPUS_DIR)
+ mkdir -p $(OPUS_BUILDDIR)
- cd $(OPUS_BUILDDIR) && $(DEFAULT_VARS) $(OPUS_DIR)/configure --disable-shared --with-pic --srcdir=$(OPUS_DIR)
-+$(PKG_SOURCE_DIR):
-+ $(GETLIB) $(PKG_SOURCE)
-+ (cd $(PKG_BUILD_DIR); ${autoreconf_target})
-+
-+$(PKG_BUILD_DIR)/Makefile: $(PKG_SOURCE_DIR)
-+ mkdir -p $(PKG_BUILD_DIR)
-+ #cd $(PKG_BUILD_DIR) && $(DEFAULT_VARS) $(PKG_SOURCE_DIR)/configure $(MY_DEFAULT_ARGS)
-+ (cd $(PKG_BUILD_DIR); $(call Build/Configure/Default,${MY_DEFAULT_ARGS}))
- $(TOUCH_TARGET)
-
--$(IETF_LA): $(OPUS_BUILDDIR)/Makefile
-- cd $(OPUS_BUILDDIR) && $(MAKE)
-+$(IETF_LA): $(PKG_BUILD_DIR)/Makefile
-+ (cd $(PKG_BUILD_DIR) && $(MAKE))
++ cd $(OPUS_BUILDDIR) && $(DEFAULT_VARS) $(OPUS_DIR)/configure --host=$(GNU_TARGET_NAME) --disable-shared --with-pic --srcdir=$(OPUS_DIR)
$(TOUCH_TARGET)
- $(CELT_LA): $(IETF_LA)
+ $(IETF_LA): $(OPUS_BUILDDIR)/Makefile