mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-24 22:58:21 +00:00
Instead of linking libresample into the main Asterisk binary, build it as
res_resample, and mark codec_resample as dependent upon res_resample. This prevents the linker from optimizing away libresample, and also makes it so the libresample code isn't linked in to multiple places. (I have another module in a branch that needs it, too.) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@95697 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -55,7 +55,4 @@ $(LIBG722):
|
||||
|
||||
$(if $(filter codec_g722,$(EMBEDDED_MODS)),modules.link,codec_g722.so): $(LIBG722)
|
||||
|
||||
codec_resample.o: ASTCFLAGS+=-I$(ASTTOPDIR)/main/libresample/include
|
||||
ifneq ($(findstring $(OSARCH), mingw32 cygwin ),)
|
||||
codec_resample.so: LIBS += $(ASTTOPDIR)/main/libresample/libresample.a
|
||||
endif
|
||||
codec_resample.o: ASTCFLAGS+=-I$(ASTTOPDIR)/res/libresample/include
|
||||
|
@@ -24,6 +24,10 @@
|
||||
* \ingroup codecs
|
||||
*/
|
||||
|
||||
/*** MODULEINFO
|
||||
<depend>res_resample</depend>
|
||||
***/
|
||||
|
||||
#include "asterisk.h"
|
||||
|
||||
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||
|
@@ -111,9 +111,6 @@ editline/libedit.a: CHECK_SUBDIR
|
||||
db1-ast/libdb1.a: CHECK_SUBDIR
|
||||
CFLAGS="$(ASTCFLAGS)" LDFLAGS="$(ASTLDFLAGS)" $(MAKE) -C db1-ast libdb1.a
|
||||
|
||||
libresample/libresample.a: CHECK_SUBDIR
|
||||
$(MAKE) -f Makefile.asterisk -C libresample libresample.a
|
||||
|
||||
ast_expr2.c ast_expr2.h:
|
||||
bison -o $@ -d --name-prefix=ast_yy ast_expr2.y
|
||||
|
||||
@@ -155,7 +152,7 @@ else
|
||||
MAIN_TGT:=asterisk
|
||||
endif
|
||||
|
||||
$(MAIN_TGT): $(OBJS) editline/libedit.a db1-ast/libdb1.a minimime/libmmime.a $(AST_EMBED_LDSCRIPTS) libresample/libresample.a
|
||||
$(MAIN_TGT): $(OBJS) editline/libedit.a db1-ast/libdb1.a minimime/libmmime.a $(AST_EMBED_LDSCRIPTS)
|
||||
@$(CC) -c -o buildinfo.o $(ASTCFLAGS) buildinfo.c
|
||||
$(ECHO_PREFIX) echo " [LD] $^ -> $@"
|
||||
ifneq ($(findstring chan_h323,$(MENUSELECT_CHANNELS)),)
|
||||
@@ -172,4 +169,3 @@ clean::
|
||||
@$(MAKE) -C db1-ast clean
|
||||
@$(MAKE) -C stdtime clean
|
||||
@$(MAKE) -C minimime clean
|
||||
@$(MAKE) -f Makefile.asterisk -C libresample clean
|
||||
|
@@ -47,6 +47,9 @@ ael/ael.tab.c ael/ael.tab.h:
|
||||
|
||||
ael/pval.o: ael/pval.c
|
||||
|
||||
res_resample.so: libresample/src/resample.o libresample/src/resamplesubs.o libresample/src/filterkit.o
|
||||
|
||||
clean::
|
||||
rm -f snmp/*.o
|
||||
rm -f ael/*.o
|
||||
rm -f libresample/src/*.o
|
||||
|
44
res/res_resample.c
Normal file
44
res/res_resample.c
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Asterisk -- A telephony toolkit for Linux.
|
||||
*
|
||||
* Copyright (C) 2007, Digium, Inc.
|
||||
*
|
||||
* Russell Bryant <russell@digium.com>
|
||||
*
|
||||
* See http://www.asterisk.org for more information about
|
||||
* the Asterisk project. Please do not directly contact
|
||||
* any of the maintainers of this project for assistance;
|
||||
* the project provides a web site, mailing lists and IRC
|
||||
* channels for your use.
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License Version 2. See the LICENSE file
|
||||
* at the top of the source tree.
|
||||
*/
|
||||
|
||||
/*!
|
||||
* \file
|
||||
*
|
||||
* \author Russell Bryant <russell@digium.com>
|
||||
*/
|
||||
|
||||
#include "asterisk.h"
|
||||
|
||||
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||
|
||||
#include "asterisk/module.h"
|
||||
|
||||
static int load_module(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int unload_module(void)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS, "Resampling Support via libresample",
|
||||
.load = load_module,
|
||||
.unload = unload_module,
|
||||
);
|
Reference in New Issue
Block a user