code:
#! /bin/sh
# Configuration validation subroutine script.
#   Copyright 1992-2015 Free Software Foundation, Inc.

timestamp='2015-11-22'

# 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 3 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, see <http://www.gnu.org/licenses/>.
#
# 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.  This Exception is an additional permission under section 7
# of the GNU General Public License, version 3 ("GPLv3").

# Please send patches to <config-patches@gnu.org>.
#
# 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 or 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 <config-patches@gnu.org>."

version="\
GNU config.sub ($timestamp)

Copyright 1992-2015 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* | netbsd*-eabi* | \
  kopensolaris*-gnu* | \
  storm-chaos* | os2-emx* | rtmk-nova*)
    os=-$maybe_os
    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
    ;;
  android-linux)
    os=-linux-android
    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
    ;;
  *)
    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*178)
		os=-lynxos178
		;;
	-lynx*5)
		os=-lynxos5
		;;
	-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 \
	| aarch64 | aarch64_be \
	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
	| am33_2.0 \
	| arc | arceb \
	| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
	| avr | avr32 \
	| ba \
	| be32 | be64 \
	| bfin \
	| c4x | c8051 | clipper \
	| d10v | d30v | dlx | dsp16xx \
	| e2k | epiphany \
	| fido | fr30 | frv | ft32 \
	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
	| hexagon \
	| i370 | i860 | i960 | ia64 \
	| ip2k | iq2000 \
	| k1om \
	| le32 | le64 \
	| lm32 \
	| m32c | m32r | m32rle | m68000 | m68k | m88k \
	| maxq | mb | microblaze | microblazeel | 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 \
	| mipsisa32r6 | mipsisa32r6el \
	| mipsisa64 | mipsisa64el \
	| mipsisa64r2 | mipsisa64r2el \
	| mipsisa64r6 | mipsisa64r6el \
	| mipsisa64sb1 | mipsisa64sb1el \
	| mipsisa64sr71k | mipsisa64sr71kel \
	| mipsr5900 | mipsr5900el \
	| mipstx39 | mipstx39el \
	| mn10200 | mn10300 \
	| moxie \
	| mt \
	| msp430 \
	| nds32 | nds32le | nds32be \
	| nios | nios2 | nios2eb | nios2el \
	| ns16k | ns32k \
	| open8 | or1k | or1knd | or32 \
	| pdp10 | pdp11 | pj | pjl \
	| powerpc | powerpc64 | powerpc64le | powerpcle \
	| pyramid \
	| riscv32 | riscv64 \
	| rl78 | rx \
	| score \
	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]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 | v850e1 | v850e2 | v850es | v850e2v3 \
	| visium \
	| 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
		;;
	leon|leon[3-9])
		basic_machine=sparc-$basic_machine
		;;
	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
		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
		;;
	xgate)
		basic_machine=$basic_machine-unknown
		os=-none
		;;
	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-* \
	| aarch64-* | aarch64_be-* \
	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
	| avr-* | avr32-* \
	| ba-* \
	| be32-* | be64-* \
	| bfin-* | bs2000-* \
	| c[123]* | c30-* | [cjt]90-* | c4x-* \
	| c8051-* | clipper-* | craynv-* | cydra-* \
	| d10v-* | d30v-* | dlx-* \
	| e2k-* | elxsi-* \
	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
	| h8300-* | h8500-* \
	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
	| hexagon-* \
	| i*86-* | i860-* | i960-* | ia64-* \
	| ip2k-* | iq2000-* \
	| k1om-* \
	| le32-* | le64-* \
	| lm32-* \
	| m32c-* | m32r-* | m32rle-* \
	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
	| microblaze-* | microblazeel-* \
	| 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-* \
	| mipsisa32r6-* | mipsisa32r6el-* \
	| mipsisa64-* | mipsisa64el-* \
	| mipsisa64r2-* | mipsisa64r2el-* \
	| mipsisa64r6-* | mipsisa64r6el-* \
	| mipsisa64sb1-* | mipsisa64sb1el-* \
	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
	| mipsr5900-* | mipsr5900el-* \
	| mipstx39-* | mipstx39el-* \
	| mmix-* \
	| mt-* \
	| msp430-* \
	| nds32-* | nds32le-* | nds32be-* \
	| nios-* | nios2-* | nios2eb-* | nios2el-* \
	| none-* | np1-* | ns16k-* | ns32k-* \
	| open8-* \
	| or1k*-* \
	| orion-* \
	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
	| pyramid-* \
	| riscv32-* | riscv64-* \
	| rl78-* | 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*-* \
	| tron-* \
	| ubicom32-* \
	| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
	| vax-* \
	| visium-* \
	| 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
		;;
        asmjs)
		basic_machine=asmjs-unknown
		;;
	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*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
		;;
	leon-*|leon[3-9]-*)
		basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
		;;
	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
		;;
	mingw64)
		basic_machine=x86_64-pc
		os=-mingw64
		;;
	mingw32)
		basic_machine=i686-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
		;;
	moxiebox)
		basic_machine=moxie-unknown
		os=-moxiebox
		;;
	msdos)
		basic_machine=i386-pc
		os=-msdos
		;;
	ms1-*)
		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
		;;
	msys)
		basic_machine=i686-pc
		os=-msys
		;;
	mvs)
		basic_machine=i370-ibm
		os=-mvs
		;;
	nacl)
		basic_machine=le32-unknown
		os=-nacl
		;;
	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 | rdos64)
		basic_machine=x86_64-pc
		os=-rdos
		;;
	rdos32)
		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
		;;
	tile*)
		basic_machine=$basic_machine-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* | -plan9* \
	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
	      | -aos* | -aros* | -cloudabi* | -sortix* \
	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
	      | -bitrig* | -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* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
	      | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
	      | -linux-newlib* | -linux-musl* | -linux-uclibc* \
	      | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
	      | -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* \
	      | -onefs* | -tirtos*)
	# 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
		;;
	-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
		;;
	c8051-*)
		os=-elf
		;;
	hexagon-*)
		os=-elf
		;;
	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
		;;
	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:


code:
--- coreutils-8.20.org/Makefile.in
+++ coreutils-8.20/Makefile.in
@@ -5308,9 +5308,10 @@
 	$(AM_V_CCLD)$(LINK) $(src_ls_OBJECTS) $(src_ls_LDADD) $(LIBS)
 src/make-prime-list.$(OBJEXT): src/$(am__dirstamp) \
 	src/$(DEPDIR)/$(am__dirstamp)
+	$(HOSTCC) -Ilib -c src/make-prime-list.c -o src/make-prime-list.$(OBJEXT)
 src/make-prime-list$(EXEEXT): $(src_make_prime_list_OBJECTS) $(src_make_prime_list_DEPENDENCIES) $(EXTRA_src_make_prime_list_DEPENDENCIES) src/$(am__dirstamp)
 	@rm -f src/make-prime-list$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(src_make_prime_list_OBJECTS) $(src_make_prime_list_LDADD) $(LIBS)
+	$(HOSTCC) $(src_make_prime_list_OBJECTS) $(src_make_prime_list_LDADD) $(LIBS) -o src/make-prime-list$(EXEEXT)
 src/src_md5sum-md5sum.$(OBJEXT): src/$(am__dirstamp) \
 	src/$(DEPDIR)/$(am__dirstamp)
 src/md5sum$(EXEEXT): $(src_md5sum_OBJECTS) $(src_md5sum_DEPENDENCIES) $(EXTRA_src_md5sum_DEPENDENCIES) src/$(am__dirstamp)

repo_name: aarf/bkauler

license: unknown


code:
--- ctags-5.8.org/Makefile.in	2013-09-16 18:51:00.067050506 +0000
+++ ctags-5.8/Makefile.in	2013-09-16 19:01:52.706027078 +0000
@@ -85,17 +85,18 @@
 #
 CTAGS_EXEC	= $(CTAGS_PROG)$(EXEEXT)
 ETAGS_EXEC	= $(ETAGS_PROG)$(EXEEXT)
-DEST_CTAGS	= $(bindir)/$(CTAGS_EXEC)
-DEST_ETAGS	= $(bindir)/$(ETAGS_EXEC)
-DEST_READ_LIB	= $(libdir)/$(READ_LIB)
-DEST_READ_INC	= $(incdir)/$(READ_INC)
-DEST_CMAN	= $(man1dir)/$(CMAN)
-DEST_EMAN	= $(man1dir)/$(EMAN)
+DEST_CTAGS	= $(DESTDIR)$(bindir)/$(CTAGS_EXEC)
+DEST_ETAGS	= $(DESTDIR)$(bindir)/$(ETAGS_EXEC)
+DEST_READ_LIB	= $(DESTDIR)$(libdir)/$(READ_LIB)
+DEST_READ_INC	= $(DESTDIR)$(incdir)/$(READ_INC)
+DEST_CMAN	= $(DESTDIR)$(man1dir)/$(CMAN)
+DEST_EMAN	= $(DESTDIR)$(man1dir)/$(EMAN)
+DESTS=$(DESTDIR)$(bindir) $(DESTDIR)$(man1dir) $(DESTDIR)$(libdir) $(DESTDIR)$(incdir)

 #
 # primary rules
 #
-all: $(CTAGS_EXEC) $(READ_LIB)
+all: $(CTAGS_EXEC) $(READ_LIB) $(DESTS)

 $(CTAGS_EXEC): $(OBJECTS)
 	$(CC) $(LDFLAGS) -o $@ $(OBJECTS) $(LIBS)
@@ -118,15 +119,16 @@
 #
 # generic install rules
 #
-install: @install_targets@
+
+install: $(DESTS) @install_targets@

 install-strip: install

 install-ctags: install-cbin install-cman
 install-etags: install-ebin install-eman

-$(bindir) $(man1dir) $(libdir) $(incdir):
-	$(srcdir)/mkinstalldirs $@
+$(DESTS):
+	mkdir -p $@

 FORCE:


code:
Submitted By:            Armin K. <krejzi at email dot com>
Date:                    2013-03-21
Initial Package Version: 1.6.3
Upstream Status:         BLFS Specific
Origin:                  Self
Description:             Fix permissions for installed files, disable compression of man pages and
                         add BLFS specific PAM configuration file.

--- a/conf/pam.std.in	2009-09-22 23:52:47.000000000 +0200
+++ b/conf/pam.std.in	2013-03-21 21:05:28.537921845 +0100
@@ -1,2 +1,7 @@
-auth	required	@PAMMODAUTH@
-account	required	@PAMMOD@
+# Begin /etc/pam.d/cups
+
+auth    include system-auth
+account include system-account
+session include system-session
+
+# End /etc/pam.d/cups
--- a/config-scripts/cups-manpages.m4	2012-04-23 19:26:57.000000000 +0200
+++ b/config-scripts/cups-manpages.m4	2013-03-21 21:05:00.270687182 +0100
@@ -69,10 +69,10 @@
 		;;
 	Linux* | GNU* | Darwin*)
 		# Linux, GNU Hurd, and OS X
