summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2019-04-18 11:17:22 +0200
committerYorhel <git@yorhel.nl>2019-04-18 11:17:22 +0200
commit34e2966703b3e0e0bcbcd836f76c99e4b0094c42 (patch)
tree9250fa4fe71d60605a0b46c80e0a13b2c54eb041
parentf75cc72127bfedbb38df45dff65546e52c1e94b8 (diff)
Fix static build
-rw-r--r--.gitignore6
-rwxr-xr-xstatic/build.sh45
-rw-r--r--static/meson-cross-arm.txt15
-rw-r--r--static/meson-cross-i486.txt12
-rw-r--r--static/meson-cross-x86_64.txt12
5 files changed, 62 insertions, 28 deletions
diff --git a/.gitignore b/.gitignore
index 1b33f76..d88ae4d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -25,5 +25,7 @@ doc/*.1
doc/ncdc.pod
ncdc-db-upgrade
INSTALL
-static/*
-!static/build.sh
+static/arm
+static/i486
+static/x86_64
+static/tarballs
diff --git a/static/build.sh b/static/build.sh
index 6195d7d..4913379 100755
--- a/static/build.sh
+++ b/static/build.sh
@@ -10,6 +10,8 @@
# perl
# python2
# git
+# meson
+# ninja
# (Anything else I forgot)
# - A checkout of the ncdc git repo can be found in "..", and the configure
# script exists (i.e. autoreconf has been run).
@@ -31,9 +33,9 @@ SQLITE_VERSION=3270200
GMP_VERSION=6.1.2
NETTLE_VERSION=3.4.1
IDN_VERSION=2.1.1
-GNUTLS_VERSION=3.6.6
+GNUTLS_VERSION=3.6.7
NCURSES_VERSION=6.1
-GLIB_VERSION=2.60.0
+GLIB_VERSION=2.60.1
MAXMIND_VERSION=1.3.2
@@ -204,27 +206,18 @@ getncurses() {
getglib() {
fem http://ftp.gnome.org/pub/gnome/sources/glib/${GLIB_VERSION%.*}/ glib-$GLIB_VERSION.tar.xz glib
prebuild glib || return
- export glib_cv_stack_grows=no # Arch
- export glib_cv_uscore=no # OS/Arch
- export glib_cv_have_strlcpy=yes # libc
- export ac_cv_func_posix_getpwuid_r=yes # libc
- export ac_cv_func_posix_getgrgid_r=yes # libc
- export ac_cv_alignof_guint32=4 # Arch, not mentioned in Glib docs...
- export ac_cv_alignof_guint64=8 # Arch, ~
- case $TARGET in # Arch, ~
- x86_64) export ac_cv_alignof_unsigned_long=8 ;;
- *) export ac_cv_alignof_unsigned_long=4 ;;
- esac
- $srcdir/configure --prefix=$PREFIX --enable-static --disable-shared\
- --disable-gtk-doc-html --disable-xattr --disable-fam --disable-dtrace\
- --disable-gcov --disable-modular-tests --with-pcre=internal --disable-silent-rules\
- --disable-compile-warnings --host=$HOST CPPFLAGS=-D_GNU_SOURCE || exit
- perl -pi -e 's{(#define GLIB_LOCALE_DIR).+}{$1 "/usr/share/locale"}' config.h
- make -C glib/libcharset install
- make -C glib/gnulib install
- make -C glib/pcre install
- make -C glib install-libLTLIBRARIES install-data install-nodist_configexecincludeHEADERS || exit
- make -C gthread install || exit
+
+ # Get rid of GObject & GIO stuff from the meson build, ncdc doesn't need it.
+ mv $srcdir/meson.build $srcdir/meson.build.orig
+ grep -vE "subdir\('(gio|gobject|gmodule|fuzzing|tests)'\)" $srcdir/meson.build.orig\
+ | grep -vE '^(gobject|gmodule|gio)inc = '\
+ | sed -E "s/.+GLIB_LOCALE_DIR.+/glib_conf.set_quoted('GLIB_LOCALE_DIR', '\\/usr\\/share\\/locale')/"\
+ > $srcdir/meson.build
+
+ meson setup . $srcdir --cross-file ../../meson-cross-$TARGET.txt --prefix=$PREFIX\
+ --localedir=localexxx -Ddefault_library=static\
+ -Dlibmount=false -Dinternal_pcre=true -Dnls=disabled || exit
+ ninja install || exit
postbuild
}
@@ -243,10 +236,10 @@ getncdc() {
prebuild ncdc || return
srcdir=../../..
$srcdir/configure --host=$HOST --disable-silent-rules --with-geoip\
- CPPFLAGS="-I$PREFIX/include -D_GNU_SOURCE" LDFLAGS="-static -L$PREFIX/lib -L$PREFIX/lib64 -lz -lbz2"\
+ CPPFLAGS="-I$PREFIX/include -D_GNU_SOURCE -Wno-deprecated-declarations" LDFLAGS="-static -L$PREFIX/lib -L$PREFIX/lib64 -lz -lbz2"\
SQLITE_LIBS=-lsqlite3 GEOIP_LIBS=-lmaxminddb GNUTLS_LIBS="-lgnutls -lz -lhogweed -lnettle -lgmp -lidn2"\
- GLIB_LIBS="-pthread -lglib-2.0 -lgthread-2.0"\
- GLIB_CFLAGS="-I$PREFIX/include/glib-2.0 -I$PREFIX/lib/glib-2.0/include" || exit
+ NCURSES_CFLAGS="-I$PREFIX/include/ncursesw" NCURSES_LIBS="-lncursesw"\
+ GLIB_LIBS="-pthread -lglib-2.0 -lgthread-2.0" GLIB_CFLAGS="-I$PREFIX/include/glib-2.0 -I$PREFIX/lib/glib-2.0/include" || exit
# Make sure that the Makefile dependencies for makeheaders and gendoc are "up-to-date"
mkdir -p deps deps/.deps doc doc/.deps
touch deps/.dirstamp deps/.deps/.dirstamp deps/makeheaders.o doc/.dirstamp doc/.deps/.dirstamp doc/gendoc.o
diff --git a/static/meson-cross-arm.txt b/static/meson-cross-arm.txt
new file mode 100644
index 0000000..9510049
--- /dev/null
+++ b/static/meson-cross-arm.txt
@@ -0,0 +1,15 @@
+[binaries]
+c = 'arm-linux-musleabi-gcc'
+cpp = 'arm-linux-musleabi-g++'
+ar = 'arm-linux-musleabi-ar'
+strip = 'arm-linux-musleabi-strip'
+pkgconfig = 'pkg-config'
+
+[properties]
+needs_exe_wrapper = true
+
+[host_machine]
+system = 'linux'
+cpu_family = 'arm'
+cpu = 'armv7-a'
+endian = 'little'
diff --git a/static/meson-cross-i486.txt b/static/meson-cross-i486.txt
new file mode 100644
index 0000000..3a879ac
--- /dev/null
+++ b/static/meson-cross-i486.txt
@@ -0,0 +1,12 @@
+[binaries]
+c = 'i486-linux-musl-gcc'
+cpp = 'i486-linux-musl-g++'
+ar = 'i486-linux-musl-ar'
+strip = 'i486-linux-musl-strip'
+pkgconfig = 'pkg-config'
+
+[host_machine]
+system = 'linux'
+cpu_family = 'i486'
+cpu = 'i486'
+endian = 'little'
diff --git a/static/meson-cross-x86_64.txt b/static/meson-cross-x86_64.txt
new file mode 100644
index 0000000..68e1912
--- /dev/null
+++ b/static/meson-cross-x86_64.txt
@@ -0,0 +1,12 @@
+[binaries]
+c = 'x86_64-linux-musl-gcc'
+cpp = 'x86_64-linux-musl-g++'
+ar = 'x86_64-linux-musl-ar'
+strip = 'x86_64-linux-musl-strip'
+pkgconfig = 'pkg-config'
+
+[host_machine]
+system = 'linux'
+cpu_family = 'x86_64'
+cpu = 'x86_64'
+endian = 'little'