summaryrefslogtreecommitdiff
path: root/databases/ruby-oci8/files/patch-ext_oci8_oraconf.rb
blob: 249fe9f00acf330a98134a52fb8840a21c894f7c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
--- ext/oci8/oraconf.rb.orig	Fri Jan 19 15:50:28 2007
+++ ext/oci8/oraconf.rb	Thu Apr 12 10:58:36 2007
@@ -197,6 +197,8 @@
     when /darwin/
       @@ld_envs = %w[DYLD_LIBRARY_PATH]
       so_ext = 'dylib'
+    when /freebsd/
+      return "/usr/local/oracle8-client/lib"
     end
 
     glob_name = "#{oci_basename}.#{so_ext}#{oci_glob_postfix}"
@@ -720,7 +722,8 @@
       @libs = get_libs("#{ic_dir}/sdk")
       ld_path = nil
     else
-      @cflags = " -I#{inc_dir}"
+      @cflags = ''
+      @libs = ''
       # set ld_path and so_ext
       case RUBY_PLATFORM
       when /aix/
@@ -736,10 +739,16 @@
       when /darwin/
         ld_path = 'DYLD_LIBRARY_PATH'
         so_ext = 'dylib'
+      when /freebsd/
+        so_ext = 'a'
+        inc_dir = "#{ic_dir}/../rdbms/demo"
+        @cflags = " -I#{ic_dir}/../rdbms/public"
+        @libs = " -lcompat"
       else
         ld_path = 'LD_LIBRARY_PATH'
         so_ext = 'so'
       end
+      @cflags += " -I#{inc_dir}"
       # check Oracle client library.
       unless File.exists?("#{lib_dir}/libclntsh.#{so_ext}")
         files = Dir.glob("#{lib_dir}/libclntsh.#{so_ext}.*")
@@ -761,7 +770,7 @@
         end
         raise 'failed'
       end
-      @libs = " -L#{lib_dir} -lclntsh "
+      @libs += " -L#{lib_dir} -lclntsh "
     end
     unless File.exists?("#{inc_dir}/oci.h")
           raise <<EOS