From: <ma...@us...> - 2003-12-19 23:50:16
|
Update of /cvsroot/sharedaemon/ui-wx In directory sc8-pr-cvs1:/tmp/cvs-serv5475 Modified Files: configure Log Message: wxMSW: Fixed registry issues, statusbar flickering, toolbar images and resource compilation. General: Now uses `which` to detect wx-config. Index: configure =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/configure,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- configure 19 Dec 2003 03:01:14 -0000 1.6 +++ configure 19 Dec 2003 23:50:11 -0000 1.7 @@ -19,22 +19,135 @@ ################################################################################ ## -# Checks for ccache (compiler cache) availability +# Parses command-line options and sets variables as needed. # -function check_ccache() { - echo -n -e "checking for ccache...\t\t\t\t"; - if test -x /usr/local/bin/ccache; then - ccache=/usr/local/bin/ccache; +function parse_cmdline() { + # defaults + wxconfig=wx-config; + gtkconfig=gtk-config; + prefix=/usr/local/bin; + include=-I/local/include; + include_dir=/local/include; + optimise=1; + debug=0; + profile=0; + show_flags=0; + patch_sizer=0; + colours=1; + + while test $# -gt 0; do + case $1 in + -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) optarg= ;; + esac + + case $1 in + --help) + print_help; + ;; + --with-wx-config=*) + wxconfig=$optarg; + ;; + --with-gtk-config=*) + gtkconfig=$optarg; + ;; + --prefix=*) + prefix=$optarg; + ;; + --include-dir=*) + include="$include -I$optarg"; + include_dir="$include_dir $optarg" + ;; + --enable-optimise) + optimise=1; + ;; + --disable-optimise) + optimise=0; + ;; + --enable-debug) + debug=1; + ;; + --disable-debug) + debug=0; + ;; + --enable-profile) + profile=1; + ;; + --disable-profile) + profile=0; + ;; + --has-patched-wxsizer) + patch_sizer=1; + ;; + --show-flags) + show_flags=1; + ;; + --hide-flags) + show_flags=0; + ;; + --disable-colours) + colours=0; + ;; + --enable-colours) + colours=1; + ;; + *) + print_help; + ;; + esac; + shift; + done; + + echo -e -n "checking for --disable-colours\t\t\t"; + if test $colours = 1; then + colour_default="\33[0;2m" + colour_yes="\33[32;22m" + colour_no="\33[31;22m" + colour_output="\33[35;1m" + colour_warning="\33[36;1m" + echo -e "${colour_yes}no${colour_default}"; + else + echo -e "yes"; + fi; + + echo -e "checking for --with-wx-config\t\t\t$wxconfig"; + echo -e "checking for --prefix\t\t\t\t$prefix"; + echo -e "checking for --include-dir\t\t\t$include_dir"; + + echo -e -n "checking for --enable-optimise\t\t\t"; + if test $optimise = 1; then + echo -e "${colour_yes}yes${colour_default}"; + cppflags="$cppflags -O3" + else + echo -e "${colour_no}no${colour_default}"; + fi; + + echo -e -n "checking for --enable-debug\t\t\t"; + if test $debug = 1; then + echo -e "${colour_yes}yes${colour_default}"; + cppflags="$cppflags -g -ggdb -fno-inline -Wall" + else + echo -e "${colour_no}no${colour_default}"; + fi; + + echo -e -n "checking for --enable-profile\t\t\t"; + if test $profile = 1; then + echo -e "${colour_yes}yes${colour_default}"; + cppflags="$cppflags -pg" + else + echo -e "${colour_no}no${colour_default}"; + fi; + + echo -e -n "checking for --has-patched-wxsizer\t\t"; + if test $patch_sizer = 1; then + echo -e "${colour_yes}yes${colour_default}"; + else + echo -e "${colour_no}no${colour_default}"; + fi; + + echo -e -n "checking for --show-flags\t\t\t"; + if test $show_flags = 1; then echo -e "${colour_yes}yes${colour_default}"; - elif test -x /usr/bin/ccache; then - ccache=/usr/bin/ccache; - echo -e "${colour_yes}yes${colour_default}" - elif test -x /local/bin/ccache; then - ccache=/local/bin/ccache; - echo -e "${colour_yes}yes${colour_default}" - elif test -x /bin/ccache; then - ccache=/bin/ccache; - echo -e "${colour_yes}yes${colour_default}" else echo -e "${colour_no}no${colour_default}"; fi; @@ -48,6 +161,8 @@ echo -n -e "checking for wx-config... \t\t\t"; if test -x $wxconfig; then wxconfig=$wxconfig; + elif test -x `which wx-config`; then + wxconfig=`which wx-config`; elif test -x /usr/local/bin/wx-config; then wxconfig=/usr/local/bin/wx-config; elif test -x /usr/bin/wx-config; then @@ -119,6 +234,7 @@ # Checks if wxWindows library was linked against GTK2 # function check_wxgtk2() { +if $wxconfig --cppflags | grep -q 'gtk'; then echo -e -n "checking if wxWindows was linked against GTK2..."; if $wxconfig --cppflags | grep -q 'gtk2' ; then echo -e "${colour_no}yes${colour_default}"; @@ -128,19 +244,78 @@ else echo -e "${colour_yes}no${colour_default}"; fi; +fi; } ## -# Outputs error message about too old wxWindows library and exits with false. +# Checks if wxWindows was linked against MSW # -function wrong_version() { - cat<<EOF -wxWindows library was found, but is too old for usage (v$wxversion_major.\ -$wxversion_minor.$wxversion_patch). Please download -latest version for your platform ( wxGTK for Linux, wxMac for Mac OS, wxMSW for -MS Windows ) from http://www.wxwindows.org, install it and rerun configure. +function check_wxmsw() { + if $wxconfig --cppflags | grep -q 'msw'; then + res=wxInterface_private.res + fi; +} + +### +# Checks for availability of GTK headers (needed for GTK systray) +# +function check_gtkconfig() { +if $wxconfig --cppflags | grep -q 'gtk'; then + echo -e -n "checking for gtk-config..."; + if test -x $gtkconfig; then + gtkconfig=$gtkconfig; + has_gtk=1; + elif test -x /usr/local/bin/gtk-config; then + gtkconfig=/usr/local/bin/gtk-config; + has_gtk=1; + elif test -x /usr/bin/gtk-config; then + gtkconfig=/usr/bin/gtk-config; + has_gtk=1; + elif test -x /bin/gtk-config; then + gtkconfig=/bin/gtk-config; + has_gtk=1; + elif test -x /local/bin/gtk-config; then + gtkconfig=/local/bin/gtk-config; + has_gtk=1; + else + echo -e "${colour_no}no${colour_warning}"; + cat << EOF +gtk-config was not found in standard locations. This means that either +you do not have GTK installed, you are missing GTK developer packages, +or you have installed GTK into custom location. In the latter case, +please rerun configure with --with-gtk-config=PREFIX. +GTK systray will be disabled. EOF - exit 1; + echo -e "$(colour_default)"; + has_gtk=0; + fi; + if test $has_gtk = 1; then + echo -e "${colour_yes}\t\t\tyes${colour_default}"; + fi; +fi; +} + + +## +# Checks for ccache (compiler cache) availability +# +function check_ccache() { + echo -n -e "checking for ccache...\t\t\t\t"; + if test -x /usr/local/bin/ccache; then + ccache=/usr/local/bin/ccache; + echo -e "${colour_yes}yes${colour_default}"; + elif test -x /usr/bin/ccache; then + ccache=/usr/bin/ccache; + echo -e "${colour_yes}yes${colour_default}" + elif test -x /local/bin/ccache; then + ccache=/local/bin/ccache; + echo -e "${colour_yes}yes${colour_default}" + elif test -x /bin/ccache; then + ccache=/bin/ccache; + echo -e "${colour_yes}yes${colour_default}" + else + echo -e "${colour_no}no${colour_default}"; + fi; } ## @@ -194,144 +369,27 @@ s#@PRINT_CPP_FLAGS@#$print_cpp_flags#; \ s#@PRINT_LINK_FLAGS@#$print_link_flags#; \ s#@TRAY_OBJECTS@#$tray_objs#; \ + s#@RES@#$res#; \ " src/Makefile.am >> src/Makefile; } -## -# Parses command-line options and sets variables as needed. -# -parse_cmdline() { - # defaults - wxconfig=wx-config; - gtkconfig=gtk-config; - prefix=/usr/local/bin; - include=-I/local/include; - include_dir=/local/include; - optimise=1; - debug=0; - profile=0; - show_flags=0; - patch_sizer=0; - colours=1; - - while test $# -gt 0; do - case $1 in - -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) optarg= ;; - esac - - case $1 in - --help) - print_help; - ;; - --with-wx-config=*) - wxconfig=$optarg; - ;; - --with-gtk-config=*) - gtkconfig=$optarg; - ;; - --prefix=*) - prefix=$optarg; - ;; - --include-dir=*) - include="$include -I$optarg"; - include_dir="$include_dir $optarg" - ;; - --enable-optimise) - optimise=1; - ;; - --disable-optimise) - optimise=0; - ;; - --enable-debug) - debug=1; - ;; - --disable-debug) - debug=0; - ;; - --enable-profile) - profile=1; - ;; - --disable-profile) - profile=0; - ;; - --has-patched-wxsizer) - patch_sizer=1; - ;; - --show-flags) - show_flags=1; - ;; - --hide-flags) - show_flags=0; - ;; - --disable-colours) - colours=0; - ;; - --enable-colours) - colours=1; - ;; - *) - print_help; - ;; - esac; - shift; - done; - - echo -e -n "checking for --disable-colours\t\t\t"; - if test $colours = 1; then - colour_default="\33[0;2m" - colour_yes="\33[32;22m" - colour_no="\33[31;22m" - colour_output="\33[35;1m" - colour_warning="\33[36;1m" - echo -e "${colour_yes}no${colour_default}"; - else - echo -e "yes"; - fi; - - echo -e "checking for --with-wx-config\t\t\t$wxconfig"; - echo -e "checking for --prefix\t\t\t\t$prefix"; - echo -e "checking for --include-dir\t\t\t$include_dir"; - - echo -e -n "checking for --enable-optimise\t\t\t"; - if test $optimise = 1; then - echo -e "${colour_yes}yes${colour_default}"; - cppflags="$cppflags -O3" - else - echo -e "${colour_no}no${colour_default}"; - fi; - - echo -e -n "checking for --enable-debug\t\t\t"; - if test $debug = 1; then - echo -e "${colour_yes}yes${colour_default}"; - cppflags="$cppflags -g -ggdb -fno-inline -Wall" - else - echo -e "${colour_no}no${colour_default}"; - fi; - echo -e -n "checking for --enable-profile\t\t\t"; - if test $profile = 1; then - echo -e "${colour_yes}yes${colour_default}"; - cppflags="$cppflags -pg" - else - echo -e "${colour_no}no${colour_default}"; - fi; - echo -e -n "checking for --has-patched-wxsizer\t\t"; - if test $patch_sizer = 1; then - echo -e "${colour_yes}yes${colour_default}"; - else - echo -e "${colour_no}no${colour_default}"; - fi; - echo -e -n "checking for --show-flags\t\t\t"; - if test $show_flags = 1; then - echo -e "${colour_yes}yes${colour_default}"; - else - echo -e "${colour_no}no${colour_default}"; - fi; +## +# Outputs error message about too old wxWindows library and exits with false. +# +function wrong_version() { + cat<<EOF +wxWindows library was found, but is too old for usage (v$wxversion_major.\ +$wxversion_minor.$wxversion_patch). Please download +latest version for your platform ( wxGTK for Linux, wxMac for Mac OS, wxMSW for +MS Windows ) from http://www.wxwindows.org, install it and rerun configure. +EOF + exit 1; } + ## # Outputs a detailed help text on command-line options # @@ -354,44 +412,6 @@ exit 0; } -### -# Checks for availability of GTK headers (needed for GTK systray) -# -function check_gtkconfig() { -if $wxconfig --cppflags | grep -q 'gtk'; then - echo -e -n "checking for gtk-config..."; - if test -x $gtkconfig; then - gtkconfig=$gtkconfig; - has_gtk=1; - elif test -x /usr/local/bin/gtk-config; then - gtkconfig=/usr/local/bin/gtk-config; - has_gtk=1; - elif test -x /usr/bin/gtk-config; then - gtkconfig=/usr/bin/gtk-config; - has_gtk=1; - elif test -x /bin/gtk-config; then - gtkconfig=/bin/gtk-config; - has_gtk=1; - elif test -x /local/bin/gtk-config; then - gtkconfig=/local/bin/gtk-config; - has_gtk=1; - else - echo -e "${colour_no}no${colour_warning}"; - cat << EOF -gtk-config was not found in standard locations. This means that either -you do not have GTK installed, you are missing GTK developer packages, -or you have installed GTK into custom location. In the latter case, -please rerun configure with --with-gtk-config=PREFIX. -GTK systray will be disabled. -EOF - echo -e "$(colour_default)"; - has_gtk=0; - fi; - if test $has_gtk = 1; then - echo -e "${colour_yes}\t\t\tyes${colour_default}"; - fi; -fi; -} ## # Main script execution part. @@ -400,6 +420,7 @@ check_wxconfig; check_wxversion; check_wxgtk2; +check_wxmsw; check_gtkconfig; check_ccache; gen_makefile; |