aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAngelo Mantellini <manangel@cisco.com>2019-10-09 10:17:00 +0200
committerAngelo Mantellini <manangel@cisco.com>2019-10-14 15:49:08 +0200
commite7a7324c575f9d0807dc32ca8ae95273f4615831 (patch)
tree899e87bbac52cb04e293af38bcdee55b079b5636
parente739ca2affa1237089857b5e1c87afeac25449aa (diff)
[CICN-21] build for arm64 ubuntu 18
Signed-off-by: Angelo Mantellini <manangel@cisco.com> Change-Id: I9895cbfdc1c32a46d67f40310ef08c8b66b02664
-rw-r--r--libparc/parc/algol/parc_DisplayIndented.c3
-rw-r--r--libparc/parc/algol/parc_Object.c2
-rw-r--r--libparc/parc/algol/parc_Time.c15
-rw-r--r--libparc/parc/algol/parc_URI.c3
-rw-r--r--libparc/parc/logging/parc_Log.c3
-rw-r--r--libparc/scripts/build-package.sh55
6 files changed, 44 insertions, 37 deletions
diff --git a/libparc/parc/algol/parc_DisplayIndented.c b/libparc/parc/algol/parc_DisplayIndented.c
index a17e7f04..a5b9098f 100644
--- a/libparc/parc/algol/parc_DisplayIndented.c
+++ b/libparc/parc/algol/parc_DisplayIndented.c
@@ -27,6 +27,9 @@
#include <parc/assert/parc_Assert.h>
#include <parc/algol/parc_DisplayIndented.h>
+int asprintf(char **strp, const char *fmt, ...);
+int vasprintf(char **strp, const char *fmt, va_list ap);
+
static char *_spaces = " ";
static size_t _indentationFactor = 2;
diff --git a/libparc/parc/algol/parc_Object.c b/libparc/parc/algol/parc_Object.c
index 422a97f7..4f2b3359 100644
--- a/libparc/parc/algol/parc_Object.c
+++ b/libparc/parc/algol/parc_Object.c
@@ -36,6 +36,8 @@
#include <parc/algol/parc_Hash.h>
#include <parc/concurrent/parc_AtomicUint64.h>
+int asprintf(char **strp, const char *fmt, ...);
+
typedef struct parc_object_locking {
pthread_mutex_t lock;
pthread_cond_t notification;
diff --git a/libparc/parc/algol/parc_Time.c b/libparc/parc/algol/parc_Time.c
index 8f292c1b..7ed9ef09 100644
--- a/libparc/parc/algol/parc_Time.c
+++ b/libparc/parc/algol/parc_Time.c
@@ -17,6 +17,13 @@
#include <sys/time.h>
#endif
+#ifdef __linux__
+#if __GNUC__ >= 8
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-truncation"
+#endif
+#endif
+
#include <config.h>
#include <stdio.h>
#include <string.h>
@@ -26,6 +33,8 @@
#include <parc/algol/parc_Time.h>
#include <parc/algol/parc_Memory.h>
+int asprintf(char **strp, const char *fmt, ...);
+
char *
parcTime_TimevalAsString(struct timeval timeval)
{
@@ -169,3 +178,9 @@ parcTime_NowNanoseconds(void)
uint64_t result = timeval.tv_sec * 1000000000 + timeval.tv_usec * 1000;
return result;
}
+
+#ifdef __linux__
+#if __GNUC__ >= 8
+#pragma GCC diagnostic pop
+#endif
+#endif
diff --git a/libparc/parc/algol/parc_URI.c b/libparc/parc/algol/parc_URI.c
index 94f74981..bac6c5f6 100644
--- a/libparc/parc/algol/parc_URI.c
+++ b/libparc/parc/algol/parc_URI.c
@@ -45,6 +45,9 @@ char *gen_delims = ":/?#[]@";
#define isReserved(c) (isGenDelims(c) || isSubDelims(c))
#define isPchar(c) (isUnreserved(c) || isSubDelims(c) || c == ':' || c == '@')
+
+int vasprintf(char **strp, const char *fmt, va_list ap);
+
struct parc_uri {
char *scheme;
char *authority;
diff --git a/libparc/parc/logging/parc_Log.c b/libparc/parc/logging/parc_Log.c
index 7034f5ea..8b76cffe 100644
--- a/libparc/parc/logging/parc_Log.c
+++ b/libparc/parc/logging/parc_Log.c
@@ -28,6 +28,9 @@
#include <parc/logging/parc_Log.h>
#include <parc/logging/parc_LogReporter.h>
+
+int vasprintf(char **strp, const char *fmt, va_list ap);
+
struct PARCLog {
char *hostName;
char *applicationName;
diff --git a/libparc/scripts/build-package.sh b/libparc/scripts/build-package.sh
index b06fecb8..23941b3c 100644
--- a/libparc/scripts/build-package.sh
+++ b/libparc/scripts/build-package.sh
@@ -15,6 +15,11 @@ BUILD_TOOLS_GROUP_CENTOS="'Development Tools'"
LIBSSL_LIBEVENT_CENTOS="libevent-devel openssl-devel"
DEPS_CENTOS="$LIBSSL_LIBEVENT_CENTOS"
+PACKAGECLOUD_RELEASE_REPO_DEB="https://packagecloud.io/install/repositories/fdio/release/script.deb.sh"
+PACKAGECLOUD_RELEASE_REPO_RPM="https://packagecloud.io/install/repositories/fdio/release/script.rpm.sh"
+
+LATEST_EPEL_REPO="http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm"
+
update_cmake_repo() {
cat /etc/resolv.conf
@@ -41,7 +46,7 @@ update_qt_repo() {
exit -1
fi
- sudo ${apt_get} install -y --allow-unauthenticated software-properties-common
+ sudo DEBIAN_FRONTEND=noninteractive ${apt_get} install -y --allow-unauthenticated software-properties-common
sudo add-apt-repository --yes ppa:beineri/opt-qt571-$DISTRIBUTION_CODENAME
wget -q -O - http://archive.getdeb.net/getdeb-archive.key | sudo apt-key add -
@@ -63,40 +68,12 @@ update_fdio_repo() {
REPO_VPP_URL=""
if [ "$DISTRIB_ID" == "Ubuntu" ]; then
- if [ "$DISTRIB_CODENAME" == "xenial" ]; then
- REPO_VPP_URL="${NEXUS_PROXY}/content/repositories/fd.io.stable.1701.ubuntu.xenial.main/"
- REPO=${REPO_NAME:-"master.ubuntu.xenial.main"}
- REPO_CICN_URL="${NEXUS_PROXY}/content/repositories/fd.io.${REPO}"
- elif [ "$DISTRIB_CODENAME" == "bionic" ]; then
- REPO_VPP_URL="${NEXUS_PROXY}/content/repositories/fd.io.stable.1701.ubuntu.bionic.main/"
- REPO=${REPO_NAME:-"master.ubuntu.bionic.main"}
- REPO_CICN_URL="${NEXUS_PROXY}/content/repositories/fd.io.${REPO}"
- else
- echo "Distribution $DISTRIB_CODENAME is not supported"
- exit -1
- fi
-
- echo "deb ${REPO_VPP_URL} ./" | sudo tee /etc/apt/sources.list.d/99fd.io.list
- echo "deb ${REPO_CICN_URL} ./" | sudo tee /etc/apt/sources.list.d/99fd.io.master.list
+ curl -s ${PACKAGECLOUD_RELEASE_REPO_DEB} | sudo bash
elif [ "$DISTRIB_ID" == "CentOS" ]; then
- REPO_VPP_URL="${NEXUS_PROXY}/content/repositories/fd.io.centos7/"
- REPO=${REPO_NAME:-"master.centos7"}
- REPO_CICN_URL="${NEXUS_PROXY}/content/repositories/fd.io.${REPO}"
-
- sudo cat << EOF > fdio.repo
-[fdio-vpp-master]
-name=fd.io master branch latest merge
-baseurl=${REPO_VPP_URL}
-enabled=1
-gpgcheck=0
-
-[fdio-cicn-master]
-name=fd.io master branch latest merge
-baseurl=${REPO_CICN_URL}
-enabled=1
-gpgcheck=0
-EOF
- sudo mv fdio.repo /etc/yum.repos.d/fdio.repo
+ curl -s ${PACKAGECLOUD_RELEASE_REPO_RPM} | sudo bash
+ curl ${LATEST_EPEL_REPO} > epel-release-latest-7.noarch.rpm
+ rpm -ivh epel-release-latest-7.noarch.rpm || true
+ rm epel-release-latest-7.noarch.rpm
else
echo "Distribution $DISTRIB_CODENAME is not supported"
exit -1
@@ -106,9 +83,13 @@ EOF
setup() {
DISTRIB_ID=$1
+
DISTRIB_CODENAME=$2
- update_cmake_repo
+ ARCH=`uname -m`
+ if [ "$ARCH" == "x86_64" ] || [ "$ARCH" == "x86" ]; then
+ update_cmake_repo
+ fi
update_fdio_repo $DISTRIB_ID $DISTRIB_CODENAME
@@ -158,11 +139,11 @@ build_package() {
echo DISTRIB_CODENAME: $DISTRIB_CODENAME
echo DISTRIB_DESCRIPTION: $DISTRIB_DESCRIPTION
- setup $DISTRIB_ID $DISTRIB_CODENAME
+ setup $DISTRIB_ID $DISTRIB_CODENAME $ARCHITECTURE
# Install package dependencies
if [ $DISTRIB_ID == "Ubuntu" ]; then
- echo $BUILD_TOOLS_UBUNTU $DEPS_UBUNTU | xargs sudo ${apt_get} install -y --allow-unauthenticated
+ echo $BUILD_TOOLS_UBUNTU $DEPS_UBUNTU | xargs sudo DEBIAN_FRONTEND=noninteractive ${apt_get} install -y --allow-unauthenticated
elif [ $DISTRIB_ID == "CentOS" ]; then
echo $BUILD_TOOLS_GROUP_CENTOS | xargs sudo yum groupinstall -y --nogpgcheck
echo $DEPS_CENTOS | xargs sudo yum install -y --nogpgcheck || true