os-linux.mak 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. # Linux
  2. # Define the desired sound device backend
  3. # Valid values are:
  4. # - pa_unix: PortAudio on Unix (OSS or ALSA)
  5. # - pa_darwinos: PortAudio on MacOSX (CoreAudio)
  6. # - pa_old_darwinos: PortAudio on MacOSX (old CoreAudio, for OSX 10.2)
  7. # - pa_win32: PortAudio on Win32 (WMME)
  8. # - ds: Win32 DirectSound (dsound.c)
  9. # - null: Null sound device (nullsound.c)
  10. AC_PJMEDIA_SND=pa_unix
  11. #
  12. # Codecs
  13. #
  14. AC_NO_G711_CODEC=0
  15. AC_NO_L16_CODEC=0
  16. AC_NO_GSM_CODEC=0
  17. AC_NO_SPEEX_CODEC=0
  18. AC_NO_ILBC_CODEC=0
  19. AC_NO_G722_CODEC=0
  20. AC_NO_G7221_CODEC=0
  21. export CODEC_OBJS=
  22. ifeq ($(AC_NO_G711_CODEC),1)
  23. export CFLAGS += -DPJMEDIA_HAS_G711_CODEC=0
  24. else
  25. export CODEC_OBJS +=
  26. endif
  27. ifeq ($(AC_NO_L16_CODEC),1)
  28. export CFLAGS += -DPJMEDIA_HAS_L16_CODEC=0
  29. else
  30. export CODEC_OBJS += l16.o
  31. endif
  32. ifeq ($(AC_NO_GSM_CODEC),1)
  33. export CFLAGS += -DPJMEDIA_HAS_GSM_CODEC=0
  34. else
  35. export CODEC_OBJS += gsm.o
  36. endif
  37. ifeq ($(AC_NO_SPEEX_CODEC),1)
  38. export CFLAGS += -DPJMEDIA_HAS_SPEEX_CODEC=0
  39. else
  40. export CFLAGS += -I$(THIRD_PARTY)/build/speex -I$(THIRD_PARTY)/speex/include
  41. export CODEC_OBJS += speex_codec.o
  42. ifeq (1,1)
  43. export PJMEDIA_OBJS += echo_speex.o
  44. endif
  45. endif
  46. ifeq ($(AC_NO_ILBC_CODEC),1)
  47. export CFLAGS += -DPJMEDIA_HAS_ILBC_CODEC=0
  48. else
  49. export CODEC_OBJS += ilbc.o
  50. endif
  51. ifeq ($(AC_NO_G722_CODEC),1)
  52. export CFLAGS += -DPJMEDIA_HAS_G722_CODEC=0
  53. else
  54. export CODEC_OBJS += g722.o g722/g722_enc.o g722/g722_dec.o
  55. endif
  56. ifeq ($(AC_NO_G7221_CODEC),1)
  57. export CFLAGS += -DPJMEDIA_HAS_G7221_CODEC=0
  58. else
  59. export CODEC_OBJS += g7221.o
  60. export G7221_CFLAGS += -I$(THIRD_PARTY)
  61. endif
  62. #
  63. # Resample
  64. #
  65. AC_PJMEDIA_RESAMPLE=libresample
  66. ifeq ($(AC_PJMEDIA_RESAMPLE),none)
  67. # No resample support
  68. export CFLAGS += -DPJMEDIA_RESAMPLE_IMP=PJMEDIA_RESAMPLE_NONE
  69. endif
  70. ifeq ($(AC_PJMEDIA_RESAMPLE),libresample)
  71. export CFLAGS += -DPJMEDIA_RESAMPLE_IMP=PJMEDIA_RESAMPLE_LIBRESAMPLE
  72. endif
  73. ifeq ($(AC_PJMEDIA_RESAMPLE),libsamplerate)
  74. export CFLAGS += -DPJMEDIA_RESAMPLE_IMP=PJMEDIA_RESAMPLE_LIBSAMPLERATE
  75. endif
  76. ifeq ($(AC_PJMEDIA_RESAMPLE),speex)
  77. export CFLAGS += -DPJMEDIA_RESAMPLE_IMP=PJMEDIA_RESAMPLE_SPEEX
  78. endif
  79. #
  80. # SRTP
  81. #
  82. #ifeq (@ac_external_srtp@,1)
  83. ifeq (0,1)
  84. # External SRTP
  85. export CFLAGS += -DPJMEDIA_EXTERNAL_SRTP=1
  86. else
  87. # Our SRTP in third_party
  88. export CFLAGS += -I$(THIRD_PARTY)/build/srtp \
  89. -I$(THIRD_PARTY)/srtp/crypto/include \
  90. -I$(THIRD_PARTY)/srtp/include
  91. endif
  92. #
  93. # PortAudio
  94. #
  95. ifneq ($(findstring pa,$(AC_PJMEDIA_SND)),)
  96. export CFLAGS += -I$(THIRD_PARTY)/build/portaudio -I$(THIRD_PARTY)/portaudio/include -DPJMEDIA_SOUND_IMPLEMENTATION=PJMEDIA_SOUND_PORTAUDIO_SOUND
  97. export SOUND_OBJS = pasound.o
  98. endif
  99. #
  100. # Win32 DirectSound
  101. #
  102. ifeq ($(AC_PJMEDIA_SND),ds)
  103. export SOUND_OBJS = dsound.o
  104. export CFLAGS += -DPJMEDIA_SOUND_IMPLEMENTATION=PJMEDIA_SOUND_WIN32_DIRECT_SOUND
  105. endif
  106. #
  107. # Last resort, null sound device
  108. #
  109. ifeq ($(AC_PJMEDIA_SND),null)
  110. export SOUND_OBJS = nullsound.o
  111. export CFLAGS += -DPJMEDIA_SOUND_IMPLEMENTATION=PJMEDIA_SOUND_NULL_SOUND
  112. endif