[CICN-21] build for arm64 ubuntu 18 15/22615/24
authorAngelo Mantellini <[email protected]>
Wed, 9 Oct 2019 08:17:00 +0000 (10:17 +0200)
committerAngelo Mantellini <[email protected]>
Mon, 14 Oct 2019 13:49:08 +0000 (15:49 +0200)
Signed-off-by: Angelo Mantellini <[email protected]>
Change-Id: I9895cbfdc1c32a46d67f40310ef08c8b66b02664

libparc/parc/algol/parc_DisplayIndented.c
libparc/parc/algol/parc_Object.c
libparc/parc/algol/parc_Time.c
libparc/parc/algol/parc_URI.c
libparc/parc/logging/parc_Log.c
libparc/scripts/build-package.sh

index a17e7f0..a5b9098 100644 (file)
@@ -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;
index 422a97f..4f2b335 100644 (file)
@@ -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;
index 8f292c1..7ed9ef0 100644 (file)
 #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
index 94f7498..bac6c5f 100644 (file)
@@ -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;
index 7034f5e..8b76cff 100644 (file)
@@ -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;
index b06fecb..23941b3 100644 (file)
@@ -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