2006-08-21 02:11:39 +00:00
|
|
|
#
|
|
|
|
|
# Asterisk -- A telephony toolkit for Linux.
|
|
|
|
|
#
|
|
|
|
|
# Makefile to build main Asterisk binary
|
|
|
|
|
#
|
|
|
|
|
# Copyright (C) 1999-2006, Digium, Inc.
|
|
|
|
|
#
|
|
|
|
|
# Mark Spencer <markster@digium.com>
|
|
|
|
|
#
|
|
|
|
|
# This program is free software, distributed under the terms of
|
|
|
|
|
# the GNU General Public License
|
|
|
|
|
#
|
|
|
|
|
|
2006-08-26 23:58:47 +00:00
|
|
|
-include $(ASTTOPDIR)/menuselect.makeopts $(ASTTOPDIR)/menuselect.makedeps $(ASTTOPDIR)/makeopts.embed_rules
|
2006-08-21 02:11:39 +00:00
|
|
|
|
|
|
|
|
all: asterisk
|
|
|
|
|
|
|
|
|
|
include $(ASTTOPDIR)/Makefile.moddir_rules
|
|
|
|
|
|
2008-01-18 22:04:33 +00:00
|
|
|
OBJS= tcptls.o io.o sched.o logger.o frame.o loader.o config.o channel.o \
|
2009-02-17 20:52:24 +00:00
|
|
|
translate.o file.o pbx.o cli.o md5.o term.o heap.o \
|
2006-08-21 02:11:39 +00:00
|
|
|
ulaw.o alaw.o callerid.o fskmodem.o image.o app.o \
|
|
|
|
|
cdr.o tdd.o acl.o rtp.o udptl.o manager.o asterisk.o \
|
|
|
|
|
dsp.o chanvars.o indications.o autoservice.o db.o privacy.o \
|
|
|
|
|
astmm.o enum.o srv.o dns.o aescrypt.o aestab.o aeskey.o \
|
|
|
|
|
utils.o plc.o jitterbuf.o dnsmgr.o devicestate.o \
|
|
|
|
|
netsock.o slinfactory.o ast_expr2.o ast_expr2f.o \
|
2006-09-15 17:16:00 +00:00
|
|
|
cryptostub.o sha1.o http.o fixedjitterbuf.o abstract_jb.o \
|
Merged revisions 80362 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r80362 | russell | 2007-08-22 15:21:36 -0500 (Wed, 22 Aug 2007) | 34 lines
Merge changes from team/russell/iax_refcount.
This set of changes fixes problems with the handling of iax2_user and iax2_peer
objects. It was very possible for a thread to still hold a reference to one of
these objects while a reload operation tries to delete them. The fix here is to
ensure that all references to these objects are tracked so that they can't go away
while still in use.
To accomplish this, I used the astobj2 reference counted object model. This
code has been in one of Luigi Rizzo's branches for a long time and was primarily
developed by one of his students, Marta Carbone. I wanted to go ahead and bring
this in to 1.4 because there are other problems similar to the ones fixed by these
changes, so we might as well go ahead and use the new astobj if we're going to go
through all of the work necessary to fix the problems.
As a nice side benefit of these changes, peer and user handling got more efficient.
Using astobj2 lets us not hold the container lock for peers or users nearly as long
while iterating. Also, by changing a define at the top of chan_iax2.c, the objects
will be distributed in a hash table, drastically increasing lookup speed in these
containers, which will have a very big impact on systems that have a large number of
users or peers.
The use of the hash table will be made the default in trunk. It is not the default
in 1.4 because it changes the behavior slightly. Previously, since peers and users
were stored in memory in the same order they were specified in the configuration file,
you could influence peer and user matching order based on the order they are specified
in the configuration. The hash table does not guarantee any order in the container,
so this behavior will be going away. It just means that you have to be a little
more careful ensuring that peers and users are matched explicitly and not forcing
chan_iax2 to have to guess which user is the right one based on secret, host, and
access list settings, instead of simply using the username.
If you have any questions, feel free to ask on the asterisk-dev list.
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@80387 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-22 20:44:23 +00:00
|
|
|
strcompat.o threadstorage.o dial.o event.o adsistub.o audiohook.o \
|
2008-07-21 14:47:41 +00:00
|
|
|
astobj2.o hashtab.o global_datastores.o version.o \
|
Merged revisions 182847 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
................
r182847 | russell | 2009-03-17 21:28:55 -0500 (Tue, 17 Mar 2009) | 52 lines
Merged revisions 182810 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r182810 | russell | 2009-03-17 21:09:13 -0500 (Tue, 17 Mar 2009) | 44 lines
Fix cases where the internal poll() was not being used when it needed to be.
We have seen a number of problems caused by poll() not working properly on
Mac OSX. If you search around, you'll find a number of references to using
select() instead of poll() to work around these issues. In Asterisk, we've
had poll.c which implements poll() using select() internally. However, we
were still getting reports of problems.
vadim investigated a bit and realized that at least on his system, even
though we were compiling in poll.o, the system poll() was still being used.
So, the primary purpose of this patch is to ensure that we're using the
internal poll() when we want it to be used.
The changes are:
1) Remove logic for when internal poll should be used from the Makefile.
Instead, put it in the configure script. The logic in the configure
script is the same as it was in the Makefile. Ideally, we would have
a functionality test for the problem, but that's not actually possible,
since we would have to be able to run an application on the _target_
system to test poll() behavior.
2) Always include poll.o in the build, but it will be empty if AST_POLL_COMPAT
is not defined.
3) Change uses of poll() throughout the source tree to ast_poll(). I feel
that it is good practice to give the API call a new name when we are
changing its behavior and not using the system version directly in all cases.
So, normally, ast_poll() is just redefined to poll(). On systems where
AST_POLL_COMPAT is defined, ast_poll() is redefined to ast_internal_poll().
4) Change poll() in main/poll.c to be ast_internal_poll().
It's worth noting that any code that still uses poll() directly will work fine
(if they worked fine before). So, for example, out of tree modules that are
using poll() will not stop working or anything. However, for modules to work
properly on Mac OSX, ast_poll() needs to be used.
(closes issue #13404)
Reported by: agalbraith
Tested by: russell, vadim
http://reviewboard.digium.com/r/198/
........
................
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@182946 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-18 14:32:47 +00:00
|
|
|
features.o taskprocessor.o timing.o datastore.o poll.o
|
2006-08-21 02:11:39 +00:00
|
|
|
|
|
|
|
|
# we need to link in the objects statically, not as a library, because
|
|
|
|
|
# otherwise modules will not have them available if none of the static
|
|
|
|
|
# objects use it.
|
|
|
|
|
OBJS+=stdtime/localtime.o
|
|
|
|
|
|
|
|
|
|
# At the moment say.o is an optional component which can be overridden
|
|
|
|
|
# by a module.
|
|
|
|
|
OBJS+=say.o
|
|
|
|
|
|
2006-10-22 19:09:25 +00:00
|
|
|
AST_LIBS += $(SSL_LIB)
|
2007-01-19 16:51:31 +00:00
|
|
|
AST_LIBS += $(BKTR_LIB)
|
2006-10-22 19:09:25 +00:00
|
|
|
|
2008-05-14 18:54:16 +00:00
|
|
|
ifneq ($(findstring $(OSARCH), linux-gnu uclinux linux-uclibc linux-gnueabi ),)
|
2006-08-21 02:11:39 +00:00
|
|
|
ifneq ($(findstring LOADABLE_MODULES,$(MENUSELECT_CFLAGS)),)
|
|
|
|
|
AST_LIBS+=-ldl
|
|
|
|
|
endif
|
2006-09-27 21:48:01 +00:00
|
|
|
ifneq (x$(CAP_LIB),x)
|
|
|
|
|
AST_LIBS+=$(CAP_LIB)
|
|
|
|
|
endif
|
2006-08-21 02:11:39 +00:00
|
|
|
AST_LIBS+=-lpthread $(EDITLINE_LIB) -lm -lresolv
|
|
|
|
|
else
|
|
|
|
|
AST_LIBS+=$(EDITLINE_LIB) -lm
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
ifneq ($(findstring darwin,$(OSARCH)),)
|
|
|
|
|
AST_LIBS+=-lresolv
|
2006-08-26 16:45:35 +00:00
|
|
|
ifneq ($(findstring LOADABLE_MODULES,$(MENUSELECT_CFLAGS)),)
|
|
|
|
|
ASTLINK=-Wl,-dynamic
|
|
|
|
|
endif
|
2006-08-21 02:11:39 +00:00
|
|
|
else
|
|
|
|
|
# These are used for all but Darwin
|
2006-08-26 16:45:35 +00:00
|
|
|
ifneq ($(findstring LOADABLE_MODULES,$(MENUSELECT_CFLAGS)),)
|
2006-09-21 16:09:31 +00:00
|
|
|
ASTLINK+=-Wl,--export-dynamic
|
2006-08-26 16:45:35 +00:00
|
|
|
else
|
|
|
|
|
ASTLINK+=${GC_LDFLAGS}
|
|
|
|
|
endif
|
2006-08-21 02:11:39 +00:00
|
|
|
ifneq ($(findstring BSD,$(OSARCH)),)
|
|
|
|
|
LDFLAGS+=-L/usr/local/lib
|
|
|
|
|
endif
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
ifeq ($(OSARCH),FreeBSD)
|
2007-11-05 21:27:04 +00:00
|
|
|
# -V is understood by BSD Make, not by GNU make.
|
|
|
|
|
BSDVERSION=$(shell make -V OSVERSION -f /usr/share/mk/bsd.port.subdir.mk)
|
|
|
|
|
AST_LIBS+=$(shell if test $(BSDVERSION) -lt 502102 ; then echo "-lc_r"; else echo "-pthread"; fi)
|
2006-08-21 02:11:39 +00:00
|
|
|
AST_LIBS+=-lcrypto
|
|
|
|
|
endif
|
|
|
|
|
|
2007-11-17 10:54:52 +00:00
|
|
|
ifneq ($(findstring $(OSARCH), mingw32 cygwin ),)
|
|
|
|
|
AST_LIBS+=-lminires -ldl
|
2007-11-20 07:42:38 +00:00
|
|
|
ASTLINK+= -shared -Wl,--out-implib,libasterisk.a
|
2007-11-17 10:54:52 +00:00
|
|
|
endif
|
2006-08-21 02:11:39 +00:00
|
|
|
ifeq ($(OSARCH),NetBSD)
|
|
|
|
|
AST_LIBS+=-lpthread -lcrypto -lm -L/usr/pkg/lib $(EDITLINE_LIB)
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
ifeq ($(OSARCH),OpenBSD)
|
|
|
|
|
AST_LIBS+=-lcrypto -lpthread -lm $(EDITLINE_LIB)
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
ifeq ($(OSARCH),SunOS)
|
|
|
|
|
AST_LIBS+=-lpthread -ldl -lnsl -lsocket -lresolv -L/opt/ssl/lib -L/usr/local/ssl/lib
|
|
|
|
|
ASTLINK=
|
|
|
|
|
endif
|
|
|
|
|
|
2008-08-03 16:14:14 +00:00
|
|
|
ifneq ($(findstring USE_HOARD_ALLOCATOR,$(MENUSELECT_CFLAGS)),)
|
|
|
|
|
ifneq ($(HOARD_LIB),)
|
|
|
|
|
AST_LIBS+=$(HOARD_LIB)
|
|
|
|
|
endif
|
|
|
|
|
endif
|
|
|
|
|
|
2007-06-29 20:33:35 +00:00
|
|
|
CHECK_SUBDIR: # do nothing, just make sure that we recurse in the subdir/
|
|
|
|
|
|
|
|
|
|
editline/libedit.a: CHECK_SUBDIR
|
2008-01-29 17:44:05 +00:00
|
|
|
cd editline && test -f config.h || CFLAGS="$(PTHREAD_CFLAGS) $(subst $(ASTTOPDIR),../../,$(ASTCFLAGS:-Werror=))" LDFLAGS="$(ASTLDFLAGS)" ./configure --build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) --with-ncurses=$(NCURSES_DIR) --with-curses=$(CURSES_DIR) --with-termcap=$(TERMCAP_DIR) --with-tinfo=$(TINFO_DIR)
|
2006-08-21 02:11:39 +00:00
|
|
|
$(MAKE) -C editline libedit.a
|
|
|
|
|
|
2007-06-29 20:33:35 +00:00
|
|
|
db1-ast/libdb1.a: CHECK_SUBDIR
|
2008-01-29 17:44:05 +00:00
|
|
|
CFLAGS="$(subst $(ASTTOPDIR),../../,$(ASTCFLAGS))" LDFLAGS="$(ASTLDFLAGS)" $(MAKE) -C db1-ast libdb1.a
|
2006-08-21 02:11:39 +00:00
|
|
|
|
|
|
|
|
ast_expr2.c ast_expr2.h:
|
|
|
|
|
bison -o $@ -d --name-prefix=ast_yy ast_expr2.y
|
|
|
|
|
|
|
|
|
|
ast_expr2f.c:
|
2009-02-20 00:26:06 +00:00
|
|
|
flex -o $@ ast_expr2.fl
|
2008-09-27 16:49:27 +00:00
|
|
|
sed 's@#if __STDC_VERSION__ >= 199901L@#if !defined __STDC_VERSION__ || __STDC_VERSION__ >= 199901L@' $@ > $@.fix
|
|
|
|
|
echo "#include \"asterisk.h\"" > $@
|
|
|
|
|
echo >> $@
|
|
|
|
|
cat $@.fix >> $@
|
|
|
|
|
rm $@.fix
|
2006-08-21 02:11:39 +00:00
|
|
|
|
2008-03-11 11:36:51 +00:00
|
|
|
ast_expr2f.o: ASTCFLAGS+=-Wno-unused
|
|
|
|
|
|
2006-08-21 02:11:39 +00:00
|
|
|
testexpr2: ast_expr2f.c ast_expr2.c ast_expr2.h
|
|
|
|
|
$(CC) -g -c -Iinclude -DSTANDALONE ast_expr2f.c
|
|
|
|
|
$(CC) -g -c -Iinclude -DSTANDALONE ast_expr2.c
|
2007-07-02 21:50:15 +00:00
|
|
|
$(CC) -g -o testexpr2 ast_expr2f.o ast_expr2.o -lm
|
2006-08-21 02:11:39 +00:00
|
|
|
rm ast_expr2.o ast_expr2f.o
|
|
|
|
|
|
2008-03-17 22:10:06 +00:00
|
|
|
ifneq ($(findstring ENABLE_UPLOADS,$(MENUSELECT_CFLAGS)),)
|
|
|
|
|
http.o: ASTCFLAGS+=$(GMIME_INCLUDE)
|
|
|
|
|
endif
|
|
|
|
|
|
2008-11-29 18:16:50 +00:00
|
|
|
stdtime/localtime.o: ASTCFLAGS+=$(AST_NO_STRICT_OVERFLOW) -Wno-format-nonliteral
|
2008-03-11 11:36:51 +00:00
|
|
|
|
2006-08-21 02:11:39 +00:00
|
|
|
AST_EMBED_LDSCRIPTS:=$(sort $(EMBED_LDSCRIPTS))
|
|
|
|
|
AST_EMBED_LDFLAGS:=$(foreach dep,$(EMBED_LDFLAGS),$(value $(dep)))
|
|
|
|
|
AST_EMBED_LIBS:=$(foreach dep,$(EMBED_LIBS),$(value $(dep)))
|
|
|
|
|
OBJS:=$(sort $(OBJS))
|
|
|
|
|
|
2006-09-19 17:07:22 +00:00
|
|
|
ifneq ($(wildcard ../channels/h323/Makefile.ast),)
|
|
|
|
|
include ../channels/h323/Makefile.ast
|
|
|
|
|
else
|
|
|
|
|
H323LDFLAGS=
|
|
|
|
|
H323LDLIBS=
|
|
|
|
|
endif
|
|
|
|
|
|
2007-11-17 12:33:15 +00:00
|
|
|
ifneq ($(findstring $(OSARCH), mingw32 cygwin ),)
|
|
|
|
|
MAIN_TGT:=asterisk.dll
|
|
|
|
|
asterisk: cygload
|
|
|
|
|
mv cygload.exe asterisk.exe
|
|
|
|
|
|
|
|
|
|
cygload: asterisk.dll
|
|
|
|
|
else
|
|
|
|
|
MAIN_TGT:=asterisk
|
|
|
|
|
endif
|
|
|
|
|
|
2008-03-17 22:10:06 +00:00
|
|
|
ifneq ($(findstring ENABLE_UPLOADS,$(MENUSELECT_CFLAGS)),)
|
|
|
|
|
GMIMELDFLAGS+=$(GMIME_LIB)
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
$(MAIN_TGT): $(OBJS) editline/libedit.a db1-ast/libdb1.a $(AST_EMBED_LDSCRIPTS)
|
2006-09-29 18:54:21 +00:00
|
|
|
@$(CC) -c -o buildinfo.o $(ASTCFLAGS) buildinfo.c
|
2006-08-21 02:11:39 +00:00
|
|
|
$(ECHO_PREFIX) echo " [LD] $^ -> $@"
|
2007-08-29 15:59:10 +00:00
|
|
|
ifneq ($(findstring chan_h323,$(MENUSELECT_CHANNELS)),)
|
2008-03-17 22:10:06 +00:00
|
|
|
$(CMD_PREFIX) $(CC) $(STATIC_BUILD) -o $@ $(ASTLINK) $(AST_EMBED_LDFLAGS) $(ASTLDFLAGS) $^ buildinfo.o $(AST_LIBS) $(AST_EMBED_LIBS) $(GMIMELDFLAGS)
|
2007-08-29 15:59:10 +00:00
|
|
|
else
|
2008-03-17 22:10:06 +00:00
|
|
|
$(CMD_PREFIX) $(CXX) $(STATIC_BUILD) -o $@ $(ASTLINK) $(AST_EMBED_LDFLAGS) $(ASTLDFLAGS) $(H323LDFLAGS) $^ buildinfo.o $(AST_LIBS) $(AST_EMBED_LIBS) $(H323LDLIBS) $(GMIMELDFLAGS)
|
2007-08-29 15:59:10 +00:00
|
|
|
endif
|
2008-02-28 00:11:31 +00:00
|
|
|
$(CMD_PREFIX) $(ASTTOPDIR)/build_tools/strip_nonapi $@ || rm $@
|
2006-08-21 02:11:39 +00:00
|
|
|
|
|
|
|
|
clean::
|
|
|
|
|
rm -f asterisk
|
2006-12-18 11:59:48 +00:00
|
|
|
rm -f db1-ast/.*.d
|
2007-02-07 20:09:58 +00:00
|
|
|
@if [ -f editline/Makefile ]; then $(MAKE) -C editline distclean ; fi
|
2006-08-21 02:11:39 +00:00
|
|
|
@$(MAKE) -C db1-ast clean
|
|
|
|
|
@$(MAKE) -C stdtime clean
|
2008-01-02 16:20:26 +00:00
|
|
|
rm -f libresample/src/*.o
|