[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] cluster configure



CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	fabbione sourceware org	2007-12-21 07:28:37

Modified files:
	.              : configure 

Log message:
	Minor objdir rework to extend flexibility.
	
	the first shot of objdir implementation implied that you did:
	
	cd cluster
	./configure --objdir... etc.
	cd /path/to/objdir
	make
	
	now you can:
	
	mkdir objdir
	cd objdir
	/path/to/configure
	make
	
	NOTE: in this case you don't need to specify objdir. it will be automatically
	set up for you.
	
	As a nice side effect you can also be anywhere on the fs and do:
	
	/path/to/configure --objdir=/path/to/obj
	cd /path/to/obj
	make
	
	and it will work.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/configure.diff?cvsroot=cluster&r1=1.44&r2=1.45

--- cluster/configure	2007/12/21 05:58:34	1.44
+++ cluster/configure	2007/12/21 07:28:37	1.45
@@ -296,7 +296,7 @@
     $dirname = dirname($_);
     $filename = basename($_);
     system("mkdir -p $objdir/$dirname");
-    symlink("${pwd}/$_","$objdir/$dirname/$filename");
+    symlink("${cdir}/$_","$objdir/$dirname/$filename");
   }
   close IFILE;
   return 0;
@@ -330,22 +330,27 @@
   $prefix="/usr";
 }
 
+print "\nChecking tree: ";
 if (!$objdir) {
   $objdir="${pwd}";
+}
+$objdir = abs_path( $objdir );
+$cdir = dirname ( abs_path( $0 ) );
+unless ("$cdir" eq "$objdir") {
+  chdir "$cdir";
+}
+
+if (! -d "$objdir/make") {
+  print "setting up $objdir\n";
+  mkdir "$objdir";
+  symlinks(".","Makefile");
+  symlinks(".","*.mk");
+  symlinks("gnbd-kernel","*.c");
+  symlinks("gnbd-kernel","*.h");
+  symlinks("gfs-kernel","*.c");
+  symlinks("gfs-kernel","*.h");
 } else {
-  $objdir = abs_path( $objdir );
-  if (! -d $objdir) {
-    print "\nSetting up objdir in $objdir\n";
-    mkdir "$objdir";
-    symlinks(".","Makefile");
-    symlinks(".","*.mk");
-    symlinks("gnbd-kernel","*.c");
-    symlinks("gnbd-kernel","*.h");
-    symlinks("gfs-kernel","*.c");
-    symlinks("gfs-kernel","*.h");
-  } else {
-    print "\nFound old objdir in $objdir: no actions taken\n";
-  }
+  print "nothing to do\n";
 }
 
 my @un = POSIX::uname();
@@ -370,10 +375,10 @@
   $module_dir="/lib/modules/$un[2]/kernel";
 }
 if (!$gfskincdir) {
-  $gfskincdir="${pwd}/gfs-kernel/src/gfs";
+  $gfskincdir="${cdir}/gfs-kernel/src/gfs";
 }
 if (!$gnbdkincdir) {
-  $gnbdkincdir="${pwd}/gnbd-kernel/src";
+  $gnbdkincdir="${cdir}/gnbd-kernel/src";
 }
 if (!$incdir) {
   $incdir="${prefix}/include";
@@ -382,19 +387,19 @@
   $libdir="${prefix}/lib";
 }
 if (!$ccsincdir) {
-  $ccsincdir="${pwd}/ccs/lib";
+  $ccsincdir="${cdir}/ccs/lib";
 }
 if (!$ccslibdir) {
   $ccslibdir="${objdir}/ccs/lib";
 }
 if (!$cmanincdir) {
-  $cmanincdir="${pwd}/cman/lib";
+  $cmanincdir="${cdir}/cman/lib";
 }
 if (!$cmanlibdir) {
   $cmanlibdir="${objdir}/cman/lib";
 }
 if (!$dlmincdir) {
-  $dlmincdir="${pwd}/dlm/lib";
+  $dlmincdir="${cdir}/dlm/lib";
 }
 if (!$dlmlibdir) {
   $dlmlibdir="${objdir}/dlm/lib";
@@ -538,7 +543,7 @@
 
 while (<IFILE>) {
   chomp;
-  $_ =~ s/\ SRCDIR\@/$pwd/;
+  $_ =~ s/\ SRCDIR\@/$cdir/;
   $_ =~ s/\ CC\@/$cc/;
   $_ =~ s/\ CFLAGS\@/$cflags/;
   $_ =~ s/\ LDFLAGS\@/$ldflags/;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]