configure.ac 77 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496
  1. dnl configure.ac: source for the configure script
  2. dnl copyright by the mpg123 project - free software under the terms of the LGPL 2.1
  3. dnl see COPYING and AUTHORS files in distribution or http://mpg123.org
  4. dnl initially written by Nicholas J. Humfrey
  5. dnl Require autoconf version >= 2.57
  6. AC_PREREQ(2.57)
  7. dnl ############# Initialisation
  8. AC_INIT([mpg123], [1.25.6], [[email protected]])
  9. dnl Increment API_VERSION when the API gets changes (new functions).
  10. dnl libmpg123
  11. API_VERSION=44
  12. LIB_PATCHLEVEL=5
  13. dnl libout123
  14. OUTAPI_VERSION=2
  15. OUTLIB_PATCHLEVEL=1
  16. dnl Since we want to be backwards compatible, both sides get set to API_VERSION.
  17. LIBMPG123_VERSION=$API_VERSION:$LIB_PATCHLEVEL:$API_VERSION
  18. LIBOUT123_VERSION=$OUTAPI_VERSION:$OUTLIB_PATCHLEVEL:$OUTAPI_VERSION
  19. AC_SUBST(LIBMPG123_VERSION)
  20. AC_SUBST(API_VERSION)
  21. AC_SUBST(LIBOUT123_VERSION)
  22. AC_SUBST(OUTAPI_VERSION)
  23. AC_CONFIG_SRCDIR(src/mpg123.c)
  24. AC_CONFIG_AUX_DIR(build)
  25. AC_CONFIG_SRCDIR(doc)
  26. AC_CONFIG_MACRO_DIR([m4])
  27. AC_CANONICAL_HOST
  28. dnl Version 1.7 of automake is recommended
  29. dnl Not sure what minimal version does not choke on sub directories.
  30. dnl Testing with 1.14.
  31. AM_INIT_AUTOMAKE([subdir-objects])
  32. AC_CONFIG_HEADERS([src/config.h])
  33. # You get strange symptoms like jack module build failing because the AC_C_CONST failed to detect the working const support.
  34. # In that case, the test failed because -Werror, not because no const there...
  35. # After looking again, there are possibly more tests being obscured by false failures.
  36. AC_MSG_CHECKING([for -Werror in CFLAGS (It breaks tests)])
  37. if echo "$CFLAGS" | grep Werror; then
  38. AC_MSG_RESULT([yes])
  39. AC_MSG_WARN([You have -Werror in CFLAGS. That may break some tests and make this configure bogus.
  40. If you want paranoid compilation, use --enable-nagging option, which adds -Werror for gcc.
  41. Also note that you shall not run make distcheck after configuring with --enable-nagging.
  42. distcheck uses the generated CFLAGS...
  43. Anyhow, continuing at your own risk.])
  44. else
  45. AC_MSG_RESULT([no])
  46. fi
  47. buffer=enabled # try to build with buffer by default
  48. dnl ############# Compiler and tools Checks
  49. LT_LDFLAGS=-export-dynamic
  50. EXEC_LT_LDFLAGS=
  51. be_static=no
  52. all_static=no
  53. lib_static=no
  54. AC_MSG_CHECKING([if you are up to something totally static with LDFLAGS/CFLAGS])
  55. for f in $LDFLAGS $CFLAGS
  56. do
  57. case "$f" in
  58. -all-static)
  59. be_static=yes
  60. all_static=yes
  61. lib_static=yes
  62. ;;
  63. -static)
  64. be_static=yes
  65. lib_static=yes
  66. ;;
  67. -static-libgcc)
  68. lib_static=yes
  69. ;;
  70. esac
  71. done
  72. if test "x$be_static" = xyes; then
  73. AC_MSG_RESULT([yes])
  74. LT_LDFLAGS=-all-static
  75. EXEC_LT_LDFLAGS="$LT_LDFLAGS"
  76. else
  77. AC_MSG_RESULT([no])
  78. fi
  79. if test "x$all_static" = xyes; then
  80. AC_MSG_WARN( Use -static in LDFLAGS for all-static linking! Your compiler may blow up on that -all-static. )
  81. fi
  82. AM_PROG_AS
  83. AC_PROG_CC
  84. AM_PROG_CC_C_O
  85. AC_PROG_CPP
  86. AC_PROG_INSTALL
  87. AC_CHECK_LIBM
  88. AC_SUBST(LIBM)
  89. dnl "Checking for egrep is broken after removal of libltdl stuff... checks use $EGREP, so searching it here."
  90. AC_PROG_EGREP
  91. AC_C_CONST
  92. AC_INLINE
  93. AC_C_BIGENDIAN
  94. if test "x$lib_static" = xyes; then
  95. CC="$CC -static-libgcc"
  96. CCLD="$CC"
  97. echo "Adding -static-libgcc"
  98. fi
  99. dnl ############# Use Libtool for dynamic module loading
  100. modules=auto
  101. OUTPUT_OBJ="module.\$(OBJEXT)"
  102. AC_ARG_ENABLE(modules,
  103. [ --enable-modules=[no/yes] dynamically loadable output modules],
  104. [
  105. if test "x$enableval" = xyes
  106. then
  107. modules=enabled
  108. else
  109. modules=disabled
  110. fi
  111. ],
  112. [
  113. if test "x$be_static" = "xyes"; then
  114. modules=disabled
  115. else
  116. modules=auto
  117. fi
  118. ])
  119. dnl We only want shared libraries by default
  120. AC_DISABLE_STATIC
  121. AC_ENABLE_SHARED
  122. if test x"$enable_shared" = xno; then
  123. modules=disabled
  124. LT_LDFLAGS=
  125. else
  126. AC_DEFINE(DYNAMIC_BUILD, 1, [ Define if building with dynamcally linked libmpg123])
  127. fi
  128. dnl We need the windows header also for checking the module mechanism.
  129. AC_CHECK_HEADERS([windows.h])
  130. if test x"$modules" = xdisabled
  131. then
  132. echo "Modules disabled, not checking for dynamic loading."
  133. else
  134. have_dl=no
  135. # The dlopen() API is either in libc or in libdl.
  136. if test x$ac_cv_header_windows_h = xyes; then
  137. AC_MSG_CHECKING([if LoadLibrary should be used])
  138. AC_LINK_IFELSE([AC_LANG_SOURCE([
  139. #ifdef __CYGWIN__
  140. #error Cygwin should use dlopen
  141. #endif
  142. #include <windows.h>
  143. int main() {
  144. LoadLibraryW(0);
  145. GetProcAddress(0, 0);
  146. FreeLibrary(0);
  147. }
  148. ])], [
  149. have_dl=yes
  150. AC_MSG_RESULT([Using LoadLibrary])
  151. ],
  152. [AC_MSG_RESULT([no])])
  153. else
  154. AC_SEARCH_LIBS(dlopen, dl)
  155. AC_CHECK_HEADER(dlfcn.h)
  156. AC_CHECK_FUNCS(dlopen dlsym dlclose, [ have_dl=yes ])
  157. fi
  158. if test x"$modules" = xenabled -a x"$have_dl" = xno; then
  159. AC_MSG_ERROR([Modules enabled but no runtime loader found! This will not work...])
  160. fi
  161. if test x"$modules" = xauto; then
  162. if test x"$have_dl" = xyes; then
  163. modules=enabled
  164. echo "We found a runtime loader: Modules enabled."
  165. else
  166. echo "We did not find a runtime loader: Modules disabled."
  167. modules=disabled
  168. fi
  169. fi
  170. fi
  171. dnl Configure libtool
  172. AC_LIBTOOL_WIN32_DLL
  173. AM_PROG_LIBTOOL
  174. if test x"$modules" = xdisabled
  175. then
  176. echo "Modules disabled."
  177. else
  178. # Enable module support in source code
  179. AC_DEFINE( USE_MODULES, 1, [Define if modules are enabled] )
  180. # Export the module file suffix as LT_MODULE_EXT
  181. LT_SYS_MODULE_EXT
  182. fi
  183. AM_CONDITIONAL( [HAVE_MODULES], [test "x$modules" = xenabled] )
  184. AC_SUBST(LT_LDFLAGS)
  185. AC_SUBST(EXEC_LT_LDFLAGS)
  186. dnl ############## Configurable Options
  187. AC_ARG_ENABLE(debug,
  188. [ --enable-debug=[no/yes] turn on debugging],
  189. [
  190. if test "x$enableval" = xyes
  191. then
  192. debugging="enabled"
  193. else
  194. debugging="disabled"
  195. fi
  196. ],
  197. [ debugging="disabled" ]
  198. )
  199. AC_ARG_ENABLE(nagging,
  200. [ --enable-nagging=[no/yes] turn on GCC's pedantic nagging with error on warnings, does not include --enable-debug anymore ],
  201. [
  202. if test "x$enableval" = xyes
  203. then
  204. nagging="enabled"
  205. else
  206. nagging="disabled"
  207. fi
  208. ],
  209. [ nagging="disabled" ]
  210. )
  211. if test x"$debugging" = xenabled; then
  212. AC_DEFINE(DEBUG, 1, [ Define if debugging is enabled. ])
  213. fi
  214. AC_ARG_ENABLE(gapless,
  215. [ --enable-gapless=[no/yes] turn on gapless (enabled per default)],
  216. [
  217. if test "x$enableval" = xyes
  218. then
  219. gapless="enabled"
  220. AC_DEFINE(GAPLESS, 1, [ Define if gapless is enabled. ])
  221. else
  222. gapless="disabled"
  223. fi
  224. ],
  225. [
  226. gapless="enabled"
  227. AC_DEFINE(GAPLESS, 1, [ Define if gapless is enabled. ])
  228. ]
  229. )
  230. AC_ARG_ENABLE(fifo,
  231. [ --enable-fifo=[no/yes] FIFO support for control interface (auto-enabled on linux) ],
  232. [
  233. if test "x$enableval" = xyes
  234. then
  235. fifo="enabled"
  236. else
  237. fifo="disabled"
  238. fi
  239. ],
  240. [
  241. fifo="auto"
  242. ]
  243. )
  244. AC_ARG_ENABLE(ipv6,
  245. [ --enable-ipv6=[no/yes] IPv6 support (actually any protocol your libc does with getaddrinfo) ],
  246. [
  247. if test "x$enableval" = xyes
  248. then
  249. ipv6="enabled"
  250. else
  251. ipv6="disabled"
  252. fi
  253. ],
  254. [
  255. ipv6="auto"
  256. ]
  257. )
  258. AC_ARG_ENABLE(network,
  259. [ --enable-network=[no/yes] network support (http streams / webradio) ],
  260. [
  261. if test "x$enableval" = xyes
  262. then
  263. network="enabled"
  264. else
  265. network="disabled"
  266. fi
  267. ],
  268. [
  269. network="auto"
  270. ]
  271. )
  272. dnl Optional objects list, depends on decoder choice and core feature selection.
  273. dnl Not just for specific decoders anymore...
  274. s_fpu=
  275. DECODER_OBJ=
  276. DECODER_LOBJ=
  277. dnl Core features that can be disabled to reduce binary size.
  278. id3v2=enabled
  279. AC_ARG_ENABLE(id3v2,
  280. [ --disable-id3v2=[no/yes] no ID3v2 parsing ],
  281. [
  282. if test "x$enableval" = xno; then
  283. id3v2="disabled"
  284. fi
  285. ], [])
  286. # id3v2 depends on strings... so check that in between.
  287. string=enabled
  288. AC_ARG_ENABLE(string,
  289. [ --disable-string=[no/yes] no string API (this will disable ID3v2; main mpg123 won't build anymore) ],
  290. [
  291. if test "x$enableval" = xno; then
  292. string="disabled"
  293. fi
  294. ], [])
  295. if test "x$string" = "xdisabled"; then
  296. AC_DEFINE(NO_STRING, 1, [ Define to disable string functions. ])
  297. id3v2=disabled
  298. AC_MSG_WARN([ID3v2 support disabled because of string API being disabled.])
  299. else
  300. DECODER_OBJ="$DECODER_OBJ stringbuf.\$(OBJEXT)"
  301. DECODER_LOBJ="$DECODER_LOBJ stringbuf.lo"
  302. fi
  303. if test "x$id3v2" = "xdisabled"; then
  304. AC_DEFINE(NO_ID3V2, 1, [ Define to disable ID3v2 parsing. ])
  305. fi
  306. icy=enabled
  307. AC_ARG_ENABLE(icy,
  308. [ --disable-icy=[no/yes] no ICY metainfo parsing/conversion (main mpg123 won't build!) ],
  309. [
  310. if test "x$enableval" = xno; then
  311. icy="disabled"
  312. fi
  313. ], [])
  314. if test "x$icy" = "xdisabled"; then
  315. AC_DEFINE(NO_ICY, 1, [ Define to disable ICY handling. ])
  316. else
  317. DECODER_OBJ="$DECODER_OBJ icy.\$(OBJEXT) icy2utf8.\$(OBJEXT)"
  318. DECODER_LOBJ="$DECODER_LOBJ icy.lo icy2utf8.lo"
  319. fi
  320. ntom=enabled
  321. AC_ARG_ENABLE(ntom,
  322. [ --disable-ntom=[no/yes] no flexible resampling ],
  323. [
  324. if test "x$enableval" = xno; then
  325. ntom="disabled"
  326. fi
  327. ], [])
  328. if test "x$ntom" = "xdisabled"; then
  329. AC_DEFINE(NO_NTOM, 1, [ Define to disable ntom resampling. ])
  330. else
  331. DECODER_OBJ="$DECODER_OBJ ntom.\$(OBJEXT)"
  332. DECODER_LOBJ="$DECODER_LOBJ ntom.lo"
  333. fi
  334. downsample=enabled
  335. AC_ARG_ENABLE(downsample,
  336. [ --disable-downsample=[no/yes] no downsampled decoding ],
  337. [
  338. if test "x$enableval" = xno; then
  339. downsample="disabled"
  340. fi
  341. ], [])
  342. if test "x$downsample" = "xdisabled"; then
  343. AC_DEFINE(NO_DOWNSAMPLE, 1, [ Define to disable downsampled decoding. ])
  344. fi
  345. feeder=enabled
  346. AC_ARG_ENABLE(feeder,
  347. [ --disable-feeder=[no/yes] no feeder decoding, no buffered readers ],
  348. [
  349. if test "x$enableval" = xno; then
  350. feeder="disabled"
  351. fi
  352. ], [])
  353. if test "x$feeder" = "xdisabled"; then
  354. AC_DEFINE(NO_FEEDER, 1, [ Define to disable feeder and buffered readers. ])
  355. fi
  356. messages=enabled
  357. AC_ARG_ENABLE(messages,
  358. [ --disable-messages=[no/yes] no error/warning messages on the console ],
  359. [
  360. if test "x$enableval" = xno; then
  361. messages="disabled"
  362. fi
  363. ], [])
  364. if test "x$messages" = "xdisabled"; then
  365. AC_DEFINE(NO_WARNING, 1, [ Define to disable warning messages. ])
  366. AC_DEFINE(NO_ERRORMSG, 1, [ Define to disable error messages. ])
  367. AC_DEFINE(NO_ERETURN, 1, [ Define to disable error messages in combination with a return value (the return is left intact). ])
  368. fi
  369. newhuff=enabled
  370. AC_ARG_ENABLE(new-huffman,
  371. [ --enable-new-huffman=[yes/no] use new huffman decoding scheme by Taihei (faster on modern CPUs at least, so on by default) ],
  372. [
  373. if test "x$enableval" = xno; then
  374. newhuff=disabled
  375. fi
  376. ]
  377. , [])
  378. if test "x$newhuff" = "xenabled"; then
  379. AC_DEFINE(USE_NEW_HUFFTABLE, 1, [ Define for new Huffman decoding scheme. ])
  380. fi
  381. integers=fast
  382. AC_ARG_ENABLE(int-quality,
  383. [ --enable-int-quality=[yes/no] use rounding instead of fast truncation for integer output, where possible ],
  384. [
  385. if test "x$enableval" = xyes; then
  386. integers=quality
  387. AC_DEFINE(ACCURATE_ROUNDING, 1, [ Define to use proper rounding. ])
  388. fi
  389. ], [])
  390. int16=enabled
  391. AC_ARG_ENABLE(16bit,
  392. [ --disable-16bit=[no/yes] no 16 bit integer output ],
  393. [
  394. if test "x$enableval" = xno; then
  395. int16="disabled"
  396. fi
  397. ], [])
  398. int8=enabled
  399. AC_ARG_ENABLE(8bit,
  400. [ --disable-8bit=[no/yes] no 8 bit integer output ],
  401. [
  402. if test "x$enableval" = xno; then
  403. int8="disabled"
  404. fi
  405. ], [])
  406. int32=enabled
  407. AC_ARG_ENABLE(32bit,
  408. [ --disable-32bit=[no/yes] no 32 bit integer output (also 24 bit) ],
  409. [
  410. if test "x$enableval" = xno; then
  411. int32="disabled"
  412. fi
  413. ], [])
  414. real=enabled
  415. AC_ARG_ENABLE(real,
  416. [ --disable-real=[no/yes] no real (floating point) output ],
  417. [
  418. if test "x$enableval" = xno; then
  419. real="disabled"
  420. fi
  421. ], [])
  422. equalizer=enabled
  423. AC_ARG_ENABLE(equalizer,
  424. [ --disable-equalizer=[no/yes] no equalizer support ],
  425. [
  426. if test "x$enableval" = xno; then
  427. equalizer="disabled"
  428. fi
  429. ], [])
  430. AC_ARG_WITH([cpu], [
  431. --with-cpu=generic[[_fpu]] Use generic processor code with floating point arithmetic
  432. --with-cpu=generic_float Plain alias to generic_fpu now... float output is a normal runtime option!
  433. --with-cpu=generic_nofpu Use generic processor code with fixed point arithmetic (p.ex. ARM)
  434. --with-cpu=generic_dither Use generic processor code with floating point arithmetic and dithering for 1to1 16bit decoding.
  435. --with-cpu=i386[[_fpu]] Use code optimized for i386 processors with floating point arithmetic
  436. --with-cpu=i386_nofpu Use code optimized for i386 processors with fixed point arithmetic
  437. --with-cpu=i486 Use code optimized for i486 processors (only usable alone!)
  438. --with-cpu=i586 Use code optimized for i586 processors
  439. --with-cpu=i586_dither Use code optimized for i586 processors with dithering (noise shaping), adds 256K to binary size
  440. --with-cpu=3dnow Use code optimized for 3DNow processors
  441. --with-cpu=3dnow_vintage Use code optimized for older 3DNow processors (K6 family)
  442. --with-cpu=3dnowext Use code optimized for 3DNowExt processors (K6-3+, Athlon)
  443. --with-cpu=3dnowext_alone Really only 3DNowExt decoder, without 3DNow fallback for flexible rate
  444. --with-cpu=3dnow_vintage Use code optimized for older extended 3DNow processors (like K6-III+)
  445. --with-cpu=mmx Use code optimized for MMX processors
  446. --with-cpu=mmx_alone Really only MMX decoder, without i586 fallback for flexible rate
  447. --with-cpu=sse Use code optimized for SSE processors
  448. --with-cpu=sse_vintage Use code optimized for older SSE processors (plain C DCT36)
  449. --with-cpu=sse_alone Really only SSE decoder, without i586 fallback for flexible rate
  450. --with-cpu=avx Use code optimized for x86-64 with AVX processors
  451. --with-cpu=x86 Pack all x86 opts into one binary (excluding i486, including dither)
  452. --with-cpu=x86-64 Use code optimized for x86-64 processors (AMD64 and Intel64, including AVX and dithered generic)
  453. --with-cpu=altivec Use code optimized for Altivec processors (PowerPC G4 and G5)
  454. --with-cpu=ppc_nofpu Use code optimized for PowerPC processors with fixed point arithmetic
  455. --with-cpu=neon Use code optimized for ARM NEON SIMD engine (Cortex-A series)
  456. --with-cpu=arm_fpu Pack neon and generic[[_dither]] decoders, for ARM processors with FPU and/or NEON
  457. --with-cpu=arm_nofpu Use code optimized for ARM processors with fixed point arithmetic
  458. --with-cpu=neon64 Use code optimized for AArch64 NEON SIMD engine
  459. --with-cpu=aarch64 Pack neon64 and generic[[_dither]] decoders, for 64bit ARM processors
  460. ])
  461. use_yasm=auto
  462. AC_ARG_ENABLE(yasm,
  463. [ --enable-yasm=[no/yes] enforce yasm instad of default assembler for some optimizations (AVX, currently) ],
  464. [
  465. if test "x$enableval" = xyes; then
  466. use_yasm="enabled"
  467. else
  468. use_yasm="disabled"
  469. fi
  470. ], [])
  471. AC_ARG_ENABLE(ieeefloat,
  472. [ --enable-ieeefloat=[yes/no] use special hackery relying on IEEE 754 floating point storage format (to accurately round to 16 bit integer at bit more efficiently in generic decoder, enabled by default, disable in case you have a very special computer) ],
  473. [
  474. if test "x$enableval" = xyes; then
  475. ieee=enabled
  476. else
  477. ieee=disabled
  478. fi
  479. ], [ ieee=enabled ])
  480. if test "x$ieee" = xenabled; then
  481. echo "We assume IEEE754 floating point format."
  482. AC_DEFINE(IEEE_FLOAT, 1, [ Define to indicate that float storage follows IEEE754. ])
  483. fi
  484. sys_cppflags=
  485. newoldwritesample=disabled
  486. case $host in
  487. aarch64-*linux*|arm64-*linux*|aarch64-*bsd*|arm64-*bsd*|aarch64-apple-darwin*|arm64-apple-darwin*)
  488. cpu_type="aarch64"
  489. ;;
  490. arm*-*-linux*-*eabihf|armv7hl*-*-linux*)
  491. cpu_type="arm_fpu"
  492. ;;
  493. arm*-*-linux*)
  494. # check that... perhaps we are better off on arm with kernel math emulation
  495. cpu_type="arm_nofpu"
  496. ;;
  497. armv7*-apple-darwin*)
  498. cpu_type="arm_fpu"
  499. ;;
  500. i386-*-linux*|i386-*-kfreebsd*-gnu)
  501. cpu_type="i386_fpu"
  502. newoldwritesample=enabled
  503. ;;
  504. i486-*-linux*|i486-*-kfreebsd*-gnu)
  505. cpu_type="i486"
  506. newoldwritesample=enabled
  507. ;;
  508. i586-*-linux*|i586-*-kfreebsd*-gnu)
  509. cpu_type="x86"
  510. newoldwritesample=enabled
  511. ;;
  512. i686-*-linux*|i686-*-kfreebsd*-gnu)
  513. cpu_type="x86"
  514. newoldwritesample=enabled
  515. ;;
  516. x86_64-*-linux*|x86_64-*-kfreebsd*-gnu)
  517. cpu_type="x86-64"
  518. ;;
  519. *-*-linux*|*-*-kfreebsd*-gnu)
  520. cpu_type="generic_fpu"
  521. ;;
  522. i?86-apple-darwin10*)
  523. AC_MSG_CHECKING([if CPU type supports x86-64])
  524. case `sysctl -n hw.optional.x86_64` in
  525. 1)
  526. AC_MSG_RESULT([yes])
  527. cpu_type="x86-64"
  528. ;;
  529. *)
  530. AC_MSG_RESULT([no])
  531. cpu_type="x86"
  532. newoldwritesample=enabled
  533. ;;
  534. esac
  535. ;;
  536. i?86-apple-darwin*)
  537. cpu_type="x86"
  538. newoldwritesample=enabled
  539. ;;
  540. x86_64-apple-darwin*)
  541. cpu_type="x86-64"
  542. ;;
  543. *-apple-darwin*)
  544. AC_MSG_CHECKING([if CPU type supports AltiVec])
  545. case `machine` in
  546. ppc7400 | ppc7450 | ppc970)
  547. AC_MSG_RESULT([yes])
  548. cpu_type="altivec"
  549. ;;
  550. *)
  551. AC_MSG_RESULT([no])
  552. cpu_type="generic_fpu"
  553. ;;
  554. esac
  555. ;;
  556. i?86-*-dragonfly* | i?86-*-freebsd* | i?86-*-midnightbsd* | i?86-*-mirbsd* | i?86-*-netbsd* | i?86-*-openbsd* | i?86-*-haiku*)
  557. cpu_type="x86"
  558. newoldwritesample=enabled
  559. ;;
  560. x86_64-*-dragonfly* | x86_64-*-freebsd* | x86_64-*-midnightbsd* | x86_64-*-mirbsd* | x86_64-*-netbsd* | x86_64-*-openbsd* | x86_64-*-haiku*)
  561. cpu_type="x86-64"
  562. ;;
  563. *-*-dragonfly* | *-*-freebsd* | *-*-midnightbsd* | *-*-mirbsd* | *-*-netbsd* | *-*-openbsd*)
  564. cpu_type="generic_fpu"
  565. ;;
  566. i386-*-solaris*)
  567. cpu_type=x86
  568. newoldwritesample=enabled
  569. ;;
  570. x86_64-*-solaris*)
  571. cpu_type=x86-64
  572. ;;
  573. *-*-solaris*)
  574. cpu_type="generic_fpu"
  575. ;;
  576. # os2-emx = OS/2 with some Unix fun; so p.ex. buffer works.
  577. # Till we sorted out the assembler troubles, generic CPU is default.
  578. i386-pc-os2-emx)
  579. cpu_type=generic_fpu
  580. newoldwritesample=enabled
  581. ;;
  582. x86_64-pc-os2-emx)
  583. # We are optimistic hat the future knows OS/2 on x86-64;-)
  584. cpu_type=generic_fpu
  585. ;;
  586. *-pc-os2-emx)
  587. cpu_type="generic_fpu"
  588. ;;
  589. *-dec-osf*)
  590. cpu_type="generic_fpu"
  591. ;;
  592. x86_64-*-cygwin*)
  593. cpu_type="x86-64"
  594. ;;
  595. i686-*-cygwin*)
  596. cpu_type="x86"
  597. newoldwritesample=enabled
  598. ;;
  599. i586-*-cygwin*)
  600. cpu_type="x86"
  601. newoldwritesample=enabled
  602. ;;
  603. i486-*-cygwin*)
  604. cpu_type="i486"
  605. newoldwritesample=enabled
  606. ;;
  607. i386-*-cygwin*)
  608. cpu_type="i386"
  609. newoldwritesample=enabled
  610. ;;
  611. *-cygwin*)
  612. cpu_type="generic_fpu"
  613. ;;
  614. i@<:@3-7@:>@86-*-mingw32*)
  615. LIBS="$LIBS"
  616. buffer=disabled
  617. cpu_type="x86"
  618. newoldwritesample=enabled
  619. ;;
  620. x86_64-*-mingw32*)
  621. LIBS="$LIBS"
  622. buffer=disabled
  623. cpu_type="x86-64"
  624. ;;
  625. i386-*-nto-qnx*)
  626. cpu_type="x86"
  627. newoldwritesample=enabled
  628. ;;
  629. *-ibm-aix*)
  630. AC_MSG_WARN([AIX system detected. You might want to --disable-largefile when trouble about conflicting types for lseek64 and friends occurs.])
  631. # Altivec instead? It is developed for MacOS ...
  632. cpu_type=generic_fpu
  633. # no struct winsize without _ALL_SOURCE
  634. sys_cppflags=-D_ALL_SOURCE
  635. ;;
  636. i386-*)
  637. AC_MSG_WARN([Unknown host operating system])
  638. cpu_type="i386"
  639. buffer=disabled
  640. sys_cppflags=-DGENERIC
  641. newoldwritesample=enabled
  642. ;;
  643. i486-*)
  644. AC_MSG_WARN([Unknown host operating system])
  645. cpu_type="i486"
  646. buffer=disabled
  647. sys_cppflags=-DGENERIC
  648. newoldwritesample=enabled
  649. ;;
  650. i586-*)
  651. AC_MSG_WARN([Unknown host operating system])
  652. cpu_type="x86"
  653. buffer=disabled
  654. sys_cppflags=-DGENERIC
  655. newoldwritesample=enabled
  656. ;;
  657. i686-*)
  658. AC_MSG_WARN([Unknown host operating system])
  659. cpu_type="x86"
  660. buffer=disabled
  661. sys_cppflags=-DGENERIC
  662. newoldwritesample=enabled
  663. ;;
  664. x86_64-*)
  665. AC_MSG_WARN([Unknown host operating system])
  666. cpu_type="x86-64"
  667. buffer=disabled
  668. sys_cppflags=-DGENERIC
  669. ;;
  670. *)
  671. AC_MSG_WARN([Unknown host operating system])
  672. cpu_type="generic_fpu"
  673. buffer=disabled
  674. sys_cppflags=-DGENERIC
  675. ;;
  676. esac
  677. AC_ARG_ENABLE(buffer,
  678. [ --enable-buffer=[yes/no] disable audio buffer code (default uses system whitelist... proper checks later) ],
  679. [
  680. if test "x$enableval" = xyes
  681. then
  682. echo "Note: Enabling buffer per request... perhaps it will not build anyway."
  683. buffer="enabled"
  684. else
  685. echo "Note: Disabling buffer per request."
  686. buffer="disabled"
  687. fi
  688. ]
  689. )
  690. AC_ARG_ENABLE(newoldwritesample,
  691. [ --enable-newoldwritesample=[no/yes] enable new/old WRITE_SAMPLE macro for non-accurate 16 bit output, faster on certain CPUs (default on on x86-32)],
  692. [
  693. if test "x$enableval" = xyes
  694. then
  695. newoldwritesample=enabled
  696. else
  697. newoldwritesample=disabled
  698. fi
  699. ])
  700. dnl Did user choose other CPU type ?
  701. if test "x$with_cpu" != "x"; then
  702. cpu_type=$with_cpu
  703. fi
  704. # Flag for 32 bit synth output or post-processing.
  705. case "$cpu_type" in
  706. *_nofpu)
  707. synth32=false
  708. AC_DEFINE(NO_SYNTH32, 1, [ Define for post-processed 32 bit formats. ])
  709. ;;
  710. *)
  711. synth32=true
  712. ;;
  713. esac
  714. if test "x$int16" = "xdisabled"; then
  715. AC_DEFINE(NO_16BIT, 1, [ Define to disable 16 bit integer output. ])
  716. else
  717. DECODER_OBJ="$DECODER_OBJ synth.\$(OBJEXT)"
  718. DECODER_LOBJ="$DECODER_LOBJ synth.lo"
  719. fi
  720. # 8bit works only through 16bit
  721. if test "x$int16" = "xdisabled"; then
  722. int8=disabled
  723. fi
  724. if test "x$int8" = "xdisabled"; then
  725. AC_DEFINE(NO_8BIT, 1, [ Define to disable 8 bit integer output. ])
  726. else
  727. DECODER_OBJ="$DECODER_OBJ synth_8bit.\$(OBJEXT)"
  728. DECODER_LOBJ="$DECODER_LOBJ synth_8bit.lo"
  729. fi
  730. if test "x$int32" = "xdisabled"; then
  731. AC_DEFINE(NO_32BIT, 1, [ Define to disable 32 bit and 24 bit integer output. ])
  732. else
  733. if $synth32; then
  734. s_fpu="$s_fpu synth_s32"
  735. fi
  736. fi
  737. if test "x$real" = "xdisabled"; then
  738. AC_DEFINE(NO_REAL, 1, [ Define to disable real output. ])
  739. else
  740. if $synth32; then
  741. s_fpu="$s_fpu synth_real"
  742. fi
  743. fi
  744. if test "x$equalizer" = "xdisabled"; then
  745. AC_DEFINE(NO_EQUALIZER, 1, [ Define to disable equalizer. ])
  746. fi
  747. layer1=enabled
  748. AC_ARG_ENABLE(layer1,
  749. [ --disable-layer1=[no/yes] no layer I decoding ],
  750. [
  751. if test "x$enableval" = xno; then
  752. layer1="disabled"
  753. fi
  754. ], [])
  755. if test "x$layer1" = "xdisabled"; then
  756. AC_DEFINE(NO_LAYER1, 1, [ Define to disable layer I. ])
  757. else
  758. # layer1 needs code in layer2
  759. DECODER_OBJ="$DECODER_OBJ layer1.\$(OBJEXT) layer2.\$(OBJEXT)"
  760. DECODER_LOBJ="$DECODER_LOBJ layer1.lo layer2.lo"
  761. fi
  762. layer2=enabled
  763. AC_ARG_ENABLE(layer2,
  764. [ --disable-layer2=[no/yes] no layer II decoding ],
  765. [
  766. if test "x$enableval" = xno; then
  767. layer2="disabled"
  768. fi
  769. ], [])
  770. if test "x$layer2" = "xdisabled"; then
  771. AC_DEFINE(NO_LAYER2, 1, [ Define to disable layer II. ])
  772. else
  773. # layer1 may have added the objects already
  774. if test "x$layer1" = "xdisabled"; then
  775. DECODER_OBJ="$DECODER_OBJ layer2.\$(OBJEXT)"
  776. DECODER_LOBJ="$DECODER_LOBJ layer2.lo"
  777. fi
  778. fi
  779. layer3=enabled
  780. AC_ARG_ENABLE(layer3,
  781. [ --disable-layer3=[no/yes] no layer III decoding ],
  782. [
  783. if test "x$enableval" = xno; then
  784. layer3="disabled"
  785. fi
  786. ], [])
  787. if test "x$layer3" = "xdisabled"; then
  788. AC_DEFINE(NO_LAYER3, 1, [ Define to disable layer III. ])
  789. else
  790. DECODER_OBJ="$DECODER_OBJ layer3.\$(OBJEXT)"
  791. DECODER_LOBJ="$DECODER_LOBJ layer3.lo"
  792. fi
  793. AC_ARG_WITH([audio], [
  794. --with-audio=<list of modules> Select a list (or only one) of audio output modules (comma or space separated list).
  795. ])
  796. AC_ARG_WITH([default-audio], [
  797. --with-default-audio=aix Use AIX as default audio output sub-system
  798. --with-default-audio=alib Use Alib as default audio output sub-system (for HPUX)
  799. --with-default-audio=alsa Use ALSA as default audio output sub-system (libasound)
  800. --with-default-audio=tinyalsa Use ALSA as default audio output sub-system (tinyalsa)
  801. --with-default-audio=arts Use aRts as default audio output sub-system (KDE sound server)
  802. --with-default-audio=dummy Use dummy as default audio (when no sound card is available)
  803. --with-default-audio=esd Use ESoundD as default audio output sub-system
  804. --with-default-audio=hp Use HP as default audio output sub-system
  805. --with-default-audio=jack Use JACK as default low-latency audio server
  806. --with-default-audio=coreaudio Use Mac OS X as default audio output sub-system (CoreAudio)
  807. --with-default-audio=mint Use MinT as default audio output sub-system (Atari)
  808. --with-default-audio=nas Use NAS as default audio output (Network Audio System)
  809. --with-default-audio=os2 Use OS2 as default audio output sub-system
  810. --with-default-audio=oss Use OSS as default audio output sub-system (/dev/dsp)
  811. --with-default-audio=portaudio Use PortAudio as default audio output sub-system
  812. --with-default-audio=pulse Use Pulse audio server as default audio output sub-system
  813. --with-default-audio=qsa Use QSA as default audio output sub-system
  814. --with-default-audio=sdl Use SDL as default audio output sub-system (Simple DirectMedia Layer)
  815. --with-default-audio=sgi Use SGI as default audio output sub-system (IRIX)
  816. --with-default-audio=sndio Use OpenBSD's sndio as default audio output sub-system
  817. --with-default-audio=sun Use Sun as default audio output sub-system (/dev/audio)
  818. --with-default-audio=win32 Use Win32 audio as default audio output sub-system
  819. --with-default-audio=win32_wasapi Use Win32 wasapi audio as default audio output sub-system
  820. ])
  821. AC_ARG_WITH([optimization], [
  822. --with-optimization=0 No Optimization
  823. --with-optimization=1 Limited Optimization (-O) (for gcc)
  824. --with-optimization=2 Default Optimization (-O2 ...) (for gcc)
  825. --with-optimization=3 More Optimize than default (-O3 ...) (for gcc)
  826. --with-optimization=4 Optimize yet more (-O4 ...) (for gcc)
  827. ])
  828. AC_ARG_WITH([seektable], [
  829. --with-seektable=<size> choose size of seek index table (0 disables it), default 1000
  830. ])
  831. dnl ############## Modules
  832. # Dummy audio output module is always supported
  833. output_modules="dummy"
  834. dnl ############## Assembler, compiler properties
  835. # based on posting from John Dalgliesh <[email protected]> on ffmpeg (LGPL) mailing list
  836. # extended to use balign if present
  837. AC_MSG_CHECKING([if .balign is present])
  838. echo '.balign 4' > conftest.s
  839. if $CCAS -c -o conftest.o conftest.s 1>/dev/null 2>&1; then
  840. AC_MSG_RESULT([yes])
  841. AC_DEFINE(ASMALIGN_BALIGN, 1, [ Define if .balign is present. ])
  842. else
  843. AC_MSG_RESULT([no])
  844. # find if .align arg is power-of-two or not
  845. asmalign_exp="unknown"
  846. if test x"$asmalign_exp" = xunknown; then
  847. AC_MSG_CHECKING([if .align takes 2-exponent])
  848. asmalign_exp="no"
  849. echo '.align 3' > conftest.s
  850. if $CCAS -c -o conftest.o conftest.s 1>/dev/null 2>&1; then
  851. asmalign_exp="yes"
  852. AC_MSG_RESULT([yes])
  853. else
  854. AC_MSG_RESULT([no])
  855. fi
  856. rm -f conftest.o conftest.s
  857. fi
  858. if test x"$asmalign_exp" = xyes; then
  859. AC_DEFINE(ASMALIGN_EXP, 1, [ Define if .align takes 3 for alignment of 2^3=8 bytes instead of 8. ])
  860. else
  861. AC_DEFINE(ASMALIGN_BYTE, 1, [ Define if .align just takes byte count. ])
  862. fi
  863. fi
  864. ccalign="unknown"
  865. if test x"$ccalign" = xunknown; then
  866. AC_MSG_CHECKING([__attribute__((aligned(16)))])
  867. ccalign="no"
  868. echo '__attribute__((aligned(16))) float var;' > conftest.c
  869. if $CC -c -o conftest.o conftest.c >/dev/null 2>&1; then
  870. ccalign="yes"
  871. AC_MSG_RESULT([yes])
  872. else
  873. AC_MSG_RESULT([no])
  874. fi
  875. rm -f conftest.o conftest.c
  876. fi
  877. dnl We apply alignment hints only to cpus that need it.
  878. dnl See further below for the definition of CCALIGN
  879. avx_support="unknown"
  880. if test x"$avx_support" = xunknown; then
  881. AC_MSG_CHECKING([if assembler supports AVX instructions])
  882. avx_support="no"
  883. echo '.text' > conftest.s
  884. echo 'vaddps %ymm0,%ymm0,%ymm0' >> conftest.s
  885. if $CCAS -c -o conftest.o conftest.s 1>/dev/null 2>&1; then
  886. avx_support="yes"
  887. AC_MSG_RESULT([yes])
  888. else
  889. AC_MSG_RESULT([no])
  890. fi
  891. rm -f conftest.o conftest.s
  892. fi
  893. check_yasm=no
  894. if test x"$avx_support" = xno || test x"$use_yasm" = xenabled; then
  895. check_yasm=yes
  896. fi
  897. if test x"$use_yasm" = xdisabled; then
  898. check_yasm=no
  899. fi
  900. if test x"$check_yasm" = xyes; then
  901. AC_CHECK_PROGS(YASM,[yasm],no)
  902. if test x"$YASM" != xno; then
  903. AC_MSG_CHECKING([if $YASM supports GAS syntax and AVX instructions])
  904. echo '.text' > conftest.s
  905. echo 'vaddps %ymm0,%ymm0,%ymm0' >> conftest.s
  906. if $YASM -pgas -rcpp -o conftest.o conftest.s 1>/dev/null 2>&1; then
  907. avx_support="yes"
  908. YASMFLAGS="-pgas -rgas -mamd64"
  909. AC_MSG_RESULT([yes])
  910. else
  911. AC_MSG_RESULT([no])
  912. fi
  913. rm -f conftest.o conftest.s
  914. else
  915. if test x"$use_yasm" = xenabled; then
  916. AC_MSG_ERROR([Yasm enforced but not found!])
  917. fi
  918. fi
  919. else
  920. YASM="no"
  921. fi
  922. if test "x$cpu_type" = "xavx"; then
  923. if test "x$avx_support" != "xyes"; then
  924. AC_MSG_ERROR([Assembler doesn't understand AVX instructions.])
  925. fi
  926. fi
  927. AC_SUBST(YASM)
  928. AC_SUBST(YASMFLAGS)
  929. dnl ############## Really basic headers, needed for other checks.
  930. AC_HEADER_STDC
  931. dnl Is it too paranoid to specifically check for stdint.h and limits.h?
  932. AC_CHECK_HEADERS([stdio.h stdlib.h string.h unistd.h sched.h sys/ioctl.h sys/types.h stdint.h limits.h inttypes.h sys/time.h sys/wait.h sys/resource.h sys/signal.h signal.h sys/select.h dirent.h sys/stat.h])
  933. dnl ############## Types
  934. dnl Large file support stuff needs cleanup. There are superfluous variables.
  935. dnl Detect large file support, enable switches if needed.
  936. AC_SYS_LARGEFILE
  937. dnl If we do have a switch for large files, rename off_t-aware API calls.
  938. dnl Using the file_offset_bits variable here is fine for linux (possibly Solaris),
  939. dnl Others... we'll have to see.
  940. dnl Note: I started writing this with with multiline replacements.
  941. dnl Does not work. Automake insists on putting these into Makefiles where they break things.
  942. dnl It is also assumed that a system that does not set file offset bits is not
  943. dnl sensitive to largefile changes, i.e. FreeBSD always using 64 bit off_t.
  944. if test "x$ac_cv_sys_file_offset_bits" = x || echo "$ac_cv_sys_file_offset_bits" | $GREP '@<:@^0-9@:>@' > /dev/null; then
  945. dnl if it has non-numeric chars or is empty... ignore...
  946. LFS_LOBJ=
  947. largefile_sensitive=no
  948. else
  949. # Add dual-mode wrapper code.
  950. LFS_LOBJ=lfs_wrap.lo
  951. largefile_sensitive=yes
  952. fi
  953. # Using the lower level macros instead of AC_TYPE_* for compatibility with not freshest autoconf.
  954. AC_CHECK_TYPE(size_t, unsigned long)
  955. AC_CHECK_TYPE(uintptr_t, unsigned long)
  956. AC_CHECK_TYPE(ssize_t, long)
  957. AC_CHECK_TYPE(off_t, long int)
  958. AC_CHECK_TYPE(int32_t, int)
  959. AC_CHECK_TYPE(int64_t, long long)
  960. AC_CHECK_TYPE(uint32_t, unsigned int)
  961. AC_CHECK_TYPE(int16_t, short)
  962. AC_CHECK_TYPE(uint16_t, unsigned short)
  963. AC_CHECK_SIZEOF(size_t,4)
  964. AC_CHECK_SIZEOF(ssize_t,4)
  965. AC_CHECK_SIZEOF(off_t,4)
  966. AC_CHECK_SIZEOF(int32_t)
  967. AC_CHECK_SIZEOF(long,4)
  968. dnl The native type used for aliases is what off_t maps to without any largefile-
  969. dnl enabling switches. So, it's long int if the system is largefile-senstive,
  970. dnl but it is actual plain off_t if the system does not have such switches.
  971. if test "x$largefile_sensitive" = xyes; then
  972. lfs_alias_type=long
  973. lfs_alias_size=$ac_cv_sizeof_long
  974. else
  975. lfs_alias_type=off_t
  976. lfs_alias_size=$ac_cv_sizeof_off_t
  977. fi
  978. if test "x$lfs_alias_size" = "x"; then
  979. AC_MSG_ERROR([Cannot determine sizeof(lfs_alias_t)?])
  980. else
  981. LFS_ALIAS_BITS=`expr "$lfs_alias_size" "*" "8"`
  982. AC_DEFINE_UNQUOTED([lfs_alias_t], $lfs_alias_type,
  983. [Define to the native offset type (long or actually off_t).])
  984. AC_DEFINE_UNQUOTED([LFS_ALIAS_BITS], $LFS_ALIAS_BITS,
  985. [Define this to the size of native offset type in bits, used for LFS alias functions.])
  986. fi
  987. lfs_alias=enabled
  988. AC_ARG_ENABLE(lfs-alias,
  989. [ --disable-lfs-alias disable alias wrappers for largefile bitness (mpg123_seek_32 or mpg123_seek_64 in addition to mpg123_seek, or the other way around; It is a mess, do not play with this!) ],
  990. [
  991. if test "x$enableval" = xno; then
  992. lfs_alias="disabled"
  993. fi
  994. ],
  995. [
  996. case $host in
  997. *-cygwin*)
  998. lfs_alias="disabled"
  999. AC_MSG_NOTICE([lfs-alias disabled for Cygwin, use --enable-lfs-alias explicitly to enable, only if you know what you are doing])
  1000. ;;
  1001. esac
  1002. ])
  1003. AC_MSG_CHECKING([if we want to enable alias wrappers for largefile])
  1004. if test "x$lfs_alias" = "xenabled"; then
  1005. AC_MSG_RESULT([yes])
  1006. LFS_LOBJ="$LFS_LOBJ lfs_alias.lo"
  1007. else
  1008. AC_MSG_RESULT([no])
  1009. fi
  1010. # Again, prepend path for non-recursive make.
  1011. LFS_LOBJ=`for i in $LFS_LOBJ; do printf ' src/libmpg123/%s' $i; done`
  1012. AC_SUBST(LFS_LOBJ)
  1013. dnl ############## Function Checks
  1014. AC_FUNC_MMAP
  1015. # Check if system supports termios
  1016. AC_SYS_POSIX_TERMIOS
  1017. if test "x$ac_cv_sys_posix_termios" = "xyes"; then
  1018. AC_DEFINE_UNQUOTED([HAVE_TERMIOS], 1,
  1019. [Define this if you have the POSIX termios library])
  1020. fi
  1021. AC_CHECK_FUNCS( random )
  1022. # Check for sched_setscheduler
  1023. AC_CHECK_FUNCS( sched_setscheduler setuid getuid)
  1024. # Check for setpriority
  1025. AC_CHECK_FUNCS( setpriority )
  1026. AC_CHECK_FUNCS( strerror )
  1027. AC_CHECK_FUNCS( setlocale nl_langinfo )
  1028. AC_CHECK_FUNCS( atoll )
  1029. AC_CHECK_FUNCS( mkfifo, [ have_mkfifo=yes ], [ have_mkfifo=no ] )
  1030. dnl ############## Header and Library Checks
  1031. # locale headers
  1032. AC_CHECK_HEADERS([locale.h langinfo.h])
  1033. # Headers for network (http) stuff
  1034. network_type=Unknown
  1035. AC_CHECK_HEADERS([netdb.h sys/param.h sys/socket.h netinet/in.h arpa/inet.h])
  1036. if test "x$ac_cv_header_netdb_h" = "xyes" &&
  1037. test "x$ac_cv_header_sys_param_h" = "xyes" &&
  1038. test "x$ac_cv_header_sys_socket_h" = "xyes" &&
  1039. test "x$ac_cv_header_netinet_in_h" = "xyes" &&
  1040. test "x$ac_cv_header_arpa_inet_h" = "xyes"; then
  1041. have_network=yes
  1042. network_type=Posix
  1043. else
  1044. have_network=no
  1045. fi
  1046. dnl trying to get that socket lib settled in one line
  1047. AC_SEARCH_LIBS(gethostbyname, nsl socket network)
  1048. dnl OK, two lines... Solaris needs -lnsl -lsocket
  1049. AC_SEARCH_LIBS(socket, socket)
  1050. AC_CHECK_FUNCS( getaddrinfo, [ have_ipv6=yes ], [ have_ipv6=no ] )
  1051. APR_CHECK_GETADDRINFO_ADDRCONFIG()
  1052. # Substitutions for the installable mpg123.h header
  1053. if test "x$ac_cv_header_stdio_h" = "xyes"; then
  1054. INCLUDE_STDIO_H="#include <stdio.h>"
  1055. else
  1056. INCLUDE_STDIO_H="/* #include <stdio.h> is not available on this system */"
  1057. fi
  1058. AC_SUBST(INCLUDE_STDIO_H)
  1059. if test "x$ac_cv_header_stdlib_h" = "xyes"; then
  1060. INCLUDE_STDLIB_H="#include <stdlib.h>"
  1061. else
  1062. INCLUDE_STDLIB_H="/* #include <stdlib.h> is not available on this system */"
  1063. fi
  1064. AC_SUBST(INCLUDE_STDLIB_H)
  1065. if test "x$ac_cv_header_sys_types_h" = "xyes"; then
  1066. INCLUDE_SYS_TYPE_H="#include <sys/types.h>"
  1067. else
  1068. INCLUDE_SYS_TYPE_H="/* #include <sys/types.h> is not available on this system */"
  1069. fi
  1070. AC_SUBST(INCLUDE_SYS_TYPE_H)
  1071. # Checks for maths libraries.
  1072. AC_CHECK_LIB([m], [sqrt])
  1073. AC_CHECK_LIB([mx], [powf])
  1074. # attempt to make the signal stuff work... also with GENERIC - later
  1075. #if test x"$ac_cv_header_sys_signal_h" = xyes; then
  1076. # AC_CHECK_FUNCS( sigemptyset sigaddset sigprocmask sigaction )
  1077. # if test x"$ac_cv_func_sigemptyset" = xyes &&
  1078. # test x"$ac_cv_func_sigaddset" = xyes &&
  1079. # test x"$ac_cv_func_sigprocmask" = xyes &&
  1080. # test x"$ac_cv_func_sigaction" = xyes; then
  1081. # AC_DEFINE(
  1082. #fi
  1083. dnl ############## Choose compiler flags and CPU
  1084. # do not assume gcc here, so no flags by default
  1085. ADD_CFLAGS=""
  1086. ADD_CPPFLAGS="$sys_cppflags"
  1087. ADD_LDFLAGS=""
  1088. LIBS="$LIBS"
  1089. # Consider moving that stuff.
  1090. AC_CHECK_HEADER([os2.h], [ADD_CPPFLAGS="$ADD_CPPFLAGS -DOS2"])
  1091. # On OS/2, we need to link to os2term to make terminal control actually work.
  1092. AC_CHECK_LIB([os2term], [tcsetattr], [ADD_LDFLAGS="$ADD_LDFLAGS -los2term"])
  1093. # If debugging is enabled, just enable debugging symbols.
  1094. # All other stuff enters nagging territory.
  1095. if test x"$debugging" = xenabled; then
  1096. ADD_CFLAGS="-g"
  1097. fi
  1098. # gcc specific...
  1099. if test x"$GCC" = xyes; then
  1100. if test x"$nagging" = xenabled; then
  1101. ADD_CFLAGS="$ADD_CFLAGS -Wall -Werror -std=c89 -pedantic -DPLAIN_C89"
  1102. fi
  1103. fi
  1104. dnl Only try the attribute_align_arg mumbo-jumbo on x86, x86-64 warns/errors out on that attribute.
  1105. dnl ...dunno even what about other architectures.
  1106. case $host in
  1107. i?86-*)
  1108. AC_DEFINE(ABI_ALIGN_FUN, 1, [ Define if your architecture wants/needs/can use attribute_align_arg and alignment checks. It is for 32bit x86... ])
  1109. ;;
  1110. esac
  1111. s_altivec="synth_altivec dct64_altivec"
  1112. s_i386="dct64_i386"
  1113. s_i486="$s_i386 synth_i486 dct64_i486"
  1114. s_i586="$s_i386 synth_i586"
  1115. s_i586d="$s_i386 synth_i586_dither"
  1116. s_3dnow="$s_i386 synth_3dnow dct64_3dnow equalizer_3dnow"
  1117. s_3dnowext="$s_i386 dct64_3dnowext tabinit_mmx synth_3dnowext"
  1118. s_3dnow_vintage=$s_3dnow
  1119. s_3dnowext_vintage=$s_3dnowext
  1120. if test "x$layer3" = "xenabled"; then
  1121. s_3dnow_vintage="$s_3dnow_vintage dct36_3dnow"
  1122. s_3dnowext_vintage="$s_3dnowext_vintage dct36_3dnowext"
  1123. fi
  1124. s_mmx="$s_i386 dct64_mmx tabinit_mmx synth_mmx"
  1125. s_sse_vintage="$s_i386 tabinit_mmx dct64_sse_float synth_sse_float synth_stereo_sse_float synth_sse_s32 synth_stereo_sse_s32 "
  1126. s_sse="$s_sse_vintage dct36_sse"
  1127. s_x86_64="dct36_x86_64 dct64_x86_64_float synth_x86_64_float synth_x86_64_s32 synth_stereo_x86_64_float synth_stereo_x86_64_s32"
  1128. s_x86_64_mono_synths="synth_x86_64_float synth_x86_64_s32"
  1129. s_x86_64_avx="dct36_avx dct64_avx_float synth_stereo_avx_float synth_stereo_avx_s32"
  1130. s_x86multi="getcpuflags"
  1131. s_x86_64_multi="getcpuflags_x86_64"
  1132. s_dither="dither"
  1133. s_neon="dct36_neon dct64_neon_float synth_neon_float synth_neon_s32 synth_stereo_neon_float synth_stereo_neon_s32"
  1134. s_neon64="dct36_neon64 dct64_neon64_float synth_neon64_float synth_neon64_s32 synth_stereo_neon64_float synth_stereo_neon64_s32"
  1135. s_arm_multi="getcpuflags_arm check_neon"
  1136. # choose optimized 16bit decoder for SSE, quality or fast
  1137. # note: supporting deactivation of output formats for these decoders would need more logic here
  1138. if test "x$integers" = "xquality"; then
  1139. s_sse="$s_sse synth_sse_accurate synth_stereo_sse_accurate"
  1140. s_sse_vintage="$s_sse_vintage synth_sse_accurate synth_stereo_sse_accurate"
  1141. s_x86_64="$s_x86_64 synth_x86_64_accurate synth_stereo_x86_64_accurate"
  1142. s_x86_64_mono_synths="$s_x86_64_mono_synths synth_x86_64_accurate"
  1143. s_x86_64_avx="$s_x86_64_avx synth_stereo_avx_accurate"
  1144. s_arm="synth_arm_accurate"
  1145. s_neon="$s_neon synth_neon_accurate synth_stereo_neon_accurate"
  1146. s_neon64="$s_neon64 synth_neon64_accurate synth_stereo_neon64_accurate"
  1147. else
  1148. s_sse="$s_sse dct64_sse synth_sse" # no stereo
  1149. s_sse_vintage="$s_sse_vintage dct64_sse synth_sse" # no stereo
  1150. s_x86_64="$s_x86_64 synth_x86_64 dct64_x86_64 synth_stereo_x86_64"
  1151. s_x86_64_mono_synths="$s_x86_64_mono_synths synth_x86_64"
  1152. s_x86_64_avx="$s_x86_64_avx dct64_avx synth_stereo_avx"
  1153. s_arm="synth_arm"
  1154. s_neon="$s_neon dct64_neon synth_neon synth_stereo_neon"
  1155. s_neon64="$s_neon64 dct64_neon64 synth_neon64 synth_stereo_neon64"
  1156. fi
  1157. dnl CPU specific compiler flags and sources
  1158. case $cpu_type in
  1159. generic)
  1160. ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_GENERIC -DREAL_IS_FLOAT"
  1161. more_sources="$s_fpu"
  1162. ccalign=no
  1163. ;;
  1164. generic_dither)
  1165. ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_GENERIC_DITHER -DREAL_IS_FLOAT"
  1166. more_sources="$s_fpu $s_dither"
  1167. ccalign=no
  1168. ;;
  1169. dnl Not disabling buffer for float mode... check that this is OK now!
  1170. generic_fpu | generic_float)
  1171. ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_GENERIC -DREAL_IS_FLOAT"
  1172. more_sources="$s_fpu"
  1173. ccalign=no
  1174. ;;
  1175. generic_nofpu)
  1176. ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_GENERIC -DREAL_IS_FIXED"
  1177. more_sources=
  1178. ccalign=no
  1179. ;;
  1180. ppc_nofpu)
  1181. ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_GENERIC -DOPT_PPC -DREAL_IS_FIXED"
  1182. more_sources=
  1183. ccalign=no
  1184. ;;
  1185. arm_nofpu)
  1186. ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_ARM -DREAL_IS_FIXED"
  1187. more_sources="$s_arm"
  1188. ccalign=no
  1189. ;;
  1190. altivec)
  1191. ADD_CFLAGS="$ADD_CFLAGS -maltivec"
  1192. ADD_CPPFLAGS="$ADD_CPPFLAGS -DREAL_IS_FLOAT -DOPT_ALTIVEC"
  1193. more_sources="$s_altivec $s_fpu"
  1194. AC_MSG_CHECKING([if $CC accepts -faltivec])
  1195. touch conftest.c
  1196. if $CC -faltivec -c -o conftest.o conftest.c >/dev/null 2>&1; then
  1197. ADD_CFLAGS="$ADD_CFLAGS -faltivec"
  1198. AC_MSG_RESULT([yes])
  1199. else
  1200. AC_MSG_RESULT([no])
  1201. fi
  1202. rm -f conftest.o conftest.c
  1203. ;;
  1204. neon)
  1205. ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_NEON -DREAL_IS_FLOAT"
  1206. more_sources="$s_neon $s_fpu"
  1207. ;;
  1208. arm_fpu)
  1209. ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MULTI -DOPT_GENERIC -DOPT_GENERIC_DITHER -DOPT_NEON -DREAL_IS_FLOAT"
  1210. more_sources="$s_neon $s_fpu $s_dither $s_arm_multi"
  1211. ;;
  1212. neon64)
  1213. ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_NEON64 -DREAL_IS_FLOAT"
  1214. more_sources="$s_neon64 $s_fpu"
  1215. ;;
  1216. aarch64)
  1217. ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MULTI -DOPT_GENERIC -DOPT_GENERIC_DITHER -DOPT_NEON64 -DREAL_IS_FLOAT"
  1218. more_sources="$s_neon64 $s_fpu $s_dither $s_arm_multi"
  1219. ;;
  1220. i386)
  1221. ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_I386 -DREAL_IS_FLOAT"
  1222. more_sources="$s_fpu $s_i386"
  1223. ccalign=no
  1224. ;;
  1225. i386_fpu)
  1226. ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_I386 -DREAL_IS_FLOAT"
  1227. more_sources="$s_fpu $s_i386"
  1228. ccalign=no
  1229. ;;
  1230. i386_nofpu)
  1231. ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_I386 -DREAL_IS_FIXED"
  1232. more_sources="$s_i386"
  1233. ccalign=no
  1234. ;;
  1235. i486)
  1236. ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_I486 -DREAL_IS_FLOAT"
  1237. more_sources="$s_fpu $s_i486"
  1238. ccalign=no
  1239. ;;
  1240. i586)
  1241. ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_I586 -DREAL_IS_FLOAT"
  1242. more_sources="$s_fpu $s_i586"
  1243. ;;
  1244. i586_dither)
  1245. ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_I586_DITHER -DREAL_IS_FLOAT"
  1246. more_sources="$s_fpu $s_i586d $s_dither"
  1247. ;;
  1248. 3dnow)
  1249. # legacy 3dnow had the 3dnow paired with i586...
  1250. ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MULTI -DOPT_I586 -DOPT_3DNOW -DREAL_IS_FLOAT"
  1251. more_sources="$s_fpu $s_i586 $s_3dnow $s_x86multi "
  1252. ;;
  1253. 3dnow_vintage)
  1254. ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MULTI -DOPT_I586 -DOPT_3DNOW_VINTAGE -DREAL_IS_FLOAT"
  1255. more_sources="$s_fpu $s_i586 $s_3dnow_vintage $s_x86multi "
  1256. ;;
  1257. 3dnow_alone)
  1258. ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_3DNOW -DREAL_IS_FLOAT"
  1259. more_sources="$s_fpu $s_3dnow"
  1260. ;;
  1261. 3dnowext_alone)
  1262. ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_3DNOWEXT -DREAL_IS_FLOAT"
  1263. more_sources="$s_fpu $s_3dnowext"
  1264. ;;
  1265. 3dnowext_vintage)
  1266. ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MULTI -DOPT_3DNOW -DOPT_3DNOWEXT_VINTAGE -DREAL_IS_FLOAT"
  1267. more_sources="$s_fpu $s_3dnowext_vintage $s_3dnow $s_x86multi"
  1268. ;;
  1269. 3dnowext)
  1270. ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MULTI -DOPT_3DNOW -DOPT_3DNOWEXT -DREAL_IS_FLOAT"
  1271. more_sources="$s_fpu $s_3dnowext $s_3dnow $s_x86multi"
  1272. ;;
  1273. mmx_alone|mmx)
  1274. ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MMX -DREAL_IS_FLOAT"
  1275. more_sources="$s_fpu $s_mmx"
  1276. ;;
  1277. sse_alone|sse)
  1278. ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_SSE -DREAL_IS_FLOAT"
  1279. more_sources="$s_fpu $s_sse"
  1280. ;;
  1281. sse_vintage)
  1282. ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_SSE_VINTAGE -DREAL_IS_FLOAT"
  1283. more_sources="$s_fpu $s_sse_vintage"
  1284. ;;
  1285. avx)
  1286. ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_AVX -DREAL_IS_FLOAT"
  1287. more_sources="$s_fpu $s_x86_64_avx $s_x86_64_mono_synths"
  1288. if test "x$YASM" != "xno"; then
  1289. use_yasm_for_avx="yes"
  1290. fi
  1291. ;;
  1292. x86|x86_dither)
  1293. # plain C dct36 always there, for vintage/non-vintage
  1294. # Selection of non-/vintage sources implies that
  1295. # $s_3dnow_vintage contains $s_3dnow,
  1296. # $s_sse contains $s_sse_vintage.
  1297. ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MULTI -DOPT_GENERIC -DOPT_GENERIC_DITHER -DOPT_I386 -DOPT_I586 -DOPT_I586_DITHER -DOPT_MMX -DOPT_3DNOW -DOPT_3DNOW_VINTAGE -DOPT_3DNOWEXT -DOPT_3DNOWEXT_VINTAGE -DOPT_SSE -DOPT_SSE_VINTAGE -DREAL_IS_FLOAT"
  1298. more_sources="$s_fpu $s_i386 $s_i586 $s_i586d $s_mmx $s_3dnow_vintage $s_3dnowext_vintage $s_sse $s_x86multi $s_dither"
  1299. ;;
  1300. x86-64_alone)
  1301. ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_X86_64 -DREAL_IS_FLOAT"
  1302. more_sources="$s_fpu $s_x86_64"
  1303. ;;
  1304. x86-64|x86-64_all|x86-64_dither)
  1305. ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MULTI -DOPT_X86_64 -DOPT_GENERIC -DOPT_GENERIC_DITHER -DREAL_IS_FLOAT"
  1306. more_sources="$s_fpu $s_x86_64 $s_dither $s_x86_64_multi"
  1307. if test "x$avx_support" = "xyes"; then
  1308. ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_AVX"
  1309. more_sources="$more_sources $s_x86_64_avx"
  1310. if test "x$YASM" != "xno"; then
  1311. use_yasm_for_avx="yes"
  1312. fi
  1313. fi
  1314. ;;
  1315. *)
  1316. AC_MSG_ERROR([Unknown CPU type '$cpu_type'])
  1317. ;;
  1318. esac
  1319. # Use yasm instead of the default assembler for AVX sources
  1320. if test "x$use_yasm_for_avx" = "xyes"; then
  1321. case $host_os in
  1322. *cygwin*|*mingw*)
  1323. YASM_FORMAT="-f win64"
  1324. ;;
  1325. *darwin*)
  1326. YASM_FORMAT="-f macho"
  1327. ;;
  1328. *)
  1329. YASM_FORMAT="-f elf"
  1330. ;;
  1331. esac
  1332. AC_DEFINE(USE_YASM_FOR_AVX, 1, [Define to use yasm for assemble AVX sources.])
  1333. fi
  1334. AM_CONDITIONAL( [USE_YASM_FOR_AVX], [test "x$use_yasm_for_avx" = xyes] )
  1335. AC_SUBST(YASM_FORMAT)
  1336. # Check if we want feature report function.
  1337. AC_MSG_CHECKING([if we want feature report function])
  1338. feature_report=enabled
  1339. AC_ARG_ENABLE(feature_report,
  1340. [ --disable-feature_report Disable feature report function ],
  1341. [
  1342. if test "x$enableval" = xno; then
  1343. AC_MSG_RESULT([no])
  1344. feature_report=disabled
  1345. else
  1346. AC_MSG_RESULT([yes])
  1347. fi
  1348. ],
  1349. [AC_MSG_RESULT([yes])])
  1350. if test "x$feature_report" = xenabled; then
  1351. more_sources="$more_sources feature"
  1352. fi
  1353. # Return 0 if first arg appears in list of following arguments.
  1354. # Return 1 otherwise.
  1355. word_in_list() {
  1356. word=$1
  1357. shift
  1358. # Avoid naming conflict with the outside!
  1359. # Is local not POSIX sh?
  1360. for given_word in "$@"
  1361. do
  1362. if test "x$word" = "x$given_word"; then
  1363. return 0
  1364. fi
  1365. done
  1366. return 1
  1367. }
  1368. for i in $more_sources
  1369. do
  1370. # Make sure every file is only once in the list.
  1371. word_in_list "$i.\$(OBJEXT)" $DECODER_OBJ || DECODER_OBJ="$DECODER_OBJ $i.\$(OBJEXT)"
  1372. word_in_list "$i.lo" $DECODER_LOBJ || DECODER_LOBJ="$DECODER_LOBJ $i.lo"
  1373. done
  1374. # Another preprocessing step: Append prefix for non-recursive make.
  1375. # Just because $(addprefix ...) is a GNU extension.
  1376. DECODER_OBJ=`for i in $DECODER_OBJ; do printf ' src/libmpg123/%s' $i; done`
  1377. DECODER_LOBJ=`for i in $DECODER_LOBJ; do printf ' src/libmpg123/%s' $i; done`
  1378. AC_SUBST(DECODER_OBJ)
  1379. AC_SUBST(DECODER_LOBJ)
  1380. dnl Finally insert the code switch for alignment, above cpu selection having possibly changed the setting.
  1381. if test x"$ccalign" = xyes; then
  1382. AC_DEFINE(CCALIGN, 1, [ Define if __attribute__((aligned(16))) shall be used ])
  1383. fi
  1384. dnl ############## Output module choice
  1385. # The full list of supported modules to check, first come, first serve.
  1386. check_modules="alsa tinyalsa oss coreaudio sndio sun win32 win32_wasapi os2 esd jack portaudio pulse sdl nas arts openal dummy"
  1387. # Only check qsa before all else on QNX.
  1388. # It would mask ALSA otherwise.
  1389. case $host in
  1390. *-nto-qnx*)
  1391. check_modules="qsa $check_modules"
  1392. ;;
  1393. esac
  1394. # The final list.
  1395. output_modules=
  1396. check_forced=no
  1397. check_failed=no
  1398. if test "x$with_audio" != "x"; then
  1399. check_modules="`echo $with_audio|tr , ' '` dummy"
  1400. echo "Limiting outputs to build according to your preference: $check_modules"
  1401. check_forced=yes
  1402. fi
  1403. PKG_PROG_PKG_CONFIG([])
  1404. # Now go through the modules to check and do the chores.
  1405. for m in $check_modules
  1406. do
  1407. case "$m" in
  1408. dummy)
  1409. AC_MSG_CHECKING([if you are too dumbing dumb for the dummy])
  1410. AC_MSG_RESULT([no])
  1411. output_modules="$output_modules dummy"
  1412. HAVE_DUMMY=yes
  1413. ;;
  1414. oss)
  1415. AC_CHECK_HEADERS([sys/soundcard.h linux/soundcard.h machine/soundcard.h])
  1416. if test "x${ac_cv_header_sys_soundcard_h}" = "xyes" \
  1417. -o "x${ac_cv_header_linux_soundcard_h}" = "xyes" \
  1418. -o "x${ac_cv_header_machine_soundcard_h}" = "xyes";
  1419. then
  1420. output_modules="$output_modules oss"
  1421. HAVE_OSS="yes"
  1422. else
  1423. check_failed=yes
  1424. fi
  1425. ;;
  1426. tinyalsa)
  1427. TINYALSA_LIBS="-ltinyalsa"
  1428. # Check for ALSA
  1429. AC_CHECK_LIB( [tinyalsa], [pcm_open],
  1430. [ AC_CHECK_HEADER( [tinyalsa/asoundlib.h],
  1431. [ output_modules="$output_modules tinyalsa" HAVE_TINYALSA="yes"],
  1432. [ AC_MSG_WARN([Found TINYALSA library but NOT header files on your system]) ] )
  1433. ]
  1434. )
  1435. if test "x$HAVE_TINYALSA" != xyes; then
  1436. check_failed=yes
  1437. fi
  1438. ;;
  1439. # QSA and ALSA are not distinguishable in these tests, need to block
  1440. # each other and play with test order depending on platform.
  1441. alsa)
  1442. if test "x$HAVE_QSA" = xyes; then
  1443. HAVE_ALSA=no
  1444. else
  1445. ALSA_LIBS="-lasound"
  1446. # Check for ALSA
  1447. AC_CHECK_LIB( [asound], [snd_pcm_open],
  1448. [ AC_CHECK_HEADER( [alsa/asoundlib.h],
  1449. [ output_modules="$output_modules alsa" HAVE_ALSA="yes"],
  1450. [ AC_MSG_WARN([Found ALSA library but NOT header files on your system]) ] )
  1451. ]
  1452. )
  1453. if test "x$HAVE_ALSA" != xyes; then
  1454. check_failed=yes
  1455. fi
  1456. fi # HAVE_QSA
  1457. ;;
  1458. qsa)
  1459. if test "x$HAVE_ALSA" = xyes; then
  1460. HAVE_QSA=no
  1461. else
  1462. QSA_LIBS="-lasound"
  1463. # Check for QSA
  1464. AC_CHECK_LIB( [asound], [snd_pcm_open],
  1465. [ AC_CHECK_HEADER( [sys/asoundlib.h],
  1466. [ output_modules="$output_modules qsa" HAVE_QSA="yes"],
  1467. [ AC_MSG_WARN([Found QSA library but NOT header files on your system]) ] )
  1468. ]
  1469. )
  1470. if test "x$HAVE_QSA" != xyes; then
  1471. check_failed=yes
  1472. fi
  1473. fi # HAVE_ALSA
  1474. ;;
  1475. jack)
  1476. # JACK module uses semaphores, hence -lpthread.
  1477. AC_CHECK_LIB( [pthread], [sem_post],
  1478. [ PKG_CHECK_MODULES(JACK, jack,
  1479. [
  1480. output_modules="$output_modules jack"
  1481. HAVE_JACK="yes"
  1482. JACK_LIBS="$JACK_LIBS -lpthread"
  1483. ], [ HAVE_JACK="no" check_failed=yes ] )
  1484. ],
  1485. [ HAVE_JACK=no check_failed=yes ]
  1486. )
  1487. ;;
  1488. pulse)
  1489. PKG_CHECK_MODULES(PULSE, libpulse-simple, output_modules="$output_modules pulse" HAVE_PULSE="yes", HAVE_PULSE="no" check_failed=yes)
  1490. ;;
  1491. esd)
  1492. PKG_CHECK_MODULES(ESD, esound, output_modules="$output_modules esd" HAVE_ESD="yes", HAVE_ESD="no" check_failed=yes)
  1493. ;;
  1494. portaudio)
  1495. # Remember: This looks only insane because you chose an insane tab width!
  1496. PORTAUDIO_LIBS="-lportaudio"
  1497. PORTAUDIO_CFLAGS=
  1498. case $host in
  1499. *-*-mingw32)
  1500. # We tested portaudio with MME
  1501. if test "x$HAVE_PORTAUDIO" != "xyes"; then
  1502. AC_CHECK_LIB( [portaudio], [Pa_Initialize],
  1503. [ AC_CHECK_HEADER( [portaudio.h],
  1504. [ output_modules="$output_modules portaudio" HAVE_PORTAUDIO_WINMM="yes" HAVE_PORTAUDIO="yes" ],
  1505. [ AC_MSG_WARN([Found PortAudio library but NOT header files on your system]) ] )
  1506. PORTAUDIO_LIBS="$PORTAUDIO_LIBS -lwinmm"
  1507. ],
  1508. [ HAVE_PORTAUDIO="no"],
  1509. [ -lwinmm ]
  1510. )
  1511. fi
  1512. ;;
  1513. *)
  1514. AC_CHECK_LIB( [portaudio], [Pa_Initialize],
  1515. [ AC_CHECK_HEADER( [portaudio.h],
  1516. [ output_modules="$output_modules portaudio" HAVE_PORTAUDIO="yes" ],
  1517. [ AC_MSG_WARN([Found PortAudio library but NOT header files on your system]) ] )
  1518. ]
  1519. )
  1520. ;;
  1521. esac
  1522. if test "x$HAVE_PORTAUDIO" != xyes; then
  1523. check_failed=yes
  1524. else
  1525. # See if we have v19 or v18
  1526. AC_CHECK_LIB( [portaudio], [Pa_GetVersion], [:], [AC_DEFINE( [PORTAUDIO18], 1, [Define if portaudio v18 API is wanted.]) ], [$PORTAUDIO_LIBS] )
  1527. fi
  1528. ;;
  1529. sdl)
  1530. PKG_CHECK_MODULES(SDL, sdl, output_modules="$output_modules sdl" HAVE_SDL="yes", HAVE_SDL="no" check_failed=yes)
  1531. ;;
  1532. nas)
  1533. NAS_LIBS=-laudio
  1534. AC_CHECK_LIB( [audio], [AuOpenServer],
  1535. [ AC_CHECK_HEADER( [audio/audiolib.h],
  1536. [ output_modules="$output_modules nas" HAVE_NAS="yes"],
  1537. [ AC_MSG_WARN([Found NAS library but NOT header files on your system]) ] )
  1538. ]
  1539. )
  1540. if test "x$HAVE_NAS" != xyes; then
  1541. check_failed=yes
  1542. fi
  1543. ;;
  1544. win32)
  1545. # Check for windows ... and win32 audio
  1546. # Does not work... instead just check for header
  1547. # AC_CHECK_LIB( [winmm], [waveOutOpen] )
  1548. WIN32_LIBS=-lwinmm
  1549. if test x$ac_cv_header_windows_h = xyes; then
  1550. output_modules="$output_modules win32"
  1551. HAVE_WIN32=yes
  1552. else
  1553. HAVE_WIN32=no
  1554. check_failed=yes
  1555. fi
  1556. ;;
  1557. win32_wasapi)
  1558. # Check for windows ... and win32 wasapi audio
  1559. # Does not work... instead just check for header
  1560. # AC_CHECK_LIB( [avrt], [] )
  1561. AC_MSG_CHECKING([if we have wasapi headers])
  1562. OLD_LIBS=$LIBS
  1563. LIBS="$LIBS -lole32 -lavrt"
  1564. AC_LINK_IFELSE([AC_LANG_SOURCE([
  1565. #define COBJMACROS 1
  1566. #define _WIN32_WINNT 0x601
  1567. #include <initguid.h>
  1568. #include <audioclient.h>
  1569. #include <mmdeviceapi.h>
  1570. #include <avrt.h>
  1571. int main(){
  1572. /* UUID Checks */
  1573. GUID *IDs[] = {
  1574. &CLSID_MMDeviceEnumerator,
  1575. &IID_IMMDeviceEnumerator,
  1576. &IID_IAudioClient,
  1577. &IID_IAudioRenderClient
  1578. };
  1579. return 0;
  1580. }
  1581. ])], [HAVE_WIN32_WASAPI=yes], [HAVE_WIN32_WASAPI=no])
  1582. LIBS=$OLD_LIBS
  1583. WIN32_WASAPI_LIBS="-lole32 -lavrt"
  1584. AC_MSG_RESULT([$HAVE_WIN32_WASAPI])
  1585. if test "x$HAVE_WIN32_WASAPI" = xyes; then
  1586. output_modules="$output_modules win32_wasapi"
  1587. else
  1588. check_failed=yes
  1589. fi
  1590. ;;
  1591. sndio)
  1592. SNDIO_LIBS=-lsndio
  1593. AC_CHECK_LIB([sndio], [sio_open],
  1594. [AC_CHECK_HEADERS([sndio.h],
  1595. [output_modules="$output_modules sndio" HAVE_SNDIO="yes"])
  1596. ]
  1597. )
  1598. if test "x$HAVE_SNDIO" != xyes; then
  1599. check_failed=yes
  1600. fi
  1601. ;;
  1602. sun)
  1603. AC_CHECK_HEADERS([sun/audioio.h sys/audioio.h asm/audioio.h sys/audio.h])
  1604. if test "x${ac_cv_header_sun_audioio_h}" = "xyes" \
  1605. -o "x${ac_cv_header_sys_audioio_h}" = "xyes" \
  1606. -o "x${ac_cv_header_asm_audioio_h}" = "xyes";
  1607. then
  1608. output_modules="$output_modules sun"
  1609. HAVE_SUN="yes"
  1610. else
  1611. check_failed=yes
  1612. fi
  1613. ;;
  1614. coreaudio)
  1615. COREAUDIO_LIBS="-framework AudioToolbox"
  1616. AC_CHECK_HEADERS([AudioUnit/AudioUnit.h AudioToolbox/AudioToolbox.h])
  1617. if test "x${ac_cv_header_AudioUnit_AudioUnit_h}" = "xyes" \
  1618. -a "x${ac_cv_header_AudioToolbox_AudioToolbox_h}" = "xyes";
  1619. then
  1620. OLD_LIBS=$LIBS
  1621. LIBS="$LIBS $COREAUDIO_LIBS"
  1622. AC_MSG_CHECKING([if AudioUnit functions are available within AudioToolbox])
  1623. AC_TRY_LINK(
  1624. [#include <AudioUnit/AudioUnit.h>],
  1625. [AudioUnitInitialize(NULL);],
  1626. [AC_MSG_RESULT([yes])],
  1627. [AC_MSG_RESULT([no])
  1628. COREAUDIO_LIBS="$COREAUDIO_LIBS -framework AudioUnit"]
  1629. )
  1630. LIBS=$OLD_LIBS
  1631. AC_CHECK_HEADERS([CoreServices/CoreServices.h],
  1632. [COREAUDIO_LIBS="$COREAUDIO_LIBS -framework CoreServices"]
  1633. )
  1634. if test x"$modules" = xdisabled; then
  1635. AC_MSG_WARN([Disabling buffer because of directly linked CoreAudio! Use the module if you need the buffer.])
  1636. buffer=disabled
  1637. fi
  1638. output_modules="$output_modules coreaudio"
  1639. HAVE_COREAUDIO="yes"
  1640. else
  1641. check_failed=yes
  1642. fi
  1643. ;;
  1644. arts)
  1645. AC_MSG_CHECKING([for artsc])
  1646. if artsc-config > /dev/null 2>&1; then
  1647. AC_MSG_RESULT([yes])
  1648. output_modules="$output_modules arts"
  1649. HAVE_ARTS=yes
  1650. ARTS_LIBS=`artsc-config --libs`
  1651. ARTS_CFLAGS=`artsc-config --cflags`
  1652. else
  1653. AC_MSG_RESULT([no])
  1654. check_failed=yes
  1655. fi
  1656. ;;
  1657. openal)
  1658. AC_CHECK_HEADERS([OpenAL/al.h OpenAL/alc.h AL/al.h AL/alc.h al.h alc.h])
  1659. if test "x${ac_cv_header_OpenAL_al_h}" = "xyes" \
  1660. -a "x${ac_cv_header_OpenAL_alc_h}" = "xyes";
  1661. then #Mac OS X
  1662. output_modules="$output_modules openal"
  1663. OPENAL_LIBS="-framework OpenAL"
  1664. OPENAL_CFLAGS="-DOPENAL_SUBDIR_OPENAL"
  1665. HAVE_OPENAL="yes"
  1666. elif test "x${ac_cv_header_AL_al_h}" = "xyes" \
  1667. -a "x${ac_cv_header_AL_alc_h}" = "xyes";
  1668. then #Linux
  1669. output_modules="$output_modules openal"
  1670. OPENAL_LIBS="-lopenal"
  1671. OPENAL_CFLAGS="-DOPENAL_SUBDIR_AL"
  1672. HAVE_OPENAL="yes"
  1673. elif test "x${ac_cv_header_al_h}" = "xyes" \
  1674. -a "x${ac_cv_header_alc_h}" = "xyes";
  1675. then #Windows?
  1676. output_modules="$output_modules openal"
  1677. OPENAL_LIBS="-lopenal"
  1678. OPENAL_CFLAGS=""
  1679. HAVE_OPENAL="yes"
  1680. else
  1681. check_failed=yes
  1682. fi
  1683. ;;
  1684. os2)
  1685. OS2_LIBS="-los2me -lmmpm2 -lsocket"
  1686. AC_CHECK_HEADERS([os2.h])
  1687. # os2me.h depends on os2.h
  1688. # Yes, that way of coding it is ugly.
  1689. if test "x${ac_cv_header_os2_h}" = xyes
  1690. then
  1691. # We mimick exactly the way how the header will be used.
  1692. # It seems to be picky...
  1693. AC_CHECK_HEADERS([os2me.h], [], [], [#define INCL_OS2MM
  1694. #define INCL_DOS
  1695. #define INCL_VIO
  1696. #define INCL_KBD
  1697. #include <os2.h>
  1698. #])
  1699. fi
  1700. if test "x${ac_cv_header_os2_h}" = xyes \
  1701. -a "x${ac_cv_header_os2me_h}" = xyes
  1702. then
  1703. output_modules="$output_modules os2"
  1704. HAVE_OS2=yes
  1705. else
  1706. check_failed=yes
  1707. fi
  1708. ;;
  1709. # from here on only forced tests, untested code
  1710. hp)
  1711. # What's the deal with that and alib?
  1712. UNSUPPORTED_AUDIO=yes
  1713. AC_CHECK_HEADER([sys/audio.h], [output_modules="$output_modules hp" HAVE_HP=yes], [check_failed=yes])
  1714. ;;
  1715. alib)
  1716. UNSUPPORTED_AUDIO=yes
  1717. # ALIB_CFLAGS="-I/opt/audio/include"
  1718. ALIB_LIBS=-lAlib
  1719. # These headers may not be all about audio but they are used.
  1720. AC_CHECK_HEADERS([ Alib.h CUlib.h netdb.h netinet/in.h netinet/tcp.h])
  1721. if test "x${ac_cv_header_Alib_h}" = xyes \
  1722. -a "x${ac_cv_header_CUlib_h}" = xyes \
  1723. -a "x${ac_cv_header_netdb_h}" = xyes \
  1724. -a "x${ac_cv_header_netinet_in_h}" = xyes \
  1725. -a "x${ac_cv_header_netinet_tcp_h}" = xyes
  1726. then
  1727. output_modules="$output_modules alib"
  1728. HAVE_ALIB=yes
  1729. else
  1730. check_failed=yes
  1731. fi
  1732. ;;
  1733. mint)
  1734. UNSUPPORTED_AUDIO=yes
  1735. AC_CHECK_HEADERS([audios.h], [output_modules="$output_modules mint" HAVE_MINT=yes], [check_failes=yes])
  1736. ;;
  1737. aix)
  1738. UNSUPPORTED_AUDIO=yes
  1739. AC_CHECK_HEADERS([sys/audio.h], [output_modules="$output_modules aix" HAVE_AIX=yes], [check_failed=yes])
  1740. ;;
  1741. sgi)
  1742. UNSUPPORTED_AUDIO=yes
  1743. SGI_LIBS=-laudio
  1744. AC_CHECK_HEADER([dmedia/audio.h], [output_modules="$output_modules sgi" HAVE_SGI=yes], [check_failed=yes])
  1745. ;;
  1746. *)
  1747. AC_MSG_ERROR([Unsupported/-known output '$m' demanded!])
  1748. ;;
  1749. esac
  1750. done
  1751. if test "x$check_forced" = xyes -a "x$UNSUPPORTED_AUDIO" = xyes; then
  1752. AC_MSG_WARN([You requested bulding of an unsupported audio module. Be prepared for happy hacking and please tell us about your experience!])
  1753. fi
  1754. if test "x$check_forced" = xyes -a "x$check_failed" = "xyes"; then
  1755. AC_MSG_ERROR([One/some of your requested audio modules failed the test!])
  1756. fi
  1757. # When you extend check_modules, you should extend this:
  1758. #for i in alsa qsa oss coreaudio sndio sun win32 win32_wasapi esd jack portaudio pulse sdl nas aix alib arts hp os2 sgi mint openal dummy
  1759. #do echo $i; done |
  1760. #perl -ne 'chomp; $big = uc($_); print <<EOT;
  1761. #AC_SUBST(${big}_LIBS)
  1762. #AC_SUBST(${big}_LDFLAGS)
  1763. #AC_SUBST(${big}_CFLAGS)
  1764. #AM_CONDITIONAL( [HAVE_$big], [test "x\$HAVE_$big" = xyes] )
  1765. #EOT
  1766. #'
  1767. AC_SUBST(TINYALSA_LIBS)
  1768. AC_SUBST(TINYALSA_LDFLAGS)
  1769. AC_SUBST(TINYALSA_CFLAGS)
  1770. AM_CONDITIONAL( [HAVE_TINYALSA], [test "x$HAVE_TINYALSA" = xyes] )
  1771. AC_SUBST(ALSA_LIBS)
  1772. AC_SUBST(ALSA_LDFLAGS)
  1773. AC_SUBST(ALSA_CFLAGS)
  1774. AM_CONDITIONAL( [HAVE_ALSA], [test "x$HAVE_ALSA" = xyes] )
  1775. AC_SUBST(QSA_LIBS)
  1776. AC_SUBST(QSA_LDFLAGS)
  1777. AC_SUBST(QSA_CFLAGS)
  1778. AM_CONDITIONAL( [HAVE_QSA], [test "x$HAVE_QSA" = xyes] )
  1779. AC_SUBST(OSS_LIBS)
  1780. AC_SUBST(OSS_LDFLAGS)
  1781. AC_SUBST(OSS_CFLAGS)
  1782. AM_CONDITIONAL( [HAVE_OSS], [test "x$HAVE_OSS" = xyes] )
  1783. AC_SUBST(COREAUDIO_LIBS)
  1784. AC_SUBST(COREAUDIO_LDFLAGS)
  1785. AC_SUBST(COREAUDIO_CFLAGS)
  1786. AM_CONDITIONAL( [HAVE_COREAUDIO], [test "x$HAVE_COREAUDIO" = xyes] )
  1787. AC_SUBST(SNDIO_LIBS)
  1788. AC_SUBST(SNDIO_LDFLAGS)
  1789. AC_SUBST(SNDIO_CFLAGS)
  1790. AM_CONDITIONAL( [HAVE_SNDIO], [test "x$HAVE_SNDIO" = xyes] )
  1791. AC_SUBST(SUN_LIBS)
  1792. AC_SUBST(SUN_LDFLAGS)
  1793. AC_SUBST(SUN_CFLAGS)
  1794. AM_CONDITIONAL( [HAVE_SUN], [test "x$HAVE_SUN" = xyes] )
  1795. AC_SUBST(WIN32_LIBS)
  1796. AC_SUBST(WIN32_LDFLAGS)
  1797. AC_SUBST(WIN32_CFLAGS)
  1798. AM_CONDITIONAL( [HAVE_WIN32], [test "x$HAVE_WIN32" = xyes] )
  1799. AC_SUBST(WIN32_WASAPI_LIBS)
  1800. AC_SUBST(WIN32_WASAPI_LDFLAGS)
  1801. AC_SUBST(WIN32_WASAPI_CFLAGS)
  1802. AM_CONDITIONAL( [HAVE_WIN32_WASAPI], [test "x$HAVE_WIN32_WASAPI" = xyes] )
  1803. AC_SUBST(ESD_LIBS)
  1804. AC_SUBST(ESD_LDFLAGS)
  1805. AC_SUBST(ESD_CFLAGS)
  1806. AM_CONDITIONAL( [HAVE_ESD], [test "x$HAVE_ESD" = xyes] )
  1807. AC_SUBST(JACK_LIBS)
  1808. AC_SUBST(JACK_LDFLAGS)
  1809. AC_SUBST(JACK_CFLAGS)
  1810. AM_CONDITIONAL( [HAVE_JACK], [test "x$HAVE_JACK" = xyes] )
  1811. AC_SUBST(PORTAUDIO_LIBS)
  1812. AC_SUBST(PORTAUDIO_LDFLAGS)
  1813. AC_SUBST(PORTAUDIO_CFLAGS)
  1814. AM_CONDITIONAL( [HAVE_PORTAUDIO], [test "x$HAVE_PORTAUDIO" = xyes] )
  1815. AC_SUBST(PULSE_LIBS)
  1816. AC_SUBST(PULSE_LDFLAGS)
  1817. AC_SUBST(PULSE_CFLAGS)
  1818. AM_CONDITIONAL( [HAVE_PULSE], [test "x$HAVE_PULSE" = xyes] )
  1819. AC_SUBST(SDL_LIBS)
  1820. AC_SUBST(SDL_LDFLAGS)
  1821. AC_SUBST(SDL_CFLAGS)
  1822. AM_CONDITIONAL( [HAVE_SDL], [test "x$HAVE_SDL" = xyes] )
  1823. AC_SUBST(NAS_LIBS)
  1824. AC_SUBST(NAS_LDFLAGS)
  1825. AC_SUBST(NAS_CFLAGS)
  1826. AM_CONDITIONAL( [HAVE_NAS], [test "x$HAVE_NAS" = xyes] )
  1827. AC_SUBST(AIX_LIBS)
  1828. AC_SUBST(AIX_LDFLAGS)
  1829. AC_SUBST(AIX_CFLAGS)
  1830. AM_CONDITIONAL( [HAVE_AIX], [test "x$HAVE_AIX" = xyes] )
  1831. AC_SUBST(ALIB_LIBS)
  1832. AC_SUBST(ALIB_LDFLAGS)
  1833. AC_SUBST(ALIB_CFLAGS)
  1834. AM_CONDITIONAL( [HAVE_ALIB], [test "x$HAVE_ALIB" = xyes] )
  1835. AC_SUBST(ARTS_LIBS)
  1836. AC_SUBST(ARTS_LDFLAGS)
  1837. AC_SUBST(ARTS_CFLAGS)
  1838. AM_CONDITIONAL( [HAVE_ARTS], [test "x$HAVE_ARTS" = xyes] )
  1839. AC_SUBST(HP_LIBS)
  1840. AC_SUBST(HP_LDFLAGS)
  1841. AC_SUBST(HP_CFLAGS)
  1842. AM_CONDITIONAL( [HAVE_HP], [test "x$HAVE_HP" = xyes] )
  1843. AC_SUBST(OS2_LIBS)
  1844. AC_SUBST(OS2_LDFLAGS)
  1845. AC_SUBST(OS2_CFLAGS)
  1846. AM_CONDITIONAL( [HAVE_OS2], [test "x$HAVE_OS2" = xyes] )
  1847. AC_SUBST(SGI_LIBS)
  1848. AC_SUBST(SGI_LDFLAGS)
  1849. AC_SUBST(SGI_CFLAGS)
  1850. AM_CONDITIONAL( [HAVE_SGI], [test "x$HAVE_SGI" = xyes] )
  1851. AC_SUBST(MINT_LIBS)
  1852. AC_SUBST(MINT_LDFLAGS)
  1853. AC_SUBST(MINT_CFLAGS)
  1854. AM_CONDITIONAL( [HAVE_MINT], [test "x$HAVE_MINT" = xyes] )
  1855. AC_SUBST(OPENAL_LIBS)
  1856. AC_SUBST(OPENAL_LDFLAGS)
  1857. AC_SUBST(OPENAL_CFLAGS)
  1858. AM_CONDITIONAL( [HAVE_OPENAL], [test "x$HAVE_OPENAL" = xyes] )
  1859. AC_SUBST(DUMMY_LIBS)
  1860. AC_SUBST(DUMMY_LDFLAGS)
  1861. AC_SUBST(DUMMY_CFLAGS)
  1862. AM_CONDITIONAL( [HAVE_DUMMY], [test "x$HAVE_DUMMY" = xyes] )
  1863. # Hackery to get rid of module .la files.
  1864. AC_SUBST(output_modules)
  1865. for f in $output_modules
  1866. do
  1867. output_modules_la="$output_modules_la output_$f.la"
  1868. done
  1869. AC_SUBST(output_modules_la)
  1870. # Did user choose default audio subsystem ?
  1871. if test "x$with_default_audio" != "x"; then
  1872. default_output_module=$with_default_audio
  1873. else
  1874. default_output_module=`echo "$output_modules" | $AWK '{ print $1 }'`
  1875. fi
  1876. # That's (beginning of) the list for mpg123's internal default.
  1877. default_output_modules=$default_output_module
  1878. # Setup the static build.
  1879. # The conditionals always need to be defined by configure, even if
  1880. # HAVE_MODULES is FALSE!
  1881. # Here's a script for that tedious list, perhaps to be outsourced together with the one in #src/output/Makefile.am
  1882. #for i in dummy tinyalsa alsa qsa coreaudio esd jack nas oss portaudio pulse sdl sndio sun win32 win32_wasapi aix alib arts hp os2 sgi mint openal
  1883. #do echo $i; done |
  1884. #perl -ne 'chomp; $big = uc($_); print <<EOT;
  1885. #AM_CONDITIONAL([BUILD_${big}], [ test "$_" = \$default_output_module ])
  1886. #EOT
  1887. #'
  1888. AM_CONDITIONAL([BUILD_DUMMY], [ test "dummy" = $default_output_module ])
  1889. AM_CONDITIONAL([BUILD_TINYALSA], [ test "tinyalsa" = $default_output_module ])
  1890. AM_CONDITIONAL([BUILD_ALSA], [ test "alsa" = $default_output_module ])
  1891. AM_CONDITIONAL([BUILD_QSA], [ test "qsa" = $default_output_module ])
  1892. AM_CONDITIONAL([BUILD_COREAUDIO], [ test "coreaudio" = $default_output_module ])
  1893. AM_CONDITIONAL([BUILD_ESD], [ test "esd" = $default_output_module ])
  1894. AM_CONDITIONAL([BUILD_JACK], [ test "jack" = $default_output_module ])
  1895. AM_CONDITIONAL([BUILD_NAS], [ test "nas" = $default_output_module ])
  1896. AM_CONDITIONAL([BUILD_OSS], [ test "oss" = $default_output_module ])
  1897. AM_CONDITIONAL([BUILD_PORTAUDIO], [ test "portaudio" = $default_output_module ])
  1898. AM_CONDITIONAL([BUILD_PULSE], [ test "pulse" = $default_output_module ])
  1899. AM_CONDITIONAL([BUILD_SDL], [ test "sdl" = $default_output_module ])
  1900. AM_CONDITIONAL([BUILD_SNDIO], [ test "sndio" = $default_output_module ])
  1901. AM_CONDITIONAL([BUILD_SUN], [ test "sun" = $default_output_module ])
  1902. AM_CONDITIONAL([BUILD_WIN32], [ test "win32" = $default_output_module ])
  1903. AM_CONDITIONAL([BUILD_WIN32_WASAPI], [ test "win32_wasapi" = $default_output_module ])
  1904. AM_CONDITIONAL([BUILD_AIX], [ test "aix" = $default_output_module ])
  1905. AM_CONDITIONAL([BUILD_ALIB], [ test "alib" = $default_output_module ])
  1906. AM_CONDITIONAL([BUILD_ARTS], [ test "arts" = $default_output_module ])
  1907. AM_CONDITIONAL([BUILD_HP], [ test "hp" = $default_output_module ])
  1908. AM_CONDITIONAL([BUILD_OS2], [ test "os2" = $default_output_module ])
  1909. AM_CONDITIONAL([BUILD_SGI], [ test "sgi" = $default_output_module ])
  1910. AM_CONDITIONAL([BUILD_MINT], [ test "mint" = $default_output_module ])
  1911. AM_CONDITIONAL([BUILD_OPENAL], [ test "openal" = $default_output_module ])
  1912. if test "x$modules" = xenabled
  1913. then
  1914. # Now make a comma-separated list again... eliminating the possible duplicate and dummy.
  1915. for i in $output_modules
  1916. do
  1917. if test $i != $default_output_module && test $i != dummy; then
  1918. default_output_modules=$default_output_modules,$i
  1919. fi
  1920. done
  1921. fi
  1922. AC_DEFINE_UNQUOTED( DEFAULT_OUTPUT_MODULE, "$default_output_modules", [The default audio output module(s) to use] )
  1923. dnl ############## Compiler Optimizations
  1924. CFLAGS="$ADD_CFLAGS $CFLAGS"
  1925. AM_CONDITIONAL([BUILD_BUFFER], [ test x"$buffer" = xenabled ])
  1926. if test x"$buffer" = xdisabled; then
  1927. ADD_CPPFLAGS="$ADD_CPPFLAGS -DNOXFERMEM"
  1928. fi
  1929. if test x"$newoldwritesample" = xenabled; then
  1930. ADD_CPPFLAGS="$ADD_CPPFLAGS -DNEWOLD_WRITE_SAMPLE"
  1931. fi
  1932. CPPFLAGS="$ADD_CPPFLAGS $CPPFLAGS"
  1933. LDFLAGS="$ADD_LDFLAGS $LDFLAGS"
  1934. # None chosen?
  1935. if test "x$with_optimization" = "x"; then
  1936. if test x"$debugging" = xenabled; then
  1937. with_optimization="0"
  1938. else
  1939. # enable (gcc specific) default opts only with gcc
  1940. if test "x$GCC" = xyes; then
  1941. with_optimization="2"
  1942. else
  1943. with_optimization="0"
  1944. fi
  1945. fi
  1946. fi
  1947. case $with_optimization in
  1948. 0)
  1949. # No Optimizations
  1950. CFLAGS="$CFLAGS"
  1951. ;;
  1952. 1)
  1953. CFLAGS="-O $CFLAGS"
  1954. ;;
  1955. 2)
  1956. CFLAGS="-O2 -fomit-frame-pointer -funroll-all-loops -finline-functions -ffast-math $CFLAGS"
  1957. ;;
  1958. 3)
  1959. CFLAGS="-O3 -fomit-frame-pointer -funroll-all-loops -finline-functions -ffast-math $CFLAGS"
  1960. ;;
  1961. 4)
  1962. CFLAGS="-O4 -fomit-frame-pointer -funroll-all-loops -finline-functions -ffast-math $CFLAGS"
  1963. ;;
  1964. *)
  1965. AC_MSG_ERROR([Unknown optimizations level '$with_optimization'])
  1966. ;;
  1967. esac
  1968. dnl If using gcc, prevent a bad alignment option from breaking things.
  1969. dnl Let's default to safe 16-byte alignment for any special x86 or altivec stuff.
  1970. if test "x$GCC" = xyes && echo "$CFLAGS" | $GREP 'mpreferred-stack-boundary=' > /dev/null; then
  1971. case $cpu_type in
  1972. x86 | i586* | mmx | sse | 3dnow* | altivec)
  1973. AC_MSG_WARN( [ You are trying to mess with stack alignment. I know better. ] )
  1974. CFLAGS="$CFLAGS -mpreferred-stack-boundary=4"
  1975. ;;
  1976. esac
  1977. fi
  1978. dnl ############## Seektable size
  1979. if test "x$with_seektable" = "x"; then
  1980. seektable=1000
  1981. else
  1982. seektable=$with_seektable
  1983. fi
  1984. if test "$seektable" -gt 0; then
  1985. AC_DEFINE(FRAME_INDEX, 1, [ Define if frame index should be used. ])
  1986. fi
  1987. # Define that always... also without frame index enabled.
  1988. AC_DEFINE_UNQUOTED(INDEX_SIZE, $seektable, [size of the frame index seek table])
  1989. dnl ############## Win32 function checks
  1990. # Check if we want Unicode for Win32. Cygwin does not need _wopen
  1991. if test x$ac_cv_header_windows_h = xyes && test "x$host_os" != "xcygwin"; then
  1992. win32_specific_codes=enabled
  1993. else
  1994. win32_specific_codes=disabled
  1995. fi
  1996. win32_unicode=unneeded
  1997. win32_sockets=disabled
  1998. win32_sockets_working=no
  1999. win32_wide_working=no
  2000. win32_winver_bump=no
  2001. dnl We do not support non-unicode Windows.
  2002. if test "x$win32_specific_codes" = xenabled; then
  2003. #### Check for Wide functions
  2004. AC_CHECK_FUNC([_wopen], [win32_unicode=enabled],[win32_unicode=disabled])
  2005. AC_MSG_CHECKING([if we want Unicode File Open for Win32])
  2006. if test "x$win32_unicode" = xenabled; then
  2007. dnl We need to include the header for PathCombineW checking as
  2008. dnl the actual symbol has a very funny name.
  2009. oldlibs=$LIBS
  2010. LIBS="$LIBS -lshlwapi"
  2011. AC_MSG_RESULT([yes])
  2012. AC_MSG_CHECKING([if Unicode functions working])
  2013. AC_LINK_IFELSE([AC_LANG_SOURCE([
  2014. #include <windows.h>
  2015. #include <shlwapi.h>
  2016. #include <stdlib.h>
  2017. int main()
  2018. {
  2019. MultiByteToWideChar (0, 0, NULL, 0, NULL, 0);
  2020. WideCharToMultiByte (0, 0, NULL, 0, NULL, 0, NULL, NULL);
  2021. PathCombineW(0,0,0);
  2022. return 0;
  2023. }
  2024. ])], [win32_wide_working=yes], [win32_winver_bump=yes])
  2025. if test "x$win32_wide_working" = xno; then
  2026. AC_LINK_IFELSE([AC_LANG_SOURCE([
  2027. #define WINVER 0x501
  2028. #define _WIN32_WINNT 0x501
  2029. #include <windows.h>
  2030. #include <shlwapi.h>
  2031. #include <stdlib.h>
  2032. int main()
  2033. {
  2034. MultiByteToWideChar (0, 0, NULL, 0, NULL, 0);
  2035. WideCharToMultiByte (0, 0, NULL, 0, NULL, 0, NULL, NULL);
  2036. PathCombineW(0,0,0);
  2037. return 0;
  2038. }
  2039. ])], [win32_wide_working=yes], [AC_MSG_RESULT([no])])
  2040. fi
  2041. if test "x$win32_wide_working" = xyes; then
  2042. AC_MSG_RESULT([yes])
  2043. AC_DEFINE([WANT_WIN32_UNICODE], [1], [ Define to use Unicode for Windows ])
  2044. else
  2045. LIBS=$oldlibs
  2046. AC_MSG_ERROR([Unicode support for Win32 not working])
  2047. fi
  2048. else
  2049. AC_MSG_ERROR([Unicode File Open for Win32 not available])
  2050. fi
  2051. #### Check for Network functions
  2052. AC_CHECK_HEADERS([ws2tcpip.h], [win32_sockets=enabled], [AC_MSG_WARN([Please update your headers to support winsock 2.2.])])
  2053. AC_MSG_CHECKING([if we want Win32 sockets])
  2054. if test "x$win32_sockets" = "xenabled" && test "x$network" != "xdisabled"; then
  2055. AC_MSG_RESULT([yes])
  2056. AC_MSG_CHECKING([if winsock2 API is available])
  2057. wsoldlibs="$LIBS"
  2058. LIBS="$LIBS -lws2_32"
  2059. AC_LINK_IFELSE([AC_LANG_SOURCE([
  2060. #include <winsock2.h>
  2061. #include <ws2tcpip.h>
  2062. #include <stdlib.h>
  2063. int main()
  2064. {
  2065. getaddrinfo(NULL, NULL, NULL, NULL);
  2066. freeaddrinfo(NULL);
  2067. return 0;
  2068. }
  2069. ])], [win32_sockets_working=yes], [win32_winver_bump=yes])
  2070. if test "x$win32_sockets_working" = "xno"; then
  2071. AC_MSG_CHECKING([deeper if winsock2 API is available])
  2072. AC_LINK_IFELSE([AC_LANG_SOURCE([
  2073. #define WINVER 0x501
  2074. #define _WIN32_WINNT 0x501
  2075. #include <winsock2.h>
  2076. #include <ws2tcpip.h>
  2077. #include <stdlib.h>
  2078. int main()
  2079. {
  2080. getaddrinfo(NULL, NULL, NULL, NULL);
  2081. freeaddrinfo(NULL);
  2082. return 0;
  2083. }
  2084. ])], [win32_sockets_working=yes], [AC_MSG_RESULT([no])])
  2085. fi
  2086. if test "x$win32_sockets_working" = "xyes"; then
  2087. AC_MSG_RESULT([yes])
  2088. AC_DEFINE([WANT_WIN32_SOCKETS], [1], [ Define to use Win32 sockets ])
  2089. network_type=Winsock2
  2090. have_network=yes
  2091. have_ipv6=yes
  2092. else
  2093. LIBS="$wsoldlibs"
  2094. AC_MSG_WARN([Please update your headers to support winsock 2.2.])
  2095. fi
  2096. else
  2097. AC_MSG_RESULT([no])
  2098. fi
  2099. #### Check for Win32 Named Pipe functions
  2100. win32_fifo_working=no
  2101. if test x$win32_specific_codes = xenabled; then
  2102. AC_MSG_CHECKING([if we have Named Pipes])
  2103. if test "x$fifo" != "xdisabled"; then
  2104. AC_LINK_IFELSE([AC_LANG_SOURCE([
  2105. #include <windows.h>
  2106. int main(){
  2107. CreateNamedPipeA(NULL,PIPE_ACCESS_DUPLEX|FILE_FLAG_OVERLAPPED,PIPE_TYPE_BYTE,1,255,255,0,NULL);
  2108. CreateNamedPipeW(NULL,PIPE_ACCESS_DUPLEX|FILE_FLAG_OVERLAPPED,PIPE_TYPE_BYTE,1,255,255,0,NULL);
  2109. return 0;
  2110. }])],[win32_fifo_working=yes],[win32_winver_bump=yes])
  2111. if test "x$win32_fifo_working" != "xyes"; then
  2112. AC_LINK_IFELSE([AC_LANG_SOURCE([
  2113. #define WINVER 0x501
  2114. #define _WIN32_WINNT 0x501
  2115. #include <windows.h>
  2116. int main(){
  2117. CreateNamedPipeA(NULL,PIPE_ACCESS_DUPLEX|FILE_FLAG_OVERLAPPED,PIPE_TYPE_BYTE,1,255,255,0,NULL);
  2118. CreateNamedPipeW(NULL,PIPE_ACCESS_DUPLEX|FILE_FLAG_OVERLAPPED,PIPE_TYPE_BYTE,1,255,255,0,NULL);
  2119. return 0;
  2120. }])],[win32_fifo_working=yes],[win32_fifo_working=no])
  2121. fi
  2122. fi
  2123. have_mkfifo=$win32_fifo_working
  2124. if test "x$win32_fifo_working" = "xyes"; then
  2125. AC_MSG_RESULT([yes])
  2126. AC_DEFINE([WANT_WIN32_FIFO], [1], [ Define to use Win32 named pipes ])
  2127. else
  2128. AC_MSG_RESULT([no])
  2129. fi
  2130. fi
  2131. #### WINVER Bump
  2132. if test x$win32_specific_codes = xenabled; then
  2133. AC_MSG_CHECKING([if WINVER and _WIN32_WINNT needs version bumps])
  2134. if test "x$win32_winver_bump" = "xyes"; then
  2135. AC_MSG_RESULT([yes])
  2136. AC_DEFINE([WINVER], [0x0501], [ WinXP and above for ipv6 ])
  2137. AC_DEFINE([_WIN32_WINNT], [0x0501], [ WinXP and above for ipv6 ])
  2138. # getaddrinfo and freeaddrinfo are available for Win2K and above
  2139. # Bug: MinGW.org w32api ws2tcpip.h incorrectly wants (_WIN32_WINNT >= 0x0501) for getaddrinfo and freeaddrinfo
  2140. # MultiByteToWideChar and WideCharToMultiByte are available for Win2K and above
  2141. else
  2142. AC_MSG_RESULT([no])
  2143. fi
  2144. fi
  2145. fi #END OF WIN32 CHECKS
  2146. #### Check mingw.org for EOVERFLOW
  2147. AC_MSG_CHECKING([if we have EOVERFLOW macro])
  2148. AC_COMPILE_IFELSE([AC_LANG_SOURCE([
  2149. #include <errno.h>
  2150. int i = (EOVERFLOW) + 0;
  2151. ])],[eoverflow_present=yes],[eoverflow_present=no])
  2152. AC_MSG_RESULT([$eoverflow_present])
  2153. AS_IF([test "x$eoverflow_present" = "xyes"],[],[AC_DEFINE([EOVERFLOW],[EFBIG],[Use EFBIG as substitude for EOVERFLOW, mingw.org may lack the latter])])
  2154. #### Use Win32 support codes
  2155. AM_CONDITIONAL([WIN32_CODES], [ test "x$win32_specific_codes" = xenabled ])
  2156. if test x"$network" = xauto; then
  2157. if test x"$have_network" = xyes; then
  2158. network=enabled
  2159. else
  2160. network=disabled
  2161. fi
  2162. fi
  2163. if test x"$ipv6" = xauto; then
  2164. if test x"$have_ipv6" = xyes; then
  2165. ipv6=enabled
  2166. else
  2167. ipv6=disabled
  2168. fi
  2169. fi
  2170. dnl ############## FIFO enable
  2171. if test x"$fifo" = xauto; then
  2172. if test x"$have_mkfifo" = xyes; then
  2173. fifo=enabled
  2174. else
  2175. fifo=disabled
  2176. fi
  2177. fi
  2178. if test x"$fifo" = xenabled; then
  2179. AC_DEFINE(FIFO, 1, [ Define if FIFO support is enabled. ])
  2180. if test x"$have_mkfifo" = xno; then
  2181. AC_MSG_WARN( [ You forced FIFO code while I think there is no mkfifo() available! ] )
  2182. fi
  2183. fi
  2184. dnl ############## Network enable
  2185. if test x"$network" = xenabled; then
  2186. AC_DEFINE(NETWORK, 1, [ Define if network support is enabled. ])
  2187. if test x"$have_network" = xno; then
  2188. AC_MSG_WARN( [ You forced network code while I think there is support missing! ] )
  2189. fi
  2190. fi
  2191. if test x"$ipv6" = xenabled; then
  2192. AC_DEFINE(IPV6, 1, [ Define if IPV6 support is enabled. ])
  2193. if test x"$have_ipv6" = xno; then
  2194. AC_MSG_WARN( [ You forced IPv6 code while I think there is no getaddrinfo() available! ] )
  2195. fi
  2196. fi
  2197. dnl ############## Final Output
  2198. AC_CONFIG_FILES([
  2199. Makefile
  2200. libmpg123.pc
  2201. libout123.pc
  2202. mpg123.spec
  2203. src/libmpg123/mpg123.h
  2204. src/libout123/out123.h
  2205. ])
  2206. AC_OUTPUT
  2207. dnl ############## Display Message
  2208. echo "
  2209. $PACKAGE_NAME $PACKAGE_VERSION
  2210. Install path ............ $prefix
  2211. CPU Optimization ........ $cpu_type
  2212. Compiler Optimization ... $with_optimization
  2213. Gapless Support ......... $gapless
  2214. Debugging ............... $debugging
  2215. Seek table size ......... $seektable
  2216. FIFO support ............ $fifo
  2217. Buffer .................. $buffer
  2218. Network (http streams) .. $network
  2219. Network Sockets ......... $network_type
  2220. IPv6 (getaddrinfo) ...... $ipv6"
  2221. if test x"$LARGEFILE_BITS" = x; then
  2222. echo " File offsets ............ default"
  2223. else
  2224. echo " File offsets ............ $LARGEFILE_BITS"
  2225. echo " The lib will (try to) support default offset size, too."
  2226. fi
  2227. echo " LFS alias symbols ....... $lfs_alias ($LFS_ALIAS_BITS)"
  2228. echo " LFS alias type .......... $lfs_alias_type"
  2229. if test x"$use_yasm_for_avx" = xyes; then
  2230. echo " Use yasm (for AVX only) . enabled"
  2231. else
  2232. echo " Use yasm (for AVX only) . disabled"
  2233. fi
  2234. echo "
  2235. Core libmpg123 features:
  2236. Layer I ................. $layer1
  2237. Layer II ................ $layer2
  2238. Layer III ............... $layer3
  2239. NtoM resampling ......... $ntom
  2240. downsampled decoding .... $downsample
  2241. Feeder/buffered input ... $feeder
  2242. ID3v2 parsing ........... $id3v2
  2243. String API .............. $string
  2244. ICY parsing/conversion .. $icy
  2245. Error/warning messages .. $messages
  2246. Win32 Unicode File Open.. $win32_unicode
  2247. Feature Report Function.. $feature_report
  2248. Output formats (nofpu will disable all but 16 or 8 bit!):
  2249. 8 bit integer ........... $int8
  2250. 16 bit integer .......... $int16
  2251. 32/24 bit integer ....... $int32
  2252. real (32 bit float) ..... $real
  2253. Equalizer ............... $equalizer
  2254. Optimization detail:
  2255. Integer conversion ...... $integers
  2256. IEEE 754 hackery ........ $ieee
  2257. New/old WRITE_SAMPLE .... $newoldwritesample
  2258. new Huffman scheme ...... $newhuff
  2259. Note: Disabling core features is not commonly done and some combinations might not build/work. If you encounter such a case, help yourself (and provide a patch) or just poke the maintainers."
  2260. # just an empty line
  2261. echo
  2262. echo " Modules ................. $modules"
  2263. echo " Checked audio modules ... $check_modules
  2264. Detected audio support ..$output_modules
  2265. Default output module ... $default_output_module
  2266. "
  2267. if test x"$modules" = xdisabled; then
  2268. echo "The _single_ active output module is being statically linked in.
  2269. "
  2270. fi
  2271. if test x"$with_optimization" = x0; then
  2272. echo "No optimization flags chosen, make sure you have something basic in your CFLAGS at least...
  2273. "
  2274. fi
  2275. if test x"$cpu_type" = xi486; then
  2276. echo "WARNING: You selected the i486 decoder. This is not recommened for regular use."
  2277. echo "It was designed for actual i486 CPUs a long time ago. Generic C code is likely"
  2278. echo "to perform better nowadays. Also, the decoder misses features like volume"
  2279. echo "scaling and has clipping issues. Continue if you are into software archeology"
  2280. echo "only."
  2281. fi
  2282. echo
  2283. echo " CPPFLAGS='$CPPFLAGS'"
  2284. echo " CFLAGS='$CFLAGS'"
  2285. echo " LIBS='$LIBS'"
  2286. echo
  2287. echo "Next type 'make' and then 'make install'."