mirror of
https://github.com/NLnetLabs/unbound.git
synced 2025-12-20 23:00:56 -05:00
services api integration.
git-svn-id: file:///svn/unbound/trunk@1501 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
parent
7a2c1c8d47
commit
f30fc9133c
18 changed files with 22626 additions and 23196 deletions
|
|
@ -122,7 +122,8 @@ ALL_OBJ=$(addprefix $(BUILD),$(ALL_SRC:.c=.lo) \
|
||||||
$(addprefix compat/,$(LIBOBJS:.o=.lo))) $(COMPAT_OBJ)
|
$(addprefix compat/,$(LIBOBJS:.o=.lo))) $(COMPAT_OBJ)
|
||||||
|
|
||||||
ifeq "$(UB_ON_WINDOWS)" "yes"
|
ifeq "$(UB_ON_WINDOWS)" "yes"
|
||||||
DAEMON_OBJ+=$(BUILD)winrc/rsrc_unbound.o
|
DAEMON_SRC+=$(patsubst $(srcdir)/%,%, $(wildcard $(srcdir)/winrc/*.c))
|
||||||
|
DAEMON_OBJ+=$(BUILD)winrc/rsrc_unbound.o $(BUILD)winrc/win_svc.lo
|
||||||
HOST_OBJ+=$(BUILD)winrc/rsrc_unbound_host.o
|
HOST_OBJ+=$(BUILD)winrc/rsrc_unbound_host.o
|
||||||
CONTROL_OBJ+=$(BUILD)winrc/rsrc_unbound_control.o
|
CONTROL_OBJ+=$(BUILD)winrc/rsrc_unbound_control.o
|
||||||
CHECKCONF_OBJ+=$(BUILD)winrc/rsrc_unbound_checkconf.o
|
CHECKCONF_OBJ+=$(BUILD)winrc/rsrc_unbound_checkconf.o
|
||||||
|
|
|
||||||
8857
aclocal.m4
vendored
8857
aclocal.m4
vendored
File diff suppressed because it is too large
Load diff
1079
config.guess
vendored
1079
config.guess
vendored
File diff suppressed because it is too large
Load diff
14
config.h.in
14
config.h.in
|
|
@ -299,10 +299,6 @@
|
||||||
/* Define to 1 if you have the <ws2tcpip.h> header file. */
|
/* Define to 1 if you have the <ws2tcpip.h> header file. */
|
||||||
#undef HAVE_WS2TCPIP_H
|
#undef HAVE_WS2TCPIP_H
|
||||||
|
|
||||||
/* Define to the sub-directory in which libtool stores uninstalled libraries.
|
|
||||||
*/
|
|
||||||
#undef LT_OBJDIR
|
|
||||||
|
|
||||||
/* Define to the maximum message length to pass to syslog. */
|
/* Define to the maximum message length to pass to syslog. */
|
||||||
#undef MAXSYSLOGMSGLEN
|
#undef MAXSYSLOGMSGLEN
|
||||||
|
|
||||||
|
|
@ -400,11 +396,9 @@
|
||||||
/* in_port_t */
|
/* in_port_t */
|
||||||
#undef in_port_t
|
#undef in_port_t
|
||||||
|
|
||||||
/* Define to `__inline__' or `__inline' if that's what the C compiler
|
/* Define as `__inline' if that's what the C compiler calls it, or to nothing
|
||||||
calls it, or to nothing if 'inline' is not supported under any name. */
|
if it is not supported. */
|
||||||
#ifndef __cplusplus
|
|
||||||
#undef inline
|
#undef inline
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Define to `short' if <sys/types.h> does not define. */
|
/* Define to `short' if <sys/types.h> does not define. */
|
||||||
#undef int16_t
|
#undef int16_t
|
||||||
|
|
@ -421,7 +415,7 @@
|
||||||
/* Define to rpl_malloc if the replacement function should be used. */
|
/* Define to rpl_malloc if the replacement function should be used. */
|
||||||
#undef malloc
|
#undef malloc
|
||||||
|
|
||||||
/* Define to `long int' if <sys/types.h> does not define. */
|
/* Define to `long' if <sys/types.h> does not define. */
|
||||||
#undef off_t
|
#undef off_t
|
||||||
|
|
||||||
/* Define to `int' if <sys/types.h> does not define. */
|
/* Define to `int' if <sys/types.h> does not define. */
|
||||||
|
|
@ -430,7 +424,7 @@
|
||||||
/* Define to 'int' if not defined */
|
/* Define to 'int' if not defined */
|
||||||
#undef rlim_t
|
#undef rlim_t
|
||||||
|
|
||||||
/* Define to `unsigned int' if <sys/types.h> does not define. */
|
/* Define to `unsigned' if <sys/types.h> does not define. */
|
||||||
#undef size_t
|
#undef size_t
|
||||||
|
|
||||||
/* Define to 'int' if not defined */
|
/* Define to 'int' if not defined */
|
||||||
|
|
|
||||||
497
config.sub
vendored
497
config.sub
vendored
|
|
@ -1,10 +1,9 @@
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# Configuration validation subroutine script.
|
# Configuration validation subroutine script.
|
||||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
|
||||||
# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
|
# Free Software Foundation, Inc.
|
||||||
# Inc.
|
|
||||||
|
|
||||||
timestamp='2007-04-29'
|
timestamp='2001-06-08'
|
||||||
|
|
||||||
# This file is (in principle) common to ALL GNU software.
|
# This file is (in principle) common to ALL GNU software.
|
||||||
# The presence of a machine in this file suggests that SOME GNU software
|
# The presence of a machine in this file suggests that SOME GNU software
|
||||||
|
|
@ -22,17 +21,15 @@ timestamp='2007-04-29'
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software
|
||||||
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
|
# Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
# 02110-1301, USA.
|
# Boston, MA 02111-1307, USA.
|
||||||
#
|
|
||||||
# As a special exception to the GNU General Public License, if you
|
# As a special exception to the GNU General Public License, if you
|
||||||
# distribute this file as part of a program that contains a
|
# distribute this file as part of a program that contains a
|
||||||
# configuration script generated by Autoconf, you may include it under
|
# configuration script generated by Autoconf, you may include it under
|
||||||
# the same distribution terms that you use for the rest of that program.
|
# the same distribution terms that you use for the rest of that program.
|
||||||
|
|
||||||
|
# Please send patches to <config-patches@gnu.org>.
|
||||||
# Please send patches to <config-patches@gnu.org>. Submit a context
|
|
||||||
# diff and a properly formatted ChangeLog entry.
|
|
||||||
#
|
#
|
||||||
# Configuration subroutine to validate and canonicalize a configuration type.
|
# Configuration subroutine to validate and canonicalize a configuration type.
|
||||||
# Supply the specified configuration type as an argument.
|
# Supply the specified configuration type as an argument.
|
||||||
|
|
@ -72,7 +69,7 @@ Report bugs and patches to <config-patches@gnu.org>."
|
||||||
version="\
|
version="\
|
||||||
GNU config.sub ($timestamp)
|
GNU config.sub ($timestamp)
|
||||||
|
|
||||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
|
||||||
Free Software Foundation, Inc.
|
Free Software Foundation, Inc.
|
||||||
|
|
||||||
This is free software; see the source for copying conditions. There is NO
|
This is free software; see the source for copying conditions. There is NO
|
||||||
|
|
@ -85,11 +82,11 @@ Try \`$me --help' for more information."
|
||||||
while test $# -gt 0 ; do
|
while test $# -gt 0 ; do
|
||||||
case $1 in
|
case $1 in
|
||||||
--time-stamp | --time* | -t )
|
--time-stamp | --time* | -t )
|
||||||
echo "$timestamp" ; exit ;;
|
echo "$timestamp" ; exit 0 ;;
|
||||||
--version | -v )
|
--version | -v )
|
||||||
echo "$version" ; exit ;;
|
echo "$version" ; exit 0 ;;
|
||||||
--help | --h* | -h )
|
--help | --h* | -h )
|
||||||
echo "$usage"; exit ;;
|
echo "$usage"; exit 0 ;;
|
||||||
-- ) # Stop option processing
|
-- ) # Stop option processing
|
||||||
shift; break ;;
|
shift; break ;;
|
||||||
- ) # Use stdin as input.
|
- ) # Use stdin as input.
|
||||||
|
|
@ -101,7 +98,7 @@ while test $# -gt 0 ; do
|
||||||
*local*)
|
*local*)
|
||||||
# First pass through any local machine types.
|
# First pass through any local machine types.
|
||||||
echo $1
|
echo $1
|
||||||
exit ;;
|
exit 0;;
|
||||||
|
|
||||||
* )
|
* )
|
||||||
break ;;
|
break ;;
|
||||||
|
|
@ -120,9 +117,7 @@ esac
|
||||||
# Here we must recognize all the valid KERNEL-OS combinations.
|
# Here we must recognize all the valid KERNEL-OS combinations.
|
||||||
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
|
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
|
||||||
case $maybe_os in
|
case $maybe_os in
|
||||||
nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
|
nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-*)
|
||||||
uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
|
|
||||||
storm-chaos* | os2-emx* | rtmk-nova*)
|
|
||||||
os=-$maybe_os
|
os=-$maybe_os
|
||||||
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
|
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
|
||||||
;;
|
;;
|
||||||
|
|
@ -148,7 +143,7 @@ case $os in
|
||||||
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
|
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
|
||||||
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
|
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
|
||||||
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
|
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
|
||||||
-apple | -axis | -knuth | -cray)
|
-apple | -axis)
|
||||||
os=
|
os=
|
||||||
basic_machine=$1
|
basic_machine=$1
|
||||||
;;
|
;;
|
||||||
|
|
@ -173,10 +168,6 @@ case $os in
|
||||||
-hiux*)
|
-hiux*)
|
||||||
os=-hiuxwe2
|
os=-hiuxwe2
|
||||||
;;
|
;;
|
||||||
-sco6)
|
|
||||||
os=-sco5v6
|
|
||||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
|
||||||
;;
|
|
||||||
-sco5)
|
-sco5)
|
||||||
os=-sco3.2v5
|
os=-sco3.2v5
|
||||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||||
|
|
@ -193,10 +184,6 @@ case $os in
|
||||||
# Don't forget version if it is 3.2v4 or newer.
|
# Don't forget version if it is 3.2v4 or newer.
|
||||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
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*)
|
-sco*)
|
||||||
os=-sco3.2v2
|
os=-sco3.2v2
|
||||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||||
|
|
@ -236,57 +223,26 @@ esac
|
||||||
case $basic_machine in
|
case $basic_machine in
|
||||||
# Recognize the basic CPU types without company name.
|
# Recognize the basic CPU types without company name.
|
||||||
# Some are omitted here because they have special meanings below.
|
# Some are omitted here because they have special meanings below.
|
||||||
1750a | 580 \
|
tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc \
|
||||||
| a29k \
|
| arm | arme[lb] | arm[bl]e | armv[2345] | armv[345][lb] | strongarm | xscale \
|
||||||
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
|
| pyramid | mn10200 | mn10300 | tron | a29k \
|
||||||
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
|
| 580 | i960 | h8300 \
|
||||||
| am33_2.0 \
|
| x86 | ppcbe | mipsbe | mipsle | shbe | shle \
|
||||||
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
|
| hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
|
||||||
| bfin \
|
| hppa64 \
|
||||||
| c4x | clipper \
|
| alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \
|
||||||
| d10v | d30v | dlx | dsp16xx \
|
| alphaev6[78] \
|
||||||
| fido | fr30 | frv \
|
| we32k | ns16k | clipper | i370 | sh | sh[34] \
|
||||||
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
|
| powerpc | powerpcle \
|
||||||
| i370 | i860 | i960 | ia64 \
|
| 1750a | dsp16xx | pdp10 | pdp11 \
|
||||||
| ip2k | iq2000 \
|
| mips16 | mips64 | mipsel | mips64el \
|
||||||
| m32c | m32r | m32rle | m68000 | m68k | m88k \
|
| mips64orion | mips64orionel | mipstx39 | mipstx39el \
|
||||||
| maxq | mb | microblaze | mcore | mep \
|
| mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \
|
||||||
| mips | mipsbe | mipseb | mipsel | mipsle \
|
| mips64vr5000 | miprs64vr5000el | mcore | s390 | s390x \
|
||||||
| mips16 \
|
| sparc | sparclet | sparclite | sparc64 | sparcv9 | sparcv9b \
|
||||||
| mips64 | mips64el \
|
| v850 | c4x \
|
||||||
| mips64vr | mips64vrel \
|
| thumb | d10v | d30v | fr30 | avr | openrisc | tic80 \
|
||||||
| mips64orion | mips64orionel \
|
| pj | pjl | h8500 | z8k)
|
||||||
| mips64vr4100 | mips64vr4100el \
|
|
||||||
| mips64vr4300 | mips64vr4300el \
|
|
||||||
| mips64vr5000 | mips64vr5000el \
|
|
||||||
| mips64vr5900 | mips64vr5900el \
|
|
||||||
| mipsisa32 | mipsisa32el \
|
|
||||||
| mipsisa32r2 | mipsisa32r2el \
|
|
||||||
| mipsisa64 | mipsisa64el \
|
|
||||||
| mipsisa64r2 | mipsisa64r2el \
|
|
||||||
| mipsisa64sb1 | mipsisa64sb1el \
|
|
||||||
| mipsisa64sr71k | mipsisa64sr71kel \
|
|
||||||
| mipstx39 | mipstx39el \
|
|
||||||
| mn10200 | mn10300 \
|
|
||||||
| mt \
|
|
||||||
| msp430 \
|
|
||||||
| nios | nios2 \
|
|
||||||
| ns16k | ns32k \
|
|
||||||
| or32 \
|
|
||||||
| pdp10 | pdp11 | pj | pjl \
|
|
||||||
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
|
|
||||||
| pyramid \
|
|
||||||
| score \
|
|
||||||
| sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
|
|
||||||
| sh64 | sh64le \
|
|
||||||
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
|
|
||||||
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
|
|
||||||
| spu | strongarm \
|
|
||||||
| tahoe | thumb | tic4x | tic80 | tron \
|
|
||||||
| v850 | v850e \
|
|
||||||
| we32k \
|
|
||||||
| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
|
|
||||||
| z8k)
|
|
||||||
basic_machine=$basic_machine-unknown
|
basic_machine=$basic_machine-unknown
|
||||||
;;
|
;;
|
||||||
m6811 | m68hc11 | m6812 | m68hc12)
|
m6811 | m68hc11 | m6812 | m68hc12)
|
||||||
|
|
@ -296,9 +252,6 @@ case $basic_machine in
|
||||||
;;
|
;;
|
||||||
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
|
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
|
||||||
;;
|
;;
|
||||||
ms1)
|
|
||||||
basic_machine=mt-unknown
|
|
||||||
;;
|
|
||||||
|
|
||||||
# We use `pc' rather than `unknown'
|
# We use `pc' rather than `unknown'
|
||||||
# because (1) that's what they normally are, and
|
# because (1) that's what they normally are, and
|
||||||
|
|
@ -312,66 +265,31 @@ case $basic_machine in
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
# Recognize the basic CPU types with company name.
|
# Recognize the basic CPU types with company name.
|
||||||
580-* \
|
# FIXME: clean up the formatting here.
|
||||||
| a29k-* \
|
vax-* | tahoe-* | i*86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \
|
||||||
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
|
| m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | c[123]* \
|
||||||
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
|
| arm-* | armbe-* | armle-* | armv*-* | strongarm-* | xscale-* \
|
||||||
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
|
| mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
|
||||||
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
|
| power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \
|
||||||
| avr-* | avr32-* \
|
| xmp-* | ymp-* \
|
||||||
| bfin-* | bs2000-* \
|
| x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* \
|
||||||
| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
|
| hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* \
|
||||||
| clipper-* | craynv-* | cydra-* \
|
| hppa2.0n-* | hppa64-* \
|
||||||
| d10v-* | d30v-* | dlx-* \
|
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \
|
||||||
| elxsi-* \
|
| alphaev6[78]-* \
|
||||||
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
|
| we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \
|
||||||
| h8300-* | h8500-* \
|
| clipper-* | orion-* \
|
||||||
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
|
| sparclite-* | pdp10-* | pdp11-* | sh-* | sh[34]-* | sh[34]eb-* \
|
||||||
| i*86-* | i860-* | i960-* | ia64-* \
|
| powerpc-* | powerpcle-* | sparc64-* | sparcv9-* | sparcv9b-* | sparc86x-* \
|
||||||
| ip2k-* | iq2000-* \
|
| mips16-* | mips64-* | mipsel-* \
|
||||||
| m32c-* | m32r-* | m32rle-* \
|
| mips64el-* | mips64orion-* | mips64orionel-* \
|
||||||
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
|
| mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \
|
||||||
| m88110-* | m88k-* | maxq-* | mcore-* \
|
| mipstx39-* | mipstx39el-* | mcore-* \
|
||||||
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
|
| f30[01]-* | f700-* | s390-* | s390x-* | sv1-* | t3e-* \
|
||||||
| mips16-* \
|
| [cjt]90-* \
|
||||||
| mips64-* | mips64el-* \
|
| m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \
|
||||||
| mips64vr-* | mips64vrel-* \
|
| thumb-* | v850-* | d30v-* | tic30-* | tic80-* | c30-* | fr30-* \
|
||||||
| mips64orion-* | mips64orionel-* \
|
| bs2000-* | tic54x-* | c54x-* | x86_64-* | pj-* | pjl-*)
|
||||||
| mips64vr4100-* | mips64vr4100el-* \
|
|
||||||
| mips64vr4300-* | mips64vr4300el-* \
|
|
||||||
| mips64vr5000-* | mips64vr5000el-* \
|
|
||||||
| mips64vr5900-* | mips64vr5900el-* \
|
|
||||||
| mipsisa32-* | mipsisa32el-* \
|
|
||||||
| mipsisa32r2-* | mipsisa32r2el-* \
|
|
||||||
| mipsisa64-* | mipsisa64el-* \
|
|
||||||
| mipsisa64r2-* | mipsisa64r2el-* \
|
|
||||||
| mipsisa64sb1-* | mipsisa64sb1el-* \
|
|
||||||
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
|
|
||||||
| mipstx39-* | mipstx39el-* \
|
|
||||||
| mmix-* \
|
|
||||||
| mt-* \
|
|
||||||
| msp430-* \
|
|
||||||
| nios-* | nios2-* \
|
|
||||||
| none-* | np1-* | ns16k-* | ns32k-* \
|
|
||||||
| orion-* \
|
|
||||||
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
|
|
||||||
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
|
|
||||||
| pyramid-* \
|
|
||||||
| romp-* | rs6000-* \
|
|
||||||
| sh-* | sh[1234]-* | sh[24]a-* | 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-* | strongarm-* | sv1-* | sx?-* \
|
|
||||||
| tahoe-* | thumb-* \
|
|
||||||
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
|
|
||||||
| tron-* \
|
|
||||||
| v850-* | v850e-* | vax-* \
|
|
||||||
| we32k-* \
|
|
||||||
| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
|
|
||||||
| xstormy16-* | xtensa-* \
|
|
||||||
| ymp-* \
|
|
||||||
| z8k-*)
|
|
||||||
;;
|
;;
|
||||||
# Recognize the various machine names and aliases which stand
|
# Recognize the various machine names and aliases which stand
|
||||||
# for a CPU type and a company and sometimes even an OS.
|
# for a CPU type and a company and sometimes even an OS.
|
||||||
|
|
@ -389,9 +307,6 @@ case $basic_machine in
|
||||||
basic_machine=a29k-amd
|
basic_machine=a29k-amd
|
||||||
os=-udi
|
os=-udi
|
||||||
;;
|
;;
|
||||||
abacus)
|
|
||||||
basic_machine=abacus-unknown
|
|
||||||
;;
|
|
||||||
adobe68k)
|
adobe68k)
|
||||||
basic_machine=m68010-adobe
|
basic_machine=m68010-adobe
|
||||||
os=-scout
|
os=-scout
|
||||||
|
|
@ -406,12 +321,6 @@ case $basic_machine in
|
||||||
basic_machine=a29k-none
|
basic_machine=a29k-none
|
||||||
os=-bsd
|
os=-bsd
|
||||||
;;
|
;;
|
||||||
amd64)
|
|
||||||
basic_machine=x86_64-pc
|
|
||||||
;;
|
|
||||||
amd64-*)
|
|
||||||
basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
|
|
||||||
;;
|
|
||||||
amdahl)
|
amdahl)
|
||||||
basic_machine=580-amdahl
|
basic_machine=580-amdahl
|
||||||
os=-sysv
|
os=-sysv
|
||||||
|
|
@ -443,10 +352,6 @@ case $basic_machine in
|
||||||
basic_machine=ns32k-sequent
|
basic_machine=ns32k-sequent
|
||||||
os=-dynix
|
os=-dynix
|
||||||
;;
|
;;
|
||||||
c90)
|
|
||||||
basic_machine=c90-cray
|
|
||||||
os=-unicos
|
|
||||||
;;
|
|
||||||
convex-c1)
|
convex-c1)
|
||||||
basic_machine=c1-convex
|
basic_machine=c1-convex
|
||||||
os=-bsd
|
os=-bsd
|
||||||
|
|
@ -467,30 +372,27 @@ case $basic_machine in
|
||||||
basic_machine=c38-convex
|
basic_machine=c38-convex
|
||||||
os=-bsd
|
os=-bsd
|
||||||
;;
|
;;
|
||||||
cray | j90)
|
cray | ymp)
|
||||||
basic_machine=j90-cray
|
basic_machine=ymp-cray
|
||||||
os=-unicos
|
os=-unicos
|
||||||
;;
|
;;
|
||||||
craynv)
|
cray2)
|
||||||
basic_machine=craynv-cray
|
basic_machine=cray2-cray
|
||||||
os=-unicosmp
|
os=-unicos
|
||||||
;;
|
;;
|
||||||
cr16c)
|
[cjt]90)
|
||||||
basic_machine=cr16c-unknown
|
basic_machine=${basic_machine}-cray
|
||||||
os=-elf
|
os=-unicos
|
||||||
;;
|
;;
|
||||||
crds | unos)
|
crds | unos)
|
||||||
basic_machine=m68k-crds
|
basic_machine=m68k-crds
|
||||||
;;
|
;;
|
||||||
crisv32 | crisv32-* | etraxfs*)
|
|
||||||
basic_machine=crisv32-axis
|
|
||||||
;;
|
|
||||||
cris | cris-* | etrax*)
|
cris | cris-* | etrax*)
|
||||||
basic_machine=cris-axis
|
basic_machine=cris-axis
|
||||||
;;
|
;;
|
||||||
crx)
|
cygwin*)
|
||||||
basic_machine=crx-unknown
|
basic_machine=i586-pc
|
||||||
os=-elf
|
os=-cygwin
|
||||||
;;
|
;;
|
||||||
da30 | da30-*)
|
da30 | da30-*)
|
||||||
basic_machine=m68k-da30
|
basic_machine=m68k-da30
|
||||||
|
|
@ -498,14 +400,6 @@ case $basic_machine in
|
||||||
decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
|
decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
|
||||||
basic_machine=mips-dec
|
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 \
|
delta | 3300 | motorola-3300 | motorola-delta \
|
||||||
| 3300-motorola | delta-motorola)
|
| 3300-motorola | delta-motorola)
|
||||||
basic_machine=m68k-motorola
|
basic_machine=m68k-motorola
|
||||||
|
|
@ -514,10 +408,6 @@ case $basic_machine in
|
||||||
basic_machine=m88k-motorola
|
basic_machine=m88k-motorola
|
||||||
os=-sysv3
|
os=-sysv3
|
||||||
;;
|
;;
|
||||||
djgpp)
|
|
||||||
basic_machine=i586-pc
|
|
||||||
os=-msdosdjgpp
|
|
||||||
;;
|
|
||||||
dpx20 | dpx20-*)
|
dpx20 | dpx20-*)
|
||||||
basic_machine=rs6000-bull
|
basic_machine=rs6000-bull
|
||||||
os=-bosx
|
os=-bosx
|
||||||
|
|
@ -679,13 +569,9 @@ case $basic_machine in
|
||||||
basic_machine=ns32k-utek
|
basic_machine=ns32k-utek
|
||||||
os=-sysv
|
os=-sysv
|
||||||
;;
|
;;
|
||||||
mingw32)
|
mingw*)
|
||||||
basic_machine=i386-pc
|
basic_machine=i586-pc
|
||||||
os=-mingw32
|
os=-mingw
|
||||||
;;
|
|
||||||
mingw32ce)
|
|
||||||
basic_machine=arm-unknown
|
|
||||||
os=-mingw32ce
|
|
||||||
;;
|
;;
|
||||||
miniframe)
|
miniframe)
|
||||||
basic_machine=m68000-convergent
|
basic_machine=m68000-convergent
|
||||||
|
|
@ -694,26 +580,35 @@ case $basic_machine in
|
||||||
basic_machine=m68k-atari
|
basic_machine=m68k-atari
|
||||||
os=-mint
|
os=-mint
|
||||||
;;
|
;;
|
||||||
|
mipsel*-linux*)
|
||||||
|
basic_machine=mipsel-unknown
|
||||||
|
os=-linux-gnu
|
||||||
|
;;
|
||||||
|
mips*-linux*)
|
||||||
|
basic_machine=mips-unknown
|
||||||
|
os=-linux-gnu
|
||||||
|
;;
|
||||||
mips3*-*)
|
mips3*-*)
|
||||||
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
|
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
|
||||||
;;
|
;;
|
||||||
mips3*)
|
mips3*)
|
||||||
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
|
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
|
||||||
;;
|
;;
|
||||||
|
mmix*)
|
||||||
|
basic_machine=mmix-knuth
|
||||||
|
os=-mmixware
|
||||||
|
;;
|
||||||
monitor)
|
monitor)
|
||||||
basic_machine=m68k-rom68k
|
basic_machine=m68k-rom68k
|
||||||
os=-coff
|
os=-coff
|
||||||
;;
|
;;
|
||||||
morphos)
|
|
||||||
basic_machine=powerpc-unknown
|
|
||||||
os=-morphos
|
|
||||||
;;
|
|
||||||
msdos)
|
msdos)
|
||||||
basic_machine=i386-pc
|
basic_machine=i386-pc
|
||||||
os=-msdos
|
os=-msdos
|
||||||
;;
|
;;
|
||||||
ms1-*)
|
msys)
|
||||||
basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
|
basic_machine=i386-pc
|
||||||
|
os=-msys
|
||||||
;;
|
;;
|
||||||
mvs)
|
mvs)
|
||||||
basic_machine=i370-ibm
|
basic_machine=i370-ibm
|
||||||
|
|
@ -790,13 +685,6 @@ case $basic_machine in
|
||||||
basic_machine=hppa1.1-oki
|
basic_machine=hppa1.1-oki
|
||||||
os=-proelf
|
os=-proelf
|
||||||
;;
|
;;
|
||||||
openrisc | openrisc-*)
|
|
||||||
basic_machine=or32-unknown
|
|
||||||
;;
|
|
||||||
os400)
|
|
||||||
basic_machine=powerpc-ibm
|
|
||||||
os=-os400
|
|
||||||
;;
|
|
||||||
OSE68000 | ose68000)
|
OSE68000 | ose68000)
|
||||||
basic_machine=m68000-ericsson
|
basic_machine=m68000-ericsson
|
||||||
os=-ose
|
os=-ose
|
||||||
|
|
@ -805,6 +693,10 @@ case $basic_machine in
|
||||||
basic_machine=m68k-none
|
basic_machine=m68k-none
|
||||||
os=-os68k
|
os=-os68k
|
||||||
;;
|
;;
|
||||||
|
p4w)
|
||||||
|
basic_machine=i586-pc
|
||||||
|
os=-p4w
|
||||||
|
;;
|
||||||
pa-hitachi)
|
pa-hitachi)
|
||||||
basic_machine=hppa1.1-hitachi
|
basic_machine=hppa1.1-hitachi
|
||||||
os=-hiuxwe2
|
os=-hiuxwe2
|
||||||
|
|
@ -822,36 +714,24 @@ case $basic_machine in
|
||||||
pc532 | pc532-*)
|
pc532 | pc532-*)
|
||||||
basic_machine=ns32k-pc532
|
basic_machine=ns32k-pc532
|
||||||
;;
|
;;
|
||||||
pc98)
|
pentium | p5 | k5 | k6 | nexgen)
|
||||||
basic_machine=i386-pc
|
|
||||||
;;
|
|
||||||
pc98-*)
|
|
||||||
basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
|
|
||||||
;;
|
|
||||||
pentium | p5 | k5 | k6 | nexgen | viac3)
|
|
||||||
basic_machine=i586-pc
|
basic_machine=i586-pc
|
||||||
;;
|
;;
|
||||||
pentiumpro | p6 | 6x86 | athlon | athlon_*)
|
pentiumpro | p6 | 6x86 | athlon)
|
||||||
basic_machine=i686-pc
|
basic_machine=i686-pc
|
||||||
;;
|
;;
|
||||||
pentiumii | pentium2 | pentiumiii | pentium3)
|
pentiumii | pentium2)
|
||||||
basic_machine=i686-pc
|
basic_machine=i686-pc
|
||||||
;;
|
;;
|
||||||
pentium4)
|
pentium-* | p5-* | k5-* | k6-* | nexgen-*)
|
||||||
basic_machine=i786-pc
|
|
||||||
;;
|
|
||||||
pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
|
|
||||||
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
|
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||||
;;
|
;;
|
||||||
pentiumpro-* | p6-* | 6x86-* | athlon-*)
|
pentiumpro-* | p6-* | 6x86-* | athlon-*)
|
||||||
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
|
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||||
;;
|
;;
|
||||||
pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
|
pentiumii-* | pentium2-*)
|
||||||
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
|
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||||
;;
|
;;
|
||||||
pentium4-*)
|
|
||||||
basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
|
|
||||||
;;
|
|
||||||
pn)
|
pn)
|
||||||
basic_machine=pn-gould
|
basic_machine=pn-gould
|
||||||
;;
|
;;
|
||||||
|
|
@ -867,16 +747,6 @@ case $basic_machine in
|
||||||
ppcle-* | powerpclittle-*)
|
ppcle-* | powerpclittle-*)
|
||||||
basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
|
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)
|
ps2)
|
||||||
basic_machine=i386-ibm
|
basic_machine=i386-ibm
|
||||||
;;
|
;;
|
||||||
|
|
@ -884,10 +754,6 @@ case $basic_machine in
|
||||||
basic_machine=i586-unknown
|
basic_machine=i586-unknown
|
||||||
os=-pw32
|
os=-pw32
|
||||||
;;
|
;;
|
||||||
rdos)
|
|
||||||
basic_machine=i386-pc
|
|
||||||
os=-rdos
|
|
||||||
;;
|
|
||||||
rom68k)
|
rom68k)
|
||||||
basic_machine=m68k-rom68k
|
basic_machine=m68k-rom68k
|
||||||
os=-coff
|
os=-coff
|
||||||
|
|
@ -898,30 +764,10 @@ case $basic_machine in
|
||||||
rtpc | rtpc-*)
|
rtpc | rtpc-*)
|
||||||
basic_machine=romp-ibm
|
basic_machine=romp-ibm
|
||||||
;;
|
;;
|
||||||
s390 | s390-*)
|
|
||||||
basic_machine=s390-ibm
|
|
||||||
;;
|
|
||||||
s390x | s390x-*)
|
|
||||||
basic_machine=s390x-ibm
|
|
||||||
;;
|
|
||||||
sa29200)
|
sa29200)
|
||||||
basic_machine=a29k-amd
|
basic_machine=a29k-amd
|
||||||
os=-udi
|
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)
|
sequent)
|
||||||
basic_machine=i386-sequent
|
basic_machine=i386-sequent
|
||||||
;;
|
;;
|
||||||
|
|
@ -929,13 +775,7 @@ case $basic_machine in
|
||||||
basic_machine=sh-hitachi
|
basic_machine=sh-hitachi
|
||||||
os=-hms
|
os=-hms
|
||||||
;;
|
;;
|
||||||
sh5el)
|
sparclite-wrs)
|
||||||
basic_machine=sh5le-unknown
|
|
||||||
;;
|
|
||||||
sh64)
|
|
||||||
basic_machine=sh64-unknown
|
|
||||||
;;
|
|
||||||
sparclite-wrs | simso-wrs)
|
|
||||||
basic_machine=sparclite-wrs
|
basic_machine=sparclite-wrs
|
||||||
os=-vxworks
|
os=-vxworks
|
||||||
;;
|
;;
|
||||||
|
|
@ -1002,42 +842,22 @@ case $basic_machine in
|
||||||
os=-dynix
|
os=-dynix
|
||||||
;;
|
;;
|
||||||
t3e)
|
t3e)
|
||||||
basic_machine=alphaev5-cray
|
basic_machine=t3e-cray
|
||||||
os=-unicos
|
|
||||||
;;
|
|
||||||
t90)
|
|
||||||
basic_machine=t90-cray
|
|
||||||
os=-unicos
|
os=-unicos
|
||||||
;;
|
;;
|
||||||
tic54x | c54x*)
|
tic54x | c54x*)
|
||||||
basic_machine=tic54x-unknown
|
basic_machine=tic54x-unknown
|
||||||
os=-coff
|
os=-coff
|
||||||
;;
|
;;
|
||||||
tic55x | c55x*)
|
|
||||||
basic_machine=tic55x-unknown
|
|
||||||
os=-coff
|
|
||||||
;;
|
|
||||||
tic6x | c6x*)
|
|
||||||
basic_machine=tic6x-unknown
|
|
||||||
os=-coff
|
|
||||||
;;
|
|
||||||
tx39)
|
tx39)
|
||||||
basic_machine=mipstx39-unknown
|
basic_machine=mipstx39-unknown
|
||||||
;;
|
;;
|
||||||
tx39el)
|
tx39el)
|
||||||
basic_machine=mipstx39el-unknown
|
basic_machine=mipstx39el-unknown
|
||||||
;;
|
;;
|
||||||
toad1)
|
|
||||||
basic_machine=pdp10-xkl
|
|
||||||
os=-tops20
|
|
||||||
;;
|
|
||||||
tower | tower-32)
|
tower | tower-32)
|
||||||
basic_machine=m68k-ncr
|
basic_machine=m68k-ncr
|
||||||
;;
|
;;
|
||||||
tpf)
|
|
||||||
basic_machine=s390x-ibm
|
|
||||||
os=-tpf
|
|
||||||
;;
|
|
||||||
udi29k)
|
udi29k)
|
||||||
basic_machine=a29k-amd
|
basic_machine=a29k-amd
|
||||||
os=-udi
|
os=-udi
|
||||||
|
|
@ -1081,17 +901,17 @@ case $basic_machine in
|
||||||
basic_machine=hppa1.1-winbond
|
basic_machine=hppa1.1-winbond
|
||||||
os=-proelf
|
os=-proelf
|
||||||
;;
|
;;
|
||||||
xbox)
|
windows32)
|
||||||
basic_machine=i686-pc
|
basic_machine=i386-pc
|
||||||
os=-mingw32
|
os=-windows32-msvcrt
|
||||||
|
;;
|
||||||
|
xmp)
|
||||||
|
basic_machine=xmp-cray
|
||||||
|
os=-unicos
|
||||||
;;
|
;;
|
||||||
xps | xps100)
|
xps | xps100)
|
||||||
basic_machine=xps100-honeywell
|
basic_machine=xps100-honeywell
|
||||||
;;
|
;;
|
||||||
ymp)
|
|
||||||
basic_machine=ymp-cray
|
|
||||||
os=-unicos
|
|
||||||
;;
|
|
||||||
z8k-*-coff)
|
z8k-*-coff)
|
||||||
basic_machine=z8k-unknown
|
basic_machine=z8k-unknown
|
||||||
os=-sim
|
os=-sim
|
||||||
|
|
@ -1112,12 +932,16 @@ case $basic_machine in
|
||||||
op60c)
|
op60c)
|
||||||
basic_machine=hppa1.1-oki
|
basic_machine=hppa1.1-oki
|
||||||
;;
|
;;
|
||||||
|
mips)
|
||||||
|
if [ x$os = x-linux-gnu ]; then
|
||||||
|
basic_machine=mips-unknown
|
||||||
|
else
|
||||||
|
basic_machine=mips-mips
|
||||||
|
fi
|
||||||
|
;;
|
||||||
romp)
|
romp)
|
||||||
basic_machine=romp-ibm
|
basic_machine=romp-ibm
|
||||||
;;
|
;;
|
||||||
mmix)
|
|
||||||
basic_machine=mmix-knuth
|
|
||||||
;;
|
|
||||||
rs6000)
|
rs6000)
|
||||||
basic_machine=rs6000-ibm
|
basic_machine=rs6000-ibm
|
||||||
;;
|
;;
|
||||||
|
|
@ -1134,10 +958,10 @@ case $basic_machine in
|
||||||
we32k)
|
we32k)
|
||||||
basic_machine=we32k-att
|
basic_machine=we32k-att
|
||||||
;;
|
;;
|
||||||
sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
|
sh3 | sh4)
|
||||||
basic_machine=sh-unknown
|
basic_machine=sh-unknown
|
||||||
;;
|
;;
|
||||||
sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
|
sparc | sparcv9 | sparcv9b)
|
||||||
basic_machine=sparc-sun
|
basic_machine=sparc-sun
|
||||||
;;
|
;;
|
||||||
cydra)
|
cydra)
|
||||||
|
|
@ -1155,6 +979,10 @@ case $basic_machine in
|
||||||
pmac | pmac-mpw)
|
pmac | pmac-mpw)
|
||||||
basic_machine=powerpc-apple
|
basic_machine=powerpc-apple
|
||||||
;;
|
;;
|
||||||
|
c4x*)
|
||||||
|
basic_machine=c4x-none
|
||||||
|
os=-coff
|
||||||
|
;;
|
||||||
*-unknown)
|
*-unknown)
|
||||||
# Make sure to match an already-canonicalized machine name.
|
# Make sure to match an already-canonicalized machine name.
|
||||||
;;
|
;;
|
||||||
|
|
@ -1210,23 +1038,16 @@ case $os in
|
||||||
| -aos* \
|
| -aos* \
|
||||||
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
|
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
|
||||||
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
|
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
|
||||||
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
|
| -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
|
||||||
| -openbsd* | -solidbsd* \
|
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
|
||||||
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
|
|
||||||
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
|
|
||||||
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
|
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
|
||||||
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
|
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
|
||||||
| -chorusos* | -chorusrdb* \
|
| -chorusos* | -chorusrdb* \
|
||||||
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
|
| -cygwin* | -msys* | -p4w* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
|
||||||
| -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
|
| -mingw* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
|
||||||
| -uxpv* | -beos* | -mpeix* | -udk* \
|
| -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
|
||||||
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
|
|
||||||
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
|
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
|
||||||
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
|
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* | -os2*)
|
||||||
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
|
|
||||||
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
|
|
||||||
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
|
|
||||||
| -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
|
|
||||||
# Remember, each alternative MUST END IN *, to match a version number.
|
# Remember, each alternative MUST END IN *, to match a version number.
|
||||||
;;
|
;;
|
||||||
-qnx*)
|
-qnx*)
|
||||||
|
|
@ -1238,21 +1059,16 @@ case $os in
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
-nto-qnx*)
|
|
||||||
;;
|
|
||||||
-nto*)
|
-nto*)
|
||||||
os=`echo $os | sed -e 's|nto|nto-qnx|'`
|
os=-nto-qnx
|
||||||
;;
|
;;
|
||||||
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
|
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
|
||||||
| -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
|
| -windows* | -osx | -abug | -netware* | -os9* | -beos* \
|
||||||
| -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
|
| -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
|
||||||
;;
|
;;
|
||||||
-mac*)
|
-mac*)
|
||||||
os=`echo $os | sed -e 's|mac|macos|'`
|
os=`echo $os | sed -e 's|mac|macos|'`
|
||||||
;;
|
;;
|
||||||
-linux-dietlibc)
|
|
||||||
os=-linux-dietlibc
|
|
||||||
;;
|
|
||||||
-linux*)
|
-linux*)
|
||||||
os=`echo $os | sed -e 's|linux|linux-gnu|'`
|
os=`echo $os | sed -e 's|linux|linux-gnu|'`
|
||||||
;;
|
;;
|
||||||
|
|
@ -1265,9 +1081,6 @@ case $os in
|
||||||
-opened*)
|
-opened*)
|
||||||
os=-openedition
|
os=-openedition
|
||||||
;;
|
;;
|
||||||
-os400*)
|
|
||||||
os=-os400
|
|
||||||
;;
|
|
||||||
-wince*)
|
-wince*)
|
||||||
os=-wince
|
os=-wince
|
||||||
;;
|
;;
|
||||||
|
|
@ -1286,21 +1099,12 @@ case $os in
|
||||||
-acis*)
|
-acis*)
|
||||||
os=-aos
|
os=-aos
|
||||||
;;
|
;;
|
||||||
-atheos*)
|
|
||||||
os=-atheos
|
|
||||||
;;
|
|
||||||
-syllable*)
|
|
||||||
os=-syllable
|
|
||||||
;;
|
|
||||||
-386bsd)
|
-386bsd)
|
||||||
os=-bsd
|
os=-bsd
|
||||||
;;
|
;;
|
||||||
-ctix* | -uts*)
|
-ctix* | -uts*)
|
||||||
os=-sysv
|
os=-sysv
|
||||||
;;
|
;;
|
||||||
-nova*)
|
|
||||||
os=-rtmk-nova
|
|
||||||
;;
|
|
||||||
-ns2 )
|
-ns2 )
|
||||||
os=-nextstep2
|
os=-nextstep2
|
||||||
;;
|
;;
|
||||||
|
|
@ -1314,9 +1118,6 @@ case $os in
|
||||||
-sinix*)
|
-sinix*)
|
||||||
os=-sysv4
|
os=-sysv4
|
||||||
;;
|
;;
|
||||||
-tpf*)
|
|
||||||
os=-tpf
|
|
||||||
;;
|
|
||||||
-triton*)
|
-triton*)
|
||||||
os=-sysv3
|
os=-sysv3
|
||||||
;;
|
;;
|
||||||
|
|
@ -1347,15 +1148,6 @@ case $os in
|
||||||
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
|
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
|
||||||
os=-mint
|
os=-mint
|
||||||
;;
|
;;
|
||||||
-aros*)
|
|
||||||
os=-aros
|
|
||||||
;;
|
|
||||||
-kaos*)
|
|
||||||
os=-kaos
|
|
||||||
;;
|
|
||||||
-zvmoe)
|
|
||||||
os=-zvmoe
|
|
||||||
;;
|
|
||||||
-none)
|
-none)
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
|
@ -1378,12 +1170,6 @@ else
|
||||||
# system, and we'll never get to this point.
|
# system, and we'll never get to this point.
|
||||||
|
|
||||||
case $basic_machine in
|
case $basic_machine in
|
||||||
score-*)
|
|
||||||
os=-elf
|
|
||||||
;;
|
|
||||||
spu-*)
|
|
||||||
os=-elf
|
|
||||||
;;
|
|
||||||
*-acorn)
|
*-acorn)
|
||||||
os=-riscix1.2
|
os=-riscix1.2
|
||||||
;;
|
;;
|
||||||
|
|
@ -1393,10 +1179,6 @@ case $basic_machine in
|
||||||
arm*-semi)
|
arm*-semi)
|
||||||
os=-aout
|
os=-aout
|
||||||
;;
|
;;
|
||||||
c4x-* | tic4x-*)
|
|
||||||
os=-coff
|
|
||||||
;;
|
|
||||||
# This must come before the *-dec entry.
|
|
||||||
pdp10-*)
|
pdp10-*)
|
||||||
os=-tops20
|
os=-tops20
|
||||||
;;
|
;;
|
||||||
|
|
@ -1421,18 +1203,12 @@ case $basic_machine in
|
||||||
m68*-cisco)
|
m68*-cisco)
|
||||||
os=-aout
|
os=-aout
|
||||||
;;
|
;;
|
||||||
mep-*)
|
|
||||||
os=-elf
|
|
||||||
;;
|
|
||||||
mips*-cisco)
|
mips*-cisco)
|
||||||
os=-elf
|
os=-elf
|
||||||
;;
|
;;
|
||||||
mips*-*)
|
mips*-*)
|
||||||
os=-elf
|
os=-elf
|
||||||
;;
|
;;
|
||||||
or32-*)
|
|
||||||
os=-coff
|
|
||||||
;;
|
|
||||||
*-tti) # must be before sparc entry or we get the wrong os.
|
*-tti) # must be before sparc entry or we get the wrong os.
|
||||||
os=-sysv3
|
os=-sysv3
|
||||||
;;
|
;;
|
||||||
|
|
@ -1442,15 +1218,9 @@ case $basic_machine in
|
||||||
*-be)
|
*-be)
|
||||||
os=-beos
|
os=-beos
|
||||||
;;
|
;;
|
||||||
*-haiku)
|
|
||||||
os=-haiku
|
|
||||||
;;
|
|
||||||
*-ibm)
|
*-ibm)
|
||||||
os=-aix
|
os=-aix
|
||||||
;;
|
;;
|
||||||
*-knuth)
|
|
||||||
os=-mmixware
|
|
||||||
;;
|
|
||||||
*-wec)
|
*-wec)
|
||||||
os=-proelf
|
os=-proelf
|
||||||
;;
|
;;
|
||||||
|
|
@ -1583,16 +1353,10 @@ case $basic_machine in
|
||||||
-mvs* | -opened*)
|
-mvs* | -opened*)
|
||||||
vendor=ibm
|
vendor=ibm
|
||||||
;;
|
;;
|
||||||
-os400*)
|
|
||||||
vendor=ibm
|
|
||||||
;;
|
|
||||||
-ptx*)
|
-ptx*)
|
||||||
vendor=sequent
|
vendor=sequent
|
||||||
;;
|
;;
|
||||||
-tpf*)
|
-vxsim* | -vxworks*)
|
||||||
vendor=ibm
|
|
||||||
;;
|
|
||||||
-vxsim* | -vxworks* | -windiss*)
|
|
||||||
vendor=wrs
|
vendor=wrs
|
||||||
;;
|
;;
|
||||||
-aux*)
|
-aux*)
|
||||||
|
|
@ -1607,16 +1371,13 @@ case $basic_machine in
|
||||||
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
|
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
|
||||||
vendor=atari
|
vendor=atari
|
||||||
;;
|
;;
|
||||||
-vos*)
|
|
||||||
vendor=stratus
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
|
basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
echo $basic_machine$os
|
echo $basic_machine$os
|
||||||
exit
|
exit 0
|
||||||
|
|
||||||
# Local variables:
|
# Local variables:
|
||||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||||
|
|
|
||||||
|
|
@ -504,3 +504,27 @@ daemon_delete(struct daemon* daemon)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void daemon_apply_cfg(struct daemon* daemon, struct config_file* cfg)
|
||||||
|
{
|
||||||
|
daemon->cfg = cfg;
|
||||||
|
config_apply(cfg);
|
||||||
|
if(!daemon->env->msg_cache ||
|
||||||
|
cfg->msg_cache_size != slabhash_get_size(daemon->env->msg_cache) ||
|
||||||
|
cfg->msg_cache_slabs != daemon->env->msg_cache->size) {
|
||||||
|
slabhash_delete(daemon->env->msg_cache);
|
||||||
|
daemon->env->msg_cache = slabhash_create(cfg->msg_cache_slabs,
|
||||||
|
HASH_DEFAULT_STARTARRAY, cfg->msg_cache_size,
|
||||||
|
msgreply_sizefunc, query_info_compare,
|
||||||
|
query_entry_delete, reply_info_delete, NULL);
|
||||||
|
if(!daemon->env->msg_cache) {
|
||||||
|
fatal_exit("malloc failure updating config settings");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if((daemon->env->rrset_cache = rrset_cache_adjust(
|
||||||
|
daemon->env->rrset_cache, cfg, &daemon->superalloc)) == 0)
|
||||||
|
fatal_exit("malloc failure updating config settings");
|
||||||
|
if((daemon->env->infra_cache = infra_adjust(daemon->env->infra_cache,
|
||||||
|
cfg))==0)
|
||||||
|
fatal_exit("malloc failure updating config settings");
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -132,4 +132,11 @@ void daemon_cleanup(struct daemon* daemon);
|
||||||
*/
|
*/
|
||||||
void daemon_delete(struct daemon* daemon);
|
void daemon_delete(struct daemon* daemon);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Apply config settings.
|
||||||
|
* @param daemon: the daemon.
|
||||||
|
* @param cfg: new config settings.
|
||||||
|
*/
|
||||||
|
void daemon_apply_cfg(struct daemon* daemon, struct config_file* cfg);
|
||||||
|
|
||||||
#endif /* DAEMON_H */
|
#endif /* DAEMON_H */
|
||||||
|
|
|
||||||
|
|
@ -77,6 +77,10 @@
|
||||||
# include <event.h>
|
# include <event.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef UB_ON_WINDOWS
|
||||||
|
# include "winrc/win_svc.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
/** global debug value to keep track of heap memory allocation */
|
/** global debug value to keep track of heap memory allocation */
|
||||||
void* unbound_start_brk = 0;
|
void* unbound_start_brk = 0;
|
||||||
|
|
||||||
|
|
@ -90,6 +94,11 @@ static void usage()
|
||||||
printf(" file format is described in unbound.conf(5).\n");
|
printf(" file format is described in unbound.conf(5).\n");
|
||||||
printf("-d do not fork into the background.\n");
|
printf("-d do not fork into the background.\n");
|
||||||
printf("-v verbose (more times to increase verbosity)\n");
|
printf("-v verbose (more times to increase verbosity)\n");
|
||||||
|
#ifdef UB_ON_WINDOWS
|
||||||
|
printf("-w opt windows option: \n");
|
||||||
|
printf(" install, remove - manage the services entry\n");
|
||||||
|
printf(" service - used to start from services control panel\n");
|
||||||
|
#endif
|
||||||
printf("Version %s\n", PACKAGE_VERSION);
|
printf("Version %s\n", PACKAGE_VERSION);
|
||||||
printf("libevent %s, libldns %s, %s\n",
|
printf("libevent %s, libldns %s, %s\n",
|
||||||
event_get_version(), ldns_version(),
|
event_get_version(), ldns_version(),
|
||||||
|
|
@ -181,27 +190,8 @@ apply_settings(struct daemon* daemon, struct config_file* cfg,
|
||||||
int cmdline_verbose)
|
int cmdline_verbose)
|
||||||
{
|
{
|
||||||
/* apply if they have changed */
|
/* apply if they have changed */
|
||||||
daemon->cfg = cfg;
|
|
||||||
verbosity = cmdline_verbose + cfg->verbosity;
|
verbosity = cmdline_verbose + cfg->verbosity;
|
||||||
config_apply(cfg);
|
daemon_apply_cfg(daemon, cfg);
|
||||||
if(!daemon->env->msg_cache ||
|
|
||||||
cfg->msg_cache_size != slabhash_get_size(daemon->env->msg_cache) ||
|
|
||||||
cfg->msg_cache_slabs != daemon->env->msg_cache->size) {
|
|
||||||
slabhash_delete(daemon->env->msg_cache);
|
|
||||||
daemon->env->msg_cache = slabhash_create(cfg->msg_cache_slabs,
|
|
||||||
HASH_DEFAULT_STARTARRAY, cfg->msg_cache_size,
|
|
||||||
msgreply_sizefunc, query_info_compare,
|
|
||||||
query_entry_delete, reply_info_delete, NULL);
|
|
||||||
if(!daemon->env->msg_cache) {
|
|
||||||
fatal_exit("malloc failure updating config settings");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if((daemon->env->rrset_cache = rrset_cache_adjust(
|
|
||||||
daemon->env->rrset_cache, cfg, &daemon->superalloc)) == 0)
|
|
||||||
fatal_exit("malloc failure updating config settings");
|
|
||||||
if((daemon->env->infra_cache = infra_adjust(daemon->env->infra_cache,
|
|
||||||
cfg))==0)
|
|
||||||
fatal_exit("malloc failure updating config settings");
|
|
||||||
checkrlimits(cfg);
|
checkrlimits(cfg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -599,7 +589,7 @@ main(int argc, char* argv[])
|
||||||
|
|
||||||
log_init(NULL, 0, NULL);
|
log_init(NULL, 0, NULL);
|
||||||
/* parse the options */
|
/* parse the options */
|
||||||
while( (c=getopt(argc, argv, "c:dhv")) != -1) {
|
while( (c=getopt(argc, argv, "c:dhvw:")) != -1) {
|
||||||
switch(c) {
|
switch(c) {
|
||||||
case 'c':
|
case 'c':
|
||||||
cfgfile = optarg;
|
cfgfile = optarg;
|
||||||
|
|
@ -611,6 +601,13 @@ main(int argc, char* argv[])
|
||||||
case 'd':
|
case 'd':
|
||||||
debug_mode = 1;
|
debug_mode = 1;
|
||||||
break;
|
break;
|
||||||
|
case 'w':
|
||||||
|
#ifdef UB_ON_WINDOWS
|
||||||
|
wsvc_command_option(optarg);
|
||||||
|
#else
|
||||||
|
fatal_exit("option not supported");
|
||||||
|
#endif
|
||||||
|
break;
|
||||||
case '?':
|
case '?':
|
||||||
case 'h':
|
case 'h':
|
||||||
default:
|
default:
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
27 February 2009: Wouter
|
27 February 2009: Wouter
|
||||||
- Fixup lexer, to not give warnings about fwrite. Appeared in
|
- Fixup lexer, to not give warnings about fwrite. Appeared in
|
||||||
new lexer features.
|
new lexer features.
|
||||||
|
- makedistro functionality for mingw. Has RC support.
|
||||||
|
- support spaces and backslashes in configured defaults paths.
|
||||||
|
- register, deregister in service control manager.
|
||||||
|
|
||||||
25 February 2009: Wouter
|
25 February 2009: Wouter
|
||||||
- windres usage for application resources.
|
- windres usage for application resources.
|
||||||
|
|
|
||||||
12
makedist.sh
12
makedist.sh
|
|
@ -147,20 +147,20 @@ while [ "$1" ]; do
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ "$DOWIN" = "yes" ]; then
|
if [ "$DOWIN" = "yes" ]; then
|
||||||
version=`./configure --version | head -1 | awk '{ print $3 }'` || \
|
version=`./configure --version | head -1 | awk '{ print $3 }'` \
|
||||||
error_cleanup "Cannot determine version number."
|
|| error_cleanup "Cannot determine version number."
|
||||||
if [ "$RC" != "no" ]; then
|
if [ "$RC" != "no" ]; then
|
||||||
version2="${version}rc$RC"
|
version2=`echo $version | sed -e 's/rc.*//'`"rc$RC"
|
||||||
replace_text "configure.ac" "AC_INIT(unbound, $version" "AC_INIT(unbound, $version2"
|
replace_text "configure.ac" "AC_INIT(unbound, $version" "AC_INIT(unbound, $version2"
|
||||||
version="$version2"
|
version="$version2"
|
||||||
info "Rebuilding configure script (autoconf) snapshot."
|
info "Rebuilding configure script (autoconf) snapshot."
|
||||||
autoreconf || error_cleanup "Autoconf failed."
|
autoconf || autoheader || error_cleanup "Autoconf failed."
|
||||||
rm -r autom4te* || error_cleanup "Failed to remove autoconf cache directory."
|
rm -r autom4te* || echo "ignored"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
info "Creating windows dist unbound $version"
|
info "Creating windows dist unbound $version"
|
||||||
info "Calling configure"
|
info "Calling configure"
|
||||||
echo './configure --enable-debug --enable-static-exe "--with-conf-file=C:\Program Files\Unbound\service.conf" "--with-run-dir=C:\Program Files\Unbound" '"$*"
|
echo './configure --enable-debug --enable-static-exe "--with-conf-file=C:\Program Files\Unbound\service.conf" --with-run-dir="" '"$*"
|
||||||
./configure --enable-debug --enable-static-exe \
|
./configure --enable-debug --enable-static-exe \
|
||||||
"--with-conf-file=C:\Program Files\Unbound\service.conf" \
|
"--with-conf-file=C:\Program Files\Unbound\service.conf" \
|
||||||
"--with-run-dir=C:\Program Files\Unbound" $* \
|
"--with-run-dir=C:\Program Files\Unbound" $* \
|
||||||
|
|
|
||||||
|
|
@ -319,3 +319,8 @@ int remote_control_callback(struct comm_point* ATTR_UNUSED(c),
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wsvc_command_option(const char* ATTR_UNUSED(opt))
|
||||||
|
{
|
||||||
|
log_assert(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
BIN
winrc/gen_msg.bin
Normal file
BIN
winrc/gen_msg.bin
Normal file
Binary file not shown.
44
winrc/gen_msg.mc
Normal file
44
winrc/gen_msg.mc
Normal file
|
|
@ -0,0 +1,44 @@
|
||||||
|
; for Unbound
|
||||||
|
; severity default Success Informational Warning Error
|
||||||
|
|
||||||
|
; .bin file created with:
|
||||||
|
; "/c/Program Files/Microsoft SDKs/Windows/v6.1/Bin/mc" gen_msg.mc
|
||||||
|
; mv MSG00001.bin gen_msg.bin
|
||||||
|
; rm gen_msg.h
|
||||||
|
; and pasted contents of gen_msg.rc into rsrc_unbound.rc
|
||||||
|
|
||||||
|
FacilityNames=(Server=0x1)
|
||||||
|
MessageIdTypeDef=WORD
|
||||||
|
|
||||||
|
MessageID=0x1
|
||||||
|
Severity=Success
|
||||||
|
Facility=Server
|
||||||
|
SymbolicName=MSG_GENERIC_SUCCESS
|
||||||
|
Language=English
|
||||||
|
%1
|
||||||
|
.
|
||||||
|
|
||||||
|
MessageID=0x2
|
||||||
|
Severity=Informational
|
||||||
|
Facility=Server
|
||||||
|
SymbolicName=MSG_GENERIC_INFO
|
||||||
|
Language=English
|
||||||
|
%1
|
||||||
|
.
|
||||||
|
|
||||||
|
MessageID=0x3
|
||||||
|
Severity=Warning
|
||||||
|
Facility=Server
|
||||||
|
SymbolicName=MSG_GENERIC_WARN
|
||||||
|
Language=English
|
||||||
|
%1
|
||||||
|
.
|
||||||
|
|
||||||
|
MessageID=0x4
|
||||||
|
Severity=Error
|
||||||
|
Facility=Server
|
||||||
|
SymbolicName=MSG_GENERIC_ERR
|
||||||
|
Language=English
|
||||||
|
%1
|
||||||
|
.
|
||||||
|
|
||||||
|
|
@ -38,3 +38,6 @@ BEGIN
|
||||||
VALUE "Translation", 0x409, 0x1252
|
VALUE "Translation", 0x409, 0x1252
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
|
|
||||||
|
LANGUAGE 0x9,0x1
|
||||||
|
1 11 "winrc/gen_msg.bin"
|
||||||
|
|
|
||||||
357
winrc/win_svc.c
Normal file
357
winrc/win_svc.c
Normal file
|
|
@ -0,0 +1,357 @@
|
||||||
|
/*
|
||||||
|
* winrc/win_svc.c - windows services API implementation for unbound
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009, NLnet Labs. All rights reserved.
|
||||||
|
*
|
||||||
|
* This software is open source.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
*
|
||||||
|
* Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
|
* and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* Neither the name of the NLNET LABS nor the names of its contributors may
|
||||||
|
* be used to endorse or promote products derived from this software without
|
||||||
|
* specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||||
|
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \file
|
||||||
|
*
|
||||||
|
* This file contains functions to integrate with the windows services API.
|
||||||
|
* This means it handles the commandline switches to install and remove
|
||||||
|
* the service (via CreateService and DeleteService), it handles
|
||||||
|
* the ServiceMain() main service entry point when started as a service,
|
||||||
|
* and it handles the Handler[_ex]() to process requests to the service
|
||||||
|
* (such as start and stop and status).
|
||||||
|
*/
|
||||||
|
#include "config.h"
|
||||||
|
#include "winrc/win_svc.h"
|
||||||
|
#include "daemon/daemon.h"
|
||||||
|
#include "util/config_file.h"
|
||||||
|
|
||||||
|
/** service name for unbound (internal to ServiceManager) */
|
||||||
|
#define SERVICE_NAME "unbound"
|
||||||
|
|
||||||
|
/** from gen_msg.h */
|
||||||
|
#define MSG_GENERIC_SUCCESS ((WORD)0x00010001L)
|
||||||
|
#define MSG_GENERIC_INFO ((WORD)0x40010002L)
|
||||||
|
#define MSG_GENERIC_WARN ((WORD)0x80010003L)
|
||||||
|
#define MSG_GENERIC_ERR ((WORD)0xC0010004L)
|
||||||
|
|
||||||
|
/** global service status */
|
||||||
|
SERVICE_STATUS service_status;
|
||||||
|
/** global service status handle */
|
||||||
|
SERVICE_STATUS_HANDLE service_status_handle;
|
||||||
|
/** global service stop event */
|
||||||
|
HANDLE service_stop_event = NULL;
|
||||||
|
|
||||||
|
/** exit with windows error */
|
||||||
|
static void
|
||||||
|
fatal_win(const char* str)
|
||||||
|
{
|
||||||
|
fatal_exit("%s (%d)", str, (int)GetLastError());
|
||||||
|
}
|
||||||
|
|
||||||
|
/** put quotes around string. Needs one space in front
|
||||||
|
* @param str: to be quoted.
|
||||||
|
*/
|
||||||
|
static void
|
||||||
|
quote_it(char* str, size_t maxlen)
|
||||||
|
{
|
||||||
|
if(strlen(str) == maxlen)
|
||||||
|
fatal_exit("string too long %s", str);
|
||||||
|
str[0]='"';
|
||||||
|
str[strlen(str)+1]=0;
|
||||||
|
str[strlen(str)]='"';
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Install service in servicecontrolmanager */
|
||||||
|
static void
|
||||||
|
wsvc_install(void)
|
||||||
|
{
|
||||||
|
SC_HANDLE scm;
|
||||||
|
SC_HANDLE sv;
|
||||||
|
TCHAR path[MAX_PATH+2+256];
|
||||||
|
printf("installing unbound service\n");
|
||||||
|
if(!GetModuleFileName(NULL, path+1, MAX_PATH))
|
||||||
|
fatal_win("could not GetModuleFileName");
|
||||||
|
/* have to quote it because of spaces in directory names */
|
||||||
|
/* could append arguments to be sent to ServiceMain */
|
||||||
|
quote_it(path, sizeof(path));
|
||||||
|
strcat(path, " -w service");
|
||||||
|
scm = OpenSCManager(NULL, NULL, (int)SC_MANAGER_CREATE_SERVICE);
|
||||||
|
if(!scm) fatal_win("could not OpenSCManager");
|
||||||
|
sv = CreateService(
|
||||||
|
scm,
|
||||||
|
SERVICE_NAME, /* name of service */
|
||||||
|
"Unbound DNS validator", /* display name */
|
||||||
|
SERVICE_ALL_ACCESS, /* desired access */
|
||||||
|
SERVICE_WIN32_OWN_PROCESS, /* service type */
|
||||||
|
SERVICE_AUTO_START, /* start type */
|
||||||
|
SERVICE_ERROR_NORMAL, /* error control type */
|
||||||
|
path, /* path to service's binary */
|
||||||
|
NULL, /* no load ordering group */
|
||||||
|
NULL, /* no tag identifier */
|
||||||
|
NULL, /* no deps */
|
||||||
|
NULL, /* on LocalSystem */
|
||||||
|
NULL /* no password */
|
||||||
|
);
|
||||||
|
if(!sv) {
|
||||||
|
CloseServiceHandle(scm);
|
||||||
|
fatal_win("could not CreateService");
|
||||||
|
}
|
||||||
|
CloseServiceHandle(sv);
|
||||||
|
CloseServiceHandle(scm);
|
||||||
|
printf("unbound service installed\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Remove installed service from servicecontrolmanager */
|
||||||
|
static void
|
||||||
|
wsvc_remove(void)
|
||||||
|
{
|
||||||
|
SC_HANDLE scm;
|
||||||
|
SC_HANDLE sv;
|
||||||
|
printf("removing unbound service\n");
|
||||||
|
scm = OpenSCManager(NULL, NULL, (int)SC_MANAGER_ALL_ACCESS);
|
||||||
|
if(!scm) fatal_win("could not OpenSCManager");
|
||||||
|
sv = OpenService(scm, SERVICE_NAME, DELETE);
|
||||||
|
if(!sv) {
|
||||||
|
CloseServiceHandle(scm);
|
||||||
|
fatal_win("could not OpenService");
|
||||||
|
}
|
||||||
|
if(!DeleteService(sv)) {
|
||||||
|
fatal_win("could not DeleteService");
|
||||||
|
}
|
||||||
|
CloseServiceHandle(sv);
|
||||||
|
CloseServiceHandle(scm);
|
||||||
|
printf("unbound service removed\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Report current service status to service control manager
|
||||||
|
* @param state: current state
|
||||||
|
* @param exitcode: error code (when stopped)
|
||||||
|
* @param wait: pending operation estimated time in milliseconds.
|
||||||
|
*/
|
||||||
|
void report_status(DWORD state, DWORD exitcode, DWORD wait)
|
||||||
|
{
|
||||||
|
static DWORD checkpoint = 1;
|
||||||
|
service_status.dwCurrentState = state;
|
||||||
|
service_status.dwWin32ExitCode = exitcode;
|
||||||
|
service_status.dwWaitHint = wait;
|
||||||
|
if(state == SERVICE_START_PENDING)
|
||||||
|
service_status.dwControlsAccepted = 0;
|
||||||
|
else service_status.dwControlsAccepted = SERVICE_ACCEPT_STOP;
|
||||||
|
if(state == SERVICE_RUNNING || state == SERVICE_STOPPED)
|
||||||
|
service_status.dwCheckPoint = 0;
|
||||||
|
else service_status.dwCheckPoint = checkpoint++;
|
||||||
|
SetServiceStatus(service_status_handle, &service_status);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Service control handler. Called by serviceControlManager when a control
|
||||||
|
* code is sent to the service (with ControlService).
|
||||||
|
* @param ctrl: control code
|
||||||
|
*/
|
||||||
|
static void
|
||||||
|
hdlr(DWORD ctrl)
|
||||||
|
{
|
||||||
|
if(ctrl == SERVICE_CONTROL_STOP) {
|
||||||
|
report_status(SERVICE_STOP_PENDING, NO_ERROR, 0);
|
||||||
|
/* send signal to stop */
|
||||||
|
SetEvent(service_stop_event);
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
/* ctrl == SERVICE_CONTROL_INTERROGATE or whatever */
|
||||||
|
/* update status */
|
||||||
|
report_status(service_status.dwCurrentState, NO_ERROR, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* report event to system event log
|
||||||
|
* For use during startup and shutdown.
|
||||||
|
* @param str: the error
|
||||||
|
*/
|
||||||
|
static void
|
||||||
|
reportev(const char* str)
|
||||||
|
{
|
||||||
|
char b[256];
|
||||||
|
HANDLE* s;
|
||||||
|
LPCTSTR msg = b;
|
||||||
|
/* print quickly to keep GetLastError value */
|
||||||
|
snprintf(b, sizeof(b), "%s: %s (%d)", SERVICE_NAME,
|
||||||
|
str, (int)GetLastError());
|
||||||
|
s = RegisterEventSource(NULL, SERVICE_NAME);
|
||||||
|
if(!s) return;
|
||||||
|
ReportEvent(s, /* event log */
|
||||||
|
EVENTLOG_ERROR_TYPE, /* event type */
|
||||||
|
0, /* event category */
|
||||||
|
MSG_GENERIC_ERR, /* event ID (from gen_msg.mc) */
|
||||||
|
NULL, /* user security context */
|
||||||
|
1, /* numstrings */
|
||||||
|
0, /* binary size */
|
||||||
|
&msg, /* strings */
|
||||||
|
NULL); /* binary data */
|
||||||
|
DeregisterEventSource(s);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Init service. Keeps calling status pending to tell service control
|
||||||
|
* manager that this process is not hanging.
|
||||||
|
* @param d: daemon returned here.
|
||||||
|
* @param c: config file returned here.
|
||||||
|
* @return false if failed.
|
||||||
|
*/
|
||||||
|
static int
|
||||||
|
service_init(struct daemon** d, struct config_file** c)
|
||||||
|
{
|
||||||
|
struct config_file* cfg = NULL;
|
||||||
|
struct daemon* daemon = NULL;
|
||||||
|
const char* cfgfile = CONFIGFILE;
|
||||||
|
|
||||||
|
/* create daemon */
|
||||||
|
daemon = daemon_init();
|
||||||
|
if(!daemon) return 0;
|
||||||
|
report_status(SERVICE_START_PENDING, NO_ERROR, 3000);
|
||||||
|
|
||||||
|
/* read config */
|
||||||
|
cfg = config_create();
|
||||||
|
if(!cfg) return 0;
|
||||||
|
if(!config_read(cfg, cfgfile, daemon->chroot)) {
|
||||||
|
if(errno != ENOENT) {
|
||||||
|
/* could not read config file */
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
/* could not open config file, using defaults */
|
||||||
|
}
|
||||||
|
report_status(SERVICE_START_PENDING, NO_ERROR, 3000);
|
||||||
|
|
||||||
|
/* apply settings and init */
|
||||||
|
verbosity = cfg->verbosity;
|
||||||
|
if(cfg->directory && cfg->directory[0]) {
|
||||||
|
if(chdir(cfg->directory)) return 0;
|
||||||
|
verbose(VERB_QUERY, "chdir to %s", cfg->directory);
|
||||||
|
}
|
||||||
|
log_init(cfg->logfile, cfg->use_syslog, cfg->chrootdir);
|
||||||
|
report_status(SERVICE_START_PENDING, NO_ERROR, 3000);
|
||||||
|
daemon_apply_cfg(daemon, cfg);
|
||||||
|
|
||||||
|
/* open ports */
|
||||||
|
/* keep reporting that we are busy starting */
|
||||||
|
report_status(SERVICE_START_PENDING, NO_ERROR, 3000);
|
||||||
|
if(!daemon_open_shared_ports(daemon)) return 0;
|
||||||
|
report_status(SERVICE_START_PENDING, NO_ERROR, 3000);
|
||||||
|
|
||||||
|
*d = daemon;
|
||||||
|
*c = cfg;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The main function for the service.
|
||||||
|
* Called by the services API when starting unbound on windows in background.
|
||||||
|
* Arguments could have been present in the string 'path'.
|
||||||
|
* @param argc: nr args
|
||||||
|
* @param argv: arg text.
|
||||||
|
*/
|
||||||
|
static void
|
||||||
|
service_main(DWORD ATTR_UNUSED(argc), LPTSTR* ATTR_UNUSED(argv))
|
||||||
|
{
|
||||||
|
struct config_file* cfg = NULL;
|
||||||
|
struct daemon* daemon = NULL;
|
||||||
|
|
||||||
|
service_status_handle = RegisterServiceCtrlHandler(SERVICE_NAME,
|
||||||
|
(LPHANDLER_FUNCTION)hdlr);
|
||||||
|
if(!service_status_handle) {
|
||||||
|
reportev("Could not RegisterServiceCtrlHandler");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
service_status.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
|
||||||
|
service_status.dwServiceSpecificExitCode = 0;
|
||||||
|
|
||||||
|
/* we are now starting up */
|
||||||
|
report_status(SERVICE_START_PENDING, NO_ERROR, 3000);
|
||||||
|
if(!service_init(&daemon, &cfg)) {
|
||||||
|
reportev("Could not service_init");
|
||||||
|
report_status(SERVICE_STOPPED, NO_ERROR, 0);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* event that gets signalled when we want to quit; it
|
||||||
|
* should get registered in the worker-0 waiting loop. */
|
||||||
|
service_stop_event = CreateEvent(NULL, 1, 0, NULL);
|
||||||
|
if(!service_stop_event) {
|
||||||
|
reportev("Could not CreateEvent");
|
||||||
|
report_status(SERVICE_STOPPED, NO_ERROR, 0);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* SetServiceStatus SERVICE_RUNNING;*/
|
||||||
|
report_status(SERVICE_RUNNING, NO_ERROR, 0);
|
||||||
|
|
||||||
|
/* daemon_fork(daemon) , but wait on stop event ! */
|
||||||
|
/* instead of this while loop */
|
||||||
|
|
||||||
|
/* wait until exit */
|
||||||
|
while(1) {
|
||||||
|
WaitForSingleObject(service_stop_event, INFINITE);
|
||||||
|
report_status(SERVICE_STOPPED, NO_ERROR, 0);
|
||||||
|
FILE* out = fopen("C:\\output.txt", "a");
|
||||||
|
fprintf(out, "stopped!\n");
|
||||||
|
fclose(out);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
verbose(VERB_ALGO, "cleanup.");
|
||||||
|
daemon_cleanup(daemon);
|
||||||
|
config_delete(cfg);
|
||||||
|
daemon_delete(daemon);
|
||||||
|
report_status(SERVICE_STOPPED, NO_ERROR, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** start the service */
|
||||||
|
static void
|
||||||
|
service_start()
|
||||||
|
{
|
||||||
|
SERVICE_TABLE_ENTRY myservices[2] = {
|
||||||
|
{SERVICE_NAME, (LPSERVICE_MAIN_FUNCTION)service_main},
|
||||||
|
{NULL, NULL} };
|
||||||
|
/* this call returns when service has stopped. */
|
||||||
|
if(!StartServiceCtrlDispatcher(myservices)) {
|
||||||
|
reportev("Could not StartServiceCtrlDispatcher");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
wsvc_command_option(const char* str)
|
||||||
|
{
|
||||||
|
if(strcmp(str, "install") == 0)
|
||||||
|
wsvc_install();
|
||||||
|
else if(strcmp(str, "remove") == 0)
|
||||||
|
wsvc_remove();
|
||||||
|
else if(strcmp(str, "service") == 0)
|
||||||
|
service_start();
|
||||||
|
else fatal_exit("unknown option: %s", str);
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
56
winrc/win_svc.h
Normal file
56
winrc/win_svc.h
Normal file
|
|
@ -0,0 +1,56 @@
|
||||||
|
/*
|
||||||
|
* winrc/win_svc.h - windows services API implementation for unbound
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009, NLnet Labs. All rights reserved.
|
||||||
|
*
|
||||||
|
* This software is open source.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
*
|
||||||
|
* Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
|
* and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* Neither the name of the NLNET LABS nor the names of its contributors may
|
||||||
|
* be used to endorse or promote products derived from this software without
|
||||||
|
* specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||||
|
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \file
|
||||||
|
*
|
||||||
|
* This file contains functions to integrate with the windows services API.
|
||||||
|
* This means it handles the commandline switches to install and remove
|
||||||
|
* the service (via CreateService and DeleteService), it handles
|
||||||
|
* the ServiceMain() main service entry point when started as a service,
|
||||||
|
* and it handles the Handler[_ex]() to process requests to the service
|
||||||
|
* (such as start and stop and status).
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef WINRC_WIN_SVC_H
|
||||||
|
#define WINRC_WIN_SVC_H
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle commandline service for windows.
|
||||||
|
* @param str: option
|
||||||
|
*/
|
||||||
|
void wsvc_command_option(const char* str);
|
||||||
|
|
||||||
|
#endif /* WINRC_WIN_SVC_H */
|
||||||
Loading…
Reference in a new issue