I am trying to build some code, but find that I need to alter the configure.ac file first, as it is not searching in the correct place for the ruby headers. Today is the first day I have ever even looked at config.ac files, so there were bound to be issues when digging around in them and changing them! But yes, I am a complete newbie to these kinds of things, so apologies if this is a silly question.
On my system the ruby.h
file is located at /usr/include/ruby/ruby.h
, and there is actually a similarly named file at /usr/include/ruby.h
. I'll admit that I don't know which one is correct, but either way, my configure script cannot find it.
This is the part of my configure.ac file that SHOULD be finding the right headers:
CPPFLAGS="$CPPFLAGS -I/usr/include/ruby"
AC_MSG_CHECKING([CPPFLAGS are $CPPFLAGS])
AC_CHECK_HEADER([ruby.h],
[AC_DEFINE(HAVE_RUBY_H, 1, [has ruby.h -- ruby-dev is installed] )],
[AC_MSG_ERROR([Sorry, you need ruby-dev (headers) installed])])
CPPFLAGS=$SAVE_CPPFLAGS
But this is the output I am getting:
checking ruby.h usability... no
checking ruby.h presence... no
checking for ruby.h... no
configure: error: Sorry, you need ruby-dev (headers) installed
In the config.log
file, the following message is given:
configure:13689: checking ruby.h usability
configure:13689: gcc -c -I/usr/include/ruby/ conftest.c >&5
In file included from conftest.c:69:0:
/usr/include/ruby/ruby.h:24:25: fatal error: ruby/config.h: No such file or directory
I don't understand what the config.h
file it is looking for is exactly.
Also, I found a similar problem here, but I tried the proposed fixes (namely specifying the path within the AC_CHECK_HEADER call), but nothing worked. I also saw this question here, which makes me think that my problem MIGHT be a permissions issue, but I still don't know the purpose of the config.h
file that the log talks about. It is nowhere to be found.
Any ideas?