summaryrefslogtreecommitdiff
path: root/databases/p5-DBD-ODBC/patches/patch-aa
blob: d2b3e084a6eb30af1ba7a1ddfb453dbbf2a772f7 (plain)
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
$NetBSD: patch-aa,v 1.1.1.1 2009/05/17 13:29:15 sno Exp $

# Fix issues detecting iODBC

--- Makefile.PL.orig	2009-05-16 08:36:54.000000000 +0000
+++ Makefile.PL	2009-05-16 08:49:56.000000000 +0000
@@ -154,7 +154,6 @@
 
 EOT
     }
-    prompt("Press return to continue...");
 }
 print "Overriding ODBC Directory with command line option: $opt_o\n"
     if $opt_o ;
@@ -242,6 +241,7 @@
             # exist until 2.2.11 and it was broken wrt --cflags in 2.2.11/2.2.12
             # i.e. --cflags did not include -I/xxx/yyy
             my $odbc_config_v = `odbc_config --version 2>&1`;
+            my $iodbc_config_v = `iodbc-config --version 2>&1`;
             print "Looking for odbc_config\n";
             if ($odbc_config_v && ($odbc_config_v =~ /^(\d\.)+/)) {
                 print "  Found odbc_config versions $odbc_config_v\n";
@@ -257,6 +257,20 @@
                     print "  but cannot find header files in that path so ignoring\n";
                     $odbchome = '';
                 }
+            } elsif ($iodbc_config_v && ($iodbc_config_v =~ /^(\d\.)+/)) {
+                print "  Found iodbc-config versions $iodbc_config_v\n";
+                $odbchome = `iodbc-config --prefix 2>&1`;
+                print "  iodbc-config reports --prefix=$odbchome\n";
+                chomp $odbchome;
+                if ((-e $odbchome) && (-e "$odbchome/include") &&
+                        (-f "$odbchome/include/sql.h") &&
+                            (-f "$odbchome/include/sqlext.h") &&
+                                (-f "$odbchome/include/sqltypes.h")) {
+                    print "  Set ODBCHOME to $odbchome from iodbc-config\n";
+                } else {
+                    print "  but cannot find header files in that path so ignoring\n";
+                    $odbchome = '';
+                }
             } else {
                 print "  odbc_config not found - ok, there are other things I can do\n";
             }
@@ -272,6 +286,11 @@
                                  -f '/usr/local/include/sqltypes.h') {
                     print "  Found sql header files in /use/local/include\n";
                     $odbchome = '/usr/local';
+                } elsif (-f '/usr/pkg/include/sql.h' &&
+                             -f '/usr/pkg/include/sqlext.h' &&
+                                 -f '/usr/pkg/include/sqltypes.h') {
+                    print "  Found sql header files in /use/pkg/include\n";
+                    $odbchome = '/usr/pkg';
                 } elsif (-d '/usr/local/easysoft/unixODBC') {
                     print "  Found sql header files in /use/local/easysoft/include\n";
                     $odbchome = '/usr/local/easysoft/unixODBC';
@@ -346,13 +365,13 @@
     # fix to avoid foo..ext on many systems.
     $arext =~ s/^\.//;
 
-    $myodbc = 'unixodbc'
-		if !$myodbc && glob "$odbchome/lib/libodbc.*";
-
     $myodbc = 'iodbc'
 		if !$myodbc && ((glob "$odbchome/*iodbc*") ||
                                     (glob "$odbchome/lib/*iodbc*"));
 
+    $myodbc = 'unixodbc'
+		if !$myodbc && glob "$odbchome/lib/libodbc.*";
+
     $myodbc = 'empress'
 		if !$myodbc && glob "$odbchome/lib/libempodbc.*";