Hi Eric,

thanks for helping me. I completely forgot about mkmf.log . Here is the content of this log:

$ find . -type f -name mkmf.log|xargs cat
"gcc -o conftest
	-I/home/travis/.rvm/rubies/ruby-1.9.3-p545/include/ruby-1.9.1/x86_64-linux
	-I/home/travis/.rvm/rubies/ruby-1.9.3-p545/include/ruby-1.9.1/ruby/backward
	-I/home/travis/.rvm/rubies/ruby-1.9.3-p545/include/ruby-1.9.1
	-I../../../../ext/cracklib  
	-O3
	-ggdb
	-Wall
	-Wextra
	-Wno-unused-parameter
	-Wno-parentheses
	-Wno-long-long
	-Wno-missing-field-initializers
	-Wpointer-arith
	-Wwrite-strings
	-Wdeclaration-after-statement
	-Wimplicit-function-declaration 
	-fPIC conftest.c 
	-L.
	-L/home/travis/.rvm/rubies/ruby-1.9.3-p545/lib
	-Wl,-R/home/travis/.rvm/rubies/ruby-1.9.3-p545/lib
	-L. 
	-rdynamic
	-Wl,-export-dynamic
	-lcrack  
	-Wl,-R -Wl,/home/travis/.rvm/rubies/ruby-1.9.3-p545/lib
	-L/home/travis/.rvm/rubies/ruby-1.9.3-p545/lib
	-lruby 
	-lpthread
	-lrt
	-ldl
	-lcrypt
	-lm 
	-lc"
/usr/bin/ld: cannot find -lcrack
collect2: ld returned 1 exit status
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5:  return 0;
6: }
/* end */

I formatted the output to be more readable. As you already guessed the linker include option for cracklib under $GEMROOT/vendor/cracklib/lib is missing.

Adding the HEADER_DIRS and LIB_DIRS directly to the LDFLAGS resulted in exactly the same error:

"gcc
	-o conftest
	-I/home/travis/.rvm/rubies/ruby-2.0.0-p451/include/ruby-2.0.0/x86_64-linux
	-I/home/travis/.rvm/rubies/ruby-2.0.0-p451/include/ruby-2.0.0/ruby/backward
	-I/home/travis/.rvm/rubies/ruby-2.0.0-p451/include/ruby-2.0.0
	-I../../../../ext/cracklib
	-I/home/travis/build/nirnanaaa/cracklib/vendor/cracklib/lib
	-I/opt/local/include
	-I/usr/local/include
	-I/home/travis/.rvm/rubies/ruby-2.0.0-p451/include
	-I/usr/include
	-I/include  
	-O3
	-fno-fast-math
	-ggdb3
	-Wall
	-Wextra
	-Wno-unused-parameter
	-Wno-parentheses
	-Wno-long-long
	-Wno-missing-field-initializers
	-Wunused-variable
	-Wpointer-arith
	-Wwrite-strings
	-Wdeclaration-after-statement
	-Wimplicit-function-declaration 
	-fPIC conftest.c 
	-L.
	-L/home/travis/.rvm/rubies/ruby-2.0.0-p451/lib-Wl,-R/home/travis/.rvm/rubies/ruby-2.0.0-p451/lib
	-L/home/travis/build/nirnanaaa/cracklib/vendor/cracklib/lib-Wl,-R/home/travis/build/nirnanaaa/cracklib/vendor/cracklib/lib
	-L/usr/local/lib-Wl,-R/usr/local/lib
	-L/home/travis/.rvm/rubies/ruby-2.0.0-p451/lib -Wl,-R/home/travis/.rvm/rubies/ruby-2.0.0-p451/lib
	-L/usr/lib -Wl,-R/usr/lib
	-L/lib -Wl,-R/lib
	-L.
	-fstack-protector
	-rdynamic
	-Wl,
	-export-dynamic
	-lcrack
	-I /home/travis/build/nirnanaaa/cracklib/vendor/cracklib/lib
	-I /opt/local/include
	-I /usr/local/include
	-I /home/travis/.rvm/rubies/ruby-2.0.0-p451/include
	-I /usr/include
	-I /include
	-L /home/travis/build/nirnanaaa/cracklib/vendor/cracklib/lib
	-L /usr/local/lib
	-L /home/travis/.rvm/rubies/ruby-2.0.0-p451/lib
	-L /usr/lib
	-L /lib   '-Wl,-rpath,/../lib' -Wl,-R -Wl,/home/travis/.rvm/rubies/ruby-2.0.0-p451/lib -L/home/travis/.rvm/rubies/ruby-2.0.0-p451/lib-lruby -lpthread -lrt -ldl -lcrypt -lm  -lc"
/usr/bin/ld: cannot find -lcrack
collect2: ld returned 1 exit status
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5:  return 0;
6: }
/* end */


---
Flo
On July 2, 2014 at 5:10:03 PM, Eric MSP Veith (eveith / wwweb-library.net) wrote:

Hi Flo,  

On Wednesday 02 July 2014 16:10:10, Florian Kasper <mosny / zyg.li> wrote:  
> However the packages "build-essential gcc automake" got installed on the  
> before_install step of travis' config  
>  
> Maybe this is related to changing the HEADER_DIRS and LIB_DIRS in the  
> extconf.rb ?  

build-essential pulls in libc6-dev, which contains /usr/include/sys/types.h.  
If that's the culprit, the include paths are wrong.  

Could you post the actual compiler command line? It should be in mkmf.log.  

HTH  

--- Eric