summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-11-16 12:22:47 +0100
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-11-16 12:37:00 +0000
commit56885ed37e6ef011044cd37c848e3f8ed94618ba (patch)
tree16757a204eaf5a4bbe922f0ed53d7ab5b3ad1c67
parentbecd18327dd28bd742007a54b176d1d4f0f5857c (diff)
Make libarchive support config test based
Use the bundled one automatically if 3.1.2 is not available via pkg-config. Change-Id: Iac00dc0173acef3525fc97a09b47458fb2b1036b Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
-rw-r--r--3rdparty/libarchive.pri2
-rw-r--r--INSTALL.md2
-rw-r--r--application-manager.pro6
-rw-r--r--config.tests/libarchive/libarchive.pro7
-rw-r--r--config.tests/libarchive/main.cpp45
5 files changed, 57 insertions, 5 deletions
diff --git a/3rdparty/libarchive.pri b/3rdparty/libarchive.pri
index 3becf06d..83ddafe4 100644
--- a/3rdparty/libarchive.pri
+++ b/3rdparty/libarchive.pri
@@ -1,7 +1,7 @@
include(libz.pri)
-bundled-libarchive {
+!config_libarchive {
LIBARCHIVE_PATH = $$PWD/libarchive
LIBARCHIVE_BUILD_PATH = $$shadowed($$LIBARCHIVE_PATH)
diff --git a/INSTALL.md b/INSTALL.md
index 00810417..2ba80129 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -29,8 +29,6 @@ There are various options that can be applied to the `qmake` step to tailor the
| Option | Description |
| ------ | ----------- |
| `-config bundled-libz` | Build and link against the bundled version of zlib, instead of using a system version.
-| `-config bundled-libarchive` | Build and link against the bundled version of libyaml, instead of using a system version.
-| `-config bundled-libarchive` | Build and link against the bundled version of libarchive, instead of using a system version.
| `-config bundled-libcrypto` | Build and link against the bundled version of openssl, instead of using a system version.
| `-config force-singleprocess` | Force a single-process build, even if Qt's Wayland `compositor` module is available.
| `-config force-multiprocess` | Force a multi-process build - this will break if Qt's Wayland `compositor` module is not available.
diff --git a/application-manager.pro b/application-manager.pro
index d0eea696..16bd05b5 100644
--- a/application-manager.pro
+++ b/application-manager.pro
@@ -1,4 +1,5 @@
load(configure)
+qtCompileTest(libarchive)
qtCompileTest(libyaml)
MIN_MINOR=4
@@ -11,7 +12,7 @@ CONFIG += ordered
include($$BASE_PRI)
-bundled-libarchive:SUBDIRS += 3rdparty/libarchive/libarchive.pro
+!config_libarchive:SUBDIRS += 3rdparty/libarchive/libarchive.pro
!config_libyaml:SUBDIRS += 3rdparty/libyaml/libyaml.pro
force-singleprocess:force-multiprocess:error("You cannot both specify force-singleprocess and force-multiprocess")
@@ -40,13 +41,14 @@ printConfigLine("QtCompositor support", $$yesNo(qtHaveModule(compositor)), auto)
printConfigLine("Multi-process mode", $$check_multi, auto)
printConfigLine("Installer enabled", $$yesNo(!CONFIG(disable-installer)), auto)
printConfigLine("Tests enabled", $$yesNo(CONFIG(enable-tests)), auto)
-printConfigLine("Bundled libarchive", $$yesNo(CONFIG(bundled-libarchive)), auto)
printConfigLine("libcrypto defines", $$check_libcrypto_defines, auto)
printConfigLine("libcrypto includes", $$check_libcrypto_includes, auto)
printConfigLine("SSDP support", $$yesNo(qtHaveModule(pssdp)), auto)
printConfigLine("Shellserver support", $$yesNo(qtHaveModule(pshellserver)), auto)
printConfigLine("Genivi support", $$yesNo(qtHaveModule(geniviextras)), auto)
printConfigLine("Systemd workaround", $$yesNo(CONFIG(systemd-workaround)), auto)
+printConfigLine("System libarchive", $$yesNo(config_libarchive), auto)
+printConfigLine("System libyaml", $$yesNo(config_libyaml), auto)
include(doc/doc.pri)
diff --git a/config.tests/libarchive/libarchive.pro b/config.tests/libarchive/libarchive.pro
new file mode 100644
index 00000000..0a1bf2e2
--- /dev/null
+++ b/config.tests/libarchive/libarchive.pro
@@ -0,0 +1,7 @@
+TARGET = libarchive
+CONFIG -= qt
+
+SOURCES += main.cpp
+
+PKGCONFIG += "'libarchive >= 3.1.2'"
+CONFIG += link_pkgconfig
diff --git a/config.tests/libarchive/main.cpp b/config.tests/libarchive/main.cpp
new file mode 100644
index 00000000..a9fb5671
--- /dev/null
+++ b/config.tests/libarchive/main.cpp
@@ -0,0 +1,45 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Application Manager
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <archive.h>
+#include <archive_entry.h>
+
+int main()
+{
+ struct archive *ar = archive_write_new();
+
+ return 0;
+}