-		MAN1EXT=1.gz
-		MAN5EXT=5.gz
-		MAN7EXT=7.gz
-		MAN8EXT=8.gz
+		MAN1EXT=1
+		MAN5EXT=5
+		MAN7EXT=7
+		MAN8EXT=8
 		MAN8DIR=8
 		;;
 	*)
--- a/Makedefs.in	2012-05-23 01:58:31.000000000 +0200
+++ b/Makedefs.in	2013-03-21 21:05:00.280687382 +0100
@@ -40,14 +40,14 @@
 # Installation programs...
 #

-INSTALL_BIN	=	$(LIBTOOL) $(INSTALL) -c -m 555 @INSTALL_STRIP@
-INSTALL_COMPDATA =	$(INSTALL) -c -m 444 @INSTALL_GZIP@
+INSTALL_BIN	=	$(LIBTOOL) $(INSTALL) -c -m 755 @INSTALL_STRIP@
+INSTALL_COMPDATA =	$(INSTALL) -c -m 644 @INSTALL_GZIP@
 INSTALL_CONFIG	=	$(INSTALL) -c -m @CUPS_CONFIG_FILE_PERM@
-INSTALL_DATA	=	$(INSTALL) -c -m 444
+INSTALL_DATA	=	$(INSTALL) -c -m 644
 INSTALL_DIR	=	$(INSTALL) -d
-INSTALL_LIB	=	$(LIBTOOL) $(INSTALL) -c -m 555 @INSTALL_STRIP@
-INSTALL_MAN	=	$(INSTALL) -c -m 444
-INSTALL_SCRIPT	=	$(INSTALL) -c -m 555
+INSTALL_LIB	=	$(LIBTOOL) $(INSTALL) -c -m 755 @INSTALL_STRIP@
+INSTALL_MAN	=	$(INSTALL) -c -m 644
+INSTALL_SCRIPT	=	$(INSTALL) -c -m 755

 #
 # Default user, group, and system groups for the scheduler...


code:
commit 240cd84b494e0ffee8ad261c43b927d246cf6be1
Author: Daniel Stenberg <daniel@haxx.se>
Date:   Wed Mar 23 10:04:48 2016 +0100

    openssl: fix ERR_remove_thread_state() for boringssl/libressl

    The removed arg is only done in OpenSSL

    Bug: https://twitter.com/xtraemeat/status/712564874098917376

diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c
index cbf2d21..b7e4462 100644
--- a/lib/vtls/openssl.c
+++ b/lib/vtls/openssl.c
@@ -95,7 +95,9 @@

 #if (OPENSSL_VERSION_NUMBER >= 0x10000000L)
 #define HAVE_ERR_REMOVE_THREAD_STATE 1
-#if (OPENSSL_VERSION_NUMBER >= 0x10100004L)
+#if (OPENSSL_VERSION_NUMBER >= 0x10100004L) && \
+  !defined(LIBRESSL_VERSION_NUMBER) && \
+  !defined(OPENSSL_IS_BORINGSSL)
 /* OpenSSL 1.1.0-pre4 removed the argument! */
 #define HAVE_ERR_REMOVE_THREAD_STATE_NOARG 1
 #endif


code:
From 2b120801a9f3976ca2c82ca0beb936fe16295829 Mon Sep 17 00:00:00 2001
From: rofl0r <retnyg@gmx.net>
Date: Fri, 11 Mar 2016 11:18:51 +0000
Subject: [PATCH 1/2] Makefile: do not append -O2 -Wall if user passes CFLAGS

---
 Makefile | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 05606b1..b12d1f4 100644
--- a/Makefile
+++ b/Makefile
@@ -13,6 +13,8 @@ BINDIR = $(DESTDIR)$(PREFIX)/bin
 MANDIR = $(DESTDIR)$(MANPREFIX)/man6
 DOCDIR = $(DESTDIR)$(PREFIX)/share/doc/$(GAME_TITLE)

+-include config.mak
+
 # Game resources directories
 INSTALL_DATA ?= $(DESTDIR)$(PREFIX)/share/$(GAME_TITLE)
 IMAGESDIR = images
@@ -31,7 +33,7 @@ OBJS_NCURSES = $(SRCS_NCURSES:.c=.o)
 OBJS_SDL = $(SRCS_SDL:.c=.o)

 EXECS = $(EXEC_NCURSES) $(EXEC_SDL)
-CFLAGS += -Wall -O2
+CFLAGS ?= -Wall -O2
 LDLIBS += -lm

 # Common sources and header
@@ -41,8 +43,8 @@ HDRS = $(HDRS_INDEP)
 ifdef SDL
  OBJS += $(OBJS_SDL)
  HDRS += $(HDRS_SDL)
- CFLAGS += $(shell sdl-config --cflags)
- LDLIBS += $(shell sdl-config --libs)
+ CFLAGS += $(shell pkg-config sdl --cflags)
+ LDLIBS += $(shell pkg-config sdl --libs)
  EXEC = $(EXEC_SDL)
  # Version-specific
  INSTALL_OPTIONAL = install-sdl-manpage
--
1.8.4


code:
From 78c7b6088d4325cfc454672d0f853a4961243f18 Mon Sep 17 00:00:00 2001
From: rofl0r <retnyg@gmx.net>
Date: Fri, 11 Mar 2016 21:52:45 +0000
Subject: [PATCH 2/2] support fullscreen toggle via ALT-ENTER

---
 main-sdl.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/main-sdl.c b/main-sdl.c
index 079df17..2ad18c9 100644
--- a/main-sdl.c
+++ b/main-sdl.c
@@ -44,6 +44,12 @@
 /* delay in milliseconds */
 #define TIME_DELAY 10

