added configure option to force Wx detection.
authoretisserant
Mon, 18 Feb 2008 10:36:01 +0100
changeset 398 c928fd8cb759
parent 397 f9e720b220ea
child 399 8d22c323fe0f
added configure option to force Wx detection.
configure
--- a/configure	Mon Feb 18 10:35:14 2008 +0100
+++ b/configure	Mon Feb 18 10:36:01 2008 +0100
@@ -109,6 +109,8 @@
 	--target=*)	SUB_TARGET=$optarg;;
 	--can=*)	SUB_CAN_DRIVER=$optarg;;
 	--timers=*)	SUB_TIMERS_DRIVER=$optarg;;
+	--wx=*)		SUB_WX=$optarg;
+			echo "Forced wx detection to $optarg";;
 	--disable-Ox)	DISABLE_OPT=1;
 			echo "On user request: Won't optimize with \"-Ox\"";;
 	--disable-dll)	DISABLE_DLL=1;
@@ -156,6 +158,7 @@
 		echo	"               \"can4linux\" can4linux driver"
 		echo	"                 see http://www.port.de/engl/canprod/hw_can4linux.html"
 		echo 	" --timers=foo  Use 'foo' as TIMERS driver (can be 'unix', 'xeno' or 'kernel')"
+		echo 	" --wx=foo  force result of WxWidgets detection (0 or 1)"
 		echo 	" --disable-dll Disable run-time dynamic linking of can, led and nvram drivers"
 		echo 	" --enable-lss  Enable the LSS services"
 		echo 	" --enable-lss-fs  Enable the LSS FastScan service"
@@ -485,28 +488,29 @@
 #                           GUESS DEPENDENCIES                            #
 ###########################################################################
 
-if which wx-config >/dev/null 2>&1; then
-	echo -n "Testing wxWidgets compiles ... "
-	cat > /tmp/wx_test.cpp <<EOF
+if [ "$SUB_WX" = "" ]; then
+	if which wx-config >/dev/null 2>&1; then
+		echo -n "Testing wxWidgets compiles ... "
+		cat > /tmp/wx_test.cpp <<EOF
 #include "wx/wx.h"
 class MyApp : public wxApp
 {
 };
 IMPLEMENT_APP(MyApp)
 EOF
-	if $CXX /tmp/wx_test.cpp `wx-config --cxxflags` `wx-config --libs` -o /tmp/wx_test >/dev/null 2>&1 ; then
-		SUB_WX=1
-		echo "Yes"
+		if $CXX /tmp/wx_test.cpp `wx-config --cxxflags` `wx-config --libs` -o /tmp/wx_test >/dev/null 2>&1 ; then
+			SUB_WX=1
+			echo "Yes"
+		else
+			SUB_WX=0
+			echo "No"
+		fi
+		rm -f /tmp/wx_test*
 	else
 		SUB_WX=0
-		echo "No"
-	fi
-	rm -f /tmp/wx_test*
-else
-	SUB_WX=0
-	echo "No wxWidgets available"
-fi
-
+		echo "No wxWidgets available"
+	fi
+fi
 ###########################################################################
 #                   CANFESTIVAL DEFINES --> config.h                      #
 ###########################################################################