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

[or-cvs] r8830: Patch to cross.sh from Michael Mohr; check more values befor (in tor/trunk: . contrib)



Author: nickm
Date: 2006-10-25 21:54:20 -0400 (Wed, 25 Oct 2006)
New Revision: 8830

Modified:
   tor/trunk/
   tor/trunk/contrib/cross.sh
Log:
 r9391@Kushana:  nickm | 2006-10-25 21:51:33 -0400
 Patch to cross.sh from Michael Mohr; check more values before failing; always --enable-eventdns



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r9391] on c95137ef-5f19-0410-b913-86e773d04f59

Modified: tor/trunk/contrib/cross.sh
===================================================================
--- tor/trunk/contrib/cross.sh	2006-10-25 21:46:21 UTC (rev 8829)
+++ tor/trunk/contrib/cross.sh	2006-10-26 01:54:20 UTC (rev 8830)
@@ -50,10 +50,14 @@
 # disable the platform-specific tests in configure
 export CROSS_COMPILE=yes
 
+# for error conditions
+EXITVAL=0
+
 if [ ! -f configure ]
 then
-  echo "Please run this script from the root of the Tor distribution."
-  exit -1
+  echo "Please run this script from the root of the Tor distribution"
+  echo "and ensure that autogen.sh has been run."
+  EXITVAL=-1
 fi
 
 if [ -z $PREFIX ]
@@ -61,7 +65,7 @@
   echo "You must define \$PREFIX since you are cross-compiling."
   echo "Select a non-system location (i.e. /tmp/tor-cross):"
   echo "	export PREFIX=/tmp/tor-cross"
-  exit -1
+  EXITVAL=-1
 fi
 
 if [ -z $CROSSPATH ]
@@ -69,7 +73,7 @@
   echo "You must define the location of your cross-compiler's"
   echo "directory using \$CROSSPATH; for example,"
   echo "	export CROSSPATH=/opt/cross/staging_dir_mipsel/bin"
-  exit -1
+  EXITVAL=-1
 fi
 
 if [ -z $ARCH_PREFIX ]
@@ -78,14 +82,14 @@
   echo "if you normally cross-compile applications using"
   echo "mipsel-linux-uclibc-gcc, you would set \$ARCH_PREFIX like so:"
   echo "	export ARCH_PREFIX=mipsel-linux-uclibc-"
-  exit -1
+  EXITVAL=-1
 fi
 
 if [ -z $HOST ]
 then
   echo "You must specify a target processor with \$HOST; for example:"
   echo "	export HOST=mipsel-unknown-elf"
-  exit -1
+  EXITVAL=-1
 fi
 
 if [ -z $BUILD ]
@@ -94,9 +98,15 @@
   echo "	export BUILD=i686-pc-linux-gnu"
   echo "If you wish to let configure autodetect the host, set \$BUILD to 'auto':"
   echo "	export BUILD=auto"
-  exit -1
+  EXITVAL=-1
 fi
 
+if [ $EXITVAL -ne 0 ]
+then
+  echo "Remember, you can hard-code these values in cross.sh if needed."
+  exit $EXITVAL
+fi
+
 # clean up any existing object files
 if [ -f src/or/tor ]
 then
@@ -111,10 +121,14 @@
 if [ $BUILD == "auto" ]
 then
   ./configure \
+	--enable-debug \
+	--enable-eventdns \
 	--prefix=$PREFIX \
 	--host=$HOST
 else
   ./configure \
+	--enable-debug \
+	--enable-eventdns \
 	--prefix=$PREFIX \
 	--host=$HOST \
 	--build=$BUILD
@@ -134,6 +148,16 @@
 
 make
 
+# has a problem occurred?
+if [ $? -ne 0 ]
+then
+  echo ""
+  echo "A problem has been detected with make."
+  echo "Please check the output above and rerun make."
+  echo ""
+  exit -1
+fi
+
 # if $STRIP has length (i.e. STRIP=yes), strip the binaries
 if [ ! -z $STRIP ]
 then
@@ -147,4 +171,3 @@
 echo "Tor should be compiled at this point.  Now run 'make install' to"
 echo "install to $PREFIX"
 echo ""
-