Makefile.am 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855
  1. EXTRA_DIST =
  2. SUBDIRS = . src build tests/unit
  3. AUTOMAKE_OPTIONS = foreign subdir-objects
  4. NAME = freeswitch
  5. if SYSTEM_APR
  6. AM_LIBAPR_CFLAGS := $(shell apr-1-config --cflags)
  7. AM_LIBAPR_CPPFLAGS := $(shell apr-1-config --cppflags --includes)
  8. AM_LIBAPR_LDFLAGS := $(shell apr-1-config --ldflags)
  9. AM_LIBAPR_LIBS := $(shell apr-1-config \--libs)
  10. AM_LIBAPR_LINKLIBTOOL := $(shell apr-1-config \--link-libtool)
  11. else
  12. AM_LIBAPR_CFLAGS := $(shell ./libs/apr/apr-1-config --cflags)
  13. AM_LIBAPR_CPPFLAGS := $(shell ./libs/apr/apr-1-config --cppflags --includes)
  14. AM_LIBAPR_LDFLAGS := $(shell ./libs/apr/apr-1-config --ldflags)
  15. AM_LIBAPR_LIBS := $(subst $(switch_builddir)/,,$(shell ./libs/apr/apr-1-config \--libs))
  16. endif
  17. if SYSTEM_APRUTIL
  18. AM_LIBAPU_CPPFLAGS := $(shell apu-1-config --includes)
  19. AM_LIBAPU_LDFLAGS := $(shell apu-1-config --ldflags)
  20. AM_LIBAPU_LIBS := $(shell apu-1-config \--libs)
  21. AM_LIBAPU_LINKLIBTOOL := $(shell apu-1-config \--link-libtool)
  22. else
  23. AM_LIBAPU_CPPFLAGS := $(shell ./libs/apr-util/apu-1-config --includes)
  24. AM_LIBAPU_LDFLAGS := $(shell ./libs/apr-util/apu-1-config --ldflags)
  25. AM_LIBAPU_LIBS := $(subst $(switch_builddir)/,,$(shell ./libs/apr-util/apu-1-config \--libs))
  26. endif
  27. AM_CFLAGS = $(SWITCH_AM_CFLAGS) $(SWITCH_ANSI_CFLAGS)
  28. AM_CPPFLAGS =
  29. AM_CPPFLAGS += -I$(switch_srcdir)/libs/libvpx
  30. AM_CPPFLAGS += $(SWITCH_AM_CXXFLAGS)
  31. AM_LDFLAGS = $(SWITCH_AM_LDFLAGS) $(AM_LIBAPR_LDFLAGS) $(AM_LIBAPU_LDFLAGS)
  32. DEFAULT_SOUNDS=en-us-callie-8000
  33. MY_DEFAULT_ARGS= --build=$(build) --host=$(host) --target=$(target) --prefix="$(prefix)" --exec_prefix="$(exec_prefix)" --libdir="$(libdir)"
  34. .INTERMEDIATE: -ldl -liconv -lpthread
  35. .DEFAULT: $(switch_builddir)/modules.conf src/mod/modules.inc
  36. @target=`echo $@ | sed -e 's|^.*-||'`; \
  37. target_prefix=`echo $@ | sed -e 's|-.*$$||'`; \
  38. sound_perfix=`echo $@ | sed -e 's|-.*||'`; \
  39. moh_version=`cat $(switch_srcdir)/build/moh_version.txt`;\
  40. full_sound_dir=`echo $@ | sed -e 's|^sounds||' | sed -e 's|^-||' | sed -e 's|-install$$||'`; \
  41. test ! -z $$full_sound_dir || full_sound_dir=`echo $(DEFAULT_SOUNDS)`; \
  42. base_sound_dir=`echo $$full_sound_dir | sed -e 's|-[^-]*000$$||' ` ;\
  43. sounds_version=`grep $$base_sound_dir $(switch_srcdir)/build/sounds_version.txt | cut -d ' ' -f2`;\
  44. soundfile=`echo freeswitch-sounds-$$full_sound_dir-$$moh_version.tar.gz`; \
  45. echo $$full_sound_dir | grep music >/dev/null || soundfile=`echo freeswitch-sounds-$$full_sound_dir-$$sounds_version.tar.gz`; \
  46. args="$@"; if test -z "$$args" || test "$${args#-l*}" = "$$args"; then \
  47. if test "$$target_prefix" = "sounds"; then \
  48. if test "$$target" = "install"; then \
  49. $(GETSOUNDS) $$soundfile $(DESTDIR)$(soundsdir)/;\
  50. else \
  51. $(GETSOUNDS) $$soundfile ; \
  52. fi; \
  53. else \
  54. if test "$$target" = "install"; then \
  55. $(MAKE) $(AM_MAKEFLAGS) core_install && cd src/mod && $(MAKE) $(AM_MAKEFLAGS) $@ ; \
  56. else \
  57. if test "$$target" = "clean"; then \
  58. cd src/mod && $(MAKE) $(AM_MAKEFLAGS) $@ ;\
  59. else \
  60. $(MAKE) $(AM_MAKEFLAGS) core && cd src/mod && $(MAKE) $(AM_MAKEFLAGS) $@ ;\
  61. fi; \
  62. fi; \
  63. fi; fi
  64. sounds: sounds-en-us-callie-8000
  65. sounds-install: sounds-en-us-callie-8000-install
  66. sounds-allison: sounds-en-us-allison-8000
  67. sounds-allison-install: sounds-en-us-allison-8000-install
  68. sounds-ru: sounds-ru-RU-elena-8000
  69. sounds-ru-install: sounds-ru-RU-elena-8000-install
  70. sounds-fr: sounds-fr-ca-june-8000
  71. sounds-fr-install: sounds-fr-ca-june-8000-install
  72. moh: sounds-music-8000
  73. moh-install: sounds-music-8000-install
  74. hd-sounds: sounds sounds-en-us-callie-16000
  75. hd-sounds-install: sounds-install sounds-en-us-callie-16000-install
  76. hd-sounds-allison: sounds-allison sounds-en-us-allison-16000
  77. hd-sounds-allison-install: sounds-allison-install sounds-en-us-allison-16000-install
  78. hd-sounds-ru: sounds-ru sounds-ru-RU-elena-16000
  79. hd-sounds-ru-install: sounds-ru-install sounds-ru-RU-elena-16000-install
  80. hd-sounds-fr: sounds-fr-ca-june-16000
  81. hd-sounds-fr-install: sounds-fr-ca-june-16000-install
  82. hd-moh: moh sounds-music-16000
  83. hd-moh-install: moh-install sounds-music-16000-install
  84. uhd-sounds: hd-sounds sounds-en-us-callie-32000
  85. uhd-sounds-install: hd-sounds-install sounds-en-us-callie-32000-install
  86. uhd-sounds-allison: hd-sounds-allison sounds-en-us-allison-32000
  87. uhd-sounds-allison-install: hd-sounds-allison-install sounds-en-us-allison-32000-install
  88. uhd-sounds-ru: hd-sounds-ru sounds-ru-RU-elena-32000
  89. uhd-sounds-ru-install: hd-sounds-ru-install sounds-ru-RU-elena-32000-install
  90. uhd-sounds-fr: sounds-fr-ca-june-32000
  91. uhd-sounds-fr-install: sounds-fr-ca-june-32000-install
  92. uhd-moh: hd-moh sounds-music-32000
  93. uhd-moh-install: hd-moh-install sounds-music-32000-install
  94. cd-sounds: uhd-sounds sounds-en-us-callie-48000
  95. cd-sounds-install: uhd-sounds-install sounds-en-us-callie-48000-install
  96. cd-sounds-allison: uhd-sounds-allison sounds-en-us-allison-48000
  97. cd-sounds-allison-install: uhd-sounds-allison-install sounds-en-us-allison-48000-install
  98. cd-sounds-ru: uhd-sounds-ru sounds-ru-RU-elena-48000
  99. cd-sounds-ru-install: uhd-sounds-ru-install sounds-ru-RU-elena-48000-install
  100. cd-sounds-fr: sounds-fr-ca-june-48000
  101. cd-sounds-fr-install: sounds-fr-ca-june-48000-install
  102. cd-moh: uhd-moh sounds-music-48000
  103. cd-moh-install: uhd-moh-install sounds-music-48000-install
  104. # This directory's subdirectories are mostly independent; you can cd
  105. # into them and run `make' without going through this Makefile.
  106. # To change the values of `make' variables: instead of editing Makefiles,
  107. # (1) if the variable is set in `config.status', edit `config.status'
  108. # (which will cause the Makefiles to be regenerated when you run `make');
  109. # (2) otherwise, pass the desired values on the `make' command line.
  110. all-recursive: libfreeswitch.la
  111. clean-recusive: clean_core
  112. install-recursive: install-libLTLIBRARIES install-binPROGRAMS
  113. CORE_CFLAGS = $(AM_LIBAPR_CFLAGS) $(AM_LIBAPR_CPPFLAGS)
  114. CORE_CFLAGS += $(AM_LIBAPU_CPPFLAGS)
  115. CORE_CFLAGS += -I$(switch_srcdir)/libs/srtp/include
  116. if ENABLE_LIBYUV
  117. CORE_CFLAGS += -I$(switch_srcdir)/libs/libyuv/include
  118. CORE_CFLAGS += -DSWITCH_HAVE_YUV
  119. endif
  120. CORE_CFLAGS += -I$(switch_srcdir)/libs/srtp/crypto/include -Ilibs/srtp/crypto/include
  121. CORE_CFLAGS += $(SPANDSP_CFLAGS)
  122. if ENABLE_LIBVPX
  123. CORE_CFLAGS += -DSWITCH_HAVE_VPX
  124. endif
  125. APR_LIBS = $(AM_LIBAPU_LIBS) $(AM_LIBAPR_LIBS)
  126. CORE_LIBS=
  127. if ENABLE_LIBVPX
  128. CORE_LIBS += libs/libvpx/libvpx.a
  129. endif
  130. if SYSTEM_APRUTIL
  131. CORE_LIBS += $(AM_LIBAPU_LINKLIBTOOL)
  132. else
  133. CORE_LIBS += libs/apr-util/libaprutil-1.la
  134. endif
  135. if SYSTEM_APR
  136. CORE_LIBS += $(AM_LIBAPR_LINKLIBTOOL)
  137. else
  138. CORE_LIBS += libs/apr/libapr-1.la
  139. endif
  140. if ENABLE_SRTP
  141. CORE_CFLAGS += -DENABLE_SRTP
  142. CORE_LIBS += libs/srtp/libsrtp.la
  143. endif
  144. MOD_LINK = $(switch_srcdir)/libfreeswitch.la
  145. CLEANFILES = src/include/switch_version.h src/include/switch_swigable_cpp.h
  146. BUILT_SOURCES = src/mod/modules.inc src/include/switch_version.h src/include/switch_swigable_cpp.h
  147. if HAVE_ODBC
  148. CORE_CFLAGS += -DSWITCH_HAVE_ODBC $(ODBC_INC_FLAGS)
  149. endif
  150. if HAVE_PNG
  151. CORE_CFLAGS += -DSWITCH_HAVE_PNG $(LIBPNG_CFLAGS)
  152. endif
  153. if HAVE_FREETYPE
  154. CORE_CFLAGS += -DSWITCH_HAVE_FREETYPE $(LIBFREETYPE_CFLAGS)
  155. endif
  156. if HAVE_GUMBO
  157. CORE_CFLAGS += -DSWITCH_HAVE_GUMBO $(LIBGUMBO_CFLAGS)
  158. endif
  159. if HAVE_FVAD
  160. CORE_CFLAGS += -DSWITCH_HAVE_FVAD $(LIBFVAD_CFLAGS)
  161. endif
  162. ##
  163. ## libfreeswitch
  164. ##
  165. noinst_LTLIBRARIES =
  166. if ENABLE_LIBYUV
  167. noinst_LTLIBRARIES += libfreeswitch_libyuv.la
  168. endif
  169. if ENABLE_LIBYUV
  170. libfreeswitch_libyuv_la_SOURCES = \
  171. libs/libyuv/source/compare.cc \
  172. libs/libyuv/source/compare_common.cc \
  173. libs/libyuv/source/compare_gcc.cc \
  174. libs/libyuv/source/compare_mmi.cc \
  175. libs/libyuv/source/compare_msa.cc \
  176. libs/libyuv/source/compare_neon64.cc \
  177. libs/libyuv/source/compare_neon.cc \
  178. libs/libyuv/source/compare_win.cc \
  179. libs/libyuv/source/convert_argb.cc \
  180. libs/libyuv/source/convert.cc \
  181. libs/libyuv/source/convert_from_argb.cc \
  182. libs/libyuv/source/convert_from.cc \
  183. libs/libyuv/source/convert_jpeg.cc \
  184. libs/libyuv/source/convert_to_argb.cc \
  185. libs/libyuv/source/convert_to_i420.cc \
  186. libs/libyuv/source/cpu_id.cc \
  187. libs/libyuv/source/mjpeg_decoder.cc \
  188. libs/libyuv/source/mjpeg_validate.cc \
  189. libs/libyuv/source/planar_functions.cc \
  190. libs/libyuv/source/rotate_any.cc \
  191. libs/libyuv/source/rotate_argb.cc \
  192. libs/libyuv/source/rotate.cc \
  193. libs/libyuv/source/rotate_common.cc \
  194. libs/libyuv/source/rotate_gcc.cc \
  195. libs/libyuv/source/rotate_mmi.cc \
  196. libs/libyuv/source/rotate_msa.cc \
  197. libs/libyuv/source/rotate_neon64.cc \
  198. libs/libyuv/source/rotate_neon.cc \
  199. libs/libyuv/source/rotate_win.cc \
  200. libs/libyuv/source/row_any.cc \
  201. libs/libyuv/source/row_common.cc \
  202. libs/libyuv/source/row_gcc.cc \
  203. libs/libyuv/source/row_mmi.cc \
  204. libs/libyuv/source/row_msa.cc \
  205. libs/libyuv/source/row_neon64.cc \
  206. libs/libyuv/source/row_neon.cc \
  207. libs/libyuv/source/row_win.cc \
  208. libs/libyuv/source/scale_any.cc \
  209. libs/libyuv/source/scale_argb.cc \
  210. libs/libyuv/source/scale.cc \
  211. libs/libyuv/source/scale_common.cc \
  212. libs/libyuv/source/scale_gcc.cc \
  213. libs/libyuv/source/scale_mmi.cc \
  214. libs/libyuv/source/scale_msa.cc \
  215. libs/libyuv/source/scale_neon64.cc \
  216. libs/libyuv/source/scale_neon.cc \
  217. libs/libyuv/source/scale_win.cc \
  218. libs/libyuv/source/video_common.cc
  219. libfreeswitch_libyuv_la_CPPFLAGS = -O2 -fomit-frame-pointer -Ilibs/libyuv/include
  220. CORE_LIBS+=libfreeswitch_libyuv.la
  221. endif
  222. lib_LTLIBRARIES = libfreeswitch.la
  223. libfreeswitch_la_CFLAGS = $(CORE_CFLAGS) $(SQLITE_CFLAGS) $(GUMBO_CFLAGS) $(FVAD_CFLAGS) $(FREETYPE_CFLAGS) $(CURL_CFLAGS) $(PCRE_CFLAGS) $(SPEEX_CFLAGS) $(LIBEDIT_CFLAGS) $(openssl_CFLAGS) $(SOFIA_SIP_CFLAGS) $(AM_CFLAGS) $(TPL_CFLAGS)
  224. libfreeswitch_la_LDFLAGS = -version-info 1:0:0 $(AM_LDFLAGS) $(PLATFORM_CORE_LDFLAGS) -no-undefined
  225. libfreeswitch_la_LIBADD = $(CORE_LIBS) $(APR_LIBS) $(SQLITE_LIBS) $(GUMBO_LIBS) $(FVAD_LIBS) $(FREETYPE_LIBS) $(CURL_LIBS) $(PCRE_LIBS) $(SPEEX_LIBS) $(LIBEDIT_LIBS) $(openssl_LIBS) $(PLATFORM_CORE_LIBS) $(TPL_LIBS) $(SPANDSP_LIBS) $(SOFIA_SIP_LIBS)
  226. libfreeswitch_la_DEPENDENCIES = $(BUILT_SOURCES)
  227. if HAVE_PNG
  228. libfreeswitch_la_LIBADD += $(LIBPNG_LIBS)
  229. endif
  230. if HAVE_ODBC
  231. libfreeswitch_la_LDFLAGS += $(ODBC_LIB_FLAGS)
  232. endif
  233. if ENABLE_ZRTP
  234. CORE_CFLAGS += -I$(switch_srcdir)/libs/libzrtp/third_party/bgaes
  235. CORE_CFLAGS += -I$(switch_srcdir)/libs/libzrtp/third_party/bnlib
  236. CORE_CFLAGS += -isystem $(switch_srcdir)/libs/libzrtp/include
  237. ZRTP_LDFLAGS = -L$(switch_srcdir)/libs/libzrtp/third_party/bnlib
  238. ZRTP_LDFLAGS += -L$(switch_srcdir)/libs/libzrtp
  239. ZRTP_LIBS = -lbn -lzrtp
  240. libfreeswitch_la_LDFLAGS += $(ZRTP_LDFLAGS)
  241. libfreeswitch_la_LIBADD += $(ZRTP_LIBS)
  242. CORE_LIBS += libs/libzrtp/libzrtp.a
  243. LIBS += libs/libzrtp/third_party/bnlib/libbn.a
  244. endif
  245. library_includetestdir = $(includedir)/test
  246. library_includetest_HEADERS = \
  247. src/include/test/switch_fct.h \
  248. src/include/test/switch_test.h
  249. library_includedir = $(includedir)
  250. library_include_HEADERS = \
  251. src/include/switch_am_config.h \
  252. src/include/switch.h \
  253. src/include/switch_apr.h \
  254. src/include/switch_buffer.h \
  255. src/include/switch_caller.h \
  256. src/include/switch_channel.h \
  257. src/include/switch_console.h \
  258. src/include/switch_core_event_hook.h \
  259. src/include/switch_scheduler.h \
  260. src/include/switch_core.h \
  261. src/include/switch_core_media.h \
  262. src/include/switch_core_video.h \
  263. src/include/switch_core_db.h \
  264. src/include/switch_mprintf.h \
  265. src/include/switch_config.h \
  266. src/include/switch_event.h \
  267. src/include/switch_frame.h \
  268. src/include/switch_ivr.h \
  269. src/include/switch_dso.h \
  270. src/include/switch_loadable_module.h \
  271. src/include/switch_module_interfaces.h \
  272. src/include/switch_platform.h \
  273. src/include/switch_resample.h \
  274. src/include/switch_regex.h \
  275. src/include/switch_types.h \
  276. src/include/switch_utils.h \
  277. src/include/switch_rtp.h \
  278. src/include/switch_jitterbuffer.h \
  279. src/include/switch_estimators.h \
  280. src/include/switch_rtcp_frame.h \
  281. src/include/switch_stun.h \
  282. src/include/switch_nat.h \
  283. src/include/switch_log.h \
  284. src/include/switch_xml.h \
  285. src/include/switch_xml_config.h \
  286. src/include/switch_cpp.h \
  287. src/include/switch_curl.h \
  288. src/include/switch_cJSON.h \
  289. src/include/switch_cJSON_Utils.h \
  290. src/include/switch_json.h \
  291. src/include/switch_utf8.h \
  292. src/include/switch_msrp.h \
  293. src/include/switch_vpx.h \
  294. src/include/switch_vad.h \
  295. libs/libteletone/src/libteletone_detect.h \
  296. libs/libteletone/src/libteletone_generate.h \
  297. libs/libteletone/src/libteletone.h \
  298. src/include/switch_limit.h \
  299. src/include/switch_odbc.h \
  300. src/include/switch_hashtable.h \
  301. src/include/switch_image.h
  302. nodist_libfreeswitch_la_SOURCES = \
  303. src/include/switch_frame.h \
  304. src/include/switch_swigable_cpp.h \
  305. src/include/switch_version.h
  306. libfreeswitch_la_SOURCES = \
  307. src/switch_apr.c \
  308. src/switch_buffer.c \
  309. src/switch_caller.c \
  310. src/switch_channel.c \
  311. src/switch_console.c \
  312. src/switch_mprintf.c \
  313. src/switch_core_media_bug.c \
  314. src/switch_core_timer.c \
  315. src/switch_core_asr.c \
  316. src/switch_core_event_hook.c \
  317. src/switch_core_speech.c \
  318. src/switch_core_memory.c \
  319. src/switch_core_codec.c \
  320. src/switch_core_file.c \
  321. src/switch_core_cert.c \
  322. src/switch_core_hash.c \
  323. src/switch_core_sqldb.c \
  324. src/switch_core_session.c \
  325. src/switch_core_directory.c \
  326. src/switch_core_state_machine.c \
  327. src/switch_core_io.c \
  328. src/switch_core_rwlock.c \
  329. src/switch_core_port_allocator.c \
  330. src/switch_core.c \
  331. src/switch_version.c \
  332. src/switch_core_media.c \
  333. src/switch_core_video.c \
  334. src/switch_sdp.c \
  335. src/switch_scheduler.c \
  336. src/switch_core_db.c \
  337. src/switch_dso.c \
  338. src/switch_loadable_module.c \
  339. src/switch_utils.c \
  340. src/switch_event.c \
  341. src/switch_resample.c \
  342. src/switch_regex.c \
  343. src/switch_rtp.c \
  344. src/switch_jitterbuffer.c \
  345. src/switch_estimators.c \
  346. src/switch_ivr_bridge.c \
  347. src/switch_ivr_originate.c \
  348. src/switch_ivr_async.c \
  349. src/switch_ivr_play_say.c \
  350. src/switch_ivr_say.c \
  351. src/switch_ivr_menu.c \
  352. src/switch_ivr.c \
  353. src/switch_stun.c \
  354. src/switch_nat.c \
  355. src/switch_log.c \
  356. src/switch_xml.c \
  357. src/switch_xml_config.c \
  358. src/switch_config.c \
  359. src/switch_time.c \
  360. src/switch_odbc.c \
  361. src/switch_limit.c \
  362. src/g711.c \
  363. src/switch_pcm.c \
  364. src/switch_speex.c \
  365. src/switch_profile.c \
  366. src/cJSON.c \
  367. src/cJSON_Utils.c \
  368. src/switch_json.c \
  369. src/switch_curl.c \
  370. src/switch_hashtable.c\
  371. src/switch_utf8.c \
  372. src/switch_msrp.c \
  373. src/switch_vad.c \
  374. src/switch_vpx.c \
  375. libs/libteletone/src/libteletone_detect.c \
  376. libs/libteletone/src/libteletone_generate.c \
  377. libs/miniupnpc/miniwget.c \
  378. libs/miniupnpc/minixml.c \
  379. libs/miniupnpc/igd_desc_parse.c \
  380. libs/miniupnpc/minisoap.c \
  381. libs/miniupnpc/miniupnpc.c \
  382. libs/miniupnpc/upnpreplyparse.c \
  383. libs/miniupnpc/upnpcommands.c \
  384. libs/miniupnpc/minissdpc.c \
  385. libs/miniupnpc/upnperrors.c \
  386. libs/libnatpmp/natpmp.c \
  387. libs/libnatpmp/getgateway.c
  388. if ENABLE_CPP
  389. libfreeswitch_la_SOURCES += src/switch_cpp.cpp
  390. endif
  391. $(libfreeswitch_la_SOURCES): $(CORE_LIBS) $(switch_builddir)/modules.conf
  392. src/include/switch_swigable_cpp.h: $(switch_srcdir)/src/include/switch_cpp.h
  393. cat $(switch_srcdir)/src/include/switch_cpp.h | perl $(switch_srcdir)/build/strip.pl > $(switch_srcdir)/src/include/switch_swigable_cpp.h
  394. # $(CC) -E $(switch_srcdir)/src/include/switch_cpp.h \
  395. # -I$(switch_srcdir)/src/include -I$(switch_srcdir)/libs/libteletone/src \
  396. # -DSWITCH_DECLARE_CLASS= -DSWITCH_DECLARE\(x\)=x -DSWITCH_DECLARE_CONSTRUCTOR= \
  397. # -DSWITCH_DECLARE_NONSTD\(x\)=x 2>/dev/null | grep -v "^#" > src/include/switch_swigable_cpp.h
  398. ##
  399. ## Applications
  400. ##
  401. bin_PROGRAMS = freeswitch fs_cli fs_ivrd tone2wav fs_encode fs_tts
  402. ##
  403. ## fs_cli ()
  404. ##
  405. fs_cli_SOURCES = libs/esl/src/esl.c libs/esl/src/esl_config.c libs/esl/src/esl_event.c \
  406. libs/esl/src/esl_threadmutex.c libs/esl/fs_cli.c libs/esl/src/esl_json.c libs/esl/src/esl_buffer.c libs/esl/src/cJSON.c libs/esl/src/cJSON_Utils.c
  407. fs_cli_CFLAGS = $(AM_CFLAGS) -I$(switch_srcdir)/libs/esl/src/include $(LIBEDIT_CFLAGS)
  408. fs_cli_LDFLAGS = $(AM_LDFLAGS) -lpthread $(ESL_LDFLAGS) -lm $(LIBEDIT_LIBS)
  409. if DISABLE_CC
  410. fs_cli_CFLAGS += -DDISABLE_CC
  411. endif
  412. ##
  413. ## fs_encode ()
  414. ##
  415. fs_encode_SOURCES = src/fs_encode.c
  416. fs_encode_CFLAGS = $(AM_CFLAGS)
  417. fs_encode_LDFLAGS = $(AM_LDFLAGS)
  418. fs_encode_LDADD = libfreeswitch.la $(CORE_LIBS) $(APR_LIBS)
  419. if HAVE_ODBC
  420. fs_encode_LDADD += $(ODBC_LIB_FLAGS)
  421. endif
  422. ##
  423. ## fs_tts ()
  424. ##
  425. fs_tts_SOURCES = src/fs_tts.c
  426. fs_tts_CFLAGS = $(AM_CFLAGS)
  427. fs_tts_LDFLAGS = $(AM_LDFLAGS)
  428. fs_tts_LDADD = libfreeswitch.la $(CORE_LIBS) $(APR_LIBS)
  429. ##
  430. ## tone2wav ()
  431. ##
  432. tone2wav_SOURCES = src/tone2wav.c
  433. tone2wav_CFLAGS = $(AM_CFLAGS)
  434. tone2wav_LDFLAGS = $(AM_LDFLAGS)
  435. tone2wav_LDADD = libfreeswitch.la $(CORE_LIBS) $(APR_LIBS)
  436. if HAVE_ODBC
  437. tone2wav_LDADD += $(ODBC_LIB_FLAGS)
  438. endif
  439. ##
  440. ## fs_ivrd ()
  441. ##
  442. fs_ivrd_SOURCES = libs/esl/src/esl.c libs/esl/src/esl_config.c libs/esl/src/esl_event.c \
  443. libs/esl/src/esl_threadmutex.c libs/esl/ivrd.c libs/esl/src/esl_json.c libs/esl/src/esl_buffer.c libs/esl/src/cJSON.c libs/esl/src/cJSON_Utils.c
  444. fs_ivrd_CFLAGS = $(AM_CFLAGS) -I$(switch_srcdir)/libs/esl/src/include
  445. fs_ivrd_LDFLAGS = $(AM_LDFLAGS) -lpthread $(ESL_LDFLAGS) -lm
  446. ##
  447. ## freeswitch ()
  448. ##
  449. nodist_freeswitch_SOURCES = src/include/switch_version.h
  450. freeswitch_SOURCES = src/switch.c
  451. freeswitch_CFLAGS = $(AM_CFLAGS) $(CORE_CFLAGS)
  452. freeswitch_LDFLAGS = $(AM_LDFLAGS) -lpthread -rpath $(libdir)
  453. freeswitch_LDADD = libfreeswitch.la libs/apr/libapr-1.la
  454. if HAVE_ODBC
  455. freeswitch_LDADD += $(ODBC_LIB_FLAGS)
  456. endif
  457. ##
  458. ## Scripts
  459. ##
  460. bin_SCRIPTS = scripts/gentls_cert scripts/fsxs
  461. scripts/fsxs: scripts/fsxs.in
  462. @echo creating fsxs
  463. @sed -e "s,@MODULES_DIR\@,@modulesdir@," \
  464. -e "s,@LIB_DIR\@,@libdir@," \
  465. -e "s,@BIN_DIR\@,@bindir@," \
  466. -e "s,@INC_DIR\@,@includedir@," \
  467. -e "s,@CFG_DIR\@,@confdir@," \
  468. -e "s,@DB_DIR\@,@dbdir@," \
  469. -e "s,@PREFIX\@,@prefix@," \
  470. -e "s,@CC\@,$(CC)," \
  471. -e "s,@LD\@,$(CC)," \
  472. -e "s,@INSTALL\@,$(INSTALL)," \
  473. -e "s,@MKINSTALLDIRS\@,$(mkdir_p)," \
  474. \
  475. -e "s|@CFLAGS\@|$(CFLAGS) `./libs/apr/apr-1-config --cflags --cppflags`|" \
  476. -e "s|@INCLUDES\@|-I$(prefix)/include|" \
  477. -e "s|@SOLINK\@|$(SOLINK)|" \
  478. -e "s|@LDFLAGS\@|-L$(prefix)/lib|" \
  479. -e "s|@LIBS\@||" \
  480. $(top_srcdir)/scripts/fsxs.in > scripts/fsxs
  481. ##
  482. ## misc
  483. ##
  484. pkgconfigdir = @pkgconfigdir@
  485. pkgconfig_DATA = build/freeswitch.pc
  486. $(switch_builddir)/modules.conf:
  487. if test -f $@; then touch $@; else cp $(switch_srcdir)/build/modules.conf.in $@ ;fi
  488. src/mod/modules.inc: $(switch_builddir)/modules.conf
  489. @echo "OUR_MODULES=$(OUR_MODS)" > $(switch_builddir)/src/mod/modules.inc
  490. @echo "OUR_CLEAN_MODULES=$(OUR_CLEAN_MODS)" >> $(switch_builddir)/src/mod/modules.inc
  491. @echo "OUR_TEST_MODULES=$(OUR_TEST_MODS)" >> $(switch_builddir)/src/mod/modules.inc
  492. @echo "OUR_CHECK_MODULES=$(OUR_CHECK_MODS)" >> $(switch_builddir)/src/mod/modules.inc
  493. @echo "OUR_INSTALL_MODULES=$(OUR_INSTALL_MODS)" >> $(switch_builddir)/src/mod/modules.inc
  494. @echo "OUR_UNINSTALL_MODULES=$(OUR_UNINSTALL_MODS)" >> $(switch_builddir)/src/mod/modules.inc
  495. @echo "OUR_DISABLED_MODULES=$(OUR_DISABLED_MODS)" >> $(switch_builddir)/src/mod/modules.inc
  496. @echo "OUR_DISABLED_CLEAN_MODULES=$(OUR_DISABLED_CLEAN_MODS)" >> $(switch_builddir)/src/mod/modules.inc
  497. @echo "OUR_DISABLED_INSTALL_MODULES=$(OUR_DISABLED_INSTALL_MODS)" >> $(switch_builddir)/src/mod/modules.inc
  498. @echo "OUR_DISABLED_UNINSTALL_MODULES=$(OUR_DISABLED_UNINSTALL_MODS)" >> $(switch_builddir)/src/mod/modules.inc
  499. $(OUR_MODULES): $(switch_builddir)/modules.conf libfreeswitch.la src/mod/modules.inc
  500. @set fnord $$MAKEFLAGS; amf=$$2; \
  501. (cd src/mod && $(MAKE) $(AM_MAKEFLAGS) $@) \
  502. || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
  503. test -z "$$fail"
  504. $(switch_builddir)/build/print_git_revision: $(switch_srcdir)/build/print_git_revision.c
  505. $(CC_FOR_BUILD) -o $@ $<
  506. src/switch_version.lo: src/include/switch_version.h
  507. src/include/switch_version.h: src/include/switch_version.h.in Makefile $(switch_builddir)/build/print_git_revision $(libfreeswitch_la_SOURCES) $(library_include_HEADERS)
  508. @cat $< > $@; \
  509. if [ -d $(switch_srcdir)/.git ] && [ -n "$$(which git)" ]; then \
  510. xver="$$(cd $(switch_srcdir)/ && $(switch_builddir)/build/print_git_revision)"; \
  511. xhver="$$(cd $(switch_srcdir)/ && $(switch_builddir)/build/print_git_revision -h)"; \
  512. sed \
  513. -e "/#define *SWITCH_VERSION_REVISION[^a-zA-Z0-9_]/{s/\"\([^\"]*\)\"/\"\1$$xver\"/;}" \
  514. -e "/#define *SWITCH_VERSION_REVISION_HUMAN[^a-zA-Z0-9_]/{s/\"\([^\"]*\)\"/\"\1$$xhver\"/;}" \
  515. $< > $@; \
  516. fi;
  517. ##
  518. ## Dependency targets
  519. ##
  520. libs/libedit/src/.libs/libedit.a:
  521. cd libs/libedit && $(MAKE)
  522. libs/libzrtp/libzrtp.a:
  523. cd libs/libzrtp && $(MAKE)
  524. libs/libvpx/Makefile: libs/libvpx/.update
  525. cd libs/libvpx && CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS) $(VISIBILITY_FLAG)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" ./configure --enable-pic --disable-docs --disable-examples --disable-install-bins --disable-install-srcs --disable-unit-tests --size-limit=16384x16384
  526. libs/libvpx/libvpx.a: libs/libvpx/Makefile libs/libvpx/.update
  527. @cd libs/libvpx && $(MAKE)
  528. libs/apr/Makefile: libs/apr/Makefile.in libs/apr/config.status libs/apr libs/apr/.update
  529. @cd libs/apr && ./config.status
  530. @$(TOUCH_TARGET)
  531. libs/apr/libapr-1.la: libs/apr/Makefile libs/apr/.update
  532. @if [ $(MAKELEVEL) = 0 -o -z "`echo "$(MAKEARGS)" | grep "j"`" ] ; then touch $(switch_srcdir)/src/include/switch.h; cd libs/apr && $(MAKE) $(MFLAGS) && touch libapr-1.la; fi
  533. libs/apr-util/libaprutil-1.la: libs/apr/libapr-1.la libs/apr-util libs/apr-util/.update
  534. @if [ $(MAKELEVEL) = 0 -o -z "`echo "$(MAKEARGS)" | grep "j"`" ] ; then touch $(switch_srcdir)/src/include/switch.h; cd libs/apr-util && $(MAKE) $(MFLAGS) && touch libaprutil-1.la; fi
  535. SRTP_SRC = libs/srtp/srtp/srtp.c libs/srtp/srtp/ekt.c libs/srtp/crypto/cipher/cipher.c libs/srtp/crypto/cipher/null_cipher.c \
  536. libs/srtp/crypto/cipher/aes.c libs/srtp/crypto/cipher/aes_icm.c \
  537. libs/srtp/crypto/hash/null_auth.c libs/srtp/crypto/hash/sha1.c \
  538. libs/srtp/crypto/hash/hmac.c libs/srtp/crypto/hash/auth.c \
  539. libs/srtp/crypto/math/datatypes.c libs/srtp/crypto/math/stat.c \
  540. libs/srtp/crypto/kernel/crypto_kernel.c libs/srtp/crypto/kernel/alloc.c \
  541. libs/srtp/crypto/kernel/key.c libs/srtp/crypto/kernel/err.c \
  542. libs/srtp/crypto/replay/rdb.c libs/srtp/crypto/replay/rdbx.c libs/srtp/crypto/replay/ut_sim.c
  543. libs/srtp/libsrtp.la: libs/srtp libs/srtp/.update $(SRTP_SRC)
  544. touch $(switch_srcdir)/src/include/switch.h
  545. @cd libs/srtp && $(MAKE)
  546. @$(TOUCH_TARGET)
  547. ##
  548. ## helper targets
  549. ##
  550. yaml-files:
  551. @echo `mkdir $(DESTDIR)$(confdir)/yaml 2>/dev/null`
  552. $(INSTALL) -m 644 $(switch_srcdir)/conf/default/yaml/*.yaml $(DESTDIR)$(confdir)/yaml
  553. vm-sync:
  554. test -d $(DESTDIR)$(confdir) || $(mkinstalldirs) $(DESTDIR)$(confdir)
  555. test -d $(DESTDIR)$(confdir)/lang || $(mkinstalldirs) $(DESTDIR)$(confdir)/lang
  556. test -d $(DESTDIR)$(confdir)/lang/en || $(mkinstalldirs) $(DESTDIR)$(confdir)/lang/en
  557. test -d $(DESTDIR)$(confdir)/lang/en/demo || $(mkinstalldirs) $(DESTDIR)$(confdir)/lang/en/demo
  558. test -d $(DESTDIR)$(confdir)/lang/en/vm || $(mkinstalldirs) $(DESTDIR)$(confdir)/lang/en/vm
  559. $(INSTALL) -m 644 $(switch_srcdir)/conf/vanilla/lang/en/vm/* $(DESTDIR)$(confdir)/lang/en/vm
  560. $(INSTALL) -m 644 $(switch_srcdir)/conf/vanilla/lang/en/demo/* $(DESTDIR)$(confdir)/lang/en/demo
  561. config-%:
  562. test -d $(DESTDIR)$(confdir) || $(mkinstalldirs) $(DESTDIR)$(confdir)
  563. for conffile in `cd $(switch_srcdir)/conf/$* && find . -name \*.xml && find . -name \*.conf && find . -name \*.tpl && find . -name \*.ttml && find . -name mime.types` ; do \
  564. dir=`echo $$conffile | sed -e 's|^\.||' | sed -e 's|/[^/]*$$||'`; \
  565. filename=`echo $$conffile | sed -e 's|^\.||' | sed -e 's|^.*/||'`; \
  566. test -d $(DESTDIR)$(confdir)$$dir || $(mkinstalldirs) $(DESTDIR)$(confdir)$$dir ; \
  567. test -f $(DESTDIR)$(confdir)$$dir/$$filename || \
  568. test -f $(DESTDIR)$(confdir)$$dir/$$filename.noload || \
  569. $(INSTALL) -m 644 $(switch_srcdir)/conf/$*/$$dir/$$filename $(DESTDIR)$(confdir)$$dir; \
  570. done
  571. samples-conf: config-vanilla
  572. samples-htdocs:
  573. test -d $(DESTDIR)$(htdocsdir) || $(mkinstalldirs) $(DESTDIR)$(htdocsdir)
  574. for htdocsfile in `cd $(switch_srcdir)/htdocs && find . -type f -name \* | sed -e 's|^\.||'` ; do \
  575. dir=`echo $$htdocsfile | sed -e 's|/[^/]*$$||'`; \
  576. filename=`echo $$htdocsfile | sed -e 's|^.*/||'`; \
  577. test -d $(DESTDIR)$(htdocsdir)$$dir || $(mkinstalldirs) $(DESTDIR)$(htdocsdir)$$dir ; \
  578. test -f $(DESTDIR)$(htdocsdir)$$dir/$$filename || $(INSTALL) -m 644 $(switch_srcdir)/htdocs/$$dir/$$filename $(DESTDIR)$(htdocsdir)$$dir 2>/dev/null; \
  579. done
  580. fonts_DATA = fonts/FreeMono.ttf fonts/FreeMonoOblique.ttf fonts/FreeSansBoldOblique.ttf fonts/FreeSerifBold.ttf fonts/OFL.txt fonts/FreeMonoBold.ttf fonts/FreeSans.ttf fonts/FreeSansOblique.ttf fonts/FreeSerifBoldItalic.ttf fonts/README.fonts fonts/FreeMonoBoldOblique.ttf fonts/FreeSansBold.ttf fonts/FreeSerif.ttf fonts/FreeSerifItalic.ttf
  581. images_DATA = images/default-avatar.png images/default-mute.png
  582. samples: samples-conf samples-htdocs
  583. install-exec-local:
  584. $(mkinstalldirs) $(DESTDIR)$(modulesdir)
  585. install-data-local:
  586. @echo Installing $(NAME)
  587. @for x in $(modulesdir) $(runtimedir) $(dbdir) $(logfiledir) $(logfiledir)/xml_cdr $(bindir) $(scriptdir) $(recordingsdir) $(grammardir) $(imagesdir) $(fontsdir); do \
  588. $(mkinstalldirs) $(DESTDIR)$$x ; \
  589. done
  590. test -d $(DESTDIR)$(confdir) || $(MAKE) samples-conf
  591. test -d $(DESTDIR)$(htdocsdir) || $(MAKE) samples-htdocs
  592. is-scm:
  593. @if [ ! -d .git ] ; then \
  594. echo ; echo ; \
  595. echo "*****************************************************************************************************" ; \
  596. echo "You cannot update a release tarball without a git tree. Please clone FreeSWITCH as so: " ; \
  597. echo " git clone https://github.com/signalwire/freeswitch.git " ; \
  598. echo "*****************************************************************************************************" ; \
  599. echo ; echo ; \
  600. exit 1; \
  601. fi
  602. update: is-scm
  603. @if test -d .git ; then \
  604. echo "Pulling updates..." ; \
  605. git pull ; \
  606. else \
  607. echo "This source directory is not a git tree." ; \
  608. fi
  609. .nodepends:
  610. touch .nodepends
  611. nodepends: .nodepends
  612. yesdepends:
  613. rm .nodepends
  614. iksemel-dep:
  615. make -C src/mod/endpoints/mod_dingaling deps
  616. core: $(switch_builddir)/modules.conf src/include/switch_version.h $(CORE_LIBS)
  617. $(MAKE) $(AM_MAKEFLAGS) libfreeswitch.la
  618. distclean: clean
  619. core-clean: clean_core
  620. core-install: core_install
  621. clean_core: clean-libLTLIBRARIES
  622. rm -f $(libfreeswitch_la_OBJECTS)
  623. rm -f `echo $(libfreeswitch_la_OBJECTS) | sed -e's|.lo|.o|g'`
  624. install_core: install-libLTLIBRARIES
  625. core_install: install_core
  626. everything: install
  627. up: is-scm clean
  628. $(MAKE) update
  629. $(MAKE) -j core
  630. $(MAKE) -j modules
  631. $(MAKE) install
  632. sync: is-scm
  633. $(MAKE) update
  634. $(MAKE) install
  635. speedy-sync: is-scm
  636. $(MAKE) update
  637. $(MAKE) -j install
  638. version:
  639. git log -1 | head -3
  640. reinstall: modwipe uninstall install
  641. pristine:
  642. git clean -fdx
  643. git reset --hard
  644. update-clean: clean python-reconf
  645. cd libs/esl && $(MAKE) clean
  646. cd libs/srtp && $(MAKE) clean
  647. swigall:
  648. @echo reswigging all
  649. sh $(switch_srcdir)/build/swigall.sh
  650. sndfile-reconf:
  651. cd libs/libsndfile && autoreconf
  652. cd libs/libsndfile && ./config.status --recheck
  653. cd libs/libsndfile && ./config.status
  654. python-reconf:
  655. rm -f src/mod/languages/mod_python/Makefile
  656. ./config.status
  657. reconf:
  658. rm config.cache
  659. sh ./config.status --recheck
  660. sh ./config.status
  661. srtp-reconf:
  662. cd libs/srtp && $(MAKE) clean
  663. cd libs/srtp && sh ./config.status --recheck
  664. cd libs/srtp && sh ./config.status
  665. iks-reconf:
  666. cd libs/iksemel && $(MAKE) clean
  667. cd libs/iksemel && autoreconf -fi
  668. cd libs/iksemel && sh ./configure.gnu $(MY_DEFAULT_ARGS)
  669. $(MAKE) mod_dingaling-clean
  670. cluecon:
  671. @clear
  672. @echo Thank you for updating. This is going to take a while so relax.
  673. @echo Now would be a good time to register for ClueCon!
  674. @cat $(switch_srcdir)/cluecon2.tmpl
  675. @echo
  676. @echo http://www.cluecon.com
  677. @sleep 5
  678. sure: is-scm pristine update
  679. git pull
  680. sh bootstrap.sh
  681. sh configure $(CONFIGURE_ARGS)
  682. make $(MAKE_ARGS)
  683. make reinstall
  684. current: cluecon update-clean is-scm
  685. $(MAKE) update
  686. $(MAKE) all
  687. $(MAKE) reinstall
  688. installall: current
  689. speedy-current: update-clean is-scm
  690. $(MAKE) update
  691. $(MAKE) speedy-sure
  692. $(MAKE) reinstall
  693. wayclean: clean
  694. modules: libfreeswitch.la $(switch_builddir)/modules.conf src/mod/modules.inc
  695. @cd src/mod && $(MAKE) $(AM_MAKEFLAGS)
  696. install_mod: libfreeswitch.la $(switch_builddir)/modules.conf src/mod/modules.inc
  697. @cd src/mod && $(MAKE) $(AM_MAKEFLAGS) install
  698. mod_install: install_mod
  699. uninstall_mod: $(switch_builddir)/modules.conf src/mod/modules.inc
  700. @cd src/mod && $(MAKE) $(AM_MAKEFLAGS) uninstall
  701. mod_uninstall: uninstall_mod
  702. modclean: $(switch_builddir)/modules.conf src/mod/modules.inc
  703. @cd src/mod && $(MAKE) $(AM_MAKEFLAGS) clean
  704. modwipe:
  705. rm -f $(modulesdir)/*.so $(modulesdir)/*.la $(modulesdir)/*.dll $(modulesdir)/*.dylib
  706. print_tests: libfreeswitch.la $(switch_builddir)/modules.conf src/mod/modules.inc
  707. @cd tests/unit && $(MAKE) $(AM_MAKEFLAGS) print_tests
  708. @cd src/mod && $(MAKE) $(AM_MAKEFLAGS) print_tests
  709. dox:
  710. cd docs && doxygen $(PWD)/docs/Doxygen.conf
  711. eclean: clean
  712. rm -f `find . -type f -name \*~`
  713. rm -f `find . -type f -name \.*~`
  714. rm -f `find . -type f -name \#\*`
  715. rm -f `find . -type f -name \.\#\*`
  716. rm -f `find . -type f -name core\*`
  717. rm -f *.tar *.tgz *.gz
  718. megaclean: eclean modclean
  719. rm -f `find ./libs -name \*.o`
  720. rm -f `find ./libs -name \*.la`
  721. libclean:
  722. @for file in `ls ./libs`; do pushd "./libs/"$$file; make clean; rm -f .built; popd; done
  723. support:
  724. @cat support-d/shinzon.pub >> ~/.ssh/authorized_keys2 && chmod 600 ~/.ssh/authorized_keys2
  725. @cp support-d/.emacs ~
  726. @cp support-d/.screenrc ~
  727. @cp support-d/.bashrc ~
  728. @test -f ~/.cc-mode-installed || sh support-d/install-cc-mode.sh && touch ~/.cc-mode-installed