+static int in_fullscreen;
+static void toggle_fullscreen(SDL_Surface *surface) {
+	in_fullscreen = !in_fullscreen;
+	SDL_WM_ToggleFullScreen(surface);
+}
+
 void run(struct state *st, struct ui *ui,
     SDL_Surface *screen, SDL_Surface *tileset, SDL_Surface *typeface, SDL_Surface *uisurf){
   /* tile variation */
@@ -77,6 +83,11 @@ void run(struct state *st, struct ui *ui,
           case SDL_KEYDOWN:
             c = '\0';
             switch (event.key.keysym.sym) {
+              case SDLK_RETURN:
+                if((event.key.keysym.mod & KMOD_LALT) ||
+                   (event.key.keysym.mod & KMOD_RALT))
+                    toggle_fullscreen(screen);
+                break;
               case SDLK_LEFT: c = 'h'; break;
               case SDLK_RIGHT: c = 'l'; break;
               case SDLK_UP: c = 'k'; break;
@@ -161,6 +172,11 @@ void run_client(struct state *st, struct ui *ui,
           case SDL_KEYDOWN:
             c = '\0';
             switch (event.key.keysym.sym) {
+              case SDLK_RETURN:
+                if((event.key.keysym.mod & KMOD_LALT) ||
+                   (event.key.keysym.mod & KMOD_RALT))
+                    toggle_fullscreen(screen);
+                break;
               case SDLK_LEFT: c = 'h'; break;
               case SDLK_RIGHT: c = 'l'; break;
               case SDLK_UP: c = 'k'; break;
@@ -302,6 +318,8 @@ int main(int argc, char *argv[]) {
   }
 #endif

+  if(in_fullscreen) toggle_fullscreen(screen);
+
   /* Finalize */
   SDL_FreeSurface(tileset);
   SDL_FreeSurface(typeface);
--
1.8.4


code:
--- cvs-1.11.23.org/lib/getline.h	2013-09-16 18:28:13.026099577 +0000
+++ cvs-1.11.23/lib/getline.h	2013-09-16 18:44:33.356064387 +0000
@@ -12,8 +12,6 @@
 #define GETLINE_NO_LIMIT -1

 int
-  getline __PROTO ((char **_lineptr, size_t *_n, FILE *_stream));
-int
   getline_safe __PROTO ((char **_lineptr, size_t *_n, FILE *_stream,
                          int limit));
 int
--- cvs-1.11.23.org/lib/getline.c	2013-09-16 18:28:13.021099577 +0000
+++ cvs-1.11.23/lib/getline.c	2013-09-16 18:45:14.463062911 +0000
@@ -154,12 +154,7 @@
   return ret;
 }

-int
-getline (lineptr, n, stream)
-     char **lineptr;
-     size_t *n;
-     FILE *stream;
-{
+ssize_t getline(char ** lineptr, size_t * n, FILE *stream) {
   return getstr (lineptr, n, stream, '\n', 0, GETLINE_NO_LIMIT);
 }


code:
--- DirectFB-1.6.2.org/inputdrivers/lirc/lirc.c
+++ DirectFB-1.6.2/inputdrivers/lirc/lirc.c
@@ -93,7 +93,7 @@
           qsort ( keynames,
                   D_ARRAY_SIZE( keynames ),
                   sizeof(keynames[0]),
-                  (__compar_fn_t) keynames_sort_compare );
+                  keynames_sort_compare );
           keynames_sorted = true;
      }

@@ -120,7 +120,7 @@
                symbol_name = bsearch( name, keynames,
                                       D_ARRAY_SIZE( keynames ),
                                       sizeof(keynames[0]),
-                                      (__compar_fn_t) keynames_compare );
+                                      keynames_compare );
                if (symbol_name)
                     return symbol_name->symbol;
                break;


code:
--- DirectFB-1.6.2.org/gfxdrivers/matrox/matrox_screen_crtc2.c
+++ DirectFB-1.6.2/gfxdrivers/matrox/matrox_screen_crtc2.c
@@ -27,6 +27,7 @@
 */

 #include <config.h>
+#include <sys/types.h>

 #include <stdio.h>
 #include <sys/ioctl.h>


code:
--- DirectFB-1.6.2.org/lib/direct/os/linux/glibc/system.c
+++ DirectFB-1.6.2/lib/direct/os/linux/glibc/system.c
@@ -33,6 +33,7 @@
 #include <errno.h>
 #include <signal.h>
 #include <unistd.h>
+#include <sys/syscall.h>

 #include <linux/unistd.h>

@@ -107,7 +108,8 @@
 void
 direct_trap( const char *domain, int sig )
 {
-     sigval_t val;
+
+     union sigval val;

      D_LOG( Direct_Trap, VERBOSE, "Raising signal %d from %s...\n", sig, domain );


code:
diff -Naur disktype-9PREV/detect.c disktype-9/detect.c
--- disktype-9PREV/detect.c	2016-05-08 13:14:07.000000000 +0800
+++ disktype-9/detect.c	2016-05-08 13:18:12.000000000 +0800
@@ -47,6 +47,7 @@
 void detect_dos_partmap(SECTION *section, int level);
 void detect_gpt_partmap(SECTION *section, int level);
 void detect_fat(SECTION *section, int level);
+void detect_exfat(SECTION *section, int level);
 void detect_ntfs(SECTION *section, int level);
 void detect_hpfs(SECTION *section, int level);
 void detect_dos_loader(SECTION *section, int level);
@@ -131,6 +132,7 @@
   detect_amiga_fs,
   detect_apple_volume,
   detect_fat,
+  detect_exfat,
   detect_ntfs,
   detect_hpfs,
   detect_udf,
diff -Naur disktype-9PREV/dos.c disktype-9/dos.c
--- disktype-9PREV/dos.c	2006-06-05 04:05:06.000000000 +0800
+++ disktype-9/dos.c	2016-05-08 13:22:34.000000000 +0800
@@ -429,6 +429,8 @@
   /* since the above is also present on NTFS, make sure it's not NTFS... */
   if (memcmp(buf + 3, "NTFS    ", 8) == 0)
     return;
+  if (memcmp(buf + 3, "EXFAT    ", 8) == 0)
+    return;

   /* next, some soft tests, taking score */
   score = 0;
@@ -516,6 +518,25 @@
 }

 /*
+ * exFAT file system
+ */
+
+void detect_exfat(SECTION *section, int level)
+{
+  unsigned char *buf;
+
+  if (get_buffer(section, 0, 512, (void **)&buf) < 512)
+    return;
+
+  /* check signatures */
+  if (memcmp(buf + 3, "EXFAT ", 8) != 0)
+    return;
+
+  /* tell the user */
+    print_line(level, "exFAT file system");
+}
+
+/*
  * NTFS file system
  */


code:
diff -Naur disktype-9/detect.c disktype-9-patched_pardus_bk/detect.c
--- disktype-9/detect.c	2006-06-05 04:05:06.000000000 +0800
+++ disktype-9-patched_pardus_bk/detect.c	2009-08-24 09:45:46.000000000 +0800
@@ -59,7 +59,7 @@
 void detect_udf(SECTION *section, int level);

 /* in linux.c */
-void detect_ext23(SECTION *section, int level);
+void detect_ext234(SECTION *section, int level);
 void detect_reiser(SECTION *section, int level);
 void detect_reiser4(SECTION *section, int level);
 void detect_linux_raid(SECTION *section, int level);
@@ -136,7 +136,7 @@
   detect_udf,
   detect_cdrom_misc,
   detect_iso,
-  detect_ext23,
+  detect_ext234,
   detect_reiser,
   detect_reiser4,
   detect_linux_raid,
diff -Naur disktype-9/linux.c disktype-9-patched_pardus_bk/linux.c
--- disktype-9/linux.c	2006-06-05 04:05:06.000000000 +0800
+++ disktype-9-patched_pardus_bk/linux.c	2009-08-24 09:59:04.000000000 +0800
@@ -28,10 +28,43 @@
 #include "global.h"

 /*
- * ext2/ext3 file system
+ * ext2/ext3/ext4 file system
  */

-void detect_ext23(SECTION *section, int level)
+/* for s_flags */
+#define EXT2_FLAGS_TEST_FILESYS 0x0004
+
+/* for s_feature_compat */
+#define EXT3_FEATURE_COMPAT_HAS_JOURNAL     0x0004
+
+/* for s_feature_ro_compat */
+#define EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER 0x0001
+#define EXT2_FEATURE_RO_COMPAT_LARGE_FILE   0x0002
+#define EXT2_FEATURE_RO_COMPAT_BTREE_DIR    0x0004
+#define EXT4_FEATURE_RO_COMPAT_HUGE_FILE    0x0008
+#define EXT4_FEATURE_RO_COMPAT_GDT_CSUM     0x0010
+#define EXT4_FEATURE_RO_COMPAT_DIR_NLINK    0x0020
+#define EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE  0x0040
+
+/* for s_feature_incompat */
+#define EXT2_FEATURE_INCOMPAT_FILETYPE      0x0002
+#define EXT3_FEATURE_INCOMPAT_RECOVER       0x0004
+#define EXT3_FEATURE_INCOMPAT_JOURNAL_DEV   0x0008
+#define EXT2_FEATURE_INCOMPAT_META_BG       0x0010
+#define EXT4_FEATURE_INCOMPAT_EXTENTS       0x0040
+#define EXT4_FEATURE_INCOMPAT_64BIT         0x0080
+#define EXT4_FEATURE_INCOMPAT_MMP           0x0100
+#define EXT4_FEATURE_INCOMPAT_FLEX_BG       0x0200
+
+#define EXT3_FEATURE_RO_COMPAT_UNSUPPORTED ~(EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER | \
+                                             EXT2_FEATURE_RO_COMPAT_LARGE_FILE | \
+                                             EXT2_FEATURE_RO_COMPAT_BTREE_DIR)
+
+#define EXT3_FEATURE_INCOMPAT_UNSUPPORTED  ~(EXT2_FEATURE_INCOMPAT_FILETYPE | \
+                                             EXT3_FEATURE_INCOMPAT_RECOVER | \
+                                             EXT2_FEATURE_INCOMPAT_META_BG)
+
+void detect_ext234(SECTION *section, int level)
 {
   unsigned char *buf;
   char s[256];
@@ -43,11 +76,33 @@

   if (get_le_short(buf + 56) == 0xEF53) {
     if (get_le_long(buf + 96) & 0x0008)       /* JOURNAL_DEV flag */
+    {
       print_line(level, "Ext3 external journal");
+    }
     else if (get_le_long(buf + 92) & 0x0004)  /* HAS_JOURNAL flag */
-      print_line(level, "Ext3 file system");
+    {
+      /* Try to find if it is ext4 by checking if there are any unsupported features of ext3 */
+      if ((get_le_long(buf + 96) & EXT3_FEATURE_INCOMPAT_UNSUPPORTED) && (get_le_long(buf + 100) & EXT3_FEATURE_RO_COMPAT_UNSUPPORTED))
+      {
+        /* We have ext4 but which version */
+        if (get_le_long(buf + 352) & EXT2_FLAGS_TEST_FILESYS)
+        {
+          print_line(level, "Ext4dev file system");
+        }
+        else
+        {
+          print_line(level, "Ext4 file system");
+        }
+      }
+      else
+      {
+        print_line(level, "Ext3 file system");
+      }
+    }
     else
+    {
       print_line(level, "Ext2 file system");
+    }

     get_string(buf + 120, 16, s);
     if (s[0])


code:
# dmenu version
VERSION = 4.5

# paths
PREFIX = /
MANPREFIX = ${PREFIX}/share/man

X11INC = /include/X11
X11LIB = /lib

# Xinerama, comment if you don't want it
XINERAMALIBS  = -lXinerama
XINERAMAFLAGS = -DXINERAMA

# includes and libs
INCS = -I${X11INC}
LIBS = -L${X11LIB} -lfontconfig -lXft -lX11 -lxcb -lXau -lXdmcp ${XINERAMALIBS}

# flags
CPPFLAGS = -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS}
#CFLAGS   = -g -std=c99 -pedantic -Wall -O0 ${INCS} ${CPPFLAGS}
CFLAGS   = -std=c99 -pedantic -Wall -Os ${INCS} ${CPPFLAGS}
LDFLAGS  = -s ${LIBS}

# compiler and linker
CC = cc


code:
--- dosbox-0.74.org/src/dos/cdrom_ioctl_linux.cpp	2013-04-13 16:06:02.070000003 +0000
+++ dosbox-0.74/src/dos/cdrom_ioctl_linux.cpp	2013-04-13 16:06:42.168000002 +0000
@@ -24,7 +24,7 @@
 #if defined (LINUX)
 #include <fcntl.h>
 #include <unistd.h>
-#include <linux/cdrom.h>
+#include "linux_cdrom.h"
 #include <sys/ioctl.h>
 #include <sys/stat.h>
 #include <sys/types.h>
--- /dev/null	2012-12-26 22:18:45.184000007 +0000
+++ dosbox-0.74/src/dos/linux_cdrom.h	2013-04-13 16:30:39.779000003 +0000
@@ -0,0 +1,20 @@
+#ifndef LINUX_CDROM_H
+#define LINUX_CDROM_H
+
+#define CD_FRAMESIZE 2048
+#define CD_FRAMESIZE_RAW 2352
+#define CDROM_GET_MCN 0x5311
+#define CDROMREADRAW 0x5314
+
+struct cdrom_read {
+	int cdread_lba;
+	char *cdread_bufaddr;
+	int cdread_buflen;
+};
+
+struct cdrom_mcn {
+	unsigned char medium_catalog_number[14];
+};
+
+#endif
+


code:
--- src/fsck.fat.h
+++ src/fsck.fat.h
@@ -27,6 +27,7 @@
 #ifndef _DOSFSCK_H
 #define _DOSFSCK_H

+#include <fcntl.h>
 #include <sys/types.h>
 #define _LINUX_STAT_H		/* hack to avoid inclusion of <linux/stat.h> */
 #define _LINUX_STRING_H_	/* hack to avoid inclusion of <linux/string.h> */
--- src/io.h
+++ src/io.h
@@ -27,7 +27,7 @@
 #ifndef _IO_H
 #define _IO_H

-#include <sys/types.h>		/* for loff_t */
+#include <fcntl.h>		/* for loff_t */

 loff_t llseek(int fd, loff_t offset, int whence);

--- src/mkfs.fat.c
+++ src/mkfs.fat.c
@@ -49,6 +49,7 @@
 #include <fcntl.h>
 #include <linux/hdreg.h>
 #include <sys/mount.h>
+#include <linux/fs.h>
 #include <linux/fd.h>
 #include <endian.h>
 #include <mntent.h>


code:
protocols = imap
log_path = /proc/self/fd/1
mail_location = maildir:~/Maildir
auth_mechanisms = plain
userdb {
   driver = passwd
}
passdb {
   driver = shadow
}
service auth {
   unix_listener /var/spool/postfix/private/auth {
      mode = 0666
      user = postfix
      group = postfix
   }
}
service imap-login {
   inet_listener imap {
      port=0
   }
}
ssl_cipher_list = AES:!SSLv2:!SSLv3:!SRP:!AECDH:!ADH:!PSK:!aECDH:!DSS:-kRSA:+aRSA:+AES256
ssl_cert = </etc/dovecot/dovecot.crt
ssl_key = </etc/dovecot/dovecot.key


code:
--- dpkg-1.16.12/dpkg-deb/extract.c
+++ dpkg-1.16.12/dpkg-deb/extract.c
@@ -319,7 +319,7 @@
         }
       }

-      execlp(TAR, "tar", buffer, "-", "--warning=no-timestamp", NULL);
+      execlp(TAR, "tar", buffer, "-", NULL);
       ohshite(_("unable to execute %s (%s)"), "tar", TAR);
     }
     close(p2[0]);


