From 70b2da34cd46086dc2c916f4a630380d695449cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Thu, 23 Jul 2015 12:42:19 +0000 Subject: [PATCH] compiles for mingw now --- ax_check_qt.m4 | 95 ++++----- ax_init_standard_project.m4 | 236 +++++++++++++---------- bootstrap.sh | 372 +++++++++++++++++++++++++++--------- configure.ac | 2 +- mac-create-app-bundle.sh | 103 ++++++++++ src/proxyface/autoproxy.hxx | 6 - 6 files changed, 572 insertions(+), 242 deletions(-) create mode 100755 mac-create-app-bundle.sh diff --git a/ax_check_qt.m4 b/ax_check_qt.m4 index 61724b6..88dc733 100644 --- a/ax_check_qt.m4 +++ b/ax_check_qt.m4 @@ -42,10 +42,10 @@ AC_DEFUN([AX_CXX_QT_TOOL], [ HAVE_$1=1 AC_MSG_CHECKING([for $2]) AC_ARG_VAR([$1], [path to Qt tool $2]) - $1=${$1:-$(pkg-config --variable=$2_location Qt5Core)} - $1=${$1:-$(pkg-config --variable=host_bins Qt5Core)/$2} - $1=${$1:-$(pkg-config --variable=$2_location QtCore)} - $1=${$1:-$(pkg-config --variable=host_bins QtCore)/$2} + $1=${$1:-$(${ac_tool_prefix}pkg-config --variable=$2_location Qt5Core)} + $1=${$1:-$(${ac_tool_prefix}pkg-config --variable=host_bins Qt5Core)/$2} + $1=${$1:-$(${ac_tool_prefix}pkg-config --variable=$2_location QtCore)} + $1=${$1:-$(${ac_tool_prefix}pkg-config --variable=host_bins QtCore)/$2} if ! which "${$1%% *}" > /dev/null; then if which "$2" > /dev/null; then $1=$2 @@ -75,19 +75,19 @@ AC_DEFUN([AX_CXX_QT_TOOLS], [ AC_DEFUN([AX_CHECK_VALID_FLAG], [ AC_MSG_CHECKING([m4_default([$2], [for valid flag in "$1"])]) - save_cxxflags="$CXXFLAGS" + save_cppflags="$CPPFLAGS" newflag="no" for test_flag in $1; do - CXXFLAGS+=" ${test_flag}" + CPPFLAGS+=" ${test_flag}" AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [ newflag="$test_flag" - AM_CXXFLAGS+=" ${test_flag}" - CXXFLAGS="$save_cxxflags" + CPPFLAGS="$save_cppflags" + CPPFLAGS+=" ${test_flag}" break; ]) - CXXFLAGS="$save_cxxflags" + CPPFLAGS="$save_cppflags" done - AC_SUBST(AM_CXXFLAGS) + AC_SUBST(CPPFLAGS) AC_MSG_RESULT([$newflag]) ]) @@ -100,28 +100,20 @@ AC_DEFUN([AX_CHECK_QT], [ PKG_CHECK_MODULES([$1]5, [${qt_modules//Qt/Qt5}], [ HAVE_$1=1 AC_DEFINE([HAVE_$1]) - AM_CPPFLAGS+=" ${[$1]5_CFLAGS}" + QTDIR=$(${ac_tool_prefix}pkg-config --variable=prefix Qt5Core) + QT_PLUGIN_PATH=${QTDIR}/share/qt5/plugins + CPPFLAGS+=" ${[$1]5_CFLAGS}" MOC_FLAGS+=" -DHAVE_$1=1 ${[$1]5_CFLAGS}" - AM_CXXFLAGS+=" ${[$1]5_CFLAGS}" + CXXFLAGS+=" ${[$1]5_CFLAGS}" LIBS+=" ${[$1]5_LIBS}" - modules=${qt_modules//Qt/Qt5} - if test -z "$PKG_REQUIREMENTS"; then - PKG_REQUIREMENTS="${modules// /, }" - else - PKG_REQUIREMENTS="${PKG_REQUIREMENTS}, ${modules// /, }" - fi + PKG_REQUIREMENTS+=" ${qt_modules//Qt/Qt5}" if test -n "${qt_modules_optional}"; then PKG_CHECK_MODULES([$1]5_OPTIONAL, [${qt_modules_optional//Qt/Qt5}], [ - AM_CPPFLAGS+=" ${[$1]5_OPTIONAL_CFLAGS}" + CPPFLAGS+=" ${[$1]5_OPTIONAL_CFLAGS}" MOC_FLAGS+=" ${[$1]5_OPTIONAL_CFLAGS}" - AM_CXXFLAGS+=" ${[$1]5_OPTIONAL_CFLAGS}" + CXXFLAGS+=" ${[$1]5_OPTIONAL_CFLAGS}" LIBS+=" ${[$1]5_OPTIONAL_LIBS}" - modules=${qt_modules_optional//Qt/Qt5} - if test -z "$PKG_REQUIREMENTS"; then - PKG_REQUIREMENTS="${modules// /, }" - else - PKG_REQUIREMENTS="${PKG_REQUIREMENTS}, ${modules// /, }" - fi + PKG_REQUIREMENTS+=" ${qt_modules_optional//Qt/Qt5}" ], [ AC_MSG_NOTICE([Not found: ${qt_modules_optional//Qt/Qt5}]) ]) @@ -130,28 +122,20 @@ AC_DEFUN([AX_CHECK_QT], [ PKG_CHECK_MODULES([$1], [${qt_modules}], [ HAVE_$1=1 AC_DEFINE([HAVE_$1]) - AM_CPPFLAGS+=" ${$1_CFLAGS}" + QTDIR=$(${ac_tool_prefix}pkg-config --variable=prefix QtCore) + QT_PLUGIN_PATH=${QTDIR}/share/qt/plugins + CPPFLAGS+=" ${$1_CFLAGS}" MOC_FLAGS+=" -DHAVE_$1=1 ${$1_CFLAGS}" - AM_CXXFLAGS+=" ${$1_CFLAGS}" + CXXFLAGS+=" ${$1_CFLAGS}" LIBS+=" ${$1_LIBS}" - modules=${qt_modules} - if test -z "$PKG_REQUIREMENTS"; then - PKG_REQUIREMENTS="${modules// /, }" - else - PKG_REQUIREMENTS="${PKG_REQUIREMENTS}, ${modules// /, }" - fi + PKG_REQUIREMENTS+=" ${qt_modules}" if test -n "$3"; then PKG_CHECK_MODULES($1_OPTIONAL, [${qt_modules_optional}], [ - AM_CPPFLAGS+=" ${$1_OPTIONAL_CFLAGS}" + CPPFLAGS+=" ${$1_OPTIONAL_CFLAGS}" MOC_FLAGS+=" ${$1_OPTIONAL_CFLAGS}" - AM_CXXFLAGS+=" ${$1_OPTIONAL_CFLAGS}" + CXXFLAGS+=" ${$1_OPTIONAL_CFLAGS}" LIBS+=" ${$1_OPTIONAL_LIBS}" - modules=${qt_modules_optional} - if test -z "$PKG_REQUIREMENTS"; then - PKG_REQUIREMENTS="${modules// /, }" - else - PKG_REQUIREMENTS="${PKG_REQUIREMENTS}, ${modules// /, }" - fi + PKG_REQUIREMENTS+=" ${qt_modules_optional}" ], [ AC_MSG_NOTICE([Not found: ${qt_modules_optional}]) ]) @@ -160,11 +144,16 @@ AC_DEFUN([AX_CHECK_QT], [ ]) AM_CONDITIONAL(HAVE_$1, test $HAVE_$1 -eq 1) AX_CHECK_VALID_FLAG([-fPIC -fPIE], [position independent code flag]) - AC_SUBST(AM_CPPFLAGS) + AC_SUBST(QTDIR) + AC_SUBST(QT_PLUGIN_PATH) + AC_SUBST(CPPFLAGS) AC_SUBST(MOC_FLAGS) - AC_SUBST(AM_CXXFLAGS) + AC_SUBST(CXXFLAGS) AC_SUBST(PKG_REQUIREMENTS) AX_ADDITIONAL_QT_RULES_HACK=' + +LANGUAGE_FILE_BASE ?= translations + ui_%.hxx: %.ui $(UIC) -o [$][@] $< @@ -172,9 +161,21 @@ moc_%.cxx: %.hxx $(MOC) $(MOC_FLAGS) -o [$][@] $< qrc_%.cxx: %.qrc - $(RCC) -o [$][@] $<' + $(RCC) -o [$][@] -name ${<:%.qrc=%} $< AC_SUBST(AX_ADDITIONAL_QT_RULES_HACK) -]) + +#%.qrc: % +# cwd=$$(pwd) && cd $< && $(RCC) -project -o $${cwd}/[$][@] + +%.qm: %.ts + ${LRELEASE} $< -qm [$][@] + +#%.ts: ${LANGUAGE_FILES} +# ${LUPDATE} -no-obsolete \ +# -target-language ${@:${LANGUAGE_FILE_BASE}_%.ts=%} \ +# -ts [$][@] $< + +']) # SYNOPSIS # @@ -222,5 +223,5 @@ AC_DEFUN([AX_REQUIRE_QT], [ # AX_QT_NO_KEYWORDS AC_DEFUN([AX_QT_NO_KEYWORDS], [ - AM_CPPFLAGS+=" -DQT_NO_KEYWORDS" + CPPFLAGS+=" -DQT_NO_KEYWORDS" ]) diff --git a/ax_init_standard_project.m4 b/ax_init_standard_project.m4 index a882473..eb5ac43 100644 --- a/ax_init_standard_project.m4 +++ b/ax_init_standard_project.m4 @@ -68,7 +68,7 @@ dnl refers to ${prefix}. Thus we have to use `eval' twice. # $3 = filename of makefile.in AC_DEFUN([AX_ADD_MAKEFILE_TARGET_DEP], [ sh_add_makefile_target_dep() { - sed -i ':a;/^'${1}':.*\\$/{N;s/\\\n//;ta};s/^'${1}':.*$/& '${2}'/' "${srcdir}/${3}" + sed -i -e ':a;/^'${1}':.*\\$/{N;s/\\\n//;ta};s/^'${1}':.*$/& '${2}'/' "${srcdir}/${3}" if ! egrep -q "${1}:.* ${2}" "${srcdir}/${3}"; then echo "${1}: ${2}" >> "${srcdir}/${3}" fi @@ -108,7 +108,15 @@ AC_DEFUN([AX_SUBST], [ # # configures the basic environment AC_DEFUN([AX_INIT_STANDARD_PROJECT], [ - AM_CPPFLAGS+=" '-DMAKE_STRING(X)=\#X' '-DNAMESPACE=${PACKAGE_NAME}'" + MINGW=no + MAC=no + case $host in + *mingw*) MINGW=yes;; + *darwin* | *rhapsody* | *macosx*) MAC=yes;; + esac + AM_CONDITIONAL(MINGW, test "$MINGW" = "yes") + AM_CONDITIONAL(MAC, test "$MAC" = "yes") + AM_CPPFLAGS+=" '-DMAKE_STRING(X)=\#X' '-DNAMESPACE=${PACKAGE_NAME//-/_}'" AX_SUBST(NUMBERS) AX_SUBST(HOME) README=$(tail -n +3 README) @@ -134,6 +142,21 @@ AC_DEFUN([AX_INIT_STANDARD_PROJECT], [ PROJECT_ICON="${PROJECT_NAME}-icon.png" fi AX_SUBST(PROJECT_ICON) + + AC_ARG_ENABLE(pedantic, + [AS_HELP_STRING([--enable-pedantic], + [enable all warnings and checks, abort on warnings])], + [have_pedantic="$enableval"; test "$enableval" = "yes" && \ + AM_CXXFLAGS="${AM_CXXFLAGS:-} -pedantic-errors -Wall -W -Wfloat-equal -Wundef -Wendif-labels -Wpointer-arith -Wcast-align -Wwrite-strings -Wconversion -Wsign-compare -Wmissing-format-attribute -Wno-multichar -Wpacked -Wredundant-decls -Werror -Wshadow -Wcast-qual -Wno-ctor-dtor-privacy"]) + dnl problem in libs: -Wshadow -Wcast-qual + dnl auto.hpp: -Wno-ctor-dtor-privacy (removed) + AM_CONDITIONAL(PEDANTIC, test "$enableval" = "yes") + if test "$have_pedantic" == "yes"; then + AC_MSG_NOTICE([Pedantic compile mode enabled! + - all warnings for GNU g++ are enabled + - all warnings result in an error + - doxygen warnings are treated as error too]); fi + AC_CONFIG_FILES([makefile]) AX_ADD_MAKEFILE_TARGET_DEP([clean-am], [clean-standard-project-targets], [makefile.in]) AX_ADD_MAKEFILE_TARGET_DEP([distclean-am], [distclean-standard-project-targets], [makefile.in]) @@ -174,35 +197,21 @@ AC_DEFUN([AX_USE_CXX], [ AM_DISTCHECK_CONFIGURE_FLAGS="CXXFLAGS='${CXXFLAGS}' CPPFLAGS='${CPPFLAGS}' CFLAGS='${CFLAGS}' LDFLAGS='${LDFLAGS}'" AC_SUBST(AM_DISTCHECK_CONFIGURE_FLAGS) - AC_ARG_ENABLE(pedantic, - [AS_HELP_STRING([--enable-pedantic], - [enable all warnings and checks, abort on warnings])], - [have_pedantic="$enableval"; test "$enableval" = "yes" && \ - AM_CXXFLAGS="${AM_CXXFLAGS:-} -pedantic-errors -Wall -W -Wfloat-equal -Wundef -Wendif-labels -Wpointer-arith -Wcast-align -Wwrite-strings -Wconversion -Wsign-compare -Wmissing-format-attribute -Wno-multichar -Wpacked -Wredundant-decls -Werror -Wshadow -Wcast-qual -Wno-ctor-dtor-privacy"]) - dnl problem in libs: -Wshadow -Wcast-qual - dnl auto.hpp: -Wno-ctor-dtor-privacy (removed) - AM_CONDITIONAL(PEDANTIC, test "$enableval" = "yes") - if test "$have_pedantic" == "yes"; then - AC_MSG_NOTICE([Pedantic compile mode enabled! - - all warnings for GNU g++ are enabled - - all warnings result in an error - - doxygen warnings are treated as error too]); fi - - MINGW32=no - MAC=no - case $host_os in - *mingw32*) MINGW32=yes;; - *darwin* | *rhapsody* | *macosx*) MAC=yes;; - esac - AM_CONDITIONAL(MINGW32, test "$MINGW32" = "yes") - AM_CONDITIONAL(MAC, test "$MAC" = "yes") - AC_SUBST(AM_CXXFLAGS) AC_SUBST(AM_CPPFLAGS) AC_SUBST(AM_LDFLAGS) AX_ADD_MAKEFILE_TARGET_DEP([maintainer-clean-am], [maintainer-clean-cxx-targets], [src/makefile.in]) test -f src/makefile.in && cat >> src/makefile.in <> examples/html.in < ${1}/Contents/Info.plist < + + + + CFBundleIdentifier + ${2} + CFBundleExecutable + ${executablefile##/} + + +EOF +fi \ No newline at end of file diff --git a/src/proxyface/autoproxy.hxx b/src/proxyface/autoproxy.hxx index e8083b8..78df9fc 100644 --- a/src/proxyface/autoproxy.hxx +++ b/src/proxyface/autoproxy.hxx @@ -17,9 +17,7 @@ #include #include #include -#ifndef Q_OS_WIN32 #include -#endif #include #ifndef PROXYFACE_LOG #define PROXYFACE_LOG qDebug()<<__PRETTY_FUNCTION__ @@ -193,11 +191,7 @@ namespace proxy { @example getproxylist.cxx */ class Interface #if HAVE_QT == 1 -# ifdef Q_OS_WIN32 - : public QObject -# else : public QThread -# endif #endif { #if HAVE_QT == 1