Don't read unlimited data from files
[qBittorrent.git] / m4 / qbittorrent.m4
blobe67f93544fdd331976d69b85649cbaf68bc97a47
1 # Checking for pkg-config. If found, check for QtCore and query pkg-config
2 # for its exec-prefix variable.
4 # FIND_QT5()
5 # Sets the QT_QMAKE variable to the path of Qt5 qmake if found.
6 # --------------------------------------
7 AC_DEFUN([FIND_QT5],
8 [PKG_CHECK_EXISTS([Qt5Core >= 5.15.2],
9                  [PKG_CHECK_VAR(QT_QMAKE,
10                                 [Qt5Core >= 5.15.2],
11                                 [host_bins])
12                  ])
14 AS_IF([test -f "$QT_QMAKE/qmake"],
15               [QT_QMAKE="$QT_QMAKE/qmake"],
16               [AS_IF([test -f "$QT_QMAKE/qmake-qt5"],
17                              [QT_QMAKE="$QT_QMAKE/qmake-qt5"],
18                              [QT_QMAKE=""])
19               ])
21 AC_MSG_CHECKING([for Qt5 qmake >= 5.15.2])
22 AS_IF([test "x$QT_QMAKE" != "x"],
23       [AC_MSG_RESULT([$QT_QMAKE])],
24       [AC_MSG_RESULT([not found])]
25       )
28 # FIND_QTDBUS()
29 # Sets the HAVE_QTDBUS variable to true or false.
30 # --------------------------------------
31 AC_DEFUN([FIND_QTDBUS],
32        [AC_MSG_CHECKING([for Qt5DBus >= 5.15.2])
33        PKG_CHECK_EXISTS([Qt5DBus >= 5.15.2],
34                         [AC_MSG_RESULT([found])
35                          HAVE_QTDBUS=[true]],
36                         [AC_MSG_RESULT([not found])
37                          HAVE_QTDBUS=[false]])
40 # DETECT_CPP17_PROGRAM()
41 # Detects if at least C++17 mode is enabled.
42 # --------------------------------------
43 AC_DEFUN([DETECT_CPP17_PROGRAM],
44        [AC_LANG_PROGRAM([[
45             #ifndef __cplusplus
46             #error "This is not a C++ compiler"
47             #elif __cplusplus < 201703L
48             #error "This is not a C++17 compiler"
49             #endif]],
50             [[]])