From 823aed41d91959cd8c2746f3a22889c81385add5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Sat, 14 Mar 2015 16:26:54 +0000 Subject: [PATCH] on the way to compile --- ax_check_qt.m4 | 41 ++++++++++++++++++++++++----- ax_init_standard_project.m4 | 42 +++++++++++++----------------- bootstrap.sh | 24 +++++++++-------- configure.ac | 7 ++++- debian/changelog.in | 7 +++-- src/authentication.hxx | 4 +-- src/browser.hxx | 22 ++++++++-------- src/certificate.hxx | 6 ++--- src/editbookmarks.hxx | 8 +++--- src/logincertificate.hxx | 2 +- src/main.cxx | 2 +- src/pinentry.hxx | 4 +-- src/qbrowserlib/buttonlineedit.hxx | 8 +++--- src/qbrowserlib/errorlog.hxx | 4 +-- src/qbrowserlib/log.hxx | 22 +++------------- src/qbrowserlib/makefile.am | 20 ++++++++------ src/qbrowserlib/saveorrun.hxx | 14 +++++----- src/qbrowserlib/settings.hxx | 4 +-- src/qbrowserlib/swisswebwidget.hxx | 8 +++--- src/smartcardauth.hxx | 2 +- src/swisssurfer.pc.in | 10 +++---- 21 files changed, 140 insertions(+), 121 deletions(-) diff --git a/ax_check_qt.m4 b/ax_check_qt.m4 index 4567828..df6daa7 100644 --- a/ax_check_qt.m4 +++ b/ax_check_qt.m4 @@ -62,16 +62,35 @@ AC_DEFUN([AX_CXX_QT_TOOLS], [ AX_CXX_QT_TOOL(LRELEASE, lrelease) ]) -AC_DEFUN([AX_CXX_CHECK_QT], [ +AC_DEFUN([AX_CHECK_VALID_FLAG], [ + AC_MSG_CHECKING([m4_default([$2], [for valid flag in "$1"])]) + save_cxxflags="$CXXFLAGS" + newflag="no" + for test_flag in $1; do + CXXFLAGS+=" ${test_flag}" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [ + newflag="$test_flag" + AM_CXXFLAGS+=" ${test_flag}" + CXXFLAGS="$save_cxxflags" + break; + ]) + CXXFLAGS="$save_cxxflags" + done + AC_SUBST(AM_CXXFLAGS) + AC_MSG_RESULT([$newflag]) +]) + +AC_DEFUN([AX_CHECK_QT], [ qt_modules="$2" AX_CXX_QT_TOOLS HAVE_$1=0 - PKG_CHECK_MODULES([$1], [${qt_modules//Qt/Qt5}], [ + PKG_PROG_PKG_CONFIG + PKG_CHECK_MODULES([$1]5, [${qt_modules//Qt/Qt5}], [ HAVE_$1=1 AC_DEFINE([HAVE_$1]) - AM_CPPFLAGS+=" ${$1_CFLAGS}" - AM_CXXFLAGS+=" ${$1_CFLAGS}" - LIBS+=" ${$1_LIBS}" + AM_CPPFLAGS+=" ${[$1]5_CFLAGS}" + AM_CXXFLAGS+=" ${[$1]5_CFLAGS}" + LIBS+=" ${[$1]5_LIBS}" ], [ PKG_CHECK_MODULES([$1], [${qt_modules}], [ HAVE_$1=1 @@ -82,10 +101,13 @@ AC_DEFUN([AX_CXX_CHECK_QT], [ ], [HAVE_$1=0]) ]) 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(AM_CXXFLAGS) AX_ADDITIONAL_QT_RULES_HACK=' -%_ui.hxx: %.ui +#BUILT_SOURCES += $(patsubst %.ui, ui_%.hxx, $(filter %.ui, $(SOURCES)))) +#BUILT_SOURCES += $(patsubst %.hxx, moc_%.cxx, $(shell grep -l Q_OBJECT $(HEADERS)))1 +ui_%.hxx: %.ui ${UIC} -o [$][@] $< moc_%.cxx: %.hxx @@ -95,3 +117,10 @@ qrc_%.cxx: %.qrc ${RCC} -o [$][@] $<' AC_SUBST(AX_ADDITIONAL_QT_RULES_HACK) ]) + +AC_DEFUN([AX_REQUIRE_QT], [ + AX_CHECK_QT([$1], [$2]) + if ! test "$HAVE_$1" -eq 1; then + AC_MSG_ERROR([Required Qt modules not found: $2]) + fi +]) \ No newline at end of file diff --git a/ax_init_standard_project.m4 b/ax_init_standard_project.m4 index a01617b..c1a4b06 100644 --- a/ax_init_standard_project.m4 +++ b/ax_init_standard_project.m4 @@ -104,7 +104,8 @@ AC_DEFUN([AX_USE_CXX], [ AC_CONFIG_FILES([src/makefile]) - AM_CPPFLAGS="-DPACKAGE_VERSION='\"${PACKAGE_VERSION}\"' -DPACKAGE_NAME='\"${PACKAGE_NAME}\"'" + AM_CPPFLAGS='-I ${top_srcdir}/src -I ${top_builddir}/src' + AM_LDFLAGS='-L ${top_srcdir}/src -I ${top_builddir}/src' # Get rid of that stupid -O2 -g opions! CXXFLAGS="${CXXFLAGS:-}" @@ -138,6 +139,7 @@ AC_DEFUN([AX_USE_CXX], [ AC_SUBST(AM_CXXFLAGS) AC_SUBST(AM_CPPFLAGS) + AC_SUBST(AM_LDFLAGS) ]) AC_DEFUN([AX_USE_CPPUNIT], [ @@ -204,16 +206,6 @@ AC_DEFUN([AX_USE_DOXYGEN], [ AC_CHECK_PROG(have_doxygen, doxygen, yes, no) AC_CHECK_PROG(have_dot, dot, yes, no) AC_CHECK_PROG(have_mscgen, mscgen, yes, no) - AC_ARG_ENABLE(html, - [AS_HELP_STRING([--disable-html], - [disable generation of doxygen html documentation])], - [have_html="$enableval"], [have_html="no"]) - AM_CONDITIONAL(HTML_DOC, test "$have_html" = "yes") - AC_ARG_ENABLE(pdf, - [AS_HELP_STRING([--enable-pdf], - [enable generation of doxygen pdf documentation])], - [have_pdf="$enableval"], [have_pdf="no"]) - AM_CONDITIONAL(PDF_DOC, test "$have_pdf" = "yes") PDF_DOC=${PACKAGE_NAME}-${PACKAGE_VERSION}.pdf AC_SUBST(PDF_DOC) if test "$have_doxygen" = "no"; then @@ -238,19 +230,8 @@ AC_DEFUN([AX_USE_DOXYGEN], [ AX_ADD_MAKEFILE_TARGET_DEP([.PHONY], [pdf], [doc/makefile.in]) test -f doc/makefile.in && cat >> doc/makefile.in < doxyfile: configure $1 ..." - if sed -i 's§\(^'"$1"' *=\) *§\1'" $2"'§g' doc/doxyfile.in; then + if sed -i 's|\(^'"$1"' *=\) *|\1'" $2"'|g' doc/doxyfile.in; then echo " success" else - echo " ignored" + echo " error" + echo "**** command: sed -i 's|\(^'"$1"' *=\) *|\1'" $2"'|g' doc/doxyfile.in;" + exit 1 fi } @@ -163,10 +165,10 @@ echo "${HEADER}" | to --condition AX_USE_DOXYGEN doc/makefile.am echo "${HEADER}" | to --condition AX_BUILD_EXAMPLES examples/makefile.am if testtag AX_USE_DOXYGEN && ! test -f doc/doxyfile.in; then run doxygen -g doc/doxyfile.in - doxyreplace PROJECT_NAME '"@PACKAGE_NAME@"' - doxyreplace PROJECT_NUMBER '"@PACKAGE_VERSION@"' - doxyreplace PROJECT_BRIEF '"@DESCRIPTION@"' - doxyreplace PROJECT_LOGO '"@PROJECT_LOGO@"' + doxyreplace PROJECT_NAME "@PACKAGE_NAME@" + doxyreplace PROJECT_NUMBER "@PACKAGE_VERSION@" + doxyreplace PROJECT_BRIEF "@DESCRIPTION@" + doxyreplace PROJECT_LOGO "@PROJECT_LOGO@" doxyreplace INLINE_INHERITED_MEMB YES doxyreplace MULTILINE_CPP_IS_BRIEF YES doxyreplace TAB_SIZE 2 @@ -194,7 +196,7 @@ if testtag AX_USE_DOXYGEN && ! test -f doc/doxyfile.in; then doxyreplace GENERATE_TREEVIEW NO doxyreplace SEARCHENGINE YES doxyreplace GENERATE_HTML YES - doxyreplace GENERATE_LATEX YES + doxyreplace GENERATE_LATEX NO doxyreplace LATEX_BATCHMODE YES doxyreplace LATEX_HIDE_INDICES YES doxyreplace COMPACT_RTF YES @@ -280,16 +282,16 @@ if ! test -f makefile.am; then echo "${HEADER}SUBDIRS =${SUBDIRS}" | to makefile.am fi to --condition AX_USE_LIBTOOL src/${PACKAGE_NAME}.pc.in < Wed, 07 Apr 2010 10:23:02 +0200 + -- @AUTHOR@ @BUILD_DATE@ diff --git a/src/authentication.hxx b/src/authentication.hxx index 19be8a0..dd5eb5f 100644 --- a/src/authentication.hxx +++ b/src/authentication.hxx @@ -8,8 +8,8 @@ #ifndef __AUTHENTICATION_HXX__ #define __AUTHENTICATION_HXX__ -#include -#include +#include +#include #include class Authentication: public QDialog, protected Ui::Authentication { diff --git a/src/browser.hxx b/src/browser.hxx index 31a04cc..c47dc88 100644 --- a/src/browser.hxx +++ b/src/browser.hxx @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include @@ -32,23 +32,23 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include #include #include #include -#include +#include -#include +#include #include #include diff --git a/src/certificate.hxx b/src/certificate.hxx index d73a41e..7273a9a 100644 --- a/src/certificate.hxx +++ b/src/certificate.hxx @@ -8,10 +8,10 @@ #ifndef CERTIFICATE_HXX #define CERTIFICATE_HXX -#include +#include #include -#include -#include +#include +#include #include #include diff --git a/src/editbookmarks.hxx b/src/editbookmarks.hxx index 011ba00..24ed507 100644 --- a/src/editbookmarks.hxx +++ b/src/editbookmarks.hxx @@ -8,10 +8,10 @@ #ifndef __EDITBOOKMARKS_HXX__ #define __EDITBOOKMARKS_HXX__ -#include -#include -#include -#include +#include +#include +#include +#include #include diff --git a/src/logincertificate.hxx b/src/logincertificate.hxx index ef726d3..125f063 100644 --- a/src/logincertificate.hxx +++ b/src/logincertificate.hxx @@ -9,7 +9,7 @@ #define LOGINCERTIFICATE_HXX #include -#include +#include class LoginCertificate: public QDialog, protected Ui::LoginCertificate { public: diff --git a/src/main.cxx b/src/main.cxx index 0ed2180..184ee6f 100644 --- a/src/main.cxx +++ b/src/main.cxx @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/pinentry.hxx b/src/pinentry.hxx index 4c51577..7b99ff9 100644 --- a/src/pinentry.hxx +++ b/src/pinentry.hxx @@ -10,8 +10,8 @@ #include #include -#include -#include +#include +#include #include #include diff --git a/src/qbrowserlib/buttonlineedit.hxx b/src/qbrowserlib/buttonlineedit.hxx index 5359993..db77053 100644 --- a/src/qbrowserlib/buttonlineedit.hxx +++ b/src/qbrowserlib/buttonlineedit.hxx @@ -9,10 +9,10 @@ #define __BUTTONLINEEDIT_HXX__ #include -#include -#include -#include -#include +#include +#include +#include +#include #include //! @addtogroup qbrowserlib diff --git a/src/qbrowserlib/errorlog.hxx b/src/qbrowserlib/errorlog.hxx index eb9eb9b..9cb4fcd 100644 --- a/src/qbrowserlib/errorlog.hxx +++ b/src/qbrowserlib/errorlog.hxx @@ -9,8 +9,8 @@ #define ERRORLOG_HXX #include -#include -#include +#include +#include //! @addtogroup qbrowserlib //! @{ diff --git a/src/qbrowserlib/log.hxx b/src/qbrowserlib/log.hxx index 959333e..9d95e73 100644 --- a/src/qbrowserlib/log.hxx +++ b/src/qbrowserlib/log.hxx @@ -8,10 +8,8 @@ #ifndef QBROWSERLIB_LOG #define QBROWSERLIB_LOG -#ifdef QT_GUI_LIB -#include -#include -#endif +#include +#include #include #include @@ -122,23 +120,15 @@ namespace qbrowserlib { bool _clean; }; - class LogDialog: -#ifdef QT_GUI_LIB - public QDialog, public Ui::LogDialog -#else - public QObject -#endif - { + class LogDialog: public QDialog, public Ui::LogDialog { Q_OBJECT; public: -#ifdef QT_GUI_LIB LogDialog(QWidget* p=0): QDialog(p) { setupUi(this); } -#endif template LogDialog& append(const Log& log, TYPE* arg) { std::ostringstream ss; @@ -147,7 +137,6 @@ namespace qbrowserlib { } template LogDialog& append(const Log& log, TYPE arg) { -#ifdef QT_GUI_LIB int pos(_logs->rowCount()); _logs->insertRow(pos); _logs->setItem @@ -165,13 +154,11 @@ namespace qbrowserlib { _logs->setItem (pos, MESSAGE, new QTableWidgetItem(QVariant(arg).toString())); -#endif return *this; } protected Q_SLOTS: -#ifdef QT_GUI_LIB void on__fileLine_toggled(bool checked) { if (checked) { _logs->showColumn(FILE); @@ -218,13 +205,12 @@ namespace qbrowserlib { if (!items.isEmpty()) _logs->scrollToItem(items[0]); unsetCursor(); } -#endif private: friend class Log; enum {FILE, LINE, INSTANCE, FUNCTION, MESSAGE} Columns; - + }; // note: template class method must be defined in the header diff --git a/src/qbrowserlib/makefile.am b/src/qbrowserlib/makefile.am index eac7564..c7caf0a 100644 --- a/src/qbrowserlib/makefile.am +++ b/src/qbrowserlib/makefile.am @@ -5,14 +5,18 @@ qbrowserlibdir=${includedir}/qbrowserlib -qbrowserlib_HEADERS = buttonlineedit.hxx errorlog.hxx log.hxx \ - settings.hxx swisswebwidget.hxx certs.hxx \ - executor.hxx pluginfactory.hxx swisswebpage.hxx \ - temporaryfile.hxx downloadmanager.hxx \ - filestorage.hxx saveorrun.hxx swisswebview.hxx +qbrowserlib_HEADERS = $(libqbrowserlib_la_HEADERS) lib_LTLIBRARIES = libqbrowserlib.la -libqbrowserlib_la_SOURCES = errorlog.ui log.ui saveorrun.ui \ - settings.ui swisswebwidget.ui certs.cxx \ - log.cxx +libqbrowserlib_la_MOCFILES = buttonlineedit.hxx errorlog.hxx log.hxx \ + settings.hxx swisswebwidget.hxx \ + certs.hxx executor.hxx pluginfactory.hxx \ + swisswebpage.hxx temporaryfile.hxx \ + downloadmanager.hxx filestorage.hxx \ + saveorrun.hxx swisswebview.hxx +libqbrowserlib_la_UIFILES = errorlog.ui log.ui saveorrun.ui \ + settings.ui swisswebwidget.ui +libqbrowserlib_la_SOURCES = certs.cxx log.cxx \ + $(libqbrowserlib_la_MOCFILES:%.hxx=moc_%.hxx) \ + $(libqbrowserlib_la_UIFILES:%.ui=ui_%.hxx) diff --git a/src/qbrowserlib/saveorrun.hxx b/src/qbrowserlib/saveorrun.hxx index 755a6b2..f1b8ab5 100644 --- a/src/qbrowserlib/saveorrun.hxx +++ b/src/qbrowserlib/saveorrun.hxx @@ -9,17 +9,17 @@ #define __SAVEORRUN_HXX__ #include -#include +#include #include #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/qbrowserlib/settings.hxx b/src/qbrowserlib/settings.hxx index 8a08331..03ec1d4 100644 --- a/src/qbrowserlib/settings.hxx +++ b/src/qbrowserlib/settings.hxx @@ -9,13 +9,13 @@ #define QBROWSERLIB_SETTINGS_HXX #include -#include +#include #include #include #include #include -#include +#include #include diff --git a/src/qbrowserlib/swisswebwidget.hxx b/src/qbrowserlib/swisswebwidget.hxx index e5388bc..9589316 100644 --- a/src/qbrowserlib/swisswebwidget.hxx +++ b/src/qbrowserlib/swisswebwidget.hxx @@ -8,13 +8,13 @@ #ifndef __SWISSWEBWIDGET_HXX__ #define __SWISSWEBWIDGET_HXX__ -#include +#include #include #include -#include -#include -#include +#include +#include +#include #include diff --git a/src/smartcardauth.hxx b/src/smartcardauth.hxx index c2e97c9..72f8551 100644 --- a/src/smartcardauth.hxx +++ b/src/smartcardauth.hxx @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include diff --git a/src/swisssurfer.pc.in b/src/swisssurfer.pc.in index 8336126..9dd1f56 100644 --- a/src/swisssurfer.pc.in +++ b/src/swisssurfer.pc.in @@ -1,18 +1,18 @@ ## @id $Id$ # -# This file has been added by bootstrap.sh on Fri, 13 Mar 2015 15:22:56 +0100 +# This file has been added by bootstrap.sh on Sat, 14 Mar 2015 15:34:48 +0100 # Feel free to change it or even remove and rebuild it, up to your needs # ## 1 2 3 4 5 6 7 8 ## 45678901234567890123456789012345678901234567890123456789012345678901234567890 -prefix=@PACKAGE_NAME@ -exec_prefix= +prefix=@prefix@ +exec_prefix=@exec_prefix@ libdir=/lib includedir=/include Name: @PACKAGE_NAME@ Description: @DESCRIPTION@ Version: @VERSION@ -Libs: -L -l@PACKAGE_NAME@ -Cflags: -I +Libs: -L -l@PACKAGE_NAME@ @LDFLAGS@ +Cflags: -I @CPPFLAGS@