svn commit: samba r25711 - in branches/SAMBA_4_0/source/build/smb_build: .

metze at samba.org metze at samba.org
Wed Oct 24 08:34:12 GMT 2007


Author: metze
Date: 2007-10-24 08:34:11 +0000 (Wed, 24 Oct 2007)
New Revision: 25711

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25711

Log:
only use sort if available

metze
Modified:
   branches/SAMBA_4_0/source/build/smb_build/cflags.pm


Changeset:
Modified: branches/SAMBA_4_0/source/build/smb_build/cflags.pm
===================================================================
--- branches/SAMBA_4_0/source/build/smb_build/cflags.pm	2007-10-24 04:32:24 UTC (rev 25710)
+++ branches/SAMBA_4_0/source/build/smb_build/cflags.pm	2007-10-24 08:34:11 UTC (rev 25711)
@@ -6,7 +6,8 @@
 package cflags;
 use strict;
 
-use sort 'stable';
+my $sort_available = eval "use sort 'stable'; return 1;";
+$sort_available = 0 unless defined($sort_available);
 
 sub by_path {
 	return  1 if($a =~ m#^\-I/#);
@@ -29,10 +30,15 @@
 		next unless defined ($key->{FINAL_CFLAGS});
 		next unless (@{$key->{FINAL_CFLAGS}} > 0);
 
+		my @sorted_cflags = @{$key->{FINAL_CFLAGS}};
+		if ($sort_available) {
+			@sorted_cflags = sort(by_path, @{$key->{FINAL_CFLAGS}});
+		}
+
 		# Rewrite CFLAGS so that both the source and the build
 		# directories are in the path.
 		my @cflags = ();
-		foreach my $flag (sort by_path @{$key->{FINAL_CFLAGS}}) {
+		foreach my $flag (@sorted_cflags) {
 			if($src_ne_build) {
 			        if($flag =~ m#^-I([^/].*$)#) {
 				        my $dir = $1;



More information about the samba-cvs mailing list