Makefile.am 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  1. # Copyright (c) 2007-2014, Anthony Minessale II
  2. # All rights reserved.
  3. #
  4. # Redistribution and use in source and binary forms, with or without
  5. # modification, are permitted provided that the following conditions
  6. # are met:
  7. #
  8. # * Redistributions of source code must retain the above copyright
  9. # notice, this list of conditions and the following disclaimer.
  10. #
  11. # * Redistributions in binary form must reproduce the above copyright
  12. # notice, this list of conditions and the following disclaimer in the
  13. # documentation and/or other materials provided with the distribution.
  14. #
  15. # * Neither the name of the original author; nor the names of any contributors
  16. # may be used to endorse or promote products derived from this software
  17. # without specific prior written permission.
  18. #
  19. #
  20. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  21. # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  22. # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  23. # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
  24. # OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  25. # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  26. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  27. # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  28. # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  29. # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  30. # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  31. ACLOCAL_AMFLAGS = -I build
  32. AUTOMAKE_OPTIONS = foreign
  33. SRC = src
  34. moddir = @modinstdir@
  35. libdir = @libdir@
  36. library_includedir = $(prefix)/include
  37. INCS = -I$(FT_SRCDIR)/$(SRC)/include -I$(FT_SRCDIR)/$(SRC)/include/private
  38. # we needed to separate CFLAGS in FTDM_COMPAT_CFLAGS and FTDM_CFLAGS due to -c99 which causes problems with wanpipe headers
  39. FTDM_COMPAT_CFLAGS = $(INCS) -DFTDM_CONFIG_DIR=\"@confdir@\" -DFTDM_MOD_DIR=\"$(moddir)\" @COMP_VENDOR_COMPAT_CFLAGS@ @DEFS@
  40. FTDM_CFLAGS = $(INCS) -DFTDM_CONFIG_DIR=\"@confdir@\" -DFTDM_MOD_DIR=\"$(moddir)\" @COMP_VENDOR_CFLAGS@ @DEFS@
  41. COMPILE = $(CC) $(FTDM_CFLAGS)
  42. LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(COMPILE)
  43. LINK = $(LIBTOOL) --mode=link --tag=CC $(CC) $(FTDM_CFLAGS) $(LDFLAGS) -o $@
  44. #
  45. # GNU pkgconfig file
  46. #
  47. EXTRA_DIST = freetdm.pc.in
  48. pkgconfigdir = @pkgconfigdir@
  49. pkgconfig_DATA = freetdm.pc
  50. #
  51. # libfreetdm
  52. #
  53. libfreetdm_la_SOURCES = \
  54. $(SRC)/hashtable.c \
  55. $(SRC)/hashtable_itr.c \
  56. $(SRC)/ftdm_io.c \
  57. $(SRC)/ftdm_state.c \
  58. $(SRC)/ftdm_queue.c \
  59. $(SRC)/ftdm_sched.c \
  60. $(SRC)/ftdm_call_utils.c \
  61. $(SRC)/ftdm_variables.c \
  62. $(SRC)/ftdm_config.c \
  63. $(SRC)/ftdm_callerid.c \
  64. $(SRC)/fsk.c \
  65. $(SRC)/uart.c \
  66. $(SRC)/g711.c \
  67. $(SRC)/libteletone_detect.c \
  68. $(SRC)/libteletone_generate.c \
  69. $(SRC)/ftdm_buffer.c \
  70. $(SRC)/ftdm_threadmutex.c \
  71. $(SRC)/ftdm_dso.c \
  72. $(SRC)/ftdm_cpu_monitor.c \
  73. $(SRC)/ftdm_backtrace.c
  74. library_include_HEADERS = \
  75. $(SRC)/include/freetdm.h \
  76. $(SRC)/include/ftdm_declare.h \
  77. $(SRC)/include/ftdm_threadmutex.h \
  78. $(SRC)/include/ftdm_os.h \
  79. $(SRC)/include/ftdm_call_utils.h \
  80. $(SRC)/include/ftdm_dso.h
  81. lib_LTLIBRARIES = libfreetdm.la
  82. libfreetdm_la_CFLAGS = $(FTDM_CFLAGS) $(AM_CFLAGS)
  83. libfreetdm_la_LDFLAGS = -version-info 1:0:0 $(AM_LDFLAGS)
  84. libfreetdm_la_LIBADD = $(LIBS)
  85. core: libfreetdm.la
  86. core-install: install-libLTLIBRARIES
  87. #
  88. # tools & test programs
  89. #
  90. noinst_PROGRAMS = testtones detect_tones detect_dtmf testpri testr2 testanalog testapp testcid
  91. testapp_SOURCES = $(SRC)/testapp.c
  92. testapp_LDADD = libfreetdm.la
  93. testapp_CFLAGS = $(FTDM_CFLAGS) $(AM_CFLAGS)
  94. testcid_SOURCES = $(SRC)/testcid.c
  95. testcid_LDADD = libfreetdm.la
  96. testcid_CFLAGS = $(FTDM_CFLAGS) $(AM_CFLAGS)
  97. testtones_SOURCES = $(SRC)/testtones.c
  98. testtones_LDADD = libfreetdm.la
  99. testtones_CFLAGS = $(FTDM_CFLAGS) $(AM_CFLAGS)
  100. detect_tones_SOURCES = $(SRC)/detect_tones.c
  101. detect_tones_LDADD = libfreetdm.la
  102. detect_tones_CFLAGS = $(FTDM_CFLAGS) $(AM_CFLAGS)
  103. detect_dtmf_SOURCES = $(SRC)/detect_dtmf.c
  104. detect_dtmf_LDADD = libfreetdm.la
  105. detect_dtmf_CFLAGS = $(FTDM_CFLAGS) $(AM_CFLAGS)
  106. #testisdn_SOURCES = $(SRC)/testisdn.c
  107. #testisdn_LDADD = libfreetdm.la
  108. #testisdn_CFLAGS = $(FTDM_CFLAGS) $(AM_CFLAGS)
  109. testpri_SOURCES = $(SRC)/testpri.c
  110. testpri_LDADD = libfreetdm.la
  111. testpri_CFLAGS = $(FTDM_CFLAGS) $(AM_CFLAGS)
  112. testr2_SOURCES = $(SRC)/testr2.c
  113. testr2_LDADD = libfreetdm.la
  114. testr2_CFLAGS = $(FTDM_CFLAGS) $(AM_CFLAGS)
  115. testanalog_SOURCES = $(SRC)/testanalog.c
  116. testanalog_LDADD = libfreetdm.la
  117. testanalog_CFLAGS = $(FTDM_CFLAGS) $(AM_CFLAGS)
  118. #
  119. # ftmod modules
  120. #
  121. mod_LTLIBRARIES = ftmod_zt.la ftmod_skel.la ftmod_analog.la ftmod_analog_em.la
  122. ftmod_zt_la_SOURCES = $(SRC)/ftmod/ftmod_zt/ftmod_zt.c
  123. ftmod_zt_la_CFLAGS = $(FTDM_CFLAGS) $(AM_CFLAGS)
  124. ftmod_zt_la_LDFLAGS = -shared -module -avoid-version
  125. ftmod_zt_la_LIBADD = libfreetdm.la
  126. ftmod_skel_la_SOURCES = $(SRC)/ftmod/ftmod_skel/ftmod_skel.c
  127. ftmod_skel_la_CFLAGS = $(FTDM_CFLAGS) $(AM_CFLAGS)
  128. ftmod_skel_la_LDFLAGS = -shared -module -avoid-version
  129. ftmod_skel_la_LIBADD = libfreetdm.la
  130. ftmod_analog_la_SOURCES = $(SRC)/ftmod/ftmod_analog/ftmod_analog.c
  131. ftmod_analog_la_CFLAGS = $(FTDM_CFLAGS) $(AM_CFLAGS)
  132. ftmod_analog_la_LDFLAGS = -shared -module -avoid-version
  133. ftmod_analog_la_LIBADD = libfreetdm.la
  134. ftmod_analog_em_la_SOURCES = $(SRC)/ftmod/ftmod_analog_em/ftmod_analog_em.c
  135. ftmod_analog_em_la_CFLAGS = $(FTDM_CFLAGS) $(AM_CFLAGS)
  136. ftmod_analog_em_la_LDFLAGS = -shared -module -avoid-version
  137. ftmod_analog_em_la_LIBADD = libfreetdm.la
  138. if HAVE_LIBSANGOMA
  139. mod_LTLIBRARIES += ftmod_wanpipe.la
  140. ftmod_wanpipe_la_SOURCES = $(SRC)/ftmod/ftmod_wanpipe/ftmod_wanpipe.c
  141. # some structures within Wanpipe drivers are not c99 compatible, so we need to compile ftmod_wanpipe
  142. # without c99 flags, use FTDM_COMPAT_CFLAGS instead
  143. ftmod_wanpipe_la_CFLAGS = $(FTDM_COMPAT_CFLAGS) $(AM_CFLAGS) -D__LINUX__ -I/usr/include/wanpipe
  144. ftmod_wanpipe_la_LDFLAGS = -shared -module -avoid-version
  145. ftmod_wanpipe_la_LIBADD = libfreetdm.la -lsangoma
  146. endif
  147. if HAVE_LIBISDN
  148. mod_LTLIBRARIES += ftmod_isdn.la
  149. ftmod_isdn_la_SOURCES = $(SRC)/ftmod/ftmod_isdn/ftmod_isdn.c
  150. ftmod_isdn_la_CFLAGS = $(FTDM_CFLAGS) $(AM_CFLAGS) -D_GNU_SOURCE $(LIBISDN_CPPFLAGS) $(PCAP_CPPFLAGS)
  151. ftmod_isdn_la_LDFLAGS = -shared -module -avoid-version $(LIBISDN_LDFLAGS) $(PCAP_LDFLAGS)
  152. ftmod_isdn_la_LIBADD = libfreetdm.la $(LIBISDN_LIBS) $(PCAP_LIBS)
  153. endif
  154. if HAVE_LIBPRI
  155. mod_LTLIBRARIES += ftmod_libpri.la
  156. ftmod_libpri_la_SOURCES = $(SRC)/ftmod/ftmod_libpri/ftmod_libpri.c $(SRC)/ftmod/ftmod_libpri/lpwrap_pri.c
  157. ftmod_libpri_la_CFLAGS = $(FTDM_CFLAGS) $(AM_CFLAGS) $(LIBPRI_CPPFLAGS)
  158. ftmod_libpri_la_LDFLAGS = -shared -module -avoid-version $(LIBPRI_LDFLAGS)
  159. ftmod_libpri_la_LIBADD = libfreetdm.la $(LIBPRI_LIBS)
  160. endif
  161. if HAVE_PRITAP
  162. mod_LTLIBRARIES += ftmod_pritap.la
  163. ftmod_pritap_la_SOURCES = $(SRC)/ftmod/ftmod_pritap/ftmod_pritap.c
  164. ftmod_pritap_la_CFLAGS = $(FTDM_CFLAGS) $(AM_CFLAGS)
  165. ftmod_pritap_la_LDFLAGS = -shared -module -avoid-version
  166. ftmod_pritap_la_LIBADD = libfreetdm.la -lpri
  167. endif
  168. if HAVE_SNG_SS7
  169. mod_LTLIBRARIES += ftmod_sangoma_ss7.la
  170. ftmod_sangoma_ss7_la_SOURCES = \
  171. $(SRC)/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_support.c \
  172. $(SRC)/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_main.c \
  173. $(SRC)/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_handle.c \
  174. $(SRC)/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_in.c \
  175. $(SRC)/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_out.c \
  176. $(SRC)/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_cntrl.c \
  177. $(SRC)/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_xml.c \
  178. $(SRC)/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_timers.c \
  179. $(SRC)/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_cli.c \
  180. $(SRC)/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_cfg.c \
  181. $(SRC)/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_sta.c \
  182. $(SRC)/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_sts.c \
  183. $(SRC)/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_logger.c \
  184. $(SRC)/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_m2ua_xml.c \
  185. $(SRC)/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_m2ua.c \
  186. $(SRC)/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_relay.c
  187. ftmod_sangoma_ss7_la_CFLAGS = $(FTDM_CFLAGS) $(AM_CFLAGS) -D_GNU_SOURCE
  188. ftmod_sangoma_ss7_la_LDFLAGS = -shared -module -avoid-version
  189. ftmod_sangoma_ss7_la_LIBADD = libfreetdm.la -lsng_ss7
  190. endif
  191. if HAVE_SNG_ISDN
  192. mod_LTLIBRARIES += ftmod_sangoma_isdn.la
  193. ftmod_sangoma_isdn_la_SOURCES = \
  194. $(SRC)/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn.c \
  195. $(SRC)/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_cfg.c \
  196. $(SRC)/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_cntrl.c \
  197. $(SRC)/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_trace.c \
  198. $(SRC)/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_transfer.c \
  199. $(SRC)/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_support.c \
  200. $(SRC)/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_cntrl.c \
  201. $(SRC)/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_cfg.c \
  202. $(SRC)/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_rcv.c \
  203. $(SRC)/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_hndl.c \
  204. $(SRC)/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_out.c
  205. ftmod_sangoma_isdn_la_CFLAGS = $(FTDM_CFLAGS) $(AM_CFLAGS) -D_GNU_SOURCE
  206. ftmod_sangoma_isdn_la_LDFLAGS = -shared -module -avoid-version
  207. ftmod_sangoma_isdn_la_LIBADD = libfreetdm.la -lsng_isdn
  208. endif
  209. if HAVE_OPENR2
  210. mod_LTLIBRARIES += ftmod_r2.la
  211. ftmod_r2_la_SOURCES = $(SRC)/ftmod/ftmod_r2/ftmod_r2.c $(SRC)/ftmod/ftmod_r2/ftmod_r2_io_mf_lib.c
  212. ftmod_r2_la_CFLAGS = $(FTDM_CFLAGS) $(AM_CFLAGS)
  213. ftmod_r2_la_LDFLAGS = -shared -module -avoid-version
  214. ftmod_r2_la_LIBADD = libfreetdm.la -lopenr2
  215. endif
  216. if HAVE_WAT
  217. mod_LTLIBRARIES += ftmod_gsm.la
  218. ftmod_gsm_la_SOURCES = $(SRC)/ftmod/ftmod_gsm/ftmod_gsm.c
  219. ftmod_gsm_la_CFLAGS = $(FTDM_CFLAGS) $(AM_CFLAGS)
  220. ftmod_gsm_la_LDFLAGS = -shared -module -avoid-version
  221. ftmod_gsm_la_LIBADD = libfreetdm.la -lwat
  222. endif
  223. if HAVE_MISDN
  224. mod_LTLIBRARIES += ftmod_misdn.la
  225. ftmod_misdn_la_SOURCES = $(SRC)/ftmod/ftmod_misdn/ftmod_misdn.c
  226. ftmod_misdn_la_CFLAGS = $(FTDM_CFLAGS) $(AM_CFLAGS) $(MISDN_CFLAGS) -D_GNU_SOURCE
  227. ftmod_misdn_la_LDFLAGS = -shared -module -avoid-version
  228. ftmod_misdn_la_LIBADD = libfreetdm.la
  229. endif
  230. dox doxygen:
  231. doxygen $(FT_SRCDIR)/docs/Doxygen.conf
  232. mod_freetdm/mod_freetdm.so: libfreetdm.la mod_freetdm/mod_freetdm.c
  233. $(MAKE) -C mod_freetdm
  234. mod_freetdm: mod_freetdm/mod_freetdm.so
  235. mod_freetdm-install: mod_freetdm
  236. $(MAKE) -C mod_freetdm install
  237. mod_freetdm-clean:
  238. @if [ -f mod_freetdm/mod_freetdm.so ] ; then \
  239. $(MAKE) -C mod_freetdm clean ; \
  240. fi
  241. install-data-local:
  242. $(mkinstalldirs) $(DESTDIR)$(prefix)
  243. $(mkinstalldirs) $(DESTDIR)@confdir@
  244. @[ -f "$(DESTDIR)@confdir@/freetdm.conf" ] || ( cp conf/*.conf $(DESTDIR)@confdir@)
  245. @echo FreeTDM Installed