Problem with mkmf on OS X

A

Andreas Schwarz

Hello,

I've got the following extconf.rb:

# begin
require "mkmf"

dir_config "SQLite", "/usr/local"

if find_library("sqlite", "sqlite_open", "/usr/local/lib", "/usr/pkg/lib", "/sw/lib") and have_header("sqlite.h")
create_makefile "SQLite"
end
#end

When I run it I get "checking for sqlite_open() in -lsqlite... no",
although the sqlite lib exists in /sw/lib and the header file in
/sw/include.

mkmf.log follows:

find_library: checking for sqlite_open() in -lsqlite... --------------------
gcc -o conftest -I/sw/lib/ruby/1.8/powerpc-darwin -I/sw/lib/ruby/1.8/powerpc-darwin -I/usr/local/include -I/sw/include -g -O2 -fno-common -pipe conftest.c -L/sw/lib -L/usr/local/lib -lruby-static -lsqlite -ldl -lobjc
ld: warning -L: directory name (/usr/local/lib) does not exist
ld: can't locate file for: -lruby-static
checked program was:
/* begin */

int main() { return 0; }
int t() { sqlite_open(); return 0; }
/* end */

gcc -o conftest -I/sw/lib/ruby/1.8/powerpc-darwin -I/sw/lib/ruby/1.8/powerpc-darwin -I/usr/local/include -I/sw/include -g -O2 -fno-common -pipe conftest.c -L/sw/lib -L/usr/local/lib -lruby-static -lsqlite -ldl -lobjc
conftest.c: In function `t':
conftest.c:4: error: `sqlite_open' undeclared (first use in this function)
conftest.c:4: error: (Each undeclared identifier is reported only once
conftest.c:4: error: for each function it appears in.)
checked program was:
/* begin */


int main() { return 0; }
int t() { void ((*volatile p)()); p = (void ((*)()))sqlite_open; return 0; }
/* end */

gcc -o conftest -I/sw/lib/ruby/1.8/powerpc-darwin -I/sw/lib/ruby/1.8/powerpc-darwin -I/usr/local/include -I/sw/include -g -O2 -fno-common -pipe conftest.c -L/sw/lib -L/usr/local/lib -lruby-static -lsqlite -ldl -lobjc
ld: warning -L: directory name (/usr/local/lib) does not exist
ld: can't locate file for: -lruby-static
checked program was:
/* begin */

int main() { return 0; }
int t() { sqlite_open(); return 0; }
/* end */

gcc -o conftest -I/sw/lib/ruby/1.8/powerpc-darwin -I/sw/lib/ruby/1.8/powerpc-darwin -I/usr/local/include -I/sw/include -g -O2 -fno-common -pipe conftest.c -L/sw/lib -L/usr/local/lib -lruby-static -lsqlite -ldl -lobjc
conftest.c: In function `t':
conftest.c:4: error: `sqlite_open' undeclared (first use in this function)
conftest.c:4: error: (Each undeclared identifier is reported only once
conftest.c:4: error: for each function it appears in.)
checked program was:
/* begin */


int main() { return 0; }
int t() { void ((*volatile p)()); p = (void ((*)()))sqlite_open; return 0; }
/* end */

gcc -o conftest -I/sw/lib/ruby/1.8/powerpc-darwin -I/sw/lib/ruby/1.8/powerpc-darwin -I/usr/local/include -I/sw/include -g -O2 -fno-common -pipe conftest.c -L/sw/lib -L/usr/local/lib -L/usr/pkg/lib -lruby-static -lsqlite -ldl -lobjc
ld: warning -L: directory name (/usr/local/lib) does not exist
ld: warning -L: directory name (/usr/pkg/lib) does not exist
ld: can't locate file for: -lruby-static
checked program was:
/* begin */

int main() { return 0; }
int t() { sqlite_open(); return 0; }
/* end */

gcc -o conftest -I/sw/lib/ruby/1.8/powerpc-darwin -I/sw/lib/ruby/1.8/powerpc-darwin -I/usr/local/include -I/sw/include -g -O2 -fno-common -pipe conftest.c -L/sw/lib -L/usr/local/lib -L/usr/pkg/lib -lruby-static -lsqlite -ldl -lobjc
conftest.c: In function `t':
conftest.c:4: error: `sqlite_open' undeclared (first use in this function)
conftest.c:4: error: (Each undeclared identifier is reported only once
conftest.c:4: error: for each function it appears in.)
checked program was:
/* begin */


int main() { return 0; }
int t() { void ((*volatile p)()); p = (void ((*)()))sqlite_open; return 0; }
/* end */

gcc -o conftest -I/sw/lib/ruby/1.8/powerpc-darwin -I/sw/lib/ruby/1.8/powerpc-darwin -I/usr/local/include -I/sw/include -g -O2 -fno-common -pipe conftest.c -L/sw/lib -L/usr/local/lib -L/sw/lib -lruby-static -lsqlite -ldl -lobjc
ld: warning -L: directory name (/usr/local/lib) does not exist
ld: can't locate file for: -lruby-static
checked program was:
/* begin */

int main() { return 0; }
int t() { sqlite_open(); return 0; }
/* end */

gcc -o conftest -I/sw/lib/ruby/1.8/powerpc-darwin -I/sw/lib/ruby/1.8/powerpc-darwin -I/usr/local/include -I/sw/include -g -O2 -fno-common -pipe conftest.c -L/sw/lib -L/usr/local/lib -L/sw/lib -lruby-static -lsqlite -ldl -lobjc
conftest.c: In function `t':
conftest.c:4: error: `sqlite_open' undeclared (first use in this function)
conftest.c:4: error: (Each undeclared identifier is reported only once
conftest.c:4: error: for each function it appears in.)
checked program was:
/* begin */


int main() { return 0; }
int t() { void ((*volatile p)()); p = (void ((*)()))sqlite_open; return 0; }
/* end */

-------------------- no
 
N

nobu.nokada

Hi,

At Sun, 27 Jun 2004 03:13:03 +0900,
Andreas Schwarz wrote in [ruby-talk:104645]:
When I run it I get "checking for sqlite_open() in -lsqlite... no",
although the sqlite lib exists in /sw/lib and the header file in
/sw/include.

ruby extconf.rb --with-opt-dir=/sw
 
A

Andreas Schwarz

At Sun, 27 Jun 2004 03:13:03 +0900,
Andreas Schwarz wrote in [ruby-talk:104645]:
When I run it I get "checking for sqlite_open() in -lsqlite... no",
although the sqlite lib exists in /sw/lib and the header file in
/sw/include.


ruby extconf.rb --with-opt-dir=/sw

This doesn't change anything.
 
N

nobu.nokada

Hi,

At Sun, 27 Jun 2004 03:13:03 +0900,
Andreas Schwarz wrote in [ruby-talk:104645]:
gcc -o conftest -I/sw/lib/ruby/1.8/powerpc-darwin -I/sw/lib/ruby/1.8/powerpc-darwin -I/usr/local/include -I/sw/include -g -O2 -fno-common -pipe conftest.c -L/sw/lib -L/usr/local/lib -lruby-static -lsqlite -ldl -lobjc
ld: warning -L: directory name (/usr/local/lib) does not exist
ld: can't locate file for: -lruby-static

Is libruby-static.a installed underneath
/sw/lib/ruby/1.8/powerpc-darwin diretory?

And your ruby seems quite old.
 
A

Andreas Schwarz

Hi,

At Sun, 27 Jun 2004 03:13:03 +0900,
Andreas Schwarz wrote in [ruby-talk:104645]:
gcc -o conftest -I/sw/lib/ruby/1.8/powerpc-darwin -I/sw/lib/ruby/1.8/powerpc-darwin -I/usr/local/include -I/sw/include -g -O2 -fno-common -pipe conftest.c -L/sw/lib -L/usr/local/lib -lruby-static -lsqlite -ldl -lobjc
ld: warning -L: directory name (/usr/local/lib) does not exist
ld: can't locate file for: -lruby-static


Is libruby-static.a installed underneath
/sw/lib/ruby/1.8/powerpc-darwin diretory?

No, it didn't exist at all. Now that I have built ruby from source it
works. Thanks for the hint!

Andreas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,962
Messages
2,570,134
Members
46,692
Latest member
JenniferTi

Latest Threads

Top