Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395
  1. # Configuration script for sndlib (taken from Snd)
  2. AC_INIT(sndlib, 22, bil@ccrma.stanford.edu, ftp://ccrma-ftp.stanford.edu/pub/Lisp/sndlib.tar.gz)
  3. SNDLIB_VERSION=22
  4. AC_CONFIG_SRCDIR(io.c)
  5. AC_CANONICAL_HOST
  6. AC_CONFIG_FILES(makefile)
  7. AC_CONFIG_FILES(sndlib.pc)
  8. AC_CONFIG_FILES(sndins/Makefile)
  9. AC_CONFIG_HEADERS(unix-config.h)
  10. AC_CONFIG_FILES(sndlib-config, [chmod +x sndlib-config])
  11. AC_PROG_CC
  12. # AC_HEADER_STDC
  13. AC_PROG_INSTALL
  14. AC_C_BIGENDIAN
  15. AC_CHECK_SIZEOF(void *)
  16. AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
  17. #--------------------------------------------------------------------------------
  18. # configuration options
  19. # --disable-shared don't try to make a .so file
  20. # --with-alsa use ALSA if possible
  21. # --with-audio without-audio to stub out all audio
  22. # --with-forth use Forth as extension language
  23. # --with-gsl include GSL
  24. # --with-jack use Jack
  25. # --with-oss use OSS if possible
  26. # --with-portaudio use portaudio
  27. # --with-ruby use Ruby as the extension language
  28. # --with-s7 use S7 as the extension language (default = yes)
  29. #--------------------------------------------------------------------------------
  30. AC_ARG_ENABLE(shared, [ --disable_shared don't build or install the shared library])
  31. AC_ARG_WITH(alsa, [ --with-alsa use ALSA])
  32. AC_ARG_WITH(audio, [ --without-audio don't include any audio functionality])
  33. AC_ARG_WITH(forth, [ --with-forth use Forth as the extension language])
  34. AC_ARG_WITH(gsl, [ --with-gsl use GSL, default=yes])
  35. AC_ARG_WITH(jack, [ --with-jack use JACK])
  36. AC_ARG_WITH(oss, [ --with-oss use OSS])
  37. AC_ARG_WITH(portaudio, [ --with-portaudio use portaudio, default=no])
  38. AC_ARG_WITH(ruby, [ --with-ruby use Ruby as the extension language])
  39. AC_ARG_WITH(s7, [ --with-s7 use s7, default=yes])
  40. AUDIO_SYSTEM="None"
  41. LIBS=""
  42. #--------------------------------------------------------------------------------
  43. # GSL
  44. #--------------------------------------------------------------------------------
  45. GSL_LIBS=""
  46. GSL_CFLAGS=""
  47. if test "$with_gsl" != no; then
  48. AC_MSG_CHECKING(for gsl)
  49. if test x$PKG_CONFIG != xno ; then
  50. if $PKG_CONFIG gsl --exists ; then
  51. GSL_LIBS="`$PKG_CONFIG gsl --libs`"
  52. GSL_CFLAGS="`$PKG_CONFIG gsl --cflags`"
  53. AC_DEFINE(HAVE_GSL)
  54. OPTIONAL_LIBRARIES="$OPTIONAL_LIBRARIES gsl"
  55. AC_MSG_RESULT(yes)
  56. else
  57. AC_MSG_RESULT(no)
  58. fi
  59. fi
  60. fi
  61. AC_SUBST(GSL_LIBS)
  62. AC_SUBST(GSL_CFLAGS)
  63. #--------------------------------------------------------------------------------
  64. # language
  65. #--------------------------------------------------------------------------------
  66. # language choice: ruby if --with-ruby and we can find one of ruby-2.0.pc, ruby-1.9.pc, or ruby-1.8.pc
  67. # forth if --with-forth
  68. # none if --without-extension-language
  69. # s7 otherwise
  70. XEN_LIBS=""
  71. XEN_CFLAGS=""
  72. ac_snd_extension_language=none
  73. SNDLIB_LANGUAGE="None"
  74. #--------------------------------------------------------------------------------
  75. # Ruby
  76. #--------------------------------------------------------------------------------
  77. if test "$with_ruby" = yes ; then
  78. if test x$PKG_CONFIG != xno ; then
  79. m4_foreach([ruby_version], [[ruby-2.1], [ruby-2.0], [ruby], [ruby-1.9.3], [ruby-1.9], [ruby-1.8]],
  80. [
  81. if test "$ac_snd_extension_language" = none ; then
  82. if $PKG_CONFIG ruby_version --exists ; then
  83. AC_DEFINE(HAVE_RUBY)
  84. XEN_CFLAGS="`$PKG_CONFIG ruby_version --cflags`"
  85. XEN_LIBS="`$PKG_CONFIG ruby_version --libs`"
  86. LOCAL_LANGUAGE="Ruby"
  87. ac_snd_extension_language=Ruby
  88. fi
  89. fi
  90. ])
  91. fi
  92. fi
  93. #--------------------------------------------------------------------------------
  94. # Forth
  95. #--------------------------------------------------------------------------------
  96. if test "$with_forth" = yes ; then
  97. AC_PATH_PROG([FTH], [fth], [no])
  98. AC_MSG_CHECKING([for Forth])
  99. if test "${FTH}" != no ; then
  100. XEN_CFLAGS=`${FTH} --no-init-file --eval .cflags`
  101. XEN_LIBS=`${FTH} --no-init-file --eval .libs`
  102. AC_MSG_RESULT([yes])
  103. AC_DEFINE(HAVE_FORTH)
  104. ac_snd_extension_language=Forth
  105. SNDLIB_LANGUAGE="Forth"
  106. else
  107. AC_MSG_RESULT([no])
  108. fi
  109. fi
  110. #--------------------------------------------------------------------------------
  111. # s7 (the default)
  112. #--------------------------------------------------------------------------------
  113. if test "$with_s7" != no && test "$ac_snd_extension_language" = none ; then
  114. AC_DEFINE(HAVE_SCHEME)
  115. ac_snd_extension_language=s7
  116. SNDLIB_LANGUAGE="s7"
  117. S7_LIB="s7.o"
  118. AC_SUBST(S7_LIB)
  119. fi
  120. AC_SUBST(XEN_LIBS)
  121. AC_SUBST(XEN_CFLAGS)
  122. #--------------------------------------------------------------------------------
  123. # Audio library
  124. #--------------------------------------------------------------------------------
  125. AUDIO_LIB=""
  126. JACK_LIBS=""
  127. JACK_FLAGS=""
  128. if test "$with_audio" != no ; then
  129. if test "$with_pulseaudio" = yes ; then
  130. AC_DEFINE(MUS_PULSEAUDIO)
  131. AUDIO_LIB="-lpulse-simple"
  132. AUDIO_SYSTEM=pulseaudio
  133. fi
  134. if test "$with_portaudio" = yes ; then
  135. AC_DEFINE(MUS_PORTAUDIO)
  136. AUDIO_SYSTEM=portaudio
  137. AUDIO_LIB="-lportaudio"
  138. fi
  139. if test "$with_jack" = yes ; then
  140. AUDIO_SYSTEM=JACK
  141. AC_DEFINE(MUS_JACK)
  142. if test x$PKG_CONFIG != xno ; then
  143. if $PKG_CONFIG jack --exists ; then
  144. JACK_LIBS="`$PKG_CONFIG jack --libs`"
  145. JACK_FLAGS="`$PKG_CONFIG jack --cflags`"
  146. if $PKG_CONFIG samplerate --exists ; then
  147. JACK_LIBS="$JACK_LIBS `$PKG_CONFIG samplerate --libs`"
  148. JACK_FLAGS="$JACK_FLAGS `$PKG_CONFIG samplerate --cflags`"
  149. else
  150. JACK_LIBS="$JACK_LIBS -lsamplerate"
  151. fi
  152. else
  153. JACK_LIBS="-ljack -lsamplerate"
  154. fi
  155. else
  156. JACK_LIBS="-ljack -lsamplerate"
  157. fi
  158. fi
  159. if test "$with_alsa" = yes ; then
  160. AC_DEFINE(HAVE_ALSA)
  161. AUDIO_LIB="-lasound"
  162. AUDIO_SYSTEM=ALSA
  163. fi
  164. if test "$with_oss" = yes ; then
  165. AC_DEFINE(HAVE_OSS)
  166. AUDIO_SYSTEM=OSS
  167. fi
  168. if test "$AUDIO_SYSTEM" = None ; then
  169. case "$host" in
  170. *-*-linux*)
  171. AUDIO_SYSTEM=ALSA
  172. AC_DEFINE(HAVE_ALSA)
  173. AUDIO_LIB="-lasound"
  174. ;;
  175. *-*-sunos4*)
  176. AUDIO_SYSTEM=Sun
  177. ;;
  178. *-*-solaris*)
  179. AUDIO_SYSTEM=Sun
  180. ;;
  181. *-*-hpux*)
  182. AUDIO_SYSTEM=Hpux
  183. ;;
  184. *-*-bsdi*)
  185. AC_DEFINE(HAVE_OSS)
  186. AUDIO_SYSTEM=OSS
  187. ;;
  188. *-*-freebsd*)
  189. AC_DEFINE(HAVE_OSS)
  190. AUDIO_SYSTEM=OSS
  191. ;;
  192. *-*-openbsd*)
  193. AUDIO_SYSTEM=OpenBSD
  194. ;;
  195. *-*-netbsd*)
  196. AUDIO_SYSTEM=NetBSD
  197. ;;
  198. *-*-cygwin*)
  199. if test "$with_jack" != yes ; then
  200. AUDIO_SYSTEM=Windows
  201. fi
  202. ;;
  203. *-*-mingw*)
  204. audio_system=Windows
  205. ;;
  206. *-apple-*)
  207. if test "$with_jack" != yes ; then
  208. AUDIO_SYSTEM=MacOSX
  209. AUDIO_LIB="-framework CoreAudio -framework CoreFoundation -framework CoreMIDI"
  210. else
  211. AUDIO_SYSTEM=JACK
  212. JACK_LIBS="-framework CoreAudio -framework CoreServices -framework AudioUnit -L/usr/local/lib -ljack -lsamplerate"
  213. JACK_FLAGS="-I/usr/local/include"
  214. fi
  215. ;;
  216. esac
  217. fi
  218. fi
  219. AC_MSG_CHECKING([for audio system])
  220. AC_MSG_RESULT($AUDIO_SYSTEM)
  221. if test "$AUDIO_SYSTEM" != None ; then
  222. AC_DEFINE(WITH_AUDIO)
  223. fi
  224. AC_SUBST(AUDIO_LIB)
  225. AC_SUBST(JACK_LIBS)
  226. AC_SUBST(JACK_FLAGS)
  227. #--------------------------------------------------------------------------------
  228. # compiler/loader flags
  229. #--------------------------------------------------------------------------------
  230. LDSO_FLAGS=""
  231. SO_FLAGS=""
  232. SO_LD="ld"
  233. SO_INSTALL="install"
  234. A_INSTALL="install"
  235. # A_LD="ld"
  236. # A_LD_FLAGS=""
  237. A_LD="ar"
  238. A_LD_FLAGS="-rc"
  239. SO_NAME="libsndlib.so"
  240. RANLIB=":"
  241. LD_FLAGS="-r"
  242. case "$host" in
  243. *-*-linux*)
  244. LDSO_FLAGS="-shared"
  245. LIBS="$LIBS -lm -ldl"
  246. if test "$GCC" = yes ; then
  247. SO_FLAGS="-fPIC $SO_FLAGS"
  248. SO_LD="$CC"
  249. fi
  250. if test "$with_jack" = yes ; then
  251. A_INSTALL=":"
  252. A_LD=":"
  253. fi
  254. ;;
  255. *-*-sunos4*)
  256. LIBS="$LIBS -lm"
  257. ;;
  258. *-*-solaris*)
  259. LIBS="$LIBS -lm"
  260. LDSO_FLAGS="-G"
  261. ;;
  262. *-*-hpux*)
  263. LDSO_FLAGS="+z -Ae +DA1.1"
  264. if test "$GCC" = yes ; then
  265. SO_FLAGS="-fPIC $SO_FLAGS"
  266. fi
  267. ;;
  268. *-*-bsdi*)
  269. LIBS="$LIBS -lm"
  270. if test "$GCC" = yes ; then
  271. SO_FLAGS="-fPIC $SO_FLAGS"
  272. fi
  273. ;;
  274. *-*-freebsd*)
  275. LIBS="$LIBS -lm"
  276. if test "$GCC" = yes ; then
  277. SO_LD="$CC"
  278. SO_FLAGS="-fPIC $SO_FLAGS"
  279. LDSO_FLAGS="-shared"
  280. fi
  281. ;;
  282. *-*-openbsd*)
  283. LIBS="$LIBS -lm"
  284. if test "$GCC" = yes ; then
  285. SO_LD="$CC"
  286. SO_FLAGS="-fPIC $SO_FLAGS"
  287. CFLAGS="-ftrampolines $CFLAGS"
  288. LDSO_FLAGS="-shared"
  289. fi
  290. ;;
  291. *-*-netbsd*)
  292. LIBS="$LIBS -lm"
  293. if test "$GCC" = yes ; then
  294. SO_LD="$CC"
  295. SO_FLAGS="-fPIC $SO_FLAGS"
  296. LDSO_FLAGS="-shared"
  297. fi
  298. ;;
  299. *-*-cygwin*)
  300. A_LD_FLAGS="-rc"
  301. SO_INSTALL=":"
  302. SO_LD=":"
  303. ;;
  304. *-*-mingw*)
  305. LIBS="$LIBS -lwinmm -lwsock32"
  306. LDFLAGS="$LDFLAGS -mwindows"
  307. SO_INSTALL=":"
  308. SO_LD=":"
  309. ;;
  310. *-apple-*)
  311. SO_LD="$CC"
  312. LDSO_FLAGS="-dynamic -bundle -undefined suppress -flat_namespace"
  313. ;;
  314. esac
  315. if test "$enable_shared" = no; then
  316. SO_LD=":"
  317. SO_INSTALL=":"
  318. fi
  319. AUDIO_CHOICE="$AUDIO_SYSTEM"
  320. CFLAGS="-I. $CFLAGS"
  321. AC_SUBST(LDSO_FLAGS)
  322. AC_SUBST(SO_FLAGS)
  323. AC_SUBST(SO_INSTALL)
  324. AC_SUBST(A_INSTALL)
  325. AC_SUBST(SO_LD)
  326. AC_SUBST(A_LD)
  327. AC_SUBST(A_LD_FLAGS)
  328. AC_SUBST(LD_FLAGS)
  329. AC_SUBST(SNDLIB_VERSION)
  330. AC_SUBST(SNDLIB_LANGUAGE)
  331. AC_SUBST(SO_NAME)
  332. AC_SUBST(JACK_LIBS)
  333. AC_SUBST(JACK_FLAGS)
  334. AC_SUBST(RANLIB)
  335. AC_SUBST(AUDIO_CHOICE)
  336. AC_OUTPUT