Permalink
Browse files

extconf

  • Loading branch information...
1 parent 68af6de commit 294fd4dc415dcaf7fa204874f2aee26eef6d81c0 Florian Weingarten committed Sep 20, 2012
Showing with 12 additions and 3 deletions.
  1. +12 −3 ext/nacl/extconf.rb
View
@@ -1,8 +1,17 @@
-require 'mkmf'
+unless nacl = ENV['NACL_HOME']
+ puts "NACL_HOME environment variable missing"
+ exit
+end
-$LDFLAGS << '-Wl,-Bsymbolic-functions -fPIC -lnacl /opt/pynacl/nacl-20110221/build/rep220/lib/amd64/randombytes.o -L/opt/pynacl/nacl-20110221/build/rep220/lib/amd64'
+hostname = `hostname`.chomp
+builddir = "#{nacl}/build/#{hostname}"
+okabi = `#{builddir}/bin/okabi`.chomp
+libdir = "#{builddir}/lib/#{okabi}"
+incdir = "#{builddir}/include/#{okabi}"
-$CFLAGS << ' -fPIC -I/opt/pynacl/nacl-20110221/build/rep220/include/amd64 '
+$LDFLAGS << "-Wl,-Bsymbolic-functions -fPIC -lnacl #{libdir}/randombytes.o -L#{libdir}"
+$CFLAGS << " -fPIC -I#{incdir} "
+require 'mkmf'
have_library "nacl"
create_makefile('nacl/nacl')

0 comments on commit 294fd4d

Please sign in to comment.