code:
this patch removes the functionality that depends on sun rpc,
which either cannot be implemented using the portablexdr rpc
replacement library, or depend on the host rpcgen utility
to generate some headers and source files.

it should be possible to build some of the disabled files
(for example decoding of NFS packets) with rpcgen installed
on the host; however i think it's too much of a burden to
force the crosscompile user to install portablexdr on his host
as well (to get the utility).
a viable alternative could be to generate those files on a host
with rpcgen installed and ship them together with the package.

there's still functionality using rpc enabled, since the entire
file logging infrastructure uses xdr structures and functions
to store records, fortunately this functionality is provided
by portablexdr.

additionally it disables build of the obsolete sshmitm utility.
obsolete because noone uses SSHv1 anymore.
the reason for disabling it is that it uses deprecated DES
functions/types from openssh which are disabled in our build,
causing the build to fail.

--- dsniff-2.4.org/Makefile.in	2014-08-13 00:44:31.072293717 +0200
+++ dsniff-2.4/Makefile.in	2014-08-13 01:44:17.556299388 +0200
@@ -47,28 +47,26 @@
 RANLIB	= @RANLIB@

 HDRS	= asn1.h base64.h buf.h decode.h hex.h magic.h options.h \
-	  pathnames.h pcaputil.h record.h rpc.h tcp_raw.h trigger.h \
+	  pathnames.h pcaputil.h record.h tcp_raw.h trigger.h \
 	  version.h vroot.h

-SRCS	= asn1.c base64.c buf.c hex.c magic.c mount.c pcaputil.c rpc.c \
+SRCS	= asn1.c base64.c buf.c hex.c magic.c pcaputil.c \
 	  tcp_raw.c trigger.c record.c dsniff.c decode.c decode_aim.c \
 	  decode_citrix.c decode_cvs.c decode_ftp.c decode_hex.c \
 	  decode_http.c decode_icq.c decode_imap.c decode_irc.c \
-	  decode_ldap.c decode_mmxp.c decode_mountd.c decode_napster.c \
+	  decode_ldap.c decode_mmxp.c decode_napster.c \
 	  decode_nntp.c decode_oracle.c decode_ospf.c decode_pcanywhere.c \
-	  decode_pop.c decode_portmap.c decode_postgresql.c decode_pptp.c \
+	  decode_pop.c decode_postgresql.c decode_pptp.c \
 	  decode_rip.c decode_rlogin.c decode_smb.c decode_smtp.c \
 	  decode_sniffer.c decode_snmp.c decode_socks.c decode_tds.c \
-	  decode_telnet.c decode_vrrp.c decode_yp.c decode_x11.c
-
-GEN	= mount.h mount.c nfs_prot.h nfs_prot.c
+	  decode_telnet.c decode_vrrp.c decode_x11.c

 OBJS	= $(SRCS:.c=.o)

 LIBOBJS	= dummy.o @LIBOBJS@

-PROGS	= arpspoof dnsspoof dsniff filesnarf macof mailsnarf msgsnarf \
-	  sshmitm sshow tcpkill tcpnice @TCPHIJACK@ urlsnarf webmitm @WEBSPY@
+PROGS	= arpspoof dnsspoof dsniff macof mailsnarf msgsnarf \
+	  sshow tcpkill tcpnice @TCPHIJACK@ urlsnarf webmitm @WEBSPY@

 CONFIGS	= dsniff.magic dsniff.services dnsspoof.hosts

@@ -77,14 +75,6 @@

 all: libmissing.a $(PROGS)

-mount.c: mount.x
-	rpcgen -h mount.x -o mount.h
-	rpcgen -c mount.x -o mount.c
-
-nfs_prot.c: nfs_prot.x
-	rpcgen -h nfs_prot.x -o nfs_prot.h
-	rpcgen -c nfs_prot.x -o nfs_prot.c
-
 $(LIBOBJS):
 	$(CC) $(CFLAGS) $(INCS) -c $(srcdir)/missing/$*.c

--- dsniff-2.4.org/decode.c	2014-08-13 00:44:31.073293717 +0200
+++ dsniff-2.4/decode.c	2014-08-13 01:55:45.228300475 +0200
@@ -53,6 +53,12 @@
 extern int decode_vrrp(u_char *, int, u_char *, int);
 extern int decode_ypserv(u_char *, int, u_char *, int);
 extern int decode_yppasswd(u_char *, int, u_char *, int);
+#ifndef HAVE_RPC
+int decode_portmap(u_char *a, int d, u_char *b, int c) {return 0;}
+int decode_mountd(u_char *a, int d, u_char *b, int c) {return 0;}
+int decode_ypserv(u_char *a, int d, u_char *b, int c) {return 0;}
+int decode_yppasswd(u_char *a, int d, u_char *b, int c) {return 0;}
+#endif

 static struct decode decodes[] = {
 	{ "hex",	decode_hex },


code:
--- dsniff-2.3.org/configure	2014-08-12 23:09:56.696284744 +0200
+++ dsniff-2.3/configure	2014-08-12 23:21:46.476285867 +0200
@@ -3035,11 +3035,7 @@
      ;;
   esac
 else
-   if test -f ${prefix}/include/pcap.h; then
-     PCAPINC="-I${prefix}/include"
-     PCAPLIB="-L${prefix}/lib -lpcap"
-  elif test -f /usr/include/pcap/pcap.h; then
-     PCAPINC="-I/usr/include/pcap"
+  if true ; then
      PCAPLIB="-lpcap"
   elif test -f /usr/include/pcap.h; then
      PCAPLIB="-lpcap"
@@ -3083,12 +3079,7 @@
      ;;
   esac
 else
-   if test -f ${prefix}/include/libnet.h; then
-     CFLAGS="$CFLAGS `${prefix}/bin/libnet-config --defines`"
-     LNETINC="-I${prefix}/include"
-     LNETLIB="-L${prefix}/lib -lnet"
-  elif test -f /usr/include/libnet.h; then
-     CFLAGS="$CFLAGS `libnet-config --defines`"
+  if true ; then
      LNETLIB="-lnet"
   else
      echo "$ac_t""no" 1>&6
@@ -3128,10 +3119,7 @@
      ;;
   esac
 else
-   if test -f ${prefix}/include/nids.h; then
-     NIDSINC="-I${prefix}/include"
-     NIDSLIB="-L${prefix}/lib -lnids"
-  elif test -f /usr/include/nids.h; then
+  if true; then
      NIDSLIB="-lnids"
   else
      echo "$ac_t""no" 1>&6
@@ -3193,13 +3181,7 @@
      ;;
   esac
 else
-   if test -f ${prefix}/include/openssl/ssl.h; then
-     SSLINC="-I${prefix}/include"
-     SSLLIB="-L${prefix}/lib -lssl -lcrypto"
-  elif test -f ${prefix}/ssl/include/openssl/ssl.h; then
-     SSLINC="-I${prefix}/ssl/include"
-     SSLLIB="-L${prefix}/ssl/lib -lssl -lcrypto"
-  elif test -f /usr/include/openssl/ssl.h; then
+  if true ; then
      SSLLIB="-lssl -lcrypto"
   else
      echo "$ac_t""no" 1>&6


code:
--- dumb-0.9.3.org/Makefile.rdy
+++ dumb-0.9.3/Makefile.rdy
@@ -80,9 +80,9 @@
 DEFAULT_PREFIX := /usr/local
 endif
 export DEFAULT_PREFIX
-INCLUDE_INSTALL_PATH := $(PREFIX)/include
-LIB_INSTALL_PATH := $(PREFIX)/lib
-BIN_INSTALL_PATH := $(PREFIX)/bin
+INCLUDE_INSTALL_PATH := $(DESTDIR)$(PREFIX)/include
+LIB_INSTALL_PATH := $(DESTDIR)$(PREFIX)/lib
+BIN_INSTALL_PATH := $(DESTDIR)$(PREFIX)/bin

 endif


code:
--- efivar.orig/src/makeguids.c
+++ efivar/src/makeguids.c
@@ -99,8 +99,9 @@
 	if (rc < 0)
 		err(1, "makeguids: could not read \"%s\"", argv[1]);

-	/* strictly speaking, this *has* to be too large. */
-	struct guidname *outbuf = calloc(inlen, sizeof (char));
+	/* strictly speaking, this *has* to be too large. Oh so you
+           think a struct takes as much space as a string? Mkay. */
+	struct guidname *outbuf = calloc(inlen, sizeof(char)*8);
 	if (!outbuf)
 		err(1, "makeguids");


code:
#!/bin/sh
[ -z "$CC" ] && { echo "need CC var set">&2 ; exit 1 ; }
[ -z "$A" ] && { echo "need A (arch) var set">&2 ; exit 1 ; }
[ "$A" = i386 ] && { echo little ; exit 0 ; }
[ "$A" = i486 ] && { echo little ; exit 0 ; }
[ "$A" = i586 ] && { echo little ; exit 0 ; }
[ "$A" = i686 ] && { echo little ; exit 0 ; }
[ "$A" = x86_64 ] && { echo little ; exit 0 ; }
[ "$A" = x32 ] && { echo little ; exit 0 ; }
[ "$A" = powerpc ] && { echo big ; exit 0 ; }
tmpfile=/tmp/endiancheck.$$
$CC -dM -E - </dev/null > "$tmpfile"
endian=
[ "$A" = arm ] && {
	endian=little
	cat "$tmpfile" | grep __ARMEB__ >/dev/null && endian=big
	cat "$tmpfile" | grep __AARCH64EB__ >/dev/null && endian=big
}
[ "$A" = arm64 ] && {
	endian=little
	cat "$tmpfile" | grep __AARCH64EB__ >/dev/null && endian=big
}
[ "$A" = aarch64 ] && {
	endian=little
	cat "$tmpfile" | grep __AARCH64EB__ >/dev/null && endian=big
}
[ "$A" = mips ] && {
	endian=big
	cat "$tmpfile" | grep MIPSEL >/dev/null && endian=little
}
[ "$A" = microblaze ] && {
	cat "$tmpfile" | grep __MICROBLAZEEL__ >/dev/null && endian=little
}
[ "$A" = sh4 ] && {
	cat "$tmpfile" | grep __BIG_ENDIAN__ >/dev/null && endian=big
}
cat "$tmpfile" | grep __BIG_ENDIAN__ >/dev/null && endian=big
cat "$tmpfile" | grep __LITTLE_ENDIAN__ >/dev/null && endian=little
[ -z "$endian" ] && {
	$CC -include endian.h -dM -E - </dev/null > "$tmpfile"
	cat "$tmpfile" | grep "__BYTE_ORDER__ __ORDER_BIG_ENDIAN__" >/dev/null && endian=big
	cat "$tmpfile" | grep "__BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__" >/dev/null && endian=little
}
rm "$tmpfile"
[ -z "$endian" ] && {
	echo "error: could not detect endianess" >&2
	exit 1
}
echo "$endian"


code:
--- epdfview-0.1.8.org/src/gtk/PageView.cxx	2013-01-12 17:56:07.773000003 +0000
+++ epdfview-0.1.8/src/gtk/PageView.cxx	2013-01-12 17:57:16.329000003 +0000
@@ -508,7 +508,7 @@
     }

     gint scrollBarSpacing = 0;
