Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Ewout ter Hoeven
VLC-Android
Commits
c100b387
Commit
c100b387
authored
Feb 04, 2015
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move vlc compilation to compile-libvlc.sh
parent
0239358d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
98 additions
and
26 deletions
+98
-26
compile-libvlc.sh
compile-libvlc.sh
+89
-2
compile.sh
compile.sh
+9
-24
No files found.
compile-libvlc.sh
View file @
c100b387
#!/bin/sh
RELEASE
=
0
if
[
-z
"
$ANDROID_NDK
"
]
;
then
echo
"Please set the ANDROID_NDK environment variable with its path."
exit
1
...
...
@@ -16,6 +18,57 @@ if [ -z "$ANDROID_API" ];then
exit
1
fi
for
i
in
${
@
}
;
do
case
"
$i
"
in
release|--release
)
RELEASE
=
1
;;
*
)
;;
esac
done
# Set up ABI variables
if
[
${
ANDROID_ABI
}
=
"x86"
]
;
then
TARGET_TUPLE
=
"i686-linux-android"
PATH_HOST
=
"x86"
HAVE_X86
=
1
PLATFORM_SHORT_ARCH
=
"x86"
elif
[
${
ANDROID_ABI
}
=
"x86_64"
]
;
then
TARGET_TUPLE
=
"x86_64-linux-android"
PATH_HOST
=
"x86_64"
HAVE_X86
=
1
HAVE_64
=
1
PLATFORM_SHORT_ARCH
=
"x86_64"
elif
[
${
ANDROID_ABI
}
=
"mips"
]
;
then
TARGET_TUPLE
=
"mipsel-linux-android"
PATH_HOST
=
$TARGET_TUPLE
HAVE_MIPS
=
1
PLATFORM_SHORT_ARCH
=
"mips"
elif
[
${
ANDROID_ABI
}
=
"arm64-v8a"
]
;
then
TARGET_TUPLE
=
"aarch64-linux-android"
PATH_HOST
=
$TARGET_TUPLE
HAVE_ARM
=
1
HAVE_64
=
1
PLATFORM_SHORT_ARCH
=
"arm64"
else
TARGET_TUPLE
=
"arm-linux-androideabi"
PATH_HOST
=
$TARGET_TUPLE
HAVE_ARM
=
1
PLATFORM_SHORT_ARCH
=
"arm"
fi
# Make in //
if
[
-z
"
$MAKEFLAGS
"
]
;
then
UNAMES
=
$(
uname
-s
)
MAKEFLAGS
=
if
which
nproc
>
/dev/null
;
then
MAKEFLAGS
=
-j
`
nproc
`
elif
[
"
$UNAMES
"
==
"Darwin"
]
&&
which sysctl
>
/dev/null
;
then
MAKEFLAGS
=
-j
`
sysctl
-n
machdep.cpu.thread_count
`
fi
fi
VLC_SOURCEDIR
=
..
CFLAGS
=
"-g -O2 -fstrict-aliasing -funsafe-math-optimizations"
...
...
@@ -39,8 +92,35 @@ SYSROOT=$ANDROID_NDK/platforms/$ANDROID_API/arch-$PLATFORM_SHORT_ARCH
ANDROID_BIN
=
`
echo
$ANDROID_NDK
/toolchains/
${
PATH_HOST
}
-
${
GCCVER
}
/prebuilt/
\`
uname
|tr A-Z a-z
\`
-
*
/bin/
`
CROSS_COMPILE
=
${
ANDROID_BIN
}
/
${
TARGET_TUPLE
}
-
# Release or not?
if
[
"
$RELEASE
"
=
1
]
;
then
OPTS
=
""
EXTRA_CFLAGS
=
" -DNDEBUG "
else
OPTS
=
"--enable-debug"
fi
#############
# BOOTSTRAP #
#############
if
[
!
-f
config.h
]
;
then
echo
"Bootstraping"
./bootstrap
fi
###################
# BUILD DIRECTORY #
###################
mkdir
-p
build-android-
${
TARGET_TUPLE
}
&&
cd
build-android-
${
TARGET_TUPLE
}
#############
# CONFIGURE #
#############
CPPFLAGS
=
"
$CPPFLAGS
"
\
CFLAGS
=
"
$CFLAGS
${
VLC_EXTRA_CFLAGS
}
"
\
CFLAGS
=
"
$CFLAGS
${
VLC_EXTRA_CFLAGS
}
${
EXTRA_CFLAGS
}
"
\
CXXFLAGS
=
"
$CFLAGS
"
\
LDFLAGS
=
"
$LDFLAGS
"
\
CC
=
"
${
CROSS_COMPILE
}
gcc --sysroot=
${
SYSROOT
}
"
\
...
...
@@ -112,7 +192,7 @@ sh $VLC_SOURCEDIR/configure --host=$TARGET_TUPLE --build=x86_64-unknown-linux $E
--disable-faad
\
--disable-x264
\
--disable-schroedinger
--disable-dirac
\
$
*
$
OPTS
# ANDROID NDK FIXUP (BLAME GOOGLE)
config_undef
()
...
...
@@ -148,3 +228,10 @@ if [ ${ANDROID_API} = "android-21" ] ; then
fi
# END OF ANDROID NDK FIXUP
############
# BUILDING #
############
echo
"Building"
make
$MAKEFLAGS
compile.sh
View file @
c100b387
...
...
@@ -313,14 +313,6 @@ cd contrib/contrib-android-${TARGET_TUPLE}
# We append -marm to the CFLAGS of these libs to disable thumb mode
[
${
ANDROID_ABI
}
=
"armeabi-v7a"
]
&&
echo
"NOTHUMB := -marm"
>>
config.mak
# Release or not?
if
[
"
$RELEASE
"
=
1
]
;
then
OPTS
=
""
EXTRA_CFLAGS
=
"
${
EXTRA_CFLAGS
}
-DNDEBUG "
else
OPTS
=
"--enable-debug"
fi
echo
"EXTRA_CFLAGS= -g
${
EXTRA_CFLAGS
}
"
>>
config.mak
echo
"EXTRA_LDFLAGS=
${
EXTRA_LDFLAGS
}
"
>>
config.mak
export
VLC_EXTRA_CFLAGS
=
"
${
EXTRA_CFLAGS
}
"
...
...
@@ -336,7 +328,15 @@ make $MAKEFLAGS
############
# Make VLC #
############
cd
../..
&&
mkdir
-p
build-android-
${
TARGET_TUPLE
}
&&
cd
build-android-
${
TARGET_TUPLE
}
cd
../..
echo
"Configuring"
${
ANDROID_PATH
}
/compile-libvlc.sh
$*
####################################
# VLC android UI and specific code
####################################
echo
"Building VLC for Android"
cd
../../
if
[
"
$JNI
"
=
1
]
;
then
CLEAN
=
"jniclean"
...
...
@@ -345,21 +345,6 @@ else
CLEAN
=
"distclean"
TARGET
=
fi
if
[
!
-f
config.h
]
;
then
echo
"Bootstraping"
../bootstrap
echo
"Configuring"
${
ANDROID_PATH
}
/compile-libvlc.sh
$OPTS
fi
echo
"Building"
make
$MAKEFLAGS
####################################
# VLC android UI and specific code
####################################
echo
"Building VLC for Android"
cd
../../
export
ANDROID_SYS_HEADERS
=
${
PWD
}
/android-headers
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment