diff --git a/COPYING b/COPYING index 9d1202d01b6..38382b9d761 100644 --- a/COPYING +++ b/COPYING @@ -1,23 +1,22 @@ -/* Copyright (c) 2008-2013 The XBPS developers and contributors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ + Copyright (c) 2008-2014 The XBPS developers and contributors. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/common/build_style/README b/common/build_style/README new file mode 100644 index 00000000000..8ed990b7242 --- /dev/null +++ b/common/build_style/README @@ -0,0 +1,12 @@ +BUILD STYLES +============ + +These shell snippets provide support for multiple build systems, i.e GNU configure, +CMake, etc. A build style file must provide at least the following functions: + + - do_configure + - do_build + - do_install + +If a source package defines its own do_xxx() function, the function defined in +the build style file is simply ignored. diff --git a/common/build_style/cmake.sh b/common/build_style/cmake.sh new file mode 100644 index 00000000000..1e2b0b98806 --- /dev/null +++ b/common/build_style/cmake.sh @@ -0,0 +1,45 @@ +# +# This helper is for templates using cmake. +# +do_configure() { + [ ! -d build ] && mkdir build + cd build + + if [ "$CROSS_BUILD" ]; then + cat > cross_${XBPS_CROSS_TRIPLET}.cmake <<_EOF +SET(CMAKE_SYSTEM_NAME Linux) +SET(CMAKE_SYSTEM_VERSION 1) + +SET(CMAKE_C_COMPILER ${XBPS_CROSS_TRIPLET}-gcc) +SET(CMAKE_CXX_COMPILER ${XBPS_CROSS_TRIPLET}-g++) +SET(CMAKE_CROSSCOMPILING TRUE) + +SET(CMAKE_FIND_ROOT_PATH ${XBPS_CROSS_BASE}) + +SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +_EOF + configure_args+=" -DCMAKE_TOOLCHAIN_FILE=cross_${XBPS_CROSS_TRIPLET}.cmake" + fi + configure_args+=" -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DCMAKE_SKIP_RPATH=ON" + + cmake ${configure_args} .. +} + +do_build() { + : ${make_cmd:=make} + + cd build + ${make_cmd} ${makejobs} ${make_build_args} ${make_build_target} +} + +do_install() { + : ${make_cmd:=make} + : ${make_install_target:=install} + + make_install_args+=" DESTDIR=${DESTDIR}" + + cd build + ${make_cmd} ${make_install_args} ${make_install_target} +} diff --git a/common/build_style/configure.sh b/common/build_style/configure.sh new file mode 100644 index 00000000000..b310a88a3d1 --- /dev/null +++ b/common/build_style/configure.sh @@ -0,0 +1,24 @@ +# +# This helper is for templates using configure scripts (not generated +# by the GNU autotools). +# +do_configure() { + : ${configure_script:=./configure} + + ${configure_script} ${configure_args} +} + +do_build() { + : ${make_cmd:=make} + + ${make_cmd} ${makejobs} ${make_build_args} ${make_build_target} +} + +do_install() { + : ${make_cmd:=make} + : ${make_install_target:=install} + + make_install_args+=" DESTDIR=${DESTDIR}" + + ${make_cmd} ${make_install_args} ${make_install_target} +} diff --git a/common/build_style/gnu-configure.sh b/common/build_style/gnu-configure.sh new file mode 100644 index 00000000000..9c52832835d --- /dev/null +++ b/common/build_style/gnu-configure.sh @@ -0,0 +1,33 @@ +# +# This helper is for templates using GNU configure scripts. +# +do_configure() { + : ${configure_script:=./configure} + + # Make sure that shared libraries are built with --as-needed. + # + # http://lists.gnu.org/archive/html/libtool-patches/2004-06/msg00002.html + if [ -z "$broken_as_needed" ]; then + sed -i "s/^\([ \t]*tmp_sharedflag\)='-shared'/\1='-shared -Wl,--as-needed'/" ${configure_script} + fi + # Automatically detect musl toolchains. + for f in $(find ${wrksrc} -type f -name *config*.sub); do + cp -f ${XBPS_CROSSPFDIR}/config.sub ${f} + done + ${configure_script} ${configure_args} +} + +do_build() { + : ${make_cmd:=make} + + ${make_cmd} ${makejobs} ${make_build_args} ${make_build_target} +} + +do_install() { + : ${make_cmd:=make} + : ${make_install_target:=install} + + make_install_args+=" DESTDIR=${DESTDIR}" + + ${make_cmd} ${make_install_args} ${make_install_target} +} diff --git a/common/build_style/gnu-makefile.sh b/common/build_style/gnu-makefile.sh new file mode 100644 index 00000000000..d9100117845 --- /dev/null +++ b/common/build_style/gnu-makefile.sh @@ -0,0 +1,20 @@ +# +# This helper is for templates using GNU Makefiles. +# +do_build() { + : ${make_cmd:=make} + + ${make_cmd} \ + CC="$CC" CXX="$CXX" LD="$LD" AR="$AR" RANLIB="$RANLIB" \ + CPP="$CPP" AS="$AS" OBJDUMP="$OBJDUMP" STRIP="$STRIP" \ + ${makejobs} ${make_build_args} ${make_build_target} +} + +do_install() { + : ${make_cmd:=make} + : ${make_install_target:=install} + + make_install_args+=" PREFIX=/usr DESTDIR=${DESTDIR}" + + ${make_cmd} ${make_install_args} ${make_install_target} +} diff --git a/common/build_style/meta.sh b/common/build_style/meta.sh new file mode 100644 index 00000000000..2a33d0b465d --- /dev/null +++ b/common/build_style/meta.sh @@ -0,0 +1,13 @@ +# meta pkg build style; do nothing. + +do_fetch() { + : +} + +do_extract() { + : +} + +do_install() { + : +} diff --git a/common/build_style/perl-ModuleBuild.sh b/common/build_style/perl-ModuleBuild.sh new file mode 100644 index 00000000000..7a4eef5890f --- /dev/null +++ b/common/build_style/perl-ModuleBuild.sh @@ -0,0 +1,32 @@ +# +# This helper does the required steps to be able to build and install +# perl modules with the Module::Build method into the correct location. +# +# Required vars to be set by a template: +# +# build_style=perl-ModuleBuild +# +do_configure() { + if [ -f Build.PL ]; then + PERL_MM_USE_DEFAULT=1 PERL_MM_OPT="INSTALLDIRS=vendor DESTDIR='$DESTDIR'" \ + PERL_MB_OPT="--installdirs vendor --destdir '$DESTDIR'" \ + LD="$CC" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" \ + perl Build.PL ${configure_args} INSTALLDIRS=vendor + else + msg_error "$pkgver: cannot find Build.PL for perl module!\n" + fi +} + +do_build() { + if [ ! -x ./Build ]; then + msg_error "$pkgver: cannot find ./Build script!\n" + fi + LD="$CC" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" ./Build ${make_build_args} +} + +do_install() { + if [ ! -x ./Build ]; then + msg_error "$pkgver: cannot find ./Build script!\n" + fi + ./Build ${make_install_args} install +} diff --git a/common/build_style/perl-module.sh b/common/build_style/perl-module.sh new file mode 100644 index 00000000000..37c5c3a71b0 --- /dev/null +++ b/common/build_style/perl-module.sh @@ -0,0 +1,64 @@ +# +# This helper does the required steps to be able to build and install +# perl modules that use MakeMaker into the correct location. +# +# Required vars to be set by a template: +# +# build_style=perl-module +# +# Optionally if the module needs more directories to be configured other +# than $XBPS_BUILDDIR/$wrksrc, one can use (relative to $wrksrc): +# +# perl_configure_dirs="blob/bob foo/blah" +# +do_configure() { + local perlmkf + + if [ -z "$perl_configure_dirs" ]; then + perlmkf="$wrksrc/Makefile.PL" + if [ ! -f $perlmkf ]; then + msg_error "*** ERROR couldn't find $perlmkf, aborting ***\n" + fi + + cd $wrksrc + PERL_MM_USE_DEFAULT=1 GCC="$CC" CC="$CC" LD="$CC" \ + OPTIMIZE="$CFLAGS" \ + CFLAGS="$CFLAGS -I${XBPS_CROSS_BASE}/usr/include" \ + LDFLAGS="$LDFLAGS -L${XBPS_CROSS_BASE}/usr/lib" \ + LDDLFLAGS="-shared $CFLAGS -L${XBPS_CROSS_BASE}/usr/lib" \ + perl Makefile.PL ${configure_args} INSTALLDIRS=vendor + fi + + for i in "$perl_configure_dirs"; do + perlmkf="$wrksrc/$i/Makefile.PL" + if [ -f $perlmkf ]; then + cd $wrksrc/$i + PERL_MM_USE_DEFAULT=1 GCC="$CC" CC="$CC" LD="$CC" \ + OPTIMIZE="$CFLAGS" \ + CFLAGS="$CFLAGS -I${XBPS_CROSS_BASE}/usr/include" \ + LDFLAGS="$LDFLAGS -L${XBPS_CROSS_BASE}/usr/lib" \ + LDDLFLAGS="-shared $CFLAGS -L${XBPS_CROSS_BASE}/usr/lib" \ + perl Makefile.PL ${make_build_args} INSTALLDIRS=vendor + else + msg_error "*** ERROR: couldn't find $perlmkf, aborting **\n" + fi + done +} + +do_build() { + : ${make_cmd:=make} + + ${make_cmd} CC="$CC" LD="$CC" CFLAGS="$CFLAGS" OPTIMIZE="$CFLAGS" \ + LDFLAGS="$LDFLAGS -L${XBPS_CROSS_BASE}/usr/lib" \ + LDDLFLAGS="-shared $CFLAGS -L${XBPS_CROSS_BASE}/usr/lib" \ + ${makejobs} ${make_build_args} ${make_build_target} +} + +do_install() { + : ${make_cmd:=make} + : ${make_install_target:=install} + + make_install_args+=" DESTDIR=${DESTDIR}" + + ${make_cmd} ${make_install_args} ${make_install_target} +} diff --git a/common/build_style/python-module.sh b/common/build_style/python-module.sh new file mode 100644 index 00000000000..a0202a18943 --- /dev/null +++ b/common/build_style/python-module.sh @@ -0,0 +1,36 @@ +# +# This helper is for templates installing python modules. +# +XBPS_PYVER="2.7" # currently 2.7 is the default python + +do_build() { + if [ -n "$CROSS_BUILD" ]; then + CC="${XBPS_CROSS_TRIPLET}-gcc -pthread" + LDSHARED="${CC} -shared" + PYPREFIX="$XBPS_CROSS_BASE" + CFLAGS="$CFLAGS -I${XBPS_CROSS_BASE}/include/python${XBPS_PYVER} -I${XBPS_CROSS_BASE}/usr/include" + LDFLAGS="$LDFLAGS -L${XBPS_CROSS_BASE}/lib/python${XBPS_PYVER} -L${XBPS_CROSS_BASE}/lib" + env CC="$CC" LDSHARED="$LDSHARED" \ + PYPREFIX="$PYPREFIX" CFLAGS="$CFLAGS" \ + LDFLAGS="$LDFLAGS" python setup.py build ${make_build_args} + else + python setup.py build ${make_build_args} + fi +} + +do_install() { + make_install_args+=" --prefix=/usr --root=$DESTDIR" + + if [ -n "$CROSS_BUILD" ]; then + CC="${XBPS_CROSS_TRIPLET}-gcc -pthread" + LDSHARED="${CC} -shared" + PYPREFIX="$XBPS_CROSS_BASE" + CFLAGS="$CFLAGS -I${XBPS_CROSS_BASE}/include/python${XBPS_PYVER} -I${XBPS_CROSS_BASE}/usr/include" + LDFLAGS="$LDFLAGS -L${XBPS_CROSS_BASE}/lib/python${XBPS_PYVER} -L${XBPS_CROSS_BASE}/lib" + env CC="$CC" LDSHARED="$LDSHARED" \ + PYPREFIX="$PYPREFIX" CFLAGS="$CFLAGS" \ + LDFLAGS="$LDFLAGS" python setup.py install ${make_install_args} + else + python setup.py install ${make_install_args} + fi +} diff --git a/common/build_style/waf.sh b/common/build_style/waf.sh new file mode 100644 index 00000000000..5b241c29509 --- /dev/null +++ b/common/build_style/waf.sh @@ -0,0 +1,16 @@ +# +# This helper is for templates using WAF to build/install. +# +do_configure() { + python waf configure --prefix=/usr ${configure_args} +} + +do_build() { + python waf build ${make_build_args} +} + +do_install() { + make_install_args+=" --destdir=${DESTDIR}" + + python waf install ${make_install_args} +} diff --git a/common/build_style/waf3.sh b/common/build_style/waf3.sh new file mode 100644 index 00000000000..bfa11c36146 --- /dev/null +++ b/common/build_style/waf3.sh @@ -0,0 +1,16 @@ +# +# This helper is for templates using WAF with python3 to build/install. +# +do_configure() { + PYTHON=python3 python3 waf configure --prefix=/usr ${configure_args} +} + +do_build() { + PYTHON=python3 python3 waf build ${make_build_args} +} + +do_install() { + make_install_args+=" --destdir=$DESTDIR" + + PYTHON=python3 python3 waf install ${make_install_args} +} diff --git a/common/cross-profiles/README b/common/cross-profiles/README new file mode 100644 index 00000000000..a9c0a13f417 --- /dev/null +++ b/common/cross-profiles/README @@ -0,0 +1,14 @@ +CROSS PROFILES +============== + +This directory contains cross profiles to allow cross compilation for the specified target. +A cross profile file must provide the following variables: + + - XBPS_TARGET_ARCH (as returned by uname -m) + - XBPS_CROSS_TRIPLET (the cross compiler triplet) + - XBPS_CFLAGS (C compiler flags for host compiler) + - XBPS_CXXFLAGS (C++ compiler flags for the host compiler) + - XBPS_CROSS_CFLAGS (C compiler flags for the cross compiler) + - XBPS_CROSS_CXXFLAGS (C++ compiler flags for the cross compiler) + +A source package matching `cross-${XBPS_CROSS_TRIPLET}' must also exist. diff --git a/common/cross-profiles/armv6hf-musl.sh b/common/cross-profiles/armv6hf-musl.sh new file mode 100644 index 00000000000..2f51fd08597 --- /dev/null +++ b/common/cross-profiles/armv6hf-musl.sh @@ -0,0 +1,8 @@ +# Cross build profile for ARM EABI5 Hard Float and Musl libc. + +XBPS_TARGET_ARCH="armv6l-musl" +XBPS_CROSS_TRIPLET="arm-linux-musleabi" +XBPS_CFLAGS="-O2 -pipe" +XBPS_CXXFLAGS="$XBPS_CFLAGS" +XBPS_CROSS_CFLAGS="-march=armv6 -mfpu=vfp -mfloat-abi=hard" +XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS" diff --git a/common/cross-profiles/armv6hf.sh b/common/cross-profiles/armv6hf.sh new file mode 100644 index 00000000000..0931f65194d --- /dev/null +++ b/common/cross-profiles/armv6hf.sh @@ -0,0 +1,8 @@ +# Cross build profile for ARM GNU EABI5 Hard Float. + +XBPS_TARGET_ARCH="armv6l" +XBPS_CROSS_TRIPLET="arm-linux-gnueabihf" +XBPS_CFLAGS="-O2 -pipe" +XBPS_CXXFLAGS="$XBPS_CFLAGS" +XBPS_CROSS_CFLAGS="-march=armv6 -mfpu=vfp -mfloat-abi=hard" +XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS" diff --git a/common/cross-profiles/armv7.sh b/common/cross-profiles/armv7.sh new file mode 100644 index 00000000000..0bebb311638 --- /dev/null +++ b/common/cross-profiles/armv7.sh @@ -0,0 +1,8 @@ +# Cross build profile for ARMv7 GNU EABI Hard Float. + +XBPS_TARGET_ARCH="armv7l" +XBPS_CROSS_TRIPLET="arm-linux-gnueabihf7" +XBPS_CFLAGS="-O2 -pipe" +XBPS_CXXFLAGS="$XBPS_CFLAGS" +XBPS_CROSS_CFLAGS="-march=armv7-a -mfpu=vfpv3 -mfloat-abi=hard" +XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS" diff --git a/common/cross-profiles/config.sub b/common/cross-profiles/config.sub new file mode 100644 index 00000000000..f66c6624bb5 --- /dev/null +++ b/common/cross-profiles/config.sub @@ -0,0 +1,1762 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011 Free Software Foundation, Inc. + +timestamp='2011-03-23' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Please send patches to . Submit a context +# diff and a properly formatted GNU ChangeLog entry. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free +Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ + linux-musl* | \ + linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | \ + kopensolaris*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray | -microblaze) + os= + basic_machine=$1 + ;; + -bluegene*) + os=-cnk + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fido | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | mcore | mep | metag \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ + | nios | nios2 \ + | ns16k | ns32k \ + | open8 \ + | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pyramid \ + | rx \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu \ + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | ubicom32 \ + | v850 | v850e \ + | we32k \ + | x86 | xc16x | xstormy16 | xtensa \ + | z8k | z80) + basic_machine=$basic_machine-unknown + ;; + c54x) + basic_machine=tic54x-unknown + ;; + c55x) + basic_machine=tic55x-unknown + ;; + c6x) + basic_machine=tic6x-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12 | picochip) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=mt-unknown + ;; + + strongarm | thumb | xscale) + basic_machine=arm-unknown + ;; + + xscaleeb) + basic_machine=armeb-unknown + ;; + + xscaleel) + basic_machine=armel-unknown + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ + | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64octeon-* | mips64octeonel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ + | nios-* | nios2-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | open8-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pyramid-* \ + | romp-* | rs6000-* | rx-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | tahoe-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile-* | tilegx-* \ + | tron-* \ + | ubicom32-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* \ + | xstormy16-* | xtensa*-* \ + | ymp-* \ + | z8k-* | z80-*) + ;; + # Recognize the basic CPU types without company name, with glob match. + xtensa*) + basic_machine=$basic_machine-unknown + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aros) + basic_machine=i386-pc + os=-aros + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=-linux + ;; + blackfin-*) + basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + bluegene*) + basic_machine=powerpc-ibm + os=-cnk + ;; + c54x-*) + basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c55x-*) + basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c6x-*) + basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16 | cr16-*) + basic_machine=cr16-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux + ;; + m68knommu-*) + basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + microblaze) + basic_machine=microblaze-xilinx + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + neo-tandem) + basic_machine=neo-tandem + ;; + nse-tandem) + basic_machine=nse-tandem + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + parisc) + basic_machine=hppa-unknown + os=-linux + ;; + parisc-*) + basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc | ppcbe) basic_machine=powerpc-unknown + ;; + ppc-* | ppcbe-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rdos) + basic_machine=i386-pc + os=-rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh5el) + basic_machine=sh5le-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + strongarm-* | thumb-*) + basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + # This must be matched before tile*. + tilegx*) + basic_machine=tilegx-unknown + os=-linux-gnu + ;; + tile*) + basic_machine=tile-unknown + os=-linux-gnu + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + xscale-* | xscalee[bl]-*) + basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + z80-*-coff) + basic_machine=z80-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -auroraux) + os=-auroraux + ;; + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* | -aros* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -openbsd* | -solidbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* | -cegcc* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-uclibc* \ + | -linux-musl* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; + -zvmoe) + os=-zvmoe + ;; + -dicos*) + os=-dicos + ;; + -nacl*) + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + tic54x-*) + os=-coff + ;; + tic55x-*) + os=-coff + ;; + tic6x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mep-*) + os=-elf + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -cnk*|-aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/common/cross-profiles/i686-musl.sh b/common/cross-profiles/i686-musl.sh new file mode 100644 index 00000000000..e9004a546df --- /dev/null +++ b/common/cross-profiles/i686-musl.sh @@ -0,0 +1,8 @@ +# Cross build profile for i686 and Musl libc. + +XBPS_TARGET_ARCH="i686-musl" +XBPS_CROSS_TRIPLET="i686-linux-musl" +XBPS_CFLAGS="-O2 -pipe" +XBPS_CXXFLAGS="$XBPS_CFLAGS" +XBPS_CROSS_CFLAGS="-march=i686" +XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS" diff --git a/common/cross-profiles/i686.sh b/common/cross-profiles/i686.sh new file mode 100644 index 00000000000..2cf14e80e99 --- /dev/null +++ b/common/cross-profiles/i686.sh @@ -0,0 +1,8 @@ +# Cross build profile for i686 GNU. + +XBPS_TARGET_ARCH="i686" +XBPS_CROSS_TRIPLET="i686-pc-linux-gnu" +XBPS_CFLAGS="-O2 -pipe" +XBPS_CXXFLAGS="$XBPS_CFLAGS" +XBPS_CROSS_CFLAGS="-march=i686 -mtune=generic" +XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS" diff --git a/common/cross-profiles/mips.sh b/common/cross-profiles/mips.sh new file mode 100644 index 00000000000..74e14a66e6a --- /dev/null +++ b/common/cross-profiles/mips.sh @@ -0,0 +1,8 @@ +# Cross build profile for MIPS BE soft float. + +XBPS_TARGET_ARCH="mips" +XBPS_CROSS_TRIPLET="mips-softfloat-linux-gnu" +XBPS_CFLAGS="-O2 -pipe" +XBPS_CXXFLAGS="$XBPS_CFLAGS" +XBPS_CROSS_CFLAGS="-mtune=mips32r2 -mabi=32 -msoft-float" +XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS" diff --git a/common/cross-profiles/mipsel.sh b/common/cross-profiles/mipsel.sh new file mode 100644 index 00000000000..7335138b946 --- /dev/null +++ b/common/cross-profiles/mipsel.sh @@ -0,0 +1,8 @@ +# Cross build profile for MIPS LE soft float. + +XBPS_TARGET_ARCH="mipsel" +XBPS_CROSS_TRIPLET="mipsel-softfloat-linux-gnu" +XBPS_CFLAGS="-O2 -pipe" +XBPS_CXXFLAGS="$XBPS_CFLAGS" +XBPS_CROSS_CFLAGS="-mtune=mips32r2 -mabi=32 -msoft-float" +XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS" diff --git a/common/cross-profiles/musl-gnulibfix b/common/cross-profiles/musl-gnulibfix new file mode 100644 index 00000000000..a9ff663d3a4 --- /dev/null +++ b/common/cross-profiles/musl-gnulibfix @@ -0,0 +1,179 @@ +#!/bin/sh +empty_file() { + rm -f "$1" + touch "$1" +} + +dir="$1" +# fix files breaking the build entirely +for i in fseeko.c freadahead.c fseterr.c ; do empty_file "$dir"/$i ; done +echo "void close_stdin(void) {}" > "$dir"/closein.c + +# fix stuff trying to reimplement libc +culprits=`cat << EOF +accept4 +acosl +alloca +alphasort +asinl +asprintf +atanl +atexit +atoll +bcopy +btowc +chown +closedir +cosl +dirfd +dprintf +dup2 +dup3 +_Exit +expl +fchdir +fchown-stub +fdatasync +fdopendir +ffs +flock +fnmatch +forkpty +fpending +fprintf +freeaddrinfo +fsync +ftell +ftruncate +futimens +gai_strerror +getaddrinfo +getdelim +getdtablesize +getgroups +gethostname +getline +getlogin +getlogin_r +getnameinfo +getpagesize +getpass +getsubopt +gettimeofday +getusershell +gmtime_r +grantpt +imaxabs +imaxdiv +inet_ntop +inet_pton +isblank +iswblank +lchmod +lchown +ldexp +ldexpl +link +linkat +logl +mbrlen +mbrtowc +mbsinit +memmove +mempcpy +mkdtemp +mkfifo +mkfifoat +mknod +mknodat +mkstemp +mktime +nanosleep +nl_langinfo +open +openat +opendir +openpty +pclose +perror +pipe +pipe2 +poll +popen +pread +pselect +ptsname +pwrite +raise +readdir +readlink +renameat +rewinddir +setenv +sigaction +sigaddset +sigdelset +sigemptyset +sigfillset +sigismember +sigpending +sigprocmask +sinl +snprintf +spawnattr_destroy +spawnattr_getdefault +spawnattr_getflags +spawnattr_getpgroup +spawnattr_getsigmask +spawnattr_init +spawnattr_setdefault.c +spawnattr_setflags +spawnattr_setpgroup +spawnattr_setsigmask +spawn_faction_addclose +spawn_faction_adddup2 +spawn_faction_addopen +spawn_faction_destroy +spawn_faction_init +spawn_factions_addopen +spawn_factions_destroy +spawn_factions_init +sprintf +sqrtl +stdio-read +stdio-write +strcasecmp +strcasestr +strchrnul +strcspn +strncasecmp +strndup +strnlen +strpbrk +strsep +strsignal +strstr +strtod +strtoimax +strtol +symlink +symlinkat +tanl +tcgetsid +timegm +time_r +times +tmpfile +uname +unlockpt +unsetenv +usleep +vasprintf +vdprintf +waitpid +wcrtomb +wctob +EOF +` +#fixme check fsusage +for i in $culprits ; do empty_file "$dir"/$i.c ; done diff --git a/common/cross-profiles/x86_64-musl.sh b/common/cross-profiles/x86_64-musl.sh new file mode 100644 index 00000000000..7df635af1ff --- /dev/null +++ b/common/cross-profiles/x86_64-musl.sh @@ -0,0 +1,8 @@ +# Cross build profile for x86_64 and Musl libc. + +XBPS_TARGET_ARCH="x86_64-musl" +XBPS_CROSS_TRIPLET="x86_64-linux-musl" +XBPS_CFLAGS="-O2 -pipe" +XBPS_CXXFLAGS="$XBPS_CFLAGS" +XBPS_CROSS_CFLAGS="-mtune=generic" +XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS" diff --git a/common/environment/0000-REQUIREMENTS.sh b/common/environment/0000-REQUIREMENTS.sh new file mode 100644 index 00000000000..92fc4eb4427 --- /dev/null +++ b/common/environment/0000-REQUIREMENTS.sh @@ -0,0 +1,16 @@ +# -*- shell mode -*- +# +# Sets the minimal required xbps versions to build packages. +# +# ========================================================= +# DO NOT MODIFY THIS FILE WITHOUT PRIOR WRITTEN PERMISSION! +# ========================================================= +# +# xbps-src version. +export XBPS_SRC_REQ=100 + +# XBPS utils version. +export XBPS_UTILS_REQ=0.29 + +# XBPS utils API version. +export XBPS_UTILS_API_REQ=20131224 diff --git a/common/environment/0001-bootstrap.sh b/common/environment/0001-bootstrap.sh new file mode 100644 index 00000000000..5d4aed052e8 --- /dev/null +++ b/common/environment/0001-bootstrap.sh @@ -0,0 +1,6 @@ +# This file sets some envvars to allow building bootstrap packages +# when the chroot is not yet ready. + +[ -z "$CHROOT_READY" ] && return 0 + +export PKG_CONFIG_PATH="${XBPS_MASTERDIR}/usr/lib/pkgconfig:${XBPS_MASTERDIR}/usr/share/pkgconfig" diff --git a/common/environment/0001-configure-args.sh b/common/environment/0001-configure-args.sh new file mode 100644 index 00000000000..e9b5fb7e5e6 --- /dev/null +++ b/common/environment/0001-configure-args.sh @@ -0,0 +1,6 @@ +# This file sets up configure_args with commong settings for packages +# that don't set $build_style or set it to gnu-configure. + +if [ "$build_style" = "gnu-configure" -o -z "$build_style" ]; then + export configure_args="--prefix=/usr --sysconfdir=/etc --infodir=/usr/share/info --mandir=/usr/share/man --localstatedir=/var ${configure_args}" +fi diff --git a/common/environment/0002-cross.sh b/common/environment/0002-cross.sh new file mode 100644 index 00000000000..109bbfc80b3 --- /dev/null +++ b/common/environment/0002-cross.sh @@ -0,0 +1,11 @@ +# This file sets some envvars to allow cross compiling packages. + +[ -z "$CROSS_BUILD" ] && return 0 + +export PKG_CONFIG_SYSROOT_DIR="$XBPS_CROSS_BASE" +export PKG_CONFIG_PATH="$XBPS_CROSS_BASE/lib/pkgconfig:$XBPS_CROSS_BASE/usr/share/pkgconfig" +export PKG_CONFIG_LIBDIR="$XBPS_CROSS_BASE/lib/pkgconfig" + +if [ "$build_style" = "gnu-configure" -o -z "$build_style" ]; then + export configure_args+=" --host=$XBPS_CROSS_TRIPLET --with-sysroot=$XBPS_CROSS_BASE --with-libtool-sysroot=$XBPS_CROSS_BASE " +fi diff --git a/common/vars.sh b/common/environment/0003-misc.sh similarity index 100% rename from common/vars.sh rename to common/environment/0003-misc.sh diff --git a/common/environment/README b/common/environment/README new file mode 100644 index 00000000000..99812870e10 --- /dev/null +++ b/common/environment/README @@ -0,0 +1,11 @@ +ENVIRONMENT SHELL SNIPPETS +========================== + +This directory contains shell files (must not be executable nor contain a shebang) +that are read by xbps-src when building source packages. The shell files +are read in lexical order (as ordered by shell rules). + +These files shall set environment variables for use in the xbps-src helpers +(libexec/xbps-src-*). Only files with the `.sh' extension are read, so this file +will be simply ignored. + diff --git a/common/global-defs.sh b/common/global-defs.sh deleted file mode 100644 index fcda9830d22..00000000000 --- a/common/global-defs.sh +++ /dev/null @@ -1,23 +0,0 @@ -# -*- shell mode -*- -# -# Sets globally the minimal versions required by the xbps source packages. -# -# ========================================================= -# DO NOT MODIFY THIS FILE WITHOUT PRIOR WRITTEN PERMISSION! -# ========================================================= -# -# Every time a new source package requires a specific feature from a new -# 'xbps-src', 'xbps' or 'base-chroot' package, that version must be -# increased to "reproduce" the build behaviour (somewhat :-). - -# xbps-src version. -XBPS_SRC_REQ=83 - -# XBPS utils version. -XBPS_UTILS_REQ=0.26.1 - -# XBPS utils API version. -XBPS_UTILS_API_REQ=20130918 - -# base-chroot version. -BASE_CHROOT_REQ=0.40_1 diff --git a/common/helpers/README b/common/helpers/README new file mode 100644 index 00000000000..ff5e3b865cf --- /dev/null +++ b/common/helpers/README @@ -0,0 +1,25 @@ +SHELL HELPERS +============= + +This directory contains shell files that are read by xbps-src and can be used at any +phase when building source packages. Only files with the `.sh' extension will be read. + +A shell helper must provide its own function for use in the source packages. +The following examples illustrates a fake helper named `myhelper.sh' that provides +the `myhelper_func' function: + +myhelper.sh: +... +myhelper_func() { + ... +} +... + +You can then use this helper in a source package like this: + +srcpkgs/foo/template: +... +do_install() { + myhelper_func ... +} +... diff --git a/common/helpers/replace-interpreter.sh b/common/helpers/replace-interpreter.sh new file mode 100644 index 00000000000..1660ac6fa1b --- /dev/null +++ b/common/helpers/replace-interpreter.sh @@ -0,0 +1,41 @@ +# This helper replaces shebang paths pointing to the correct ones +# as used by xbps. Multiple languages are supported: +# +# - GNU Bash +# - Perl +# - Python +# + +bash_regexp=".*sh" +perl_regexp=".*perl[^[:space:]]*" +python_regexp=".*python[^[:space:]]*" + +replace_interpreter() { + local lang="$1" file="$2" trsb orsb + + [ -z $lang -o -z $file ] && return 1 + + case $lang in + bash) + orsb=$bash_regexp + trpath="/bin/bash" + ;; + perl) + orsb=$perl_regexp + trpath="/usr/bin/perl" + ;; + python) + orsb=$python_regexp + trpath="/usr/bin/python" + ;; + *) + ;; + esac + + if [ -f $file ]; then + sed -i -e "1s|^#![[:space:]]*${orsb}|#!${trpath}|" $file + msg_normal "Transformed $lang script: ${file##$wrksrc}.\n" + else + msg_warn "Ignoring unexistent $lang script: ${file##$wrksrc}.\n" + fi +} diff --git a/common/shlibs b/common/shlibs index a76b9ca0572..88d8fd1bf96 100644 --- a/common/shlibs +++ b/common/shlibs @@ -105,9 +105,11 @@ libXrender.so.1 libXrender-0.9.4_1 libXrandr.so.2 libXrandr-1.3.0_1 libGLU.so.1 glu-9.0.0_1 libEGL.so.1 libEGL-7.11_1 +libEGL.so libEGL-1.0_1 +libGLESv1_CM.so libGLES-1.0_1 +libGLESv1_CM.so.1 libGLES-1.0_1 +libGLESv2.so libGLES-1.0_1 libwayland-egl.so.1 libwayland-egl-9.0.1_4 -libGLESv1_CM.so.1 libGLES-9.0.1_1 -libGLESv2.so.2 libGLES-9.0.1_1 libGL.so.1 libGL-7.11_1 libglapi.so.0 libglapi-7.11_1 libOpenVG.so.1 libOpenVG-7.11_1 @@ -440,7 +442,6 @@ libphysfs.so.1 physfs-2.0.0_1 libSDL_ttf-2.0.so.0 SDL_ttf-2.0.9_1 libparted.so.2 libparted-3.1_1 libparted-fs-resize.so.0 libparted-3.1_1 -libopenobex.so.1 libopenobex-1.5_1 libntfs-3g.so.84 ntfs-3g-2013.1.13_1 libruby.so.1.9 ruby-1.9.3_1 libruby.so.2.0 ruby-2.0.0_1 @@ -921,6 +922,7 @@ libgtksourceviewmm-3.0.so.0 gtksourceviewmm-3.2.0_1 libyajl.so.2 yajl-2.0.1_1 libconfuse.so.0 confuse-2.7_1 libLLVM-3.3.so libllvm-3.3_4 +libLLVM-3.4.so libllvm-3.4_1 libisofs.so.6 libisofs-0.6.24_1 libbfd-2.22.so binutils-2.22_1<2.23_1 libopcodes-2.22.so binutils-2.22_1<2.23_1 @@ -1193,8 +1195,6 @@ libtaginfo_c.so.0 libtaginfo-0.1.3_1 libaa.so.1 aalib-1.4rc4_2 libbsd.so.0 libbsd-0.4.2_1 libWFC.so rpi-firmware-20130228_1 -libGLESv2.so rpi-firmware-20130228_1 -libEGL.so rpi-firmware-20130228_1 libbcm_host.so rpi-firmware-20130228_1 libopenmaxil.so rpi-firmware-20130228_1 libvchiq_arm.so rpi-firmware-20130228_1 @@ -1392,7 +1392,7 @@ libSDL2-2.0.so.0 SDL2-2.0.0_1 libcacard.so.0 libcacard-1.6.1_1 libxcb-cursor.so.0 xcb-util-cursor-0.1.0_1 libgldi.so.3 libgldi-3.3.1_1 -libevdev.so.1 libevdev-0.4_1 +libevdev.so.1 libevdev-0.6_1 libmutter-wayland.so.0 mutter-wayland-3.10.1_1 libgdiplus.so.0 libgdiplus-2.10.9_1 libmonosgen-2.0.so.1 mono-3.2.3_1 @@ -1446,3 +1446,13 @@ libcinnamon-desktop.so.4 cinnamon-desktop-2.0.4_1 libcinnamon-control-center.so.1 cinnamon-control-center-2.0.9_1 libnemo-extension.so.1 libnemo-2.0.8_1 libxshmfence.so.1 libxshmfence-1.1_1 +libgoffice-0.8.so.8 goffice0.8-0.8.13_1 +libgoffice-0.10.so.10 goffice-0.10.9_1 +libc++.so.1 libcxx-3.4_1 +libopenobex.so.2 openobex-1.7.1_1 +libnotmuch.so.3 libnotmuch-0.17_2 +libdri2.so.1 libdri2-0.1_1 +libUMP.so libump-1.0_1 +libUMP.so.3 libump-1.0_1 +libatomic_ops_gpl.so.0 libatomic_ops-7.2e_1 +libatomic_ops.so.0 libatomic_ops-7.2e_1 diff --git a/doc/manual.txt b/doc/manual.txt index a8af37c0fd7..88bc6c801c6 100644 --- a/doc/manual.txt +++ b/doc/manual.txt @@ -1,3 +1,5 @@ +// vim: set syntax=asciidoc: + The XBPS source packages manual =============================== Juan RP @@ -8,7 +10,7 @@ Juan RP :website: http://www.voidlinux.eu This article contains an exhaustive manual of how to create new source -packages for XBPS, the package manager of the *Void Linux distribution*. +packages for XBPS, the `Void Linux` native packaging system. Introduction ------------ @@ -25,11 +27,10 @@ A simple `template` example is as follows: -------------------------------------------------------------------------- # Template file for 'foo' -## source section pkgname="foo" version="1.0" -revision="1" -build_style="gnu-configure" +revision=1 +build_style=gnu-configure short_desc="A short description max 72 chars" maintainer="name " license="GPL-3" @@ -37,22 +38,20 @@ homepage="http://www.foo.org" distfiles="http://www.foo.org/foo-${version}.tar.gz" checksum="fea0a94d4b605894f3e2d5572e3f96e4413bcad3a085aae7367c2cf07908b2ff" -## package section -foo_package() { - pkg_install() { - vmove all - } +## optional +foo-devel_package() { + short_desc+=" - development files" + depends="..." + pkg_install() { + vmove usr/include + } } --------------------------------------------------------------------------- -There are two main `sections` in a template: the `source section` and the -`package section`. The `source section` contains definitions to download, build -and install the package files to a `fake destdir`. The `package section` -contains the definitions to how the resulting binary packages are generated. - -A template always requires at least a `source section` and a `package section`; -multiple `package sections` can be defined to generate `multiple binary packages`. +The template file contains definitions to download, build and install the +package files to a `fake destdir`, and after this a binary package can be +generated with the definitions specified on it. Don't worry if anything is not clear as it should be. The reserved `variables` and `functions` will be explained later. This `template` file should be created @@ -61,7 +60,7 @@ If everything went fine after running `xbps-src build-pkg` a binary package called `foo-1.0_1..xbps` will be generated in the local repository. Additional binary packages (those defined in `_package() blocks` need a -symlink to the `main` package, like this: +symlink to the `main` package), like this: ---------------------------------- @@ -80,25 +79,25 @@ Package build phases Building a package consist of the following phases: *fetch*:: - This phase downloads required sources for a `source package`, as defined by - the `distfiles` variable or `do_fetch()` function. + This phase downloads required sources for a `source package`, as defined by +the `distfiles` variable or `do_fetch()` function. *extract*:: - This phase extracts the `distfiles` files into `$wrksrc` or executes the `do_extract()` - function, which is the directory to be used to compile the `source package`. + This phase extracts the `distfiles` files into `$wrksrc` or executes the `do_extract()` +function, which is the directory to be used to compile the `source package`. *configure*:: - This phase executes the `configuration` of a `source package`, i.e `GNU configure scripts`. + This phase executes the `configuration` of a `source package`, i.e `GNU configure scripts`. *build*:: - This phase compiles/prepares the `source files` via `make` or any other compatible method. + This phase compiles/prepares the `source files` via `make` or any other compatible method. *install-destdir*:: - This phase installs the `package files` into a `fake destdir`, via `make install` or - any other compatible method. + This phase installs the `package files` into a `fake destdir`, via `make install` or +any other compatible method. *build-pkg*:: - This phase builds the `binary packages` with files stored in the `package destdir`. + This phase builds the `binary packages` with files stored in the `package destdir`. `xbps-src` supports running just the specified phase, and if it ran successfully, the phase will be skipped later (unless its work directory @@ -111,28 +110,28 @@ The following functions are defined by `xbps-src` and can be used on any templat *vinstall()*:: `vinstall []` - Installs `file` with the specified `mode` into `targetdir` in `$DESTDIR` - (if called from a `source section`) or `$PKGDESTDIR` (if called from a `package section`). - The optional 4th argument can be used to change the `file name`. +Installs `file` with the specified `mode` into `targetdir` in `$DESTDIR` +(if called from a `source section`) or `$PKGDESTDIR` (if called from a `package section`). +The optional 4th argument can be used to change the `file name`. *vcopy()*:: `vcopy ` - Copies resursively all files in `pattern` to `targetdir` on `$DESTDIR` - (if called from a `source section`) or `$PKGDESTDIR` (if called from a `package section`). +Copies resursively all files in `pattern` to `targetdir` on `$DESTDIR` +(if called from a `source section`) or `$PKGDESTDIR` (if called from a `package section`). *vmove()*:: `vmove ` - Moves `pattern` to the specified directory in `$DESTDIR` - (if called from a `source section`) or `$PKGDESTDIR` (if called from a `package section`). +Moves `pattern` to the specified directory in `$DESTDIR` +(if called from a `source section`) or `$PKGDESTDIR` (if called from a `package section`). *vmkdir()*:: `vmkdir []` - Creates a directory in `$DESTDIR` (if called from a `source section`) or - $PKGDESTDIR` (if called from a `package section`). The 2nd optional argument - sets the mode of the directory. +Creates a directory in `$DESTDIR` (if called from a `source section`) or +`$PKGDESTDIR` (if called from a `package section`). The 2nd optional argument +sets the mode of the directory. NOTE: shell wildcards must be properly quoted. @@ -141,38 +140,40 @@ Global variables The following variables are defined by `xbps-src` and can be used on any template: *makejobs*:: - Set to `-jX` if `XBPS_MAKEJOBS` is defined, to allow parallel jobs with `GNU make`. + Set to `-jX` if `XBPS_MAKEJOBS` is defined, to allow parallel jobs with `GNU make`. *sourcepkg*:: - Set to the to main package name, can be used to match the main package - rather than additional binary package names. + Set to the to main package name, can be used to match the main package +rather than additional binary package names. *CHROOT_READY*:: - True if the target chroot (masterdir) is ready for chroot builds. + True if the target chroot (masterdir) is ready for chroot builds. *CROSS_BUILD*:: - True if `xbps-src` is cross compiling a package. + True if `xbps-src` is cross compiling a package. *DESTDIR*:: - Full path to the fake destdir used by the `source section`, set to - `${XBPS_MASTERDIR}/destdir/${sourcepkg}-${version}`. + Full path to the fake destdir used by the `source section`, set to +`${XBPS_MASTERDIR}/destdir/${sourcepkg}-${version}`. *PKGDESTDIR*:: - Full path to the fake destdir used by the `pkg_install()` function in the - `package section`, set to `${XBPS_MASTERDIR}/destdir/pkg-${pkgname}-${version}`. + Full path to the fake destdir used by the `pkg_install()` function in the +`package section`, set to `${XBPS_MASTERDIR}/destdir/${pkgname}-${version}`. *XBPS_MACHINE*:: - The machine architecture as returned by `uname -m`. + The machine architecture as returned by `uname -m`. *XBPS_SRCDISTDIR*:: - Full path to where the `source distfiles` are stored, i.e `$XBPS_HOSTDIR/sources`. + Full path to where the `source distfiles` are stored, i.e `$XBPS_HOSTDIR/sources`. *XBPS_SRCPKGDIR*:: - Full path to the `srcpkgs` directory. + Full path to the `srcpkgs` directory. *XBPS_TARGET_MACHINE*:: - The target machine architecture when cross compiling a package. + The target machine architecture when cross compiling a package. +*XBPS_FETCH_CMD*:: + The utility to fetch files from `ftp`, `http` of `https` servers. Source section -------------- @@ -181,150 +182,167 @@ Mandatory variables The list of mandatory variables in the `source section`: *homepage*:: - A string pointing to the `upstream` homepage. + A string pointing to the `upstream` homepage. *license*:: - A string matching any license file available in `/usr/share/licenses`. - Multiple licenses should be separated by commas, i.e `GPL-3, LGPL-2.1`. + A string matching any license file available in `/usr/share/licenses`. +Multiple licenses should be separated by commas, i.e `GPL-3, LGPL-2.1`. *maintainer*:: - A string in the form of `name `. + A string in the form of `name `. *pkgname*:: - A string with the package name, matching `srcpkgs/`. + A string with the package name, matching `srcpkgs/`. *revision*:: - A number that must be set to 1 when the `source package` is created, or - updated to a new `upstream version`. This should only be increased when - the generated `binary packages` have been modified. + A number that must be set to 1 when the `source package` is created, or +updated to a new `upstream version`. This should only be increased when +the generated `binary packages` have been modified. *short_desc*:: - A string with a brief description for this package. Max 72 chars. + A string with a brief description for this package. Max 72 chars. *version*:: - A string with the package version. Must not contain dashes and at least - one digit is required. + A string with the package version. Must not contain dashes and at least +one digit is required. Optional variables ~~~~~~~~~~~~~~~~~~ *hostmakedepends*:: - The list of `host` dependencies required to build the package. Dependencies - can be specified with the following version comparators: `<`, `>`, `<=`, `>=` - or `foo-1.0_1` to match an exact version. If version comparator is not - defined (just a package name), the version comparator is automatically set to `>=0`. - Example `hostmakedepends="foo blah<1.0"`. + The list of `host` dependencies required to build the package. Dependencies +can be specified with the following version comparators: `<`, `>`, `<=`, `>=` +or `foo-1.0_1` to match an exact version. If version comparator is not +defined (just a package name), the version comparator is automatically set to `>=0`. +Example `hostmakedepends="foo blah<1.0"`. *makedepends*:: - The list of `target` dependencies required to build the package. Dependencies - can be specified with the following version comparators: `<`, `>`, `<=`, `>=` - or `foo-1.0_1` to match an exact version. If version comparator is not - defined (just a package name), the version comparator is automatically set to `>=0`. - Example `makedepends="foo blah>=1.0"`. + The list of `target` dependencies required to build the package. Dependencies +can be specified with the following version comparators: `<`, `>`, `<=`, `>=` +or `foo-1.0_1` to match an exact version. If version comparator is not +defined (just a package name), the version comparator is automatically set to `>=0`. +Example `makedepends="foo blah>=1.0"`. *bootstrap*:: - If enabled the source package is considered to be part of the `bootstrap` - process and required to be able to build packages in the chroot. Only a - small number of packages must set this property. + If enabled the source package is considered to be part of the `bootstrap` +process and required to be able to build packages in the chroot. Only a +small number of packages must set this property. *distfiles*:: - The full URL to the `upstream` source distribution files. Multiple files - can be separated by blanks. The files must end in `.tar.lzma`, `.tar.xz`, - `.txz`, `.tar.bz2`, `.tbz`, `.tar.gz`, `.tgz`, `.gz`, `.bz2`, `.tar` or - `.zip`. Example `distfiles="http://foo.org/foo-1.0.tar.gz"` + The full URL to the `upstream` source distribution files. Multiple files +can be separated by blanks. The files must end in `.tar.lzma`, `.tar.xz`, +`.txz`, `.tar.bz2`, `.tbz`, `.tar.gz`, `.tgz`, `.gz`, `.bz2`, `.tar` or +`.zip`. Example `distfiles="http://foo.org/foo-1.0.tar.gz"` *checksum*:: - The `sha256` digests matching `${distfiles}`. Multiple files can be - separated by blanks. Please note that the order must be the same than - was used in `${distfiles}`. Example `checksum="kkas00xjkjas"` + The `sha256` digests matching `${distfiles}`. Multiple files can be +separated by blanks. Please note that the order must be the same than +was used in `${distfiles}`. Example `checksum="kkas00xjkjas"` *long_desc*:: - A long description of the main package. Max 80 chars per line and must - not contain the following characters: `&`, `<`, `>`. + A long description of the main package. Max 80 chars per line and must +not contain the following characters: `&`, `<`, `>`. *wrksrc*:: - The directory name where the package sources are extracted, by default - set to `${pkgname}-${version}`. + The directory name where the package sources are extracted, by default +set to `${pkgname}-${version}`. *build_wrksrc*:: - A directory relative to `${wrksrc}` that will be used when building the package. + A directory relative to `${wrksrc}` that will be used when building the package. *create_wrksrc*:: - Enable it to create the `${wrksrc}` directory. Required if a package - contains multiple `distfiles`. + Enable it to create the `${wrksrc}` directory. Required if a package +contains multiple `distfiles`. *only_for_archs*:: - This expects a separated list of architectures where the package can be - built matching `uname -m` output. Example `only_for_archs="x86_64 armv6l"` + This expects a separated list of architectures where the package can be +built matching `uname -m` output. Example `only_for_archs="x86_64 armv6l"` *build_style*:: - This specifies the `build method` for a package. Read below to know more - about the available package `build methods`. If `build_style` is not set, - the package must define at least a `do_install()` function, and optionally - more build phases as such `do_configure()`, `do_build()`, etc. + This specifies the `build method` for a package. Read below to know more +about the available package `build methods`. If `build_style` is not set, +the package must define at least a `do_install()` function, and optionally + more build phases as such `do_configure()`, `do_build()`, etc. *create_srcdir*:: - This creates a directory in `${XBPS_SRCDISTDIR}` as such `${pkgname}-${version}` - to store the package sources at the `extract` phase. Required in packages that - use unversioned ${distfiles}`. + This creates a directory in `${XBPS_SRCDISTDIR}` as such `${pkgname}-${version}` +to store the package sources at the `extract` phase. Required in packages that +use unversioned ${distfiles}`. *configure_script*:: - The name of the `configure` script to execute at the `configure` phase if - `${build_style}` is set to `configure` or `gnu-configure` build methods. - By default set to `./configure`. + The name of the `configure` script to execute at the `configure` phase if +`${build_style}` is set to `configure` or `gnu-configure` build methods. +By default set to `./configure`. *configure_args*:: - The arguments to be passed in to the `configure` script if `${build_style}` - is set to `configure` or `gnu-configure` build methods. By default, prefix - must be set to `/usr`. In `gnu-configure` packages, some options are already - set by default: `--prefix=/usr --sysconfdir=/etc --infodir=/usr/share/info --mandir=/usr/share/man --localstatedir=/var`. + The arguments to be passed in to the `configure` script if `${build_style}` +is set to `configure` or `gnu-configure` build methods. By default, prefix +must be set to `/usr`. In `gnu-configure` packages, some options are already +set by default: `--prefix=/usr --sysconfdir=/etc --infodir=/usr/share/info --mandir=/usr/share/man --localstatedir=/var`. *make_cmd*:: - The executable to run at the `build` phase if `${build_style}` is set to - `configure`, `gnu-configure` or `gnu-makefile` build methods. - By default set to `make`. + The executable to run at the `build` phase if `${build_style}` is set to +`configure`, `gnu-configure` or `gnu-makefile` build methods. +By default set to `make`. *make_build_args*:: - The arguments to be passed in to `${make_cmd}` at the build phase if - `${build_style}` is set to `configure`, `gnu-configure` or `gnu_makefile` - build methods. Unset by default. + The arguments to be passed in to `${make_cmd}` at the build phase if +`${build_style}` is set to `configure`, `gnu-configure` or `gnu_makefile` +build methods. Unset by default. *make_install_args*:: - The arguments to be passed in to `${make_cmd}` at the `install-destdir` - phase if `${build_style}` is set to `configure`, `gnu-configure` or - `gnu_makefile` build methods. Unset by default. + The arguments to be passed in to `${make_cmd}` at the `install-destdir` +phase if `${build_style}` is set to `configure`, `gnu-configure` or +`gnu_makefile` build methods. By default set to +`PREFIX=/usr DESTDIR=${DESTDIR}`. *make_build_target*:: - The target to be passed in to `${make_cmd}` at the build phase if - `${build_style}` is set to `configure`, `gnu-configure` or `gnu_makefile` - build methods. Unset by default (`all` target). + The target to be passed in to `${make_cmd}` at the build phase if +`${build_style}` is set to `configure`, `gnu-configure` or `gnu_makefile` +build methods. Unset by default (`all` target). *make_install_target*:: - The target to be passed in to `${make_cmd}` at the `install-destdir` phase - if `${build_style}` is set to `configure`, `gnu-configure` or `gnu_makefile` - build methods. By default set to `DESTDIR=${DESTDIR} install`. + The target to be passed in to `${make_cmd}` at the `install-destdir` phase +if `${build_style}` is set to `configure`, `gnu-configure` or `gnu_makefile` +build methods. By default set to `install`. *patch_args*:: - The arguments to be passed in to the `patch(1)` command when applying - patches to the package sources after `do_extract()`. Patches are stored in - `srcpkgs//patches` and must be in `-p0` format. By default set to `-Np0`. + The arguments to be passed in to the `patch(1)` command when applying +patches to the package sources after `do_extract()`. Patches are stored in +`srcpkgs//patches` and must be in `-p0` format. By default set to `-Np0`. *disable_parallel_build*:: - If set the package won't be built in parallel and `XBPS_MAKEJOBS` has no effect. + If set the package won't be built in parallel and `XBPS_MAKEJOBS` has no effect. *keep_libtool_archives*:: - If enabled the `GNU Libtool` archives won't be removed. By default those - files are always removed automatically. + If enabled the `GNU Libtool` archives won't be removed. By default those +files are always removed automatically. *skip_extraction*:: - A list of filenames that should not be extracted in the `extract` phase. - This must match the basename of any url defined in `${distfiles}`. - Example `skip_extraction="foo-${version}.tar.gz"`. + A list of filenames that should not be extracted in the `extract` phase. +This must match the basename of any url defined in `${distfiles}`. +Example `skip_extraction="foo-${version}.tar.gz"`. *force_debug_pkgs*:: - If enabled binary packages with debugging symbols will be generated - even if `XBPS_DEBUG_PKGS` is disabled in `xbps-src.conf` or in the - `command line arguments`. + If enabled binary packages with debugging symbols will be generated +even if `XBPS_DEBUG_PKGS` is disabled in `xbps-src.conf` or in the +`command line arguments`. + +*conf_files*:: +A list of configuration files the binary package owns; this expects full +paths, and multiple entries can be separated by blanks, i.e: +`conf_files="/etc/foo.conf /etc/foo2.conf"`. + +*noarch*:: + If set, the binary package is not architecture specific and can be shared +by all supported architectures. + +*nonfree*:: + If set, the binary package will be put into the *non free* repository. + +*nostrip*:: + If set, the ELF binaries with debugging symbols won't be stripped. By +default all binaries are stripped. build style scripts ~~~~~~~~~~~~~~~~~~~ @@ -336,42 +354,48 @@ to execute a `build_style` script must be defined via `hostmakedepends`. The current list of available `build_style` scripts is the following: *cmake*:: - For packages that use the CMake build system, configuration arguments - can be passed in via `configure_args`. + For packages that use the CMake build system, configuration arguments +can be passed in via `configure_args`. *configure*:: - For packages that use non-GNU configure scripts, at least `--prefix=/usr` - should be passed in via `configure_args`. + For packages that use non-GNU configure scripts, at least `--prefix=/usr` +should be passed in via `configure_args`. *gnu-configure*:: - For packages that use GNU configure scripts, additional configuration - arguments can be passed in via `configure_args`. + For packages that use GNU configure scripts, additional configuration +arguments can be passed in via `configure_args`. *gnu-makefile*:: - For packages that use GNU make, build arguments can be passed in via - `make_build_args` and install arguments via `make_install_args`. The build - target can be overriden via `make_build_target` and the install target + For packages that use GNU make, build arguments can be passed in via +`make_build_args` and install arguments via `make_install_args`. The build +target can be overriden via `make_build_target` and the install target +via `make_install_target`. *meta*:: - For `meta-packages`, i.e packages that only install local files or simply - depend on additional packages. + For `meta-packages`, i.e packages that only install local files or simply +depend on additional packages. This build style does not install +dependencies to the root directory, and only checks if a binary package is +available in repositories. *perl-ModuleBuild*:: - For packages that use the Perl - http://search.cpan.org/~leont/Module-Build-0.4202/lib/Module/Build.pm[Module::Build] method. + For packages that use the Perl +http://search.cpan.org/~leont/Module-Build-0.4202/lib/Module/Build.pm[Module::Build] method. *perl*:: - For packages that use the Perl - http://perldoc.perl.org/ExtUtils/MakeMaker.html[ExtUtils::MakeMaker] build method. + For packages that use the Perl +http://perldoc.perl.org/ExtUtils/MakeMaker.html[ExtUtils::MakeMaker] build method. *python-module*:: - For packages that use the Python module build method (setup.py). + For packages that use the Python module build method (setup.py). *waf3*:: - For packages that use the Python3 `waf` build method with python3. + For packages that use the Python3 `waf` build method with python3. *waf*:: - For packages that use the Python `waf` method with python2. + For packages that use the Python `waf` method with python2. + +NOTE: if `build_style` is not set, the template must (at least) define a +`do_install()` function and optionally more phases via `do_xxx()` functions. Functions ~~~~~~~~~ @@ -379,80 +403,47 @@ The following functions can be defined to change the behavior of how the package is downloaded, compiled and installed. *do_fetch()*:: - if defined and `distfiles` is not set, use it to fetch the required sources. + if defined and `distfiles` is not set, use it to fetch the required sources. *do_extract()*:: - if defined and `distfiles` is not set, use it to extract the required sources. + if defined and `distfiles` is not set, use it to extract the required sources. *post_extract()*:: - Actions to execute after `do_extract()`. + Actions to execute after `do_extract()`. *pre_configure()*:: - Actions to execute after `post_extract()`. + Actions to execute after `post_extract()`. *do_configure()*:: - Actions to execute to configure the package; `${configure_args}` should - still be passed in if it's a GNU configure script. + Actions to execute to configure the package; `${configure_args}` should +still be passed in if it's a GNU configure script. *post_configure()*:: - Actions to execute after `do_configure()`. + Actions to execute after `do_configure()`. *pre_build()*:: - Actions to execute after `post_configure()`. + Actions to execute after `post_configure()`. *do_build()*:: - Actions to execute to build the package. + Actions to execute to build the package. *post_build()*:: - Actions to execute after `do_build()`. + Actions to execute after `do_build()`. *pre_install()*:: - Actions to execute after `post_build()`. + Actions to execute after `post_build()`. *do_install()*:: - Actions to execute to install the packages files into the `fake destdir`. + Actions to execute to install the packages files into the `fake destdir`. *post_install()*:: - Actions to execute after `do_install()`. + Actions to execute after `do_install()`. NOTE: A function defined in a template has preference over the same function defined by a `build_style` script. -Run-time dependencies -~~~~~~~~~~~~~~~~~~~~~ - -Dependencies for ELF executables or shared libraries are detected -automatically by `xbps-src`, hence run-time dependencies must not be specified -in the *package sections* with the following exceptions: - -- ELF binaries using dlopen(3). -- non ELF objects, i.e perl/python/ruby/etc modules. -- Overriding the minimal version specified in the `shlibs` file. - -The run-time dependencies for ELF binaries are detected by checking which SONAMEs -use and then the SONAMEs are mapped to a binary package name with a minimal -required version. The `shlibs` file in the `xbps-packages/common` directory -sets up the `SONAME pkgname>=version` mappings. - -For example the `foo-1.0_1` package provides the `libfoo.so.1` SONAME and -software requiring this library will link to `libfoo`; the resulting binary -package will have a run-time dependency to `foo>=1.0_1` package as specified in -`common/shlibs`: - ------------------------ -# common/shlibs -... -libfoo.so.1 foo-1.0_1 -... ------------------------ - -- The first field specifies the SONAME. -- The second field specified the package name and minimal version required. -- A third optional field specifies the architecture (rarely used). - Build options -~~~~~~~~~~~~~ - +------------- Some packages might be built with different build options to enable/disable additional features; `xbps-src` allows you to do this with some simple tweaks to the `template` file. @@ -460,14 +451,14 @@ to the `template` file. The following variables may be set to allow package build options: *build_options*:: - Sets the build options supported by the source package. + Sets the build options supported by the source package. *build_options_default*:: - Sets the default build options to be used by the source package. + Sets the default build options to be used by the source package. *desc_option_