]> rtime.felk.cvut.cz Git - CanFestival-3.git/commitdiff
added configure option to force Wx detection.
authoretisserant <etisserant>
Mon, 18 Feb 2008 09:36:01 +0000 (09:36 +0000)
committeretisserant <etisserant>
Mon, 18 Feb 2008 09:36:01 +0000 (09:36 +0000)
configure

index 923f307afe2bf70b9015156855f7857d2fcdc627..e3bf48e405588b0aa070077458dc399ac5e03d35 100755 (executable)
--- a/configure
+++ b/configure
@@ -109,6 +109,8 @@ while [ $# -ge 1 ]; do
        --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 @@ while [ $# -ge 1 ]; do
                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 @@ echo "Using prefix: ${SUB_PREFIX}"
 #                           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"
+               echo "No wxWidgets available"
        fi
-       rm -f /tmp/wx_test*
-else
-       SUB_WX=0
-       echo "No wxWidgets available"
 fi
-
 ###########################################################################
 #                   CANFESTIVAL DEFINES --> config.h                      #
 ###########################################################################