You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

336 lines
11KB

  1. dnl Process this file with autoconf to produce a configure script.
  2. AC_INIT(SpiralSynthModular.C)
  3. dnl Automake (can't use AC_CONFIG_HEADER - get complaints!)
  4. AM_CONFIG_HEADER(config.h)
  5. dnl Checks for programs.
  6. AC_PROG_CC
  7. AC_PROG_CPP
  8. AC_PROG_INSTALL
  9. dnl Checks for header files.
  10. AC_HEADER_STDC
  11. dnl Checks for typedefs, structures, and compiler characteristics.
  12. AC_C_CONST
  13. AC_C_INLINE
  14. dnl Check plugin directory
  15. AC_ARG_WITH(plugindir,
  16. [ --with-plugindir=dir give the plugin directory],
  17. plugindir="$withval",
  18. plugindir="/usr/lib/SpiralPlugins")
  19. AC_SUBST(PLUGINDIR, $plugindir)
  20. dnl Check whether to enable debugging
  21. AC_ARG_ENABLE(debug, [ --enable-debug enable debugging ],
  22. ac_arg_debug="Y", ac_arg_debug="N")
  23. if test $ac_arg_debug = "Y" ; then
  24. CFLAGS="-pipe -Wall -O0 -ggdb "
  25. CXXFLAGS="-pipe -Wall -O0 -ggdb "
  26. else
  27. CFLAGS="-pipe -Wall -O3 -ffast-math -DNO_DEBUG -Wno-unused "
  28. CXXFLAGS="-pipe -Wall -O3 -ffast-math -DNO_DEBUG -Wno-unused "
  29. fi
  30. dnl build plugin list - plugins that do not require an optional component
  31. dnl (i.e. Jack, and LADSPA)
  32. PLUGINLIST="AmpPlugin AnotherFilterPlugin BeatMatchPlugin ControllerPlugin \
  33. CounterPlugin DelayPlugin DiskWriterPlugin DistributorPlugin EchoPlugin \
  34. EnvFollowerPlugin EnvelopePlugin FilterPlugin FlipflopPlugin FormantFilterPlugin \
  35. KeyboardPlugin LFOPlugin LogicPlugin MasherPlugin MatrixPlugin \
  36. MeterPlugin MidiPlugin MixSwitchPlugin MixerPlugin MoogFilterPlugin NoisePlugin \
  37. NoteSnapPlugin OperatorPlugin OscillatorPlugin OutputPlugin PoshSamplerPlugin \
  38. RingModPlugin SVFilterPlugin SampleHoldPlugin ScopePlugin SeqSelectorPlugin \
  39. SmoothPlugin SpiralLoopPlugin SplitSwitchPlugin SplitterPlugin StereoMixerPlugin \
  40. StreamPlugin SwitchPlugin TransposePlugin TrigPlugin WaveShaperPlugin \
  41. WaveTablePlugin XFadePlugin"
  42. dnl Check whether jack is present or has been disabled
  43. jack_message=""
  44. AC_ARG_ENABLE(
  45. jack,
  46. [ --disable-jack Do not build JackPlugin],
  47. [build_jack="n" ; jack_message="manually disabled"],
  48. [build_jack="y"]
  49. )
  50. if test "$build_jack" = "y"; then
  51. AC_CHECK_HEADER(jack/jack.h, [build_jack="y"], [build_jack="n" ; jack_message="No jack/jack.h found"])
  52. fi
  53. if test "$build_jack" = "y"; then
  54. AC_CHECK_LIB(jack, jack_client_new, [build_jack="y"], [build_jack="n" ; jack_message="No libjack found"])
  55. fi
  56. if test "$build_jack" = "y" ; then
  57. PLUGINLIST="JackPlugin $PLUGINLIST"
  58. fi
  59. dnl Check whether LADSPA is present or has been disabled
  60. ladspa_message=""
  61. AC_ARG_ENABLE(
  62. ladspa,
  63. [ --disable-ladspa Do not build LADSPAPlugin],
  64. [build_ladspa="n" ; ladspa_message="manually disabled"],
  65. [build_ladspa="y"]
  66. )
  67. if test "$build_ladspa" = "y"; then
  68. AC_CHECK_HEADER(ladspa.h, [build_ladspa="y"], [build_ladspa="n" ; ladspa_message="No ladspa.h found"])
  69. fi
  70. if test "$build_ladspa" = "y" ; then
  71. PLUGINLIST="LADSPAPlugin $PLUGINLIST"
  72. fi
  73. dnl build plugin list
  74. echo "$PLUGINLIST" > SpiralSound/PluginList.txt
  75. dnl Check whether liblrdf is present or has been disabled
  76. lrdf_message=""
  77. AC_ARG_ENABLE(
  78. lrdf,
  79. [ --disable-lrdf Disable liblrdf for LADSPA Plugin],
  80. [use_liblrdf="n" ; lrdf_message="manually disabled"],
  81. [use_liblrdf="y"]
  82. )
  83. if test "$build_ladspa" = "n" ; then
  84. use_liblrdf="n"
  85. lrdf_message="LADSPAPlugin not used"
  86. fi
  87. if test "$use_liblrdf" = "y"; then
  88. AC_CHECK_HEADER(lrdf.h, [use_liblrdf="y"], [use_liblrdf="n" ; lrdf_message="No lrdf.h found"])
  89. fi
  90. if test "$use_liblrdf" = "y"; then
  91. AC_CHECK_LIB(lrdf, lrdf_init, [use_liblrdf="y"], [use_liblrdf="n" ; lrdf_message="No liblrdf found"])
  92. fi
  93. if test "$use_liblrdf" = "y"; then
  94. AC_DEFINE(HAVE_LIBLRDF, , [Enable liblrdf support for LADSPA Plugin])
  95. LRDFLIBS="-llrdf"
  96. AC_SUBST(LRDFLIBS)
  97. fi
  98. dnl Check if POSIX SHM is present or has been disabled
  99. shm_message=""
  100. AC_ARG_ENABLE(
  101. posix-shm,
  102. [ --disable-posix-shm Disable POSIX SHM for LADSPA Plugin],
  103. [use_posix_shm="n" ; shm_message="manually disabled"],
  104. [use_posix_shm="y"]
  105. )
  106. if test "$build_ladspa" = "n" ; then
  107. use_posix_shm="n"
  108. shm_message="LADSPAPlugin not used"
  109. elif test "$use_liblrdf" = "n" ; then
  110. use_posix_shm="n"
  111. shm_message="liblrdf not used"
  112. fi
  113. if test "$use_posix_shm" = "y"; then
  114. AC_MSG_CHECKING([POSIX SHM support ])
  115. if test -d /dev/shm -a -w /dev/shm ; then
  116. AC_DEFINE(USE_POSIX_SHM, ,[Enable POSIX SHM support for LADSPA Plugin])
  117. AC_MSG_RESULT(found.)
  118. SHMLIBS="-lrt"
  119. AC_SUBST(SHMLIBS)
  120. else
  121. AC_MSG_RESULT(not found.)
  122. use_posix_shm="n"
  123. shm_message="/dev/shm not found";
  124. fi
  125. fi
  126. dnl Check whether alsa-midi is present or has been disabled
  127. amidi_message=""
  128. AC_ARG_ENABLE(
  129. alsa_midi,
  130. [ --disable-alsa-midi Disable alsa midi (use OSS)],
  131. [use_alsa_midi="n"; amidi_message="manually disabled"],
  132. [use_alsa_midi="y"]
  133. )
  134. if test "$use_alsa_midi" = "y"; then
  135. AC_CHECK_HEADER(alsa/asoundlib.h, [use_alsa_midi="y"], [use_alsa_midi="n" ; amidi_message="No alsa/asoundlib.h found"])
  136. fi
  137. if test "$use_alsa_midi" = "y"; then
  138. AC_CHECK_LIB(asound, snd_seq_open, [use_alsa_midi="y"], [use_alsa_midi="n" ; amidi_message="No libasound found"])
  139. fi
  140. if test "$use_alsa_midi" = "y"; then
  141. AC_DEFINE(USE_ALSA_MIDI, , [Use ALSA MIDI not OSS])
  142. AMIDILIBS="-lasound"
  143. AC_SUBST(AMIDILIBS)
  144. else
  145. AC_DEFINE(USE_OSS_MIDI, , [Use OSS MIDI not ALSA])
  146. fi
  147. dnl Check whether libsndfile is present or has been disabled
  148. sndfile_message=""
  149. AC_ARG_ENABLE(
  150. sndfile,
  151. [ --disable-sndfile Disable libsndfile for waveform loading],
  152. [use_sndfile="n" ; sndfile_message="manually disabled"],
  153. [use_sndfile="y"]
  154. )
  155. if test "$use_sndfile" = "y"; then
  156. AC_CHECK_HEADER(sndfile.h, [use_sndfile="y"], [use_sndfile="n" ; sndfile_message="No sndfile.h found"])
  157. fi
  158. if test "$use_sndfile" = "y"; then
  159. AC_CHECK_LIB(sndfile, sf_open, [use_sndfile="y"], [use_sndfile="n" ; sndfile_message="No libXXXX found"])
  160. fi
  161. if test "$use_sndfile" = "y"; then
  162. AC_DEFINE(USE_LIBSNDFILE, , [Enable libsndfile for waveform loading])
  163. SFLIBS="-lsndfile"
  164. AC_SUBST(SFLIBS)
  165. fi
  166. dnl Checks for library functions.
  167. AC_CHECK_HEADERS(math.h)
  168. AC_CHECK_LIB(m, sin)
  169. dnl AC_CHECK_HEADERS(X11/Xlib.h)
  170. dnl AC_CHECK_LIB(X11, XDisplayName)
  171. dnl AC_CHECK_LIB(Xext, main)
  172. AC_PATH_PROG(FLTK_CONFIG, fltk-config, no)
  173. if test "$FLTK_CONFIG" = "no"; then
  174. AC_PATH_XTRA
  175. LIBGL=""
  176. CPPFLAGS="$CPPFLAGS $X_CFLAGS"
  177. AC_CHECK_HEADERS(GL/gl.h)
  178. if test $ac_cv_header_GL_gl_h = "yes" ; then
  179. AC_CHECK_LIB(GL, glBegin, LIBGL="-lGL")
  180. fi
  181. AC_CHECK_HEADERS(FL/Fl.h)
  182. if test $ac_cv_header_FL_Fl_h = "no" ; then
  183. echo "*** FLTK headers missing."
  184. exit 1
  185. fi
  186. AC_CHECK_LIB(fltk, main)
  187. FLTK_CXXFLAGS="$X_CFLAGS"
  188. FLTK_CFLAGS="$FLTK_CXXFLAGS"
  189. FLTK_LIBS="$X_LIBS -lfltk $LIBGL"
  190. else
  191. FLTK_CXXFLAGS=`$FLTK_CONFIG $fltk_config_args --cxxflags`
  192. FLTK_CFLAGS=`$FLTK_CONFIG $fltk_config_args --cxxflags`
  193. FLTK_LIBS=`$FLTK_CONFIG $fltk_config_args --ldflags`
  194. dnl This caused problems for debian users,
  195. dnl It would be nice to find a more robust way of doing it.
  196. dnl if test "${FLTK_LIBS/*-rpath*/yes}" != "yes"; then
  197. dnl echo "*** FLTK needs to be configured with --enable-shared"
  198. dnl exit 1
  199. dnl fi
  200. fi
  201. AC_SUBST(FLTK_CXXFLAGS)
  202. AC_SUBST(FLTK_CFLAGS)
  203. AC_SUBST(FLTK_LIBS)
  204. AC_CHECK_HEADERS(dlfcn.h)
  205. AC_CHECK_LIB(dl, dlopen)
  206. dnl Do we need png?????
  207. dnl AC_CHECK_HEADERS(png.h)
  208. dnl AC_CHECK_LIB(png, png_get_copyright)
  209. dnl This is normally done with libtool but since we aren't using libtool
  210. dnl yet to it here.
  211. dnl FIXME: forced to add -fPIC here..
  212. CFLAGS="$CFLAGS -fPIC"
  213. CXXFLAGS="$CFLAGS -fPIC"
  214. AC_SUBST(CFLAGS)
  215. AC_SUBST(CXXFLAGS)
  216. AC_SUBST(PLUGINLIST)
  217. dnl Modify the output files.
  218. AC_OUTPUT(
  219. SpiralSound/Plugins/AmpPlugin/Makefile
  220. SpiralSound/Plugins/AnotherFilterPlugin/Makefile
  221. SpiralSound/Plugins/BeatMatchPlugin/Makefile
  222. SpiralSound/Plugins/ControllerPlugin/Makefile
  223. SpiralSound/Plugins/CounterPlugin/Makefile
  224. SpiralSound/Plugins/DelayPlugin/Makefile
  225. SpiralSound/Plugins/DiskWriterPlugin/Makefile
  226. SpiralSound/Plugins/DistributorPlugin/Makefile
  227. SpiralSound/Plugins/EchoPlugin/Makefile
  228. SpiralSound/Plugins/EnvFollowerPlugin/Makefile
  229. SpiralSound/Plugins/EnvelopePlugin/Makefile
  230. SpiralSound/Plugins/FilterPlugin/Makefile
  231. SpiralSound/Plugins/FlipflopPlugin/Makefile
  232. SpiralSound/Plugins/FormantFilterPlugin/Makefile
  233. SpiralSound/Plugins/JackPlugin/Makefile
  234. SpiralSound/Plugins/KeyboardPlugin/Makefile
  235. SpiralSound/Plugins/LADSPAPlugin/Makefile
  236. SpiralSound/Plugins/LFOPlugin/Makefile
  237. SpiralSound/Plugins/LogicPlugin/Makefile
  238. SpiralSound/Plugins/MasherPlugin/Makefile
  239. SpiralSound/Plugins/MatrixPlugin/Makefile
  240. SpiralSound/Plugins/MeterPlugin/Makefile
  241. SpiralSound/Plugins/MidiPlugin/Makefile
  242. SpiralSound/Plugins/MixSwitchPlugin/Makefile
  243. SpiralSound/Plugins/MixerPlugin/Makefile
  244. SpiralSound/Plugins/MoogFilterPlugin/Makefile
  245. SpiralSound/Plugins/NoisePlugin/Makefile
  246. SpiralSound/Plugins/NoteSnapPlugin/Makefile
  247. SpiralSound/Plugins/OperatorPlugin/Makefile
  248. SpiralSound/Plugins/OscillatorPlugin/Makefile
  249. SpiralSound/Plugins/OutputPlugin/Makefile
  250. SpiralSound/Plugins/PoshSamplerPlugin/Makefile
  251. SpiralSound/Plugins/RingModPlugin/Makefile
  252. SpiralSound/Plugins/SVFilterPlugin/Makefile
  253. SpiralSound/Plugins/SampleHoldPlugin/Makefile
  254. SpiralSound/Plugins/ScopePlugin/Makefile
  255. SpiralSound/Plugins/SeqSelectorPlugin/Makefile
  256. SpiralSound/Plugins/SmoothPlugin/Makefile
  257. SpiralSound/Plugins/SpiralLoopPlugin/Makefile
  258. SpiralSound/Plugins/SplitSwitchPlugin/Makefile
  259. SpiralSound/Plugins/SplitterPlugin/Makefile
  260. SpiralSound/Plugins/StereoMixerPlugin/Makefile
  261. SpiralSound/Plugins/StreamPlugin/Makefile
  262. SpiralSound/Plugins/SwitchPlugin/Makefile
  263. SpiralSound/Plugins/TransposePlugin/Makefile
  264. SpiralSound/Plugins/TrigPlugin/Makefile
  265. SpiralSound/Plugins/WaveShaperPlugin/Makefile
  266. SpiralSound/Plugins/WaveTablePlugin/Makefile
  267. SpiralSound/Plugins/XFadePlugin/Makefile
  268. SpiralSynthPluginLocation.h
  269. Makefile
  270. )
  271. echo -e "\nConfig options:"
  272. echo -n "libsndfile support for wave loading - "
  273. if test "$use_sndfile" = "y"; then
  274. echo "Enabled"
  275. else
  276. echo "Disabled - $sndfile_message"
  277. fi
  278. echo -n " ALSA support for MidiPlugin - "
  279. if test "$use_alsa_midi" = "y"; then
  280. echo "Enabled"
  281. else
  282. echo "Disabled - $amidi_message - Using OSS instead"
  283. fi
  284. echo -n " Jack support (via JackPlugin) - "
  285. if test "$build_jack" = "y"; then
  286. echo "Enabled"
  287. else
  288. echo "Disabled - $jack_message"
  289. fi
  290. echo -n " LADSPA support (via LADSPAPlugin) - "
  291. if test "$build_ladspa" = "y"; then
  292. echo "Enabled"
  293. else
  294. echo "Disabled - $ladspa_message"
  295. fi
  296. echo -n " liblrdf support for LADSPAPlugin - "
  297. if test "$use_liblrdf" = "y"; then
  298. echo "Enabled"
  299. else
  300. echo "Disabled - $lrdf_message"
  301. fi
  302. echo -n " POSIX SHM support for LADSPAPlugin - "
  303. if test "$use_posix_shm" = "y"; then
  304. echo "Enabled"
  305. else
  306. echo "Disabled - $shm_message"
  307. fi
  308. echo ""