C Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesC Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 2nd, 2012, 01:31 PM
artheus artheus is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2010
Location: Stockholm
Posts: 9 artheus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 53 m 38 sec
Reputation Power: 0
Compiling iniParser C-library on Mac OSX Mountain Lion.

Hi,

My goal is to compile and edit the source of the ownCloud client source on my Mac OS X Mountain Lion.

The problem I am facing right now is that it does not seem that I am able to compile and install the iniParser library on my OS.

The problem I was first facing was that the in the Makefile it was stated that to compile this library ld should use the flag "-Bsymbolic" and the flag "-soname=".
I've been searching around for any hints on this. I've searched for Mac OS X patches for this Makefile and I've been searching for equivalents for the "-Bsymbolic" and the "-soname" in Mac OS X's ld command.
I found out that I could use the "-dylib_install_name" flag as an equivalent to "-soname". I can't seem to find anything on the "-Bsymbolic" flag though.

I've tried to just remove the "-Bsymbolic" flag and change "-soname" to "-dylib_install_name" in the Makefile, but it just gives me the error:

Code:
$ make
compiling src/iniparser.c ...
compiling src/dictionary.c ...
a - src/iniparser.o
a - src/dictionary.o
i686-apple-darwin11-llvm-gcc-4.2: libiniparser.so.0: No such file or directory
make: *** [libiniparser.so] Error 1


My Makefile looks like this:

Code:
#
# iniparser Makefile
#

# Compiler settings
CC      = gcc
CFLAGS  = -O2 -fPIC -Wall -ansi -pedantic

# Ar settings to build the library
AR	    = ar
ARFLAGS = rcv

SHLD = ${CC} ${CFLAGS}
LDSHFLAGS = -shared -Wl,-rpath -Wl,/usr/lib -Wl,-rpath,/usr/lib
LDFLAGS = -Wl,-rpath -Wl,/usr/lib -Wl,-rpath,/usr/lib

# Set RANLIB to ranlib on systems that require it (Sun OS < 4, Mac OSX)
RANLIB  = ranlib
#RANLIB = true

RM      = rm -f


# Implicit rules

SUFFIXES = .o .c .h .a .so .sl

COMPILE.c=$(CC) $(CFLAGS) -c
.c.o:
	@(echo "compiling $< ...")
	@($(COMPILE.c) -o $@ $<)


SRCS = src/iniparser.c \
	   src/dictionary.c

OBJS = $(SRCS:.c=.o)


default:	libiniparser.a libiniparser.so

libiniparser.a:	$(OBJS)
	@($(AR) $(ARFLAGS) libiniparser.a $(OBJS))
	@($(RANLIB) libiniparser.a)

libiniparser.so:	$(OBJS)
	@$(SHLD) $(LDSHFLAGS) -o $@.0 $(OBJS) $(LDFLAGS) \
		-Wl,-dylib_install_name `basename $@`.0

clean:
	$(RM) $(OBJS)

veryclean:
	$(RM) $(OBJS) libiniparser.a libiniparser.so*
	rm -rf ./html ; mkdir html
	cd test ; $(MAKE) veryclean

docs:
	@(cd doc ; $(MAKE))
	
check:
	@(cd test ; $(MAKE))


Could anyone please help me figuring this out?

iniParser lib link : http://ndevilla.free.fr/iniparser/index.html

Thanks,
Artheus

Reply With Quote
  #2  
Old September 3rd, 2012, 04:36 AM
artheus artheus is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2010
Location: Stockholm
Posts: 9 artheus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 53 m 38 sec
Reputation Power: 0
Well...

There was a very simple solution for this. I feel kinda stupid.

cmake was the magical command

Code:
cmake .


This solved everything.

Cheers,
Artheus

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesC Programming > Compiling iniParser C-library on Mac OSX Mountain Lion.

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap