Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not compile against OSX binary install #6

Closed
mperham opened this issue Apr 6, 2010 · 15 comments
Closed

Does not compile against OSX binary install #6

mperham opened this issue Apr 6, 2010 · 15 comments

Comments

@mperham
Copy link
Contributor

mperham commented Apr 6, 2010

I installed the 5.1.45 OSX binary package from dev.mysql.com. The headers are in /usr/local/mysql/include:

/usr/local/mysql/include> ls
decimal.h         my_config.h       my_no_pthread.h   mysql_time.h      sslopt-case.h
errmsg.h          my_dbug.h         my_pthread.h      mysql_version.h   sslopt-longopts.h
keycache.h        my_dir.h          my_sys.h          mysqld_ername.h   sslopt-vars.h
m_ctype.h         my_getopt.h       my_xml.h          mysqld_error.h    typelib.h
m_string.h        my_global.h       mysql.h           plugin.h
my_alloc.h        my_list.h         mysql_com.h       sql_common.h
my_attribute.h    my_net.h          mysql_embed.h     sql_state.h

So I get this error:

/Users/mike/.rvm/rubies/ruby-1.9.1-p378/bin/ruby extconf.rb --with-mysql-dir=/usr/local/mysql
checking for mysql/mysql.h... no
checking for main() in -lmysqlclient... yes
creating Makefile

make
gcc -I. -I/Users/mike/.rvm/rubies/ruby-1.9.1-p378/include/ruby-1.9.1/i386-darwin10.2.0 -I/Users/mike/.rvm/rubies/ruby-1.9.1-p378/include/ruby-1.9.1/ruby/backward -I/Users/mike/.rvm/rubies/ruby-1.9.1-p378/include/ruby-1.9.1 -I. -I/usr/local/mysql/include  -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -fno-common  -O2 -g -Wall -Wno-parentheses -pipe -fno-common -Wall -Wextra -funroll-loops -DRUBY_19_COMPATIBILITY  -o mysql2_ext.o -c mysql2_ext.c
In file included from mysql2_ext.c:1:
mysql2_ext.h:4:25: error: mysql/mysql.h: No such file or directory
mysql2_ext.h:5:29: error: mysql/mysql_com.h: No such file or directory
mysql2_ext.h:6:26: error: mysql/errmsg.h: No such file or directory
mysql2_ext.h:7:32: error: mysql/mysqld_error.h: No such file or directory
@brianmario
Copy link
Owner

Yeah, I need to add a bunch of tweaks to extconf for this. It's on my internal TODO, shoulda probably opened a ticket for it. This'll work ;)
I'll try to push a fix today sometime.

@mperham
Copy link
Contributor Author

mperham commented Apr 6, 2010

ln -s . mysql

fixed it real quick.

@brianmario
Copy link
Owner

@mperham
Copy link
Contributor Author

mperham commented Apr 6, 2010

Doesn't fix it. And extconf.rb line 7 should be "with-mysql-dir"

@brianmario
Copy link
Owner

well shiiiit, I was really hoping I wouldn't have to do something like this: http://github.com/oldmoe/mysqlplus/blob/master/ext/extconf.rb

@brianmario
Copy link
Owner

@mperham
Copy link
Contributor Author

mperham commented Apr 7, 2010

Great, installs perfectly without needing any additional config options. I know it's ugly but from a user perspective it's a million times better now.

@brianmario
Copy link
Owner

rad, thanks for trying it out. I'll push a new gem soon.

@zbage
Copy link

zbage commented Aug 5, 2010

rubies/ruby-1.9.2-rc2/bin/ruby extconf.rb --with-mysql-config=/Applications/xampp/xamppfiles/bin/mysql_config
checking for rb_thread_blocking_region()... yes
checking for mysql.h... no
checking for mysql/mysql.h... no

mysql.h is missing. please check your installation of mysql and try again.

extconf.rb failed

@spaquet
Copy link

spaquet commented Aug 11, 2010

zbage: when installing mysql related gems you need to have mysql lib and development files installed on your system.
If they are properly installed then check (find / -name mysql.h -print) to see where it is on your system to tell it to you gem command.

@zbage
Copy link

zbage commented Aug 31, 2010

gem install mysql2 -- --with-mysql-config=/Applications/xampp/xamppfiles/bin/mysql_config

Already installed XAMPP Developer package
sudo find / -name mysql.h
/Applications/XAMPP/xamppfiles/include/mysql/mysql.h

checking for rb_thread_blocking_region()... yes
checking for mysql.h... no
checking for mysql/mysql.h... no

mysql.h is missing. please check your installation of mysql and try again.

extconf.rb failed

@brianmario
Copy link
Owner

Very strange...
I'll see if I can track this down soon

@tamasjung
Copy link

Very similar failure here. Regarding the mkmf.log the compiler knew where the mysql.h is but another issue mislead the extconf.rb:
gcc-4.2: -E, -S, -save-temps and -M options are not allowed with multiple -arch flags

So the have_header functions fails for another reason not because the header is not there.
This looks very much the same issue:
http://gist.github.com/640944

@brianmario
Copy link
Owner

ARCH_FLAG should be ARCH_FLAGS

@hlxwell
Copy link

hlxwell commented Jul 2, 2013

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants