Repository navigation
Expand file tree
/
Copy pathbuild-ncurses-remaining.sh
More file actions
executable file
·73 lines (59 loc) · 2.13 KB
/
Copy pathbuild-ncurses-remaining.sh
File metadata and controls
executable file
·73 lines (59 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/bash
set -e
export ANDROID_NDK_HOME="/opt/homebrew/share/android-ndk"
export ANDROID_NDK_ROOT="$ANDROID_NDK_HOME"
export TOOLCHAIN=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/darwin-x86_64
export API=24
BUILD_DIR="/Users/jyo/projects/ai/mosh-android"
SRC_DIR="$BUILD_DIR/src/ncurses-6.4"
OUTPUT_DIR="$BUILD_DIR/output"
# Create symlinks for arm64-v8a since it's already built
cd "$OUTPUT_DIR/arm64-v8a/ncurses/lib"
ln -sf libncursesw.a libncurses.a 2>/dev/null || true
cd "$OUTPUT_DIR/arm64-v8a/ncurses/include"
ln -sf ncursesw ncurses 2>/dev/null || true
build_ncurses() {
local ARCH=$1
local TARGET=$2
local HOST=$3
echo "=========================================="
echo "Building ncurses for $ARCH"
echo "=========================================="
cd "$SRC_DIR"
make distclean 2>/dev/null || true
export CC=$TOOLCHAIN/bin/${TARGET}${API}-clang
export CXX=$TOOLCHAIN/bin/${TARGET}${API}-clang++
export AR=$TOOLCHAIN/bin/llvm-ar
export RANLIB=$TOOLCHAIN/bin/llvm-ranlib
export STRIP=$TOOLCHAIN/bin/llvm-strip
export PATH=$TOOLCHAIN/bin:$PATH
./configure \
--host=$HOST \
--prefix="$OUTPUT_DIR/$ARCH/ncurses" \
--without-ada \
--without-cxx \
--without-cxx-binding \
--without-manpages \
--without-progs \
--without-tests \
--without-debug \
--enable-widec \
--enable-static \
--disable-shared \
--disable-database \
--with-fallbacks=xterm,xterm-256color,vt100 \
ac_cv_header_locale_h=no
make -j$(sysctl -n hw.ncpu)
make install.libs install.includes || true
# Create symlinks for compatibility
cd "$OUTPUT_DIR/$ARCH/ncurses/lib"
ln -sf libncursesw.a libncurses.a 2>/dev/null || true
cd "$OUTPUT_DIR/$ARCH/ncurses/include"
ln -sf ncursesw ncurses 2>/dev/null || true
echo "ncurses for $ARCH built successfully!"
}
# Build for armeabi-v7a
build_ncurses "armeabi-v7a" "armv7a-linux-androideabi" "arm-linux-androideabi"
# Build for x86_64
build_ncurses "x86_64" "x86_64-linux-android" "x86_64-linux-android"
echo "All remaining ncurses builds complete!"