1#
2#    Copyright (C) 2002-2009  Thomas Ries <tries@gmx.net>
3#
4#    This file is part of Siproxd.
5#
6#    Siproxd is free software; you can redistribute it and/or modify
7#    it under the terms of the GNU General Public License as published by
8#    the Free Software Foundation; either version 2 of the License, or
9#    (at your option) any later version.
10#
11#    Siproxd is distributed in the hope that it will be useful,
12#    but WITHOUT ANY WARRANTY; without even the implied warranty of
13#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14#    GNU General Public License for more details.
15#
16#    You should have received a copy of the GNU General Public License
17#    along with Siproxd; if not, write to the Free Software
18#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19#
20
21
22if use_convenience_ltdl
23   LTDLDEF = -DLTDL_CONVLIB
24endif
25
26AM_CFLAGS = -D_GNU_SOURCE $(LTDLDEF) \
27            -DBUILDSTR="\"`cat .buildno`\""
28
29#
30# Plugin modules, installed in "pkglib" directory ($prefix/lib/siproxd/)
31#
32pkglib_LTLIBRARIES =	plugin_demo.la \
33			plugin_shortdial.la \
34			plugin_logcall.la \
35			plugin_defaulttarget.la \
36			plugin_fix_bogus_via.la \
37			plugin_fix_DTAG.la \
38			plugin_stun.la \
39			plugin_prefix.la \
40			plugin_regex.la \
41			plugin_codecfilter.la \
42			plugin_stripheader.la \
43			plugin_siptrunk.la \
44			plugin_fix_fbox_anoncall.la
45
46DLOPENPLUGINS = 	-dlopen plugin_demo.la \
47			-dlopen plugin_shortdial.la \
48			-dlopen plugin_logcall.la \
49			-dlopen plugin_defaulttarget.la \
50			-dlopen plugin_fix_bogus_via.la \
51			-dlopen plugin_fix_DTAG.la \
52			-dlopen plugin_stun.la \
53			-dlopen plugin_prefix.la \
54			-dlopen plugin_regex.la \
55			-dlopen plugin_codecfilter.la \
56			-dlopen plugin_stripheader.la \
57			-dlopen plugin_siptrunk.la \
58			-dlopen plugin_fix_fbox_anoncall.la
59#
60plugin_demo_la_SOURCES = plugin_demo.c
61plugin_demo_la_LDFLAGS = -module -avoid-version -shrext '.so'
62#
63plugin_shortdial_la_SOURCES = plugin_shortdial.c
64plugin_shortdial_la_LDFLAGS = -module -avoid-version -shrext '.so'
65#
66plugin_logcall_la_SOURCES = plugin_logcall.c
67plugin_logcall_la_LDFLAGS = -module -avoid-version -shrext '.so'
68#
69plugin_defaulttarget_la_SOURCES = plugin_defaulttarget.c
70plugin_defaulttarget_la_LDFLAGS = -module -avoid-version -shrext '.so'
71#
72plugin_fix_bogus_via_la_SOURCES = plugin_fix_bogus_via.c
73plugin_fix_bogus_via_la_LDFLAGS = -module -avoid-version -shrext '.so'
74#
75plugin_fix_DTAG_la_SOURCES = plugin_fix_DTAG.c
76plugin_fix_DTAG_la_LDFLAGS = -module -avoid-version -shrext '.so'
77#
78plugin_stun_la_SOURCES = plugin_stun.c
79plugin_stun_la_LDFLAGS = -module -avoid-version -shrext '.so'
80#
81plugin_prefix_la_SOURCES = plugin_prefix.c
82plugin_prefix_la_LDFLAGS = -module -avoid-version -shrext '.so'
83#
84plugin_regex_la_SOURCES = plugin_regex.c
85plugin_regex_la_LDFLAGS = -module -avoid-version -shrext '.so'
86#
87plugin_codecfilter_la_SOURCES = plugin_codecfilter.c
88plugin_codecfilter_la_LDFLAGS = -module -avoid-version -shrext '.so'
89#
90plugin_stripheader_la_SOURCES = plugin_stripheader.c
91plugin_stripheader_la_LDFLAGS = -module -avoid-version -shrext '.so'
92#
93plugin_siptrunk_la_SOURCES = plugin_siptrunk.c
94plugin_siptrunk_la_LDFLAGS = -module -avoid-version -shrext '.so'
95#
96plugin_fix_fbox_anoncall_la_SOURCES = plugin_fix_fbox_anoncall.c
97plugin_fix_fbox_anoncall_la_LDFLAGS = -module -avoid-version -shrext '.so'
98
99
100#
101# Siproxd itself
102# (references DLOPENPLUGINS defined above - must be placed afterwards
103#  else Cygwin goes beserk when building...)
104#
105sbin_PROGRAMS = siproxd
106siproxd_LDFLAGS=-export-dynamic
107siproxd_LDADD = $(LIBLTDL) $(DLOPENPLUGINS)
108siproxd_SOURCES = siproxd.c proxy.c register.c sock.c utils.c \
109		  sip_utils.c sip_layer.c log.c readconf.c rtpproxy.c \
110		  rtpproxy_relay.c accessctl.c route_processing.c \
111		  security.c auth.c fwapi.c resolve.c \
112		  dejitter.c plugins.c redirect_cache.c
113
114
115#
116# an example for a custom firewall control module
117# that can be linked into siproxd (--with-custom-fwmodule)
118#
119noinst_LIBRARIES = libcustom_fw_module.a
120libcustom_fw_module_a_SOURCES = custom_fw_module.c
121
122
123noinst_HEADERS = log.h siproxd.h digcalc.h rtpproxy.h \
124		 fwapi.h plugins.h dejitter.h \
125		 redirect_cache.h
126
127EXTRA_DIST = .buildno
128
129#
130# count BUILDs - each time increment by one and define the
131# C macro BUILDNO. bind it to a file everybody includes (log.h)
132#
133log.h: increment_build
134
135increment_build:
136	@echo "incrementing BUILD number"
137	@if [ -f .buildno ]; then \
138	  bld=`cat .buildno`; \
139	  bld=`expr $${bld} + 1`; \
140	else \
141	  bld=1; \
142	fi; \
143	echo "$${bld}" >.buildno;
144