Skip to content

Commit

Permalink
aarch64: build mariadb-106
Browse files Browse the repository at this point in the history
  • Loading branch information
hadfl committed Jul 11, 2024
1 parent c92fd46 commit f122edf
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 24 deletions.
103 changes: 79 additions & 24 deletions build/mariadb/build-106.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,19 @@ XFORM_ARGS="
"

CFLAGS+=" -O3 -I$OPREFIX/include -I/usr/include/gssapi"
CXXFLAGS[i386]="$CFLAGS ${CFLAGS[i386]} -R$OPREFIX/lib"
CXXFLAGS[amd64]="$CFLAGS ${CFLAGS[amd64]} -R$OPREFIX/lib/amd64"
LDFLAGS[i386]+=" -L$OPREFIX/lib -R$OPREFIX/lib"
LDFLAGS[amd64]+=" -L$OPREFIX/lib/amd64 -R$OPREFIX/lib/amd64"
CXXFLAGS[i386]="$CFLAGS ${CFLAGS[i386]} -R$OPREFIX/${LIBDIRS[i386]}"
CXXFLAGS[amd64]="$CFLAGS ${CFLAGS[amd64]} -R$OPREFIX/${LIBDIRS[amd64]}"
CXXFLAGS[aarch64]="$CFLAGS ${CFLAGS[aarch64]} -R$OPREFIX/${LIBDIRS[aarch64]}"
CXXFLAGS[aarch64]+=" -mtls-dialect=trad"
LDFLAGS[i386]+=" -L$OPREFIX/${LIBDIRS[i386]} -R$OPREFIX/${LIBDIRS[i386]}"
LDFLAGS[amd64]+=" -L$OPREFIX/${LIBDIRS[amd64]} -R$OPREFIX/${LIBDIRS[amd64]}"
LDFLAGS[aarch64]+=" -L$OPREFIX/${LIBDIRS[aarch64]}"
LDFLAGS[aarch64]+=" -R$OPREFIX/${LIBDIRS[aarch64]}"

CONFIGURE_OPTS=
CONFIGURE_OPTS[i386]=
CONFIGURE_OPTS[amd64]=
CONFIGURE_OPTS[aarch64]=
CONFIGURE_OPTS[i386_WS]="
-DFEATURE_SET=xsmall
-DCMAKE_C_FLAGS_RELEASE=\"$CFLAGS ${CFLAGS[i386]}\"
Expand All @@ -74,7 +79,7 @@ CONFIGURE_OPTS[i386_WS]="
-DINSTALL_BINDIR=bin/i386
-DINSTALL_SBINDIR=bin/i386
-DINSTALL_SCRIPTDIR=bin/i386
-DINSTALL_LIBDIR=lib
-DINSTALL_LIBDIR=${LIBDIRS[i386]}
-DWITH_MARIABACKUP=OFF
-DWITH_UNIT_TESTS=OFF
"
Expand All @@ -88,7 +93,19 @@ CONFIGURE_OPTS[amd64_WS]="
-DINSTALL_BINDIR=bin
-DINSTALL_SBINDIR=bin
-DINSTALL_SCRIPTDIR=bin
-DINSTALL_LIBDIR=lib/amd64
-DINSTALL_LIBDIR=${LIBDIRS[amd64]}
"
CONFIGURE_OPTS[aarch64_WS]="
-DFEATURE_SET=community
-DCMAKE_C_FLAGS_RELEASE=\"$CFLAGS ${CFLAGS[aarch64]}\"
-DCMAKE_CXX_FLAGS_RELEASE=\"${CXXFLAGS[aarch64]}\"
-DCMAKE_EXE_LINKER_FLAGS_RELEASE=\"${LDFLAGS[aarch64]}\"
-DCMAKE_MODULE_LINKER_FLAGS_RELEASE=\"${LDFLAGS[aarch64]}\"
-DCMAKE_SHARED_LINKER_FLAGS_RELEASE=\"${LDFLAGS[aarch64]}\"
-DINSTALL_BINDIR=bin
-DINSTALL_SBINDIR=bin
-DINSTALL_SCRIPTDIR=bin
-DINSTALL_LIBDIR=${LIBDIRS[aarch64]}
"
CONFIGURE_OPTS[WS]="
-DWITH_COMMENT=\"$DISTRO MariaDB Server\"
Expand Down Expand Up @@ -129,17 +146,64 @@ CONFIGURE_OPTS[WS]="
-DWITH_PIC=1
"

# Make ISA binaries for mysql_config, to allow software to find the
# right settings for 32/64-bit when pkg-config is not used.
make_isa_stub() {
pushd $DESTDIR$PREFIX/bin >/dev/null
logcmd mkdir -p amd64
logcmd mv *_config amd64/ || logerr "mv mysql_config"
make_isaexec_stub_arch amd64 $PREFIX/bin
popd >/dev/null
pre_configure() {
typeset arch=$1

! cross_arch $arch && return

save_variable BUILDARCH
save_buildenv
set_arch $BUILD_ARCH
set_gccver $DEFAULT_GCC_VER
CONFIGURE_OPTS[$BUILD_ARCH]=

save_builddir __native_tools__

note -n "-- Building native tools"

# not installing the native tools
pre_install() { false; }

MAKE_TARGET=import_executables build
set_crossgcc $arch
restore_builddir __native_tools__
restore_buildenv
restore_variable BUILDARCH

unset -f pre_install

CONFIGURE_OPTS[${arch}_WS]+="
-DIMPORT_EXECUTABLES=$TMPDIR/$BUILDDIR/build.$BUILD_ARCH/import_executables.cmake
-DCMAKE_TOOLCHAIN_FILE=$SRCDIR/files/cmake-toolchain-$arch.txt
-DHAVE_SOLARIS_ATOMIC_EXITCODE=0
"

note -n "-- Building $PROG"
}

build_manifests() {
post_install() {
typeset arch=$1

[ $arch = i386 ] && return

# Make ISA binaries for mysql_config, to allow software to find the
# right settings for 32/64-bit when pkg-config is not used.
if [ $arch = amd64 ]; then
pushd $DESTDIR$PREFIX/bin >/dev/null
logcmd $MKDIR -p amd64
logcmd $MV *_config amd64/ || logerr "mv mysql_config"
make_isaexec_stub_arch amd64 $PREFIX/bin
popd >/dev/null
fi

add_notes README.install

logcmd $MKDIR -p $DESTDIR/$CONFPATH
xform $SRCDIR/files/my.cnf > $DESTDIR/$CONFPATH/my.cnf
xform $SRCDIR/files/mariadb-template.xml > $TMPDIR/$PROG-$sMAJVER.xml
xform $SRCDIR/files/mariadb-template > $TMPDIR/$PROG-$sMAJVER
install_smf -oocemethod ooce $PROG-$sMAJVER.xml $PROG-$sMAJVER

manifest_start $TMPDIR/manifest.client
manifest_add_dir $PREFIX/include mysql
manifest_add_dir $PREFIX/lib pkgconfig amd64 amd64/pkgconfig
Expand All @@ -156,15 +220,6 @@ download_source $PROG $PROG $VER
patch_source
prep_build cmake+ninja
build
strip_install
make_isa_stub
add_notes README.install
logcmd mkdir -p $DESTDIR/$CONFPATH
xform files/my.cnf > $DESTDIR/$CONFPATH/my.cnf
xform files/mariadb-template.xml > $TMPDIR/$PROG-$sMAJVER.xml
xform files/mariadb-template > $TMPDIR/$PROG-$sMAJVER
install_smf -oocemethod ooce $PROG-$sMAJVER.xml $PROG-$sMAJVER
build_manifests
PKG=${PKG/database/library} SUMMARY+=" client and libraries" \
make_package -seed $TMPDIR/manifest.client
RUN_DEPENDS_IPS="${PKG/database/library} ooce/database/mariadb-common" \
Expand Down
2 changes: 2 additions & 0 deletions build/mariadb/files/cmake-toolchain-aarch64.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
set(CMAKE_SYSTEM_NAME SunOS)
set(CMAKE_SYSTEM_PROCESSOR aarch64)
3 changes: 3 additions & 0 deletions doc/baseline.aarch64
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ extra.omnios ooce/compress/pbzip2
extra.omnios ooce/compress/pigz
extra.omnios ooce/database/bdb
extra.omnios ooce/database/lmdb
extra.omnios ooce/database/mariadb-106
extra.omnios ooce/database/mariadb-common
extra.omnios ooce/database/postgresql-14
extra.omnios ooce/database/postgresql-common
extra.omnios ooce/developer/ninja
Expand All @@ -31,6 +33,7 @@ extra.omnios ooce/library/libsodium
extra.omnios ooce/library/libuv
extra.omnios ooce/library/libvorbis
extra.omnios ooce/library/libwebp
extra.omnios ooce/library/mariadb-106
extra.omnios ooce/library/nettle
extra.omnios ooce/library/onig
extra.omnios ooce/library/openldap
Expand Down
2 changes: 2 additions & 0 deletions doc/pkglist.aarch64
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ ooce/security/oath-toolkit
ooce/editor/joe
ooce/multimedia/x265
ooce/library/libde265
ooce/database/mariadb-common
###############################################################################
.SYSROOT
ooce/audio/flac
Expand All @@ -67,6 +68,7 @@ ooce/library/slang
ooce/util/jq
ooce/security/minisign
ooce/application/links
ooce/database/mariadb-106
###############################################################################
.SYSROOT
ooce/network/unbound
Expand Down

0 comments on commit f122edf

Please sign in to comment.