[GRASS-user] Re: Patched version of libjpeg-6b for 32-bit and 64-bit architectures

I have libjpeg build instructions that take care of 32+64 bits. And my UnixImageIO framework includes libjpeg 32+64bits. There's actually nothing wrong in the source for 64bit support (that version you sent seems to be newer than I thought was available, but none of the new code looks like it has anything to do with 64bit fixes), it's just the configuration and compilation that needs a little help.

The main problem is that the libtool included is so old (v1.3.5), it doesn't understand the OSX -arch flags. And it's too old to *easily* update libtool, though some autotools whiz probably could.

I'm actually surprised this works for you - libtool 1.3.5 should quietly drop those arch flags during compilation (or complain). My build instructions use a different approach, using a custom gcc wrapper to fool libtool into not seeing the flags. Though I have been considering a custom makefile, which should be easy enough, so I don't have to depend on the gcc wrapper.

On Sep 30, 2008, at 3:58 PM, Elvis Dowson wrote:

In order to build it , open a terminal window and type the following commands:

MACOSX_DEPLOYMENT_TARGET=10.5
CFLAGS="-O2 -I$(srcdir) -arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -pipe -no-cppprecomp"
CCFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -pipe"
CXXFLAGS="-arch ppc -arch ppc64 - arch i386 -arch x86_64 -g -Os -pipe"
LDFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 -bind_at_load"
./configure --enable-shared

Modify the following entries in the automatically generated Makefile

CFLAGS= -O2 -I$(srcdir) -arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -pipe -no-cppprecomp
CCFLAGS= -arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -pipe
CXXFLAGS= -arch ppc -arch ppc64 - arch i386 -arch x86_64 -g -Os -pipe
LDFLAGS= -arch ppc -arch ppc64 -arch i386 -arch x86_64 -bind_at_load

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"Mon Dieu! but they are all alike. Cheating, murdering, lying, fighting, and all for things that the beasts of the jungle would not deign to possess - money to purchase the effeminate pleasures of weaklings. And yet withal bound down by silly customs that make them slaves to their unhappy lot while firm in the belief that they be the lords of creation enjoying the only real pleasures of existence....

- the wisdom of Tarzan

Hi William,
                       Yes, those flags are being dropped somehow, I didn't know it was libtool. I had a suspicion that the instructions for specifying the environment variables was somehow redundant, since it didn't appear in the Makefile, even though makefile.cfg attempts to reference these variables for inclusion in the Makefile.

In the end I just had to edit the Makefile manually to get it to work.

Some of the patches that I applied helped to create the dynamic libraries. The original 6b sources somehow only kept generating the static versions of these libraries.

As to why I didn't use your pre-built frameworks, well, it is because later on, I want to try to port it to a real-time OS, such as VxWorks or GreenHills Integrity with X11. Hence, I was to see what kind of problems I'll run into and learn it on the Mac X11 environment, and sort of prepare myself for the real-time OS environment.

Best regards,

Elvis Dowson

On Oct 1, 2008, at 1:43 AM, William Kyngesburye wrote:

I have libjpeg build instructions that take care of 32+64 bits. And my UnixImageIO framework includes libjpeg 32+64bits. There's actually nothing wrong in the source for 64bit support (that version you sent seems to be newer than I thought was available, but none of the new code looks like it has anything to do with 64bit fixes), it's just the configuration and compilation that needs a little help.

The main problem is that the libtool included is so old (v1.3.5), it doesn't understand the OSX -arch flags. And it's too old to *easily* update libtool, though some autotools whiz probably could.

I'm actually surprised this works for you - libtool 1.3.5 should quietly drop those arch flags during compilation (or complain). My build instructions use a different approach, using a custom gcc wrapper to fool libtool into not seeing the flags. Though I have been considering a custom makefile, which should be easy enough, so I don't have to depend on the gcc wrapper.

On Sep 30, 2008, at 3:58 PM, Elvis Dowson wrote:

In order to build it , open a terminal window and type the following commands:

MACOSX_DEPLOYMENT_TARGET=10.5
CFLAGS="-O2 -I$(srcdir) -arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -pipe -no-cppprecomp"
CCFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -pipe"
CXXFLAGS="-arch ppc -arch ppc64 - arch i386 -arch x86_64 -g -Os -pipe"
LDFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 -bind_at_load"
./configure --enable-shared

Modify the following entries in the automatically generated Makefile

CFLAGS= -O2 -I$(srcdir) -arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -pipe -no-cppprecomp
CCFLAGS= -arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -pipe
CXXFLAGS= -arch ppc -arch ppc64 - arch i386 -arch x86_64 -g -Os -pipe
LDFLAGS= -arch ppc -arch ppc64 -arch i386 -arch x86_64 -bind_at_load

On Sep 30, 2008, at 4:52 PM, Elvis Dowson wrote:

Hi William,
                     Yes, those flags are being dropped somehow, I didn't know it was libtool. I had a suspicion that the instructions for specifying the environment variables was somehow redundant, since it didn't appear in the Makefile, even though makefile.cfg attempts to reference these variables for inclusion in the Makefile.

In the end I just had to edit the Makefile manually to get it to work.

It's still strange. Libtool operates during compilation, so even after changing the makefile after configuring, libtool should be dropping the flags. If it was just configure dropping the flags, then patching the makefile would definitely work.

You can see what's happening by looking at the make output, there will be a libtool line immediately followed by a gcc line. The gcc line is the result of processing by libtool, with the flags normalized for the OS and flags it didn't understand stripped out.

It may be that one of the patches you found fixed libtool so that it doesn't ignore arch flags. (note: "libtool" is generated from "ltmain.sh" and "ltconfig" and custom info in configure)

Some of the patches that I applied helped to create the dynamic libraries. The original 6b sources somehow only kept generating the static versions of these libraries.

That's a libtool problem that the patch in my build instructions addresses.

On Oct 1, 2008, at 1:43 AM, William Kyngesburye wrote:

The main problem is that the libtool included is so old (v1.3.5), it doesn't understand the OSX -arch flags. And it's too old to *easily* update libtool, though some autotools whiz probably could.

I'm actually surprised this works for you - libtool 1.3.5 should quietly drop those arch flags during compilation (or complain). My build instructions use a different approach, using a custom gcc wrapper to fool libtool into not seeing the flags. Though I have been considering a custom makefile, which should be easy enough, so I don't have to depend on the gcc wrapper.

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"This is a question about the past, is it? ... How can I tell that the past isn't a fiction designed to account for the discrepancy between my immediate physical sensations and my state of mind?"

- The Ruler of the Universe