Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > Building Bzip Shared Library

Building Bzip Shared Library
Thread Tools
Fresh-Faced Recruit
Join Date: Oct 2008
Status: Offline
Reply With Quote
Oct 12, 2008, 01:18 PM
 
Need a bit of help here.

For one of the programs I'm compiling, while reading the ./configure output, I was told my bzip installation was out-of-date. I'm trying to compile bzip with shared library support.

How do I compile bzip into a shared library?

Thank you.
     
P
Moderator
Join Date: Apr 2000
Location: Gothenburg, Sweden
Status: Offline
Reply With Quote
Oct 12, 2008, 02:39 PM
 
Easiest is probably to use one of the ports collections - macports has 1.0.5, which is an update over the 1.0.4 that my Leopard installation has, and the other collections have probably update by now as well. If you really want to build it, I guess you should download the tarball and do the regular ./configure, make and sudo make install. That it's a shared library shouldn't be anything different - you only have to make sure that the directory it ends up in is in the libpath when building something else.
     
Fresh-Faced Recruit
Join Date: Oct 2008
Status: Offline
Reply With Quote
Oct 12, 2008, 03:18 PM
 
See there is no ./configure for bzip
to compile I have to use

make install PREFIX=/tmp

There is no option for shared libraries. I understand I could use macports but this doesn't help me out in trying to understand how to manually compile bzip.

(Sorry for creating another account. Could not log into last one.)
     
P
Moderator
Join Date: Apr 2000
Location: Gothenburg, Sweden
Status: Offline
Reply With Quote
Oct 13, 2008, 04:38 AM
 
Well, if it doesn't follow the standard conventions, I guess I'll have to investigate the specific package. On a business trip atm, I'll give it a spin when I'm back at my Mac and have a chance to look at it.
     
Posting Junkie
Join Date: Dec 2000
Status: Offline
Reply With Quote
Oct 13, 2008, 12:54 PM
 
Just typing "make" and then "sudo make install" from the source directory seems to work fine for me. Takes only a few seconds to build.

What problems are you having exactly?

Ticking sound coming from a .pkg package? Don't let the .bom go off! Inspect it first with Pacifist. Macworld - five mice!
     
Fresh-Faced Recruit
Join Date: Oct 2008
Status: Offline
Reply With Quote
Oct 13, 2008, 01:35 PM
 
Hi,

My problem is I want to compile bzip as a shared library in a nonstandard directory. I have the non standard directory part solved by simply doing the command...
"sudo make install PREFIX=/path/to/..."

But I still don't know how to compile as a shared library (sorta). By simplying compiling with sudo make install or by using PREFIX you library will be static and will have the name ...."libbz2.a"

When you compile bzip from macports, the files look like this
"
ls -la /opt/local/lib
total 1024
drwxr-xr-x 8 root admin 272 Oct 12 19:56 .
drwxr-xr-x 11 root admin 374 Oct 12 09:46 ..
-rw-rw-r-- 1 root admin 0 Dec 17 2007 .turd_MacPorts
-rwxr-xr-x 2 root admin 77196 Oct 12 19:56 libbz2.1.0.4.dylib
-rwxr-xr-x 2 root admin 77196 Oct 12 19:56 libbz2.1.0.dylib
-rwxr-xr-x 2 root admin 77196 Oct 12 19:56 libbz2.1.dylib
-rw-r--r-- 2 root admin 212320 Oct 12 19:56 libbz2.a
-rwxr-xr-x 2 root admin 77196 Oct 12 19:56 libbz2.dylib
"

Since my last post, I emailed the maintainer of bzip from macports and asked him how bzip is being built as a shared library. He pointed me to
"http://trac.macports.org/browser/trunk/dports/archivers/bzip2/files/patch-Makefile-dylib.diff"

So now what I did is
downloaded bzip source
extracted source from tar.gz archive.
cd /source
patch -p0 < /Path/to/patch-Makefile-dylib.diff
make
sudo make install PREFIX=/tmp

after running sudo make install.... I get this error...
"
cp: libbz2.1.0.4.dylib: No such file or directory
make: *** [install] Error 1
"

So although I have learned a little more on how to compile as a shared library, I still can't get it to compile properly.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 01:40 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2