...
 
Commits (3)
......@@ -12,3 +12,4 @@ Paavo Leinonen <paavo.leinonen@tieto.com>
Nicolas Bertrand <nicolas.bertrand@linux.intel.com>
Philippe Nunes <philippe.nunes@linux.intel.com>
Jussi Pakkanen <jussi.pakkanen@canonical.com>
James Prestwood <james.prestwood@linux.intel.com>
ver 1.21:
Add support for SimAuth class for GSM/UMTS authentication.
Add support for handling ISim file systems.
ver 1.20:
Fix issue with encoding of EFpnn.
Fix issue with hex quoted strings in CRSM.
......
......@@ -16,6 +16,10 @@ src_phonesim_SOURCES = src/main.cpp \
src/qsmsmessage.h src/qsmsmessage.cpp \
src/qcbsmessage.h src/qcbsmessage.cpp \
src/callmanager.h src/callmanager.cpp \
src/simauth.h src/simauth.cpp \
src/aidapplication.h src/aidapplication.cpp \
src/comp128.h src/comp128.c \
src/aes.h src/aes.c \
src/simfilesystem.h src/simfilesystem.cpp \
src/simapplication.h src/simapplication.cpp \
src/qgsmcodec.h src/qgsmcodec.cpp \
......@@ -34,6 +38,8 @@ nodist_src_phonesim_SOURCES = src/ui_controlbase.h \
src/moc_phonesim.cpp \
src/moc_hardwaremanipulator.cpp \
src/moc_callmanager.cpp \
src/moc_simauth.cpp \
src/moc_aidapplication.cpp \
src/moc_simfilesystem.cpp \
src/moc_simapplication.cpp \
src/moc_qwsppdu.cpp
......@@ -42,7 +48,7 @@ src_phonesim_LDADD = $(QT_LIBS)
AM_CXXFLAGS = -Wall $(QT_CFLAGS)
INCLUDES = -I$(top_srcdir)/src -I$(top_builddir)/src
AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/src
CLEANFILES = src/control.moc $(nodist_src_phonesim_SOURCES)
......@@ -51,7 +57,7 @@ dist_pkgdata_DATA = src/default.xml
EXTRA_DIST = src/controlbase.ui src/GSMSpecification.xml
MAINTAINERCLEANFILES = Makefile.in \
aclocal.m4 configure depcomp missing install-sh
aclocal.m4 configure depcomp missing compile install-sh
$(src_phonesim_OBJECTS): src/ui_controlbase.h
......
This diff is collapsed.
This diff is collapsed.
#! /bin/sh
# Wrapper for compilers which do not understand '-c -o'.
scriptversion=2012-10-14.11; # UTC
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to <bug-automake@gnu.org> or send patches to
# <automake-patches@gnu.org>.
nl='
'
# We need space, tab and new line, in precisely that order. Quoting is
# there to prevent tools from complaining about whitespace usage.
IFS=" "" $nl"
file_conv=
# func_file_conv build_file lazy
# Convert a $build file to $host form and store it in $file
# Currently only supports Windows hosts. If the determined conversion
# type is listed in (the comma separated) LAZY, no conversion will
# take place.
func_file_conv ()
{
file=$1
case $file in
/ | /[!/]*) # absolute file, and not a UNC file
if test -z "$file_conv"; then
# lazily determine how to convert abs files
case `uname -s` in
MINGW*)
file_conv=mingw
;;
CYGWIN*)
file_conv=cygwin
;;
*)
file_conv=wine
;;
esac
fi
case $file_conv/,$2, in
*,$file_conv,*)
;;
mingw/*)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
cygwin/*)
file=`cygpath -m "$file" || echo "$file"`
;;
wine/*)
file=`winepath -w "$file" || echo "$file"`
;;
esac
;;
esac
}
# func_cl_dashL linkdir
# Make cl look for libraries in LINKDIR
func_cl_dashL ()
{
func_file_conv "$1"
if test -z "$lib_path"; then
lib_path=$file
else
lib_path="$lib_path;$file"
fi
linker_opts="$linker_opts -LIBPATH:$file"
}
# func_cl_dashl library
# Do a library search-path lookup for cl
func_cl_dashl ()
{
lib=$1
found=no
save_IFS=$IFS
IFS=';'
for dir in $lib_path $LIB
do
IFS=$save_IFS
if $shared && test -f "$dir/$lib.dll.lib"; then
found=yes
lib=$dir/$lib.dll.lib
break
fi
if test -f "$dir/$lib.lib"; then
found=yes
lib=$dir/$lib.lib
break
fi
if test -f "$dir/lib$lib.a"; then
found=yes
lib=$dir/lib$lib.a
break
fi
done
IFS=$save_IFS
if test "$found" != yes; then
lib=$lib.lib
fi
}
# func_cl_wrapper cl arg...
# Adjust compile command to suit cl
func_cl_wrapper ()
{
# Assume a capable shell
lib_path=
shared=:
linker_opts=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as 'compile cc -o foo foo.c'.
eat=1
case $2 in
*.o | *.[oO][bB][jJ])
func_file_conv "$2"
set x "$@" -Fo"$file"
shift
;;
*)
func_file_conv "$2"
set x "$@" -Fe"$file"
shift
;;
esac
;;
-I)
eat=1
func_file_conv "$2" mingw
set x "$@" -I"$file"
shift
;;
-I*)
func_file_conv "${1#-I}" mingw
set x "$@" -I"$file"
shift
;;
-l)
eat=1
func_cl_dashl "$2"
set x "$@" "$lib"
shift
;;
-l*)
func_cl_dashl "${1#-l}"
set x "$@" "$lib"
shift
;;
-L)
eat=1
func_cl_dashL "$2"
;;
-L*)
func_cl_dashL "${1#-L}"
;;
-static)
shared=false
;;
-Wl,*)
arg=${1#-Wl,}
save_ifs="$IFS"; IFS=','
for flag in $arg; do
IFS="$save_ifs"
linker_opts="$linker_opts $flag"
done
IFS="$save_ifs"
;;
-Xlinker)
eat=1
linker_opts="$linker_opts $2"
;;
-*)
set x "$@" "$1"
shift
;;
*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
func_file_conv "$1"
set x "$@" -Tp"$file"
shift
;;
*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
func_file_conv "$1" mingw
set x "$@" "$file"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -n "$linker_opts"; then
linker_opts="-link$linker_opts"
fi
exec "$@" $linker_opts
exit 1
}
eat=
case $1 in
'')
echo "$0: No command. Try '$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: compile [--help] [--version] PROGRAM [ARGS]
Wrapper for compilers which do not understand '-c -o'.
Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
arguments, and rename the output as expected.
If you are trying to build a whole package this is not the
right script to run: please start by reading the file 'INSTALL'.
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "compile $scriptversion"
exit $?
;;
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
func_cl_wrapper "$@" # Doesn't return...
;;
esac
ofile=
cfile=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as 'compile cc -o foo foo.c'.
# So we strip '-o arg' only if arg is an object.
eat=1
case $2 in
*.o | *.obj)
ofile=$2
;;
*)
set x "$@" -o "$2"
shift
;;
esac
;;
*.c)
cfile=$1
set x "$@" "$1"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -z "$ofile" || test -z "$cfile"; then
# If no '-o' option was seen then we might have been invoked from a
# pattern rule where we don't need one. That is ok -- this is a
# normal compilation that the losing compiler can handle. If no
# '.c' file was seen then we are probably linking. That is also
# ok.
exec "$@"
fi
# Name of file we expect compiler to create.
cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
# Create the lock directory.
# Note: use '[/\\:.-]' here to ensure that we don't use the same name
# that we are using for the .o file. Also, base the name on the expected
# object file name, since that is what matters with a parallel build.
lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
while true; do
if mkdir "$lockdir" >/dev/null 2>&1; then
break
fi
sleep 1
done
# FIXME: race condition here if user kills between mkdir and trap.
trap "rmdir '$lockdir'; exit 1" 1 2 15
# Run the compile.
"$@"
ret=$?
if test -f "$cofile"; then
test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
elif test -f "${cofile}bj"; then
test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
fi
rmdir "$lockdir"
exit $ret
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
This diff is collapsed.
AC_PREREQ(2.60)
AC_INIT(phonesim, 1.20)
AC_INIT(phonesim, 1.21)
AM_INIT_AUTOMAKE([foreign subdir-objects])
......@@ -11,6 +11,7 @@ AC_PREFIX_DEFAULT(/usr/local)
PKG_PROG_PKG_CONFIG
AC_PROG_CC
AC_PROG_CXX
AC_PROG_INSTALL
......
ofono-phonesim (1.20-2) UNRELEASED; urgency=medium
ofono-phonesim (1.21-1) UNRELEASED; urgency=medium
[ Jonny Lamb ]
* Remove myself from Uploaders.
-- Jonny Lamb <jonny@debian.org> Wed, 15 Jun 2016 12:19:37 +0100
[ Jonah Brüchert ]
* New upstream release 1.21
-- Jonah Brüchert <jbb@kaidan.im> Fri, 11 Jan 2019 10:53:48 +0100
ofono-phonesim (1.20-1) unstable; urgency=medium
......
Source: ofono-phonesim
Section: devel
Priority: optional
Maintainer: Debian Telepathy maintainers <pkg-telepathy-maintainers@lists.alioth.debian.org>
Uploaders: Hector Oron <zumbi@debian.org>
Build-Depends: debhelper (>= 5),
cdbs,
Section: devel
Priority: optional
Build-Depends: debhelper (>= 11),
pkg-config,
libqt4-dev
Standards-Version: 3.9.5
qtbase5-dev
Standards-Version: 4.3.0
Vcs-Browser: https://salsa.debian.org/telepathy-team/ofono-phonesim
Vcs-Git: https://salsa.debian.org/telepathy-team/ofono-phonesim.git
Homepage: http://www.ofono.org/
Vcs-Git: git://anonscm.debian.org/pkg-telepathy/ofono-phonesim.git
Vcs-Browser: http://anonscm.debian.org/cgit/pkg-telepathy/ofono-phonesim.git
Package: ofono-phonesim
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Depends: ${shlibs:Depends},
${misc:Depends}
Description: Modem emulator used by the oFono mobile telephony stack
oFono is a stack for mobile telephony devices on Linux. oFono supports
speaking to telephony devices through specific drivers, or with generic
......
From 535146c0becd1d430208bea6dd3384d6d5458bbd Mon Sep 17 00:00:00 2001
From: Simon Busch <morphis@gravedo.de>
Date: Wed, 26 Mar 2014 15:31:04 +0100
Subject: [PATCH] Port to qt5
Signed-off-by: Simon Busch <morphis@gravedo.de>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
Makefile.am | 2 +-
configure.ac | 6 +++---
src/control.cpp | 4 ++--
src/qsimcommand.cpp | 2 +-
src/qsmsmessage.cpp | 2 +-
5 files changed, 8 insertions(+), 8 deletions(-)
--- a/Makefile.am
+++ b/Makefile.am
@@ -46,7 +46,7 @@
src_phonesim_LDADD = $(QT_LIBS)
-AM_CXXFLAGS = -Wall $(QT_CFLAGS)
+AM_CXXFLAGS = -Wall $(QT_CFLAGS) -fPIC -fPIE
AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/src
--- a/configure.ac
+++ b/configure.ac
@@ -22,18 +22,18 @@
fi
])
-PKG_CHECK_MODULES(QT, QtCore QtGui QtXml QtNetwork QtScript QtDBus, dummy=yes,
+PKG_CHECK_MODULES(QT, Qt5Core Qt5Gui Qt5Xml Qt5Network Qt5Script Qt5DBus Qt5Widgets, dummy=yes,
AC_MSG_ERROR(Qt is required))
AC_SUBST(QT_CFLAGS)
AC_SUBST(QT_LIBS)
AC_MSG_CHECKING(for moc)
-MOC="`$PKG_CONFIG --variable=moc_location QtCore`"
+MOC="`$PKG_CONFIG --variable=host_bins Qt5Core`/moc"
AC_SUBST(MOC)
AC_MSG_RESULT($MOC)
AC_MSG_CHECKING(for uic)
-UIC="`$PKG_CONFIG --variable=uic_location QtCore`"
+UIC="`$PKG_CONFIG --variable=host_bins Qt5Core`/uic"
AC_SUBST(UIC)
AC_MSG_RESULT($UIC)
--- a/src/control.cpp
+++ b/src/control.cpp
@@ -22,7 +22,7 @@
#include <qslider.h>
#include <qcheckbox.h>
#include <qcombobox.h>
-#include <QtGui/qmessagebox.h>
+#include <qmessagebox.h>
#include <qfiledialog.h>
#include <Qt>
#include <qbuffer.h>
@@ -31,7 +31,7 @@
#include <QFileInfo>
#include <QFile>
#include <QDir>
-#include <QtGui/QHeaderView>
+#include <QHeaderView>
#define TWO_BYTE_MAX 65535
#define FOUR_CHAR 4
--- a/src/qsimcommand.cpp
+++ b/src/qsimcommand.cpp
@@ -3764,7 +3764,7 @@
QSimCommandPrivate *QSimCommand::dwrite()
{
// If we are the only user of the private object, return it as-is.
- if ( d->ref == 1 )
+ if ( d->ref.load() == 1 )
return d;
// Create a new private object and copy the current contents into it.
--- a/src/qsmsmessage.cpp
+++ b/src/qsmsmessage.cpp
@@ -365,7 +365,7 @@
QSMSMessagePrivate *QSMSMessage::dwrite()
{
// If we are the only user of the private object, return it as-is.
- if ( d->ref == 1 )
+ if ( d->ref.load() == 1 )
return d;
// Create a new private object and copy the current contents into it.
From 6a55811a6d6baac4f270901078611adb589b1aaf Mon Sep 17 00:00:00 2001
From: Martin Jansa <Martin.Jansa@gmail.com>
Date: Tue, 10 May 2016 16:45:13 +0200
Subject: [PATCH] Fix random build failure
uic and moc doesn't create output directory automatically and it could
be missing when uic is executed before gcc creates any object files as
src/*.o
OE @ ~/build/wpb/webos-ports/tmp-glibc/work/i586-webos-linux/phonesim/1.20-r0/build $ rm -rf src/
OE @ ~/build/wpb/webos-ports/tmp-glibc/work/i586-webos-linux/phonesim/1.20-r0/build $ /OE/build/wpb/webos-ports/tmp-glibc/sysroots/x86_64-linux/usr/bin/qt5/uic ../phonesim-1.20/src/controlbase.ui -o src/ui_controlbase.h
Could not create output file
Fixes phonesim randomly failing with:
OE @ ~/build/wpb/webos-ports/tmp-glibc/work/i586-webos-linux/phonesim/1.20-r0/build $ cat ../temp/log.do_compile
DEBUG: SITE files ['endian-little', 'bit-32', 'ix86-common', 'common-linux', 'common-glibc', 'i586-linux', 'common']
DEBUG: Executing shell function do_compile
NOTE: make -j 9
/OE/build/wpb/webos-ports/tmp-glibc/sysroots/x86_64-linux/usr/bin/qt5/uic ../phonesim-1.20/src/controlbase.ui -o src/ui_controlbase.h
/OE/build/wpb/webos-ports/tmp-glibc/sysroots/x86_64-linux/usr/bin/qt5/moc ../phonesim-1.20/src/control.h -o src/moc_control.cpp
/OE/build/wpb/webos-ports/tmp-glibc/sysroots/x86_64-linux/usr/bin/qt5/moc ../phonesim-1.20/src/phonesim.h -o src/moc_phonesim.cpp
/OE/build/wpb/webos-ports/tmp-glibc/sysroots/x86_64-linux/usr/bin/qt5/moc ../phonesim-1.20/src/hardwaremanipulator.h -o src/moc_hardwaremanipulator.cpp
/OE/build/wpb/webos-ports/tmp-glibc/sysroots/x86_64-linux/usr/bin/qt5/moc ../phonesim-1.20/src/callmanager.h -o src/moc_callmanager.cpp
/OE/build/wpb/webos-ports/tmp-glibc/sysroots/x86_64-linux/usr/bin/qt5/moc ../phonesim-1.20/src/simfilesystem.h -o src/moc_simfilesystem.cpp
/OE/build/wpb/webos-ports/tmp-glibc/sysroots/x86_64-linux/usr/bin/qt5/moc ../phonesim-1.20/src/simapplication.h -o src/moc_simapplication.cpp
Could not create output file
Makefile:977: recipe for target 'src/ui_controlbase.h' failed
make: *** [src/ui_controlbase.h] Error 1
make: *** Waiting for unfinished jobs....
WARNING: /OE/build/wpb/webos-ports/tmp-glibc/work/i586-webos-linux/phonesim/1.20-r0/temp/run.do_compile.3359:1 exit 1 from 'exit 1'
ERROR: oe_runmake failed
ERROR: Function failed: do_compile (log file is located at /OE/build/wpb/webos-ports/tmp-glibc/work/i586-webos-linux/phonesim/1.20-r0/temp/log.do_compile.3359)
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
Makefile.am | 2 ++
1 file changed, 2 insertions(+)
--- a/Makefile.am
+++ b/Makefile.am
@@ -67,6 +67,7 @@
QT_V_MOC_0 = @echo " MOC " $@;
src/moc_%.cpp: src/%.h
+ $(MKDIR_P) src
$(QT_V_MOC)$(MOC) $< -o $@
QT_V_UIC = $(QT_V_UIC_$(V))
@@ -74,4 +75,5 @@
QT_V_UIC_0 = @echo " UIC " $@;
src/ui_%.h: src/%.ui
+ $(MKDIR_P) src
$(QT_V_UIC)$(UIC) $< -o $@
From a3e579042c8bbe84a44b71dd1ff23d4f99337636 Mon Sep 17 00:00:00 2001
From: Martin Jansa <Martin.Jansa@gmail.com>
Date: Wed, 4 May 2016 15:05:47 +0200
Subject: [PATCH] configure.ac: use gnu++11 to fix build with Qt 5.7
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
configure.ac | 4 ++++
1 file changed, 4 insertions(+)
--- a/configure.ac
+++ b/configure.ac
@@ -24,6 +24,10 @@
PKG_CHECK_MODULES(QT, Qt5Core Qt5Gui Qt5Xml Qt5Network Qt5Script Qt5DBus Qt5Widgets, dummy=yes,
AC_MSG_ERROR(Qt is required))
+
+# Needed for Qt 5.7
+CXXFLAGS="$CXXFLAGS --std=gnu++11"
+
AC_SUBST(QT_CFLAGS)
AC_SUBST(QT_LIBS)
From 0862ec0b25a0a589a5dc58eda46290dd02dd24a4 Mon Sep 17 00:00:00 2001
From: Martin Jansa <Martin.Jansa@gmail.com>
Date: Thu, 2 Feb 2017 20:04:52 +0100
Subject: [PATCH] Fix build with Qt 5.8
../phonesim-1.20/src/qsmsmessage.cpp: In member function 'QCBSMessage QCBSDeliverMessage::unpack(QTextCodec*)':
../phonesim-1.20/src/qsmsmessage.cpp:2598:40: error: ambiguous overload for 'operator==' (operand types are 'QCharRef' and 'char')
text[len - 1] == '\0' ) ) {
~~~~~~~~~~~~~~^~~~~~~
In file included from ../phonesim-1.20/src/qsmsmessage.h:23:0,
from ../phonesim-1.20/src/qsmsmessage.cpp:22:
/OE/build/owpb/webos-ports/tmp-glibc/work/i586-webos-linux/phonesim/1.20-r0/recipe-sysroot/usr/include/qt5/QtCore/qstring.h:1632:13: note: candidate: bool operator==(QChar, const QStringRef&)
inline bool operator==(QChar lhs, const QStringRef &rhs) Q_DECL_NOTHROW
^~~~~~~~
/OE/build/owpb/webos-ports/tmp-glibc/work/i586-webos-linux/phonesim/1.20-r0/recipe-sysroot/usr/include/qt5/QtCore/qstring.h:1613:13: note: candidate: bool operator==(QChar, const QString&)
inline bool operator==(QChar lhs, const QString &rhs) Q_DECL_NOTHROW
^~~~~~~~
In file included from /OE/build/owpb/webos-ports/tmp-glibc/work/i586-webos-linux/phonesim/1.20-r0/recipe-sysroot/usr/include/qt5/QtCore/qstring.h:48:0,
from ../phonesim-1.20/src/qsmsmessage.h:23,
from ../phonesim-1.20/src/qsmsmessage.cpp:22:
/OE/build/owpb/webos-ports/tmp-glibc/work/i586-webos-linux/phonesim/1.20-r0/recipe-sysroot/usr/include/qt5/QtCore/qchar.h:573:30: note: candidate: constexpr bool operator==(QChar, QChar)
Q_DECL_CONSTEXPR inline bool operator==(QChar c1, QChar c2) Q_DECL_NOTHROW { return c1.ucs == c2.ucs; }
^~~~~~~~
make: *** [Makefile:583: src/qsmsmessage.o] Error 1
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
src/qsmsmessage.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/src/qsmsmessage.cpp
+++ b/src/qsmsmessage.cpp
@@ -2594,8 +2594,8 @@
QString text = userData
( (QSMSDataCodingScheme)scheme, codec, headers, false, true );
len = text.length();
- while ( len > 0 && ( text[len - 1] == '\r' || text[len - 1] == '\n' ||
- text[len - 1] == '\0' ) ) {
+ while ( len > 0 && ( text.at(len - 1) == QChar ('\r') || text.at(len - 1) == QChar ('\n') ||
+ text.at(len - 1) == QChar ('\0') ) ) {
--len;
}
m.setText( text.left( len ) );
From a3c912dd24632cf6bb811d3fafd3f48957c8006c Mon Sep 17 00:00:00 2001
From: Martin Jansa <Martin.Jansa@gmail.com>
Date: Wed, 26 Sep 2018 14:36:38 +0000
Subject: [PATCH] configure.ac: fix checking for host_bins variable
$PKG_CONFIG --variable=host_bins Qt5Core
returns absolute path without the prefix to sysroot when cross compiling
Before https://github.com/meta-qt5/meta-qt5/commit/b716195f609de6547cfdfadfd4fd25292a6bbf09
this will return:
pkg-config --variable=host_bins Qt5Core
/usr/bin/qt5
which is bad, but is replaced with ${OE_QMAKE_PATH_EXTERNAL_HOST_BINS}
in the generated Makefile after configure as in:
https://github.com/webOS-ports/meta-webos-ports/blob/e4283e7906e3fbd2e0bcffcd317d2d1a9e2ebcd5/meta-luneos/recipes-connectivity/ofono/phonesim_1.20.bb#L22
but with empty QT_DIR_NAME the returned value is:
pkg-config --variable=host_bins Qt5Core
/usr/bin
and these 2 replaces fail, causing
make: /usr/bin/uic: Command not found
Use PKG_CHECK_VAR for host_bins which we can override with
OE_QMAKE_PATH_EXTERNAL_HOST_BINS from the environment and
the generated Mafile will be correct right away.
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
configure.ac | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
--- a/configure.ac
+++ b/configure.ac
@@ -31,13 +31,18 @@
AC_SUBST(QT_CFLAGS)
AC_SUBST(QT_LIBS)
+AC_MSG_CHECKING(for Qt5 host_bins)
+PKG_CHECK_VAR(QMAKE_PATH_HOST_BINS, Qt5Core, host_bins)
+AC_SUBST(QMAKE_PATH_HOST_BINS)
+AC_MSG_RESULT($QMAKE_PATH_HOST_BINS)
+
AC_MSG_CHECKING(for moc)
-MOC="`$PKG_CONFIG --variable=host_bins Qt5Core`/moc"
+MOC="$QMAKE_PATH_HOST_BINS/moc"
AC_SUBST(MOC)
AC_MSG_RESULT($MOC)
AC_MSG_CHECKING(for uic)
-UIC="`$PKG_CONFIG --variable=host_bins Qt5Core`/uic"
+UIC="$QMAKE_PATH_HOST_BINS/uic"
AC_SUBST(UIC)
AC_MSG_RESULT($UIC)
Description: Make Qt detect fPIC flag correctly
Author: Jonah Brüchert <jbb@kaidan.im>
--- a/Makefile.am
+++ b/Makefile.am
@@ -46,7 +46,7 @@
src_phonesim_LDADD = $(QT_LIBS)
-AM_CXXFLAGS = -Wall $(QT_CFLAGS) -fPIC -fPIE
+AM_CXXFLAGS = -Wall $(QT_CFLAGS) -fPIC
AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/src
0001-Port-to-qt5.patch
0002-Fix-random-build-failure.patch
0003-configure.ac-use-gnu-11-to-fix-build-with-Qt-5.7.patch
0004-Fix-build-with-Qt-5.8.patch
0005-configure.ac-fix-checking-for-host_bins-variable.patch
0006-Fix-fPIC.patch
This diff is collapsed.
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2011-01-19.21; # UTC
scriptversion=2011-11-20.07; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
......@@ -35,7 +35,7 @@ scriptversion=2011-01-19.21; # UTC
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# 'make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
......@@ -156,7 +156,7 @@ while test $# -ne 0; do
-s) stripcmd=$stripprog;;
-t) dst_arg=$2
# Protect names problematic for `test' and other utilities.
# Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
......@@ -190,7 +190,7 @@ if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
fi
shift # arg
dst_arg=$arg
# Protect names problematic for `test' and other utilities.
# Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
......@@ -202,7 +202,7 @@ if test $# -eq 0; then
echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call `install-sh -d' without argument.
# It's OK to call 'install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
......@@ -240,7 +240,7 @@ fi
for src
do
# Protect names problematic for `test' and other utilities.
# Protect names problematic for 'test' and other utilities.
case $src in
-* | [=\(\)!]) src=./$src;;
esac
......@@ -345,34 +345,41 @@ do
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
# $RANDOM is not portable (e.g. dash); use it when possible to
# lower collision chance
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0
# As "mkdir -p" follows symlinks and we work in /tmp possibly; so
# create the $tmpdir first (and fail if unsuccessful) to make sure
# that nobody tries to guess the $tmpdir name.
if (umask $mkdir_umask &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
$mkdirprog $mkdir_mode "$tmpdir" &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writeable bit of parent directory when it shouldn't.
# other-writable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"`
test_tmpdir="$tmpdir/a"
ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
$mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/d" "$tmpdir"
rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
fi
trap '' 0;;
esac;;
......
This diff is collapsed.
/****************************************************************************
**
** This file is part of the Qt Extended Opensource Package.
**
** Copyright (C) 2017 Intel Corporation. All rights reserved.
**
** This file may be used under the terms of the GNU General Public License
** version 2.0 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 GNU General Public
** Licensing requirements will be met:
** http://www.fsf.org/licensing/licenses/info/GPLv2.html.
**
**
****************************************************************************/
#define _GNU_SOURCE
#include <unistd.h>
#include <sys/socket.h>
#include <alloca.h>
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#include "aes.h"
#ifndef AF_ALG
#define AF_ALG 38
#define PF_ALG AF_ALG
#endif
#ifndef HAVE_LINUX_IF_ALG_H
struct sockaddr_alg {
uint16_t salg_family;
uint8_t salg_type[14];
uint32_t salg_feat;
uint32_t salg_mask;
uint8_t salg_name[64];
};
#define ALG_SET_KEY 1
#define ALG_SET_OP 3
#define ALG_OP_ENCRYPT 1
#else
#include <linux/if_alg.h>
#endif
#ifndef SOL_ALG
#define SOL_ALG 279
#endif
bool aes_encrypt(const uint8_t *key, size_t key_len, const uint8_t *in,
uint8_t *out, size_t len)
{
uint32_t op = ALG_OP_ENCRYPT;
char *msg_buf;
size_t msg_size;
struct msghdr msg;
struct cmsghdr *c_msg;
ssize_t result;
struct sockaddr_alg sa = {
.salg_family = AF_ALG,
.salg_type = "skcipher",
.salg_name = "ecb(aes)"
};
struct iovec iov = {
.iov_base = (void *) in,
.iov_len = len
};
int sock = socket(AF_ALG, SOCK_SEQPACKET | SOCK_CLOEXEC, 0);
if (bind(sock, (struct sockaddr *)&sa, sizeof(sa))) {
close(sock);
return 0;
}
if (setsockopt(sock, SOL_ALG, ALG_SET_KEY, key, key_len)) {
close(sock);
return 0;
}
int cipher = accept4(sock, NULL, 0, SOCK_CLOEXEC);
if (cipher == -1) {
close(sock);
return 0;
}
close(sock);
msg_size = CMSG_SPACE(sizeof(op));
msg_buf = alloca(msg_size);
memset(msg_buf, 0, msg_size);
memset(&msg, 0, sizeof(msg));
msg.msg_iov = &iov;
msg.msg_control = msg_buf;
msg.msg_controllen = msg_size;
msg.msg_iovlen = 1;
c_msg = CMSG_FIRSTHDR(&msg);
c_msg->cmsg_level = SOL_ALG;
c_msg->cmsg_type = ALG_SET_OP;
c_msg->cmsg_len = CMSG_LEN(sizeof(op));
memcpy(CMSG_DATA(c_msg), &op, sizeof(op));
result = sendmsg(cipher, &msg, 0);
if (result < 0) {
return 0;
}
result = read(cipher, out, len);
if (result < 0) {
return 0;
}
return 1;
}
/****************************************************************************
**
** This file is part of the Qt Extended Opensource Package.
**
** Copyright (C) 2017 Intel Corporation. All rights reserved.
**
** This file may be used under the terms of the GNU General Public License
** version 2.0 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 GNU General Public
** Licensing requirements will be met:
** http://www.fsf.org/licensing/licenses/info/GPLv2.html.
**
**
****************************************************************************/
#ifndef CIPHER_H
#define CIPHER_H
#ifdef __cplusplus
extern "C" {
#endif
bool aes_encrypt(const uint8_t *key, size_t key_len, const uint8_t *in,
uint8_t *out, size_t len);
#ifdef __cplusplus
}
#endif
#endif /* CIPHER_H */
This diff is collapsed.
/****************************************************************************
**
** This file is part of the Qt Extended Opensource Package.
**
** Copyright (C) 2017 Intel Corporation. All rights reserved.
**
** This file may be used under the terms of the GNU General Public License
** version 2.0 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 GNU General Public
** Licensing requirements will be met:
** http://www.fsf.org/licensing/licenses/info/GPLv2.html.
**
**
****************************************************************************/
#ifndef AIDAPPLICATION_H
#define AIDAPPLICATION_H
#include "phonesim.h"
#define MAX_LOGICAL_CHANNELS 4
/*
* Some common errors
*/
enum CmdType {
CMD_TYPE_GSM_AUTH = 0,
CMD_TYPE_UMTS_AUTH = 1,
CMD_TYPE_UNSUPPORTED_CLS = 0x6E00,
CMD_TYPE_UNSUPPORTED_INS = 0x6D00,
CMD_TYPE_INCORRECT_P2_P1 = 0x6A86,
CMD_TYPE_WRONG_LENGTH = 0x6700,
CMD_TYPE_APP_ERROR = 0x9862,
CMD_TYPE_UNKNOWN = 0xFFFF
};
/*
* Class for representing a single AID
*/
class AidApplication : public QObject
{
Q_OBJECT
public:
AidApplication( QObject *parent, SimXmlNode& n );
~AidApplication();
QString getAid() { return aid; };
QString getType() { return type; };
SimFileSystem *fs;
signals:
// Send a response to a command.
void send( const QString& line );
private:
QString aid;
QString type;
};
/*
* Wrapper for containing all AIDs on the SIM
*/
class AidAppWrapper : public QObject
{
Q_OBJECT
public:
AidAppWrapper( SimRules *r, QList<AidApplication *> apps, SimAuth *auth = NULL );
~AidAppWrapper();
bool command( const QString& cmd );
//signals:
// Send a response to a command.
// void send( const QString& line );
private:
QList<AidApplication *> applications;
QMap<int, AidApplication*> sessions;
int session_start;
SimRules *rules;
SimAuth *auth;
enum CmdType checkCommand( AidApplication *app, QString command);
};
#endif
This diff is collapsed.
/****************************************************************************
**
** This file is part of the Qt Extended Opensource Package.
**
** Copyright (C) 2017 Intel Corporation. All rights reserved.
**
** This file may be used under the terms of the GNU General Public License
** version 2.0 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 GNU General Public
** Licensing requirements will be met:
** http://www.fsf.org/licensing/licenses/info/GPLv2.html.
**
**
****************************************************************************/
#ifndef COMP128_H
#define COMP128_H
#ifdef __cplusplus
extern "C" {
#endif
void comp128(const uint8_t *ki, const uint8_t *rand, uint8_t *sres,
uint8_t *kc);
#ifdef __cplusplus
}
#endif
#endif /* COMP128_H */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.