diff --git a/mk.sh b/mk.sh index e28fe70..0246ad3 100755 --- a/mk.sh +++ b/mk.sh @@ -58,6 +58,7 @@ source "$SCRIPTDIR/util/pkgcmd.sh" source "$SCRIPTDIR/util/toolchain.sh" source "$SCRIPTDIR/util/misc.sh" source "$SCRIPTDIR/util/override.sh" +source "$SCRIPTDIR/util/autotools.sh" ############################## toolchain config ############################## include_merge "TOOLCHAIN" diff --git a/pkg/bash-completion/build b/pkg/bash-completion/build index ae4d713..fc037a9 100755 --- a/pkg/bash-completion/build +++ b/pkg/bash-completion/build @@ -10,7 +10,7 @@ prepare() { } build() { - $1/configure --prefix="" --host="$TARGET" + run_configure "$1" make -j $NUMJOBS } diff --git a/pkg/bash/build b/pkg/bash/build index ab0a021..5c4fa4a 100755 --- a/pkg/bash/build +++ b/pkg/bash/build @@ -10,8 +10,7 @@ prepare() { } build() { - $1/configure --prefix="" --build="$HOSTTUPLE" --host="$TARGET" \ - --without-bash-malloc --with-installed-readline + run_configure "$1" --without-bash-malloc --with-installed-readline make -j $NUMJOBS } diff --git a/pkg/btrfs-progs/build b/pkg/btrfs-progs/build index 3df6a4d..20b1e00 100755 --- a/pkg/btrfs-progs/build +++ b/pkg/btrfs-progs/build @@ -12,9 +12,8 @@ prepare() { build() { cp -r ${1}/* ${PKGBUILDDIR} - ./configure --prefix="" --host="$TARGET" --sbindir=/bin \ - --disable-documentation --disable-convert \ - --disable-zstd --disable-backtrace --disable-python + run_configure "." --disable-documentation --disable-convert \ + --disable-zstd --disable-backtrace --disable-python make -j $NUMJOBS } diff --git a/pkg/coreutils/build b/pkg/coreutils/build index 53b1586..d5e407c 100755 --- a/pkg/coreutils/build +++ b/pkg/coreutils/build @@ -10,8 +10,7 @@ prepare() { } build() { - $1/configure --prefix="" --host="$TARGET" --libexecdir=/lib/libexec - + run_configure "$1" make -j $NUMJOBS } diff --git a/pkg/dhcpcd/build b/pkg/dhcpcd/build index ac9f03a..408b60b 100755 --- a/pkg/dhcpcd/build +++ b/pkg/dhcpcd/build @@ -15,10 +15,7 @@ build() { cp -r $SOURCE/* $PKGBUILDDIR - ./configure --prefix="" --host="$TARGET" --sbindir=/bin \ - --datadir=/share --libexecdir=/lib/libexec \ - --disable-static - + run_configure "." make -j $NUMJOBS } diff --git a/pkg/diffutils/build b/pkg/diffutils/build index 4f85f52..c6b5831 100755 --- a/pkg/diffutils/build +++ b/pkg/diffutils/build @@ -10,8 +10,7 @@ prepare() { } build() { - $1/configure --prefix="" --host="$TARGET" - + run_configure "$1" make -j $NUMJOBS } diff --git a/pkg/dosfstools/build b/pkg/dosfstools/build index c9b356e..cd45664 100755 --- a/pkg/dosfstools/build +++ b/pkg/dosfstools/build @@ -10,9 +10,7 @@ prepare() { } build() { - $1/configure --prefix="" --host="$TARGET" --sbindir=/bin \ - --disable-compat-symlinks --without-udev - + run_configure "$1" --disable-compat-symlinks --without-udev make -j $NUMJOBS } diff --git a/pkg/ethtool/build b/pkg/ethtool/build index 7bb617f..0824ffd 100755 --- a/pkg/ethtool/build +++ b/pkg/ethtool/build @@ -10,8 +10,7 @@ prepare() { } build() { - $1/configure --prefix="" --host="$TARGET" --sbindir="/bin" - + run_configure "$1" make -j $NUMJOBS } diff --git a/pkg/expat/build b/pkg/expat/build index 8f92e88..5765643 100644 --- a/pkg/expat/build +++ b/pkg/expat/build @@ -10,9 +10,7 @@ prepare() { } build() { - $1/configure --prefix="" --host="$TARGET" --disable-static \ - --without-xmlwf --with-libbsd - + run_configure "$1" --without-xmlwf --with-libbsd make -j $NUMJOBS } diff --git a/pkg/file/build b/pkg/file/build index 31c3fb2..7199498 100755 --- a/pkg/file/build +++ b/pkg/file/build @@ -10,8 +10,7 @@ prepare() { } build() { - $1/configure --prefix="" --host="$TARGET" --disable-static - + run_configure "$1" make -j $NUMJOBS } diff --git a/pkg/findutils/build b/pkg/findutils/build index c2c58ed..5b253cc 100755 --- a/pkg/findutils/build +++ b/pkg/findutils/build @@ -10,9 +10,7 @@ prepare() { } build() { - $1/configure --prefix="" --host="$TARGET" --libexecdir=/lib/libexec \ - --localstatedir=/var/lib/locate - + run_configure "$1" --localstatedir=/var/lib/locate make -j $NUMJOBS } diff --git a/pkg/gawk/build b/pkg/gawk/build index d134888..e19f0b5 100755 --- a/pkg/gawk/build +++ b/pkg/gawk/build @@ -10,8 +10,7 @@ prepare() { } build() { - $1/configure --prefix="" --host="$TARGET" --libexecdir="/lib/libexec" - + run_configure "$1" make -j $NUMJOBS } diff --git a/pkg/gmp/build b/pkg/gmp/build index d0758d4..67d2add 100755 --- a/pkg/gmp/build +++ b/pkg/gmp/build @@ -10,8 +10,7 @@ prepare() { } build() { - $1/configure --prefix="" --host="$TARGET" --disable-static --enable-cxx - + run_configure "$1" --enable-cxx make -j $NUMJOBS } diff --git a/pkg/grep/build b/pkg/grep/build index a142bf3..e35abb6 100755 --- a/pkg/grep/build +++ b/pkg/grep/build @@ -10,8 +10,7 @@ prepare() { } build() { - $1/configure --prefix="" --host="$TARGET" - + run_configure "$1" make -j $NUMJOBS } diff --git a/pkg/gzip/build b/pkg/gzip/build index 524d274..8519039 100755 --- a/pkg/gzip/build +++ b/pkg/gzip/build @@ -10,8 +10,7 @@ prepare() { } build() { - $1/configure --prefix="" --host="$TARGET" --with-regex=regcmp - + run_configure "$1" --with-regex=regcmp make -j $NUMJOBS } diff --git a/pkg/inetutils/build b/pkg/inetutils/build index 2042953..98d21e5 100755 --- a/pkg/inetutils/build +++ b/pkg/inetutils/build @@ -10,10 +10,10 @@ prepare() { } build() { - $1/configure --prefix="" --host="$TARGET" --disable-servers \ - --disable-dnsdomainname --disable-rcp --disable-rexec \ - --enable-hostname --disable-rlogin --disable-rsh \ - --disable-logger --disable-talk --disable-ifconfig + run_configure "$1" --disable-servers --disable-dnsdomainname \ + --disable-rcp --disable-rexec --enable-hostname \ + --disable-rlogin --disable-rsh --disable-logger \ + --disable-talk --disable-ifconfig make -j $NUMJOBS } diff --git a/pkg/init/build b/pkg/init/build index 1d37ffe..ac0d4c4 100755 --- a/pkg/init/build +++ b/pkg/init/build @@ -10,12 +10,7 @@ prepare() { } build() { - local SOURCE="$1" - local DEPLOY="$2" - - $SOURCE/configure --prefix="" --host="$TARGET" --sbindir=/bin \ - --libexecdir=/lib/libexec - + run_configure "$1" make -j $NUMJOBS } diff --git a/pkg/kbd/build b/pkg/kbd/build index 674372a..0619562 100755 --- a/pkg/kbd/build +++ b/pkg/kbd/build @@ -10,8 +10,8 @@ prepare() { } build() { - $1/configure --prefix="" --host="$TARGET" --enable-optional-progs \ - --disable-tests --enable-libkeymap --disable-vlock + run_configure "$1" --enable-optional-progs --disable-tests \ + --enable-libkeymap --disable-vlock make -j $NUMJOBS } diff --git a/pkg/kmod/build b/pkg/kmod/build index dd01918..01d482e 100644 --- a/pkg/kmod/build +++ b/pkg/kmod/build @@ -10,9 +10,7 @@ prepare() { } build() { - $1/configure --prefix="" --host="$TARGET" --with-xz --with-zlib \ - --with-bashcompletiondir="/share/bash-completion/completions" - + run_configure "$1" --with-xz --with-zlib make -j $NUMJOBS } diff --git a/pkg/ldns/build b/pkg/ldns/build index 0ca1d57..16aef18 100755 --- a/pkg/ldns/build +++ b/pkg/ldns/build @@ -10,11 +10,7 @@ prepare() { } build() { - ac_cv_func_malloc_0_nonnull=yes \ - ac_cv_func_realloc_0_nonnull=yes \ - $1/configure --prefix="" --build="$HOSTTUPLE" --host="$TARGET" \ - --sysconfdir=/etc --sbindir=/bin --disable-static \ - --with-drill --without-pyldns --without-pyldnsx \ + run_configure "$1" --with-drill --without-pyldns --without-pyldnsx \ --without-p5-dns-ldns --with-ssl="$TCDIR/$TARGET" make -j $NUMJOBS diff --git a/pkg/less/build b/pkg/less/build index 0b9d44c..a3a0211 100755 --- a/pkg/less/build +++ b/pkg/less/build @@ -10,8 +10,7 @@ prepare() { } build() { - $1/configure --prefix="" --host="$TARGET" --with-regex=regcmp - + run_configure "$1" --with-regex=regcmp make -j $NUMJOBS } diff --git a/pkg/libbsd/build b/pkg/libbsd/build index eadeb38..20bb8d1 100644 --- a/pkg/libbsd/build +++ b/pkg/libbsd/build @@ -10,8 +10,7 @@ prepare() { } build() { - $1/configure --prefix="" --host="$TARGET" --disable-static - + run_configure "$1" make -j $NUMJOBS } diff --git a/pkg/libmnl/build b/pkg/libmnl/build index 2542708..6fffe50 100644 --- a/pkg/libmnl/build +++ b/pkg/libmnl/build @@ -10,8 +10,7 @@ prepare() { } build() { - $1/configure --prefix="" --host="$TARGET" - + run_configure "$1" make -j $NUMJOBS } diff --git a/pkg/libnftnl/build b/pkg/libnftnl/build index 1758dc7..72a8c6e 100644 --- a/pkg/libnftnl/build +++ b/pkg/libnftnl/build @@ -10,8 +10,7 @@ prepare() { } build() { - $1/configure --prefix="" --host="$TARGET" - + run_configure "$1" make -j $NUMJOBS } diff --git a/pkg/libnl3/build b/pkg/libnl3/build index a377a3c..b1b8e6f 100644 --- a/pkg/libnl3/build +++ b/pkg/libnl3/build @@ -10,9 +10,7 @@ prepare() { } build() { - $1/configure --prefix="" --host="$TARGET" --disable-static \ - --disable-cli - + run_configure "$1" --disable-cli make -j $NUMJOBS } diff --git a/pkg/libpcap/build b/pkg/libpcap/build index e6deb6b..5f4dc41 100755 --- a/pkg/libpcap/build +++ b/pkg/libpcap/build @@ -13,10 +13,7 @@ build() { cp -r ${1}/* ${PKGBUILDDIR} sed -i "s#/usr/include/libnl3#$TCDIR/$TARGET/include/libnl3#g" configure - ./configure --prefix="" --host="$TARGET" --sbindir=/bin \ - --libexecdir=/lib/libexec --with-pcap=linux \ - --enable-ipv6 - + run_configure "." --with-pcap=linux --enable-ipv6 make -j $NUMJOBS } diff --git a/pkg/libseccomp/build b/pkg/libseccomp/build index b8be49a..e55f4d4 100644 --- a/pkg/libseccomp/build +++ b/pkg/libseccomp/build @@ -10,8 +10,7 @@ prepare() { } build() { - $1/configure --prefix="" --host="$TARGET" --disable-static - + run_configure "$1" make -j $NUMJOBS } diff --git a/pkg/lzo/build b/pkg/lzo/build index a178d9d..fd842c6 100644 --- a/pkg/lzo/build +++ b/pkg/lzo/build @@ -10,9 +10,7 @@ prepare() { } build() { - $1/configure --prefix="" --host="$TARGET" \ - --enable-shared --disable-static - + run_configure "$1" make -j $NUMJOBS } diff --git a/pkg/nano/build b/pkg/nano/build index 9cdccff..0ee1401 100644 --- a/pkg/nano/build +++ b/pkg/nano/build @@ -10,8 +10,7 @@ prepare() { } build() { - $1/configure --prefix="" --host="$TARGET" --enable-utf8 - + run_configure "$1" --enable-utf8 make -j $NUMJOBS } diff --git a/pkg/ncurses/build b/pkg/ncurses/build index f929618..63b44de 100755 --- a/pkg/ncurses/build +++ b/pkg/ncurses/build @@ -10,10 +10,9 @@ prepare() { } build() { - $1/configure --prefix="" --host="$TARGET" --with-shared \ - --without-debug --without-ada --enable-widec \ - --with-pkg-config-libdir=/lib/pkgconfig \ - --enable-pc-files --disable-stripping + run_configure "$1" --with-shared --without-debug --without-ada \ + --enable-widec --with-pkg-config-libdir=/lib/pkgconfig \ + --enable-pc-files --disable-stripping make -j $NUMJOBS } diff --git a/pkg/nftables/build b/pkg/nftables/build index a187c22..ad13983 100644 --- a/pkg/nftables/build +++ b/pkg/nftables/build @@ -10,9 +10,7 @@ prepare() { } build() { - $1/configure --prefix="" --host="$TARGET" --sbindir=/bin \ - --disable-debug --disable-man-doc --without-mini-gmp - + run_configure "$1" --disable-debug --disable-man-doc --without-mini-gmp make -j $NUMJOBS } diff --git a/pkg/openssh/build b/pkg/openssh/build index 839c523..c951a2d 100644 --- a/pkg/openssh/build +++ b/pkg/openssh/build @@ -10,9 +10,7 @@ prepare() { } build() { - $1/configure --prefix="" --host="$TARGET" --sbindir=/bin \ - --libexecdir=/lib/libexec \ - --with-pie --without-pam --without-stackprotect \ + run_configure "$1" --with-pie --without-pam --without-stackprotect \ --without-selinux --disable-strip \ --with-sandbox=seccomp_filter \ --with-privsep-path=/var/lib/sshd diff --git a/pkg/procps-ng/build b/pkg/procps-ng/build index 20f8e04..f8b0670 100755 --- a/pkg/procps-ng/build +++ b/pkg/procps-ng/build @@ -10,11 +10,8 @@ prepare() { } build() { - ac_cv_func_malloc_0_nonnull=yes \ - ac_cv_func_realloc_0_nonnull=yes \ - $1/configure --prefix="" --host="$TARGET" --disable-static \ - --enable-watch8bit --with-ncurses --without-systemd \ - --disable-kill --disable-numa --sbindir=/bin + run_configure "$1" --enable-watch8bit --with-ncurses \ + --without-systemd --disable-kill --disable-numa make -j $NUMJOBS } diff --git a/pkg/psmisc/build b/pkg/psmisc/build index bdb30b6..01dbe5f 100755 --- a/pkg/psmisc/build +++ b/pkg/psmisc/build @@ -10,11 +10,7 @@ prepare() { } build() { - ac_cv_func_malloc_0_nonnull=yes \ - ac_cv_func_realloc_0_nonnull=yes \ - $1/configure --prefix="" --host="$TARGET" --disable-static \ - --disable-selinux - + run_configure "$1" --disable-selinux make -j $NUMJOBS } diff --git a/pkg/readline/build b/pkg/readline/build index 0f3f28a..3f3d725 100755 --- a/pkg/readline/build +++ b/pkg/readline/build @@ -10,8 +10,7 @@ prepare() { } build() { - $1/configure --prefix="" --host="$TARGET" --disable-static - + run_configure "$1" make SHLIB_LIBS="-lncursesw" -j $NUMJOBS } diff --git a/pkg/sed/build b/pkg/sed/build index 581a54d..d8c7783 100755 --- a/pkg/sed/build +++ b/pkg/sed/build @@ -10,8 +10,7 @@ prepare() { } build() { - $1/configure --prefix="" --host="$TARGET" - + run_configure "$1" make -j $NUMJOBS } diff --git a/pkg/shadow/build b/pkg/shadow/build index 0a72cd5..3a1c1cd 100755 --- a/pkg/shadow/build +++ b/pkg/shadow/build @@ -13,8 +13,7 @@ prepare() { } build() { - $1/configure --prefix="" --host="$TARGET" --sbindir=/bin \ - --disable-man --without-libpam --without-selinux \ + run_configure "$1" --disable-man --without-libpam --without-selinux \ --with-sha-crypt --with-group-name-max-length=32 make -j $NUMJOBS diff --git a/pkg/sqlite3/build b/pkg/sqlite3/build index e9764b5..9e92750 100755 --- a/pkg/sqlite3/build +++ b/pkg/sqlite3/build @@ -10,8 +10,7 @@ prepare() { } build() { - $1/configure --prefix="" --host="$TARGET" --disable-tcl - + run_configure "$1" --disable-tcl make -j $NUMJOBS } diff --git a/pkg/tar/build b/pkg/tar/build index bc3b1b7..7ead183 100755 --- a/pkg/tar/build +++ b/pkg/tar/build @@ -10,8 +10,7 @@ prepare() { } build() { - $1/configure --prefix="" --host="$TARGET" --libexecdir=/lib/libexec - + run_configure "$1" make -j $NUMJOBS } diff --git a/pkg/tcpdump/build b/pkg/tcpdump/build index d7819fa..00619d7 100755 --- a/pkg/tcpdump/build +++ b/pkg/tcpdump/build @@ -10,9 +10,8 @@ prepare() { } build() { - $1/configure --prefix="" --host="$TARGET" --sbindir=/bin \ - --libexecdir=/lib/libexec --with-system-libpcap \ - --with-cap-ng --with-crypto="$TCDIR/$TARGET" + run_configure "$1" --with-system-libpcap --with-cap-ng \ + --with-crypto="$TCDIR/$TARGET" make -j $NUMJOBS } diff --git a/pkg/unbound/build b/pkg/unbound/build index 02c8d0d..97d86ca 100644 --- a/pkg/unbound/build +++ b/pkg/unbound/build @@ -10,9 +10,8 @@ prepare() { } build() { - $1/configure --prefix="" --host="$TARGET" --disable-static \ - --sysconfdir=/etc --with-pidfile=/run/unbound.pid \ - --sbindir=/bin --with-libexpat="$TCDIR/$TARGET" \ + run_configure "$1" --with-pidfile=/run/unbound.pid \ + --with-libexpat="$TCDIR/$TARGET" \ --with-ssl="$TCDIR/$TARGET" make -j $NUMJOBS diff --git a/pkg/util-linux/build b/pkg/util-linux/build index 3f3e844..481cd01 100755 --- a/pkg/util-linux/build +++ b/pkg/util-linux/build @@ -10,18 +10,9 @@ prepare() { } build() { - $1/configure ADJTIME_PATH=/var/lib/hwclock/adjtime \ - --prefix="" --host="$TARGET" --sbindir="/bin" \ - --with-bashcompletiondir="/share/bash-completion/completions" \ - --disable-pylibmount --disable-static --without-python \ + ADJTIME_PATH=/var/lib/hwclock/adjtime \ + run_configure "$1" --disable-pylibmount --without-python \ --without-systemd --without-systemdsystemunitdir \ - --disable-cal --disable-chmem --disable-fdformat \ - --disable-fsck --disable-logger --disable-mesg \ - --disable-minix --disable-bfs --disable-more \ - --disable-nologin --disable-nsenter --disable-pivot_root \ - --disable-raw --disable-sulogin --disable-switch_root \ - --disable-ul --disable-unshare --disable-utmpdump \ - --disable-uuidd --disable-wall --disable-zramctl \ --disable-makeinstall-chown \ --disable-makeinstall-setuid \ --enable-agetty diff --git a/pkg/xz/build b/pkg/xz/build index 6ad7679..4b3e3b5 100644 --- a/pkg/xz/build +++ b/pkg/xz/build @@ -10,8 +10,7 @@ prepare() { } build() { - $1/configure --prefix="" --host="$TARGET" --disable-static - + run_configure "$1" make -j $NUMJOBS } diff --git a/util/autotools.sh b/util/autotools.sh new file mode 100644 index 0000000..f04305f --- /dev/null +++ b/util/autotools.sh @@ -0,0 +1,14 @@ +run_configure() { + local srcdir="$1" + shift + + ac_cv_func_malloc_0_nonnull=yes \ + ac_cv_func_realloc_0_nonnull=yes \ + $srcdir/configure --prefix="" --build="$HOSTTUPLE" --host="$TARGET" \ + --bindir="/bin" --sbindir="/bin" --sysconfdir="/etc" \ + --libexecdir="/lib/libexec" --datarootdir="/share" \ + --datadir="/share" --sharedstatedir="/share" \ + --with-bashcompletiondir="/share/bash-completion/completions" \ + --includedir="/include" \ + --enable-shared --disable-static $@ +}