configure.in 34 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265
  1. dnl $Id$
  2. dnl
  3. dnl
  4. dnl don't forget to set ASM_FOR_ARCH to a space delimited list of
  5. dnl processor architectures, for which assembler routines exist
  6. dnl
  7. dnl
  8. dnl Exported and configured variables:
  9. dnl CC
  10. dnl CFLAGS
  11. dnl LDFLAGS
  12. dnl LDADD
  13. dnl NASM
  14. dnl extra vars for frontend:
  15. dnl FRONTEND_LDFLAGS
  16. dnl FRONTEND_CFLAGS
  17. dnl FRONTEND_LDADD
  18. AC_PREREQ(2.69)
  19. AC_INIT([lame],[3.100],[lame-dev@lists.sf.net])
  20. AC_CONFIG_SRCDIR([libmp3lame/lame.c])
  21. AC_LANG([C])
  22. dnl check system
  23. AC_CANONICAL_HOST
  24. dnl automake
  25. AM_INIT_AUTOMAKE
  26. AC_CONFIG_HEADERS([config.h])
  27. AH_TOP([
  28. #ifndef LAME_CONFIG_H
  29. #define LAME_CONFIG_H
  30. ])
  31. AH_BOTTOM([#endif /* LAME_CONFIG_H */])
  32. AM_MAINTAINER_MODE
  33. AM_MAKE_INCLUDE
  34. dnl check environment
  35. AC_AIX
  36. AC_ISC_POSIX
  37. AC_MINIX
  38. case $host_os in
  39. *cygwin* ) CYGWIN=yes;;
  40. * ) CYGWIN=no;;
  41. esac
  42. dnl libtool
  43. # AC_DISABLE_SHARED
  44. AC_PROG_LIBTOOL
  45. AC_SUBST(LIBTOOL_DEPS)
  46. CFLAGS="${ac_save_CFLAGS}"
  47. # increase this when the shared lib becomes totally incompatible
  48. LIB_MAJOR_VERSION=0
  49. # increase this when changes are made, but they are upward compatible
  50. # to previous versions
  51. LIB_MINOR_VERSION=0
  52. dnl # work around for a bug, don't know where it is exactly
  53. if test "${ac_cv_cygwin}" = "yes"; then
  54. if test "${CC}" != "gcc"; then
  55. AC_MSG_ERROR([Please use]
  56. [ CC=gcc ./configure]
  57. [Abort this configure run and add "CC=gcc" or you will]
  58. [see errors and no lame.exe will be build.])
  59. fi
  60. fi
  61. dnl check programs
  62. AC_PROG_CC()
  63. if test "x${GCC}" = "xyes"; then
  64. AC_MSG_CHECKING(compiler)
  65. COMPILER_TYPE="`${CC} --version | head -1 | sed -e '1,$s/version.*//g'`"
  66. case "${COMPILER_TYPE}" in
  67. *gcc*)
  68. AC_MSG_RESULT(gcc)
  69. HAVE_GCC=yes
  70. HAVE_CLANG=no
  71. ;;
  72. *clang*)
  73. AC_MSG_RESULT(clang)
  74. HAVE_CLANG=yes
  75. HAVE_GCC=no
  76. ;;
  77. *)
  78. AC_MSG_RESULT(unknown)
  79. HAVE_GCC=no
  80. HAVE_CLANG=no
  81. ;;
  82. esac
  83. if test "${HAVE_GCC}" = "yes"; then
  84. AC_MSG_CHECKING(version of GCC)
  85. GCC_version="`${CC} --version | sed -n '1s/^[[^ ]]* (.*) //;s/ .*$//;1p'`"
  86. case "${GCC_version}" in
  87. [0-9]*[0-9]*)
  88. AC_MSG_RESULT(${GCC_version})
  89. ;;
  90. *)
  91. # probably not gcc...
  92. AC_MSG_RESULT(unknown compiler version pattern, playing safe and disabling gcc optimisations... ${GCC_version})
  93. HAVE_GCC=no
  94. ;;
  95. esac
  96. fi
  97. if test "${HAVE_CLANG}" = "yes"; then
  98. AC_MSG_CHECKING(version of clang)
  99. CLANG_version="`${CC} --version | sed -n 's/.*clang version //;s/ .*$//;1p'`"
  100. AC_MSG_RESULT(${CLANG_version})
  101. fi
  102. fi
  103. AC_CHECK_HEADER(dmalloc.h)
  104. if test "${ac_cv_header_dmalloc_h}" = "yes"; then
  105. AM_WITH_DMALLOC
  106. fi
  107. dnl Checks for header files.
  108. AC_HEADER_STDC
  109. AC_CHECK_HEADERS( \
  110. errno.h \
  111. fcntl.h \
  112. limits.h \
  113. stdint.h \
  114. string.h \
  115. sys/soundcard.h \
  116. sys/time.h \
  117. unistd.h \
  118. linux/soundcard.h)
  119. dnl Checks for actually working SSE intrinsics
  120. AC_MSG_CHECKING(working SSE intrinsics)
  121. AC_COMPILE_IFELSE(
  122. [AC_LANG_PROGRAM(
  123. [[#include <xmmintrin.h>]],
  124. [[_mm_sfence();]])],
  125. [AC_DEFINE([HAVE_XMMINTRIN_H], [1], [Define if SSE intrinsics work.])
  126. ac_cv_header_xmmintrin_h=yes],
  127. [ac_cv_header_xmmintrin_h=no])
  128. AC_MSG_RESULT(${ac_cv_header_xmmintrin_h})
  129. dnl Checks for typedefs, structures, and compiler characteristics.
  130. AC_C_CONST
  131. AC_C_INLINE
  132. if test ${cross_compiling} = "no"; then
  133. AC_C_BIGENDIAN
  134. fi
  135. AC_SYS_LARGEFILE
  136. AC_CHECK_SIZEOF(short)
  137. AC_CHECK_SIZEOF(unsigned short)
  138. AC_CHECK_SIZEOF(int)
  139. AC_CHECK_SIZEOF(unsigned int)
  140. AC_CHECK_SIZEOF(long)
  141. AC_CHECK_SIZEOF(unsigned long)
  142. AC_CHECK_SIZEOF(long long)
  143. AC_CHECK_SIZEOF(unsigned long long)
  144. AC_CHECK_SIZEOF(float)
  145. AC_CHECK_SIZEOF(double)
  146. if test $ac_cv_sizeof_short -eq 0 \
  147. -o $ac_cv_sizeof_unsigned_short -eq 0 \
  148. -o $ac_cv_sizeof_int -eq 0 \
  149. -o $ac_cv_sizeof_unsigned_int -eq 0 \
  150. -o $ac_cv_sizeof_long -eq 0 \
  151. -o $ac_cv_sizeof_unsigned_long -eq 0 \
  152. -o $ac_cv_sizeof_long_long -eq 0 \
  153. -o $ac_cv_sizeof_unsigned_long_long -eq 0 \
  154. -o $ac_cv_sizeof_float -eq 0 \
  155. -o $ac_cv_sizeof_double -eq 0; then
  156. echo '*** I have a problem determining the size of some variable types. Either'
  157. echo '*** you compiler is broken, or your system+compiler combination is not'
  158. echo '*** supportet by the "autoconf" framework we use to generate this'
  159. echo '*** configure script.'
  160. exit 1
  161. fi
  162. AC_C_LONG_DOUBLE
  163. if test "${ac_cv_c_have_long_double}" = "yes" ; then
  164. AC_CHECK_SIZEOF(long double)
  165. fi
  166. AC_CHECK_TYPES([uint8_t, int8_t, uint16_t, int16_t, uint32_t, int32_t, uint64_t, int64_t])
  167. AH_VERBATIM([HAVE_UINT8_T],
  168. [/* add uint8_t type */
  169. #undef HAVE_UINT8_T
  170. #ifndef HAVE_UINT8_T
  171. typedef unsigned char uint8_t;
  172. #endif])
  173. AH_VERBATIM([HAVE_INT8_T],
  174. [/* add int8_t type */
  175. #undef HAVE_INT8_T
  176. #ifndef HAVE_INT8_T
  177. typedef char int8_t;
  178. #endif])
  179. AH_VERBATIM([HAVE_UINT16_T],
  180. [/* add uint16_t type */
  181. #undef HAVE_UINT16_T
  182. #ifndef HAVE_UINT16_T
  183. typedef unsigned short uint16_t;
  184. #endif])
  185. AH_VERBATIM([HAVE_INT16_T],
  186. [/* add int16_t type */
  187. #undef HAVE_INT16_T
  188. #ifndef HAVE_INT16_T
  189. typedef short int16_t;
  190. #endif])
  191. if test "${HAVE_INT32_T}" = yes; then
  192. AC_DEFINE(A_UINT32_T,unsigned int32_t)
  193. else
  194. if test "${ac_cv_sizeof_unsigned_short}" = "4"; then
  195. AC_DEFINE(A_UINT32_T,unsigned short)
  196. else
  197. if test "${ac_cv_sizeof_unsigned_int}" = "4"; then
  198. AC_DEFINE(A_UINT32_T,unsigned int)
  199. else
  200. if test "${ac_cv_sizeof_unsigned_long}" = "4"; then
  201. AC_DEFINE(A_UINT32_T,unsigned long)
  202. else
  203. AC_MSG_ERROR([CHECK_TYPE_uint32_t - please report to lame-dev@lists.sourceforge.net])
  204. fi
  205. fi
  206. fi
  207. fi
  208. AH_VERBATIM([HAVE_UINT32_T],
  209. [/* add uint32_t type */
  210. #undef HAVE_UINT32_T
  211. #ifndef HAVE_UINT32_T
  212. #undef A_UINT32_T
  213. typedef A_UINT32_T uint32_t;
  214. #endif])
  215. if test "${ac_cv_sizeof_short}" = "4"; then
  216. AC_DEFINE(A_INT32_T,short)
  217. else
  218. if test "${ac_cv_sizeof_int}" = "4"; then
  219. AC_DEFINE(A_INT32_T,int)
  220. else
  221. if test "${ac_cv_sizeof_long}" = "4"; then
  222. AC_DEFINE(A_INT32_T,long)
  223. else
  224. AC_MSG_ERROR([CHECK_TYPE_int32_t - please report to lame-dev@lists.sourceforge.net])
  225. fi
  226. fi
  227. fi
  228. AH_VERBATIM([HAVE_INT32_T],
  229. [/* add int32_t type */
  230. #undef HAVE_INT32_T
  231. #ifndef HAVE_INT32_T
  232. #undef A_INT32_T
  233. typedef A_INT32_T int32_t;
  234. #endif])
  235. if test "${HAVE_INT64_T}" = yes; then
  236. AC_DEFINE(A_UINT64_T,unsigned int64_t)
  237. else
  238. if test "${ac_cv_sizeof_unsigned_int}" = "8"; then
  239. AC_DEFINE(A_UINT64_T,unsigned int)
  240. else
  241. if test "${ac_cv_sizeof_unsigned_long}" = "8"; then
  242. AC_DEFINE(A_UINT64_T,unsigned long)
  243. else
  244. if test "${ac_cv_sizeof_unsigned_long_long}" = "8"; then
  245. AC_DEFINE(A_UINT64_T,unsigned long long)
  246. else
  247. AC_MSG_ERROR([CHECK_TYPE_uint64_t - please report to lame-dev@lists.sourceforge.net])
  248. fi
  249. fi
  250. fi
  251. fi
  252. AH_VERBATIM([HAVE_UINT64_T],
  253. [/* add uint64_t type */
  254. #undef HAVE_UINT64_T
  255. #ifndef HAVE_UINT64_T
  256. #undef A_UINT64_T
  257. typedef A_UINT64_T uint64_t;
  258. #endif])
  259. if test "${ac_cv_sizeof_int}" = "8"; then
  260. AC_DEFINE(A_INT64_T,int)
  261. else
  262. if test "${ac_cv_sizeof_long}" = "8"; then
  263. AC_DEFINE(A_INT64_T,long)
  264. else
  265. if test "${ac_cv_sizeof_long_long}" = "8"; then
  266. AC_DEFINE(A_INT64_T,long long)
  267. else
  268. AC_MSG_ERROR([CHECK_TYPE_int64_t - please report to lame-dev@lists.sourceforge.net])
  269. fi
  270. fi
  271. fi
  272. AH_VERBATIM([HAVE_INT64_T],
  273. [/* add int64_t type */
  274. #undef HAVE_INT64_T
  275. #ifndef HAVE_INT64_T
  276. #undef A_INT64_T
  277. typedef A_INT64_T int64_t;
  278. #endif])
  279. alex_IEEE854_FLOAT80
  280. if test "${alex_cv_ieee854_float80}" = "yes" ; then
  281. if test "${ac_cv_c_long_double}" = "yes" ; then
  282. AC_CHECK_TYPES(ieee854_float80_t, long double)
  283. AH_VERBATIM([HAVE_IEEE854_FLOAT80_T],
  284. [/* add ieee854_float80_t type */
  285. #undef HAVE_IEEE854_FLOAT80_T
  286. #ifndef HAVE_IEEE854_FLOAT80_T
  287. typedef long double ieee854_float80_t;
  288. #endif])
  289. AC_DEFINE(HAVE_IEEE854_FLOAT80, 1, [system has 80 bit floats])
  290. fi
  291. fi
  292. AC_CHECK_TYPES([ieee754_float64_t, ieee754_float32_t])
  293. AH_VERBATIM([HAVE_IEEE754_FLOAT64_T],
  294. [/* add ieee754_float64_t type */
  295. #undef HAVE_IEEE754_FLOAT64_T
  296. #ifndef HAVE_IEEE754_FLOAT64_T
  297. typedef double ieee754_float64_t;
  298. #endif])
  299. AH_VERBATIM([HAVE_IEEE754_FLOAT32_T],
  300. [/* add ieee754_float32_t type */
  301. #undef HAVE_IEEE754_FLOAT32_T
  302. #ifndef HAVE_IEEE754_FLOAT32_T
  303. typedef float ieee754_float32_t;
  304. #endif])
  305. AC_DEFINE(LAME_LIBRARY_BUILD, 1, [requested by Frank, seems to be temporary needed for a smooth transition])
  306. if test ${cross_compiling} = "yes"; then
  307. AC_MSG_WARN([]
  308. [**************************************************************************]
  309. [* *]
  310. [* You are cross compiling: *]
  311. [* - I did not have a change to determine *]
  312. [* + the size of: *]
  313. [* - short *]
  314. [* - unsigned short *]
  315. [* - int *]
  316. [* - unsigned int *]
  317. [* - long *]
  318. [* - unsigned long *]
  319. [* - float *]
  320. [* - double *]
  321. [* - long double *]
  322. [* + the endianess of the system *]
  323. [* - You have to provide appropriate defines for them in config.h, e.g. *]
  324. [* + define SIZEOF_SHORT to 2 if the size of a short is 2 *]
  325. [* + define WORDS_BIGENDIAN if your system is a big endian system *]
  326. [* *]
  327. [**************************************************************************])
  328. fi
  329. AC_TYPE_SIZE_T
  330. AC_HEADER_TIME
  331. dnl Checks for library functions.
  332. AC_FUNC_ALLOCA
  333. AC_CHECK_FUNCS(gettimeofday strtol)
  334. if test "X${ac_cv_func_strtol}" != "Xyes"; then
  335. AC_MSG_ERROR([function strtol is mandatory])
  336. fi
  337. dnl Check if we are on a mingw system, which needs libwsock32
  338. SOCKETFUNCTION=unknown
  339. AC_CHECK_FUNCS(socket)
  340. if test $ac_cv_func_socket = no; then
  341. # maybe it is in libsocket
  342. AC_CHECK_LIB(socket, socket, [AC_DEFINE(HAVE_SOCKET)
  343. LIBS="$LIBS -lsocket"])
  344. if test "X${ac_cv_lib_socket_socket}" != "Xyes"; then
  345. SOCKETFUNCTION=NO
  346. else
  347. case ${host_os} in
  348. *solaris*)
  349. LIBS="$LIBS -lnsl"
  350. ;;
  351. esac
  352. fi
  353. fi
  354. dnl Initialize configuration variables for the Makefile
  355. CFLAGS=${CFLAGS}
  356. CONFIG_DEFS=${CONFIG_DEFS}
  357. NASM=
  358. INCLUDES="-I\$(top_srcdir)/include -I\$(srcdir)"
  359. FRONTEND_LDFLAGS=
  360. FRONTEND_CFLAGS=
  361. LIB_SOURCES=
  362. MAKEDEP="-M"
  363. RM_F="rm -f"
  364. AC_ARG_ENABLE(nasm,
  365. [ --enable-nasm Allow the use of nasm if available],
  366. ASM_FOR_ARCH="i386", ASM_FOR_ARCH="")
  367. dnl Checks for libraries.
  368. AC_CHECK_HEADERS(termcap.h)
  369. AC_CHECK_HEADERS(ncurses/termcap.h)
  370. AC_CHECK_LIB(termcap, initscr, HAVE_TERMCAP="termcap")
  371. AC_CHECK_LIB(curses, initscr, HAVE_TERMCAP="curses")
  372. AC_CHECK_LIB(ncurses, initscr, HAVE_TERMCAP="ncurses")
  373. AM_ICONV
  374. dnl math lib
  375. AC_CHECK_LIB(m, cos, USE_LIBM="-lm")
  376. dnl free fast math library
  377. AC_CHECK_LIB(ffm, cos, USE_LIBM="-lffm -lm")
  378. dnl Compaq fast math library.
  379. AC_ARG_ENABLE(cpml,
  380. [ --disable-cpml Do not use Compaq's fast Math Library],
  381. CONFIG_CPML="no", CONFIG_CPML="yes")
  382. if test "${CONFIG_CPML}" = yes; then
  383. AC_CHECK_LIB(cpml, cos, USE_LIBM="-lcpml")
  384. fi
  385. CONFIG_MATH_LIB="${USE_LIBM}"
  386. dnl configure use of features
  387. AM_PATH_GTK(1.2.0, HAVE_GTK="yes", HAVE_GTK="no")
  388. dnl ElectricFence malloc debugging
  389. AC_MSG_CHECKING(use of ElectricFence malloc debugging)
  390. AC_ARG_ENABLE(efence,
  391. [ --enable-efence Use ElectricFence for malloc debugging],
  392. CONFIG_EFENCE="${enableval}", CONFIG_EFENCE="no")
  393. case "${CONFIG_EFENCE}" in
  394. yes)
  395. AC_CHECK_LIB(efence, EF_Print, HAVE_EFENCE="-lefence")
  396. if test "x${HAVE_EFENCE}" != "x-lefence"; then
  397. AC_MSG_RESULT(yes, but libefence not found)
  398. else
  399. LDADD="${LDADD} ${HAVE_EFENCE}"
  400. AC_DEFINE(HAVE_EFENCE, 1, we link against libefence)
  401. AC_MSG_RESULT(${CONFIG_EFENCE})
  402. fi
  403. ;;
  404. no)
  405. AC_MSG_RESULT(${CONFIG_EFENCE})
  406. ;;
  407. *)
  408. AC_MSG_ERROR(bad value �${CONFIG_EFENCE}� for efence option)
  409. ;;
  410. esac
  411. dnl libsndfile
  412. WARNING=
  413. AC_ARG_WITH(fileio,
  414. [ --with-fileio=lame Use lame's internal file io routines [default]]
  415. [ =sndfile Use Erik de Castro Lopo's libsndfile]
  416. [ (no stdin possible currently)],
  417. CONFIG_FILEIO="${withval}", CONFIG_FILEIO="lame")
  418. if test "${CONFIG_FILEIO}" = "sndfile" ; then
  419. PKG_CHECK_MODULES(SNDFILE, sndfile >= 1.0.2, HAVE_SNDFILE="yes", HAVE_SNDFILE="no")
  420. fi
  421. AC_MSG_CHECKING(use of file io)
  422. if test "${CONFIG_FILEIO}" = "sndfile" ; then
  423. if test "${HAVE_SNDFILE}" = "yes" -o "x${SNDFILE_LIBS}" != "x" \
  424. -o "x${SNDFILE_CFLAGS}" != "x"; then
  425. SNDFILE_LIBS=`echo ${SNDFILE_LIBS}`
  426. SNDFILE_CFLAGS=`echo ${SNDFILE_CFLAGS}`
  427. if test -n "${SNDFILE_LIBS}" ; then
  428. FRONTEND_LDFLAGS="${SNDFILE_LIBS} ${FRONTEND_LDFLAGS}"
  429. fi
  430. FRONTEND_LDADD="-lsndfile ${FRONTEND_LDADD}"
  431. if test -n "${SNDFILE_CFLAGS}" ; then
  432. INCLUDES="${SNDFILE_CFLAGS} ${INCLUDES}"
  433. fi
  434. AC_DEFINE(LIBSNDFILE, 1, set to 1 if you have libsndfile)
  435. else
  436. # default
  437. CONFIG_FILEIO="lame"
  438. WARNING="${WARNING} Could not find any sndfile lib on system."
  439. fi
  440. else
  441. CONFIG_FILEIO="lame"
  442. fi
  443. AC_MSG_RESULT(${CONFIG_FILEIO})
  444. if test "x${WARNING}" != "x" ; then
  445. AC_MSG_WARN($WARNING)
  446. fi
  447. dnl check if we should remove hooks for analyzer code in library
  448. dnl default library must include these hooks
  449. AC_MSG_CHECKING(use of analyzer hooks)
  450. AC_ARG_ENABLE(analyzer-hooks,
  451. [ --disable-analyzer-hooks Exclude analyzer hooks],
  452. CONFIG_ANALYZER="${enableval}", CONFIG_ANALYZER="yes")
  453. case "${CONFIG_ANALYZER}" in
  454. yes)
  455. ;;
  456. no)
  457. AC_DEFINE(NOANALYSIS, 1, build without hooks for analyzer)
  458. ;;
  459. *)
  460. AC_MSG_ERROR(bad value �${CONFIG_ANALYZER}� for analyzer-hooks option)
  461. ;;
  462. esac
  463. AC_MSG_RESULT($CONFIG_ANALYZER)
  464. dnl mpg123 decoder
  465. AC_MSG_CHECKING(use of mpg123 decoder)
  466. AC_ARG_ENABLE(decoder,
  467. [ --disable-decoder Exclude mpg123 decoder],
  468. CONFIG_DECODER="${enableval}", CONFIG_DECODER="yes")
  469. AM_CONDITIONAL(LIB_WITH_DECODER, test "x${CONFIG_DECODER}" = "xyes")
  470. if test "${CONFIG_DECODER}" != "no" ; then
  471. CONFIG_DECODER="yes (Layer 1, 2, 3)"
  472. AC_DEFINE(HAVE_MPGLIB, 1, build with mpglib support)
  473. AC_DEFINE(DECODE_ON_THE_FLY, 1, allow to compute a more accurate replaygain value)
  474. fi
  475. AC_MSG_RESULT($CONFIG_DECODER)
  476. AC_MSG_CHECKING(if the lame frontend should be build)
  477. AC_ARG_ENABLE(frontend,
  478. [ --disable-frontend Do not build the lame executable [default=build]],
  479. WITH_FRONTEND="${enableval}", WITH_FRONTEND=yes)
  480. if test "x${WITH_FRONTEND}" = "xyes"; then
  481. WITH_FRONTEND=lame${ac_exeext}
  482. AC_MSG_RESULT(yes)
  483. else
  484. WITH_FRONTEND=
  485. AC_MSG_RESULT(no)
  486. fi
  487. AC_MSG_CHECKING(if mp3x is requested)
  488. AC_ARG_ENABLE(mp3x,
  489. [ --enable-mp3x Build GTK frame analyzer [default=no]],
  490. WITH_MP3X="${enableval}", WITH_MP3X=no)
  491. if test "x${WITH_MP3X}" = "xyes"; then
  492. WITH_MP3X=mp3x${ac_exeext}
  493. AC_MSG_RESULT(yes)
  494. else
  495. WITH_MP3X=
  496. AC_MSG_RESULT(no)
  497. fi
  498. if test "${HAVE_GTK}" = "no"; then
  499. if test "x${WITH_MP3X}" = "xmp3x"; then
  500. AC_MSG_WARN(can't build mp3x, no GTK installed)
  501. WITH_MP3X=
  502. fi
  503. if test "x${CONFIG_ANALYZER}" != "xyes"; then
  504. AC_MSG_WARN(can't build mp3x because of disabled analyzer hooks)
  505. WITH_MP3X=
  506. fi
  507. fi
  508. AC_MSG_CHECKING(if mp3rtp is requested)
  509. AC_ARG_ENABLE(mp3rtp,
  510. [ --enable-mp3rtp Build mp3rtp [default=no]],
  511. WITH_MP3RTP="${enableval}", WITH_MP3RTP=no)
  512. if test "x${WITH_MP3RTP}" = "xyes"; then
  513. if test ${SOCKETFUNCTION} = NO; then
  514. AC_MSG_ERROR([function socket is mandatory for mp3rtp])
  515. fi
  516. WITH_MP3RTP=mp3rtp${ac_exeext}
  517. AC_MSG_RESULT(yes)
  518. else
  519. WITH_MP3RTP=
  520. AC_MSG_RESULT(no)
  521. fi
  522. AC_MSG_CHECKING(if dynamic linking of the frontends is requested)
  523. AC_ARG_ENABLE(dynamic-frontends,
  524. [ --enable-dynamic-frontends Link frontends against shared libraries [default=no]],
  525. FRONTEND_LDFLAGS="${FRONTEND_LDFLAGS}", FRONTEND_LDFLAGS="${FRONTEND_LDFLAGS} -static")
  526. case "x${FRONTEND_LDFLAGS}" in
  527. *-static*)
  528. AC_MSG_RESULT(no)
  529. ;;
  530. *)
  531. AC_MSG_RESULT(yes)
  532. ;;
  533. esac
  534. #
  535. # this is from vorbis
  536. #
  537. dnl check GLIBC
  538. case $host in
  539. *86-*-linux*)
  540. # glibc < 2.1.3 has a serious FP bug in the math inline header
  541. # that will cripple Vorbis. Look to see if the magic FP stack
  542. # clobber is missing in the mathinline header, thus indicating
  543. # the buggy version
  544. AC_EGREP_CPP(log10.*fldlg2.*fxch,[
  545. #define __LIBC_INTERNAL_MATH_INLINES 1
  546. #define __OPTIMIZE__
  547. #include <math.h>
  548. ],bad=maybe,bad=no)
  549. AC_MSG_CHECKING(glibc mathinline bug)
  550. if test ${bad} = "maybe" ;then
  551. AC_EGREP_CPP(log10.*fldlg2.*fxch.*st\([[0123456789]]*\),
  552. [
  553. #define __LIBC_INTERNAL_MATH_INLINES 1
  554. #define __OPTIMIZE__
  555. #include <math.h>
  556. ],bad=no,bad=yes)
  557. fi
  558. AC_MSG_RESULT(${bad})
  559. if test ${bad} = "yes" ;then
  560. AC_MSG_WARN([ ])
  561. AC_MSG_WARN([********************************************************])
  562. AC_MSG_WARN([* The glibc headers on this machine have a serious bug *])
  563. AC_MSG_WARN([* in /usr/include/bits/mathinline.h This bug affects *])
  564. AC_MSG_WARN([* all floating point code, not only LAME, but all code *])
  565. AC_MSG_WARN([* built on this machine. Upgrading to glibc 2.1.3 is *])
  566. AC_MSG_WARN([* strongly urged to correct the problem. *])
  567. AC_MSG_WARN([*Note: that upgrading glibc will not fix any previously*])
  568. AC_MSG_WARN([* built programs; this is a compile-time bug. *])
  569. AC_MSG_WARN([* To work around the problem for this build of LAME, *])
  570. AC_MSG_WARN([* autoconf is disabling all math inlining. This will *])
  571. AC_MSG_WARN([* hurt LAME performace but is necessary for LAME to *])
  572. AC_MSG_WARN([* work correctly. Once glibc is upgraded, rerun *])
  573. AC_MSG_WARN([* configure and make to build with inlining. *])
  574. AC_MSG_WARN([********************************************************])
  575. AC_MSG_WARN([ ])
  576. AC_DEFINE(__NO_MATH_INLINES, 1, work around a glibc bug)
  577. fi;;
  578. esac
  579. dnl configure use of VBR bitrate histogram
  580. dnl todo: always use yes as default, use simulation instead ?
  581. AC_MSG_CHECKING(for termcap)
  582. if test "x${HAVE_TERMCAP}" != "x"; then
  583. FRONTEND_LDADD="-l${HAVE_TERMCAP} ${FRONTEND_LDADD}"
  584. AC_DEFINE(HAVE_TERMCAP, 1, have termcap)
  585. TERMCAP_DEFAULT="yes"
  586. else
  587. TERMCAP_DEFAULT="no"
  588. fi
  589. AC_MSG_RESULT(${TERMCAP_DEFAULT})
  590. dnl ### processor specific options ###
  591. WITH_VECTOR=no
  592. case $host_cpu in
  593. x86_64|amd64)
  594. CPUTYPE="no"
  595. if test $ac_cv_header_xmmintrin_h = yes ; then
  596. WITH_XMM=yes
  597. WITH_VECTOR=yes
  598. fi
  599. AC_DEFINE(TAKEHIRO_IEEE754_HACK, 1, IEEE754 compatible machine)
  600. AC_DEFINE(USE_FAST_LOG, 1, faster log implementation with less but enoug
  601. h precission)
  602. ;;
  603. *86)
  604. CPUTYPE="i386"
  605. if test $ac_cv_header_xmmintrin_h = yes ; then
  606. WITH_XMM=yes
  607. WITH_VECTOR=yes
  608. fi
  609. # use internal knowledge of the IEEE 754 layout
  610. AC_DEFINE(TAKEHIRO_IEEE754_HACK, 1, IEEE754 compatible machine)
  611. AC_DEFINE(USE_FAST_LOG, 1, faster log implementation with less but enough precission)
  612. ;;
  613. powerpc)
  614. CPUTYPE="no"
  615. # use internal knowledge of the IEEE 754 layout
  616. AC_DEFINE(TAKEHIRO_IEEE754_HACK, 1, IEEE754 compatible machine)
  617. # The following should not get enabled on a G5. HOWTO check for a G5?
  618. AC_DEFINE(USE_FAST_LOG, 1, faster log implementation with less but enough precission)
  619. ;;
  620. *)
  621. CPUTYPE="no"
  622. ;;
  623. esac
  624. # which vector code do we support to build on this machine?
  625. AM_CONDITIONAL(WITH_XMM, test "x${WITH_XMM}" = "xyes")
  626. # needs to be defined to link in the internal vector lib
  627. AM_CONDITIONAL(WITH_VECTOR, test "x${WITH_VECTOR}" = "xyes")
  628. AC_MSG_CHECKING(if I have to build the internal vector lib)
  629. AC_MSG_RESULT(${WITH_VECTOR})
  630. AC_PATH_PROG(NASM, nasm, no)
  631. case "${NASM}" in
  632. no)
  633. ;;
  634. *)
  635. AC_MSG_CHECKING(for assembler routines for this processor type)
  636. for recurse_over in ${ASM_FOR_ARCH}
  637. do
  638. if test "${CPUTYPE}" = "${recurse_over}"; then
  639. include_asm_routines="yes"
  640. fi
  641. case $host_os in
  642. *darwin*)
  643. # currently we have problems because of a wrong
  644. # libtool hack in the darwin case (for nasm code)
  645. include_asm_routines="no"
  646. ;;
  647. esac
  648. done
  649. if test "x${include_asm_routines}" = "xyes"; then
  650. AC_DEFINE(HAVE_NASM, 1, have nasm)
  651. AC_DEFINE(MMX_choose_table, 1, use MMX version of choose_table)
  652. else
  653. include_asm_routines="no"
  654. NASM="no"
  655. fi
  656. AC_MSG_RESULT(${include_asm_routines})
  657. ;;
  658. esac
  659. AM_CONDITIONAL(HAVE_NASM, test "${NASM}" != "no")
  660. case $host_os in
  661. *cygwin*|*mingw32*)
  662. CYGWIN=yes
  663. NASM_FORMAT="-f win32 -DWIN32"
  664. ;;
  665. *darwin*)
  666. NASM_FORMAT="-f macho"
  667. ;;
  668. *)
  669. CYGWIN=no
  670. NASM_FORMAT="-f elf"
  671. ;;
  672. esac
  673. #
  674. # 'expopt' is used for "additional optimizations", not for optimizations which
  675. # are marked as "experimental" in the guide for the compiler.
  676. # They are "experimental" here in the LAME project (at least
  677. # "--enable-expopt=full").
  678. #
  679. AC_MSG_CHECKING(for additional optimizations)
  680. AC_ARG_ENABLE(expopt,
  681. [ --enable-expopt=full,norm Whether to enable experimental optimizations]
  682. [ [default=no]],
  683. CONFIG_EXPOPT="${enableval}", CONFIG_EXPOPT="no")
  684. if test "x$HAVE_GCC" = "xyes" -o "x$HAVE_CLANG" = "xyes"; then
  685. # gcc defaults. OS specific options go in versious sections below
  686. # from the gcc man pages: "there is no reason to use -pedantic"
  687. if test "x${with_gnu_ld}" = "xyes"; then
  688. CFLAGS="-Wall -pipe ${CFLAGS}"
  689. else
  690. # some vendor ld's don't like '-pipe'
  691. CFLAGS="-Wall ${CFLAGS}"
  692. fi
  693. # GCC version specific generic options
  694. if test "x${HAVE_GCC}" = "xyes"; then
  695. case "${GCC_version}" in
  696. 2.96*)
  697. # for buggy version of gcc shipped with RH7.1, back of on some
  698. # optimizations
  699. OPTIMIZATION="-O -fomit-frame-pointer -ffast-math \
  700. -funroll-loops"
  701. OPTIMIZATION_FULL="-fmove-all-movables -freduce-all-givs \
  702. -fsched-interblock -fbranch-count-reg -fforce-addr \
  703. -fforce-mem"
  704. ;;
  705. 3.0*)
  706. # -funroll-loops seems to produce buggy code with gcc 3.0.3
  707. OPTIMIZATION="-O -fomit-frame-pointer -ffast-math"
  708. OPTIMIZATION_FULL="-fmove-all-movables -freduce-all-givs \
  709. -fbranch-count-reg -fforce-addr -fforce-mem"
  710. ;;
  711. 3.*|4.0.*|4.1.*)
  712. # -fomit-frame-pointer seems to be buggy on cygwin
  713. case ${host_os} in
  714. *cygwin*)
  715. OMIT_FRAME_POINTER=
  716. ;;
  717. *)
  718. OMIT_FRAME_POINTER=-fomit-frame-pointer
  719. ;;
  720. esac
  721. OPTIMIZATION="-O3 ${OMIT_FRAME_POINTER} -ffast-math"
  722. OPTIMIZATION_FULL="-fmove-all-movables -freduce-all-givs \
  723. -fbranch-count-reg -fforce-addr -fforce-mem"
  724. ;;
  725. [456789].*)
  726. OPTIMIZATION="-O3 -fomit-frame-pointer -ffast-math"
  727. OPTIMIZATION_FULL="-fbranch-count-reg -fforce-addr"
  728. ;;
  729. *)
  730. # default
  731. OPTIMIZATION="-O3 ${OMIT_FRAME_POINTER} -ffast-math \
  732. -funroll-loops"
  733. OPTIMIZATION_FULL="-fbranch-count-reg -fforce-addr"
  734. ;;
  735. esac
  736. # GCC version independend generic options
  737. OPTIMIZATION_NORM="-fschedule-insns2"
  738. fi
  739. # generic CPU specific options
  740. case ${host_cpu} in
  741. sparc)
  742. case "${GCC_version}" in
  743. 3.0*)
  744. ;;
  745. [3456789].*)
  746. # doesn't work on 3.0.x, but on 3.[12] and
  747. # hopefully on every other release after that too
  748. if test -x /usr/bin/isalist; then
  749. /usr/bin/isalist | grep sparcv8plus \
  750. >/dev/null 2>&1 && \
  751. OPTIMIZATION="${OPTIMIZATION} \
  752. -mcpu=ultrasparc \
  753. -mtune=ultrasparc"
  754. fi
  755. ;;
  756. esac
  757. ;;
  758. *86)
  759. case "${GCC_version}" in
  760. [3456789].*)
  761. OPTIMIZATION="${OPTIMIZATION} \
  762. -maccumulate-outgoing-args"
  763. ;;
  764. esac
  765. ;;
  766. esac
  767. expopt_msg_result_printed=no
  768. case "${CONFIG_EXPOPT}" in
  769. no)
  770. # if someone supplies own CFLAGS, we don't add our own
  771. if test "x${ac_save_CFLAGS}" != "x"; then
  772. OPTIMIZATION=""
  773. fi
  774. ;;
  775. norm|yes)
  776. OPTIMIZATION="${OPTIMIZATION} ${OPTIMIZATION_NORM}"
  777. ;;
  778. full)
  779. OPTIMIZATION="${OPTIMIZATION} ${OPTIMIZATION_NORM} \
  780. ${OPTIMIZATION_FULL}"
  781. if test "${HAVE_GCC}" = "yes"; then
  782. # some hardware dependend options
  783. case "${GCC_version}" in
  784. 2.9*|3.*|4.0.*|4.1.*)
  785. # "new" GCC, use some "new" CPU specific optimizations
  786. # use -mtune instead of -m486 or -mcpu= etc, since they are
  787. # deprecated by GCC <rbrito>
  788. case ${host_cpu} in
  789. *486)
  790. OPTIMIZATION="${OPTIMIZATION} -mcpu=i486 \
  791. -mfancy-math-387"
  792. ;;
  793. *586)
  794. OPTIMIZATION="${OPTIMIZATION} -mcpu=pentium \
  795. -march=pentium -mfancy-math-387"
  796. ;;
  797. *686)
  798. OPTIMIZATION="${OPTIMIZATION} -mcpu=pentiumpro \
  799. -march=pentiumpro -mfancy-math-387 \
  800. -malign-double"
  801. ;;
  802. *86)
  803. OPTIMIZATION="${OPTIMIZATION} -mfancy-math-387"
  804. ;;
  805. alpha*)
  806. OPTIMIZATION="${OPTIMIZATION} -mfp-regs"
  807. AC_DEFINE(FLOAT, double, double is faster than float on Alpha)
  808. # add "-mcpu=21164a -Wa,-m21164a" to optimize
  809. # for 21164a (ev56) CPU
  810. ;;
  811. *)
  812. OPTIMIZATION="${OPTIMIZATION} -fdelayed-branch"
  813. ;;
  814. esac
  815. ;;
  816. [456789].*)
  817. case ${host_cpu} in
  818. *486)
  819. OPTIMIZATION="${OPTIMIZATION} -march=i486"
  820. ;;
  821. *586)
  822. OPTIMIZATION="${OPTIMIZATION} -march=i586 \
  823. -mtune=native"
  824. ;;
  825. *686)
  826. OPTIMIZATION="${OPTIMIZATION} -march=i686 \
  827. -mtune=native"
  828. ;;
  829. *86)
  830. OPTIMIZATION="${OPTIMIZATION} -march=native \
  831. -mtune=native"
  832. ;;
  833. arm*-gnueabi)
  834. if [ -z "$(echo ${GCC_version} | awk '/4\.0/')" ]; then
  835. # Work round buggy softfloat optimization in ARM EABI compilers
  836. # -gnueabi in only gcc-4.1 onwards
  837. OPTIMIZATION="${OPTIMIZATION} -fno-finite-math-only"
  838. fi
  839. ;;
  840. esac
  841. ;;
  842. *)
  843. # no special optimization for other versions
  844. AC_MSG_RESULT(no)
  845. expopt_msg_result_printed=yes
  846. AC_MSG_WARN(LAME doesn't know about your version (${GCC_version}) of gcc, please report it to lame-dev@lists.sourceforge.net. Please make sure you try the latest LAME version first!)
  847. ;;
  848. esac
  849. fi
  850. ;;
  851. *)
  852. AC_MSG_ERROR(bad value �${CONFIG_EXPOPT}� for expopt option)
  853. ;;
  854. esac
  855. if test "x${HAVE_CLANG}" = "xyes"; then
  856. case "${CLANG_VERSION}" in
  857. 3.[89]*|[45].*)
  858. OPTIMIZATION="-Ofast"
  859. ;;
  860. *)
  861. OPTIMIZATION="-O3"
  862. ;;
  863. esac
  864. # generic CPU specific options
  865. case ${host_cpu} in
  866. *486)
  867. OPTIMIZATION="${OPTIMIZATION} -march=i486"
  868. ;;
  869. *586)
  870. OPTIMIZATION="${OPTIMIZATION} -march=i586 \
  871. -mtune=native"
  872. ;;
  873. *686)
  874. OPTIMIZATION="${OPTIMIZATION} -march=i686 \
  875. -mtune=native"
  876. ;;
  877. *86)
  878. OPTIMIZATION="${OPTIMIZATION} -march=native \
  879. -mtune=native"
  880. ;;
  881. esac
  882. fi
  883. if test "${expopt_msg_result_printed}" = "no" ; then
  884. AC_MSG_RESULT(${CONFIG_EXPOPT})
  885. fi
  886. else
  887. AC_MSG_RESULT(no)
  888. fi
  889. AC_MSG_CHECKING(for debug options)
  890. AC_ARG_ENABLE(debug,
  891. [ --enable-debug=alot,norm Enable debugging (disables optimizations)]
  892. [ [default=no]],
  893. CONFIG_DEBUG="${enableval}", CONFIG_DEBUG="no")
  894. if test "x$GCC" = "xyes"; then
  895. DEBUG_NORM_OPT="-O -g -Wall"
  896. DEBUG_ANOYING="-Wbad-function-cast -Wcast-align \
  897. -Wcast-qual -Wchar-subscripts -Wconversion \
  898. -Wmissing-prototypes -Wnested-externs -Wpointer-arith \
  899. -Wredundant-decls -Wshadow -Wstrict-prototypes \
  900. -Wwrite-strings -Winline \
  901. -Wformat -Wswitch -Waggregate-return -Wmissing-noreturn \
  902. -Wimplicit-int -fno-builtin"
  903. case "${CONFIG_DEBUG}" in
  904. no)
  905. dnl Comment out the NDEBUG on release build, they check for issues
  906. dnl which should also be rejected in a release build.
  907. dnl The real solution would be to do user friendly error messages
  908. dnl instead of a core dump. This is a quick and user-unfriendly fix.
  909. dnl AC_DEFINE(NDEBUG, 1, no debug build)
  910. ;;
  911. norm|yes)
  912. AC_DEFINE(ABORTFP, 1, debug define)
  913. OPTIMIZATION="${DEBUG_NORM_OPT}"
  914. ;;
  915. anoying)
  916. AC_DEFINE(ABORTFP, 1, debug define)
  917. OPTIMIZATION="${DEBUG_NORM_OPT} ${DEBUG_ANOYING}"
  918. ;;
  919. alot)
  920. AC_DEFINE(ABORTFP, 1, debug define)
  921. AC_DEFINE(DEBUG, 1, alot of debug output)
  922. OPTIMIZATION="${DEBUG_NORM_OPT}"
  923. ;;
  924. *)
  925. AC_MSG_ERROR(bad value �${CONFIG_DEBUG}� for debug option)
  926. esac
  927. AC_MSG_RESULT(${CONFIG_DEBUG})
  928. else
  929. AC_MSG_RESULT(no)
  930. fi
  931. dnl ### system specific options ###
  932. ##########################################################################
  933. # LINUX on Digital/Compaq Alpha CPUs
  934. ##########################################################################
  935. case $host in
  936. alpha*-*-linux*)
  937. ################################################################
  938. #### Check if 'ccc' is in our path
  939. ################################################################
  940. if test "`which ccc 2>/dev/null | grep -c ccc`" != "0" ; then
  941. # Compaq's C Compiler
  942. CC=ccc
  943. ################################################################
  944. #### set 'OPTIMIZATION = -arch host -tune host'
  945. #### to generate/tune instructions for this machine
  946. #### 'OPTIMIZATION += -migrate -fast -inline speed -unroll 0'
  947. #### tweak to run as fast as possible :)
  948. #### 'OPTIMIZATION += -w0'
  949. #### set warning and linking flags
  950. ################################################################
  951. OPTIMIZATION="-arch host -tune host"
  952. OPTIMIZATION="-migrate -fast -inline speed -unroll 0 $OPTIMIZATION"
  953. OPTIMIZATION="-w0 $OPTIMIZATION"
  954. ################################################################
  955. #### to debug, uncomment
  956. ################################################################
  957. # For Debugging
  958. #OPTIMIZATION="-g3 $OPTIMIZATION"
  959. ################################################################
  960. #### define __DECALPHA__ (i was getting re-declaration warnings
  961. #### in machine.h
  962. ################################################################
  963. # Define DEC Alpha
  964. AC_DEFINE(__DECALPHA__, 1, we're on DEC Alpha)
  965. fi # gcc or ccc?
  966. ;; # alpha
  967. ##########################################################################
  968. # SunOS
  969. ##########################################################################
  970. sparc-*-sunos4*)
  971. if test CC = "cc"; then
  972. OPTIMIZATION="-O -xCC"
  973. MAKEDEP="-xM"
  974. # for gcc, use instead:
  975. # CC="gcc"
  976. # OPTIMIZATION="-O"
  977. # MAKEDEP="-M"
  978. AC_MSG_WARN([Please contact lame@lists.sourceforge.net with the output of the configure run and the file config.cache. Thank you for your cooperation.])
  979. fi
  980. ;; #SunOS
  981. ##########################################################################
  982. # SGI
  983. ##########################################################################
  984. *-sgi-irix*)
  985. if test CC = "cc"; then
  986. OPTIMIZATION="-O3 -woff all"
  987. fi
  988. ;; # SGI
  989. ##########################################################################
  990. # Compaq Alpha running Dec Unix (OSF)
  991. ##########################################################################
  992. alpha*-dec-osf*)
  993. if test CC = "cc"; then
  994. OPTIMIZATION="-fast -O3 -std -g3 -non_shared"
  995. fi
  996. ;; #OSF
  997. esac
  998. # todo: include the following tests in the case-list
  999. UNAME=`uname`
  1000. ARCH=`uname -m`
  1001. ###########################################################################
  1002. # MOSXS (Rhapsody PPC)
  1003. ###########################################################################
  1004. if test "$UNAME" = "Rhapsody"; then
  1005. # CC="cc" # should be handled already by autoconf
  1006. MAKEDEP="-make"
  1007. fi
  1008. ###########################################################################
  1009. # MAC OSX Darwin PPC
  1010. ###########################################################################
  1011. if test "$UNAME" = "Darwin"; then
  1012. MAKEDEP="-make"
  1013. CFLAGS="$CFLAGS -fno-common"
  1014. fi
  1015. ##########################################################################
  1016. # OS/2
  1017. ##########################################################################
  1018. # Properly installed EMX runtime & development package is a prerequisite.
  1019. # tools I used: make 3.76.1, uname 1.12, sed 2.05, PD-ksh 5.2.13
  1020. #
  1021. ##########################################################################
  1022. if test "$UNAME" = "OS/2"; then
  1023. SHELL=sh
  1024. #CC=gcc # should already be handled by configure
  1025. # file extension should already be handled by automake (I don't know,
  1026. # please give feedback!
  1027. #FILE_EXTENSION=".exe"
  1028. # Uncomment & inspect the GTK lines to use MP3x GTK frame analyzer.
  1029. # Properly installed XFree86/devlibs & GTK+ is a prerequisite.
  1030. # The following works for me using Xfree86/OS2 3.3.5 and GTK+ 1.2.3:
  1031. # AC_DEFINE(HAVE_GTK, 1, have GTK)
  1032. # AC_DEFINE(__ST_MT_ERRNO__, 1)
  1033. # INCLUDES="-IC:/XFree86/include/gtk12 -IC:/XFree86/include/glib12 \
  1034. # -IC:/XFree86/include $INCLUDES"
  1035. # FRONTEND_LDFLAGS="-LC:/XFree86/lib -lgtk12 -lgdk12 -lgmodule -lglib12 \
  1036. # -lXext -lX11 -lshm -lbsd -lsocket -lm $FRONTEND_LDFLAGS"
  1037. # FRONTEND_CFLAGS="-Zmtd -Zsysv-signals -Zbin-files $FRONTEND_CFLAGS"
  1038. fi
  1039. ###########################################################################
  1040. # AmigaOS
  1041. ###########################################################################
  1042. # Type 'Make ARCH=PPC' for PowerUP and 'Make ARCH=WOS' for WarpOS
  1043. #
  1044. ###########################################################################
  1045. if test "$UNAME" = "AmigaOS" ; then
  1046. CC="gcc -noixemul"
  1047. OPTIMIZATION="$OPTIMIZATION -m68020-60 -m68881"
  1048. MAKEDEP="-MM"
  1049. if test "$ARCH" = "WOS"; then
  1050. CC="ppc-amigaos-gcc -warpup"
  1051. OPTIMIZATION="$OPTIMIZATION -mmultiple -mcpu=603e"
  1052. AR="ppc-amigaos-ar"
  1053. RANLIB="ppc-amigaos-ranlib"
  1054. fi
  1055. if test "$ARCH",PPC; then
  1056. CC="ppc-amigaos-gcc"
  1057. OPTIMIZATION="$OPTIMIZATION -mmultiple -mcpu=603e"
  1058. AR="ppc-amigaos-ar"
  1059. RANLIB="ppc-amigaos-ranlib"
  1060. fi
  1061. fi
  1062. CFLAGS="${OPTIMIZATION} ${CFLAGS}"
  1063. LDADD="${LDADD}"
  1064. FRONTEND_CFLAGS="${INCICONV} ${FRONTEND_CFLAGS}"
  1065. FRONTEND_LDADD="${FRONTEND_LDADD} ${LTLIBICONV} ${CONFIG_MATH_LIB}"
  1066. AC_SUBST(INCLUDES)
  1067. AC_SUBST(FRONTEND_LDFLAGS)
  1068. AC_SUBST(FRONTEND_CFLAGS)
  1069. AC_SUBST(FRONTEND_LDADD)
  1070. AC_SUBST(CONFIG_MATH_LIB)
  1071. AC_SUBST(LDADD)
  1072. AC_SUBST(LIB_MAJOR_VERSION)
  1073. AC_SUBST(LIB_MINOR_VERSION)
  1074. AC_SUBST(NASM)
  1075. AC_SUBST(NASM_FORMAT)
  1076. AC_SUBST(MAKEDEP)
  1077. AC_SUBST(RM_F)
  1078. AC_SUBST(LIBTOOL_DEPS)
  1079. AC_SUBST(WITH_FRONTEND)
  1080. AC_SUBST(WITH_MP3X)
  1081. AC_SUBST(WITH_MP3RTP)
  1082. AC_SUBST(CPUTYPE)
  1083. AC_SUBST(CPUCCODE)
  1084. AC_SUBST(CONFIG_DEFS)
  1085. AC_CONFIG_FILES([Makefile \
  1086. libmp3lame/Makefile \
  1087. libmp3lame/i386/Makefile \
  1088. libmp3lame/vector/Makefile \
  1089. frontend/Makefile \
  1090. mpglib/Makefile \
  1091. doc/Makefile \
  1092. doc/html/Makefile \
  1093. doc/man/Makefile \
  1094. include/Makefile \
  1095. Dll/Makefile \
  1096. misc/Makefile \
  1097. dshow/Makefile \
  1098. ACM/Makefile \
  1099. ACM/ADbg/Makefile \
  1100. ACM/ddk/Makefile \
  1101. ACM/tinyxml/Makefile \
  1102. lame.spec \
  1103. mac/Makefile \
  1104. macosx/Makefile \
  1105. macosx/English.lproj/Makefile \
  1106. macosx/LAME.xcodeproj/Makefile \
  1107. vc_solution/Makefile])
  1108. AC_OUTPUT