Skip to Content.
Sympa Menu

freetds - Re: [freetds] /usr/include/freetds/ and DBD-Sybase problem

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Joshua Daniel Franklin <joshuadf AT u.washington.edu>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] /usr/include/freetds/ and DBD-Sybase problem
  • Date: Sat, 29 May 2004 18:05:53 -0700

Joshua Daniel Franklin wrote:
I'll see if I can come up with a patch to have DBD-Sybase's Makefile.PL check both /usr/include/ and /usr/include/freetds/ in the future.

OK here are a few lines. I used the latest DBD::Sybase off CPAN, version 1.02. The patch does three things:

--If no SYBASE is set, sets it to '/usr'. I think this is the right thing to do since setting SYBASE is the most confusing to admins with vendor-supplied freetds libs in /usr/lib, and because anyone rolling their own freetds should already have SYBASE set.

--Separates the SYBASE/lib check from the include check

--Checks SYBASE/include SYBASE/include/freetds for headers

This makes building DBD::Sybase work OOTB on my platform (RHEL or Fedora) with Dag's freetds RPMs.
--- DBD-Sybase-1.02/Makefile.PL.orig	2004-05-29 16:11:36.204276664 -0700
+++ DBD-Sybase-1.02/Makefile.PL	2004-05-29 16:34:41.351702248 -0700
@@ -90,7 +90,9 @@ sub configure {
     $SYBASE = VMS::Filespec::unixify($SYBASE) if $^O eq 'VMS';
 
     if(!$SYBASE || $SYBASE =~ /^\s*$/) {
-	die "Please set SYBASE in CONFIG, or set the \$SYBASE environment variable";
+	print "Setting SYBASE=/usr, if this is incorrect\n";
+	print "Please set SYBASE in CONFIG, or set the \$SYBASE environment variable";
+	$SYBASE = "/usr";
     }
 
     # System 12.0 has a different directory structure...
@@ -98,14 +100,25 @@ sub configure {
 	$SYBASE .= "/$ENV{SYBASE_OCS}";
     }
 
-    if(! -d "$SYBASE/lib" || !-d "$SYBASE/include") {
-	die "Can't find the lib or include directories under $SYBASE!";
+    if(! -d "$SYBASE/lib" ) {
+	die "Can't find the lib directory under $SYBASE!";
     }
 	
     die "Can't find any Sybase libraries in $SYBASE/lib" unless checkLib($SYBASE);
 
+    if(-d "$SYBASE/include" ) {
+    	$inc_string = "-I$SYBASE/include";
+    }
+
+    if(-d "$SYBASE/include/freetds" ) {
+    	$inc_string = "-I$SYBASE/include/freetds";
+    }
+
+    if(! -d "$SYBASE/include/freetds" || !-d "$SYBASE/include") {
+	die "Can't find the include directory under $SYBASE!";
+    }
 
-    $inc_string = "-I$SYBASE/include";
+print "$inc_string\n";
 
     if($^O eq 'MSWin32') {
 	$lib_string = "-L$SYBASE/lib -llibct.lib -llibcs.lib -llibtcl.lib -llibcomn.lib -llibintl.lib $attr{EXTRA_LIBS} -lm";



Archive powered by MHonArc 2.6.24.

Top of Page