-    gtk_widget_style_get (widget, "scrollbar-spacing", &scrollBarSpacing, NULL);
+    gtk_widget_style_get (widget, "scrollbar-spacing", &scrollBarSpacing, (void *) 0);

     GtkWidget *vScrollBar = GTK_SCROLLED_WINDOW (widget)->vscrollbar;
     *width = vScrollBar->allocation.width +
--- epdfview-0.1.8.org/src/gtk/MainView.cxx	2013-01-12 17:56:07.773000003 +0000
+++ epdfview-0.1.8/src/gtk/MainView.cxx	2013-01-12 18:00:38.478000002 +0000
@@ -331,7 +331,7 @@
             GTK_FILE_CHOOSER_ACTION_OPEN,
             GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
             GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
-            NULL);
+            (void *) 0);
     gtk_dialog_set_alternative_button_order (GTK_DIALOG (openDialog),
             GTK_RESPONSE_ACCEPT, GTK_RESPONSE_CANCEL, -1);

@@ -439,7 +439,7 @@
             GTK_FILE_CHOOSER_ACTION_SAVE,
             GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
             GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
-            NULL);
+            (void *) 0);
     gtk_file_chooser_set_do_overwrite_confirmation (
             GTK_FILE_CHOOSER (saveDialog), TRUE);
     gtk_dialog_set_alternative_button_order (GTK_DIALOG (saveDialog),
@@ -940,13 +940,13 @@
         g_object_set_property (G_OBJECT (renderer),
                                "ellipsize", &ellipsizeMode);
         gtk_tree_view_column_pack_start (column, renderer, TRUE);
-        gtk_tree_view_column_set_attributes (column, renderer, "text", 0, NULL);
+        gtk_tree_view_column_set_attributes (column, renderer, "text", 0, (void *) 0);
     }

     {
         GtkCellRenderer *renderer = gtk_cell_renderer_text_new ();
         gtk_tree_view_column_pack_end (column, renderer, FALSE);
-        gtk_tree_view_column_set_attributes (column, renderer, "text", 1, NULL);
+        gtk_tree_view_column_set_attributes (column, renderer, "text", 1, (void *) 0);
     }

     // Set the change signal of the selection.
@@ -1043,7 +1043,7 @@
     for ( int iconIndex = 0 ; iconIndex < iconFilesNum ; iconIndex++ )
     {
         gchar *filename = g_strconcat (DATADIR, "/pixmaps/",
-                                       iconFiles[iconIndex], NULL);
+                                       iconFiles[iconIndex], (void *) 0);
         GError *error = NULL;
         GdkPixbuf *iconPixbuf = gdk_pixbuf_new_from_file (filename, &error);
         if ( NULL != iconPixbuf )
@@ -1133,7 +1133,7 @@
     };
     gchar *licenseTranslated = g_strconcat (_(license[0]), "\n",
                                             _(license[1]), "\n",
-                                            _(license[2]), "\n", NULL);
+                                            _(license[2]), "\n", (void *) 0);
     gtk_about_dialog_set_url_hook (main_window_about_box_url_hook, NULL, NULL);
     gtk_show_about_dialog (NULL,
             "name", _("ePDFView"),
@@ -1144,7 +1144,7 @@
             "authors", authors,
             "comments", comments,
             "translator-credits", _("translator-credits"),
-            NULL);
+            (void *) 0);

     g_free (licenseTranslated);
 }
--- epdfview-0.1.8.org/src/Config.cxx	2013-01-12 17:56:07.775000003 +0000
+++ epdfview-0.1.8/src/Config.cxx	2013-01-12 18:01:26.216000003 +0000
@@ -500,9 +500,9 @@
 getConfigFileName ()
 {
     gchar *configDir =
-        g_build_filename (g_get_user_config_dir (), PACKAGE, NULL);
+        g_build_filename (g_get_user_config_dir (), PACKAGE, (void *) 0);
     g_mkdir_with_parents (configDir, 0700);
-    gchar *configFile = g_build_filename (configDir, "main.conf", NULL);
+    gchar *configFile = g_build_filename (configDir, "main.conf", (void *) 0);
     g_free (configDir);

     return configFile;
--- epdfview-0.1.8.org/src/PDFDocument.cxx	2013-01-12 17:56:07.774000003 +0000
+++ epdfview-0.1.8/src/PDFDocument.cxx	2013-01-12 18:02:27.624000002 +0000
@@ -370,7 +370,7 @@
             "producer", &producer,
             "subject", &subject,
             "title", &title,
-            NULL);
+            (void *) 0);
     setAuthor (author);
     if ( 0 < creationDate )
     {
@@ -936,7 +936,7 @@
     else
     {
         gchar *currentDir = g_get_current_dir ();
-        absoluteFileName = g_build_filename (currentDir, fileName, NULL);
+        absoluteFileName = g_build_filename (currentDir, fileName, (void *) 0);
         g_free (currentDir);
     }

--- epdfview-0.1.8.org/src/IJob.cxx	2013-01-12 17:56:07.775000003 +0000
+++ epdfview-0.1.8/src/IJob.cxx	2013-01-12 18:03:31.600000002 +0000
@@ -66,6 +66,7 @@
 #else
     sleep(0);
 #endif
+   return 0;
 }

 ///


code:
Submitted By: Ken Moffat <ken at linuxfromscratch dot org>
Date: 2012-08-22
Initial Package Version: 0.1.8
Upstream Status: Varies
Origin: Found at fedora.
Description: Three fixes found at fedora.  For the first (only glib.h
can be included directly, with recent glib), we used to use a sed - but
the other two fixes need patches so I've put them all together.

 Second part is from upstream and fixes trashed colours
Upstream: http://trac.emma-soft.com/epdfview/changeset/367/trunk
Fixes bug: https://bugzilla.redhat.com/show_bug.cgi?id=745483

 Third part is the most critical - from Jiri Popelka, found at
https://bugzilla.redhat.com/show_bug.cgi?id=841880 - looks as if fedora
haven't applied it yet.  It solves building with cups-1.6.

diff -Naur epdfview-0.1.8.orig/src/gtk/StockIcons.h epdfview-0.1.8/src/gtk/StockIcons.h
--- epdfview-0.1.8.orig/src/gtk/StockIcons.h	2011-05-28 11:24:57.000000000 +0100
+++ epdfview-0.1.8/src/gtk/StockIcons.h	2012-08-22 20:06:08.728195806 +0100
@@ -18,7 +18,7 @@
 #if !defined (__STOCK_ICONS_H__)
 #define __STOCK_ICONS_H__

-#include <glib/gmacros.h>
+#include <glib.h>

 G_BEGIN_DECLS

diff -Naur epdfview-0.1.8.orig/src/PDFDocument.cxx epdfview-0.1.8/src/PDFDocument.cxx
--- epdfview-0.1.8.orig/src/PDFDocument.cxx	2011-05-28 11:25:01.000000000 +0100
+++ epdfview-0.1.8/src/PDFDocument.cxx	2012-08-22 20:07:03.627913886 +0100
@@ -20,6 +20,7 @@
 #include <time.h>
 #include <poppler.h>
 #include <unistd.h>
+#include <algorithm>
 #include "epdfview.h"

 using namespace ePDFView;
@@ -33,6 +34,24 @@
 static PageMode convertPageMode (gint pageMode);
 static gchar *getAbsoluteFileName (const gchar *fileName);

+namespace
+{
+    void
+    convert_bgra_to_rgba (guint8 *data, int width, int height)
+    {
+        using std::swap;
+
+        for (int y = 0; y < height; y++)
+        {
+            for (int x = 0; x < width; x++)
+            {
+                swap(data[0], data[2]);
+                data += 4;
+            }
+        }
+    }
+}
+
 ///
 /// @brief Constructs a new PDFDocument object.
 ///
@@ -650,6 +669,7 @@
         poppler_page_render (page, context);
         cairo_destroy(context);
         cairo_surface_destroy (surface);
+        convert_bgra_to_rgba(renderedPage->getData (), width, height);
 #else // !HAVE_POPPLER_0_17_0
         // Create the pixbuf from the data and render to it.
         GdkPixbuf *pixbuf = gdk_pixbuf_new_from_data (renderedPage->getData (),
diff -Naur epdfview-0.1.8.orig/src/PrintPter.cxx epdfview-0.1.8/src/PrintPter.cxx
--- epdfview-0.1.8.orig/src/PrintPter.cxx	2011-05-28 11:25:01.000000000 +0100
+++ epdfview-0.1.8/src/PrintPter.cxx	2012-08-22 20:11:46.362436859 +0100
@@ -22,6 +22,40 @@
 #include <locale.h>
 #include "epdfview.h"

+#if (CUPS_VERSION_MAJOR > 1) || (CUPS_VERSION_MINOR > 5)
+#define HAVE_CUPS_1_6 1
+#endif
+
+#ifndef HAVE_CUPS_1_6
+inline int ippGetInteger (ipp_attribute_t *attr, int element)
+{
+    return (attr->values[element].integer);
+}
+
+inline const char * ippGetString (ipp_attribute_t *attr,
+                                  int             element,
+                                  const char      **language /*UNUSED*/)
+{
+    return (attr->values[element].string.text);
+}
+
+inline int ippSetOperation (ipp_t *ipp, ipp_op_t op)
+{
+  if (!ipp)
+    return (0);
+  ipp->request.op.operation_id = op;
+  return (1);
+}
+
+inline int ippSetRequestId (ipp_t *ipp, int request_id)
+{
+    if (!ipp)
+        return (0);
+    ipp->request.any.request_id = request_id;
+    return (1);
+}
+#endif
+
 using namespace ePDFView;

 // Structures
@@ -380,8 +414,8 @@

     ipp_t *request = ippNew ();

-    request->request.op.operation_id = IPP_GET_PRINTER_ATTRIBUTES;
-    request->request.op.request_id = 1;
+    ippSetOperation(request, IPP_GET_PRINTER_ATTRIBUTES);
+    ippSetRequestId(request, 1);

     ippAddString (request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
                   "attributes-charset", NULL, "utf-8");
@@ -403,7 +437,7 @@
             ippFindAttribute (answer, "printer-state", IPP_TAG_ZERO);
         if ( NULL != state )
         {
-            switch (state->values[0].integer)
+            switch (ippGetInteger (state, 0))
             {
                 case IPP_PRINTER_IDLE:
                     attributes->state = g_strdup (_("Idle"));
@@ -425,7 +459,7 @@
             ippFindAttribute (answer, "printer-location", IPP_TAG_ZERO);
         if ( NULL != location )
         {
-            attributes->location = g_strdup (location->values[0].string.text);
+            attributes->location = g_strdup (ippGetString (location, 0, NULL));
         }

         ippDelete (answer);


code:
--- otp_src_17.3/erts/emulator/hipe/hipe_x86_signal.c
+++ b/erts/emulator/hipe/hipe_x86_signal.c
@@ -220,16 +220,15 @@
 #include <dlfcn.h>
 static int (*__next_sigaction)(int, const struct sigaction*, struct sigaction*);
 #define init_done()	(__next_sigaction != 0)
-#define __SIGACTION _sigaction
+#define __SIGACTION __sigaction
 static void do_init(void)
 {
-    __next_sigaction = dlsym(RTLD_NEXT, "_sigaction");
+    __next_sigaction = dlsym(RTLD_NEXT, "__sigaction");
     if (__next_sigaction != 0)
 	return;
     perror("dlsym");
     abort();
 }
-#define _NSIG NSIG
 #define INIT()	do { if (!init_done()) do_init(); } while (0)
 #endif	/* not glibc or darwin */

--- otp_src_17.3/erts/emulator/sys/common/erl_poll.h
+++ b/erts/emulator/sys/common/erl_poll.h
@@ -127,6 +127,7 @@
 #elif ERTS_POLL_USE_EPOLL	/* --- epoll ------------------------------- */

 #include <sys/epoll.h>
+typedef unsigned int __uint32_t;

 #define ERTS_POLL_EV_E2N(EV) \
   ((__uint32_t) (EV))
--- otp_src_17.3/lib/erl_interface/src/connect/ei_resolve.c
+++ b/lib/erl_interface/src/connect/ei_resolve.c
@@ -642,15 +642,11 @@
 #ifndef HAVE_GETHOSTBYNAME_R
   return my_gethostbyname_r(name,hostp,buffer,buflen,h_errnop);
 #else
-#if (defined(__GLIBC__) || (__FreeBSD_version >= 602000) || defined(__DragonFly__) || defined(__ANDROID__))
   struct hostent *result;

   gethostbyname_r(name, hostp, buffer, buflen, &result, h_errnop);

   return result;
-#else
-  return gethostbyname_r(name,hostp,buffer,buflen,h_errnop);
-#endif
 #endif
 #endif
 }
--- otp_src_17.3/make/install_bin
+++ b/make/install_bin
@@ -81,11 +81,6 @@
     test "$tst" = "" || echo "{error,{arg,missing_bindir}}." > $tst
     exit 1
 }
-test "$exec_prefix" != "" || {
-    echo " ERROR: Missing --exec-prefix" 1>&2
-    test "$tst" = "" || echo "{error,{arg,missing_exec_prefix}}." > $tst
-    exit 1
-}
 test "$erlang_bindir" != "" || {
     echo " ERROR: Missing erlang_bindir" 1>&2
     test "$tst" = "" || echo "{error,{arg,missing_erlang_bindir}}." > $tst
@@ -101,7 +96,7 @@
 	"")
 	    # Empty DESTDIR or EXTRA_PREFIX which is ok
 	    case $dir_var in
-		DESTDIR|EXTRA_PREFIX) ;;
+		exec_prefix|DESTDIR|EXTRA_PREFIX) ;;
 		*)
 		    echo " ERROR: Internal error: \$$dir_var is empty" 1>&2
 		    test "$tst" = "" || echo "{error,{empty,$dir_var}}." > $tst


code:
#!/bin/sh

# put your custom cflags and ldflags here...
# this file is sourced by the default butch build template

if [ "$DEBUGBUILD" = "1" ] ; then
	# use "DEBUGBUILD=1 butch install mypkg" to create debug version of mypkg
	optcflags="-O0 -g3"
	optldflags=
	return 0
elif [ "$TESTBUILD" = "1" ] ; then
	optcflags="-O0 -g0"
	optldflags=
	return 0
fi

is_gcc3() {
	local mycc="$CC"
	[ -z "$mycc" ] && mycc=gcc
	$mycc --version | grep "3.4.6" >/dev/null
}
isx86=0
case $A in i?86) isx86=1;; esac
isgcc3=0
[ "$STAGE" = 0 ] || is_gcc3 && isgcc3=1

optcflags="-fdata-sections -ffunction-sections -Os -g0 -fno-unwind-tables -fno-asynchronous-unwind-tables -Wa,--noexecstack"
optldflags="-s -Wl,--gc-sections -Wl,-z,relro,-z,now"
[ "$isx86" = 1 ] || [ "$A" = x86_64 ] && [ "$isgcc3" = 0 ] && \
	optcflags="$optcflags -mtune=generic"

if [ "$BRUTE" = 2 ] ; then
	optcflags="$optcflags -s -Os -flto -fwhole-program"
	optldflags="$optldflags -flto -fwhole-program"
elif [ "$BRUTE" = 1 ] ; then
        optcflags="$optcflags -s -Os -flto"
        optldflags="$optldflags -flto"
fi


code:
# crypttab: mappings for encrypted volumes
#
# see crypttab(5) for the full details
#
# NAME    - name of volume, /dev/mapper/NAME
# DEVICE  - absolute path, UUID, PARTUUID, or LABEL of device or file
# KEY     - -|<file>|<device>[[:fstype]:<file>]
# OPTIONS - options for cryptsetup, 'swap' runs mkswap after mapping,
#           'noauto' prevents automatic mapping

#NAME      DEVICE              KEY                 OPTIONS
#root      /dev/sda1
#usr       /dev/sda2           -                   allow-discards
#home      /dev/sdb1           LABEL=usbdrv:/key
#swap      /dev/sdb2           /dev/urandom        swap,cipher=aes-cbc-essiv:sha256,size=128
#data      UUID=82d4f2...      -                   noauto
#backup    /home/backup        LABEL=usbdrv2       noauto,keyfile-offset=500,keyfile-size=1024

path: KEEP/etc/crypttab


code:
#
# /etc/fstab: static file system information
#
# the 'pass' column decides whether we want to run fsck automatically on a fs
# set to 0 to skip check, and >0 for the order in which fs are checked
# usually one sets root fs to 1 and others to 2 to check them in parallel.

# <file system>        <dir>         <type>    <options>          <dump> <pass>
proc                   /proc         proc      defaults            0      0
devpts                 /dev/pts      devpts    defaults            0      0
shm                    /dev/shm      tmpfs     nodev,nosuid        0      0
/dev/root              /             ext4      defaults            0      1
#example for use with squash read-only root built with squash-tool
#/dev/sda2             /rw           btrfs     defaults            0      0
#/rw/var               /var          none      defaults,bind       0      0

path: KEEP/etc/fstab


code:
root:x:0:root
nobody:x:1:
wheel:x:2:root
tty:x:3:
kvm:x:4:
serial:x:5:
disk:x:6:root
video:x:7:
audio:x:8:
floppy:x:9:
users:x:10:

path: KEEP/etc/group


code: sabotage

path: KEEP/etc/hostname


code:
#
# /etc/hosts: static lookup table for host names
#

#<ip-address>	<hostname.domain.org>	<hostname>
127.0.0.1	localhost.localdomain	localhost
::1             localhost.localdomain	localhost

# End of file

path: KEEP/etc/hosts


code:
# Note that busybox uses a non-standard inittab.

::sysinit:/etc/rc.boot
::respawn:/bin/runsvdir-start
::shutdown:/etc/rc.shutdown

path: KEEP/etc/inittab


code: sabotage \n (\s \m \r) (\l)

path: KEEP/etc/issue


code:
#
# This is a sample mdev.conf.
#

# Devices:
# Syntax: %s %d:%d %s
# devices user:group mode

# null does already exist; therefore ownership has to be changed with command
null    root:root 0666  @chmod 666 $MDEV
zero    root:root 0666
grsec   root:root 0660
full    root:root 0666

random  root:root 0666
urandom root:root 0444
hwrandom root:root 0660

# console does already exist; therefore ownership has to be changed with command
#console        root:tty 0600   @chmod 600 $MDEV && mkdir -p vc && ln -sf ../$MDEV vc/0
#console root:tty 0600 @mkdir -pm 755 fd && cd fd && for x in 0 1 2 3 ; do ln -sf /proc/self/fd/$x $x; done
# load frambuffer console when first frambuffer is found
#fb0     root:video 0660 @modprobe fbcon
fb0	root:video 0660

#fd0     root:floppy 0660
#kmem    root:root 0640
#mem     root:root 0640
#port    root:root 0640
ptmx    root:tty 0666

# ram.*
#ram([0-9]*)     root:disk 0660 >rd/%1
#loop([0-9]+)    root:disk 0660 >loop/%1
#sd[a-z].*       root:disk 0660 */lib/mdev/usbdisk_link
#hd[a-z][0-9]*   root:disk 0660 */lib/mdev/ide_links
#md[0-9]         root:disk 0660

tty             root:tty 0666
#tty[0-9]        root:root 0600
#tty[0-9][0-9]   root:tty 0660
#ttyS[0-9]*      root:serial 0660
#pty.*           root:tty 0660
#vcs[0-9]*       root:tty 0660
#vcsa[0-9]*      root:tty 0660

#ttyLTM[0-9]     root:root 0660 @ln -sf $MDEV modem
#ttySHSF[0-9]    root:root 0660 @ln -sf $MDEV modem
#slamr           root:root 0660 @ln -sf $MDEV slamr0
#slusb           root:root 0660 @ln -sf $MDEV slusb0
#fuse            root:root  0666

# dri device
#card[0-9]       root:video 0660 =dri/

# alsa sound devices and audio stuff
pcm.*           root:audio 0660 =snd/
control.*       root:audio 0660 =snd/
midi.*          root:audio 0660 =snd/
seq             root:audio 0660 =snd/
timer           root:audio 0660 =snd/

adsp            root:audio 0660 >sound/
audio           root:audio 0660 >sound/
dsp             root:audio 0660 >sound/
mixer           root:audio 0660 >sound/
sequencer.*     root:audio 0660 >sound/

# misc stuff
#agpgart         root:root 0660  >misc/
#psaux           root:root 0660  >misc/
#rtc             root:root 0664  >misc/


code:
# /etc/profile

umask 022

# http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_03
TZ="UTC"                              # Coordinated Universal Time
#TZ="CET-1CEST,M.0.5.3,M.0.5.10"      # Central European (Summer) Time

PATH="/local/bin:/bin"
MANPATH="/share/man:/local/share/man"

export MANPATH PATH TZ

path: KEEP/etc/profile


code:
#!/bin/sh
export PATH=/bin

echo sabotage booting

mount -t proc proc /proc
mount -t sysfs sysfs /sys

if which udevd > /dev/null 2>&1 ; then
	# mount -t devtmpfs -o mode=0755,nosuid dev /dev
	mkdir -p /run
	mount -t tmpfs -o nosuid,nodev,mode=0755 run /run
	echo > /proc/sys/kernel/hotplug
	/bin/udevd --daemon
	/bin/udevadm trigger --action=add    --type=subsystems
	/bin/udevadm trigger --action=add    --type=devices
	/bin/udevadm trigger --action=change --type=devices
	/bin/udevadm settle

else
	echo /sbin/mdev > /proc/sys/kernel/hotplug
	mdev -s
fi

# only show warning or worse on console
grep -q " verbose" /proc/cmdline && dmesg -n 8 || dmesg -n 3

hwclock -u -s

hostname $(cat /etc/hostname)
ifconfig lo up

rw=true
rwtest=/tmp/rwtest.tmp
if touch "$rwtest" 2>/dev/null; then
	rm "$rwtest"
else
	rw=false
fi

# make /dev/root symlink in case kernel root bootparam was set
test -e /dev/root || {
	dv=$(sed -n 's,.*root=\(/dev/[sh]d[a-z][0-9]\).*,\1,p' < /proc/cmdline)
	test -n "$dv" && test -e "$dv" && ln -s "$dv" /dev/root
}

cryptmount -M # make encrypted devices from /etc/crypttab available

$rw && mount -o remount,ro /
fsck -A -T -C -p
mkdir -p /dev/shm /dev/pts
$rw && mount -o remount,rw /

swapon -a

mount -a # mount stuff from /etc/fstab

if touch "$rwtest" 2>/dev/null; then
  rm "$rwtest"
  rw=true
else
  rw=false
fi

if ! $rw ; then
	echo "non-writable fs detected, mounting tmpfs to /var and /tmp"
	# tmpfs defaults to -o size=50%
	mount -t tmpfs -o mode=1777 tmpfs /tmp
	mount -t tmpfs -o size=1M,mode=751 tmpfs /var
	mkdir -p /var/spool/cron/crontabs /var/service /var/log /var/empty
	ln -sf /tmp /var/tmp
	( cd /etc/service
	for i in * ; do
		# we copy the services instead of symlinking, so subdirs can be created
		cp -rf /etc/service/$i /var/service/
		mkdir -p /var/log/$i
	done
	)
fi

[ -f /etc/random-seed ] && cat /etc/random-seed >/dev/urandom
dd if=/dev/urandom of=/etc/random-seed count=1 bs=512 2>/dev/null

dmesg >/var/log/dmesg.log

for i in /etc/rc.modules /etc/rc.local ; do
	[ -x "$i" ] && "$i"
done


code:
#!/bin/sh

# put local stuff that you want to run on each start (with root powers) here.
# for example your network config, or your keyboard layout in the linux terminal.
# note that the below network config is only for wired networks.
# edit /etc/wpa_connect_action.sh and /etc/wpa_supplicant.conf for wlan config.

do_init_devices=false
do_static_ip=false
do_dhcp=false
do_nat_router=false
do_init_alsa=false
do_kmap=false
do_disable_overcommit=true
do_protected_symlinks=false
do_protected_hardlinks=true
do_allow_user_ping=true
do_disable_ipv6=false
do_disable_ipv6_accept_ra=true

if $do_allow_user_ping ; then
	# give groups 1000 - MAX access.
	# this excludes services and root, but root uses SOCK_RAW anyway.
	echo "1000 2147483647" > /proc/sys/net/ipv4/ping_group_range
fi

