Compiling libJPEG for Mac OSX

Hello !

I know that this is a little bit OT but i want to use SDL_image
CVS on Mac OSX and need to compile libJPEG.

libPNG compiled without any problems, creating static and shared libs.
libJPEG only creates static libs.

I am using Mac OSX v10.3 Is there a way to compile libJPEG the UNIX way
on Mac OSX with shared and static libs ? I don?t want to use FINK.

Thanks.

Run ‘./configure --help | less’ without the quotes. Scroll through the
output to search for what you’re looking for.

Good luck.On Fri, 2004-07-09 at 08:27, Torsten Giebl wrote:

Hello !

I am using Mac OSX v10.3 Is there a way to compile libJPEG the UNIX way
on Mac OSX with shared and static libs ? I don?t want to use FINK.

I know that this is a little bit OT but i want to use SDL_image
CVS on Mac OSX and need to compile libJPEG.

libPNG compiled without any problems, creating static and shared libs.
libJPEG only creates static libs.

I am using Mac OSX v10.3 Is there a way to compile libJPEG the UNIX way
on Mac OSX with shared and static libs ? I don?t want to use FINK.

Why do you care? Shared libraries are a PITA when you’re distributing
an application – especially on OS X. The memory and disk space
savings by sharing libjpeg among processes is going to be totally
negligible, since most things that need jpeg already have it
(statically linked) or get it from somewhere else (like QuickTime or
CoreGraphics). Basically, it’s a total waste to care about having a
shared library.

On another note, you may also want to look at DarwinPorts. It’s a lot
different than Fink.

-bob
-------------- next part --------------
A non-text attachment was scrubbed…
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2357 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20040709/e2f26abd/attachment.binOn Jul 9, 2004, at 11:27 AM, Torsten Giebl wrote:

Bob Ippolito wrote:

Why do you care? Shared libraries are a PITA when you’re distributing
an application – especially on OS X.

If you’re statically linking with an LGPL library (as it is the case for
SDL) you have to provide a way to the user to link to another version of
SDL. Using dynamic library avoids such troubles. That can be a good
reason :slight_smile:

Stephane

Hello !

If you’re statically linking with an LGPL library (as it is the case for
SDL) you have to provide a way to the user to link to another version of
SDL. Using dynamic library avoids such troubles. That can be a good
reason :slight_smile:

Yup. And normally on a Standard System you want to
have libPNG, libJPEG, zlib and so on installed.

MacOSX comes with zlib. libPNG compiles without problems on
MacOSX. The only problem for me is libJPEG. And after installing
SDL_image i can start hacking :slight_smile:

CU

Hi,

Yup. And normally on a Standard System you want to have libPNG, libJPEG,
zlib and so on installed.

MacOSX comes with zlib. libPNG compiles without problems on MacOSX. The
only problem for me is libJPEG. And after installing SDL_image i can
start hacking :slight_smile:

Don’t know if it’ll work for You, but on BeOS i this “trick” if i just
want to compile once:

when You compile it using “make” command, one of the last “parts” of
output You’ll get will be few lines starting with “ar rc” then many files
with “.o” extension. just copy those lines, and change “ar rc” part to:

g++ -shared -Xlinker -soname=libjpeg.so -o libjpeg.so

or something similar (sorry, but i don’t know what extension MacOS uses
for shared library, or if soname is needed… hmm… maybe You can check
that line in output of libpng build?). after that line just paste all
object file names (those with “.o” extension).

Regards
ahwayakchih

On a related note. Does anyone know how to link statically on windows for a
gcc/mingw target?

CU,
SecOn Fri, Jul 09, 2004 at 13:48 -0400, Bob Ippolito wrote:

Why do you care? Shared libraries are a PITA when you’re distributing
an application – especially on OS X.


When C++ is your hammer, everything looks like a thumb

Bob Ippolito wrote:

Why do you care? Shared libraries are a PITA when you’re
distributing an application – especially on OS X.

If you’re statically linking with an LGPL library (as it is the case
for SDL) you have to provide a way to the user to link to another
version of SDL. Using dynamic library avoids such troubles. That can
be a good reason :slight_smile:

But not in this case!

-bob

-------------- next part --------------
A non-text attachment was scrubbed…
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2357 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20040709/6627670e/attachment.binOn Jul 9, 2004, at 1:52 PM, Stephane Marchesin wrote:

Hi,

Yup. And normally on a Standard System you want to have libPNG,
libJPEG,
zlib and so on installed.

MacOSX comes with zlib. libPNG compiles without problems on MacOSX.
The
only problem for me is libJPEG. And after installing SDL_image i can
start hacking :slight_smile:

Don’t know if it’ll work for You, but on BeOS i this “trick” if i just
want to compile once:

when You compile it using “make” command, one of the last “parts” of
output You’ll get will be few lines starting with “ar rc” then many
files
with “.o” extension. just copy those lines, and change “ar rc” part to:

g++ -shared -Xlinker -soname=libjpeg.so -o libjpeg.so

or something similar (sorry, but i don’t know what extension MacOS uses
for shared library, or if soname is needed… hmm… maybe You can
check
that line in output of libpng build?). after that line just paste all
object file names (those with “.o” extension).

It’s not nearly that easy on OS X. I don’t really want to get into it
here. man ld :slight_smile:

-bob
-------------- next part --------------
A non-text attachment was scrubbed…
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2357 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20040709/df0fe8de/attachment.binOn Jul 9, 2004, at 4:47 PM, Marcin Konicki wrote:

Hello !

If you’re statically linking with an LGPL library (as it is the case
for
SDL) you have to provide a way to the user to link to another version
of
SDL. Using dynamic library avoids such troubles. That can be a good
reason :slight_smile:

Yup. And normally on a Standard System you want to
have libPNG, libJPEG, zlib and so on installed.

MacOSX comes with zlib. libPNG compiles without problems on
MacOSX. The only problem for me is libJPEG. And after installing
SDL_image i can start hacking :slight_smile:

What’s the difference whether it’s installed statically or dynamically?
Applications still compile against it. No shipping OS X
application[*] depends on a dynamic version of libjpeg being installed.

[*] excluding applications that aren’t done correctly, or applications
that depend on some package management system such as fink or
darwinports

-bob
-------------- next part --------------
A non-text attachment was scrubbed…
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2357 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20040709/c7068a50/attachment.binOn Jul 9, 2004, at 3:11 PM, Torsten Giebl wrote: