Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ You can install everything on your local machine, or (the way I do) use an Ubunt
1. Execute `./prepare-build-system`
2. If everything goes well you should see all the compiled libraries (opus, openh264, openssl) in the <b>output</b> folder.

## Build PJSIP using Docker
1. Download JDK from the Oracle server and put it the the root directory (i.e. jdk-8u211-linux-x64.tar.gz)
2. Change JDK_DIR and JDK_TAR args of the build.dockerfile file according to the downloaded JDK file
3. Run ./build_with_docker.sh to build the lib

## Build PJSIP
After you have successfully set up everything, to build PJSIP execute `./build`

Expand Down
33 changes: 33 additions & 0 deletions build.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FROM ubuntu:latest as jdk_image

ARG JDK_DIR=jdk1.8.0_211
ARG JDK_TAR=jdk-8u211-linux-x64.tar.gz

ENV JDK_DIR $JDK_DIR
ENV JDK_TAR $JDK_TAR

ENV PATH="/usr/lib/jvm/jdk1.8.0_211/bin:/usr/lib/jvm/jdk1.8.0_211/jre/bin:$PATH"
ENV J2SDKDIR="/usr/lib/jvm/jdk1.8.0_211"
ENV J2REDIR="/usr/lib/jvm/jdk1.8.0_211/jre"
ENV JAVA_HOME="/usr/lib/jvm/jdk1.8.0_211"

WORKDIR /home
COPY $JDK_TAR /home

RUN apt-get update && \
apt-get install -y sudo && \
apt-get install -y software-properties-common && \
mkdir -p /usr/lib/jvm && \
tar xzvf /home/jdk-8u211-linux-x64.tar.gz -C /usr/lib/jvm && \
update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/$JDK_DIR/bin/java" 0 && \
update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/$JDK_DIR/bin/javac" 0 && \
update-alternatives --set java /usr/lib/jvm/$JDK_DIR/bin/java && \
update-alternatives --set javac /usr/lib/jvm/$JDK_DIR/bin/javac

FROM jdk_image

WORKDIR /home
COPY . /home/

RUN ./prepare-build-system && \
./build
6 changes: 6 additions & 0 deletions build_with_docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

docker build --tag pjsip_android:latest --file ./build.dockerfile .
CID=$(docker create pjsip_android:latest)
docker cp ${CID}:/home/output/pjsip-build-output .
docker rm ${CID}
6 changes: 3 additions & 3 deletions config.conf
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ OPENSSL_TARGET_NDK_LEVEL=23
###############################################################################

# OPENH264 Version to download
OPENH264_VERSION=1.6.0
OPENH264_VERSION=1.8.0

# The URL from which to download OpenH264 sources tag
OPENH264_DOWNLOAD_URL="https://github.com/cisco/openh264/archive/v$OPENH264_VERSION.tar.gz"
Expand Down Expand Up @@ -188,10 +188,10 @@ DOWNLOAD_LIBYUV=0
DOWNLOAD_OPUS=1

# Remove Tools directory after build
REMOVE_TOOLS=1
REMOVE_TOOLS=0

# Set permission on output directory -- FOR DOCKER USE
SET_PERMISSIONS=1
SET_PERMISSIONS=0

# Set the name of the user on the host machine
OWNER="aenon"
2 changes: 1 addition & 1 deletion openh264-build-target-archs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ do

elif [ "$arch" == "x86" ]
then
ARGS="${ARGS}x86"
ARGS="${ARGS}x86 ENABLEPIC=Yes"

elif [ "$arch" == "x86_64" ]
then
Expand Down
4 changes: 2 additions & 2 deletions prepare-build-system
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ then
# Setup Java 8
sudo add-apt-repository -y ppa:webupd8team/java
sudo apt-get update
sudo apt-get purge -y openjdk*
#sudo apt-get purge -y openjdk*
echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections
echo debconf shared/accepted-oracle-license-v1-1 seen true | sudo debconf-set-selections
sudo apt-get -y install oracle-java8-installer ant
sudo apt-get -y install ant

sudo apt-get install -y unzip git

Expand Down