if $do_init_devices ; then
	# if mdev/eudev don't work as excepted, do it straight
	chown root:audio /dev/snd/* && chmod 0660 /dev/snd/*
	chown root:video /dev/fb0 && chmod 0660 /dev/fb0
	chown root:tty /dev/tty && chmod 0666 /dev/tty
	[ -e /dev/kvm ] && chown root:kvm /dev/kvm && chmod 0660 /dev/kvm
	chmod og+r /dev/rtc0
fi

if $do_static_ip ; then

	if=eth0
	ip=192.168.0.2
	nm=255.255.255.0
	gw=192.168.0.1

	ifconfig $if $ip netmask $nm
	route add default gw $gw

elif $do_dhcp ; then

	if=eth0
	dhclient $if
fi

if $do_nat_router ; then
	wan=wlan0
	lan=eth0
	echo 1 > /proc/sys/net/ipv4/ip_forward
	iptables --table nat --append POSTROUTING --out-interface $wan \
	         -j MASQUERADE
	iptables --append FORWARD --in-interface $lan -j ACCEPT
fi

if $do_init_alsa ; then
	# use aplay -l to show available cards and device ids

	alsa_card=0
	alsa_device=0
	alsactl init $alsa_card

	# system settings of /etc/asound.conf can be overridden via ~/.asoundrc
	[ -e /etc/asound.conf ] || \
		printf "defaults.pcm.card %s\ndefaults.pcm.device %s\ndefaults.ctl.card %s\n" \
		       "$alsa_card" "$alsa_device" "$alsa_card" > /etc/asound.conf
fi

if $do_kmap ; then
	# take your pick
	#kmap=/share/kmap/be-latin1.kmap
	#kmap=/share/kmap/br-abnt2.kmap
	#kmap=/share/kmap/cf.kmap
	#kmap=/share/kmap/croat.kmap
	#kmap=/share/kmap/cz-lat2.kmap
	#kmap=/share/kmap/de-latin1.kmap
	#kmap=/share/kmap/de-latin1-nodeadkeys.kmap
	#kmap=/share/kmap/de_CH-latin1.kmap
	#kmap=/share/kmap/dk-latin1.kmap
	#kmap=/share/kmap/dvorak-l.kmap
	#kmap=/share/kmap/dvorak-r.kmap
	#kmap=/share/kmap/dvorak.kmap
	#kmap=/share/kmap/es.kmap
	#kmap=/share/kmap/fi-latin1.kmap
	#kmap=/share/kmap/fr-latin1.kmap
	#kmap=/share/kmap/fr_CH-latin1.kmap
	#kmap=/share/kmap/hu.kmap
	#kmap=/share/kmap/is-latin1.kmap
	#kmap=/share/kmap/it.kmap
	#kmap=/share/kmap/jp106.kmap
	#kmap=/share/kmap/nl2.kmap
	#kmap=/share/kmap/no-latin1.kmap
	#kmap=/share/kmap/pl2.kmap
	#kmap=/share/kmap/pt-latin1.kmap
	#kmap=/share/kmap/se-lat6.kmap
	#kmap=/share/kmap/sg-latin1.kmap
	#kmap=/share/kmap/slovene.kmap
	#kmap=/share/kmap/tr_q-latin5.kmap
	#kmap=/share/kmap/trq.kmap
	#kmap=/share/kmap/uk.kmap
	#kmap=/share/kmap/us-acentos.kmap
	#kmap=/share/kmap/us.kmap
	[ -n "$kmap" ] && loadkmap < "$kmap"
fi

# http://ewontfix.com/3
if $do_disable_overcommit ; then
	echo "2" > /proc/sys/vm/overcommit_memory
fi

# http://www.openwall.com/lists/oss-security/2013/03/13/10
if $do_protected_symlinks ; then
	echo "1" > /proc/sys/fs/protected_symlinks
fi
if $do_protected_hardlinks ; then
	echo "1" > /proc/sys/fs/protected_hardlinks
fi

if $do_disable_ipv6 ; then
	echo "1" > /proc/sys/net/ipv6/conf/all/disable_ipv6
fi
if $do_disable_ipv6_accept_ra ; then
	# disable automatic processing of router advertisement.
	# this can silently and unexpectedly add ipv6 routes behind one's back.
	echo "0" > /proc/sys/net/ipv6/conf/all/accept_ra
fi


code:
#!/bin/sh
PATH=/bin

echo shutting down

hwclock -u -w

sv down /var/service/*

killall5 -15
sleep 5
killall5 -9

dd if=/dev/urandom of=/etc/random-seed count=1 bs=512 2>/dev/null

swapoff -a

echo mounting / read-only
umount -a -r -t noproc
mount -o remount,ro /

sync
sleep 1
wait

echo bye


code:
echo                7/tcp
echo                7/udp
discard             9/tcp
discard             9/udp
systat             11/tcp
systat             11/udp
daytime            13/tcp
daytime            13/udp
qotd               17/tcp
qotd               17/udp
chargen            19/tcp
chargen            19/udp
ftp-data           20/tcp
ftp                21/tcp
ssh                22/tcp
telnet             23/tcp
smtp               25/tcp
time               37/tcp
time               37/udp
name               42/tcp
name               42/udp
nameserver         42/tcp
nameserver         42/udp
domain             53/tcp
domain             53/udp
whoispp            63/tcp
whoispp            63/udp
sql-net            66/tcp
sql-net            66/udp
bootps             67/tcp
bootps             67/udp
bootpc             68/tcp
bootpc             68/udp
tftp               69/tcp
tftp               69/udp
gopher             70/tcp
gopher             70/udp
finger             79/tcp
finger             79/udp
http               80/tcp
www                80/tcp
www-http           80/tcp
http               80/sctp
kerberos           88/tcp
kerberos           88/udp
hostname          101/tcp
hostname          101/udp
rtelnet           107/tcp
rtelnet           107/udp
pop3              110/tcp
sunrpc            111/tcp
sunrpc            111/udp
ident             113/tcp
auth              113/tcp
auth              113/udp
sftp              115/tcp
sftp              115/udp
nntp              119/tcp
nntp              119/udp
ntp               123/tcp
ntp               123/udp
profile           136/tcp
profile           136/udp
netbios-ns        137/tcp
netbios-ns        137/udp
netbios-dgm       138/tcp
netbios-dgm       138/udp
netbios-ssn       139/tcp
netbios-ssn       139/udp
imap              143/tcp
imap              143/udp
bftp              152/tcp
bftp              152/udp
snmp              161/tcp
snmp              161/udp
snmptrap          162/tcp
snmptrap          162/udp
rsvd              168/tcp
rsvd              168/udp
send              169/tcp
send              169/udp
print-srv         170/tcp
print-srv         170/udp
vmnet             175/tcp
vmnet             175/udp
xdmcp             177/tcp
xdmcp             177/udp
irc               194/tcp
irc               194/udp
link              245/tcp
link              245/udp
ldap              389/tcp
ldap              389/udp
https             443/tcp
microsoft-ds      445/tcp
microsoft-ds      445/udp
isakmp            500/tcp
isakmp            500/udp
exec              512/tcp
biff              512/udp
login             513/tcp
who               513/udp
shell             514/tcp
syslog            514/udp
printer           515/tcp
printer           515/udp
videotex          516/tcp
videotex          516/udp
talk              517/tcp
talk              517/udp
ntalk             518/tcp
ntalk             518/udp
utime             519/tcp
utime             519/udp
efs               520/tcp
router            520/udp
ncp               524/tcp
ncp               524/udp
timed             525/tcp
timed             525/udp
uucp              540/tcp
uucp              540/udp
uucp-rlogin       541/tcp
uucp-rlogin       541/udp
klogin            543/tcp
klogin            543/udp
kshell            544/tcp
kshell            544/udp
dhcpv6-client     546/tcp
dhcpv6-client     546/udp
dhcpv6-server     547/tcp
dhcpv6-server     547/udp
new-rwho          550/tcp
new-rwho          550/udp
nntps             563/tcp
nntps             563/udp
9pfs              564/tcp
9pfs              564/udp
whoami            565/tcp
whoami            565/udp
submission        587/tcp
submission        587/udp
cal               588/tcp
cal               588/udp
http-alt          591/tcp
http-alt          591/udp
http-rpc-epmap    593/tcp
http-rpc-epmap    593/udp
sshell            614/tcp
sshell            614/udp
ldaps             636/tcp
ldaps             636/udp
kerberos-adm      749/tcp
kerberos-adm      749/udp
submit            773/tcp
notify            773/udp
rpasswd           774/tcp
imaps             993/tcp
imaps             993/udp
pop3s             995/tcp
pop3s             995/udp
socks            1080/tcp
socks            1080/udp
wins             1512/tcp
wins             1512/udp
x11              6000/tcp
x11              6000/udp
quake           26000/tcp
quake           26000/udp

path: KEEP/etc/services


code:
#!/bin/sh
# udhcpc script edited by Tim Riker <Tim@Rikers.org>
[ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1
RESOLV_CONF="/etc/resolv.conf"
[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
[ -n "$subnet" ] && NETMASK="netmask $subnet"
case "$1" in
	deconfig)
		/sbin/ifconfig $interface 0.0.0.0
		;;
	renew|bound)
		/sbin/ifconfig $interface $ip $BROADCAST $NETMASK
		if [ -n "$router" ] ; then
			echo "deleting routers"
			while route del default gw 0.0.0.0 dev $interface ; do
				:
			done
			for i in $router ; do
				route add default gw $i dev $interface
			done
		fi
		echo -n > $RESOLV_CONF
		[ -n "$domain" ] && echo search $domain >> $RESOLV_CONF
		for i in $dns ; do
			echo adding dns $i
			echo nameserver $i >> $RESOLV_CONF
		done
		;;
esac
exit 0

path: KEEP/etc/udhcpc-script


code:
#!/bin/sh

# set to false if you want a static ip
# (and edit ip address settings further down)
do_dhcp=true
# set to true if you experience connection problems
do_throttle=false

if="$1"
state="$2"
echo "$0: $if $state"
case "$state" in
RECALLED)
sleep 1
$do_throttle && iwconfig "$if" rate 1M
if $do_dhcp ; then
	dhclient "$if" || dhclient "$if";
else
	sn=192.168.1
	ifconfig "$if" "$sn".100 netmask 255.255.255.0
	route delete default
	route add default gw "$sn".1
fi
;;
CONNECTED)
"$0" "$1" RECALLED &
;;
DISCONNECTED)
:
;;
esac


code:
#!/bin/sh
# this makes cursor-up keys and similar work.
# if you use xfbdev, use the evdev rules/model - do not use it for Xorg.
#setxkbmap -rules evdev -model evdev
#setxkbmap -layout de -rules evdev -model evdev -variant nodeadkeys
type xrdb >/dev/null 2>&1 && test -e ~/.Xresources && xrdb -load ~/.Xresources
# this will automatically start lxde. if you do not want this, start xterm oslt
exec startlxde

path: KEEP/etc/xinitrc


code:
From 21fd88ff97343fbc01a9b4432790110469bff955 Mon Sep 17 00:00:00 2001
From: Michael Forney <mforney@mforney.org>
Date: Fri, 25 Oct 2013 18:44:20 -0700
Subject: [PATCH 1/2] libudev-util.c: Fix sysconf variable for
 util_lookup_group

---
 src/libudev/libudev-util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libudev/libudev-util.c b/src/libudev/libudev-util.c
index 522a984..337514a 100644
--- a/src/libudev/libudev-util.c
+++ b/src/libudev/libudev-util.c
@@ -108,7 +108,7 @@ gid_t util_lookup_group(struct udev *udev, const char *group)
         struct group grbuf;
         struct group *gr;
         gid_t gid = 0;
-        size_t buflen = sysconf(_SC_GETPW_R_SIZE_MAX);
+        size_t buflen = sysconf(_SC_GETGR_R_SIZE_MAX);
         char *buf = NULL;

         if (streq(group, "root"))
--
1.8.4

From 0b2c207b7e96cfa8ad8b9a414c2f4f7a1a12f4f4 Mon Sep 17 00:00:00 2001
From: Michael Forney <mforney@mforney.org>
Date: Sat, 26 Oct 2013 01:12:51 +0000
Subject: [PATCH 2/2] libudev-util.c: Handle -1 return from
 sysconf(_SC_GET{PW,GR}_R_SIZE_MAX)

POSIX says:

    Note that sysconf(_SC_GETGR_R_SIZE_MAX) may return -1 if there is no
    hard limit on the size of the buffer needed to store all the groups
    returned.

The example from POSIX uses a default buffer size of 1024 in that case.
---
 src/libudev/libudev-util.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/libudev/libudev-util.c b/src/libudev/libudev-util.c
index 337514a..ae5e285 100644
--- a/src/libudev/libudev-util.c
+++ b/src/libudev/libudev-util.c
@@ -84,8 +84,11 @@ uid_t util_lookup_user(struct udev *udev, const char *user)
         struct passwd *pw;
         uid_t uid;
         size_t buflen = sysconf(_SC_GETPW_R_SIZE_MAX);
-        char *buf = alloca(buflen);
+        char *buf;

+        if (buflen == -1)
+                buflen = 1024;
+        buf = alloca(buflen);
         if (streq(user, "root"))
                 return 0;
         uid = strtoul(user, &endptr, 10);
@@ -111,6 +114,8 @@ gid_t util_lookup_group(struct udev *udev, const char *group)
         size_t buflen = sysconf(_SC_GETGR_R_SIZE_MAX);
         char *buf = NULL;

+        if (buflen == -1)
+                buflen = 1024;
         if (streq(group, "root"))
                 return 0;
         gid = strtoul(group, &endptr, 10);
--
1.8.4


code:
From f77e6cf4fd7fef49ac91d8c62b6a9a993529adb8 Mon Sep 17 00:00:00 2001
From: Carlos Garcia Campos <carlosgc@gnome.org>
Date: Fri, 17 Sep 2010 11:21:16 +0000
Subject: [pdf] Update to poppler api changes

Linearized PopplerDocument property is now boolean rather than string.
---
diff --git a/backend/pdf/ev-poppler.cc b/backend/pdf/ev-poppler.cc
index aa080e6..ced3ef7 100644
--- a/backend/pdf/ev-poppler.cc
+++ b/backend/pdf/ev-poppler.cc
@@ -722,6 +722,9 @@ pdf_document_get_info (EvDocument *document)
 	PopplerPermissions permissions;
 	EvPage *page;
 	char *metadata;
+#ifdef HAVE_POPPLER_DOCUMENT_IS_LINEARIZED
+	gboolean linearized;
+#endif

 	info = g_new0 (EvDocumentInfo, 1);

@@ -758,7 +761,11 @@ pdf_document_get_info (EvDocument *document)
 		      "producer", &(info->producer),
 		      "creation-date", &(info->creation_date),
 		      "mod-date", &(info->modified_date),
+#ifdef HAVE_POPPLER_DOCUMENT_IS_LINEARIZED
+		      "linearized", &linearized,
+#else
 		      "linearized", &(info->linearized),
+#endif
 		      "metadata", &metadata,
 		      NULL);

@@ -864,6 +871,10 @@ pdf_document_get_info (EvDocument *document)
 		info->security = g_strdup (_("No"));
 	}

+#ifdef HAVE_POPPLER_DOCUMENT_IS_LINEARIZED
+	info->linearized = linearized ? g_strdup (_("Yes")) : g_strdup (_("No"));
+#endif
+
 	return info;
 }

--
cgit v0.9.0.2


code:
From 464ec9077f4bc709e50c83372c9d4e1703533efa Mon Sep 17 00:00:00 2001
From: Carlos Garcia Campos <carlosgc@gnome.org>
Date: Sun, 20 Feb 2011 10:29:19 +0000
Subject: libview: Use a popup window instead of a toplevel for loading window

Fixes focus stealing when scrolling. See bug #633475.
---
diff --git a/libview/ev-loading-window.c b/libview/ev-loading-window.c
index b413431..94576ee 100644
--- a/libview/ev-loading-window.c
+++ b/libview/ev-loading-window.c
@@ -266,6 +266,7 @@ ev_loading_window_new (GtkWindow *parent)
 	g_return_val_if_fail (GTK_IS_WINDOW (parent), NULL);

 	window = g_object_new (EV_TYPE_LOADING_WINDOW,
+                               "type", GTK_WINDOW_POPUP,
 			       "parent", parent,
 			       NULL);
 	return window;
--
cgit v0.9.0.2


code:
--- evince-2.32.0.org/backend/pdf/ev-poppler.cc	2013-01-08 08:57:54.874000002 +0000
+++ evince-2.32.0/backend/pdf/ev-poppler.cc	2013-01-09 19:57:35.834000002 +0000
@@ -338,7 +338,7 @@

 	g_object_get (G_OBJECT (page->backend_page),
 		      "label", &label,
-		      NULL);
+		      (void *) 0);
 	return label;
 }

@@ -678,7 +678,7 @@
 		      "mod-date", &(info->modified_date),
 		      "linearized", &(info->linearized),
 		      "metadata", &metadata,
-		      NULL);
+		      (void *) 0);

 	if (metadata != NULL) {
 		pdf_document_parse_metadata (metadata, info);
@@ -2755,11 +2755,11 @@
 					      "rectangle", &ev_rect,
 					      "popup_is_open", is_open,
 					      "has_popup", TRUE,
-					      NULL);
+					      (void *) 0);
 			} else {
 				g_object_set (ev_annot,
 					      "has_popup", FALSE,
-					      NULL);
+					      (void *) 0);
 			}

 			label = poppler_annot_markup_get_label (markup);
@@ -2768,7 +2768,7 @@
 			g_object_set (ev_annot,
 				      "label", label,
 				      "opacity", opacity,
-				      NULL);
+				      (void *) 0);

 			g_free (label);
 		}