Compiling LAME on OpenSolaris
Had a couple of problems compiling LAME under Solaris Express b77 with the SunStudio compilers, so I thought I'd document the workarounds here.
I downloaded the source from Sourceforge, unpacked and ran
But
Searched around and found a solution here, patching the source with:
The executable is under the
I downloaded the source from Sourceforge, unpacked and ran
./configure. No problems here.
But
./make complained about __inline. I looked around a bit and found this post with the following patch:
*** gain_analysis.c.orig Tue May 31 20:05:09 2005
--- gain_analysis.c Tue May 31 20:06:32 2005
***************
*** 247,252 ****
--- 247,257 ----
/* returns GAIN_ANALYSIS_OK if successful,
GAIN_ANALYSIS_ERROR if not */
+ #ifdef __SUNPRO_C
+ #pragma inline (fsqr)
+ #define __inline
+ #endif
+
static __inline double fsqr(const double d)
{ return d*d;
}
Another ./make revealed a different problem.Searched around and found a solution here, patching the source with:
--- frontend/brhist.c.orig Sun Sep 24 15:53:31 2006
+++ frontend/brhist.c Mon Nov 20 14:02:55 2006
@@ -429,7 +429,7 @@
void
brhist_disp(const lame_global_flags * gf)
{
- int i, lines = 0;
+ int i, brh_lines = 0;
int br_hist[BRHIST_WIDTH]; /* how often a frame size was used */
int br_sm_hist[BRHIST_WIDTH][4]; /* how often a special frame size/stereo mode commbination was used */
int st_mode[4];
@@ -456,13 +456,13 @@
if (most_often < br_hist[i])
most_often = br_hist[i];
if (br_hist[i])
- ++lines;
+ ++brh_lines;
}
for (i = 0; i < BRHIST_WIDTH; i++) {
int show = br_hist[i];
#ifdef RH_HIST
- show = show && (lines > 1);
+ show = show && (brh_lines > 1);
#endif
if (show
|| (i >= brhist.vbr_bitrate_min_index
./make now runs smoothly.The executable is under the
lame-3.97/frontend folder.
__inline is our old friend, GCC. That can be solved easily enough with the C preprocessor, cpp(1):
#define __inline inline
Posted by UX-admin on January 24, 2008 at 06:53 AM PST #