Skip to content

Commit 7ca5f1f

Browse files
committed
Merge pull request #409 from sodabrew/incflags_not_cflags
Use mysql_config --include instead of --cflags
2 parents 25546f8 + 7088238 commit 7ca5f1f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/mysql2/extconf.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ def asplode lib
4242
elsif mc = (with_config('mysql-config') || Dir[GLOB].first) then
4343
mc = Dir[GLOB].first if mc == true
4444
ver = `#{mc} --version`.chomp.to_f
45-
cflags = `#{mc} --cflags`.chomp
45+
includes = `#{mc} --include`.chomp
4646
exit 1 if $? != 0
4747
libs = `#{mc} --libs_r`.chomp
4848
# MySQL 5.5 and above already have re-entrant code in libmysqlclient (no _r).
4949
if ver >= 5.5 || libs.empty?
5050
libs = `#{mc} --libs`.chomp
5151
end
5252
exit 1 if $? != 0
53-
$CPPFLAGS += ' ' + cflags
53+
$INCFLAGS += ' ' + includes
5454
$libs = libs + " " + $libs
5555
else
5656
inc, lib = dir_config('mysql', '/usr/local')

0 commit comments

Comments
 (0)